mirror of
https://github.com/servo/servo.git
synced 2025-07-25 16:20:36 +01:00
Auto merge of #9503 - glennw:fix-text-node-opacity, r=pcwalton
Ensure that text nodes don't inherit opacity. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9503) <!-- Reviewable:end -->
This commit is contained in:
commit
a9f6ab2153
4 changed files with 71 additions and 0 deletions
|
@ -6958,6 +6958,12 @@ pub fn modify_style_for_text(style: &mut Arc<ComputedValues>) {
|
||||||
padding.padding_bottom = computed::LengthOrPercentage::Length(Au(0));
|
padding.padding_bottom = computed::LengthOrPercentage::Length(Au(0));
|
||||||
padding.padding_left = 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.
|
/// Adjusts the `margin` property as necessary to account for the text of an `input` element.
|
||||||
|
|
|
@ -4608,6 +4608,18 @@
|
||||||
"url": "/_mozilla/css/text_justify_none_a.html"
|
"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": [
|
"css/text_overflow_a.html": [
|
||||||
{
|
{
|
||||||
"path": "css/text_overflow_a.html",
|
"path": "css/text_overflow_a.html",
|
||||||
|
@ -10724,6 +10736,18 @@
|
||||||
"url": "/_mozilla/css/text_justify_none_a.html"
|
"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": [
|
"css/text_overflow_a.html": [
|
||||||
{
|
{
|
||||||
"path": "css/text_overflow_a.html",
|
"path": "css/text_overflow_a.html",
|
||||||
|
|
21
tests/wpt/mozilla/tests/css/text_node_opacity.html
Normal file
21
tests/wpt/mozilla/tests/css/text_node_opacity.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel='match' href='text_node_opacity_ref.html'>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/ahem.css">
|
||||||
|
<style type="text/css">
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 100px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
opacity: 0.5;
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>A</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
20
tests/wpt/mozilla/tests/css/text_node_opacity_ref.html
Normal file
20
tests/wpt/mozilla/tests/css/text_node_opacity_ref.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style type="text/css">
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
position: absolute;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
opacity: 0.5;
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue