Bug 30429

Summary: Web Inspector: [REGRESSION] Tabbing Through Element Attributes Loses Focus Immediately
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Severity: Normal CC: aroben, bweinstein, joepeck, pfeldman, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Proposed Patch pfeldman: review+

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>