mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibWeb: Make CSS 'An+B' parsing spec-compliant
Parsing this pattern from CSS tokens turns out to be slightly crazy, but thankfully well documented in the spec. The spec lists the cases in order of simple -> complicated, but this would cause problems in code, since `<n-dimension> <signed-.integer>` would never by reached, as `<n-dimension>` comes before. Instead, I have grouped them by their first token. Also renamed the NthChildPattern class to ANPlusBPattern, to match spec terminology.
This commit is contained in:
parent
8d0ff98eff
commit
6034fc0ee6
7 changed files with 333 additions and 92 deletions
|
@ -54,7 +54,7 @@ String Token::to_debug_string() const
|
|||
case Type::Number:
|
||||
builder.append("Number: ");
|
||||
builder.append(m_value.to_string());
|
||||
builder.append(m_unit.to_string());
|
||||
builder.append(m_number_type == NumberType::Integer ? " (int)" : " (float)");
|
||||
return builder.to_string();
|
||||
case Type::Percentage:
|
||||
builder.append("Percentage: ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue