mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibWeb: Add per-Frame EventHandler, handle mouse events recursively
We now handle mouse events by recursing into subframes. This makes links, tooltips, etc, work inside <iframe> content.
This commit is contained in:
parent
896db187e5
commit
d1852b4547
7 changed files with 355 additions and 144 deletions
|
@ -33,14 +33,12 @@
|
|||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibGfx/Size.h>
|
||||
#include <LibWeb/Frame/EventHandler.h>
|
||||
#include <LibWeb/Loader/FrameLoader.h>
|
||||
#include <LibWeb/TreeNode.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
class Document;
|
||||
class PageView;
|
||||
|
||||
class Frame : public TreeNode<Frame> {
|
||||
public:
|
||||
static NonnullRefPtr<Frame> create_subframe(Element& host_element, Frame& main_frame) { return adopt(*new Frame(host_element, main_frame)); }
|
||||
|
@ -76,6 +74,9 @@ public:
|
|||
FrameLoader& loader() { return m_loader; }
|
||||
const FrameLoader& loader() const { return m_loader; }
|
||||
|
||||
EventHandler& event_handler() { return m_event_handler; }
|
||||
const EventHandler& event_handler() const { return m_event_handler; }
|
||||
|
||||
void scroll_to_anchor(const String&);
|
||||
|
||||
Frame& main_frame() { return m_main_frame; }
|
||||
|
@ -91,6 +92,7 @@ private:
|
|||
Frame& m_main_frame;
|
||||
|
||||
FrameLoader m_loader;
|
||||
EventHandler m_event_handler;
|
||||
|
||||
WeakPtr<Element> m_host_element;
|
||||
WeakPtr<PageView> m_page_view;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue