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

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

Issue 81123002: Factor out common BorderImageLength code in CSSToStyleMap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add expected file too Created 7 years, 1 month 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/StyleBuilderFunctions.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index 70ee3f508ce0f72e71ea72d8b9df8e76954a4204..96b55a56df7175f43ed83d47a7a8f0a26b16865e 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -175,7 +175,7 @@ namespace WebCore {
{
NinePieceImage image(state.style()->{{getter}}());
{%- if modifier_type == "Outset" %}
- image.setOutset(BorderImageLengthBox({{ (["Length(0, Fixed)"]*4) | join(", ") }}));
+ image.setOutset(Length(0, Fixed));
{%- elif modifier_type == "Repeat" %}
image.setHorizontalRule(StretchImageRule);
image.setVerticalRule(StretchImageRule);
@@ -187,8 +187,8 @@ namespace WebCore {
image.setImageSlices(LengthBox({{ (["Length(100, Percent)"]*4) | join(", ") }}));
image.setFill(false);
{%- elif modifier_type == "Width" %}
- // Masks have a different initial value for widths. Preserve the value of 0 for backwards compatibility.
- image.setBorderSlices(BorderImageLengthBox({{ (["1.0"]*4) | join(", ") if not is_mask_box }}));
+ // Masks have a different initial value for widths. Preserve the value of 'auto' for backwards compatibility.
+ image.setBorderSlices({{ "Length(Auto)" if is_mask_box else "1.0" }});
{%- endif %}
state.style()->{{setter}}(image);
}

Powered by Google App Engine
This is Rietveld 408576698