| Summary: | document.querySelector doesn't work for xml documents | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | annevk, bburg, cdumez, hi, koivisto, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
This appears to work fine: data:text/xml,<note><script%20xmlns="http://www.w3.org/1999/xhtml">alert(document.querySelector("note"))</script></note> |
This is causing the WebDriver test imported/w3c/webdriver/tests/is_element_enabled/enabled.py::test_xml_always_not_enabled to fail, but because we fail to find the node first. > element = session.find.css("note", all=False) E NoSuchElementException: no such element (404): body = {'using': 'css selector', 'value': 'note'} err = <NoSuchElementException http_status=404> method = 'POST' response = <Response status=404 error=<NoSuchElementException http_status=404>> self = <Session 2d4c898d-9ba1-40e7-867c-3c99b339dcdb> url = 'session/2d4c898d-9ba1-40e7-867c-3c99b339dcdb/element' This is because document.querySelector('note') is returning null. The document is just: <?xml version="1.0" encoding="utf-8"?> <note></note> Saving that to a file and opening it in both ff and chrome, I can get the valid node by calling document.querySelector('note') from the inspector console.