Changeset 188514 in webkit


Ignore:
Timestamp:
Aug 15, 2015 1:13:24 PM (9 years ago)
Author:
Simon Fraser
Message:

Have will-change create stacking context when necessary
https://bugs.webkit.org/show_bug.cgi?id=148060

Reviewed by Zalan Bujtas.

Source/WebCore:

If will-change includes a property whose non-initial value can create
stacking context, create stacking context for that element.

Test: fast/css/will-change/will-change-creates-stacking-context.html

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::adjustRenderStyle):

  • rendering/style/RenderStyle.h: Add willChangeCreatesStackingContext(),

which on most cases is a fast, inlined 'return false'. Otherwise ask
the WillChangeData.

  • rendering/style/WillChangeData.cpp:

(WebCore::propertyCreatesStackingContext):
(WebCore::WillChangeData::createsStackingContext):

  • rendering/style/WillChangeData.h:

LayoutTests:

Ref test for will-change creating stacking context.

  • fast/css/will-change/resources/will-change-stacking-helper.js: Added.

(makeStackingBlock):

  • fast/css/will-change/will-change-creates-stacking-context-expected.html: Added.
  • fast/css/will-change/will-change-creates-stacking-context.html: Added.
  • platform/efl/TestExpectations: Mark image failure on EFL, since some CSS

properties in the test are disabled there.

Location:
trunk
Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r188512 r188514  
     12015-08-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have will-change create stacking context when necessary
     4        https://bugs.webkit.org/show_bug.cgi?id=148060
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        Ref test for will-change creating stacking context.
     9
     10        * fast/css/will-change/resources/will-change-stacking-helper.js: Added.
     11        (makeStackingBlock):
     12        * fast/css/will-change/will-change-creates-stacking-context-expected.html: Added.
     13        * fast/css/will-change/will-change-creates-stacking-context.html: Added.
     14        * platform/efl/TestExpectations: Mark image failure on EFL, since some CSS
     15        properties in the test are disabled there.
     16
    1172015-08-14  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/LayoutTests/platform/efl/TestExpectations

    r188390 r188514  
    404404# CSS image-resolution is not yet enabled.
    405405webkit.org/b/85262 fast/css/image-resolution
     406
     407# Some CSS properties not supported on EFL
     408fast/css/will-change/will-change-creates-stacking-context.html [ ImageOnlyFailure ]
    406409
    407410# Perf tests are really slow in debug builds and there are few benefits in running them.
  • trunk/LayoutTests/platform/mac-mavericks/TestExpectations

    r188026 r188514  
    1010compositing/media-controls-bar-appearance.html [ Skip ]
    1111compositing/media-controls-bar-appearance-big.html [ Skip ]
     12fast/css/will-change/will-change-creates-stacking-context.html [ ImageOnlyFailure ]
    1213
    1314# No support for non-HLS Media Selection Group
  • trunk/Source/WebCore/ChangeLog

    r188513 r188514  
     12015-08-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have will-change create stacking context when necessary
     4        https://bugs.webkit.org/show_bug.cgi?id=148060
     5
     6        Reviewed by Zalan Bujtas.
     7       
     8        If will-change includes a property whose non-initial value can create
     9        stacking context, create stacking context for that element.
     10
     11        Test: fast/css/will-change/will-change-creates-stacking-context.html
     12
     13        * css/StyleResolver.cpp:
     14        (WebCore::StyleResolver::adjustRenderStyle):
     15        * rendering/style/RenderStyle.h: Add willChangeCreatesStackingContext(),
     16        which on most cases is a fast, inlined 'return false'. Otherwise ask
     17        the WillChangeData.
     18        * rendering/style/WillChangeData.cpp:
     19        (WebCore::propertyCreatesStackingContext):
     20        (WebCore::WillChangeData::createsStackingContext):
     21        * rendering/style/WillChangeData.h:
     22
    1232015-08-15  Commit Queue  <commit-queue@webkit.org>
    224
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r187659 r188514  
    12701270        || (style.position() == FixedPosition && documentSettings() && documentSettings()->fixedPositionCreatesStackingContext())
    12711271        || style.hasFlowFrom()
     1272        || style.willChangeCreatesStackingContext()
    12721273        ))
    12731274        style.setZIndex(0);
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r188512 r188514  
    114114class StyleResolver;
    115115class TransformationMatrix;
    116 class WillChangeData;
    117116
    118117struct ScrollSnapPoints;
     
    18031802    void setWillChange(PassRefPtr<WillChangeData>);
    18041803
     1804    bool willChangeCreatesStackingContext() const
     1805    {
     1806        if (!willChange())
     1807            return false;
     1808       
     1809        return willChange()->createsStackingContext();
     1810    }
     1811
    18051812    const AtomicString& hyphenString() const;
    18061813
  • trunk/Source/WebCore/rendering/style/WillChangeData.cpp

    r188512 r188514  
    6161}
    6262
     63// "If any non-initial value of a property would create a stacking context on the element,
     64// specifying that property in will-change must create a stacking context on the element."
     65static bool propertyCreatesStackingContext(CSSPropertyID property)
     66{
     67    switch (property) {
     68    case CSSPropertyClipPath:
     69    case CSSPropertyWebkitClipPath:
     70    case CSSPropertyMask:
     71    case CSSPropertyOpacity:
     72    case CSSPropertyPosition:
     73    case CSSPropertyZIndex:
     74    case CSSPropertyWebkitBackfaceVisibility:
     75    case CSSPropertyWebkitBoxReflect:
     76#if ENABLE(CSS_COMPOSITING)
     77    case CSSPropertyMixBlendMode:
     78    case CSSPropertyIsolation:
     79#endif
     80    case CSSPropertyWebkitFilter:
     81#if ENABLE(FILTERS_LEVEL_2)
     82    case CSSPropertyWebkitBackdropFilter:
     83#endif
     84    case CSSPropertyWebkitMask:
     85    case CSSPropertyWebkitMaskImage:
     86    case CSSPropertyWebkitMaskBoxImage:
     87    case CSSPropertyPerspective:
     88    case CSSPropertyTransform:
     89    case CSSPropertyTransformStyle:
     90    case CSSPropertyWebkitTransformStyle:
     91#if ENABLE(CSS_REGIONS)
     92    case CSSPropertyWebkitFlowFrom:
     93#endif
     94#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
     95    case CSSPropertyWebkitOverflowScrolling:
     96#endif
     97        return true;
     98    default:
     99        return false;
     100    }
     101}
     102
     103bool WillChangeData::createsStackingContext() const
     104{
     105    for (const auto& feature : m_animatableFeatures) {
     106        if (feature.feature() == Property && propertyCreatesStackingContext(feature.property()))
     107            return true;
     108    }
     109    return false;
     110}
     111
    63112void WillChangeData::addFeature(Feature feature, CSSPropertyID propertyID)
    64113{
  • trunk/Source/WebCore/rendering/style/WillChangeData.h

    r188512 r188514  
    5454    bool containsContents() const;
    5555    bool containsProperty(CSSPropertyID) const;
     56    bool createsStackingContext() const;
    5657
    5758    enum Feature {
Note: See TracChangeset for help on using the changeset viewer.