mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibWeb: Store CSSStyleProperties properties in "specified order"
The spec requires us to store properties in their shorthand-expanded form and in the "specified" order, removing duplicates prefering based on "cascading order". We already enforced this in `set_property` but not at creation time (e.g. in stylesheets) or in `set_css_text` (e.g. updating style attribute). This commit enforces the spec requirements at all the relevant points. We no longer include logical properties in the return value of `getComputedStyle` as they are mapped to their physical equivalents in `StyleComputer::for_each_property_expanding_shorthands`, but resolving that requires a relatively large rework of how we handle logical properties, (namely moving when we map them to their physical equivalents from parse time to style computation time). This also exposes two false positive tests in wpt-import/css/cssom/border-shorthand-serialization.html related to us not yet supporting the border-image css property.
This commit is contained in:
parent
048a0c9106
commit
3421cd76fa
Notes:
github-actions[bot]
2025-06-09 09:44:59 +00:00
Author: https://github.com/Calme1709
Commit: 3421cd76fa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4990
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/konradekk
7 changed files with 84 additions and 50 deletions
|
@ -63,6 +63,7 @@ public:
|
|||
|
||||
private:
|
||||
CSSStyleProperties(JS::Realm&, Computed, Readonly, Vector<StyleProperty> properties, HashMap<FlyString, StyleProperty> custom_properties, Optional<DOM::ElementReference>);
|
||||
static Vector<StyleProperty> convert_declarations_to_specified_order(Vector<StyleProperty>&);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue