Title: [180471] branches/safari-600.1.4.15-branch
Revision
180471
Author
[email protected]
Date
2015-02-20 18:18:35 -0800 (Fri, 20 Feb 2015)

Log Message

Merged r180150.  rdar://problem/19891984

Modified Paths

Added Paths

Diff

Modified: branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog (180470 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog	2015-02-21 02:18:35 UTC (rev 180471)
@@ -1,3 +1,23 @@
+2015-02-20  Lucas Forschler  <[email protected]>
+
+        Merge r180150
+
+    2015-02-12  David Hyatt  <[email protected]>
+
+            text-underline-position:under has multiple correctness issues
+            https://bugs.webkit.org/show_bug.cgi?id=141528
+
+            Reviewed by Dean Jackson.
+
+            * fast/text/text-underline-first-line-decoration-expected.html: Added.
+            * fast/text/text-underline-first-line-decoration.html: Added.
+            * fast/text/text-underline-position-mixed-fonts-expected.html: Added.
+            * fast/text/text-underline-position-mixed-fonts.html: Added.
+            * fast/text/text-underline-position-subscript-expected.html: Added.
+            * fast/text/text-underline-position-subscript.html: Added.
+            * fast/text/text-underline-vertical-first-line-decoration-expected.html: Added.
+            * fast/text/text-underline-vertical-first-line-decoration.html: Added.
+
 2015-02-20  Babak Shafiei  <[email protected]>
 
         Merge r180364.

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-first-line-decoration-expected.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+<span style="text-decoration:underline">The first line <span style="vertical-align:-20px">has a decoration,</span> but not </span><img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"><span style="text-decoration:underline"> under the image.</span><br>
+The second line should not.
+</p>

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-first-line-decoration.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-first-line-decoration.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.decorate::first-line { text-decoration:underline }
+</style>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+The first line <span style="vertical-align:-20px">has a decoration,</span> but not <img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"> under the image.<br>
+The second line should not.
+</p>

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts-expected.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<body style="overflow:hidden">
+<p>Test to make sure gigantic fonts that aren't inside the text decoration don't affect the position of
+the line. The giant font is invisible (color:transparent) in this test.
+</p>
+
+<span style="text-decoration:underline;-webkit-text-underline-position:under">This text should be underlined just under the descenders.</span> 

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-mixed-fonts.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-mixed-fonts.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<body style="overflow:hidden">
+<p>Test to make sure gigantic fonts that aren't inside the text decoration don't affect the position of
+the line. The giant font is invisible (color:transparent) in this test.
+</p>
+
+<span style="text-decoration:underline;-webkit-text-underline-position:under">This text should be underlined just under the descenders.</span> <span style="font-size:64px; vertical-align:-256px; color:transparent">Should not be underlined.</span>

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-subscript-expected.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-subscript-expected.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.yellow::first-line { color:grey }
+</style>
+</head>
+<body>
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="yellow" style="font-size:40px; padding-top:5px; float:left; text-decoration:underline;-webkit-text-underline-position:under; border:1px dotted orange"><span style="position:relative;">Here is the subscript for this line.</span>
+</p>

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-subscript.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-position-subscript.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-subscript.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-position-subscript.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.yellow::first-line { color:grey }
+</style>
+</head>
+<body>
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="yellow" style="font-size:40px; float:left; text-decoration:underline;-webkit-text-underline-position:under; border:1px dotted orange"><span style="vertical-align:-5px;">Here is the subscript for this line.</span>
+</p>

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration-expected.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-lr; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+<span style="text-decoration:underline">The first line <span style="vertical-align:-20px">has a decoration,</span> but not </span><img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"><span style="text-decoration:underline"> under the image.</span><br>
+The second line should not.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-rl; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+<span style="text-decoration:underline">The first line <span style="vertical-align:-20px">has a decoration,</span> but not </span><img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"><span style="text-decoration:underline"> under the image.</span><br>
+The second line should not.
+</p>

Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html (from rev 180150, trunk/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html) (0 => 180471)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/text-underline-vertical-first-line-decoration.html	2015-02-21 02:18:35 UTC (rev 180471)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<style>
+.decorate::first-line { text-decoration:underline }
+</style>
+</head>
+<body style="overflow:hidden">
+<p>Test to make sure that the decoration line paints properly underneath the subscript.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-lr; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+The first line <span style="vertical-align:-20px">has a decoration,</span> but not <img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"> under the image.<br>
+The second line should not.
+</p>
+
+<p class="decorate" style="-webkit-writing-mode:vertical-rl; margin-right:10px; font-size:24px; float:left;-webkit-text-underline-position:under; border:1px dotted orange">
+The first line <span style="vertical-align:-20px">has a decoration,</span> but not <img style="vertical-align:-100px; height:20px;width:20px;background-color:lime"> under the image.<br>
+The second line should not.
+</p>
\ No newline at end of file

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-02-21 02:18:35 UTC (rev 180471)
@@ -1,3 +1,52 @@
+2015-02-20  Lucas Forschler  <[email protected]>
+
+        Merge r180150
+
+    2015-02-12  David Hyatt  <[email protected]>
+
+            text-underline-position:under has multiple correctness issues
+            https://bugs.webkit.org/show_bug.cgi?id=141528
+
+            Reviewed by Dean Jackson.
+
+            Added a bunch of new tests in fast/text
+
+            * rendering/InlineFlowBox.cpp:
+            (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine):
+            (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine):
+            (WebCore::InlineFlowBox::computeMaxLogicalBottom): Deleted.
+            * rendering/InlineFlowBox.h:
+            These functions have been re-written to take an enclosing renderer that specified the
+            decoration. This way they can properly limit the bottom/top computation to only line boxes
+            that are contained inside the renderer.
+
+            * rendering/InlineTextBox.cpp:
+            (WebCore::InlineTextBox::paintDecoration):
+            Tweak the call to get the decoration colors now that quirks mode has been removed.
+
+            * rendering/RenderElement.cpp:
+            (WebCore::RenderElement::enclosingRendererWithTextDecoration):
+            * rendering/RenderElement.h:
+            New function that finds the enclosing renderer that specified a text decoration. For now
+            this is only used in the "under" position computation, but soon we'll be using it
+            everywhere.
+
+            * rendering/RenderObject.cpp:
+            (WebCore::RenderObject::getTextDecorationColors):
+            * rendering/RenderObject.h:
+            Remove the quirks mode argument, since we were always passing true anyway (making the argument dead).
+
+            * rendering/RootInlineBox.cpp:
+            (WebCore::RootInlineBox::maxLogicalBottom): Deleted.
+            * rendering/RootInlineBox.h:
+            Get rid of these functions and just have InlineTextBoxStyle's computeUnderLineOffset function call
+            the InlineFlowBox functions directly.
+
+            * style/InlineTextBoxStyle.cpp:
+            (WebCore::computeUnderlineOffset):
+            Re-written to fetch the enclosingRendererWithTextDecoration so that it can be passed to the logical top/bottom
+            computation to limit which line boxes get included.
+
 2015-02-20  Dean Jackson  <[email protected]>
 
         <rdar://problem/19450275> Media player updates.

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineFlowBox.cpp (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineFlowBox.cpp	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineFlowBox.cpp	2015-02-21 02:18:35 UTC (rev 180471)
@@ -750,18 +750,45 @@
     }
 }
 
