mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-14 21:11:57 +00:00
LibWeb: Avoid overwriting resolved values in compute_keyframe_values
When we have an unresolved value for a shorthand (e.g. `border-style: var(--border-style)`, `keyframe_values` will contain an `UnresolvedStyleValue` for the shorthand and `PendingSubstitutionStyleValue`s for each of it's longhands. When we come across the shorthand's `UnresolvedStyleValue` we will resolve the value and set all of the relevant longhands. If the longhand's `PendingSubstitutionStyleValue` was processed after (which isn't always the case as the iteration order depends on a HashMap) would overwrite the correctly resolved longhand. To avoid this we just skip any `PendingSubstitutionStyleValue`s we come across and rely on the resolution of the shorthand to set those properties. Resolves a crash @tcl3 was experiencing when adding a new "border-image-repeat" property.
This commit is contained in:
parent
2dead9231d
commit
64d79d4c3f
Notes:
github-actions[bot]
2025-06-13 15:07:18 +00:00
Author: https://github.com/Calme1709
Commit: 64d79d4c3f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5075
Reviewed-by: https://github.com/gmta ✅
1 changed files with 5 additions and 0 deletions
|
@ -1170,6 +1170,11 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optional<CSS::
|
|||
continue;
|
||||
}
|
||||
|
||||
// If the style value is a PendingSubstitutionStyleValue we should skip it to avoid overwriting any value
|
||||
// already set by resolving the relevant shorthand's value.
|
||||
if (style_value->is_pending_substitution())
|
||||
continue;
|
||||
|
||||
if (style_value->is_revert() || style_value->is_revert_layer())
|
||||
style_value = computed_properties.property(property_id);
|
||||
if (style_value->is_unresolved())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue