mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Clarify comment about cascading presentational hints
The spec allows us to either treat them as part of the UA origin, or as its own origin before author styles. This second behaviour turns out to be what we are currently doing, which is nice! Funnily enough this was clarified in the spec barely a month after this original comment was written. :^)
This commit is contained in:
parent
bea47a2554
commit
dcf55dd492
Notes:
github-actions[bot]
2024-09-26 06:09:27 +00:00
Author: https://github.com/AtkinsSJ
Commit: dcf55dd492
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1524
1 changed files with 6 additions and 1 deletions
|
@ -1551,7 +1551,12 @@ void StyleComputer::compute_cascaded_values(StyleProperties& style, DOM::Element
|
|||
previous_layer_style = style.clone();
|
||||
cascade_declarations(style, element, pseudo_element, matching_rule_set.user_rules, CascadeOrigin::User, Important::No, previous_origin_style, previous_layer_style);
|
||||
|
||||
// Author presentational hints (NOTE: The spec doesn't say exactly how to prioritize these.)
|
||||
// Author presentational hints
|
||||
// The spec calls this a special "Author presentational hint origin":
|
||||
// "For the purpose of cascading this author presentational hint origin is treated as an independent origin;
|
||||
// however for the purpose of the revert keyword (but not for the revert-layer keyword) it is considered
|
||||
// part of the author origin."
|
||||
// https://drafts.csswg.org/css-cascade-5/#author-presentational-hint-origin
|
||||
previous_origin_style = style.clone();
|
||||
if (!pseudo_element.has_value()) {
|
||||
element.apply_presentational_hints(style);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue