Skip to content

Should HTMLDocument nodes be serialized as web element reference? #1687

@whimboo

Description

@whimboo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions