mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02: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:
committed by
Tim Ledbetter
parent
e4e64c15aa
commit
98f88d49de
Notes:
github-actions[bot]
2024-07-21 11:26:29 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/98f88d49de8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/746 Reviewed-by: https://github.com/tcl3 ✅
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>
|
||||
Reference in New Issue
Block a user