mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibWeb: Bail parsing transform-origin if the parsed value is null
Passing a value of a type different than number or length-percentage to transform-origin returned a null pointer, and we didn't take care of that path before. This patch fixes a crash caused by an incorrect CSS declaration, such as `transform-origin: "center"`. Fixes #21609
This commit is contained in:
committed by
Andreas Kling
parent
d22aa851cf
commit
bf16ddfbb0
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/bf16ddfbb0 Pull-request: https://github.com/SerenityOS/serenity/pull/21668 Issue: https://github.com/SerenityOS/serenity/issues/21609
@@ -0,0 +1,23 @@
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
function serialize(input) {
|
||||
const e = document.createElement("div");
|
||||
e.style.transformOrigin = input;
|
||||
const serialized = e.style.transformOrigin;
|
||||
println(input + " => " + (serialized === '' ? '(invalid)' : serialized));
|
||||
}
|
||||
|
||||
for (transformOrigin of [
|
||||
'center',
|
||||
'10px',
|
||||
'25%',
|
||||
'left 20%',
|
||||
'20px bottom',
|
||||
'top right',
|
||||
'"center"',
|
||||
]) {
|
||||
serialize(transformOrigin);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user