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

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

Issue 1394193003: Invalidate background-attachment:fixed on scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename all SlowRepaint to BackgroundAttachmentFixed. rebaseline test. 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 eff218eb7134268d01e5389b289821cf744d68bf..6173fd65b7ae665e82127a48c82e7fb4e4cf4168 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -114,7 +114,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)
@@ -1204,22 +1203,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)
@@ -1286,6 +1285,12 @@ void FrameView::scrollContentsIfNeededRecursive()
});
}
+void FrameView::invalidateBackgroundAttachmentFixedObjects()
+{
+ for (const auto& layoutObject : m_backgroundAttachmentFixedObjects)
+ layoutObject->setShouldDoFullPaintInvalidation();
+}
+
bool FrameView::invalidateViewportConstrainedObjects()
{
for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
@@ -1319,9 +1324,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