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

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: Fix compile issue Created 5 years, 1 month 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 310aa4148998d4807b89e1941c69b1336f076be8..a1726a717250851b291bdd544bcca3b6f006862f 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"
@@ -5329,6 +5330,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());
@@ -5831,6 +5840,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