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

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

Issue 236763002: Move default StyleBuilderFunctions handlers from StyleBuilder.cpp to StyleBuilderFunctions.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 dbc1133e91331a426101739b43972522699f44f7..b8cc192a98d9fcf2ae647413ced89112a8a6ca46 100644
--- a/Source/build/scripts/templates/StyleBuilder.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilder.cpp.tmpl
@@ -5,69 +5,12 @@
#include "core/css/resolver/StyleBuilder.h"
#include "StyleBuilderFunctions.h"
-#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/resolver/StyleResolverState.h"
// FIXME: currently we're just generating a switch statement, but we should
// test other variations for performance once we have more properties here.
-{% macro set_value(property) %}
-{% if property.svg %}
-state.style()->accessSVGStyle()->{{property.setter}}
-{%- elif property.font %}
-state.fontBuilder().{{property.setter}}
-{%- else %}
-state.style()->{{property.setter}}
-{%- endif %}
-{% endmacro %}
namespace WebCore {
-{# FIXME: add blank line #}
-{% for property_id, property in properties.items() if not property.use_handlers_for %}
-{% call wrap_with_condition(property.condition) %}
-{% set apply_type = property.apply_type %}
-{% if not property.custom_initial %}
-void StyleBuilderFunctions::applyInitial{{property_id}}(StyleResolverState& state)
-{
- {% if property.svg %}
- {{set_value(property)}}(SVGRenderStyle::{{property.initial}}());
- {% elif property.font %}
- {{set_value(property)}}(FontBuilder::{{property.initial}}());
- {% else %}
- {{set_value(property)}}(RenderStyle::{{property.initial}}());
- {% endif %}
-}
-
-{% endif %}
-{% if not property.custom_inherit %}
-void StyleBuilderFunctions::applyInherit{{property_id}}(StyleResolverState& state)
-{
- {% if property.svg %}
- {{set_value(property)}}(state.parentStyle()->svgStyle()->{{property.getter}}());
- {% elif property.font %}
- {{set_value(property)}}(state.parentFontDescription().{{property.getter}}());
- {% else %}
- {{set_value(property)}}(state.parentStyle()->{{property.getter}}());
- {% endif %}
-}
-
-{% endif %}
-{% if not property.custom_value %}
-void StyleBuilderFunctions::applyValue{{property_id}}(StyleResolverState& state, CSSValue* value)
-{
- {% if property.converter %}
- {{ set_value(property) }}(StyleBuilderConverter::{{property.converter}}(state, value));
- {% elif property.font %}
- if (!value->isPrimitiveValue())
- return;
- {{set_value(property)}}(static_cast<{{property.type_name}}>(*toCSSPrimitiveValue(value)));
- {% else %}
- {{set_value(property)}}(static_cast<{{property.type_name}}>(*toCSSPrimitiveValue(value)));
- {% endif %}
-}
-
-{% endif %}
-{% endcall %}
-{% endfor %}
bool StyleBuilder::applyProperty(CSSPropertyID property, StyleResolverState& state, CSSValue* value, bool isInitial, bool isInherit) {
switch(property) {
« no previous file with comments | « Source/build/scripts/make_style_builder.py ('k') | Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698