mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 01:51:03 +09: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:
parent
d22aa851cf
commit
bf16ddfbb0
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/krkk
Commit: bf16ddfbb0
Pull-request: https://github.com/SerenityOS/serenity/pull/21668
Issue: https://github.com/SerenityOS/serenity/issues/21609
3 changed files with 32 additions and 0 deletions
|
@ -5008,6 +5008,8 @@ RefPtr<StyleValue> Parser::parse_transform_origin_value(Vector<ComponentValue> c
|
|||
};
|
||||
|
||||
auto to_axis_offset = [](RefPtr<StyleValue> value) -> Optional<AxisOffset> {
|
||||
if (!value)
|
||||
return OptionalNone {};
|
||||
if (value->is_percentage())
|
||||
return AxisOffset { Axis::None, value->as_percentage() };
|
||||
if (value->is_length())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue