Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: Source/build/scripts/templates/StyleBuilder.cpp.tmpl

Issue 186403002: Make font-related CSS properties less custom. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/build/scripts/templates/StyleBuilder.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilder.cpp.tmpl b/Source/build/scripts/templates/StyleBuilder.cpp.tmpl
index 94b468d233c1b729746b2cfbb55697a7bc861a8d..883367488faadd76e5da865a3ab29684c79f6290 100644
--- a/Source/build/scripts/templates/StyleBuilder.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilder.cpp.tmpl
@@ -30,6 +30,8 @@ void StyleBuilderFunctions::applyInitial{{property_id}}(StyleResolverState& stat
{
{%- if property.svg %}
{{ set_value(property) }}(SVGRenderStyle::{{property.initial}}());
+{%- elif property.font %}
+ state.fontBuilder().{{property.setter}}(FontBuilder::{{property.initial}}());
{%- else %}
{{ set_value(property) }}(RenderStyle::{{property.initial}}());
{%- endif %}
@@ -41,6 +43,8 @@ void StyleBuilderFunctions::applyInherit{{property_id}}(StyleResolverState& stat
{
{%- if property.svg %}
{{ set_value(property) }}(state.parentStyle()->svgStyle()->{{property.getter}}());
+{%- elif property.font %}
+ state.fontBuilder().{{property.setter}}(state.parentFontDescription().{{property.getter}}());
{%- else %}
{{ set_value(property) }}(state.parentStyle()->{{property.getter}}());
{%- endif %}
@@ -52,6 +56,10 @@ void StyleBuilderFunctions::applyValue{{property_id}}(StyleResolverState& state,
{
{%- if property.converter %}
{{ set_value(property) }}(StyleBuilderConverter::{{property.converter}}(state, value));
+{%- elif property.font %}
+ if (!value->isPrimitiveValue())
Timothy Loh 2014/03/04 05:58:22 Can we see if removing this branch doesn't break a
dglazkov 2014/03/05 04:05:19 Will do next!
+ return;
+ state.fontBuilder().{{property.setter}}(static_cast<{{property.type_name}}>(*toCSSPrimitiveValue(value)));
{%- else %}
{{ set_value(property) }}(static_cast<{{property.type_name}}>(*toCSSPrimitiveValue(value)));
{%- endif %}

Powered by Google App Engine
This is Rietveld 408576698