Title: [289686] trunk
Revision
289686
Author
[email protected]
Date
2022-02-11 17:52:57 -0800 (Fri, 11 Feb 2022)

Log Message

`contain:content` breaks fullscreen
https://bugs.webkit.org/show_bug.cgi?id=236470
<rdar://88689388>

Reviewed by Simon Fraser.

Source/WebCore:

Paint/layout containment forms a containing block for fixed positioned block boxes. It makes all fixed
positioned descendants anchored (contained) to this layout container.
This patch enables fullscreen boxes break out of this non-ICB based layout scope (this is similar to what we
do for other, "layout scope changing" properties, see canContainFixedPositionObjects).

Test: fullscreen/fullscreen-prevented-by-containment.html

* css/fullscreen.css:
(:-webkit-full-screen-ancestor:not(iframe)):
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):

LayoutTests:

* fullscreen/fullscreen-prevented-by-containment-expected.txt: Added.
* fullscreen/fullscreen-prevented-by-containment.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (289685 => 289686)


--- trunk/LayoutTests/ChangeLog	2022-02-12 01:46:34 UTC (rev 289685)
+++ trunk/LayoutTests/ChangeLog	2022-02-12 01:52:57 UTC (rev 289686)
@@ -1,3 +1,14 @@
+2022-02-11  Alan Bujtas  <[email protected]>
+
+        `contain:content` breaks fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=236470
+        <rdar://88689388>
+
+        Reviewed by Simon Fraser.
+
+        * fullscreen/fullscreen-prevented-by-containment-expected.txt: Added.
+        * fullscreen/fullscreen-prevented-by-containment.html: Added.
+
 2022-02-11  Truitt Savell  <[email protected]>
 
         Marking expectations for compositing/iframes/border-radius-composited-frame.html as it is failing on EWS

Added: trunk/LayoutTests/fullscreen/fullscreen-prevented-by-containment-expected.txt (0 => 289686)


--- trunk/LayoutTests/fullscreen/fullscreen-prevented-by-containment-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-prevented-by-containment-expected.txt	2022-02-12 01:52:57 UTC (rev 289686)
@@ -0,0 +1,4 @@
+This is the fullscreen element (click to activate)
+EVENT(webkitfullscreenchange) TEST(fullscreener.offsetWidth == window.innerWidth && fullscreener.offsetHeight == window.innerHeight) OK
+END OF TEST
+

Added: trunk/LayoutTests/fullscreen/fullscreen-prevented-by-containment.html (0 => 289686)


--- trunk/LayoutTests/fullscreen/fullscreen-prevented-by-containment.html	                        (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-prevented-by-containment.html	2022-02-12 01:52:57 UTC (rev 289686)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src=""
+<style>
+.content-ancestor {
+  background-color: red;
+  height: 500px;
+  width: 500px;
+}
+.content {
+  contain: content;
+}
+
+#fullscreener {
+  background-color: green;
+}
+</style>
+<div class=content-ancestor>
+  <div class=content>
+    <div id=fullscreener>This is the fullscreen element (click to activate)</div>
+</div>
+<script>
+  if (window.testRunner) {
+    waitForEventTestAndEnd(document, 'webkitfullscreenchange', "fullscreener.offsetWidth == window.innerWidth && fullscreener.offsetHeight == window.innerHeight");
+    runWithKeyDown(function() {
+      fullscreener.webkitRequestFullScreen();
+    });
+  } else {
+     fullscreener.addEventListener('click', function () {
+        fullscreener.webkitRequestFullscreen();
+     }, false);
+ }
+</script>

Modified: trunk/Source/WebCore/ChangeLog (289685 => 289686)


--- trunk/Source/WebCore/ChangeLog	2022-02-12 01:46:34 UTC (rev 289685)
+++ trunk/Source/WebCore/ChangeLog	2022-02-12 01:52:57 UTC (rev 289686)
@@ -1,3 +1,23 @@
+2022-02-11  Alan Bujtas  <[email protected]>
+
+        `contain:content` breaks fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=236470
+        <rdar://88689388>
+
+        Reviewed by Simon Fraser.
+
+        Paint/layout containment forms a containing block for fixed positioned block boxes. It makes all fixed
+        positioned descendants anchored (contained) to this layout container.
+        This patch enables fullscreen boxes break out of this non-ICB based layout scope (this is similar to what we
+        do for other, "layout scope changing" properties, see canContainFixedPositionObjects).
+
+        Test: fullscreen/fullscreen-prevented-by-containment.html
+
+        * css/fullscreen.css:
+        (:-webkit-full-screen-ancestor:not(iframe)):
+        * css/parser/CSSParserContext.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+
 2022-02-11  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r289498.

Modified: trunk/Source/WebCore/css/fullscreen.css (289685 => 289686)


--- trunk/Source/WebCore/css/fullscreen.css	2022-02-12 01:46:34 UTC (rev 289685)
+++ trunk/Source/WebCore/css/fullscreen.css	2022-02-12 01:52:57 UTC (rev 289686)
@@ -48,6 +48,7 @@
     perspective: none !important;
     -webkit-transform-style: flat !important;
     overflow: visible !important;
+    contain: none !important;
 }
 
 video:-webkit-full-screen, audio:-webkit-full-screen {

Modified: trunk/Source/WebCore/css/parser/CSSParserContext.cpp (289685 => 289686)


--- trunk/Source/WebCore/css/parser/CSSParserContext.cpp	2022-02-12 01:46:34 UTC (rev 289685)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.cpp	2022-02-12 01:52:57 UTC (rev 289686)
@@ -51,6 +51,7 @@
         individualTransformPropertiesEnabled = true;
         focusVisibleEnabled = true;
         inputSecurityEnabled = true;
+        containmentEnabled = true;
 #if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
         transformStyleOptimized3DEnabled = true;
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to