Changeset 100246 in webkit
- Timestamp:
- Nov 15, 2011 12:08:59 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100245 r100246 1 2011-11-14 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: Command line $x fails for 3 of 4 types of XPath query 4 https://bugs.webkit.org/show_bug.cgi?id=72276 5 6 Reviewed by Timothy Hatcher. 7 8 * inspector/console/console-xpath-expected.txt: Added. 9 * inspector/console/console-xpath.html: Added. 10 1 11 2011-11-14 Peter Kasting <pkasting@google.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r100243 r100246 1 2011-11-14 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: Command line $x fails for 3 of 4 types of XPath query 4 https://bugs.webkit.org/show_bug.cgi?id=72276 5 6 Reviewed by Timothy Hatcher. 7 8 Test: inspector/console/console-xpath.html 9 10 * inspector/InjectedScriptSource.js: 11 (.): 12 1 13 2011-11-14 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r100113 r100246 593 593 $x: function(xpath, context) 594 594 { 595 var nodes = []; 596 try { 597 var doc = (context && context.ownerDocument) || inspectedWindow.document; 598 var results = doc.evaluate(xpath, context || doc, null, XPathResult.ANY_TYPE, null); 595 var doc = (context && context.ownerDocument) || inspectedWindow.document; 596 var result = doc.evaluate(xpath, context || doc, null, XPathResult.ANY_TYPE, null); 597 switch (result.resultType) { 598 case XPathResult.NUMBER_TYPE: 599 return result.numberValue; 600 case XPathResult.STRING_TYPE: 601 return result.stringValue; 602 case XPathResult.BOOLEAN_TYPE: 603 return result.booleanValue; 604 default: 605 var nodes = []; 599 606 var node; 600 while (node = result s.iterateNext())607 while (node = result.iterateNext()) 601 608 nodes.push(node); 602 } catch (e) { 603 } 604 return nodes; 609 return nodes; 610 } 605 611 }, 606 612
Note: See TracChangeset
for help on using the changeset viewer.