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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1419823005: Invalidate background-attachment:fixed on scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 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/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698