OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/CSSPropertyNames.h" | |
6 #include "core/css/CSSValue.h" | |
7 #include "core/css/properties/CSSPropertyAPI.h" | |
8 | |
9 namespace blink { | |
10 | |
11 /* This struct should contain function pointers matching those declared | |
12 in CSSPropertyAPI. API functions should also be added to the getDescriptor | |
13 template below. */ | |
14 struct CSSPropertyDescriptor { | |
15 const CSSValue* (*parseSingleValue)(CSSParserTokenRange&, | |
16 const CSSParserContext&); | |
17 CSSPropertyID (*getID)(); | |
18 | |
19 bool isValidProperty; | |
nainar
2016/11/29 02:17:21
should this maybe be m_isValidProperty?
| |
20 static const CSSPropertyDescriptor& get(CSSPropertyID); | |
21 static void add(CSSPropertyDescriptor, CSSPropertyID); | |
22 }; | |
23 | |
24 template <class T> | |
25 CSSPropertyDescriptor getDescriptor() { | |
26 CSSPropertyDescriptor a; | |
27 a.parseSingleValue = &T::parseSingleValue; | |
28 a.getID = &T::getID; | |
29 | |
30 DCHECK(a.parseSingleValue != CSSPropertyAPI::parseSingleValue); | |
31 DCHECK(a.getID != CSSPropertyAPI::getID); | |
32 | |
33 a.isValidProperty = true; | |
34 return a; | |
35 } | |
36 } | |
OLD | NEW |