mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/HTML: Add source field to ToggleEventInit
Corresponds to:
95131eec8f
As we now have a field in that dictionary, I removed the separate
`source` parameter from ToggleEvent::create(). Also updated the
relevant test.
This commit is contained in:
parent
99bef81d09
commit
e5ea4f9bdf
Notes:
github-actions[bot]
2025-12-01 14:59:29 +00:00
Author: https://github.com/AtkinsSJ
Commit: e5ea4f9bdf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6958
Reviewed-by: https://github.com/tcl3 ✅
7 changed files with 47 additions and 22 deletions
|
|
@ -17,6 +17,7 @@ namespace Web::HTML {
|
|||
struct ToggleEventInit : public DOM::EventInit {
|
||||
String old_state;
|
||||
String new_state;
|
||||
GC::Ptr<DOM::Element> source;
|
||||
};
|
||||
|
||||
class ToggleEvent : public DOM::Event {
|
||||
|
|
@ -24,7 +25,7 @@ class ToggleEvent : public DOM::Event {
|
|||
GC_DECLARE_ALLOCATOR(ToggleEvent);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static GC::Ref<ToggleEvent> create(JS::Realm&, FlyString const& event_name, ToggleEventInit = {}, GC::Ptr<DOM::Element> source = {});
|
||||
[[nodiscard]] static GC::Ref<ToggleEvent> create(JS::Realm&, FlyString const& event_name, ToggleEventInit = {});
|
||||
static WebIDL::ExceptionOr<GC::Ref<ToggleEvent>> construct_impl(JS::Realm&, FlyString const& event_name, ToggleEventInit);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#dom-toggleevent-oldstate
|
||||
|
|
@ -43,7 +44,7 @@ public:
|
|||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
ToggleEvent(JS::Realm&, FlyString const& event_name, ToggleEventInit event_init, GC::Ptr<DOM::Element> source);
|
||||
ToggleEvent(JS::Realm&, FlyString const& event_name, ToggleEventInit event_init);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue