Changeset 230573 in webkit
- Timestamp:
- Apr 12, 2018 7:51:35 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r230565 r230573 1 2018-04-12 Zalan Bujtas <zalan@apple.com> 2 3 [LayoutReloaded] Introduce needsLayout to InlineFormattingContext 4 https://bugs.webkit.org/show_bug.cgi?id=184538 5 6 Reviewed by Antti Koivisto. 7 8 * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: 9 (BlockFormattingContext.prototype._adjustBottomWithFIXME): 10 (BlockFormattingContext): 11 (BlockFormattingContext.prototype._firstInFlowChildWithNeedsLayout): Deleted. 12 (BlockFormattingContext.prototype._nextInFlowSiblingWithNeedsLayout): Deleted. 13 * LayoutReloaded/FormattingContext/FormattingContext.js: 14 (FormattingContext.prototype._firstInFlowChildWithNeedsLayout): 15 (FormattingContext.prototype._nextInFlowSiblingWithNeedsLayout): 16 (FormattingContext): 17 * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: 18 (InlineFormattingContext.prototype.layout): 19 (InlineFormattingContext.prototype._handleInlineContainer): 20 (InlineFormattingContext.prototype._handleInlineBlockContainer): 21 (InlineFormattingContext.prototype._handleInlineContent): 22 (InlineFormattingContext.prototype._clearAndMoveToNext): 23 (InlineFormattingContext): 24 1 25 2018-04-12 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 26 -
trunk/Tools/LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js
r230555 r230573 179 179 return bottom; 180 180 } 181 182 _firstInFlowChildWithNeedsLayout(layoutBox) {183 if (!layoutBox.isContainer())184 return null;185 for (let child = layoutBox.firstInFlowOrFloatChild(); child; child = child.nextInFlowOrFloatSibling()) {186 if (this.formattingState().needsLayout(child))187 return child;188 }189 return null;190 }191 192 _nextInFlowSiblingWithNeedsLayout(layoutBox) {193 for (let sibling = layoutBox.nextInFlowOrFloatSibling(); sibling; sibling = sibling.nextInFlowOrFloatSibling()) {194 if (this.formattingState().needsLayout(sibling))195 return sibling;196 }197 return null;198 }199 181 } -
trunk/Tools/LayoutReloaded/FormattingContext/FormattingContext.js
r230555 r230573 333 333 return outOfFlowBoxes; 334 334 } 335 336 _firstInFlowChildWithNeedsLayout(layoutBox) { 337 if (!layoutBox.isContainer()) 338 return null; 339 for (let child = layoutBox.firstInFlowOrFloatChild(); child; child = child.nextInFlowOrFloatSibling()) { 340 if (this.formattingState().needsLayout(child)) 341 return child; 342 } 343 return null; 344 } 345 346 _nextInFlowSiblingWithNeedsLayout(layoutBox) { 347 for (let sibling = layoutBox.nextInFlowOrFloatSibling(); sibling; sibling = sibling.nextInFlowOrFloatSibling()) { 348 if (this.formattingState().needsLayout(sibling)) 349 return sibling; 350 } 351 return null; 352 } 335 353 } -
trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js
r230484 r230573 38 38 this.m_line = this._createNewLine(); 39 39 let inlineContainerStack = new Array(); 40 this._addToLayoutQueue(this. formattingRoot().firstInFlowOrFloatChild());40 this._addToLayoutQueue(this._firstInFlowChildWithNeedsLayout(this.formattingRoot())); 41 41 while (this._descendantNeedsLayout()) { 42 42 let layoutBox = this._nextInLayoutQueue(); … … 54 54 this._commitLine(); 55 55 ASSERT(!this.m_inlineContainerStack.length); 56 ASSERT(!this.formattingState().layoutNeeded()); 56 57 } 57 58 … … 62 63 this.m_inlineContainerStack.push(inlineContainer); 63 64 this._adjustLineForInlineContainerStart(inlineContainer); 64 this._addToLayoutQueue( inlineContainer.firstInFlowOrFloatChild());65 this._addToLayoutQueue(this._firstInFlowChildWithNeedsLayout(inlineContainer)); 65 66 // Keep the inline container in the layout stack so that we can finish it when all the descendants are all set. 66 67 return; … … 68 69 this.m_inlineContainerStack.pop(inlineContainer); 69 70 this._adjustLineForInlineContainerEnd(inlineContainer); 70 this._removeFromLayoutQueue(inlineContainer); 71 this._addToLayoutQueue(inlineContainer.nextInFlowOrFloatSibling()); 71 this._clearAndMoveToNext(inlineContainer); 72 72 // Place inflow positioned children. 73 73 this._placeInFlowPositionedChildren(inlineContainer); … … 85 85 displayBox.setHeight(Utils.height(inlineBlockContainer) + Utils.computedVerticalBorderAndPadding(inlineBlockContainer.node())); 86 86 this._adjustLineForInlineContainerEnd(inlineBlockContainer); 87 88 87 this._line().addInlineContainerBox(displayBox.size()); 89 this._removeFromLayoutQueue(inlineBlockContainer); 90 this._addToLayoutQueue(inlineBlockContainer.nextInFlowOrFloatSibling()); 88 this._clearAndMoveToNext(inlineBlockContainer); 91 89 } 92 90 … … 98 96 else 99 97 ASSERT_NOT_REACHED(); 100 this._removeFromLayoutQueue(layoutBox); 101 this._addToLayoutQueue(layoutBox.nextInFlowOrFloatSibling()); 98 this._clearAndMoveToNext(layoutBox); 102 99 } 103 100 … … 213 210 return horizontalPosition - rootLeft; 214 211 } 212 213 _clearAndMoveToNext(layoutBox) { 214 this._removeFromLayoutQueue(layoutBox); 215 this.formattingState().clearNeedsLayout(layoutBox); 216 this._addToLayoutQueue(this._nextInFlowSiblingWithNeedsLayout(layoutBox)); 217 } 215 218 } 216 219
Note: See TracChangeset
for help on using the changeset viewer.