New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 670130 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug
Team-Accessibility



Sign in to add a comment

activeElement should never be in an inert context / below a top-level element (e.g. <dialog>)

Project Member Reported by dbeam@chromium.org, Dec 1 2016

Issue description

Chrome Version: (copy from chrome://version)
57.0.2937.0 (Developer Build) (64-bit)

OS: (e.g. Win7, OSX 10.9.5, etc...)
Linux, Ubuntu

What steps will reproduce the problem?
(1) Visit chrome://md-settings/clearBrowserData (shows a <dialog>) (or https://jsfiddle.net/ozr8acaq/ + click "focus me!")
(2) Click on the "scrim" (gray background)
(3) console.log(document.activeElement)

What is the expected result?
the showing <dialog> or something in it

What happens instead?
<body>

Please use labels and text to provide additional information.
I'm fairly sure that Document::activeElement()[1] or TreeScope::adjustedFocusElement()[2] needs to be massaged to look for top-level elements.

If a <dialog> is shown without anything focusable in it (i.e. https://jsfiddle.net/ozr8acaq/1/), I assume the <dialog> should to be the activeElement (or something), and should probably get a 'focus' event dispatched or something.

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Document.cpp?q=document::activeelement&sq=package:chromium&dr=CSs&l=6293
[2] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/TreeScope.cpp?sq=package:chromium&dr=CSs&rcl=1480537046&l=396

For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.
n/a
 

Comment 2 by dbeam@chromium.org, Dec 1 2016

with me*

Comment 3 by dbeam@chromium.org, Dec 1 2016

btw, falken@ told me over chat that `document.body` might be a special case here (and there are multiple tests that imply the same)
Yes document.body should be the only exception. From what I remember and based on the CL description at https://codereview.chromium.org/112553002, if a modal dialog is open but nothing is focusable, document.body gets focus as a last resort. I vaguely remember Blink has some assumptions over the codebase that when nothing is focusable document.body will get it, which I think is what I'm referring to here:

"a) it would make document.body inert, which violates
assumptions of document.body getting default focus when
nothing else can have focus, and"

Indeed the CL doesn't explicitly give focus to body, but instead called document().setFocusedElement(0); which effectively gives document.body focus.

Anyway that CL does recognize that the actual spec and desirable behavior would be for document.body to not get focus (I'm not sure what document.activeElement would be then... null? or maybe <dialog> should get last resort focus even if it's not focusable) but mentions the problems were a) and b) (accessibility tree gets confused).

I'm not sure if a) and b) are still problems today but that's why document.body gets focus.
Digging into history more, there was a huge spec discusssion about this. Some people were advocating for <dialog> to be focusable but Hixie was unconvinced:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23366
Components: UI>Accessibility
Labels: -Pri-2 Pri-3
Owner: kochi@chromium.org
Status: Assigned (was: Untriaged)
I'm going to bump the priority down on this since it's not new.

Tagging this with accessibility (not sure if that's the right label)--a11y people, do you have opinions here? I notice S. Faulkner on the issue linked in Comment 5 is talking about the effect this has on AT.

kochi, could you investigate what the spec requires and what other browsers do? We need to decide whether we should change the spec behavior or fix Blink.

Cc: aboxhall@chromium.org
No other browser implements <dialog> yet, so we should do whatever makes sense and provide spec feedback to change the spec to make sense too.

Comment 8 by falken@chromium.org, Dec 14 2016

Mozilla seems to be implementing so now's a good time for feedback:
https://bugzilla.mozilla.org/show_bug.cgi?id=1322938
Labels: NewComponent-Accessibility-Blink NewComponent-Accessibility
Components: Blink>Accessibility
Components: -UI>Accessibility
Labels: -newcomponent-accessibility-blink -newcomponent-accessibility
Labels: triage-alice
Labels: -triage-alice
Seems like we need to implement the focus fixup rules to fix this: https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule-one
Alice could you take over this issue?
Labels: triage-dtseng
Labels: -triage-dtseng

Comment 17 by kochi@chromium.org, Aug 14 2017

Status: Available (was: Assigned)
I don't have time to work on this in foreseeable future, changing the
status to "Available".
Components: Blink>HTML>Focus
Components: -Blink>Focus

Comment 20 by kochi@chromium.org, Oct 17 2017

Owner: ----
Labels: win-a11y
Update from dsexton, this is concerning spec compliance but it is also relevant to how dialogs receive focus. Includes Windows. 
Owner: foolip@chromium.org
Status: Assigned (was: Available)
@foolip, would you mind taking a fresh look at this?

I'm curious about whether you can reproduce the bug with fullscreen instead of dialog, and I imagine the fix ought to be similar.

Labels: dialogs
Cc: foolip@chromium.org
Components: Blink>Fullscreen
Owner: ----
Status: Available (was: Assigned)
dmazzoni@, it's been a month and a half, sorry about that.

This will affect fullscreen as well, but if the fix for this is implementing https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule-one then I believe the Blink>HTML component is the right one. I may run across this with fullscreen, but for now the honest status of this is that I'm not going to look at it until I run into it with fullscreen, especially given that it's a P3. I'll add myself to CC though and am adding the Blink>Fullscreen component.
Labels: -a11y-Dialogs
Labels: -dialogs a11y-Dialogs
Labels: --a11y-Dialogs
Labels: -OS-Android

Sign in to add a comment