Skip to content

Commit

Permalink
LibWeb/CSS: Replace Parser "current property" with a stack of contexts
Browse files Browse the repository at this point in the history
`current_property_id()` is insufficient to determine if a quirk is
allowed. For example, unitless lengths are allowed in certain
properties, but NOT if they are inside a calc() or other function. It's
also incorrect when we are parsing a longhand inside a shorthand. So
instead, replace that with a stack of value-parsing contexts. For now,
this is either properties or CSS functions, but in future can be
expanded to include media features and other places.

This lets us disallow quirks inside functions, like we're supposed to.

It also lays the groundwork for being able to more easily determine
what type a percentage inside a calculation should become, as this is
based on the same stack of contexts.
  • Loading branch information
AtkinsSJ committed Jan 8, 2025
1 parent ba43dfe commit 33d36c4
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 78 deletions.
Loading

0 comments on commit 33d36c4

Please sign in to comment.