diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index ac6722b6321..46d121c4fb3 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -6958,6 +6958,12 @@ pub fn modify_style_for_text(style: &mut Arc) { padding.padding_bottom = computed::LengthOrPercentage::Length(Au(0)); padding.padding_left = computed::LengthOrPercentage::Length(Au(0)); } + + if style.effects.opacity != 1.0 { + let mut style = Arc::make_mut(style); + let mut effects = Arc::make_mut(&mut style.effects); + effects.opacity = 1.0; + } } /// Adjusts the `margin` property as necessary to account for the text of an `input` element. diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 3926a713fc3..92a73d95a49 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -4608,6 +4608,18 @@ "url": "/_mozilla/css/text_justify_none_a.html" } ], + "css/text_node_opacity.html": [ + { + "path": "css/text_node_opacity.html", + "references": [ + [ + "/_mozilla/css/text_node_opacity_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/text_node_opacity.html" + } + ], "css/text_overflow_a.html": [ { "path": "css/text_overflow_a.html", @@ -10724,6 +10736,18 @@ "url": "/_mozilla/css/text_justify_none_a.html" } ], + "css/text_node_opacity.html": [ + { + "path": "css/text_node_opacity.html", + "references": [ + [ + "/_mozilla/css/text_node_opacity_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/text_node_opacity.html" + } + ], "css/text_overflow_a.html": [ { "path": "css/text_overflow_a.html", diff --git a/tests/wpt/mozilla/tests/css/text_node_opacity.html b/tests/wpt/mozilla/tests/css/text_node_opacity.html new file mode 100644 index 00000000000..6bb8d9c091c --- /dev/null +++ b/tests/wpt/mozilla/tests/css/text_node_opacity.html @@ -0,0 +1,21 @@ + + + + + + + + +
A
+ + diff --git a/tests/wpt/mozilla/tests/css/text_node_opacity_ref.html b/tests/wpt/mozilla/tests/css/text_node_opacity_ref.html new file mode 100644 index 00000000000..0d1bfeaca47 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/text_node_opacity_ref.html @@ -0,0 +1,20 @@ + + + + + + +
+ +