Open wilt00 opened 2 years ago
This is likely an issue upstream with the nwsapi
dependency... I'll have to look into why it's doing this :thinking:
FYI: A document's having multiple elements with the same ID is not spec (regardless of how an agent's runtime allows interactions).
In the case where two different elements of different classes (e.g.
div
andimg
) share the sameid
:deno-dom is unable to select the second tag.
Firefox and Chrome are both able to select the
img
tag - see screenshot of Firefox's behavior below:(Edit: replaced with a slightly more rigorous non-Quirks-mode screenshot)
Duplicating ids is banned by the spec, but can be found in the wild - e.g. Google sites like youtube.com make heavy usage of nonunique ids in shared components.
Tested with
https://deno.land/x/deno_dom@v0.1.32-alpha/deno-dom-wasm.ts