mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Make getElementById() always return first match in tree order
We had a const and non-const version of this function, with slightly different behavior (oops!) This patch consolidates the implementations and keeps only the correct behavior in there. Fixes an issue where comments were not collapsible on Hacker News.
This commit is contained in:
parent
e4e64c15aa
commit
98f88d49de
Notes:
github-actions[bot]
2024-07-21 11:26:29 +00:00
Author: https://github.com/awesomekling
Commit: 98f88d49de
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/746
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 11 additions and 16 deletions
7
Tests/LibWeb/Text/input/DOM/getElementById-multiple.html
Normal file
7
Tests/LibWeb/Text/input/DOM/getElementById-multiple.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<div id="foo" n="1"></div><div id="foo" n="2"></div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println("getElementById('foo') => " + document.getElementById("foo").getAttribute("n"));
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue