[Webkit-unassigned] [Bug 218383] WebDriver: do not focus the main frame when switching to a window
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Nov 5 01:02:27 PST 2020
https://bugs.webkit.org/show_bug.cgi?id=218383
--- Comment #8 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Sam Sneddon [:gsnedders] from comment #6)
> (In reply to James Graham from comment #3)
> > So. We recently refactored the spec here and afaict per the current text,
> > switch to window does reset the frame; it calls [1] which unconditionally
> > sets the current browsing context.
> >
> > But I can't tell you if that's actually the correct behaviour here; if it
> > doesn't match browsers we should possibly change it to be a no-op if the
> > window doesn't change (the refactor was intended to ensure we didn't fail
> > commands in lots of cases where a frame was closed and the top level context
> > was still open).
> >
> > The infra test could well be wrong.
> >
> > [1]
> > https://w3c.github.io/webdriver/#dfn-set-the-current-top-level-browsing-
> > context
>
> As I read the spec, changing the current window changes the "current
> browsing context" (and more obviously the "current top-level browsing
> context"), and send keys should fail to send keys to an element within a
> frame as it looks up the element by id within the "current browsing
> context", and the element shouldn't exist within the top-level browsing
> context, only its child. So per spec send keys should fail due to not
> finding the element?
It's not send keys command, but an action sequence. Two action sequences actually, on to click on the input element and another one to send "PASS" to the input filed. Keyboard actions don't have an element as target, they are equivalent to press/release they keys, so the current focused element will handle them. In this case, the window we are switching to is the one containing the iframe, so there isn't a toplevel browsing context change in the end.
test_driver.set_test_context(parent);
await new test_driver.Actions()
.pointerMove(0, 0, {origin: input})
.pointerDown()
.pointerUp()
.send();
await new test_driver.Actions()
.keyDown("P")
.keyUp("P")
.keyDown("A")
.keyUp("A")
.keyDown("S")
.keyUp("S")
.keyDown("S")
.keyUp("S")
.send();
if (input.value === "PASS") {
test_driver.message_test("PASS", "*")
} else {
test_driver.message_test("FAIL", "*")
}
For some reason between the first action sequence and the second there's a window switch.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201105/7d93d1b1/attachment.htm>
More information about the webkit-unassigned
mailing list