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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1188563005: Compute snap offsets (both repeat and element based) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove m_frame 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 9fa9677b4fb48e5ff88842ea7e039a5f757dd04e..e4c67a379d5db81f6003816b2977c74231d4811f 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -189,6 +189,7 @@
#include "core/page/Page.h"
#include "core/page/PointerLockController.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
+#include "core/page/scrolling/SnapCoordinator.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGTitleElement.h"
#include "core/svg/SVGUseElement.h"
@@ -5290,6 +5291,14 @@ bool Document::threadedParsingEnabledForTesting()
return s_threadedParsingEnabledForTesting;
}
+SnapCoordinator* Document::snapCoordinator()
+{
+ if (RuntimeEnabledFeatures::cssScrollSnapPointsEnabled() && !m_snapCoordinator)
+ m_snapCoordinator = SnapCoordinator::create();
+
+ return m_snapCoordinator.get();
+}
+
bool Document::hasActiveParser()
{
return m_activeParserCount || (m_parser && m_parser->processingData());
@@ -5759,6 +5768,7 @@ DEFINE_TRACE(Document)
visitor->trace(m_compositorPendingAnimations);
visitor->trace(m_contextDocument);
visitor->trace(m_canvasFontCache);
+ visitor->trace(m_snapCoordinator);
WillBeHeapSupplementable<Document>::trace(visitor);
#endif
TreeScope::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698