Changeset 283546 in webkit
- Timestamp:
- Oct 5, 2021 5:10:00 AM (10 months ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-scrollIntoView-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-scrollIntoView-expected.txt (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderElement.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283545 r283546 1 2021-10-05 Martin Robinson <mrobinson@webkit.org> 2 3 [css-position-sticky] scrollIntoView should not take into account sticky positioning offsets 4 https://bugs.webkit.org/show_bug.cgi?id=230689 5 6 Reviewed by Simon Fraser. 7 8 * platform/ios-wk2/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-scrollIntoView-expected.txt: Removed. 9 1 10 2021-10-05 Youenn Fablet <youenn@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/ChangeLog
r283539 r283546 1 2021-10-05 Martin Robinson <mrobinson@webkit.org> 2 3 [css-position-sticky] scrollIntoView should not take into account sticky positioning offsets 4 https://bugs.webkit.org/show_bug.cgi?id=230689 5 6 Reviewed by Simon Fraser. 7 8 * web-platform-tests/css/css-position/sticky/position-sticky-scrollIntoView-expected.txt: Update results to show newly 9 passing test. 10 1 11 2021-10-05 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-scrollIntoView-expected.txt
r280960 r283546 6 6 7 7 8 FAIL scrolling a sticky element into view should use its unshifted position assert_approx_equals: expected 1122 +/- 1 but got 561 8 PASS scrolling a sticky element into view should use its unshifted position 9 9 -
trunk/Source/WebCore/ChangeLog
r283544 r283546 1 2021-10-05 Martin Robinson <mrobinson@webkit.org> 2 3 [css-position-sticky] scrollIntoView should not take into account sticky positioning offsets 4 https://bugs.webkit.org/show_bug.cgi?id=230689 5 6 Reviewed by Simon Fraser. 7 8 When calculating the location for absolute anchors rectangles, 9 do not take into account sticky offsets. This means that when 10 scrolling to elements that are stickily positioned, their static 11 positions will be targeted. 12 13 No new tests. This is covered by an existing WPT test. 14 15 * rendering/RenderElement.cpp: 16 (WebCore::RenderElement::getLeadingCorner const): Do not take into account sticky position when calculating this point. 17 (WebCore::RenderElement::getTrailingCorner const): Ditto. 18 1 19 2021-10-05 Tim Nguyen <ntim@apple.com> 2 20 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r283464 r283546 1614 1614 bool RenderElement::getLeadingCorner(FloatPoint& point, bool& insideFixed) const 1615 1615 { 1616 // When scrolling elements into view, ignore sticky offsets and scroll to the static 1617 // position of the element. See: https://drafts.csswg.org/css-position/#stickypos-scroll. 1618 OptionSet<MapCoordinatesMode> localToAbsoluteMode { UseTransforms, IgnoreStickyOffsets }; 1619 1616 1620 if (!isInline() || isReplaced()) { 1617 point = localToAbsolute(FloatPoint(), UseTransforms, &insideFixed);1621 point = localToAbsolute(FloatPoint(), localToAbsoluteMode, &insideFixed); 1618 1622 return true; 1619 1623 } … … 1641 1645 1642 1646 if (!o->isInline() || o->isReplaced()) { 1643 point = o->localToAbsolute(FloatPoint(), UseTransforms, &insideFixed);1647 point = o->localToAbsolute(FloatPoint(), localToAbsoluteMode, &insideFixed); 1644 1648 return true; 1645 1649 } … … 1655 1659 } else if (is<RenderBox>(*o)) 1656 1660 point.moveBy(downcast<RenderBox>(*o).location()); 1657 point = o->container()->localToAbsolute(point, UseTransforms, &insideFixed);1661 point = o->container()->localToAbsolute(point, localToAbsoluteMode, &insideFixed); 1658 1662 return true; 1659 1663 } … … 1671 1675 bool RenderElement::getTrailingCorner(FloatPoint& point, bool& insideFixed) const 1672 1676 { 1677 // When scrolling elements into view, ignore sticky offsets and scroll to the static 1678 // position of the element. See: https://drafts.csswg.org/css-position/#stickypos-scroll. 1679 OptionSet<MapCoordinatesMode> localToAbsoluteMode { UseTransforms, IgnoreStickyOffsets }; 1680 1673 1681 if (!isInline() || isReplaced()) { 1674 point = localToAbsolute(LayoutPoint(downcast<RenderBox>(*this).size()), UseTransforms, &insideFixed);1682 point = localToAbsolute(LayoutPoint(downcast<RenderBox>(*this).size()), localToAbsoluteMode, &insideFixed); 1675 1683 return true; 1676 1684 } … … 1703 1711 } else 1704 1712 point.moveBy(downcast<RenderBox>(*o).frameRect().maxXMaxYCorner()); 1705 point = o->container()->localToAbsolute(point, UseTransforms, &insideFixed);1713 point = o->container()->localToAbsolute(point, localToAbsoluteMode, &insideFixed); 1706 1714 return true; 1707 1715 }
Note: See TracChangeset
for help on using the changeset viewer.