Closed Bug 1402217 Opened 8 years ago Closed 8 years ago

stylo: custom property referring variable with cycle dependency is not marked invalid correctly

Categories

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

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: xidorn, Assigned: xidorn)

References

Details

Attachments

(3 files)

Attached file testcase
See the testcase. There are three custom properties in the target element: > --varA: var(--varB); > --varB: var(--varA); > --varC: var(--varB); apparently, all of the three should be invalid, because --varA and --varB forms a dependency cycle, and --varC refers to this cycle. However, stylo fails to mark --varC invalid in this case, but instead inherits it from the parent. Both Gecko and Blink agree on the correct behavior (that --varC computes to its initial value rather than inheriting). Web platform test css/css-variables-1/variable-substitution-variable-declaration.html checks this behavior.
I wouldn't say this is super important, but it is probably something we want to fix for shipping stylo.
Assignee: nobody → xidorn+moz
Attached file another testcase
The current algorithm is actually very unreliable. For a testcase like this, the cycle removal can ignore certain items depending on the order of traversal. Moving declarations around within #outer rule can lead to different result.
Actually, comment 2 and comment 0 are different issues. There is no test for the issue of comment 2 at the moment. I'll file a new bug for that one.
Attached file Servo PR
Please either request uplift or set 57 status to wontfix.
Flags: needinfo?(xidorn+moz)
I don't think it's important to uplift this. It is a behavior change, but mostly for handling error case.
Flags: needinfo?(xidorn+moz)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: