Bug 1426807 - Prevent the a11y code running on static clone (printing) docs. r=surkov
authorJonathan Watt <jwatt@jwatt.org>
Wed, 24 Jan 2018 20:02:15 +0000
changeset 400709 1063efb84fbe1e2dcf83ce81838b3cc6576d3c39
parent 400708 c71022b03df808e4c176f269ec727a3338767dfe
child 400710 462f8c845149208a9c1afa4d5637c5b3a880d604
push id33313
push userncsoregi@mozilla.com
push dateThu, 25 Jan 2018 10:14:49 +0000
treeherdermozilla-central@040afea6562f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1426807
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1426807 - Prevent the a11y code running on static clone (printing) docs. r=surkov MozReview-Commit-ID: COUmRqt2dIo
accessible/base/DocManager.cpp
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -465,20 +465,23 @@ DocManager::RemoveListeners(nsIDocument*
 
   elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
                                  TrustedEventsAtCapture());
 }
 
 DocAccessible*
 DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
 {
-  // Ignore hiding, resource documents and documents without docshell.
+  // Ignore hidden documents, resource documents, static clone
+  // (printing) documents and documents without a docshell.
   if (!aDocument->IsVisibleConsideringAncestors() ||
-      aDocument->IsResourceDoc() || !aDocument->IsActive())
+      aDocument->IsResourceDoc() || aDocument->IsStaticDocument() ||
+      !aDocument->IsActive()) {
     return nullptr;
+  }
 
   // Ignore documents without presshell and not having root frame.
   nsIPresShell* presShell = aDocument->GetShell();
   if (!presShell || presShell->IsDestroying())
     return nullptr;
 
   bool isRootDoc = nsCoreUtils::IsRootDocument(aDocument);