Have fixedPositionCreatesStackingContext be on by default everywhere
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Mar 2017 05:46:52 +0000 (05:46 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Mar 2017 05:46:52 +0000 (05:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169334

Reviewed by Zalan Bujtas.

It makes no sense to have web-exposed CSS functionality be different based on setting,
and other browser are now aligned with having position:fixed create stacking context.

So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
always force stacking context for position:fixed.

Source/WebCore:

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* page/Settings.cpp:
* page/Settings.in:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):

LayoutTests:

* compositing/absolute-inside-out-of-view-fixed.html:
* compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html:
* compositing/layer-creation/fixed-overlap-extent-rtl.html:
* compositing/layer-creation/fixed-overlap-extent.html:
* compositing/layer-creation/fixed-position-change-out-of-view-in-view.html:
* compositing/layer-creation/fixed-position-in-view-dynamic.html:
* compositing/layer-creation/fixed-position-out-of-view-dynamic.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-iframe-scroll.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-iframe.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html:
* compositing/layer-creation/fixed-position-out-of-view-scaled.html:
* compositing/layer-creation/fixed-position-transformed-into-view.html:
* compositing/layer-creation/fixed-position-transformed-outside-view.html:
* compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html:
* compositing/repaint/scroll-fixed-layer-no-content.html:
* compositing/repaint/scroll-fixed-layer-out-of-view.html:
* fast/block/positioning/fixed-position-stacking-context2.html:
* fullscreen/full-screen-fixed-pos-parent.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/absolute-inside-out-of-view-fixed.html
LayoutTests/compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html
LayoutTests/compositing/layer-creation/fixed-overlap-extent-rtl.html
LayoutTests/compositing/layer-creation/fixed-overlap-extent.html
LayoutTests/compositing/layer-creation/fixed-position-change-out-of-view-in-view.html
LayoutTests/compositing/layer-creation/fixed-position-in-view-dynamic.html
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-dynamic.html
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-iframe-scroll.html
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-iframe.html
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-scaled.html
LayoutTests/compositing/layer-creation/fixed-position-transformed-into-view.html
LayoutTests/compositing/layer-creation/fixed-position-transformed-outside-view.html
LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html
LayoutTests/compositing/repaint/scroll-fixed-layer-no-content.html
LayoutTests/compositing/repaint/scroll-fixed-layer-out-of-view.html
LayoutTests/fast/block/positioning/fixed-position-stacking-context2.html
LayoutTests/fullscreen/full-screen-fixed-pos-parent.html
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index fd90f70..c988329 100644 (file)
@@ -1,3 +1,35 @@
+2017-03-07  Simon Fraser  <simon.fraser@apple.com>
+
+        Have fixedPositionCreatesStackingContext be on by default everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=169334
+
+        Reviewed by Zalan Bujtas.
+
+        It makes no sense to have web-exposed CSS functionality be different based on setting,
+        and other browser are now aligned with having position:fixed create stacking context.
+
+        So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
+        always force stacking context for position:fixed.
+
+        * compositing/absolute-inside-out-of-view-fixed.html:
+        * compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html:
+        * compositing/layer-creation/fixed-overlap-extent-rtl.html:
+        * compositing/layer-creation/fixed-overlap-extent.html:
+        * compositing/layer-creation/fixed-position-change-out-of-view-in-view.html:
+        * compositing/layer-creation/fixed-position-in-view-dynamic.html:
+        * compositing/layer-creation/fixed-position-out-of-view-dynamic.html:
+        * compositing/layer-creation/fixed-position-out-of-view-scaled-iframe-scroll.html:
+        * compositing/layer-creation/fixed-position-out-of-view-scaled-iframe.html:
+        * compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html:
+        * compositing/layer-creation/fixed-position-out-of-view-scaled.html:
+        * compositing/layer-creation/fixed-position-transformed-into-view.html:
+        * compositing/layer-creation/fixed-position-transformed-outside-view.html:
+        * compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html:
+        * compositing/repaint/scroll-fixed-layer-no-content.html:
+        * compositing/repaint/scroll-fixed-layer-out-of-view.html:
+        * fast/block/positioning/fixed-position-stacking-context2.html:
+        * fullscreen/full-screen-fixed-pos-parent.html:
+
 2017-03-07  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebCrypto] Implement ECDH ImportKey/ExportKey operations
