Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {{license()}} | 2 {{license()}} |
| 3 | 3 |
| 4 #ifndef ComputedStyleBase_h | 4 #ifndef ComputedStyleBase_h |
| 5 #define ComputedStyleBase_h | 5 #define ComputedStyleBase_h |
| 6 | 6 |
| 7 #include "core/ComputedStyleBaseConstants.h" | 7 #include "core/ComputedStyleBaseConstants.h" |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 | 9 |
| 10 {# Returns the default value for the field, converted to fit in the storage cont ainer. #} | 10 {# Returns the default value for the field, converted to fit in the storage cont ainer. #} |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 return true | 76 return true |
| 77 {% for field in fields if not field.property['inherited'] %} | 77 {% for field in fields if not field.property['inherited'] %} |
| 78 && {{field.name}} == o.{{field.name}} | 78 && {{field.name}} == o.{{field.name}} |
| 79 {% endfor %} | 79 {% endfor %} |
| 80 && true; | 80 && true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void setBitDefaults() | 83 void setBitDefaults() |
| 84 { | 84 { |
| 85 {% for field in fields %} | 85 {% for field in fields %} |
| 86 reset{{field.property['upper_camel_name']}}(); | 86 {{field.resetter_method_name}}(); |
| 87 {% endfor %} | 87 {% endfor %} |
| 88 } | 88 } |
| 89 | 89 |
| 90 enum IsAtShadowBoundary { | 90 enum IsAtShadowBoundary { |
| 91 AtShadowBoundary, | 91 AtShadowBoundary, |
| 92 NotAtShadowBoundary, | 92 NotAtShadowBoundary, |
| 93 }; | 93 }; |
| 94 void inheritFrom(const ComputedStyleBase& inheritParent, IsAtShadowBoundary isAtShadowBoundary = NotAtShadowBoundary); | 94 void inheritFrom(const ComputedStyleBase& inheritParent, IsAtShadowBoundary isAtShadowBoundary = NotAtShadowBoundary); |
| 95 | 95 |
| 96 void copyNonInheritedFromCached(const ComputedStyleBase& other); | |
| 97 | |
| 96 // Fields. | 98 // Fields. |
| 97 // TODO(sashab): Remove initialFoo() static methods and update callers to | 99 // TODO(sashab): Remove initialFoo() static methods and update callers to |
| 98 // use resetFoo(), which can be more efficient. | 100 // use resetFoo(), which can be more efficient. |
| 99 {% for field in fields %} | 101 {% for field in fields %} |
| 100 // {{field.property['name']}} | 102 // {{field.property['name']}} |
| 101 inline static {{field.type}} initial{{field.property['upper_camel_name']}}() { return {{field.default_value}}; } | 103 inline static {{field.type}} {{field.initial_method_name}}() { return {{fiel d.default_value}}; } |
| 102 {{field.type}} {{field.property['lower_camel_name']}}() const { return stati c_cast<{{field.type}}>({{field.name}}); } | 104 {{field.type}} {{field.getter_method_name}}() const { return static_cast<{{f ield.type}}>({{field.name}}); } |
| 103 void set{{field.property['upper_camel_name']}}({{field.type}} v) { {{field.n ame}} = static_cast<unsigned>(v); } | 105 void {{field.setter_method_name}}({{field.type}} v) { {{field.name}} = stati c_cast<unsigned>(v); } |
| 104 inline void reset{{field.property['upper_camel_name']}}() { {{field.name}} = {{default_value(field)}}; } | 106 inline void {{field.resetter_method_name}}() { {{field.name}} = {{default_va lue(field)}}; } |
| 105 | 107 |
| 106 {% endfor %} | 108 {% endfor %} |
| 107 protected: | 109 protected: |
| 108 // Storage. | 110 // Storage. |
| 109 {% for field in fields %} | 111 {% for field in fields %} |
| 110 unsigned {{field.name}} : {{field.size}}; // {{field.type}} | 112 unsigned {{field.name}} : {{field.size}}; // {{field.type}} |
| 111 {% endfor %} | 113 {% endfor %} |
| 112 }; | 114 }; |
| 113 | 115 |
| 114 } // namespace blink | 116 } // namespace blink |
| 115 | 117 |
| 116 #endif // ComputedStyleBase_h | 118 #endif // ComputedStyleBase_h |
|
sashab
2016/09/22 06:00:42
// Copyright (c) 2014 The Chromium Authors. All ri
| |
| OLD | NEW |