-
Notifications
You must be signed in to change notification settings - Fork 222
Should HTMLDocument nodes be serialized as web element reference? #1687
Description
Right now the WebDriver specification creates a web element reference in JSON clone when the value is of instance Element, which basically maps to Element nodes in the HTML spec.
But when you check the Node interface you can see that Element nodes have a type of 1 and Document nodes a type of 9. That means that HTMLDocument nodes are not Elements for WebDriver and as such shouldn't be serialized as such.
But recently when investigating a test failure in Firefox I noticed that Chrome is actually passing this test and returns the HTMLDocument as web element reference. This is against the WebDriver specification.
The question is now if Chrome should fix that broken behavior (not sure if this could cause regressions for existing tests) or if we should allow the serialization of HTMLDocument. Maybe the WebDriver BiDi specification could benefit from that as well?
CC'ing @sadym-chromium and @jgraham for now, and I'll put it onto our monthly WebDriver agenda for this week.