OLD | NEW |
1 {% from 'macros.tmpl' import license, print_if %} | 1 {% from 'macros.tmpl' import license, print_if %} |
2 {% from 'fields/field.tmpl' import encode, getter_expression, declare_storage, f
ieldwise_compare %} | 2 {% from 'fields/field.tmpl' import encode, getter_expression, declare_storage, f
ieldwise_compare %} |
3 {% from 'fields/group.tmpl' import define_field_group_class %} | 3 {% from 'fields/group.tmpl' import define_field_group_class %} |
4 {{license()}} | 4 {{license()}} |
5 | 5 |
6 #ifndef ComputedStyleBase_h | 6 #ifndef ComputedStyleBase_h |
7 #define ComputedStyleBase_h | 7 #define ComputedStyleBase_h |
8 | 8 |
9 #include "core/style/ComputedStyleConstants.h" | 9 #include "core/style/ComputedStyleConstants.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 {% endif %} | 131 {% endif %} |
132 {% endfor %} | 132 {% endfor %} |
133 | 133 |
134 ~ComputedStyleBase() = default; | 134 ~ComputedStyleBase() = default; |
135 | 135 |
136 // Storage. | 136 // Storage. |
137 {% for subgroup in computed_style.subgroups %} | 137 {% for subgroup in computed_style.subgroups %} |
138 DataRef<{{subgroup.type_name}}> {{subgroup.member_name}}; | 138 DataRef<{{subgroup.type_name}}> {{subgroup.member_name}}; |
139 {% endfor %} | 139 {% endfor %} |
140 | 140 |
| 141 static unsigned WidthToFixedPoint(float width) { |
| 142 DCHECK_GE(width, 0); |
| 143 return static_cast<unsigned>(std::min<float>(width, kMaxForBorderWidth) * |
| 144 kBorderWidthDenominator); |
| 145 } |
| 146 |
141 private: | 147 private: |
142 {% for field in computed_style.fields %} | 148 {% for field in computed_style.fields %} |
143 {{declare_storage(field)}} | 149 {{declare_storage(field)}} |
144 {% endfor %} | 150 {% endfor %} |
145 }; | 151 }; |
146 | 152 |
147 } // namespace blink | 153 } // namespace blink |
148 | 154 |
149 #endif // ComputedStyleBase_h | 155 #endif // ComputedStyleBase_h |
OLD | NEW |