Chromium Code Reviews| 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 da95da69b3f99c926d7968be98e19f9dd816f8fe..871bbd4de90eb2837361af2076dd467234c41a09 100644 |
| --- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
| +++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
| @@ -183,6 +183,19 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt |
| && lengthTypeAndValueMatch(borderImageLengthBox.bottom(), type, value)); |
| } |
| +static bool numberTypeAndValueMatch(const BorderImageLength& borderImageLength, float value) |
| +{ |
| + return borderImageLength.isNumber() && (borderImageLength.number() == value); |
| +} |
| + |
| +static bool numberTypeAndValueMatch(const BorderImageLengthBox& borderImageLengthBox, float value) |
|
Timothy Loh
2015/05/29 02:10:15
Naming is weird, lengthTypeAndValueMatch is checki
Sunil Ratnu
2015/05/29 13:56:01
Made the changes. Now passing BorderImageLength as
|
| +{ |
| + return (numberTypeAndValueMatch(borderImageLengthBox.left(), value) |
| + && numberTypeAndValueMatch(borderImageLengthBox.right(), value) |
| + && numberTypeAndValueMatch(borderImageLengthBox.top(), value) |
| + && numberTypeAndValueMatch(borderImageLengthBox.bottom(), value)); |
| +} |
| + |
| {% 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' %} |
| @@ -206,10 +219,10 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt |
| 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 (lengthTypeAndValueMatch(currentImage.borderSlices(), Auto, 0)) |
| + if (numberTypeAndValueMatch(currentImage.borderSlices(), 0)) |
|
Timothy Loh
2015/05/29 02:10:15
I think this is wrong. The default for -webkit-mas
Sunil Ratnu
2015/05/29 13:56:01
Done.
|
| return; |
| {% elif modifier_type == 'Width' and not is_mask_box %} |
| - if (lengthTypeAndValueMatch(currentImage.borderSlices(), Fixed, 1)) |
| + if (numberTypeAndValueMatch(currentImage.borderSlices(), 1.0)) |
|
Timothy Loh
2015/05/29 02:10:15
This is fixing a bug, right? We could add a test h
Sunil Ratnu
2015/05/29 13:56:01
Not sure if its fixing a bug for which we can have
|
| return; |
| {% endif %} |