Modified: trunk/LayoutTests/ChangeLog (206482 => 206483)
--- trunk/LayoutTests/ChangeLog 2016-09-28 01:11:07 UTC (rev 206482)
+++ trunk/LayoutTests/ChangeLog 2016-09-28 01:17:17 UTC (rev 206483)
@@ -1,3 +1,15 @@
+2016-09-27 Zalan Bujtas <za...@apple.com>
+
+ REGRESSION (r204552): Yelp carousel animation is not smooth.
+ https://bugs.webkit.org/show_bug.cgi?id=162632
+
+ Reviewed by Simon Fraser.
+
+ * compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html: Added.
+ * compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html: Added.
+ * compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html: Added.
+ * compositing/hidpi-negative-composited-bounds-on-device-pixel.html: Added.
+
2016-09-27 Chris Dumez <cdu...@apple.com>
<a download> does not honor the same-origin requirement
Added: trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html (0 => 206483)
--- trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html 2016-09-28 01:17:17 UTC (rev 206483)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the gap between the graphics layer and its associated renderer changes dynamically.</title>
+<style>
+div {
+ width: 20px;
+ height: 20px;
+ background-color: green;
+ position: absolute;
+}
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+ var subpixel = 0;
+ var container = document.getElementById("container");
+ for (i = 0; i < 20; ++i) {
+ for (j = 0; j < 20; ++j) {
+ var outer = document.createElement("div");
+ outer.style.top = 25 * i + subpixel + "px";
+ outer.style.left = 25 * j + subpixel + "px";
+ container.appendChild(outer);
+ subpixel += 0.1;
+ }
+ }
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html (0 => 206483)
--- trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html 2016-09-28 01:17:17 UTC (rev 206483)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the gap between the graphics layer and its associated renderer changes dynamically.</title>
+<style>
+div {
+ transform: translateZ(0);
+ width: 20px;
+ height: 20px;
+ background-color: green;
+ position: absolute;
+}
+
+.boxShadow {
+ background-color: yellow;
+}
+</style>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function runTest() {
+ setTimeout(function() {
+ var elements = document.getElementsByClassName("boxShadow")
+ for (var i = 0; i < elements.length; ++i)
+ elements[i].style.boxShadow = "0px 0px 10px transparent";
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }
+</script>
+</head>
+<body _onload_="runTest()">
+<p id="container"></p>
+<script>
+ var subpixel = 0;
+ var container = document.getElementById("container");
+ for (i = 0; i < 20; ++i) {
+ for (j = 0; j < 20; ++j) {
+ var outer = document.createElement("div");
+ outer.style.top = 25 * i + subpixel + "px";
+ outer.style.left = 25 * j + subpixel + "px";
+ outer.className = "boxShadow";
+ outer.appendChild(document.createElement("div"));
+ container.appendChild(outer);
+ subpixel += 0.1;
+ }
+ }
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html (0 => 206483)
--- trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html 2016-09-28 01:17:17 UTC (rev 206483)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the composited bounds lands on device pixel.</title>
+<style>
+.container {
+ position: absolute;
+ background-color: green;
+ width: 50px;
+ height: 50px;
+ left: 10.1px;
+ top: 10.1px;
+}
+
+.offset {
+ background-color: blue;
+ width: 10px;
+ height: 10px;
+ left: -0.6px;
+ top: -0.7px;
+ position: relative;
+ }
+
+.jiggle {
+ height: 30px;
+ width: 30px;
+ background-color: red;
+}
+</style>
+</head>
+<body>
+<div class=container>
+ <div class=offset></div>
+ <div class=jiggle></div>
+</div>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel.html (0 => 206483)
--- trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel.html (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel.html 2016-09-28 01:17:17 UTC (rev 206483)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the composited bounds lands on device pixel.</title>
+<style>
+.container {
+ position: absolute;
+ background-color: green;
+ transform: translateZ(0);
+ width: 50px;
+ height: 50px;
+ left: 10.1px;
+ top: 10.1px;
+}
+
+.offset {
+ background-color: blue;
+ width: 10px;
+ height: 10px;
+ left: -0.6px;
+ top: -0.7px;
+ position: relative;
+ }
+
+.jiggle {
+ height: 30px;
+ width: 30px;
+ background-color: red;
+ transform: translateZ(0);
+}
+</style>
+</head>
+<body>
+<div class=container>
+ <div class=offset></div>
+ <div class=jiggle></div>
+</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (206482 => 206483)
--- trunk/Source/WebCore/ChangeLog 2016-09-28 01:11:07 UTC (rev 206482)
+++ trunk/Source/WebCore/ChangeLog 2016-09-28 01:17:17 UTC (rev 206483)
@@ -1,3 +1,24 @@
+2016-09-27 Zalan Bujtas <za...@apple.com>
+
+ REGRESSION (r204552): Yelp carousel animation is not smooth.
+ https://bugs.webkit.org/show_bug.cgi?id=162632
+
+ Reviewed by Simon Fraser.
+
+ For composited state changes when the layers don't need rebuilding, the updateGeometry() traversal
+ is post-order (see webkit.org/162634), so we can't rely on the offsetfromRenderer() value when
+ computing the graphics layer position on the descendants. We need this workaround until after webkit.org/162634
+ gets fixed.
+
+ Tests: compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html
+ compositing/hidpi-negative-composited-bounds-on-device-pixel.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::computeOffsetFromAncestorGraphicsLayer):
+ (WebCore::ComputedOffsets::ComputedOffsets):
+ (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
+ (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
+
2016-09-27 Said Abou-Hallawa <sabouhall...@apple.com>
Move caching the ImageFrame from BitmapImage to ImageSource
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (206482 => 206483)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-09-28 01:11:07 UTC (rev 206482)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-09-28 01:17:17 UTC (rev 206483)
@@ -740,14 +740,18 @@
return snappedGraphicsLayer;
}
-static LayoutSize computeOffsetFromAncestorGraphicsLayer(RenderLayer* compositedAncestor, const LayoutPoint& location)
+static LayoutSize computeOffsetFromAncestorGraphicsLayer(RenderLayer* compositedAncestor, const LayoutPoint& location, float deviceScaleFactor)
{
if (!compositedAncestor)
return toLayoutSize(location);
- LayoutSize ancestorRenderLayerOffsetFromAncestorGraphicsLayer = -(LayoutSize(compositedAncestor->backing()->graphicsLayer()->offsetFromRenderer())
- + compositedAncestor->backing()->subpixelOffsetFromRenderer());
- return ancestorRenderLayerOffsetFromAncestorGraphicsLayer + toLayoutSize(location);
+ // FIXME: This is a workaround until after webkit.org/162634 gets fixed. ancestorSubpixelOffsetFromRenderer
+ // could be stale when a dynamic composited state change triggers a pre-order updateGeometry() traversal.
+ LayoutSize ancestorSubpixelOffsetFromRenderer = compositedAncestor->backing()->subpixelOffsetFromRenderer();
+ LayoutRect ancestorCompositedBounds = compositedAncestor->backing()->compositedBounds();
+ LayoutSize floored = toLayoutSize(LayoutPoint(floorPointToDevicePixels(ancestorCompositedBounds.location() - ancestorSubpixelOffsetFromRenderer, deviceScaleFactor)));
+ LayoutSize ancestorRendererOffsetFromAncestorGraphicsLayer = -(floored + ancestorSubpixelOffsetFromRenderer);
+ return ancestorRendererOffsetFromAncestorGraphicsLayer + toLayoutSize(location);
}
class ComputedOffsets {
@@ -757,6 +761,7 @@
, m_location(localRect.location())
, m_parentGraphicsLayerOffset(toLayoutSize(parentGraphicsLayerRect.location()))
, m_primaryGraphicsLayerOffset(toLayoutSize(primaryGraphicsLayerRect.location()))
+ , m_deviceScaleFactor(renderLayer.renderer().document().deviceScaleFactor())
{
}
@@ -780,7 +785,7 @@
if (!m_fromAncestorGraphicsLayer) {
RenderLayer* compositedAncestor = m_renderLayer.ancestorCompositingLayer();
LayoutPoint localPointInAncestorRenderLayerCoords = m_renderLayer.convertToLayerCoords(compositedAncestor, m_location, RenderLayer::AdjustForColumns);
- m_fromAncestorGraphicsLayer = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, localPointInAncestorRenderLayerCoords);
+ m_fromAncestorGraphicsLayer = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, localPointInAncestorRenderLayerCoords, m_deviceScaleFactor);
}
return m_fromAncestorGraphicsLayer.value();
}
@@ -794,6 +799,7 @@
const LayoutPoint m_location;
const LayoutSize m_parentGraphicsLayerOffset;
const LayoutSize m_primaryGraphicsLayerOffset;
+ float m_deviceScaleFactor;
};
LayoutRect RenderLayerBacking::computePrimaryGraphicsLayerRect(const LayoutRect& parentGraphicsLayerRect) const
@@ -821,7 +827,7 @@
if (ancestorBackingLayer->hasClippingLayer()) {
// If the compositing ancestor has a layer to clip children, we parent in that, and therefore position relative to it.
LayoutRect clippingBox = clipBox(downcast<RenderBox>(compositedAncestor->renderer()));
- LayoutSize clippingBoxOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, clippingBox.location());
+ LayoutSize clippingBoxOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, clippingBox.location(), deviceScaleFactor());
parentGraphicsLayerRect = snappedGraphicsLayer(clippingBoxOffset, clippingBox.size(), deviceScaleFactor()).m_snappedRect;
}
@@ -850,7 +856,7 @@
RenderLayer::ClipRectsContext clipRectsContext(compositedAncestor, TemporaryClipRects, IgnoreOverlayScrollbarSize, shouldRespectOverflowClip);
LayoutRect parentClipRect = m_owningLayer.backgroundClipRect(clipRectsContext).rect(); // FIXME: Incorrect for CSS regions.
ASSERT(!parentClipRect.isInfinite());
- LayoutSize clippingOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, parentClipRect.location());
+ LayoutSize clippingOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, parentClipRect.location(), deviceScaleFactor());
LayoutRect snappedClippingLayerRect = snappedGraphicsLayer(clippingOffset, parentClipRect.size(), deviceScaleFactor()).m_snappedRect;
// The primary layer is then parented in, and positioned relative to this clipping layer.
ancestorClippingLayerOffset = snappedClippingLayerRect.location() - parentGraphicsLayerRect.location();