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

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: Rebase 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 58c665bdc4ecd8d8ae7b50d483a2d681b0065e44..bfba81785cb7893e149d73b22ccca7201e8251a3 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssURLImageValue.html
@@ -5,6 +5,7 @@
<div id="testImage1"></div>
<div id="testImage2"></div>
<div id="testImage3"></div>
+<div id="testImage4"></div>
<script>
@@ -21,6 +22,15 @@ function base64Url() {
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 image = new CSSURLImageValue(url());
assert_equals(image.state, "unloaded");
@@ -107,4 +117,17 @@ test(function() {
};
}
+test(function() {
+ var url4 = base64Url();
+
+ for (var i = 0; i < imageProperties.length; ++i) {
+ testImage4.style[imageProperties[i]] = 'url(' + url4 + ')';
+ }
+
+ for (var i = 0; i < imageProperties.length; ++i) {
+ assertCorrectURLImageValue(getComputedStyleMap(testImage4).get(imageProperties[i]), url4, 1, 1, 1);
+ assertCorrectURLImageValue(testImage4.styleMap.get(imageProperties[i]), url4, 1, 1, 1);
+ }
+}, "Getting CSSURLImageValue from StyleMap");
+
</script>

Powered by Google App Engine
This is Rietveld 408576698