RESOLVED CONFIGURATION CHANGED205923
document.querySelector doesn't work for xml documents
https://bugs.webkit.org/show_bug.cgi?id=205923
Summary document.querySelector doesn't work for xml documents
Carlos Garcia Campos
Reported 2020-01-08 06:03:39 PST
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.
Attachments
Radar WebKit Bug Importer
Comment 1 2020-01-08 10:46:30 PST
Anne van Kesteren
Comment 2 2023-12-29 03:38:11 PST
This appears to work fine: data:text/xml,<note><script%20xmlns="http://www.w3.org/1999/xhtml">alert(document.querySelector("note"))</script></note>
Note You need to log in before you can comment on or make changes to this bug.