Title: [193420] branches/safari-601-branch

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193419 => 193420)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2015-12-04 17:10:40 UTC (rev 193420)
@@ -1,5 +1,25 @@
 2015-12-03  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r188514. rdar://problem/23732374
+
+    2015-08-15  Simon Fraser  <simon.fra...@apple.com>
+
+            Have will-change create stacking context when necessary
+            https://bugs.webkit.org/show_bug.cgi?id=148060
+
+            Reviewed by Zalan Bujtas.
+
+            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.
+
+2015-12-03  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r188512. rdar://problem/23732374
 
     2015-08-14  Simon Fraser  <simon.fra...@apple.com>

Added: branches/safari-601-branch/LayoutTests/fast/css/will-change/resources/will-change-stacking-helper.js (0 => 193420)


--- branches/safari-601-branch/LayoutTests/fast/css/will-change/resources/will-change-stacking-helper.js	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/css/will-change/resources/will-change-stacking-helper.js	2015-12-04 17:10:40 UTC (rev 193420)
@@ -0,0 +1,51 @@
+var willChangeValues = [
+    { 'property' : 'auto', 'stacking' : false },
+    { 'property' : 'background', 'stacking' : false },
+    { 'property' : 'will-change', 'stacking' : false },
+
+    { 'property' : 'clip-path', 'stacking' : true },
+    { 'property' : 'mask', 'stacking' : true },
+    { 'property' : 'opacity', 'stacking' : true },
+    { 'property' : 'position', 'stacking' : true },
+    { 'property' : 'z-index', 'stacking' : true },
+    { 'property' : 'mix-blend-mode', 'stacking' : true },
+    { 'property' : 'isolation', 'stacking' : true },
+    { 'property' : 'perspective', 'stacking' : true },
+    { 'property' : 'transform', 'stacking' : true },
+    { 'property' : 'transform-style', 'stacking' : true },
+
+    { 'property' : '-webkit-filter', 'stacking' : true },
+    { 'property' : '-webkit-clip-path', 'stacking' : true },
+    { 'property' : '-webkit-backface-visibility', 'stacking' : true },
+    { 'property' : '-webkit-box-reflect', 'stacking' : true },
+    { 'property' : '-webkit-backdrop-filter', 'stacking' : true },
+    { 'property' : '-webkit-mask', 'stacking' : true },
+    { 'property' : '-webkit-mask-image', 'stacking' : true },
+    { 'property' : '-webkit-mask-box-image', 'stacking' : true },
+    { 'property' : '-webkit-transform', 'stacking' : true },
+    { 'property' : '-webkit-transform-style', 'stacking' : true },
+    { 'property' : '-webkit-flow-from', 'stacking' : true },
+];
+
+function makeStackingBlock(stackingProperty, value)
+{
+    var container = document.createElement('div');
+    container.className = 'container';
+
+    var potentialStackingContext = document.createElement('div');
+    potentialStackingContext.className = 'potential-stacking-context';
+    potentialStackingContext.style[stackingProperty] = value;
+
+    var child = document.createElement('div');
+    child.className = 'child';
+    potentialStackingContext.appendChild(child);
+
+    container.appendChild(potentialStackingContext);
+
+    var interposer = document.createElement('div');
+    interposer.className = 'interposer';
+    container.appendChild(interposer);
+    
+    document.body.appendChild(container);
+}
+

Added: branches/safari-601-branch/LayoutTests/fast/css/will-change/will-change-creates-stacking-context-expected.html (0 => 193420)


--- branches/safari-601-branch/LayoutTests/fast/css/will-change/will-change-creates-stacking-context-expected.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/css/will-change/will-change-creates-stacking-context-expected.html	2015-12-04 17:10:40 UTC (rev 193420)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            display: inline-block;
+            margin: 25px;
+            width: 50px;
+            height: 50px;
+            position: relative;
+            border: 1px solid black;
+        }
+        
+        .container div {
+            width: 100%;
+            height: 100%;
+        }
+        
+        .potential-stacking-context {
+            position: relative;
+            z-index: auto;
+            background-color: silver;
+        }
+        
+        .child {
+            position: absolute;
+            top: 10px;
+            left: 10px;
+            z-index: 1;
+            background-color: orange;
+        }
+
+        .interposer {
+            position: absolute;
+            top: 20px;
+            left: 20px;
+            z-index: 0;
+            background-color: green;
+        }
+    </style>
+
+    <script src=""
+    <script>
+        function doTest()
+        {
+            for (value of willChangeValues) {
+                makeStackingBlock('z-index', value.stacking ? '0' : 'auto');
+            }
+        }
+        
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+</body>
+</html>

