зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to build-system.
This commit is contained in:
Коммит
c1eec06aa3
4
.hgtags
4
.hgtags
|
@ -62,3 +62,7 @@ b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE_20110406
|
|||
a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE
|
||||
a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE_20110406
|
||||
a95d426422816513477e5863add1b00ac7041dcb AURORA_BASE_20110412
|
||||
138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R14
|
||||
9eae975b3d6fb7748fe5a3c0113d449b1c7cc0b2 AURORA_BASE_20110524
|
||||
138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R14
|
||||
462c726144bc1fb45b61e774f64ac5d61b4e047c UPDATE_PACKAGING_R14
|
||||
|
|
|
@ -162,7 +162,7 @@ ifdef MOZ_SYMBOLS_EXTRA_BUILDID
|
|||
EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
|
||||
endif
|
||||
|
||||
export SYMBOL_INDEX_NAME = \
|
||||
SYMBOL_INDEX_NAME = \
|
||||
$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
|
||||
|
||||
buildsymbols:
|
||||
|
@ -194,7 +194,7 @@ endif # MOZ_CRASHREPORTER
|
|||
|
||||
uploadsymbols:
|
||||
ifdef MOZ_CRASHREPORTER
|
||||
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
|
||||
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
|
||||
endif
|
||||
|
||||
# defined in package-name.mk
|
||||
|
|
|
@ -341,9 +341,7 @@ void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
|
|||
if (!maiHyperlink && !aMaiHyperlink) {
|
||||
return; // Never set and we're shutting down
|
||||
}
|
||||
if (maiHyperlink) {
|
||||
delete maiHyperlink;
|
||||
}
|
||||
delete maiHyperlink;
|
||||
g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink,
|
||||
aMaiHyperlink);
|
||||
}
|
||||
|
|
|
@ -477,7 +477,8 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
|||
eNoValue,
|
||||
eSwitchAction,
|
||||
eNoLiveAttr,
|
||||
kNoReqStates
|
||||
kNoReqStates,
|
||||
eARIASelectable
|
||||
},
|
||||
{
|
||||
"tablist",
|
||||
|
|
|
@ -199,23 +199,32 @@ private:
|
|||
printf("uri: %s", spec);
|
||||
|
||||
#define NS_LOG_ACCDOC_TYPE(aDocument) \
|
||||
PRBool isContent = nsCoreUtils::IsContentDocument(aDocument); \
|
||||
printf("%s document", (isContent ? "content" : "chrome"));
|
||||
if (aDocument->IsActive()) { \
|
||||
PRBool isContent = nsCoreUtils::IsContentDocument(aDocument); \
|
||||
printf("%s document", (isContent ? "content" : "chrome")); \
|
||||
} else { \
|
||||
printf("document type: [failed]"); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_SHELLSTATE(aDocument) \
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer(); \
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container); \
|
||||
PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE; \
|
||||
docShell->GetBusyFlags(&busyFlags); \
|
||||
nsCAutoString docShellBusy; \
|
||||
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE) \
|
||||
docShellBusy.AppendLiteral("'none'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY) \
|
||||
docShellBusy.AppendLiteral("'busy'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD) \
|
||||
docShellBusy.AppendLiteral(", 'before page load'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING) \
|
||||
docShellBusy.AppendLiteral(", 'page loading'"); \
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer(); \
|
||||
if (container) { \
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container); \
|
||||
PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE; \
|
||||
docShell->GetBusyFlags(&busyFlags); \
|
||||
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE) \
|
||||
docShellBusy.AppendLiteral("'none'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY) \
|
||||
docShellBusy.AppendLiteral("'busy'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD) \
|
||||
docShellBusy.AppendLiteral(", 'before page load'"); \
|
||||
if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING) \
|
||||
docShellBusy.AppendLiteral(", 'page loading'"); \
|
||||
} \
|
||||
else { \
|
||||
docShellBusy.AppendLiteral("[failed]"); \
|
||||
} \
|
||||
printf("docshell busy: %s", docShellBusy.get());
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCSTATES(aDocument) \
|
||||
|
@ -336,20 +345,22 @@ private:
|
|||
printf(" "); \
|
||||
NS_LOG_ACCDOC_ADDRESS(aDocument, aDocAcc) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_URI(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_SHELLSTATE(aDocument) \
|
||||
printf("; "); \
|
||||
NS_LOG_ACCDOC_TYPE(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCSTATES(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCPRESSHELL(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCLOADGROUP(aDocument) \
|
||||
printf(", "); \
|
||||
NS_LOG_ACCDOC_DOCPARENT(aDocument) \
|
||||
printf("\n"); \
|
||||
if (aDocument) { \
|
||||
NS_LOG_ACCDOC_URI(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_SHELLSTATE(aDocument) \
|
||||
printf("; "); \
|
||||
NS_LOG_ACCDOC_TYPE(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCSTATES(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCPRESSHELL(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCLOADGROUP(aDocument) \
|
||||
printf(", "); \
|
||||
NS_LOG_ACCDOC_DOCPARENT(aDocument) \
|
||||
printf("\n"); \
|
||||
} \
|
||||
}
|
||||
#define NS_LOG_ACCDOC_DOCINFO_END \
|
||||
printf(" }\n");
|
||||
|
|
|
@ -67,7 +67,7 @@ struct WalkState
|
|||
nsAccTreeWalker::
|
||||
nsAccTreeWalker(nsIWeakReference* aShell, nsIContent* aContent,
|
||||
PRBool aWalkAnonContent, bool aWalkCache) :
|
||||
mWeakShell(aShell), mState(nsnull), mWalkCache(aWalkCache)
|
||||
mWeakShell(aShell), mWalkCache(aWalkCache), mState(nsnull)
|
||||
{
|
||||
NS_ASSERTION(aContent, "No node for the accessible tree walker!");
|
||||
|
||||
|
|
|
@ -160,7 +160,8 @@ nsAccUtils::GetPositionAndSizeForXULSelectControlItem(nsIContent *aContent,
|
|||
control->GetItemAtIndex(index, getter_AddRefs(currItem));
|
||||
nsCOMPtr<nsINode> currNode(do_QueryInterface(currItem));
|
||||
|
||||
nsAccessible* itemAcc = GetAccService()->GetAccessible(currNode);
|
||||
nsAccessible* itemAcc = currNode ?
|
||||
GetAccService()->GetAccessible(currNode) : nsnull;
|
||||
|
||||
if (!itemAcc || itemAcc->State() & states::INVISIBLE) {
|
||||
(*aSetSize)--;
|
||||
|
@ -201,7 +202,8 @@ nsAccUtils::GetPositionAndSizeForXULContainerItem(nsIContent *aContent,
|
|||
container->GetItemAtIndex(index, getter_AddRefs(item));
|
||||
nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
|
||||
|
||||
nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
|
||||
nsAccessible* itemAcc = itemNode ?
|
||||
GetAccService()->GetAccessible(itemNode) : nsnull;
|
||||
|
||||
if (itemAcc) {
|
||||
PRUint32 itemRole = Role(itemAcc);
|
||||
|
@ -220,8 +222,9 @@ nsAccUtils::GetPositionAndSizeForXULContainerItem(nsIContent *aContent,
|
|||
nsCOMPtr<nsIDOMXULElement> item;
|
||||
container->GetItemAtIndex(index, getter_AddRefs(item));
|
||||
nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
|
||||
|
||||
nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
|
||||
|
||||
nsAccessible* itemAcc =
|
||||
itemNode ? GetAccService()->GetAccessible(itemNode) : nsnull;
|
||||
|
||||
if (itemAcc) {
|
||||
PRUint32 itemRole = Role(itemAcc);
|
||||
|
|
|
@ -55,9 +55,6 @@
|
|||
#include "nsIDOMCSSPrimitiveValue.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
@ -135,6 +132,12 @@ void nsAccessNode::LastRelease()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessNode public
|
||||
|
||||
bool
|
||||
nsAccessNode::IsDefunct() const
|
||||
{
|
||||
return !mContent;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsAccessNode::Init()
|
||||
{
|
||||
|
|
|
@ -120,11 +120,6 @@ public:
|
|||
*/
|
||||
already_AddRefed<nsINode> GetCurrentFocus();
|
||||
|
||||
/**
|
||||
* Returns true when the accessible is defunct.
|
||||
*/
|
||||
virtual PRBool IsDefunct() { return !mContent; }
|
||||
|
||||
/**
|
||||
* Initialize the access node object, add it to the cache.
|
||||
*/
|
||||
|
@ -135,6 +130,11 @@ public:
|
|||
*/
|
||||
virtual void Shutdown();
|
||||
|
||||
/**
|
||||
* Returns true when the accessible is defunct.
|
||||
*/
|
||||
virtual bool IsDefunct() const;
|
||||
|
||||
/**
|
||||
* Return frame for the given access node object.
|
||||
*/
|
||||
|
@ -171,7 +171,7 @@ public:
|
|||
nsINode* node = GetNode();
|
||||
return node && node->IsElement();
|
||||
}
|
||||
PRBool IsDocument() const
|
||||
bool IsDocumentNode() const
|
||||
{
|
||||
return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#include "nsImageFrame.h"
|
||||
#include "nsILink.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPluginInstance.h"
|
||||
#include "nsNPAPIPluginInstance.h"
|
||||
#include "nsISupportsUtils.h"
|
||||
#include "nsObjectFrame.h"
|
||||
#include "nsOuterDocAccessible.h"
|
||||
|
@ -346,8 +346,8 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
|
|||
|
||||
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
|
||||
// 2) for plugins
|
||||
nsCOMPtr<nsIPluginInstance> pluginInstance;
|
||||
if (NS_SUCCEEDED(aFrame->GetPluginInstance(*getter_AddRefs(pluginInstance))) &&
|
||||
nsRefPtr<nsNPAPIPluginInstance> pluginInstance;
|
||||
if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) &&
|
||||
pluginInstance) {
|
||||
#ifdef XP_WIN
|
||||
// Note: pluginPort will be null if windowless.
|
||||
|
@ -842,6 +842,8 @@ nsAccessibilityService::GetAccessibleInShell(nsINode* aNode,
|
|||
nsAccessible*
|
||||
nsAccessibilityService::GetAccessible(nsINode* aNode)
|
||||
{
|
||||
NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash.");
|
||||
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
|
||||
return document ? document->GetAccessible(aNode) : nsnull;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "nsIDOMDocumentTraversal.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIDOMNodeFilter.h"
|
||||
|
@ -1534,15 +1533,20 @@ nsAccessible::State()
|
|||
return states::DEFUNCT;
|
||||
|
||||
PRUint64 state = NativeState();
|
||||
// Apply ARIA states to be sure accessible states will be overriden.
|
||||
// Apply ARIA states to be sure accessible states will be overridden.
|
||||
ApplyARIAState(&state);
|
||||
|
||||
if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB) {
|
||||
if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB &&
|
||||
!(state & states::SELECTED) &&
|
||||
!mContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsAccessibilityAtoms::aria_selected,
|
||||
nsAccessibilityAtoms::_false, eCaseMatters)) {
|
||||
// Special case: for tabs, focused implies selected, unless explicitly
|
||||
// false, i.e. aria-selected="false".
|
||||
if (state & states::FOCUSED) {
|
||||
state |= states::SELECTED;
|
||||
} else {
|
||||
// Expose 'selected' state on ARIA tab if the focus is on internal element
|
||||
// of related tabpanel.
|
||||
// If focus is in a child of the tab panel surely the tab is selected!
|
||||
nsCOMPtr<nsIAccessible> tabPanel = nsRelUtils::
|
||||
GetRelatedAccessible(this, nsIAccessibleRelation::RELATION_LABEL_FOR);
|
||||
|
||||
|
@ -3220,16 +3224,15 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
|
|||
if (accessible)
|
||||
return accessible;
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentTraversal> trav =
|
||||
do_QueryInterface(aStartNode->GetOwnerDoc());
|
||||
NS_ENSURE_TRUE(trav, nsnull);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->GetOwnerDoc());
|
||||
NS_ENSURE_TRUE(domDoc, nsnull);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
|
||||
nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(GetNode()));
|
||||
nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
|
||||
nsCOMPtr<nsIDOMTreeWalker> walker;
|
||||
trav->CreateTreeWalker(rootNode,
|
||||
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
|
||||
nsnull, PR_FALSE, getter_AddRefs(walker));
|
||||
domDoc->CreateTreeWalker(rootNode,
|
||||
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
|
||||
nsnull, PR_FALSE, getter_AddRefs(walker));
|
||||
NS_ENSURE_TRUE(walker, nsnull);
|
||||
|
||||
walker->SetCurrentNode(currentNode);
|
||||
|
|
|
@ -376,6 +376,9 @@ public:
|
|||
|
||||
inline bool IsApplication() const { return mFlags & eApplicationAccessible; }
|
||||
|
||||
inline bool IsDoc() const { return mFlags & eDocAccessible; }
|
||||
nsDocAccessible* AsDoc();
|
||||
|
||||
inline bool IsHyperText() const { return mFlags & eHyperTextAccessible; }
|
||||
nsHyperTextAccessible* AsHyperText();
|
||||
|
||||
|
@ -529,10 +532,11 @@ protected:
|
|||
*/
|
||||
enum AccessibleTypes {
|
||||
eApplicationAccessible = 1 << 2,
|
||||
eHyperTextAccessible = 1 << 3,
|
||||
eHTMLListItemAccessible = 1 << 4,
|
||||
eRootAccessible = 1 << 5,
|
||||
eTextLeafAccessible = 1 << 6
|
||||
eDocAccessible = 1 << 3,
|
||||
eHyperTextAccessible = 1 << 4,
|
||||
eHTMLListItemAccessible = 1 << 5,
|
||||
eRootAccessible = 1 << 6,
|
||||
eTextLeafAccessible = 1 << 7
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -332,8 +332,8 @@ nsApplicationAccessible::GetPlatformVersion(nsAString& aVersion)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessNode public methods
|
||||
|
||||
PRBool
|
||||
nsApplicationAccessible::IsDefunct()
|
||||
bool
|
||||
nsApplicationAccessible::IsDefunct() const
|
||||
{
|
||||
return nsAccessibilityService::IsShutdown();
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
NS_DECL_NSIACCESSIBLEAPPLICATION
|
||||
|
||||
// nsAccessNode
|
||||
virtual PRBool IsDefunct();
|
||||
virtual bool IsDefunct() const;
|
||||
virtual PRBool Init();
|
||||
virtual void Shutdown();
|
||||
virtual bool IsPrimaryForNode() const;
|
||||
|
|
|
@ -93,7 +93,7 @@ nsLeafAccessible::CacheChildren()
|
|||
nsLinkableAccessible::
|
||||
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
|
||||
nsAccessibleWrap(aContent, aShell),
|
||||
mActionContent(nsnull),
|
||||
mActionAcc(nsnull),
|
||||
mIsLink(PR_FALSE),
|
||||
mIsOnclick(PR_FALSE)
|
||||
{
|
||||
|
@ -107,11 +107,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap)
|
|||
NS_IMETHODIMP
|
||||
nsLinkableAccessible::TakeFocus()
|
||||
{
|
||||
nsAccessible *actionAcc = GetActionAccessible();
|
||||
if (actionAcc)
|
||||
return actionAcc->TakeFocus();
|
||||
|
||||
return nsAccessibleWrap::TakeFocus();
|
||||
return mActionAcc ? mActionAcc->TakeFocus() : nsAccessibleWrap::TakeFocus();
|
||||
}
|
||||
|
||||
PRUint64
|
||||
|
@ -120,8 +116,7 @@ nsLinkableAccessible::NativeState()
|
|||
PRUint64 states = nsAccessibleWrap::NativeState();
|
||||
if (mIsLink) {
|
||||
states |= states::LINKED;
|
||||
nsAccessible* actionAcc = GetActionAccessible();
|
||||
if (actionAcc->State() & states::TRAVERSED)
|
||||
if (mActionAcc->State() & states::TRAVERSED)
|
||||
states |= states::TRAVERSED;
|
||||
}
|
||||
|
||||
|
@ -137,13 +132,7 @@ nsLinkableAccessible::GetValue(nsAString& aValue)
|
|||
if (!aValue.IsEmpty())
|
||||
return NS_OK;
|
||||
|
||||
if (mIsLink) {
|
||||
nsAccessible *actionAcc = GetActionAccessible();
|
||||
if (actionAcc)
|
||||
return actionAcc->GetValue(aValue);
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return mIsLink ? mActionAcc->GetValue(aValue) : NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,7 +141,7 @@ nsLinkableAccessible::GetNumActions(PRUint8 *aNumActions)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aNumActions);
|
||||
|
||||
*aNumActions = mActionContent ? 1 : 0;
|
||||
*aNumActions = (mIsOnclick || mIsLink) ? 1 : 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -182,11 +171,8 @@ nsLinkableAccessible::DoAction(PRUint8 aIndex)
|
|||
if (aIndex != eAction_Jump)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsAccessible *actionAcc = GetActionAccessible();
|
||||
if (actionAcc)
|
||||
return actionAcc->DoAction(aIndex);
|
||||
|
||||
return nsAccessibleWrap::DoAction(aIndex);
|
||||
return mActionAcc ? mActionAcc->DoAction(aIndex) :
|
||||
nsAccessibleWrap::DoAction(aIndex);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -194,11 +180,8 @@ nsLinkableAccessible::GetKeyboardShortcut(nsAString& aKeyboardShortcut)
|
|||
{
|
||||
aKeyboardShortcut.Truncate();
|
||||
|
||||
nsAccessible *actionAcc = GetActionAccessible();
|
||||
if (actionAcc)
|
||||
return actionAcc->GetKeyboardShortcut(aKeyboardShortcut);
|
||||
|
||||
return nsAccessible::GetKeyboardShortcut(aKeyboardShortcut);
|
||||
return mActionAcc ? mActionAcc->GetKeyboardShortcut(aKeyboardShortcut) :
|
||||
nsAccessible::GetKeyboardShortcut(aKeyboardShortcut);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -207,7 +190,9 @@ nsLinkableAccessible::GetKeyboardShortcut(nsAString& aKeyboardShortcut)
|
|||
void
|
||||
nsLinkableAccessible::Shutdown()
|
||||
{
|
||||
mActionContent = nsnull;
|
||||
mIsLink = PR_FALSE;
|
||||
mIsOnclick = PR_FALSE;
|
||||
mActionAcc = nsnull;
|
||||
nsAccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
|
@ -218,14 +203,11 @@ already_AddRefed<nsIURI>
|
|||
nsLinkableAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
|
||||
{
|
||||
if (mIsLink) {
|
||||
nsAccessible* link = GetActionAccessible();
|
||||
if (link) {
|
||||
NS_ASSERTION(link->IsHyperLink(),
|
||||
"nsIAccessibleHyperLink isn't implemented.");
|
||||
NS_ASSERTION(mActionAcc->IsHyperLink(),
|
||||
"nsIAccessibleHyperLink isn't implemented.");
|
||||
|
||||
if (link->IsHyperLink())
|
||||
return link->GetAnchorURI(aAnchorIndex);
|
||||
}
|
||||
if (mActionAcc->IsHyperLink())
|
||||
return mActionAcc->GetAnchorURI(aAnchorIndex);
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
|
@ -241,55 +223,35 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
|
|||
nsAccessibleWrap::BindToParent(aParent, aIndexInParent);
|
||||
|
||||
// Cache action content.
|
||||
mActionContent = nsnull;
|
||||
mActionAcc = nsnull;
|
||||
mIsLink = PR_FALSE;
|
||||
mIsOnclick = PR_FALSE;
|
||||
|
||||
nsIContent* walkUpContent = mContent;
|
||||
PRBool isOnclick = nsCoreUtils::HasClickListener(walkUpContent);
|
||||
|
||||
if (isOnclick) {
|
||||
mActionContent = walkUpContent;
|
||||
if (nsCoreUtils::HasClickListener(mContent)) {
|
||||
mIsOnclick = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
while ((walkUpContent = walkUpContent->GetParent())) {
|
||||
nsAccessible* walkUpAcc =
|
||||
GetAccService()->GetAccessibleInWeakShell(walkUpContent, mWeakShell);
|
||||
|
||||
// XXX: The logic looks broken since the click listener may be registered
|
||||
// on non accessible node in parent chain but this node is skipped when tree
|
||||
// is traversed.
|
||||
nsAccessible* walkUpAcc = this;
|
||||
while ((walkUpAcc = walkUpAcc->GetParent()) && !walkUpAcc->IsDoc()) {
|
||||
if (walkUpAcc && walkUpAcc->Role() == nsIAccessibleRole::ROLE_LINK &&
|
||||
walkUpAcc->State() & states::LINKED) {
|
||||
mIsLink = PR_TRUE;
|
||||
mActionContent = walkUpContent;
|
||||
mActionAcc = walkUpAcc;
|
||||
return;
|
||||
}
|
||||
|
||||
isOnclick = nsCoreUtils::HasClickListener(walkUpContent);
|
||||
if (isOnclick) {
|
||||
mActionContent = walkUpContent;
|
||||
if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
|
||||
mActionAcc = walkUpAcc;
|
||||
mIsOnclick = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsLinkableAccessible: protected
|
||||
|
||||
nsAccessible *
|
||||
nsLinkableAccessible::GetActionAccessible() const
|
||||
{
|
||||
// Return accessible for the action content if it's different from node of
|
||||
// this accessible. If the action accessible is not null then it is used to
|
||||
// redirect methods calls otherwise we use method implementation from the
|
||||
// base class.
|
||||
if (!mActionContent || mContent == mActionContent)
|
||||
return nsnull;
|
||||
|
||||
return GetAccService()->GetAccessibleInWeakShell(mActionContent, mWeakShell);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsEnumRoleAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -108,14 +108,10 @@ protected:
|
|||
// nsAccessible
|
||||
virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
|
||||
|
||||
// nsLinkableAccessible
|
||||
|
||||
/**
|
||||
* Return an accessible for cached action node.
|
||||
* Parent accessible that provides an action for this linkable accessible.
|
||||
*/
|
||||
nsAccessible *GetActionAccessible() const;
|
||||
|
||||
nsCOMPtr<nsIContent> mActionContent;
|
||||
nsAccessible* mActionAcc;
|
||||
PRPackedBool mIsLink;
|
||||
PRPackedBool mIsOnclick;
|
||||
};
|
||||
|
|
|
@ -352,12 +352,15 @@ nsCaretAccessible::GetCaretRect(nsIWidget **aOutWidget)
|
|||
}
|
||||
|
||||
nsPoint offset;
|
||||
// Offset from widget origin to the frame origin, which includes chrome
|
||||
// on the widget.
|
||||
*aOutWidget = frame->GetNearestWidget(offset);
|
||||
NS_ENSURE_TRUE(*aOutWidget, nsIntRect());
|
||||
rect.MoveBy(offset);
|
||||
|
||||
caretRect = rect.ToOutsidePixels(frame->PresContext()->AppUnitsPerDevPixel());
|
||||
caretRect.MoveBy((*aOutWidget)->WidgetToScreenOffset());
|
||||
// ((content screen origin) - (content offset in the widget)) = widget origin on the screen
|
||||
caretRect.MoveBy((*aOutWidget)->WidgetToScreenOffset() - (*aOutWidget)->GetClientOffset());
|
||||
|
||||
// Correct for character size, so that caret always matches the size of the character
|
||||
// This is important for font size transitions, and is necessary because the Gecko caret uses the
|
||||
|
|
|
@ -493,12 +493,10 @@ nsCoreUtils::IsErrorPage(nsIDocument *aDocument)
|
|||
nsCAutoString path;
|
||||
uri->GetPath(path);
|
||||
|
||||
nsCAutoString::const_iterator start, end;
|
||||
path.BeginReading(start);
|
||||
path.EndReading(end);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(neterror, "neterror");
|
||||
return FindInReadable(neterror, start, end);
|
||||
NS_NAMED_LITERAL_CSTRING(certerror, "certerror");
|
||||
|
||||
return StringBeginsWith(path, neterror) || StringBeginsWith(path, certerror);
|
||||
}
|
||||
|
||||
PRBool
|
||||
|
|
|
@ -54,8 +54,6 @@
|
|||
#include "nsIDOMCharacterData.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMNSHTMLDocument.h"
|
||||
#include "nsIDOMXULDocument.h"
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
@ -109,6 +107,8 @@ nsDocAccessible::
|
|||
mDocument(aDocument), mScrollPositionChangedTicks(0), mIsLoaded(PR_FALSE),
|
||||
mCacheRoot(nsnull), mIsPostCacheProcessing(PR_FALSE)
|
||||
{
|
||||
mFlags |= eDocAccessible;
|
||||
|
||||
mDependentIDsHash.Init();
|
||||
// XXX aaronl should we use an algorithm for the initial cache size?
|
||||
mAccessibleCache.Init(kDefaultCacheSize);
|
||||
|
@ -409,22 +409,24 @@ NS_IMETHODIMP nsDocAccessible::GetURL(nsAString& aURL)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDocAccessible::GetTitle(nsAString& aTitle)
|
||||
NS_IMETHODIMP
|
||||
nsDocAccessible::GetTitle(nsAString& aTitle)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
|
||||
if (domnsDocument) {
|
||||
return domnsDocument->GetTitle(aTitle);
|
||||
nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocument);
|
||||
if (!domDocument) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
return domDocument->GetTitle(aTitle);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDocAccessible::GetMimeType(nsAString& aMimeType)
|
||||
NS_IMETHODIMP
|
||||
nsDocAccessible::GetMimeType(nsAString& aMimeType)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
|
||||
if (domnsDocument) {
|
||||
return domnsDocument->GetContentType(aMimeType);
|
||||
nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocument);
|
||||
if (!domDocument) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
return domDocument->GetContentType(aMimeType);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDocAccessible::GetDocType(nsAString& aDocType)
|
||||
|
@ -605,6 +607,12 @@ nsDocAccessible::Init()
|
|||
if (!mNotificationController)
|
||||
return PR_FALSE;
|
||||
|
||||
// Mark the document accessible as loaded if its DOM document was loaded at
|
||||
// this point (this can happen because a11y is started late or DOM document
|
||||
// having no container was loaded.
|
||||
if (mDocument->GetReadyStateEnum() == nsIDocument::READYSTATE_COMPLETE)
|
||||
mIsLoaded = PR_TRUE;
|
||||
|
||||
AddEventListeners();
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -668,8 +676,8 @@ nsDocAccessible::GetFrame() const
|
|||
return root;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsDocAccessible::IsDefunct()
|
||||
bool
|
||||
nsDocAccessible::IsDefunct() const
|
||||
{
|
||||
return nsHyperTextAccessibleWrap::IsDefunct() || !mDocument;
|
||||
}
|
||||
|
@ -1035,6 +1043,14 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
|
|||
return;
|
||||
}
|
||||
|
||||
if (aAttribute == nsAccessibilityAtoms::aria_busy) {
|
||||
PRBool isOn = !aContent->AttrValueIs(aNameSpaceID, aAttribute,
|
||||
nsAccessibilityAtoms::_true, eCaseMatters);
|
||||
nsRefPtr<AccEvent> event = new AccStateChangeEvent(aContent, states::BUSY, isOn);
|
||||
FireDelayedAccessibleEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aAttribute == nsAccessibilityAtoms::selected ||
|
||||
aAttribute == nsAccessibilityAtoms::aria_selected) {
|
||||
// ARIA or XUL selection
|
||||
|
@ -1114,7 +1130,8 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
|
|||
// at least until native API comes up with a more meaningful event.
|
||||
if (aAttribute == nsAccessibilityAtoms::aria_grabbed ||
|
||||
aAttribute == nsAccessibilityAtoms::aria_dropeffect ||
|
||||
aAttribute == nsAccessibilityAtoms::aria_hidden) {
|
||||
aAttribute == nsAccessibilityAtoms::aria_hidden ||
|
||||
aAttribute == nsAccessibilityAtoms::aria_sort) {
|
||||
FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED,
|
||||
aContent);
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
virtual PRBool Init();
|
||||
virtual void Shutdown();
|
||||
virtual nsIFrame* GetFrame() const;
|
||||
virtual PRBool IsDefunct();
|
||||
virtual bool IsDefunct() const;
|
||||
virtual nsINode* GetNode() const { return mDocument; }
|
||||
virtual nsIDocument* GetDocumentNode() const { return mDocument; }
|
||||
|
||||
|
@ -552,4 +552,11 @@ protected:
|
|||
NS_DEFINE_STATIC_IID_ACCESSOR(nsDocAccessible,
|
||||
NS_DOCACCESSIBLE_IMPL_CID)
|
||||
|
||||
inline nsDocAccessible*
|
||||
nsAccessible::AsDoc()
|
||||
{
|
||||
return mFlags & eDocAccessible ?
|
||||
static_cast<nsDocAccessible*>(this) : nsnull;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -213,8 +213,8 @@ nsOuterDocAccessible::RemoveChild(nsAccessible *aAccessible)
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
NS_LOG_ACCDOCDESTROY("remove document from outerdoc",
|
||||
child->GetDocumentNode())
|
||||
NS_LOG_ACCDOCDESTROY_FOR("remove document from outerdoc",
|
||||
child->GetDocumentNode(), child)
|
||||
NS_LOG_ACCDOCDESTROY_ACCADDRESS("outerdoc", this)
|
||||
|
||||
PRBool wasRemoved = nsAccessible::RemoveChild(child);
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#define CreateEvent CreateEventA
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
#include "States.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsApplicationAccessibleWrap.h"
|
||||
|
@ -48,7 +51,6 @@
|
|||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
|
@ -57,7 +59,6 @@
|
|||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIDOMHTMLSelectElement.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMXULMenuListElement.h"
|
||||
#include "nsIDOMXULMultSelectCntrlEl.h"
|
||||
|
@ -76,11 +77,8 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsRootAccessible.h"
|
||||
#include "nsIDOMNSEventTarget.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsXULTreeAccessible.h"
|
||||
|
@ -140,7 +138,7 @@ nsRootAccessible::GetName(nsAString& aName)
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNSDocument> document(do_QueryInterface(mDocument));
|
||||
nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(mDocument);
|
||||
return document->GetTitle(aName);
|
||||
}
|
||||
|
||||
|
@ -415,11 +413,11 @@ nsRootAccessible::FireCurrentFocusEvent()
|
|||
return; // No current focus
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(mDocument);
|
||||
if (docEvent) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
|
||||
if (domDoc) {
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
if (NS_SUCCEEDED(docEvent->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event))) &&
|
||||
if (NS_SUCCEEDED(domDoc->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event))) &&
|
||||
NS_SUCCEEDED(event->InitEvent(NS_LITERAL_STRING("focus"), PR_TRUE, PR_TRUE))) {
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
|
|
|
@ -297,7 +297,7 @@ nsTextEquivUtils::AppendFromValue(nsAccessible *aAccessible,
|
|||
}
|
||||
|
||||
//XXX: is it necessary to care the accessible is not a document?
|
||||
if (aAccessible->IsDocument())
|
||||
if (aAccessible->IsDocumentNode())
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsIContent *content = aAccessible->GetContent();
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsISelection2.h"
|
||||
#include "nsISelectionPrivate.h"
|
||||
|
|
|
@ -916,7 +916,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
|
||||
nsCOMPtr<nsFrameSelection> frameSelection;
|
||||
nsRefPtr<nsFrameSelection> frameSelection;
|
||||
rv = privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -1014,7 +1014,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
|
|||
}
|
||||
|
||||
if (aType == eGetBefore) {
|
||||
endOffset = aOffset;
|
||||
finalEndOffset = aOffset;
|
||||
}
|
||||
else {
|
||||
// Start moving forward from the start so that we don't get
|
||||
|
@ -1680,7 +1680,7 @@ PRInt32 nsHyperTextAccessible::GetCaretLineNumber()
|
|||
getter_AddRefs(domSel));
|
||||
nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
|
||||
NS_ENSURE_TRUE(privateSelection, -1);
|
||||
nsCOMPtr<nsFrameSelection> frameSelection;
|
||||
nsRefPtr<nsFrameSelection> frameSelection;
|
||||
privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
|
||||
NS_ENSURE_TRUE(frameSelection, -1);
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
|
|||
if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
|
||||
return NSAccessibilityRoleDescription([self role], nil);
|
||||
#endif
|
||||
if ([attribute isEqualToString:kInstanceDescriptionAttribute])
|
||||
if ([attribute isEqualToString: (NSString*) kInstanceDescriptionAttribute])
|
||||
return [self customDescription];
|
||||
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
|
||||
return [NSNumber numberWithBool:[self isFocused]];
|
||||
|
@ -246,7 +246,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
|
|||
return [self size];
|
||||
if ([attribute isEqualToString:NSAccessibilityWindowAttribute])
|
||||
return [self window];
|
||||
if ([attribute isEqualToString:kTopLevelUIElementAttribute])
|
||||
if ([attribute isEqualToString: (NSString*) kTopLevelUIElementAttribute])
|
||||
return [self window];
|
||||
if ([attribute isEqualToString:NSAccessibilityTitleAttribute] ||
|
||||
[attribute isEqualToString:NSAccessibilityTitleUIElementAttribute])
|
||||
|
@ -471,7 +471,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
|
|||
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(mGeckoAccessible),
|
||||
"Does not support nsIAccessibleText when it should");
|
||||
#endif
|
||||
return AXRoles[mRole];
|
||||
return (NSString*) AXRoles[mRole];
|
||||
}
|
||||
|
||||
- (NSString*)subrole
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
#ifndef _nsAccessibleWrap_H_
|
||||
#define _nsAccessibleWrap_H_
|
||||
|
||||
#include <objc/objc.h>
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "States.h"
|
||||
|
@ -54,7 +56,6 @@
|
|||
#include "nsAutoPtr.h"
|
||||
|
||||
struct AccessibleWrapper;
|
||||
struct objc_class;
|
||||
|
||||
class nsAccessibleWrap : public nsAccessible
|
||||
{
|
||||
|
@ -71,7 +72,7 @@ class nsAccessibleWrap : public nsAccessible
|
|||
// the objective-c |Class| type that this accessible's native object
|
||||
// should be instantied with. used on runtime to determine the
|
||||
// right type for this accessible's associated native object.
|
||||
virtual objc_class* GetNativeType ();
|
||||
virtual Class GetNativeType ();
|
||||
|
||||
virtual void Shutdown ();
|
||||
virtual void InvalidateChildren();
|
||||
|
|
|
@ -88,7 +88,7 @@ nsAccessibleWrap::GetNativeInterface (void **aOutInterface)
|
|||
|
||||
// overridden in subclasses to create the right kind of object. by default we create a generic
|
||||
// 'mozAccessible' node.
|
||||
objc_class*
|
||||
Class
|
||||
nsAccessibleWrap::GetNativeType ()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
nsIWeakReference *aShell);
|
||||
virtual ~nsRootAccessibleWrap();
|
||||
|
||||
objc_class* GetNativeType ();
|
||||
Class GetNativeType ();
|
||||
|
||||
// let's our native accessible get in touch with the
|
||||
// native cocoa view that is our accessible parent.
|
||||
|
|
|
@ -59,7 +59,7 @@ nsRootAccessibleWrap::~nsRootAccessibleWrap()
|
|||
{
|
||||
}
|
||||
|
||||
objc_class*
|
||||
Class
|
||||
nsRootAccessibleWrap::GetNativeType ()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
|
|
@ -275,7 +275,7 @@ STDMETHODIMP nsAccessNodeWrap::get_attributes(
|
|||
__try{
|
||||
*aNumAttribs = 0;
|
||||
|
||||
if (IsDefunct() || IsDocument())
|
||||
if (IsDefunct() || IsDocumentNode())
|
||||
return E_FAIL;
|
||||
|
||||
PRUint32 numAttribs = mContent->GetAttrCount();
|
||||
|
@ -348,7 +348,7 @@ STDMETHODIMP nsAccessNodeWrap::get_computedStyle(
|
|||
__try{
|
||||
*aNumStyleProperties = 0;
|
||||
|
||||
if (IsDefunct() || IsDocument())
|
||||
if (IsDefunct() || IsDocumentNode())
|
||||
return E_FAIL;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
|
||||
|
@ -383,7 +383,7 @@ STDMETHODIMP nsAccessNodeWrap::get_computedStyleForProperties(
|
|||
/* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues)
|
||||
{
|
||||
__try {
|
||||
if (IsDefunct() || IsDocument())
|
||||
if (IsDefunct() || IsDocumentNode())
|
||||
return E_FAIL;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
|
||||
|
|
|
@ -1762,6 +1762,38 @@ nsAccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
|
|||
if (nsAccUtils::MustPrune(this))
|
||||
return nsnull;
|
||||
|
||||
// If lVal negative then it is treated as child ID and we should look for
|
||||
// accessible through whole accessible subtree including subdocuments.
|
||||
// Otherwise we treat lVal as index in parent.
|
||||
|
||||
if (aVarChild.lVal < 0) {
|
||||
// Convert child ID to unique ID.
|
||||
void* uniqueID = reinterpret_cast<void*>(-aVarChild.lVal);
|
||||
|
||||
// Document.
|
||||
if (IsDoc())
|
||||
return AsDoc()->GetAccessibleByUniqueIDInSubtree(uniqueID);
|
||||
|
||||
// ARIA document.
|
||||
if (ARIARole() == nsIAccessibleRole::ROLE_DOCUMENT) {
|
||||
nsDocAccessible* document = GetDocAccessible();
|
||||
nsAccessible* child =
|
||||
document->GetAccessibleByUniqueIDInSubtree(uniqueID);
|
||||
|
||||
// Check whether the accessible for the given ID is a child of ARIA
|
||||
// document.
|
||||
nsAccessible* parent = child ? child->GetParent() : nsnull;
|
||||
while (parent && parent != document) {
|
||||
if (parent == this)
|
||||
return child;
|
||||
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
// Gecko child indices are 0-based in contrast to indices used in MSAA.
|
||||
return GetChildAt(aVarChild.lVal - 1);
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ public: // construction, destruction
|
|||
/**
|
||||
* Find an accessible by the given child ID in cached documents.
|
||||
*/
|
||||
virtual nsAccessible *GetXPAccessibleFor(const VARIANT& aVarChild);
|
||||
nsAccessible* GetXPAccessibleFor(const VARIANT& aVarChild);
|
||||
|
||||
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
|
||||
|
||||
|
|
|
@ -99,22 +99,6 @@ STDMETHODIMP nsDocAccessibleWrap::QueryInterface(REFIID iid, void** ppv)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
nsDocAccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
|
||||
{
|
||||
// If lVal negative then it is treated as child ID and we should look for
|
||||
// accessible through whole accessible subtree including subdocuments.
|
||||
// Otherwise we treat lVal as index in parent.
|
||||
|
||||
if (aVarChild.vt == VT_I4 && aVarChild.lVal < 0) {
|
||||
// Convert child ID to unique ID.
|
||||
void* uniqueID = reinterpret_cast<void*>(-aVarChild.lVal);
|
||||
return GetAccessibleByUniqueIDInSubtree(uniqueID);
|
||||
}
|
||||
|
||||
return nsAccessibleWrap::GetXPAccessibleFor(aVarChild);
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDocAccessibleWrap::get_URL(/* [out] */ BSTR __RPC_FAR *aURL)
|
||||
{
|
||||
__try {
|
||||
|
|
|
@ -92,9 +92,6 @@ public:
|
|||
// nsAccessNode
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessibleWrap
|
||||
virtual nsAccessible *GetXPAccessibleFor(const VARIANT& varChild);
|
||||
|
||||
// nsDocAccessible
|
||||
virtual void* GetNativeWindow() const;
|
||||
|
||||
|
|
|
@ -156,8 +156,8 @@ nsXULTreeAccessible::GetValue(nsAString& aValue)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeAccessible: nsAccessNode implementation
|
||||
|
||||
PRBool
|
||||
nsXULTreeAccessible::IsDefunct()
|
||||
bool
|
||||
nsXULTreeAccessible::IsDefunct() const
|
||||
{
|
||||
return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView;
|
||||
}
|
||||
|
@ -834,8 +834,8 @@ nsXULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeItemAccessibleBase: nsAccessNode implementation
|
||||
|
||||
PRBool
|
||||
nsXULTreeItemAccessibleBase::IsDefunct()
|
||||
bool
|
||||
nsXULTreeItemAccessibleBase::IsDefunct() const
|
||||
{
|
||||
if (nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0)
|
||||
return PR_TRUE;
|
||||
|
@ -1091,8 +1091,8 @@ nsXULTreeItemAccessible::GetName(nsAString& aName)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeItemAccessible: nsAccessNode implementation
|
||||
|
||||
PRBool
|
||||
nsXULTreeItemAccessible::IsDefunct()
|
||||
bool
|
||||
nsXULTreeItemAccessible::IsDefunct() const
|
||||
{
|
||||
return nsXULTreeItemAccessibleBase::IsDefunct() || !mColumn;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
|
||||
|
||||
// nsAccessNode
|
||||
virtual PRBool IsDefunct();
|
||||
virtual bool IsDefunct() const;
|
||||
virtual void Shutdown();
|
||||
|
||||
// nsAccessible
|
||||
|
@ -201,7 +201,7 @@ public:
|
|||
NS_IMETHOD DoAction(PRUint8 aIndex);
|
||||
|
||||
// nsAccessNode
|
||||
virtual PRBool IsDefunct();
|
||||
virtual bool IsDefunct() const;
|
||||
virtual void Shutdown();
|
||||
virtual bool IsPrimaryForNode() const;
|
||||
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
NS_IMETHOD GetName(nsAString& aName);
|
||||
|
||||
// nsAccessNode
|
||||
virtual PRBool IsDefunct();
|
||||
virtual bool IsDefunct() const;
|
||||
virtual PRBool Init();
|
||||
virtual void Shutdown();
|
||||
|
||||
|
|
|
@ -1087,8 +1087,8 @@ nsXULTreeGridCellAccessible::IsSelected(PRBool *aIsSelected)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTreeGridCellAccessible: nsAccessNode implementation
|
||||
|
||||
PRBool
|
||||
nsXULTreeGridCellAccessible::IsDefunct()
|
||||
bool
|
||||
nsXULTreeGridCellAccessible::IsDefunct() const
|
||||
{
|
||||
return nsLeafAccessible::IsDefunct() || !mParent || !mTree || !mTreeView ||
|
||||
!mColumn;
|
||||
|
|
|
@ -155,7 +155,7 @@ public:
|
|||
NS_DECL_NSIACCESSIBLETABLECELL
|
||||
|
||||
// nsAccessNode
|
||||
virtual PRBool IsDefunct();
|
||||
virtual bool IsDefunct() const;
|
||||
virtual PRBool Init();
|
||||
virtual bool IsPrimaryForNode() const;
|
||||
|
||||
|
|
|
@ -90,16 +90,14 @@ _TEST_FILES =\
|
|||
test_aria_roles.xul \
|
||||
test_aria_token_attrs.html \
|
||||
test_bug420863.html \
|
||||
$(warning test_childAtPoint.html temporarily disabled) \
|
||||
$(warning test_childAtPoint.xul temporarily disabled) \
|
||||
test_childAtPoint.html \
|
||||
test_childAtPoint.xul \
|
||||
test_descr.html \
|
||||
test_elm_landmarks.html \
|
||||
test_elm_listbox.xul \
|
||||
$(warning test_elm_media.html temporarily disabled) \
|
||||
test_elm_nsApplicationAcc.html \
|
||||
test_elm_plugin.html \
|
||||
test_keys.html \
|
||||
$(warning test_nsIAccessible_comboboxes.xul temporarily disabled) \
|
||||
test_nsIAccessible_selects.html \
|
||||
test_nsIAccessibleDocument.html \
|
||||
test_nsIAccessibleImage.html \
|
||||
|
|
|
@ -52,6 +52,7 @@ _TEST_FILES =\
|
|||
test_general.xul \
|
||||
test_inputs.html \
|
||||
test_link.html \
|
||||
test_media.html \
|
||||
test_tree.xul \
|
||||
test_treegrid.xul \
|
||||
$(NULL)
|
||||
|
|
|
@ -36,9 +36,19 @@
|
|||
ID: "li_clickable3",
|
||||
actionName: "click",
|
||||
events: CLICK_EVENTS
|
||||
},
|
||||
{
|
||||
ID: "onclick_img",
|
||||
actionName: "click",
|
||||
events: CLICK_EVENTS
|
||||
}
|
||||
];
|
||||
|
||||
testActions(actionsArray);
|
||||
|
||||
getAccessible("onclick_img").takeFocus();
|
||||
is(getAccessible("link1").numActions, 1, "links should have one action");
|
||||
is(getAccessible("link2").numActions, 1, "link with onclick handler should have 1 action");
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -58,6 +68,11 @@
|
|||
title="Expose click action if mouseup and mousedown are registered">
|
||||
Mozilla Bug 423409
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=659620"
|
||||
title="hang when trying to edit a page on wikimo with NVDA running">
|
||||
Mozilla Bug 659620
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
@ -68,5 +83,11 @@
|
|||
<li id="li_clickable2" onmousedown="">Clickable list item</li>
|
||||
<li id="li_clickable3" onmouseup="">Clickable list item</li>
|
||||
</ul>
|
||||
|
||||
<!-- linkable accessibles -->
|
||||
<img id="onclick_img" onclick="" src="../moz.png">
|
||||
|
||||
<a id="link1" href="www">linkable textleaf accessible</a>
|
||||
<div id="link2" onclick="">linkable textleaf accessible</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -13,15 +13,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
|||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="events.js"></script>
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="actions.js"></script>
|
||||
src="../actions.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="states.js"></script>
|
||||
src="../states.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
|
@ -58,49 +58,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
|||
|
||||
function doTest()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// test the accessible tree
|
||||
|
||||
var accTree = {
|
||||
role: ROLE_GROUPING,
|
||||
children: [
|
||||
{ // start/stop button
|
||||
role: ROLE_PUSHBUTTON,
|
||||
name: "Play",
|
||||
states: {
|
||||
states: STATE_FOCUSABLE
|
||||
}
|
||||
},
|
||||
{ // buffer bar
|
||||
role: ROLE_PROGRESSBAR
|
||||
},
|
||||
{ // progress bar
|
||||
role: ROLE_PROGRESSBAR
|
||||
},
|
||||
{ // slider of progress bar
|
||||
role: ROLE_SLIDER,
|
||||
name: "0:00 of 0:01 elapsed",
|
||||
states: {
|
||||
states: STATE_FOCUSABLE
|
||||
}
|
||||
},
|
||||
{ // duration label, role="presentation"
|
||||
role: ROLE_NOTHING
|
||||
},
|
||||
{ // mute button
|
||||
role: ROLE_PUSHBUTTON,
|
||||
name: "Mute",
|
||||
states: {
|
||||
states: STATE_FOCUSABLE
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
testAccessibleTree("audio", accTree);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// test actions of audio controls
|
||||
|
||||
todo(false, "Focus test are disabled until bug 494175 is fixed.");
|
||||
|
||||
var audioElm = getAccessible("audio");
|
||||
var playBtn = audioElm.firstChild;
|
||||
var scrubber = playBtn.nextSibling.nextSibling.nextSibling;
|
||||
|
@ -112,24 +74,24 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
|||
actionName: "press",
|
||||
events: CLICK_EVENTS,
|
||||
eventSeq: [
|
||||
new focusChecker(muteBtn),
|
||||
// new focusChecker(muteBtn),
|
||||
new nameChecker(muteBtn, "Unmute"),
|
||||
]
|
||||
},
|
||||
{
|
||||
ID: scrubber,
|
||||
actionName: "activate",
|
||||
events: null,
|
||||
eventSeq: [
|
||||
new focusChecker(scrubber)
|
||||
]
|
||||
},
|
||||
// {
|
||||
// ID: scrubber,
|
||||
// actionName: "activate",
|
||||
// events: null,
|
||||
// eventSeq: [
|
||||
// new focusChecker(scrubber)
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
ID: playBtn,
|
||||
actionName: "press",
|
||||
events: CLICK_EVENTS,
|
||||
eventSeq: [
|
||||
new focusChecker(playBtn),
|
||||
// new focusChecker(playBtn),
|
||||
new nameChecker(playBtn, "Pause"),
|
||||
]
|
||||
}
|
||||
|
@ -152,7 +114,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
|||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<audio id="audio" src="bug461281.ogg"
|
||||
<audio id="audio" src="../bug461281.ogg"
|
||||
controls="true"></audio>
|
||||
|
||||
<div id="eventDump"></div>
|
|
@ -30,11 +30,11 @@
|
|||
var menu1 = document.getElementById("menu_item1");
|
||||
menu1.open = true;
|
||||
|
||||
window.setTimeout(function() {
|
||||
menu1.addEventListener("popupshown", function() {
|
||||
var menu2 = document.getElementById("menu_item2");
|
||||
menu2.open = true;
|
||||
|
||||
window.setTimeout(function() {
|
||||
menu2.addEventListener("popupshown", function() {
|
||||
testGroupAttrs("menu_item1.1", 1, 1);
|
||||
testGroupAttrs("menu_item1.2", 1, 3);
|
||||
testGroupAttrs("menu_item1.4", 2, 3);
|
||||
|
@ -42,9 +42,12 @@
|
|||
testGroupAttrs("menu_item2.1", 1, 2, 1);
|
||||
testGroupAttrs("menu_item2.2", 2, 2, 1);
|
||||
|
||||
menu1.open = false;
|
||||
menu2.open = false;
|
||||
|
||||
SimpleTest.finish();
|
||||
}, 200);
|
||||
}, 200);
|
||||
}, false);
|
||||
}, false);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// xul:tab
|
||||
|
|
|
@ -93,7 +93,7 @@ function addA11yLoadEvent(aFunc)
|
|||
if (state.value & STATE_BUSY)
|
||||
return waitForDocLoad();
|
||||
|
||||
window.setTimeout(aFunc, 150);
|
||||
window.setTimeout(aFunc, 0);
|
||||
},
|
||||
0
|
||||
);
|
||||
|
|
|
@ -51,8 +51,8 @@ _TEST_FILES =\
|
|||
focus.html \
|
||||
scroll.html \
|
||||
test_aria_alert.html \
|
||||
test_aria_hidden.html \
|
||||
test_aria_menu.html \
|
||||
test_aria_objattr.html \
|
||||
test_aria_statechange.html \
|
||||
test_attrs.html \
|
||||
test_caretmove.html \
|
||||
|
|
|
@ -192,11 +192,11 @@
|
|||
/**
|
||||
* Load wrong URI what results in error page loading.
|
||||
*/
|
||||
function loadErrorPageInvoker()
|
||||
function loadErrorPageInvoker(aURL, aURLDescr)
|
||||
{
|
||||
this.invoke = function loadErrorPageInvoker_invoke()
|
||||
{
|
||||
gTabBrowser.loadURI("www.wronguri.wronguri");
|
||||
gTabBrowser.loadURI(aURL);
|
||||
}
|
||||
|
||||
this.eventSeq = [
|
||||
|
@ -209,7 +209,7 @@
|
|||
|
||||
this.getID = function loadErrorPageInvoker_getID()
|
||||
{
|
||||
return "load error page";
|
||||
return "load error page: '" + aURLDescr + "'";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,11 @@
|
|||
gQueue.push(new clickReloadBtnInvoker());
|
||||
gQueue.push(new loadURIInvoker("about:mozilla"));
|
||||
gQueue.push(new reloadInvoker());
|
||||
gQueue.push(new loadErrorPageInvoker());
|
||||
gQueue.push(new loadErrorPageInvoker("www.wronguri.wronguri",
|
||||
"Server not found"));
|
||||
gQueue.push(new loadErrorPageInvoker("https://nocert.example.com:443",
|
||||
"Untrusted Connection"));
|
||||
|
||||
gQueue.onFinish = function() { window.close(); }
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>Accessible ARIA hidden attribute</title>
|
||||
<title>Accessible ARIA object attribute changes</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
@ -43,14 +43,38 @@
|
|||
}
|
||||
}
|
||||
|
||||
function updateSort(aID, aSort)
|
||||
{
|
||||
this.node = getNode(aID);
|
||||
this.accessible = getAccessible(this.node);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
|
||||
];
|
||||
|
||||
this.invoke = function updateSort_invoke()
|
||||
{
|
||||
this.node.setAttribute("aria-sort", aSort);
|
||||
}
|
||||
|
||||
this.getID = function updateSort_getID()
|
||||
{
|
||||
return "aria-sort for " + aID + " " + aSort;
|
||||
}
|
||||
}
|
||||
|
||||
// Debug stuff.
|
||||
// gA11yEventDumpID = "eventdump";
|
||||
// gA11yEventDumpToConsole = true;
|
||||
|
||||
function doTests()
|
||||
{
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new hideNode("hideable", "true"));
|
||||
|
||||
gQueue.push(new updateSort("sortable", "ascending"));
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -67,6 +91,12 @@
|
|||
Mozilla Bug 581096
|
||||
</a>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
|
||||
title="Add event support for aria-sort">
|
||||
Mozilla Bug 640707
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
@ -75,5 +105,6 @@
|
|||
|
||||
<div id="hideable"><div>Hi</div><div>there</div></div>
|
||||
|
||||
<div id="sortable" role="columnheader" aria-sort"none">aria-sort</div>
|
||||
</body>
|
||||
</html>
|
|
@ -26,35 +26,60 @@
|
|||
*/
|
||||
var gQueue = null;
|
||||
|
||||
// Debug stuff.
|
||||
//gA11yEventDumpID = "eventdump";
|
||||
// gA11yEventDumpToConsole = true;
|
||||
|
||||
function expandNode(aNodeOrID, bExpand)
|
||||
{
|
||||
this.DOMNode = getNode(aNodeOrID);
|
||||
|
||||
this.invoke = function expand_invoke() {
|
||||
this.invoke = function expandNode_invoke() {
|
||||
// Note: this should fire an EVENT_STATE_CHANGE
|
||||
this.DOMNode.setAttribute("aria-expanded", bExpand);
|
||||
};
|
||||
|
||||
this.check = function expand_check() {
|
||||
this.check = function expandNode_check() {
|
||||
testStates(aNodeOrID,
|
||||
bExpand ? STATE_EXPANDED : STATE_COLLAPSED,
|
||||
EXT_STATE_EXPANDABLE);
|
||||
};
|
||||
|
||||
this.getID = function changeValue_getID() {
|
||||
this.getID = function expandNode_getID() {
|
||||
return prettyName(aNodeOrID) + " aria-expanded changed";
|
||||
};
|
||||
}
|
||||
|
||||
function busyify(aNodeOrID, aBusy)
|
||||
{
|
||||
this.DOMNode = getNode(aNodeOrID);
|
||||
|
||||
this.invoke = function busyify_invoke() {
|
||||
this.DOMNode.setAttribute("aria-busy", aBusy);
|
||||
};
|
||||
|
||||
this.check = function busyify_check(event) {
|
||||
testStates(aNodeOrID,
|
||||
(aBusy ? STATE_BUSY : 0), 0,
|
||||
(aBusy ? 0 : STATE_BUSY), 0);
|
||||
};
|
||||
|
||||
this.getID = function busyify_getID() {
|
||||
return prettyName(aNodeOrID) + " aria-busy changed to " + aBusy;
|
||||
};
|
||||
}
|
||||
|
||||
function doTests()
|
||||
{
|
||||
gQueue = new eventQueue(nsIAccessibleEvent.EVENT_STATE_CHANGE);
|
||||
gQueue = new eventQueue(EVENT_STATE_CHANGE);
|
||||
|
||||
gQueue.push(new expandNode("section", true));
|
||||
gQueue.push(new expandNode("section", false));
|
||||
gQueue.push(new expandNode("div", true));
|
||||
gQueue.push(new expandNode("div", false));
|
||||
|
||||
gQueue.push(new busyify("aria_doc", true));
|
||||
gQueue.push(new busyify("aria_doc", false));
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -71,6 +96,11 @@
|
|||
Mozilla Bug 551684
|
||||
</a>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=648133"
|
||||
title="fire state change event for aria-busy"
|
||||
Mozilla Bug 648133
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
@ -81,5 +111,7 @@
|
|||
<div id="section" role="section" aria-expanded="false">expandable section</div>
|
||||
<div id="div" aria-expanded="false">expandable native div</div>
|
||||
|
||||
<!-- aria-busy -->
|
||||
<div id="aria_doc" role="document" tabindex="0">A document</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -118,6 +118,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
function makeIFrameVisible(aID)
|
||||
{
|
||||
this.DOMNode = getNode(aID);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_REORDER, this.DOMNode.parentNode)
|
||||
];
|
||||
|
||||
this.invoke = function makeIFrameVisible_invoke()
|
||||
{
|
||||
this.DOMNode.style.visibility = "visible";
|
||||
}
|
||||
|
||||
this.getID = function makeIFrameVisible_getID()
|
||||
{
|
||||
return "The accessible for DOM document loaded before it's shown shouldn't have busy state.";
|
||||
}
|
||||
}
|
||||
|
||||
function openDialogWnd(aURL)
|
||||
{
|
||||
// Get application root accessible.
|
||||
|
@ -224,7 +243,7 @@
|
|||
|
||||
// Debug stuff.
|
||||
// gA11yEventDumpID = "eventdump";
|
||||
// gA11yEventDumpToConsole = true;
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
function doTests()
|
||||
{
|
||||
|
@ -235,12 +254,30 @@
|
|||
gQueue.push(new morphIFrame("iframe", kHide));
|
||||
gQueue.push(new morphIFrame("iframe", kShow));
|
||||
gQueue.push(new morphIFrame("iframe", kRemove));
|
||||
gQueue.push(new makeIFrameVisible("iframe2"));
|
||||
gQueue.push(new openDialogWnd("about:"));
|
||||
gQueue.push(new openWndShutdownDoc());
|
||||
|
||||
gQueue.onFinish = doLastCallTests;
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
function doLastCallTests()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// makeIFrameVisible() test, part2
|
||||
|
||||
// The document shouldn't have busy state (the DOM document was loaded
|
||||
// before its accessible was created). Do this test lately to make sure
|
||||
// the content of document accessible was created initially, prior to this
|
||||
// the document accessible keeps busy state. The initial creation happens
|
||||
// asynchronously after document creation, there are no events we could
|
||||
// use to catch it.
|
||||
var iframeDoc = getAccessible("iframe2").firstChild;
|
||||
testStates(iframeDoc, 0, 0, STATE_BUSY);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTests);
|
||||
</script>
|
||||
|
@ -268,6 +305,11 @@
|
|||
title="Shutdown document accessible when presshell goes away">
|
||||
Mozilla Bug 571459
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=658185"
|
||||
title="The DOM document loaded before it's shown shouldn't have busy state">
|
||||
Mozilla Bug 658185
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
|
@ -275,6 +317,7 @@
|
|||
</pre>
|
||||
|
||||
<div id="testContainer"><iframe id="iframe"></iframe></div>
|
||||
<div id="testContainer2"><iframe id="iframe2" src="about:" style="visibility: hidden;"></iframe></div>
|
||||
<div id="eventdump"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -48,6 +48,8 @@ include $(topsrcdir)/config/rules.mk
|
|||
_TEST_FILES =\
|
||||
test_aria.html \
|
||||
test_aria_imgmap.html \
|
||||
test_aria_tabs.html \
|
||||
test_comboboxes.xul \
|
||||
test_doc.html \
|
||||
test_docarticle.html \
|
||||
test_editablebody.html \
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Test ARIA tab accessible selected state</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function focusARIATab(aID, aIsSelected)
|
||||
{
|
||||
this.DOMNode = getNode(aID);
|
||||
|
||||
this.invoke = function focusARIATab_invoke()
|
||||
{
|
||||
this.DOMNode.focus();
|
||||
}
|
||||
|
||||
this.check = function focusARIATab_check(aEvent)
|
||||
{
|
||||
testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
|
||||
aIsSelected ? 0 : STATE_SELECTED);
|
||||
}
|
||||
|
||||
this.getID = function focusARIATab_getID()
|
||||
{
|
||||
return "Focused ARIA Tab with aria-selected=" +
|
||||
(aIsSelected ? "true, should" : "false, shouldn't") +
|
||||
" have selected state on " + prettyName(aID);
|
||||
}
|
||||
}
|
||||
|
||||
function focusActiveDescendantTab(aTabID, aTabListID, aIsSelected)
|
||||
{
|
||||
this.DOMNode = getNode(aTabID);
|
||||
this.tabListDOMNode = getNode(aTabListID);
|
||||
|
||||
this.invoke = function focusActiveDescendantTab_invoke()
|
||||
{
|
||||
this.tabListDOMNode.setAttribute("aria-activedescendant", aTabID);
|
||||
this.tabListDOMNode.focus();
|
||||
}
|
||||
|
||||
this.check = function focusActiveDescendantTab_check(aEvent)
|
||||
{
|
||||
testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
|
||||
aIsSelected ? 0 : STATE_SELECTED);
|
||||
}
|
||||
|
||||
this.getID = function tabActiveDescendant_getID()
|
||||
{
|
||||
return "ARIA Tab with activedescendant " +
|
||||
(aIsSelected ? "should" : "shouldn't") +
|
||||
" have the selected state on " + prettyName(aTabID);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
var gQueue = null;
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// simple tabs
|
||||
testStates("aria_tab1", 0, 0, STATE_SELECTED);
|
||||
testStates("aria_tab2", STATE_SELECTED);
|
||||
|
||||
// To make sure our focus != selected is truly under test, we need to
|
||||
// make sure our cache of what currently has focus is correct, which
|
||||
// we update asyncronously.
|
||||
gQueue = new eventQueue(EVENT_FOCUS);
|
||||
|
||||
gQueue.push(new focusARIATab("aria_tab1", true));
|
||||
gQueue.push(new focusARIATab("aria_tab3", false));
|
||||
gQueue.push(new focusARIATab("aria_tab2", true));
|
||||
|
||||
// selection through aria-activedescendant
|
||||
// Make sure initially setting it selects the tab.
|
||||
gQueue.push(new focusActiveDescendantTab("aria_tab5", "aria_tablist2", true));
|
||||
|
||||
// Now, make sure if one is selected selection gets transferred properly.
|
||||
gQueue.push(new focusActiveDescendantTab("aria_tab6", "aria_tablist2", true));
|
||||
|
||||
// Now, make sure the focused but explicitly unselected one behaves.
|
||||
gQueue.push(new focusActiveDescendantTab("aria_tab4", "aria_tablist2", false));
|
||||
|
||||
gQueue.invoke(); // SimpleTest.finish() will be called in the end
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=653601"
|
||||
title="aria-selected ignored for ARIA tabs">
|
||||
Mozilla Bug 653601
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<!-- tab -->
|
||||
<div id="aria_tablist" role="tablist">
|
||||
<div id="aria_tab1" role="tab" tabindex="0">unselected tab</div>
|
||||
<div id="aria_tab2" role="tab" tabindex="0" aria-selected="true">selected tab</div>
|
||||
<div id="aria_tab3" role="tab" tabindex="0" aria-selected="false">focused explicitly unselected tab</div>
|
||||
</div>
|
||||
|
||||
<!-- test activeDescendant -->
|
||||
<div id="aria_tablist2" role="tablist" tabindex="0">
|
||||
<div id="aria_tab4" role="tab" aria-selected="false">focused explicitly unselected tab</div>
|
||||
<div id="aria_tab5" role="tab">initially selected tab</div>
|
||||
<div id="aria_tab6" role="tab">later selected tab</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -16,9 +16,9 @@
|
|||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js" />
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="events.js" />
|
||||
src="../events.js" />
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
@ -64,6 +64,7 @@
|
|||
//var searchbar = document.getElementById("searchbar");
|
||||
//gQueue.push(new openHideCombobox(searchbar, true));
|
||||
//gQueue.push(new openHideCombobox(searchbar, false));
|
||||
todo(false, "Enable states test for XUL searchbar widget!");
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
|
@ -25,19 +25,19 @@
|
|||
testChildAtPoint(list, 1, 1, true, image.firstChild);
|
||||
|
||||
// ::MustPrune case (in this case childAtPoint doesn't look inside a
|
||||
// button), point is inside of button.
|
||||
var btn = getAccessible("btn");
|
||||
testChildAtPoint(btn, 1, 1, false, btn);
|
||||
testChildAtPoint(btn, 1, 1, true, btn);
|
||||
// textbox), point is inside of textbox.
|
||||
var txt = getAccessible("txt");
|
||||
testChildAtPoint(txt, 1, 1, false, txt);
|
||||
testChildAtPoint(txt, 1, 1, true, txt);
|
||||
|
||||
// ::MustPrune case, point is outside of button accessible but is in
|
||||
// ::MustPrune case, point is outside of textbox accessible but is in
|
||||
// document.
|
||||
testChildAtPoint(btn, -1, 1, false, null);
|
||||
testChildAtPoint(btn, -1, 1, true, null);
|
||||
testChildAtPoint(txt, -1, 1, false, null);
|
||||
testChildAtPoint(txt, -1, 1, true, null);
|
||||
|
||||
// ::MustPrune case, point is outside of root accessible.
|
||||
testChildAtPoint(btn, -10000, 10000, false, null);
|
||||
testChildAtPoint(btn, -10000, 10000, true, null);
|
||||
testChildAtPoint(txt, -10000, 10000, false, null);
|
||||
testChildAtPoint(txt, -10000, 10000, true, null);
|
||||
|
||||
// Not specific case, point is inside of label accessible.
|
||||
var label = getAccessible("label");
|
||||
|
@ -82,7 +82,7 @@
|
|||
|
||||
<span role="label">label1</span><span role="label" id="label">label2</span>
|
||||
|
||||
<span role="button">btn1</span><span role="button" id="btn">btn2</span>
|
||||
<span role="textbox">textbox1</span><span role="textbox" id="txt">textbox2</span>
|
||||
|
||||
<div id="outofflow" style="width: 10px; height: 10px; position: absolute; left: 0px; top: 0px; background-color: yellow;">
|
||||
</div>
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
function doTest()
|
||||
{
|
||||
// Initialize the tree
|
||||
var view = new inTreeView();
|
||||
view.mRowCount = 5;
|
||||
var view = new nsTableTreeView(5);
|
||||
|
||||
var tree = getNode("tree");
|
||||
var treeBox = tree.treeBoxObject;
|
||||
|
|
|
@ -50,8 +50,8 @@ _TEST_FILES = \
|
|||
test_doc.html \
|
||||
test_hypertext.html \
|
||||
test_passwords.html \
|
||||
$(warning test_singleline.html disabled due to bug 652459) \
|
||||
$(warning test_whitespaces.html disabled due to bug 652459) \
|
||||
test_singleline.html \
|
||||
test_whitespaces.html \
|
||||
test_words.html \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -216,10 +216,10 @@
|
|||
|
||||
// BOUNDARY_WORD_START
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
|
@ -231,10 +231,10 @@
|
|||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_START, "hello ", 0, 6,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_START, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
|
@ -246,10 +246,10 @@
|
|||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "my ", 6, 9,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(10, BOUNDARY_WORD_START, "my ", 6, 9,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
|
@ -268,10 +268,10 @@
|
|||
|
||||
// BOUNDARY_WORD_END
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
|
@ -283,10 +283,10 @@
|
|||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_END, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
"input", kTodo, kTodo, kOk,
|
||||
"div", kTodo, kTodo, kOk,
|
||||
"editable", kTodo, kTodo, kOk,
|
||||
"textarea", kTodo, kTodo, kOk);
|
||||
testTextBeforeOffset(7, BOUNDARY_WORD_END, "hello ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
|
@ -320,10 +320,10 @@
|
|||
|
||||
// BOUNDARY_LINE_START
|
||||
testTextBeforeOffset(0, BOUNDARY_LINE_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_LINE_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
|
@ -342,10 +342,10 @@
|
|||
|
||||
// BOUNDARY_LINE_END
|
||||
testTextBeforeOffset(0, BOUNDARY_LINE_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_LINE_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
|
|
|
@ -196,10 +196,10 @@
|
|||
|
||||
// BOUNDARY_WORD_START
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
|
@ -211,10 +211,10 @@
|
|||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
testTextBeforeOffset(6, BOUNDARY_WORD_START, "Brave ", 0, 6,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(9, BOUNDARY_WORD_START, "Brave ", 0, 6,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
|
@ -226,10 +226,10 @@
|
|||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(11, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(15, BOUNDARY_WORD_START, "Sir ", 6, 11,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
|
@ -251,10 +251,10 @@
|
|||
"editable", kTodo, kTodo, kTodo,
|
||||
"textarea", kTodo, kTodo, kTodo);
|
||||
testTextBeforeOffset(19, BOUNDARY_WORD_START, "Robin ", 11, 19,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(20, BOUNDARY_WORD_START, "Robin ", 11, 19,
|
||||
"input", kTodo, kTodo, kTodo,
|
||||
"div", kTodo, kTodo, kTodo,
|
||||
|
@ -268,10 +268,10 @@
|
|||
|
||||
// BOUNDARY_WORD_END
|
||||
testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
"editable", kTodo, kOk, kTodo,
|
||||
"textarea", kTodo, kOk, kTodo);
|
||||
"input", kOk, kOk, kOk,
|
||||
"div", kOk, kOk, kOk,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
|
||||
"input", kTodo, kOk, kTodo,
|
||||
"div", kTodo, kOk, kTodo,
|
||||
|
|
|
@ -30,24 +30,33 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
|
|||
role: ROLE_GROUPING,
|
||||
children: [
|
||||
{ // start/stop button
|
||||
role: ROLE_PUSHBUTTON
|
||||
role: ROLE_PUSHBUTTON,
|
||||
name: "Play",
|
||||
children: []
|
||||
},
|
||||
{ // buffer bar
|
||||
role: ROLE_PROGRESSBAR
|
||||
role: ROLE_PROGRESSBAR,
|
||||
children: []
|
||||
},
|
||||
{ // progress bar
|
||||
role: ROLE_PROGRESSBAR
|
||||
role: ROLE_PROGRESSBAR,
|
||||
children: []
|
||||
},
|
||||
{ // slider of progress bar
|
||||
role: ROLE_SLIDER
|
||||
role: ROLE_SLIDER,
|
||||
//name: "0:00 of 0:02 elapsed",
|
||||
children: []
|
||||
},
|
||||
{ // mute button
|
||||
role: ROLE_PUSHBUTTON
|
||||
role: ROLE_PUSHBUTTON,
|
||||
name: "Mute",
|
||||
children: []
|
||||
}
|
||||
]
|
||||
};
|
||||
testAccessibleTree("audio", accTree);
|
||||
|
||||
todo(false, "Enable name test for slider. Fail on Linux.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
@ -108,6 +110,11 @@
|
|||
]
|
||||
};
|
||||
|
||||
function test_txc7() {
|
||||
testAccessibleTree("txc7", accTree);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
// XPFE and Toolkit autocomplete widgets differ.
|
||||
var txc7 = document.getElementById("txc7");
|
||||
if ("clearResults" in txc7) {
|
||||
|
@ -139,11 +146,14 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
);
|
||||
test_txc7();
|
||||
|
||||
} else {
|
||||
SimpleTest.ok(true, "Testing (New) Toolkit autocomplete widget.");
|
||||
|
||||
// Dumb access to trigger popup lazy creation. (See code below.)
|
||||
// Dumb access to trigger popup lazy creation.
|
||||
waitForEvent(EVENT_REORDER, txc7, test_txc7);
|
||||
txc7.popup;
|
||||
|
||||
accTree.children.push(
|
||||
|
@ -161,17 +171,8 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
// Delay txc7 test a bit, to let Toolkit popup lazy creation complete.
|
||||
function test_txc7() {
|
||||
testAccessibleTree("txc7", accTree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
// SimpleTest.executeSoon() doesn't help here: use setTimeout() with a little delay.
|
||||
setTimeout(test_txc7, 25);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
|
|
@ -102,51 +102,20 @@ CPPSRCS = nsBrowserApp.cpp
|
|||
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
ifdef _MSC_VER
|
||||
STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
|
||||
else
|
||||
STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
|
||||
endif
|
||||
LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
|
||||
else
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
LIBS += $(DIST)/bin/XUL
|
||||
TK_LIBS := $(TK_LIBS)
|
||||
else
|
||||
EXTRA_DSO_LIBS += xul
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
TK_LIBS := $(TK_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
|
||||
else
|
||||
MOZILLA_INTERNAL_API = 1
|
||||
APP_XPCOM_LIBS = $(XPCOM_LIBS)
|
||||
endif
|
||||
|
||||
LIBS += \
|
||||
$(STATIC_COMPONENTS_LINKER_PATH) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(APP_XPCOM_LIBS) \
|
||||
$(XPCOM_GLUE_LDOPTS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
LIBS += \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(TK_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
# Add explicit X11 dependency when building against X11 toolkits
|
||||
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
|
||||
LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_JPROF
|
||||
LIBS += -ljprof
|
||||
endif
|
||||
|
@ -171,22 +140,9 @@ ifdef _MSC_VER
|
|||
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
|
||||
endif
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
include $(topsrcdir)/config/static-config.mk
|
||||
|
||||
EXTRA_DEPS += \
|
||||
$(STATIC_EXTRA_DEPS) \
|
||||
$(NULL)
|
||||
DEFINES += $(STATIC_DEFINES)
|
||||
CPPSRCS += $(STATIC_CPPSRCS)
|
||||
EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
|
||||
EXTRA_LIBS += $(STATIC_EXTRA_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32 delayimp)
|
||||
LDFLAGS += -delayload:xul.dll -delayload:xpcom.dll -delayload:plc4.dll -delayload:nspr4.dll -delayload:mozalloc.dll
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
|
@ -196,9 +152,6 @@ RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
|
|||
else
|
||||
RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
|
||||
endif
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
RCFLAGS += -DMOZ_STATIC_BUILD
|
||||
endif
|
||||
ifdef DEBUG
|
||||
RCFLAGS += -DDEBUG
|
||||
endif
|
||||
|
@ -207,9 +160,6 @@ endif
|
|||
ifeq ($(OS_ARCH),OS2)
|
||||
RESFILE=splashos2.res
|
||||
RCFLAGS += -DMOZ_PHOENIX
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
|
||||
endif
|
||||
ifdef DEBUG
|
||||
RCFLAGS += -DDEBUG
|
||||
endif
|
||||
|
@ -218,12 +168,6 @@ endif
|
|||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
include $(topsrcdir)/config/static-rules.mk
|
||||
|
||||
DEFINES += -DIMPL_XREAPI
|
||||
endif
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
|
||||
LIBS += -lphexlib
|
||||
endif
|
||||
|
|
|
@ -97,6 +97,11 @@
|
|||
<versionRange minVersion="3.7a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion="3.3.1" maxVersion="*">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="5.0a1" maxVersion="*"/>
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem id="{E8E88AB0-7182-11DF-904E-6045E0D72085}"/>
|
||||
</emItems>
|
||||
|
|
|
@ -92,6 +92,55 @@
|
|||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>oga</string>
|
||||
<string>ogg</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>document.icns</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>audio/ogg</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>HTML5 Audio (Ogg)</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>ogv</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>document.icns</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>video/ogg</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>HTML5 Video (Ogg)</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>webm</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>document.icns</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>video/webm</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>HTML5 Video (WebM)</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>firefox-bin</string>
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#ifdef XP_WIN
|
||||
// we want to use the DLL blocklist if possible
|
||||
#define XRE_WANT_DLL_BLOCKLIST
|
||||
#define XRE_PRELOAD_XUL
|
||||
// we want a wmain entry point
|
||||
#include "nsWindowsWMain.cpp"
|
||||
#endif
|
||||
|
|
|
@ -123,7 +123,7 @@ var stringBundle;
|
|||
// and targets
|
||||
let io = Components.classes["@mozilla.org/network/io-service;1"].
|
||||
getService(Components.interfaces.nsIIOService);
|
||||
let source = io.newURI(canvas.toDataURL("image/png", ""), "UTF8", null);
|
||||
let source = io.newURI(canvas.toDataURL("image/png"), "UTF8", null);
|
||||
let target = io.newFileURI(file);
|
||||
|
||||
// prepare to save the canvas data
|
||||
|
|
|
@ -91,6 +91,9 @@ function onBuiltinSurveyLoad() {
|
|||
explanation.innerHTML = "";
|
||||
}
|
||||
drawSurveyForm(task, contentDiv);
|
||||
// Allow surveys to define arbitrary page load handlers - call them
|
||||
// after creating the rest of the page:
|
||||
task.onPageLoad(task, document);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,7 +117,7 @@ function drawSurveyForm(task, contentDiv) {
|
|||
for (let i = 0; i < surveyQuestions.length; i++) {
|
||||
let question = surveyQuestions[i].question;
|
||||
let explanation = surveyQuestions[i].explanation;
|
||||
let elem;
|
||||
let elem, j;
|
||||
|
||||
elem = document.createElement("h3");
|
||||
elem.innerHTML = (i+1) + ". " + question;
|
||||
|
@ -129,7 +132,7 @@ function drawSurveyForm(task, contentDiv) {
|
|||
let choices = surveyQuestions[i].choices;
|
||||
switch (surveyQuestions[i].type) {
|
||||
case MULTIPLE_CHOICE:
|
||||
for (let j = 0; j < choices.length; j++) {
|
||||
for (j = 0; j < choices.length; j++) {
|
||||
let newRadio = document.createElement("input");
|
||||
newRadio.setAttribute("type", "radio");
|
||||
newRadio.setAttribute("name", "answer_to_" + i);
|
||||
|
@ -148,7 +151,7 @@ function drawSurveyForm(task, contentDiv) {
|
|||
case CHECK_BOXES_WITH_FREE_ENTRY:
|
||||
let checkboxName = "answer_to_" + i;
|
||||
// Check boxes:
|
||||
for (let j = 0; j < choices.length; j++) {
|
||||
for (j = 0; j < choices.length; j++) {
|
||||
let newCheck = document.createElement("input");
|
||||
newCheck.setAttribute("type", "checkbox");
|
||||
newCheck.setAttribute("name", checkboxName);
|
||||
|
@ -188,7 +191,7 @@ function drawSurveyForm(task, contentDiv) {
|
|||
inputBox.addEventListener(
|
||||
"keypress", function() {
|
||||
let elements = document.getElementsByName(checkboxName);
|
||||
for (let j = (elements.length - 1); j >= 0; j--) {
|
||||
for (j = (elements.length - 1); j >= 0; j--) {
|
||||
if (elements[j].value == freeformId) {
|
||||
elements[j].checked = true;
|
||||
break;
|
||||
|
@ -213,7 +216,7 @@ function drawSurveyForm(task, contentDiv) {
|
|||
let label = document.createElement("span");
|
||||
label.innerHTML = surveyQuestions[i].min_label;
|
||||
contentDiv.appendChild(label);
|
||||
for (let j = surveyQuestions[i].scale_minimum;
|
||||
for (j = surveyQuestions[i].scale_minimum;
|
||||
j <= surveyQuestions[i].scale_maximum;
|
||||
j++) {
|
||||
let newRadio = document.createElement("input");
|
||||
|
@ -243,7 +246,7 @@ function drawSurveyForm(task, contentDiv) {
|
|||
let freeformId = "freeform_" + i;
|
||||
let radioName = "answer_to_" + i;
|
||||
|
||||
for (let j = 0; j < choices.length; j++) {
|
||||
for (j = 0; j < choices.length; j++) {
|
||||
let newRadio = document.createElement("input");
|
||||
newRadio.setAttribute("type", "radio");
|
||||
newRadio.setAttribute("name", radioName);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>testpilot@labs.mozilla.com</em:id>
|
||||
<em:version>1.1.1</em:version>
|
||||
<em:version>1.1.2</em:version>
|
||||
<em:type>2</em:type>
|
||||
|
||||
<!-- Target Application this extension can install into,
|
||||
|
@ -13,7 +13,7 @@
|
|||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>3.5</em:minVersion>
|
||||
<em:maxVersion>5.0</em:maxVersion>
|
||||
<em:maxVersion>6.0</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
|
|
|
@ -512,15 +512,15 @@ exports.RemoteExperimentLoader.prototype = {
|
|||
remoteExperiments[filename] = this._loader.require(filename);
|
||||
this._logger.info("Loaded " + filename + " OK.");
|
||||
} catch(e) {
|
||||
/* Turn the load-time errors into strings and store them, so we can display
|
||||
* them on a debug page or include them with a data upload! (Don't store
|
||||
* exception objects directly as that causes garbage collector problems-
|
||||
* aka bug 646122) */
|
||||
let errStr = e.name + " on line " + e.lineNumber + " of file " +
|
||||
e.fileName + ": " + e.message;
|
||||
/* Turn the load-time errors into strings and store them, so we can display
|
||||
* them on a debug page or include them with a data upload! (Don't store
|
||||
* exception objects directly as that causes garbage collector problems-
|
||||
* aka bug 646122) */
|
||||
let errStr = e.name + " on line " + e.lineNumber + " of file " +
|
||||
e.fileName + ": " + e.message;
|
||||
this._loadErrors.push(errStr);
|
||||
this._logger.warn("Error loading " + filename);
|
||||
this._logger.warn(e);
|
||||
this._logger.warn(errStr);
|
||||
}
|
||||
}
|
||||
return remoteExperiments;
|
||||
|
|
|
@ -254,18 +254,15 @@ let TestPilotSetup = {
|
|||
Ci.nsITimer.TYPE_REPEATING_SLACK);
|
||||
|
||||
this.getVersion(function() {
|
||||
// Show first run page (in front window) if newly installed or upgraded.
|
||||
let currVersion = self._prefs.getValue(VERSION_PREF, "firstrun");
|
||||
|
||||
if (currVersion != self.version) {
|
||||
if(!self._isBetaChannel()) {
|
||||
// Don't show first run page in ffx4 beta version.
|
||||
/* Show first run page (in front window) only the first time after install;
|
||||
* Don't show first run page in Feedback UI version. */
|
||||
if ((self._prefs.getValue(VERSION_PREF, "") == "") &&
|
||||
(!self._interfaceBuilder.channelUsesFeedback())) {
|
||||
self._prefs.setValue(VERSION_PREF, self.version);
|
||||
let browser = self._getFrontBrowserWindow().getBrowser();
|
||||
let url = self._prefs.getValue(FIRST_RUN_PREF, "");
|
||||
let tab = browser.addTab(url);
|
||||
browser.selectedTab = tab;
|
||||
}
|
||||
}
|
||||
|
||||
// Install tasks. (This requires knowing the version, so it is
|
||||
|
|
|
@ -597,7 +597,7 @@ TestPilotExperiment.prototype = {
|
|||
}
|
||||
}
|
||||
} catch(e) {
|
||||
this._logger.warn("Error in getStudyMetadata: " + e);
|
||||
this._dataStore.logException("getStudyMetadata: " + e);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
@ -660,6 +660,7 @@ TestPilotExperiment.prototype = {
|
|||
// This method handles all date-related status changes and should be
|
||||
// called periodically.
|
||||
let currentDate = this._now();
|
||||
let self = this;
|
||||
|
||||
// Reset automatically recurring tests:
|
||||
if (this._recursAutomatically &&
|
||||
|
@ -703,7 +704,6 @@ TestPilotExperiment.prototype = {
|
|||
currentDate <= this._endDate) {
|
||||
this._logger.info("Study now starting.");
|
||||
// clear the data before starting.
|
||||
let self = this;
|
||||
this._dataStore.wipeAllData(function() {
|
||||
// Experiment is now in progress.
|
||||
self.changeStatus(TaskConstants.STATUS_IN_PROGRESS, true);
|
||||
|
@ -714,7 +714,6 @@ TestPilotExperiment.prototype = {
|
|||
// What happens when a test finishes:
|
||||
if (this._status < TaskConstants.STATUS_FINISHED &&
|
||||
currentDate > this._endDate) {
|
||||
let self = this;
|
||||
let setDataDeletionDate = true;
|
||||
this._logger.info("Passed End Date - Switched Task Status to Finished");
|
||||
this.changeStatus(TaskConstants.STATUS_FINISHED);
|
||||
|
@ -896,7 +895,6 @@ TestPilotExperiment.prototype = {
|
|||
optOut: function TestPilotExperiment_optOut(reason, callback) {
|
||||
// Regardless of study ID, post the opt-out message to a special
|
||||
// database table of just opt-out messages; include study ID in metadata.
|
||||
let url = Application.prefs.getValue(DATA_UPLOAD_PREF, "") + "opt-out";
|
||||
let logger = this._logger;
|
||||
|
||||
this.onExperimentShutdown();
|
||||
|
@ -909,6 +907,7 @@ TestPilotExperiment.prototype = {
|
|||
if (reason) {
|
||||
// Send us the reason...
|
||||
// (TODO: include metadata?)
|
||||
let url = Application.prefs.getValue(DATA_UPLOAD_PREF, "") + "opt-out";
|
||||
let answer = {id: this._id,
|
||||
reason: reason};
|
||||
let dataString = JSON.stringify(answer);
|
||||
|
@ -924,17 +923,23 @@ TestPilotExperiment.prototype = {
|
|||
if (req.readyState == 4) {
|
||||
if (req.status == 200 || req.status == 201 || req.status == 202) {
|
||||
logger.info("Quit reason posted successfully " + req.responseText);
|
||||
callback(true);
|
||||
if (callback) {
|
||||
callback(true);
|
||||
}
|
||||
} else {
|
||||
logger.warn(req.status + " posting error " + req.responseText);
|
||||
callback(false);
|
||||
if (callback) {
|
||||
callback(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
logger.trace("Sending quit reason.");
|
||||
req.send(dataString);
|
||||
} else {
|
||||
callback(false);
|
||||
if (callback) {
|
||||
callback(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -961,6 +966,7 @@ TestPilotBuiltinSurvey.prototype = {
|
|||
this._versionNumber = surveyInfo.versionNumber;
|
||||
this._questions = surveyInfo.surveyQuestions;
|
||||
this._explanation = surveyInfo.surveyExplanation;
|
||||
this._onPageLoad = surveyInfo.onPageLoad;
|
||||
},
|
||||
|
||||
get taskType() {
|
||||
|
@ -988,6 +994,12 @@ TestPilotBuiltinSurvey.prototype = {
|
|||
return this._studyId;
|
||||
},
|
||||
|
||||
onPageLoad: function(task, document) {
|
||||
if (this._onPageLoad) {
|
||||
this._onPageLoad(task, document);
|
||||
}
|
||||
},
|
||||
|
||||
onDetailPageOpened: function TPS_onDetailPageOpened() {
|
||||
if (this._status < TaskConstants.STATUS_IN_PROGRESS) {
|
||||
this.changeStatus( TaskConstants.STATUS_IN_PROGRESS, true );
|
||||
|
@ -1204,4 +1216,4 @@ TestPilotLegacyStudy.prototype = {
|
|||
// TODO test that they don't say "thanks for contributing" if the
|
||||
// user didn't actually complete them...
|
||||
};
|
||||
TestPilotLegacyStudy.prototype.__proto__ = TestPilotTask;
|
||||
TestPilotLegacyStudy.prototype.__proto__ = TestPilotTask;
|
||||
|
|
|
@ -43,8 +43,6 @@ VPATH = @srcdir@
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -DFIREFOX_VERSION=$(FIREFOX_VERSION)
|
||||
|
||||
FILES := \
|
||||
install.rdf \
|
||||
$(NULL)
|
||||
|
|
|
@ -70,6 +70,7 @@ pref("extensions.blocklist.interval", 86400);
|
|||
pref("extensions.blocklist.level", 2);
|
||||
pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/");
|
||||
pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/");
|
||||
pref("extensions.blocklist.itemURL", "https://addons.mozilla.org/%LOCALE%/%APP%/blocked/%blockID%");
|
||||
|
||||
pref("extensions.update.autoUpdateDefault", true);
|
||||
|
||||
|
@ -785,6 +786,8 @@ pref("browser.sessionstore.max_resumed_crashes", 1);
|
|||
// Other tabs won't be restored until they are selected
|
||||
// N = The number of tabs to restore at the same time
|
||||
pref("browser.sessionstore.max_concurrent_tabs", 3);
|
||||
// Whether to automatically restore hidden tabs (i.e., tabs in other tab groups) or not
|
||||
pref("browser.sessionstore.restore_hidden_tabs", false);
|
||||
|
||||
// allow META refresh by default
|
||||
pref("accessibility.blockautorefresh", false);
|
||||
|
@ -899,6 +902,17 @@ pref("dom.ipc.plugins.enabled.x86_64", true);
|
|||
pref("dom.ipc.plugins.enabled", true);
|
||||
#endif
|
||||
|
||||
// This pref governs whether we attempt to work around problems caused by
|
||||
// plugins using OS calls to manipulate the cursor while running out-of-
|
||||
// process. These workarounds all involve intercepting (hooking) certain
|
||||
// OS calls in the plugin process, then arranging to make certain OS calls
|
||||
// in the browser process. Eventually plugins will be required to use the
|
||||
// NPAPI to manipulate the cursor, and these workarounds will be removed.
|
||||
// See bug 621117.
|
||||
#ifdef XP_MACOSX
|
||||
pref("dom.ipc.plugins.nativeCursorSupport", true);
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
pref("browser.taskbar.previews.enable", false);
|
||||
pref("browser.taskbar.previews.max", 20);
|
||||
|
@ -1003,6 +1017,19 @@ pref("devtools.chrome.enabled", false);
|
|||
// Change to -1 if you do not want the Web Console to remember its last height.
|
||||
pref("devtools.hud.height", 0);
|
||||
|
||||
// Remember the Web Console position. Possible values:
|
||||
// above - above the web page,
|
||||
// below - below the web page,
|
||||
// window - in a separate window/popup panel.
|
||||
pref("devtools.webconsole.position", "above");
|
||||
|
||||
// The number of lines that are displayed in the web console for the Net,
|
||||
// CSS, JS and Web Developer categories.
|
||||
pref("devtools.hud.loglimit.network", 200);
|
||||
pref("devtools.hud.loglimit.cssparser", 200);
|
||||
pref("devtools.hud.loglimit.exception", 200);
|
||||
pref("devtools.hud.loglimit.console", 200);
|
||||
|
||||
// Whether the character encoding menu is under the main Firefox button. This
|
||||
// preference is a string so that localizers can alter it.
|
||||
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
|
||||
|
|
|
@ -359,7 +359,6 @@ appUpdater.prototype =
|
|||
// notified with the normal app update user interface so this is safe.
|
||||
gAppUpdater.isChecking = false;
|
||||
gAppUpdater.selectPanel("noUpdatesFound");
|
||||
return;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -613,6 +612,8 @@ var gChannelSelector = {
|
|||
// Change app update channel.
|
||||
Services.prefs.setCharPref("app.update.desiredChannel", this.channelValue);
|
||||
|
||||
// Stop any downloads in progress
|
||||
gAppUpdater.aus.pauseDownload();
|
||||
// App updater will look at app.update.desiredChannel for new channel value
|
||||
// and will clear it when the update is complete.
|
||||
gAppUpdater.isChecking = true;
|
||||
|
|
|
@ -201,6 +201,10 @@
|
|||
label="&errorConsoleCmd.label;"
|
||||
key="key_errorConsole"
|
||||
oncommand="toJavaScriptConsole();"/>
|
||||
<menuseparator id="appmenu_devToolsEndSeparator"/>
|
||||
<menuitem id="appmenu_getMoreDevtools"
|
||||
label="&getMoreDevtoolsCmd.label;"
|
||||
oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
|
||||
<menuseparator/>
|
||||
#define ID_PREFIX appmenu_developer_
|
||||
#define OMIT_ACCESSKEYS
|
||||
|
|
|
@ -567,6 +567,11 @@
|
|||
accesskey="&errorConsoleCmd.accesskey;"
|
||||
key="key_errorConsole"
|
||||
oncommand="toJavaScriptConsole();"/>
|
||||
<menuseparator id="devToolsEndSeparator"/>
|
||||
<menuitem id="getMoreDevtools"
|
||||
label="&getMoreDevtoolsCmd.label;"
|
||||
accesskey="&getMoreDevtoolsCmd.accesskey;"
|
||||
oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem id="menu_pageInfo"
|
||||
|
|
|
@ -40,11 +40,15 @@ let TabView = {
|
|||
_deck: null,
|
||||
_iframe: null,
|
||||
_window: null,
|
||||
_firstUseExperienced: false,
|
||||
_browserKeyHandlerInitialized: false,
|
||||
_isFrameLoading: false,
|
||||
_initFrameCallbacks: [],
|
||||
PREF_BRANCH: "browser.panorama.",
|
||||
PREF_FIRST_RUN: "browser.panorama.experienced_first_run",
|
||||
PREF_STARTUP_PAGE: "browser.startup.page",
|
||||
PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
|
||||
VISIBILITY_IDENTIFIER: "tabview-visibility",
|
||||
GROUPS_IDENTIFIER: "tabview-groups",
|
||||
|
||||
// ----------
|
||||
get windowTitle() {
|
||||
|
@ -57,38 +61,56 @@ let TabView = {
|
|||
|
||||
// ----------
|
||||
get firstUseExperienced() {
|
||||
return this._firstUseExperienced;
|
||||
let pref = this.PREF_FIRST_RUN;
|
||||
if (Services.prefs.prefHasUserValue(pref))
|
||||
return Services.prefs.getBoolPref(pref);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
// ----------
|
||||
set firstUseExperienced(val) {
|
||||
if (val != this._firstUseExperienced)
|
||||
Services.prefs.setBoolPref("browser.panorama.experienced_first_run", val);
|
||||
Services.prefs.setBoolPref(this.PREF_FIRST_RUN, val);
|
||||
},
|
||||
|
||||
// ----------
|
||||
get sessionRestoreEnabledOnce() {
|
||||
let pref = this.PREF_RESTORE_ENABLED_ONCE;
|
||||
if (Services.prefs.prefHasUserValue(pref))
|
||||
return Services.prefs.getBoolPref(pref);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
// ----------
|
||||
set sessionRestoreEnabledOnce(val) {
|
||||
Services.prefs.setBoolPref(this.PREF_RESTORE_ENABLED_ONCE, val);
|
||||
},
|
||||
|
||||
// ----------
|
||||
init: function TabView_init() {
|
||||
if (!Services.prefs.prefHasUserValue("browser.panorama.experienced_first_run") ||
|
||||
!Services.prefs.getBoolPref("browser.panorama.experienced_first_run")) {
|
||||
Services.prefs.addObserver(
|
||||
"browser.panorama.experienced_first_run", this, false);
|
||||
} else {
|
||||
this._firstUseExperienced = true;
|
||||
|
||||
if (this.firstUseExperienced) {
|
||||
if ((gBrowser.tabs.length - gBrowser.visibleTabs.length) > 0)
|
||||
this._setBrowserKeyHandlers();
|
||||
|
||||
// ___ visibility
|
||||
let sessionstore =
|
||||
Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
let data = sessionstore.getWindowValue(window, this.VISIBILITY_IDENTIFIER);
|
||||
|
||||
let data = sessionstore.getWindowValue(window, this.VISIBILITY_IDENTIFIER);
|
||||
if (data && data == "true") {
|
||||
this.show();
|
||||
} else {
|
||||
let self = this;
|
||||
try {
|
||||
data = sessionstore.getWindowValue(window, this.GROUPS_IDENTIFIER);
|
||||
if (data) {
|
||||
let parsedData = JSON.parse(data);
|
||||
this.updateGroupNumberBroadcaster(parsedData.totalNumber || 0);
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
// if a tab is changed from hidden to unhidden and the iframe is not
|
||||
let self = this;
|
||||
// if a tab is changed from hidden to unhidden and the iframe is not
|
||||
// initialized, load the iframe and setup the tab.
|
||||
this._tabShowEventListener = function (event) {
|
||||
if (!self._window)
|
||||
|
@ -100,26 +122,24 @@ let TabView = {
|
|||
"TabShow", this._tabShowEventListener, true);
|
||||
}
|
||||
}
|
||||
|
||||
Services.prefs.addObserver(this.PREF_BRANCH, this, false);
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Observes topic changes.
|
||||
observe: function TabView_observe(subject, topic, data) {
|
||||
if (topic == "nsPref:changed") {
|
||||
Services.prefs.removeObserver(
|
||||
"browser.panorama.experienced_first_run", this);
|
||||
this._firstUseExperienced = true;
|
||||
if (data == this.PREF_FIRST_RUN && this.firstUseExperienced) {
|
||||
this._addToolbarButton();
|
||||
this.enableSessionRestore();
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Uninitializes TabView.
|
||||
uninit: function TabView_uninit() {
|
||||
if (!this._firstUseExperienced) {
|
||||
Services.prefs.removeObserver(
|
||||
"browser.panorama.experienced_first_run", this);
|
||||
}
|
||||
Services.prefs.removeObserver(this.PREF_BRANCH, this);
|
||||
|
||||
if (this._tabShowEventListener) {
|
||||
gBrowser.tabContainer.removeEventListener(
|
||||
"TabShow", this._tabShowEventListener, true);
|
||||
|
@ -366,5 +386,31 @@ let TabView = {
|
|||
toolbar.currentSet = currentSet;
|
||||
toolbar.setAttribute("currentset", currentSet);
|
||||
document.persist(toolbar.id, "currentset");
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: updateGroupNumberBroadcaster
|
||||
// Updates the group number broadcaster.
|
||||
updateGroupNumberBroadcaster: function TabView_updateGroupNumberBroadcaster(number) {
|
||||
let groupsNumber = document.getElementById("tabviewGroupsNumber");
|
||||
groupsNumber.setAttribute("groups", number);
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: enableSessionRestore
|
||||
// Enables automatic session restore when the browser is started. Does
|
||||
// nothing if we already did that once in the past.
|
||||
enableSessionRestore: function UI_enableSessionRestore() {
|
||||
if (!this._window || !this.firstUseExperienced)
|
||||
return;
|
||||
|
||||
// do nothing if we already enabled session restore once
|
||||
if (this.sessionRestoreEnabledOnce)
|
||||
return;
|
||||
|
||||
this.sessionRestoreEnabledOnce = true;
|
||||
|
||||
// enable session restore
|
||||
Services.prefs.setIntPref(this.PREF_STARTUP_PAGE, 3);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -462,7 +462,6 @@ statuspanel {
|
|||
margin-top: -3em;
|
||||
left: 0;
|
||||
max-width: 50%;
|
||||
-moz-transition: opacity 100ms ease-out;
|
||||
}
|
||||
|
||||
statuspanel:-moz-locale-dir(ltr)[mirror],
|
||||
|
@ -482,6 +481,7 @@ statuspanel[type=status] {
|
|||
}
|
||||
|
||||
statuspanel[type=overLink] {
|
||||
-moz-transition: opacity 100ms ease-out;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
|
@ -496,3 +496,7 @@ statuspanel[label=""] {
|
|||
width: 100%;
|
||||
-moz-box-align: end;
|
||||
}
|
||||
|
||||
.panel-inner-arrowcontentfooter[footertype="promobox"] {
|
||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
|
||||
}
|
||||
|
|
|
@ -261,10 +261,10 @@ function UpdateBackForwardCommands(aWebNavigation) {
|
|||
function SetClickAndHoldHandlers() {
|
||||
var timer;
|
||||
|
||||
function timerCallback(aButton) {
|
||||
function openMenu(aButton) {
|
||||
cancelHold(aButton);
|
||||
aButton.firstChild.hidden = false;
|
||||
aButton.open = true;
|
||||
timer = null;
|
||||
}
|
||||
|
||||
function mousedownHandler(aEvent) {
|
||||
|
@ -276,7 +276,29 @@ function SetClickAndHoldHandlers() {
|
|||
// Prevent the menupopup from opening immediately
|
||||
aEvent.currentTarget.firstChild.hidden = true;
|
||||
|
||||
timer = setTimeout(timerCallback, 500, aEvent.currentTarget);
|
||||
aEvent.currentTarget.addEventListener("mouseout", mouseoutHandler, false);
|
||||
aEvent.currentTarget.addEventListener("mouseup", mouseupHandler, false);
|
||||
timer = setTimeout(openMenu, 500, aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function mouseoutHandler(aEvent) {
|
||||
let buttonRect = aEvent.currentTarget.getBoundingClientRect();
|
||||
if (aEvent.clientX >= buttonRect.left &&
|
||||
aEvent.clientX <= buttonRect.right &&
|
||||
aEvent.clientY >= buttonRect.bottom)
|
||||
openMenu(aEvent.currentTarget);
|
||||
else
|
||||
cancelHold(aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function mouseupHandler(aEvent) {
|
||||
cancelHold(aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function cancelHold(aButton) {
|
||||
clearTimeout(timer);
|
||||
aButton.removeEventListener("mouseout", mouseoutHandler, false);
|
||||
aButton.removeEventListener("mouseup", mouseupHandler, false);
|
||||
}
|
||||
|
||||
function clickHandler(aEvent) {
|
||||
|
@ -292,36 +314,33 @@ function SetClickAndHoldHandlers() {
|
|||
}
|
||||
}
|
||||
|
||||
function stopTimer(aEvent) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
function _addClickAndHoldListenersOnElement(aElm) {
|
||||
aElm.addEventListener("mousedown", mousedownHandler, true);
|
||||
aElm.addEventListener("mouseup", stopTimer, false);
|
||||
aElm.addEventListener("mouseout", stopTimer, false);
|
||||
aElm.addEventListener("click", clickHandler, true);
|
||||
}
|
||||
|
||||
// Bug 414797: Clone the dropmarker's menu into both the back and
|
||||
// the forward buttons.
|
||||
// Bug 414797: Clone unified-back-forward-button's context menu into both the
|
||||
// back and the forward buttons.
|
||||
var unifiedButton = document.getElementById("unified-back-forward-button");
|
||||
if (unifiedButton && !unifiedButton._clickHandlersAttached) {
|
||||
var popup = document.getElementById("backForwardMenu").cloneNode(true);
|
||||
unifiedButton._clickHandlersAttached = true;
|
||||
|
||||
let popup = document.getElementById("backForwardMenu").cloneNode(true);
|
||||
popup.removeAttribute("id");
|
||||
var backButton = document.getElementById("back-button");
|
||||
// Prevent the context attribute on unified-back-forward-button from being
|
||||
// inherited.
|
||||
popup.setAttribute("context", "");
|
||||
|
||||
let backButton = document.getElementById("back-button");
|
||||
backButton.setAttribute("type", "menu");
|
||||
backButton.appendChild(popup);
|
||||
_addClickAndHoldListenersOnElement(backButton);
|
||||
var forwardButton = document.getElementById("forward-button");
|
||||
|
||||
let forwardButton = document.getElementById("forward-button");
|
||||
popup = popup.cloneNode(true);
|
||||
forwardButton.setAttribute("type", "menu");
|
||||
forwardButton.appendChild(popup);
|
||||
_addClickAndHoldListenersOnElement(forwardButton);
|
||||
unifiedButton._clickHandlersAttached = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1379,7 +1398,7 @@ function prepareForStartup() {
|
|||
gBrowser.addEventListener("NewPluginInstalled", gPluginHandler.newPluginInstalled, true);
|
||||
#ifdef XP_MACOSX
|
||||
gBrowser.addEventListener("npapi-carbon-event-model-failure", gPluginHandler, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Services.obs.addObserver(gPluginHandler.pluginCrashed, "plugin-crashed", false);
|
||||
|
||||
|
@ -3327,7 +3346,7 @@ const BrowserSearch = {
|
|||
var win = getTopWin();
|
||||
if (win) {
|
||||
// If there's an open browser window, it should handle this command
|
||||
win.focus()
|
||||
win.focus();
|
||||
win.BrowserSearch.webSearch();
|
||||
} else {
|
||||
// If there are no open browser windows, open a new one
|
||||
|
@ -3337,7 +3356,7 @@ const BrowserSearch = {
|
|||
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
|
||||
}
|
||||
}
|
||||
win = window.openDialog("chrome://browser/content/", "_blank",
|
||||
win = window.openDialog(getBrowserURL(), "_blank",
|
||||
"chrome,all,dialog=no", "about:blank");
|
||||
Services.obs.addObserver(observer, "browser-delayed-startup-finished", false);
|
||||
}
|
||||
|
@ -4118,7 +4137,7 @@ var XULBrowserWindow = {
|
|||
startTime: 0,
|
||||
statusText: "",
|
||||
isBusy: false,
|
||||
inContentWhitelist: ["about:addons"],
|
||||
inContentWhitelist: ["about:addons", "about:permissions"],
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (aIID.equals(Ci.nsIWebProgressListener) ||
|
||||
|
@ -6692,12 +6711,15 @@ var gPluginHandler = {
|
|||
handleEvent : function(event) {
|
||||
let self = gPluginHandler;
|
||||
let plugin = event.target;
|
||||
let hideBarPrefName;
|
||||
let doc = plugin.ownerDocument;
|
||||
|
||||
// We're expecting the target to be a plugin.
|
||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
||||
return;
|
||||
|
||||
// Force a style flush, so that we ensure our binding is attached.
|
||||
plugin.clientTop;
|
||||
|
||||
switch (event.type) {
|
||||
case "PluginCrashed":
|
||||
self.pluginInstanceCrashed(plugin, event);
|
||||
|
@ -6707,32 +6729,38 @@ var gPluginHandler = {
|
|||
// For non-object plugin tags, register a click handler to install the
|
||||
// plugin. Object tags can, and often do, deal with that themselves,
|
||||
// so don't stomp on the page developers toes.
|
||||
if (!(plugin instanceof HTMLObjectElement))
|
||||
self.addLinkClickCallback(plugin, "installSinglePlugin");
|
||||
if (!(plugin instanceof HTMLObjectElement)) {
|
||||
// We don't yet check to see if there's actually an installer available.
|
||||
let installStatus = doc.getAnonymousElementByAttribute(plugin, "class", "installStatus");
|
||||
installStatus.setAttribute("status", "ready");
|
||||
let iconStatus = doc.getAnonymousElementByAttribute(plugin, "class", "icon");
|
||||
iconStatus.setAttribute("status", "ready");
|
||||
|
||||
let installLink = doc.getAnonymousElementByAttribute(plugin, "class", "installPluginLink");
|
||||
self.addLinkClickCallback(installLink, "installSinglePlugin", plugin);
|
||||
}
|
||||
/* FALLTHRU */
|
||||
|
||||
case "PluginBlocklisted":
|
||||
case "PluginOutdated":
|
||||
hideBarPrefName = event.type == "PluginOutdated" ?
|
||||
"plugins.hide_infobar_for_outdated_plugin" :
|
||||
"plugins.hide_infobar_for_missing_plugin";
|
||||
if (gPrefService.getBoolPref(hideBarPrefName))
|
||||
return;
|
||||
|
||||
self.pluginUnavailable(plugin, event.type);
|
||||
break;
|
||||
#ifdef XP_MACOSX
|
||||
case "npapi-carbon-event-model-failure":
|
||||
hideBarPrefName = "plugins.hide_infobar_for_carbon_failure_plugin";
|
||||
if (gPrefService.getBoolPref(hideBarPrefName))
|
||||
return;
|
||||
|
||||
#endif
|
||||
self.pluginUnavailable(plugin, event.type);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case "PluginDisabled":
|
||||
self.addLinkClickCallback(plugin, "managePlugins");
|
||||
let manageLink = doc.getAnonymousElementByAttribute(plugin, "class", "managePluginsLink");
|
||||
self.addLinkClickCallback(manageLink, "managePlugins");
|
||||
break;
|
||||
}
|
||||
|
||||
// Hide the in-content UI if it's too big. The crashed plugin handler already did this.
|
||||
if (event.type != "PluginCrashed") {
|
||||
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
if (self.isTooSmall(plugin, overlay))
|
||||
overlay.style.visibility = "hidden";
|
||||
}
|
||||
},
|
||||
|
||||
newPluginInstalled : function(event) {
|
||||
|
@ -6751,10 +6779,10 @@ var gPluginHandler = {
|
|||
},
|
||||
|
||||
// Callback for user clicking on a missing (unsupported) plugin.
|
||||
installSinglePlugin: function (aEvent) {
|
||||
installSinglePlugin: function (plugin) {
|
||||
var missingPluginsArray = {};
|
||||
|
||||
var pluginInfo = getPluginInfo(aEvent.target);
|
||||
var pluginInfo = getPluginInfo(plugin);
|
||||
missingPluginsArray[pluginInfo.mimetype] = pluginInfo;
|
||||
|
||||
openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
|
||||
|
@ -6804,9 +6832,6 @@ var gPluginHandler = {
|
|||
let blockedNotification = notificationBox.getNotificationWithValue("blocked-plugins");
|
||||
let missingNotification = notificationBox.getNotificationWithValue("missing-plugins");
|
||||
|
||||
// If there is already an outdated plugin notification then do nothing
|
||||
if (outdatedNotification)
|
||||
return;
|
||||
|
||||
function showBlocklistInfo() {
|
||||
var url = formatURL("extensions.blocklist.detailsURL", true);
|
||||
|
@ -6838,7 +6863,7 @@ var gPluginHandler = {
|
|||
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
|
||||
|
||||
|
||||
// Something aborted the quit process.
|
||||
if (cancelQuit.data)
|
||||
return;
|
||||
|
@ -6902,10 +6927,17 @@ var gPluginHandler = {
|
|||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
// If there is already an outdated plugin notification then do nothing
|
||||
if (outdatedNotification)
|
||||
return;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
if (eventType == "npapi-carbon-event-model-failure") {
|
||||
if (gPrefService.getBoolPref("plugins.hide_infobar_for_carbon_failure_plugin"))
|
||||
return;
|
||||
|
||||
let carbonFailureNotification =
|
||||
let carbonFailureNotification =
|
||||
notificationBox.getNotificationWithValue("carbon-failure-plugins");
|
||||
|
||||
if (carbonFailureNotification)
|
||||
|
@ -6917,11 +6949,18 @@ var gPluginHandler = {
|
|||
eventType = "PluginNotFound";
|
||||
}
|
||||
#endif
|
||||
|
||||
if (eventType == "PluginBlocklisted") {
|
||||
if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin")) // XXX add a new pref?
|
||||
return;
|
||||
|
||||
if (blockedNotification || missingNotification)
|
||||
return;
|
||||
}
|
||||
else if (eventType == "PluginOutdated") {
|
||||
if (gPrefService.getBoolPref("plugins.hide_infobar_for_outdated_plugin"))
|
||||
return;
|
||||
|
||||
// Cancel any notification about blocklisting/missing plugins
|
||||
if (blockedNotification)
|
||||
blockedNotification.close();
|
||||
|
@ -6929,6 +6968,9 @@ var gPluginHandler = {
|
|||
missingNotification.close();
|
||||
}
|
||||
else if (eventType == "PluginNotFound") {
|
||||
if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin"))
|
||||
return;
|
||||
|
||||
if (missingNotification)
|
||||
return;
|
||||
|
||||
|
@ -6984,9 +7026,6 @@ var gPluginHandler = {
|
|||
// Remap the plugin name to a more user-presentable form.
|
||||
pluginName = this.makeNicePluginName(pluginName, pluginFilename);
|
||||
|
||||
// Force a style flush, so that we ensure our binding is attached.
|
||||
plugin.clientTop;
|
||||
|
||||
let messageString = gNavigatorBundle.getFormattedString("crashedpluginsMessage.title", [pluginName]);
|
||||
|
||||
//
|
||||
|
@ -6994,12 +7033,6 @@ var gPluginHandler = {
|
|||
//
|
||||
let doc = plugin.ownerDocument;
|
||||
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
|
||||
// The binding has role="link" here, since missing/disabled/blocked
|
||||
// plugin UI has a onclick handler on the whole thing. This isn't needed
|
||||
// for the plugin-crashed UI, because we use actual HTML links in the text.
|
||||
overlay.removeAttribute("role");
|
||||
|
||||
let statusDiv = doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
let status;
|
||||
|
@ -7653,12 +7686,6 @@ var gIdentityHandler = {
|
|||
icon_label = this.getEffectiveHost();
|
||||
}
|
||||
|
||||
// We need a port number for all lookups. If one hasn't been specified, use
|
||||
// the https default
|
||||
var lookupHost = this._lastLocation.host;
|
||||
if (lookupHost.indexOf(':') < 0)
|
||||
lookupHost += ":443";
|
||||
|
||||
// Verifier is either the CA Org, for a normal cert, or a special string
|
||||
// for certs that are trusted because of a security exception.
|
||||
var tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
|
||||
|
@ -7668,7 +7695,12 @@ var gIdentityHandler = {
|
|||
// thing here in terms of converting _lastLocation.port from string to int, but
|
||||
// the overrideService doesn't like undefined ports, so make sure we have
|
||||
// something in the default case (bug 432241).
|
||||
if (this._overrideService.hasMatchingOverride(this._lastLocation.hostname,
|
||||
// .hostname can return an empty string in some exceptional cases -
|
||||
// hasMatchingOverride does not handle that, so avoid calling it.
|
||||
// Updating the tooltip value in those cases isn't critical.
|
||||
// FIXME: Fixing bug 646690 would probably makes this check unnecessary
|
||||
if (this._lastLocation.hostname &&
|
||||
this._overrideService.hasMatchingOverride(this._lastLocation.hostname,
|
||||
(this._lastLocation.port || 443),
|
||||
iData.cert, {}, {}))
|
||||
tooltip = gNavigatorBundle.getString("identity.identified.verified_by_you");
|
||||
|
@ -8488,7 +8520,7 @@ var TabContextMenu = {
|
|||
updateContextMenu: function updateContextMenu(aPopupMenu) {
|
||||
this.contextTab = document.popupNode.localName == "tab" ?
|
||||
document.popupNode : gBrowser.selectedTab;
|
||||
let disabled = gBrowser.visibleTabs.length == 1;
|
||||
let disabled = gBrowser.tabs.length == 1;
|
||||
|
||||
// Enable the "Close Tab" menuitem when the window doesn't close with the last tab.
|
||||
document.getElementById("context_closeTab").disabled =
|
||||
|
@ -8498,6 +8530,11 @@ var TabContextMenu = {
|
|||
for (var i = 0; i < menuItems.length; i++)
|
||||
menuItems[i].disabled = disabled;
|
||||
|
||||
disabled = gBrowser.visibleTabs.length == 1;
|
||||
menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple-visible");
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
menuItems[i].disabled = disabled;
|
||||
|
||||
// Session store
|
||||
document.getElementById("context_undoCloseTab").disabled =
|
||||
Cc["@mozilla.org/browser/sessionstore;1"].
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
|
||||
tbattr="tabbrowser-multiple"
|
||||
tbattr="tabbrowser-multiple-visible"
|
||||
oncommand="gBrowser.reloadAllTabs();"/>
|
||||
<menuitem id="context_bookmarkAllTabs"
|
||||
label="&bookmarkAllTabs.label;"
|
||||
|
@ -177,6 +177,7 @@
|
|||
|
||||
<panel id="editBookmarkPanel"
|
||||
type="arrow"
|
||||
footertype="promobox"
|
||||
orient="vertical"
|
||||
ignorekeys="true"
|
||||
hidden="true"
|
||||
|
@ -337,8 +338,13 @@
|
|||
|
||||
<menupopup id="placesContext"/>
|
||||
|
||||
<panel id="notification-popup" type="arrow" position="after_start"
|
||||
hidden="true" orient="vertical"/>
|
||||
<panel id="notification-popup"
|
||||
type="arrow"
|
||||
footertype="promobox"
|
||||
position="after_start"
|
||||
hidden="true"
|
||||
orient="vertical"
|
||||
role="alert"/>
|
||||
|
||||
<!-- Popup for site identity information -->
|
||||
<panel id="identity-popup"
|
||||
|
@ -844,9 +850,8 @@
|
|||
key="key_tabview"
|
||||
label="&viewTabGroups.label;"
|
||||
command="Browser:ToggleTabView"
|
||||
observes="tabviewGroupsNumber"
|
||||
keepme="true"/>
|
||||
<menuseparator id="alltabs-popup-separator" keepme="true"/>
|
||||
observes="tabviewGroupsNumber"/>
|
||||
<menuseparator id="alltabs-popup-separator"/>
|
||||
</menupopup>
|
||||
</toolbarbutton>
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ Cu.import("resource://gre/modules/NetUtil.jsm");
|
|||
Cu.import("resource:///modules/PropertyPanel.jsm");
|
||||
|
||||
const SCRATCHPAD_CONTEXT_CONTENT = 1;
|
||||
const SCRATCHPAD_CONTEXT_CHROME = 2;
|
||||
const SCRATCHPAD_CONTEXT_BROWSER = 2;
|
||||
const SCRATCHPAD_WINDOW_URL = "chrome://browser/content/scratchpad.xul";
|
||||
const SCRATCHPAD_L10N = "chrome://browser/locale/scratchpad.properties";
|
||||
const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
|
||||
|
@ -75,7 +75,7 @@ var Scratchpad = {
|
|||
* Possible values:
|
||||
* - SCRATCHPAD_CONTEXT_CONTENT to execute code in the context of the current
|
||||
* tab content window object.
|
||||
* - SCRATCHPAD_CONTEXT_CHROME to execute code in the context of the
|
||||
* - SCRATCHPAD_CONTEXT_BROWSER to execute code in the context of the
|
||||
* currently active chrome window object.
|
||||
*/
|
||||
executionContext: SCRATCHPAD_CONTEXT_CONTENT,
|
||||
|
@ -121,6 +121,11 @@ var Scratchpad = {
|
|||
return recentWin ? recentWin.gBrowser : null;
|
||||
},
|
||||
|
||||
insertIntro: function SP_insertIntro()
|
||||
{
|
||||
this.textbox.value = this.strings.GetStringFromName("scratchpadIntro");
|
||||
},
|
||||
|
||||
/**
|
||||
* Cached Cu.Sandbox object for the active tab content window object.
|
||||
*/
|
||||
|
@ -129,8 +134,9 @@ var Scratchpad = {
|
|||
/**
|
||||
* Get the Cu.Sandbox object for the active tab content window object. Note
|
||||
* that the returned object is cached for later reuse. The cached object is
|
||||
* kept only for the current browser window and it is reset for each context
|
||||
* switch or navigator:browser window switch.
|
||||
* kept only for the current location in the current tab of the current
|
||||
* browser window and it is reset for each context switch,
|
||||
* navigator:browser window switch, tab switch or navigation.
|
||||
*/
|
||||
get contentSandbox()
|
||||
{
|
||||
|
@ -141,12 +147,16 @@ var Scratchpad = {
|
|||
}
|
||||
|
||||
if (!this._contentSandbox ||
|
||||
this.browserWindow != this._previousBrowserWindow) {
|
||||
this.browserWindow != this._previousBrowserWindow ||
|
||||
this._previousBrowser != this.gBrowser.selectedBrowser ||
|
||||
this._previousLocation != this.gBrowser.contentWindow.location.href) {
|
||||
let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
|
||||
this._contentSandbox = new Cu.Sandbox(contentWindow,
|
||||
{ sandboxPrototype: contentWindow, wantXrays: false });
|
||||
|
||||
this._previousBrowserWindow = this.browserWindow;
|
||||
this._previousBrowser = this.gBrowser.selectedBrowser;
|
||||
this._previousLocation = contentWindow.location.href;
|
||||
}
|
||||
|
||||
return this._contentSandbox;
|
||||
|
@ -283,7 +293,7 @@ var Scratchpad = {
|
|||
* Execute the selected text (if any) or the entire textbox content in the
|
||||
* current context.
|
||||
*/
|
||||
execute: function SP_execute()
|
||||
run: function SP_run()
|
||||
{
|
||||
let selection = this.selectedText || this.textbox.value;
|
||||
let result = this.evalForContext(selection);
|
||||
|
@ -298,7 +308,7 @@ var Scratchpad = {
|
|||
*/
|
||||
inspect: function SP_inspect()
|
||||
{
|
||||
let [selection, result] = this.execute();
|
||||
let [selection, result] = this.run();
|
||||
|
||||
if (result) {
|
||||
this.openPropertyPanel(selection, result);
|
||||
|
@ -307,11 +317,11 @@ var Scratchpad = {
|
|||
|
||||
/**
|
||||
* Execute the selected text (if any) or the entire textbox content in the
|
||||
* current context. The evaluation result is "printed" in the textbox after
|
||||
* current context. The evaluation result is inserted into the textbox after
|
||||
* the selected text, or at the end of the textbox value if there is no
|
||||
* selected text.
|
||||
*/
|
||||
print: function SP_print()
|
||||
display: function SP_display()
|
||||
{
|
||||
let selectionStart = this.textbox.selectionStart;
|
||||
let selectionEnd = this.textbox.selectionEnd;
|
||||
|
@ -319,7 +329,7 @@ var Scratchpad = {
|
|||
selectionEnd = this.textbox.value.length;
|
||||
}
|
||||
|
||||
let [selection, result] = this.execute();
|
||||
let [selection, result] = this.run();
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
@ -556,23 +566,23 @@ var Scratchpad = {
|
|||
setContentContext: function SP_setContentContext()
|
||||
{
|
||||
let content = document.getElementById("sp-menu-content");
|
||||
document.getElementById("sp-menu-chrome").removeAttribute("checked");
|
||||
document.getElementById("sp-menu-browser").removeAttribute("checked");
|
||||
content.setAttribute("checked", true);
|
||||
this.statusbarStatus.label = content.getAttribute("label");
|
||||
this.executionContext = SCRATCHPAD_CONTEXT_CONTENT;
|
||||
this.statusbarStatus.label = content.getAttribute("label");
|
||||
this.resetContext();
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the current execution context to be the most recent chrome window.
|
||||
*/
|
||||
setChromeContext: function SP_setChromeContext()
|
||||
setBrowserContext: function SP_setBrowserContext()
|
||||
{
|
||||
let chrome = document.getElementById("sp-menu-chrome");
|
||||
let browser = document.getElementById("sp-menu-browser");
|
||||
document.getElementById("sp-menu-content").removeAttribute("checked");
|
||||
chrome.setAttribute("checked", true);
|
||||
this.statusbarStatus.label = chrome.getAttribute("label");
|
||||
this.executionContext = SCRATCHPAD_CONTEXT_CHROME;
|
||||
browser.setAttribute("checked", true);
|
||||
this.executionContext = SCRATCHPAD_CONTEXT_BROWSER;
|
||||
this.statusbarStatus.label = browser.getAttribute("label");
|
||||
this.resetContext();
|
||||
},
|
||||
|
||||
|
@ -584,6 +594,8 @@ var Scratchpad = {
|
|||
this._chromeSandbox = null;
|
||||
this._contentSandbox = null;
|
||||
this._previousWindow = null;
|
||||
this._previousBrowser = null;
|
||||
this._previousLocation = null;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -604,10 +616,10 @@ var Scratchpad = {
|
|||
*/
|
||||
onLoad: function SP_onLoad()
|
||||
{
|
||||
let chromeContextMenu = document.getElementById("sp-menu-chrome");
|
||||
let chromeContextMenu = document.getElementById("sp-menu-browser");
|
||||
let errorConsoleMenu = document.getElementById("sp-menu-errorConsole");
|
||||
let errorConsoleCommand = document.getElementById("sp-cmd-errorConsole");
|
||||
let chromeContextCommand = document.getElementById("sp-cmd-chromeContext");
|
||||
let chromeContextCommand = document.getElementById("sp-cmd-browserContext");
|
||||
|
||||
let chrome = Services.prefs.getBoolPref(DEVTOOLS_CHROME_ENABLED);
|
||||
if (chrome) {
|
||||
|
@ -616,6 +628,7 @@ var Scratchpad = {
|
|||
errorConsoleCommand.removeAttribute("disabled");
|
||||
chromeContextCommand.removeAttribute("disabled");
|
||||
}
|
||||
this.insertIntro();
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -70,11 +70,11 @@
|
|||
-->
|
||||
|
||||
<command id="sp-cmd-close" oncommand="window.close();"/>
|
||||
<command id="sp-cmd-execute" oncommand="Scratchpad.execute();"/>
|
||||
<command id="sp-cmd-run" oncommand="Scratchpad.run();"/>
|
||||
<command id="sp-cmd-inspect" oncommand="Scratchpad.inspect();"/>
|
||||
<command id="sp-cmd-print" oncommand="Scratchpad.print();"/>
|
||||
<command id="sp-cmd-display" oncommand="Scratchpad.display();"/>
|
||||
<command id="sp-cmd-contentContext" oncommand="Scratchpad.setContentContext();"/>
|
||||
<command id="sp-cmd-chromeContext" oncommand="Scratchpad.setChromeContext();" disabled="true"/>
|
||||
<command id="sp-cmd-browserContext" oncommand="Scratchpad.setBrowserContext();" disabled="true"/>
|
||||
<command id="sp-cmd-resetContext" oncommand="Scratchpad.resetContext();"/>
|
||||
<command id="sp-cmd-errorConsole" oncommand="Scratchpad.openErrorConsole();" disabled="true"/>
|
||||
<command id="sp-cmd-webConsole" oncommand="Scratchpad.openWebConsole();"/>
|
||||
|
@ -118,17 +118,17 @@
|
|||
<key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
|
||||
<key id="key_undo" key="&undoCmd.key;" modifiers="accel"/>
|
||||
<key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
|
||||
<key id="sp-key-execute"
|
||||
key="&execute.key;"
|
||||
command="sp-cmd-execute"
|
||||
<key id="sp-key-run"
|
||||
key="&run.key;"
|
||||
command="sp-cmd-run"
|
||||
modifiers="accel"/>
|
||||
<key id="sp-key-inspect"
|
||||
key="&inspect.key;"
|
||||
command="sp-cmd-inspect"
|
||||
modifiers="accel"/>
|
||||
<key id="sp-key-print"
|
||||
key="&print.key;"
|
||||
command="sp-cmd-print"
|
||||
<key id="sp-key-display"
|
||||
key="&display.key;"
|
||||
command="sp-cmd-display"
|
||||
modifiers="accel"/>
|
||||
<key id="sp-key-errorConsole"
|
||||
key="&errorConsoleCmd.commandkey;"
|
||||
|
@ -220,7 +220,6 @@
|
|||
key="key_selectAll"
|
||||
accesskey="&selectAllCmd.accesskey;"
|
||||
command="cmd_selectAll"/>
|
||||
<menuseparator/>
|
||||
|
||||
<!-- TODO: bug 650345 - implement search and replace
|
||||
<menuitem id="sp-menu-find"
|
||||
|
@ -238,38 +237,44 @@
|
|||
<menuseparator id="sp-execute-separator"/>
|
||||
-->
|
||||
|
||||
<menuitem id="sp-text-execute"
|
||||
label="&execute.label;"
|
||||
accesskey="&execute.accesskey;"
|
||||
key="sp-key-execute"
|
||||
command="sp-cmd-execute"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="sp-execute-menu" label="&executeMenu.label;"
|
||||
accesskey="&executeMenu.accesskey;">
|
||||
<menupopup id="sp-menu_executepopup">
|
||||
<menuitem id="sp-text-run"
|
||||
label="&run.label;"
|
||||
accesskey="&run.accesskey;"
|
||||
key="sp-key-run"
|
||||
command="sp-cmd-run"/>
|
||||
<menuitem id="sp-text-inspect"
|
||||
label="&inspect.label;"
|
||||
accesskey="&inspect.accesskey;"
|
||||
key="sp-key-inspect"
|
||||
command="sp-cmd-inspect"/>
|
||||
<menuitem id="sp-text-print"
|
||||
label="&print.label;"
|
||||
accesskey="&print.accesskey;"
|
||||
key="sp-key-print"
|
||||
command="sp-cmd-print"/>
|
||||
<menuitem id="sp-text-display"
|
||||
label="&display.label;"
|
||||
accesskey="&display.accesskey;"
|
||||
key="sp-key-display"
|
||||
command="sp-cmd-display"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="sp-context-menu"
|
||||
label="&contextMenu.label;"
|
||||
accesskey="&contextMenu.accesskey;">
|
||||
<menupopup id="sp-menu-context">
|
||||
<menu id="sp-environment-menu"
|
||||
label="&environmentMenu.label;"
|
||||
accesskey="&environmentMenu.accesskey;">
|
||||
<menupopup id="sp-menu-environment">
|
||||
<menuitem id="sp-menu-content"
|
||||
label="&contentContext.label;"
|
||||
accesskey="&contentContext.accesskey;"
|
||||
command="sp-cmd-contentContext"
|
||||
checked="true"
|
||||
type="radio"/>
|
||||
<menuitem id="sp-menu-chrome" hidden="true"
|
||||
command="sp-cmd-chromeContext"
|
||||
label="&chromeContext.label;"
|
||||
accesskey="&chromeContext.accesskey;"
|
||||
<menuitem id="sp-menu-browser" hidden="true"
|
||||
command="sp-cmd-browserContext"
|
||||
label="&browserContext.label;"
|
||||
accesskey="&browserContext.accesskey;"
|
||||
type="radio"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="sp-menu-resetContext"
|
||||
|
@ -306,21 +311,21 @@
|
|||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="sp-text-execute"
|
||||
label="&execute.label;"
|
||||
accesskey="&execute.accesskey;"
|
||||
key="sp-key-execute"
|
||||
command="sp-cmd-execute"/>
|
||||
<menuitem id="sp-text-run"
|
||||
label="&run.label;"
|
||||
accesskey="&run.accesskey;"
|
||||
key="sp-key-run"
|
||||
command="sp-cmd-run"/>
|
||||
<menuitem id="sp-text-inspect"
|
||||
label="&inspect.label;"
|
||||
accesskey="&inspect.accesskey;"
|
||||
key="sp-key-inspect"
|
||||
command="sp-cmd-inspect"/>
|
||||
<menuitem id="sp-text-print"
|
||||
label="&print.label;"
|
||||
accesskey="&print.accesskey;"
|
||||
key="sp-key-print"
|
||||
command="sp-cmd-print"/>
|
||||
<menuitem id="sp-text-display"
|
||||
label="&display.label;"
|
||||
accesskey="&display.accesskey;"
|
||||
key="sp-key-display"
|
||||
command="sp-cmd-display"/>
|
||||
</menupopup>
|
||||
</popupset>
|
||||
|
||||
|
@ -328,7 +333,7 @@
|
|||
multiline="true"
|
||||
flex="1"
|
||||
context="scratchpad-text-popup"
|
||||
placeholder="&textbox.placeholder;" />
|
||||
placeholder="&textbox.placeholder1;" />
|
||||
<statusbar id="scratchpad-statusbar" align="end">
|
||||
<statusbarpanel id="scratchpad-status"
|
||||
label="&contentContext.label;"
|
||||
|
|
|
@ -64,6 +64,7 @@ const RECAPTCHA_DOMAIN = "https://www.google.com";
|
|||
Cu.import("resource://services-sync/main.js");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
Cu.import("resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
var gSyncSetup = {
|
||||
|
@ -92,9 +93,9 @@ var gSyncSetup = {
|
|||
init: function () {
|
||||
let obs = [
|
||||
["weave:service:changepph:finish", "onResetPassphrase"],
|
||||
["weave:service:verify-login:start", "onLoginStart"],
|
||||
["weave:service:verify-login:error", "onLoginEnd"],
|
||||
["weave:service:verify-login:finish", "onLoginEnd"]];
|
||||
["weave:service:login:start", "onLoginStart"],
|
||||
["weave:service:login:error", "onLoginEnd"],
|
||||
["weave:service:login:finish", "onLoginEnd"]];
|
||||
|
||||
// Add the observers now and remove them on unload
|
||||
let self = this;
|
||||
|
@ -216,6 +217,8 @@ var gSyncSetup = {
|
|||
feedback = server;
|
||||
break;
|
||||
case Weave.LOGIN_FAILED_LOGIN_REJECTED:
|
||||
case Weave.LOGIN_FAILED_NO_USERNAME:
|
||||
case Weave.LOGIN_FAILED_NO_PASSWORD:
|
||||
feedback = password;
|
||||
break;
|
||||
case Weave.LOGIN_FAILED_INVALID_PASSPHRASE:
|
||||
|
@ -820,7 +823,9 @@ var gSyncSetup = {
|
|||
if (this._case1Setup)
|
||||
break;
|
||||
|
||||
let places_db = Weave.Svc.History.DBConnection;
|
||||
let places_db = PlacesUtils.history
|
||||
.QueryInterface(Ci.nsPIPlacesDatabase)
|
||||
.DBConnection;
|
||||
if (Weave.Engines.get("history").enabled) {
|
||||
let daysOfHistory = 0;
|
||||
let stm = places_db.createStatement(
|
||||
|
@ -851,7 +856,7 @@ var gSyncSetup = {
|
|||
"FROM moz_bookmarks b " +
|
||||
"LEFT JOIN moz_bookmarks t ON " +
|
||||
"b.parent = t.id WHERE b.type = 1 AND t.parent <> :tag");
|
||||
stm.params.tag = Weave.Svc.Bookmark.tagsFolder;
|
||||
stm.params.tag = PlacesUtils.tagsFolderId;
|
||||
if (stm.executeStep())
|
||||
bookmarks = stm.row.bookmarks;
|
||||
// Support %S for historical reasons (see bug 600141)
|
||||
|
@ -865,7 +870,7 @@ var gSyncSetup = {
|
|||
}
|
||||
|
||||
if (Weave.Engines.get("passwords").enabled) {
|
||||
let logins = Weave.Svc.Login.getAllLogins({});
|
||||
let logins = Services.logins.getAllLogins({});
|
||||
// Support %S for historical reasons (see bug 600141)
|
||||
document.getElementById("passwordCount").value =
|
||||
PluralForm.get(logins.length,
|
||||
|
|
|
@ -55,8 +55,8 @@ let gSyncUtils = {
|
|||
else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
|
||||
openUILinkIn(url, "window");
|
||||
else if (document.documentElement.id == "change-dialog")
|
||||
Weave.Svc.WinMediator.getMostRecentWindow("navigator:browser")
|
||||
.openUILinkIn(url, "tab");
|
||||
Services.wm.getMostRecentWindow("navigator:browser")
|
||||
.openUILinkIn(url, "tab");
|
||||
else
|
||||
openUILinkIn(url, "tab");
|
||||
},
|
||||
|
@ -69,7 +69,7 @@ let gSyncUtils = {
|
|||
|
||||
openChange: function openChange(type, duringSetup) {
|
||||
// Just re-show the dialog if it's already open
|
||||
let openedDialog = Weave.Svc.WinMediator.getMostRecentWindow("Sync:" + type);
|
||||
let openedDialog = Services.wm.getMostRecentWindow("Sync:" + type);
|
||||
if (openedDialog != null) {
|
||||
openedDialog.focus();
|
||||
return;
|
||||
|
@ -78,8 +78,8 @@ let gSyncUtils = {
|
|||
// Open up the change dialog
|
||||
let changeXUL = "chrome://browser/content/syncGenericChange.xul";
|
||||
let changeOpt = "centerscreen,chrome,resizable=no";
|
||||
Weave.Svc.WinWatcher.activeWindow.openDialog(changeXUL, "", changeOpt,
|
||||
type, duringSetup);
|
||||
Services.ww.activeWindow.openDialog(changeXUL, "", changeOpt,
|
||||
type, duringSetup);
|
||||
},
|
||||
|
||||
changePassword: function () {
|
||||
|
@ -194,12 +194,13 @@ let gSyncUtils = {
|
|||
*/
|
||||
passphraseSave: function(elid) {
|
||||
let dialogTitle = this.bundle.GetStringFromName("save.synckey.title");
|
||||
let defaultSaveName = this.bundle.GetStringFromName("save.default.label");
|
||||
this._preparePPiframe(elid, function(iframe) {
|
||||
let filepicker = Cc["@mozilla.org/filepicker;1"]
|
||||
.createInstance(Ci.nsIFilePicker);
|
||||
filepicker.init(window, dialogTitle, Ci.nsIFilePicker.modeSave);
|
||||
filepicker.appendFilters(Ci.nsIFilePicker.filterHTML);
|
||||
filepicker.defaultString = "Firefox Sync Key.html";
|
||||
filepicker.defaultString = defaultSaveName;
|
||||
let rv = filepicker.show();
|
||||
if (rv == Ci.nsIFilePicker.returnOK
|
||||
|| rv == Ci.nsIFilePicker.returnReplace) {
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<property name="visibleTabs" readonly="true">
|
||||
<getter><![CDATA[
|
||||
return Array.filter(this.tabs, function(tab) {
|
||||
return !tab.hidden && this._removingTabs.indexOf(tab) == -1;
|
||||
return !tab.hidden && !tab.closing;
|
||||
}, this);
|
||||
]]></getter>
|
||||
</property>
|
||||
|
@ -208,7 +208,7 @@
|
|||
//
|
||||
// Fixing bug 630826 could make that happen automatically.
|
||||
// Fixing bug 630830 could avoid the ugly hack below.
|
||||
|
||||
|
||||
let closeMenuItem = document.getElementById("menu_close");
|
||||
let parentPopup = closeMenuItem.parentNode;
|
||||
let nextItem = closeMenuItem.nextSibling;
|
||||
|
@ -963,6 +963,10 @@
|
|||
// if the tab is a blank one.
|
||||
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
|
||||
if (newBrowser._urlbarFocused && gURLBar) {
|
||||
|
||||
// Explicitly close the popup if the URL bar retains focus
|
||||
gURLBar.closePopup();
|
||||
|
||||
if (!window.fullScreen) {
|
||||
gURLBar.focus();
|
||||
break;
|
||||
|
@ -999,7 +1003,7 @@
|
|||
<method name="_tabAttrModified">
|
||||
<parameter name="aTab"/>
|
||||
<body><![CDATA[
|
||||
if (this._removingTabs.indexOf(aTab) > -1)
|
||||
if (aTab.closing)
|
||||
return;
|
||||
|
||||
// This event should be dispatched when any of these attributes change:
|
||||
|
@ -1455,7 +1459,7 @@
|
|||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate &&
|
||||
this._removingTabs.indexOf(aTab) > -1) {
|
||||
aTab.closing) {
|
||||
this._endRemoveTab(aTab);
|
||||
return;
|
||||
}
|
||||
|
@ -1509,7 +1513,7 @@
|
|||
<parameter name="aCloseWindowFastpath"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._removingTabs.indexOf(aTab) > -1 || this._windowIsClosing)
|
||||
if (aTab.closing || this._windowIsClosing)
|
||||
return false;
|
||||
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
|
@ -1539,9 +1543,12 @@
|
|||
newTab = true;
|
||||
}
|
||||
|
||||
aTab.closing = true;
|
||||
this._removingTabs.push(aTab);
|
||||
|
||||
this.tabContainer.updateVisibility();
|
||||
if (newTab)
|
||||
this.addTab("about:blank", {skipAnimation: true});
|
||||
else
|
||||
this.tabContainer.updateVisibility();
|
||||
|
||||
// We're committed to closing the tab now.
|
||||
// Dispatch a notification.
|
||||
|
@ -1597,8 +1604,6 @@
|
|||
|
||||
// update the UI early for responsiveness
|
||||
aTab.collapsed = true;
|
||||
if (aNewTab)
|
||||
this.addTab("about:blank", {skipAnimation: true});
|
||||
this.tabContainer._fillTrailingGap();
|
||||
this._blurTab(aTab);
|
||||
|
||||
|
@ -1707,7 +1712,7 @@
|
|||
|
||||
if (aTab.owner &&
|
||||
!aTab.owner.hidden &&
|
||||
this._removingTabs.indexOf(aTab.owner) == -1 &&
|
||||
!aTab.owner.closing &&
|
||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")) {
|
||||
this.selectedTab = aTab.owner;
|
||||
return;
|
||||
|
@ -1718,7 +1723,7 @@
|
|||
let numTabs = remainingTabs.length;
|
||||
if (numTabs == 0 || numTabs == 1 && remainingTabs[0] == aTab) {
|
||||
remainingTabs = Array.filter(this.tabs, function(tab) {
|
||||
return this._removingTabs.indexOf(tab) == -1;
|
||||
return !tab.closing;
|
||||
}, this);
|
||||
}
|
||||
|
||||
|
@ -1933,7 +1938,7 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
if (!aTab.hidden && !aTab.pinned && !aTab.selected &&
|
||||
this._removingTabs.indexOf(aTab) == -1) {
|
||||
!aTab.closing) {
|
||||
aTab.setAttribute("hidden", "true");
|
||||
this.tabContainer.adjustTabstrip();
|
||||
let event = document.createEvent("Events");
|
||||
|
@ -2902,7 +2907,7 @@
|
|||
tabWidth += "px";
|
||||
for (let i = numPinned; i < tabs.length; i++) {
|
||||
let tab = tabs[i];
|
||||
tab.style.maxWidth = tabWidth;
|
||||
tab.style.setProperty("max-width", tabWidth, "important");
|
||||
if (!isEndTab) { // keep tabs the same width
|
||||
tab.style.MozTransition = "none";
|
||||
tab.clientTop; // flush styles to skip animation; see bug 649247
|
||||
|
@ -2948,8 +2953,7 @@
|
|||
<body><![CDATA[
|
||||
var numPinned = this.tabbrowser._numPinnedTabs;
|
||||
var doPosition = this.getAttribute("overflow") == "true" &&
|
||||
numPinned > 0 &&
|
||||
numPinned < this.tabbrowser.visibleTabs.length;
|
||||
numPinned > 0;
|
||||
|
||||
if (doPosition) {
|
||||
this.setAttribute("positionpinnedtabs", "true");
|
||||
|
@ -3077,7 +3081,7 @@
|
|||
var tab = this._getDragTargetTab(event);
|
||||
if (window.getComputedStyle(this, null).direction == "ltr") {
|
||||
for (let i = tab ? tab._tPos : 0; i < tabs.length; i++)
|
||||
if (event.screenX < tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2)
|
||||
if (event.screenX < tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2)
|
||||
return i;
|
||||
} else {
|
||||
for (let i = tab ? tab._tPos : 0; i < tabs.length; i++)
|
||||
|
@ -3171,7 +3175,7 @@
|
|||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return this.tabbrowser._removingTabs.indexOf(aTab) == -1;
|
||||
return !aTab.closing;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -3194,7 +3198,7 @@
|
|||
|
||||
if (tab.getAttribute("fadein") == "true")
|
||||
this._handleNewTab(tab);
|
||||
else if (this.tabbrowser._removingTabs.indexOf(tab) > -1)
|
||||
else if (tab.closing)
|
||||
this.tabbrowser._endRemoveTab(tab);
|
||||
]]></handler>
|
||||
|
||||
|
@ -3337,7 +3341,7 @@
|
|||
var scrollRect = tabStrip.scrollClientRect;
|
||||
var rect = this.getBoundingClientRect();
|
||||
var minMargin = scrollRect.left - rect.left;
|
||||
var maxMargin = Math.min(minMargin + scrollRect.width,
|
||||
var maxMargin = Math.min(minMargin + scrollRect.width,
|
||||
scrollRect.right);
|
||||
if (!ltr)
|
||||
[minMargin, maxMargin] = [this.clientWidth - maxMargin,
|
||||
|
@ -3635,6 +3639,7 @@
|
|||
<field name="mOverCloseButton">false</field>
|
||||
<field name="mCorrespondingMenuitem">null</field>
|
||||
<field name="_fullyOpen">false</field>
|
||||
<field name="closing">false</field>
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
|
@ -3738,10 +3743,15 @@
|
|||
|
||||
var tabstripBO = tabContainer.mTabstrip.scrollBoxObject;
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
var curTabBO = this.childNodes[i].tab.boxObject;
|
||||
let curTab = this.childNodes[i].tab;
|
||||
if (!curTab) // "Tab Groups" menuitem and its menuseparator
|
||||
continue;
|
||||
let curTabBO = curTab.boxObject;
|
||||
if (!curTabBO) // "Tabs From Other Computers" menuitem
|
||||
continue;
|
||||
if (curTabBO.screenX >= tabstripBO.screenX &&
|
||||
curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width)
|
||||
this.childNodes[i].setAttribute("tabIsVisible", "true");
|
||||
this.childNodes[i].setAttribute("tabIsVisible", "true");
|
||||
else
|
||||
this.childNodes[i].removeAttribute("tabIsVisible");
|
||||
}
|
||||
|
@ -3752,7 +3762,7 @@
|
|||
<parameter name="aTab"/>
|
||||
<body><![CDATA[
|
||||
var menuItem = document.createElementNS(
|
||||
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
"menuitem");
|
||||
|
||||
menuItem.setAttribute("class", "menuitem-iconic alltabs-item menuitem-with-favicon");
|
||||
|
@ -3815,7 +3825,7 @@
|
|||
// clear out the menu popup and remove the listeners
|
||||
for (let i = this.childNodes.length - 1; i > 0; i--) {
|
||||
let menuItem = this.childNodes[i];
|
||||
if (!menuItem.hasAttribute("keepme")) {
|
||||
if (menuItem.tab) {
|
||||
menuItem.removeEventListener("command", this, false);
|
||||
menuItem.tab.mCorrespondingMenuitem = null;
|
||||
this.removeChild(menuItem);
|
||||
|
|
|
@ -1913,7 +1913,7 @@ let GroupItems = {
|
|||
|
||||
// ----------
|
||||
// Function: uninit
|
||||
uninit : function GroupItems_uninit () {
|
||||
uninit: function GroupItems_uninit() {
|
||||
// call our cleanup functions
|
||||
this._cleanupFunctions.forEach(function(func) {
|
||||
func();
|
||||
|
@ -1928,7 +1928,7 @@ let GroupItems = {
|
|||
// ----------
|
||||
// Function: newGroup
|
||||
// Creates a new empty group.
|
||||
newGroup: function () {
|
||||
newGroup: function GroupItems_newGroup() {
|
||||
let bounds = new Rect(20, 20, 250, 200);
|
||||
return new GroupItem([], {bounds: bounds, immediately: true});
|
||||
},
|
||||
|
@ -2107,7 +2107,9 @@ let GroupItems = {
|
|||
|
||||
let activeGroupId = this._activeGroupItem ? this._activeGroupItem.id : null;
|
||||
Storage.saveGroupItemsData(
|
||||
gWindow, { nextID: this.nextID, activeGroupId: activeGroupId });
|
||||
gWindow,
|
||||
{ nextID: this.nextID, activeGroupId: activeGroupId,
|
||||
totalNumber: this.groupItems.length });
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -2163,7 +2165,16 @@ let GroupItems = {
|
|||
}
|
||||
|
||||
toClose.forEach(function(groupItem) {
|
||||
groupItem.destroy({immediately: true});
|
||||
// All remaining children in to-be-closed groups are re-used by
|
||||
// session restore. Reconnect them so that they're put into their
|
||||
// right groups.
|
||||
groupItem.getChildren().forEach(function (tabItem) {
|
||||
if (tabItem.parent && tabItem.parent.hidden)
|
||||
iQ(tabItem.container).show();
|
||||
tabItem._reconnected = false;
|
||||
tabItem._reconnect();
|
||||
});
|
||||
groupItem.close({immediately: true});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,10 @@ let AllTabs = {
|
|||
get tabs() {
|
||||
// Get tabs from each browser window and flatten them into one array
|
||||
return Array.concat.apply(null, browserWindows.map(function(browserWindow) {
|
||||
return Array.slice(browserWindow.gBrowser.tabs);
|
||||
let removingTabs = browserWindow.gBrowser._removingTabs;
|
||||
return Array.filter(browserWindow.gBrowser.tabs, function (tab) {
|
||||
return removingTabs.indexOf(tab) == -1;
|
||||
});
|
||||
}));
|
||||
},
|
||||
|
||||
|
|
|
@ -1558,6 +1558,6 @@ TabCanvas.prototype = {
|
|||
// ----------
|
||||
// Function: toImageData
|
||||
toImageData: function TabCanvas_toImageData() {
|
||||
return this.canvas.toDataURL("image/png", "");
|
||||
return this.canvas.toDataURL("image/png");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -552,6 +552,9 @@ let UI = {
|
|||
|
||||
TabItems.resumePainting();
|
||||
}
|
||||
|
||||
if (gTabView.firstUseExperienced)
|
||||
gTabView.enableSessionRestore();
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -739,9 +742,9 @@ let UI = {
|
|||
} else {
|
||||
// If we're currently in the process of entering private browsing,
|
||||
// we don't want to go to the Tab View UI.
|
||||
if (self._privateBrowsing.transitionMode)
|
||||
return;
|
||||
|
||||
if (self._storageBusyCount)
|
||||
return;
|
||||
|
||||
// if not closing the last tab
|
||||
if (gBrowser.tabs.length > 1) {
|
||||
// Don't return to TabView if there are any app tabs
|
||||
|
@ -953,12 +956,11 @@ let UI = {
|
|||
|
||||
// ----------
|
||||
updateTabButton: function UI__updateTabButton() {
|
||||
let groupsNumber = gWindow.document.getElementById("tabviewGroupsNumber");
|
||||
let exitButton = document.getElementById("exit-button");
|
||||
let numberOfGroups = GroupItems.groupItems.length;
|
||||
|
||||
groupsNumber.setAttribute("groups", numberOfGroups);
|
||||
exitButton.setAttribute("groups", numberOfGroups);
|
||||
gTabView.updateGroupNumberBroadcaster(numberOfGroups);
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -992,7 +994,8 @@ let UI = {
|
|||
#ifdef XP_MACOSX
|
||||
"preferencesCmdMac", "minimizeWindow",
|
||||
#endif
|
||||
"newNavigator", "newNavigatorTab", "find"
|
||||
"newNavigator", "newNavigatorTab", "undo", "cut", "copy", "paste",
|
||||
"selectAll", "find"
|
||||
].forEach(function(key) {
|
||||
let element = gWindow.document.getElementById("key_" + key);
|
||||
keys[key] = element.getAttribute("key").toLocaleLowerCase().charCodeAt(0);
|
||||
|
@ -1001,7 +1004,7 @@ let UI = {
|
|||
// for key combinations with shift key, the charCode of upper case letters
|
||||
// are different to the lower case ones so need to handle them differently.
|
||||
["closeWindow", "tabview", "undoCloseTab", "undoCloseWindow",
|
||||
"privatebrowsing"].forEach(function(key) {
|
||||
"privatebrowsing", "redo"].forEach(function(key) {
|
||||
let element = gWindow.document.getElementById("key_" + key);
|
||||
keys[key] = element.getAttribute("key").toLocaleUpperCase().charCodeAt(0);
|
||||
});
|
||||
|
@ -1040,6 +1043,7 @@ let UI = {
|
|||
case self._browserKeys.undoCloseTab:
|
||||
case self._browserKeys.undoCloseWindow:
|
||||
case self._browserKeys.closeWindow:
|
||||
case self._browserKeys.redo:
|
||||
preventDefault = false;
|
||||
break;
|
||||
case self._browserKeys.tabview:
|
||||
|
@ -1053,6 +1057,11 @@ let UI = {
|
|||
break;
|
||||
case self._browserKeys.newNavigator:
|
||||
case self._browserKeys.newNavigatorTab:
|
||||
case self._browserKeys.undo:
|
||||
case self._browserKeys.cut:
|
||||
case self._browserKeys.copy:
|
||||
case self._browserKeys.paste:
|
||||
case self._browserKeys.selectAll:
|
||||
preventDefault = false;
|
||||
break;
|
||||
#ifdef XP_UNIX
|
||||
|
|
|
@ -112,7 +112,7 @@ _BROWSER_FILES = \
|
|||
browser_bug416661.js \
|
||||
browser_bug417483.js \
|
||||
browser_bug419612.js \
|
||||
browser_bug420160.js \
|
||||
browser_identity_UI.js \
|
||||
browser_bug422590.js \
|
||||
browser_bug424101.js \
|
||||
browser_bug427559.js \
|
||||
|
@ -170,6 +170,8 @@ _BROWSER_FILES = \
|
|||
browser_bug616836.js \
|
||||
browser_bug623893.js \
|
||||
browser_bug624734.js \
|
||||
browser_bug647886.js \
|
||||
browser_bug655584.js \
|
||||
browser_findbarClose.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
|
@ -194,12 +196,14 @@ _BROWSER_FILES = \
|
|||
browser_inspector_treePanel_result.html \
|
||||
browser_scratchpad_initialization.js \
|
||||
browser_scratchpad_contexts.js \
|
||||
browser_scratchpad_tab_switch.js \
|
||||
browser_scratchpad_execute_print.js \
|
||||
browser_scratchpad_inspect.js \
|
||||
browser_scratchpad_files.js \
|
||||
browser_scratchpad_ui.js \
|
||||
browser_scratchpad_bug_646070_chrome_context_pref.js \
|
||||
browser_overflowScroll.js \
|
||||
browser_locationBarExternalLoad.js \
|
||||
browser_pageInfo.js \
|
||||
browser_page_style_menu.js \
|
||||
browser_pinnedTabs.js \
|
||||
|
@ -229,7 +233,6 @@ _BROWSER_FILES = \
|
|||
browser_visibleTabs_bookmarkAllPages.js \
|
||||
browser_visibleTabs_bookmarkAllTabs.js \
|
||||
browser_visibleTabs_tabPreview.js \
|
||||
browser_webdev_menu.js \
|
||||
bug592338.html \
|
||||
disablechrome.html \
|
||||
discovery.html \
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
var listener = {
|
||||
testFunction: null,
|
||||
|
||||
handleEvent: function (e) {
|
||||
this.testFunction();
|
||||
}
|
||||
}
|
||||
|
||||
/* Tests for correct behaviour of getEffectiveHost on identity handler */
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
ok(gIdentityHandler, "gIdentityHandler should exist");
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", listener, true);
|
||||
listener.testFunction = testNormalDomain;
|
||||
content.location = "http://test1.example.org/";
|
||||
}
|
||||
|
||||
// Greek IDN for 'example.test'.
|
||||
var idnDomain = "\u03C0\u03B1\u03C1\u03AC\u03B4\u03B5\u03B9\u03B3\u03BC\u03B1.\u03B4\u03BF\u03BA\u03B9\u03BC\u03AE";
|
||||
|
||||
function testNormalDomain() {
|
||||
is(gIdentityHandler._lastLocation.host, 'test1.example.org', "Identity handler is getting the full location");
|
||||
is(gIdentityHandler.getEffectiveHost(), 'example.org', "getEffectiveHost should return example.org for test1.example.org");
|
||||
|
||||
listener.testFunction = testIDNDomain;
|
||||
content.location = "http://sub1." + idnDomain + "/";
|
||||
}
|
||||
|
||||
function testIDNDomain() {
|
||||
is(gIdentityHandler._lastLocation.host, "sub1." + idnDomain, "Identity handler is getting the full location");
|
||||
is(gIdentityHandler.getEffectiveHost(), idnDomain, "getEffectiveHost should return the IDN base domain in UTF-8");
|
||||
|
||||
listener.testFunction = testNormalDomainWithPort;
|
||||
content.location = "http://sub1.test1.example.org:8000/";
|
||||
}
|
||||
|
||||
function testNormalDomainWithPort() {
|
||||
is(gIdentityHandler._lastLocation.host, 'sub1.test1.example.org:8000', "Identity handler is getting port information");
|
||||
is(gIdentityHandler.getEffectiveHost(), 'example.org', "getEffectiveHost should return example.org for sub1.test1.example.org:8000");
|
||||
|
||||
listener.testFunction = testIPWithPort;
|
||||
content.location = "http://127.0.0.1:8888/";
|
||||
}
|
||||
|
||||
function testIPWithPort() {
|
||||
is(gIdentityHandler.getEffectiveHost(), '127.0.0.1', "getEffectiveHost should return 127.0.0.1 for 127.0.0.1:8888");
|
||||
gBrowser.selectedBrowser.removeEventListener("load", listener, true);
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
|
@ -31,7 +31,7 @@ function test() {
|
|||
|
||||
content.location =
|
||||
"data:text/html," +
|
||||
"<style type='text/css'>#test-image,#not-test-image {background-image: url('about:logo?c');}</style>" +
|
||||
"<style type='text/css'>%23test-image,%23not-test-image {background-image: url('about:logo?c');}</style>" +
|
||||
"<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" +
|
||||
"<img src='about:logo?b' height=300 width=350 alt=2>" +
|
||||
"<img src='about:logo?a' height=200 width=250>" +
|
||||
|
|
|
@ -96,11 +96,10 @@ function test_disabled_install() {
|
|||
|
||||
wait_for_notification_close(function() {
|
||||
try {
|
||||
Services.prefs.getBoolPref("xpinstall.disabled");
|
||||
ok(false, "xpinstall.disabled should not be set");
|
||||
ok(Services.prefs.getBoolPref("xpinstall.enabled"), "Installation should be enabled");
|
||||
}
|
||||
catch (e) {
|
||||
ok(true, "xpinstall.disabled should not be set");
|
||||
ok(false, "xpinstall.enabled should be set");
|
||||
}
|
||||
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
content.history.pushState({}, "2", "2.html");
|
||||
|
||||
testBackButton();
|
||||
}, true);
|
||||
|
||||
loadURI("http://example.com");
|
||||
}
|
||||
|
||||
function testBackButton() {
|
||||
var backButton = document.getElementById("back-button");
|
||||
var rect = backButton.getBoundingClientRect();
|
||||
|
||||
info("waiting for the history menu to open");
|
||||
|
||||
backButton.addEventListener("popupshown", function (event) {
|
||||
backButton.removeEventListener("popupshown", arguments.callee, false);
|
||||
|
||||
ok(true, "history menu opened");
|
||||
event.target.hidePopup();
|
||||
finish();
|
||||
}, false);
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(backButton, {type: "mousedown"});
|
||||
EventUtils.synthesizeMouse(backButton, rect.width / 2, rect.height, {type: "mouseup"});
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
// Bug 655584 - awesomebar suggestions don't update after tab is closed
|
||||
|
||||
function test() {
|
||||
var tab1 = gBrowser.addTab();
|
||||
var tab2 = gBrowser.addTab();
|
||||
|
||||
// When urlbar in a new tab is focused, and a tab switch occurs,
|
||||
// the urlbar popup should be closed
|
||||
gBrowser.selectedTab = tab2;
|
||||
gURLBar.focus(); // focus the urlbar in the tab we will switch to
|
||||
gBrowser.selectedTab = tab1;
|
||||
gURLBar.openPopup();
|
||||
gBrowser.selectedTab = tab2;
|
||||
ok(!gURLBar.popupOpen, "urlbar focused in tab to switch to, close popup");
|
||||
|
||||
// cleanup
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
/* Tests for correct behaviour of getEffectiveHost on identity handler */
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
ok(gIdentityHandler, "gIdentityHandler should exist");
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", checkResult, true);
|
||||
|
||||
nextTest();
|
||||
}
|
||||
|
||||
// Greek IDN for 'example.test'.
|
||||
var idnDomain = "\u03C0\u03B1\u03C1\u03AC\u03B4\u03B5\u03B9\u03B3\u03BC\u03B1.\u03B4\u03BF\u03BA\u03B9\u03BC\u03AE";
|
||||
var tests = [
|
||||
{
|
||||
name: "normal domain",
|
||||
location: "http://test1.example.org/",
|
||||
host: "test1.example.org",
|
||||
effectiveHost: "example.org"
|
||||
},
|
||||
{
|
||||
name: "view-source",
|
||||
location: "view-source:http://example.com/",
|
||||
// TODO: these should not be blank, bug 646690
|
||||
host: "",
|
||||
effectiveHost: ""
|
||||
},
|
||||
{
|
||||
name: "normal HTTPS",
|
||||
location: "https://example.com/",
|
||||
host: "example.com",
|
||||
effectiveHost: "example.com",
|
||||
isHTTPS: true
|
||||
},
|
||||
{
|
||||
name: "IDN subdomain",
|
||||
location: "http://sub1." + idnDomain + "/",
|
||||
host: "sub1." + idnDomain,
|
||||
effectiveHost: idnDomain
|
||||
},
|
||||
{
|
||||
name: "subdomain with port",
|
||||
location: "http://sub1.test1.example.org:8000/",
|
||||
host: "sub1.test1.example.org:8000",
|
||||
effectiveHost: "example.org"
|
||||
},
|
||||
{
|
||||
name: "subdomain HTTPS",
|
||||
location: "https://test1.example.com",
|
||||
host: "test1.example.com",
|
||||
effectiveHost: "example.com",
|
||||
isHTTPS: true
|
||||
},
|
||||
{
|
||||
name: "view-source HTTPS",
|
||||
location: "view-source:https://example.com/",
|
||||
// TODO: these should not be blank, bug 646690
|
||||
host: "",
|
||||
effectiveHost: "",
|
||||
isHTTPS: true
|
||||
},
|
||||
{
|
||||
name: "IP address",
|
||||
location: "http://127.0.0.1:8888/",
|
||||
host: "127.0.0.1:8888",
|
||||
effectiveHost: "127.0.0.1"
|
||||
},
|
||||
]
|
||||
|
||||
let gCurrentTest, gCurrentTestIndex = -1;
|
||||
// Go through the tests in both directions, to add additional coverage for
|
||||
// transitions between different states.
|
||||
let gForward = true;
|
||||
function nextTest() {
|
||||
if (gForward)
|
||||
gCurrentTestIndex++;
|
||||
else
|
||||
gCurrentTestIndex--;
|
||||
|
||||
if (gCurrentTestIndex == tests.length) {
|
||||
// Went too far, reverse
|
||||
gCurrentTestIndex--;
|
||||
gForward = false;
|
||||
}
|
||||
|
||||
if (gCurrentTestIndex == -1) {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", checkResult, true);
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
gCurrentTest = tests[gCurrentTestIndex];
|
||||
gTestDesc = "#" + gCurrentTestIndex + " (" + gCurrentTest.name + ")";
|
||||
if (!gForward)
|
||||
gTestDesc += " (second time)";
|
||||
content.location = gCurrentTest.location;
|
||||
}
|
||||
|
||||
function checkResult() {
|
||||
if (gCurrentTest.isHTTPS) {
|
||||
// Check that the effective host is displayed in the UI
|
||||
let label = document.getElementById("identity-icon-label");
|
||||
is(label.value, gCurrentTest.effectiveHost, "effective host is displayed in identity icon label for test " + gTestDesc);
|
||||
}
|
||||
|
||||
// Sanity check other values, and the value of gIdentityHandler.getEffectiveHost()
|
||||
is(gIdentityHandler._lastLocation.host, gCurrentTest.host, "host matches for test " + gTestDesc);
|
||||
is(gIdentityHandler.getEffectiveHost(), gCurrentTest.effectiveHost, "effectiveHost matches for test " + gTestDesc);
|
||||
|
||||
executeSoon(nextTest);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
nextTest();
|
||||
}
|
||||
|
||||
let urls = [
|
||||
"javascript:'foopy';",
|
||||
"data:text/html,<body>hi"
|
||||
];
|
||||
|
||||
function urlEnter(url) {
|
||||
gURLBar.value = url;
|
||||
gURLBar.focus();
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
}
|
||||
|
||||
function urlClick(url) {
|
||||
gURLBar.value = url;
|
||||
gURLBar.focus();
|
||||
let goButton = document.getElementById("urlbar-go-button");
|
||||
EventUtils.synthesizeMouseAtCenter(goButton, {});
|
||||
}
|
||||
|
||||
function nextTest() {
|
||||
let url = urls.shift();
|
||||
if (url) {
|
||||
testURL(url, urlEnter, function () {
|
||||
testURL(url, urlClick, nextTest);
|
||||
});
|
||||
}
|
||||
else
|
||||
finish();
|
||||
}
|
||||
|
||||
function testURL(url, loadFunc, endFunc) {
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
registerCleanupFunction(function () {
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
addPageShowListener(function () {
|
||||
let pagePrincipal = gBrowser.contentPrincipal;
|
||||
loadFunc(url);
|
||||
|
||||
addPageShowListener(function () {
|
||||
ok(!gBrowser.contentPrincipal.equals(pagePrincipal),
|
||||
"load of " + url + " by " + loadFunc.name + " should produce a page with a different principal");
|
||||
endFunc();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addPageShowListener(func) {
|
||||
gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() {
|
||||
gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false);
|
||||
func();
|
||||
});
|
||||
}
|
|
@ -127,7 +127,12 @@ function test3() {
|
|||
|
||||
new TabOpenListener("about:addons", test4, prepareTest5);
|
||||
|
||||
EventUtils.synthesizeMouse(gTestBrowser.contentDocument.getElementById("test"),
|
||||
var pluginNode = gTestBrowser.contentDocument.getElementById("test");
|
||||
ok(pluginNode, "Test 3, Found plugin in page");
|
||||
var manageLink = gTestBrowser.contentDocument.getAnonymousElementByAttribute(pluginNode, "class", "managePluginsLink");
|
||||
ok(manageLink, "Test 3, found 'manage' link in plugin-problem binding");
|
||||
|
||||
EventUtils.synthesizeMouse(manageLink,
|
||||
5, 5, {}, gTestBrowser.contentWindow);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ function runTests()
|
|||
ok(sp, "Scratchpad object exists in new window");
|
||||
|
||||
let chromeContextMenu = gScratchpadWindow.document.
|
||||
getElementById("sp-menu-chrome");
|
||||
getElementById("sp-menu-browser");
|
||||
ok(chromeContextMenu, "Chrome context menuitem element exists");
|
||||
ok(!chromeContextMenu.hasAttribute("hidden"),
|
||||
"Chrome context menuitem is visible");
|
||||
|
@ -54,7 +54,7 @@ function runTests()
|
|||
"Error console menuitem is visible");
|
||||
|
||||
let chromeContextCommand = gScratchpadWindow.document.
|
||||
getElementById("sp-cmd-chromeContext");
|
||||
getElementById("sp-cmd-browserContext");
|
||||
ok(chromeContextCommand, "Chrome context command element exists");
|
||||
ok(!chromeContextCommand.hasAttribute("disabled"),
|
||||
"Chrome context command is disabled");
|
||||
|
|
|
@ -27,11 +27,11 @@ function runTests()
|
|||
let sp = gScratchpadWindow.Scratchpad;
|
||||
|
||||
let contentMenu = gScratchpadWindow.document.getElementById("sp-menu-content");
|
||||
let chromeMenu = gScratchpadWindow.document.getElementById("sp-menu-chrome");
|
||||
let chromeMenu = gScratchpadWindow.document.getElementById("sp-menu-browser");
|
||||
let statusbar = sp.statusbarStatus;
|
||||
|
||||
ok(contentMenu, "found #sp-menu-content");
|
||||
ok(chromeMenu, "found #sp-menu-chrome");
|
||||
ok(chromeMenu, "found #sp-menu-browser");
|
||||
ok(statusbar, "found Scratchpad.statusbarStatus");
|
||||
|
||||
sp.setContentContext();
|
||||
|
@ -54,14 +54,14 @@ function runTests()
|
|||
ok(!content.wrappedJSObject.foobarBug636725,
|
||||
"no content.foobarBug636725");
|
||||
|
||||
sp.execute();
|
||||
sp.run();
|
||||
|
||||
is(content.wrappedJSObject.foobarBug636725, "aloha",
|
||||
"content.foobarBug636725 has been set");
|
||||
|
||||
sp.setChromeContext();
|
||||
sp.setBrowserContext();
|
||||
|
||||
is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_CHROME,
|
||||
is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_BROWSER,
|
||||
"executionContext is chrome");
|
||||
|
||||
is(chromeMenu.getAttribute("checked"), "true",
|
||||
|
@ -77,37 +77,37 @@ function runTests()
|
|||
|
||||
ok(!window.foobarBug636725, "no window.foobarBug636725");
|
||||
|
||||
sp.execute();
|
||||
sp.run();
|
||||
|
||||
is(window.foobarBug636725, "aloha2", "window.foobarBug636725 has been set");
|
||||
|
||||
sp.textbox.value = "window.gBrowser";
|
||||
|
||||
is(typeof sp.execute()[1].addTab, "function",
|
||||
is(typeof sp.run()[1].addTab, "function",
|
||||
"chrome context has access to chrome objects");
|
||||
|
||||
// Check that the sandbox is cached.
|
||||
|
||||
sp.textbox.value = "typeof foobarBug636725cache;";
|
||||
is(sp.execute()[1], "undefined", "global variable does not exist");
|
||||
is(sp.run()[1], "undefined", "global variable does not exist");
|
||||
|
||||
sp.textbox.value = "var foobarBug636725cache = 'foo';";
|
||||
sp.execute();
|
||||
sp.run();
|
||||
|
||||
sp.textbox.value = "typeof foobarBug636725cache;";
|
||||
is(sp.execute()[1], "string",
|
||||
is(sp.run()[1], "string",
|
||||
"global variable exists across two different executions");
|
||||
|
||||
sp.resetContext();
|
||||
|
||||
is(sp.execute()[1], "undefined",
|
||||
is(sp.run()[1], "undefined",
|
||||
"global variable no longer exists after calling resetContext()");
|
||||
|
||||
sp.textbox.value = "var foobarBug636725cache2 = 'foo';";
|
||||
sp.execute();
|
||||
sp.run();
|
||||
|
||||
sp.textbox.value = "typeof foobarBug636725cache2;";
|
||||
is(sp.execute()[1], "string",
|
||||
is(sp.run()[1], "string",
|
||||
"global variable exists across two different executions");
|
||||
|
||||
sp.setContentContext();
|
||||
|
@ -115,7 +115,7 @@ function runTests()
|
|||
is(sp.executionContext, gScratchpadWindow.SCRATCHPAD_CONTEXT_CONTENT,
|
||||
"executionContext is content");
|
||||
|
||||
is(sp.execute()[1], "undefined",
|
||||
is(sp.run()[1], "undefined",
|
||||
"global variable no longer exists after changing the context");
|
||||
|
||||
gScratchpadWindow.close();
|
||||
|
|
|
@ -17,7 +17,7 @@ function test()
|
|||
gScratchpadWindow.addEventListener("load", runTests, false);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html,<p>test execute() and print() in Scratchpad";
|
||||
content.location = "data:text/html,<p>test run() and display() in Scratchpad";
|
||||
}
|
||||
|
||||
function runTests()
|
||||
|
@ -31,7 +31,7 @@ function runTests()
|
|||
ok(sp.textbox, "textbox exists");
|
||||
sp.textbox.value = "++window.foobarBug636725";
|
||||
|
||||
let exec = sp.execute();
|
||||
let exec = sp.run();
|
||||
is(exec[0], sp.textbox.value, "execute()[0] is correct");
|
||||
is(exec[1], content.wrappedJSObject.foobarBug636725,
|
||||
"execute()[1] is correct");
|
||||
|
@ -42,7 +42,7 @@ function runTests()
|
|||
is(content.wrappedJSObject.foobarBug636725, 2,
|
||||
"execute() updated window.foobarBug636725");
|
||||
|
||||
sp.print();
|
||||
sp.display();
|
||||
|
||||
is(content.wrappedJSObject.foobarBug636725, 3,
|
||||
"print() updated window.foobarBug636725");
|
||||
|
@ -69,7 +69,7 @@ function runTests()
|
|||
is(sp.textbox.selectionStart, 0, "selectionStart is 0");
|
||||
is(sp.textbox.selectionEnd, 29, "selectionEnd is 29");
|
||||
|
||||
exec = sp.execute();
|
||||
exec = sp.run();
|
||||
|
||||
is(exec[0], "window.foobarBug636725 = 'a';",
|
||||
"execute()[0] is correct");
|
||||
|
@ -88,7 +88,7 @@ function runTests()
|
|||
|
||||
sp.selectRange(0, 22);
|
||||
|
||||
sp.print();
|
||||
sp.display();
|
||||
|
||||
is(content.wrappedJSObject.foobarBug636725, "a",
|
||||
"print() worked for the selected range");
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче