Commit Graph

2 Commits

Author SHA1 Message Date
Timothy Flynn
d14a26b9e7 LibWeb: Make the drag data store reference counted
Ownership of the drag data store is a bit weird. In a normal drag-and-
drop operation, the DragAndDropEventHandler owns the store. When events
are fired for the operation, the DataTransfer object assigned to those
events are "associated" with the store. We currently represent that with
an Optional<DragDataStore&>.

However, it's also possible to create DataTransfer objects from scripts.
Those objects create their own drag data store. This puts DataTransfer
in a weird situation where it may own a store or just reference one.

Rather than coming up with something like Variant<DDS, DDS&> or using
MaybeOwned<DDS> here, we can get by with just making the store reference
counted.

(cherry picked from commit f7c4165dde9cc1f3c84fbc49c8496dea3a898491)
2024-11-01 22:04:14 -04:00
Timothy Flynn
cfd1c66552 LibWeb: Begin implementing the drag data store
(cherry picked from commit 9e98e63559ebaaf50e7260c62ea750869bb3613d)
2024-11-01 19:58:08 -04:00