Skip to content
  • Masayuki Nakano's avatar
    Bug 1461708 - part 3: EventStateManager::InitAndDispatchClickEvent() shouldn't... · 4bc3e930
    Masayuki Nakano authored
    Bug 1461708 - part 3: EventStateManager::InitAndDispatchClickEvent() shouldn't overwrite nsEventStatus with nsEventStatus_eIgnore r=smaug
    
    EventStateManager::InitAndDispatchClickEvent() sends given nsEventStatus to
    nsIPresShell::HandleEventWithTarget().  Then, it sends the status to
    EventStateManager::PreHandleEvent() before dispatching the event.  At this
    time, EventStateManager::PreHandleEvent() resets the state to
    nsEventStatus_eIgnore.  Therefore, for example, if eMouseClick event is
    consumed but eMouseAuxClick is ignored, the event status result is
    nsEventStatus_eIgnore.  So, neither DispatchClickEvents() nor
    PostMouseUpEventHandler() cannot check whether at least one click event
    is consumed.
    
    This patch makes EventStateManager::InitAndDispatchClickEvent() sends
    local variable of nsEventStatus to nsIPresShell::HandleEventWithTarget().
    Then, merge the result with current status.
    
    If we'd change nsEventStatus to enum class, we could make this change as
    custom "operator|=" or something.
    
    Differential Revision: https://phabricator.services.mozilla.com/D7850
    
    --HG--
    extra : moz-landing-system : lando
    4bc3e930