index ac2bc36..dcacd29 100644 (file)
       if (window.testRunner) {
         testRunner.waitUntilDone();
         testRunner.dumpAsText();
-        if (window.internals) {
+        if (window.internals)
             window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-            window.internals.settings.setFixedPositionCreatesStackingContext(true);
-        }
       }
 
       function doScroll()
index 87e8a49..4dd4107 100644 (file)
@@ -27,7 +27,6 @@
   if (window.internals) {
     window.internals.settings.setVisualViewportEnabled(false);
     window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
     window.internals.setPageScaleFactor(0.5, 0, 0);
   }
 </script>
index a0b00c0..9f80aa7 100644 (file)
         if (window.testRunner)
             testRunner.dumpAsText();
 
-        if (window.internals) {
+        if (window.internals)
             internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-            internals.settings.setFixedPositionCreatesStackingContext(true);
-        }
 
         function doTest()
         {
index b8d5d76..d83a075 100644 (file)
         if (window.testRunner)
             testRunner.dumpAsText();
 
-        if (window.internals) {
+        if (window.internals)
             internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-            internals.settings.setFixedPositionCreatesStackingContext(true);
-        }
 
         function doTest()
         {
index 480557c..1b4a762 100644 (file)
@@ -11,7 +11,6 @@
     if (window.testRunner && window.internals) {
       testRunner.dumpAsText();
       internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-      internals.settings.setFixedPositionCreatesStackingContext(true);
 
       addEventListener("load", function() {
         document.getElementById("layerTree1").innerText = internals.layerTreeAsText(document);
index 15b68e4..e215c85 100644 (file)
@@ -16,7 +16,6 @@
     if (window.testRunner && window.internals) {
       testRunner.dumpAsText();
       internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-      internals.settings.setFixedPositionCreatesStackingContext(true);
 
       addEventListener("load", function() {
         var fixed = document.createElement("div");
index 3fbb904..4d3949c 100644 (file)
@@ -16,7 +16,6 @@
     if (window.testRunner && window.internals) {
       testRunner.dumpAsText();
       internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-      internals.settings.setFixedPositionCreatesStackingContext(true);
 
       addEventListener("load", function() {
         var fixed = document.createElement("div");
index 1999cb2..8c2461b 100644 (file)
@@ -8,7 +8,6 @@
   }
   if (window.internals) {
     window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
 
     addEventListener("load", function() {
       window.internals.setPageScaleFactor(0.5, 0, 0);
index a310541..b362653 100644 (file)
@@ -8,7 +8,6 @@
   }
   if (window.internals) {
     window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
 
     addEventListener("load", function() {
       window.internals.setPageScaleFactor(0.5, 0, 0);
index 9c0ae46..e4a3c31 100644 (file)
@@ -16,7 +16,6 @@
   }
   if (window.internals) {
     window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
 
     addEventListener("load", function() {
       window.scrollTo(100,100);
index 96c9530..1c886b0 100644 (file)
@@ -16,7 +16,6 @@
   }
   if (window.internals) {
     window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
 
     addEventListener("load", function() {
       document.getElementById("layerTree").innerText = internals.layerTreeAsText(document);
index 1322847..3314088 100644 (file)
@@ -31,7 +31,6 @@ if (window.testRunner) {
 }
 if (window.internals) {
     window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
 
     window.addEventListener("load", function() {
         document.getElementById("layerTree").innerText = internals.layerTreeAsText(document);
index f12b26d..32c85fb 100644 (file)
@@ -31,7 +31,6 @@
     }
     if (window.internals) {
         window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-        window.internals.settings.setFixedPositionCreatesStackingContext(true);
 
         window.addEventListener("load", function() {
             document.getElementById("layerTree").innerText = internals.layerTreeAsText(document);
index 3256cd3..84dfe94 100644 (file)
   </style>
 
   <script type="text/javascript">
-    if (window.internals) {
+    if (window.internals)
       window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-      window.internals.settings.setFixedPositionCreatesStackingContext(true);
-    }
 
     if (window.testRunner) {
       testRunner.dumpAsText();
index 0690679..891ca57 100644 (file)
@@ -5,10 +5,8 @@
         if (window.testRunner)
             testRunner.dumpAsText();
 
-        if (window.internals) {
+        if (window.internals)
             internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-            internals.settings.setFixedPositionCreatesStackingContext(true);
-        }
 
         function test()
         {
index 2188c08..768b5eb 100644 (file)
@@ -5,10 +5,8 @@
         if (window.testRunner)
             testRunner.dumpAsText();
 
-        if (window.internals) {
+        if (window.internals)
             internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-            internals.settings.setFixedPositionCreatesStackingContext(true);
-        }
 
         function test()
         {
index 76a7f77..066b7b7 100644 (file)
@@ -23,13 +23,6 @@ div {
     z-index: 2;
 }
 </style>
-<script>
-if ("internals" in window) {
-    window.internals.settings.setFixedPositionCreatesStackingContext(true);
-} else {
-    document.write("This test depends on the FixedPositionCreatesStackingContext setting being true, so run in DumpRenderTree or manually enable it");
-}
-</script>
 <div class="green"></div>
 <div class="container">
   <div class="green"></div>
index 054523b..523798e 100644 (file)
@@ -26,9 +26,6 @@
 </head>
 <script src="full-screen-test.js"></script>
 <script>
-    if (window.internals)
-        window.internals.settings.setFixedPositionCreatesStackingContext(true);
-
     function doTest() {
         if (window.testRunner) {
             testRunner.dumpAsText(true);
index 20af34e..b11c7e0 100644 (file)
@@ -1,3 +1,21 @@
+2017-03-07  Simon Fraser  <simon.fraser@apple.com>
+
+        Have fixedPositionCreatesStackingContext be on by default everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=169334
+
+        Reviewed by Zalan Bujtas.
+
+        It makes no sense to have web-exposed CSS functionality be different based on setting,
+        and other browser are now aligned with having position:fixed create stacking context.
+
+        So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
+        always force stacking context for position:fixed.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyle):
+        * page/Settings.cpp:
+        * page/Settings.in:
+
 2017-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         Asynchronous image decoding should consider the drawing size if it is smaller than the size of the image
index 5f84f2d..0ace4c2 100644 (file)
@@ -911,7 +911,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par
             || style.hasBlendMode()
             || style.hasIsolation()
             || style.position() == StickyPosition
-            || (style.position() == FixedPosition && settings().fixedPositionCreatesStackingContext())
+            || style.position() == FixedPosition
             || style.hasFlowFrom()
             || style.willChangeCreatesStackingContext())
             style.setZIndex(0);
index 7d08784..1b3e22b 100644 (file)
@@ -142,7 +142,6 @@ static const bool defaultYouTubeFlashPluginReplacementEnabled = false;
 #endif
 
 #if PLATFORM(IOS)
-static const bool defaultFixedPositionCreatesStackingContext = true;
 static const bool defaultFixedBackgroundsPaintRelativeToDocument = true;
 static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
 static const bool defaultAllowsInlineMediaPlayback = false;
@@ -156,7 +155,6 @@ static const bool defaultScrollingTreeIncludesFrames = true;
 static const bool defaultMediaControlsScaleWithPageZoom = true;
 static const bool defaultQuickTimePluginReplacementEnabled = true;
 #else
-static const bool defaultFixedPositionCreatesStackingContext = false;
 static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
 static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
 static const bool defaultAllowsInlineMediaPlayback = true;
index ecff410..13ed3e0 100644 (file)
@@ -158,7 +158,6 @@ imageSubsamplingEnabled initial=defaultImageSubsamplingEnabled
 wantsBalancedSetDefersLoadingBehavior initial=false
 requestAnimationFrameEnabled initial=true
 
-fixedPositionCreatesStackingContext initial=defaultFixedPositionCreatesStackingContext
 cookieEnabled initial=true
 mediaEnabled initial=true
 DOMPasteAllowed initial=false
index 6009d14..e4e7ef2 100644 (file)
@@ -1,3 +1,19 @@
+2017-03-07  Simon Fraser  <simon.fraser@apple.com>
+
+        Have fixedPositionCreatesStackingContext be on by default everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=169334
+
+        Reviewed by Zalan Bujtas.
+
+        It makes no sense to have web-exposed CSS functionality be different based on setting,
+        and other browser are now aligned with having position:fixed create stacking context.
+
+        So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
+        always force stacking context for position:fixed.
+
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-03-06  Simon Fraser  <simon.fraser@apple.com>
 
         Initialize the subpixelAntialiasedLayerTextEnabled Setting in WebKit1
index fbd416c..e3623cd 100644 (file)
@@ -2776,7 +2776,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setPlugInSnapshottingEnabled([preferences plugInSnapshottingEnabled]);
     settings.setHttpEquivEnabled([preferences httpEquivEnabled]);
 
-    settings.setFixedPositionCreatesStackingContext(true);
 #if PLATFORM(MAC)
     settings.setAcceleratedCompositingForFixedPositionEnabled(true);
 #endif
index 5762dd8..bdc94e1 100644 (file)
@@ -1,3 +1,23 @@
+2017-03-07  Simon Fraser  <simon.fraser@apple.com>
+
+        Have fixedPositionCreatesStackingContext be on by default everywhere
+        https://bugs.webkit.org/show_bug.cgi?id=169334
+
+        Reviewed by Zalan Bujtas.
+
+        It makes no sense to have web-exposed CSS functionality be different based on setting,
+        and other browser are now aligned with having position:fixed create stacking context.
+
+        So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
+        always force stacking context for position:fixed.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setUseFixedLayout):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
+
 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
 
         [Mac][WK2] Whitelist iokit-get-properties
index a2da574..2b88fd7 100644 (file)
@@ -183,7 +183,6 @@ void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store)
     // Fixed position elements need to be composited and create stacking contexts
     // in order to be scrolled by the ScrollingCoordinator.
     settings.setAcceleratedCompositingForFixedPositionEnabled(settings.acceleratedCompositingEnabled());
-    settings.setFixedPositionCreatesStackingContext(settings.acceleratedCompositingEnabled());
 #endif
 
     m_alwaysUseCompositing = settings.acceleratedCompositingEnabled() && settings.forceCompositingMode();
index 8f88d9a..b7a10c2 100644 (file)
@@ -1681,7 +1681,6 @@ void WebPage::setUseFixedLayout(bool fixed)
 #endif
 #if USE(COORDINATED_GRAPHICS)
     m_page->settings().setAcceleratedCompositingForFixedPositionEnabled(fixed);
-    m_page->settings().setFixedPositionCreatesStackingContext(fixed);
     m_page->settings().setDelegatesPageScaling(fixed);
     m_page->settings().setScrollingCoordinatorEnabled(fixed);
 #endif
index 5969b6f..5d39446 100644 (file)
@@ -177,7 +177,6 @@ void RemoteLayerTreeDrawingArea::updatePreferences(const WebPreferencesStore&)
     // Fixed position elements need to be composited and create stacking contexts
     // in order to be scrolled by the ScrollingCoordinator.
     settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    settings.setFixedPositionCreatesStackingContext(true);
 
     m_rootLayer->setShowDebugBorder(settings.showDebugBorders());
 
index f2067f2..06785b3 100644 (file)
@@ -202,11 +202,8 @@ void TiledCoreAnimationDrawingArea::updatePreferences(const WebPreferencesStore&
 #endif
 
     // Fixed position elements need to be composited and create stacking contexts
-    // in order to be scrolled by the ScrollingCoordinator. We also want to keep
-    // Settings:setFixedPositionCreatesStackingContext() enabled for iOS. See
-    // <rdar://problem/9813262> for more details.
+    // in order to be scrolled by the ScrollingCoordinator.
     settings.setAcceleratedCompositingForFixedPositionEnabled(true);
-    settings.setFixedPositionCreatesStackingContext(true);
 
     if (MainFrame* mainFrame = m_webPage.mainFrame())
         DebugPageOverlays::settingsChanged(*mainFrame);