forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backed out changeset 29a6664e8f73 (bug 1319342) for wpt failures in N…
…ode-cloneNode.html a=backout MozReview-Commit-ID: 2FoC3zDqXO2
- Loading branch information
Showing
9 changed files
with
109 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
dom/tests/mochitest/webcomponents/test_custom_element_clone_callbacks.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<!-- | ||
https://bugzilla.mozilla.org/show_bug.cgi?id=1081039 | ||
--> | ||
<head> | ||
<title>Test callbacks for cloned custom elements.</title> | ||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> | ||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> | ||
</head> | ||
<body> | ||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1081039">Bug 1081039</a> | ||
<script> | ||
|
||
SimpleTest.waitForExplicitFinish(); | ||
|
||
// Test to make sure created callback is called on clones that are upgraded and clones | ||
// created after registering the custom element. | ||
|
||
var callbackCalledOnUpgrade = false; | ||
var callbackCalledOnClone = false; | ||
|
||
var foo = document.createElement("x-foo"); | ||
var fooClone = foo.cloneNode(true); | ||
|
||
var p = Object.create(HTMLElement.prototype); | ||
p.createdCallback = function() { | ||
is(this.__proto__, p, "Correct prototype should be set on custom elements."); | ||
|
||
if (this == fooClone) { | ||
// Callback called for the element created before registering the custom element. | ||
// Should be called on element upgrade. | ||
is(callbackCalledOnUpgrade, false, "Upgrade should only be called once per clone."); | ||
callbackCalledOnUpgrade = true; | ||
} else if (this != foo) { | ||
// Callback called for the element created after registering the custom element. | ||
is(callbackCalledOnClone, false, "Upgrade should only be called once per clone."); | ||
callbackCalledOnClone = true; | ||
} | ||
|
||
if (callbackCalledOnUpgrade && callbackCalledOnClone) { | ||
SimpleTest.finish(); | ||
} | ||
}; | ||
|
||
document.registerElement("x-foo", { prototype: p }); | ||
|
||
var anotherFooClone = foo.cloneNode(true); | ||
|
||
SimpleTest.waitForExplicitFinish(); | ||
|
||
</script> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
testing/web-platform/meta/custom-elements/reaction-timing.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[reaction-timing.html] | ||
type: testharness | ||
[Calling Node.prototype.cloneNode(false) must push a new element queue to the processing stack] | ||
expected: FAIL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
testing/web-platform/meta/custom-elements/reactions/Node.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Node.html] | ||
type: testharness | ||
[cloneNode on Node must enqueue an attributeChanged reaction when cloning an element with an observed attribute] | ||
expected: FAIL | ||
|
||
[cloneNode on Node must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute] | ||
expected: FAIL | ||
|
||
[cloneNode on Node must enqueue an attributeChanged reaction when cloning an element only for observed attributes] | ||
expected: FAIL |
9 changes: 9 additions & 0 deletions
9
testing/web-platform/meta/custom-elements/reactions/Range.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
[Range.html] | ||
type: testharness | ||
[cloneContents on Range must enqueue an attributeChanged reaction when cloning an element with an observed attribute] | ||
expected: FAIL | ||
|
||
[cloneContents on Range must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute] | ||
expected: FAIL | ||
|
||
[cloneContents on Range must enqueue an attributeChanged reaction when cloning an element only for observed attributes] | ||
expected: FAIL | ||
|
||
[createContextualFragment on Range must construct a custom element] | ||
expected: FAIL | ||
|
14 changes: 14 additions & 0 deletions
14
testing/web-platform/meta/custom-elements/upgrading/Node-cloneNode.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Node-cloneNode.html] | ||
type: testharness | ||
[Node.prototype.cloneNode(true) must set parentNode, previousSibling, and nextSibling before upgrading custom elements] | ||
expected: FAIL | ||
|
||
[HTMLElement constructor must throw an InvalidStateError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself after super() call] | ||
expected: FAIL | ||
|
||
[HTMLElement constructor must throw an InvalidStateError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself before super() call] | ||
expected: FAIL | ||
|
||
[Upgrading a custom element must throw InvalidStateError when the custom element's constructor returns another element] | ||
expected: FAIL | ||
16 changes: 8 additions & 8 deletions
16
testing/web-platform/meta/dom/nodes/Node-cloneNode.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
[Node-cloneNode.html] | ||
type: testharness | ||
[Node.cloneNode] | ||
expected: FAIL | ||
|
||
[createElement(dialog)] | ||
expected: | ||
if os == "linux": PASS | ||
if os == "mac": FAIL | ||
if os == "win": FAIL | ||
expected: FAIL | ||
|
||
[implementation.createDocument] | ||
expected: | ||
if os == "linux": PASS | ||
if os == "mac": FAIL | ||
if os == "win": FAIL | ||
expected: FAIL | ||
|
||
[createElement(applet)] | ||
expected: FAIL | ||
|