Open Bug 2021155 Opened 3 months ago Updated 13 days ago

Investigate reworking property dependency tracking

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: emilio, Unassigned)

References

Details

This came up recently in the context of attr(), because attr() can introduce variable references in any property which causes our tracking to be a bit more complicated. It doesn't fundamentally change the constraints we're working with, so I don't think it's a blocker, but dealing with it is complicated because our system to deal with property dependencies is very ad-hoc (mostly historically, due to how CSS has evolved).

  • Before custom properties, we only had early and late properties. So a hard-coded list of early properties was more than reasonable.
  • Custom properties initially didn't have any non-custom dependency, but could have cycles between them, and influence any non-custom property, so dealing with custom properties first, then with non-custom ones was reasonably.
  • Then the problems begin: Registered custom properties can have em / lh / colors which introduce dependencies on non-custom properties. So we "defer" those.

The end result is the current messy state where we try to process custom properties upfront, but we defer some, then we process the prioritary properties, then the deferred ones, then the rest.

Given more and more things are adding more and more dependencies (proper calc() math would introduce dependencies from a lot of integer-taking properties to things like font, think font-weight: calc(1em / 1px), etc...), it might make sense to generalize this a little bit? Some context:

It might be worth doing some unified dependency / cycle tracking. Right now the "non-custom" dependency tracking is in here, and the custom one is a bit spread around.

I think chrome has done some work in this area and it might be worth looking if they have something sound or more ad-hoc.

Big concern here of course would be performance...

See Also: → 2033678
See Also: → 2026785
You need to log in before you can comment on or make changes to this bug.