| OLD | NEW |
| 1 {% from 'macros.tmpl' import license, print_if %} | 1 {% from 'macros.tmpl' import license, print_if %} |
| 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/style/ComputedStyleConstants.h" | 7 #include "core/style/ComputedStyleConstants.h" |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 {% for path in include_paths %} | 9 {% for path in include_paths %} |
| 10 #include "{{path}}" | 10 #include "{{path}}" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 'storage_only': storage_only, | 26 'storage_only': storage_only, |
| 27 'external': external | 27 'external': external |
| 28 } %} | 28 } %} |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 // The generated portion of ComputedStyle. For more info, see the header comment | 32 // The generated portion of ComputedStyle. For more info, see the header comment |
| 33 // in ComputedStyle.h. | 33 // in ComputedStyle.h. |
| 34 class CORE_EXPORT ComputedStyleBase { | 34 class CORE_EXPORT ComputedStyleBase { |
| 35 public: | 35 public: |
| 36 inline bool independentInheritedEqual(const ComputedStyleBase& o) const { | 36 inline bool IndependentInheritedEqual(const ComputedStyleBase& o) const { |
| 37 return ( | 37 return ( |
| 38 {% for field in fields if field.is_inherited and field.is_independent %} | 38 {% for field in fields if field.is_inherited and field.is_independent %} |
| 39 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} | 39 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} |
| 40 {% endfor %} | 40 {% endfor %} |
| 41 ); | 41 ); |
| 42 } | 42 } |
| 43 | 43 |
| 44 inline bool nonIndependentInheritedEqual(const ComputedStyleBase& o) const { | 44 inline bool NonIndependentInheritedEqual(const ComputedStyleBase& o) const { |
| 45 return ( | 45 return ( |
| 46 {% for field in fields if field.is_inherited and not field.is_independent %} | 46 {% for field in fields if field.is_inherited and not field.is_independent %} |
| 47 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} | 47 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} |
| 48 {% endfor %} | 48 {% endfor %} |
| 49 ); | 49 ); |
| 50 } | 50 } |
| 51 | 51 |
| 52 inline bool inheritedEqual(const ComputedStyleBase& o) const { | 52 inline bool InheritedEqual(const ComputedStyleBase& o) const { |
| 53 return independentInheritedEqual(o) && nonIndependentInheritedEqual(o); | 53 return IndependentInheritedEqual(o) && NonIndependentInheritedEqual(o); |
| 54 } | 54 } |
| 55 | 55 |
| 56 inline bool nonInheritedEqual(const ComputedStyleBase& o) const { | 56 inline bool NonInheritedEqual(const ComputedStyleBase& o) const { |
| 57 return ( | 57 return ( |
| 58 {% for field in fields if field.is_property and not field.is_inherited %} | 58 {% for field in fields if field.is_property and not field.is_inherited %} |
| 59 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} | 59 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} |
| 60 {% endfor %} | 60 {% endfor %} |
| 61 ); | 61 ); |
| 62 } | 62 } |
| 63 | 63 |
| 64 enum IsAtShadowBoundary { | 64 enum IsAtShadowBoundary { |
| 65 AtShadowBoundary, | 65 kAtShadowBoundary, |
| 66 NotAtShadowBoundary, | 66 kNotAtShadowBoundary, |
| 67 }; | 67 }; |
| 68 void inheritFrom(const ComputedStyleBase& inheritParent, | 68 void InheritFrom(const ComputedStyleBase& inheritParent, |
| 69 IsAtShadowBoundary isAtShadowBoundary = NotAtShadowBoundary); | 69 IsAtShadowBoundary isAtShadowBoundary = kNotAtShadowBoundary)
; |
| 70 | 70 |
| 71 void copyNonInheritedFromCached(const ComputedStyleBase& other); | 71 void CopyNonInheritedFromCached(const ComputedStyleBase& other); |
| 72 | 72 |
| 73 // Copies the values of any independent inherited properties from the parent | 73 // Copies the values of any independent inherited properties from the parent |
| 74 // style that are marked as inherited by this style. | 74 // style that are marked as inherited by this style. |
| 75 void propagateIndependentInheritedProperties( | 75 void PropagateIndependentInheritedProperties( |
| 76 const ComputedStyleBase& parentStyle); | 76 const ComputedStyleBase& parentStyle); |
| 77 | 77 |
| 78 // Fields. | 78 // Fields. |
| 79 // TODO(sashab): Remove initialFoo() static methods and update callers to | 79 // TODO(sashab): Remove initialFoo() static methods and update callers to |
| 80 // use resetFoo(), which can be more efficient. | 80 // use resetFoo(), which can be more efficient. |
| 81 | 81 |
| 82 {% for field in fields %} | 82 {% for field in fields %} |
| 83 // {{field.property_name}} | 83 // {{field.property_name}} |
| 84 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} | 84 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} |
| 85 | 85 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 101 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} | 101 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} |
| 102 {% else %} | 102 {% else %} |
| 103 {{field.type_name}} {{field.name}}; | 103 {{field.type_name}} {{field.name}}; |
| 104 {% endif %} | 104 {% endif %} |
| 105 {% endfor %} | 105 {% endfor %} |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| 109 | 109 |
| 110 #endif // ComputedStyleBase_h | 110 #endif // ComputedStyleBase_h |
| OLD | NEW |