mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibWeb: Refactor Element.attachShadow() after spec changes
The bulk of this function is moved to a new "attach a shadow root" helper, designed to be used both from here and the HTML parser.
This commit is contained in:
parent
f3070118b1
commit
043ad0eb76
Notes:
sideshowbarker
2024-07-17 04:34:25 +09:00
Author: https://github.com/awesomekling
Commit: 043ad0eb76
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/278
Reviewed-by: https://github.com/mattco98
Reviewed-by: https://github.com/nico
4 changed files with 95 additions and 26 deletions
|
@ -33,6 +33,8 @@ struct ShadowRootInit {
|
|||
Bindings::ShadowRootMode mode;
|
||||
bool delegates_focus = false;
|
||||
Bindings::SlotAssignmentMode slot_assignment { Bindings::SlotAssignmentMode::Named };
|
||||
bool clonable = false;
|
||||
bool serializable = false;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/csswg-drafts/cssom-view-1/#dictdef-scrollintoviewoptions
|
||||
|
@ -126,6 +128,7 @@ public:
|
|||
DOMTokenList* class_list();
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<ShadowRoot>> attach_shadow(ShadowRootInit init);
|
||||
WebIDL::ExceptionOr<void> attach_a_shadow_root(Bindings::ShadowRootMode mode, bool clonable, bool serializable, bool delegates_focus, Bindings::SlotAssignmentMode slot_assignment);
|
||||
JS::GCPtr<ShadowRoot> shadow_root() const;
|
||||
|
||||
WebIDL::ExceptionOr<bool> matches(StringView selectors) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue