Changeset 277579 in webkit


Ignore:
Timestamp:
May 17, 2021 3:09:03 AM (14 months ago)
Author:
ntim@apple.com
Message:

will-change: position should not create a containing block for position: fixed elements
https://bugs.webkit.org/show_bug.cgi?id=225443

Reviewed by Antti Koivisto.

This partially undoes r276627 which made will-change: position create a CB for all out-of-flow elements:

  • Removed CSSPropertyPosition from createsContainingBlockForOutOfFlowPositioned() to not create a containing block

for position: fixed; children.

  • Added createsContainingBlockForAbsolutelyPositioned() with CSSPropertyPosition to still create a containing block

for position: absolute; children.

Enabled WPT (which covers both cases): css/css-will-change/will-change-fixpos-cb-position-1.html

Source/WebCore:

  • rendering/RenderElement.h:

(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):

  • rendering/style/WillChangeData.cpp:

(WebCore::WillChangeData::createsContainingBlockForAbsolutelyPositioned const):
(WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):

  • rendering/style/WillChangeData.h:

LayoutTests:

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277577 r277579  
     12021-05-17  Tim Nguyen  <ntim@apple.com>
     2
     3        will-change: position should not create a containing block for position: fixed elements
     4        https://bugs.webkit.org/show_bug.cgi?id=225443
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This partially undoes r276627 which made will-change: position create a CB for all out-of-flow elements:
     9
     10        - Removed CSSPropertyPosition from createsContainingBlockForOutOfFlowPositioned() to not create a containing block
     11        for position: fixed; children.
     12        - Added createsContainingBlockForAbsolutelyPositioned() with CSSPropertyPosition to still create a containing block
     13        for position: absolute; children.
     14
     15        Enabled WPT (which covers both cases): css/css-will-change/will-change-fixpos-cb-position-1.html
     16
     17        * TestExpectations:
     18
    1192021-05-16  Cameron McCormack  <heycam@apple.com>
    220
  • trunk/LayoutTests/TestExpectations

    r277577 r277579  
    48584858webkit.org/b/225034 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-003.html [ ImageOnlyFailure ]
    48594859webkit.org/b/225442 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixpos-cb-contain-1.html [ ImageOnlyFailure ]
    4860 webkit.org/b/225443 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixpos-cb-position-1.html [ ImageOnlyFailure ]
    48614860webkit.org/b/224902 [ Debug ] imported/w3c/web-platform-tests/css/css-will-change/parsing/will-change-invalid.html [ Skip ]
    48624861
  • trunk/Source/WebCore/ChangeLog

    r277578 r277579  
     12021-05-17  Tim Nguyen  <ntim@apple.com>
     2
     3        will-change: position should not create a containing block for position: fixed elements
     4        https://bugs.webkit.org/show_bug.cgi?id=225443
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This partially undoes r276627 which made will-change: position create a CB for all out-of-flow elements:
     9
     10        - Removed CSSPropertyPosition from createsContainingBlockForOutOfFlowPositioned() to not create a containing block
     11        for position: fixed; children.
     12        - Added createsContainingBlockForAbsolutelyPositioned() with CSSPropertyPosition to still create a containing block
     13        for position: absolute; children.
     14
     15        Enabled WPT (which covers both cases): css/css-will-change/will-change-fixpos-cb-position-1.html
     16
     17        * rendering/RenderElement.h:
     18        (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
     19        * rendering/style/WillChangeData.cpp:
     20        (WebCore::WillChangeData::createsContainingBlockForAbsolutelyPositioned const):
     21        (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
     22        * rendering/style/WillChangeData.h:
     23
    1242021-05-17  Zan Dobersek  <zdobersek@igalia.com>
    225
  • trunk/Source/WebCore/rendering/RenderElement.h

    r277124 r277579  
    450450        || (isRenderBlock() && hasTransformRelatedProperty())
    451451        // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
    452         || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
     452        || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForAbsolutelyPositioned())
    453453        || isSVGForeignObject()
    454454        || shouldApplyLayoutContainment(*this)
  • trunk/Source/WebCore/rendering/style/WillChangeData.cpp

    r277566 r277579  
    6161}
    6262
     63bool WillChangeData::createsContainingBlockForAbsolutelyPositioned() const
     64{
     65    return createsContainingBlockForOutOfFlowPositioned()
     66        || containsProperty(CSSPropertyPosition);
     67}
     68
    6369bool WillChangeData::createsContainingBlockForOutOfFlowPositioned() const
    6470{
    65     return containsProperty(CSSPropertyPosition)
    66         || containsProperty(CSSPropertyPerspective)
     71    return containsProperty(CSSPropertyPerspective)
    6772        // CSS transforms
    6873        || containsProperty(CSSPropertyTransform)
  • trunk/Source/WebCore/rendering/style/WillChangeData.h

    r276627 r277579  
    5353    bool containsProperty(CSSPropertyID) const;
    5454
     55    bool createsContainingBlockForAbsolutelyPositioned() const;
    5556    bool createsContainingBlockForOutOfFlowPositioned() const;
    5657    bool canCreateStackingContext() const { return m_canCreateStackingContext; }
Note: See TracChangeset for help on using the changeset viewer.