Simple line layout: Move setCollapedWhitespaceWidth call to updateLineConstrains.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2017 19:01:15 +0000 (19:01 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2017 19:01:15 +0000 (19:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172178

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::updateLineConstrains):
(WebCore::SimpleLineLayout::createLineRuns):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216940 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp

index fab6ae9..fa0afc9 100644 (file)
@@ -1,3 +1,16 @@
+2017-05-16  Zalan Bujtas  <zalan@apple.com>
+
+        Simple line layout: Move setCollapedWhitespaceWidth call to updateLineConstrains.
+        https://bugs.webkit.org/show_bug.cgi?id=172178
+
+        Reviewed by Antti Koivisto.
+
+        No change in functionality.
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::updateLineConstrains):
+        (WebCore::SimpleLineLayout::createLineRuns):
+
 2017-05-16  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] Return default device list until user gives permission to capture
index 419064b..23b262a 100644 (file)
@@ -608,7 +608,7 @@ static void updateLineConstrains(const RenderBlockFlow& flow, LineState& line, c
     numberOfPrecedingLinesWithHyphen = (previousLine.isEmpty() || !previousLine.lastFragment().hasHyphen()) ? 0 : numberOfPrecedingLinesWithHyphen + 1;
     if (style.hyphenLimitLines && numberOfPrecedingLinesWithHyphen >= *style.hyphenLimitLines)
         line.setHyphenationDisabled();
-
+    line.setCollapedWhitespaceWidth(style.font.spaceWidth() + style.wordSpacing);
 }
 
 struct SplitFragmentData {
@@ -781,7 +781,6 @@ static void forceFragmentToLine(LineState& line, TextFragmentIterator& textFragm
 static bool createLineRuns(LineState& line, const LineState& previousLine, Layout::RunVector& runs, TextFragmentIterator& textFragmentIterator)
 {
     const auto& style = textFragmentIterator.style();
-    line.setCollapedWhitespaceWidth(style.font.spaceWidth() + style.wordSpacing);
     bool lineCanBeWrapped = style.wrapLines || style.breakFirstWordOnOverflow || style.breakAnyWordOnOverflow;
     auto fragment = firstFragment(textFragmentIterator, line, previousLine, runs);
     while (fragment.type() != TextFragmentIterator::TextFragment::ContentEnd) {