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

Unified Diff: LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion.html

Issue 18789002: Implement Custom Elements' attributeChangedCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months 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/registration-context-delete-during-callback-recursion.html
diff --git a/LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade.html b/LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion.html
similarity index 52%
copy from LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade.html
copy to LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion.html
index e740ef2759eda99d4effc3508d785c0bab1e2fb9..356855884645d45f653344700098e928666b30d9 100644
--- a/LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade.html
+++ b/LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion.html
@@ -2,13 +2,12 @@
<script src="../../js/resources/js-test-pre.js"></script>
<script src="testutils.js"></script>
<body>
-<x-a></x-a>
-<x-a></x-a>
-<x-a></x-a>
+<div id="s">
+</div>
<script>
if (fork()) {
// The controlling parent frame
- description('Tests destroying a context during element upgrade.');
+ description('Tests destroying a context during attributeChanged callback.');
jsTestIsAsync = true;
successfullyParsed = true;
} else {
@@ -17,12 +16,23 @@ if (fork()) {
var n = 0;
var proto = Object.create(HTMLElement.prototype);
proto.createdCallback = function () {
- if (++n == 2)
+ if (n++ == 2)
+ this.nextSibling.setAttribute('tick', '...');
+ };
+ proto.attributeChangedCallback = function (name) {
+ if (name == 'tick')
+ this.nextSibling.setAttribute('boom', 'tsk');
+ if (name == 'boom')
destroyContext();
};
var A = document.register('x-a', {prototype: proto});
- new A();
+ s.innerHTML =
+ '<x-a id="t"></x-a>' +
+ '<x-a id="u"></x-a>' +
+ '<x-a id="v"></x-a>' +
+ '<x-a id="w"></x-a>';
+
done();
}
</script>

Powered by Google App Engine
This is Rietveld 408576698