mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Add basic registered properties with initial values
Add global registry for registered properties and partial support for `@property` rule. Enables registering properties with initial values. Also adds basic retrieval via `var()`. Note: This is not a complete `@property` implementation.
This commit is contained in:
parent
e7f0126c2e
commit
7ad01d28a8
Notes:
github-actions[bot]
2025-07-18 10:13:56 +00:00
Author: https://github.com/Norbiros 🔰
Commit: 7ad01d28a8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5456
Reviewed-by: https://github.com/AtkinsSJ ✅
9 changed files with 73 additions and 20 deletions
|
@ -145,6 +145,13 @@ GC::RootVector<GC::Ref<CSSRule>> Parser::convert_rules(Vector<Rule> const& raw_r
|
|||
|
||||
m_declared_namespaces.set(as<CSSNamespaceRule>(*rule).prefix());
|
||||
break;
|
||||
case CSSRule::Type::Property: {
|
||||
auto& property_rule = as<CSSPropertyRule>(*rule);
|
||||
if (m_document) {
|
||||
const_cast<DOM::Document*>(m_document.ptr())->registered_custom_properties().set(property_rule.name(), property_rule);
|
||||
}
|
||||
[[fallthrough]];
|
||||
}
|
||||
default:
|
||||
import_rules_valid = false;
|
||||
namespace_rules_valid = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue