Bug 30665 - REGRESSION: Web Inspector: blur and focus Events are Fired Too Often
Summary: REGRESSION: Web Inspector: blur and focus Events are Fired Too Often
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-22 00:20 PDT by Joseph Pecoraro
Modified: 2014-12-15 23:39 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-10-22 00:20:46 PDT
Blur and Focus events are not acting as expected.  This has caused a regression with tabbing while editing Element attributes.  The following are cases I've found where the events are fired too frequently.  All are in inspector.js:

WebInspector.windowFocused:
- Fired multiple times on focusing the Inspector
- http://grab.by/bdt (notice the unexpected event.targets)

WebInspector.windowBlured
- Fired multiple times on blurring the Inspector
- http://grab.by/bdt (notice the unexpected event.targets)

Blur event listener on element in WebInspector.startEditing:
- This is a Regression
- Fired when blurring the first element and then again immediately on the moved too element
Comment 1 Joseph Pecoraro 2009-10-22 00:28:13 PDT
The first two are registered as follows:

  X.addEventListener("focus", this.windowFocused.bind(this), true);
  X.addEventListener("blur", this.windowBlured.bind(this), true);

By changing the "bubbling" boolean to false these events fire only when expected and with the expected target (document.defaultView).  However, I looked at the spec to try and understand the behavior when this attribute was true and I came across the following:
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-types-list

> All events must accomplish the capture and target phases,
> but not all of them must accomplish the bubbling phase"

In the table, the Spec shows "blur" and "focus" events do not accomplish the bubbling phase. What then is the behavior I am seeing when the listeners are registered as non-capturing?  The WebInspector.startEditing event listener does use "false" in its declaration.  Based on the Spec is this valid?

As for the regression, I do not know what caused that.  Does anyone have a setup where doing a binary search through the history to narrow down a revision would not take all day?! =)
Comment 2 Joseph Pecoraro 2009-10-22 00:29:40 PDT
> By changing the "bubbling" boolean to false

Correction: this is the "useCapture" boolean.
Comment 3 Rob Colburn 2012-05-10 13:59:11 PDT
This is an old bug. @Joseph, what's the status, are you still experiencing the issue?