https://bugs.webkit.org/show_bug.cgi?id=147019
Reviewed by Tim Horton.
Source/WebCore:
Test: compositing/fixed-with-fixed-layout.html
When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
use the simpler document bounds (before scaling).
In the long term, there needs to be an equivalent of viewportConstrainedVisibleContentRect()
that gives an appropriate rect that can be used here.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
LayoutTests:
Test with four fixed elements in fixed layout mode.
* compositing/fixed-with-fixed-layout-expected.txt: Added.
* compositing/fixed-with-fixed-layout.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186911
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-07-16 Simon Fraser <simon.fraser@apple.com>
+
+ Fix disappearing position:fixed elements in fixed layout mode
+ https://bugs.webkit.org/show_bug.cgi?id=147019
+
+ Reviewed by Tim Horton.
+
+ Test with four fixed elements in fixed layout mode.
+
+ * compositing/fixed-with-fixed-layout-expected.txt: Added.
+ * compositing/fixed-with-fixed-layout.html: Added.
+
2015-07-16 Filip Pizlo <fpizlo@apple.com>
Unreviewed, roll out http://trac.webkit.org/changeset/186903. It broke the build.
--- /dev/null
+Top Left Right bottom
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 806.00 1616.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 1008.00 2021.00)
+ (contentsOpaque 1)
+ (transform [0.80 0.00 0.00 0.00] [0.00 0.80 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
+ (children 4
+ (GraphicsLayer
+ (bounds 1000.00 100.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 0.00 200.00)
+ (bounds 100.00 100.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 900.00 200.00)
+ (bounds 100.00 100.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 0.00 1900.00)
+ (bounds 1000.00 100.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
--- /dev/null
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ body {
+ height: 2000px;
+ width: 1000px;
+ }
+
+ .fixed {
+ position: fixed;
+ height: 100px;
+ width: 100px;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
+
+ .top, .bottom {
+ left: 0;
+ width: 100%;
+ }
+
+ .left, .right {
+ top: 200px;
+ }
+
+ .top {
+ top: 0;
+ }
+
+ .bottom {
+ bottom: 0;
+ }
+ .left {
+ left: 0;
+ }
+ .right {
+ right: 0;
+ }
+ </style>
+ <script>
+
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ if (window.internals) {
+ internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
+ internals.setUseFixedLayout(true);
+ internals.setFixedLayoutSize(1000, 2000);
+ var scale = 800 / 1000;
+ eventSender.scalePageBy(scale, scale);
+ }
+
+ function doTest()
+ {
+ window.setTimeout(function() {
+ document.getElementById("layerTree").innerText = window.internals.layerTreeAsText(document);
+ testRunner.notifyDone();
+ }, 0);
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+
+<div class="top fixed">
+ Top
+</div>
+
+<div class="left fixed">
+ Left
+</div>
+
+<div class="right fixed">
+ Right
+</div>
+
+<div class="bottom fixed">
+ bottom
+</div>
+
+<pre id="layerTree"></pre>
+</body>
+</html>
+2015-07-16 Simon Fraser <simon.fraser@apple.com>
+
+ Fix disappearing position:fixed elements in fixed layout mode
+ https://bugs.webkit.org/show_bug.cgi?id=147019
+
+ Reviewed by Tim Horton.
+
+ Test: compositing/fixed-with-fixed-layout.html
+
+ When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
+ the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
+ use the simpler document bounds (before scaling).
+
+ In the long term, there needs to be an equivalent of viewportConstrainedVisibleContentRect()
+ that gives an appropriate rect that can be used here.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
+
2015-07-16 Benjamin Poulain <bpoulain@apple.com>
[Content extensions] Combine suffixes when generating NFAs
}
// Fixed position elements that are invisible in the current view don't get their own layer.
- LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
+ // FIXME: We shouldn't have to check useFixedLayout() here; one of the viewport rects needs to give the correct answer.
+ LayoutRect viewBounds;
+ if (m_renderView.frameView().useFixedLayout())
+ viewBounds = m_renderView.unscaledDocumentRect();
+ else
+ viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
LayoutRect layerBounds = layer.calculateLayerBounds(&layer, LayoutSize(), RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxesExcludingCompositing
| RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
// Map to m_renderView to ignore page scale.