mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 15:19:16 +00:00
LibWeb/CSS: Add StyleValue getter to CSSStyleDeclarations
Will be used by StylePropertyMap, as that wants a StyleValue to reify, not a string representation.
This commit is contained in:
parent
276540fbe9
commit
25c4c2397e
Notes:
github-actions[bot]
2025-08-18 09:14:10 +00:00
Author: https://github.com/AtkinsSJ
Commit: 25c4c2397e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5862
Reviewed-by: https://github.com/Calme1709
5 changed files with 21 additions and 0 deletions
|
@ -289,6 +289,14 @@ bool CSSDescriptors::has_property(StringView property_name) const
|
|||
return descriptor(*descriptor_id) != nullptr;
|
||||
}
|
||||
|
||||
RefPtr<StyleValue const> CSSDescriptors::get_property_style_value(StringView property_name) const
|
||||
{
|
||||
auto descriptor_id = descriptor_id_from_string(m_at_rule_id, property_name);
|
||||
if (!descriptor_id.has_value())
|
||||
return nullptr;
|
||||
return descriptor(*descriptor_id);
|
||||
}
|
||||
|
||||
bool is_shorthand(AtRuleID at_rule, DescriptorID descriptor)
|
||||
{
|
||||
if (at_rule == AtRuleID::Page && descriptor == DescriptorID::Margin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue