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

Unified Diff: Source/core/dom/ContainerNode.cpp

Issue 1188563005: Compute snap offsets (both repeat and element based) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up TODOs Created 5 years, 3 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: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index 5a44e55d67cbe96d456b2c3e4279929563e6b35a..066e5875a29671607113dc1bbf9dcaac9607d4c1 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -51,6 +51,7 @@
#include "core/layout/LayoutTheme.h"
#include "core/layout/LayoutView.h"
#include "core/layout/line/InlineTextBox.h"
+#include "core/page/scrolling/SnapCoordinator.h"
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/ScriptForbiddenScope.h"
@@ -872,12 +873,18 @@ void ContainerNode::attach(const AttachContext& context)
attachChildren(context);
clearChildNeedsStyleRecalc();
Node::attach(context);
+
+ if (document().frame() && document().frame()->snapCoordinator())
esprehn 2015/09/24 17:37:41 ditto checking for frame() doesn't make sense, thi
majidvp 2015/10/15 21:47:02 Done.
+ document().frame()->snapCoordinator()->attach(*this);
}
void ContainerNode::detach(const AttachContext& context)
{
detachChildren(context);
setChildNeedsStyleRecalc();
+ if (document().frame() && document().frame()->snapCoordinator())
+ document().frame()->snapCoordinator()->detach(*this);
esprehn 2015/09/24 17:37:41 frame() checks here don't make sense, we must have
majidvp 2015/10/15 21:47:02 Done.
+
Node::detach(context);
}

Powered by Google App Engine
This is Rietveld 408576698