Bug 168120 - REGRESSION(r188138): Web Inspector: cannot edit next/previous DOM attribute by using tab/shift-tab
Summary: REGRESSION(r188138): Web Inspector: cannot edit next/previous DOM attribute b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-02-10 09:42 PST by Brian Burg
Modified: 2017-02-13 11:16 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.54 KB, patch)
2017-02-11 01:58 PST, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2017-02-10 09:42:21 PST
This is definitely a regression. It used to be possible to tab through attributes, which would cancel the current edit and start editing the next attribute.

Steps to reproduce:

1. Inspect an element with >1 attribute in Elements Tab
2. Press 'Enter' to start editing the first attribute
3. Press 'Tab' to cancel editing of first attribute and start editing next attribute
=> DOMTreeOutline loses selection, sometimes the Quick Console gets caret/focus
Comment 1 Radar WebKit Bug Importer 2017-02-10 09:42:42 PST
<rdar://problem/30466065>
Comment 2 Matt Baker 2017-02-11 01:50:00 PST
Regressed way back in https://trac.webkit.org/changeset/188138.

Tabbing to the next attribute *does* work, as long as the current attribute text changes:

--- a/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
+++ b/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
@@ -874,6 +875,9 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
 
     _attributeEditingCommitted(element, newText, oldText, attributeName, moveDirection)
     {
+        if (newText === oldText)
+            return;
+
         this._editing = false;
 
         var treeOutline = this.treeOutline;
Comment 3 Matt Baker 2017-02-11 01:58:05 PST
Created attachment 301249 [details]
Patch
Comment 4 Joseph Pecoraro 2017-02-12 22:27:38 PST
Comment on attachment 301249 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=301249&action=review

> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:963
> +        if (!moveDirection && newText === oldText)

What about all of the other functions with moveDirection? _tagNameEditingCommitted and _attributeNumberEditingCommitted?
Comment 5 Matt Baker 2017-02-13 00:44:11 PST
Comment on attachment 301249 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=301249&action=review

>> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:963
>> +        if (!moveDirection && newText === oldText)
> 
> What about all of the other functions with moveDirection? _tagNameEditingCommitted and _attributeNumberEditingCommitted?

I didn't notice these. However, it looks like _tagNameEditingCommitted handles moveDirection in `cancel()`, and _attributeNumberEditingCommitted ignores the parameter.
Comment 6 WebKit Commit Bot 2017-02-13 11:16:23 PST
Comment on attachment 301249 [details]
Patch

Clearing flags on attachment: 301249

Committed r212236: <http://trac.webkit.org/changeset/212236>
Comment 7 WebKit Commit Bot 2017-02-13 11:16:27 PST
All reviewed patches have been landed.  Closing bug.