mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb/CSS: Take PropertyNameAndID in in style-only CSSSD methods
StylePropertyMap only ever works with style properties - never descriptors. Switching `has_property()` and `get_property_style_value()` to taking PropertyNameAndID skips some duplicate work.
This commit is contained in:
parent
47062424fb
commit
2f02ccc5c1
Notes:
github-actions[bot]
2025-10-02 12:47:49 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2f02ccc5c1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6310
7 changed files with 36 additions and 73 deletions
|
@ -281,22 +281,6 @@ RefPtr<StyleValue const> CSSDescriptors::descriptor_or_initial_value(DescriptorI
|
|||
return descriptor_initial_value(m_at_rule_id, descriptor_id);
|
||||
}
|
||||
|
||||
bool CSSDescriptors::has_property(FlyString const& property_name) const
|
||||
{
|
||||
auto descriptor_id = descriptor_id_from_string(m_at_rule_id, property_name);
|
||||
if (!descriptor_id.has_value())
|
||||
return false;
|
||||
return descriptor(*descriptor_id) != nullptr;
|
||||
}
|
||||
|
||||
RefPtr<StyleValue const> CSSDescriptors::get_property_style_value(FlyString const& 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