Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate current handling of !important CSS declarations #240

Closed
kasperisager opened this issue May 25, 2020 · 0 comments · Fixed by #282
Closed

Investigate current handling of !important CSS declarations #240

kasperisager opened this issue May 25, 2020 · 0 comments · Fixed by #282
Assignees

Comments

@kasperisager
Copy link
Contributor

When computing styles, Alfa traverses the rule tree (packages/alfa-cascade/src/rule-tree.ts) for every element in order to determine the rules that match an element, in decreasing order of priority. However, style computation currently fails to account for individual property declarations that specify the !important flag. Servo deals with this directly in the rule tree by seemingly splitting out !important declarations into separate nodes in the tree in order to correctly position them: https://doc.servo.org/style/rule_tree/struct.RuleTree.html#method.insert_ordered_rules_with_important. We might need to do something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant