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

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

Issue 1153353002: Fast path when setting border-image-width to initial always fails (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 %}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698