mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 07:37:03 +00:00
LibWeb: Don't crash when resolving grid properties of inline elements
Previously, attempting to get the computed value for a grid-template-rows or grid-template-columns property would cause a crash for inline elements.
This commit is contained in:
parent
f65df3f59f
commit
087fcb84cb
Notes:
github-actions[bot]
2024-09-20 06:17:26 +00:00
Author: https://github.com/tcl3
Commit: 087fcb84cb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1454
4 changed files with 23 additions and 17 deletions
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const elementsToTest = [
|
||||
"br",
|
||||
"span",
|
||||
];
|
||||
for (const elementName of elementsToTest) {
|
||||
const element = document.createElement(elementName);
|
||||
document.body.appendChild(element);
|
||||
const style = getComputedStyle(element);
|
||||
let values = [];
|
||||
for (const propertyName of style) {
|
||||
values.push(style[propertyName]);
|
||||
}
|
||||
element.remove();
|
||||
}
|
||||
println("PASS (didn't crash)");
|
||||
});
|
||||
</script>
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const noPaintableElement = document.createElement("br");
|
||||
document.body.appendChild(noPaintableElement);
|
||||
const style = getComputedStyle(noPaintableElement);
|
||||
let values = [];
|
||||
for (const propertyName of style) {
|
||||
values.push(style[propertyName]);
|
||||
}
|
||||
noPaintableElement.remove();
|
||||
println("PASS (didn't crash)");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue