Closed Bug 1507101 Opened 5 years ago Closed 5 years ago

overflow:hidden affects Shift+Tab within shadow DOM


(Core :: DOM: Core & HTML, defect, P2)




Tracking Status
firefox65 --- verified


(Reporter: serguey.kulikov, Assigned: emilio)


(Blocks 1 open bug)



(2 files)

Attached file repro.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Steps to reproduce:

1. Create a custom element with shadow root
2. In the shadow DOM, add the div with overflow: hidden
3. In that div, place 2 focusable elements (e.g. button and input)
4. Focus the input
5. Press Shift+Tab, to move focus back to button
6. Press Shift+Tab once again

Actual results:

focus moves out of the shadow root

Expected results:

focus returns back to the input
UPD: corrected description:

Expected results: 
focus moves out of the shadow root

Actual results:
focus returns back to the input
Component: Untriaged → DOM
Product: Firefox → Core
Ever confirmed: true
Priority: -- → P2
That's indeed a bit wild, I bet this is related to the extra anonymous box we have for overflow: hidden. Olli, let me know if you want me to look at it, from a quick look I assume the bug is around this code, right?
If you have time, feel free to take a look.
Assignee: nobody → emilio
Yup! I was right on which code was wrong :-)
Blocks: 1430692
There are lots of frames which create anonymous content (like scrollframes,
which generate scrollbars) but for which this code was wrong.

Use StyleChildrenIterator which has a defined order between NAC and flattened
tree. I've verified this doesn't break tabbing through input type="date" with
UA widget disabled, fwiw.
Pushed by
Use StyleChildrenIterator instead of custom frame tree walking code to handle NAC inside shadow dom. r=smaug
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
I was meant to document the custom code as a clean-up after bug 1507895 and this is done already 👍
Flags: qe-verify+

I have reproduced this issue using Firefox 65.0a1 (2018.11.14) on Windows 10 x64.
I can confirm this issue is fixed, I verified using Firefox 65.0b11 on Ubuntu 18.04 x64, Windows 10 x64 and on Mac OS X 10.13.

Flags: qe-verify+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.