From 1a156ce3aad8b775f5cee40302c2a18add226467 Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Sun, 22 Jan 2012 15:55:22 -0800 Subject: [PATCH 1/5] Bug 720016 - warning when compiling the maintenance service - swprintf takes a count parameter. r=bbondy --- .../components/maintenanceservice/maintenanceservice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolkit/components/maintenanceservice/maintenanceservice.cpp b/toolkit/components/maintenanceservice/maintenanceservice.cpp index d05834445416..74bd42525059 100644 --- a/toolkit/components/maintenanceservice/maintenanceservice.cpp +++ b/toolkit/components/maintenanceservice/maintenanceservice.cpp @@ -186,9 +186,11 @@ GetBackupLogPath(LPWSTR path, LPCWSTR basePath, int logNumber) WCHAR logName[64]; wcscpy(path, basePath); if (logNumber <= 0) { - swprintf(logName, L"maintenanceservice.log"); + swprintf(logName, sizeof(logName) / sizeof(logName[0]), + L"maintenanceservice.log"); } else { - swprintf(logName, L"maintenanceservice-%d.log", logNumber); + swprintf(logName, sizeof(logName) / sizeof(logName[0]), + L"maintenanceservice-%d.log", logNumber); } return PathAppendSafe(path, logName); } From 4ef9277e57719229671f7d8a966121f1b61e3eeb Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Mon, 23 Jan 2012 08:02:37 +0100 Subject: [PATCH 2/5] Bug 719389. (Av1) Fix "#ifdef MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN" from bug 441197. r=khuey. --- widget/windows/nsAppShell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index 6037c81a2e66..c3fb941503b7 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -257,7 +257,7 @@ nsAppShell::Run(void) nsresult rv = nsBaseAppShell::Run(); -#ifdef MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN +#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN mozilla::widget::StopAudioSession(); #endif From 1216e0cd9802fb3de3137487f40a1c43a70a6579 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 23 Jan 2012 08:37:56 +0100 Subject: [PATCH 3/5] Fixup for bug 683127 part 11 to properly load sqlite3. rs=tbsaunde --- mozglue/android/APKOpen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mozglue/android/APKOpen.cpp b/mozglue/android/APKOpen.cpp index efcf26e5a8c6..5f91d84ccf99 100644 --- a/mozglue/android/APKOpen.cpp +++ b/mozglue/android/APKOpen.cpp @@ -757,8 +757,8 @@ static void loadSQLiteLibs(const char *apkName) #endif #ifndef MOZ_OLD_LINKER - char *file = new char[strlen(apkName) + sizeof("!/mozsqlite3.so")]; - sprintf(file, "%s!/mozsqlite3.so", apkName); + char *file = new char[strlen(apkName) + sizeof("!/libmozsqlite3.so")]; + sprintf(file, "%s!/libmozsqlite3.so", apkName); sqlite_handle = __wrap_dlopen(file, RTLD_GLOBAL | RTLD_LAZY); delete [] file; #else From c7eee0e1b4e6350a6cb2aa4677edf93f1e0e7c9b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 23 Jan 2012 08:38:12 +0100 Subject: [PATCH 4/5] Bug 683127 part 12 - Enable the new linker on Android native UI. r=khuey --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4edd9061e29a..80d9544ef1c6 100644 --- a/configure.in +++ b/configure.in @@ -4909,7 +4909,9 @@ cairo-android) MOZ_WEBGL=1 MOZ_PDF_PRINTING=1 MOZ_INSTRUMENT_EVENT_LOOP=1 - MOZ_OLD_LINKER=1 + if test "$MOZ_BUILD_APP" = "mobile/xul"; then + MOZ_OLD_LINKER=1 + fi MOZ_TOUCH=1 ;; From 2fe7e7bf8975b33aef9319f5e9cef59629c7134f Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Mon, 23 Jan 2012 17:55:30 +0000 Subject: [PATCH 5/5] Backout ca7d87ab38b6 (bug 707654) for causing problems with NVDA (bug 720393); a=MarcoZ --- accessible/src/base/nsRootAccessible.cpp | 78 ++++++--- accessible/src/base/nsRootAccessible.h | 3 +- .../tests/mochitest/relations/Makefile.in | 1 - .../tests/mochitest/relations/test_embeds.xul | 152 ------------------ .../mochitest/relations/test_general.html | 13 ++ .../mochitest/relations/test_general.xul | 13 ++ 6 files changed, 88 insertions(+), 172 deletions(-) delete mode 100644 accessible/tests/mochitest/relations/test_embeds.xul diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index 355effda1b5e..a0511f38a1d1 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -574,6 +574,59 @@ nsRootAccessible::Shutdown() nsDocAccessibleWrap::Shutdown(); } +// nsRootAccessible protected member +already_AddRefed +nsRootAccessible::GetContentDocShell(nsIDocShellTreeItem *aStart) +{ + if (!aStart) { + return nsnull; + } + + PRInt32 itemType; + aStart->GetItemType(&itemType); + if (itemType == nsIDocShellTreeItem::typeContent) { + nsDocAccessible *accDoc = nsAccUtils::GetDocAccessibleFor(aStart); + + // Hidden documents don't have accessibles (like SeaMonkey's sidebar), + // they are of no interest for a11y. + if (!accDoc) + return nsnull; + + // If ancestor chain of accessibles is not completely visible, + // don't use this one. This happens for example if it's inside + // a background tab (tabbed browsing) + nsAccessible* parent = accDoc->Parent(); + while (parent) { + if (parent->State() & states::INVISIBLE) + return nsnull; + + if (parent == this) + break; // Don't check past original root accessible we started with + + parent = parent->Parent(); + } + + NS_ADDREF(aStart); + return aStart; + } + nsCOMPtr treeNode(do_QueryInterface(aStart)); + if (treeNode) { + PRInt32 subDocuments; + treeNode->GetChildCount(&subDocuments); + for (PRInt32 count = 0; count < subDocuments; count ++) { + nsCOMPtr treeItemChild, contentTreeItem; + treeNode->GetChildAt(count, getter_AddRefs(treeItemChild)); + NS_ENSURE_TRUE(treeItemChild, nsnull); + contentTreeItem = GetContentDocShell(treeItemChild); + if (contentTreeItem) { + NS_ADDREF(aStart = contentTreeItem); + return aStart; + } + } + } + return nsnull; +} + // nsIAccessible method Relation nsRootAccessible::RelationByType(PRUint32 aType) @@ -581,25 +634,14 @@ nsRootAccessible::RelationByType(PRUint32 aType) if (!mDocument || aType != nsIAccessibleRelation::RELATION_EMBEDS) return nsDocAccessibleWrap::RelationByType(aType); - nsIDOMWindow* rootWindow = mDocument->GetWindow(); - if (rootWindow) { - nsCOMPtr contentWindow; - rootWindow->GetContent(getter_AddRefs(contentWindow)); - if (contentWindow) { - nsCOMPtr contentDOMDocument; - contentWindow->GetDocument(getter_AddRefs(contentDOMDocument)); - nsCOMPtr contentDocumentNode = - do_QueryInterface(contentDOMDocument); - if (contentDocumentNode) { - nsDocAccessible* contentDocument = - GetAccService()->GetDocAccessible(contentDocumentNode); - if (contentDocument) - return Relation(contentDocument); - } - } - } + nsCOMPtr treeItem = + nsCoreUtils::GetDocShellTreeItemFor(mDocument); + nsCOMPtr contentTreeItem = GetContentDocShell(treeItem); + // there may be no content area, so we need a null check + if (!contentTreeItem) + return Relation(); - return Relation(); + return Relation(nsAccUtils::GetDocAccessibleFor(contentTreeItem)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/src/base/nsRootAccessible.h b/accessible/src/base/nsRootAccessible.h index b7f02ffddbca..6feb79a91005 100644 --- a/accessible/src/base/nsRootAccessible.h +++ b/accessible/src/base/nsRootAccessible.h @@ -127,7 +127,8 @@ protected: PRUint32 GetChromeFlags(); #endif - + already_AddRefed + GetContentDocShell(nsIDocShellTreeItem *aStart); nsRefPtr mCaretAccessible; }; diff --git a/accessible/tests/mochitest/relations/Makefile.in b/accessible/tests/mochitest/relations/Makefile.in index 5fc8bf6d8789..5a7654412d37 100644 --- a/accessible/tests/mochitest/relations/Makefile.in +++ b/accessible/tests/mochitest/relations/Makefile.in @@ -48,7 +48,6 @@ include $(topsrcdir)/config/rules.mk # test_tabbrowser.xul disabled for misusing (bug 715857) _TEST_FILES =\ - test_embeds.xul \ test_general.html \ test_general.xul \ test_tree.xul \ diff --git a/accessible/tests/mochitest/relations/test_embeds.xul b/accessible/tests/mochitest/relations/test_embeds.xul deleted file mode 100644 index 5d0ddcfa9990..000000000000 --- a/accessible/tests/mochitest/relations/test_embeds.xul +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Mozilla Bug 707654 - -

