mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Implement popover beforetoggle and toggle events
This commit is contained in:
parent
872a6a11a4
commit
fcf6cc27f2
Notes:
github-actions[bot]
2024-12-12 22:11:32 +00:00
Author: https://github.com/lukewarlow
Commit: fcf6cc27f2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/346
Reviewed-by: https://github.com/ADKaster ✅
7 changed files with 371 additions and 11 deletions
|
@ -6,10 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/HTML/GlobalEventHandlers.h>
|
||||
#include <LibWeb/HTML/HTMLOrSVGElement.h>
|
||||
#include <LibWeb/HTML/ToggleTaskTracker.h>
|
||||
#include <LibWeb/HTML/TokenizedFeatures.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -127,8 +129,6 @@ public:
|
|||
WebIDL::ExceptionOr<void> show_popover(ThrowExceptions throw_exceptions, GC::Ptr<HTMLElement> invoker);
|
||||
WebIDL::ExceptionOr<void> hide_popover(FocusPreviousElement focus_previous_element, FireEvents fire_events, ThrowExceptions throw_exceptions);
|
||||
|
||||
WebIDL::ExceptionOr<bool> check_popover_validity(ExpectedToBeShowing expected_to_be_showing, ThrowExceptions throw_exceptions, GC::Ptr<DOM::Document>);
|
||||
|
||||
protected:
|
||||
HTMLElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
|
@ -155,6 +155,10 @@ private:
|
|||
|
||||
GC::Ptr<DOM::NodeList> m_labels;
|
||||
|
||||
WebIDL::ExceptionOr<bool> check_popover_validity(ExpectedToBeShowing expected_to_be_showing, ThrowExceptions throw_exceptions, GC::Ptr<DOM::Document>);
|
||||
|
||||
void queue_a_popover_toggle_event_task(String old_state, String new_state);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#attached-internals
|
||||
GC::Ptr<ElementInternals> m_attached_internals;
|
||||
|
||||
|
@ -174,6 +178,9 @@ private:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/popover.html#popover-showing-or-hiding
|
||||
bool m_popover_showing_or_hiding { false };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/popover.html#the-popover-attribute:toggle-task-tracker
|
||||
Optional<ToggleTaskTracker> m_popover_toggle_task_tracker;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue