<!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>[192660] 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/192660">192660</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2015-11-19 14:29:21 -0800 (Thu, 19 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Simple line layout: Add word-spacing support.
https://bugs.webkit.org/show_bug.cgi?id=151420
Reviewed by Antti Koivisto.
Source/WebCore:
This enables us to use simple line layout on word-spacing content.
Test: fast/text/simple-line-wordspacing.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::canUseForStyle): Deleted.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
LayoutTests:
Some rebaselining is needed since inline box layout does not compute text run width properly (see webkit.org/b/151452)
* fast/text/simple-line-wordspacing-expected.html: Added.
* fast/text/simple-line-wordspacing.html: Added.
* platform/mac/css1/text_properties/word_spacing-expected.txt:
* platform/mac/fast/css/word-space-extra-expected.txt:
* platform/mac/fast/text/atsui-negative-spacing-features-expected.txt:
* platform/mac/fast/text/atsui-spacing-features-expected.txt:
* platform/mac/fast/text/basic/004-expected.txt:
* platform/mac/fast/text/basic/005-expected.txt:
* platform/mac/fast/text/word-space-expected.txt:
* platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss1text_propertiesword_spacingexpectedtxt">trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastcsswordspaceextraexpectedtxt">trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttextatsuinegativespacingfeaturesexpectedtxt">trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttextatsuispacingfeaturesexpectedtxt">trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttextbasic004expectedtxt">trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttextbasic005expectedtxt">trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttextwordspaceexpectedtxt">trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomsvgfontswordspacingexpectedtxt">trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt</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="#trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorcpp">trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorh">trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextsimplelinewordspacingexpectedhtml">trunk/LayoutTests/fast/text/simple-line-wordspacing-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextsimplelinewordspacinghtml">trunk/LayoutTests/fast/text/simple-line-wordspacing.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/ChangeLog        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-11-19 Zalan Bujtas <zalan@apple.com>
+
+ Simple line layout: Add word-spacing support.
+ https://bugs.webkit.org/show_bug.cgi?id=151420
+
+ Reviewed by Antti Koivisto.
+
+ Some rebaselining is needed since inline box layout does not compute text run width properly (see webkit.org/b/151452)
+
+ * fast/text/simple-line-wordspacing-expected.html: Added.
+ * fast/text/simple-line-wordspacing.html: Added.
+ * platform/mac/css1/text_properties/word_spacing-expected.txt:
+ * platform/mac/fast/css/word-space-extra-expected.txt:
+ * platform/mac/fast/text/atsui-negative-spacing-features-expected.txt:
+ * platform/mac/fast/text/atsui-spacing-features-expected.txt:
+ * platform/mac/fast/text/basic/004-expected.txt:
+ * platform/mac/fast/text/basic/005-expected.txt:
+ * platform/mac/fast/text/word-space-expected.txt:
+ * platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt:
+
</ins><span class="cx"> 2015-11-19 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Marking storage/indexeddb/modern/cursor-4.html as flaky on mac-wk1
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelinewordspacingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-line-wordspacing-expected.html (0 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-line-wordspacing-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-wordspacing-expected.html        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<html>
+<head>
+<title>This tests that simple line layout renders word-spacing properly.</title>
+<body>
+<script>
+if (window.internals)
+        internals.settings.setSimpleLineLayoutEnabled(false);
+for (var i = -6; i < 15; ++i) {
+ var element = document.createElement("div");
+ element.innerHTML = "a b        c d        e f        g";
+ element.style.wordSpacing = i;
+        document.body.appendChild(element);
+}
+for (var i = -6; i < 15; ++i) {
+ var element = document.createElement("div");
+ element.innerHTML = "a b        c d                e f                        g h                                j";
+ element.style.wordSpacing = i;
+ element.style.whiteSpace = "pre-wrap";
+        document.body.appendChild(element);
+}
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelinewordspacinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-line-wordspacing.html (0 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-line-wordspacing.html         (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-wordspacing.html        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<html>
+<head>
+<title>This tests that simple line layout renders word-spacing properly.</title>
+<body>
+<script>
+for (var i = -6; i < 15; ++i) {
+ var element = document.createElement("div");
+ element.innerHTML = "a b        c d        e f        g";
+ element.style.wordSpacing = i;
+        document.body.appendChild(element);
+}
+for (var i = -6; i < 15; ++i) {
+ var element = document.createElement("div");
+ element.innerHTML = "a b        c d                e f                        g h                                j";
+ element.style.wordSpacing = i;
+ element.style.whiteSpace = "pre-wrap";
+        document.body.appendChild(element);
+}
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss1text_propertiesword_spacingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -21,26 +21,26 @@
</span><span class="cx"> text run at (0,150) width 0: " "
</span><span class="cx"> RenderBlock {HR} at (0,212) size 769x2 [border: (1px inset #000000)]
</span><span class="cx"> RenderBlock {P} at (0,230) size 769x18
</span><del>- RenderText {#text} at (0,0) size 688x18
- text run at (0,0) width 688: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 716x18
+ text run at (0,0) width 716: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,264) size 769x18
</span><del>- RenderText {#text} at (0,0) size 598x18
- text run at (0,0) width 598: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 617x18
+ text run at (0,0) width 617: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,298) size 769x18
</span><del>- RenderText {#text} at (0,0) size 598x18
- text run at (0,0) width 598: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 617x18
+ text run at (0,0) width 617: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,332) size 769x18
</span><del>- RenderText {#text} at (0,0) size 464x18
- text run at (0,0) width 464: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 468x18
+ text run at (0,0) width 468: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,366) size 769x18
</span><del>- RenderText {#text} at (0,0) size 464x18
- text run at (0,0) width 464: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 468x18
+ text run at (0,0) width 468: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,400) size 769x18
</span><del>- RenderText {#text} at (0,0) size 572x18
- text run at (0,0) width 572: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 588x18
+ text run at (0,0) width 588: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,434) size 769x18
</span><del>- RenderText {#text} at (0,0) size 493x18
- text run at (0,0) width 493: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 500x18
+ text run at (0,0) width 500: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (0,468) size 769x36
</span><span class="cx"> RenderText {#text} at (0,0) size 758x18
</span><span class="cx"> text run at (0,0) width 758: "This words in this sentence should have extra space between them, but the last few words in the sentence"
</span><span class="lines">@@ -50,8 +50,8 @@
</span><span class="cx"> RenderText {#text} at (179,18) size 5x18
</span><span class="cx"> text run at (179,18) width 5: "."
</span><span class="cx"> RenderBlock {P} at (0,520) size 769x18
</span><del>- RenderText {#text} at (0,0) size 719x18
- text run at (0,0) width 719: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
</del><ins>+ RenderText {#text} at (0,0) size 716x18
+ text run at (0,0) width 716: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
</ins><span class="cx"> RenderTable {TABLE} at (0,554) size 769x344 [border: (1px outset #808080)]
</span><span class="cx"> RenderTableSection {TBODY} at (1,1) size 767x342
</span><span class="cx"> RenderTableRow {TR} at (0,0) size 767x26
</span><span class="lines">@@ -65,26 +65,26 @@
</span><span class="cx"> text run at (4,4) width 4: " "
</span><span class="cx"> RenderTableCell {TD} at (12,26) size 755x316 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
</span><span class="cx"> RenderBlock {P} at (4,4) size 747x18
</span><del>- RenderText {#text} at (0,0) size 688x18
- text run at (0,0) width 688: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 716x18
+ text run at (0,0) width 716: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,38) size 747x18
</span><del>- RenderText {#text} at (0,0) size 598x18
- text run at (0,0) width 598: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 617x18
+ text run at (0,0) width 617: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,72) size 747x18
</span><del>- RenderText {#text} at (0,0) size 598x18
- text run at (0,0) width 598: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 617x18
+ text run at (0,0) width 617: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,106) size 747x18
</span><del>- RenderText {#text} at (0,0) size 464x18
- text run at (0,0) width 464: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 468x18
+ text run at (0,0) width 468: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,140) size 747x18
</span><del>- RenderText {#text} at (0,0) size 464x18
- text run at (0,0) width 464: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 468x18
+ text run at (0,0) width 468: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,174) size 747x18
</span><del>- RenderText {#text} at (0,0) size 572x18
- text run at (0,0) width 572: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 588x18
+ text run at (0,0) width 588: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,208) size 747x18
</span><del>- RenderText {#text} at (0,0) size 493x18
- text run at (0,0) width 493: "This words in this sentence should have extra space between them."
</del><ins>+ RenderText {#text} at (0,0) size 500x18
+ text run at (0,0) width 500: "This words in this sentence should have extra space between them."
</ins><span class="cx"> RenderBlock {P} at (4,242) size 747x36
</span><span class="cx"> RenderText {#text} at (0,0) size 694x36
</span><span class="cx"> text run at (0,0) width 694: "This words in this sentence should have extra space between them, but the last few words in the"
</span><span class="lines">@@ -95,5 +95,5 @@
</span><span class="cx"> RenderText {#text} at (243,18) size 5x18
</span><span class="cx"> text run at (243,18) width 5: "."
</span><span class="cx"> RenderBlock {P} at (4,294) size 747x18
</span><del>- RenderText {#text} at (0,0) size 719x18
- text run at (0,0) width 719: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
</del><ins>+ RenderText {#text} at (0,0) size 716x18
+ text run at (0,0) width 716: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastcsswordspaceextraexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -8,8 +8,8 @@
</span><span class="cx"> text run at (0,0) width 139: "word-spacing"
</span><span class="cx"> RenderBlock (floating) {PRE} at (0,60) size 986x169
</span><span class="cx"> RenderBlock {H3} at (0,15) size 986x18
</span><del>- RenderText {#text} at (0,0) size 205x17
- text run at (0,0) width 205: "In a floated pre"
</del><ins>+ RenderText {#text} at (0,0) size 145x17
+ text run at (0,0) width 145: "In a floated pre"
</ins><span class="cx"> RenderBlock (anonymous) at (0,47) size 986x121
</span><span class="cx"> RenderText {#text} at (0,0) size 257x30
</span><span class="cx"> text run at (0,0) width 0: " "
</span><span class="lines">@@ -148,8 +148,8 @@
</span><span class="cx"> RenderBR {BR} at (985,0) size 1x18
</span><span class="cx"> RenderBlock {PRE} at (0,256) size 769x153
</span><span class="cx"> RenderBlock {H3} at (0,0) size 769x17
</span><del>- RenderText {#text} at (0,0) size 241x17
- text run at (0,0) width 241: "In an un-floated pre"
</del><ins>+ RenderText {#text} at (0,0) size 181x17
+ text run at (0,0) width 181: "In an un-floated pre"
</ins><span class="cx"> RenderBlock (anonymous) at (0,32) size 769x121
</span><span class="cx"> RenderText {#text} at (0,0) size 257x30
</span><span class="cx"> text run at (0,0) width 0: " "
</span><span class="lines">@@ -289,8 +289,8 @@
</span><span class="cx"> RenderText {#text} at (0,0) size 0x0
</span><span class="cx"> RenderBlock (anonymous) at (0,427) size 769x23
</span><span class="cx"> RenderBlock {H3} at (0,0) size 769x22
</span><del>- RenderText {#text} at (0,0) size 95x22
- text run at (0,0) width 95: "In a span"
</del><ins>+ RenderText {#text} at (0,0) size 115x22
+ text run at (0,0) width 115: "In a span"
</ins><span class="cx"> RenderBlock (anonymous) at (0,468) size 769x271
</span><span class="cx"> RenderInline {SPAN} at (0,0) size 868x234
</span><span class="cx"> RenderText {#text} at (0,0) size 179x18
</span><span class="lines">@@ -895,8 +895,8 @@
</span><span class="cx"> text run at (0,0) width 133: "both-spacing"
</span><span class="cx"> RenderBlock (floating) {PRE} at (0,1608) size 1451x168
</span><span class="cx"> RenderBlock {H3} at (0,15) size 1451x18
</span><del>- RenderText {#text} at (0,0) size 285x17
- text run at (0,0) width 285: "In a floated pre"
</del><ins>+ RenderText {#text} at (0,0) size 225x17
+ text run at (0,0) width 225: "In a floated pre"
</ins><span class="cx"> RenderBlock (anonymous) at (0,47) size 1451x121
</span><span class="cx"> RenderText {#text} at (0,0) size 537x30
</span><span class="cx"> text run at (0,0) width 0: " "
</span><span class="lines">@@ -1035,8 +1035,8 @@
</span><span class="cx"> RenderBR {BR} at (1450,0) size 1x18
</span><span class="cx"> RenderBlock {PRE} at (0,1803) size 769x153
</span><span class="cx"> RenderBlock {H3} at (0,0) size 769x17
</span><del>- RenderText {#text} at (0,0) size 341x17
- text run at (0,0) width 341: "In an un-floated pre"
</del><ins>+ RenderText {#text} at (0,0) size 281x17
+ text run at (0,0) width 281: "In an un-floated pre"
</ins><span class="cx"> RenderBlock (anonymous) at (0,32) size 769x121
</span><span class="cx"> RenderText {#text} at (0,0) size 537x30
</span><span class="cx"> text run at (0,0) width 0: " "
</span><span class="lines">@@ -1177,8 +1177,8 @@
</span><span class="cx"> RenderText {#text} at (0,0) size 0x0
</span><span class="cx"> RenderBlock (anonymous) at (0,2005) size 769x23
</span><span class="cx"> RenderBlock {H3} at (0,0) size 769x22
</span><del>- RenderText {#text} at (0,0) size 140x22
- text run at (0,0) width 140: "In a span"
</del><ins>+ RenderText {#text} at (0,0) size 160x22
+ text run at (0,0) width 160: "In a span"
</ins><span class="cx"> RenderBlock (anonymous) at (0,2046) size 769x343
</span><span class="cx"> RenderInline {SPAN} at (0,0) size 862x342
</span><span class="cx"> RenderText {#text} at (0,0) size 428x18
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttextatsuinegativespacingfeaturesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -32,9 +32,9 @@
</span><span class="cx"> text run at (1,1) width 174: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
</span><span class="cx"> text run at (1,19) width 175: "consectetuer adipiscing e\x{300}lit."
</span><span class="cx"> RenderBlock {DIV} at (0,86) size 202x38 [border: (1px solid #008000)]
</span><del>- RenderText {#text} at (1,1) size 177x36
- text run at (1,1) width 176: "Lorem ipsum dolor sit amet,"
- text run at (1,19) width 177: "consectetuer adipiscing elit."
</del><ins>+ RenderText {#text} at (1,1) size 175x36
+ text run at (1,1) width 174: "Lorem ipsum dolor sit amet,"
+ text run at (1,19) width 175: "consectetuer adipiscing elit."
</ins><span class="cx"> RenderTableCell {TD} at (208,24) size 205x126 [r=1 c=1 rs=1 cs=1]
</span><span class="cx"> RenderBlock {DIV} at (1,1) size 203x124
</span><span class="cx"> RenderBlock {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttextatsuispacingfeaturesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -46,10 +46,10 @@
</span><span class="cx"> text run at (1,19) width 130: "ame\x{300}t, consectetuer"
</span><span class="cx"> text run at (1,37) width 105: "adipiscing e\x{300}lit."
</span><span class="cx"> RenderBlock {DIV} at (0,122) size 202x56 [border: (1px solid #008000)]
</span><del>- RenderText {#text} at (1,1) size 163x54
- text run at (1,1) width 163: "Lorem ipsum dolor sit"
- text run at (1,19) width 120: "amet, consectetuer"
- text run at (1,37) width 95: "adipiscing elit."
</del><ins>+ RenderText {#text} at (1,1) size 173x54
+ text run at (1,1) width 173: "Lorem ipsum dolor sit"
+ text run at (1,19) width 130: "amet, consectetuer"
+ text run at (1,37) width 105: "adipiscing elit."
</ins><span class="cx"> RenderTableCell {TD} at (208,24) size 205x234 [r=1 c=1 rs=1 cs=1]
</span><span class="cx"> RenderBlock {DIV} at (1,1) size 203x232
</span><span class="cx"> RenderBlock {DIV} at (0,0) size 202x74 [border: (1px solid #0000FF)]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttextbasic004expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -4,19 +4,19 @@
</span><span class="cx"> RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx"> RenderBody {BODY} at (8,8) size 784x584
</span><span class="cx"> RenderBlock (floating) {P} at (0,16) size 652x22 [border: (2px solid #008000)]
</span><del>- RenderText {#text} at (2,2) size 618x18
- text run at (2,2) width 618: "There should be 30px of word spacing between each word."
</del><ins>+ RenderText {#text} at (2,2) size 648x18
+ text run at (2,2) width 648: "There should be 30px of word spacing between each word."
</ins><span class="cx"> RenderBlock {DIV} at (0,0) size 784x100
</span><span class="cx"> RenderTable {TABLE} at (0,100) size 100x130
</span><span class="cx"> RenderTableSection {TBODY} at (0,0) size 100x130
</span><span class="cx"> RenderTableRow {TR} at (0,0) size 100x130
</span><span class="cx"> RenderTableCell {TD} at (0,0) size 100x130 [r=0 c=0 rs=1 cs=1]
</span><span class="cx"> RenderBlock {P} at (0,0) size 100x130 [border: (2px solid #008000)]
</span><del>- RenderText {#text} at (2,2) size 71x126
</del><ins>+ RenderText {#text} at (2,2) size 86x126
</ins><span class="cx"> text run at (2,2) width 38: "There"
</span><del>- text run at (2,20) width 62: "should be"
- text run at (2,38) width 50: "15px of"
</del><ins>+ text run at (2,20) width 77: "should be"
+ text run at (2,38) width 65: "15px of"
</ins><span class="cx"> text run at (2,56) width 33: "word"
</span><span class="cx"> text run at (2,74) width 49: "spacing"
</span><span class="cx"> text run at (2,92) width 54: "between"
</span><del>- text run at (2,110) width 71: "each word."
</del><ins>+ text run at (2,110) width 86: "each word."
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttextbasic005expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -4,5 +4,5 @@
</span><span class="cx"> RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx"> RenderBody {BODY} at (8,8) size 784x584
</span><span class="cx"> RenderBlock (floating) {DIV} at (0,0) size 263x22 [border: (2px solid #008000)]
</span><del>- RenderText {#text} at (2,2) size 264x18
- text run at (2,2) width 264: "Words should have a negative spacing of 5px."
</del><ins>+ RenderText {#text} at (2,2) size 259x18
+ text run at (2,2) width 259: "Words should have a negative spacing of 5px."
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttextwordspaceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -20,11 +20,11 @@
</span><span class="cx"> RenderText {#text} at (0,0) size 267x18
</span><span class="cx"> text run at (0,0) width 267: "The next 7 lines should all look the same."
</span><span class="cx"> RenderBlock (floating) {DIV} at (0,86) size 82x24 [border: (3px solid #000000)]
</span><del>- RenderText {#text} at (3,3) size 26x18
- text run at (3,3) width 26: "A B"
</del><ins>+ RenderText {#text} at (3,3) size 76x18
+ text run at (3,3) width 76: "A B"
</ins><span class="cx"> RenderBlock (floating) {DIV} at (0,110) size 82x24 [border: (3px solid #000000)]
</span><del>- RenderText {#text} at (3,3) size 26x18
- text run at (3,3) width 26: "A B"
</del><ins>+ RenderText {#text} at (3,3) size 76x18
+ text run at (3,3) width 76: "A B"
</ins><span class="cx"> RenderBlock (floating) {DIV} at (0,134) size 83x24 [border: (3px solid #000000)]
</span><span class="cx"> RenderInline {SPAN} at (0,0) size 12x18
</span><span class="cx"> RenderText {#text} at (3,3) size 12x18
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomsvgfontswordspacingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -13,8 +13,8 @@
</span><span class="cx"> RenderText {#text} at (0,0) size 300x18
</span><span class="cx"> text run at (0,0) width 300: "word-spacing: 100px, all should look the same"
</span><span class="cx"> RenderBlock {P} at (0,110) size 784x20
</span><del>- RenderText {#text} at (0,1) size 170x18
- text run at (0,1) width 170: "abc abc abc"
</del><ins>+ RenderText {#text} at (0,1) size 270x18
+ text run at (0,1) width 270: "abc abc abc"
</ins><span class="cx"> RenderBlock {P} at (0,148) size 784x20
</span><span class="cx"> RenderText {#text} at (0,1) size 126x18
</span><span class="cx"> text run at (0,1) width 126: "abc "
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/Source/WebCore/ChangeLog        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-11-19 Zalan Bujtas <zalan@apple.com>
+
+ Simple line layout: Add word-spacing support.
+ https://bugs.webkit.org/show_bug.cgi?id=151420
+
+ Reviewed by Antti Koivisto.
+
+ This enables us to use simple line layout on word-spacing content.
+
+ Test: fast/text/simple-line-wordspacing.html
+
+ * rendering/SimpleLineLayout.cpp:
+ (WebCore::SimpleLineLayout::createLineRuns):
+ (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
+ * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
+ (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
+ (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
+ (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
+ * rendering/SimpleLineLayoutTextFragmentIterator.h:
+
</ins><span class="cx"> 2015-11-19 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Modern IDB: IDBObjectStore.deleteIndex() support.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -122,8 +122,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> if (!style.textIndent().isZero())
</span><span class="cx"> return false;
</span><del>- if (!style.wordSpacing().isZero())
- return false;
</del><span class="cx"> if (!style.isLeftToRightDirection())
</span><span class="cx"> return false;
</span><span class="cx"> if (style.lineBoxContain() != RenderStyle::initialLineBoxContain())
</span><span class="lines">@@ -541,7 +539,7 @@
</span><span class="cx"> static bool createLineRuns(LineState& line, const LineState& previousLine, Layout::RunVector& runs, TextFragmentIterator& textFragmentIterator)
</span><span class="cx"> {
</span><span class="cx"> const auto& style = textFragmentIterator.style();
</span><del>- line.setCollapedWhitespaceWidth(style.spaceWidth);
</del><ins>+ line.setCollapedWhitespaceWidth(style.spaceWidth + style.wordSpacing);
</ins><span class="cx"> bool lineCanBeWrapped = style.wrapLines || style.breakWordOnOverflow;
</span><span class="cx"> auto fragment = firstFragment(textFragmentIterator, line, previousLine, runs);
</span><span class="cx"> while (fragment.type() != TextFragmentIterator::TextFragment::ContentEnd) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> , wrapLines(style.autoWrap())
</span><span class="cx"> , breakWordOnOverflow(style.overflowWrap() == BreakOverflowWrap && (wrapLines || preserveNewline))
</span><span class="cx"> , spaceWidth(font.width(TextRun(StringView(&space, 1))))
</span><ins>+ , wordSpacing(font.wordSpacing())
</ins><span class="cx"> , tabWidth(collapseWhitespace ? 0 : style.tabSize())
</span><span class="cx"> , locale(style.locale())
</span><span class="cx"> {
</span><span class="lines">@@ -182,12 +183,12 @@
</span><span class="cx"> width = 0;
</span><span class="cx"> if (nextPosition == currentPosition)
</span><span class="cx"> return currentPosition;
</span><ins>+ // Both non-collapsed whitespace and non-whitespace runs need to be measured.
</ins><span class="cx"> bool measureText = positionType != NonWhitespace || !m_style.collapseWhitespace;
</span><del>- if (measureText) {
- float textWidth = this->textWidth(currentPosition, nextPosition, xPosition);
- width += textWidth;
- } else if (startPosition < nextPosition)
- width = m_style.spaceWidth;
</del><ins>+ if (measureText)
+ width = this->textWidth(currentPosition, nextPosition, xPosition);
+ else if (startPosition < nextPosition)
+ width = m_style.spaceWidth + m_style.wordSpacing;
</ins><span class="cx"> return nextPosition;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -207,7 +208,7 @@
</span><span class="cx"> run.setTabSize(!!m_style.tabWidth, m_style.tabWidth);
</span><span class="cx"> float width = m_style.font.width(run);
</span><span class="cx"> if (measureWithEndSpace)
</span><del>- width -= m_style.spaceWidth;
</del><ins>+ width -= (m_style.spaceWidth + m_style.wordSpacing);
</ins><span class="cx"> return std::max<float>(0, width);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h (192659 => 192660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h        2015-11-19 22:18:15 UTC (rev 192659)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h        2015-11-19 22:29:21 UTC (rev 192660)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx"> bool wrapLines;
</span><span class="cx"> bool breakWordOnOverflow;
</span><span class="cx"> float spaceWidth;
</span><ins>+ float wordSpacing;
</ins><span class="cx"> unsigned tabWidth;
</span><span class="cx"> AtomicString locale;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>