Bug 30429 - Web Inspector: [REGRESSION] Tabbing Through Element Attributes Loses Focus Immediately
Summary: Web Inspector: [REGRESSION] Tabbing Through Element Attributes Loses Focus Im...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
Depends on:
Reported: 2009-10-15 22:07 PDT by Joseph Pecoraro
Modified: 2009-10-29 14:59 PDT (History)
6 users (show)

See Also:

Proposed Patch (2.80 KB, patch)
2009-10-29 12:27 PDT, Timothy Hatcher
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-10-15 22:07:35 PDT
This is bizarre. When tabbing to create a new element it loses focus immediately. I don't know when this regression happened I haven't looked into the past.

Stepping through the code the following happens:
Start editing an attribute and push tab:
1. It properly adds a new attribute or starts editing the next attribute
2. It seems to set the focus on the new node
3. It properly sets the selection in the new node
4. The moment it returns from the blur event listener in WebInspector.startEditing() the focus on the new node disappears.

I haven't seen anything like this. Any ideas?
Comment 1 Timothy Hatcher 2009-10-29 11:02:22 PDT
This happens because commiting an attribute edit causes a delayed callback to happen (WebInspector.DOMAgent.prototype._didApplyDomChange) which then calls _updateTitle on the ElementsTreeElement that changed, which sets innerHTML, which fires a blur event, and that cancels the edit for the next attribute.
Comment 2 Timothy Hatcher 2009-10-29 12:23:05 PDT
I have a fix.
Comment 3 Timothy Hatcher 2009-10-29 12:27:05 PDT
Created attachment 42125 [details]
Proposed Patch
Comment 4 Timothy Hatcher 2009-10-29 14:59:59 PDT
Committed r50303: <http://trac.webkit.org/changeset/50303>