Title: [161814] trunk
Revision
161814
Author
[email protected]
Date
2014-01-12 10:55:33 -0800 (Sun, 12 Jan 2014)

Log Message

REGRESSION(r160806): line-height is not applied when only present in :link style.
<http://webkit.org/b/126839>
<rdar://problem/15799899>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/css/line-height-link-style.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::CascadedProperties::Property::apply):

    Use the CSSValue for SelectorChecker::MatchLink when applying
    style inside a link.

LayoutTests:

* fast/css/line-height-link-style-expected.txt: Added.
* fast/css/line-height-link-style.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (161813 => 161814)


--- trunk/LayoutTests/ChangeLog	2014-01-12 18:47:36 UTC (rev 161813)
+++ trunk/LayoutTests/ChangeLog	2014-01-12 18:55:33 UTC (rev 161814)
@@ -1,3 +1,14 @@
+2014-01-12  Andreas Kling  <[email protected]>
+
+        REGRESSION(r160806): line-height is not applied when only present in :link style.
+        <http://webkit.org/b/126839>
+        <rdar://problem/15799899>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/css/line-height-link-style-expected.txt: Added.
+        * fast/css/line-height-link-style.html: Added.
+
 2014-01-11  Brent Fulgham  <[email protected]>
 
         [WebGL] Correct uniform input validation for texture sampler uniforms

Added: trunk/LayoutTests/fast/css/line-height-link-style-expected.txt (0 => 161814)


--- trunk/LayoutTests/fast/css/line-height-link-style-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/line-height-link-style-expected.txt	2014-01-12 18:55:33 UTC (rev 161814)
@@ -0,0 +1,11 @@
+This test verifies that line-height gets applied from link-only style.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS regularComputedStyle.lineHeight is '100px'
+PASS linkComputedStyle.lineHeight is '200px'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/line-height-link-style.html (0 => 161814)


--- trunk/LayoutTests/fast/css/line-height-link-style.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/line-height-link-style.html	2014-01-12 18:55:33 UTC (rev 161814)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+<style>
+a { line-height: 100px }
+a:link { line-height: 200px }
+</style>
+</head>
+<body>
+<div id="gunk">
+    <a id="a_regular">regular anchor</a>
+    <a id="a_link" href="" anchor</a>
+</div>
+<script>
+
+description("This test verifies that line-height gets applied from link-only style.");
+
+var regularComputedStyle = window.getComputedStyle(document.getElementById("a_regular"));
+var linkComputedStyle = window.getComputedStyle(document.getElementById("a_link"));
+
+shouldBe("regularComputedStyle.lineHeight", "'100px'");
+shouldBe("linkComputedStyle.lineHeight", "'200px'");
+
+document.getElementById("gunk").remove();
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (161813 => 161814)


--- trunk/Source/WebCore/ChangeLog	2014-01-12 18:47:36 UTC (rev 161813)
+++ trunk/Source/WebCore/ChangeLog	2014-01-12 18:55:33 UTC (rev 161814)
@@ -1,3 +1,19 @@
+2014-01-12  Andreas Kling  <[email protected]>
+
+        REGRESSION(r160806): line-height is not applied when only present in :link style.
+        <http://webkit.org/b/126839>
+        <rdar://problem/15799899>
+
+        Reviewed by Antti Koivisto.
+
+        Test: fast/css/line-height-link-style.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::CascadedProperties::Property::apply):
+
+            Use the CSSValue for SelectorChecker::MatchLink when applying
+            style inside a link.
+
 2014-01-12  David Kilzer  <[email protected]>
 
         [iOS] Fix link errors for iOS: Part 3

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (161813 => 161814)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2014-01-12 18:47:36 UTC (rev 161813)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2014-01-12 18:55:33 UTC (rev 161814)
@@ -4252,8 +4252,8 @@
 
     // FIXME: It would be nice if line-height were less of a special snowflake.
     if (id == CSSPropertyLineHeight) {
-        if (cssValue[0])
-            state.setLineHeightValue(cssValue[0]);
+        if (auto value = state.style()->insideLink() == NotInsideLink ? cssValue[0] : cssValue[SelectorChecker::MatchLink])
+            state.setLineHeightValue(value);
         return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to