Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1193)

Unified Diff: third_party/WebKit/Source/web/LinkHighlightImpl.cpp

Issue 2019583002: Don't include scroll offset in offsetFromLayoutObject for scrolling contents layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/LinkHighlightImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/LinkHighlightImpl.cpp
diff --git a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
index c1414d48d8062396cedf5cfbc21ab39710e736cd..3fac9ec6e92249418a706b0507d354dad1137a67 100644
--- a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
+++ b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
@@ -71,6 +71,7 @@ LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl)
: m_node(node)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
+ , m_isScrollingGraphicsLayer(false)
, m_geometryNeedsUpdate(false)
, m_isAnimating(false)
, m_startTime(monotonicallyIncreasingTime())
@@ -127,9 +128,12 @@ void LinkHighlightImpl::releaseResources()
void LinkHighlightImpl::attachLinkHighlightToCompositingLayer(const LayoutBoxModelObject& paintInvalidationContainer)
{
GraphicsLayer* newGraphicsLayer = paintInvalidationContainer.layer()->graphicsLayerBacking();
+ m_isScrollingGraphicsLayer = false;
// FIXME: There should always be a GraphicsLayer. See crbug.com/431961.
- if (newGraphicsLayer && !newGraphicsLayer->drawsContent())
+ if (paintInvalidationContainer.layer()->needsCompositedScrolling() && m_node->layoutObject() != &paintInvalidationContainer) {
newGraphicsLayer = paintInvalidationContainer.layer()->graphicsLayerBackingForScrolling();
+ m_isScrollingGraphicsLayer = true;
+ }
if (!newGraphicsLayer)
return;
@@ -222,6 +226,13 @@ bool LinkHighlightImpl::computeHighlightLayerPathAndPosition(const LayoutBoxMode
for (size_t quadIndex = 0; quadIndex < quads.size(); ++quadIndex) {
FloatQuad absoluteQuad = quads[quadIndex];
+ // Scrolling content layers have the same offset from layout object as the non-scrolling layers. Thus we need
+ // to adjust for their scroll offset.
+ if (m_isScrollingGraphicsLayer) {
+ DoubleSize adjustedScrollOffset = paintInvalidationContainer.layer()->getScrollableArea()->adjustedScrollOffset();
+ absoluteQuad.move(adjustedScrollOffset.width(), adjustedScrollOffset.height());
+ }
+
// Transform node quads in target absolute coords to local coordinates in the compositor layer.
FloatQuad transformedQuad;
convertTargetSpaceQuadToCompositedLayer(absoluteQuad, m_node->layoutObject(), paintInvalidationContainer, transformedQuad);
« no previous file with comments | « third_party/WebKit/Source/web/LinkHighlightImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698