Title: [179047] trunk/Source/WebCore
Revision
179047
Author
[email protected]
Date
2015-01-23 17:12:06 -0800 (Fri, 23 Jan 2015)

Log Message

Simple line layout: Use only FlowContents::nextTextFragment() to read fragments from the text flow.
https://bugs.webkit.org/show_bug.cgi?id=140842

Reviewed by Antti Koivisto.

This is in preparation to make FlowContents a content iterator class.

No change in functionality.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::initializeNewLine):
* rendering/SimpleLineLayoutFlowContents.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (179046 => 179047)


--- trunk/Source/WebCore/ChangeLog	2015-01-24 01:05:32 UTC (rev 179046)
+++ trunk/Source/WebCore/ChangeLog	2015-01-24 01:12:06 UTC (rev 179047)
@@ -1,3 +1,18 @@
+2015-01-23  Zalan Bujtas  <[email protected]>
+
+        Simple line layout: Use only FlowContents::nextTextFragment() to read fragments from the text flow.
+        https://bugs.webkit.org/show_bug.cgi?id=140842
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation to make FlowContents a content iterator class.
+
+        No change in functionality.
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::initializeNewLine):
+        * rendering/SimpleLineLayoutFlowContents.h:
+
 2015-01-23  Bartlomiej Gajda  <[email protected]>
 
         [MSE] Implement Range Removal algorithm.

Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (179046 => 179047)


--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2015-01-24 01:05:32 UTC (rev 179046)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2015-01-24 01:12:06 UTC (rev 179047)
@@ -378,8 +378,12 @@
     }
 
     if (overflowedFragment.isEmpty()) {
-        unsigned spaceCount = 0;
-        lineState.jumpTo(style.collapseWhitespace ? flowContents.findNextNonWhitespacePosition(linePositon, spaceCount) : linePositon, 0);
+        if (style.collapseWhitespace) {
+            auto firstFragment = flowContents.nextTextFragment(linePositon, 0);
+            if (firstFragment.type == FlowContents::TextFragment::Whitespace)
+                linePositon = firstFragment.end;
+        }
+        lineState.jumpTo(linePositon, 0);
         return lineState;
     }
 

Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h (179046 => 179047)


--- trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h	2015-01-24 01:05:32 UTC (rev 179046)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h	2015-01-24 01:12:06 UTC (rev 179047)
@@ -63,12 +63,8 @@
         bool isBreakable = false;
         float width = 0;
     };
-
     TextFragment nextTextFragment(unsigned position, float xPosition) const;
-    unsigned findNextNonWhitespacePosition(unsigned position, unsigned& spaceCount) const;
-
     float textWidth(unsigned from, unsigned to, float xPosition) const;
-
     bool isLineBreak(unsigned position) const;
     bool isEnd(unsigned position) const;
 
@@ -100,6 +96,7 @@
     const Style& style() const { return m_style; }
 
 private:
+    unsigned findNextNonWhitespacePosition(unsigned position, unsigned& spaceCount) const;
     unsigned findNextBreakablePosition(unsigned position) const;
     unsigned segmentIndexForPosition(unsigned position) const;
     unsigned segmentIndexForPositionSlow(unsigned position) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to