Title: [163157] trunk/Source/WebCore
Revision
163157
Author
[email protected]
Date
2014-01-30 21:42:25 -0800 (Thu, 30 Jan 2014)

Log Message

Some fixed position elements disappear in WK2 on iOS
https://bugs.webkit.org/show_bug.cgi?id=127977

Reviewed by Tim Horton.

Use the appropriate rectangle to ensure that on iOS we don't
consider a fixed element outside the viewport when zoomed in,
and therefore never make a compositing layer for it.

Also remove the iOS-specific code in RenderLayerCompositor::requiresCompositingForPosition(),
since it's OK to use the common code. Doing so requires that we
set the "acceleratedCompositingForFixedPositionEnabled" setting to true
for iOS, so do so.

* page/Settings.cpp:
* page/Settings.in:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (163156 => 163157)


--- trunk/Source/WebCore/ChangeLog	2014-01-31 05:41:46 UTC (rev 163156)
+++ trunk/Source/WebCore/ChangeLog	2014-01-31 05:42:25 UTC (rev 163157)
@@ -1,3 +1,24 @@
+2014-01-30  Simon Fraser  <[email protected]>
+
+        Some fixed position elements disappear in WK2 on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=127977
+
+        Reviewed by Tim Horton.
+
+        Use the appropriate rectangle to ensure that on iOS we don't 
+        consider a fixed element outside the viewport when zoomed in,
+        and therefore never make a compositing layer for it.
+
+        Also remove the iOS-specific code in RenderLayerCompositor::requiresCompositingForPosition(),
+        since it's OK to use the common code. Doing so requires that we
+        set the "acceleratedCompositingForFixedPositionEnabled" setting to true
+        for iOS, so do so.
+
+        * page/Settings.cpp:
+        * page/Settings.in:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
+
 2014-01-30  Zalan Bujtas  <[email protected]>
 
         Subpixel rendering: Make RoundedRect layout unit aware.

Modified: trunk/Source/WebCore/page/Settings.cpp (163156 => 163157)


--- trunk/Source/WebCore/page/Settings.cpp	2014-01-31 05:41:46 UTC (rev 163156)
+++ trunk/Source/WebCore/page/Settings.cpp	2014-01-31 05:42:25 UTC (rev 163157)
@@ -124,11 +124,13 @@
 
 #if PLATFORM(IOS)
 static const bool defaultFixedPositionCreatesStackingContext = true;
+static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
 static const bool defaultMediaPlaybackAllowsInline = false;
 static const bool defaultMediaPlaybackRequiresUserGesture = true;
 static const bool defaultShouldRespectImageOrientation = true;
 #else
 static const bool defaultFixedPositionCreatesStackingContext = false;
+static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
 static const bool defaultMediaPlaybackAllowsInline = true;
 static const bool defaultMediaPlaybackRequiresUserGesture = false;
 static const bool defaultShouldRespectImageOrientation = false;

Modified: trunk/Source/WebCore/page/Settings.in (163156 => 163157)


--- trunk/Source/WebCore/page/Settings.in	2014-01-31 05:41:46 UTC (rev 163156)
+++ trunk/Source/WebCore/page/Settings.in	2014-01-31 05:42:25 UTC (rev 163157)
@@ -95,7 +95,7 @@
 
 xssAuditorEnabled initial=false
 unsafePluginPastingEnabled initial=true
-acceleratedCompositingForFixedPositionEnabled initial=false
+acceleratedCompositingForFixedPositionEnabled initial=defaultAcceleratedCompositingForFixedPositionEnabled
 acceleratedCompositingForOverflowScrollEnabled initial=false
 
 # Works only in conjunction with forceCompositingMode.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (163156 => 163157)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-01-31 05:41:46 UTC (rev 163156)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-01-31 05:42:25 UTC (rev 163157)
@@ -2495,24 +2495,9 @@
 
 bool RenderLayerCompositor::requiresCompositingForPosition(RenderLayerModelObject& renderer, const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
 {
-#if PLATFORM(IOS)
-    if (renderer.isStickyPositioned())
-        return true;
-
     // position:fixed elements that create their own stacking context (e.g. have an explicit z-index,
     // opacity, transform) can get their own composited layer. A stacking context is required otherwise
     // z-index and clipping will be broken.
-    if (!(renderer.isOutOfFlowPositioned() && renderer.style().position() == FixedPosition))
-        return false;
-
-    if (!m_renderView.hasCustomFixedPosition(renderer, RenderView::CheckContainingBlock)) {
-        m_reevaluateCompositingAfterLayout = true;
-        return false;
-    }
-#else
-    // position:fixed elements that create their own stacking context (e.g. have an explicit z-index,
-    // opacity, transform) can get their own composited layer. A stacking context is required otherwise
-    // z-index and clipping will be broken.
     if (!renderer.isPositioned())
         return false;
     
@@ -2532,7 +2517,6 @@
 
     if (isSticky)
         return hasCoordinatedScrolling() && isViewportConstrainedFixedOrStickyLayer(layer);
-#endif
 
     auto container = renderer.container();
     // If the renderer is not hooked up yet then we have to wait until it is.
@@ -2563,7 +2547,7 @@
     }
 
     // Fixed position elements that are invisible in the current view don't get their own layer.
-    LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
+    LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedExtentRect();
     LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxes
         | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
     // Map to m_renderView to ignore page scale.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to