Index: third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
diff --git a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
index aca6905209fda100ea972fef3eafeb874bafb36c..b435e82c6ea748ab18eca145e7b4097af62a8610 100644 |
--- a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
+++ b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
@@ -17,6 +17,12 @@ class ContainerNode; |
class Element; |
class LayoutBox; |
struct LengthPoint; |
+class SnapManager; |
+ |
+struct SnapOffsets { |
+ Vector<double> horizontal; |
+ Vector<double> vertical; |
+}; |
// Snap Coordinator keeps track of snap containers and all of their associated |
// snap areas. It also contains the logic to generate the list of valid snap |
@@ -33,15 +39,22 @@ struct LengthPoint; |
// For more information see spec: https://drafts.csswg.org/css-snappoints/ |
class CORE_EXPORT SnapCoordinator final : public GarbageCollectedFinalized<SnapCoordinator> { |
WTF_MAKE_NONCOPYABLE(SnapCoordinator); |
- |
public: |
- static SnapCoordinator* create(); |
+ class Client { |
+ public: |
+ virtual void didUpdateSnapOffsets(const LayoutBox&, SnapOffsets) = 0; |
+ }; |
+ |
+ static SnapCoordinator* create(Client*); |
~SnapCoordinator(); |
DEFINE_INLINE_TRACE() {} |
void snapContainerDidChange(LayoutBox&, ScrollSnapType); |
void snapAreaDidChange(LayoutBox&, const Vector<LengthPoint>& snapCoordinates); |
+ void notifyLayoutUpdated(); |
+ void clear(); |
+ |
#ifndef NDEBUG |
void showSnapAreaMap(); |
void showSnapAreasFor(const LayoutBox*); |
@@ -49,13 +62,18 @@ public: |
private: |
friend class SnapCoordinatorTest; |
- explicit SnapCoordinator(); |
+ explicit SnapCoordinator(Client*); |
Vector<double> snapOffsets(const ContainerNode&, ScrollbarOrientation); |
HashSet<const LayoutBox*> m_snapContainers; |
+ HashMap<const LayoutBox*, SnapOffsets> m_offsetMap; |
+ Client* m_client; |
+ |
}; |
+bool operator==(const SnapOffsets&, const SnapOffsets&); |
+ |
} // namespace blink |
#endif // SnapCoordinator_h |