| Index: third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| index 1f7243f64ce0c823f2304b756aeb958b1be49b12..4e81b0f414f9ee8cd98ac65179f0edf001dc307c 100644
|
| --- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| @@ -29,11 +29,11 @@ void StyleBuilderFunctions::applyValue{{property_id}}(StyleResolverState& state,
|
| {%- endmacro %}
|
| {% macro set_value(property) %}
|
| {% if property.svg %}
|
| -state.style()->accessSVGStyle().{{property.setter}}
|
| +state.Style()->AccessSVGStyle().{{property.setter}}
|
| {%- elif property.font %}
|
| -state.fontBuilder().{{property.setter}}
|
| +state.GetFontBuilder().{{property.setter}}
|
| {%- else %}
|
| -state.style()->{{property.setter}}
|
| +state.Style()->{{property.setter}}
|
| {%- endif %}
|
| {% endmacro %}
|
| {% macro convert_and_set_value(property) %}
|
| @@ -41,13 +41,13 @@ state.style()->{{property.setter}}
|
| {{set_value(property)}}(StyleBuilderConverter::{{property.converter}}(state, value));
|
| {# TODO(sashab): Remove this list from this file. #}
|
| {% elif property.type_name in ['short', 'unsigned short', 'int', 'unsigned int', 'unsigned', 'float', 'LineClampValue'] %}
|
| -{{set_value(property)}}(toCSSPrimitiveValue(value).convertTo<{{property.type_name}}>());
|
| +{{set_value(property)}}(ToCSSPrimitiveValue(value).ConvertTo<{{property.type_name}}>());
|
| {%- else %}
|
| -{{set_value(property)}}(toCSSIdentifierValue(value).convertTo<{{property.type_name}}>());
|
| +{{set_value(property)}}(ToCSSIdentifierValue(value).ConvertTo<{{property.type_name}}>());
|
| {%- endif %}
|
| {% endmacro %}
|
| {% macro set_is_inherited(property) %}
|
| -state.style()->{{property.is_inherited_setter}}
|
| +state.Style()->{{property.is_inherited_setter}}
|
| {% endmacro %}
|
|
|
| namespace blink {
|
| @@ -72,11 +72,11 @@ namespace blink {
|
| {% if not property.custom_inherit %}
|
| {{declare_inherit_function(property_id)}} {
|
| {% if property.svg %}
|
| - {{set_value(property)}}(state.parentStyle()->svgStyle().{{property.getter}}());
|
| + {{set_value(property)}}(state.ParentStyle()->SvgStyle().{{property.getter}}());
|
| {% elif property.font %}
|
| - {{set_value(property)}}(state.parentFontDescription().{{property.getter}}());
|
| + {{set_value(property)}}(state.ParentFontDescription().{{property.getter}}());
|
| {% else %}
|
| - {{set_value(property)}}(state.parentStyle()->{{property.getter}}());
|
| + {{set_value(property)}}(state.ParentStyle()->{{property.getter}}());
|
| {% endif %}
|
| {% if property.independent %}
|
| {{set_is_inherited(property)}}(true);
|
| @@ -96,26 +96,26 @@ namespace blink {
|
| {% endfor %}
|
|
|
| {% macro apply_animation(property_id, attribute, animation) %}
|
| -{% set vector = attribute|lower_first + "List()" %}
|
| +{% set vector = attribute + "List()" %}
|
| {{declare_initial_function(property_id)}} {
|
| - CSS{{animation}}Data& data = state.style()->access{{animation}}s();
|
| - data.{{vector}}.clear();
|
| - data.{{vector}}.push_back(CSS{{animation}}Data::initial{{attribute}}());
|
| + CSS{{animation}}Data& data = state.Style()->Access{{animation}}s();
|
| + data.{{vector}}.Clear();
|
| + data.{{vector}}.push_back(CSS{{animation}}Data::Initial{{attribute}}());
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - const CSS{{animation}}Data* parentData = state.parentStyle()->{{animation|lower}}s();
|
| + const CSS{{animation}}Data* parentData = state.ParentStyle()->{{animation}}s();
|
| if (!parentData)
|
| applyInitial{{property_id}}(state);
|
| else
|
| - state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}};
|
| + state.Style()->Access{{animation}}s().{{vector}} = parentData->{{vector}};
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| - CSS{{animation}}Data& data = state.style()->access{{animation}}s();
|
| - data.{{vector}}.clear();
|
| - for (auto& listValue : toCSSValueList(value))
|
| - data.{{vector}}.push_back(CSSToStyleMap::mapAnimation{{attribute}}(*listValue));
|
| + CSS{{animation}}Data& data = state.Style()->Access{{animation}}s();
|
| + data.{{vector}}.Clear();
|
| + for (auto& listValue : ToCSSValueList(value))
|
| + data.{{vector}}.push_back(CSSToStyleMap::MapAnimation{{attribute}}(*listValue));
|
| }
|
| {% endmacro %}
|
| {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}}
|
| @@ -133,130 +133,130 @@ namespace blink {
|
|
|
| {% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identity='CSSValueAuto') %}
|
| {% set property = properties[property_id] %}
|
| -{% set auto_getter = auto_getter or 'hasAuto' + property.name_for_methods %}
|
| -{% set auto_setter = auto_setter or 'setHasAuto' + property.name_for_methods %}
|
| +{% set auto_getter = auto_getter or 'HasAuto' + property.name_for_methods %}
|
| +{% set auto_setter = auto_setter or 'SetHasAuto' + property.name_for_methods %}
|
| {{declare_initial_function(property_id)}} {
|
| - state.style()->{{auto_setter}}();
|
| + state.Style()->{{auto_setter}}();
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - if (state.parentStyle()->{{auto_getter}}())
|
| - state.style()->{{auto_setter}}();
|
| + if (state.ParentStyle()->{{auto_getter}}())
|
| + state.Style()->{{auto_setter}}();
|
| else
|
| - {{set_value(property)}}(state.parentStyle()->{{property.getter}}());
|
| + {{set_value(property)}}(state.ParentStyle()->{{property.getter}}());
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| - if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID() == {{auto_identity}})
|
| - state.style()->{{auto_setter}}();
|
| + if (value.IsIdentifierValue() && ToCSSIdentifierValue(value).GetValueID() == {{auto_identity}})
|
| + state.Style()->{{auto_setter}}();
|
| else
|
| {{convert_and_set_value(property)}}
|
| }
|
| {% endmacro %}
|
| {{apply_auto('CSSPropertyClip')}}
|
| {{apply_auto('CSSPropertyColumnCount')}}
|
| -{{apply_auto('CSSPropertyColumnGap', auto_getter='hasNormalColumnGap', auto_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal')}}
|
| +{{apply_auto('CSSPropertyColumnGap', auto_getter='HasNormalColumnGap', auto_setter='SetHasNormalColumnGap', auto_identity='CSSValueNormal')}}
|
| {{apply_auto('CSSPropertyColumnWidth')}}
|
| {{apply_auto('CSSPropertyZIndex')}}
|
|
|
| static bool lengthMatchesAllSides(const LengthBox& lengthBox,
|
| const Length& length) {
|
| - return (lengthBox.left() == length &&
|
| - lengthBox.right() == length &&
|
| - lengthBox.top() == length &&
|
| - lengthBox.bottom() == length);
|
| + return (lengthBox.Left() == length &&
|
| + lengthBox.Right() == length &&
|
| + lengthBox.Top() == length &&
|
| + lengthBox.Bottom() == length);
|
| }
|
|
|
| static bool borderImageLengthMatchesAllSides(
|
| const BorderImageLengthBox& borderImageLengthBox,
|
| const BorderImageLength& borderImageLength) {
|
| - return (borderImageLengthBox.left() == borderImageLength &&
|
| - borderImageLengthBox.right() == borderImageLength &&
|
| - borderImageLengthBox.top() == borderImageLength &&
|
| - borderImageLengthBox.bottom() == borderImageLength);
|
| + return (borderImageLengthBox.Left() == borderImageLength &&
|
| + borderImageLengthBox.Right() == borderImageLength &&
|
| + borderImageLengthBox.Top() == borderImageLength &&
|
| + borderImageLengthBox.Bottom() == borderImageLength);
|
| }
|
|
|
| {% macro apply_border_image_modifier(property_id, modifier_type) %}
|
| {% set is_mask_box = 'MaskBox' in property_id %}
|
| -{% set getter = 'maskBoxImage' if is_mask_box else 'borderImage' %}
|
| -{% set setter = 'setMaskBoxImage' if is_mask_box else 'setBorderImage' %}
|
| +{% set getter = 'MaskBoxImage' if is_mask_box else 'BorderImage' %}
|
| +{% set setter = 'SetMaskBoxImage' if is_mask_box else 'SetBorderImage' %}
|
| {{ declare_initial_function(property_id) }} {
|
| - const NinePieceImage& currentImage = state.style()->{{getter}}();
|
| + const NinePieceImage& currentImage = state.Style()->{{getter}}();
|
| {# Check for equality in case we can bail out before creating a new NinePieceImage. #}
|
| {% if modifier_type == 'Outset' %}
|
| - if (borderImageLengthMatchesAllSides(currentImage.outset(),
|
| - BorderImageLength(Length(0, Fixed))))
|
| + if (borderImageLengthMatchesAllSides(currentImage.Outset(),
|
| + BorderImageLength(Length(0, kFixed))))
|
| return;
|
| {% elif modifier_type == 'Repeat' %}
|
| - if (currentImage.horizontalRule() == StretchImageRule &&
|
| - currentImage.verticalRule() == StretchImageRule)
|
| + if (currentImage.HorizontalRule() == kStretchImageRule &&
|
| + currentImage.VerticalRule() == kStretchImageRule)
|
| return;
|
| {% elif modifier_type == 'Slice' and is_mask_box %}
|
| // Masks have a different initial value for slices. Preserve the value of 0
|
| // for backwards compatibility.
|
| - if (currentImage.fill() == true &&
|
| - lengthMatchesAllSides(currentImage.imageSlices(), Length(0, Fixed)))
|
| + if (currentImage.Fill() == true &&
|
| + lengthMatchesAllSides(currentImage.ImageSlices(), Length(0, kFixed)))
|
| return;
|
| {% elif modifier_type == 'Slice' and not is_mask_box %}
|
| - if (currentImage.fill() == false &&
|
| - lengthMatchesAllSides(currentImage.imageSlices(), Length(100, Percent)))
|
| + if (currentImage.Fill() == false &&
|
| + lengthMatchesAllSides(currentImage.ImageSlices(), Length(100, kPercent)))
|
| return;
|
| {% elif modifier_type == 'Width' and is_mask_box %}
|
| // Masks have a different initial value for widths. Preserve the value of
|
| // 'auto' for backwards compatibility.
|
| - if (borderImageLengthMatchesAllSides(currentImage.borderSlices(),
|
| - BorderImageLength(Length(Auto))))
|
| + if (borderImageLengthMatchesAllSides(currentImage.BorderSlices(),
|
| + BorderImageLength(Length(kAuto))))
|
| return;
|
| {% elif modifier_type == 'Width' and not is_mask_box %}
|
| - if (borderImageLengthMatchesAllSides(currentImage.borderSlices(),
|
| + if (borderImageLengthMatchesAllSides(currentImage.BorderSlices(),
|
| BorderImageLength(1.0)))
|
| return;
|
| {% endif %}
|
|
|
| NinePieceImage image(currentImage);
|
| {% if modifier_type == 'Outset' %}
|
| - image.setOutset(Length(0, Fixed));
|
| + image.SetOutset(Length(0, kFixed));
|
| {% elif modifier_type == 'Repeat' %}
|
| - image.setHorizontalRule(StretchImageRule);
|
| - image.setVerticalRule(StretchImageRule);
|
| + image.SetHorizontalRule(kStretchImageRule);
|
| + image.SetVerticalRule(kStretchImageRule);
|
| {% elif modifier_type == 'Slice' and is_mask_box %}
|
| - image.setImageSlices(LengthBox({{ (['Length(0, Fixed)']*4) | join(', ') }}));
|
| - image.setFill(true);
|
| + image.SetImageSlices(LengthBox({{ (['Length(0, kFixed)']*4) | join(', ') }}));
|
| + image.SetFill(true);
|
| {% elif modifier_type == 'Slice' and not is_mask_box %}
|
| - image.setImageSlices(LengthBox({{ (['Length(100, Percent)']*4) | join(', ') }}));
|
| - image.setFill(false);
|
| + image.SetImageSlices(LengthBox({{ (['Length(100, kPercent)']*4) | join(', ') }}));
|
| + image.SetFill(false);
|
| {% elif modifier_type == 'Width' %}
|
| - image.setBorderSlices({{ 'Length(Auto)' if is_mask_box else '1.0' }});
|
| + image.SetBorderSlices({{ 'Length(kAuto)' if is_mask_box else '1.0' }});
|
| {% endif %}
|
| - state.style()->{{setter}}(image);
|
| + state.Style()->{{setter}}(image);
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - NinePieceImage image(state.style()->{{getter}}());
|
| + NinePieceImage image(state.Style()->{{getter}}());
|
| {% if modifier_type == 'Outset' %}
|
| - image.copyOutsetFrom(state.parentStyle()->{{getter}}());
|
| + image.CopyOutsetFrom(state.ParentStyle()->{{getter}}());
|
| {% elif modifier_type == 'Repeat' %}
|
| - image.copyRepeatFrom(state.parentStyle()->{{getter}}());
|
| + image.CopyRepeatFrom(state.ParentStyle()->{{getter}}());
|
| {% elif modifier_type == 'Slice' %}
|
| - image.copyImageSlicesFrom(state.parentStyle()->{{getter}}());
|
| + image.CopyImageSlicesFrom(state.ParentStyle()->{{getter}}());
|
| {% elif modifier_type == 'Width' %}
|
| - image.copyBorderSlicesFrom(state.parentStyle()->{{getter}}());
|
| + image.CopyBorderSlicesFrom(state.ParentStyle()->{{getter}}());
|
| {% endif %}
|
| - state.style()->{{setter}}(image);
|
| + state.Style()->{{setter}}(image);
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| - NinePieceImage image(state.style()->{{getter}}());
|
| + NinePieceImage image(state.Style()->{{getter}}());
|
| {% if modifier_type == 'Outset' %}
|
| - image.setOutset(CSSToStyleMap::mapNinePieceImageQuad(state, value));
|
| + image.SetOutset(CSSToStyleMap::MapNinePieceImageQuad(state, value));
|
| {% elif modifier_type == 'Repeat' %}
|
| - CSSToStyleMap::mapNinePieceImageRepeat(state, value, image);
|
| + CSSToStyleMap::MapNinePieceImageRepeat(state, value, image);
|
| {% elif modifier_type == 'Slice' %}
|
| - CSSToStyleMap::mapNinePieceImageSlice(state, value, image);
|
| + CSSToStyleMap::MapNinePieceImageSlice(state, value, image);
|
| {% elif modifier_type == 'Width' %}
|
| - image.setBorderSlices(CSSToStyleMap::mapNinePieceImageQuad(state, value));
|
| + image.SetBorderSlices(CSSToStyleMap::MapNinePieceImageQuad(state, value));
|
| {% endif %}
|
| - state.style()->{{setter}}(image);
|
| + state.Style()->{{setter}}(image);
|
| }
|
| {% endmacro %}
|
| {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}}
|
| @@ -271,44 +271,44 @@ static bool borderImageLengthMatchesAllSides(
|
| {% macro apply_value_border_image_source(property_id) %}
|
| {{declare_value_function(property_id)}} {
|
| {% set property = properties[property_id] %}
|
| - {{set_value(property)}}(state.styleImage({{property_id}}, value));
|
| + {{set_value(property)}}(state.GetStyleImage({{property_id}}, value));
|
| }
|
| {% endmacro %}
|
| {{apply_value_border_image_source('CSSPropertyBorderImageSource')}}
|
| {{apply_value_border_image_source('CSSPropertyWebkitMaskBoxImageSource')}}
|
|
|
| -{% macro apply_color(property_id, initial_color='StyleColor::currentColor') %}
|
| +{% macro apply_color(property_id, initial_color='StyleColor::CurrentColor') %}
|
| {% set property = properties[property_id] %}
|
| -{% set visited_link_setter = 'setVisitedLink' + property.name_for_methods %}
|
| +{% set visited_link_setter = 'SetVisitedLink' + property.name_for_methods %}
|
| {{declare_initial_function(property_id)}} {
|
| StyleColor color = {{initial_color}}();
|
| - if (state.applyPropertyToRegularStyle())
|
| + if (state.ApplyPropertyToRegularStyle())
|
| {{set_value(property)}}(color);
|
| - if (state.applyPropertyToVisitedLinkStyle())
|
| - state.style()->{{visited_link_setter}}(color);
|
| + if (state.ApplyPropertyToVisitedLinkStyle())
|
| + state.Style()->{{visited_link_setter}}(color);
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| // Visited link style can never explicitly inherit from parent visited link
|
| // style so no separate getters are needed.
|
| - StyleColor color = state.parentStyle()->{{property.getter}}();
|
| - if (state.applyPropertyToRegularStyle())
|
| + StyleColor color = state.ParentStyle()->{{property.getter}}();
|
| + if (state.ApplyPropertyToRegularStyle())
|
| {{set_value(property)}}(color);
|
| - if (state.applyPropertyToVisitedLinkStyle())
|
| - state.style()->{{visited_link_setter}}(color);
|
| + if (state.ApplyPropertyToVisitedLinkStyle())
|
| + state.Style()->{{visited_link_setter}}(color);
|
| }
|
|
|
| {{declare_value_function(property_id)}}
|
| {
|
| - if (state.applyPropertyToRegularStyle())
|
| - {{set_value(property)}}(StyleBuilderConverter::convertStyleColor(state, value));
|
| - if (state.applyPropertyToVisitedLinkStyle()) {
|
| - state.style()->{{visited_link_setter}}(
|
| - StyleBuilderConverter::convertStyleColor(state, value, true));
|
| + if (state.ApplyPropertyToRegularStyle())
|
| + {{set_value(property)}}(StyleBuilderConverter::ConvertStyleColor(state, value));
|
| + if (state.ApplyPropertyToVisitedLinkStyle()) {
|
| + state.Style()->{{visited_link_setter}}(
|
| + StyleBuilderConverter::ConvertStyleColor(state, value, true));
|
| }
|
| }
|
| {% endmacro %}
|
| -{{apply_color('CSSPropertyBackgroundColor', initial_color='ComputedStyle::initialBackgroundColor') }}
|
| +{{apply_color('CSSPropertyBackgroundColor', initial_color='ComputedStyle::InitialBackgroundColor') }}
|
| {{apply_color('CSSPropertyBorderBottomColor')}}
|
| {{apply_color('CSSPropertyBorderLeftColor')}}
|
| {{apply_color('CSSPropertyBorderRightColor')}}
|
| @@ -323,144 +323,145 @@ static bool borderImageLengthMatchesAllSides(
|
| {% macro apply_counter(property_id, action) %}
|
| {% set property = properties[property_id] %}
|
| {{declare_initial_function(property_id)}} {
|
| - state.style()->clear{{action}}Directives();
|
| + state.Style()->Clear{{action}}Directives();
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - const CounterDirectiveMap* parentMap = state.parentStyle()->counterDirectives();
|
| + const CounterDirectiveMap* parentMap = state.ParentStyle()->GetCounterDirectives();
|
| if (!parentMap)
|
| return;
|
|
|
| - CounterDirectiveMap& map = state.style()->accessCounterDirectives();
|
| - DCHECK(!parentMap->isEmpty());
|
| + CounterDirectiveMap& map = state.Style()->AccessCounterDirectives();
|
| + DCHECK(!parentMap->IsEmpty());
|
|
|
| typedef CounterDirectiveMap::const_iterator Iterator;
|
| Iterator end = parentMap->end();
|
| for (Iterator it = parentMap->begin(); it != end; ++it) {
|
| - CounterDirectives& directives = map.insert(it->key, CounterDirectives()).storedValue->value;
|
| - directives.inherit{{action}}(it->value);
|
| + CounterDirectives& directives = map.insert(it->key, CounterDirectives()).stored_value->value;
|
| + directives.Inherit{{action}}(it->value);
|
| }
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| - state.style()->clear{{action}}Directives();
|
| + state.Style()->Clear{{action}}Directives();
|
|
|
| - if (!value.isValueList()) {
|
| - DCHECK(value.isIdentifierValue());
|
| - DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone);
|
| + if (!value.IsValueList()) {
|
| + DCHECK(value.IsIdentifierValue());
|
| + DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueNone);
|
| return;
|
| }
|
|
|
| - CounterDirectiveMap& map = state.style()->accessCounterDirectives();
|
| + CounterDirectiveMap& map = state.Style()->AccessCounterDirectives();
|
|
|
| - const CSSValueList& list = toCSSValueList(value);
|
| + const CSSValueList& list = ToCSSValueList(value);
|
|
|
| for (size_t i = 0; i < list.length(); ++i) {
|
| - const CSSValuePair& pair = toCSSValuePair(list.item(i));
|
| - AtomicString identifier(toCSSCustomIdentValue(pair.first()).value());
|
| - int value = toCSSPrimitiveValue(pair.second()).getIntValue();
|
| + const CSSValuePair& pair = ToCSSValuePair(list.Item(i));
|
| + AtomicString identifier(ToCSSCustomIdentValue(pair.First()).Value());
|
| + int value = ToCSSPrimitiveValue(pair.Second()).GetIntValue();
|
| CounterDirectives& directives =
|
| - map.insert(identifier, CounterDirectives()).storedValue->value;
|
| + map.insert(identifier, CounterDirectives()).stored_value->value;
|
| {% if action == 'Reset' %}
|
| - directives.setResetValue(value);
|
| + directives.SetResetValue(value);
|
| {% else %}
|
| - directives.addIncrementValue(value);
|
| + directives.AddIncrementValue(value);
|
| {% endif %}
|
| }
|
| - DCHECK(!map.isEmpty());
|
| + DCHECK(!map.IsEmpty());
|
| }
|
| {% endmacro %}
|
| {{apply_counter('CSSPropertyCounterIncrement', 'Increment')}}
|
| {{apply_counter('CSSPropertyCounterReset', 'Reset')}}
|
|
|
| -{% macro apply_fill_layer(property_id, fill_type) %}
|
| +{% macro apply_fill_layer(property_id, fill_type, fill_type_getter = None) %}
|
| {% set layer_type = 'Background' if 'Background' in property_id else 'Mask' %}
|
| -{% set fill_layer_type = layer_type + 'FillLayer' %}
|
| -{% set access_layers = 'access' + layer_type + 'Layers' %}
|
| -{% set map_fill = 'mapFill' + fill_type %}
|
| +{% set fill_layer_type = 'k' + layer_type + 'FillLayer' %}
|
| +{% set access_layers = 'Access' + layer_type + 'Layers' %}
|
| +{% set map_fill = 'MapFill' + fill_type %}
|
| +{% set fill_type_getter = fill_type_getter or fill_type %}
|
| {{declare_initial_function(property_id)}} {
|
| - FillLayer* currChild = &state.style()->{{access_layers}}();
|
| - currChild->set{{fill_type}}(FillLayer::initialFill{{fill_type}}({{fill_layer_type}}));
|
| - for (currChild = currChild->next(); currChild; currChild = currChild->next())
|
| - currChild->clear{{fill_type}}();
|
| +FillLayer* currChild = &state.Style()->{{access_layers}}();
|
| +currChild->Set{{fill_type}}(FillLayer::InitialFill{{fill_type}}({{fill_layer_type}}));
|
| +for (currChild = currChild->Next(); currChild; currChild = currChild->Next())
|
| + currChild->Clear{{fill_type}}();
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - FillLayer* currChild = &state.style()->{{access_layers}}();
|
| - FillLayer* prevChild = 0;
|
| - const FillLayer* currParent = &state.parentStyle()->{{layer_type|lower}}Layers();
|
| - while (currParent && currParent->is{{fill_type}}Set()) {
|
| +FillLayer* currChild = &state.Style()->{{access_layers}}();
|
| +FillLayer* prevChild = 0;
|
| +const FillLayer* currParent = &state.ParentStyle()->{{layer_type}}Layers();
|
| +while (currParent && currParent->Is{{fill_type}}Set()) {
|
| if (!currChild)
|
| - currChild = prevChild->ensureNext();
|
| - currChild->set{{fill_type}}(currParent->{{fill_type|lower_first}}());
|
| + currChild = prevChild->EnsureNext();
|
| + currChild->Set{{fill_type}}(currParent->{{fill_type_getter}}());
|
| prevChild = currChild;
|
| - currChild = prevChild->next();
|
| - currParent = currParent->next();
|
| + currChild = prevChild->Next();
|
| + currParent = currParent->Next();
|
| }
|
|
|
| while (currChild) {
|
| // Reset any remaining layers to not have the property set.
|
| - currChild->clear{{fill_type}}();
|
| - currChild = currChild->next();
|
| + currChild->Clear{{fill_type}}();
|
| + currChild = currChild->Next();
|
| }
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| - FillLayer* currChild = &state.style()->{{access_layers}}();
|
| + FillLayer* currChild = &state.Style()->{{access_layers}}();
|
| FillLayer* prevChild = 0;
|
| - if (value.isValueList() && !value.isImageSetValue()) {
|
| + if (value.IsValueList() && !value.IsImageSetValue()) {
|
| // Walk each value and put it into a layer, creating new layers as needed.
|
| - const CSSValueList& valueList = toCSSValueList(value);
|
| + const CSSValueList& valueList = ToCSSValueList(value);
|
| for (unsigned int i = 0; i < valueList.length(); i++) {
|
| if (!currChild)
|
| - currChild = prevChild->ensureNext();
|
| - CSSToStyleMap::{{map_fill}}(state, currChild, valueList.item(i));
|
| + currChild = prevChild->EnsureNext();
|
| + CSSToStyleMap::{{map_fill}}(state, currChild, valueList.Item(i));
|
| prevChild = currChild;
|
| - currChild = currChild->next();
|
| + currChild = currChild->Next();
|
| }
|
| } else {
|
| CSSToStyleMap::{{map_fill}}(state, currChild, value);
|
| - currChild = currChild->next();
|
| + currChild = currChild->Next();
|
| }
|
| while (currChild) {
|
| // Reset all remaining layers to not have the property set.
|
| - currChild->clear{{fill_type}}();
|
| - currChild = currChild->next();
|
| + currChild->Clear{{fill_type}}();
|
| + currChild = currChild->Next();
|
| }
|
| }
|
| {% endmacro %}
|
| {{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundBlendMode', 'BlendMode')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundClip', 'Clip')}}
|
| -{{apply_fill_layer('CSSPropertyBackgroundImage', 'Image')}}
|
| +{{apply_fill_layer('CSSPropertyBackgroundImage', 'Image', 'GetImage')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundOrigin', 'Origin')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundPositionX', 'XPosition')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundPositionY', 'YPosition')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundRepeatX', 'RepeatX')}}
|
| {{apply_fill_layer('CSSPropertyBackgroundRepeatY', 'RepeatY')}}
|
| -{{apply_fill_layer('CSSPropertyBackgroundSize', 'Size')}}
|
| +{{apply_fill_layer('CSSPropertyBackgroundSize', 'Size', 'size')}}
|
| {{apply_fill_layer('CSSPropertyMaskSourceType', 'MaskSourceType')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskClip', 'Clip')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskComposite', 'Composite')}}
|
| -{{apply_fill_layer('CSSPropertyWebkitMaskImage', 'Image')}}
|
| +{{apply_fill_layer('CSSPropertyWebkitMaskImage', 'Image', 'GetImage')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskOrigin', 'Origin')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskPositionX', 'XPosition')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskPositionY', 'YPosition')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskRepeatX', 'RepeatX')}}
|
| {{apply_fill_layer('CSSPropertyWebkitMaskRepeatY', 'RepeatY')}}
|
| -{{apply_fill_layer('CSSPropertyWebkitMaskSize', 'Size')}}
|
| +{{apply_fill_layer('CSSPropertyWebkitMaskSize', 'Size', 'size')}}
|
|
|
| {% macro apply_grid_template(property_id, type) %}
|
| {{declare_initial_function(property_id)}} {
|
| - state.style()->setGridTemplate{{type}}s(ComputedStyle::initialGridTemplate{{type}}s());
|
| - state.style()->setNamedGrid{{type}}Lines(ComputedStyle::initialNamedGrid{{type}}Lines());
|
| - state.style()->setOrderedNamedGrid{{type}}Lines(ComputedStyle::initialOrderedNamedGrid{{type}}Lines());
|
| + state.Style()->SetGridTemplate{{type}}s(ComputedStyle::InitialGridTemplate{{type}}s());
|
| + state.Style()->SetNamedGrid{{type}}Lines(ComputedStyle::InitialNamedGrid{{type}}Lines());
|
| + state.Style()->SetOrderedNamedGrid{{type}}Lines(ComputedStyle::InitialOrderedNamedGrid{{type}}Lines());
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - state.style()->setGridTemplate{{type}}s(state.parentStyle()->gridTemplate{{type}}s());
|
| - state.style()->setNamedGrid{{type}}Lines(state.parentStyle()->namedGrid{{type}}Lines());
|
| - state.style()->setOrderedNamedGrid{{type}}Lines(state.parentStyle()->orderedNamedGrid{{type}}Lines());
|
| + state.Style()->SetGridTemplate{{type}}s(state.ParentStyle()->GridTemplate{{type}}s());
|
| + state.Style()->SetNamedGrid{{type}}Lines(state.ParentStyle()->NamedGrid{{type}}Lines());
|
| + state.Style()->SetOrderedNamedGrid{{type}}Lines(state.ParentStyle()->OrderedNamedGrid{{type}}Lines());
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| @@ -470,29 +471,29 @@ static bool borderImageLengthMatchesAllSides(
|
| OrderedNamedGridLines orderedNamedGridLines;
|
| NamedGridLinesMap autoRepeatNamedGridLines;
|
| OrderedNamedGridLines autoRepeatOrderedNamedGridLines;
|
| - AutoRepeatType autoRepeatType = ComputedStyle::initialGridAutoRepeatType();
|
| + AutoRepeatType autoRepeatType = ComputedStyle::InitialGridAutoRepeatType();
|
| size_t autoRepeatInsertionPoint =
|
| - ComputedStyle::initialGridAutoRepeatInsertionPoint();
|
| - StyleBuilderConverter::convertGridTrackList(
|
| + ComputedStyle::InitialGridAutoRepeatInsertionPoint();
|
| + StyleBuilderConverter::ConvertGridTrackList(
|
| value, trackSizes, namedGridLines, orderedNamedGridLines,
|
| autoRepeatTrackSizes, autoRepeatNamedGridLines,
|
| autoRepeatOrderedNamedGridLines, autoRepeatInsertionPoint,
|
| autoRepeatType, state);
|
| - const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea();
|
| - if (!namedGridAreas.isEmpty()) {
|
| - StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(
|
| - namedGridAreas, namedGridLines, For{{type}}s);
|
| + const NamedGridAreaMap& namedGridAreas = state.Style()->NamedGridArea();
|
| + if (!namedGridAreas.IsEmpty()) {
|
| + StyleBuilderConverter::CreateImplicitNamedGridLinesFromGridArea(
|
| + namedGridAreas, namedGridLines, kFor{{type}}s);
|
| }
|
| - state.style()->setGridTemplate{{type}}s(trackSizes);
|
| - state.style()->setNamedGrid{{type}}Lines(namedGridLines);
|
| - state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines);
|
| - state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes);
|
| - state.style()->setGridAutoRepeat{{type}}sInsertionPoint(
|
| + state.Style()->SetGridTemplate{{type}}s(trackSizes);
|
| + state.Style()->SetNamedGrid{{type}}Lines(namedGridLines);
|
| + state.Style()->SetOrderedNamedGrid{{type}}Lines(orderedNamedGridLines);
|
| + state.Style()->SetGridAutoRepeat{{type}}s(autoRepeatTrackSizes);
|
| + state.Style()->SetGridAutoRepeat{{type}}sInsertionPoint(
|
| autoRepeatInsertionPoint);
|
| - state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines);
|
| - state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(
|
| + state.Style()->SetAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines);
|
| + state.Style()->SetAutoRepeatOrderedNamedGrid{{type}}Lines(
|
| autoRepeatOrderedNamedGridLines);
|
| - state.style()->setGridAutoRepeat{{type}}sType(autoRepeatType);
|
| + state.Style()->SetGridAutoRepeat{{type}}sType(autoRepeatType);
|
| }
|
| {% endmacro %}
|
| {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}}
|
| @@ -502,54 +503,54 @@ static bool borderImageLengthMatchesAllSides(
|
| {% set property = properties[property_id] %}
|
| {{declare_initial_function(property_id)}} {
|
| {{set_value(property)}}(
|
| - SVGComputedStyle::initial{{paint_type}}Type(),
|
| - SVGComputedStyle::initial{{paint_type}}Color(),
|
| - SVGComputedStyle::initial{{paint_type}}Uri(),
|
| - state.applyPropertyToRegularStyle(),
|
| - state.applyPropertyToVisitedLinkStyle());
|
| + SVGComputedStyle::Initial{{paint_type}}Type(),
|
| + SVGComputedStyle::Initial{{paint_type}}Color(),
|
| + SVGComputedStyle::Initial{{paint_type}}Uri(),
|
| + state.ApplyPropertyToRegularStyle(),
|
| + state.ApplyPropertyToVisitedLinkStyle());
|
| }
|
|
|
| {{declare_inherit_function(property_id)}} {
|
| - const SVGComputedStyle& svgParentStyle = state.parentStyle()->svgStyle();
|
| + const SVGComputedStyle& svgParentStyle = state.ParentStyle()->SvgStyle();
|
| {{set_value(property)}}(
|
| - svgParentStyle.{{paint_type|lower_first}}Type(),
|
| - svgParentStyle.{{paint_type|lower_first}}Color(),
|
| - svgParentStyle.{{paint_type|lower_first}}Uri(),
|
| - state.applyPropertyToRegularStyle(),
|
| - state.applyPropertyToVisitedLinkStyle());
|
| + svgParentStyle.{{paint_type}}Type(),
|
| + svgParentStyle.{{paint_type}}Color(),
|
| + svgParentStyle.{{paint_type}}Uri(),
|
| + state.ApplyPropertyToRegularStyle(),
|
| + state.ApplyPropertyToVisitedLinkStyle());
|
| }
|
|
|
| {{declare_value_function(property_id)}} {
|
| const CSSValue* localValue = &value;
|
| String url;
|
| - if (value.isValueList()) {
|
| - const CSSValueList& list = toCSSValueList(value);
|
| + if (value.IsValueList()) {
|
| + const CSSValueList& list = ToCSSValueList(value);
|
| DCHECK_EQ(list.length(), 2U);
|
| - url = toCSSURIValue(list.item(0)).value();
|
| - localValue = &list.item(1);
|
| + url = ToCSSURIValue(list.Item(0)).Value();
|
| + localValue = &list.Item(1);
|
| }
|
|
|
| Color color;
|
| SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR;
|
| - if (localValue->isURIValue()) {
|
| + if (localValue->IsURIValue()) {
|
| paintType = SVG_PAINTTYPE_URI;
|
| - url = toCSSURIValue(localValue)->value();
|
| - } else if (localValue->isIdentifierValue() &&
|
| - toCSSIdentifierValue(localValue)->getValueID() == CSSValueNone) {
|
| - paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
|
| - } else if (localValue->isIdentifierValue() &&
|
| - toCSSIdentifierValue(localValue)->getValueID() == CSSValueCurrentcolor) {
|
| - color = state.style()->color();
|
| - paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR
|
| + url = ToCSSURIValue(localValue)->Value();
|
| + } else if (localValue->IsIdentifierValue() &&
|
| + ToCSSIdentifierValue(localValue)->GetValueID() == CSSValueNone) {
|
| + paintType = url.IsEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
|
| + } else if (localValue->IsIdentifierValue() &&
|
| + ToCSSIdentifierValue(localValue)->GetValueID() == CSSValueCurrentcolor) {
|
| + color = state.Style()->GetColor();
|
| + paintType = url.IsEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR
|
| : SVG_PAINTTYPE_URI_CURRENTCOLOR;
|
| } else {
|
| - color = StyleBuilderConverter::convertColor(state, *localValue);
|
| - paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR
|
| + color = StyleBuilderConverter::ConvertColor(state, *localValue);
|
| + paintType = url.IsEmpty() ? SVG_PAINTTYPE_RGBCOLOR
|
| : SVG_PAINTTYPE_URI_RGBCOLOR;
|
| }
|
| {{set_value(property)}}(paintType, color, url,
|
| - state.applyPropertyToRegularStyle(),
|
| - state.applyPropertyToVisitedLinkStyle());
|
| + state.ApplyPropertyToRegularStyle(),
|
| + state.ApplyPropertyToVisitedLinkStyle());
|
| }
|
| {% endmacro %}
|
| {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}}
|
|
|