mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb/CSS: Implement StylePropertyMap::set()
With this commit, only direct CSSStyleValues created from internal StyleValues can be converted back to a StyleValue. More subtests will pass as create_an_internal_representation() is implemented for the various CSSStyleValue subclasses. :^) Gets us... a LOT of WPT passes, because there's a ton of coverage for each property.
This commit is contained in:
parent
927ce89864
commit
84f0f37a29
Notes:
github-actions[bot]
2025-10-04 20:58:08 +00:00
Author: https://github.com/AtkinsSJ
Commit: 84f0f37a29
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6370
13 changed files with 361 additions and 279 deletions
|
@ -122,4 +122,14 @@ WebIDL::ExceptionOr<String> CSSStyleValue::to_string() const
|
|||
return String {};
|
||||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#create-an-internal-representation
|
||||
WebIDL::ExceptionOr<NonnullRefPtr<StyleValue const>> CSSStyleValue::create_an_internal_representation(PropertyNameAndID const&) const
|
||||
{
|
||||
// If value is a direct CSSStyleValue,
|
||||
// Return value’s associated value.
|
||||
if (!m_source_value)
|
||||
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, MUST(String::formatted("Missing {}::create_an_internal_representation() overload", class_name())) };
|
||||
return NonnullRefPtr { *m_source_value };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue