Changeset 278659 in webkit
- Timestamp:
- Jun 9, 2021, 7:47:55 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278654 r278659 1 2021-06-09 Alan Bujtas <zalan@apple.com> 2 3 [Flexbox] FlexItem stays invisible after initial layout 4 https://bugs.webkit.org/show_bug.cgi?id=226778 5 6 Reviewed by Simon Fraser. 7 8 * fast/flexbox/repaint-issue-when-flex-item-appears-expected.txt: Added. 9 * fast/flexbox/repaint-issue-when-flex-item-appears.html: Added. 10 1 11 2021-06-09 Diego Pino Garcia <dpino@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r278657 r278659 1 2021-06-09 Alan Bujtas <zalan@apple.com> 2 3 [Flexbox] FlexItem stays invisible after initial layout 4 https://bugs.webkit.org/show_bug.cgi?id=226778 5 6 Reviewed by Simon Fraser. 7 8 RenderFlexibleBox::layoutAndPlaceChildren() initiates repaint() on newly constructed flex items by checking their everHadLayout bit. 9 This is similar to what we do for regular block layout when block level boxes appear. 10 However flexitems are laid out multiple times, first right after they are constructed in constructFlexItem. This initial layout 11 sets everHadLayout bit to true which makes the check in layoutAndPlaceChildren somewhat late. 12 13 Test: fast/flexbox/repaint-issue-when-flex-item-appears.html 14 15 * rendering/FlexibleBoxAlgorithm.cpp: 16 (WebCore::FlexItem::FlexItem): 17 * rendering/FlexibleBoxAlgorithm.h: 18 * rendering/RenderFlexibleBox.cpp: 19 (WebCore::RenderFlexibleBox::constructFlexItem): 20 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): 21 1 22 2021-06-09 Alexander Mikhaylenko <alexm@gnome.org> 2 23 -
trunk/Source/WebCore/rendering/FlexibleBoxAlgorithm.cpp
r267829 r278659 36 36 namespace WebCore { 37 37 38 FlexItem::FlexItem(RenderBox& box, LayoutUnit flexBaseContentSize, LayoutUnit hypotheticalMainContentSize, LayoutUnit mainAxisBorderAndPadding, LayoutUnit mainAxisMargin )38 FlexItem::FlexItem(RenderBox& box, LayoutUnit flexBaseContentSize, LayoutUnit hypotheticalMainContentSize, LayoutUnit mainAxisBorderAndPadding, LayoutUnit mainAxisMargin, bool everHadLayout) 39 39 : box(box) 40 40 , flexBaseContentSize(flexBaseContentSize) … … 42 42 , mainAxisBorderAndPadding(mainAxisBorderAndPadding) 43 43 , mainAxisMargin(mainAxisMargin) 44 , frozen(false)44 , everHadLayout(everHadLayout) 45 45 { 46 46 ASSERT(!box.isOutOfFlowPositioned()); -
trunk/Source/WebCore/rendering/FlexibleBoxAlgorithm.h
r267829 r278659 42 42 class FlexItem { 43 43 public: 44 FlexItem(RenderBox&, LayoutUnit flexBaseContentSize, LayoutUnit hypotheticalMainContentSize, LayoutUnit mainAxisBorderAndPadding, LayoutUnit mainAxisMargin );44 FlexItem(RenderBox&, LayoutUnit flexBaseContentSize, LayoutUnit hypotheticalMainContentSize, LayoutUnit mainAxisBorderAndPadding, LayoutUnit mainAxisMargin, bool everHadLayout); 45 45 46 46 LayoutUnit hypotheticalMainAxisMarginBoxSize() const … … 65 65 const LayoutUnit mainAxisMargin; 66 66 LayoutUnit flexedContentSize; 67 bool frozen; 67 bool frozen { false }; 68 bool everHadLayout { false }; 68 69 }; 69 70 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r278450 r278659 1309 1309 FlexItem RenderFlexibleBox::constructFlexItem(RenderBox& child, bool relayoutChildren) 1310 1310 { 1311 auto childHadLayout = child.everHadLayout(); 1311 1312 child.clearOverridingContentSize(); 1312 1313 if (childHasIntrinsicMainAxisSize(child)) { … … 1336 1337 LayoutUnit childMinMaxAppliedMainAxisExtent = adjustChildSizeForMinAndMax(child, childInnerFlexBaseSize); 1337 1338 LayoutUnit margin = isHorizontalFlow() ? child.horizontalMarginExtent() : child.verticalMarginExtent(); 1338 return FlexItem(child, childInnerFlexBaseSize, childMinMaxAppliedMainAxisExtent, borderAndPadding, margin );1339 return FlexItem(child, childInnerFlexBaseSize, childMinMaxAppliedMainAxisExtent, borderAndPadding, margin, childHadLayout); 1339 1340 } 1340 1341 … … 1738 1739 const auto& flexItem = children[i]; 1739 1740 auto& child = flexItem.box; 1740 bool childHadLayout = child.everHadLayout();1741 1741 1742 1742 ASSERT(!flexItem.box.isOutOfFlowPositioned()); … … 1769 1769 m_relaidOutChildren.add(&child); 1770 1770 child.layoutIfNeeded(); 1771 if (! childHadLayout && child.checkForRepaintDuringLayout()) {1771 if (!flexItem.everHadLayout && child.checkForRepaintDuringLayout()) { 1772 1772 child.repaint(); 1773 1773 child.repaintOverhangingFloats(true);
Note:
See TracChangeset
for help on using the changeset viewer.