mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 12:32:20 +02:00
LibWeb: Don't crash when querying offsets of empty inline elements
Previously, querying `offsetTop` or `offsetLeft` of an inline element with no text would cause a crash.
This commit is contained in:
committed by
Alexander Kalenik
parent
99fbd33d7d
commit
d1226f0b15
Notes:
sideshowbarker
2024-07-17 01:00:06 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/d1226f0b15 Pull-request: https://github.com/SerenityOS/serenity/pull/22976 Reviewed-by: https://github.com/kalenikaliaksandr
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const element = document.getElementById("empty");
|
||||
println("Top: " + element.offsetTop);
|
||||
println("Left: " + element.offsetLeft);
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<span id="empty"></span>
|
||||
</body>
|
||||
Reference in New Issue
Block a user