-void InlineFlowBox::computeMaxLogicalBottom(float& maxLogicalBottom) const
+void InlineFlowBox::maxLogicalBottomForTextDecorationLine(float& maxLogicalBottom, const RenderElement* decorationRenderer, TextDecoration textDecoration) const
 {
-    for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
-        if (curr->renderer().isOutOfFlowPositioned())
+    for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+        if (child->renderer().isOutOfFlowPositioned())
             continue; // Positioned placeholders don't affect calculations.
+        
+        if (!(child->lineStyle().textDecorationsInEffect() & textDecoration))
+            continue; // If the text decoration isn't in effect on the child, then it must be outside of |decorationRenderer|'s hierarchy.
+        
+        if (decorationRenderer && decorationRenderer->isRenderInline() && !isAncestorAndWithinBlock(toRenderInline(*decorationRenderer), &child->renderer()))
+            continue;
+        
+        if (child->isInlineFlowBox())
+            toInlineFlowBox(*child).maxLogicalBottomForTextDecorationLine(maxLogicalBottom, decorationRenderer, textDecoration);
+        else {
+            if (child->isInlineTextBox() || child->lineStyle().textDecorationSkip() == TextDecorationSkipNone)
+                maxLogicalBottom = std::max<float>(maxLogicalBottom, child->logicalBottom());
+        }
+    }
+}
 
