Bug 130290

Summary: Web Inspector: AXI: crash when inspecting "bar" text node in getAccessibilityPropertiesForNode layout test
Product: WebKit Reporter: James Craig <jcraig>
Component: Web InspectorAssignee: James Craig <jcraig>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dpino, graouts, jcraig, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch none

Description James Craig 2014-03-14 23:07:12 PDT
Web Inspector: AXI: crash when inspecting " bar " text node in getAccessibilityPropertiesForNode layout test.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ???                           	000000000000000000 0 + 0
1   com.apple.WebCore             	0x000000011310e86b WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties(WebCore::Node*) + 731
2   com.apple.WebCore             	0x000000011310f60c non-virtual thunk to WebCore::InspectorDOMAgent::getAccessibilityPropertiesForNode(WTF::String*, int, WTF::RefPtr<Inspector::TypeBuilder::DOM::AccessibilityProperties>&) + 44
3   com.apple.WebCore             	0x00000001131580a5 Inspector::InspectorDOMBackendDispatcher::getAccessibilityPropertiesForNode(long, Inspector::InspectorObject const&) + 357
4   com.apple.WebCore             	0x0000000113155d8f Inspector::InspectorDOMBackendDispatcher::dispatch(long, WTF::String const&, WTF::PassRefPtr<Inspector::InspectorObject>) + 367
Comment 1 Radar WebKit Bug Importer 2014-03-14 23:07:31 PDT
<rdar://problem/16334441>
Comment 2 James Craig 2014-03-26 01:38:45 PDT
Looks like this was a regression from bug 129779. toElement was being called on non-element nodes including text nodes and document nodes. A simple conditional using node->isElementNode() seems to resolve the issue. Patch coming shortly.
Comment 3 James Craig 2014-03-26 02:38:31 PDT
Created attachment 227840 [details]
patch

The WebCore fix is straightforward. The layout test result diff is obvious, but the layout test source diff is a little large. Among other things I had to rearrange things to reuse the logger on the non-element #document node which was previously specified in a element-only loop.
Comment 4 WebKit Commit Bot 2014-03-26 08:18:57 PDT
Comment on attachment 227840 [details]
patch

Clearing flags on attachment: 227840

Committed r166295: <http://trac.webkit.org/changeset/166295>
Comment 5 WebKit Commit Bot 2014-03-26 08:19:00 PDT
All reviewed patches have been landed.  Closing bug.