Changeset 240921 in webkit
- Timestamp:
- Feb 4, 2019 7:39:48 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r240916 r240921 1 2019-02-04 Frederic Wang <fwang@igalia.com> 2 3 [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow 4 https://bugs.webkit.org/show_bug.cgi?id=191816 5 6 Reviewed by Wenson Hsieh. 7 8 Add a test to verify that children with non-visible overflow create snap offsets. 9 10 * css3/scroll-snap/scroll-snap-children-with-overflow-expected.txt: Added. 11 * css3/scroll-snap/scroll-snap-children-with-overflow.html: Added. 12 1 13 2019-02-03 Antti Koivisto <antti@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r240918 r240921 1 2019-02-04 Frederic Wang <fwang@igalia.com> 2 3 [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow 4 https://bugs.webkit.org/show_bug.cgi?id=191816 5 6 Reviewed by Wenson Hsieh. 7 8 This patch fixes a bug that prevents children of a scroll container to create snap positions 9 when they have non-visible overflow. This happens because for such a child, the function 10 RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the 11 scroll container. To address that issue, we introduce a new 12 RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that 13 a real RenderBox ancestor is returned. 14 15 Test: css3/scroll-snap/scroll-snap-children-with-overflow.html 16 17 * page/scrolling/AxisScrollSnapOffsets.cpp: 18 (WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping() 19 so that we don't skip children with non-visible overflow. 20 * rendering/RenderLayerModelObject.cpp: 21 (WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls 22 enclosingBox(). 23 * rendering/RenderObject.cpp: 24 (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return 25 the scrollable container of the enclosing box. If it is actually the render object itself 26 then start the search from the parent box instead. 27 * rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping(). 28 1 29 2019-02-04 Antti Koivisto <antti@apple.com> 2 30 -
trunk/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
r240892 r240921 235 235 #endif 236 236 for (auto* child : scrollContainer->view().boxesWithScrollSnapPositions()) { 237 if (child-> findEnclosingScrollableContainer() != scrollContainer)237 if (child->enclosingScrollableContainerForSnapping() != scrollContainer) 238 238 continue; 239 239 -
trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp
r238837 r240921 220 220 } 221 221 if (oldStyle && oldStyle->scrollSnapArea() != newStyle.scrollSnapArea()) { 222 const RenderBox* scrollSnapBox = enclosingBox().findEnclosingScrollableContainer();222 auto* scrollSnapBox = enclosingScrollableContainerForSnapping(); 223 223 if (scrollSnapBox && scrollSnapBox->layer()) { 224 224 const RenderStyle& style = scrollSnapBox->style(); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r239685 r240921 439 439 } 440 440 441 const RenderBox* RenderObject::enclosingScrollableContainerForSnapping() const 442 { 443 auto& renderBox = enclosingBox(); 444 if (auto* scrollableContainer = renderBox.findEnclosingScrollableContainer()) { 445 // The scrollable container for snapping cannot be the node itself. 446 if (scrollableContainer != this) 447 return scrollableContainer; 448 if (renderBox.parentBox()) 449 return renderBox.parentBox()->findEnclosingScrollableContainer(); 450 } 451 return nullptr; 452 } 453 441 454 RenderBlock* RenderObject::firstLineBlock() const 442 455 { -
trunk/Source/WebCore/rendering/RenderObject.h
r239685 r240921 166 166 WEBCORE_EXPORT RenderBox& enclosingBox() const; 167 167 RenderBoxModelObject& enclosingBoxModelObject() const; 168 const RenderBox* enclosingScrollableContainerForSnapping() const; 168 169 169 170 // Function to return our enclosing flow thread if we are contained inside one. This
Note: See TracChangeset
for help on using the changeset viewer.