Index: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
index 5956fd1fa20ef2684a1708b9271655caa2c6081e..2757340d87409c4ea039604422c543432e46ed6c 100644 |
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
@@ -138,6 +138,12 @@ class CORE_EXPORT ComputedStyleBase { |
DataRef<{{subgroup.type_name}}> {{subgroup.member_name}}; |
{% endfor %} |
+ static unsigned WidthToFixedPoint(float width) { |
+ DCHECK_GE(width, 0); |
+ return static_cast<unsigned>(std::min<float>(width, kMaxForBorderWidth) * |
+ kBorderWidthDenominator); |
+ } |
+ |
private: |
{% for field in computed_style.fields %} |
{{declare_storage(field)}} |