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

Unified Diff: LayoutTests/fast/dom/custom/document-register-on-create-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/document-register-on-create-callback.html
diff --git a/LayoutTests/fast/dom/custom/document-register-on-create-callback.html b/LayoutTests/fast/dom/custom/document-register-on-create-callback.html
new file mode 100644
index 0000000000000000000000000000000000000000..31dcdc7e2ba2f38ad8429f249ec20cb87e313587
--- /dev/null
+++ b/LayoutTests/fast/dom/custom/document-register-on-create-callback.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
dominicc (has gone to gerrit) 2013/12/18 08:46:41 Can we use the W3C test harness for this?
+<script>
+description("document.register() in a createdCallback should upgrade elements that are in the same processing queue.");
dominicc (has gone to gerrit) 2013/12/18 08:46:41 I think it is preferable to use single quotes for
Hajime Morrita 2013/12/19 05:06:59 Done.
+
+var createdElements = [];
+
+var protoA = Object.create(HTMLElement.prototype);
+protoA.createdCallback = function () {
+ createdElements.push(this.id);
+ var protoB = Object.create(HTMLElement.prototype);
+ protoB.createdCallback = function () {
+ createdElements.push(this.id);
+ };
+
+ document.register('x-b', {prototype: protoB});
+ shouldBe("createdElements", "['elemA0', 'elemB0']");
dominicc (has gone to gerrit) 2013/12/18 08:46:41 Same here, use ' for the outermost string literal.
Hajime Morrita 2013/12/19 05:06:59 Done.
+};
+
+document.register('x-a', {prototype: protoA});
+</script>
+<x-b id=elemB0></x-b>
dominicc (has gone to gerrit) 2013/12/18 08:46:41 Quote these attributes for consistency.
Hajime Morrita 2013/12/19 05:06:59 Done.
+<x-a id=elemA0></x-a>
+<x-b id=elemB1></x-b>
+<script>
+shouldBe("createdElements", "['elemA0', 'elemB0', 'elemB1']");
dominicc (has gone to gerrit) 2013/12/18 08:46:41 And here.
Hajime Morrita 2013/12/19 05:06:59 Done.
+</script>

Powered by Google App Engine
This is Rietveld 408576698