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

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: 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..97046442fbf958ba0f17033e7bb28b3f109c1efb
--- /dev/null
+++ b/LayoutTests/fast/dom/custom/document-register-on-create-callback.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
dominicc (has gone to gerrit) 2013/12/13 05:11:16 We could use the W3C test harness for this test an
Hajime Morrita 2013/12/13 07:02:29 In this case the execution order matters. So I'd r
+</head>
+<body>
+<script>
+description("document.register() should affect even for queued elements.");
+
+var createdElements = [];
+
+var protoA = Object.create(HTMLElement.prototype);
+protoA.createdCallback = function () {
+ createdElements.push(this);
+ var protoB = Object.create(HTMLElement.prototype);
+ protoB.createdCallback = function () {
+ createdElements.push(this);
+ };
+
+ document.register('x-b', {prototype: protoB});
+};
+
+document.register('x-a', {prototype: protoA});
+</script>
+<x-a id=elemA></x-a>
+<x-b id=elemB></x-b>
+<x-c id=elemC></x-c>
dominicc (has gone to gerrit) 2013/12/13 05:11:16 I think this element is a distraction; if it isn't
Hajime Morrita 2013/12/13 07:02:29 Done.
+<script>
+shouldBe("createdElements.map(function(e) { return e.id; })", "['elemA', 'elemB']");
dominicc (has gone to gerrit) 2013/12/13 05:11:16 It might be simpler to have the createdCallback si
Hajime Morrita 2013/12/13 07:02:29 Done.
+</script>
+</body>
+</html>
dominicc (has gone to gerrit) 2013/12/13 05:11:16 I think I understand what this is testing... it's
Hajime Morrita 2013/12/13 07:02:29 Good point. I added another element to exercise th

Powered by Google App Engine
This is Rietveld 408576698