Title: [130750] trunk
Revision
130750
Author
[email protected]
Date
2012-10-09 04:42:11 -0700 (Tue, 09 Oct 2012)

Log Message

Text decorations specified on the containing block are not properly applied when ::first-line is present.
https://bugs.webkit.org/show_bug.cgi?id=93829

Patch by Arpita Bahuguna <[email protected]> on 2012-10-09
Reviewed by Abhishek Arya.

Source/WebCore:

If a container's style and its pseudo :first-line style have unique
text-decorations specified for them, only the :first-line text-decoarations
were being applied.

The uploaded patch intends to first compute the text decoration colors
for the containing box, followed by that of the first-line (if specified).

This thus avoids the condition wherein our containing box's text-decorations
were not getting applied at all since initially we were only computing
for the first-line style.

Test: fast/css/text-decorations-on-first-line-and-containing-block.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration):
getTextDecorationColors() is first called for computing the containing box's
text-decoration values and then for first-line style's text-decorations,
if specified.

LayoutTests:

* fast/css/text-decorations-on-first-line-and-containing-block-expected.html: Added.
* fast/css/text-decorations-on-first-line-and-containing-block.html: Added.
Tests added for verifying the behavior of text-decorations when specified
both for the ::first-line as well as its containing block.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (130749 => 130750)


--- trunk/LayoutTests/ChangeLog	2012-10-09 11:33:42 UTC (rev 130749)
+++ trunk/LayoutTests/ChangeLog	2012-10-09 11:42:11 UTC (rev 130750)
@@ -1,3 +1,15 @@
+2012-10-09  Arpita Bahuguna  <[email protected]>
+
+        Text decorations specified on the containing block are not properly applied when ::first-line is present.
+        https://bugs.webkit.org/show_bug.cgi?id=93829
+
+        Reviewed by Abhishek Arya.
+
+        * fast/css/text-decorations-on-first-line-and-containing-block-expected.html: Added.
+        * fast/css/text-decorations-on-first-line-and-containing-block.html: Added.
+        Tests added for verifying the behavior of text-decorations when specified
+        both for the ::first-line as well as its containing block.
+
 2012-10-09  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r130746.

Added: trunk/LayoutTests/fast/css/text-decorations-on-first-line-and-containing-block-expected.html (0 => 130750)


--- trunk/LayoutTests/fast/css/text-decorations-on-first-line-and-containing-block-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/text-decorations-on-first-line-and-containing-block-expected.html	2012-10-09 11:42:11 UTC (rev 130750)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+p { text-decoration: underline; }
+#firstline1 { color: green; }
+#firstline2 { color: green; text-decoration: overline; }
+#firstline3 { color: green; text-decoration: underline; }
+</style>
+</head>
+<body>
+<div>Test for Bugzilla <a href="" 93829</a>: Text decorations specified on the containing block are not properly applied when ::first-line is present.</div>
+<br/>
+<div>The following text should have the first line text in green color with an underline in black color. The remainder of the text should have black underline.</div>
+<p>
+<span id="firstline1">Lorem ipsum dolor set amet. Lorem ipsum </span><br/><span>dolor set amet. Lorem ipsum dolor set amet.</span>
+</p>
+<div>The following text should have the first line text in green color with an overline in green color and an underline in black color whereas the remainder of the text should only have an underline in black color. </div>
+<p>
+<span id="firstline2">Lorem ipsum dolor set amet. Lorem ipsum </span><br/><span>dolor set amet. Lorem ipsum dolor set amet.</span>
+</p>
+<div>The following text should have the first line text in green color with an underline in green color whereas the remainder of the text should also have an underline in black color. </div>
+<p>
+<span id="firstline3">Lorem ipsum dolor set amet. Lorem ipsum </span><br/><span>dolor set amet. Lorem ipsum dolor set amet.</span>
+</p>
+</body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/fast/css/text-decorations-on-first-line-and-containing-block.html (0 => 130750)


--- trunk/LayoutTests/fast/css/text-decorations-on-first-line-and-containing-block.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/text-decorations-on-first-line-and-containing-block.html	2012-10-09 11:42:11 UTC (rev 130750)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#parent1, #parent2, #parent3 { text-decoration: underline;}
+#parent1:first-line { color: green; }
+#parent2:first-line {color: green; text-decoration: overline;}
+#parent3:first-line {color: green; text-decoration: underline;}
+</style>
+</head>
+<body>
+<div>Test for Bugzilla <a href="" 93829</a>: Text decorations specified on the containing block are not properly applied when ::first-line is present.</div>
+<br/>
+<div>The following text should have the first line text in green color with an underline in black color. The remainder of the text should have black underline.</div>
+<p id="parent1">Lorem ipsum dolor set amet. Lorem ipsum <br/>dolor set amet. Lorem ipsum dolor set amet.</p>
+<div>The following text should have the first line text in green color with an overline in green color and an underline in black color whereas the remainder of the text should only have an underline in black color. </div>
+<p id="parent2">Lorem ipsum dolor set amet. Lorem ipsum <br/>dolor set amet. Lorem ipsum dolor set amet.</p>
+<div>The following text should have the first line text in green color with an underline in green color whereas the remainder of the text should also have an underline in black color. </div>
+<p id="parent3">Lorem ipsum dolor set amet. Lorem ipsum <br/>dolor set amet. Lorem ipsum dolor set amet.</p>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (130749 => 130750)


--- trunk/Source/WebCore/ChangeLog	2012-10-09 11:33:42 UTC (rev 130749)
+++ trunk/Source/WebCore/ChangeLog	2012-10-09 11:42:11 UTC (rev 130750)
@@ -1,3 +1,29 @@
+2012-10-09  Arpita Bahuguna  <[email protected]>
+
+        Text decorations specified on the containing block are not properly applied when ::first-line is present.
+        https://bugs.webkit.org/show_bug.cgi?id=93829
+
+        Reviewed by Abhishek Arya.
+
+        If a container's style and its pseudo :first-line style have unique
+        text-decorations specified for them, only the :first-line text-decoarations
+        were being applied.
+
+        The uploaded patch intends to first compute the text decoration colors
+        for the containing box, followed by that of the first-line (if specified).
+
+        This thus avoids the condition wherein our containing box's text-decorations
+        were not getting applied at all since initially we were only computing
+        for the first-line style.
+
+        Test: fast/css/text-decorations-on-first-line-and-containing-block.html
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintDecoration):
+        getTextDecorationColors() is first called for computing the containing box's
+        text-decoration values and then for first-line style's text-decorations,
+        if specified.
+
 2012-10-09  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r130746.

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (130749 => 130750)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2012-10-09 11:33:42 UTC (rev 130749)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2012-10-09 11:42:11 UTC (rev 130750)
@@ -932,7 +932,9 @@
     
     // Get the text decoration colors.
     Color underline, overline, linethrough;
-    renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true, isFirstLineStyle());
+    renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true);
+    if (isFirstLineStyle())
+        renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true, true);
     
     // Use a special function for underlines to get the positioning exactly right.
     bool isPrinting = textRenderer()->document()->printing();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to