Marionette interaction commands uses incorrect focussing and unfocussing steps

RESOLVED FIXED in Firefox 59

Status

enhancement
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: ato, Assigned: ato)

Tracking

(Blocks 1 bug)

Version 3
mozilla60
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox59 fixed, firefox60 fixed)

Details

Attachments

(8 attachments)

(Assignee)

Description

a year ago
Marionette fires custom events from event.focus and event.blur,
but doesn’t actually focus or unfocus the element.  We can rely
on HTMLElement.focus() and HTMLElement.blur() for these operations,
which will do the right thing and fire the correct DOM events.

A sidenote is that the unfocussing steps especially are difficult
to get right without HTMLElement.blur() as there are certain ranges
of elements where HTMLElement.focus() will not work for.  Also,
Gecko does not support its .focus({preventScroll: true}) option.
(Assignee)

Updated

a year ago
Assignee: nobody → ato
Blocks: webdriver
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 11

a year ago
mozreview-review
Comment on attachment 8945190 [details]
Bug 1432864 - Unfocussing steps will target <body> element.

https://reviewboard.mozilla.org/r/215426/#review221062

::: commit-message-6c860:1
(Diff revision 1)
> +Bug 1432864 - Unfocussing steps will target the <bdoy> element. r?automatedtester

body?
Attachment #8945190 - Flags: review?(dburns) → review+

Comment 12

a year ago
mozreview-review
Comment on attachment 8945164 [details]
Bug 1432864 - Decouple focussing from moving caret in textual form controls.

https://reviewboard.mozilla.org/r/215404/#review221078
Attachment #8945164 - Flags: review?(dburns) → review+

Comment 13

a year ago
mozreview-review
Comment on attachment 8945165 [details]
Bug 1432864 - Run native focussing steps on interaction commands.

https://reviewboard.mozilla.org/r/215406/#review221080
Attachment #8945165 - Flags: review?(dburns) → review+

Comment 14

a year ago
mozreview-review
Comment on attachment 8945166 [details]
Bug 1432864 - Run unfocussing steps after interaction.

https://reviewboard.mozilla.org/r/215408/#review221082
Attachment #8945166 - Flags: review?(dburns) → review+
Comment hidden (mozreview-request)
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s 91bf7dacb5a358e62b9f0e2d2a9e835de5bee32a -d 9218e87c25fb: rebasing 443945:91bf7dacb5a3 "Bug 1432864 - Decouple focussing from moving caret in textual form controls. r=automatedtester"
merging testing/marionette/interaction.js
rebasing 443946:58366e1c36c0 "Bug 1432864 - Run native focussing steps on interaction commands. r=automatedtester"
merging testing/marionette/interaction.js
merging testing/web-platform/tests/webdriver/tests/interaction/element_clear.py
warning: conflicts while merging testing/marionette/interaction.js! (edit, then use 'hg resolve --mark')
warning: conflicts while merging testing/web-platform/tests/webdriver/tests/interaction/element_clear.py! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s b3c36dffa03c93e14cba7c108f090cfd4c6a5641 -d 9218e87c25fb: rebasing 443949:b3c36dffa03c "Bug 1432864 - Decouple focussing from moving caret in textual form controls. r=automatedtester"
merging testing/marionette/interaction.js
rebasing 443950:94eb6d3a5b33 "Bug 1432864 - Run native focussing steps on interaction commands. r=automatedtester"
merging testing/marionette/interaction.js
merging testing/web-platform/tests/webdriver/tests/interaction/element_clear.py
warning: conflicts while merging testing/marionette/interaction.js! (edit, then use 'hg resolve --mark')
warning: conflicts while merging testing/web-platform/tests/webdriver/tests/interaction/element_clear.py! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 26

a year ago
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8f2ff0bdb474
Decouple focussing from moving caret in textual form controls. r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/00bab9cabf56
Run native focussing steps on interaction commands. r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/ea20d86a27d4
Run unfocussing steps after interaction. r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/d43aafb30632
Unfocussing steps will target <body> element. r=automatedtester
(Assignee)

Updated

a year ago
Blocks: 1433422
No longer depends on: 1433422
(Assignee)

Updated

a year ago
Blocks: 1433463
No longer depends on: 1433463
(Assignee)

Comment 28

a year ago
Instead of generating custom focus events when interacting with elements,
we can run the HTMLElement.focus() function will do the correct thing.

Before this patch we only simulated focus events, whereas this
patch will actually focus the element.

MozReview-Commit-ID: IoBV2ngqOA5
(Assignee)

Comment 29

a year ago
A couple of commands were not running the appropriate unfocussing
steps as the WebDriver standards says they should.

MozReview-Commit-ID: FyuRvkct19m
(Assignee)

Comment 30

a year ago
The WebDriver Element Send Keys command is meant to run the HTML
unfocussing steps after clearing the element.  When HTMLElement.blur()
is called on the root document element (<html>) it is the <body>
that is in focus when the unfocussing steps have run.

The same applies in the case of typing into an <iframe> element.
The controlling element of the <iframe> is the <body>, as this is
the element ath will receive focus should you blur the frame.

MozReview-Commit-ID: 19Ox3W9CF8O
(Assignee)

Comment 31

a year ago
Renames the interaction.focusElement, which also happened to move
the caret in textual form controls, to interaction.moveCaretToEnd,
focussed solely on moving the caret.  It doesn't make sense to
coalesce these two operations into one function.

MozReview-Commit-ID: 2QxV8FllW8J
No longer blocks: 1433463
Depends on: 1433463
You need to log in before you can comment on or make changes to this bug.