Bug 129779 - Web Inspector: AXI: Expose focused/focusable state in the Accessibility Node Inspector
Summary: Web Inspector: AXI: Expose focused/focusable state in the Accessibility Node ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Diego Pino
URL:
Keywords: InRadar
Depends on: 129781 130037
Blocks: 130196 129952
  Show dependency treegraph
 
Reported: 2014-03-05 21:59 PST by James Craig
Modified: 2014-03-13 18:58 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.80 KB, patch)
2014-03-07 04:11 PST, Diego Pino
no flags Details | Formatted Diff | Diff
Patch (13.27 KB, patch)
2014-03-12 02:26 PDT, Diego Pino
no flags Details | Formatted Diff | Diff
Patch (13.30 KB, patch)
2014-03-12 03:43 PDT, Diego Pino
no flags Details | Formatted Diff | Diff
Patch (13.46 KB, patch)
2014-03-13 08:12 PDT, Diego Pino
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Craig 2014-03-05 21:59:09 PST
Web Inspector: AXI: Expose focused/focusable state in the Accessibility Node Inspector
Comment 1 James Craig 2014-03-05 22:05:03 PST
<rdar://problem/16245334>
Comment 2 Diego Pino 2014-03-07 04:11:40 PST
Created attachment 226113 [details]
Patch
Comment 3 James Craig 2014-03-07 15:32:07 PST
If a bug is already assigned, please contact the assignee before taking it for a patch. I hadn't done any work on this yet, but we could have duplicated efforts. Reassigning this one to you for the time being. 

R- because the utility needed here is whether an element is focusable, not just focused. You'll want to add a "supportsFocus(ed)" or "focusable" bool in InspectorDOMAgent.cpp that gets assigned if the element is focusable, and only assign send back the focused value if it's focusable. Then use the booleanValueToLocalizedStringIfPropertyDefined("focused") helper function (coming in patch for bug 129781) and display either value in the client as long as it's not undefined. Note: there may be some merge conflicts with bug 129781, too. Hopefully that doesn't slow you down too much. Thanks for starting on this, just let me know next time if it's already assigned.

Please update the Layout Test, too: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
Comment 4 James Craig 2014-03-07 15:35:26 PST
I'm getting site errors when attempting to r- and cq-. This is just a note to reviewers to not r+ this one yet.
Comment 5 Joseph Pecoraro 2014-03-10 21:54:18 PDT
Comment on attachment 226113 [details]
Patch

r- based on James Craig's comments.
Comment 6 Diego Pino 2014-03-11 05:25:03 PDT
(In reply to comment #3)
> If a bug is already assigned, please contact the assignee before taking it for a patch. I hadn't done any work on this yet, but we could have duplicated efforts. Reassigning this one to you for the time being. 
> 

Sorry, I didn't realise it was assigned. Completely agree with your point of view.

> R- because the utility needed here is whether an element is focusable, not just focused. You'll want to add a "supportsFocus(ed)" or "focusable" bool in InspectorDOMAgent.cpp that gets assigned if the element is focusable, and only assign send back the focused value if it's focusable. Then use the booleanValueToLocalizedStringIfPropertyDefined("focused") helper function (coming in patch for bug 129781) and display either value in the client as long as it's not undefined. Note: there may be some merge conflicts with bug 129781, too. Hopefully that doesn't slow you down too much. Thanks for starting on this, just let me know next time if it's already assigned.

OK, I'll redo the patch according to those instructions. Thanks for the explanation.

> 
> Please update the Layout Test, too: inspector-protocol/dom/getAccessibilityPropertiesForNode.html

OK.
Comment 7 Diego Pino 2014-03-12 02:26:02 PDT
Created attachment 226486 [details]
Patch
Comment 8 James Craig 2014-03-12 03:19:46 PDT
Comment on attachment 226486 [details]
Patch

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

The rest looks okay to me.

> Source/WebCore/inspector/protocol/DOM.json:66
> +                { "name": "focused", "type": "boolean", "optional": true, "description": "Focused state." },

"Focused state. Only defined on focusable elements."
Comment 9 Diego Pino 2014-03-12 03:43:38 PDT
Created attachment 226491 [details]
Patch
Comment 10 Joseph Pecoraro 2014-03-12 10:47:58 PDT
Comment on attachment 226491 [details]
Patch

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

> LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:91
>      exists: true
>      label: 
>      role: 
> +    focused: false
>      ignored: true
>      ignoredByDefault: true
>      hidden: true

The tests all have focused: false. Would be nice to include a test where focused is true. Would it be sufficient to just do inputElement.focus() in the test?

r=me
Comment 11 Joseph Pecoraro 2014-03-12 10:48:34 PDT
Let me know if you need me to cq+
Comment 12 James Craig 2014-03-12 11:15:33 PDT
Comment on attachment 226491 [details]
Patch

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

>> LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:91
>>      hidden: true
> 
> The tests all have focused: false. Would be nice to include a test where focused is true. Would it be sufficient to just do inputElement.focus() in the test?
> 
> r=me

That'd be good, but I don't know if it's necessary for this one. I think we'll want a second test (in a later bug, not this one) to test all the iterations of focused/focusable on various elements.
Comment 13 Diego Pino 2014-03-12 12:46:39 PDT
(In reply to comment #11)
> Let me know if you need me to cq+

Yes please :)
Comment 14 James Craig 2014-03-13 02:01:48 PDT
Just an FYI that you'll need to post another conflict resolution due to the patch for bug 130037. Normally this would not have been a problem, but the commit bot has been down this week.
Comment 15 Diego Pino 2014-03-13 08:12:16 PDT
Created attachment 226593 [details]
Patch
Comment 16 WebKit Commit Bot 2014-03-13 18:58:32 PDT
Comment on attachment 226593 [details]
Patch

Clearing flags on attachment: 226593

Committed r165590: <http://trac.webkit.org/changeset/165590>
Comment 17 WebKit Commit Bot 2014-03-13 18:58:36 PDT
All reviewed patches have been landed.  Closing bug.