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

Unified Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 2203123004: Don't adjust for scrolling of the ancestor, rather than un-adjusting for it later. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 4 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
Index: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
index 14c00546a8a292551c6347ed9a5fb84f5be9875a..0e34c2218893bc322488de07008eafeff852040f 100644
--- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
+++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
@@ -307,14 +307,14 @@ void PaintInvalidationState::updateForNormalChildren()
const LayoutBox& box = toLayoutBox(m_currentObject);
- // Do not clip scroll layer contents because the compositor expects the whole layer
- // to be always invalidated in-time.
- if (box == m_paintInvalidationContainer && box.scrollsOverflow())
+ // Do not clip or scroll for the paint invalidation container, if it scrolls overflow, because it will always use composited
+ // scrolling in this case.
+ if (box == m_paintInvalidationContainer && box.scrollsOverflow()) {
ASSERT(!m_clipped); // The box establishes paint invalidation container, so no m_clipped inherited.
- else
+ } else {
addClipRectRelativeToPaintOffset(box.overflowClipRect(LayoutPoint()));
-
- m_paintOffset -= box.scrolledContentOffset();
+ m_paintOffset -= box.scrolledContentOffset();
+ }
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
}
@@ -323,7 +323,11 @@ static FloatPoint slowLocalToAncestorPoint(const LayoutObject& object, const Lay
{
if (object.isLayoutView())
return toLayoutView(object).localToAncestorPoint(point, &ancestor, TraverseDocumentBoundaries | InputIsInFrameCoordinates);
- return object.localToAncestorPoint(point, &ancestor, TraverseDocumentBoundaries);
+ FloatPoint result = object.localToAncestorPoint(point, &ancestor, TraverseDocumentBoundaries);
+ // Paint invalidation does not include scroll of the ancestor.
+ if (ancestor.isBox())
+ result.move(toLayoutBox(&ancestor)->scrolledContentOffset());
+ return result;
}
LayoutPoint PaintInvalidationState::computePositionFromPaintInvalidationBacking() const

Powered by Google App Engine
This is Rietveld 408576698