Skip to content
  • rniwa@webkit.org's avatar
    Shift clicking on an element with -webkit-user-select: all doesn't extend selection · 9e76e369
    rniwa@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=113270
    
    Reviewed by Enrica Casucci.
    
    Source/WebCore:
    
    The bug was caused by updateSelectionForMouseDownDispatchingSelectStart always replacing selection whenever
    the target node was inside an element with -webkit-suer-select even when we were attemping to extend selection
    in handleMousePressEventSingleClick.
    
    Fixed the bug by extracting this logic as a separate function (expandSelectionToRespectUserSelectAll) and deploying
    it in handleMousePressEventSingleClick to extend selection as needed.
    
    Test: editing/selection/user-select-all-with-shift.html
    
    * page/EventHandler.cpp:
    (WebCore::expandSelectionToRespectUserSelectAll): Extracted from updateSelectionForMouseDownDispatchingSelectStart.
    (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
    (WebCore::EventHandler::selectClosestWordFromHitTestResult):
    (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
    ...
    9e76e369