-        if (descendantsHaveSameLineHeightAndBaseline())
+void InlineFlowBox::minLogicalTopForTextDecorationLine(float& minLogicalTop, const RenderElement* decorationRenderer, TextDecoration textDecoration) const
+{
+    for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+        if (child->renderer().isOutOfFlowPositioned())
+            continue; // Positioned placeholders don't affect calculations.
+        
+        if (!(child->lineStyle().textDecorationsInEffect() & textDecoration))
+            continue; // If the text decoration isn't in effect on the child, then it must be outside of |decorationRenderer|'s hierarchy.
+        
+        if (decorationRenderer && decorationRenderer->isRenderInline() && !isAncestorAndWithinBlock(toRenderInline(*decorationRenderer), &child->renderer()))
             continue;
-
-        maxLogicalBottom = std::max<float>(maxLogicalBottom, curr->logicalBottom());
-        if (curr->isInlineFlowBox())
-            toInlineFlowBox(curr)->computeMaxLogicalBottom(maxLogicalBottom);
+        
+        if (child->isInlineFlowBox())
+            toInlineFlowBox(*child).minLogicalTopForTextDecorationLine(minLogicalTop, decorationRenderer, textDecoration);
+        else {
+            if (child->isInlineTextBox() || child->lineStyle().textDecorationSkip() == TextDecorationSkipNone)
+                minLogicalTop = std::min<float>(minLogicalTop, child->logicalTop());
+        }
     }
 }
 

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineFlowBox.h (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineFlowBox.h	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineFlowBox.h	2015-02-21 02:18:35 UTC (rev 180471)
@@ -293,6 +293,10 @@
 
     void computeReplacedAndTextLineTopAndBottom(LayoutUnit& lineTop, LayoutUnit& lineBottom) const;
     
+    // Used to calculate the underline offset for TextUnderlinePositionUnder.
+    void maxLogicalBottomForTextDecorationLine(float& maxLogicalBottom, const RenderElement* decorationRenderer, TextDecoration) const;
+    void minLogicalTopForTextDecorationLine(float& minLogicalTop, const RenderElement* decorationRenderer, TextDecoration) const;
+
 private:
     virtual bool isInlineFlowBox() const override final { return true; }
     void boxModelObject() const = delete;
@@ -312,9 +316,6 @@
     InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
     InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
 
-    // Maximum logicalBottom among all children of an InlineFlowBox. Used to
-    // calculate the offset for TextUnderlinePositionUnder.
-    void computeMaxLogicalBottom(float& maxLogicalBottom) const;
 private:
     unsigned m_includeLogicalLeftEdge : 1;
     unsigned m_includeLogicalRightEdge : 1;

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineTextBox.cpp (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineTextBox.cpp	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/InlineTextBox.cpp	2015-02-21 02:18:35 UTC (rev 180471)
@@ -946,9 +946,9 @@
     
     // Get the text decoration colors.
     Color underline, overline, linethrough;
-    renderer().getTextDecorationColors(decoration, underline, overline, linethrough, true);
+    renderer().getTextDecorationColors(decoration, underline, overline, linethrough);
     if (isFirstLine())
-        renderer().getTextDecorationColors(decoration, underline, overline, linethrough, true, true);
+        renderer().getTextDecorationColors(decoration, underline, overline, linethrough, true);
     
     // Use a special function for underlines to get the positioning exactly right.
     bool isPrinting = renderer().document().printing();

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.cpp (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.cpp	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.cpp	2015-02-21 02:18:35 UTC (rev 180471)
@@ -1497,4 +1497,22 @@
     return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft));
 }
 
+const RenderElement* RenderElement::enclosingRendererWithTextDecoration(TextDecoration textDecoration, bool firstLine) const
+{
+    const RenderElement* current = this;
+    do {
+        if (current->isRenderBlock())
+            return current;
+        if (!current->isRenderInline() || current->isRubyText())
+            return nullptr;
+        
+        const RenderStyle& styleToUse = firstLine ? current->firstLineStyle() : current->style();
+        if (styleToUse.textDecoration() & textDecoration)
+            return current;
+        current = current->parent();
+    } while (current && (!current->element() || (!isHTMLAnchorElement(*current->element()) && !current->element()->hasTagName(HTMLNames::fontTag))));
+
+    return current;
 }
+
+}

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.h (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.h	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.h	2015-02-21 02:18:35 UTC (rev 180471)
@@ -164,6 +164,9 @@
     void setRenderBoxNeedsLazyRepaint(bool b) { m_renderBoxNeedsLazyRepaint = b; }
     bool renderBoxNeedsLazyRepaint() const { return m_renderBoxNeedsLazyRepaint; }
 
+    
+    const RenderElement* enclosingRendererWithTextDecoration(TextDecoration, bool firstLine) const;
+
 protected:
     enum BaseTypeFlags {
         RenderLayerModelObjectFlag = 1 << 0,

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderObject.cpp (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderObject.cpp	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderObject.cpp	2015-02-21 02:18:35 UTC (rev 180471)
@@ -2169,8 +2169,7 @@
     return result;
 }
 
-void RenderObject::getTextDecorationColors(int decorations, Color& underline, Color& overline,
-                                           Color& linethrough, bool quirksMode, bool firstlineStyle)
+void RenderObject::getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool firstlineStyle)
 {
     RenderObject* curr = this;
     RenderStyle* styleToUse = 0;
@@ -2200,7 +2199,7 @@
         curr = curr->parent();
         if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuation())
             curr = toRenderBlock(curr)->continuation();
-    } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnchorElement(curr->node()) && !curr->node()->hasTagName(fontTag))));
+    } while (curr && decorations && (!curr->node() || (!isHTMLAnchorElement(curr->node()) && !curr->node()->hasTagName(fontTag))));
 
     // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
     if (decorations && curr) {

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderObject.h (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderObject.h	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderObject.h	2015-02-21 02:18:35 UTC (rev 180471)
@@ -725,7 +725,7 @@
     
     virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
 
-    void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool quirksMode = false, bool firstlineStyle = false);
+    void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool firstlineStyle = false);
 
     // Return the RenderLayerModelObject in the container chain which is responsible for painting this object, or 0
     // if painting is root-relative. This is the container that should be passed to the 'forRepaint'

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RootInlineBox.cpp (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RootInlineBox.cpp	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RootInlineBox.cpp	2015-02-21 02:18:35 UTC (rev 180471)
@@ -316,13 +316,6 @@
     return heightOfBlock + maxHeight;
 }
 
-float RootInlineBox::maxLogicalBottom() const
-{
-    float maxLogicalBottom = logicalBottom();
-    computeMaxLogicalBottom(maxLogicalBottom);
-    return maxLogicalBottom;
-}
-
 LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const
 {
     LayoutUnit result = 0;

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RootInlineBox.h (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RootInlineBox.h	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RootInlineBox.h	2015-02-21 02:18:35 UTC (rev 180471)
@@ -187,9 +187,6 @@
         return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom());
     }
 
-    // Used to calculate the underline offset for TextUnderlinePositionUnder.
-    float maxLogicalBottom() const;
-
     Node* getLogicalStartBoxWithNode(InlineBox*&) const;
     Node* getLogicalEndBoxWithNode(InlineBox*&) const;
 

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/style/InlineTextBoxStyle.cpp (180470 => 180471)


--- branches/safari-600.1.4.15-branch/Source/WebCore/style/InlineTextBoxStyle.cpp	2015-02-21 01:48:00 UTC (rev 180470)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/style/InlineTextBoxStyle.cpp	2015-02-21 02:18:35 UTC (rev 180471)
@@ -46,7 +46,19 @@
     case TextUnderlinePositionUnder: {
         ASSERT(inlineTextBox);
         // Position underline relative to the bottom edge of the lowest element's content box.
-        float offset = inlineTextBox->root().maxLogicalBottom() - inlineTextBox->logicalBottom();
+        const RootInlineBox& rootBox = inlineTextBox->root();
+        const RenderElement* decorationRenderer = inlineTextBox->parent()->renderer().enclosingRendererWithTextDecoration(TextDecorationUnderline, inlineTextBox->isFirstLine());
+        
+        float offset;
+        if (inlineTextBox->renderer().style().isFlippedLinesWritingMode()) {
+            offset = inlineTextBox->logicalTop();
+            rootBox.minLogicalTopForTextDecorationLine(offset, decorationRenderer, TextDecorationUnderline);
+            offset = inlineTextBox->logicalTop() - offset;
+        } else {
+            offset = inlineTextBox->logicalBottom();
+            rootBox.maxLogicalBottomForTextDecorationLine(offset, decorationRenderer, TextDecorationUnderline);
+            offset -= inlineTextBox->logicalBottom();
+        }
         return inlineTextBox->logicalHeight() + gap + std::max<float>(offset, 0);
     }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to