Title: [229806] trunk/Tools
Revision
229806
Author
[email protected]
Date
2018-03-21 07:44:08 -0700 (Wed, 21 Mar 2018)

Log Message

[LayoutReloaded] Move inline lines to InlineFormattingState.
https://bugs.webkit.org/show_bug.cgi?id=183814

Reviewed by Antti Koivisto.

InlineFormattingContext is not supposed to hold state.

* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
(InlineFormattingContext.prototype._commitLine):
(InlineFormattingContext.prototype._createNewLine):
(InlineFormattingContext.prototype.lines): Deleted.
(InlineFormattingContext.prototype._initializeLine): Deleted.
* LayoutReloaded/FormattingState/InlineFormattingState.js:
(InlineFormattingState):
(InlineFormattingState.prototype.lines):
(InlineFormattingState.prototype.appendLine):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (229805 => 229806)


--- trunk/Tools/ChangeLog	2018-03-21 14:37:03 UTC (rev 229805)
+++ trunk/Tools/ChangeLog	2018-03-21 14:44:08 UTC (rev 229806)
@@ -1,3 +1,23 @@
+2018-03-21  Zalan Bujtas  <[email protected]>
+
+        [LayoutReloaded] Move inline lines to InlineFormattingState.
+        https://bugs.webkit.org/show_bug.cgi?id=183814
+
+        Reviewed by Antti Koivisto.
+
+        InlineFormattingContext is not supposed to hold state.
+
+        * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
+        (InlineFormattingContext):
+        (InlineFormattingContext.prototype._commitLine):
+        (InlineFormattingContext.prototype._createNewLine):
+        (InlineFormattingContext.prototype.lines): Deleted.
+        (InlineFormattingContext.prototype._initializeLine): Deleted.
+        * LayoutReloaded/FormattingState/InlineFormattingState.js:
+        (InlineFormattingState):
+        (InlineFormattingState.prototype.lines):
+        (InlineFormattingState.prototype.appendLine):
+
 2018-03-21  Ms2ger  <[email protected]>
 
         [WPE] Disable most of TestWebKitFaviconDatabase.

Modified: trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js (229805 => 229806)


--- trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js	2018-03-21 14:37:03 UTC (rev 229805)
+++ trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js	2018-03-21 14:44:08 UTC (rev 229806)
@@ -30,15 +30,9 @@
         ASSERT(root.isBlockContainerBox());
         if (root.establishesBlockFormattingContext())
             this.m_floatingContext = new FloatingContext(this);
-        this._initializeLine();
-        this.m_lines = new Array();
+        this.m_line = this._createNewLine();
     }
 
-    lines() {
-        // TODO: this is temporary. Line boxes will live off of the BoxTree.
-        return this.m_lines;
-    }
-
     layout() {
         // 9.4.2 Inline formatting contexts
         // In an inline formatting context, boxes are laid out horizontally, one after the other, beginning at the top of a containing block.
@@ -96,8 +90,8 @@
     }
 
     _commitLine() {
-        this.m_lines.push(this._line());
-        this._initializeLine();
+        this.formattingState().appendLine(this._line());
+        this.m_line = this._createNewLine();
     }
 
     _line() {
@@ -104,7 +98,7 @@
         return this.m_line;
     }
 
-    _initializeLine() {
+    _createNewLine() {
         // TODO: Floats need to be taken into account.
         let contentBoxRect = this.formattingRoot().contentBox();
         this.m_line = new Line(contentBoxRect.topLeft(), Utils.computedLineHeight(this.formattingRoot()), contentBoxRect.width());

Modified: trunk/Tools/LayoutReloaded/FormattingState/InlineFormattingState.js (229805 => 229806)


--- trunk/Tools/LayoutReloaded/FormattingState/InlineFormattingState.js	2018-03-21 14:37:03 UTC (rev 229805)
+++ trunk/Tools/LayoutReloaded/FormattingState/InlineFormattingState.js	2018-03-21 14:44:08 UTC (rev 229806)
@@ -27,5 +27,14 @@
     constructor(formattingRoot, layoutState) {
         super(layoutState, formattingRoot);
         this._setFormattingContext(new InlineFormattingContext(this));
+        this.m_lines = new Array();
     }
+
+    lines() {
+        return this.m_lines;
+    }
+
+    appendLine(line) {
+        this.m_lines.push(line);
+    }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to