mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +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
|
@ -21,6 +21,7 @@
|
|||
#include <LibURL/Origin.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibUnicode/Forward.h>
|
||||
#include <LibWeb/CSS/CSSPropertyRule.h>
|
||||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/CSS/StyleSheetList.h>
|
||||
#include <LibWeb/Cookie/Cookie.h>
|
||||
|
@ -905,6 +906,11 @@ public:
|
|||
|
||||
StyleInvalidator& style_invalidator() { return m_style_invalidator; }
|
||||
|
||||
// https://www.w3.org/TR/css-properties-values-api-1/#dom-window-registeredpropertyset-slot
|
||||
HashMap<FlyString, GC::Ref<Web::CSS::CSSPropertyRule>>& registered_custom_properties();
|
||||
|
||||
NonnullRefPtr<CSS::CSSStyleValue const> custom_property_initial_value(FlyString const& name) const;
|
||||
|
||||
protected:
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
@ -1265,6 +1271,9 @@ private:
|
|||
HashTable<WeakPtr<Node>> m_pending_nodes_for_style_invalidation_due_to_presence_of_has;
|
||||
|
||||
GC::Ref<StyleInvalidator> m_style_invalidator;
|
||||
|
||||
// https://www.w3.org/TR/css-properties-values-api-1/#dom-window-registeredpropertyset-slot
|
||||
HashMap<FlyString, GC::Ref<Web::CSS::CSSPropertyRule>> m_registered_custom_properties;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue