[Webkit-unassigned] [Bug 220580] New: REGRESSION (r257839): Element cannot be "focus()"ed right after becoming visible from hidden

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 12 23:04:38 PST 2021


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

            Bug ID: 220580
           Summary: REGRESSION (r257839): Element cannot be "focus()"ed
                    right after becoming visible from hidden
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tomoki.imai at sony.com
                CC: koivisto at iki.fi, zalan at apple.com

Created attachment 417510

  --> https://bugs.webkit.org/attachment.cgi?id=417510&action=review

Testcase

We found a regression from r257839.

Here is how to reproduce:
1. Open the attached html with MiniBrowser
2. Push Enter key

Expected result:
Newly appeared "Menu Item" button should have focus.

Actual result:
Newly appeared "Menu Item" button doesn't have focus.

Reproduced environment:
- WinCairo MiniBrowser (r271389)

Note:
- I confirmed that reverting r257839 solves the issue.
- Chrome (87.0.4280.141) and Firefox (84.0.1) on Windows don't have this issue
- I didn't test Safari, but because the changed code in r257839 is platform-independent code, I hope it can be reproduced in Safari too.

Attached test case description:
"Menu Item" button is at first invisible, because the div which contains the button is "display:none".
When Enter key is hit, "open" class is added, and it should overwrite "display" with "block".
Then we call "focus" on the button. Because button is visible now, it should have focus.

// open menu
document.querySelector('.menu').classList.add('open');
// focus on menu item
document.querySelector('.menu-item').focus();

<div class="menu">
    <ul>
        <li>
            <button class="menu-item">Menu Item</button>
        </li>
    </ul>
</div>

.menu {
    display: none;
    background: #000;
}
.open {
    display: block;
}

-- 
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/20210113/e541bac3/attachment.htm>


More information about the webkit-unassigned mailing list