Bug 130037

Summary: Web Inspector: Feature check for accessibility support before using it (DOMAgent.getAccessibilityPropertiesForNode)
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, jcraig, joepeck, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 129779, 129943, 129952    
Attachments:
Description Flags
[PATCH] Proposed Fix timothy: review+

Description Joseph Pecoraro 2014-03-10 14:05:16 PDT
DOMAgent.getAccessibilityPropertiesForNode won't exist on iOS 6 and 7 remote inspector backends. It looks like our frontend will add UI and unconditionally ask for accessibility information. This will throw an exception inspecting an iOS 6 or iOS 7 device and cause issues.

I think Views/DOMNodeDetailsSidebarPanel.js should add an "_accessibilitySupported() { return !!DOMAgent.getAccessibilityPropertiesForNode; }" function, and only add the UI / refresh accessibility when it is supported.
Comment 1 Joseph Pecoraro 2014-03-12 17:07:39 PDT
Yep:

Inspecting an iOS 6 device with ToT I see:
[Error] TypeError: undefined is not a function (evaluating 'DOMAgent.getAccessibilityPropertiesForNode(this.id, accessibilityPropertiesCallback.bind(this))')
	accessibilityProperties (DOMNode.js, line 467)
	refreshAX (DOMNodeDetailsSidebarPanel.js, line 377)
	refresh (DOMNodeDetailsSidebarPanel.js, line 101)
	shown (DetailsSidebarPanel.js, line 60)
	selectedSidebarPanel (Sidebar.js, line 148)
	_contentBrowserRepresentedObjectsDidChange (Main.js, line 1124)
	dispatch (Object.js, line 180)
	dispatchEventToListeners (Object.js, line 187)
	_dispatchCurrentRepresentedObjectsDidChangeEvent (ContentBrowser.js, line 461)
	(anonymous function) ([native code], line 0)
Comment 2 Joseph Pecoraro 2014-03-12 17:09:44 PDT
Created attachment 226561 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2014-03-12 17:35:59 PDT
<http://trac.webkit.org/changeset/165517>