Changeset 281446 in webkit


Ignore:
Timestamp:
Aug 23, 2021 8:11:36 AM (11 months ago)
Author:
Martin Robinson
Message:

Sticky position should not use transformed position to compute sticky offset.
https://bugs.webkit.org/show_bug.cgi?id=164292
<rdar://problem/29054773>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-position/sticky/position-sticky-transforms-translate-expected.txt: Update results

of test to show pass.

Source/WebCore:

No new tests. This change is tested by the following WPT test:

web-platform-tests/css/css-position/sticky/position-sticky-transforms-translate.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::computeStickyPositionConstraints const): When calling localToContainerQuad,
pass 0 for the mode which means that the transformation between coordinate systems does not include
transforms.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r281445 r281446  
     12021-08-23  Martin Robinson  <mrobinson@webkit.org>
     2
     3        Sticky position should not use transformed position to compute sticky offset.
     4        https://bugs.webkit.org/show_bug.cgi?id=164292
     5        <rdar://problem/29054773>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * web-platform-tests/css/css-position/sticky/position-sticky-transforms-translate-expected.txt: Update results
     10        of test to show pass.
     11
    1122021-08-23  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-transforms-translate-expected.txt

    r280960 r281446  
    22PASS Translation transform can move sticky element past sticking point
    33PASS Stuck elements can still be moved via translations
    4 FAIL The sticky element should stick before the container is offset by a translation assert_equals: expected 150 but got 100
     4PASS The sticky element should stick before the container is offset by a translation
    55
  • trunk/Source/WebCore/ChangeLog

    r281444 r281446  
     12021-08-23  Martin Robinson  <mrobinson@webkit.org>
     2
     3        Sticky position should not use transformed position to compute sticky offset.
     4        https://bugs.webkit.org/show_bug.cgi?id=164292
     5        <rdar://problem/29054773>
     6
     7        Reviewed by Simon Fraser.
     8
     9        No new tests. This change is tested by the following WPT test:
     10          web-platform-tests/css/css-position/sticky/position-sticky-transforms-translate.html
     11
     12        * rendering/RenderBoxModelObject.cpp:
     13        (WebCore::RenderBoxModelObject::computeStickyPositionConstraints const): When calling localToContainerQuad,
     14        pass 0 for the mode which means that the transformation between coordinate systems does not include
     15        transforms.
     16
    1172021-08-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r281239 r281446  
    489489    containerContentRect.contract(minMargin);
    490490
    491     // Finally compute container rect relative to the scrolling ancestor.
    492     FloatRect containerRectRelativeToScrollingAncestor = containingBlock->localToContainerQuad(FloatRect(containerContentRect), &enclosingClippingBox).boundingBox();
     491    // Finally compute container rect relative to the scrolling ancestor. We pass an empty
     492    // mode here, because sticky positioning should ignore transforms.
     493    FloatRect containerRectRelativeToScrollingAncestor = containingBlock->localToContainerQuad(FloatRect(containerContentRect), &enclosingClippingBox, { } /* ignore transforms */).boundingBox();
    493494    if (enclosingClippingLayer) {
    494495        FloatPoint containerLocationRelativeToScrollingAncestor = containerRectRelativeToScrollingAncestor.location() -
     
    509510    // rectangle in the coordinate system of the scrolling ancestor, but localToContainerQuad
    510511    // itself depends on sticky positioning! Instead, start from the parent but first adjusting
    511     // the rectangle for the writing mode of this stickily-positioned element.
     512    // the rectangle for the writing mode of this stickily-positioned element. We also pass an
     513    // empty mode here because sticky positioning should ignore transforms.
    512514    //
    513     // FIXME: For now, assume that |this| is not transformed. It would also be nice to not have to
    514     // call localToContainerQuad again since we have already done a similar call to move from
    515     // the containing block to the scrolling ancestor above, but localToContainerQuad takes care
    516     // of a lot of complex situations involving inlines, tables, and transformations.
     515    // FIXME: It would also be nice to not have to call localToContainerQuad again since we
     516    // have already done a similar call to move from the containing block to the scrolling
     517    // ancestor above, but localToContainerQuad takes care of a lot of complex situations
     518    // involving inlines, tables, and transformations.
    517519    if (parent()->isBox())
    518520        downcast<RenderBox>(parent())->flipForWritingMode(stickyBoxRect);
    519     auto stickyBoxRelativeToScrollingAncestor = parent()->localToContainerQuad(FloatRect(stickyBoxRect), &enclosingClippingBox).boundingBox();
     521    auto stickyBoxRelativeToScrollingAncestor = parent()->localToContainerQuad(FloatRect(stickyBoxRect), &enclosingClippingBox, { } /* ignore transforms */).boundingBox();
    520522
    521523    if (enclosingClippingLayer) {
Note: See TracChangeset for help on using the changeset viewer.