haikuwebkit/LayoutTests/fast/repaint/justify-items-change-expect...

9 lines
165 B
Plaintext
Raw Permalink Normal View History

[CSS Grid Layout] Relayout whenever Box Alignment properties change https://bugs.webkit.org/show_bug.cgi?id=148070 Reviewed by Darin Adler. Source/WebCore: We were Reattaching the styles to the RenderTree whenever Content Alignment properties (align-items and justify-items) changed their values, since the Self Alignment properties depend on such values to resolve 'auto' values during layout. This patch removes such restriction, since we resolve the auto values whenever we access the alignment properties. The only thing we need to do is to mark a grid item for layout whenever the Default Alignment properties change from/to stretch, since it implies a resize of the grid items using 'auto' values for the Self Alignment properties. Tests: fast/css-grid-layout/relayout-align-items-changed.html fast/css-grid-layout/relayout-align-self-changed.html fast/css-grid-layout/relayout-justify-items-changed.html fast/css-grid-layout/relayout-justify-self-changed.html fast/repaint/align-items-change.html fast/repaint/align-items-overflow-change.html fast/repaint/align-self-change.html fast/repaint/align-self-overflow-change.html fast/repaint/justify-items-change.html fast/repaint/justify-items-legacy-change.html fast/repaint/justify-items-overflow-change.html fast/repaint/justify-self-change.html fast/repaint/justify-self-overflow-change.html * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentIsStretch): (WebCore::RenderGrid::styleDidChange): * rendering/RenderGrid.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::resolveAlignmentOverflow): (WebCore::RenderStyle::changeRequiresLayout): * style/StyleResolveTree.cpp: (WebCore::Style::determineChange): Deleted. LayoutTests: Tests to verify we force a layout of grid container or grid items, as appropriated, whenever Box Alignment properties change their value. This patch also adds some repaint tests, so we can ensure we generate the correct repaint rects as well. * fast/css-grid-layout/relayout-align-items-changed-expected.txt: Added. * fast/css-grid-layout/relayout-align-items-changed.html: Added. * fast/css-grid-layout/relayout-align-self-changed-expected.txt: Added. * fast/css-grid-layout/relayout-align-self-changed.html: Added. * fast/css-grid-layout/relayout-justify-items-changed-expected.txt: Added. * fast/css-grid-layout/relayout-justify-items-changed.html: Added. * fast/css-grid-layout/relayout-justify-self-changed-expected.txt: Added. * fast/css-grid-layout/relayout-justify-self-changed.html: Added. * fast/repaint/align-items-change-expected.txt: Added. * fast/repaint/align-items-change.html: Added. * fast/repaint/align-items-overflow-change-expected.txt: Added. * fast/repaint/align-items-overflow-change.html: Added. * fast/repaint/align-self-change-expected.txt: Added. * fast/repaint/align-self-change.html: Added. * fast/repaint/align-self-overflow-change-expected.txt: Added. * fast/repaint/align-self-overflow-change.html: Added. * fast/repaint/justify-items-change-expected.txt: Added. * fast/repaint/justify-items-change.html: Added. * fast/repaint/justify-items-legacy-change-expected.txt: Added. * fast/repaint/justify-items-legacy-change.html: Added. * fast/repaint/justify-items-overflow-change-expected.txt: Added. * fast/repaint/justify-items-overflow-change.html: Added. * fast/repaint/justify-self-change-expected.txt: Added. * fast/repaint/justify-self-change.html: Added. * fast/repaint/justify-self-overflow-change-expected.txt: Added. * fast/repaint/justify-self-overflow-change.html: Added. Canonical link: https://commits.webkit.org/167356@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-09-17 09:13:35 +00:00
Tests invalidation on justify-items style change. Passes if there is no red.
(repaint rects
REGRESSION: Block no longer shrinks to preferred width in this flex box layout https://bugs.webkit.org/show_bug.cgi?id=169203 <rdar://problem/30873895> Reviewed by Simon Fraser. Source/WebCore: Added new test in css3/flexbox. * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): (WebCore::StyleResolver::adjustStyleForAlignment): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): Resolve auto alignment values by adjusting the render style as needed. Make a helper function for adjusting only alignment that can be called from the inner text control custom style creation. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild): Replaced items in grids should not stretch by default. * rendering/RenderBox.cpp: (WebCore::RenderBox::hasStretchedLogicalWidth): Patched to properly check the default alignment for the child, making sure that if it's a replacd item inside a grid, that the default is start and not stretch. * rendering/RenderBox.h: (WebCore::RenderBox::selfAlignmentNormalBehavior): Self-alignment function now takes an optional child argument, since the behavior varies in grids depending on the child being replaced or not. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::alignmentForChild): Fixed to do the right thing when the child is anonymous. (WebCore::RenderFlexibleBox::styleDidChange): Deleted. * rendering/RenderFlexibleBox.h: Deleted, since alignment changes are handled at the style diff level now. * rendering/RenderFullScreen.h: Patched the selfAlignmentNormalBehavior method to take an optional child argument. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::styleDidChange): (WebCore::RenderGrid::alignSelfForChild): (WebCore::RenderGrid::justifySelfForChild): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::defaultAlignmentIsStretch): Deleted. (WebCore::defaultAlignmentChangedToStretchInRowAxis): Deleted. (WebCore::defaultAlignmentChangedFromStretchInRowAxis): Deleted. (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): Deleted. (WebCore::selfAlignmentChangedToStretchInRowAxis): Deleted. (WebCore::selfAlignmentChangedFromStretchInRowAxis): Deleted. (WebCore::selfAlignmentChangedFromStretchInColumnAxis): Deleted. * rendering/RenderGrid.h: Removed the alignment change logic in styleDidChange for grids, since style diffing handles it now. Updated all selfAlignmentForNormalBehavior queries to pass in the child so that replaced elements are handled properly. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::overflowInlineDirection): (WebCore::RenderStyle::overflowBlockDirection): (WebCore::RenderStyle::setJustifySelfPosition): New helpers used by grid and by adjustRenderStyle. * style/StyleChange.cpp: (WebCore::Style::determineChange): If alignment or justification changes occur on a parent that could affect the child (e.g., align-items) return Inherit so the child render styles get adjusted properly. LayoutTests: * css3/flexbox/column-inside-normal-block-preferred-width-expected.html: Added. * css3/flexbox/column-inside-normal-block-preferred-width.html: Added. * fast/css-grid-layout/grid-align-stretching-replaced-items-expected.txt: * fast/css-grid-layout/grid-align-stretching-replaced-items.html: * fast/repaint/align-items-change-expected.txt: * fast/repaint/align-items-overflow-change-expected.txt: * fast/repaint/justify-items-change-expected.txt: * fast/repaint/justify-items-legacy-change-expected.txt: * fast/repaint/justify-items-overflow-change-expected.txt: Canonical link: https://commits.webkit.org/186244@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-07 01:29:19 +00:00
(rect 150 52 50 300)
(rect 150 52 200 300)
[CSS Grid Layout] Relayout whenever Box Alignment properties change https://bugs.webkit.org/show_bug.cgi?id=148070 Reviewed by Darin Adler. Source/WebCore: We were Reattaching the styles to the RenderTree whenever Content Alignment properties (align-items and justify-items) changed their values, since the Self Alignment properties depend on such values to resolve 'auto' values during layout. This patch removes such restriction, since we resolve the auto values whenever we access the alignment properties. The only thing we need to do is to mark a grid item for layout whenever the Default Alignment properties change from/to stretch, since it implies a resize of the grid items using 'auto' values for the Self Alignment properties. Tests: fast/css-grid-layout/relayout-align-items-changed.html fast/css-grid-layout/relayout-align-self-changed.html fast/css-grid-layout/relayout-justify-items-changed.html fast/css-grid-layout/relayout-justify-self-changed.html fast/repaint/align-items-change.html fast/repaint/align-items-overflow-change.html fast/repaint/align-self-change.html fast/repaint/align-self-overflow-change.html fast/repaint/justify-items-change.html fast/repaint/justify-items-legacy-change.html fast/repaint/justify-items-overflow-change.html fast/repaint/justify-self-change.html fast/repaint/justify-self-overflow-change.html * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentIsStretch): (WebCore::RenderGrid::styleDidChange): * rendering/RenderGrid.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::resolveAlignmentOverflow): (WebCore::RenderStyle::changeRequiresLayout): * style/StyleResolveTree.cpp: (WebCore::Style::determineChange): Deleted. LayoutTests: Tests to verify we force a layout of grid container or grid items, as appropriated, whenever Box Alignment properties change their value. This patch also adds some repaint tests, so we can ensure we generate the correct repaint rects as well. * fast/css-grid-layout/relayout-align-items-changed-expected.txt: Added. * fast/css-grid-layout/relayout-align-items-changed.html: Added. * fast/css-grid-layout/relayout-align-self-changed-expected.txt: Added. * fast/css-grid-layout/relayout-align-self-changed.html: Added. * fast/css-grid-layout/relayout-justify-items-changed-expected.txt: Added. * fast/css-grid-layout/relayout-justify-items-changed.html: Added. * fast/css-grid-layout/relayout-justify-self-changed-expected.txt: Added. * fast/css-grid-layout/relayout-justify-self-changed.html: Added. * fast/repaint/align-items-change-expected.txt: Added. * fast/repaint/align-items-change.html: Added. * fast/repaint/align-items-overflow-change-expected.txt: Added. * fast/repaint/align-items-overflow-change.html: Added. * fast/repaint/align-self-change-expected.txt: Added. * fast/repaint/align-self-change.html: Added. * fast/repaint/align-self-overflow-change-expected.txt: Added. * fast/repaint/align-self-overflow-change.html: Added. * fast/repaint/justify-items-change-expected.txt: Added. * fast/repaint/justify-items-change.html: Added. * fast/repaint/justify-items-legacy-change-expected.txt: Added. * fast/repaint/justify-items-legacy-change.html: Added. * fast/repaint/justify-items-overflow-change-expected.txt: Added. * fast/repaint/justify-items-overflow-change.html: Added. * fast/repaint/justify-self-change-expected.txt: Added. * fast/repaint/justify-self-change.html: Added. * fast/repaint/justify-self-overflow-change-expected.txt: Added. * fast/repaint/justify-self-overflow-change.html: Added. Canonical link: https://commits.webkit.org/167356@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-09-17 09:13:35 +00:00
(rect 0 52 200 300)
)