Added: branches/safari-601-branch/LayoutTests/fast/css/will-change/will-change-creates-stacking-context.html (0 => 193420)


--- branches/safari-601-branch/LayoutTests/fast/css/will-change/will-change-creates-stacking-context.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/css/will-change/will-change-creates-stacking-context.html	2015-12-04 17:10:40 UTC (rev 193420)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            display: inline-block;
+            margin: 25px;
+            width: 50px;
+            height: 50px;
+            position: relative;
+            border: 1px solid black;
+        }
+        
+        .container div {
+            width: 100%;
+            height: 100%;
+        }
+        
+        .potential-stacking-context {
+            position: relative;
+            z-index: auto;
+            background-color: silver;
+        }
+        
+        .child {
+            position: absolute;
+            top: 10px;
+            left: 10px;
+            z-index: 1;
+            background-color: orange;
+        }
+
+        .interposer {
+            position: absolute;
+            top: 20px;
+            left: 20px;
+            z-index: 0;
+            background-color: green;
+        }
+    </style>
+
+    <script src=""
+    <script>
+        function doTest()
+        {
+            for (value of willChangeValues) {
+                makeStackingBlock('will-change', value.property);
+            }
+        }
+        
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+</body>
+</html>

Modified: branches/safari-601-branch/LayoutTests/platform/efl/TestExpectations (193419 => 193420)


--- branches/safari-601-branch/LayoutTests/platform/efl/TestExpectations	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/LayoutTests/platform/efl/TestExpectations	2015-12-04 17:10:40 UTC (rev 193420)
@@ -314,6 +314,9 @@
 # CSS image-resolution is not yet enabled.
 webkit.org/b/85262 fast/css/image-resolution
 
+# Some CSS properties not supported on EFL
+fast/css/will-change/will-change-creates-stacking-context.html [ ImageOnlyFailure ]
+
 # Perf tests are really slow in debug builds and there are few benefits in running them.
 [ Debug ] perf [ WontFix ]
 

Modified: branches/safari-601-branch/LayoutTests/platform/mac-mavericks/TestExpectations (193419 => 193420)


--- branches/safari-601-branch/LayoutTests/platform/mac-mavericks/TestExpectations	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/LayoutTests/platform/mac-mavericks/TestExpectations	2015-12-04 17:10:40 UTC (rev 193420)
@@ -9,6 +9,7 @@
 # No support for Filters Level 2
 compositing/media-controls-bar-appearance.html [ Skip ]
 compositing/media-controls-bar-appearance-big.html [ Skip ]
+fast/css/will-change/will-change-creates-stacking-context.html [ ImageOnlyFailure ]
 
 # No support for non-HLS Media Selection Group
 media/accessiblity-describes-video.html [ Skip ]

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193419 => 193420)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-04 17:10:40 UTC (rev 193420)
@@ -1,5 +1,31 @@
 2015-12-03  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r188514. rdar://problem/23732374
+
+    2015-08-15  Simon Fraser  <simon.fra...@apple.com>
+
+            Have will-change create stacking context when necessary
+            https://bugs.webkit.org/show_bug.cgi?id=148060
+
+            Reviewed by Zalan Bujtas.
+
+            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:
+
+2015-12-03  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r188512. rdar://problem/23732374
 
     2015-08-14  Simon Fraser  <simon.fra...@apple.com>

Modified: branches/safari-601-branch/Source/WebCore/css/StyleResolver.cpp (193419 => 193420)


--- branches/safari-601-branch/Source/WebCore/css/StyleResolver.cpp	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/Source/WebCore/css/StyleResolver.cpp	2015-12-04 17:10:40 UTC (rev 193420)
@@ -1269,6 +1269,7 @@
         || style.position() == StickyPosition
         || (style.position() == FixedPosition && documentSettings() && documentSettings()->fixedPositionCreatesStackingContext())
         || style.hasFlowFrom()
+        || style.willChangeCreatesStackingContext()
         ))
         style.setZIndex(0);
 

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyle.h (193419 => 193420)


--- branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyle.h	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyle.h	2015-12-04 17:10:40 UTC (rev 193420)
@@ -113,7 +113,6 @@
 class StyleInheritedData;
 class StyleResolver;
 class TransformationMatrix;
-class WillChangeData;
 
 struct ScrollSnapPoints;
 
@@ -1801,6 +1800,14 @@
     WillChangeData* willChange() const { return rareNonInheritedData->m_willChange.get(); }
     void setWillChange(PassRefPtr<WillChangeData>);
 
+    bool willChangeCreatesStackingContext() const
+    {
+        if (!willChange())
+            return false;
+        
+        return willChange()->createsStackingContext();
+    }
+
     const AtomicString& hyphenString() const;
 
     bool inheritedNotEqual(const RenderStyle*) const;

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/WillChangeData.cpp (193419 => 193420)


--- branches/safari-601-branch/Source/WebCore/rendering/style/WillChangeData.cpp	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/WillChangeData.cpp	2015-12-04 17:10:40 UTC (rev 193420)
@@ -60,6 +60,55 @@
     return false;
 }
 
+// "If any non-initial value of a property would create a stacking context on the element,
+// specifying that property in will-change must create a stacking context on the element."
+static bool propertyCreatesStackingContext(CSSPropertyID property)
+{
+    switch (property) {
+    case CSSPropertyClipPath:
+    case CSSPropertyWebkitClipPath:
+    case CSSPropertyMask:
+    case CSSPropertyOpacity:
+    case CSSPropertyPosition:
+    case CSSPropertyZIndex:
+    case CSSPropertyWebkitBackfaceVisibility:
+    case CSSPropertyWebkitBoxReflect:
+#if ENABLE(CSS_COMPOSITING)
+    case CSSPropertyMixBlendMode:
+    case CSSPropertyIsolation:
+#endif
+    case CSSPropertyWebkitFilter:
+#if ENABLE(FILTERS_LEVEL_2)
+    case CSSPropertyWebkitBackdropFilter:
+#endif
+    case CSSPropertyWebkitMask:
+    case CSSPropertyWebkitMaskImage:
+    case CSSPropertyWebkitMaskBoxImage:
+    case CSSPropertyPerspective:
+    case CSSPropertyTransform:
+    case CSSPropertyTransformStyle:
+    case CSSPropertyWebkitTransformStyle:
+#if ENABLE(CSS_REGIONS)
+    case CSSPropertyWebkitFlowFrom:
+#endif
+#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
+    case CSSPropertyWebkitOverflowScrolling:
+#endif
+        return true;
+    default:
+        return false;
+    }
+}
+
+bool WillChangeData::createsStackingContext() const
+{
+    for (const auto& feature : m_animatableFeatures) {
+        if (feature.feature() == Property && propertyCreatesStackingContext(feature.property()))
+            return true;
+    }
+    return false;
+}
+
 void WillChangeData::addFeature(Feature feature, CSSPropertyID propertyID)
 {
     ASSERT(feature == Property || propertyID == CSSPropertyInvalid);

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/WillChangeData.h (193419 => 193420)


--- branches/safari-601-branch/Source/WebCore/rendering/style/WillChangeData.h	2015-12-04 17:10:35 UTC (rev 193419)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/WillChangeData.h	2015-12-04 17:10:40 UTC (rev 193420)
@@ -53,6 +53,7 @@
     bool containsScrollPosition() const;
     bool containsContents() const;
     bool containsProperty(CSSPropertyID) const;
+    bool createsStackingContext() const;
 
     enum Feature {
         ScrollPosition,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to