Index: third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp |
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b34d0416d889d0739893daead4a7ce9d0a3e2c7e |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.cpp |
@@ -0,0 +1,41 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/css/properties/CSSPropertyDescriptor.h" |
+ |
+#include "core/CSSPropertyNames.h" |
sashab
2016/11/30 23:48:39
Remove
aazzam
2016/12/01 04:17:53
done
|
+#include "core/css/properties/CSSPaddingProperties.h" |
+ |
+namespace blink { |
+ |
+#define GET_DESCRIPTOR(X, Y) \ |
sashab
2016/11/30 23:48:39
comment and the one below
instructions on how to u
aazzam
2016/12/01 04:17:53
done
|
+ { X::parseSingleValue, X::id, Y } |
alancutter (OOO until 2018)
2016/11/30 23:46:54
Is Y ever not true?
aazzam
2016/12/01 04:17:54
good point :)
|
+ |
+#define GET_INVALID_DESCRIPTOR() \ |
+ { nullptr, CSSPropertyInvalid, false } |
+ |
+static CSSPropertyDescriptor cssPropertyDescriptors[] = { |
+ GET_INVALID_DESCRIPTOR(), |
+ GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingEnd, true), |
sashab
2016/11/30 23:48:39
Remove 'true' argumetn now :D
aazzam
2016/12/01 04:17:54
done
|
+ GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingStart, true), |
+ GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingBefore, true), |
+ GET_DESCRIPTOR(CSSPropertyAPIWebkitPaddingAfter, true), |
+}; |
+ |
+const CSSPropertyDescriptor& CSSPropertyDescriptor::get(CSSPropertyID id) { |
+ switch (id) { |
sashab
2016/11/30 23:48:39
TODO(azzam): we are using hard-coded indexes for t
aazzam
2016/12/01 04:17:54
done
|
+ case CSSPropertyWebkitPaddingEnd: |
+ return cssPropertyDescriptors[1]; |
+ case CSSPropertyWebkitPaddingStart: |
+ return cssPropertyDescriptors[2]; |
+ case CSSPropertyWebkitPaddingBefore: |
+ return cssPropertyDescriptors[3]; |
+ case CSSPropertyWebkitPaddingAfter: |
+ return cssPropertyDescriptors[4]; |
+ default: |
+ return cssPropertyDescriptors[0]; |
+ } |
+} |
+ |
+} // namespace blink |