diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index e5275a1a1e9..41f5d189615 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -1030,6 +1030,9 @@ void StyleComputer::cascade_declarations( if (important != property.important) continue; + if (pseudo_element.has_value() && !pseudo_element_supports_property(*pseudo_element, property.property_id)) + continue; + if (property.property_id == CSS::PropertyID::All) { set_all_properties(cascaded_properties, element, pseudo_element, property.value, m_document, &match->declaration(), cascade_origin, important, layer_name); continue; @@ -1596,11 +1599,13 @@ GC::Ref StyleComputer::compute_cascaded_values(DOM::Element& // Then we resolve all the CSS custom properties ("variables") for this element: // FIXME: Also resolve !important custom properties, in a second cascade. - HashMap custom_properties; - for (auto& layer : matching_rule_set.author_rules) { - cascade_custom_properties(element, pseudo_element, layer.rules, custom_properties); + if (!pseudo_element.has_value() || pseudo_element_supports_property(*pseudo_element, PropertyID::Custom)) { + HashMap custom_properties; + for (auto& layer : matching_rule_set.author_rules) { + cascade_custom_properties(element, pseudo_element, layer.rules, custom_properties); + } + element.set_custom_properties(pseudo_element, move(custom_properties)); } - element.set_custom_properties(pseudo_element, move(custom_properties)); // Then we apply the declarations from the matched rules in cascade order: diff --git a/Tests/LibWeb/Layout/expected/input-placeholder-with-line-height.txt b/Tests/LibWeb/Layout/expected/input-placeholder-with-line-height.txt index ab58e0f527b..2e42afa5ed8 100644 --- a/Tests/LibWeb/Layout/expected/input-placeholder-with-line-height.txt +++ b/Tests/LibWeb/Layout/expected/input-placeholder-with-line-height.txt @@ -6,8 +6,8 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline "text" BlockContainer at (9,8) content-size 200x82 inline-block [BFC] children: not-inline Box
at (11,9) content-size 196x80 flex-container(row) [FFC] children: not-inline - BlockContainer
at (11,40.5) content-size 98x17 flex-item [BFC] children: inline - frag 0 from TextNode start: 0, length: 11, rect: [11,40.5 89.90625x17] baseline: 13.296875 + BlockContainer
at (11,9) content-size 98x80 flex-item [BFC] children: inline + frag 0 from TextNode start: 0, length: 11, rect: [11,9 89.90625x80] baseline: 44.796875 "placeholder" TextNode <#text> BlockContainer
at (109,9) content-size 98x80 flex-item [BFC] children: inline @@ -19,7 +19,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [8,8 784x84] PaintableWithLines (BlockContainer) [8,7 202x84] PaintableBox (Box
) [9,8 200x82] - PaintableWithLines (BlockContainer
) [11,40.5 98x17] + PaintableWithLines (BlockContainer
) [11,9 98x80] TextPaintable (TextNode<#text>) PaintableWithLines (BlockContainer
) [109,9 98x80] TextPaintable (TextNode<#text>) diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-pseudo/reference/placeholder-excluded-properties-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-pseudo/reference/placeholder-excluded-properties-ref.html new file mode 100644 index 00000000000..0e573cb3d6c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-pseudo/reference/placeholder-excluded-properties-ref.html @@ -0,0 +1,10 @@ + + + + + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-pseudo/placeholder-excluded-properties.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-pseudo/placeholder-excluded-properties.html new file mode 100644 index 00000000000..f25b1063ec9 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-pseudo/placeholder-excluded-properties.html @@ -0,0 +1,22 @@ + +::placeholder should not support 'writing-mode', 'direction', and 'text-orientation' + + + + + + + + diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flexbox_first-letter.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flexbox_first-letter.txt index b470cde2da5..e7b25e88097 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flexbox_first-letter.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flexbox_first-letter.txt @@ -2,5 +2,5 @@ Harness status: OK Found 1 tests -1 Fail -Fail flexbox | first-letter \ No newline at end of file +1 Pass +Pass flexbox | first-letter \ No newline at end of file