diff --git a/Libraries/LibWeb/Animations/AnimationEffect.cpp b/Libraries/LibWeb/Animations/AnimationEffect.cpp index d69d7f490c2..5843ff78415 100644 --- a/Libraries/LibWeb/Animations/AnimationEffect.cpp +++ b/Libraries/LibWeb/Animations/AnimationEffect.cpp @@ -634,13 +634,13 @@ void AnimationEffect::visit_edges(JS::Cell::Visitor& visitor) static CSS::RequiredInvalidationAfterStyleChange compute_required_invalidation_for_animated_properties(HashMap> const& old_properties, HashMap> const& new_properties) { CSS::RequiredInvalidationAfterStyleChange invalidation; - auto old_and_new_properties = MUST(Bitmap::create(to_underlying(CSS::last_property_id) + 1, 0)); + auto old_and_new_properties = MUST(Bitmap::create(CSS::number_of_longhand_properties, 0)); for (auto const& [property_id, _] : old_properties) - old_and_new_properties.set(to_underlying(property_id), 1); + old_and_new_properties.set(to_underlying(property_id) - to_underlying(CSS::first_longhand_property_id), 1); for (auto const& [property_id, _] : new_properties) - old_and_new_properties.set(to_underlying(property_id), 1); - for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) { - if (!old_and_new_properties.get(i)) + old_and_new_properties.set(to_underlying(property_id) - to_underlying(CSS::first_longhand_property_id), 1); + for (auto i = to_underlying(CSS::first_longhand_property_id); i <= to_underlying(CSS::last_longhand_property_id); ++i) { + if (!old_and_new_properties.get(i - to_underlying(CSS::first_longhand_property_id))) continue; auto property_id = static_cast(i); auto const* old_value = old_properties.get(property_id).value_or({}); diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 5e9e4b095a5..fcc31720d78 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -674,7 +674,7 @@ static CSS::RequiredInvalidationAfterStyleChange compute_required_invalidation(C if (!old_style.computed_font_list().equals(new_style.computed_font_list())) invalidation.relayout = true; - for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) { + for (auto i = to_underlying(CSS::first_longhand_property_id); i <= to_underlying(CSS::last_longhand_property_id); ++i) { auto property_id = static_cast(i); auto old_value = old_style.maybe_null_property(property_id); auto new_value = new_style.maybe_null_property(property_id);