[Webkit-unassigned] [Bug 119727] New: Do not dispatch 'focus' or 'blur' event twice when window active state is changed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 12 21:11:17 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=119727

           Summary: Do not dispatch 'focus' or 'blur' event twice when
                    window active state is changed
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Keywords: BlinkMergeCandidate
          Severity: Normal
          Priority: P2
         Component: Event Handling
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rniwa at webkit.org
                CC: darin at apple.com, ap at webkit.org, tkent at chromium.org,
                    benjamin at webkit.org


* Bug
On Windows, 'focus' event for the window object or a focused element is
dispatched twice when the browser tab gets active, and 'blue' evnet is
dispatched twice when the browser tab gets inactive.
On OSX, 'blur' evnet is dispatched twice when the browser tab gets inactive.
On Android, we don't have this bug.

* Root cause
Focus/blue event is dispatched in dispatchEventsOnWindowAndFocusedNode
in these cases. FocusController::setFocused(bool) calls it, and
FocusController::setActive(bool) also calls it if setFocused(true) was
already called.

On Windows, these functions are called in the following sequence:
  Activation:
    WebView::setFocus(true)
      FocusController::setFocused(true)
      FocusController::setActive(true)
    WebView::setIsActive(true)
  Inactivation:
    WebView::setIsActive(false)
      FocusController::setActive(false)
    WebView::setFocus(false)
      FocusController::setFocused(false)

On OSX, these functions are called in the following sequence:
  Activation:
    WebView::setIsActive(true)
      FocusController::setActive(true)
    WebView::setFocus(true)
      FocusController::setFocused(true)
      FocusController::setActive(true)
  Inactivation:
    WebView::setIsActive(false)
      FocusController::setActive(false)
    WebView::setFocus(false)
      FocusController::setFocused(false);

On Android, these functions are called in the following sequence:
  Activation:
    WebView::setFocus(true)
      FocusController::setFocused(true)
      FocusController::setActive(true)
  Inactivation:
    WebView::setFocus(false)
      FocusController::setFocused(false);

* Fix
We don't need to call dispatchEventsOnWindowAndFocusedNode in
setActive() because we don't make a window focused state true when the
window is inactive.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list