[Webkit-unassigned] [Bug 203292] Accessory bar next/previous buttons do not work on inputs in shadow roots

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 25 17:24:07 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=203292

Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #412272|review?                     |review+
              Flags|                            |

--- Comment #28 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 412272
  --> https://bugs.webkit.org/attachment.cgi?id=412272
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412272&action=review

> LayoutTests/fast/shadow-dom/ios/accessory-bar-work-on-input-with-tabindex-in-shadow-tree.html:130
> +class Testcase {
> +    constructor(documentOrShadowRoot, inputGetter) {

It seems that we can just have a helper function that creates a simple dictionary instead of a class with a getter.
For tests, we should strive to make things as simple as possible because we don't want to be debugging test code.

> LayoutTests/fast/shadow-dom/ios/accessory-bar-work-on-input-with-tabindex-in-shadow-tree.html:145
> +        new Testcase(document, (_) => document.getElementById('first')),

It seems this class is totally unnecessary.
Given we're not dynamically mutating the tree, we can simply compute the input element right here:
e.g. testCase(document, document.getElementById('first'))

> LayoutTests/fast/shadow-dom/ios/accessory-bar-work-on-input-with-tabindex-in-shadow-tree.html:181
> +    for (const [i, { documentOrShadowRoot, inputElement, }] of stack.entries()) {

Why not just start at i=1 instead?

> LayoutTests/fast/shadow-dom/ios/accessory-bar-work-on-input-with-tabindex-in-shadow-tree.html:196
> +    for (let i = stack.length - 1; -1 < i; --i) {
> +        if (stack.length - 1 === i) {

Why not just start i = stack.length - 2?

> LayoutTests/resources/ui-helper.js:1383
> +    static moveToNextByKeyboardAccessoryBar() {

Nit: { should be on the next line.

> LayoutTests/resources/ui-helper.js:1392
> +    static moveToPrevByKeyboardAccessoryBar() {

Ditto.

-- 
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/20201026/96a2e6e1/attachment-0001.htm>


More information about the webkit-unassigned mailing list