Skip to content

Commit

Permalink
Update Imperative-Shadow-DOM-Distribution-API.md (#761)
Browse files Browse the repository at this point in the history
* wip

* wip
  • Loading branch information
kymuto authored and hayatoito committed Aug 15, 2018
1 parent 0625cf4 commit 51e4f40
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions proposals/Imperative-Shadow-DOM-Distribution-API.md
Expand Up @@ -121,6 +121,7 @@ host
│ └── slot2
├── A
└── B
```

``` javascript
Expand All @@ -132,14 +133,19 @@ slot2.assign([A]);

assert(slot2.assignedNodes() == [A]);

slot2.assign([B, A]); // The order doesn't matter.
slot1.assign([B, A]); // The order doesn't matter.

assert(slot2.assignedNodes() == [A, B]);
assert(slot1.assignedNodes() == [A, B]);

slot2.assign([A, B]); // The first slot in tree-order takes the node.

assert(slot1.assignedNodes() == [A, B]);
assert(slot2.assignedNodes() == []);

slot1.assign(A);

assert(slot1.assignedNodes() == [A]); // slot1 got A.
assert(slot2.assignedNodes() == [B]); // slot2 lost A.
assert(slot1.assignedNodes() == [A]); // slot1 lost B.
assert(slot2.assignedNodes() == [B]); // slot2 got B.

slot1.assign([A, A, A, host]); // We don't throw an exepction here.

Expand Down

0 comments on commit 51e4f40

Please sign in to comment.