- -
-    
- -
-
diff --git a/accessible/tests/mochitest/relations/test_general.html b/accessible/tests/mochitest/relations/test_general.html index d487f349ade2..71bf6f8600d2 100644 --- a/accessible/tests/mochitest/relations/test_general.html +++ b/accessible/tests/mochitest/relations/test_general.html @@ -126,6 +126,19 @@ testRelation("legend", RELATION_LABEL_FOR, "fieldset"); testRelation("fieldset", RELATION_LABELLED_BY, "legend"); + // 'embeds' relation for root accessible + var docAcc = null; + var parentOfDocAcc = null; + var parentDocAcc = getAccessible(document); + do { + docAcc = parentDocAcc; + parentOfDocAcc = getAccessible(docAcc.parent, [nsIAccessNode]); + parentDocAcc = getAccessible(parentOfDocAcc.document, + [nsIAccessible]); + } while (getRole(parentDocAcc) != ROLE_CHROME_WINDOW) + + testRelation(parentDocAcc, RELATION_EMBEDS, docAcc); + // finish test SimpleTest.finish(); } diff --git a/accessible/tests/mochitest/relations/test_general.xul b/accessible/tests/mochitest/relations/test_general.xul index 23bf7276b28b..ca288d1bf6c1 100644 --- a/accessible/tests/mochitest/relations/test_general.xul +++ b/accessible/tests/mochitest/relations/test_general.xul @@ -103,6 +103,19 @@ // 'default button' relation testRelation("textbox", RELATION_DEFAULT_BUTTON, "submit"); + // 'embeds' relation for root accessible + var docAcc = null; + var parentOfDocAcc = null; + var parentDocAcc = getAccessible(document); + do { + docAcc = parentDocAcc; + parentOfDocAcc = getAccessible(docAcc.parent, [nsIAccessNode]); + parentDocAcc = getAccessible(parentOfDocAcc.document, + [nsIAccessible]); + } while (getRole(parentDocAcc) != ROLE_CHROME_WINDOW) + + testRelation(parentDocAcc, RELATION_EMBEDS, docAcc); + // 'labelled by'/'label for' relation for xul:goupbox and xul:label of // xul:caption var groupboxAcc = getAccessible("groupbox");