mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
Bug 1660359 part 2: Allow a11y focus on a remote print preview OuterDocAccessible. r=jwatt,yzen
Print preview documents don't get DocAccessibles because this currently causes crashes and doesn't provide much value. However, we still want to tell a11y clients something useful when a print preview document gets focus, rather than a11y focus just going nowhere. Therefore, we allow a11y focus to land on the OuterDocAccessible (browser element) in this case. Differential Revision: https://phabricator.services.mozilla.com/D87997
This commit is contained in:
parent
08293afb21
commit
2f11033294
@ -370,6 +370,14 @@ nsINode* FocusManager::FocusedDOMNode() const {
|
||||
nsIContent* focusedElm = DOMFocusManager->GetFocusedElement();
|
||||
|
||||
if (focusedElm) {
|
||||
// Print preview documents don't get DocAccessibles, but we still want a11y
|
||||
// focus to go somewhere useful. Therefore, we allow a11y focus to land on
|
||||
// the OuterDocAccessible in this case.
|
||||
// Note that this code only handles remote print preview documents.
|
||||
if (EventStateManager::IsTopLevelRemoteTarget(focusedElm) &&
|
||||
focusedElm->AsElement()->HasAttribute(u"printpreview"_ns)) {
|
||||
return focusedElm;
|
||||
}
|
||||
// No focus on remote target elements like xul:browser having DOM focus and
|
||||
// residing in chrome process because it means an element in content process
|
||||
// keeps the focus. Similarly, suppress focus on OOP iframes because an
|
||||
|
@ -173,6 +173,7 @@ var PrintEventHandler = {
|
||||
});
|
||||
printPreviewBrowser.classList.add("printPreviewBrowser");
|
||||
printPreviewBrowser.setAttribute("flex", "1");
|
||||
printPreviewBrowser.setAttribute("printpreview", "true");
|
||||
|
||||
// Create the stack for the loading indicator.
|
||||
let ourBrowser = window.docShell.chromeEventHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user