diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 33b88f6b8c0d..bb7f03721898 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -714,7 +714,11 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> } let mut style = (*style).clone(); - properties::modify_style_for_text(&mut style); + match node.get_pseudo_element_type() { + PseudoElementType::Before(_) | + PseudoElementType::After(_) => {} + _ => properties::modify_style_for_text(&mut style) + } let selected_style = node.selected_style(self.style_context()); @@ -950,7 +954,11 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> // Modify the style as necessary. (See the comment in // `properties::modify_style_for_replaced_content()`.) let mut style = node.style(self.style_context()).clone(); - properties::modify_style_for_replaced_content(&mut style); + match node.get_pseudo_element_type() { + PseudoElementType::Before(_) | + PseudoElementType::After(_) => {} + _ => properties::modify_style_for_replaced_content(&mut style) + } // If this is generated content, then we need to initialize the accumulator with the // fragment corresponding to that content. Otherwise, just initialize with the ordinary diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 0bc24d762768..5d637b0f2da0 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -358,6 +358,10 @@ impl LineBreaker { let need_to_merge = match (&mut result.specific, &candidate.specific) { (&mut SpecificFragmentInfo::ScannedText(ref mut result_info), &SpecificFragmentInfo::ScannedText(ref candidate_info)) => { + result.margin.inline_end == Au(0) && + candidate.margin.inline_start == Au(0) && + result.border_padding.inline_end == Au(0) && + candidate.border_padding.inline_start == Au(0) && result_info.selected() == candidate_info.selected() && arc_ptr_eq(&result_info.run, &candidate_info.run) && inline_contexts_are_equal(&result.inline_context, diff --git a/tests/wpt/metadata-css/css-transitions-1_dev/html/pseudo-elements-001.htm.ini b/tests/wpt/metadata-css/css-transitions-1_dev/html/pseudo-elements-001.htm.ini index 784c08016a2a..f786f4bc4ac2 100644 --- a/tests/wpt/metadata-css/css-transitions-1_dev/html/pseudo-elements-001.htm.ini +++ b/tests/wpt/metadata-css/css-transitions-1_dev/html/pseudo-elements-001.htm.ini @@ -5,10 +5,3 @@ [transition padding-left on :after / values] expected: FAIL - - [transition padding-left on :before, changing content / values] - expected: FAIL - - [transition padding-left on :after, changing content / values] - expected: FAIL - diff --git a/tests/wpt/metadata-css/css21_dev/html4/pseudo-elements-001.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/pseudo-elements-001.htm.ini index 784c08016a2a..f786f4bc4ac2 100644 --- a/tests/wpt/metadata-css/css21_dev/html4/pseudo-elements-001.htm.ini +++ b/tests/wpt/metadata-css/css21_dev/html4/pseudo-elements-001.htm.ini @@ -5,10 +5,3 @@ [transition padding-left on :after / values] expected: FAIL - - [transition padding-left on :before, changing content / values] - expected: FAIL - - [transition padding-left on :after, changing content / values] - expected: FAIL - diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 5aa73e955819..815909738ab1 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -4432,6 +4432,30 @@ "url": "/_mozilla/css/pseudo_element_restyle_no_rules.html" } ], + "css/pseudo_element_spacing_margin.html": [ + { + "path": "css/pseudo_element_spacing_margin.html", + "references": [ + [ + "/_mozilla/css/pseudo_element_spacing_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/pseudo_element_spacing_margin.html" + } + ], + "css/pseudo_element_spacing_padding.html": [ + { + "path": "css/pseudo_element_spacing_padding.html", + "references": [ + [ + "/_mozilla/css/pseudo_element_spacing_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/pseudo_element_spacing_padding.html" + } + ], "css/pseudo_inherit.html": [ { "path": "css/pseudo_inherit.html", @@ -13610,6 +13634,30 @@ "url": "/_mozilla/css/pseudo_element_restyle_no_rules.html" } ], + "css/pseudo_element_spacing_margin.html": [ + { + "path": "css/pseudo_element_spacing_margin.html", + "references": [ + [ + "/_mozilla/css/pseudo_element_spacing_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/pseudo_element_spacing_margin.html" + } + ], + "css/pseudo_element_spacing_padding.html": [ + { + "path": "css/pseudo_element_spacing_padding.html", + "references": [ + [ + "/_mozilla/css/pseudo_element_spacing_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/pseudo_element_spacing_padding.html" + } + ], "css/pseudo_inherit.html": [ { "path": "css/pseudo_inherit.html", diff --git a/tests/wpt/mozilla/tests/css/pseudo_element_spacing_margin.html b/tests/wpt/mozilla/tests/css/pseudo_element_spacing_margin.html new file mode 100644 index 000000000000..8ca773655a52 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/pseudo_element_spacing_margin.html @@ -0,0 +1,31 @@ + + +
+ + + + + + |b|