mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibWeb: Add styleSheets and adoptedStyleSheets attributes in ShadowRoot
Co-authored-by: Simon Wanner <simon+git@skyrising.xyz>
This commit is contained in:
parent
f19c92d78e
commit
8ce8697a66
Notes:
sideshowbarker
2024-07-17 01:46:00 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 8ce8697a66
Pull-request: https://github.com/SerenityOS/serenity/pull/23533
Issue: https://github.com/SerenityOS/serenity/issues/23410
Reviewed-by: https://github.com/awesomekling
11 changed files with 138 additions and 37 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <LibWeb/Bindings/ShadowRootPrototype.h>
|
||||
#include <LibWeb/DOM/DocumentFragment.h>
|
||||
#include <LibWeb/WebIDL/ObservableArray.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
|
@ -33,6 +34,17 @@ public:
|
|||
WebIDL::ExceptionOr<String> inner_html() const;
|
||||
WebIDL::ExceptionOr<void> set_inner_html(StringView);
|
||||
|
||||
CSS::StyleSheetList& style_sheets();
|
||||
CSS::StyleSheetList const& style_sheets() const;
|
||||
|
||||
CSS::StyleSheetList* style_sheets_for_bindings() { return &style_sheets(); }
|
||||
|
||||
JS::NonnullGCPtr<WebIDL::ObservableArray> adopted_style_sheets() const;
|
||||
WebIDL::ExceptionOr<void> set_adopted_style_sheets(JS::Value);
|
||||
|
||||
protected:
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
ShadowRoot(Document&, Element& host, Bindings::ShadowRootMode);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
@ -46,6 +58,9 @@ private:
|
|||
Bindings::SlotAssignmentMode m_slot_assignment { Bindings::SlotAssignmentMode::Named };
|
||||
bool m_delegates_focus { false };
|
||||
bool m_available_to_element_internals { false };
|
||||
|
||||
JS::GCPtr<CSS::StyleSheetList> m_style_sheets;
|
||||
mutable JS::GCPtr<WebIDL::ObservableArray> m_adopted_style_sheets;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue