mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Always note whether a CSS property was inherited
This will be relevant when we start recomputing inherited style only.
This commit is contained in:
parent
966c68ae0e
commit
92ac702c0c
Notes:
github-actions[bot]
2024-12-23 16:06:25 +00:00
Author: https://github.com/awesomekling
Commit: 92ac702c0c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3023
1 changed files with 4 additions and 1 deletions
|
@ -2331,10 +2331,13 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::Element& elem
|
||||||
for (auto i = to_underlying(first_longhand_property_id); i <= to_underlying(last_longhand_property_id); ++i) {
|
for (auto i = to_underlying(first_longhand_property_id); i <= to_underlying(last_longhand_property_id); ++i) {
|
||||||
auto property_id = static_cast<CSS::PropertyID>(i);
|
auto property_id = static_cast<CSS::PropertyID>(i);
|
||||||
auto value = cascaded_properties.property(property_id);
|
auto value = cascaded_properties.property(property_id);
|
||||||
|
auto inherited = ComputedProperties::Inherited::No;
|
||||||
|
|
||||||
if ((!value && is_inherited_property(property_id))
|
if ((!value && is_inherited_property(property_id))
|
||||||
|| (value && value->is_inherit())) {
|
|| (value && value->is_inherit())) {
|
||||||
if (auto inheritance_parent = element_to_inherit_style_from(&element, pseudo_element)) {
|
if (auto inheritance_parent = element_to_inherit_style_from(&element, pseudo_element)) {
|
||||||
value = inheritance_parent->computed_properties()->property(property_id);
|
value = inheritance_parent->computed_properties()->property(property_id);
|
||||||
|
inherited = ComputedProperties::Inherited::Yes;
|
||||||
} else {
|
} else {
|
||||||
value = property_initial_value(property_id);
|
value = property_initial_value(property_id);
|
||||||
}
|
}
|
||||||
|
@ -2350,7 +2353,7 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::Element& elem
|
||||||
value = CSSKeywordValue::create(Keyword::Initial);
|
value = CSSKeywordValue::create(Keyword::Initial);
|
||||||
}
|
}
|
||||||
|
|
||||||
computed_style->set_property(property_id, value.release_nonnull());
|
computed_style->set_property(property_id, value.release_nonnull(), inherited);
|
||||||
|
|
||||||
if (property_id == PropertyID::AnimationName) {
|
if (property_id == PropertyID::AnimationName) {
|
||||||
computed_style->set_animation_name_source(cascaded_properties.property_source(property_id));
|
computed_style->set_animation_name_source(cascaded_properties.property_source(property_id));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue