From 9d9b128d7fe983381cb51ee34246c4a975dd5d07 Mon Sep 17 00:00:00 2001 From: "zalan@apple.com" Date: Fri, 18 Mar 2016 01:53:58 +0000 Subject: [PATCH] Images in feed on ebay.com jiggle when one is hovered https://bugs.webkit.org/show_bug.cgi?id=155608 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. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198374 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 13 ++++++++ ...rt-clipping-on-composited-content-expected.html | 26 ++++++++++++++++ ...pi-viewport-clipping-on-composited-content.html | 36 ++++++++++++++++++++++ Source/WebCore/ChangeLog | 17 ++++++++++ Source/WebCore/rendering/RenderLayerBacking.cpp | 6 ++-- Source/WebCore/rendering/RenderLayerBacking.h | 1 + 6 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html create mode 100644 LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 2b41ee6..c0a8f28 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,5 +1,18 @@ 2016-03-17 Zalan Bujtas + Images in feed on ebay.com jiggle when one is hovered + https://bugs.webkit.org/show_bug.cgi?id=155608 + + + 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 + Don't initiate a style recall while drawing text https://bugs.webkit.org/show_bug.cgi?id=155618 diff --git a/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html b/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html new file mode 100644 index 0000000..58bdce2 --- /dev/null +++ b/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content-expected.html @@ -0,0 +1,26 @@ + + + +This tests that we position composited content properly when they are clipped to the viewport. + + + + + diff --git a/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html b/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html new file mode 100644 index 0000000..dd84b99 --- /dev/null +++ b/LayoutTests/compositing/hidpi-viewport-clipping-on-composited-content.html @@ -0,0 +1,36 @@ + + + +This tests that we position composited content properly when they are clipped to the viewport. + + + +
+ + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 4d1344c..e290212 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,5 +1,22 @@ 2016-03-17 Zalan Bujtas + Images in feed on ebay.com jiggle when one is hovered + https://bugs.webkit.org/show_bug.cgi?id=155608 + + + 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 + Don't initiate a style recall while drawing text https://bugs.webkit.org/show_bug.cgi?id=155618 diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp index 65e4d0c..e04aed6 100644 --- a/Source/WebCore/rendering/RenderLayerBacking.cpp +++ b/Source/WebCore/rendering/RenderLayerBacking.cpp @@ -785,8 +785,8 @@ void RenderLayerBacking::updateGeometry() 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 @@ FloatPoint3D RenderLayerBacking::computeTransformOriginForPainting(const LayoutR // 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 diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h index 119852e..1c93fab 100644 --- a/Source/WebCore/rendering/RenderLayerBacking.h +++ b/Source/WebCore/rendering/RenderLayerBacking.h @@ -367,6 +367,7 @@ private: 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; -- 1.8.3.1