diff --git a/accessible/src/atk/nsApplicationAccessibleWrap.cpp b/accessible/src/atk/ApplicationAccessibleWrap.cpp similarity index 96% rename from accessible/src/atk/nsApplicationAccessibleWrap.cpp rename to accessible/src/atk/ApplicationAccessibleWrap.cpp index 9b58acfa6ec..ed9e2718ae8 100644 --- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp +++ b/accessible/src/atk/ApplicationAccessibleWrap.cpp @@ -38,7 +38,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsApplicationAccessibleWrap.h" +#include "ApplicationAccessibleWrap.h" #include "nsCOMPtr.h" #include "nsMai.h" @@ -466,25 +466,19 @@ mai_util_remove_key_event_listener (guint remove_listener) } } -AtkObject * +AtkObject* mai_util_get_root(void) { - if (nsAccessibilityService::IsShutdown()) { - // We've shutdown, try to use gail instead - // (to avoid assert in spi_atk_tidy_windows()) - if (gail_get_root) - return gail_get_root(); - - return nsnull; - } - - nsApplicationAccessible *applicationAcc = - nsAccessNode::GetApplicationAccessible(); - - if (applicationAcc) - return applicationAcc->GetAtkObject(); + if (nsAccessibilityService::IsShutdown()) { + // We've shutdown, try to use gail instead + // (to avoid assert in spi_atk_tidy_windows()) + if (gail_get_root) + return gail_get_root(); return nsnull; + } + + return nsAccessNode::GetApplicationAccessible()->GetAtkObject(); } G_CONST_RETURN gchar * @@ -550,15 +544,15 @@ add_listener (GSignalEmissionHook listener, static nsresult LoadGtkModule(GnomeAccessibilityModule& aModule); -// nsApplicationAccessibleWrap +// ApplicationAccessibleWrap -nsApplicationAccessibleWrap::nsApplicationAccessibleWrap(): - nsApplicationAccessible() +ApplicationAccessibleWrap::ApplicationAccessibleWrap(): + ApplicationAccessible() { - MAI_LOG_DEBUG(("======Create AppRootAcc=%p\n", (void*)this)); + MAI_LOG_DEBUG(("======Create AppRootAcc=%p\n", (void*)this)); } -nsApplicationAccessibleWrap::~nsApplicationAccessibleWrap() +ApplicationAccessibleWrap::~ApplicationAccessibleWrap() { MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this)); nsAccessibleWrap::ShutdownAtkObject(); @@ -613,7 +607,7 @@ toplevel_event_watcher(GSignalInvocationHint* ihint, } bool -nsApplicationAccessibleWrap::Init() +ApplicationAccessibleWrap::Init() { if (ShouldA11yBeEnabled()) { // load and initialize gail library @@ -655,11 +649,11 @@ nsApplicationAccessibleWrap::Init() } } - return nsApplicationAccessible::Init(); + return ApplicationAccessible::Init(); } void -nsApplicationAccessibleWrap::Unload() +ApplicationAccessibleWrap::Unload() { if (sToplevel_event_hook_added) { sToplevel_event_hook_added = false; @@ -697,7 +691,7 @@ nsApplicationAccessibleWrap::Unload() } NS_IMETHODIMP -nsApplicationAccessibleWrap::GetName(nsAString& aName) +ApplicationAccessibleWrap::GetName(nsAString& aName) { // ATK doesn't provide a way to obtain an application name (for example, // Firefox or Thunderbird) like IA2 does. Thus let's return an application @@ -707,7 +701,7 @@ nsApplicationAccessibleWrap::GetName(nsAString& aName) } NS_IMETHODIMP -nsApplicationAccessibleWrap::GetNativeInterface(void **aOutAccessible) +ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible) { *aOutAccessible = nsnull; @@ -745,9 +739,9 @@ gboolean fireRootAccessibleAddedCB(gpointer data) } bool -nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild) +ApplicationAccessibleWrap::AppendChild(nsAccessible* aChild) { - if (!nsApplicationAccessible::AppendChild(aChild)) + if (!ApplicationAccessible::AppendChild(aChild)) return false; AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild); @@ -772,7 +766,7 @@ nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild) } bool -nsApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild) +ApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild) { PRInt32 index = aChild->IndexInParent(); @@ -781,11 +775,11 @@ nsApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild) g_signal_emit_by_name(mAtkObject, "children_changed::remove", index, atkAccessible, NULL); - return nsApplicationAccessible::RemoveChild(aChild); + return ApplicationAccessible::RemoveChild(aChild); } void -nsApplicationAccessibleWrap::PreCreate() +ApplicationAccessibleWrap::PreCreate() { if (!sATKChecked) { sATKLib = PR_LoadLibrary(sATKLibName); diff --git a/accessible/src/atk/nsApplicationAccessibleWrap.h b/accessible/src/atk/ApplicationAccessibleWrap.h similarity index 89% rename from accessible/src/atk/nsApplicationAccessibleWrap.h rename to accessible/src/atk/ApplicationAccessibleWrap.h index 924eeefba39..920b3e89535 100644 --- a/accessible/src/atk/nsApplicationAccessibleWrap.h +++ b/accessible/src/atk/ApplicationAccessibleWrap.h @@ -38,20 +38,20 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef __NS_APP_ROOT_ACCESSIBLE_H__ -#define __NS_APP_ROOT_ACCESSIBLE_H__ +#ifndef MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ +#define MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ -#include "nsApplicationAccessible.h" +#include "ApplicationAccessible.h" -class nsApplicationAccessibleWrap: public nsApplicationAccessible +class ApplicationAccessibleWrap: public ApplicationAccessible { public: static void Unload(); static void PreCreate(); public: - nsApplicationAccessibleWrap(); - virtual ~nsApplicationAccessibleWrap(); + ApplicationAccessibleWrap(); + virtual ~ApplicationAccessibleWrap(); // nsAccessNode virtual bool Init(); diff --git a/accessible/src/atk/Makefile.in b/accessible/src/atk/Makefile.in index 7640adb644c..3fe4b9dabf1 100644 --- a/accessible/src/atk/Makefile.in +++ b/accessible/src/atk/Makefile.in @@ -53,7 +53,7 @@ CPPSRCS = \ nsAccessibleWrap.cpp \ nsDocAccessibleWrap.cpp \ nsRootAccessibleWrap.cpp \ - nsApplicationAccessibleWrap.cpp \ + ApplicationAccessibleWrap.cpp \ nsMaiInterfaceComponent.cpp \ nsMaiInterfaceAction.cpp \ nsMaiInterfaceText.cpp \ diff --git a/accessible/src/atk/nsAccessNodeWrap.cpp b/accessible/src/atk/nsAccessNodeWrap.cpp index b945a548eab..f6460104457 100644 --- a/accessible/src/atk/nsAccessNodeWrap.cpp +++ b/accessible/src/atk/nsAccessNodeWrap.cpp @@ -38,7 +38,6 @@ * ***** END LICENSE BLOCK ***** */ #include "nsAccessNodeWrap.h" -#include "nsApplicationAccessibleWrap.h" /* For documentation of the accessibility architecture, * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html diff --git a/accessible/src/atk/nsAccessibleWrap.cpp b/accessible/src/atk/nsAccessibleWrap.cpp index 44be0f696b4..81c03635635 100644 --- a/accessible/src/atk/nsAccessibleWrap.cpp +++ b/accessible/src/atk/nsAccessibleWrap.cpp @@ -41,9 +41,9 @@ #include "nsAccessibleWrap.h" #include "Accessible-inl.h" +#include "ApplicationAccessibleWrap.h" #include "InterfaceInitFuncs.h" #include "nsAccUtils.h" -#include "nsApplicationAccessibleWrap.h" #include "nsIAccessibleRelation.h" #include "nsRootAccessible.h" #include "nsDocAccessibleWrap.h" @@ -68,7 +68,7 @@ using namespace mozilla::a11y; nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals = eUnknown; -//defined in nsApplicationAccessibleWrap.cpp +//defined in ApplicationAccessibleWrap.cpp extern "C" GType g_atk_hyperlink_impl_type; /* MaiAtkObject */ @@ -976,25 +976,20 @@ refRelationSetCB(AtkObject *aAtkObj) // for it. nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj) { - NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nsnull); - nsAccessibleWrap *tmpAccWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap; + NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nsnull); + nsAccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap; - // Check if AccessibleWrap was deconstructed - if (tmpAccWrap == nsnull) { - return nsnull; - } + // Check if the accessible was deconstructed. + if (!accWrap) + return nsnull; - NS_ENSURE_TRUE(tmpAccWrap->GetAtkObject() == aAtkObj, nsnull); + NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nsnull); - nsApplicationAccessible *applicationAcc = - nsAccessNode::GetApplicationAccessible(); - nsAccessibleWrap* tmpAppAccWrap = - static_cast(applicationAcc); + nsAccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible(); + if (appAccWrap != accWrap && !accWrap->IsValidObject()) + return nsnull; - if (tmpAppAccWrap != tmpAccWrap && !tmpAccWrap->IsValidObject()) - return nsnull; - - return tmpAccWrap; + return accWrap; } nsresult diff --git a/accessible/src/base/AccEvent.cpp b/accessible/src/base/AccEvent.cpp index b975138cd4b..0c86d66bc63 100644 --- a/accessible/src/base/AccEvent.cpp +++ b/accessible/src/base/AccEvent.cpp @@ -39,9 +39,9 @@ #include "AccEvent.h" +#include "ApplicationAccessibleWrap.h" #include "nsAccessibilityService.h" #include "nsAccUtils.h" -#include "nsApplicationAccessibleWrap.h" #include "nsDocAccessible.h" #include "nsIAccessibleText.h" #include "nsAccEvent.h" @@ -155,7 +155,7 @@ AccEvent::CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput) // XXX: remove this hack during reorganization of 506907. Meanwhile we // want to get rid an assertion for application accessible events which // don't have DOM node (see bug 506206). - nsApplicationAccessible *applicationAcc = + ApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); if (mAccessible != static_cast(applicationAcc)) diff --git a/accessible/src/base/Makefile.in b/accessible/src/base/Makefile.in index 0c13cc8fd1e..b034b9d071d 100644 --- a/accessible/src/base/Makefile.in +++ b/accessible/src/base/Makefile.in @@ -69,7 +69,6 @@ CPPSRCS = \ nsBaseWidgetAccessible.cpp \ nsEventShell.cpp \ nsRootAccessible.cpp \ - nsApplicationAccessible.cpp \ nsCaretAccessible.cpp \ nsTextAccessible.cpp \ nsTextEquivUtils.cpp \ diff --git a/accessible/src/base/nsAccDocManager.cpp b/accessible/src/base/nsAccDocManager.cpp index 358776c410d..7bbaa02e7c5 100644 --- a/accessible/src/base/nsAccDocManager.cpp +++ b/accessible/src/base/nsAccDocManager.cpp @@ -38,9 +38,9 @@ #include "nsAccDocManager.h" +#include "ApplicationAccessible.h" #include "nsAccessibilityService.h" #include "nsAccUtils.h" -#include "nsApplicationAccessible.h" #include "nsARIAMap.h" #include "nsRootAccessibleWrap.h" #include "States.h" diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp index 909abb0cd79..a68838df6b0 100644 --- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -38,9 +38,9 @@ #include "nsAccessNode.h" +#include "ApplicationAccessibleWrap.h" #include "nsAccessibilityService.h" #include "nsAccUtils.h" -#include "nsApplicationAccessibleWrap.h" #include "nsCoreUtils.h" #include "nsRootAccessible.h" @@ -67,7 +67,7 @@ nsIStringBundle *nsAccessNode::gStringBundle = 0; bool nsAccessNode::gIsFormFillEnabled = false; -nsApplicationAccessible *nsAccessNode::gApplicationAccessible = nsnull; +ApplicationAccessible* nsAccessNode::gApplicationAccessible = nsnull; /* * Class nsAccessNode @@ -130,18 +130,16 @@ nsAccessNode::Shutdown() mDoc = nsnull; } -nsApplicationAccessible* +ApplicationAccessible* nsAccessNode::GetApplicationAccessible() { NS_ASSERTION(!nsAccessibilityService::IsShutdown(), "Accessibility wasn't initialized!"); if (!gApplicationAccessible) { - nsApplicationAccessibleWrap::PreCreate(); + ApplicationAccessibleWrap::PreCreate(); - gApplicationAccessible = new nsApplicationAccessibleWrap(); - if (!gApplicationAccessible) - return nsnull; + gApplicationAccessible = new ApplicationAccessibleWrap(); // Addref on create. Will Release in ShutdownXPAccessibility() NS_ADDREF(gApplicationAccessible); @@ -200,7 +198,7 @@ void nsAccessNode::ShutdownXPAccessibility() // Release gApplicationAccessible after everything else is shutdown // so we don't accidently create it again while tearing down root accessibles - nsApplicationAccessibleWrap::Unload(); + ApplicationAccessibleWrap::Unload(); if (gApplicationAccessible) { gApplicationAccessible->Shutdown(); NS_RELEASE(gApplicationAccessible); diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h index ea29d4ccecf..9a2f3567884 100644 --- a/accessible/src/base/nsAccessNode.h +++ b/accessible/src/base/nsAccessNode.h @@ -53,8 +53,8 @@ #include "nsIStringBundle.h" #include "nsWeakReference.h" +class ApplicationAccessible; class nsAccessNode; -class nsApplicationAccessible; class nsDocAccessible; class nsIAccessibleDocument; class nsRootAccessible; @@ -83,7 +83,7 @@ public: /** * Return an application accessible. */ - static nsApplicationAccessible* GetApplicationAccessible(); + static ApplicationAccessible* GetApplicationAccessible(); /** * Return the document accessible for this access node. @@ -174,7 +174,7 @@ private: nsAccessNode(const nsAccessNode&) MOZ_DELETE; nsAccessNode& operator =(const nsAccessNode&) MOZ_DELETE; - static nsApplicationAccessible *gApplicationAccessible; + static ApplicationAccessible* gApplicationAccessible; }; #endif diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 0d4c8c0a8ad..3dd35421c8d 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -40,6 +40,7 @@ // NOTE: alphabetically ordered #include "Accessible-inl.h" +#include "ApplicationAccessibleWrap.h" #include "ARIAGridAccessibleWrap.h" #ifdef MOZ_ACCESSIBILITY_ATK #include "AtkSocketAccessible.h" @@ -48,7 +49,6 @@ #include "nsAccessiblePivot.h" #include "nsAccUtils.h" #include "nsARIAMap.h" -#include "nsApplicationAccessibleWrap.h" #include "nsIAccessibleProvider.h" #include "nsHTMLCanvasAccessible.h" #include "nsHTMLImageMapAccessible.h" @@ -678,7 +678,7 @@ nsAccessibilityService::RecreateAccessible(nsIPresShell* aPresShell, // nsIAccessibleRetrieval NS_IMETHODIMP -nsAccessibilityService::GetApplicationAccessible(nsIAccessible **aAccessibleApplication) +nsAccessibilityService::GetApplicationAccessible(nsIAccessible** aAccessibleApplication) { NS_ENSURE_ARG_POINTER(aAccessibleApplication); @@ -1724,7 +1724,7 @@ nsAccessible* nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible) { #ifdef MOZ_ACCESSIBILITY_ATK - nsApplicationAccessible* applicationAcc = + ApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); if (!applicationAcc) return nsnull; @@ -1745,7 +1745,7 @@ void nsAccessibilityService::RemoveNativeRootAccessible(nsAccessible* aAccessible) { #ifdef MOZ_ACCESSIBILITY_ATK - nsApplicationAccessible* applicationAcc = + ApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); if (applicationAcc) diff --git a/accessible/src/base/nsAccessibilityService.h b/accessible/src/base/nsAccessibilityService.h index 7fcb1614dc6..979d67d7f68 100644 --- a/accessible/src/base/nsAccessibilityService.h +++ b/accessible/src/base/nsAccessibilityService.h @@ -63,7 +63,7 @@ FocusManager* FocusMgr(); /** * Perform initialization that should be done as soon as possible, in order * to minimize startup time. - * XXX: this function and the next defined in nsApplicationAccessibleWrap.cpp + * XXX: this function and the next defined in ApplicationAccessibleWrap.cpp */ void PreInit(); diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index c9a1f80232d..9dc74023000 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -42,7 +42,6 @@ #include "Accessible-inl.h" #include "nsAccessibilityService.h" -#include "nsApplicationAccessibleWrap.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "Relation.h" diff --git a/accessible/src/base/nsApplicationAccessible.cpp b/accessible/src/generic/ApplicationAccessible.cpp similarity index 75% rename from accessible/src/base/nsApplicationAccessible.cpp rename to accessible/src/generic/ApplicationAccessible.cpp index f42a9740876..73a8a0a812a 100644 --- a/accessible/src/base/nsApplicationAccessible.cpp +++ b/accessible/src/generic/ApplicationAccessible.cpp @@ -40,7 +40,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsApplicationAccessible.h" +#include "ApplicationAccessible.h" #include "nsAccessibilityService.h" #include "nsAccUtils.h" @@ -57,7 +57,7 @@ using namespace mozilla::a11y; -nsApplicationAccessible::nsApplicationAccessible() : +ApplicationAccessible::ApplicationAccessible() : nsAccessibleWrap(nsnull, nsnull) { mFlags |= eApplicationAccessible; @@ -66,14 +66,14 @@ nsApplicationAccessible::nsApplicationAccessible() : //////////////////////////////////////////////////////////////////////////////// // nsISupports -NS_IMPL_ISUPPORTS_INHERITED1(nsApplicationAccessible, nsAccessible, +NS_IMPL_ISUPPORTS_INHERITED1(ApplicationAccessible, nsAccessible, nsIAccessibleApplication) //////////////////////////////////////////////////////////////////////////////// // nsIAccessible NS_IMETHODIMP -nsApplicationAccessible::GetParent(nsIAccessible **aAccessible) +ApplicationAccessible::GetParent(nsIAccessible** aAccessible) { NS_ENSURE_ARG_POINTER(aAccessible); *aAccessible = nsnull; @@ -81,7 +81,7 @@ nsApplicationAccessible::GetParent(nsIAccessible **aAccessible) } NS_IMETHODIMP -nsApplicationAccessible::GetNextSibling(nsIAccessible **aNextSibling) +ApplicationAccessible::GetNextSibling(nsIAccessible** aNextSibling) { NS_ENSURE_ARG_POINTER(aNextSibling); *aNextSibling = nsnull; @@ -89,7 +89,7 @@ nsApplicationAccessible::GetNextSibling(nsIAccessible **aNextSibling) } NS_IMETHODIMP -nsApplicationAccessible::GetPreviousSibling(nsIAccessible **aPreviousSibling) +ApplicationAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling) { NS_ENSURE_ARG_POINTER(aPreviousSibling); *aPreviousSibling = nsnull; @@ -97,7 +97,7 @@ nsApplicationAccessible::GetPreviousSibling(nsIAccessible **aPreviousSibling) } NS_IMETHODIMP -nsApplicationAccessible::GetName(nsAString& aName) +ApplicationAccessible::GetName(nsAString& aName) { aName.Truncate(); @@ -125,25 +125,25 @@ nsApplicationAccessible::GetName(nsAString& aName) } void -nsApplicationAccessible::Description(nsString &aDescription) +ApplicationAccessible::Description(nsString& aDescription) { aDescription.Truncate(); } void -nsApplicationAccessible::Value(nsString& aValue) +ApplicationAccessible::Value(nsString& aValue) { aValue.Truncate(); } PRUint64 -nsApplicationAccessible::State() +ApplicationAccessible::State() { return IsDefunct() ? states::DEFUNCT : 0; } NS_IMETHODIMP -nsApplicationAccessible::GetAttributes(nsIPersistentProperties **aAttributes) +ApplicationAccessible::GetAttributes(nsIPersistentProperties** aAttributes) { NS_ENSURE_ARG_POINTER(aAttributes); *aAttributes = nsnull; @@ -151,9 +151,9 @@ nsApplicationAccessible::GetAttributes(nsIPersistentProperties **aAttributes) } NS_IMETHODIMP -nsApplicationAccessible::GroupPosition(PRInt32 *aGroupLevel, - PRInt32 *aSimilarItemsInGroup, - PRInt32 *aPositionInGroup) +ApplicationAccessible::GroupPosition(PRInt32* aGroupLevel, + PRInt32* aSimilarItemsInGroup, + PRInt32* aPositionInGroup) { NS_ENSURE_ARG_POINTER(aGroupLevel); *aGroupLevel = 0; @@ -165,14 +165,14 @@ nsApplicationAccessible::GroupPosition(PRInt32 *aGroupLevel, } nsAccessible* -nsApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY, - EWhichChildAtPoint aWhichChild) +ApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY, + EWhichChildAtPoint aWhichChild) { return nsnull; } nsAccessible* -nsApplicationAccessible::FocusedChild() +ApplicationAccessible::FocusedChild() { nsAccessible* focus = FocusMgr()->FocusedAccessible(); if (focus && focus->Parent() == this) @@ -182,14 +182,14 @@ nsApplicationAccessible::FocusedChild() } Relation -nsApplicationAccessible::RelationByType(PRUint32 aRelationType) +ApplicationAccessible::RelationByType(PRUint32 aRelationType) { return Relation(); } NS_IMETHODIMP -nsApplicationAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY, - PRInt32 *aWidth, PRInt32 *aHeight) +ApplicationAccessible::GetBounds(PRInt32* aX, PRInt32* aY, + PRInt32* aWidth, PRInt32* aHeight) { NS_ENSURE_ARG_POINTER(aX); *aX = 0; @@ -203,46 +203,46 @@ nsApplicationAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY, } NS_IMETHODIMP -nsApplicationAccessible::SetSelected(bool aIsSelected) +ApplicationAccessible::SetSelected(bool aIsSelected) { return NS_OK; } NS_IMETHODIMP -nsApplicationAccessible::TakeSelection() +ApplicationAccessible::TakeSelection() { return NS_OK; } NS_IMETHODIMP -nsApplicationAccessible::TakeFocus() +ApplicationAccessible::TakeFocus() { return NS_OK; } PRUint8 -nsApplicationAccessible::ActionCount() +ApplicationAccessible::ActionCount() { return 0; } NS_IMETHODIMP -nsApplicationAccessible::GetActionName(PRUint8 aIndex, nsAString &aName) +ApplicationAccessible::GetActionName(PRUint8 aIndex, nsAString& aName) { aName.Truncate(); return NS_ERROR_INVALID_ARG; } NS_IMETHODIMP -nsApplicationAccessible::GetActionDescription(PRUint8 aIndex, - nsAString &aDescription) +ApplicationAccessible::GetActionDescription(PRUint8 aIndex, + nsAString& aDescription) { aDescription.Truncate(); return NS_ERROR_INVALID_ARG; } NS_IMETHODIMP -nsApplicationAccessible::DoAction(PRUint8 aIndex) +ApplicationAccessible::DoAction(PRUint8 aIndex) { return NS_OK; } @@ -251,7 +251,7 @@ nsApplicationAccessible::DoAction(PRUint8 aIndex) // nsIAccessibleApplication NS_IMETHODIMP -nsApplicationAccessible::GetAppName(nsAString& aName) +ApplicationAccessible::GetAppName(nsAString& aName) { aName.Truncate(); @@ -267,7 +267,7 @@ nsApplicationAccessible::GetAppName(nsAString& aName) } NS_IMETHODIMP -nsApplicationAccessible::GetAppVersion(nsAString& aVersion) +ApplicationAccessible::GetAppVersion(nsAString& aVersion) { aVersion.Truncate(); @@ -283,14 +283,14 @@ nsApplicationAccessible::GetAppVersion(nsAString& aVersion) } NS_IMETHODIMP -nsApplicationAccessible::GetPlatformName(nsAString& aName) +ApplicationAccessible::GetPlatformName(nsAString& aName) { aName.AssignLiteral("Gecko"); return NS_OK; } NS_IMETHODIMP -nsApplicationAccessible::GetPlatformVersion(nsAString& aVersion) +ApplicationAccessible::GetPlatformVersion(nsAString& aVersion) { aVersion.Truncate(); @@ -309,20 +309,20 @@ nsApplicationAccessible::GetPlatformVersion(nsAString& aVersion) // nsAccessNode public methods bool -nsApplicationAccessible::Init() +ApplicationAccessible::Init() { mAppInfo = do_GetService("@mozilla.org/xre/app-info;1"); return true; } void -nsApplicationAccessible::Shutdown() +ApplicationAccessible::Shutdown() { mAppInfo = nsnull; } bool -nsApplicationAccessible::IsPrimaryForNode() const +ApplicationAccessible::IsPrimaryForNode() const { return false; } @@ -331,31 +331,31 @@ nsApplicationAccessible::IsPrimaryForNode() const // nsAccessible public methods void -nsApplicationAccessible::ApplyARIAState(PRUint64* aState) +ApplicationAccessible::ApplyARIAState(PRUint64* aState) { } role -nsApplicationAccessible::NativeRole() +ApplicationAccessible::NativeRole() { return roles::APP_ROOT; } PRUint64 -nsApplicationAccessible::NativeState() +ApplicationAccessible::NativeState() { return 0; } void -nsApplicationAccessible::InvalidateChildren() +ApplicationAccessible::InvalidateChildren() { // Do nothing because application children are kept updated by AppendChild() // and RemoveChild() method calls. } KeyBinding -nsApplicationAccessible::AccessKey() const +ApplicationAccessible::AccessKey() const { return KeyBinding(); } @@ -364,7 +364,7 @@ nsApplicationAccessible::AccessKey() const // nsAccessible protected methods void -nsApplicationAccessible::CacheChildren() +ApplicationAccessible::CacheChildren() { // CacheChildren is called only once for application accessible when its // children are requested because empty InvalidateChldren() prevents its @@ -404,8 +404,8 @@ nsApplicationAccessible::CacheChildren() } nsAccessible* -nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset, - nsresult* aError) const +ApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset, + nsresult* aError) const { if (aError) *aError = NS_OK; // fail peacefully @@ -417,7 +417,7 @@ nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset, // nsIAccessible NS_IMETHODIMP -nsApplicationAccessible::GetDOMNode(nsIDOMNode **aDOMNode) +ApplicationAccessible::GetDOMNode(nsIDOMNode** aDOMNode) { NS_ENSURE_ARG_POINTER(aDOMNode); *aDOMNode = nsnull; @@ -425,7 +425,7 @@ nsApplicationAccessible::GetDOMNode(nsIDOMNode **aDOMNode) } NS_IMETHODIMP -nsApplicationAccessible::GetDocument(nsIAccessibleDocument **aDocument) +ApplicationAccessible::GetDocument(nsIAccessibleDocument** aDocument) { NS_ENSURE_ARG_POINTER(aDocument); *aDocument = nsnull; @@ -433,7 +433,7 @@ nsApplicationAccessible::GetDocument(nsIAccessibleDocument **aDocument) } NS_IMETHODIMP -nsApplicationAccessible::GetRootDocument(nsIAccessibleDocument **aRootDocument) +ApplicationAccessible::GetRootDocument(nsIAccessibleDocument** aRootDocument) { NS_ENSURE_ARG_POINTER(aRootDocument); *aRootDocument = nsnull; @@ -441,20 +441,20 @@ nsApplicationAccessible::GetRootDocument(nsIAccessibleDocument **aRootDocument) } NS_IMETHODIMP -nsApplicationAccessible::ScrollTo(PRUint32 aScrollType) +ApplicationAccessible::ScrollTo(PRUint32 aScrollType) { return NS_OK; } NS_IMETHODIMP -nsApplicationAccessible::ScrollToPoint(PRUint32 aCoordinateType, - PRInt32 aX, PRInt32 aY) +ApplicationAccessible::ScrollToPoint(PRUint32 aCoordinateType, + PRInt32 aX, PRInt32 aY) { return NS_OK; } NS_IMETHODIMP -nsApplicationAccessible::GetLanguage(nsAString &aLanguage) +ApplicationAccessible::GetLanguage(nsAString& aLanguage) { aLanguage.Truncate(); return NS_OK; diff --git a/accessible/src/base/nsApplicationAccessible.h b/accessible/src/generic/ApplicationAccessible.h similarity index 91% rename from accessible/src/base/nsApplicationAccessible.h rename to accessible/src/generic/ApplicationAccessible.h index b89bf4c8682..a0d32d7b876 100644 --- a/accessible/src/base/nsApplicationAccessible.h +++ b/accessible/src/generic/ApplicationAccessible.h @@ -40,8 +40,8 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef __NS_APPLICATION_ACCESSIBLE_H__ -#define __NS_APPLICATION_ACCESSIBLE_H__ +#ifndef MOZILLA_A11Y_APPLICATION_ACCESSIBLE_H__ +#define MOZILLA_A11Y_APPLICATION_ACCESSIBLE_H__ #include "nsAccessibleWrap.h" #include "nsIAccessibleApplication.h" @@ -50,21 +50,21 @@ #include "nsIXULAppInfo.h" /** - * nsApplicationAccessible is for the whole application of Mozilla. - * Only one instance of nsApplicationAccessible exists for one Mozilla instance. + * ApplicationAccessible is for the whole application of Mozilla. + * Only one instance of ApplicationAccessible exists for one Mozilla instance. * And this one should be created when Mozilla Startup (if accessibility * feature has been enabled) and destroyed when Mozilla Shutdown. * * All the accessibility objects for toplevel windows are direct children of - * the nsApplicationAccessible instance. + * the ApplicationAccessible instance. */ -class nsApplicationAccessible: public nsAccessibleWrap, - public nsIAccessibleApplication +class ApplicationAccessible: public nsAccessibleWrap, + public nsIAccessibleApplication { public: - nsApplicationAccessible(); + ApplicationAccessible(); // nsISupports NS_DECL_ISUPPORTS_INHERITED diff --git a/accessible/src/generic/Makefile.in b/accessible/src/generic/Makefile.in index 9d48538b112..5d942962507 100644 --- a/accessible/src/generic/Makefile.in +++ b/accessible/src/generic/Makefile.in @@ -15,6 +15,7 @@ LIBXUL_LIBRARY = 1 CPPSRCS = \ + ApplicationAccessible.cpp \ ARIAGridAccessible.cpp \ FormControlAccessible.cpp \ OuterDocAccessible.cpp \ diff --git a/accessible/src/mac/nsApplicationAccessibleWrap.h b/accessible/src/mac/ApplicationAccessibleWrap.h similarity index 90% rename from accessible/src/mac/nsApplicationAccessibleWrap.h rename to accessible/src/mac/ApplicationAccessibleWrap.h index 02114953eb5..a4e0ebac896 100644 --- a/accessible/src/mac/nsApplicationAccessibleWrap.h +++ b/accessible/src/mac/ApplicationAccessibleWrap.h @@ -38,12 +38,12 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef __NS_APPLICATION_ACCESSIBLE_WRAP_H__ -#define __NS_APPLICATION_ACCESSIBLE_WRAP_H__ +#ifndef MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ +#define MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ -#include "nsApplicationAccessible.h" +#include "ApplicationAccessible.h" -class nsApplicationAccessibleWrap: public nsApplicationAccessible +class ApplicationAccessibleWrap: public ApplicationAccessible { public: static void PreCreate() {} diff --git a/accessible/src/mac/Makefile.in b/accessible/src/mac/Makefile.in index acd72204aad..d735fd0a0dc 100644 --- a/accessible/src/mac/Makefile.in +++ b/accessible/src/mac/Makefile.in @@ -62,6 +62,7 @@ CMMSRCS = nsAccessNodeWrap.mm \ EXPORTS = \ + ApplicationAccessibleWrap.h \ ARIAGridAccessibleWrap.h \ nsAccessNodeWrap.h \ nsTextAccessibleWrap.h \ @@ -74,7 +75,6 @@ EXPORTS = \ nsHyperTextAccessibleWrap.h \ nsHTMLImageAccessibleWrap.h \ nsHTMLTableAccessibleWrap.h \ - nsApplicationAccessibleWrap.h \ mozDocAccessible.h \ mozAccessible.h \ mozAccessibleProtocol.h \ diff --git a/accessible/src/msaa/nsApplicationAccessibleWrap.cpp b/accessible/src/msaa/ApplicationAccessibleWrap.cpp similarity index 88% rename from accessible/src/msaa/nsApplicationAccessibleWrap.cpp rename to accessible/src/msaa/ApplicationAccessibleWrap.cpp index fe25c14f511..6828ed687a8 100644 --- a/accessible/src/msaa/nsApplicationAccessibleWrap.cpp +++ b/accessible/src/msaa/ApplicationAccessibleWrap.cpp @@ -38,7 +38,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsApplicationAccessibleWrap.h" +#include "ApplicationAccessibleWrap.h" #include "AccessibleApplication_i.c" @@ -48,11 +48,11 @@ //////////////////////////////////////////////////////////////////////////////// // nsISupports -NS_IMPL_ISUPPORTS_INHERITED0(nsApplicationAccessibleWrap, - nsApplicationAccessible) +NS_IMPL_ISUPPORTS_INHERITED0(ApplicationAccessibleWrap, + ApplicationAccessible) NS_IMETHODIMP -nsApplicationAccessibleWrap::GetAttributes(nsIPersistentProperties** aAttributes) +ApplicationAccessibleWrap::GetAttributes(nsIPersistentProperties** aAttributes) { NS_ENSURE_ARG_POINTER(aAttributes); *aAttributes = nsnull; @@ -80,7 +80,7 @@ nsApplicationAccessibleWrap::GetAttributes(nsIPersistentProperties** aAttributes // IUnknown STDMETHODIMP -nsApplicationAccessibleWrap::QueryInterface(REFIID iid, void** ppv) +ApplicationAccessibleWrap::QueryInterface(REFIID iid, void** ppv) { *ppv = NULL; @@ -97,7 +97,7 @@ nsApplicationAccessibleWrap::QueryInterface(REFIID iid, void** ppv) // IAccessibleApplication STDMETHODIMP -nsApplicationAccessibleWrap::get_appName(BSTR *aName) +ApplicationAccessibleWrap::get_appName(BSTR* aName) { __try { *aName = NULL; @@ -121,7 +121,7 @@ __try { } STDMETHODIMP -nsApplicationAccessibleWrap::get_appVersion(BSTR *aVersion) +ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion) { __try { *aVersion = NULL; @@ -145,7 +145,7 @@ __try { } STDMETHODIMP -nsApplicationAccessibleWrap::get_toolkitName(BSTR *aName) +ApplicationAccessibleWrap::get_toolkitName(BSTR* aName) { __try { if (IsDefunct()) @@ -167,7 +167,7 @@ __try { } STDMETHODIMP -nsApplicationAccessibleWrap::get_toolkitVersion(BSTR *aVersion) +ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion) { __try { *aVersion = NULL; @@ -191,15 +191,15 @@ __try { } //////////////////////////////////////////////////////////////////////////////// -// nsApplicationAccessibleWrap public static +// ApplicationAccessibleWrap public static void -nsApplicationAccessibleWrap::PreCreate() +ApplicationAccessibleWrap::PreCreate() { } void -nsApplicationAccessibleWrap::Unload() +ApplicationAccessibleWrap::Unload() { } diff --git a/accessible/src/msaa/nsApplicationAccessibleWrap.h b/accessible/src/msaa/ApplicationAccessibleWrap.h similarity index 90% rename from accessible/src/msaa/nsApplicationAccessibleWrap.h rename to accessible/src/msaa/ApplicationAccessibleWrap.h index 967be44c017..80e42f8a196 100644 --- a/accessible/src/msaa/nsApplicationAccessibleWrap.h +++ b/accessible/src/msaa/ApplicationAccessibleWrap.h @@ -38,15 +38,15 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef __NS_APPLICATION_ACCESSIBLE_WRAP_H__ -#define __NS_APPLICATION_ACCESSIBLE_WRAP_H__ +#ifndef MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ +#define MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ -#include "nsApplicationAccessible.h" +#include "ApplicationAccessible.h" #include "AccessibleApplication.h" -class nsApplicationAccessibleWrap: public nsApplicationAccessible, - public IAccessibleApplication +class ApplicationAccessibleWrap: public ApplicationAccessible, + public IAccessibleApplication { public: // nsISupporst diff --git a/accessible/src/msaa/Makefile.in b/accessible/src/msaa/Makefile.in index 02ce97d75a1..bf0d9fdde56 100644 --- a/accessible/src/msaa/Makefile.in +++ b/accessible/src/msaa/Makefile.in @@ -48,12 +48,13 @@ LIBXUL_LIBRARY = 1 CPPSRCS = \ + ApplicationAccessibleWrap.cpp \ + ARIAGridAccessibleWrap.cpp \ nsAccessNodeWrap.cpp \ nsAccessibleWrap.cpp \ nsTextAccessibleWrap.cpp \ nsDocAccessibleWrap.cpp \ nsHTMLWin32ObjectAccessible.cpp \ - ARIAGridAccessibleWrap.cpp \ nsRootAccessibleWrap.cpp \ nsXULMenuAccessibleWrap.cpp \ nsXULListboxAccessibleWrap.cpp \ @@ -61,7 +62,6 @@ CPPSRCS = \ nsHyperTextAccessibleWrap.cpp \ nsHTMLImageAccessibleWrap.cpp \ nsHTMLTableAccessibleWrap.cpp \ - nsApplicationAccessibleWrap.cpp \ nsWinUtils.cpp \ ia2AccessibleAction.cpp \ ia2AccessibleComponent.cpp \ @@ -78,6 +78,7 @@ CPPSRCS = \ $(NULL) EXPORTS = \ + ApplicationAccessibleWrap.h \ ARIAGridAccessibleWrap.h \ nsAccessNodeWrap.h \ nsAccessibleWrap.h \ @@ -91,7 +92,6 @@ EXPORTS = \ nsHyperTextAccessibleWrap.h \ nsHTMLImageAccessibleWrap.h \ nsHTMLTableAccessibleWrap.h \ - nsApplicationAccessibleWrap.h \ ia2AccessibleAction.h \ ia2AccessibleComponent.h \ CAccessibleImage.h \ diff --git a/accessible/src/msaa/nsAccessNodeWrap.cpp b/accessible/src/msaa/nsAccessNodeWrap.cpp index 56b4fb6be3b..3e57a9deb2a 100644 --- a/accessible/src/msaa/nsAccessNodeWrap.cpp +++ b/accessible/src/msaa/nsAccessNodeWrap.cpp @@ -39,11 +39,11 @@ #include "nsAccessNodeWrap.h" #include "AccessibleApplication.h" +#include "ApplicationAccessibleWrap.h" #include "ISimpleDOMNode_i.c" #include "Compatibility.h" #include "nsAccessibilityService.h" -#include "nsApplicationAccessibleWrap.h" #include "nsCoreUtils.h" #include "nsRootAccessible.h" #include "nsWinUtils.h" @@ -174,7 +174,7 @@ nsAccessNodeWrap::QueryService(REFGUID guidService, REFIID iid, void** ppv) // Can get to IAccessibleApplication from any node via QS if (iid == IID_IAccessibleApplication) { - nsApplicationAccessible *applicationAcc = GetApplicationAccessible(); + ApplicationAccessible* applicationAcc = GetApplicationAccessible(); if (!applicationAcc) return E_NOINTERFACE; diff --git a/accessible/src/other/nsApplicationAccessibleWrap.h b/accessible/src/other/ApplicationAccessibleWrap.h similarity index 90% rename from accessible/src/other/nsApplicationAccessibleWrap.h rename to accessible/src/other/ApplicationAccessibleWrap.h index 02114953eb5..a4e0ebac896 100644 --- a/accessible/src/other/nsApplicationAccessibleWrap.h +++ b/accessible/src/other/ApplicationAccessibleWrap.h @@ -38,12 +38,12 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef __NS_APPLICATION_ACCESSIBLE_WRAP_H__ -#define __NS_APPLICATION_ACCESSIBLE_WRAP_H__ +#ifndef MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ +#define MOZILLA_A11Y_APPLICATION_ACCESSIBLE_WRAP_H__ -#include "nsApplicationAccessible.h" +#include "ApplicationAccessible.h" -class nsApplicationAccessibleWrap: public nsApplicationAccessible +class ApplicationAccessibleWrap: public ApplicationAccessible { public: static void PreCreate() {} diff --git a/accessible/src/other/Makefile.in b/accessible/src/other/Makefile.in index 5e3e98ef939..d26eccdfe13 100644 --- a/accessible/src/other/Makefile.in +++ b/accessible/src/other/Makefile.in @@ -54,6 +54,7 @@ CPPSRCS = \ $(NULL) EXPORTS = \ + ApplicationAccessibleWrap.h \ ARIAGridAccessibleWrap.h \ nsAccessNodeWrap.h \ nsTextAccessibleWrap.h \ @@ -66,7 +67,6 @@ EXPORTS = \ nsHyperTextAccessibleWrap.h \ nsHTMLImageAccessibleWrap.h \ nsHTMLTableAccessibleWrap.h \ - nsApplicationAccessibleWrap.h \ $(NULL) # we don't want the shared lib, but we want to force the creation of a static lib. diff --git a/accessible/tests/mochitest/treeupdate/test_doc.html b/accessible/tests/mochitest/treeupdate/test_doc.html index 64d5bbd75e3..5341945e223 100644 --- a/accessible/tests/mochitest/treeupdate/test_doc.html +++ b/accessible/tests/mochitest/treeupdate/test_doc.html @@ -64,8 +64,7 @@ this.preinvoke = function rootContentRemoved_preinvoke() { // Set up target for hide event before we invoke. - var text = - getAccessible(getAccessible(getDocNode(aID)).firstChild).DOMNode; + var text = getAccessible(getAccessible(getDocNode(aID)).firstChild); this.eventSeq[0].target = text; } @@ -304,16 +303,21 @@ function insertElmUnderDocElmWhileBodyMissed(aID) { - this.docNode = getDocNode(aID); - this.inputNode = getDocNode(aID).createElement("input"); + this.docNode = null; + this.inputNode = null; + + function getInputNode() + { return this.inputNode; } this.eventSeq = [ - new invokerChecker(EVENT_SHOW, this.inputNode), - new invokerChecker(EVENT_REORDER, this.docNode) + new invokerChecker(EVENT_SHOW, getInputNode.bind(this)), + new invokerChecker(EVENT_REORDER, getDocNode, aID) ]; this.invoke = function invoke() { + this.docNode = getDocNode(aID); + this.inputNode = this.docNode.createElement("input"); this.docNode.documentElement.appendChild(this.inputNode); } @@ -389,6 +393,7 @@ // Test //gA11yEventDumpID = "eventdump"; // debug stuff + //gA11yEventDumpToConsole = true; var gQueue = null; diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 52e5afa7d19..38eb62a7e88 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -425,9 +425,10 @@ pref("browser.link.open_newwindow", 3); // 2: don't divert window.open with features pref("browser.link.open_newwindow.restriction", 0); -// Enable browser frame +// Enable browser frames, but not OOP. pref("dom.mozBrowserFramesEnabled", true); pref("dom.mozBrowserFramesWhitelist", "http://homescreen.gaiamobile.org,http://browser.gaiamobile.org"); +pref("dom.ipc.tabs.disabled", true); // Temporary permission hack for WebSMS pref("dom.sms.enabled", true); diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index 1aa80ade804..3ae1f95d454 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -524,6 +524,25 @@ phase="capturing" modifiers="accel" action="this.selectEngine(event, (event.detail > 0));"/> + + + diff --git a/browser/components/sessionstore/test/browser_705597.js b/browser/components/sessionstore/test/browser_705597.js index 993164c1b4d..dd434545c45 100644 --- a/browser/components/sessionstore/test/browser_705597.js +++ b/browser/components/sessionstore/test/browser_705597.js @@ -18,11 +18,11 @@ function test() { let browser = tab.linkedBrowser; - whenBrowserLoaded(browser, function () { - ss.setTabState(tab, JSON.stringify(tabState)); + waitForTabState(tab, tabState, function () { let sessionHistory = browser.sessionHistory; let entry = sessionHistory.getEntryAtIndex(0, false); + entry.QueryInterface(Ci.nsISHContainer); whenChildCount(entry, 1, function () { whenChildCount(entry, 2, function () { @@ -49,13 +49,6 @@ function test() { }); } -function whenBrowserLoaded(aBrowser, aCallback) { - aBrowser.addEventListener("load", function onLoad() { - aBrowser.removeEventListener("load", onLoad, true); - executeSoon(aCallback); - }, true); -} - function whenChildCount(aEntry, aChildCount, aCallback) { if (aEntry.childCount == aChildCount) aCallback(); diff --git a/browser/components/sessionstore/test/browser_707862.js b/browser/components/sessionstore/test/browser_707862.js index 2095d5b328f..5dc71efeb43 100644 --- a/browser/components/sessionstore/test/browser_707862.js +++ b/browser/components/sessionstore/test/browser_707862.js @@ -18,11 +18,11 @@ function test() { let browser = tab.linkedBrowser; - whenBrowserLoaded(browser, function () { - ss.setTabState(tab, JSON.stringify(tabState)); + waitForTabState(tab, tabState, function() { let sessionHistory = browser.sessionHistory; let entry = sessionHistory.getEntryAtIndex(0, false); + entry.QueryInterface(Ci.nsISHContainer); whenChildCount(entry, 1, function () { whenChildCount(entry, 2, function () { @@ -50,13 +50,6 @@ function test() { }); } -function whenBrowserLoaded(aBrowser, aCallback) { - aBrowser.addEventListener("load", function onLoad() { - aBrowser.removeEventListener("load", onLoad, true); - executeSoon(aCallback); - }, true); -} - function whenChildCount(aEntry, aChildCount, aCallback) { if (aEntry.childCount == aChildCount) aCallback(); diff --git a/browser/components/sessionstore/test/head.js b/browser/components/sessionstore/test/head.js index 4c34b366677..a5f451d52c1 100644 --- a/browser/components/sessionstore/test/head.js +++ b/browser/components/sessionstore/test/head.js @@ -45,6 +45,10 @@ registerCleanupFunction(function () { Services.prefs.clearUserPref("browser.sessionstore.restore_on_demand"); }); +// This kicks off the search service used on about:home and allows the +// session restore tests to be run standalone without triggering errors. +Cc["@mozilla.org/browser/clh;1"].getService(Ci.nsIBrowserHandler).defaultArgs; + // This assumes that tests will at least have some state/entries function waitForBrowserState(aState, aSetStateCallback) { let windows = [window]; @@ -128,6 +132,27 @@ function waitForBrowserState(aState, aSetStateCallback) { ss.setBrowserState(JSON.stringify(aState)); } +// Doesn't assume that the tab needs to be closed in a cleanup function. +// If that's the case, the test author should handle that in the test. +function waitForTabState(aTab, aState, aCallback) { + let listening = true; + + function onSSTabRestored() { + aTab.removeEventListener("SSTabRestored", onSSTabRestored, false); + listening = false; + aCallback(); + } + + aTab.addEventListener("SSTabRestored", onSSTabRestored, false); + + registerCleanupFunction(function() { + if (listening) { + aTab.removeEventListener("SSTabRestored", onSSTabRestored, false); + } + }); + ss.setTabState(aTab, JSON.stringify(aState)); +} + // waitForSaveState waits for a state write but not necessarily for the state to // turn dirty. function waitForSaveState(aSaveStateCallback) { @@ -166,6 +191,13 @@ function waitForSaveState(aSaveStateCallback) { Services.obs.addObserver(observer, topic, false); }; +function whenBrowserLoaded(aBrowser, aCallback) { + aBrowser.addEventListener("load", function onLoad() { + aBrowser.removeEventListener("load", onLoad, true); + executeSoon(aCallback); + }, true); +} + var gUniqueCounter = 0; function r() { return Date.now() + "-" + (++gUniqueCounter); diff --git a/build/mozinfo.py b/build/mozinfo.py deleted file mode 100755 index ffec2c3a6a8..00000000000 --- a/build/mozinfo.py +++ /dev/null @@ -1,209 +0,0 @@ -#!/usr/bin/env python - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla Corporation Code. -# -# The Initial Developer of the Original Code is -# Mikeal Rogers. -# Portions created by the Initial Developer are Copyright (C) 2008 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Mikeal Rogers -# Henrik Skupin -# Clint Talbert -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -""" -file for interface to transform introspected system information to a format -pallatable to Mozilla - -Information: -- os : what operating system ['win', 'mac', 'linux', ...] -- bits : 32 or 64 -- processor : processor architecture ['x86', 'x86_64', 'ppc', ...] -- version : operating system version string - -For windows, the service pack information is also included -""" - -# TODO: it might be a good idea of adding a system name (e.g. 'Ubuntu' for -# linux) to the information; I certainly wouldn't want anyone parsing this -# information and having behaviour depend on it - -import os -import platform -import re -import sys - -# keep a copy of the os module since updating globals overrides this -_os = os - -class unknown(object): - """marker class for unknown information""" - def __nonzero__(self): - return False - def __str__(self): - return 'UNKNOWN' -unknown = unknown() # singleton - -# get system information -info = {'os': unknown, - 'processor': unknown, - 'version': unknown, - 'bits': unknown } -(system, node, release, version, machine, processor) = platform.uname() -(bits, linkage) = platform.architecture() - -# get os information and related data -if system in ["Microsoft", "Windows"]: - info['os'] = 'win' - # There is a Python bug on Windows to determine platform values - # http://bugs.python.org/issue7860 - if "PROCESSOR_ARCHITEW6432" in os.environ: - processor = os.environ.get("PROCESSOR_ARCHITEW6432", processor) - else: - processor = os.environ.get('PROCESSOR_ARCHITECTURE', processor) - system = os.environ.get("OS", system).replace('_', ' ') - service_pack = os.sys.getwindowsversion()[4] - info['service_pack'] = service_pack -elif system == "Linux": - (distro, version, codename) = platform.dist() - version = distro + " " + version - if not processor: - processor = machine - info['os'] = 'linux' -elif system == "Darwin": - (release, versioninfo, machine) = platform.mac_ver() - version = "OS X " + release - info['os'] = 'mac' -elif sys.platform in ('solaris', 'sunos5'): - info['os'] = 'unix' - version = sys.platform -info['version'] = version # os version - -# processor type and bits -if processor in ["i386", "i686"]: - if bits == "32bit": - processor = "x86" - elif bits == "64bit": - processor = "x86_64" -elif processor == "AMD64": - bits = "64bit" - processor = "x86_64" -elif processor == "Power Macintosh": - processor = "ppc" -bits = re.search('(\d+)bit', bits).group(1) -info.update({'processor': processor, - 'bits': int(bits), - }) - -# standard value of choices, for easy inspection -choices = {'os': ['linux', 'win', 'mac', 'unix'], - 'bits': [32, 64], - 'processor': ['x86', 'x86_64', 'ppc']} - - -def sanitize(info): - """Do some sanitization of input values, primarily - to handle universal Mac builds.""" - if "processor" in info and info["processor"] == "universal-x86-x86_64": - # If we're running on OS X 10.6 or newer, assume 64-bit - if release[:4] >= "10.6": - info["processor"] = "x86_64" - info["bits"] = 64 - else: - info["processor"] = "x86" - info["bits"] = 32 - -# method for updating information -def update(new_info): - """update the info""" - info.update(new_info) - sanitize(info) - globals().update(info) - - # convenience data for os access - for os_name in choices['os']: - globals()['is' + os_name.title()] = info['os'] == os_name - # unix is special - if isLinux: - globals()['isUnix'] = True - -update({}) - -# exports -__all__ = info.keys() -__all__ += ['is' + os_name.title() for os_name in choices['os']] -__all__ += ['info', 'unknown', 'main', 'choices', 'update'] - - -def main(args=None): - - # parse the command line - from optparse import OptionParser - parser = OptionParser() - for key in choices: - parser.add_option('--%s' % key, dest=key, - action='store_true', default=False, - help="display choices for %s" % key) - options, args = parser.parse_args() - - # args are JSON blobs to override info - if args: - try: - from json import loads - except ImportError: - try: - from simplejson import loads - except ImportError: - def loads(string): - """*really* simple json; will not work with unicode""" - return eval(string, {'true': True, 'false': False, 'null': None}) - for arg in args: - if _os.path.exists(arg): - string = file(arg).read() - else: - string = arg - update(loads(string)) - - # print out choices if requested - flag = False - for key, value in options.__dict__.items(): - if value is True: - print '%s choices: %s' % (key, ' '.join([str(choice) - for choice in choices[key]])) - flag = True - if flag: return - - # otherwise, print out all info - for key, value in info.items(): - print '%s: %s' % (key, value) - -if __name__ == '__main__': - main() diff --git a/configure.in b/configure.in index 431b40f6c6a..59dfc1fa118 100644 --- a/configure.in +++ b/configure.in @@ -6327,44 +6327,6 @@ if test -n "$MOZ_TREE_FREETYPE"; then AC_SUBST(CAIRO_FT_CFLAGS) fi -dnl ======================================================== -dnl Web App Runtime -dnl ======================================================== -MOZ_ARG_DISABLE_BOOL(webapp-runtime, -[ --disable-webapp-runtime Disable Web App Runtime], - MOZ_WEBAPP_RUNTIME=, - MOZ_WEBAPP_RUNTIME=1) -if test -n "$MOZ_WEBAPP_RUNTIME" -a "$OS_ARCH" = "WINNT"; then - # Disable Web App Runtime for Windows builds that use the new toolkit if the - # required major version and minimum minor version of Unicode NSIS isn't in - # the path. - REQ_NSIS_MAJOR_VER=2 - MIN_NSIS_MINOR_VER=33 - MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-2.46 makensisu makensis) - if test -z "$MAKENSISU" -o "$MAKENSISU" = ":"; then - AC_MSG_ERROR([To build the Web App Runtime you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path. To build without the Web App Runtime reconfigure using --disable-webapp-runtime.]) - fi - changequote(,) - MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'` - changequote([,]) - if test ! "$MAKENSISU_VER" = ""; then - MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'` - MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'` - fi - AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER]) - if test "$MAKENSISU_VER" = "" || - test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \ - ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([To build the Web App Runtime you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path. To build without the Web App Runtime reconfigure using --disable-webapp-runtime.]) - fi - AC_MSG_RESULT([yes]) -fi -AC_SUBST(MOZ_WEBAPP_RUNTIME) -if test "$MOZ_WEBAPP_RUNTIME"; then - AC_DEFINE(MOZ_WEBAPP_RUNTIME) -fi - dnl ======================================================== dnl Installer dnl ======================================================== @@ -6403,6 +6365,21 @@ if test "$OS_ARCH" = "WINNT"; then fi fi +dnl ======================================================== +dnl Web App Runtime +dnl ======================================================== +MOZ_ARG_DISABLE_BOOL(webapp-runtime, +[ --disable-webapp-runtime Disable Web App Runtime], + MOZ_WEBAPP_RUNTIME=, + MOZ_WEBAPP_RUNTIME=1) +if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then + MOZ_WEBAPP_RUNTIME= +fi +AC_SUBST(MOZ_WEBAPP_RUNTIME) +if test "$MOZ_WEBAPP_RUNTIME"; then + AC_DEFINE(MOZ_WEBAPP_RUNTIME) +fi + AC_MSG_CHECKING([for tar archiver]) AC_CHECK_PROGS(TAR, gnutar gtar tar, "") if test -z "$TAR"; then diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index b5edfe1f8dd..cd788dbb3f5 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -457,8 +457,13 @@ nsFrameLoader::ReallyStartLoadingInternal() } } - // FIXME get error codes from child - mRemoteBrowser->LoadURL(mURIToLoad); + if (mRemoteBrowserShown || ShowRemoteFrame(nsIntSize(0, 0))) { + // FIXME get error codes from child + mRemoteBrowser->LoadURL(mURIToLoad); + } else { + NS_WARNING("[nsFrameLoader] ReallyStartLoadingInternal tried but couldn't show remote browser.\n"); + } + return NS_OK; } @@ -912,6 +917,18 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size) // cross-process layers; need to figure out what behavior we really // want here. For now, hack. if (!mRemoteBrowserShown) { + if (!mOwnerContent || + !mOwnerContent->GetCurrentDoc()) { + return false; + } + + nsRefPtr layerManager = + nsContentUtils::LayerManagerForDocument(mOwnerContent->GetCurrentDoc()); + if (!layerManager) { + // This is just not going to work. + return false; + } + mRemoteBrowser->Show(size); mRemoteBrowserShown = true; @@ -1355,19 +1372,27 @@ nsFrameLoader::SetOwnerContent(Element* aContent) } } +bool +nsFrameLoader::OwnerIsBrowserFrame() +{ + nsCOMPtr browserFrame = do_QueryInterface(mOwnerContent); + bool isBrowser = false; + if (browserFrame) { + browserFrame->GetReallyIsBrowser(&isBrowser); + } + return isBrowser; +} + bool nsFrameLoader::ShouldUseRemoteProcess() { - // Check for *disabled* multi-process first: environment, pref - // Then check for *enabled* multi-process attribute - // Default is not-remote. - if (PR_GetEnv("MOZ_DISABLE_OOP_TABS") || Preferences::GetBool("dom.ipc.tabs.disabled", false)) { return false; } - return (bool) mOwnerContent->AttrValueIs(kNameSpaceID_None, + return OwnerIsBrowserFrame() || + (bool) mOwnerContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote, nsGkAtoms::_true, eCaseMatters); @@ -1842,24 +1867,27 @@ nsFrameLoader::TryRemoteBrowser() nsCOMPtr parentAsItem(do_QueryInterface(parentAsWebNav)); - PRInt32 parentType; - parentAsItem->GetItemType(&parentType); + //