Title: [205442] releases/WebKitGTK/webkit-2.12
Revision
205442
Author
carlo...@webkit.org
Date
2016-09-05 02:27:31 -0700 (Mon, 05 Sep 2016)

Log Message

Merge r205277 - ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline
https://bugs.webkit.org/show_bug.cgi?id=151022
<rdar://problem/27710993>

Reviewed by Simon Fraser.

Source/WebCore:

Certain CSS properties like opacity, mask etc (graphical group members) require the layer to be a non-normal flow,
self painting layer so that we can manage painting properly. However in addition to those CSS properties, some of the will-change
values (again, graphical group members) also require the layer to be non-normal flow, self painting.
This patch ensures that when deciding whether a layer should be a normal flow layer, we take the will-change values into account as well.

Tests: compositing/layer-creation/assert-on-inline-element-with-will-change.html
       compositing/layer-creation/will-change-on-normal-flow-content.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/style/WillChangeData.cpp:
(WebCore::propertyCreatesGraphicalGroup):
(WebCore::WillChangeData::addFeature):
* rendering/style/WillChangeData.h:
(WebCore::WillChangeData::canCreateGraphicalGroup):
(WebCore::WillChangeData::canTriggerCompositingOnInline): Deleted.

LayoutTests:

* compositing/layer-creation/assert-on-inline-element-with-will-change-expected.txt: Added.
* compositing/layer-creation/assert-on-inline-element-with-will-change.html: Added.
* compositing/layer-creation/will-change-on-normal-flow-content-expected.txt: Added.
* compositing/layer-creation/will-change-on-normal-flow-content.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (205441 => 205442)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-09-05 09:19:48 UTC (rev 205441)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-09-05 09:27:31 UTC (rev 205442)
@@ -1,3 +1,16 @@
+2016-08-31  Zalan Bujtas  <za...@apple.com>
+
+        ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline
+        https://bugs.webkit.org/show_bug.cgi?id=151022
+        <rdar://problem/27710993>
+
+        Reviewed by Simon Fraser.
+
+        * compositing/layer-creation/assert-on-inline-element-with-will-change-expected.txt: Added.
+        * compositing/layer-creation/assert-on-inline-element-with-will-change.html: Added.
+        * compositing/layer-creation/will-change-on-normal-flow-content-expected.txt: Added.
+        * compositing/layer-creation/will-change-on-normal-flow-content.html: Added.
+
 2016-08-26  Zalan Bujtas  <za...@apple.com>
 
         ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/assert-on-inline-element-with-will-change-expected.txt (0 => 205442)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/assert-on-inline-element-with-will-change-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/assert-on-inline-element-with-will-change-expected.txt	2016-09-05 09:27:31 UTC (rev 205442)
@@ -0,0 +1,2 @@
+PASS if no assert in debug.
+

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/assert-on-inline-element-with-will-change.html (0 => 205442)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/assert-on-inline-element-with-will-change.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/assert-on-inline-element-with-will-change.html	2016-09-05 09:27:31 UTC (rev 205442)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we make a self painting layer for the inline when will-change requires one.</title>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+span {
+   outline: 5px solid green;
+   -webkit-columns: 100px 1;
+   will-change: opacity;
+}
+</style>
+</head>
+<body>
+PASS if no assert in debug.
+<span><div></div></span>
+</body>
+</html>

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/will-change-on-normal-flow-content-expected.txt (0 => 205442)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/will-change-on-normal-flow-content-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/will-change-on-normal-flow-content-expected.txt	2016-09-05 09:27:31 UTC (rev 205442)
@@ -0,0 +1,28 @@
+opacity
+mask
+backdrop-filter
+filter
+clip-path
+(GraphicsLayer
+(anchor 0.00 0.00)
+(bounds 800.00 600.00)
+(children 1
+(GraphicsLayer
+(bounds 800.00 600.00)
+(contentsOpaque 1)
+(children 2
+(GraphicsLayer
+(position 8.00 8.00)
+(bounds 784.00 18.00)
+(drawsContent 1)
+)
+(GraphicsLayer
+(position 8.00 62.00)
+(bounds 784.00 18.00)
+(drawsContent 1)
+)
+)
+)
+)
+)
+

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/will-change-on-normal-flow-content.html (0 => 205442)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/will-change-on-normal-flow-content.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/compositing/layer-creation/will-change-on-normal-flow-content.html	2016-09-05 09:27:31 UTC (rev 205442)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we make a self painting layer for the inline when will-change requires one.</title>
+<script>
+function doTest() {
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        document.getElementById('layers').innerText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_CONTENT_LAYERS);
+    }
+}
+window.addEventListener('load', doTest, false)
+</script>
+<style>
+div {
+   -webkit-columns: 100px 1;
+}
+</style>
+</head>
+<body>
+<div style="will-change: opacity">opacity</div>
+<div style="will-change: mask">mask</div>
+<div style="will-change: backdrop-filter">backdrop-filter</div>
+<div style="will-change: filter">filter</div>
+<div style="will-change: clip-path">clip-path</div>
+<div id=layers></div>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (205441 => 205442)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-09-05 09:19:48 UTC (rev 205441)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-09-05 09:27:31 UTC (rev 205442)
@@ -1,3 +1,28 @@
+2016-08-31  Zalan Bujtas  <za...@apple.com>
+
+        ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline
+        https://bugs.webkit.org/show_bug.cgi?id=151022
+        <rdar://problem/27710993>
+
+        Reviewed by Simon Fraser.
+
+        Certain CSS properties like opacity, mask etc (graphical group members) require the layer to be a non-normal flow,
+        self painting layer so that we can manage painting properly. However in addition to those CSS properties, some of the will-change
+        values (again, graphical group members) also require the layer to be non-normal flow, self painting.
+        This patch ensures that when deciding whether a layer should be a normal flow layer, we take the will-change values into account as well.
+
+        Tests: compositing/layer-creation/assert-on-inline-element-with-will-change.html
+               compositing/layer-creation/will-change-on-normal-flow-content.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/style/WillChangeData.cpp:
+        (WebCore::propertyCreatesGraphicalGroup):
+        (WebCore::WillChangeData::addFeature):
+        * rendering/style/WillChangeData.h:
+        (WebCore::WillChangeData::canCreateGraphicalGroup):
+        (WebCore::WillChangeData::canTriggerCompositingOnInline): Deleted.
+
 2016-08-26  Zalan Bujtas  <za...@apple.com>
 
         ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderLayer.cpp (205441 => 205442)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderLayer.cpp	2016-09-05 09:19:48 UTC (rev 205441)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderLayer.cpp	2016-09-05 09:27:31 UTC (rev 205442)
@@ -6423,6 +6423,19 @@
     }
 }
 
+static bool mayCreateGraphicalGroup(const RenderElement& renderer)
+{
+    bool createsGraphicalGroup = renderer.hasClipPath()
+        || renderer.hasFilter()
+        || renderer.hasBackdropFilter()
+#if ENABLE(CSS_COMPOSITING)
+        || renderer.hasBlendMode()
+#endif
+        || renderer.isTransparent()
+        || renderer.hasMask();
+    return createsGraphicalGroup || (renderer.style().willChange() && renderer.style().willChange()->canCreateGraphicalGroup());
+}
+
 bool RenderLayer::shouldBeNormalFlowOnly() const
 {
     return (renderer().hasOverflowClip()
@@ -6434,20 +6447,14 @@
         || renderer().isRenderIFrame()
         || (renderer().style().specifiesColumns() && !isRootLayer())
         || renderer().isInFlowRenderFlowThread())
+        && !renderer().hasTransformRelatedProperty()
         && !renderer().isPositioned()
-        && !renderer().hasTransformRelatedProperty()
-        && !renderer().hasClipPath()
-        && !renderer().hasFilter()
-        && !renderer().hasBackdropFilter()
+        && !needsCompositedScrolling()
+        && !renderer().style().hasFlowFrom()
 #if PLATFORM(IOS)
         && !hasAcceleratedTouchScrolling()
 #endif
-#if ENABLE(CSS_COMPOSITING)
-        && !renderer().hasBlendMode()
-#endif
-        && !isTransparent()
-        && !needsCompositedScrolling()
-        && !renderer().style().hasFlowFrom();
+        && !mayCreateGraphicalGroup(renderer());
 }
 
 bool RenderLayer::shouldBeSelfPaintingLayer() const

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/WillChangeData.cpp (205441 => 205442)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/WillChangeData.cpp	2016-09-05 09:19:48 UTC (rev 205441)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/WillChangeData.cpp	2016-09-05 09:27:31 UTC (rev 205442)
@@ -99,6 +99,30 @@
     }
 }
 
+static bool propertyCreatesGraphicalGroup(CSSPropertyID property)
+{
+    switch (property) {
+    case CSSPropertyClipPath:
+    case CSSPropertyWebkitClipPath:
+    case CSSPropertyMask:
+    case CSSPropertyOpacity:
+#if ENABLE(CSS_COMPOSITING)
+    case CSSPropertyMixBlendMode:
+    case CSSPropertyIsolation:
+#endif
+    case CSSPropertyFilter:
+#if ENABLE(FILTERS_LEVEL_2)
+    case CSSPropertyWebkitBackdropFilter:
+#endif
+    case CSSPropertyWebkitMask:
+    case CSSPropertyWebkitMaskImage:
+    case CSSPropertyWebkitMaskBoxImage:
+        return true;
+    default:
+        return false;
+    }
+}
+
 static bool propertyTriggersCompositing(CSSPropertyID property)
 {
     switch (property) {
@@ -137,6 +161,8 @@
 
     m_canTriggerCompositingOnInline |= propertyTriggersCompositing(propertyID);
     m_canTriggerCompositing |= m_canTriggerCompositingOnInline | propertyTriggersCompositingOnBoxesOnly(propertyID);
+
+    m_canCreateGraphicalGroup |= propertyCreatesGraphicalGroup(propertyID);
 }
 
 WillChangeData::FeaturePropertyPair WillChangeData::featureAt(size_t index) const

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/WillChangeData.h (205441 => 205442)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/WillChangeData.h	2016-09-05 09:19:48 UTC (rev 205441)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/style/WillChangeData.h	2016-09-05 09:27:31 UTC (rev 205442)
@@ -57,6 +57,7 @@
     bool canCreateStackingContext() const { return m_canCreateStackingContext; }
     bool canTriggerCompositing() const { return m_canTriggerCompositing; }
     bool canTriggerCompositingOnInline() const { return m_canTriggerCompositingOnInline; }
+    bool canCreateGraphicalGroup() const { return m_canCreateGraphicalGroup; }
 
     enum Feature {
         ScrollPosition,
@@ -124,6 +125,7 @@
     bool m_canCreateStackingContext { false };
     bool m_canTriggerCompositing { false };
     bool m_canTriggerCompositingOnInline { false };
+    bool m_canCreateGraphicalGroup { false };
 };
 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to