Skip to main content

adjust_anchor_for_user_select

Function adjust_anchor_for_user_select 

Source
pub(crate) fn adjust_anchor_for_user_select(
    no_gc: &NoGC,
    anchor_candidate: RootedSelectionBoundary,
) -> Option<(RootedSelectionBoundary, Option<DomRoot<Node>>)>
Expand description

Adjust the range boundary for the selection anchor (start of a drag gesture) based on user-select of the container node and of its ancestors.

Returns None if no new drag gesture should be started (user-select: none), or:

  • The new anchor container
  • The new anchor offset
  • The node with user-select: contain that the selection must not leave, if any