Bug 1409976 - Add slotchange event

* Add support for `slotchange` event
* Signal `slotchange` when slot's assigned nodes changes

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:35:48 -04:00 committed by Roy Tam
commit af22b5cba5
9 changed files with 174 additions and 160 deletions

View file

@ -1,99 +0,0 @@
[slotchange-event.html]
type: testharness
expected: ERROR
[slotchange event must fire on a default slot element inside an open shadow root in a document]
expected: FAIL
[slotchange event must fire on a default slot element inside a closed shadow root in a document]
expected: FAIL
[slotchange event must fire on a default slot element inside an open shadow root not in a document]
expected: FAIL
[slotchange event must fire on a default slot element inside a closed shadow root not in a document]
expected: FAIL
[slotchange event must fire on a named slot element insidean open shadow root in a document]
expected: FAIL
[slotchange event must fire on a named slot element insidea closed shadow root in a document]
expected: FAIL
[slotchange event must fire on a named slot element insidean open shadow root not in a document]
expected: FAIL
[slotchange event must fire on a named slot element insidea closed shadow root not in a document]
expected: FAIL
[slotchange event must not fire on a slot element inside an open shadow root in a document when another slot's assigned nodes change]
expected: FAIL
[slotchange event must not fire on a slot element inside a closed shadow root in a document when another slot's assigned nodes change]
expected: FAIL
[slotchange event must not fire on a slot element inside an open shadow root not in a document when another slot's assigned nodes change]
expected: FAIL
[slotchange event must not fire on a slot element inside a closed shadow root not in a document when another slot's assigned nodes change]
expected: FAIL
[slotchange event must not fire on a slot element inside an open shadow root in a document when the shadow host was mutated before the slot was inserted or after the slot was removed]
expected: FAIL
[slotchange event must not fire on a slot element inside a closed shadow root in a document when the shadow host was mutated before the slot was inserted or after the slot was removed]
expected: FAIL
[slotchange event must not fire on a slot element inside an open shadow root not in a document when the shadow host was mutated before the slot was inserted or after the slot was removed]
expected: FAIL
[slotchange event must not fire on a slot element inside a closed shadow root not in a document when the shadow host was mutated before the slot was inserted or after the slot was removed]
expected: FAIL
[slotchange event must fire on a slot element inside an open shadow root in a document even if the slot was removed immediately after the assigned nodes were mutated]
expected: FAIL
[slotchange event must fire on a slot element inside a closed shadow root in a document even if the slot was removed immediately after the assigned nodes were mutated]
expected: FAIL
[slotchange event must fire on a slot element inside an open shadow root not in a document even if the slot was removed immediately after the assigned nodes were mutated]
expected: FAIL
[slotchange event must fire on a slot element inside a closed shadow root not in a document even if the slot was removed immediately after the assigned nodes were mutated]
expected: FAIL
[slotchange event must fire on a slot element inside an open shadow root in a document when innerHTML modifies the children of the shadow host]
expected: FAIL
[slotchange event must fire on a slot element inside a closed shadow root in a document when innerHTML modifies the children of the shadow host]
expected: FAIL
[slotchange event must fire on a slot element inside an open shadow root not in a document when innerHTML modifies the children of the shadow host]
expected: FAIL
[slotchange event must fire on a slot element inside a closed shadow root not in a document when innerHTML modifies the children of the shadow host]
expected: FAIL
[slotchange event must fire on a slot element inside an open shadow root in a document when nested slots's contents change]
expected: FAIL
[slotchange event must fire on a slot element inside a closed shadow root in a document when nested slots's contents change]
expected: FAIL
[slotchange event must fire on a slot element inside an open shadow root not in a document when nested slots's contents change]
expected: FAIL
[slotchange event must fire on a slot element inside a closed shadow root not in a document when nested slots's contents change]
expected: FAIL
[slotchange event must fire at the end of current microtask after mutation observers are invoked inside an open shadow root in a document when slots's contents change]
expected: FAIL
[slotchange event must fire at the end of current microtask after mutation observers are invoked inside a closed shadow root in a document when slots's contents change]
expected: FAIL
[slotchange event must fire at the end of current microtask after mutation observers are invoked inside an open shadow root not in a document when slots's contents change]
expected: FAIL
[slotchange event must fire at the end of current microtask after mutation observers are invoked inside a closed shadow root not in a document when slots's contents change]
expected: FAIL

View file

@ -1,47 +0,0 @@
[slotchange.html]
type: testharness
[slotchange event: Append a child to a host.]
expected: FAIL
[slotchange event: Remove a child from a host.]
expected: FAIL
[slotchange event: Remove a child before adding an event listener.]
expected: FAIL
[slotchange event: Change slot= attribute to make it un-assigned.]
expected: FAIL
[slotchange event: Change slot's name= attribute so that none is assigned.]
expected: FAIL
[slotchange event: Change slot= attribute to make it assigned.]
expected: FAIL
[slotchange event: Change slot's name= attribute so that a node is assigned to the slot.]
expected: FAIL
[slotchange event: Add a fallback content.]
expected: FAIL
[slotchange event: Remove a fallback content.]
expected: FAIL
[slotchange event: Add a fallback content to nested slots.]
expected: FAIL
[slotchange event: Remove a fallback content from nested slots.]
expected: FAIL
[slotchange event: Insert a slot before an existing slot.]
expected: FAIL
[slotchange event: Remove a preceding slot.]
expected: FAIL
[slotchange event: A slot is assigned to another slot.]
expected: FAIL
[slotchange event: Even if distributed nodes do not change, slotchange should be fired if assigned nodes are changed.]
expected: FAIL