mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Ensure EventHandler visits its mouse selection target
We hold a raw pointer to the mouse selection target, which is a mixin- style class inherited only by JS::Cell classes. By not visiting this object, we sometime had a dangling reference to it after it had been garbage collected.
This commit is contained in:
parent
18a160e0e9
commit
d5be18617e
Notes:
github-actions[bot]
2025-02-27 09:54:17 +00:00
Author: https://github.com/trflynn89
Commit: d5be18617e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3713
Reviewed-by: https://github.com/AtkinsSJ ✅
7 changed files with 56 additions and 2 deletions
|
@ -14,7 +14,8 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
class EditingHostManager : public JS::Cell
|
||||
class EditingHostManager
|
||||
: public JS::Cell
|
||||
, public InputEventsTarget {
|
||||
GC_CELL(EditingHostManager, JS::Cell);
|
||||
GC_DECLARE_ALLOCATOR(EditingHostManager);
|
||||
|
@ -45,6 +46,8 @@ public:
|
|||
private:
|
||||
EditingHostManager(GC::Ref<Document>);
|
||||
|
||||
virtual GC::Ref<JS::Cell> as_cell() override { return *this; }
|
||||
|
||||
GC::Ref<Document> m_document;
|
||||
GC::Ptr<DOM::Node> m_active_contenteditable_element;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue