mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
Previously we would look for a matching ID, and then for a matching name. If there was an element in the collection which had a matching ID as well as an element with a matching name, we would always return the element with a matching ID irrespective of what order that element was in.
15 lines
532 B
HTML
15 lines
532 B
HTML
<a name="anchor1" id="foo"></a>
|
|
<a name="anchor2" id="baz"></a>
|
|
<a name="anchor3" id="anchor1"></a>
|
|
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
println(document.anchors.constructor.name);
|
|
println(document.anchors.namedItem('anchor1').name);
|
|
println(document.anchors.namedItem('anchor2').name);
|
|
println(document.anchors.namedItem('anchor3').name);
|
|
println(document.anchors.namedItem('foo').name);
|
|
println(document.anchors.namedItem('baz').name);
|
|
});
|
|
</script>
|