<!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">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[194500] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/194500">194500</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2016-01-02 11:42:22 -0800 (Sat, 02 Jan 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Simple line layout:: Add text-decoration support.
https://bugs.webkit.org/show_bug.cgi?id=152623
Reviewed by Antti Koivisto.
Source/WebCore:
This patch enables text-decoration for simple line layout.
-webkit-text-underline-position: under requires normal line layout context, skip it for now.
Test: fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow): In case of multiple RenderText renderers (long text), it's ok
to pass the first text renderer as they all share the same set of decorations.
LayoutTests:
Existing tests cases also cover decoration correctness.
* fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration-expected.html: Added.
* fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutcpp">trunk/Source/WebCore/rendering/SimpleLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp">trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationsimplelinelayouttextdecorationexpectedhtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationsimplelinelayouttextdecorationhtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194499 => 194500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-02 12:19:55 UTC (rev 194499)
+++ trunk/LayoutTests/ChangeLog        2016-01-02 19:42:22 UTC (rev 194500)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-02 Zalan Bujtas <zalan@apple.com>
+
+ Simple line layout:: Add text-decoration support.
+ https://bugs.webkit.org/show_bug.cgi?id=152623
+
+ Reviewed by Antti Koivisto.
+
+ Existing tests cases also cover decoration correctness.
+
+ * fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration-expected.html: Added.
+ * fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html: Added.
+
</ins><span class="cx"> 2016-01-01 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Modern IDB: storage/indexeddb/database-deletepending-flag.html fails.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationsimplelinelayouttextdecorationexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration-expected.html (0 => 194500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration-expected.html        2016-01-02 19:42:22 UTC (rev 194500)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint simple line layout text-decoration correctly.</title>
+<script>
+ if (window.internals)
+ internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+</head>
+<body>
+<div style="text-decoration: underline;"><br>supported<br><br>supported<br></div>
+<div style="text-decoration: underline;"><br></div>
+<div style="text-decoration: underline;"><br><br></div>
+<div style="text-decoration: underline; -webkit-text-underline-position: under;">not supported</div>
+<div style="text-decoration: underline; -webkit-text-underline-position: auto;">supported</div>
+<div style="text-decoration: underline; -webkit-text-underline-position: alphabetic;">supported</div>
+<div style="text-decoration: line-through;">supported</div>
+<div style="text-decoration: overline;">supported</div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationsimplelinelayouttextdecorationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html (0 => 194500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html         (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html        2016-01-02 19:42:22 UTC (rev 194500)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint simple line layout text-decoration correctly.</title>
+</head>
+<body>
+<div style="text-decoration: underline;"><br>supported<br><br>supported<br></div>
+<div style="text-decoration: underline;"><br></div>
+<div style="text-decoration: underline;"><br><br></div>
+<div style="text-decoration: underline; -webkit-text-underline-position: under;">not supported</div>
+<div style="text-decoration: underline; -webkit-text-underline-position: auto;">supported</div>
+<div style="text-decoration: underline; -webkit-text-underline-position: alphabetic;">supported</div>
+<div style="text-decoration: line-through;">supported</div>
+<div style="text-decoration: overline;">supported</div>
+</body>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194499 => 194500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-02 12:19:55 UTC (rev 194499)
+++ trunk/Source/WebCore/ChangeLog        2016-01-02 19:42:22 UTC (rev 194500)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-01-02 Zalan Bujtas <zalan@apple.com>
+
+ Simple line layout:: Add text-decoration support.
+ https://bugs.webkit.org/show_bug.cgi?id=152623
+
+ Reviewed by Antti Koivisto.
+
+ This patch enables text-decoration for simple line layout.
+ -webkit-text-underline-position: under requires normal line layout context, skip it for now.
+
+ Test: fast/css3-text/css3-text-decoration/simple-line-layout-text-decoration.html
+
+ * rendering/SimpleLineLayout.cpp:
+ (WebCore::SimpleLineLayout::canUseForStyle):
+ (WebCore::SimpleLineLayout::printReason):
+ * rendering/SimpleLineLayoutFunctions.cpp:
+ (WebCore::SimpleLineLayout::paintFlow): In case of multiple RenderText renderers (long text), it's ok
+ to pass the first text renderer as they all share the same set of decorations.
+
</ins><span class="cx"> 2015-12-31 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> Replace WTF::move with WTFMove
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (194499 => 194500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2016-01-02 12:19:55 UTC (rev 194499)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2016-01-02 19:42:22 UTC (rev 194500)
</span><span class="lines">@@ -62,57 +62,57 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> enum AvoidanceReason_ : uint64_t {
</span><del>- FlowIsInsideRegion = 1LLU << 0,
- FlowHasHorizonalWritingMode = 1LLU << 1,
- FlowHasOutline = 1LLU << 2,
- FlowIsRuby = 1LLU << 3,
- FlowIsPaginated = 1LLU << 4,
- FlowHasTextOverflow = 1LLU << 5,
- FlowIsDepricatedFlexBox = 1LLU << 6,
- FlowParentIsPlaceholderElement = 1LLU << 7,
- FlowParentIsTextAreaWithWrapping = 1LLU << 8,
- FlowHasNonSupportedChild = 1LLU << 9,
- FlowHasUnsupportedFloat = 1LLU << 10,
- FlowHasTextDecoration = 1LLU << 11,
- FlowIsJustifyAligned = 1LLU << 12,
- FlowHasOverflowVisible = 1LLU << 13,
- FlowIsNotLTR = 1LLU << 14,
- FlowHasLineBoxContainProperty = 1LLU << 15,
- FlowIsNotTopToBottom = 1LLU << 16,
- FlowHasLineBreak = 1LLU << 17,
- FlowHasWordBreak = 1LLU << 18,
- FlowHasNonNormalUnicodeBiDi = 1LLU << 19,
- FlowHasRTLOrdering = 1LLU << 20,
- FlowHasLineAlignEdges = 1LLU << 21,
- FlowHasLineSnap = 1LLU << 22,
- FlowHasHypensAuto = 1LLU << 23,
- FlowHasTextEmphasisFillOrMark = 1LLU << 24,
- FlowHasTextShadow = 1LLU << 25,
- FlowHasPseudoFirstLine = 1LLU << 26,
- FlowHasPseudoFirstLetter = 1LLU << 27,
- FlowHasTextCombine = 1LLU << 28,
- FlowHasTextFillBox = 1LLU << 29,
- FlowHasBorderFitLines = 1LLU << 30,
- FlowHasNonAutoLineBreak = 1LLU << 31,
- FlowHasNonAutoTrailingWord = 1LLU << 32,
- FlowHasSVGFont = 1LLU << 33,
- FlowTextIsEmpty = 1LLU << 34,
- FlowTextHasNoBreakSpace = 1LLU << 35,
- FlowTextHasSoftHyphen = 1LLU << 36,
- FlowTextHasDirectionCharacter = 1LLU << 37,
- FlowIsMissingPrimaryFont = 1LLU << 38,
- FlowFontIsMissingGlyph = 1LLU << 39,
- FlowTextIsCombineText = 1LLU << 40,
- FlowTextIsRenderCounter = 1LLU << 41,
- FlowTextIsRenderQuote = 1LLU << 42,
- FlowTextIsTextFragment = 1LLU << 43,
- FlowTextIsSVGInlineText = 1LLU << 44,
- FlowFontIsNotSimple = 1LLU << 45,
- FeatureIsDisabled = 1LLU << 46,
- FlowHasNoParent = 1LLU << 47,
- FlowHasNoChild = 1LLU << 48,
- FlowChildIsSelected = 1LLU << 49,
- EndOfReasons = 1LLU << 50
</del><ins>+ FlowIsInsideRegion = 1LLU << 0,
+ FlowHasHorizonalWritingMode = 1LLU << 1,
+ FlowHasOutline = 1LLU << 2,
+ FlowIsRuby = 1LLU << 3,
+ FlowIsPaginated = 1LLU << 4,
+ FlowHasTextOverflow = 1LLU << 5,
+ FlowIsDepricatedFlexBox = 1LLU << 6,
+ FlowParentIsPlaceholderElement = 1LLU << 7,
+ FlowParentIsTextAreaWithWrapping = 1LLU << 8,
+ FlowHasNonSupportedChild = 1LLU << 9,
+ FlowHasUnsupportedFloat = 1LLU << 10,
+ FlowHasUnsupportedUnderlineDecoration = 1LLU << 11,
+ FlowIsJustifyAligned = 1LLU << 12,
+ FlowHasOverflowVisible = 1LLU << 13,
+ FlowIsNotLTR = 1LLU << 14,
+ FlowHasLineBoxContainProperty = 1LLU << 15,
+ FlowIsNotTopToBottom = 1LLU << 16,
+ FlowHasLineBreak = 1LLU << 17,
+ FlowHasWordBreak = 1LLU << 18,
+ FlowHasNonNormalUnicodeBiDi = 1LLU << 19,
+ FlowHasRTLOrdering = 1LLU << 20,
+ FlowHasLineAlignEdges = 1LLU << 21,
+ FlowHasLineSnap = 1LLU << 22,
+ FlowHasHypensAuto = 1LLU << 23,
+ FlowHasTextEmphasisFillOrMark = 1LLU << 24,
+ FlowHasTextShadow = 1LLU << 25,
+ FlowHasPseudoFirstLine = 1LLU << 26,
+ FlowHasPseudoFirstLetter = 1LLU << 27,
+ FlowHasTextCombine = 1LLU << 28,
+ FlowHasTextFillBox = 1LLU << 29,
+ FlowHasBorderFitLines = 1LLU << 30,
+ FlowHasNonAutoLineBreak = 1LLU << 31,
+ FlowHasNonAutoTrailingWord = 1LLU << 32,
+ FlowHasSVGFont = 1LLU << 33,
+ FlowTextIsEmpty = 1LLU << 34,
+ FlowTextHasNoBreakSpace = 1LLU << 35,
+ FlowTextHasSoftHyphen = 1LLU << 36,
+ FlowTextHasDirectionCharacter = 1LLU << 37,
+ FlowIsMissingPrimaryFont = 1LLU << 38,
+ FlowFontIsMissingGlyph = 1LLU << 39,
+ FlowTextIsCombineText = 1LLU << 40,
+ FlowTextIsRenderCounter = 1LLU << 41,
+ FlowTextIsRenderQuote = 1LLU << 42,
+ FlowTextIsTextFragment = 1LLU << 43,
+ FlowTextIsSVGInlineText = 1LLU << 44,
+ FlowFontIsNotSimple = 1LLU << 45,
+ FeatureIsDisabled = 1LLU << 46,
+ FlowHasNoParent = 1LLU << 47,
+ FlowHasNoChild = 1LLU << 48,
+ FlowChildIsSelected = 1LLU << 49,
+ EndOfReasons = 1LLU << 50
</ins><span class="cx"> };
</span><span class="cx"> const unsigned NoReason = 0;
</span><span class="cx">
</span><span class="lines">@@ -211,8 +211,8 @@
</span><span class="cx"> AvoidanceReasonFlags reasons = { };
</span><span class="cx"> if (style.textOverflow())
</span><span class="cx"> SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
</span><del>- if (style.textDecorationsInEffect() != TextDecorationNone)
- SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextDecoration, reasons, includeReasons);
</del><ins>+ if ((style.textDecorationsInEffect() & TextDecorationUnderline) && style.textUnderlinePosition() == TextUnderlinePositionUnder)
+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedUnderlineDecoration, reasons, includeReasons);
</ins><span class="cx"> if (style.textAlign() == JUSTIFY)
</span><span class="cx"> SET_REASON_AND_RETURN_IF_NEEDED(FlowIsJustifyAligned, reasons, includeReasons);
</span><span class="cx"> // Non-visible overflow should be pretty easy to support.
</span><span class="lines">@@ -820,8 +820,8 @@
</span><span class="cx"> case FlowHasUnsupportedFloat:
</span><span class="cx"> stream << "complicated float";
</span><span class="cx"> break;
</span><del>- case FlowHasTextDecoration:
- stream << "text-decoration";
</del><ins>+ case FlowHasUnsupportedUnderlineDecoration:
+ stream << "text-underline-position: under";
</ins><span class="cx"> break;
</span><span class="cx"> case FlowIsJustifyAligned:
</span><span class="cx"> stream << "text-align: justify";
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (194499 => 194500)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2016-01-02 12:19:55 UTC (rev 194499)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2016-01-02 19:42:22 UTC (rev 194500)
</span><span class="lines">@@ -35,12 +35,14 @@
</span><span class="cx"> #include "InlineTextBox.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><ins>+#include "RenderIterator.h"
</ins><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SimpleLineLayoutResolver.h"
</span><span class="cx"> #include "Text.h"
</span><ins>+#include "TextDecorationPainter.h"
</ins><span class="cx"> #include "TextPaintStyle.h"
</span><span class="cx"> #include "TextPainter.h"
</span><span class="cx">
</span><span class="lines">@@ -78,6 +80,16 @@
</span><span class="cx"> textPainter.setFont(style.fontCascade());
</span><span class="cx"> textPainter.setTextPaintStyle(computeTextPaintStyle(flow.frame(), style, paintInfo));
</span><span class="cx">
</span><ins>+ Optional<TextDecorationPainter> textDecorationPainter;
+ if (style.textDecorationsInEffect() != TextDecorationNone) {
+ const RenderText* textRenderer = childrenOfType<RenderText>(flow).first();
+ if (textRenderer) {
+ textDecorationPainter = TextDecorationPainter(paintInfo.context(), style.textDecorationsInEffect(), *textRenderer, false);
+ textDecorationPainter->setFont(style.fontCascade());
+ textDecorationPainter->setBaseline(style.fontMetrics().ascent());
+ }
+ }
+
</ins><span class="cx"> LayoutRect paintRect = paintInfo.rect;
</span><span class="cx"> paintRect.moveBy(-paintOffset);
</span><span class="cx">
</span><span class="lines">@@ -100,6 +112,10 @@
</span><span class="cx"> textRun.setXPos(0);
</span><span class="cx"> FloatPoint textOrigin = FloatPoint(rect.x() + paintOffset.x(), roundToDevicePixel(run.baselinePosition() + paintOffset.y(), deviceScaleFactor));
</span><span class="cx"> textPainter.paintText(textRun, textRun.length(), rect, textOrigin);
</span><ins>+ if (textDecorationPainter) {
+ textDecorationPainter->setWidth(rect.width());
+ textDecorationPainter->paintTextDecoration(textRun, textOrigin, rect.location() + paintOffset);
+ }
</ins><span class="cx"> if (debugBordersEnabled)
</span><span class="cx"> paintDebugBorders(paintInfo.context(), LayoutRect(run.rect()), paintOffset);
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>