mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Allow custom properties in CSSStyleDeclaration.getPropertyValue
This commit is contained in:
parent
3a2cc1aa20
commit
ce26e5d757
Notes:
github-actions[bot]
2024-11-21 12:17:21 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: ce26e5d757
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2460
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 20 additions and 1 deletions
|
@ -258,6 +258,14 @@ String CSSStyleDeclaration::get_property_value(StringView property_name) const
|
|||
if (!property_id.has_value())
|
||||
return {};
|
||||
|
||||
if (property_id.value() == PropertyID::Custom) {
|
||||
auto maybe_custom_property = custom_property(FlyString::from_utf8_without_validation(property_name.bytes()));
|
||||
if (maybe_custom_property.has_value()) {
|
||||
return maybe_custom_property.value().value->to_string();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
// 2. If property is a shorthand property, then follow these substeps:
|
||||
if (property_is_shorthand(property_id.value())) {
|
||||
// 1. Let list be a new empty array.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue