diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-08 03:39:41 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-08 03:39:41 +0530 |
commit | eda8784c34012b1916b524fb7afd7707c795c5e7 (patch) | |
tree | af0a479f0e4030104aaf259d950e958cd77ef235 | |
parent | 1af756c07fc2a0610c455b659890790b35b2ef03 (diff) | |
parent | b8971867f8b1c0b742c7eab07d76054d5aa573c7 (diff) | |
download | servo-eda8784c34012b1916b524fb7afd7707c795c5e7.tar.gz servo-eda8784c34012b1916b524fb7afd7707c795c5e7.zip |
Auto merge of #10438 - KiChjang:text-decoration-fix, r=mbrubeck
Properly inherit text decorations
Fixes #8684.
Fixes #8783.
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10438)
<!-- Reviewable:end -->
14 files changed, 62 insertions, 52 deletions
diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 290e048afdd..46bc02823d2 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -2314,30 +2314,24 @@ pub mod longhands { } fn derive<Cx: TContext>(context: &Cx) -> computed_value::T { - // Start with no declarations if this is a block; otherwise, start with the - // declarations in effect and add in the text decorations that this inline specifies. + // Start with no declarations if this is an atomic inline-level box; otherwise, start with the + // declarations in effect and add in the text decorations that this block specifies. let mut result = match context.style().get_box().clone_display() { - super::display::computed_value::T::inline => { - context.inherited_style().get_inheritedtext().clone__servo_text_decorations_in_effect() - } - _ => { - SpecifiedValue { - underline: None, - overline: None, - line_through: None, - } - } + super::display::computed_value::T::inline_block | + super::display::computed_value::T::inline_table => SpecifiedValue { + underline: None, + overline: None, + line_through: None, + }, + _ => context.inherited_style().get_inheritedtext().clone__servo_text_decorations_in_effect() }; - if result.underline.is_none() { - result.underline = maybe(context.style().get_text().has_underline(), context) - } - if result.overline.is_none() { - result.overline = maybe(context.style().get_text().has_overline(), context) - } - if result.line_through.is_none() { - result.line_through = maybe(context.style().get_text().has_line_through(), context) - } + result.underline = maybe(context.style().get_text().has_underline() + || result.underline.is_some(), context); + result.overline = maybe(context.style().get_text().has_overline() + || result.overline.is_some(), context); + result.line_through = maybe(context.style().get_text().has_line_through() + || result.line_through.is_some(), context); result } diff --git a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-006.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-006.htm.ini deleted file mode 100644 index b888ea98254..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-006.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[text-decoration-applies-to-006.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-008.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-008.htm.ini deleted file mode 100644 index beaaae03b5c..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-008.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[text-decoration-applies-to-008.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-009.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-009.htm.ini deleted file mode 100644 index 308007c79e5..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-009.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[text-decoration-applies-to-009.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-010.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-010.htm.ini deleted file mode 100644 index 8167d1824c8..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-010.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[text-decoration-applies-to-010.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-011.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-011.htm.ini deleted file mode 100644 index 3081b9a7b93..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/text-decoration-applies-to-011.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[text-decoration-applies-to-011.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html.ini b/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html.ini deleted file mode 100644 index 4ab40584c66..00000000000 --- a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-a.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[001-a.html] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html.ini b/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html.ini deleted file mode 100644 index 649e95c47ba..00000000000 --- a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-q.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[001-q.html] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html.ini b/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html.ini deleted file mode 100644 index f6fe434b3aa..00000000000 --- a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-s.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[001-s.html] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml.ini b/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml.ini deleted file mode 100644 index 55ede6bf25d..00000000000 --- a/tests/wpt/metadata/html/rendering/non-replaced-elements/phrasing-content-0/font-element-text-decoration-color/001-x.xhtml.ini +++ /dev/null @@ -1,3 +0,0 @@ -[001-x.xhtml] - type: reftest - expected: FAIL diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 7d7df0a75ca..3b0086fe772 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -3299,6 +3299,18 @@ "url": "/_mozilla/css/no_image_background_a.html" } ], + "css/non-inline-block-resets-underline-property.html": [ + { + "path": "css/non-inline-block-resets-underline-property.html", + "references": [ + [ + "/_mozilla/css/non-inline-block-resets-underline-property-ref.html", + "==" + ] + ], + "url": "/_mozilla/css/non-inline-block-resets-underline-property.html" + } + ], "css/noscript.html": [ { "path": "css/noscript.html", @@ -9769,6 +9781,18 @@ "url": "/_mozilla/css/no_image_background_a.html" } ], + "css/non-inline-block-resets-underline-property.html": [ + { + "path": "css/non-inline-block-resets-underline-property.html", + "references": [ + [ + "/_mozilla/css/non-inline-block-resets-underline-property-ref.html", + "==" + ] + ], + "url": "/_mozilla/css/non-inline-block-resets-underline-property.html" + } + ], "css/noscript.html": [ { "path": "css/noscript.html", diff --git a/tests/wpt/mozilla/meta/css/text_decoration_propagation_a.html.ini b/tests/wpt/mozilla/meta/css/text_decoration_propagation_a.html.ini deleted file mode 100644 index 12d7ad7b519..00000000000 --- a/tests/wpt/mozilla/meta/css/text_decoration_propagation_a.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[text_decoration_propagation_a.html] - type: reftest - expected: FAIL - bug: https://github.com/servo/servo/issues/8783 diff --git a/tests/wpt/mozilla/tests/css/non-inline-block-resets-underline-property-ref.html b/tests/wpt/mozilla/tests/css/non-inline-block-resets-underline-property-ref.html new file mode 100644 index 00000000000..deb5cddf31a --- /dev/null +++ b/tests/wpt/mozilla/tests/css/non-inline-block-resets-underline-property-ref.html @@ -0,0 +1,11 @@ +<!doctype html> +<meta charset="utf-8"> +<title></title> +<body> +<style> +.u { text-decoration: underline; } +</style> +<div class='u'>a</div> +<div class='u'>b</div> +<div class='u'>c</div> +</body> diff --git a/tests/wpt/mozilla/tests/css/non-inline-block-resets-underline-property.html b/tests/wpt/mozilla/tests/css/non-inline-block-resets-underline-property.html new file mode 100644 index 00000000000..6b7f0c947fe --- /dev/null +++ b/tests/wpt/mozilla/tests/css/non-inline-block-resets-underline-property.html @@ -0,0 +1,12 @@ +<!doctype html> +<meta charset="utf-8"> +<title></title> +<link rel="match" href="non-inline-block-resets-underline-property-ref.html"> +<body> +<style> +.u { text-decoration: underline; } +</style> +<div class='u'>a</div> +<div class='u'><div>b</div></div> +<div class='u'><div style="display:inline">c</div></div> +</body> |