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

Unified Diff: LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query.html

Issue 135103003: Updating <object> upon changing "data", "classid", "type" attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + method rename Created 6 years, 11 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: LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query.html
diff --git a/LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query.html b/LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query.html
index 446966d1c2a3aeb588f71189e5cbd131cd3a4b22..ec59a35dd614adcc87601847ba9097797affb691 100644
--- a/LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query.html
+++ b/LayoutTests/svg/as-object/embedded-svg-immediate-offsetWidth-query.html
@@ -1,6 +1,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-<script>window.enablePixelTesting = true;</script>
+<script>
+window.enablePixelTesting = true;
+window.jsTestIsAsync = true;
+</script>
<script src="../../resources/js-test.js"></script>
<script src="../../fast/repaint/resources/repaint.js"></script>
<script type="text/javascript">
@@ -16,11 +19,15 @@
shouldBe("newObject.offsetWidth", "302");
shouldBe("newObject.offsetWidth", "302");
- // Switch to document: "<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"><rect width="400" height="200" fill="green"/></svg>".
- // FIXME: This currently fails in WebKit trunk. We don't react on dataAttr changes at all. When manually relayouting using eg. zoom in/out it takes affect.
- newObject.setAttribute("data", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MDAiIGhlaWdodD0iMjAwIj48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjIwMCIgZmlsbD0iZ3JlZW4iLz48L3N2Zz4=");
- shouldBe("newObject.offsetWidth", "502");
- shouldBe("newObject.offsetWidth", "502");
+ // Switch to document: "<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"><rect width="400" height="200" fill="green"/>&lt;script><![CDATA[window.parent.postMessage('running', '*');]]>&lt;/script></svg>".
+
+ // The replacement won't synchronous; wait on its completion.
+ window.onmessage = function () {
+ shouldBe("newObject.offsetWidth", "402");
+ shouldBe("newObject.offsetWidth", "402");
+ finishJSTest();
+ };
+ newObject.setAttribute("data", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MDAiIGhlaWdodD0iMjAwIj48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjIwMCIgZmlsbD0iZ3JlZW4iLz48c2NyaXB0PjwhW0NEQVRBW3dpbmRvdy5wYXJlbnQucG9zdE1lc3NhZ2UoJ3J1bm5pbmcnLCAnKicpO11dPjwvc2NyaXB0Pjwvc3ZnPg==");
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698