Expand description
Platform-agnostic drag-and-drop state, accept-mask matching, bounded LRU dropped-file
handle registry (max 256), and non-flickering ancestor enter/leave diffing.
Structs§
- Drag
Hover Transition - Pure enter/leave reconciliation plan for one Web
dragenter/dragoverstep. - Drag
Node Meta - Compact 1-byte mirrored per-node drag metadata stored in
WebEventState: - Drag
Payload Registry - Zero-overhead
TableSlot-indexed registry ofDragPayloadContributorhooks (32 B inline when empty; 1 branch and 0 heap allocations on the empty fast path). - Dropped
File Lru - Bounded monotonic-ID LRU registry (
max 256) holding sandboxed dropped file handles.
Constants§
- MAX_
DROPPED_ FILES - Hard cap on live sandboxed browser
Filehandles retained inDroppedFileLru. - NV_
INTERNAL_ DRAG_ MIME - Internal MIME token stamped onto
DataTransferduring in-app HTML5 drags.
Traits§
- Drag
Payload Contributor - Capability-module hook supplying a
DragPayloadon drag start for nodes carrying its table (consumers:Link,TextContent, custom draggable components).
Functions§
- build_
internal_ drag_ payload - Builds a canonical
DragPayloadfrom an internal draggable node’s(mime, data)pair, matchingskia-shell(text/uri-list->uris+text,text/*->text, custom MIME ->custombytes) uniformly acrossDragStart,DragEnter, andDrop. - data_
transfer_ matches_ accept - Synchronous
dragover/dragenter/dropaccept check against mirroredDragAcceptMask. - diff_
drag_ enter_ leave - Computes
(exited_bottom_up, entered_top_down)between previous and next drop-zone chains. Crossing into a child element inside the same drop zone leaves both slices empty (0 flicker). - drag_
enter_ leave_ metas - Builds separate
(leave_meta, enter_meta)headers for enter/leave reconciliation:DragLeavealways carriesDropEffect::None, whileDragEntercarriesresolved_effect. - drop_
effect_ web_ str - Canonical W3C
DataTransfer.dropEffectkeyword. - effect_
allowed_ web_ str - Canonical W3C
DataTransfer.effectAllowedkeyword for internal drags. - effective_
drop_ effect - Resolves the effective drop effect from the source’s allowed mask and the target’s preferred
effect (falling back to
Copy). - parse_
uri_ list - Parses an RFC 2483
text/uri-listpayload, skipping#comments and blank lines, capped atmax. - payload_
matches_ accept - Returns whether a
DragPayloadsatisfies a drop target’sDragAcceptMask. - plan_
drag_ hover_ transition - Resolves the effective drop effect and enter/leave diff for a
dragenter/dragoverevent. - resolve_
allowed_ drop_ effect - Aligns a drop zone’s preferred
requestedDropEffectagainst the browser’s activeDataTransfer.effectAllowedkeyword sodt.dropEffectis always permitted by the source. - resolve_
matched_ drop_ effect - Resolves the effective
DropEffectfor the innermost matched drop target (orDropEffect::Nonewhen no drop target matched or the drag source disallowed all effects).