mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb: Add and use CSSStyleProperties helpers in Algorithms code
This commit is contained in:
parent
2f02ccc5c1
commit
ce7a8418ed
Notes:
github-actions[bot]
2025-10-02 12:47:44 +00:00
Author: https://github.com/AtkinsSJ
Commit: ce7a8418ed
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6310
3 changed files with 22 additions and 11 deletions
|
@ -385,6 +385,11 @@ bool CSSStyleProperties::has_property(PropertyNameAndID const& property) const
|
|||
return get_property_internal(property).has_value();
|
||||
}
|
||||
|
||||
bool CSSStyleProperties::has_property(PropertyID property_id) const
|
||||
{
|
||||
return has_property(PropertyNameAndID::from_id(property_id));
|
||||
}
|
||||
|
||||
RefPtr<StyleValue const> CSSStyleProperties::get_property_style_value(PropertyNameAndID const& property) const
|
||||
{
|
||||
if (auto style_property = get_property_internal(property); style_property.has_value())
|
||||
|
@ -392,6 +397,11 @@ RefPtr<StyleValue const> CSSStyleProperties::get_property_style_value(PropertyNa
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<StyleValue const> CSSStyleProperties::get_property_style_value(PropertyID property_id) const
|
||||
{
|
||||
return get_property_style_value(PropertyNameAndID::from_id(property_id));
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertyvalue
|
||||
Optional<StyleProperty> CSSStyleProperties::get_property_internal(PropertyNameAndID const& property) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue