Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index 3c579bf8e4103bcd2c2dc80298e656f22cc3b95b..2b1f96abdd8d3ff6f831f35706641071a83d7921 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -115,7 +115,6 @@ FrameView::FrameView(LocalFrame* frame) |
: m_frame(frame) |
, m_displayMode(WebDisplayModeBrowser) |
, m_canHaveScrollbars(true) |
- , m_slowRepaintObjectCount(0) |
, m_hasPendingLayout(false) |
, m_inSynchronousPostLayout(false) |
, m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) |
@@ -1195,22 +1194,22 @@ bool FrameView::contentsInCompositedLayer() const |
return layoutView && layoutView->compositingState() == PaintsIntoOwnBacking; |
} |
-void FrameView::addSlowRepaintObject() |
+void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) |
{ |
- if (!m_slowRepaintObjectCount++) { |
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
- scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this); |
- } |
+ ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); |
+ |
+ m_backgroundAttachmentFixedObjects.add(object); |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(this); |
} |
-void FrameView::removeSlowRepaintObject() |
+void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) |
{ |
- ASSERT(m_slowRepaintObjectCount > 0); |
- m_slowRepaintObjectCount--; |
- if (!m_slowRepaintObjectCount) { |
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
- scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(this); |
- } |
+ ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); |
+ |
+ m_backgroundAttachmentFixedObjects.remove(object); |
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
+ scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(this); |
} |
void FrameView::addViewportConstrainedObject(LayoutObject* object) |
@@ -1282,6 +1281,12 @@ void FrameView::scrollContentsIfNeededRecursive() |
} |
} |
+void FrameView::invalidateBackgroundAttachmentFixedObjects() |
+{ |
+ for (const auto& layoutObject : m_backgroundAttachmentFixedObjects) |
+ layoutObject->setShouldDoFullPaintInvalidation(); |
+} |
+ |
bool FrameView::invalidateViewportConstrainedObjects() |
{ |
for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
@@ -1315,9 +1320,11 @@ bool FrameView::invalidateViewportConstrainedObjects() |
bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta) |
{ |
- if (!contentsInCompositedLayer() || hasSlowRepaintObjects()) |
+ if (!contentsInCompositedLayer()) |
return false; |
+ invalidateBackgroundAttachmentFixedObjects(); |
+ |
if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty()) { |
InspectorInstrumentation::didUpdateLayout(m_frame.get()); |
return true; |