Bug 130037 - Web Inspector: Feature check for accessibility support before using it (DOMAgent.getAccessibilityPropertiesForNode)
Summary: Web Inspector: Feature check for accessibility support before using it (DOMAg...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
Depends on:
Blocks: 129779 129943 129952
  Show dependency treegraph
Reported: 2014-03-10 14:05 PDT by Joseph Pecoraro
Modified: 2014-03-13 02:05 PDT (History)
5 users (show)

See Also:

[PATCH] Proposed Fix (7.74 KB, patch)
2014-03-12 17:09 PDT, Joseph Pecoraro
timothy: 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 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

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