You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case where two different elements of different classes (e.g. div and img) share the same id:
import{DOMParser}from"https://deno.land/x/[email protected]/deno-dom-wasm.ts";consth='<div id="i"><img id="i"/></div>';constd=newDOMParser().parseFromString(h,"text/html");d.querySelectorAll('#i');// only returns the div tagd.querySelector('img#i');// returns null
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.
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/[email protected]/deno-dom-wasm.ts
The text was updated successfully, but these errors were encountered: