mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/CSS: Store the style sheet's source text on the CSSStyleSheet
This is to enable the inspector to show this source. There's a fairly hefty FIXME here because duplicating the source text is a significant waste of memory. But I don't want to get too sidetracked.
This commit is contained in:
parent
8cbc211616
commit
b00137df38
Notes:
github-actions[bot]
2024-09-03 09:13:23 +00:00
Author: https://github.com/AtkinsSJ
Commit: b00137df38
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1168
Reviewed-by: https://github.com/trflynn89
3 changed files with 22 additions and 2 deletions
|
@ -78,6 +78,9 @@ public:
|
|||
|
||||
bool disallow_modification() const { return m_disallow_modification; }
|
||||
|
||||
void set_source_text(String);
|
||||
Optional<String> source_text(Badge<DOM::Document>) const;
|
||||
|
||||
private:
|
||||
CSSStyleSheet(JS::Realm&, CSSRuleList&, MediaList&, Optional<URL::URL> location);
|
||||
|
||||
|
@ -89,6 +92,8 @@ private:
|
|||
void set_constructed(bool constructed) { m_constructed = constructed; }
|
||||
void set_disallow_modification(bool disallow_modification) { m_disallow_modification = disallow_modification; }
|
||||
|
||||
Optional<String> m_source_text;
|
||||
|
||||
JS::GCPtr<CSSRuleList> m_rules;
|
||||
JS::GCPtr<CSSNamespaceRule> m_default_namespace_rule;
|
||||
HashMap<FlyString, JS::GCPtr<CSSNamespaceRule>> m_namespace_rules;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue