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

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..15cfbe79052059db04db6dc9d75ba8def726998e 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');
+ 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>';
+ assert_true(callbackInvoked);
+
+ t.done();
+ });
+}));
+
+})();
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/created-callback-expected.txt » ('j') | Source/core/dom/custom/CustomElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698