Title: [238058] trunk
Revision
238058
Author
[email protected]
Date
2018-11-09 14:57:31 -0800 (Fri, 09 Nov 2018)

Log Message

Normal-flow-only flex items don't correctly respect z-index
https://bugs.webkit.org/show_bug.cgi?id=191486

Reviewed by Simon Fraser.

Source/WebCore:

Test: css3/flexbox/z-index-with-normal-flow-only.html

* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
r125693 did not ensure that flex items which would otherwise be
normal-flow-only would be put into the z-order tree when necessary.
Fix by respecting the same trigger we use to make layers for flex items;
namely, not having auto z-index.

LayoutTests:

* css3/flexbox/z-index-with-normal-flow-only-expected.html: Added.
* css3/flexbox/z-index-with-normal-flow-only.html: Added.
Add a test that a <canvas> with z-index 50 correctly stacks below
a <canvas> that is a flex-item with z-index 100.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (238057 => 238058)


--- trunk/LayoutTests/ChangeLog	2018-11-09 22:50:47 UTC (rev 238057)
+++ trunk/LayoutTests/ChangeLog	2018-11-09 22:57:31 UTC (rev 238058)
@@ -1,3 +1,15 @@
+2018-11-09  Tim Horton  <[email protected]>
+
+        Normal-flow-only flex items don't correctly respect z-index
+        https://bugs.webkit.org/show_bug.cgi?id=191486
+
+        Reviewed by Simon Fraser.
+
+        * css3/flexbox/z-index-with-normal-flow-only-expected.html: Added.
+        * css3/flexbox/z-index-with-normal-flow-only.html: Added.
+        Add a test that a <canvas> with z-index 50 correctly stacks below
+        a <canvas> that is a flex-item with z-index 100.
+
 2018-11-09  Jer Noble  <[email protected]>
 
         SourceBuffer throws an error when appending a second init segment after changeType().

Added: trunk/LayoutTests/css3/flexbox/z-index-with-normal-flow-only-expected.html (0 => 238058)


--- trunk/LayoutTests/css3/flexbox/z-index-with-normal-flow-only-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/z-index-with-normal-flow-only-expected.html	2018-11-09 22:57:31 UTC (rev 238058)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<style>
+div {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+}
+</style>
+<div></div>

Added: trunk/LayoutTests/css3/flexbox/z-index-with-normal-flow-only.html (0 => 238058)


--- trunk/LayoutTests/css3/flexbox/z-index-with-normal-flow-only.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/z-index-with-normal-flow-only.html	2018-11-09 22:57:31 UTC (rev 238058)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+canvas {
+    width: 100px;
+    height: 100px;
+}
+
+.positioned {
+    position: absolute;
+    left: 0;
+    top: 0;
+}
+</style>
+<div style="position: relative;">
+    <div style="display: flex;">
+        <canvas style="z-index: 100; background-color: green;"></img>
+    </div>
+    <canvas class="positioned" style="z-index: 50; background-color: red;"></img>
+</div>

Modified: trunk/Source/WebCore/ChangeLog (238057 => 238058)


--- trunk/Source/WebCore/ChangeLog	2018-11-09 22:50:47 UTC (rev 238057)
+++ trunk/Source/WebCore/ChangeLog	2018-11-09 22:57:31 UTC (rev 238058)
@@ -1,3 +1,19 @@
+2018-11-09  Tim Horton  <[email protected]>
+
+        Normal-flow-only flex items don't correctly respect z-index
+        https://bugs.webkit.org/show_bug.cgi?id=191486
+
+        Reviewed by Simon Fraser.
+
+        Test: css3/flexbox/z-index-with-normal-flow-only.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::canCreateStackingContext):
+        r125693 did not ensure that flex items which would otherwise be
+        normal-flow-only would be put into the z-order tree when necessary.
+        Fix by respecting the same trigger we use to make layers for flex items;
+        namely, not having auto z-index.
+
 2018-11-09  Wenson Hsieh  <[email protected]>
 
         [Cocoa] Implement SPI on WKWebView to increase and decrease list levels

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (238057 => 238058)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-11-09 22:50:47 UTC (rev 238057)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-11-09 22:57:31 UTC (rev 238058)
@@ -529,6 +529,7 @@
         || renderer.isPositioned() // Note that this only creates stacking context in conjunction with explicit z-index.
         || renderer.hasReflection()
         || renderer.style().hasIsolation()
+        || !renderer.style().hasAutoZIndex()
 #if PLATFORM(IOS_FAMILY)
         || layer.canUseAcceleratedTouchScrolling()
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to