mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibWeb: Don't crash on CSS all: revert
Not every value in a StyleProperties will be non-null by the time we perform `revert`, so let's make a specialized function for reverting a property instead of using the path that requires the value to be non-null.
This commit is contained in:
parent
96c0cbf584
commit
a10610a1ca
Notes:
github-actions[bot]
2024-08-04 09:50:34 +00:00
Author: https://github.com/awesomekling
Commit: a10610a1ca
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/953
5 changed files with 19 additions and 7 deletions
|
@ -859,13 +859,7 @@ void StyleComputer::set_all_properties(DOM::Element& element, Optional<CSS::Sele
|
|||
auto property_id = (CSS::PropertyID)i;
|
||||
|
||||
if (value.is_revert()) {
|
||||
style.set_property(
|
||||
property_id,
|
||||
style_for_revert.property(property_id),
|
||||
style_for_revert.is_property_inherited(property_id)
|
||||
? StyleProperties::Inherited::Yes
|
||||
: StyleProperties::Inherited::No,
|
||||
important);
|
||||
style.revert_property(property_id, style_for_revert);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue