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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html

Issue 2222863002: [Typed-OM] Enable getting CSSURLImageValue from stylemap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CSSProperties_Image
Patch Set: Remove backgroundImage test from unsupported-properties, simplify test to get from StyleMap Created 4 years, 4 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: third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html b/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html
index c5737bcbbe649cc9901d3929555094e55b2f03a9..a1bbe2d9312333754d0d2eaefb4a371ad143d93f 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html
@@ -5,6 +5,7 @@
<div id="test-image1"></div>
<div id="test-image2"></div>
<div id="test-image3"></div>
+<div id="test-image4"></div>
<script>
@@ -21,6 +22,15 @@ function base64Image() {
return "data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=";
}
+function assertCorrectURLImageValue(image, expectedUrl, expectedWidth, expectedHeight, expectedRatio) {
+ assert_true(image instanceof CSSURLImageValue);
+ assert_equals(image.url, expectedUrl);
+ assert_equals(image.state, "loaded");
+ assert_equals(image.intrinsicWidth, expectedWidth);
+ assert_equals(image.intrinsicHeight, expectedHeight);
+ assert_equals(image.intrinsicRatio, expectedRatio);
+}
+
test(function() {
var bg = new CSSURLImageValue(urlImage);
assert_equals(bg.state, "unloaded");
@@ -109,4 +119,16 @@ test(function() {
};
}
+test(function() {
+ var url4 = base64Image();
+ var div4 = document.getElementById("test-image4");
+
+ for (var i = 0; i < imageProperties.length; ++i)
+ div4.style[imageProperties[i]] = 'url(' + url4 + ')';
meade_UTC10 2016/08/12 05:23:16 For JS style we use curly braces ({}) everywhere,
+
+ for (var i = 0; i < imageProperties.length; ++i) {
+ assertCorrectURLImageValue(getComputedStyleMap(div4).get(imageProperties[i]), url4, 1, 1, 1);
+ assertCorrectURLImageValue(div4.styleMap.get(imageProperties[i]), url4, 1, 1, 1);
+ }
+}, "Getting CSSURLImageValue from StyleMap");
</script>

Powered by Google App Engine
This is Rietveld 408576698