OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 m_relaidOutChildren.clear(); | 330 m_relaidOutChildren.clear(); |
331 | 331 |
332 if (updateLogicalWidthAndColumnWidth()) | 332 if (updateLogicalWidthAndColumnWidth()) |
333 relayoutChildren = true; | 333 relayoutChildren = true; |
334 | 334 |
335 SubtreeLayoutScope layoutScope(*this); | 335 SubtreeLayoutScope layoutScope(*this); |
336 LayoutUnit previousHeight = logicalHeight(); | 336 LayoutUnit previousHeight = logicalHeight(); |
337 setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight())
; | 337 setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight())
; |
338 | 338 |
| 339 PaintLayerScrollableArea::DelayScrollPositionClampScope delayClampScope; |
| 340 |
339 { | 341 { |
340 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); | 342 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); |
341 LayoutState state(*this, locationOffset()); | 343 LayoutState state(*this, locationOffset()); |
342 | 344 |
343 m_numberOfInFlowChildrenOnFirstLine = -1; | 345 m_numberOfInFlowChildrenOnFirstLine = -1; |
344 | 346 |
345 LayoutBlock::startDelayUpdateScrollInfo(); | |
346 | |
347 prepareOrderIteratorAndMargins(); | 347 prepareOrderIteratorAndMargins(); |
348 | 348 |
349 layoutFlexItems(relayoutChildren, layoutScope); | 349 layoutFlexItems(relayoutChildren, layoutScope); |
350 | 350 if (PaintLayerScrollableArea::PreventRelayoutScope::relayoutNeeded()) { |
351 ScrollPositionMap scrollMap; | 351 PaintLayerScrollableArea::FreezeScrollbarsScope freezeScrollbarsScop
e; |
352 if (LayoutBlock::finishDelayUpdateScrollInfo(&layoutScope, &scrollMap))
{ | |
353 prepareOrderIteratorAndMargins(); | 352 prepareOrderIteratorAndMargins(); |
354 layoutFlexItems(false, layoutScope); | 353 layoutFlexItems(true, layoutScope); |
355 for (auto& entry : scrollMap) { | 354 PaintLayerScrollableArea::PreventRelayoutScope::resetRelayoutNeeded(
); |
356 entry.key->scrollToPosition(entry.value, ScrollOffsetClamped); | |
357 } | |
358 } | 355 } |
359 | 356 |
360 if (logicalHeight() != previousHeight) | 357 if (logicalHeight() != previousHeight) |
361 relayoutChildren = true; | 358 relayoutChildren = true; |
362 | 359 |
363 layoutPositionedObjects(relayoutChildren || isDocumentElement()); | 360 layoutPositionedObjects(relayoutChildren || isDocumentElement()); |
364 | 361 |
365 // FIXME: css3/flexbox/repaint-rtl-column.html seems to issue paint inva
lidations for more overflow than it needs to. | 362 // FIXME: css3/flexbox/repaint-rtl-column.html seems to issue paint inva
lidations for more overflow than it needs to. |
366 computeOverflow(clientLogicalBottomAfterRepositioning()); | 363 computeOverflow(clientLogicalBottomAfterRepositioning()); |
367 } | 364 } |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 Vector<LineContext> lineContexts; | 839 Vector<LineContext> lineContexts; |
843 OrderedFlexItemList orderedChildren; | 840 OrderedFlexItemList orderedChildren; |
844 LayoutUnit sumFlexBaseSize; | 841 LayoutUnit sumFlexBaseSize; |
845 double totalFlexGrow; | 842 double totalFlexGrow; |
846 double totalFlexShrink; | 843 double totalFlexShrink; |
847 double totalWeightedFlexShrink; | 844 double totalWeightedFlexShrink; |
848 LayoutUnit sumHypotheticalMainSize; | 845 LayoutUnit sumHypotheticalMainSize; |
849 | 846 |
850 Vector<LayoutUnit, 16> childSizes; | 847 Vector<LayoutUnit, 16> childSizes; |
851 | 848 |
| 849 PaintLayerScrollableArea::PreventRelayoutScope preventRelayoutScope(layoutSc
ope); |
| 850 |
852 dirtyForLayoutFromPercentageHeightDescendants(layoutScope); | 851 dirtyForLayoutFromPercentageHeightDescendants(layoutScope); |
853 | 852 |
854 m_orderIterator.first(); | 853 m_orderIterator.first(); |
855 LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefor
e(); | 854 LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefor
e(); |
856 while (computeNextFlexLine(orderedChildren, sumFlexBaseSize, totalFlexGrow,
totalFlexShrink, totalWeightedFlexShrink, sumHypotheticalMainSize, relayoutChild
ren)) { | 855 while (computeNextFlexLine(orderedChildren, sumFlexBaseSize, totalFlexGrow,
totalFlexShrink, totalWeightedFlexShrink, sumHypotheticalMainSize, relayoutChild
ren)) { |
857 LayoutUnit containerMainInnerSize = mainAxisContentExtent(sumHypothetica
lMainSize); | 856 LayoutUnit containerMainInnerSize = mainAxisContentExtent(sumHypothetica
lMainSize); |
858 // availableFreeSpace is the initial amount of free space in this flexbo
x. | 857 // availableFreeSpace is the initial amount of free space in this flexbo
x. |
859 // remainingFreeSpace starts out at the same value but as we place and l
ay out | 858 // remainingFreeSpace starts out at the same value but as we place and l
ay out |
860 // flex items we subtract from it. Note that both values can be negative
. | 859 // flex items we subtract from it. Note that both values can be negative
. |
861 const LayoutUnit availableFreeSpace = containerMainInnerSize - sumFlexBa
seSize; | 860 const LayoutUnit availableFreeSpace = containerMainInnerSize - sumFlexBa
seSize; |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 ASSERT(child); | 1900 ASSERT(child); |
1902 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1901 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1903 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1902 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1904 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1903 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1905 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1904 adjustAlignmentForChild(*child, newOffset - originalOffset); |
1906 } | 1905 } |
1907 } | 1906 } |
1908 } | 1907 } |
1909 | 1908 |
1910 } // namespace blink | 1909 } // namespace blink |
OLD | NEW |