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

Unified Diff: LayoutTests/fast/dom/custom/created-callback.html

Issue 106903007: Let unresolved custom element go through CustomElementCallbackQueue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated. Created 7 years 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/fast/dom/custom/created-callback.html
diff --git a/LayoutTests/fast/dom/custom/created-callback.html b/LayoutTests/fast/dom/custom/created-callback.html
index 07362925ab4cc0e7aa5a17fbf345d68ac5e604b8..a46d6e33fefbeb6eac463292ebcebe34963a9dfb 100644
--- a/LayoutTests/fast/dom/custom/created-callback.html
+++ b/LayoutTests/fast/dom/custom/created-callback.html
@@ -112,4 +112,33 @@ withFrame(t.step_func(function(frame) {
}));
})();
+
+(function() {
+
+t = async_test('callback is called even if the element is moved to foreign document');
+var callbackInvoked = false;
+
+withFrame(t.step_func(function(originalFrame) {
+ withFrame(function(destinationFrame) {
+ var protoA = Object.create(originalFrame.contentWindow.HTMLElement.prototype);
+ protoA.createdCallback = function() {
+ var toBeMoved = originalFrame.contentDocument.getElementById("toBeMoved");
dominicc (has gone to gerrit) 2013/12/18 08:46:41 Use single-quoted string literal for consistency.
Hajime Morrita 2013/12/19 05:06:59 Done.
+ destinationFrame.contentDocument.body.appendChild(toBeMoved);
+ };
+
+ var protoB = Object.create(originalFrame.contentWindow.HTMLElement.prototype);
+ protoB.createdCallback = function() {
+ callbackInvoked = true;
+ };
+
+ originalFrame.contentDocument.register('x-a', {prototype: protoA});
+ originalFrame.contentDocument.register('x-b', {prototype: protoB});
+ originalFrame.contentDocument.body.innerHTML = "<x-a></x-a><x-b id='toBeMoved'></x-b>";
dominicc (has gone to gerrit) 2013/12/18 08:46:41 ...also here.
Hajime Morrita 2013/12/19 05:06:59 Done.
+ assert_true(callbackInvoked);
+
+ t.done();
+ });
+}));
+
+})();
</script>

Powered by Google App Engine
This is Rietveld 408576698