Title: [198374] trunk
- Revision
- 198374
- Author
- [email protected]
- Date
- 2016-03-17 18:53:58 -0700 (Thu, 17 Mar 2016)
Log Message
Images in feed on ebay.com jiggle when one is hovered
https://bugs.webkit.org/show_bug.cgi?id=155608
<rdar://problem/25160681>
The content offset in compositing layer = subpixel gap between the graphics layer and the layer bounds + layer bounds top left.
Reviewed by Simon Fraser.
Source/WebCore:
Test: compositing/hidpi-viewport-clipping-on-composited-content.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
* rendering/RenderLayerBacking.h:
LayoutTests:
* compositing/hidpi-viewport-clipping-on-composited-content-expected.html: Added.
* compositing/hidpi-viewport-clipping-on-composited-content.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (198373 => 198374)
--- trunk/LayoutTests/ChangeLog 2016-03-18 01:43:06 UTC (rev 198373)
+++ trunk/LayoutTests/ChangeLog 2016-03-18 01:53:58 UTC (rev 198374)
@@ -1,5 +1,18 @@
2016-03-17 Zalan Bujtas <[email protected]>
+ Images in feed on ebay.com jiggle when one is hovered
+ https://bugs.webkit.org/show_bug.cgi?id=155608
+ <rdar://problem/25160681>
+
+ The content offset in compositing layer = subpixel gap between the graphics layer and the layer bounds + layer bounds top left.
+
+ Reviewed by Simon Fraser.
+
+ * compositing/hidpi-viewport-clipping-on-composited-content-expected.html: Added.
+ * compositing/hidpi-viewport-clipping-on-composited-content.html: Added.
+
+2016-03-17 Zalan Bujtas <[email protected]>
+
Don't initiate a style recall while drawing text
https://bugs.webkit.org/show_bug.cgi?id=155618
Added: trunk/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html (0 => 198374)
--- trunk/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html 2016-03-18 01:53:58 UTC (rev 198374)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we position composited content properly when they are clipped to the viewport.</title>
+<style>
+ .jiggle {
+ width: 20px;
+ height: 5px;
+ position: absolute;
+ background: green;
+ }
+</style>
+</head>
+<body>
+<script>
+var leftPos = 0;
+for (i = 0; i < 50; ++i) {
+ var element = document.createElement("div");
+ element.className = "jiggle";
+ element.style.top = (6 * i) + "px";
+ element.style.left = leftPos + "px";
+ document.body.appendChild(element);
+ leftPos -= 0.1;
+}
+</script>
+</html>
Added: trunk/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html (0 => 198374)
--- trunk/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html 2016-03-18 01:53:58 UTC (rev 198374)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we position composited content properly when they are clipped to the viewport.</title>
+<style>
+ .jiggle {
+ width: 20px;
+ height: 5px;
+ position: absolute;
+ background: green;
+ }
+
+ .overlapping {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 10px;
+ height: 300px;
+ -webkit-transform: translateZ(0);
+ }
+</style>
+</head>
+<body>
+<div class=overlapping></div>
+<script>
+var leftPos = 0;
+for (i = 0; i < 50; ++i) {
+ var element = document.createElement("div");
+ element.className = "jiggle";
+ element.style.top = (6 * i) + "px";
+ element.style.left = leftPos + "px";
+ document.body.appendChild(element);
+ leftPos -= 0.1;
+}
+</script>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (198373 => 198374)
--- trunk/Source/WebCore/ChangeLog 2016-03-18 01:43:06 UTC (rev 198373)
+++ trunk/Source/WebCore/ChangeLog 2016-03-18 01:53:58 UTC (rev 198374)
@@ -1,5 +1,22 @@
2016-03-17 Zalan Bujtas <[email protected]>
+ Images in feed on ebay.com jiggle when one is hovered
+ https://bugs.webkit.org/show_bug.cgi?id=155608
+ <rdar://problem/25160681>
+
+ The content offset in compositing layer = subpixel gap between the graphics layer and the layer bounds + layer bounds top left.
+
+ Reviewed by Simon Fraser.
+
+ Test: compositing/hidpi-viewport-clipping-on-composited-content.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGeometry):
+ (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
+ * rendering/RenderLayerBacking.h:
+
+2016-03-17 Zalan Bujtas <[email protected]>
+
Don't initiate a style recall while drawing text
https://bugs.webkit.org/show_bug.cgi?id=155618
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (198373 => 198374)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-03-18 01:43:06 UTC (rev 198373)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-03-18 01:53:58 UTC (rev 198374)
@@ -785,8 +785,8 @@
relativeCompositingBounds.moveBy(offsetFromParent);
LayoutRect enclosingRelativeCompositingBounds = LayoutRect(encloseRectToDevicePixels(relativeCompositingBounds, deviceScaleFactor));
- LayoutSize subpixelOffsetAdjustment = enclosingRelativeCompositingBounds.location() - relativeCompositingBounds.location();
- LayoutSize rendererOffsetFromGraphicsLayer = toLayoutSize(localCompositingBounds.location()) + subpixelOffsetAdjustment;
+ m_compositedBoundsDeltaFromGraphicsLayer = enclosingRelativeCompositingBounds.location() - relativeCompositingBounds.location();
+ LayoutSize rendererOffsetFromGraphicsLayer = toLayoutSize(localCompositingBounds.location()) + m_compositedBoundsDeltaFromGraphicsLayer;
FloatSize devicePixelOffsetFromRenderer;
LayoutSize devicePixelFractionFromRenderer;
@@ -2093,7 +2093,7 @@
// Return the offset from the top-left of this compositing layer at which the renderer's contents are painted.
LayoutSize RenderLayerBacking::contentOffsetInCompostingLayer() const
{
- return LayoutSize(-m_compositedBounds.x(), -m_compositedBounds.y()) + m_devicePixelFractionFromRenderer;
+ return LayoutSize(-m_compositedBounds.x() - m_compositedBoundsDeltaFromGraphicsLayer.width(), -m_compositedBounds.y() - m_compositedBoundsDeltaFromGraphicsLayer.height());
}
LayoutRect RenderLayerBacking::contentsBox() const
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (198373 => 198374)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2016-03-18 01:43:06 UTC (rev 198373)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2016-03-18 01:53:58 UTC (rev 198374)
@@ -367,6 +367,7 @@
LayoutRect m_compositedBounds;
LayoutSize m_devicePixelFractionFromRenderer;
+ LayoutSize m_compositedBoundsDeltaFromGraphicsLayer; // This is the (subpixel) distance between the edge of the graphics layer and the layer bounds.
bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work
bool m_isMainFrameRenderViewLayer;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes