- Revision
- 248514
- Author
- simon.fra...@apple.com
- Date
- 2019-08-10 21:03:56 -0700 (Sat, 10 Aug 2019)
Log Message
REGRESSION (r245974): Missing content on habitburger.com, amazon.com
https://bugs.webkit.org/show_bug.cgi?id=200618
rdar://problem/53920224
Reviewed by Zalan Bujtas.
Source/WebCore:
In r245974 TileController::adjustTileCoverageRect() started to intersect the coverage
rect with the bounds of the layer, which is wrong because this coverage rect is passed down
to descendant layers, and they may project outside the bounds of this tiled layer.
This caused missing dropdowns on amazon.com, and a missing menu on habitburger.com on iPhone.
The fix is to just not do the intersection with the bounds. TileGrid::getTileIndexRangeForRect()
already ensures that we never make tiles outside the bounds of a TileController.
Test: compositing/backing/layer-outside-tiled-parent.html
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::ensureTilesForRect):
LayoutTests:
* compositing/backing/layer-outside-tiled-parent-expected.txt: Added.
* compositing/backing/layer-outside-tiled-parent.html: Added.
* platform/ios-wk2/compositing/backing/layer-outside-tiled-parent-expected.txt: Added.
* tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt:
* tiled-drawing/tiled-backing-in-window-expected.txt:
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (248513 => 248514)
--- trunk/LayoutTests/ChangeLog 2019-08-11 03:46:10 UTC (rev 248513)
+++ trunk/LayoutTests/ChangeLog 2019-08-11 04:03:56 UTC (rev 248514)
@@ -1,3 +1,17 @@
+2019-08-10 Simon Fraser <simon.fra...@apple.com>
+
+ REGRESSION (r245974): Missing content on habitburger.com, amazon.com
+ https://bugs.webkit.org/show_bug.cgi?id=200618
+ rdar://problem/53920224
+
+ Reviewed by Zalan Bujtas.
+
+ * compositing/backing/layer-outside-tiled-parent-expected.txt: Added.
+ * compositing/backing/layer-outside-tiled-parent.html: Added.
+ * platform/ios-wk2/compositing/backing/layer-outside-tiled-parent-expected.txt: Added.
+ * tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt:
+ * tiled-drawing/tiled-backing-in-window-expected.txt:
+
2019-08-10 Andres Gonzalez <andresg...@apple.com>
Accessibility client cannot navigate to internal links targets on iOS.
Added: trunk/LayoutTests/compositing/backing/layer-outside-tiled-parent-expected.txt (0 => 248514)
--- trunk/LayoutTests/compositing/backing/layer-outside-tiled-parent-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/backing/layer-outside-tiled-parent-expected.txt 2019-08-11 04:03:56 UTC (rev 248514)
@@ -0,0 +1,44 @@
+trigger This should be visible This should be visible
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 785.00 2628.00)
+ (backingStoreAttached 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 785.00 2628.00)
+ (contentsOpaque 1)
+ (backingStoreAttached 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (anchor 0.50 0.06)
+ (bounds 200.00 2620.00)
+ (usingTiledLayer 1)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [200.00 0.00 0.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (bounds 200.00 296.00)
+ (contentsOpaque 1)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-204.00 0.00 0.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (bounds 200.00 296.00)
+ (contentsOpaque 1)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [404.00 0.00 0.00 1.00])
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/compositing/backing/layer-outside-tiled-parent.html (0 => 248514)
--- trunk/LayoutTests/compositing/backing/layer-outside-tiled-parent.html (rev 0)
+++ trunk/LayoutTests/compositing/backing/layer-outside-tiled-parent.html 2019-08-11 04:03:56 UTC (rev 248514)
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ * {
+ box-sizing: border-box;
+ }
+
+ .container {
+ transform: translate3d(200px, 0px, 0px);
+ border: 2px solid black;
+ width: 200px;
+ height: 300px;
+ }
+
+ .projecting {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 200px;
+ height: 100%;
+ background-color: silver;
+ }
+
+ .projecting.left {
+ transform: translate3d(-102%, 0, 0);
+ }
+
+ .projecting.right {
+ transform: translate3d(202%, 0, 0);
+ }
+
+ .tiling-trigger {
+ position: absolute;
+ left: 0;
+ top: 2600px;
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ window.addEventListener('load', () => {
+ setTimeout(() => {
+ document.getElementById('layers').innerText = "Testing..."; // Trigger a first flush.
+ setTimeout(() => {
+ if (window.internals)
+ document.getElementById('layers').innerText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }, 0);
+ }, false);
+ </script>
+</head>
+<body>
+ <div class="container">
+ <div class="tiling-trigger">trigger</div>
+ <div class="projecting left">
+ This should be visible
+ </nav>
+ <div class="projecting right">
+ This should be visible
+ </nav>
+ </div>
+</div>
+<pre id="layers"></pre>
+</body>
+</html>
Added: trunk/LayoutTests/platform/ios-wk2/compositing/backing/layer-outside-tiled-parent-expected.txt (0 => 248514)
--- trunk/LayoutTests/platform/ios-wk2/compositing/backing/layer-outside-tiled-parent-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/backing/layer-outside-tiled-parent-expected.txt 2019-08-11 04:03:56 UTC (rev 248514)
@@ -0,0 +1,44 @@
+trigger This should be visible This should be visible
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 2630.00)
+ (backingStoreAttached 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 2630.00)
+ (contentsOpaque 1)
+ (backingStoreAttached 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (anchor 0.50 0.06)
+ (bounds 200.00 2622.00)
+ (usingTiledLayer 1)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [200.00 0.00 0.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (bounds 200.00 296.00)
+ (contentsOpaque 1)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-204.00 0.00 0.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (bounds 200.00 296.00)
+ (contentsOpaque 1)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [404.00 0.00 0.00 1.00])
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Modified: trunk/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt (248513 => 248514)
--- trunk/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt 2019-08-11 03:46:10 UTC (rev 248513)
+++ trunk/LayoutTests/tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt 2019-08-11 04:03:56 UTC (rev 248514)
@@ -79,7 +79,7 @@
(contentsOpaque 1)
(drawsContent 1)
(visible rect 0.00, 0.00 0.00 x 0.00)
- (coverage rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect -8.00, -8.00 0.00 x 0.00)
(intersects coverage rect 0)
(contentsScale 1.00)
(tile cache coverage 0, 0 0 x 0)
Modified: trunk/LayoutTests/tiled-drawing/tiled-backing-in-window-expected.txt (248513 => 248514)
--- trunk/LayoutTests/tiled-drawing/tiled-backing-in-window-expected.txt 2019-08-11 03:46:10 UTC (rev 248513)
+++ trunk/LayoutTests/tiled-drawing/tiled-backing-in-window-expected.txt 2019-08-11 04:03:56 UTC (rev 248514)
@@ -63,7 +63,7 @@
(usingTiledLayer 1)
(drawsContent 1)
(visible rect 0.00, 0.00 777.00 x 200.00)
- (coverage rect 0.00, 0.00 777.00 x 200.00)
+ (coverage rect -8.00, -8.00 785.00 x 585.00)
(intersects coverage rect 1)
(contentsScale 1.00)
(tile cache coverage 0, 0 1024 x 200)
Modified: trunk/Source/WebCore/ChangeLog (248513 => 248514)
--- trunk/Source/WebCore/ChangeLog 2019-08-11 03:46:10 UTC (rev 248513)
+++ trunk/Source/WebCore/ChangeLog 2019-08-11 04:03:56 UTC (rev 248514)
@@ -1,3 +1,27 @@
+2019-08-10 Simon Fraser <simon.fra...@apple.com>
+
+ REGRESSION (r245974): Missing content on habitburger.com, amazon.com
+ https://bugs.webkit.org/show_bug.cgi?id=200618
+ rdar://problem/53920224
+
+ Reviewed by Zalan Bujtas.
+
+ In r245974 TileController::adjustTileCoverageRect() started to intersect the coverage
+ rect with the bounds of the layer, which is wrong because this coverage rect is passed down
+ to descendant layers, and they may project outside the bounds of this tiled layer.
+
+ This caused missing dropdowns on amazon.com, and a missing menu on habitburger.com on iPhone.
+
+ The fix is to just not do the intersection with the bounds. TileGrid::getTileIndexRangeForRect()
+ already ensures that we never make tiles outside the bounds of a TileController.
+
+ Test: compositing/backing/layer-outside-tiled-parent.html
+
+ * platform/graphics/ca/TileController.cpp:
+ (WebCore::TileController::adjustTileCoverageRect):
+ * platform/graphics/ca/TileGrid.cpp:
+ (WebCore::TileGrid::ensureTilesForRect):
+
2019-08-10 Andres Gonzalez <andresg...@apple.com>
Accessibility client cannot navigate to internal links targets on iOS.
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (248513 => 248514)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2019-08-11 03:46:10 UTC (rev 248513)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2019-08-11 04:03:56 UTC (rev 248514)
@@ -368,8 +368,7 @@
if (sizeChanged || MemoryPressureHandler::singleton().isUnderMemoryPressure())
return unionRect(coverageRect, currentVisibleRect);
- auto expandedCoverageRect = GraphicsLayer::adjustCoverageRectForMovement(coverageRect, previousVisibleRect, currentVisibleRect);
- return intersection(expandedCoverageRect, boundsWithoutMargin());
+ return GraphicsLayer::adjustCoverageRectForMovement(coverageRect, previousVisibleRect, currentVisibleRect);
}
#if !PLATFORM(IOS_FAMILY)
Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (248513 => 248514)
--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2019-08-11 03:46:10 UTC (rev 248513)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2019-08-11 04:03:56 UTC (rev 248514)
@@ -557,8 +557,6 @@
if (!m_controller.isInWindow())
return IntRect();
- LOG_WITH_STREAM(Tiling, stream << "TileGrid " << this << " ensureTilesForRect: " << rect);
-
FloatRect scaledRect(rect);
scaledRect.scale(m_scale);
IntRect rectInTileCoords(enclosingIntRect(scaledRect));
@@ -608,10 +606,12 @@
m_containerLayer.get().appendSublayer(*tileInfo.layer);
}
}
-
+
if (tilesInCohort)
startedNewCohort(currCohort);
+ LOG_WITH_STREAM(Tiling, stream << "TileGrid " << this << " (bounds " << m_controller.bounds() << ") ensureTilesForRect: " << rect << " covered " << coverageRect);
+
return coverageRect;
}