Closed Bug 1690884 Opened 4 years ago Closed 2 years ago

Implement Shadow DOM support for actions

Categories

(Remote Protocol :: Marionette, task, P3)

task

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: sefeng, Unassigned)

References

(Blocks 1 open bug)

Details

Doing an action like actions.pointerMove(1, 1, { origin: ShadowDOMElement }) would make the origin becomes <HTML>. The cause is that we don't have Shadow DOM support for actions.

Recently we have the Shadow DOM spec added, so we should have it implemented! :)

No longer blocks: 1686182
Depends on: 1686182

Basic support for Shadow DOM will be implemented via bug 1686182. Once done we can see how it works for actions.

Priority: -- → P3
No longer depends on: 1686182

Lets wait until the basic commands have been implemented, and which is tracked via bug 1686180.

Blocks: 1686180
Depends on: 1700073, 1700095
No longer depends on: 1743541

(In reply to Sean Feng [:sefeng] from comment #0)

Doing an action like actions.pointerMove(1, 1, { origin: ShadowDOMElement }) would make the origin becomes <HTML>. The cause is that we don't have Shadow DOM support for actions.

I just investigated remaining work that we have to do for ShadowDOM support in Marionette. And this bug is a bit unclear to me. What exactly are you trying to pass-in as origin? Should that be a ShadowRoot or an Element within a Shadow DOM? I assume it will be the latter? In such a case our actions implementation in Marionette works as is with these elements. Here a Marionette testcase:

    def test_shadow_dom(self):
        page = inline("""
        <custom-input-element id="input"></custom-input-element>
        <script>
            customElements.define('custom-input-element',
                class extends HTMLElement {
                    constructor() {
                            super();
                            this.attachShadow({mode: 'open'}).innerHTML = `
                                <div><input type="text"/></div>
                            `;
                        }
                });
        </script>""")
        self.marionette.navigate(page)
        container = self.marionette.find_element(By.ID, "input")
        shadow = container.shadow_root

        input = self.marionette.execute_script("""
            const shadow_root = arguments[0];
            const elem = shadow_root.querySelector("input");
            return elem
        """, script_args=(shadow,))

        input.click()

        sequence = ActionSequence(self.marionette, "key", "3")
        sequence.key_down("a") \
            .key_up("a") \
            .perform()
        self.assertEqual(input.get_property("value"), "a")

The only thing that is needed for the Marionette client specifically is bug 1806640. But I'm also not sure which client you were actually using here.

Sean, maybe you could give us some details in case you can still remember? Thanks a lot.

Flags: needinfo?(sefeng)
No longer depends on: 1445227

I honestly can't remember the detail...

I think we can just close this bug and I can reopen if I encounter this again in the future.

Flags: needinfo?(sefeng)

Sounds good. Note that in the next 3 months we will focus on getting proper Shadow DOM support into Marionette and WebDriver BiDi. So if something comes up during that time feel free to contact us as well on Element in the #webdriver channel.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.