Changeset 276627 in webkit


Ignore:
Timestamp:
Apr 26, 2021 10:31:07 PM (15 months ago)
Author:
commit-queue@webkit.org
Message:

Create a containing block when relevant properties are set in the current element will-change
https://bugs.webkit.org/show_bug.cgi?id=167868

Patch by Tim Nguyen <ntim@apple.com> on 2021-04-26
Reviewed by Alan Bujtas.

Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
current element's will-change.

Relevant WPT are enabled.

Test: fast/css/will-change/will-change-creates-containing-block.html

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:

Source/WebCore:

  • rendering/RenderElement.h:

(WebCore::RenderElement::canContainFixedPositionObjects const):
(WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):

  • rendering/style/WillChangeData.cpp:

(WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):

  • rendering/style/WillChangeData.h:

LayoutTests:

  • TestExpectations:
  • fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
  • fast/css/will-change/will-change-creates-containing-block.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r276626 r276627  
     12021-04-26  Tim Nguyen  <ntim@apple.com>
     2
     3        Create a containing block when relevant properties are set in the current element will-change
     4        https://bugs.webkit.org/show_bug.cgi?id=167868
     5
     6        Reviewed by Alan Bujtas.
     7
     8        Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
     9        current element's will-change.
     10
     11        Relevant WPT are enabled.
     12
     13        Test: fast/css/will-change/will-change-creates-containing-block.html
     14
     15        * TestExpectations:
     16        * fast/css/will-change/will-change-creates-containing-block-expected.html: Added.
     17        * fast/css/will-change/will-change-creates-containing-block.html: Added.
     18
    1192021-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
    220
  • trunk/LayoutTests/TestExpectations

    r276578 r276627  
    49424942
    49434943# CSS will-change failures
    4944 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-001.html [ ImageOnlyFailure ]
    4945 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-002.html [ ImageOnlyFailure ]
    4946 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-003.html [ ImageOnlyFailure ]
    4947 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-dynamic-001.html [ ImageOnlyFailure ]
    4948 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-001.html [ ImageOnlyFailure ]
    4949 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-002.html [ ImageOnlyFailure ]
    4950 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-004.html [ ImageOnlyFailure ]
    4951 webkit.org/b/167868 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-005.html [ ImageOnlyFailure ]
     4944webkit.org/b/224928 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-dynamic-001.html [ ImageOnlyFailure ]
     4945webkit.org/b/225035 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-002.html [ ImageOnlyFailure ]
     4946webkit.org/b/225034 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-003.html [ ImageOnlyFailure ]
    49524947webkit.org/b/224902 [ Debug ] imported/w3c/web-platform-tests/css/css-will-change/parsing/will-change-invalid.html [ Skip ]
    49534948
    49544949# Needs -webkit-backdrop-filter to be unprefixed
    49554950webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-stacking-context-002.html [ ImageOnlyFailure ]
     4951webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-abspos-cb-003.html [ ImageOnlyFailure ]
     4952webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-004.html [ ImageOnlyFailure ]
     4953webkit.org/b/224899 imported/w3c/web-platform-tests/css/css-will-change/will-change-fixedpos-cb-005.html [ ImageOnlyFailure ]
    49564954
    49574955webkit.org/b/223170 [ Debug ] fast/multicol/widow-relayout-with-border-fit.html [ Skip ]
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r276592 r276627  
     12021-04-26  Tim Nguyen  <ntim@apple.com>
     2
     3        Create a containing block when relevant properties are set in the current element will-change
     4        https://bugs.webkit.org/show_bug.cgi?id=167868
     5
     6        Reviewed by Alan Bujtas.
     7
     8        Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
     9        current element's will-change.
     10
     11        Relevant WPT are enabled.
     12
     13        Test: fast/css/will-change/will-change-creates-containing-block.html
     14
     15        * web-platform-tests/css/css-box/parsing/padding-computed-expected.txt:
     16
    1172021-04-26  Alexey Shvayka  <shvaikalesh@gmail.com>
    218
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-box/parsing/padding-computed-expected.txt

    r267650 r276627  
    66PASS Property padding-bottom value '30px'
    77PASS Property padding-left value '40px'
    8 FAIL Property padding value '20%' assert_equals: expected "40px" but got "160px"
    9 FAIL Property padding value '10px 20% 30% 40px' assert_equals: expected "10px 40px 60px" but got "10px 160px 240px 40px"
    10 FAIL Property padding-right value '20%' assert_equals: expected "40px" but got "160px"
    11 FAIL Property padding-top value 'calc(10% - 40px)' assert_equals: expected "0px" but got "40px"
    12 FAIL Property padding-right value 'calc(10% + 40px)' assert_equals: expected "60px" but got "120px"
     8PASS Property padding value '20%'
     9PASS Property padding value '10px 20% 30% 40px'
     10PASS Property padding-right value '20%'
     11PASS Property padding-top value 'calc(10% - 40px)'
     12PASS Property padding-right value 'calc(10% + 40px)'
    1313PASS Property padding-bottom value 'calc(10px - 0.5em)'
    1414PASS Property padding-left value 'calc(10px + 0.5em)'
  • trunk/Source/WebCore/ChangeLog

    r276626 r276627  
     12021-04-26  Tim Nguyen  <ntim@apple.com>
     2
     3        Create a containing block when relevant properties are set in the current element will-change
     4        https://bugs.webkit.org/show_bug.cgi?id=167868
     5
     6        Reviewed by Alan Bujtas.
     7
     8        Per spec, any CSS property that is susceptible to create a containing block should create one when put on the
     9        current element's will-change.
     10
     11        Relevant WPT are enabled.
     12
     13        Test: fast/css/will-change/will-change-creates-containing-block.html
     14
     15        * rendering/RenderElement.h:
     16        (WebCore::RenderElement::canContainFixedPositionObjects const):
     17        (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
     18        * rendering/style/WillChangeData.cpp:
     19        (WebCore::WillChangeData::createsContainingBlockForOutOfFlowPositioned const):
     20        * rendering/style/WillChangeData.h:
     21
    1222021-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderElement.h

    r276377 r276627  
    428428{
    429429    return isRenderView()
    430         || (hasTransform() && isRenderBlock())
    431         || (style().willChange() && style().willChange()->containsProperty(CSSPropertyTransform))
     430        || (isRenderBlock() && hasTransform())
     431        // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
     432        || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
    432433        || isSVGForeignObject()
    433434        || shouldApplyLayoutContainment(*this)
     
    439440    return style().position() != PositionType::Static
    440441        || (isRenderBlock() && hasTransformRelatedProperty())
     442        // FIXME: will-change should create containing blocks on inline boxes (bug 225035)
     443        || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned())
    441444        || isSVGForeignObject()
    442445        || shouldApplyLayoutContainment(*this)
  • trunk/Source/WebCore/rendering/style/WillChangeData.cpp

    r268615 r276627  
    5959    }
    6060    return false;
     61}
     62
     63bool WillChangeData::createsContainingBlockForOutOfFlowPositioned() const
     64{
     65    return containsProperty(CSSPropertyPosition)
     66        || containsProperty(CSSPropertyPerspective)
     67        // CSS transforms
     68        || containsProperty(CSSPropertyTransform)
     69        || containsProperty(CSSPropertyTranslate)
     70        || containsProperty(CSSPropertyRotate)
     71        || containsProperty(CSSPropertyScale)
     72        // CSS filter & backdrop-filter
     73        // FIXME: exclude root element for those properties (bug 225034)
     74#if ENABLE(FILTERS_LEVEL_2)
     75        || containsProperty(CSSPropertyWebkitBackdropFilter)
     76#endif
     77        || containsProperty(CSSPropertyFilter);
    6178}
    6279
  • trunk/Source/WebCore/rendering/style/WillChangeData.h

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