Re: [whatwg/dom] event.composedPath() may return different results if DOM is modified between two calls (#525)

I tried to apply the given algorithm to the following DOM trees.

```   
A
└──/shadowRoot1 (open)
    └── B
        ├──/shadowRoot2 (closed)
        │   └── D
        │       └── slot
        └── C
```

- Assumes that event is fired on C, and we call event.composedPath() in an event listener registered on A.  

My interpretation is:

| parent | target | (target,   | targetOverride, | relatedTarget) | root-of-closed-tree | slot-in-closed-tree                        | reversedComposedPath                                           | hiddenSubtreeLevel | hasSeenCurrentTarget |
| --     | ---    | ----     | ----            | ---            | --                  | --                                         | --                                                             |                 -- | --                   |
|        | C      | C        | C               |                |                     |                                            | A,sr1,B (We didn't add C here)    |                  1 | true                 |
| slot   |        | slot     | null            |                |                     | We didn't set true, here. Is that correct? | A,sr1,B                                                        |                  1 | true                 |
| D      |        | D        | null            |                |                     |                                            | A,sr1,B                                                        |                  1 | true                 |
| sr2    |        | sr2      | null            |                | true                |                                            | A,sr1,B                                                        |      1 (increased) | true                 |
| B      |        | B        | null            |                |                     |                                            | A,sr1,B                                                        |                  0 | true                 |
| sr1    |        | sr1      | null            |                |                     |                                            | A,sr1                                                          |                  0 | true                 |
| A      | A      | A        | A               |                |                     |                                            | A                                                              |                  0 | set to true          |





It looks event.composedPath() would return reverse([A, sr1, B]), instead of returning reverse([A, sr1, B, C]). Is my understanding correct?




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/525#issuecomment-342750037

Received on Wednesday, 8 November 2017 08:48:02 UTC