зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to s-c.
This commit is contained in:
Коммит
609bbb69f1
|
@ -45,9 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
MODULE = accessibility
|
||||
DIRS = public src build
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
endif
|
||||
TEST_DIRS += tests
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ XPIDLSRCS = \
|
|||
nsIAccessibleDocument.idl \
|
||||
nsIAccessibleProvider.idl \
|
||||
nsIAccessibleSelectable.idl \
|
||||
nsIAccessNode.idl \
|
||||
nsIAccessibleCursorable.idl \
|
||||
nsIAccessibleEvent.idl \
|
||||
nsIAccessibleEditableText.idl \
|
||||
|
|
|
@ -117,7 +117,7 @@ cpp_quote("//")
|
|||
cpp_quote("//")
|
||||
cpp_quote("// get_localInterface(/* [out] */ void **localInterface);")
|
||||
cpp_quote("// ---------------------------------------------------------------------------------------------------=")
|
||||
cpp_quote("// Only available in Gecko's process - casts to an XPCOM nsIAccessNode interface pointer")
|
||||
cpp_quote("// Only available in Gecko's process - casts to an XPCOM nsAccessNode object pointer")
|
||||
cpp_quote("//")
|
||||
cpp_quote("//")
|
||||
cpp_quote("// get_language(/* [out] */ BSTR *htmlText);")
|
||||
|
|
|
@ -1,126 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Original Author: Aaron Leventhal (aaronl@netscape.com)
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMNode;
|
||||
interface nsIAccessibleDocument;
|
||||
interface nsIDOMCSSPrimitiveValue;
|
||||
|
||||
/**
|
||||
* An interface used by in-process accessibility clients
|
||||
* to get style, window, markup and other information about
|
||||
* a DOM node. When accessibility is active in Gecko,
|
||||
* every DOM node can have one nsIAccessNode for each
|
||||
* pres shell the DOM node is rendered in.
|
||||
* The nsIAccessNode implementations are instantiated lazily.
|
||||
* The nsIAccessNode tree for a given dom window
|
||||
* has a one to one relationship to the DOM tree.
|
||||
* If the DOM node for this access node is "accessible",
|
||||
* then a QueryInterface to nsIAccessible will succeed.
|
||||
*/
|
||||
[scriptable, uuid(08bb2c50-1b30-11e1-bddb-0800200c9a66)]
|
||||
interface nsIAccessNode : nsISupports
|
||||
{
|
||||
/**
|
||||
* The DOM node this nsIAccessNode is associated with.
|
||||
*/
|
||||
readonly attribute nsIDOMNode DOMNode;
|
||||
|
||||
/**
|
||||
* The document accessible that this access node resides in.
|
||||
*/
|
||||
readonly attribute nsIAccessibleDocument document;
|
||||
|
||||
/**
|
||||
* The root document accessible that this access node resides in.
|
||||
*/
|
||||
readonly attribute nsIAccessibleDocument rootDocument;
|
||||
|
||||
/**
|
||||
* The innerHTML for the DOM node
|
||||
* This is a text string of all the markup inside the DOM
|
||||
* node, not including the start and end tag for the node.
|
||||
*/
|
||||
readonly attribute DOMString innerHTML;
|
||||
|
||||
/**
|
||||
* Makes an object visible on screen.
|
||||
*
|
||||
* @param scrollType - defines where the object should be placed on
|
||||
* the screen (see nsIAccessibleScrollType for
|
||||
* available constants).
|
||||
*/
|
||||
void scrollTo(in unsigned long aScrollType);
|
||||
|
||||
/**
|
||||
* Moves the top left of an object to a specified location.
|
||||
*
|
||||
* @param coordinateType - specifies whether the coordinates are relative to
|
||||
* the screen or the parent object (for available
|
||||
* constants refer to nsIAccessibleCoordinateType)
|
||||
* @param aX - defines the x coordinate
|
||||
* @param aY - defines the y coordinate
|
||||
*/
|
||||
void scrollToPoint(in unsigned long aCoordinateType, in long aX, in long aY);
|
||||
|
||||
/**
|
||||
* Retrieve the computed style value for this DOM node, if it is a DOM element.
|
||||
* Note: the meanings of width, height and other size measurements depend
|
||||
* on the version of CSS being used. Therefore, for bounds information,
|
||||
* it is better to use nsIAccessible::accGetBounds.
|
||||
* @param pseudoElt The pseudo element to retrieve style for, or NULL
|
||||
* for general computed style information for this node.
|
||||
* @param propertyName Retrieve the computed style value for this property name,
|
||||
* for example "border-bottom".
|
||||
*/
|
||||
DOMString getComputedStyleValue(in DOMString pseudoElt, in DOMString propertyName);
|
||||
|
||||
/**
|
||||
* The method is similar to getComputedStyleValue() excepting that this one
|
||||
* returns nsIDOMCSSPrimitiveValue.
|
||||
*/
|
||||
nsIDOMCSSPrimitiveValue getComputedStyleCSSValue(in DOMString pseudoElt,
|
||||
in DOMString propertyName);
|
||||
|
||||
/**
|
||||
* The language for the current DOM node, e.g. en, de, etc.
|
||||
*/
|
||||
readonly attribute DOMString language;
|
||||
};
|
||||
|
|
@ -43,7 +43,10 @@
|
|||
#include "nsIArray.idl"
|
||||
|
||||
interface nsIPersistentProperties;
|
||||
interface nsIDOMCSSPrimitiveValue;
|
||||
interface nsIDOMDOMStringList;
|
||||
interface nsIDOMNode;
|
||||
interface nsIAccessibleDocument;
|
||||
interface nsIAccessibleRelation;
|
||||
|
||||
/**
|
||||
|
@ -100,6 +103,53 @@ interface nsIAccessible : nsISupports
|
|||
*/
|
||||
readonly attribute long indexInParent;
|
||||
|
||||
/**
|
||||
* The innerHTML for the HTML element associated with this accessible if applicable.
|
||||
* This is a text string of all the markup inside the DOM
|
||||
* node, not including the start and end tag for the node.
|
||||
*/
|
||||
readonly attribute DOMString innerHTML;
|
||||
|
||||
/**
|
||||
* Retrieve the computed style value for this DOM node, if it is a DOM element.
|
||||
* Note: the meanings of width, height and other size measurements depend
|
||||
* on the version of CSS being used. Therefore, for bounds information,
|
||||
* it is better to use nsIAccessible::accGetBounds.
|
||||
*
|
||||
* @param pseudoElt [in] The pseudo element to retrieve style for, or NULL
|
||||
* for general computed style information for this node.
|
||||
* @param propertyName [in] Retrieve the computed style value for this property name,
|
||||
* for example "border-bottom".
|
||||
*/
|
||||
DOMString getComputedStyleValue(in DOMString pseudoElt, in DOMString propertyName);
|
||||
|
||||
/**
|
||||
* The method is similar to getComputedStyleValue() excepting that this one
|
||||
* returns nsIDOMCSSPrimitiveValue.
|
||||
*/
|
||||
nsIDOMCSSPrimitiveValue getComputedStyleCSSValue(in DOMString pseudoElt,
|
||||
in DOMString propertyName);
|
||||
|
||||
/**
|
||||
* The DOM node this nsIAccessible is associated with.
|
||||
*/
|
||||
readonly attribute nsIDOMNode DOMNode;
|
||||
|
||||
/**
|
||||
* The document accessible that this access node resides in.
|
||||
*/
|
||||
readonly attribute nsIAccessibleDocument document;
|
||||
|
||||
/**
|
||||
* The root document accessible that this access node resides in.
|
||||
*/
|
||||
readonly attribute nsIAccessibleDocument rootDocument;
|
||||
|
||||
/**
|
||||
* The language for the current DOM node, e.g. en, de, etc.
|
||||
*/
|
||||
readonly attribute DOMString language;
|
||||
|
||||
/**
|
||||
* Accessible name -- the main text equivalent for this node. The name is
|
||||
* specified by ARIA or by native markup. Example of ARIA markup is
|
||||
|
@ -285,6 +335,26 @@ interface nsIAccessible : nsISupports
|
|||
*/
|
||||
void doAction(in PRUint8 index);
|
||||
|
||||
/**
|
||||
* Makes an object visible on screen.
|
||||
*
|
||||
* @param scrollType - defines where the object should be placed on
|
||||
* the screen (see nsIAccessibleScrollType for
|
||||
* available constants).
|
||||
*/
|
||||
void scrollTo(in unsigned long aScrollType);
|
||||
|
||||
/**
|
||||
* Moves the top left of an object to a specified location.
|
||||
*
|
||||
* @param coordinateType [in] - specifies whether the coordinates are relative to
|
||||
* the screen or the parent object (for available
|
||||
* constants refer to nsIAccessibleCoordinateType)
|
||||
* @param x [in] - defines the x coordinate
|
||||
* @param y [in] - defines the y coordinate
|
||||
*/
|
||||
void scrollToPoint(in unsigned long coordinateType, in long x, in long y);
|
||||
|
||||
/**
|
||||
* Get a pointer to accessibility interface for this node, which is specific
|
||||
* to the OS/accessibility toolkit we're running on.
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIAccessible;
|
||||
interface nsIAccessNode;
|
||||
interface nsIDOMDocument;
|
||||
interface nsIDOMNode;
|
||||
interface nsIDOMWindow;
|
||||
|
@ -50,10 +49,9 @@ interface nsIDOMWindow;
|
|||
* When accessibility is turned on in Gecko,
|
||||
* there is an nsIAccessibleDocument for each document
|
||||
* whether it is XUL, HTML or whatever.
|
||||
* You can QueryInterface to nsIAccessibleDocument from
|
||||
* the nsIAccessible or nsIAccessNode for the root node
|
||||
* of a document. You can also get one from
|
||||
* nsIAccessNode::GetAccessibleDocument() or
|
||||
* You can QueryInterface to nsIAccessibleDocument from the nsIAccessible for
|
||||
* the root node of a document. You can also get one from
|
||||
* nsIAccessible::GetAccessibleDocument() or
|
||||
* nsIAccessibleEvent::GetAccessibleDocument()
|
||||
*/
|
||||
[scriptable, uuid(451242bd-8a0c-4198-ae88-c053609a4e5d)]
|
||||
|
|
|
@ -43,15 +43,12 @@ interface nsIAccessible;
|
|||
interface nsIWeakReference;
|
||||
interface nsIPresShell;
|
||||
interface nsIDOMWindow;
|
||||
interface nsIAccessNode;
|
||||
interface nsIDOMDOMStringList;
|
||||
interface nsIAccessiblePivot;
|
||||
|
||||
/**
|
||||
* An interface for in-process accessibility clients
|
||||
* wishing to get an nsIAccessible or nsIAccessNode for
|
||||
* a given DOM node.
|
||||
* More documentation at:
|
||||
* An interface for in-process accessibility clients wishing to get an
|
||||
* nsIAccessible for a given DOM node. More documentation at:
|
||||
* http://www.mozilla.org/projects/ui/accessibility
|
||||
*/
|
||||
[scriptable, uuid(310ce77d-c92b-4761-82e8-77e1a728e8d4)]
|
||||
|
|
|
@ -79,7 +79,7 @@ getDocumentLocaleCB(AtkDocument *aDocument)
|
|||
return nsnull;
|
||||
|
||||
nsAutoString locale;
|
||||
accWrap->GetLanguage(locale);
|
||||
accWrap->Language(locale);
|
||||
return locale.IsEmpty() ? nsnull : nsAccessibleWrap::ReturnString(locale);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Trevor Saunders <trev.saunders@gmail.com> (original author)
|
||||
* Andrzej Skalski <askalski@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -47,7 +48,7 @@ namespace a11y {
|
|||
namespace statistics {
|
||||
|
||||
inline void A11yInitialized()
|
||||
{ Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED, true); }
|
||||
{ Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED, 1); }
|
||||
|
||||
inline void A11yConsumers(PRUint32 aConsumer)
|
||||
{ Telemetry::Accumulate(Telemetry::A11Y_CONSUMERS, aConsumer); }
|
||||
|
@ -56,7 +57,13 @@ namespace statistics {
|
|||
* Report that ISimpleDOM* has been used.
|
||||
*/
|
||||
inline void ISimpleDOMUsed()
|
||||
{ Telemetry::Accumulate(Telemetry::ISIMPLE_DOM_USAGE, 1); }
|
||||
{
|
||||
static bool firstTime = true;
|
||||
if (firstTime) {
|
||||
Telemetry::Accumulate(Telemetry::ISIMPLE_DOM_USAGE, 1);
|
||||
firstTime = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Report that IAccessibleTable has been used.
|
||||
|
@ -64,6 +71,12 @@ namespace statistics {
|
|||
inline void IAccessibleTableUsed()
|
||||
{ Telemetry::Accumulate(Telemetry::IACCESSIBLE_TABLE_USAGE, 1); }
|
||||
|
||||
/**
|
||||
* Report that XForms accessibility has been instantiated.
|
||||
*/
|
||||
inline void XFormsAccessibleUsed()
|
||||
{ Telemetry::Accumulate(Telemetry::XFORMS_ACCESSIBLE_USED, 1); }
|
||||
|
||||
} // namespace statistics
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#define nsAccUtils_h_
|
||||
|
||||
#include "nsIAccessible.h"
|
||||
#include "nsIAccessNode.h"
|
||||
#include "nsIAccessibleRole.h"
|
||||
#include "nsIAccessibleText.h"
|
||||
#include "nsIAccessibleTable.h"
|
||||
|
|
|
@ -36,37 +36,27 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsDocAccessible.h"
|
||||
#include "nsAccessNode.h"
|
||||
|
||||
#include "nsIAccessible.h"
|
||||
|
||||
#include "nsAccCache.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
|
||||
#include "nsHashtable.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsApplicationAccessibleWrap.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsRootAccessible.h"
|
||||
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMCSSPrimitiveValue.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsRootAccessible.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
/* For documentation of the accessibility architecture,
|
||||
|
@ -89,9 +79,7 @@ nsApplicationAccessible *nsAccessNode::gApplicationAccessible = nsnull;
|
|||
NS_IMPL_CYCLE_COLLECTION_1(nsAccessNode, mContent)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsAccessNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIAccessNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsAccessNode)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAccessNode)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsAccessNode)
|
||||
|
@ -287,126 +275,28 @@ nsAccessNode::IsPrimaryForNode() const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIAccessNode
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetDOMNode(nsIDOMNode **aDOMNode)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDOMNode);
|
||||
*aDOMNode = nsnull;
|
||||
|
||||
nsINode *node = GetNode();
|
||||
if (node)
|
||||
CallQueryInterface(node, aDOMNode);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetDocument(nsIAccessibleDocument **aDocument)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocument);
|
||||
|
||||
NS_IF_ADDREF(*aDocument = GetDocAccessible());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetRootDocument(nsIAccessibleDocument **aRootDocument)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRootDocument);
|
||||
|
||||
nsRootAccessible* rootDocument = RootAccessible();
|
||||
NS_IF_ADDREF(*aRootDocument = rootDocument);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetInnerHTML(nsAString& aInnerHTML)
|
||||
{
|
||||
aInnerHTML.Truncate();
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(mContent);
|
||||
NS_ENSURE_TRUE(htmlElement, NS_ERROR_NULL_POINTER);
|
||||
|
||||
return htmlElement->GetInnerHTML(aInnerHTML);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsAccessNode::ScrollTo(PRUint32 aScrollType)
|
||||
{
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
|
||||
if (!shell)
|
||||
return;
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
if (!frame)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIContent> content = frame->GetContent();
|
||||
NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
|
||||
nsIContent* content = frame->GetContent();
|
||||
if (!content)
|
||||
return;
|
||||
|
||||
PRInt16 vPercent, hPercent;
|
||||
nsCoreUtils::ConvertScrollTypeToPercents(aScrollType, &vPercent, &hPercent);
|
||||
return shell->ScrollContentIntoView(content, vPercent, hPercent,
|
||||
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (!frame)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIntPoint coords;
|
||||
nsresult rv = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType,
|
||||
this, &coords);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIFrame *parentFrame = frame;
|
||||
while ((parentFrame = parentFrame->GetParent()))
|
||||
nsCoreUtils::ScrollFrameToPoint(parentFrame, frame, coords);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetComputedStyleValue(const nsAString& aPseudoElt,
|
||||
const nsAString& aPropertyName,
|
||||
nsAString& aValue)
|
||||
{
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> styleDecl =
|
||||
nsCoreUtils::GetComputedStyleDeclaration(aPseudoElt, mContent);
|
||||
NS_ENSURE_TRUE(styleDecl, NS_ERROR_FAILURE);
|
||||
|
||||
return styleDecl->GetPropertyValue(aPropertyName, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetComputedStyleCSSValue(const nsAString& aPseudoElt,
|
||||
const nsAString& aPropertyName,
|
||||
nsIDOMCSSPrimitiveValue **aCSSValue)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCSSValue);
|
||||
*aCSSValue = nsnull;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> styleDecl =
|
||||
nsCoreUtils::GetComputedStyleDeclaration(aPseudoElt, mContent);
|
||||
NS_ENSURE_STATE(styleDecl);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSValue> cssValue;
|
||||
styleDecl->GetPropertyCSSValue(aPropertyName, getter_AddRefs(cssValue));
|
||||
NS_ENSURE_TRUE(cssValue, NS_ERROR_FAILURE);
|
||||
|
||||
return CallQueryInterface(cssValue, aCSSValue);
|
||||
shell->ScrollContentIntoView(content, vPercent, hPercent,
|
||||
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
|
||||
}
|
||||
|
||||
// nsAccessNode public
|
||||
|
@ -443,20 +333,18 @@ nsAccessNode::GetCurrentFocus()
|
|||
return focusedNode;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetLanguage(nsAString& aLanguage)
|
||||
void
|
||||
nsAccessNode::Language(nsAString& aLanguage)
|
||||
{
|
||||
aLanguage.Truncate();
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
return;
|
||||
|
||||
nsCoreUtils::GetLanguageFor(mContent, nsnull, aLanguage);
|
||||
|
||||
if (aLanguage.IsEmpty()) { // Nothing found, so use document's language
|
||||
mContent->OwnerDoc()->GetHeaderData(nsGkAtoms::headerContentLanguage,
|
||||
aLanguage);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#ifndef _nsAccessNode_H_
|
||||
#define _nsAccessNode_H_
|
||||
|
||||
#include "nsIAccessNode.h"
|
||||
#include "nsIAccessibleTypes.h"
|
||||
|
||||
#include "a11yGeneric.h"
|
||||
|
@ -68,15 +67,7 @@ class nsIDocShellTreeItem;
|
|||
#define ACCESSIBLE_BUNDLE_URL "chrome://global-platform/locale/accessible.properties"
|
||||
#define PLATFORM_KEYS_BUNDLE_URL "chrome://global-platform/locale/platformKeys.properties"
|
||||
|
||||
#define NS_ACCESSNODE_IMPL_CID \
|
||||
{ /* 2b07e3d7-00b3-4379-aa0b-ea22e2c8ffda */ \
|
||||
0x2b07e3d7, \
|
||||
0x00b3, \
|
||||
0x4379, \
|
||||
{ 0xaa, 0x0b, 0xea, 0x22, 0xe2, 0xc8, 0xff, 0xda } \
|
||||
}
|
||||
|
||||
class nsAccessNode: public nsIAccessNode
|
||||
class nsAccessNode: public nsISupports
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -84,10 +75,7 @@ public:
|
|||
virtual ~nsAccessNode();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessNode, nsIAccessNode)
|
||||
|
||||
NS_DECL_NSIACCESSNODE
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSNODE_IMPL_CID)
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(nsAccessNode)
|
||||
|
||||
static void InitXPAccessibility();
|
||||
static void ShutdownXPAccessibility();
|
||||
|
@ -134,18 +122,6 @@ public:
|
|||
* Return frame for the given access node object.
|
||||
*/
|
||||
virtual nsIFrame* GetFrame() const;
|
||||
|
||||
/**
|
||||
* Return DOM node associated with this accessible.
|
||||
*/
|
||||
already_AddRefed<nsIDOMNode> GetDOMNode() const
|
||||
{
|
||||
nsIDOMNode *DOMNode = nsnull;
|
||||
if (GetNode())
|
||||
CallQueryInterface(GetNode(), &DOMNode);
|
||||
return DOMNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return DOM node associated with the accessible.
|
||||
*/
|
||||
|
@ -195,6 +171,18 @@ public:
|
|||
*/
|
||||
virtual bool IsPrimaryForNode() const;
|
||||
|
||||
/**
|
||||
* Return the string bundle
|
||||
*/
|
||||
static nsIStringBundle* GetStringBundle()
|
||||
{ return gStringBundle; }
|
||||
|
||||
/**
|
||||
* Interface methods on nsIAccessible shared with ISimpleDOM.
|
||||
*/
|
||||
void Language(nsAString& aLocale);
|
||||
void ScrollTo(PRUint32 aType);
|
||||
|
||||
protected:
|
||||
nsPresContext* GetPresContext();
|
||||
|
||||
|
@ -221,8 +209,5 @@ private:
|
|||
static nsApplicationAccessible *gApplicationAccessible;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsAccessNode,
|
||||
NS_ACCESSNODE_IMPL_CID)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -52,11 +52,14 @@
|
|||
#include "nsAccessibilityService.h"
|
||||
#include "nsAccTreeWalker.h"
|
||||
#include "nsIAccessibleRelation.h"
|
||||
#include "nsRootAccessible.h"
|
||||
#include "nsTextEquivUtils.h"
|
||||
#include "Relation.h"
|
||||
#include "Role.h"
|
||||
#include "States.h"
|
||||
|
||||
#include "nsIDOMCSSValue.h"
|
||||
#include "nsIDOMCSSPrimitiveValue.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
|
@ -229,6 +232,92 @@ nsAccessible::SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry)
|
|||
mRoleMapEntry = aRoleMapEntry;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetComputedStyleValue(const nsAString& aPseudoElt,
|
||||
const nsAString& aPropertyName,
|
||||
nsAString& aValue)
|
||||
{
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> styleDecl =
|
||||
nsCoreUtils::GetComputedStyleDeclaration(aPseudoElt, mContent);
|
||||
NS_ENSURE_TRUE(styleDecl, NS_ERROR_FAILURE);
|
||||
|
||||
return styleDecl->GetPropertyValue(aPropertyName, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetComputedStyleCSSValue(const nsAString& aPseudoElt,
|
||||
const nsAString& aPropertyName,
|
||||
nsIDOMCSSPrimitiveValue **aCSSValue) {
|
||||
NS_ENSURE_ARG_POINTER(aCSSValue);
|
||||
*aCSSValue = nsnull;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> styleDecl =
|
||||
nsCoreUtils::GetComputedStyleDeclaration(aPseudoElt, mContent);
|
||||
NS_ENSURE_STATE(styleDecl);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSValue> cssValue;
|
||||
styleDecl->GetPropertyCSSValue(aPropertyName, getter_AddRefs(cssValue));
|
||||
NS_ENSURE_TRUE(cssValue, NS_ERROR_FAILURE);
|
||||
|
||||
return CallQueryInterface(cssValue, aCSSValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetDocument(nsIAccessibleDocument **aDocument)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocument);
|
||||
|
||||
NS_IF_ADDREF(*aDocument = GetDocAccessible());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetDOMNode(nsIDOMNode **aDOMNode)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDOMNode);
|
||||
*aDOMNode = nsnull;
|
||||
|
||||
nsINode *node = GetNode();
|
||||
if (node)
|
||||
CallQueryInterface(node, aDOMNode);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetRootDocument(nsIAccessibleDocument **aRootDocument)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRootDocument);
|
||||
|
||||
nsRootAccessible* rootDocument = RootAccessible();
|
||||
NS_IF_ADDREF(*aRootDocument = rootDocument);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetInnerHTML(nsAString& aInnerHTML)
|
||||
{
|
||||
aInnerHTML.Truncate();
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(mContent);
|
||||
NS_ENSURE_TRUE(htmlElement, NS_ERROR_NULL_POINTER);
|
||||
|
||||
return htmlElement->GetInnerHTML(aInnerHTML);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetLanguage(nsAString& aLanguage)
|
||||
{
|
||||
Language(aLanguage);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::GetName(nsAString& aName)
|
||||
{
|
||||
|
@ -551,7 +640,7 @@ nsAccessible::GetChildren(nsIArray **aOutChildren)
|
|||
}
|
||||
|
||||
bool
|
||||
nsAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -1374,6 +1463,30 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
|
|||
if (NS_SUCCEEDED(rv))
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::textIndent, value);
|
||||
|
||||
// Expose 'margin-left' attribute.
|
||||
rv = GetComputedStyleValue(EmptyString(), NS_LITERAL_STRING("margin-left"),
|
||||
value);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::marginLeft, value);
|
||||
|
||||
// Expose 'margin-right' attribute.
|
||||
rv = GetComputedStyleValue(EmptyString(), NS_LITERAL_STRING("margin-right"),
|
||||
value);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::marginRight, value);
|
||||
|
||||
// Expose 'margin-top' attribute.
|
||||
rv = GetComputedStyleValue(EmptyString(), NS_LITERAL_STRING("margin-top"),
|
||||
value);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::marginTop, value);
|
||||
|
||||
// Expose 'margin-bottom' attribute.
|
||||
rv = GetComputedStyleValue(EmptyString(), NS_LITERAL_STRING("margin-bottom"),
|
||||
value);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::marginBottom, value);
|
||||
|
||||
// Expose draggable object attribute?
|
||||
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(mContent);
|
||||
if (htmlElement) {
|
||||
|
@ -2176,6 +2289,32 @@ nsAccessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
|
|||
nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, presShell, aContent);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::ScrollTo(PRUint32 aHow)
|
||||
{
|
||||
nsAccessNode::ScrollTo(aHow);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessible::ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (!frame)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIntPoint coords;
|
||||
nsresult rv = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType,
|
||||
this, &coords);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIFrame *parentFrame = frame;
|
||||
while ((parentFrame = parentFrame->GetParent()))
|
||||
nsCoreUtils::ScrollFrameToPoint(parentFrame, frame, coords);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsIAccessibleSelectable
|
||||
NS_IMETHODIMP nsAccessible::GetSelectedChildren(nsIArray **aSelectedAccessibles)
|
||||
{
|
||||
|
@ -2940,7 +3079,7 @@ nsAccessible::ContainerWidget() const
|
|||
void
|
||||
nsAccessible::CacheChildren()
|
||||
{
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles());
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, CanHaveAnonChildren());
|
||||
|
||||
nsAccessible* child = nsnull;
|
||||
while ((child = walker.NextChild()) && AppendChild(child));
|
||||
|
|
|
@ -129,6 +129,17 @@ public:
|
|||
*/
|
||||
virtual void Description(nsString& aDescription);
|
||||
|
||||
/**
|
||||
* Return DOM node associated with this accessible.
|
||||
*/
|
||||
inline already_AddRefed<nsIDOMNode> DOMNode() const
|
||||
{
|
||||
nsIDOMNode *DOMNode = nsnull;
|
||||
if (GetNode())
|
||||
CallQueryInterface(GetNode(), &DOMNode);
|
||||
return DOMNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the accessible name specified by ARIA.
|
||||
*/
|
||||
|
@ -388,9 +399,9 @@ public:
|
|||
virtual nsresult HandleAccEvent(AccEvent* aAccEvent);
|
||||
|
||||
/**
|
||||
* Return true if there are accessible children in anonymous content
|
||||
* Return true if this accessible allows accessible children from anonymous subtree.
|
||||
*/
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
/**
|
||||
* Returns text of accessible if accessible has text role otherwise empty
|
||||
|
|
|
@ -421,7 +421,7 @@ nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset,
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIAccessNode and nsAccessNode
|
||||
// nsIAccessible
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsApplicationAccessible::GetDOMNode(nsIDOMNode **aDOMNode)
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIAccessNode
|
||||
// nsIAccessible
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDocument(nsIAccessibleDocument** aDocument);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument);
|
||||
|
@ -83,8 +83,6 @@ public:
|
|||
const nsAString& aPropertyName,
|
||||
nsIDOMCSSPrimitiveValue** aValue NS_OUTPARAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetLanguage(nsAString& aLanguage);
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD GetParent(nsIAccessible **aParent);
|
||||
NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
|
||||
NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
|
||||
|
|
|
@ -191,7 +191,7 @@ public:
|
|||
|
||||
/**
|
||||
* Scrolls the given frame to the point, used for implememntation of
|
||||
* nsIAccessNode::scrollToPoint and nsIAccessibleText::scrollSubstringToPoint.
|
||||
* nsIAccessible::scrollToPoint and nsIAccessibleText::scrollSubstringToPoint.
|
||||
*
|
||||
* @param aScrollableFrame the scrollable frame
|
||||
* @param aFrame the frame to scroll
|
||||
|
|
|
@ -1525,7 +1525,7 @@ nsDocAccessible::CacheChildren()
|
|||
// Search for accessible children starting from the document element since
|
||||
// some web pages tend to insert elements under it rather than document body.
|
||||
nsAccTreeWalker walker(mWeakShell, mDocument->GetRootElement(),
|
||||
GetAllowsAnonChildAccessibles());
|
||||
CanHaveAnonChildren());
|
||||
|
||||
nsAccessible* child = nsnull;
|
||||
while ((child = walker.NextChild()) && AppendChild(child));
|
||||
|
@ -1881,7 +1881,7 @@ nsDocAccessible::UpdateTree(nsAccessible* aContainer, nsIContent* aChildNode,
|
|||
|
||||
} else {
|
||||
nsAccTreeWalker walker(mWeakShell, aChildNode,
|
||||
aContainer->GetAllowsAnonChildAccessibles(), true);
|
||||
aContainer->CanHaveAnonChildren(), true);
|
||||
|
||||
while ((child = walker.NextChild()))
|
||||
updateFlags |= UpdateTreeInternal(child, aIsInsert);
|
||||
|
|
|
@ -283,8 +283,8 @@ nsLangTextAttr::nsLangTextAttr(nsHyperTextAccessible *aRootAcc,
|
|||
nsIContent *aRootContent, nsIContent *aContent) :
|
||||
nsTextAttr<nsAutoString>(aContent == nsnull), mRootContent(aRootContent)
|
||||
{
|
||||
nsresult rv = aRootAcc->GetLanguage(mRootNativeValue);
|
||||
mIsRootDefined = NS_SUCCEEDED(rv) && !mRootNativeValue.IsEmpty();
|
||||
aRootAcc->Language(mRootNativeValue);
|
||||
mIsRootDefined = !mRootNativeValue.IsEmpty();
|
||||
|
||||
if (aContent)
|
||||
mIsDefined = GetLang(aContent, mNativeValue);
|
||||
|
|
|
@ -458,7 +458,7 @@ nsHTMLTableAccessible::CacheChildren()
|
|||
// caption only, because nsAccessibilityService ensures we don't create
|
||||
// accessibles for the other captions, since only the first is actually
|
||||
// visible.
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles());
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, CanHaveAnonChildren());
|
||||
|
||||
nsAccessible* child = nsnull;
|
||||
while ((child = walker.NextChild())) {
|
||||
|
|
|
@ -1148,7 +1148,7 @@ nsHyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs,
|
|||
// Compute spelling attributes on text accessible only.
|
||||
nsIFrame *offsetFrame = accAtOffset->GetFrame();
|
||||
if (offsetFrame && offsetFrame->GetType() == nsGkAtoms::textFrame) {
|
||||
nsCOMPtr<nsIDOMNode> node = accAtOffset->GetDOMNode();
|
||||
nsCOMPtr<nsIDOMNode> node = accAtOffset->DOMNode();
|
||||
|
||||
PRInt32 nodeOffset = 0;
|
||||
nsresult rv = RenderedToContentOffset(offsetFrame, offsetInAcc,
|
||||
|
@ -1560,12 +1560,17 @@ nsHyperTextAccessible::GetAssociatedEditor(nsIEditor **aEditor)
|
|||
nsresult
|
||||
nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
|
||||
{
|
||||
nsresult rv = TakeFocus();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
bool isFocusable = State() & states::FOCUSABLE;
|
||||
|
||||
// If accessible is focusable then focus it before setting the selection to
|
||||
// neglect control's selection changes on focus if any (for example, inputs
|
||||
// that do select all on focus).
|
||||
// some input controls
|
||||
if (isFocusable)
|
||||
TakeFocus();
|
||||
|
||||
// Set the selection
|
||||
SetSelectionBounds(0, aStartPos, aEndPos);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// If range 0 was successfully set, clear any additional selection
|
||||
// ranges remaining from previous selection
|
||||
|
@ -1585,7 +1590,12 @@ nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
|
|||
domSel->RemoveRange(range);
|
||||
}
|
||||
|
||||
// Now that selection is done, move the focus to the selection.
|
||||
// When selection is done, move the focus to the selection if accessible is
|
||||
// not focusable. That happens when selection is set within hypertext
|
||||
// accessible.
|
||||
if (isFocusable)
|
||||
return NS_OK;
|
||||
|
||||
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
|
||||
if (DOMFocusManager) {
|
||||
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||
|
@ -2255,10 +2265,8 @@ nsHyperTextAccessible::GetDOMPointByFrameOffset(nsIFrame *aFrame,
|
|||
if (!aFrame) {
|
||||
// If the given frame is null then set offset after the DOM node of the
|
||||
// given accessible.
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aAccessible));
|
||||
|
||||
nsCOMPtr<nsIDOMNode> DOMNode;
|
||||
accessNode->GetDOMNode(getter_AddRefs(DOMNode));
|
||||
aAccessible->GetDOMNode(getter_AddRefs(DOMNode));
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(DOMNode));
|
||||
NS_ENSURE_STATE(content);
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ CAccessibleComponent::GetARGBValueFromCSSProperty(const nsAString& aPropName,
|
|||
__try {
|
||||
*aColorValue = 0;
|
||||
|
||||
nsCOMPtr<nsIAccessNode> acc(do_QueryObject(this));
|
||||
nsRefPtr<nsAccessible> acc(do_QueryObject(this));
|
||||
if (!acc)
|
||||
return E_FAIL;
|
||||
|
||||
|
|
|
@ -396,9 +396,8 @@ __try {
|
|||
aScrollTopLeft ? nsIAccessibleScrollType::SCROLL_TYPE_TOP_LEFT :
|
||||
nsIAccessibleScrollType::SCROLL_TYPE_BOTTOM_RIGHT;
|
||||
|
||||
nsresult rv = ScrollTo(scrollType);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return S_OK;
|
||||
ScrollTo(scrollType);
|
||||
return S_OK;
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
|
||||
return E_FAIL;
|
||||
|
@ -554,10 +553,7 @@ __try {
|
|||
*aLanguage = NULL;
|
||||
|
||||
nsAutoString language;
|
||||
if (NS_FAILED(GetLanguage(language))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
Language(language);
|
||||
if (language.IsEmpty())
|
||||
return S_FALSE;
|
||||
|
||||
|
@ -575,7 +571,7 @@ nsAccessNodeWrap::get_localInterface(
|
|||
/* [out] */ void __RPC_FAR *__RPC_FAR *localInterface)
|
||||
{
|
||||
__try {
|
||||
*localInterface = static_cast<nsIAccessNode*>(this);
|
||||
*localInterface = static_cast<nsAccessNode*>(this);
|
||||
NS_ADDREF_THIS();
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
return S_OK;
|
||||
|
|
|
@ -1145,8 +1145,8 @@ STDMETHODIMP
|
|||
nsAccessibleWrap::scrollTo(enum IA2ScrollType aScrollType)
|
||||
{
|
||||
__try {
|
||||
nsresult rv = ScrollTo(aScrollType);
|
||||
return GetHRESULT(rv);
|
||||
nsAccessNode::ScrollTo(aScrollType);
|
||||
return S_OK;
|
||||
|
||||
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
return E_FAIL;
|
||||
|
@ -1366,9 +1366,7 @@ __try {
|
|||
// Any two-letter subcode is understood to be a [ISO3166] country code.
|
||||
|
||||
nsAutoString lang;
|
||||
nsresult rv = GetLanguage(lang);
|
||||
if (NS_FAILED(rv))
|
||||
return GetHRESULT(rv);
|
||||
Language(lang);
|
||||
|
||||
// If primary code consists from two letters then expose it as language.
|
||||
PRInt32 offset = lang.FindChar('-', 0);
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "nsTextEquivUtils.h"
|
||||
#include "Role.h"
|
||||
#include "States.h"
|
||||
#include "Statistics.h"
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
@ -70,6 +71,7 @@ nsXFormsAccessibleBase::nsXFormsAccessibleBase()
|
|||
if (NS_FAILED(rv))
|
||||
NS_WARNING("No XForms utility service.");
|
||||
}
|
||||
statistics::XFormsAccessibleUsed();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -213,7 +215,7 @@ nsXFormsAccessible::Description(nsString& aDescription)
|
|||
}
|
||||
|
||||
bool
|
||||
nsXFormsAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXFormsAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -236,7 +238,7 @@ nsXFormsContainerAccessible::NativeRole()
|
|||
}
|
||||
|
||||
bool
|
||||
nsXFormsContainerAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXFormsContainerAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
// Denies accessible nodes in anonymous content of xforms element by
|
||||
// always returning false value.
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
protected:
|
||||
// Returns value of first child xforms element by tagname that is bound to
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
|
||||
// Allows accessible nodes in anonymous content of xforms element by
|
||||
// always returning true value.
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -590,7 +590,7 @@ nsXFormsSelectComboboxAccessible::NativeState()
|
|||
}
|
||||
|
||||
bool
|
||||
nsXFormsSelectComboboxAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXFormsSelectComboboxAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -297,7 +297,7 @@ public:
|
|||
// nsAccessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ nsXULComboboxAccessible::Description(nsString& aDescription)
|
|||
}
|
||||
|
||||
bool
|
||||
nsXULComboboxAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXULComboboxAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
if (mContent->NodeInfo()->Equals(nsGkAtoms::textbox, kNameSpaceID_XUL) ||
|
||||
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
virtual void Description(nsString& aDescription);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -662,17 +662,10 @@ nsXULToolbarButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
|||
bool
|
||||
nsXULToolbarButtonAccessible::IsSeparator(nsAccessible *aAccessible)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> domNode;
|
||||
aAccessible->GetDOMNode(getter_AddRefs(domNode));
|
||||
nsCOMPtr<nsIContent> contentDomNode(do_QueryInterface(domNode));
|
||||
|
||||
if (!contentDomNode)
|
||||
return false;
|
||||
|
||||
return (contentDomNode->Tag() == nsGkAtoms::toolbarseparator) ||
|
||||
(contentDomNode->Tag() == nsGkAtoms::toolbarspacer) ||
|
||||
(contentDomNode->Tag() == nsGkAtoms::toolbarspring);
|
||||
}
|
||||
nsIContent* content = aAccessible->GetContent();
|
||||
return content && ((content->Tag() == nsGkAtoms::toolbarseparator) ||
|
||||
(content->Tag() == nsGkAtoms::toolbarspacer) ||
|
||||
(content->Tag() == nsGkAtoms::toolbarspring)); }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -851,7 +844,7 @@ NS_IMETHODIMP nsXULTextFieldAccessible::DoAction(PRUint8 index)
|
|||
}
|
||||
|
||||
bool
|
||||
nsXULTextFieldAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXULTextFieldAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ public:
|
|||
virtual void ApplyARIAState(PRUint64* aState);
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -1024,7 +1024,7 @@ NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString&
|
|||
}
|
||||
|
||||
bool
|
||||
nsXULListitemAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXULListitemAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
// That indicates we should walk anonymous children for listitems
|
||||
return true;
|
||||
|
|
|
@ -141,7 +141,7 @@ public:
|
|||
virtual PRUint64 NativeState();
|
||||
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
||||
PRInt32 *aSetSize);
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
// Widgets
|
||||
virtual nsAccessible* ContainerWidget() const;
|
||||
|
|
|
@ -320,7 +320,7 @@ nsXULMenuitemAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
|||
}
|
||||
|
||||
bool
|
||||
nsXULMenuitemAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXULMenuitemAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
// That indicates we don't walk anonymous children for menuitems
|
||||
return false;
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
||||
PRInt32 *aSetSize);
|
||||
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -190,7 +190,7 @@ nsXULSliderAccessible::SetCurrentValue(double aValue)
|
|||
}
|
||||
|
||||
bool
|
||||
nsXULSliderAccessible::GetAllowsAnonChildAccessibles()
|
||||
nsXULSliderAccessible::CanHaveAnonChildren()
|
||||
{
|
||||
// Do not allow anonymous xul:slider be accessible.
|
||||
return false;
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
// nsAccessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
virtual bool CanHaveAnonChildren();
|
||||
|
||||
// ActionAccessible
|
||||
virtual PRUint8 ActionCount();
|
||||
|
|
|
@ -153,9 +153,9 @@ nsXULTabAccessible::RelationByType(PRUint32 aType)
|
|||
if (!tabsElm)
|
||||
return rel;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> DOMNode(GetDOMNode());
|
||||
nsCOMPtr<nsIDOMNode> domNode(DOMNode());
|
||||
nsCOMPtr<nsIDOMNode> tabpanelNode;
|
||||
tabsElm->GetRelatedElement(DOMNode, getter_AddRefs(tabpanelNode));
|
||||
tabsElm->GetRelatedElement(domNode, getter_AddRefs(tabpanelNode));
|
||||
if (!tabpanelNode)
|
||||
return rel;
|
||||
|
||||
|
@ -255,9 +255,9 @@ nsXULTabpanelAccessible::RelationByType(PRUint32 aType)
|
|||
if (!tabpanelsElm)
|
||||
return rel;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> DOMNode(GetDOMNode());
|
||||
nsCOMPtr<nsIDOMNode> domNode(DOMNode());
|
||||
nsCOMPtr<nsIDOMNode> tabNode;
|
||||
tabpanelsElm->GetRelatedElement(DOMNode, getter_AddRefs(tabNode));
|
||||
tabpanelsElm->GetRelatedElement(domNode, getter_AddRefs(tabNode));
|
||||
if (!tabNode)
|
||||
return rel;
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ DIRS = \
|
|||
states \
|
||||
table \
|
||||
text \
|
||||
textcaret \
|
||||
textselection \
|
||||
tree \
|
||||
treeupdate \
|
||||
|
@ -103,7 +104,6 @@ _TEST_FILES =\
|
|||
test_nsIAccessNode_utils.html \
|
||||
test_nsOuterDocAccessible.html \
|
||||
test_role_nsHyperTextAcc.html \
|
||||
test_text_caret.html \
|
||||
test_textboxes.html \
|
||||
test_textboxes.xul \
|
||||
testTextboxes.js \
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=439566
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=460932
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=689540
|
||||
-->
|
||||
<head>
|
||||
<title>CSS-like attributes tests</title>
|
||||
|
@ -25,7 +26,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=460932
|
|||
var attrs = {
|
||||
"display": computedStyle.display,
|
||||
"text-align": computedStyle.textAlign,
|
||||
"text-indent": computedStyle.textIndent
|
||||
"text-indent": computedStyle.textIndent,
|
||||
"margin-left": computedStyle.marginLeft,
|
||||
"margin-right": computedStyle.marginRight,
|
||||
"margin-top": computedStyle.marginTop,
|
||||
"margin-bottom": computedStyle.marginBottom
|
||||
};
|
||||
testAttrs(aID, attrs, true);
|
||||
}
|
||||
|
@ -34,7 +39,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=460932
|
|||
{
|
||||
testCSSAttrs("span");
|
||||
testCSSAttrs("div");
|
||||
|
||||
testCSSAttrs("p");
|
||||
testCSSAttrs("p2");
|
||||
|
||||
testCSSAttrs("pml");
|
||||
testCSSAttrs("pmr");
|
||||
testCSSAttrs("pmt");
|
||||
testCSSAttrs("pmb");
|
||||
|
||||
testCSSAttrs("input");
|
||||
testCSSAttrs("table");
|
||||
testCSSAttrs("tr");
|
||||
|
@ -59,6 +72,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=460932
|
|||
title="text-indent and text-align should really be object attribute">
|
||||
Mozilla Bug 460932
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=689540"
|
||||
title="Expose IA2 margin- object attributes">
|
||||
Mozilla Bug 689540
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
|
@ -67,7 +85,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=460932
|
|||
|
||||
<span id="span" role="group">It's span</span>
|
||||
<div id="div">It's div</div>
|
||||
|
||||
<p id="p">It's paragraph"</p>
|
||||
<p id="p2" style="text-indent: 5px">It's another paragraph</p>
|
||||
|
||||
<p id="pml" style="margin-left : 11px;">It's a paragraph with left margin</p>
|
||||
<p id="pmr" style="margin-right : 21px;">It's a paragraph with right margin</p>
|
||||
<p id="pmt" style="margin-top : 31px;">It's a paragraph with top margin</p>
|
||||
<p id="pmb" style="margin-bottom : 41px;">It's a paragraph with bottom margin</p>
|
||||
|
||||
<input id="input"/>
|
||||
<table id="table">
|
||||
<tr id="tr" role="group">
|
||||
|
|
|
@ -25,6 +25,14 @@ function browserWindow()
|
|||
return gBrowserContext.browserWnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the document of the browser window.
|
||||
*/
|
||||
function browserDocument()
|
||||
{
|
||||
return browserWindow().document;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return tab browser object.
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,6 @@ const nsIAccessibleCoordinateType = Components.interfaces.nsIAccessibleCoordinat
|
|||
|
||||
const nsIAccessibleRelation = Components.interfaces.nsIAccessibleRelation;
|
||||
|
||||
const nsIAccessNode = Components.interfaces.nsIAccessNode;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
|
||||
const nsIAccessibleDocument = Components.interfaces.nsIAccessibleDocument;
|
||||
|
@ -121,10 +120,8 @@ function getNode(aAccOrNodeOrID)
|
|||
if (aAccOrNodeOrID instanceof nsIDOMNode)
|
||||
return aAccOrNodeOrID;
|
||||
|
||||
if (aAccOrNodeOrID instanceof nsIAccessible) {
|
||||
aAccOrNodeOrID.QueryInterface(nsIAccessNode);
|
||||
if (aAccOrNodeOrID instanceof nsIAccessible)
|
||||
return aAccOrNodeOrID.DOMNode;
|
||||
}
|
||||
|
||||
node = document.getElementById(aAccOrNodeOrID);
|
||||
if (!node) {
|
||||
|
@ -167,7 +164,6 @@ function getAccessible(aAccOrElmOrID, aInterfaces, aElmObj, aDoNotFailIf)
|
|||
var elm = null;
|
||||
|
||||
if (aAccOrElmOrID instanceof nsIAccessible) {
|
||||
aAccOrElmOrID.QueryInterface(nsIAccessNode);
|
||||
elm = aAccOrElmOrID.DOMNode;
|
||||
|
||||
} else if (aAccOrElmOrID instanceof nsIDOMNode) {
|
||||
|
@ -199,8 +195,6 @@ function getAccessible(aAccOrElmOrID, aInterfaces, aElmObj, aDoNotFailIf)
|
|||
}
|
||||
}
|
||||
|
||||
acc.QueryInterface(nsIAccessNode);
|
||||
|
||||
if (!aInterfaces)
|
||||
return acc;
|
||||
|
||||
|
@ -257,8 +251,7 @@ function getContainerAccessible(aAccOrElmOrID)
|
|||
*/
|
||||
function getRootAccessible(aAccOrElmOrID)
|
||||
{
|
||||
var acc = getAccessible(aAccOrElmOrID ? aAccOrElmOrID : document,
|
||||
[nsIAccessNode]);
|
||||
var acc = getAccessible(aAccOrElmOrID ? aAccOrElmOrID : document);
|
||||
return acc ? acc.rootDocument.QueryInterface(nsIAccessible) : null;
|
||||
}
|
||||
|
||||
|
@ -267,11 +260,10 @@ function getRootAccessible(aAccOrElmOrID)
|
|||
*/
|
||||
function getTabDocAccessible(aAccOrElmOrID)
|
||||
{
|
||||
var acc = getAccessible(aAccOrElmOrID ? aAccOrElmOrID : document,
|
||||
[nsIAccessNode]);
|
||||
var acc = getAccessible(aAccOrElmOrID ? aAccOrElmOrID : document);
|
||||
|
||||
var docAcc = acc.document.QueryInterface(nsIAccessible);
|
||||
var containerDocAcc = docAcc.parent.QueryInterface(nsIAccessNode).document;
|
||||
var containerDocAcc = docAcc.parent.document;
|
||||
|
||||
// Test is running is stand-alone mode.
|
||||
if (acc.rootDocument == containerDocAcc)
|
||||
|
@ -584,7 +576,7 @@ function getTextFromClipboard()
|
|||
function prettyName(aIdentifier)
|
||||
{
|
||||
if (aIdentifier instanceof nsIAccessible) {
|
||||
var acc = getAccessible(aIdentifier, [nsIAccessNode]);
|
||||
var acc = getAccessible(aIdentifier);
|
||||
var msg = "[" + getNodePrettyName(acc.DOMNode);
|
||||
try {
|
||||
msg += ", role: " + roleToString(acc.role);
|
||||
|
|
|
@ -1221,6 +1221,33 @@ function synthSelectAll(aNodeOrID, aCheckerOrEventSeq)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set caret offset in text accessible.
|
||||
*/
|
||||
function setCaretOffset(aID, aOffset, aFocusTargetID)
|
||||
{
|
||||
this.target = getAccessible(aID, [nsIAccessibleText]);
|
||||
this.offset = aOffset == -1 ? this.target.characterCount: aOffset;
|
||||
this.focus = aFocusTargetID ? getAccessible(aFocusTargetID) : null;
|
||||
|
||||
this.invoke = function setCaretOffset_invoke()
|
||||
{
|
||||
this.target.caretOffset = this.offset;
|
||||
}
|
||||
|
||||
this.getID = function setCaretOffset_getID()
|
||||
{
|
||||
return "Set caretOffset on " + prettyName(aID) + " at " + this.offset;
|
||||
}
|
||||
|
||||
this.eventSeq = [
|
||||
new caretMoveChecker(this.offset, this.target)
|
||||
];
|
||||
|
||||
if (this.focus)
|
||||
this.eventSeq.push(new asyncInvokerChecker(EVENT_FOCUS, this.focus));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Event queue checkers
|
||||
|
|
|
@ -45,8 +45,6 @@ relativesrcdir = accessible/events
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# test_scroll.xul disabled for misusing <tabbrowser> (bug 715857)
|
||||
|
||||
_TEST_FILES =\
|
||||
docload_wnd.html \
|
||||
focus.html \
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
var item = menu.getChildAt(idx);
|
||||
|
||||
if (hasState(item, STATE_FOCUSED))
|
||||
return getAccessible(item, [nsIAccessNode]);
|
||||
return getAccessible(item);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
{
|
||||
this.containerNode = getNode(aContainerID);
|
||||
this.container = getAccessible(this.containerNode, nsIAccessibleHyperText);
|
||||
this.text = this.container.firstChild.QueryInterface(nsIAccessNode);
|
||||
this.text = this.container.firstChild;
|
||||
this.textNode = this.text.DOMNode;
|
||||
this.textLen = this.textNode.data.length;
|
||||
|
||||
|
|
|
@ -45,8 +45,6 @@ relativesrcdir = accessible/name
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# test_nsRootAcc.xul, nsRootAcc_wnd.xul disabled for misusing <tabbrowser> (bug 715857)
|
||||
|
||||
_TEST_FILES =\
|
||||
general.css \
|
||||
general.xbl \
|
||||
|
@ -57,6 +55,7 @@ _TEST_FILES =\
|
|||
test_link.html \
|
||||
test_list.html \
|
||||
test_markup.html \
|
||||
test_browserui.xul \
|
||||
test_tree.xul \
|
||||
markuprules.xml \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,128 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
|
||||
<!-- Firefox tabbrowser -->
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css"
|
||||
type="text/css"?>
|
||||
<!-- SeaMonkey tabbrowser -->
|
||||
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
var gOpenerWnd = window.opener.wrappedJSObject;
|
||||
|
||||
function ok(aCond, aMsg) {
|
||||
gOpenerWnd.SimpleTest.ok(aCond, aMsg);
|
||||
}
|
||||
|
||||
function is(aExpected, aActual, aMsg) {
|
||||
gOpenerWnd.SimpleTest.is(aExpected, aActual, aMsg);
|
||||
}
|
||||
|
||||
// Hacks to make xul:tabbrowser work.
|
||||
var handleDroppedLink = null; // needed for tabbrowser usage
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
var XULBrowserWindow = {
|
||||
isBusy: false,
|
||||
setOverLink: function (link, b) {
|
||||
}
|
||||
};
|
||||
|
||||
gFindBarInitialized = false;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Invoker implementation.
|
||||
|
||||
function switchTabSelectChecker(aInvoker)
|
||||
{
|
||||
this.type = "select";
|
||||
Object.defineProperty(this, "target", { get: function() { return aInvoker.getTabsElm(); }});
|
||||
this.getID = function() { return "switch tab, select event"; }
|
||||
}
|
||||
|
||||
function switchTabFocusChecker(aInvoker)
|
||||
{
|
||||
this.type = gOpenerWnd.EVENT_FOCUS;
|
||||
Object.defineProperty(this, "target", { get: function() { return aInvoker.getContentDoc(); }});
|
||||
this.check = function(aEvent)
|
||||
{
|
||||
is(gOpenerWnd.getAccessible(document).name, "about:mozilla" + aEvent.accessible.name,
|
||||
"Oops almost :)");
|
||||
}
|
||||
this.getID = function() { return "switch tab, focus event"; }
|
||||
}
|
||||
|
||||
function switchTabInvoker(aTabBrowser, aWindow)
|
||||
{
|
||||
this.invoke = function switchTabInvoker_invoke()
|
||||
{
|
||||
gOpenerWnd.synthesizeKey("VK_TAB", { ctrlKey: true }, aWindow);
|
||||
}
|
||||
|
||||
this.eventSeq = [
|
||||
new switchTabSelectChecker(this),
|
||||
new switchTabFocusChecker(this)
|
||||
];
|
||||
|
||||
this.getContentDoc = function switchTabInvoker_getContentDoc()
|
||||
{
|
||||
return aTabBrowser.getBrowserAtIndex(1).contentDocument;
|
||||
}
|
||||
this.getTabsElm = function switchTabInvoker_getTabsElm()
|
||||
{
|
||||
return aTabBrowser.tabContainer;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Tests
|
||||
|
||||
var gQueue = null;
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
function doTest()
|
||||
{
|
||||
var tabBrowser = document.getElementById("content");
|
||||
tabBrowser.loadURI("about:");
|
||||
tabBrowser.addTab("about:mozilla");
|
||||
|
||||
gQueue = new gOpenerWnd.eventQueue();
|
||||
gQueue.push(new switchTabInvoker(tabBrowser, window));
|
||||
gQueue.onFinish = function() { window.close(); }
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
gOpenerWnd.addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- Hack to make xul:tabbrowser work -->
|
||||
<menubar>
|
||||
<menu label="menu">
|
||||
<menupopup>
|
||||
<menuitem label="close window hook" id="menu_closeWindow"/>
|
||||
<menuitem label="close hook" id="menu_close"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<tabs id="tabbrowser-tabs" class="tabbrowser-tabs"
|
||||
tabbrowser="content"
|
||||
flex="1"
|
||||
setfocus="false">
|
||||
<tab class="tabbrowser-tab" selected="true"/>
|
||||
</tabs>
|
||||
<tabbrowser id="content"
|
||||
type="content-primary"
|
||||
tabcontainer="tabbrowser-tabs"
|
||||
flex="1"/>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,106 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Accessibility Name Calculating Test.">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../browser.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
function addTab(aURL)
|
||||
{
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
|
||||
];
|
||||
|
||||
this.invoke = function addTab_invoke()
|
||||
{
|
||||
tabBrowser().addTab(aURL);
|
||||
}
|
||||
|
||||
this.getID = function addTab_getID()
|
||||
{
|
||||
return "add tab: " + aURL;
|
||||
}
|
||||
}
|
||||
|
||||
function switchTab(aTabBrowser, aWindow)
|
||||
{
|
||||
this.invoke = function switchTab_invoke()
|
||||
{
|
||||
synthesizeKey("VK_TAB", { ctrlKey: true }, browserWindow());
|
||||
}
|
||||
|
||||
this.eventSeq = [
|
||||
new focusChecker(tabDocumentAt, 1)
|
||||
];
|
||||
|
||||
this.check = function switchTab_check(aEvent)
|
||||
{
|
||||
var title = getAccessible(browserDocument()).name;
|
||||
ok(title.indexOf(aEvent.accessible.name) != -1,
|
||||
"Window title contains the name of active tab document");
|
||||
}
|
||||
|
||||
this.getID = function switchTab_getID() { return "switch tab"; }
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Tests
|
||||
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true; // debug
|
||||
|
||||
var gQueue = null;
|
||||
function doTests()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
gQueue.push(new addTab("about:mozilla"));
|
||||
gQueue.push(new switchTab());
|
||||
gQueue.onFinish = function()
|
||||
{
|
||||
closeBrowserWindow();
|
||||
}
|
||||
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
openBrowserWindow(doTests, "about:");
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<vbox flex="1" style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=507382"
|
||||
title="focus is fired earlier than root accessible name is changed when switching between tabs">
|
||||
Mozilla Bug
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox id="eventdump"></vbox>
|
||||
</vbox>
|
||||
</window>
|
|
@ -75,7 +75,6 @@ function virtualCursorChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets)
|
|||
this.check = function virtualCursorChangedChecker_check(aEvent)
|
||||
{
|
||||
var position = aDocAcc.virtualCursor.position;
|
||||
position.QueryInterface(nsIAccessNode);
|
||||
|
||||
var idMatches = position.DOMNode.id == aIdOrNameOrAcc;
|
||||
var nameMatches = position.name == aIdOrNameOrAcc;
|
||||
|
@ -214,4 +213,4 @@ function dumpTraversalSequence(aPivot, aRule)
|
|||
} while (aPivot.moveNext(aRule))
|
||||
}
|
||||
SimpleTest.info("\n[" + sequence.join(", ") + "]\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,12 +45,11 @@ relativesrcdir = accessible/relations
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# test_tabbrowser.xul disabled for misusing <tabbrowser> (bug 715857)
|
||||
|
||||
_TEST_FILES =\
|
||||
test_embeds.xul \
|
||||
test_general.html \
|
||||
test_general.xul \
|
||||
test_tabbrowser.xul \
|
||||
test_tree.xul \
|
||||
test_update.html \
|
||||
$(NULL)
|
||||
|
|
|
@ -3,20 +3,13 @@
|
|||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<!-- Firefox tabbrowser -->
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css"
|
||||
type="text/css"?>
|
||||
<!-- SeaMonkey tabbrowser -->
|
||||
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Accessible XUL tabbrowser relation tests">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
|
@ -26,75 +19,63 @@
|
|||
src="../relations.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
<script type="application/javascript"
|
||||
src="../browser.js"></script>
|
||||
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
// Invoker
|
||||
function testTabRelations()
|
||||
{
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0),
|
||||
new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
|
||||
];
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
// Hack to make xul:tabbrowser work.
|
||||
var handleDroppedLink = null;
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
var XULBrowserWindow = {
|
||||
isBusy: false,
|
||||
setOverLink: function (link, b) {
|
||||
this.invoke = function testTabRelations_invoke()
|
||||
{
|
||||
var docURIs = ["about:", "about:mozilla"];
|
||||
tabBrowser().loadTabs(docURIs, false, true);
|
||||
}
|
||||
};
|
||||
var gFindBar = {
|
||||
hidden: true
|
||||
};
|
||||
|
||||
this.finalCheck = function testTabRelations_finalCheck(aEvent)
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// 'labelled by'/'label for' relations for xul:tab and xul:tabpanel
|
||||
|
||||
var tabs = tabBrowser().tabContainer.childNodes;
|
||||
var panels = tabBrowser().mTabBox.tabpanels.childNodes;
|
||||
|
||||
testRelation(panels[0], RELATION_LABELLED_BY, tabs[0]);
|
||||
testRelation(tabs[0], RELATION_LABEL_FOR, panels[0]);
|
||||
testRelation(panels[1], RELATION_LABELLED_BY, tabs[1]);
|
||||
testRelation(tabs[1], RELATION_LABEL_FOR, panels[1]);
|
||||
}
|
||||
|
||||
this.getID = function testTabRelations_getID()
|
||||
{
|
||||
return "relations of tabs";
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
var gQueue = null;
|
||||
function doTest()
|
||||
{
|
||||
var tabBrowser = document.getElementById("tabbrowser");
|
||||
// Load documents into tabs and wait for DocLoadComplete events caused by
|
||||
// these documents load before we start the test.
|
||||
|
||||
// Load documents into tabs and wait for reorder events caused by these
|
||||
// documents load before we start the test.
|
||||
var docURIs = ["about:", "about:mozilla"];
|
||||
gQueue = new eventQueue();
|
||||
|
||||
var handler = {
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
var target = aEvent.accessible;
|
||||
if (target.role == ROLE_INTERNAL_FRAME &&
|
||||
target.parent.parent == getAccessible(this.tabBrowser.mTabBox.tabpanels)) {
|
||||
this.reorderCnt++;
|
||||
}
|
||||
|
||||
if (this.reorderCnt == docURIs.length) {
|
||||
unregisterA11yEventListener(EVENT_REORDER, this);
|
||||
testRelations();
|
||||
}
|
||||
},
|
||||
|
||||
tabBrowser: tabBrowser,
|
||||
reorderCnt: 0
|
||||
};
|
||||
registerA11yEventListener(EVENT_REORDER, handler);
|
||||
|
||||
tabBrowser.loadTabs(docURIs, false, true);
|
||||
}
|
||||
|
||||
function testRelations()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// 'labelled by'/'label for' relations for xul:tab and xul:tabpanel
|
||||
|
||||
var tabs = getNode("tabbrowser").tabContainer.childNodes;
|
||||
var panels = getNode("tabbrowser").mTabBox.tabpanels.childNodes;
|
||||
|
||||
testRelation(panels[0], RELATION_LABELLED_BY, tabs[0]);
|
||||
testRelation(tabs[0], RELATION_LABEL_FOR, panels[0]);
|
||||
testRelation(panels[1], RELATION_LABELLED_BY, tabs[1]);
|
||||
testRelation(tabs[1], RELATION_LABEL_FOR, panels[1]);
|
||||
|
||||
SimpleTest.finish();
|
||||
gQueue.push(new testTabRelations());
|
||||
gQueue.onFinish = function() { closeBrowserWindow(); }
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
openBrowserWindow(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
@ -112,26 +93,7 @@
|
|||
</pre>
|
||||
</body>
|
||||
|
||||
<!-- Hack to make xul:tabbrowser work -->
|
||||
<menubar>
|
||||
<menu label="menu">
|
||||
<menupopup>
|
||||
<menuitem label="close window hook" id="menu_closeWindow"/>
|
||||
<menuitem label="close hook" id="menu_close"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<tabs id="tabbrowser-tabs" class="tabbrowser-tabs"
|
||||
tabbrowser="tabbrowser"
|
||||
setfocus="false">
|
||||
<tab class="tabbrowser-tab" selected="true"/>
|
||||
</tabs>
|
||||
<tabbrowser id="tabbrowser"
|
||||
type="content-primary"
|
||||
tabcontainer="tabbrowser-tabs"
|
||||
flex="1"/>
|
||||
<toolbar id="addon-bar"/>
|
||||
<vbox id="eventdump"></vbox>
|
||||
</vbox>
|
||||
|
||||
</window>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
function doTest()
|
||||
{
|
||||
var elmObj = {};
|
||||
var acc = getAccessible("span", [nsIAccessNode], elmObj);
|
||||
var acc = getAccessible("span", null, elmObj);
|
||||
computedStyle = document.defaultView.getComputedStyle(elmObj.value, "");
|
||||
|
||||
// html:span element
|
||||
|
@ -23,7 +23,7 @@
|
|||
"Wrong color for element with ID 'span'");
|
||||
|
||||
// text child of html:span element
|
||||
acc = getAccessible(acc.firstChild, [nsIAccessNode]);
|
||||
acc = getAccessible(acc.firstChild);
|
||||
is(acc.getComputedStyleValue("", "color"), computedStyle.color,
|
||||
"Wrong color for text child of element with ID 'span'");
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2012
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Alexander Surkov <surkov.alexander@gmail.com> (original author)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = accessible/textcaret
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = \
|
||||
test_browserui.xul \
|
||||
test_general.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
|
|
@ -4,7 +4,7 @@
|
|||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Accessibility Name Calculating Test.">
|
||||
title="Accessibility Caret Offset Test.">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
@ -15,41 +15,47 @@
|
|||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../browser.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
// var gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
|
||||
function doTest()
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Tests
|
||||
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true; // debug
|
||||
|
||||
var gQueue = null;
|
||||
function doTests()
|
||||
{
|
||||
todo(false, "Disabled test. (Bug 586818)");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
|
||||
if (LINUX) {
|
||||
todo(false, "Skip test on Linux. (Bug 525175)");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
gQueue = new eventQueue();
|
||||
gQueue.push(new setCaretOffset(urlbarInput(), -1, urlbarInput()));
|
||||
gQueue.push(new setCaretOffset(urlbarInput(), 0));
|
||||
gQueue.onFinish = function()
|
||||
{
|
||||
closeBrowserWindow();
|
||||
}
|
||||
|
||||
var w = window.openDialog("nsRootAcc_wnd.xul",
|
||||
"nsRootAcc_name_test",
|
||||
"chrome,width=600,height=600");
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(doTest);
|
||||
openBrowserWindow(doTests, "about:");
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<vbox flex="1" style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=507382"
|
||||
title="focus is fired earlier than root accessible name is changed when switching between tabs">
|
||||
Mozilla Bug
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=723833"
|
||||
title="IAccessibleText::setCaretOffset on location or search bar causes focus to jump">
|
||||
Mozilla Bug 723833
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
|
@ -10,52 +10,11 @@
|
|||
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">
|
||||
|
||||
/**
|
||||
* Checkers.
|
||||
*/
|
||||
function caretMovedChecker(aID, aOffset)
|
||||
{
|
||||
this.__proto__ = new invokerChecker(EVENT_TEXT_CARET_MOVED, aID);
|
||||
|
||||
this.check = function caretMovedChecker_check(aEvent)
|
||||
{
|
||||
is(aEvent.QueryInterface(nsIAccessibleCaretMoveEvent).caretOffset,
|
||||
aOffset,
|
||||
"Wrong caret offset for " + prettyName(aEvent.target));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokers.
|
||||
*/
|
||||
function setCaretOffsetInvoker(aID, aOffset, aFocusableContainerID)
|
||||
{
|
||||
this.target = getAccessible(aID, [nsIAccessibleText]);
|
||||
this.focus = aFocusableContainerID ?
|
||||
getAccessible(aFocusableContainerID) : this.target;
|
||||
|
||||
this.invoke = function setCaretOffsetInvoker_invoke()
|
||||
{
|
||||
this.target.caretOffset = aOffset;
|
||||
}
|
||||
|
||||
this.getID = function setCaretOffsetInvoker_getID()
|
||||
{
|
||||
return "Set caretOffset on " + prettyName(aID) + " at " + aOffset;
|
||||
}
|
||||
|
||||
this.eventSeq = [
|
||||
new caretMovedChecker(this.target, aOffset),
|
||||
new asyncInvokerChecker(EVENT_FOCUS, this.focus)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on/off the caret browsing mode.
|
||||
*/
|
||||
|
@ -81,9 +40,9 @@
|
|||
// test caret move events and caret offsets
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new setCaretOffsetInvoker("textbox", 1));
|
||||
gQueue.push(new setCaretOffsetInvoker("link", 1));
|
||||
gQueue.push(new setCaretOffsetInvoker("heading", 1, document));
|
||||
gQueue.push(new setCaretOffset("textbox", 1, "textbox"));
|
||||
gQueue.push(new setCaretOffset("link", 1, "link"));
|
||||
gQueue.push(new setCaretOffset("heading", 1, document));
|
||||
gQueue.onFinish = function()
|
||||
{
|
||||
turnCaretBrowsing(false);
|
|
@ -45,8 +45,6 @@ relativesrcdir = accessible/tree
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# test_tabbrowser.xul disabled for misusing <tabbrowser> (bug 715857)
|
||||
|
||||
_TEST_FILES =\
|
||||
dockids.html \
|
||||
$(warning test_applicationacc.xul temporarily disabled, see bug 561508) \
|
||||
|
@ -72,6 +70,7 @@ _TEST_FILES =\
|
|||
test_media.html \
|
||||
test_select.html \
|
||||
test_tabbox.xul \
|
||||
test_tabbrowser.xul \
|
||||
test_table.html \
|
||||
test_tree.xul \
|
||||
test_txtcntr.html \
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
|
||||
<!-- Firefox tabbrowser -->
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css"
|
||||
type="text/css"?>
|
||||
<!-- SeaMonkey tabbrowser -->
|
||||
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
|
||||
type="text/css"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
|
@ -17,7 +10,7 @@
|
|||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
|
@ -25,201 +18,186 @@
|
|||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
<script type="application/javascript"
|
||||
src="../browser.js"></script>
|
||||
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
// Hack to make xul:tabbrowser work.
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
var handleDroppedLink = null;
|
||||
var XULBrowserWindow = {
|
||||
isBusy: false,
|
||||
setOverLink: function (link, b) {}
|
||||
};
|
||||
var gFindBar = {
|
||||
hidden: true
|
||||
};
|
||||
|
||||
function doTest()
|
||||
// invoker
|
||||
function testTabHierarchy()
|
||||
{
|
||||
var tabBrowser = document.getElementById("tabbrowser");
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 0),
|
||||
new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
|
||||
];
|
||||
|
||||
// Load documents into tabs and wait for reorder events caused by these
|
||||
// documents load before we start the test.
|
||||
var docURIs = ["about:", "about:mozilla"];
|
||||
|
||||
var handler = {
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
var target = aEvent.accessible;
|
||||
if (target.role == ROLE_INTERNAL_FRAME &&
|
||||
target.parent.parent == getAccessible(this.tabBrowser.mTabBox.tabpanels)) {
|
||||
this.reorderCnt++;
|
||||
}
|
||||
|
||||
if (this.reorderCnt == docURIs.length) {
|
||||
unregisterA11yEventListener(EVENT_REORDER, this);
|
||||
testAccTree();
|
||||
}
|
||||
},
|
||||
|
||||
tabBrowser: tabBrowser,
|
||||
reorderCnt: 0
|
||||
};
|
||||
registerA11yEventListener(EVENT_REORDER, handler);
|
||||
|
||||
// Test XUL and HTML documents.
|
||||
tabBrowser.loadTabs(docURIs, false, true);
|
||||
}
|
||||
|
||||
function testAccTree()
|
||||
{
|
||||
var tabBrowser = document.getElementById("tabbrowser");
|
||||
|
||||
////////////////////
|
||||
// Tab bar
|
||||
////////////////////
|
||||
var tabsAccTree = {
|
||||
// xul:tabs
|
||||
role: ROLE_PAGETABLIST,
|
||||
children: [
|
||||
// Children depend on application (UI): see below.
|
||||
]
|
||||
};
|
||||
|
||||
// SeaMonkey and Firefox tabbrowser UIs differ.
|
||||
if ("restoreTab" in tabBrowser) {
|
||||
SimpleTest.ok(true, "Testing SeaMonkey tabbrowser UI.");
|
||||
|
||||
tabsAccTree.children.splice(0, 0,
|
||||
{
|
||||
// xul:toolbarbutton ("Open a new tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
// xul:tab ("about:")
|
||||
role: ROLE_PAGETAB,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
// tab ("about:mozilla")
|
||||
role: ROLE_PAGETAB,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
// xul:toolbarbutton ("List all tabs")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: [
|
||||
{
|
||||
// xul:menupopup
|
||||
role: ROLE_MENUPOPUP,
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// xul:toolbarbutton ("Close current tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
);
|
||||
} else {
|
||||
SimpleTest.ok(true, "Testing Firefox tabbrowser UI.");
|
||||
|
||||
// NB: The (3) buttons are not visible, unless manually hovered,
|
||||
// probably due to size reduction in this test.
|
||||
tabsAccTree.children.splice(0, 0,
|
||||
{
|
||||
// xul:tab ("about:")
|
||||
role: ROLE_PAGETAB,
|
||||
children: [
|
||||
{
|
||||
// xul:toolbarbutton ("Close Tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// tab ("about:mozilla")
|
||||
role: ROLE_PAGETAB,
|
||||
children: [
|
||||
{
|
||||
// xul:toolbarbutton ("Close Tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// xul:toolbarbutton ("Open a new tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
// "List all tabs" dropdown
|
||||
// XXX: This child(?) is not present in this test.
|
||||
// I'm not sure why (though probably expected).
|
||||
);
|
||||
this.invoke = function testTabHierarchy_invoke()
|
||||
{
|
||||
var docURIs = ["about:", "about:mozilla"];
|
||||
tabBrowser().loadTabs(docURIs, false, true);
|
||||
}
|
||||
|
||||
testAccessibleTree(tabBrowser.tabContainer, tabsAccTree);
|
||||
this.finalCheck = function testTabHierarchy_finalCheck(aEvent)
|
||||
{
|
||||
////////////////////
|
||||
// Tab bar
|
||||
////////////////////
|
||||
var tabsAccTree = {
|
||||
// xul:tabs
|
||||
role: ROLE_PAGETABLIST,
|
||||
children: [
|
||||
// Children depend on application (UI): see below.
|
||||
]
|
||||
};
|
||||
|
||||
////////////////////
|
||||
// Tab contents
|
||||
////////////////////
|
||||
var tabboxAccTree = {
|
||||
// xul:tabpanels
|
||||
role: ROLE_PANE,
|
||||
children: [
|
||||
{
|
||||
// xul:notificationbox
|
||||
role: ROLE_PROPERTYPAGE,
|
||||
children: [
|
||||
{
|
||||
// xul:browser
|
||||
role: ROLE_INTERNAL_FRAME,
|
||||
children: [
|
||||
{
|
||||
// #document ("about:")
|
||||
role: ROLE_DOCUMENT
|
||||
// children: [ ... ] // Ignore document content.
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// notificationbox
|
||||
role: ROLE_PROPERTYPAGE,
|
||||
children: [
|
||||
{
|
||||
// browser
|
||||
role: ROLE_INTERNAL_FRAME,
|
||||
children: [
|
||||
{
|
||||
// #document ("about:mozilla")
|
||||
role: ROLE_DOCUMENT
|
||||
// children: [ ... ] // Ignore document content.
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
// SeaMonkey and Firefox tabbrowser UIs differ.
|
||||
if ("restoreTab" in tabBrowser) {
|
||||
SimpleTest.ok(true, "Testing SeaMonkey tabbrowser UI.");
|
||||
|
||||
testAccessibleTree(tabBrowser.mTabBox.tabpanels, tabboxAccTree);
|
||||
tabsAccTree.children.splice(0, 0,
|
||||
{
|
||||
// xul:toolbarbutton ("Open a new tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
// xul:tab ("about:")
|
||||
role: ROLE_PAGETAB,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
// tab ("about:mozilla")
|
||||
role: ROLE_PAGETAB,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
// xul:toolbarbutton ("List all tabs")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: [
|
||||
{
|
||||
// xul:menupopup
|
||||
role: ROLE_MENUPOPUP,
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// xul:toolbarbutton ("Close current tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
);
|
||||
} else {
|
||||
SimpleTest.ok(true, "Testing Firefox tabbrowser UI.");
|
||||
|
||||
SimpleTest.finish();
|
||||
// NB: The (3) buttons are not visible, unless manually hovered,
|
||||
// probably due to size reduction in this test.
|
||||
tabsAccTree.children.splice(0, 0,
|
||||
{
|
||||
// xul:tab ("about:")
|
||||
role: ROLE_PAGETAB,
|
||||
children: [
|
||||
{
|
||||
// xul:toolbarbutton ("Close Tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// tab ("about:mozilla")
|
||||
role: ROLE_PAGETAB,
|
||||
children: [
|
||||
{
|
||||
// xul:toolbarbutton ("Close Tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// xul:toolbarbutton ("Open a new tab")
|
||||
role: ROLE_PUSHBUTTON,
|
||||
children: []
|
||||
}
|
||||
// "List all tabs" dropdown
|
||||
// XXX: This child(?) is not present in this test.
|
||||
// I'm not sure why (though probably expected).
|
||||
);
|
||||
}
|
||||
|
||||
testAccessibleTree(tabBrowser().tabContainer, tabsAccTree);
|
||||
|
||||
////////////////////
|
||||
// Tab contents
|
||||
////////////////////
|
||||
var tabboxAccTree = {
|
||||
// xul:tabpanels
|
||||
role: ROLE_PANE,
|
||||
children: [
|
||||
{
|
||||
// xul:notificationbox
|
||||
role: ROLE_PROPERTYPAGE,
|
||||
children: [
|
||||
{
|
||||
// xul:browser
|
||||
role: ROLE_INTERNAL_FRAME,
|
||||
children: [
|
||||
{
|
||||
// #document ("about:")
|
||||
role: ROLE_DOCUMENT
|
||||
// children: [ ... ] // Ignore document content.
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// notificationbox
|
||||
role: ROLE_PROPERTYPAGE,
|
||||
children: [
|
||||
{
|
||||
// browser
|
||||
role: ROLE_INTERNAL_FRAME,
|
||||
children: [
|
||||
{
|
||||
// #document ("about:mozilla")
|
||||
role: ROLE_DOCUMENT
|
||||
// children: [ ... ] // Ignore document content.
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
testAccessibleTree(tabBrowser().mTabBox.tabpanels, tabboxAccTree);
|
||||
}
|
||||
|
||||
this.getID = function testTabHierarchy_getID()
|
||||
{
|
||||
return "hierarchy of tabs";
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
var gQueue = null;
|
||||
function doTest()
|
||||
{
|
||||
// Load documents into tabs and wait for docLoadComplete events caused by these
|
||||
// documents load before we start the test.
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new testTabHierarchy());
|
||||
gQueue.onFinish = function() { closeBrowserWindow(); }
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
openBrowserWindow(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
@ -242,26 +220,7 @@
|
|||
</pre>
|
||||
</body>
|
||||
|
||||
<!-- Hack to make xul:tabbrowser work -->
|
||||
<menubar>
|
||||
<menu label="menu">
|
||||
<menupopup>
|
||||
<menuitem label="close window hook" id="menu_closeWindow"/>
|
||||
<menuitem label="close hook" id="menu_close"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<tabs id="tabbrowser-tabs" class="tabbrowser-tabs"
|
||||
tabbrowser="tabbrowser"
|
||||
setfocus="false">
|
||||
<tab class="tabbrowser-tab" selected="true" fadein="true"/>
|
||||
</tabs>
|
||||
<tabbrowser id="tabbrowser"
|
||||
type="content-primary"
|
||||
tabcontainer="tabbrowser-tabs"
|
||||
flex="1"/>
|
||||
<toolbar id="addon-bar"/>
|
||||
<vbox id="eventdump"></vbox>
|
||||
</vbox>
|
||||
|
||||
</window>
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
this.preinvoke = function rootContentRemoved_preinvoke()
|
||||
{
|
||||
// Set up target for hide event before we invoke.
|
||||
var text = getAccessible(getAccessible(getDocNode(aID)).firstChild,
|
||||
[nsIAccessNode]).DOMNode;
|
||||
var text =
|
||||
getAccessible(getAccessible(getDocNode(aID)).firstChild).DOMNode;
|
||||
this.eventSeq[0].target = text;
|
||||
}
|
||||
|
||||
|
|
|
@ -413,6 +413,10 @@ pref("dom.sms.whitelist", "file://,http://localhost:6666");
|
|||
// Ignore X-Frame-Options headers.
|
||||
pref("b2g.ignoreXFrameOptions", true);
|
||||
|
||||
// controls if we want camera support
|
||||
pref("device.camera.enabled", true);
|
||||
pref("media.realtime_decoder.enabled", true);
|
||||
|
||||
// "Preview" landing of bug 710563, which is bogged down in analysis
|
||||
// of talos regression. This is a needed change for higher-framerate
|
||||
// CSS animations, and incidentally works around an apparent bug in
|
||||
|
|
|
@ -79,9 +79,10 @@ function startupHttpd(baseDir, port) {
|
|||
// FIXME Bug 707625
|
||||
// until we have a proper security model, add some rights to
|
||||
// the pre-installed web applications
|
||||
// XXX never grant 'content-camera' to non-gaia apps
|
||||
function addPermissions(urls) {
|
||||
let permissions = [
|
||||
'indexedDB', 'indexedDB-unlimited', 'webapps-manage', 'offline-app'
|
||||
'indexedDB', 'indexedDB-unlimited', 'webapps-manage', 'offline-app', 'content-camera'
|
||||
];
|
||||
urls.forEach(function(url) {
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
|
@ -133,6 +134,7 @@ var shell = {
|
|||
window.controllers.appendController(this);
|
||||
window.addEventListener('keypress', this);
|
||||
window.addEventListener('MozApplicationManifest', this);
|
||||
window.addEventListener("AppCommand", this);
|
||||
this.contentBrowser.addEventListener('load', this, true);
|
||||
|
||||
try {
|
||||
|
@ -224,6 +226,13 @@ var shell = {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case 'AppCommand':
|
||||
switch (evt.command) {
|
||||
case 'Menu':
|
||||
this.sendEvent(content, 'menu');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'load':
|
||||
this.contentBrowser.removeEventListener('load', this, true);
|
||||
this.turnScreenOn();
|
||||
|
|
|
@ -56,9 +56,6 @@ XPCOMUtils.defineLazyGetter(Services, 'fm', function() {
|
|||
|
||||
onLocationChange: function onLocationChange(progress, request,
|
||||
locationURI, flags) {
|
||||
if (locationURI.spec.indexOf('/apps/') == -1)
|
||||
return;
|
||||
|
||||
content.addEventListener('appwillopen', function(evt) {
|
||||
let appManager = content.wrappedJSObject.Gaia.AppManager;
|
||||
let topWindow = appManager.foregroundWindow.contentWindow;
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
# Scrollbars
|
||||
category agent-style-sheets browser-content-stylesheet chrome://browser/content/content.css
|
||||
|
||||
# CameraContent.js
|
||||
component {eff4231b-abce-4f7f-a40a-d646e8fde3ce} CameraContent.js
|
||||
contract @mozilla.org/b2g-camera-content;1 {eff4231b-abce-4f7f-a40a-d646e8fde3ce}
|
||||
category JavaScript-navigator-property mozCamera @mozilla.org/b2g-camera-content;1
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const kProtocolName = "b2g-camera:";
|
||||
|
||||
let CameraContent = function() {
|
||||
this.hasPrivileges = false;
|
||||
this.mapping = [];
|
||||
}
|
||||
|
||||
CameraContent.prototype = {
|
||||
getCameraURI: function(aOptions) {
|
||||
if (!this.hasPrivileges)
|
||||
return null;
|
||||
|
||||
let options = aOptions || { };
|
||||
if (!options.camera)
|
||||
options.camera = 0;
|
||||
if (!options.width)
|
||||
options.width = 320;
|
||||
if (!options.height)
|
||||
options.height = 240;
|
||||
|
||||
let uuid = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID().toString();
|
||||
uuid = uuid.substring(1, uuid.length - 2); // remove the brackets
|
||||
this.mapping.push(uuid);
|
||||
let uri = kProtocolName + "?camera=" + options.camera +
|
||||
"&width=" + options.width +
|
||||
"&height=" + options.height +
|
||||
"&type=video/x-raw-yuv";
|
||||
// XXX that's no e10s ready, but the camera inputstream itself is not...
|
||||
Services.prefs.setCharPref("b2g.camera." + kProtocolName + "?" + uuid, uri);
|
||||
return kProtocolName + "?" + uuid;
|
||||
},
|
||||
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "inner-window-destroyed") {
|
||||
let wId = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;
|
||||
if (wId == this.innerWindowID) {
|
||||
Services.obs.removeObserver(this, "inner-window-destroyed");
|
||||
for (let aId in this.mapping)
|
||||
Services.prefs.clearUserPref("b2g.camera." + kProtocolName + "?" + aId);
|
||||
this.mapping = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
init: function(aWindow) {
|
||||
let principal = aWindow.document.nodePrincipal;
|
||||
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
|
||||
|
||||
let perm = principal == secMan.getSystemPrincipal() ? Ci.nsIPermissionManager.ALLOW_ACTION : Services.perms.testExactPermission(principal.URI, "content-camera");
|
||||
|
||||
//only pages with perm set and chrome pages can use the camera in content
|
||||
this.hasPrivileges = perm == Ci.nsIPermissionManager.ALLOW_ACTION || from.schemeIs("chrome");
|
||||
|
||||
Services.obs.addObserver(this, "inner-window-destroyed", false);
|
||||
let util = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
||||
this.innerWindowID = util.currentInnerWindowID;
|
||||
},
|
||||
|
||||
classID: Components.ID("{eff4231b-abce-4f7f-a40a-d646e8fde3ce}"),
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIB2GCameraContent, Ci.nsIDOMGlobalPropertyInitializer, Ci.nsIObserver]),
|
||||
|
||||
classInfo: XPCOMUtils.generateCI({classID: Components.ID("{eff4231b-abce-4f7f-a40a-d646e8fde3ce}"),
|
||||
contractID: "@mozilla.org/b2g-camera-content;1",
|
||||
interfaces: [Ci.nsIB2GCameraContent],
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
classDescription: "B2G Camera Content Helper"})
|
||||
}
|
||||
|
||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([CameraContent]);
|
|
@ -44,8 +44,13 @@ include $(DEPTH)/config/autoconf.mk
|
|||
MODULE = B2GComponents
|
||||
XPIDL_MODULE = B2GComponents
|
||||
|
||||
XPIDLSRCS = \
|
||||
b2g.idl \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_PP_COMPONENTS = \
|
||||
B2GComponents.manifest \
|
||||
CameraContent.js \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(3615a616-571d-4194-bf54-ccf546067b14)]
|
||||
interface nsIB2GCameraContent : nsISupports
|
||||
{
|
||||
/* temporary solution, waiting for getUserMedia */
|
||||
DOMString getCameraURI([optional] in jsval options);
|
||||
};
|
|
@ -603,3 +603,4 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
|||
@BINPATH@/chrome/chrome.manifest
|
||||
@BINPATH@/components/B2GComponents.manifest
|
||||
@BINPATH@/components/B2GComponents.xpt
|
||||
@BINPATH@/components/CameraContent.js
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1327685994000">
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1328289666000">
|
||||
<emItems>
|
||||
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1">
|
||||
</versionRange>
|
||||
|
@ -43,8 +47,10 @@
|
|||
<versionRange minVersion="0.1" maxVersion="14.4.0" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i53" id="{a3a5c777-f583-4fef-9380-ab4add1bc2a8}">
|
||||
<versionRange minVersion="2.0.3" maxVersion="2.0.3">
|
||||
<emItem blockID="i61" id="youtube@youtube3.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i10" id="{8CE11043-9A15-4207-A565-0C94C42D590D}">
|
||||
|
@ -85,6 +91,14 @@
|
|||
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i53" id="{a3a5c777-f583-4fef-9380-ab4add1bc2a8}">
|
||||
<versionRange minVersion="2.0.3" maxVersion="2.0.3">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i59" id="ghostviewer@youtube2.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i51" id="admin@youtubeplayer.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
|
@ -96,19 +110,25 @@
|
|||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i23" id="firefox@bandoo.com">
|
||||
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
<emItem blockID="i60" id="youtb3@youtb3.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i56" id="flash@adobe.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i55" id="youtube@youtube7.com">
|
||||
<versionRange minVersion="0" maxVersion="*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i47" id="youtube@youtube2.com">
|
||||
</emItem>
|
||||
<emItem blockID="i11" id="yslow@yahoo-inc.com">
|
||||
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.5.7" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i22" id="ShopperReports@ShopperReports.com">
|
||||
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0">
|
||||
</versionRange>
|
||||
|
@ -140,17 +160,19 @@
|
|||
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i11" id="yslow@yahoo-inc.com">
|
||||
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.5.7" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i47" id="youtube@youtube2.com">
|
||||
</emItem>
|
||||
<emItem blockID="i17" id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
|
||||
<versionRange minVersion="2.2" maxVersion="2.2">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i23" id="firefox@bandoo.com">
|
||||
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i45" id="{22119944-ED35-4ab1-910B-E619EA06A115}">
|
||||
<versionRange minVersion="0.1" maxVersion="7.6.1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
|
|
|
@ -1031,6 +1031,12 @@ pref("devtools.errorconsole.enabled", false);
|
|||
pref("devtools.inspector.enabled", true);
|
||||
pref("devtools.inspector.htmlHeight", 112);
|
||||
|
||||
// Enable the Debugger
|
||||
pref("devtools.debugger.enabled", false);
|
||||
|
||||
// The default Debugger UI height
|
||||
pref("devtools.debugger.ui.height", 250);
|
||||
|
||||
// Enable the style inspector
|
||||
pref("devtools.styleinspector.enabled", true);
|
||||
|
||||
|
@ -1094,12 +1100,9 @@ pref("devtools.editor.expandtab", true);
|
|||
// Tells which component you want to use for source editing in developer tools.
|
||||
//
|
||||
// Available components:
|
||||
// "textarea" - this is a basic text editor, like an HTML <textarea>.
|
||||
//
|
||||
// "orion" - this is the Orion source code editor from the Eclipse project. It
|
||||
// provides programmer-specific editor features such as syntax highlighting,
|
||||
// indenting and bracket recognition. It may not be appropriate for all
|
||||
// locales (esp. RTL) or a11y situations.
|
||||
// indenting and bracket recognition.
|
||||
pref("devtools.editor.component", "orion");
|
||||
|
||||
// Whether the character encoding menu is under the main Firefox button. This
|
||||
|
@ -1119,3 +1122,8 @@ pref("browser.newtabpage.enabled", true);
|
|||
|
||||
// Enable the DOM full-screen API.
|
||||
pref("full-screen-api.enabled", true);
|
||||
|
||||
// Startup Crash Tracking
|
||||
// number of startup crashes that can occur before starting into safe mode automatically
|
||||
// (this pref has no effect if more than 6 hours have passed since the last crash)
|
||||
pref("toolkit.startup.max_resumed_crashes", 2);
|
||||
|
|
|
@ -49,9 +49,7 @@ abs_srcdir = $(call core_abspath,$(srcdir))
|
|||
|
||||
CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += content/test
|
||||
endif
|
||||
TEST_DIRS += content/test
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -265,17 +265,17 @@ appUpdater.prototype =
|
|||
if (cancelQuit.data)
|
||||
return;
|
||||
|
||||
let appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].
|
||||
getService(Components.interfaces.nsIAppStartup);
|
||||
|
||||
// If already in safe mode restart in safe mode (bug 327119)
|
||||
if (Services.appinfo.inSafeMode) {
|
||||
let env = Components.classes["@mozilla.org/process/environment;1"].
|
||||
getService(Components.interfaces.nsIEnvironment);
|
||||
env.set("MOZ_SAFE_MODE_RESTART", "1");
|
||||
appStartup.restartInSafeMode(Components.interfaces.nsIAppStartup.eAttemptQuit);
|
||||
return;
|
||||
}
|
||||
|
||||
Components.classes["@mozilla.org/toolkit/app-startup;1"].
|
||||
getService(Components.interfaces.nsIAppStartup).
|
||||
quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
|
||||
Components.interfaces.nsIAppStartup.eRestart);
|
||||
appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
|
||||
Components.interfaces.nsIAppStartup.eRestart);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -189,6 +189,11 @@
|
|||
type="checkbox"
|
||||
command="Tools:Inspect"
|
||||
key="key_inspect"/>
|
||||
<menuitem id="appmenu_debugger"
|
||||
hidden="true"
|
||||
label="&debuggerMenu.label;"
|
||||
key="key_debugger"
|
||||
command="Tools:Debugger"/>
|
||||
<menuitem id="appmenu_scratchpad"
|
||||
hidden="true"
|
||||
label="&scratchpad.label;"
|
||||
|
|
|
@ -19,5 +19,7 @@
|
|||
#endif
|
||||
<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
|
||||
%aboutHomeDTD;
|
||||
<!ENTITY % debuggerDTD SYSTEM "chrome://browser/locale/devtools/debugger.dtd">
|
||||
%debuggerDTD;
|
||||
]>
|
||||
|
||||
|
|
|
@ -546,6 +546,11 @@
|
|||
accesskey="&inspectMenu.accesskey;"
|
||||
key="key_inspect"
|
||||
command="Tools:Inspect"/>
|
||||
<menuitem id="menu_debugger"
|
||||
hidden="true"
|
||||
label="&debuggerMenu.label;"
|
||||
key="key_debugger"
|
||||
command="Tools:Debugger"/>
|
||||
<menuitem id="menu_scratchpad"
|
||||
hidden="true"
|
||||
label="&scratchpad.label;"
|
||||
|
|
|
@ -127,6 +127,7 @@
|
|||
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
|
||||
<command id="Tools:WebConsole" oncommand="HUDConsoleUI.toggleHUD();"/>
|
||||
<command id="Tools:Inspect" oncommand="InspectorUI.toggleInspectorUI();" disabled="true"/>
|
||||
<command id="Tools:Debugger" oncommand="DebuggerUI.toggleDebugger();" disabled="true"/>
|
||||
<command id="Tools:Scratchpad" oncommand="Scratchpad.openScratchpad();" disabled="true"/>
|
||||
<command id="Tools:StyleEditor" oncommand="StyleEditor.openChrome();" disabled="true"/>
|
||||
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
|
||||
|
@ -250,6 +251,13 @@
|
|||
modifiers="accel,alt"
|
||||
#else
|
||||
modifiers="accel,shift"
|
||||
#endif
|
||||
/>
|
||||
<key id="key_debugger" key="&debuggerMenu.commandkey;" command="Tools:Debugger"
|
||||
#ifdef XP_MACOSX
|
||||
modifiers="accel,alt"
|
||||
#else
|
||||
modifiers="accel,shift"
|
||||
#endif
|
||||
/>
|
||||
<key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect"
|
||||
|
|
|
@ -86,7 +86,8 @@ var gLastValidURLStr = "";
|
|||
var gInPrintPreviewMode = false;
|
||||
var gDownloadMgr = null;
|
||||
var gContextMenu = null; // nsContextMenu instance
|
||||
var gDelayedStartupTimeoutId;
|
||||
var gDelayedStartupTimeoutId; // used for non-browser-windows
|
||||
var gFirstPaintListener = null;
|
||||
var gStartupRan = false;
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
|
@ -137,8 +138,9 @@ __defineGetter__("gPrefService", function() {
|
|||
});
|
||||
|
||||
__defineGetter__("AddonManager", function() {
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
return this.AddonManager;
|
||||
let tmp = {};
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
|
||||
return this.AddonManager = tmp.AddonManager;
|
||||
});
|
||||
__defineSetter__("AddonManager", function (val) {
|
||||
delete this.AddonManager;
|
||||
|
@ -180,6 +182,12 @@ XPCOMUtils.defineLazyGetter(this, "InspectorUI", function() {
|
|||
return new tmp.InspectorUI(window);
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "DebuggerUI", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource:///modules/devtools/DebuggerUI.jsm", tmp);
|
||||
return new tmp.DebuggerUI(window);
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "Tilt", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource:///modules/devtools/Tilt.jsm", tmp);
|
||||
|
@ -1376,7 +1384,18 @@ function BrowserStartup() {
|
|||
|
||||
retrieveToolbarIconsizesFromTheme();
|
||||
|
||||
gDelayedStartupTimeoutId = setTimeout(delayedStartup, 0, isLoadingBlank, mustLoadSidebar);
|
||||
// Listen for the first paint event for this window, and only do non-critical
|
||||
// work then, so that things like session restore don't block the window from
|
||||
// being visible.
|
||||
gFirstPaintListener = function(e) {
|
||||
if (e.target == window) {
|
||||
window.removeEventListener("MozAfterPaint", gFirstPaintListener, false);
|
||||
gFirstPaintListener = null;
|
||||
delayedStartup(isLoadingBlank, mustLoadSidebar);
|
||||
}
|
||||
};
|
||||
window.addEventListener("MozAfterPaint", gFirstPaintListener, false);
|
||||
|
||||
gStartupRan = true;
|
||||
}
|
||||
|
||||
|
@ -1503,9 +1522,10 @@ function prepareForStartup() {
|
|||
}
|
||||
|
||||
function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
||||
Cu.import("resource:///modules/TelemetryTimestamps.jsm");
|
||||
let tmp = {};
|
||||
Cu.import("resource:///modules/TelemetryTimestamps.jsm", tmp);
|
||||
let TelemetryTimestamps = tmp.TelemetryTimestamps;
|
||||
TelemetryTimestamps.add("delayedStartupStarted");
|
||||
gDelayedStartupTimeoutId = null;
|
||||
|
||||
Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history", false);
|
||||
Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled", false);
|
||||
|
@ -1726,6 +1746,16 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
#endif
|
||||
}
|
||||
|
||||
// Enable Debugger?
|
||||
let enabled = gPrefService.getBoolPref("devtools.debugger.enabled");
|
||||
if (enabled) {
|
||||
document.getElementById("menu_debugger").hidden = false;
|
||||
document.getElementById("Tools:Debugger").removeAttribute("disabled");
|
||||
#ifdef MENUBAR_CAN_AUTOHIDE
|
||||
document.getElementById("appmenu_debugger").hidden = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Enable Error Console?
|
||||
// XXX Temporarily always-enabled, see bug 601201
|
||||
let consoleEnabled = true || gPrefService.getBoolPref("devtools.errorconsole.enabled");
|
||||
|
@ -1766,9 +1796,37 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
document.getElementById("appmenu_charsetMenu").hidden = true;
|
||||
#endif
|
||||
|
||||
let appMenuButton = document.getElementById("appmenu-button");
|
||||
let appMenuPopup = document.getElementById("appmenu-popup");
|
||||
if (appMenuButton && appMenuPopup) {
|
||||
let appMenuOpening = null;
|
||||
appMenuButton.addEventListener("mousedown", function(event) {
|
||||
if (event.button == 0)
|
||||
appMenuOpening = new Date();
|
||||
}, false);
|
||||
appMenuPopup.addEventListener("popupshown", function(event) {
|
||||
if (event.target != appMenuPopup || !appMenuOpening)
|
||||
return;
|
||||
let duration = new Date() - appMenuOpening;
|
||||
appMenuOpening = null;
|
||||
Services.telemetry.getHistogramById("FX_APP_MENU_OPEN_MS").add(duration);
|
||||
}, false);
|
||||
}
|
||||
|
||||
window.addEventListener("mousemove", MousePosTracker, false);
|
||||
window.addEventListener("dragover", MousePosTracker, false);
|
||||
|
||||
// End startup crash tracking after a delay to catch crashes while restoring
|
||||
// tabs and to postpone saving the pref to disk.
|
||||
try {
|
||||
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
|
||||
getService(Ci.nsIAppStartup);
|
||||
const startupCrashEndDelay = 30 * 1000;
|
||||
setTimeout(appStartup.trackStartupCrashEnd, startupCrashEndDelay);
|
||||
} catch (ex) {
|
||||
Cu.reportError("Could not end startup crash tracking: " + ex);
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
|
||||
TelemetryTimestamps.add("delayedStartupFinished");
|
||||
}
|
||||
|
@ -1820,8 +1878,9 @@ function BrowserShutdown() {
|
|||
|
||||
// Now either cancel delayedStartup, or clean up the services initialized from
|
||||
// it.
|
||||
if (gDelayedStartupTimeoutId) {
|
||||
clearTimeout(gDelayedStartupTimeoutId);
|
||||
if (gFirstPaintListener) {
|
||||
window.removeEventListener("MozAfterPaint", gFirstPaintListener, false);
|
||||
gFirstPaintListener = null;
|
||||
} else {
|
||||
if (Win7Features)
|
||||
Win7Features.onCloseWindow();
|
||||
|
@ -3136,13 +3195,17 @@ var browserDragAndDrop = {
|
|||
}
|
||||
},
|
||||
|
||||
drop: function (aEvent, aName) Services.droppedLinkHandler.dropLink(aEvent, aName)
|
||||
drop: function (aEvent, aName, aDisallowInherit) {
|
||||
return Services.droppedLinkHandler.dropLink(aEvent, aName, aDisallowInherit);
|
||||
}
|
||||
};
|
||||
|
||||
var homeButtonObserver = {
|
||||
onDrop: function (aEvent)
|
||||
{
|
||||
setTimeout(openHomeDialog, 0, browserDragAndDrop.drop(aEvent, { }));
|
||||
// disallow setting home pages that inherit the principal
|
||||
let url = browserDragAndDrop.drop(aEvent, {}, true);
|
||||
setTimeout(openHomeDialog, 0, url);
|
||||
},
|
||||
|
||||
onDragOver: function (aEvent)
|
||||
|
@ -5983,7 +6046,7 @@ function MultiplexHandler(event)
|
|||
} else if (name == 'charsetCustomize') {
|
||||
//do nothing - please remove this else statement, once the charset prefs moves to the pref window
|
||||
} else {
|
||||
SetForcedCharset(node.getAttribute('id'));
|
||||
BrowserSetForcedCharacterSet(node.getAttribute('id'));
|
||||
}
|
||||
} catch(ex) { alert(ex); }
|
||||
}
|
||||
|
@ -8159,11 +8222,13 @@ var gIdentityHandler = {
|
|||
this._identityPopup.hidePopup();
|
||||
},
|
||||
|
||||
_popupOpenTime : null,
|
||||
|
||||
/**
|
||||
* Click handler for the identity-box element in primary chrome.
|
||||
*/
|
||||
handleIdentityButtonEvent : function(event) {
|
||||
|
||||
this._popupOpenTime = new Date();
|
||||
event.stopPropagation();
|
||||
|
||||
if ((event.type == "click" && event.button != 0) ||
|
||||
|
@ -8200,6 +8265,17 @@ var gIdentityHandler = {
|
|||
this._identityPopup.openPopup(this._identityBox, "bottomcenter topleft");
|
||||
},
|
||||
|
||||
onPopupShown : function(event) {
|
||||
let openingDuration = new Date() - this._popupOpenTime;
|
||||
this._popupOpenTime = null;
|
||||
try {
|
||||
Services.telemetry.getHistogramById("FX_IDENTITY_POPUP_OPEN_MS").add(openingDuration);
|
||||
} catch (ex) {
|
||||
Components.utils.reportError("Unable to report telemetry for FX_IDENTITY_POPUP_OPEN_MS.");
|
||||
}
|
||||
document.getElementById('identity-popup-more-info-button').focus();
|
||||
},
|
||||
|
||||
onDragStart: function (event) {
|
||||
if (gURLBar.getAttribute("pageproxystate") != "valid")
|
||||
return;
|
||||
|
@ -8940,10 +9016,9 @@ function safeModeRestart()
|
|||
buttonFlags, restartText, null, null,
|
||||
null, {});
|
||||
if (rv == 0) {
|
||||
let environment = Components.classes["@mozilla.org/process/environment;1"].
|
||||
getService(Components.interfaces.nsIEnvironment);
|
||||
environment.set("MOZ_SAFE_MODE_RESTART", "1");
|
||||
Application.restart();
|
||||
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
|
||||
getService(Ci.nsIAppStartup);
|
||||
appStartup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@
|
|||
type="arrow"
|
||||
hidden="true"
|
||||
noautofocus="true"
|
||||
onpopupshown="document.getElementById('identity-popup-more-info-button').focus();"
|
||||
onpopupshown="gIdentityHandler.onPopupShown(event);"
|
||||
level="top">
|
||||
<hbox id="identity-popup-container" align="top">
|
||||
<image id="identity-popup-icon"/>
|
||||
|
@ -850,11 +850,6 @@
|
|||
label="&printButton.label;" command="cmd_print"
|
||||
tooltiptext="&printButton.tooltip;"/>
|
||||
|
||||
<toolbaritem id="navigator-throbber" title="&throbberItem.title;" align="center" pack="center"
|
||||
mousethrough="always">
|
||||
<image/>
|
||||
</toolbaritem>
|
||||
|
||||
<toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
observes="Tools:Downloads"
|
||||
ondrop="DownloadsButtonDNDObserver.onDrop(event)"
|
||||
|
@ -885,21 +880,6 @@
|
|||
ondragenter="newWindowButtonObserver.onDragOver(event)"
|
||||
ondragexit="newWindowButtonObserver.onDragExit(event)"/>
|
||||
|
||||
<toolbarbutton id="cut-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&cutCmd.label;"
|
||||
command="cmd_cut"
|
||||
tooltiptext="&cutButton.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="copy-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="©Cmd.label;"
|
||||
command="cmd_copy"
|
||||
tooltiptext="©Button.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="paste-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&pasteCmd.label;"
|
||||
command="cmd_paste"
|
||||
tooltiptext="&pasteButton.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
observes="View:FullScreen"
|
||||
type="checkbox"
|
||||
|
@ -917,12 +897,7 @@
|
|||
command="cmd_fullZoomEnlarge"
|
||||
tooltiptext="&zoomInButton.tooltip;"/>
|
||||
</toolbaritem>
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
<toolbarbutton id="sync-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&syncToolbarButton.label;"
|
||||
oncommand="gSyncUI.handleToolbarButton()"/>
|
||||
#endif
|
||||
|
||||
<toolbarbutton id="feed-button"
|
||||
type="menu"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
|
@ -937,6 +912,33 @@
|
|||
onclick="checkForMiddleClick(this, event);"/>
|
||||
</toolbarbutton>
|
||||
|
||||
<toolbarbutton id="cut-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&cutCmd.label;"
|
||||
command="cmd_cut"
|
||||
tooltiptext="&cutButton.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="copy-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="©Cmd.label;"
|
||||
command="cmd_copy"
|
||||
tooltiptext="©Button.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="paste-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&pasteCmd.label;"
|
||||
command="cmd_paste"
|
||||
tooltiptext="&pasteButton.tooltip;"/>
|
||||
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
<toolbarbutton id="sync-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&syncToolbarButton.label;"
|
||||
oncommand="gSyncUI.handleToolbarButton()"/>
|
||||
#endif
|
||||
|
||||
<toolbaritem id="navigator-throbber" title="&throbberItem.title;" align="center" pack="center"
|
||||
mousethrough="always">
|
||||
<image/>
|
||||
</toolbaritem>
|
||||
|
||||
<toolbarbutton id="tabview-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&tabGroupsButton.label;"
|
||||
command="Browser:ToggleTabView"
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
#highlighter-nodeinfobar-container {
|
||||
position: absolute;
|
||||
max-width: 95%;
|
||||
}
|
||||
|
||||
#highlighter-nodeinfobar-container:not([disable-transitions]) {
|
||||
|
@ -60,15 +61,17 @@
|
|||
display: block;
|
||||
white-space: nowrap;
|
||||
direction: ltr;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#highlighter-nodeinfobar-container[locked] > #highlighter-nodeinfobar {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
#highlighter-nodeinfobar-id,
|
||||
.highlighter-nodeinfobar-class,
|
||||
#highlighter-nodeinfobar-tagname {
|
||||
html|*#highlighter-nodeinfobar-id,
|
||||
html|*#highlighter-nodeinfobar-classes,
|
||||
html|*#highlighter-nodeinfobar-tagname {
|
||||
-moz-user-select: text;
|
||||
cursor: text;
|
||||
}
|
||||
|
@ -89,10 +92,6 @@
|
|||
visibility: hidden;
|
||||
}
|
||||
|
||||
#highlighter-nodeinfobar-id:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#highlighter-nodeinfobar-tagname {
|
||||
html|*#highlighter-nodeinfobar-tagname {
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
|
|
@ -45,3 +45,6 @@ const THUMB_HEIGHT = 127;
|
|||
#include dropTargetShim.js
|
||||
#include dropPreview.js
|
||||
#include updater.js
|
||||
|
||||
// Everything is loaded. Initialize the New Tab Page.
|
||||
gPage.init("#toolbar", "#grid");
|
||||
|
|
|
@ -33,10 +33,8 @@
|
|||
<li class="cell"/><li class="cell"/><li class="cell"/>
|
||||
</ul>
|
||||
|
||||
<xul:script type="text/javascript;version=1.8" src="chrome://browser/content/newtab/newTab.js"/>
|
||||
<xul:script type="text/javascript;version=1.8">
|
||||
gPage.init("#toolbar", "#grid");
|
||||
</xul:script>
|
||||
<xul:script type="text/javascript;version=1.8"
|
||||
src="chrome://browser/content/newtab/newTab.js"/>
|
||||
</body>
|
||||
</xul:vbox>
|
||||
</xul:window>
|
||||
|
|
|
@ -22,8 +22,8 @@ let gPage = {
|
|||
gAllPages.register(this);
|
||||
|
||||
// Listen for 'unload' to unregister this page.
|
||||
function unload() gAllPages.unregister(self);
|
||||
addEventListener("unload", unload, false);
|
||||
function unload() { gAllPages.unregister(this); }
|
||||
addEventListener("unload", unload.bind(this), false);
|
||||
|
||||
// Check if the new tab feature is enabled.
|
||||
if (gAllPages.enabled)
|
||||
|
@ -87,10 +87,11 @@ let gPage = {
|
|||
// Initialize the drop target shim.
|
||||
gDropTargetShim.init();
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// Workaround to prevent a delay on MacOSX due to a slow drop animation.
|
||||
let doc = document.documentElement;
|
||||
doc.addEventListener("dragover", this.onDragOver, false);
|
||||
doc.addEventListener("drop", this.onDrop, false);
|
||||
document.addEventListener("dragover", this.onDragOver, false);
|
||||
document.addEventListener("drop", this.onDrop, false);
|
||||
#endif
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
@ -155,7 +156,7 @@ let gPage = {
|
|||
* @param aEvent The 'dragover' event.
|
||||
*/
|
||||
onDragOver: function Page_onDragOver(aEvent) {
|
||||
if (gDrag.isValid(aEvent))
|
||||
if (gDrag.isValid(aEvent) && gDrag.draggedSite)
|
||||
aEvent.preventDefault();
|
||||
},
|
||||
|
||||
|
@ -165,7 +166,7 @@ let gPage = {
|
|||
* @param aEvent The 'drop' event.
|
||||
*/
|
||||
onDrop: function Page_onDrop(aEvent) {
|
||||
if (gDrag.isValid(aEvent)) {
|
||||
if (gDrag.isValid(aEvent) && gDrag.draggedSite) {
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
|
|
|
@ -331,16 +331,17 @@ nsContextMenu.prototype = {
|
|||
initSpellingItems: function() {
|
||||
var canSpell = InlineSpellCheckerUI.canSpellCheck;
|
||||
var onMisspelling = InlineSpellCheckerUI.overMisspelling;
|
||||
var showUndo = canSpell && InlineSpellCheckerUI.canUndo();
|
||||
this.showItem("spell-check-enabled", canSpell);
|
||||
this.showItem("spell-separator", canSpell || this.onEditableArea);
|
||||
document.getElementById("spell-check-enabled")
|
||||
.setAttribute("checked", canSpell && InlineSpellCheckerUI.enabled);
|
||||
|
||||
this.showItem("spell-add-to-dictionary", onMisspelling);
|
||||
this.showItem("spell-undo-add-to-dictionary", InlineSpellCheckerUI.canUndo());
|
||||
this.showItem("spell-undo-add-to-dictionary", showUndo);
|
||||
|
||||
// suggestion list
|
||||
this.showItem("spell-suggestions-separator", onMisspelling);
|
||||
this.showItem("spell-suggestions-separator", onMisspelling || showUndo);
|
||||
if (onMisspelling) {
|
||||
var suggestionsSeparator =
|
||||
document.getElementById("spell-add-to-dictionary");
|
||||
|
|
|
@ -341,6 +341,9 @@ function onLoadPageInfo()
|
|||
gStrings.notSet = gBundle.getString("notset");
|
||||
gStrings.mediaImg = gBundle.getString("mediaImg");
|
||||
gStrings.mediaBGImg = gBundle.getString("mediaBGImg");
|
||||
gStrings.mediaBorderImg = gBundle.getString("mediaBorderImg");
|
||||
gStrings.mediaListImg = gBundle.getString("mediaListImg");
|
||||
gStrings.mediaCursor = gBundle.getString("mediaCursor");
|
||||
gStrings.mediaObject = gBundle.getString("mediaObject");
|
||||
gStrings.mediaEmbed = gBundle.getString("mediaEmbed");
|
||||
gStrings.mediaLink = gBundle.getString("mediaLink");
|
||||
|
@ -663,13 +666,35 @@ function addImage(url, type, alt, elem, isBg)
|
|||
|
||||
function grabAll(elem)
|
||||
{
|
||||
// check for background images, any node may have multiple
|
||||
// check for images defined in CSS (e.g. background, borders), any node may have multiple
|
||||
var computedStyle = elem.ownerDocument.defaultView.getComputedStyle(elem, "");
|
||||
|
||||
if (computedStyle) {
|
||||
Array.forEach(computedStyle.getPropertyCSSValue("background-image"), function (url) {
|
||||
if (url.primitiveType == CSSPrimitiveValue.CSS_URI)
|
||||
addImage(url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true);
|
||||
});
|
||||
var addImgFunc = function (label, val) {
|
||||
if (val.primitiveType == CSSPrimitiveValue.CSS_URI) {
|
||||
addImage(val.getStringValue(), label, gStrings.notSet, elem, true);
|
||||
}
|
||||
else if (val.primitiveType == CSSPrimitiveValue.CSS_STRING) {
|
||||
// This is for -moz-image-rect.
|
||||
// TODO: Reimplement once bug 714757 is fixed
|
||||
var strVal = val.getStringValue();
|
||||
if (strVal.search(/^.*url\(\"?/) > -1) {
|
||||
url = strVal.replace(/^.*url\(\"?/,"").replace(/\"?\).*$/,"");
|
||||
addImage(url, label, gStrings.notSet, elem, true);
|
||||
}
|
||||
}
|
||||
else if (val.cssValueType == CSSValue.CSS_VALUE_LIST) {
|
||||
// recursively resolve multiple nested CSS value lists
|
||||
for (var i = 0; i < val.length; i++)
|
||||
addImgFunc(label, val.item(i));
|
||||
}
|
||||
};
|
||||
|
||||
addImgFunc(gStrings.mediaBGImg, computedStyle.getPropertyCSSValue("background-image"));
|
||||
addImgFunc(gStrings.mediaBorderImg, computedStyle.getPropertyCSSValue("-moz-border-image-source"));
|
||||
// TODO: support unprefixed "border-image" once bug 713643 is fixed.
|
||||
addImgFunc(gStrings.mediaListImg, computedStyle.getPropertyCSSValue("list-style-image"));
|
||||
addImgFunc(gStrings.mediaCursor, computedStyle.getPropertyCSSValue("cursor"));
|
||||
}
|
||||
|
||||
// one swi^H^H^Hif-else to rule them all
|
||||
|
|
|
@ -138,6 +138,14 @@ function onCancel() {
|
|||
}
|
||||
|
||||
function onLoad() {
|
||||
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
|
||||
.getService(Components.interfaces.nsIAppStartup);
|
||||
|
||||
if (appStartup.automaticSafeModeNecessary) {
|
||||
document.getElementById("autoSafeMode").hidden = false;
|
||||
document.getElementById("manualSafeMode").hidden = true;
|
||||
}
|
||||
|
||||
document.getElementById("tasks")
|
||||
.addEventListener("CheckboxStateChange", UpdateOKButtonState, false);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,12 @@
|
|||
|
||||
<stringbundle id="preferencesBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
|
||||
|
||||
<description>&safeModeDescription.label;</description>
|
||||
<vbox id="autoSafeMode" hidden="true">
|
||||
<label class="header plain" value="&autoSafeModeIntro.label;"/>
|
||||
<description>&autoSafeModeDescription.label;</description>
|
||||
</vbox>
|
||||
|
||||
<description id="manualSafeMode">&safeModeDescription.label;</description>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
|
|
|
@ -123,6 +123,7 @@ _BROWSER_FILES = \
|
|||
browser_bug441778.js \
|
||||
browser_popupNotification.js \
|
||||
browser_bug455852.js \
|
||||
browser_bug460146.js \
|
||||
browser_bug462673.js \
|
||||
browser_bug477014.js \
|
||||
browser_bug479408.js \
|
||||
|
@ -182,6 +183,7 @@ _BROWSER_FILES = \
|
|||
browser_bug719271.js \
|
||||
browser_canonizeURL.js \
|
||||
browser_findbarClose.js \
|
||||
browser_homeDrop.js \
|
||||
browser_keywordBookmarklets.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
|
@ -263,7 +265,7 @@ _BROWSER_FILES = \
|
|||
test_wyciwyg_copying.html \
|
||||
authenticate.sjs \
|
||||
browser_minimize.js \
|
||||
browser_aboutSyncProgress.js \
|
||||
browser_aboutSyncProgress.js \
|
||||
browser_middleMouse_inherit.js \
|
||||
redirect_bug623155.sjs \
|
||||
$(NULL)
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/* Check proper image url retrieval from all kinds of elements/styles */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
var doc = gBrowser.contentDocument;
|
||||
var pageInfo = BrowserPageInfo(doc, "mediaTab");
|
||||
|
||||
pageInfo.addEventListener("load", function () {
|
||||
pageInfo.removeEventListener("load", arguments.callee, true);
|
||||
pageInfo.onFinished.push(function () {
|
||||
executeSoon(function () {
|
||||
var imageTree = pageInfo.document.getElementById("imagetree");
|
||||
var imageRowsNum = imageTree.view.rowCount;
|
||||
|
||||
ok(imageTree, "Image tree is null (media tab is broken)");
|
||||
|
||||
ok(imageRowsNum == 7, "Number of images listed: " +
|
||||
imageRowsNum + ", should be 7");
|
||||
|
||||
pageInfo.close();
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}, true);
|
||||
}, true);
|
||||
|
||||
content.location =
|
||||
"data:text/html," +
|
||||
"<html>" +
|
||||
" <head>" +
|
||||
" <title>Test for media tab</title>" +
|
||||
" <link rel='shortcut icon' href='file:///dummy_icon.ico'>" + // Icon
|
||||
" </head>" +
|
||||
" <body style='background-image:url(about:logo?a);'>" + // Background
|
||||
" <img src='file:///dummy_image.gif'>" + // Image
|
||||
" <ul>" +
|
||||
" <li style='list-style:url(about:logo?b);'>List Item 1</li>" + // Bullet
|
||||
" </ul> " +
|
||||
" <div style='-moz-border-image: url(about:logo?c) 20 20 20 20;'>test</div>" + // Border
|
||||
" <a href='' style='cursor: url(about:logo?d),default;'>test link</a>" + // Cursor
|
||||
" <object type='image/svg+xml' width=20 height=20 data='file:///dummy_object.svg'></object>" + // Object
|
||||
" </body>" +
|
||||
"</html>";
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// Open a new tab, since starting a drag from the home button activates it and
|
||||
// we don't want to interfere with future tests by loading the home page.
|
||||
let newTab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
registerCleanupFunction(function () {
|
||||
gBrowser.removeTab(newTab);
|
||||
});
|
||||
|
||||
let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
|
||||
getService(Ci.mozIJSSubScriptLoader);
|
||||
let chromeUtils = {};
|
||||
scriptLoader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js", chromeUtils);
|
||||
|
||||
let homeButton = document.getElementById("home-button");
|
||||
ok(homeButton, "home button present");
|
||||
|
||||
let dialogListener = new WindowListener("chrome://global/content/commonDialog.xul", function (domwindow) {
|
||||
ok(true, "dialog appeared in response to home button drop");
|
||||
domwindow.document.documentElement.cancelDialog();
|
||||
Services.wm.removeListener(dialogListener);
|
||||
|
||||
// Now trigger the invalid URI test
|
||||
executeSoon(function () {
|
||||
let consoleListener = {
|
||||
observe: function (m) {
|
||||
if (m.message.indexOf("NS_ERROR_DOM_BAD_URI") > -1) {
|
||||
Services.console.unregisterListener(consoleListener);
|
||||
ok(true, "drop was blocked");
|
||||
executeSoon(finish);
|
||||
}
|
||||
}
|
||||
}
|
||||
Services.console.registerListener(consoleListener);
|
||||
|
||||
// The drop handler throws an exception when dragging URIs that inherit
|
||||
// principal, e.g. javascript:
|
||||
expectUncaughtException();
|
||||
chromeUtils.synthesizeDrop(homeButton, homeButton, [[{type: "text/plain", data: "javascript:8888"}]], "copy", window, EventUtils);
|
||||
})
|
||||
});
|
||||
|
||||
Services.wm.addListener(dialogListener);
|
||||
|
||||
chromeUtils.synthesizeDrop(homeButton, homeButton, [[{type: "text/plain", data: "http://mochi.test:8888/"}]], "copy", window, EventUtils);
|
||||
}
|
||||
|
||||
function WindowListener(aURL, aCallback) {
|
||||
this.callback = aCallback;
|
||||
this.url = aURL;
|
||||
}
|
||||
WindowListener.prototype = {
|
||||
onOpenWindow: function(aXULWindow) {
|
||||
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
var self = this;
|
||||
domwindow.addEventListener("load", function() {
|
||||
domwindow.removeEventListener("load", arguments.callee, false);
|
||||
|
||||
ok(true, "domwindow.document.location.href: " + domwindow.document.location.href);
|
||||
if (domwindow.document.location.href != self.url)
|
||||
return;
|
||||
|
||||
// Allow other window load listeners to execute before passing to callback
|
||||
executeSoon(function() {
|
||||
self.callback(domwindow);
|
||||
});
|
||||
}, false);
|
||||
},
|
||||
onCloseWindow: function(aXULWindow) {},
|
||||
onWindowTitleChange: function(aXULWindow, aNewTitle) {}
|
||||
}
|
||||
|
|
@ -130,8 +130,11 @@ function triggerCommand(aClick, aEvent) {
|
|||
gURLBar.value = TEST_VALUE;
|
||||
gURLBar.focus();
|
||||
|
||||
if (aClick)
|
||||
if (aClick) {
|
||||
is(gURLBar.getAttribute("pageproxystate"), "invalid",
|
||||
"page proxy state must be invalid for go button to be visible");
|
||||
EventUtils.synthesizeMouseAtCenter(gGoButton, aEvent);
|
||||
}
|
||||
else
|
||||
EventUtils.synthesizeKey("VK_RETURN", aEvent);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ _BROWSER_FILES = \
|
|||
browser_newtab_reset.js \
|
||||
browser_newtab_tabsync.js \
|
||||
browser_newtab_unpin.js \
|
||||
browser_newtab_bug723102.js \
|
||||
head.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function runTests() {
|
||||
// create a new tab page and hide it.
|
||||
setLinks("0,1,2,3,4,5,6,7,8");
|
||||
setPinnedLinks("");
|
||||
|
||||
yield addNewTabPageTab();
|
||||
let firstTab = gBrowser.selectedTab;
|
||||
|
||||
yield addNewTabPageTab();
|
||||
gBrowser.removeTab(firstTab);
|
||||
|
||||
cw.gToolbar.hide();
|
||||
ok(cw.gGrid.node.hasAttribute("page-disabled"), "page is disabled");
|
||||
}
|
|
@ -258,7 +258,7 @@ function runTest(testNum) {
|
|||
|
||||
case 2:
|
||||
// Context menu for plain text
|
||||
checkContextMenu(["context-back", false,
|
||||
plainTextItems = ["context-back", false,
|
||||
"context-forward", false,
|
||||
"context-reload", true,
|
||||
"context-stop", false,
|
||||
|
@ -272,7 +272,8 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-viewsource", true,
|
||||
"context-viewinfo", true
|
||||
].concat(inspectItems));
|
||||
].concat(inspectItems);
|
||||
checkContextMenu(plainTextItems);
|
||||
closeContextMenu();
|
||||
openContextMenuFor(link); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -513,13 +514,21 @@ function runTest(testNum) {
|
|||
].concat(inspectItems));
|
||||
contextMenu.ownerDocument.getElementById("spell-add-to-dictionary").doCommand(); // Add to dictionary
|
||||
closeContextMenu();
|
||||
openContextMenuFor(text); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 15:
|
||||
// Re-check context menu for plain text to make sure it hasn't changed
|
||||
checkContextMenu(plainTextItems);
|
||||
closeContextMenu();
|
||||
openContextMenuFor(textarea, false, true); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 15:
|
||||
|
||||
case 16:
|
||||
// Context menu for textarea after a word has been added
|
||||
// to the dictionary
|
||||
checkContextMenu(["spell-undo-add-to-dictionary", true,
|
||||
"---", null,
|
||||
"context-undo", false,
|
||||
"---", null,
|
||||
"context-cut", false,
|
||||
|
@ -540,7 +549,7 @@ function runTest(testNum) {
|
|||
openContextMenuFor(contenteditable);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
case 17:
|
||||
// Context menu for contenteditable
|
||||
checkContextMenu(["spell-no-suggestions", false,
|
||||
"spell-add-to-dictionary", true,
|
||||
|
@ -565,7 +574,7 @@ function runTest(testNum) {
|
|||
openContextMenuFor(inputspell); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 17:
|
||||
case 18:
|
||||
// Context menu for spell-check input
|
||||
checkContextMenu(["*prodigality", true, // spelling suggestion
|
||||
"spell-add-to-dictionary", true,
|
||||
|
@ -590,13 +599,13 @@ function runTest(testNum) {
|
|||
openContextMenuFor(link); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 18:
|
||||
case 19:
|
||||
executeCopyCommand("cmd_copyLink", "http://mozilla.com/");
|
||||
closeContextMenu();
|
||||
openContextMenuFor(pagemenu); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 19:
|
||||
case 20:
|
||||
// Context menu for element with assigned content context menu
|
||||
checkContextMenu(["+Plain item", {type: "", icon: "", checked: false, disabled: false},
|
||||
"+Disabled item", {type: "", icon: "", checked: false, disabled: true},
|
||||
|
@ -639,7 +648,7 @@ function runTest(testNum) {
|
|||
openContextMenuFor(pagemenu, true); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 20:
|
||||
case 21:
|
||||
// Context menu for element with assigned content context menu
|
||||
// The shift key should bypass content context menu processing
|
||||
checkContextMenu(["context-back", false,
|
||||
|
@ -684,7 +693,7 @@ function runTest(testNum) {
|
|||
var testNum = 1;
|
||||
var subwindow, chromeWin, contextMenu, lastElement;
|
||||
var text, link, mailto, input, img, canvas, video_ok, video_bad, video_bad2,
|
||||
iframe, video_in_iframe, image_in_iframe, textarea, contenteditable, inputspell, pagemenu;
|
||||
iframe, video_in_iframe, image_in_iframe, textarea, contenteditable, inputspell, pagemenu, plainTextItems;
|
||||
|
||||
function startTest() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
|
|
@ -43,8 +43,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += test
|
||||
endif
|
||||
TEST_DIRS += test
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -45,9 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
MODULE = browserdir
|
||||
LIBRARY_NAME = browserdir_s
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS = tests
|
||||
endif
|
||||
TEST_DIRS += tests
|
||||
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
DIRS = public src
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += test
|
||||
endif
|
||||
TEST_DIRS += test
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -188,6 +188,13 @@ BrowserGlue.prototype = {
|
|||
// This pref must be set here because SessionStore will use its value
|
||||
// on quit-application.
|
||||
this._setPrefToSaveSession();
|
||||
try {
|
||||
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
|
||||
getService(Ci.nsIAppStartup);
|
||||
appStartup.trackStartupCrashEnd();
|
||||
} catch (e) {
|
||||
Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e);
|
||||
}
|
||||
break;
|
||||
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
|
||||
case "browser-lastwindow-close-requested":
|
||||
|
@ -415,6 +422,9 @@ BrowserGlue.prototype = {
|
|||
browser.selectedTab = browser.addTab("about:newaddon?id=" + aAddon.id);
|
||||
})
|
||||
});
|
||||
|
||||
let keywordURLUserSet = Services.prefs.prefHasUserValue("keyword.URL");
|
||||
Services.telemetry.getHistogramById("FX_KEYWORD_URL_USERSET").add(keywordURLUserSet);
|
||||
},
|
||||
|
||||
_onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
|
||||
|
|
|
@ -45,9 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
DIRS = src
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
endif
|
||||
TEST_DIRS += tests
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -43,9 +43,7 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
endif
|
||||
TEST_DIRS += tests
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ var gCookiesWindow = {
|
|||
this.filter();
|
||||
}
|
||||
|
||||
document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0;
|
||||
this._updateRemoveAllButton();
|
||||
|
||||
this._saveState();
|
||||
},
|
||||
|
@ -119,7 +119,7 @@ var gCookiesWindow = {
|
|||
this._view._rowCount = 0;
|
||||
this._tree.treeBoxObject.rowCountChanged(0, -oldRowCount);
|
||||
this._view.selection.clearSelection();
|
||||
document.getElementById("removeAllCookies").disabled = true;
|
||||
this._updateRemoveAllButton();
|
||||
}
|
||||
else if (aData == "reload") {
|
||||
// first, clear any existing entries
|
||||
|
@ -210,10 +210,7 @@ var gCookiesWindow = {
|
|||
this._view._rowCount += rowCountImpact;
|
||||
this._tree.treeBoxObject.rowCountChanged(oldRowCount - 1, rowCountImpact);
|
||||
|
||||
if (this._view._rowCount > 0 && !this._view._filtered)
|
||||
document.getElementById("removeAllCookies").disabled = false;
|
||||
else
|
||||
document.getElementById("removeAllCookies").disabled = true;
|
||||
this._updateRemoveAllButton();
|
||||
},
|
||||
|
||||
_view: {
|
||||
|
@ -593,10 +590,21 @@ var gCookiesWindow = {
|
|||
removeCookie.parentNode.selectedPanel =
|
||||
selectedCookieCount == 1 ? removeCookie : removeCookies;
|
||||
|
||||
document.getElementById("removeAllCookies").disabled = this._view._filtered;
|
||||
removeCookie.disabled = removeCookies.disabled = !(seln.count > 0);
|
||||
},
|
||||
|
||||
performDeletion: function gCookiesWindow_performDeletion(deleteItems) {
|
||||
var psvc = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var blockFutureCookies = false;
|
||||
if (psvc.prefHasUserValue("network.cookie.blockFutureCookies"))
|
||||
blockFutureCookies = psvc.getBoolPref("network.cookie.blockFutureCookies");
|
||||
for (var i = 0; i < deleteItems.length; ++i) {
|
||||
var item = deleteItems[i];
|
||||
this._cm.remove(item.host, item.name, item.path, blockFutureCookies);
|
||||
}
|
||||
},
|
||||
|
||||
deleteCookie: function () {
|
||||
# // Selection Notes
|
||||
# // - Selection always moves to *NEXT* adjacent item unless item
|
||||
|
@ -713,15 +721,7 @@ var gCookiesWindow = {
|
|||
}
|
||||
}
|
||||
|
||||
var psvc = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
var blockFutureCookies = false;
|
||||
if (psvc.prefHasUserValue("network.cookie.blockFutureCookies"))
|
||||
blockFutureCookies = psvc.getBoolPref("network.cookie.blockFutureCookies");
|
||||
for (i = 0; i < deleteItems.length; ++i) {
|
||||
var item = deleteItems[i];
|
||||
this._cm.remove(item.host, item.name, item.path, blockFutureCookies);
|
||||
}
|
||||
this.performDeletion(deleteItems);
|
||||
|
||||
if (nextSelected < 0)
|
||||
seln.clearSelection();
|
||||
|
@ -732,8 +732,22 @@ var gCookiesWindow = {
|
|||
},
|
||||
|
||||
deleteAllCookies: function () {
|
||||
this._cm.removeAll();
|
||||
this._tree.focus();
|
||||
if (this._view._filtered) {
|
||||
var rowCount = this._view.rowCount;
|
||||
var deleteItems = [];
|
||||
for (var index = 0; index < rowCount; index++) {
|
||||
deleteItems.push(this._view._getItemAtIndex(index));
|
||||
}
|
||||
this._view._removeItemAtIndex(0, rowCount);
|
||||
this._view._rowCount = 0;
|
||||
this._tree.treeBoxObject.rowCountChanged(0, -rowCount);
|
||||
this.performDeletion(deleteItems);
|
||||
}
|
||||
else {
|
||||
this._cm.removeAll();
|
||||
}
|
||||
this._updateRemoveAllButton();
|
||||
this.focusFilterBox();
|
||||
},
|
||||
|
||||
onCookieKeyPress: function (aEvent) {
|
||||
|
@ -833,6 +847,7 @@ var gCookiesWindow = {
|
|||
this._lastSelectedRanges = [];
|
||||
|
||||
document.getElementById("cookiesIntro").value = this._bundle.getString("cookiesAll");
|
||||
this._updateRemoveAllButton();
|
||||
},
|
||||
|
||||
_cookieMatchesFilter: function (aCookie) {
|
||||
|
@ -878,6 +893,10 @@ var gCookiesWindow = {
|
|||
}
|
||||
},
|
||||
|
||||
_updateRemoveAllButton: function gCookiesWindow__updateRemoveAllButton() {
|
||||
document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0;
|
||||
},
|
||||
|
||||
filter: function () {
|
||||
var filter = document.getElementById("filter").value;
|
||||
if (filter == "") {
|
||||
|
@ -908,6 +927,7 @@ var gCookiesWindow = {
|
|||
view.selection.select(0);
|
||||
|
||||
document.getElementById("cookiesIntro").value = gCookiesWindow._bundle.getString("cookiesFiltered");
|
||||
this._updateRemoveAllButton();
|
||||
},
|
||||
|
||||
setFilter: function (aFilterString) {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче