Bug 29357 - Web Inspector: Errors When Displaying XPathResult Information
Summary: Web Inspector: Errors When Displaying XPathResult Information
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL: http://www.google.com
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-09-17 20:12 PDT by Joseph Pecoraro
Modified: 2016-12-13 15:38 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-09-17 20:12:34 PDT
Steps to Reproduce:
1. Evaluate the following in the Console of the Inspector on any web  page:
document.evaluate("//*", document, null, XPathResult.ANY_TYPE, null);
2. Attempt to Expand the Object Tree that appears in the Console.

Expected Results:
I'd like to see the properties of the XPathResult. The following was generated using keys():
["resultType", "stringValue", "booleanValue", ... ]

Actual Results:
- A log message (not an error message) saying "Error dispatching: getProperties"
- A blank error message shows up in the inspector's inspector

Further Issues:
- works => keys( document.evaluate(...) ); 
- doesn't work -> values( document.evaluate(...) );
- trying to access "snapshotLength" or "snapshotItem" and probably other values results in a DOM Exception.  Are there problems with XPath in general?
Comment 1 Alexey Proskuryakov 2009-09-18 11:48:35 PDT
> - trying to access "snapshotLength" or "snapshotItem" and probably other values
> results in a DOM Exception.  Are there problems with XPath in general?

XPathResult.ANY_TYPE gives an UNORDERED_NODE_ITERATOR_TYPE result, so snapshot-related accessors can't work. You need to pass a desired result type explicitly for them to work.

This change doesn't make visual inspection work though - I guess custom code will need to be written for presenting XPathResult.
Comment 2 Radar WebKit Bug Importer 2014-12-17 11:23:02 PST
<rdar://problem/19281526>