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

Unified Diff: Source/core/style/StyleScrollSnapData.h

Issue 1148873005: Parsing CSS properties for scroll snap points (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add additional tests for position parsing Created 5 years, 7 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/style/StyleScrollSnapData.h
diff --git a/Source/core/dom/DatasetDOMStringMap.h b/Source/core/style/StyleScrollSnapData.h
similarity index 53%
copy from Source/core/dom/DatasetDOMStringMap.h
copy to Source/core/style/StyleScrollSnapData.h
index 55d8735e841180757e2ffbc030f4acdb1d76a319..79a85de584fe0b3839d8e24b7be097db5941bd7b 100644
--- a/Source/core/dom/DatasetDOMStringMap.h
+++ b/Source/core/style/StyleScrollSnapData.h
@@ -1,5 +1,5 @@
/*
Timothy Loh 2015/05/27 00:54:04 Here and the other file: https://www.chromium.org
majidvp 2015/05/27 17:48:11 I ported this file from WebKit though it is modifi
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,48 +23,43 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DatasetDOMStringMap_h
-#define DatasetDOMStringMap_h
+#ifndef StyleScrollSnapData_h
+#define StyleScrollSnapData_h
-#include "core/dom/DOMStringMap.h"
-#include "wtf/PassOwnPtr.h"
+#include "platform/LengthSize.h"
+#include "wtf/RefCounted.h"
+#include "wtf/Vector.h"
namespace blink {
-class Element;
-class ExceptionState;
-
-class DatasetDOMStringMap final : public DOMStringMap {
-public:
- static PassOwnPtrWillBeRawPtr<DatasetDOMStringMap> create(Element* element)
- {
- return adoptPtrWillBeNoop(new DatasetDOMStringMap(element));
- }
-
-#if !ENABLE(OILPAN)
- virtual void ref() override;
- virtual void deref() override;
-#endif
+struct ScrollSnapPoints {
+ Length repeatOffset;
+ bool hasRepeat;
+ bool usesElements;
+ ScrollSnapPoints();
+};
- virtual void getNames(Vector<String>&) override;
- virtual String item(const String& name) override;
- virtual bool contains(const String& name) override;
- virtual void setItem(const String& name, const String& value, ExceptionState&) override;
- virtual bool deleteItem(const String& name) override;
+bool operator==(const ScrollSnapPoints&, const ScrollSnapPoints&);
+inline bool operator!=(const ScrollSnapPoints& a, const ScrollSnapPoints& b) { return !(a == b); }
- virtual Element* element() override { return m_element; }
+class StyleScrollSnapData : public RefCounted<StyleScrollSnapData> {
+public:
+ static PassRefPtr<StyleScrollSnapData> create() { return adoptRef(new StyleScrollSnapData); }
+ PassRefPtr<StyleScrollSnapData> copy() { return adoptRef(new StyleScrollSnapData(*this)); }
- DECLARE_VIRTUAL_TRACE();
+ ScrollSnapPoints m_xPoints;
+ ScrollSnapPoints m_yPoints;
+ LengthSize m_destination;
+ Vector<LengthSize> m_coordinates;
private:
- explicit DatasetDOMStringMap(Element* element)
- : m_element(element)
- {
- }
-
- RawPtrWillBeMember<Element> m_element;
+ StyleScrollSnapData();
+ StyleScrollSnapData(const StyleScrollSnapData&);
};
+bool operator==(const StyleScrollSnapData&, const StyleScrollSnapData&);
+inline bool operator!=(const StyleScrollSnapData& a, const StyleScrollSnapData& b) { return !(a == b); }
+
} // namespace blink
-#endif // DatasetDOMStringMap_h
+#endif // StyleScrollSnapData_h

Powered by Google App Engine
This is Rietveld 408576698