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> |