From b79d3bc706eeaae78298ff7f15060ab95d51b697 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Sat, 18 Feb 2012 02:38:43 +0900 Subject: [PATCH] Bug 677154 - Detached document accessibility tree, r=bz, marcoz --- .../tests/mochitest/treeupdate/Makefile.in | 1 + .../treeupdate/test_cssoverflow.html | 141 ++++++++++++++++++ layout/generic/nsGfxScrollFrame.cpp | 8 +- 3 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 accessible/tests/mochitest/treeupdate/test_cssoverflow.html diff --git a/accessible/tests/mochitest/treeupdate/Makefile.in b/accessible/tests/mochitest/treeupdate/Makefile.in index ca73261c52b..053201134d6 100644 --- a/accessible/tests/mochitest/treeupdate/Makefile.in +++ b/accessible/tests/mochitest/treeupdate/Makefile.in @@ -48,6 +48,7 @@ include $(topsrcdir)/config/rules.mk _TEST_FILES =\ test_ariadialog.html \ test_colorpicker.xul \ + test_cssoverflow.html \ test_contextmenu.xul \ test_doc.html \ test_gencontent.html \ diff --git a/accessible/tests/mochitest/treeupdate/test_cssoverflow.html b/accessible/tests/mochitest/treeupdate/test_cssoverflow.html new file mode 100644 index 00000000000..102fc976f78 --- /dev/null +++ b/accessible/tests/mochitest/treeupdate/test_cssoverflow.html @@ -0,0 +1,141 @@ + + + + Testing HTML scrollable frames (css overflow style) + + + + + + + + + + + + + + + Mozilla Bug 677154 + +

+ +
+  
+
+ +
+
+ + diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 547d931e0c1..e05e0b9cb07 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -969,10 +969,14 @@ nsHTMLScrollFrame::GetFrameName(nsAString& aResult) const already_AddRefed nsHTMLScrollFrame::CreateAccessible() { - if (!IsFocusable()) { + // Create an accessible regardless focusable state because the state can be + // changed during frame life cycle without any notifications to accessibility. + if (mContent->IsRootOfNativeAnonymousSubtree() || + GetScrollbarStyles() == nsIScrollableFrame:: + ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN) ) { return nsnull; } - // Focusable via CSS, so needs to be in accessibility hierarchy + nsAccessibilityService* accService = nsIPresShell::AccService(); if (accService) { return accService->CreateHyperTextAccessible(mContent,