mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibWeb: Add a constant for the number of longhand properties
We use this in multiple places (and will in more places in the future) so it's worth having as a constant from a clarity point of view
This commit is contained in:
parent
58431603ca
commit
fba4187c8f
Notes:
github-actions[bot]
2025-08-26 10:19:56 +00:00
Author: https://github.com/Calme1709
Commit: fba4187c8f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5984
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gmta ✅
4 changed files with 4 additions and 4 deletions
|
@ -150,7 +150,6 @@ WebIDL::UnsignedLong StylePropertyMapReadOnly::size() const
|
|||
// value on this"
|
||||
// Ensure style is computed on the element before we try to read it.
|
||||
element.document().update_style();
|
||||
auto longhands_count = to_underlying(last_longhand_property_id) - to_underlying(first_longhand_property_id) + 1;
|
||||
|
||||
// Some custom properties set on the element might also be in the registered custom properties set, so we
|
||||
// want the size of the union of the two sets.
|
||||
|
@ -160,7 +159,7 @@ WebIDL::UnsignedLong StylePropertyMapReadOnly::size() const
|
|||
for (auto const& [key, _] : element.document().registered_custom_properties())
|
||||
custom_properties.set(key);
|
||||
|
||||
return longhands_count + custom_properties.size();
|
||||
return number_of_longhand_properties + custom_properties.size();
|
||||
},
|
||||
[](GC::Ref<CSSStyleDeclaration> const& declaration) { return declaration->length(); });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue