Merge cvs-trunk-mirror -> mozilla-central

--HG--
rename : js/src/js.c => js/src/js.cpp
rename : js/src/jsapi.c => js/src/jsapi.cpp
rename : js/src/jsarray.c => js/src/jsarray.cpp
rename : js/src/jsatom.c => js/src/jsatom.cpp
rename : js/src/jsdate.c => js/src/jsdate.cpp
rename : js/src/jsemit.c => js/src/jsemit.cpp
rename : js/src/jsexn.c => js/src/jsexn.cpp
rename : js/src/jsfun.c => js/src/jsfun.cpp
rename : js/src/jsgc.c => js/src/jsgc.cpp
rename : js/src/jsinterp.c => js/src/jsinterp.cpp
rename : js/src/jsiter.c => js/src/jsiter.cpp
rename : js/src/jslock.c => js/src/jslock.cpp
rename : js/src/jsmath.c => js/src/jsmath.cpp
rename : js/src/jsnum.c => js/src/jsnum.cpp
rename : js/src/jsobj.c => js/src/jsobj.cpp
rename : js/src/jsopcode.c => js/src/jsopcode.cpp
rename : js/src/jsparse.c => js/src/jsparse.cpp
rename : js/src/jsregexp.c => js/src/jsregexp.cpp
rename : js/src/jsscan.c => js/src/jsscan.cpp
rename : js/src/jsscript.c => js/src/jsscript.cpp
rename : js/src/jsstr.c => js/src/jsstr.cpp
rename : js/src/jsxml.c => js/src/jsxml.cpp
This commit is contained in:
benjamin@smedbergs.us 2008-03-10 17:07:41 -04:00
Родитель 35ce5bea9f 72a45fd109
Коммит f7f9006427
432 изменённых файлов: 9666 добавлений и 3252 удалений

Просмотреть файл

@ -218,9 +218,14 @@ endif
#XXX: this is a hack, since we don't want to clobber for MSVC
# PGO support, but we can't do this test in client.mk
ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
# No point in clobbering if PGO has been explicitly disabled.
ifndef NO_PROFILE_GUIDED_OPTIMIZE
maybe_clobber_profiledbuild: clobber_all
else
maybe_clobber_profiledbuild:
endif
else
maybe_clobber_profiledbuild:
endif
.PHONY: maybe_clobber_profiledbuild

Просмотреть файл

@ -116,6 +116,8 @@ ACCESSIBILITY_ATOM(label, "label")
ACCESSIBILITY_ATOM(legend, "legend")
ACCESSIBILITY_ATOM(li, "li")
ACCESSIBILITY_ATOM(link, "link")
ACCESSIBILITY_ATOM(listcols, "listcols") // XUL
ACCESSIBILITY_ATOM(listcol, "listcol") // XUL
ACCESSIBILITY_ATOM(listhead, "listhead") // XUL
ACCESSIBILITY_ATOM(listheader, "listheader") // XUL
ACCESSIBILITY_ATOM(map, "map")

Просмотреть файл

@ -72,6 +72,7 @@
#include "nsIFrame.h"
#include "nsIViewManager.h"
#include "nsIDocShellTreeItem.h"
#include "nsIScrollableFrame.h"
#include "nsXPIDLString.h"
#include "nsUnicharUtils.h"
@ -2671,6 +2672,21 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce
nsAccUtils::GetARIATreeItemParent(this, content, aRelated);
return NS_OK;
}
// If accessible is in its own Window then we should provide NODE_CHILD_OF relation
// so that MSAA clients can easily get to true parent instead of getting to oleacc's
// ROLE_WINDOW accessible which will prevent us from going up further (because it is
// system generated and has no idea about the hierarchy above it).
nsIFrame *frame = GetFrame();
if (frame) {
nsIView *view = frame->GetViewExternal();
if (view) {
nsIScrollableFrame *scrollFrame = nsnull;
CallQueryInterface(frame, &scrollFrame);
if (scrollFrame || view->GetWidget()) {
return GetParent(aRelated);
}
}
}
break;
}
case nsIAccessibleRelation::RELATION_CONTROLLED_BY:

Просмотреть файл

@ -142,8 +142,8 @@ public:
#endif
static PRBool IsCorrectFrameType(nsIFrame* aFrame, nsIAtom* aAtom);
static PRUint32 State(nsIAccessible *aAcc) { PRUint32 state; aAcc->GetFinalState(&state, nsnull); return state; }
static PRUint32 Role(nsIAccessible *aAcc) { PRUint32 role; aAcc->GetFinalRole(&role); return role; }
static PRUint32 State(nsIAccessible *aAcc) { PRUint32 state = 0; if (aAcc) aAcc->GetFinalState(&state, nsnull); return state; }
static PRUint32 Role(nsIAccessible *aAcc) { PRUint32 role = nsIAccessibleRole::ROLE_NOTHING; if (aAcc) aAcc->GetFinalRole(&role); return role; }
static PRBool IsText(nsIAccessible *aAcc) { PRUint32 role = Role(aAcc); return role == nsIAccessibleRole::ROLE_TEXT_LEAF || role == nsIAccessibleRole::ROLE_STATICTEXT; }
static PRBool IsEmbeddedObject(nsIAccessible *aAcc) { PRUint32 role = Role(aAcc); return role != nsIAccessibleRole::ROLE_TEXT_LEAF && role != nsIAccessibleRole::ROLE_WHITESPACE && role != nsIAccessibleRole::ROLE_STATICTEXT; }
static PRInt32 TextLength(nsIAccessible *aAccessible); // Returns -1 on failure

Просмотреть файл

@ -463,13 +463,7 @@ PRBool nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *aAccessible,
if (!finalFocusNode) {
return PR_FALSE;
}
GetAccService()->GetAccessibleFor(finalFocusNode, getter_AddRefs(finalFocusAccessible));
// For activedescendant, the ARIA spec does not require that the user agent
// checks whether finalFocusNode is actually a descendant of the element with
// the activedescendant attribute.
if (!finalFocusAccessible) {
return PR_FALSE;
}
finalFocusAccessible = nsnull;
}
}
@ -478,6 +472,16 @@ PRBool nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *aAccessible,
return PR_FALSE;
}
if (!finalFocusAccessible) {
GetAccService()->GetAccessibleFor(finalFocusNode, getter_AddRefs(finalFocusAccessible));
// For activedescendant, the ARIA spec does not require that the user agent
// checks whether finalFocusNode is actually a descendant of the element with
// the activedescendant attribute.
if (!finalFocusAccessible) {
return PR_FALSE;
}
}
gLastFocusedAccessiblesState = State(finalFocusAccessible);
PRUint32 role = Role(finalFocusAccessible);
if (role == nsIAccessibleRole::ROLE_MENUITEM) {
@ -845,7 +849,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
}
}
else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
PRBool fireFocus = PR_FALSE;
PRBool fireFocus = PR_FALSE;
if (!treeItemAccessible) {
#ifdef MOZ_XUL
if (isTree) {
@ -858,8 +862,8 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
NS_ENSURE_TRUE(menuFrame, NS_ERROR_FAILURE);
nsIMenuFrame* imenuFrame;
CallQueryInterface(menuFrame, &imenuFrame);
if (imenuFrame)
fireFocus = PR_TRUE;
if (imenuFrame)
fireFocus = PR_TRUE;
// QI failed for nsIMenuFrame means it's not on menu bar
if (imenuFrame && imenuFrame->IsOnMenuBar() &&
!imenuFrame->IsOnActiveMenuBar()) {
@ -873,7 +877,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
// It is not top level menuitem
// Only fire focus event if it is not inside collapsed popup
// and not a listitem of a combo box
if (State(containerAccessible) & nsIAccessibleStates::STATE_COLLAPSED) {
if (State(containerAccessible) & nsIAccessibleStates::STATE_COLLAPSED) {
nsCOMPtr<nsIAccessible> containerParent;
containerAccessible->GetParent(getter_AddRefs(containerParent));
NS_ENSURE_TRUE(containerParent, NS_ERROR_FAILURE);
@ -893,16 +897,16 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
if (popup || containerContent == realFocusedContent) {
// If we're inside the focus or a popup we can fire focus events
// for the changed active item
fireFocus = PR_TRUE;
break;
fireFocus = PR_TRUE;
break;
}
containerContent = containerContent->GetParent();
}
}
if (fireFocus) {
nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE); // Always asynch, always from user input
FireAccessibleFocusEvent(accessible, aTargetNode, aEvent, PR_TRUE, PR_TRUE);
}
if (fireFocus) {
nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE); // Always asynch, always from user input
FireAccessibleFocusEvent(accessible, aTargetNode, aEvent, PR_TRUE, PR_TRUE);
}
}
else if (eventType.EqualsLiteral("DOMMenuBarActive")) { // Always asynch, always from user input
nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE);

Просмотреть файл

@ -53,6 +53,10 @@ nsLinkableAccessible(aDomNode, aShell)
{
}
// Expose nsIAccessibleHyperLink unconditionally
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLAreaAccessible, nsLinkableAccessible,
nsIAccessibleHyperLink)
/* wstring getName (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetName(nsAString & aName)
{

Просмотреть файл

@ -48,7 +48,12 @@ class nsHTMLAreaAccessible : public nsLinkableAccessible
{
public:
nsHTMLAreaAccessible(nsIDOMNode *domNode, nsIAccessible *accParent, nsIWeakReference* aShell);
nsHTMLAreaAccessible(nsIDOMNode *domNode, nsIAccessible *accParent,
nsIWeakReference* aShell);
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetName(nsAString & _retval);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetFirstChild(nsIAccessible **_retval);

Просмотреть файл

@ -47,6 +47,7 @@
#include "nsIDocument.h"
#include "nsIHTMLDocument.h"
#include "nsIImageLoadingContent.h"
#include "nsILink.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
#include "nsIDOMHTMLImageElement.h"
@ -57,6 +58,9 @@
const PRUint32 kDefaultImageCacheSize = 256;
////////////////////////////////////////////////////////////////////////////////
// nsHTMLImageAccessible
nsHTMLImageAccessible::nsHTMLImageAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDOMNode, aShell), mAccessNodeCache(nsnull)
{
@ -84,7 +88,11 @@ nsLinkableAccessible(aDOMNode, aShell), mAccessNodeCache(nsnull)
}
}
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLImageAccessible, nsAccessible, nsIAccessibleImage)
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLImageAccessible, nsAccessible,
nsIAccessibleImage)
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
NS_IMETHODIMP
nsHTMLImageAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
@ -151,50 +159,6 @@ NS_IMETHODIMP nsHTMLImageAccessible::GetRole(PRUint32 *_retval)
return NS_OK;
}
already_AddRefed<nsIAccessible>
nsHTMLImageAccessible::GetAreaAccessible(PRInt32 aAreaNum)
{
if (!mMapElement)
return nsnull;
nsCOMPtr<nsIDOMHTMLCollection> mapAreas;
mMapElement->GetAreas(getter_AddRefs(mapAreas));
if (!mapAreas)
return nsnull;
nsCOMPtr<nsIDOMNode> domNode;
mapAreas->Item(aAreaNum,getter_AddRefs(domNode));
if (!domNode)
return nsnull;
nsCOMPtr<nsIAccessNode> accessNode;
GetCacheEntry(*mAccessNodeCache, (void*)(aAreaNum),
getter_AddRefs(accessNode));
if (!accessNode) {
accessNode = new nsHTMLAreaAccessible(domNode, this, mWeakShell);
if (!accessNode)
return nsnull;
nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(accessNode));
NS_ASSERTION(privateAccessNode,
"Accessible doesn't implement nsPIAccessNode");
nsresult rv = privateAccessNode->Init();
if (NS_FAILED(rv))
return nsnull;
PutCacheEntry(*mAccessNodeCache, (void*)(aAreaNum), accessNode);
}
nsCOMPtr<nsIAccessible> accessible(do_QueryInterface(accessNode));
nsIAccessible *accPtr;
NS_IF_ADDREF(accPtr = accessible);
return accPtr;
}
void nsHTMLImageAccessible::CacheChildren()
{
if (!mWeakShell) {
@ -208,13 +172,9 @@ void nsHTMLImageAccessible::CacheChildren()
}
mAccChildCount = 0;
nsCOMPtr<nsIDOMHTMLCollection> mapAreas;
if (mMapElement) {
mMapElement->GetAreas(getter_AddRefs(mapAreas));
}
if (!mapAreas) {
nsCOMPtr<nsIDOMHTMLCollection> mapAreas = GetAreaCollection();
if (!mapAreas)
return;
}
PRUint32 numMapAreas;
mapAreas->GetLength(&numMapAreas);
@ -223,7 +183,7 @@ void nsHTMLImageAccessible::CacheChildren()
nsCOMPtr<nsIAccessible> areaAccessible;
nsCOMPtr<nsPIAccessible> privatePrevAccessible;
while (childCount < (PRInt32)numMapAreas &&
(areaAccessible = GetAreaAccessible(childCount)) != nsnull) {
(areaAccessible = GetAreaAccessible(mapAreas, childCount)) != nsnull) {
if (privatePrevAccessible) {
privatePrevAccessible->SetNextSibling(areaAccessible);
}
@ -263,6 +223,66 @@ NS_IMETHODIMP nsHTMLImageAccessible::DoAction(PRUint8 index)
return nsLinkableAccessible::DoAction(index);
}
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibleHyperLink
NS_IMETHODIMP
nsHTMLImageAccessible::GetAnchors(PRInt32 *aAnchors)
{
NS_ENSURE_ARG_POINTER(aAnchors);
if (!mMapElement)
return nsLinkableAccessible::GetAnchors(aAnchors);
return GetChildCount(aAnchors);
}
NS_IMETHODIMP
nsHTMLImageAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
{
NS_ENSURE_ARG_POINTER(aURI);
*aURI = nsnull;
if (!mMapElement)
return nsLinkableAccessible::GetURI(aIndex, aURI);
nsCOMPtr<nsIDOMHTMLCollection> mapAreas = GetAreaCollection();
if (!mapAreas)
return NS_OK;
nsCOMPtr<nsIDOMNode> domNode;
mapAreas->Item(aIndex, getter_AddRefs(domNode));
if (!domNode)
return NS_ERROR_INVALID_ARG;
nsCOMPtr<nsILink> link(do_QueryInterface(domNode));
if (link)
link->GetHrefURI(aURI);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLImageAccessible::GetObject(PRInt32 aIndex, nsIAccessible **aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
if (!mMapElement)
return nsLinkableAccessible::GetObject(aIndex, aAccessible);
nsCOMPtr<nsIDOMHTMLCollection> mapAreas = GetAreaCollection();
if (mapAreas) {
nsCOMPtr<nsIAccessible> accessible;
accessible = GetAreaAccessible(mapAreas, aIndex);
NS_IF_ADDREF(*aAccessible = accessible);
}
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibleImage
NS_IMETHODIMP
nsHTMLImageAccessible::GetImagePosition(PRUint32 aCoordType,
PRInt32 *aX, PRInt32 *aY)
@ -282,6 +302,9 @@ nsHTMLImageAccessible::GetImageSize(PRInt32 *aWidth, PRInt32 *aHeight)
return GetBounds(&x, &y, aWidth, aHeight);
}
////////////////////////////////////////////////////////////////////////////////
// nsPIAccessNode
NS_IMETHODIMP
nsHTMLImageAccessible::Shutdown()
{
@ -296,3 +319,57 @@ nsHTMLImageAccessible::Shutdown()
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLImageAccessible
already_AddRefed<nsIDOMHTMLCollection>
nsHTMLImageAccessible::GetAreaCollection()
{
if (!mMapElement)
return nsnull;
nsIDOMHTMLCollection *mapAreas = nsnull;
nsresult rv = mMapElement->GetAreas(&mapAreas);
if (NS_FAILED(rv))
return nsnull;
return mapAreas;
}
already_AddRefed<nsIAccessible>
nsHTMLImageAccessible::GetAreaAccessible(nsIDOMHTMLCollection *aAreaCollection,
PRInt32 aAreaNum)
{
if (!aAreaCollection)
return nsnull;
nsCOMPtr<nsIDOMNode> domNode;
aAreaCollection->Item(aAreaNum,getter_AddRefs(domNode));
if (!domNode)
return nsnull;
nsCOMPtr<nsIAccessNode> accessNode;
GetCacheEntry(*mAccessNodeCache, (void*)(aAreaNum),
getter_AddRefs(accessNode));
if (!accessNode) {
accessNode = new nsHTMLAreaAccessible(domNode, this, mWeakShell);
if (!accessNode)
return nsnull;
nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(accessNode));
NS_ASSERTION(privateAccessNode,
"Accessible doesn't implement nsPIAccessNode");
nsresult rv = privateAccessNode->Init();
if (NS_FAILED(rv))
return nsnull;
PutCacheEntry(*mAccessNodeCache, (void*)(aAreaNum), accessNode);
}
nsIAccessible *accessible = nsnull;
CallQueryInterface(accessNode, &accessible);
return accessible;
}

Просмотреть файл

@ -66,6 +66,11 @@ public:
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD DoAction(PRUint8 index);
// nsIAccessibleHyperLink
NS_IMETHOD GetAnchors(PRInt32 *aAnchors);
NS_IMETHOD GetURI(PRInt32 aIndex, nsIURI **aURI);
NS_IMETHOD GetObject(PRInt32 aIndex, nsIAccessible **aAccessible);
// nsPIAccessNode
NS_IMETHOD Shutdown();
@ -73,8 +78,14 @@ public:
NS_DECL_NSIACCESSIBLEIMAGE
protected:
// nsAccessible
virtual void CacheChildren();
already_AddRefed<nsIAccessible> GetAreaAccessible(PRInt32 aAreaNum);
already_AddRefed<nsIDOMHTMLCollection> GetAreaCollection();
already_AddRefed<nsIAccessible>
GetAreaAccessible(nsIDOMHTMLCollection* aAreaNodes, PRInt32 aAreaNum);
// Reference on linked map element if any.
nsCOMPtr<nsIDOMHTMLMapElement> mMapElement;
// Cache of area accessibles. We do not use common cache because images can

Просмотреть файл

@ -58,6 +58,7 @@
#include "nsIServiceManager.h"
#include "nsITableLayout.h"
#include "nsITableCellLayout.h"
#include "nsLayoutErrors.h"
NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLTableCellAccessible, nsHyperTextAccessible)
@ -662,11 +663,15 @@ nsHTMLTableAccessible::IsRowSelected(PRInt32 aRow, PRBool *_retval)
NS_IMETHODIMP
nsHTMLTableAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
PRBool *_retval)
PRBool *aIsSelected)
{
NS_ENSURE_TRUE(IsValidRow(aRow) && IsValidColumn(aColumn), NS_ERROR_INVALID_ARG);
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
nsITableLayout *tableLayout;
NS_ENSURE_TRUE(IsValidRow(aRow) && IsValidColumn(aColumn),
NS_ERROR_INVALID_ARG);
nsITableLayout *tableLayout = nsnull;
nsresult rv = GetTableLayout(&tableLayout);
NS_ENSURE_SUCCESS(rv, rv);
@ -674,11 +679,14 @@ nsHTMLTableAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
PRInt32 startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
return tableLayout->GetCellDataAt(aRow, aColumn,
*getter_AddRefs(domElement),
startRowIndex, startColIndex, rowSpan,
colSpan, actualRowSpan, actualColSpan,
*_retval);
rv = tableLayout->GetCellDataAt(aRow, aColumn, *getter_AddRefs(domElement),
startRowIndex, startColIndex,
rowSpan, colSpan,
actualRowSpan, actualColSpan, *aIsSelected);
if (rv == NS_TABLELAYOUT_CELL_NOT_FOUND)
return NS_ERROR_INVALID_ARG;
return rv;
}
PRBool
@ -867,15 +875,18 @@ nsHTMLTableAccessible::GetCellAt(PRInt32 aRowIndex,
rowSpan, colSpan, actualRowSpan, actualColSpan;
PRBool isSelected;
nsITableLayout *tableLayout;
nsITableLayout *tableLayout = nsnull;
nsresult rv = GetTableLayout(&tableLayout);
NS_ENSURE_SUCCESS(rv, rv);
return tableLayout->GetCellDataAt(aRowIndex, aColIndex, aCell,
startRowIndex, startColIndex,
rowSpan, colSpan,
actualRowSpan, actualColSpan,
isSelected);
rv = tableLayout->GetCellDataAt(aRowIndex, aColIndex, aCell,
startRowIndex, startColIndex,
rowSpan, colSpan,
actualRowSpan, actualColSpan, isSelected);
if (rv == NS_TABLELAYOUT_CELL_NOT_FOUND)
return NS_ERROR_INVALID_ARG;
return rv;
}
NS_IMETHODIMP nsHTMLTableAccessible::GetDescription(nsAString& aDescription)
@ -1030,7 +1041,9 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
// Check to see if there are visible borders on the cells
// XXX currently, we just check the first cell -- do we really need to do more?
nsCOMPtr<nsIDOMElement> cellElement;
GetCellAt(0, 0, *getter_AddRefs(cellElement));
nsresult rv = GetCellAt(0, 0, *getter_AddRefs(cellElement));
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
NS_ENSURE_TRUE(cellContent, NS_ERROR_FAILURE);
nsCOMPtr<nsIPresShell> shell(GetPresShell());

Просмотреть файл

@ -177,8 +177,6 @@ STDMETHODIMP
CAccessibleAction::get_name(long aActionIndex, BSTR *aName)
{
__try {
*aName = NULL;
nsCOMPtr<nsIAccessible> acc(do_QueryInterface(this));
if (!acc)
return E_FAIL;
@ -188,11 +186,10 @@ __try {
if (NS_FAILED(acc->GetActionName(index, name)))
return E_FAIL;
if (!name.IsVoid()) {
INT result = ::SysReAllocStringLen(aName, name.get(), name.Length());
if (!result)
return E_OUTOFMEMORY;
}
INT result = ::SysReAllocStringLen(aName, name.get(), name.Length());
if (!result)
return E_OUTOFMEMORY;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
@ -201,6 +198,7 @@ __try {
STDMETHODIMP
CAccessibleAction::get_localizedName(long aActionIndex, BSTR *aLocalizedName)
{
::SysFreeString(*aLocalizedName);
return E_NOTIMPL;
}

Просмотреть файл

@ -160,8 +160,6 @@ STDMETHODIMP
CAccessibleTable::get_columnDescription(long aColumn, BSTR *aDescription)
{
__try {
*aDescription = NULL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
@ -174,6 +172,7 @@ __try {
if (!::SysReAllocStringLen(aDescription, descr.get(), descr.Length()))
return E_OUTOFMEMORY;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
}
@ -371,8 +370,6 @@ STDMETHODIMP
CAccessibleTable::get_rowDescription(long aRow, BSTR *aDescription)
{
__try {
*aDescription = NULL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
@ -385,6 +382,7 @@ __try {
if (!::SysReAllocStringLen(aDescription, descr.get(), descr.Length()))
return E_OUTOFMEMORY;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
}
@ -736,9 +734,13 @@ CAccessibleTable::GetSelectedItems(long aMaxItems, long **aItems,
if (size == 0 || !items)
return S_OK;
PRUint32 maxSize = size < (PRUint32)aMaxItems ? size : aMaxItems;
PRUint32 maxSize = size < static_cast<PRUint32>(aMaxItems) ? size : aMaxItems;
*aItemsCount = maxSize;
*aItems = static_cast<long*>(nsMemory::Alloc((maxSize) * sizeof(long)));
if (!*aItems)
return E_OUTOFMEMORY;
for (PRUint32 index = 0; index < maxSize; ++index)
(*aItems)[index] = items[index];

Просмотреть файл

@ -86,65 +86,65 @@ STDMETHODIMP
nsAccessibleRelationWrap::get_relationType(BSTR *aRelationType)
{
__try {
*aRelationType = NULL;
PRUint32 type = 0;
nsresult rv = GetRelationType(&type);
if (NS_FAILED(rv))
return E_FAIL;
INT res;
switch (type) {
case RELATION_CONTROLLED_BY:
*aRelationType = ::SysAllocString(IA2_RELATION_CONTROLLED_BY);
res = ::SysReAllocString(aRelationType, IA2_RELATION_CONTROLLED_BY);
break;
case RELATION_CONTROLLER_FOR:
*aRelationType = ::SysAllocString(IA2_RELATION_CONTROLLER_FOR);
res = ::SysReAllocString(aRelationType, IA2_RELATION_CONTROLLER_FOR);
break;
case RELATION_DESCRIBED_BY:
*aRelationType = ::SysAllocString(IA2_RELATION_DESCRIBED_BY);
res = ::SysReAllocString(aRelationType, IA2_RELATION_DESCRIBED_BY);
break;
case RELATION_DESCRIPTION_FOR:
*aRelationType = ::SysAllocString(IA2_RELATION_DESCRIPTION_FOR);
res = ::SysReAllocString(aRelationType, IA2_RELATION_DESCRIPTION_FOR);
break;
case RELATION_EMBEDDED_BY:
*aRelationType = ::SysAllocString(IA2_RELATION_EMBEDDED_BY);
res = ::SysReAllocString(aRelationType, IA2_RELATION_EMBEDDED_BY);
break;
case RELATION_EMBEDS:
*aRelationType = ::SysAllocString(IA2_RELATION_EMBEDS);
res = ::SysReAllocString(aRelationType, IA2_RELATION_EMBEDS);
break;
case RELATION_FLOWS_FROM:
*aRelationType = ::SysAllocString(IA2_RELATION_FLOWS_FROM);
res = ::SysReAllocString(aRelationType, IA2_RELATION_FLOWS_FROM);
break;
case RELATION_FLOWS_TO:
*aRelationType = ::SysAllocString(IA2_RELATION_FLOWS_TO);
res = ::SysReAllocString(aRelationType, IA2_RELATION_FLOWS_TO);
break;
case RELATION_LABEL_FOR:
*aRelationType = ::SysAllocString(IA2_RELATION_LABEL_FOR);
res = ::SysReAllocString(aRelationType, IA2_RELATION_LABEL_FOR);
break;
case RELATION_LABELLED_BY:
*aRelationType = ::SysAllocString(IA2_RELATION_LABELED_BY);
res = ::SysReAllocString(aRelationType, IA2_RELATION_LABELED_BY);
break;
case RELATION_MEMBER_OF:
*aRelationType = ::SysAllocString(IA2_RELATION_MEMBER_OF);
res = ::SysReAllocString(aRelationType, IA2_RELATION_MEMBER_OF);
break;
case RELATION_NODE_CHILD_OF:
*aRelationType = ::SysAllocString(IA2_RELATION_NODE_CHILD_OF);
res = ::SysReAllocString(aRelationType, IA2_RELATION_NODE_CHILD_OF);
break;
case RELATION_PARENT_WINDOW_OF:
*aRelationType = ::SysAllocString(IA2_RELATION_PARENT_WINDOW_OF);
res = ::SysReAllocString(aRelationType, IA2_RELATION_PARENT_WINDOW_OF);
break;
case RELATION_POPUP_FOR:
*aRelationType = ::SysAllocString(IA2_RELATION_POPUP_FOR);
res = ::SysReAllocString(aRelationType, IA2_RELATION_POPUP_FOR);
break;
case RELATION_SUBWINDOW_OF:
*aRelationType = ::SysAllocString(IA2_RELATION_SUBWINDOW_OF);
res = ::SysReAllocString(aRelationType, IA2_RELATION_SUBWINDOW_OF);
break;
default:
return E_FAIL;
}
if (!aRelationType)
if (!res)
return E_OUTOFMEMORY;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
@ -153,6 +153,7 @@ __try {
STDMETHODIMP
nsAccessibleRelationWrap::get_localizedRelationType(BSTR *aLocalizedRelationType)
{
::SysFreeString(*aLocalizedRelationType);
return E_NOTIMPL;
}

Просмотреть файл

@ -1381,7 +1381,7 @@ STDMETHODIMP
nsAccessibleWrap::get_uniqueID(long *uniqueID)
{
__try {
void *id;
void *id = nsnull;
if (NS_SUCCEEDED(GetUniqueID(&id))) {
*uniqueID = - reinterpret_cast<long>(id);
return S_OK;
@ -1523,7 +1523,10 @@ __try {
strAttrs.Append(';');
}
*aAttributes = ::SysAllocString(strAttrs.get());
*aAttributes = ::SysAllocString(strAttrs.get());
if (!*aAttributes)
return E_OUTOFMEMORY;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
}
@ -1672,7 +1675,7 @@ PRInt32 nsAccessibleWrap::GetChildIDFor(nsIAccessible* aAccessible)
// so that the 3rd party application can call back and get the IAccessible
// the event occured on.
void *uniqueID;
void *uniqueID = nsnull;
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aAccessible));
if (!accessNode) {
return 0;
@ -1741,7 +1744,7 @@ IDispatch *nsAccessibleWrap::NativeAccessible(nsIAccessible *aXPAccessible)
nsCOMPtr<nsIAccessibleWin32Object> accObject(do_QueryInterface(aXPAccessible));
if (accObject) {
void* hwnd;
void* hwnd = nsnull;
accObject->GetHwnd(&hwnd);
if (hwnd) {
IDispatch *retval = nsnull;

Просмотреть файл

@ -42,8 +42,8 @@
#include "nsIContent.h"
#include "nsIDOMXULMenuListElement.h"
#include "nsIDOMXULPopupElement.h"
#include "nsIDOMXULMultSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsIDOMXULTextboxElement.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
@ -258,7 +258,7 @@ nsXULListboxAccessible::GetCaption(nsIAccessible **aCaption)
NS_ENSURE_ARG_POINTER(aCaption);
*aCaption = nsnull;
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP
@ -266,7 +266,7 @@ nsXULListboxAccessible::GetSummary(nsAString &aSummary)
{
aSummary.Truncate();
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP
@ -287,7 +287,7 @@ nsXULListboxAccessible::GetColumns(PRInt32 *aNumColumns)
nsCOMPtr<nsIContent> childContent(content->GetChildAt(index));
NS_ENSURE_STATE(childContent);
if (childContent->NodeInfo()->Equals(nsAccessibilityAtoms::listhead,
if (childContent->NodeInfo()->Equals(nsAccessibilityAtoms::listcols,
kNameSpaceID_XUL)) {
headContent = childContent;
}
@ -303,7 +303,7 @@ nsXULListboxAccessible::GetColumns(PRInt32 *aNumColumns)
nsCOMPtr<nsIContent> childContent(headContent->GetChildAt(index));
NS_ENSURE_STATE(childContent);
if (childContent->NodeInfo()->Equals(nsAccessibilityAtoms::listheader,
if (childContent->NodeInfo()->Equals(nsAccessibilityAtoms::listcol,
kNameSpaceID_XUL)) {
columnCount++;
}
@ -452,71 +452,214 @@ NS_IMETHODIMP
nsXULListboxAccessible::GetColumnDescription(PRInt32 aColumn,
nsAString& aDescription)
{
return NS_ERROR_NOT_IMPLEMENTED;
aDescription.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
{
return NS_ERROR_NOT_IMPLEMENTED;
aDescription.Truncate();
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::IsColumnSelected(PRInt32 aColumn, PRBool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
PRInt32 selectedRowsCount = 0;
nsresult rv = control->GetSelectedCount(&selectedRowsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 rowsCount = 0;
rv = GetRows(&rowsCount);
NS_ENSURE_SUCCESS(rv, rv);
*aIsSelected = (selectedRowsCount == rowsCount);
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::IsRowSelected(PRInt32 aRow, PRBool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULSelectControlElement.");
nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
control->GetItemAtIndex(aRow, getter_AddRefs(item));
NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
return item->GetSelected(aIsSelected);
}
NS_IMETHODIMP
nsXULListboxAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
PRBool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
return NS_ERROR_NOT_IMPLEMENTED;
return IsRowSelected(aRow, aIsSelected);
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedCellsCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
return NS_ERROR_NOT_IMPLEMENTED;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
nsCOMPtr<nsIDOMNodeList> selectedItems;
control->GetSelectedItems(getter_AddRefs(selectedItems));
if (!selectedItems)
return NS_OK;
PRUint32 selectedItemsCount = 0;
nsresult rv = selectedItems->GetLength(&selectedItemsCount);
NS_ENSURE_SUCCESS(rv, rv);
if (!selectedItemsCount)
return NS_OK;
PRInt32 columnsCount = 0;
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
*aCount = selectedItemsCount * columnsCount;
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedColumnsCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
PRInt32 selectedRowsCount = 0;
nsresult rv = control->GetSelectedCount(&selectedRowsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 rowsCount = 0;
rv = GetRows(&rowsCount);
NS_ENSURE_SUCCESS(rv, rv);
if (selectedRowsCount != rowsCount)
return NS_OK;
PRInt32 columnsCount = 0;
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
*aCount = columnsCount;
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedRowsCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
PRInt32 selectedRowsCount = 0;
nsresult rv = control->GetSelectedCount(&selectedRowsCount);
NS_ENSURE_SUCCESS(rv, rv);
*aCount = selectedRowsCount;
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedCells(PRUint32 *aNumCells, PRInt32 **aCells)
{
NS_ENSURE_ARG_POINTER(aNumCells);
*aNumCells = 0;
NS_ENSURE_ARG_POINTER(aCells);
*aCells = nsnull;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
nsCOMPtr<nsIDOMNodeList> selectedItems;
control->GetSelectedItems(getter_AddRefs(selectedItems));
if (!selectedItems)
return NS_OK;
PRUint32 selectedItemsCount = 0;
nsresult rv = selectedItems->GetLength(&selectedItemsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 columnsCount = 0;
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 cellsCount = selectedItemsCount * columnsCount;
PRInt32 *cellsIdxArray =
static_cast<PRInt32*>(nsMemory::Alloc((cellsCount) * sizeof(PRInt32)));
NS_ENSURE_TRUE(cellsIdxArray, NS_ERROR_OUT_OF_MEMORY);
PRUint32 index = 0, cellsIdx = 0;
for (; index < selectedItemsCount; index++) {
nsCOMPtr<nsIDOMNode> itemNode;
selectedItems->Item(index, getter_AddRefs(itemNode));
nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
do_QueryInterface(itemNode);
if (item) {
PRInt32 itemIdx = -1;
control->GetIndexOfItem(item, &itemIdx);
if (itemIdx != -1) {
PRInt32 colIdx = 0;
for (; colIdx < columnsCount; colIdx++)
cellsIdxArray[cellsIdx++] = itemIdx * columnsCount + colIdx;
}
}
}
*aNumCells = cellsCount;
*aCells = cellsIdxArray;
return NS_OK;
}
NS_IMETHODIMP
@ -524,42 +667,135 @@ nsXULListboxAccessible::GetSelectedColumns(PRUint32 *aNumColumns,
PRInt32 **aColumns)
{
NS_ENSURE_ARG_POINTER(aNumColumns);
*aNumColumns = 0;
NS_ENSURE_ARG_POINTER(aColumns);
*aColumns = nsnull;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
PRUint32 columnsCount = 0;
nsresult rv = GetSelectedColumnsCount(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
if (!columnsCount)
return NS_OK;
PRInt32 *colsIdxArray =
static_cast<PRInt32*>(nsMemory::Alloc((columnsCount) * sizeof(PRInt32)));
NS_ENSURE_TRUE(colsIdxArray, NS_ERROR_OUT_OF_MEMORY);
PRUint32 colIdx = 0;
for (; colIdx < columnsCount; colIdx++)
colsIdxArray[colIdx] = colIdx;
*aNumColumns = columnsCount;
*aColumns = colsIdxArray;
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::GetSelectedRows(PRUint32 *aNumRows, PRInt32 **aRows)
{
NS_ENSURE_ARG_POINTER(aNumRows);
*aNumRows = 0;
NS_ENSURE_ARG_POINTER(aRows);
*aRows = nsnull;
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
nsCOMPtr<nsIDOMNodeList> selectedItems;
control->GetSelectedItems(getter_AddRefs(selectedItems));
if (!selectedItems)
return NS_OK;
PRUint32 selectedItemsCount = 0;
nsresult rv = selectedItems->GetLength(&selectedItemsCount);
NS_ENSURE_SUCCESS(rv, rv);
if (!selectedItemsCount)
return NS_OK;
PRInt32 *rowsIdxArray =
static_cast<PRInt32*>(nsMemory::Alloc((selectedItemsCount) * sizeof(PRInt32)));
NS_ENSURE_TRUE(rowsIdxArray, NS_ERROR_OUT_OF_MEMORY);
PRUint32 index = 0;
for (; index < selectedItemsCount; index++) {
nsCOMPtr<nsIDOMNode> itemNode;
selectedItems->Item(index, getter_AddRefs(itemNode));
nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
do_QueryInterface(itemNode);
if (item) {
PRInt32 itemIdx = -1;
control->GetIndexOfItem(item, &itemIdx);
if (itemIdx != -1)
rowsIdxArray[index] = itemIdx;
}
}
*aNumRows = selectedItemsCount;
*aRows = rowsIdxArray;
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::SelectRow(PRInt32 aRow)
{
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
control->GetItemAtIndex(aRow, getter_AddRefs(item));
NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
return control->SelectItem(item);
}
NS_IMETHODIMP
nsXULListboxAccessible::SelectColumn(PRInt32 aColumn)
{
return NS_ERROR_NOT_IMPLEMENTED;
// xul:listbox and xul:richlistbox support row selection only.
return NS_OK;
}
NS_IMETHODIMP
nsXULListboxAccessible::UnselectRow(PRInt32 aRow)
{
return NS_ERROR_NOT_IMPLEMENTED;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
do_QueryInterface(mDOMNode);
NS_ASSERTION(control,
"Doesn't implement nsIDOMXULMultiSelectControlElement.");
nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
control->GetItemAtIndex(aRow, getter_AddRefs(item));
NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
return control->RemoveItemFromSelection(item);
}
NS_IMETHODIMP
nsXULListboxAccessible::UnselectColumn(PRInt32 aColumn)
{
return NS_ERROR_NOT_IMPLEMENTED;
// xul:listbox and xul:richlistbox support row selection only.
return NS_OK;
}
NS_IMETHODIMP

Просмотреть файл

@ -48,9 +48,11 @@ include $(topsrcdir)/config/rules.mk
_TEST_FILES =\
test_bug368835.xul \
test_groupattrs.xul \
test_table_indexes.html \
test_nsIAccessibleTable_1.html \
test_nsIAccessibleTable_2.html \
test_nsIAccessibleTable_3.html \
test_nsIAccessibleTable_listboxes.xul \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -5,6 +5,7 @@
<!--
Bug 368835 - fire TreeViewChanged/TreeRowCountChanged events.
Bug 308564 - no accessibility events when data in a tree row changes.
-->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -65,6 +66,9 @@
function TreeViewChangedHandler(aEvent)
{
gTreeViewChanged = true;
// Tree view has been setted. We can continue tests for the tree.
window.setTimeout(doTest2, 0);
}
var gTreeRowCountChanged = false;
@ -83,14 +87,11 @@
function TreeInvalidatedHandler(aEvent)
{
gTreeInvalidatedCount++;
switch (gTreeInvalidatedCount) {
case 2:
TreeColumnInvalidatedHandler(aEvent);
break;
case 3:
TreeRowInvalidatedHandler(aEvent);
break;
}
if (gTreeInvalidatedCount == 2)
TreeColumnInvalidatedHandler(aEvent);
else if (gTreeInvalidatedCount == 5)
TreeRowInvalidatedHandler(aEvent);
}
var gTreeColumnInvalidated = false;
@ -98,19 +99,19 @@
{
var startRow = aEvent.getData("startrow");
is(startRow, null,
"Wrong 'startrow' of 'treeInvalidated' event on InvalidateColumn().");
"Wrong 'startrow' of 'treeInvalidated' event on InvalidateRow().");
var endRow = aEvent.getData("endrow");
is(endRow, null,
"Wrong 'endrow' of 'treeInvalidated' event on InvalidateColumn().");
"Wrong 'endrow' of 'treeInvalidated' event on InvalidateRow().");
var startCol = aEvent.getData("startcolumn");
is(startCol, 0,
"Wrong 'startcolumn' of 'treeInvalidated' event on InvalidateColumn().");
"Wrong 'startcolumn' of 'treeInvalidated' event on InvalidateRow().");
var endCol = aEvent.getData("endcolumn");
is(endCol, 0,
"Wrong 'endcolumn' of 'treeInvalidated' event on InvalidateColumn().");
"Wrong 'endcolumn' of 'treeInvalidated' event on InvalidateRow().");
gTreeColumnInvalidated = true;
}
@ -137,11 +138,44 @@
gTreeRowInvalidated = true;
}
var gNameChangedOnTreeRowInvalidated = false;
var gNameChangedOnTreeColumnInvalidated = false;
var gA11yEventObserver = {
observe: function observe(aSubject, aTopic, aData)
{
if (aTopic != "accessible-event")
return;
const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
var event = aSubject.QueryInterface(nsIAccessibleEvent);
if (event.eventType != nsIAccessibleEvent.EVENT_NAME_CHANGE)
return;
++this.mCount;
if (this.mCount == 6) {
gNameChangedOnTreeColumnInvalidated = true;
// Make sure 'name change' events have been fired on
// InvalidateColumn() before continue the test.
window.setTimeout(doTest3, 0);
}
else if (this.mCount == 7)
gNameChangedOnTreeRowInvalidated = true;
},
mCount: 0,
mType: ""
};
function CheckEvents()
{
// If these fail then it doesn't mean actually events are not fired,
// possibly setTimeout was executed earlier than events have beenS fired.
// possibly setTimeout was executed earlier than events have been fired.
// DOM events
ok(gTreeViewChanged,
"TreeViewChanged event should have been fired.");
ok(gTreeRowCountChanged,
@ -151,6 +185,13 @@
ok(gTreeRowInvalidated,
"TreeInvalidated event should have been fired for InvalidateRow().");
// A11y events
ok(gNameChangedOnTreeRowInvalidated,
"Wrong NameChanged events number on tree row invalidation.");
ok(gNameChangedOnTreeColumnInvalidated,
"Wrong NameChanged events number on tree column invalidation.");
// Remove DOM event listeners
document.removeEventListener("TreeViewChanged",
TreeViewChangedHandler, true);
@ -160,24 +201,32 @@
document.removeEventListener("TreeInvalidated",
TreeInvalidatedHandler, true);
// Remove a11y events listener
gObserverService.removeObserver(gA11yEventObserver, "accessible-event");
SimpleTest.finish();
}
var gAccService = null;
var gObserverService = null;
var gTree = null;
var gTreeBox = null;
var gTreeView = null;
function doTest()
{
// Check whether accessibility support is enabled.
if (!("@mozilla.org/accessibleRetrieval;1" in Components.classes)) {
SimpleTest.finish();
return;
}
// Activate accessibility, otherwise events aren't fired.
gAccService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
// Add event listeners
// Add accessibility event listeners
gObserverService = Components.classes["@mozilla.org/observer-service;1"].
getService(Components.interfaces.nsIObserverService);
gObserverService.addObserver(gA11yEventObserver, "accessible-event",
false);
// Add DOM event listeners
document.addEventListener("TreeViewChanged",
TreeViewChangedHandler, true);
document.addEventListener("TreeRowCountChanged",
@ -186,43 +235,53 @@
TreeInvalidatedHandler, true);
// Initialize the tree
var tree = document.getElementById("tree");
var treeBox = tree.treeBoxObject;
gTree = document.getElementById("tree");
gTreeBox = gTree.treeBoxObject;
var view = new inTreeView();
view.mRowCount = 5;
gView = new inTreeView();
gView.mRowCount = 5;
// Fire 'TreeViewChanged' event
treeBox.view = view;
gTreeBox.view = gView;
// Fire 'TreeRowCountChanged' changed
++view.mRowCount;
treeBox.rowCountChanged(0, 1);
// Fire 'TreeInvalidated' event by InvalidateColumn()
var firstCol = treeBox.columns.getFirstColumn();
for (var i = 0; i < view.mRowCount; i++) {
var key = String(i) + firstCol.id;
view.mData[key] = key + "_col";
}
treeBox.invalidateColumn(firstCol);
// Fire 'TreeInvalidated' event by InvalidateRow()
var colCount = tree.columns.count;
for (var i = 0; i < colCount; i++) {
var key = "1" + tree.columns.getColumnAt(i).id;
view.mData[key] = key + "_row";
}
treeBox.invalidateRow(1);
++gView.mRowCount;
gTreeBox.rowCountChanged(0, 1);
// Wait for events.
if (gTreeViewChanged && gTreeRowCountChanged &&
gTreeColumnInvalidated)
CheckEvents();
else
window.setTimeout(CheckEvents, 1000);
window.setTimeout(CheckEvents, 1000);
}
function doTest2()
{
// Make sure accessibles for the tree is created because it makes
// sure accessible events will be fired.
var treeAcc = gAccService.getAccessibleFor(gTree);
// Makes sure tree children accessibles are created otherwise they won't
// be a couse of name changed events.
var children = treeAcc.children;
// Fire 'TreeInvalidated' event by InvalidateColumn()
var firstCol = gTree.columns.getFirstColumn();
for (var i = 0; i < gView.mRowCount; i++) {
var key = String(i) + firstCol.id;
gView.mData[key] = key + "_col";
}
gTreeBox.invalidateColumn(firstCol);
}
function doTest3()
{
// Fire 'TreeInvalidated' event by InvalidateRow()
var colCount = gTree.columns.count;
for (var i = 0; i < colCount; i++) {
var key = "1" + gTree.columns.getColumnAt(i).id;
gView.mData[key] = key + "_row";
}
gTreeBox.invalidateRow(1);
}
SimpleTest.waitForExplicitFinish();
@ -230,24 +289,33 @@
]]>
</script>
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=368835">
Mozilla Bug 368835
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<hbox 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=368835"
title="Fire TreeViewChanged/TreeRowCountChanged events.">
Mozilla Bug 368835
</a><br/>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=308564"
title="No accessibility events when data in a tree row changes.">
Mozilla Bug 308564
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<tree id="tree" flex="1">
<treecols>
<treecol id="col" flex="1" primary="true" label="column"/>
<treecol id="scol" flex="1" label="column 2"/>
</treecols>
<treechildren id="treechildren"/>
</tree>
</hbox>
<tree id="tree" flex="1">
<treecols>
<treecol id="col" flex="1" primary="true" label="column"/>
<treecol id="scol" flex="1" label="column 2"/>
</treecols>
<treechildren id="treechildren"/>
</tree>
</window>

Просмотреть файл

@ -12,10 +12,11 @@ function doTest()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var table = document.getElementById("table");
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
// bug 410052
var table = document.getElementById("table");
var accTable = accService.getAccessibleFor(table).
QueryInterface(Components.interfaces.nsIAccessibleTable);
@ -29,15 +30,45 @@ function doTest()
is(accTable.getRowExtentAt(2,7), 4,"rowspan wrong");
is(accTable.getColumnExtentAt(2,3), 1, "colspan wrong");
is(accTable.cellRefAt(2,1).firstChild.name, "c1", "wrong cell");
// bug 417912
var table2 = document.getElementById("table2");
var accTable2 = accService.getAccessibleFor(table2).
QueryInterface(Components.interfaces.nsIAccessibleTable);
testCellAt(accTable2, 0, 0, true);
testCellAt(accTable2, 0, 1, true);
testCellAt(accTable2, 0, 2, true);
testCellAt(accTable2, 1, 0, true);
testCellAt(accTable2, 1, 1, false);
testCellAt(accTable2, 1, 2, true);
testCellAt(accTable2, 2, 0, true);
testCellAt(accTable2, 2, 1, true);
testCellAt(accTable2, 2, 2, true);
SimpleTest.finish();
}
function testCellAt(aTable, aRow, aColumn, aSucceeded)
{
try {
aTable.cellRefAt(aRow, aColumn);
ok(aSucceeded, "cell is available at (" + aRow + ", " + aColumn + ").");
} catch (e) {
ok(!aSucceeded, "cell is not available at (" + aRow + ", " + aColumn + ").");
}
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
<br>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=417912"
title="GetCellDataAt callers that expect an error if no cell is found are wrong">
Mozilla Bug 417912
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -83,5 +114,14 @@ addLoadEvent(doTest);
</tbody>
</table>
</center>
<br><br><b>Testing Table 2:</b><br><br>
<center>
<table cellpadding="2" cellspacing="2" border="1" width="50%" id="table2">
<tr><td>1</td><td>2</td><td rowspan=3>3</td>
<tr><td>4</td>
<tr><td>5</td><td>6</td>
</table>
</center>
</body>
</html>

Просмотреть файл

@ -0,0 +1,343 @@
<?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="nsIAccessibleTable interface on xul:listbox test.">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript">
<![CDATA[
var gAccService = null;
var Ci = Components.interfaces;
function doTest()
{
gAccService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var id = "";
var listbox = null, acc = null;
//////////////////////////////////////////////////////////////////////////
// Simple listbox. There is no nsIAccessibleTable interface.
id = "listbox1";
listbox = document.getElementById(id);
acc = gAccService.getAccessibleFor(listbox);
// query nsIAccessibleTable
try {
acc.QueryInterface(Ci.nsIAccessibleTable);
ok(false,
id + " shouldn't implement nsIAccessibleTable interface.");
} catch(e) {
ok(true, id + " doesn't implement nsIAccessibleTable interface.");
}
// role
is(acc.role, Ci.nsIAccessibleRole.ROLE_LISTBOX,
id + " has wrong role.");
//////////////////////////////////////////////////////////////////////////
// Multicolumn listbox.
id = "listbox2";
listbox = document.getElementById(id);
acc = gAccService.getAccessibleFor(listbox);
// role
is(acc.role, Ci.nsIAccessibleRole.ROLE_TABLE,
id + " has wrong role.");
// query nsIAccessibleTable
try {
acc.QueryInterface(Ci.nsIAccessibleTable);
ok(true,
id + " implements nsIAccessibleTable interface.");
} catch(e) {
ok(false, id + " doesn't implement nsIAccessibleTable interface.");
}
// rows count
var rowsCount = acc.rows;
is (rowsCount, 2, id + " has wrong number of rows.");
// columns count
var colsCount = acc.columns;
is (colsCount, 2, id + " has wrong number of columns.");
//////////////////////////////////////////////////////////////////////////
// Multicolumn listbox with header.
id = "listbox3";
listbox = document.getElementById(id);
acc = gAccService.getAccessibleFor(listbox);
// role
is(acc.role, Ci.nsIAccessibleRole.ROLE_TABLE,
id + " has wrong role.");
// query nsIAccessibleTable
try {
acc.QueryInterface(Ci.nsIAccessibleTable);
ok(true,
id + " implements nsIAccessibleTable interface.");
} catch(e) {
ok(false, id + " doesn't implement nsIAccessibleTable interface.");
}
// rows count
var rowsCount = acc.rows;
is (rowsCount, 3, id + " has wrong number of rows.");
// columns count
var colsCount = acc.columns;
is (colsCount, 3, id + " has wrong number of columns.");
// getCellRefAt, getIndexAt, getRowAtIndex, getColumnAtIndex,
// getColumnExtentAt, getRowExtentAt.
for (var row = 0; row < rowsCount; row++) {
for (var col = 0; col < colsCount; col++) {
var index = row * colsCount + col;
is(acc.cellRefAt(row, col).name, "cell" + index,
id + ": wrong cell returned for (" + row + ", " + col + ")");
is(acc.getIndexAt(row, col), index,
id + ": wrong index returned for (" + row + ", " + col + ")");
is(acc.getRowAtIndex(index), row,
id + ": wrong row at the index " + index);
is(acc.getColumnAtIndex(index), col,
id + ": wrong column at the index " + index);
is(acc.getColumnExtentAt(row, col), 1,
id + ": colspan wrong for (" + row + ", " + col + ")");
is(acc.getRowExtentAt(row, col), 1,
id + ": rowspan wrong for (" + row + ", " + col + ")");
}
}
// columns selection
testColumnSelection(id, acc, colsCount, 0, null);
acc.selectColumn(0);
testColumnSelection(id, acc, colsCount, 0, null);
// rows selection
testRowSelection(id, acc, rowsCount, 0, null);
acc.selectRow(0);
testRowSelection(id, acc, rowsCount, 1, [0]);
acc.selectRow(1);
testRowSelection(id, acc, rowsCount, 1, [1]);
acc.unselectRow(1);
testRowSelection(id, acc, rowsCount, 0, null);
// cells selection
testCellSelection(id, acc, rowsCount, colsCount, 0, null);
acc.selectRow(2);
testCellSelection(id, acc, rowsCount, colsCount, 3, [6, 7, 8]);
acc.unselectRow(2);
testCellSelection(id, acc, rowsCount, colsCount, 0, null);
SimpleTest.finish();
}
/**
* Helper function to test isColumnSelected(), selectedColumnCount() and
* getSelectedColumn() methods.
*/
function testColumnSelection(aId, aAcc, aCount, aSelCount, aSelIndexesArray)
{
// isColumnSelected
for (var col = 0; col < aCount; col++) {
if (aSelIndexesArray && aSelIndexesArray.indexOf(col) != -1) {
is(aAcc.isColumnSelected(col), true,
aId + ": column " + col + " should be selected");
} else {
is(aAcc.isColumnSelected(col), false,
aId + ": column " + col + " shouldn't be selected");
}
}
// selectedColumnsCount
is(aAcc.selectedColumnsCount, aSelCount,
aId + ": wrong number of selected columns");
// getSelectedColumns
var selColsCount = {}, selCols = {};
aAcc.getSelectedColumns(selColsCount, selCols);
is(selColsCount.value, aSelCount,
aId + ": wrong number of selected columns");
if (!aSelIndexesArray) {
is(selCols.value, null,
aId + ": no columns should be selected");
} else {
for (var i = 0; i < selCols.length; i++) {
is(selCols[i], aSelIndexesArray[i],
aId + ": wrong selected column index " + i);
}
}
}
/**
* Helper function to test isRowSelected(), selectedRowCount() and
* getSelectedRow() methods.
*/
function testRowSelection(aId, aAcc, aCount, aSelCount, aSelIndexesArray)
{
// isRowSelected
for (var row = 0; row < aCount; row++) {
if (aSelIndexesArray && aSelIndexesArray.indexOf(row) != -1) {
is(aAcc.isRowSelected(row), true,
aId + ": row " + row + " should be selected");
} else {
is(aAcc.isRowSelected(row), false,
aId + ": row " + row + " shouldn't be selected");
}
}
// selectedRowsCount
is(aAcc.selectedRowsCount, aSelCount,
aId + ": wrong number of selected rows");
// getSelectedRows
var selColsCount = {}, selCols = {};
aAcc.getSelectedRows(selColsCount, selCols);
is(selColsCount.value, aSelCount,
aId + ": wrong number of selected rows");
if (!aSelIndexesArray) {
is(selCols.value, null,
aId + ": no row should be selected");
} else {
for (var i = 0; i < selCols.length; i++) {
is(selCols[i], aSelIndexesArray[i],
aId + ": wrong selected row index " + i);
}
}
}
/**
* Helper function to test isCellSelected(), selectedCellCount() and
* getSelectedCells() methods.
*/
function testCellSelection(aId, aAcc, aRowCount, aColCount,
aSelCount, aSelIndexesArray)
{
// isCellSelected
for (var row = 0; row < aRowCount; row++) {
for (var col = 0; col < aColCount; col++) {
var index = aAcc.getIndexAt(row, col);
if (aSelIndexesArray && aSelIndexesArray.indexOf(index) != -1) {
is(aAcc.isCellSelected(row, col), true,
aId + ": cell (" + row + ", " + col + ") should be selected");
} else {
is(aAcc.isCellSelected(row, col), false,
aId + ": cell (" + row + ", " + col + ") shouldn't be selected");
}
}
}
// selectedCellCount
is(aAcc.selectedCellsCount, aSelCount,
aId + ": wrong number of selected cells");
// getSelectedCells
var selColsCount = {}, selCols = {};
aAcc.getSelectedCells(selColsCount, selCols);
is(selColsCount.value, aSelCount,
aId + ": wrong number of selected cells");
if (!aSelIndexesArray) {
is(selCols.value, null,
aId + ": no cells should be selected");
} else {
for (var i = 0; i < selCols.length; i++) {
is(selCols[i], aSelIndexesArray[i],
aId + ": wrong selected cell index " + i);
}
}
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
]]>
</script>
<hbox style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=418371"
title="implement the rest of methods of nsIAccessibleTable on xul:listbox">
Mozilla Bug 418371
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<vbox flex="1">
<label control="listbox1" value="listbox: "/>
<listbox id="listbox1">
<listitem label="item1" id="item1"/>
<listitem label="item2" id="item2"/>
</listbox>
<label control="listbox2" value="multicolumn listbox: "/>
<listbox id="listbox2">
<listcols>
<listcol flex="1"/>
<listcol flex="1"/>
</listcols>
<listitem>
<listcell label="cell1"/>
<listcell label="cell2"/>
</listitem>
<listitem>
<listcell label="cell1"/>
<listcell label="cell2"/>
</listitem>
</listbox>
<label control="listbox3" value="multicolumn listbox with header"/>
<listbox id="listbox3">
<listhead>
<listheader label="header1"/>
<listheader label="header2"/>
<listheader label="header3"/>
</listhead>
<listcols>
<listcol flex="1"/>
<listcol flex="1"/>
<listcol flex="1"/>
</listcols>
<listitem>
<listcell label="cell0"/>
<listcell label="cell1"/>
<listcell label="cell2"/>
</listitem>
<listitem>
<listcell label="cell3"/>
<listcell label="cell4"/>
<listcell label="cell5"/>
</listitem>
<listitem>
<listcell label="cell6"/>
<listcell label="cell7"/>
<listcell label="cell8"/>
</listitem>
</listbox>
</vbox>
</hbox>
</window>

Просмотреть файл

@ -0,0 +1,294 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=410052
-->
<head>
<title>Table indexes chrome tests</title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript">
function doTest()
{
const nsIAccessibleRetrieval =
Components.interfaces.nsIAccessibleRetrieval;
const nsIAccessibleTable = Components.interfaces.nsIAccessibleTable;
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(nsIAccessibleRetrieval);
//////////////////////////////////////////////////////////////////////////
// table
var table = document.getElementById("table");
var tableAcc = accService.getAccessibleFor(table).
QueryInterface(nsIAccessibleTable);
var row, column, index;
var tRow = new Array(0,0,0,1,1,1,2,2,3,3);
var tCol = new Array(0,1,2,0,1,2,0,1,1,2);
for (var i = 0; i < 10; i++) {
row = tableAcc.getRowAtIndex(i);
column = tableAcc.getColumnAtIndex(i);
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
is(row, tRow[i], "table: row for index " + i +" is nor correct");
is(column, tCol[i], "table: column for index " + i +"is nor correct");
is(index, i,
"table: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
}
//////////////////////////////////////////////////////////////////////////
// tableinsane1
table = document.getElementById("tableinsane1");
tableAcc = accService.getAccessibleFor(table).
QueryInterface(nsIAccessibleTable);
tRow = [0,0,0,1,1,1,2,2,3,3];
tCol = [0,1,2,0,1,2,0,1,1,2];
for (var i = 0; i < 10; i++) {
row = tableAcc.getRowAtIndex(i);
column = tableAcc.getColumnAtIndex(i);
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
is(row, tRow[i],
"tableinsane1: row for index " + i +" is nor correct");
is(column, tCol[i],
"tableinsane1: column for index " + i +"is nor correct");
is(index, i,
"tableinsane1: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
}
//////////////////////////////////////////////////////////////////////////
// tableinsane2
table = document.getElementById("tableinsane2");
tableAcc = accService.getAccessibleFor(table).
QueryInterface(nsIAccessibleTable);
tRow = [0,0,0,1,1,1,2,2,3,3,4,4,4];
tCol = [0,1,2,0,1,2,0,1,1,2,1,3,4];
for (var i = 0; i < 13; i++) {
row = tableAcc.getRowAtIndex(i);
column = tableAcc.getColumnAtIndex(i);
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
is(row, tRow[i],
"tableinsane2: row for index " + i +" is nor correct");
is(column, tCol[i],
"tableinsane2: column for index " + i +"is nor correct");
is(index, i,
"tableinsane2: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
}
//////////////////////////////////////////////////////////////////////////
// tableinsane4
table = document.getElementById("tableinsane4");
tableAcc = accService.getAccessibleFor(table).
QueryInterface(Components.interfaces.nsIAccessibleTable);
tRow = [0,0,0,1,1,1,2,2,3,4];
tCol = [0,1,2,0,1,2,0,2,0,0];
for (var i = 0; i < 10; i++) {
row = tableAcc.getRowAtIndex(i);
column = tableAcc.getColumnAtIndex(i);
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
is(row, tRow[i],
"tableinsane4: row for index " + i +" is nor correct");
is(column, tCol[i],
"tableinsane4: column for index " + i +"is nor correct");
is(index, i,
"tableinsane4: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
}
//////////////////////////////////////////////////////////////////////////
// tableborder
var table = document.getElementById("tableborder");
var tableAcc = accService.getAccessibleFor(table).
QueryInterface(nsIAccessibleTable);
tRow = [0,0,0,1,1,1,2,2,3,3];
tCol = [0,1,2,0,1,2,0,1,1,2];
for (var i = 0; i < 10; i++) {
row = tableAcc.getRowAtIndex(i);
column = tableAcc.getColumnAtIndex(i);
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
is(row, tRow[i],
"tableborder: row for index " + i +" is nor correct");
is(column, tCol[i],
"tableborder: column for index " + i +"is nor correct");
is(index, i,
"tableborder: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
}
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<!--
If you change the structure of the table please make sure to change
the indexes count in 'for' statement in the script above.
-->
<table border="1" id="table">
<caption><strong><b><font size="29">this is a caption for this table</font></b></strong></caption>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td rowspan="0">4</td>
<td colspan="2">5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
<table border="1" id="tableborder" style="border-collapse:collapse">
<caption><strong><b><font size="29">this is a caption for this bc table</font></b></strong></caption>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td rowspan="2">4</td>
<td colspan="2">5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
<table border="1" id="tableinsane1">
<caption>test empty row groups</caption>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
</thead>
<tbody></tbody>
<tbody></tbody>
<tbody></tbody>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td rowspan="2">4</td>
<td colspan="2">5</td>
</tr>
<tr>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
<table border="1" id="tableinsane2" >
<caption>empty rowgroup + empty rows</caption>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
</thead>
<tbody><tr></tr></tbody>
<tbody></tbody>
<tbody></tbody>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td rowspan="0">4</td>
<td colspan="0">5</td>
</tr>
<tr>
<td>6</td>
<td rowspan="0">7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
</tr>
</tbody>
<table border="1" id="tableinsane4" >
<caption>test cellmap holes</caption>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
</thead>
<tbody><tr></tr></tbody>
<tbody></tbody>
<tbody></tbody>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td colspan="2">4</td>
<td rowspan="2">5</td>
</tr>
<tr>
<td>6</td>
</tr>
<tr>
<td colspan="3">7</td>
</tr>
</tbody>
</table>
</body>
</html>

Просмотреть файл

@ -198,6 +198,8 @@ pref("browser.chrome.favicons", true);
pref("browser.formfill.enable", true);
pref("browser.warnOnQuit", true);
pref("browser.warnOnRestart", true);
pref("browser.fullscreen.autohide", true);
pref("browser.fullscreen.animateUp", 1);
#ifdef UNIX_BUT_NOT_MAC
pref("browser.urlbar.clickSelectsAll", false);
@ -603,6 +605,10 @@ pref("urlclassifier.alternate_error_page", "blocked");
// The number of random entries to send with a gethash request.
pref("urlclassifier.gethashnoise", 4);
// URL for checking the reason for a malware warning.
pref("browser.safebrowsing.malware.reportURL", "http://www.stopbadware.org/reports/container?source=@APP_UA_NAME@&version=@APP_VERSION@&reportname=");
#endif
// defaults to true

Просмотреть файл

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
# ***** 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 netError.xhtml.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Adam Lock <adamlock@netscape.com>
# William R. Price <wrprice@alumni.rice.edu>
# Henrik Skupin <mozilla@hskupin.info>
# Jeff Walden <jwalden+code@mit.edu>
# Johnathan Nightingale <johnath@mozilla.com>
# Justin Dolske <dolske@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
# 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 ***** -->
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://global/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % aboutrobotsDTD
SYSTEM "chrome://browser/locale/aboutRobots.dtd">
%aboutrobotsDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&robots.pagetitle;</title>
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
<link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNgGAWjYBSMAggAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNgGJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNgGAWjYBSMAggAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNgGAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/>
<script type="application/x-javascript"><![CDATA[
var buttonClicked = false;
function robotButton()
{
var button = document.getElementById('errorTryAgain');
if (buttonClicked) {
button.style.visibility = "hidden";
} else {
var newLabel = button.getAttribute("label2");
button.setAttribute("label", newLabel);
buttonClicked = true;
}
}
]]></script>
</head>
<body dir="&locale.dir;">
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer">
<!-- Error Title -->
<div id="errorTitle">
<h1 id="errorTitleText">&robots.errorTitleText;</h1>
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText">&robots.errorShortDescText;</p>
</div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc">
<ul>
<li>&robots.errorLongDesc1;</li>
<li>&robots.errorLongDesc2;</li>
<li>&robots.errorLongDesc3;</li>
<li>&robots.errorLongDesc4;</li>
</ul>
</div>
<!-- Short Description -->
<div id="errorTrailerDesc">
<p id="errorTrailerDescText" style="float: right;">&robots.errorTrailerDescText;</p>
</div>
</div>
<!-- Button -->
<xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="errorTryAgain"
label="&retry.label;"
label2="&robots.dontpress;"
oncommand="robotButton();" />
</div>
</body>
</html>

Просмотреть файл

@ -76,13 +76,15 @@
#else
#ifdef XP_MACOSX
label="&quitApplicationCmdMac.label;"
key="key_quitApplicationCmdMac"
#else
label="&quitApplicationCmd.label;"
accesskey="&quitApplicationCmd.accesskey;"
#endif
#ifdef XP_UNIX
key="key_quitApplication"
#endif
oncommand="goQuitApplication();"/>
#endif
command="cmd_quitApplication"/>
</menupopup>
</menu>
@ -337,7 +339,8 @@
type="places"
onpopupshowing="HistoryMenu.onPopupShowing(this);"
place="place:type=0&amp;sort=4&amp;maxResults=10">
<menuitem label="&backCmd.label;"
<menuitem id="historyMenuBack"
label="&backCmd.label;"
#ifdef XP_MACOSX
key="goBackKb2"
#else
@ -348,7 +351,8 @@
onclick="checkForMiddleClick(this, event);">
<observes element="Browser:Back" attribute="disabled" />
</menuitem>
<menuitem label="&forwardCmd.label;"
<menuitem id="historyMenuForward"
label="&forwardCmd.label;"
#ifdef XP_MACOSX
key="goForwardKb2"
#else
@ -364,7 +368,7 @@
oncommand="BrowserGoHome(event);"
onclick="checkForMiddleClick(this, event);"
key="goHome"/>
<menuitem label="&showAllHistoryCmd.label;"
<menuitem label="&showAllHistoryCmd2.label;"
#ifndef XP_MACOSX
key="showAllHistoryKb"
#endif
@ -407,7 +411,7 @@
</menu>
<menuitem label="&addCurPagesCmd.label;"
command="Browser:BookmarkAllTabs" key="bookmarkAllTabsKb"/>
<menuitem label="&showAllBookmarksCmd.label;"
<menuitem label="&showAllBookmarksCmd2.label;"
command="Browser:ShowAllBookmarks" key="manBookmarkKb"/>
<menuseparator builder="start"/>
</menupopup>

Просмотреть файл

@ -753,13 +753,9 @@ var BookmarksMenuDropHandler = {
* @returns a FlavourSet object per nsDragAndDrop parlance.
*/
getSupportedFlavours: function BMDH_getSupportedFlavours() {
var flavorSet = new FlavourSet();
var view = document.getElementById("bookmarksMenuPopup");
var types = PlacesUtils.GENERIC_VIEW_DROP_TYPES
for (var i = 0; i < types.length; ++i)
flavorSet.appendFlavour(types[i]);
return flavorSet;
},
return view.getSupportedFlavours();
},
/**
* Determine whether or not the user can drop on the Bookmarks Menu.
@ -784,11 +780,9 @@ var BookmarksMenuDropHandler = {
* The active DragSession
*/
onDrop: function BMDH_onDrop(event, data, session) {
var view = document.getElementById("bookmarksMenuPopup");
// Put the item at the end of bookmark menu
var ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId, -1);
PlacesControllerDragHelper.onDrop(ip);
view._rebuild();
}
};

Просмотреть файл

@ -71,6 +71,7 @@
<command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
<command id="cmd_toggleTaskbar" oncommand="goToggleToolbar('status-bar','toggle_taskbar');"/>
<command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
<command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
<commandset id="editMenuCommands"/>
@ -302,8 +303,11 @@
<key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
#ifdef XP_MACOSX
<key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
<key id="key_quitApplicationCmdMac" key="&quitApplicationCmdMac.key;" modifiers="accel"/>
#endif
#ifdef XP_UNIX
<key id="key_quitApplication" key="&quitApplicationCmdMac.key;" command="cmd_quitApplication" modifiers="accel"/>
#endif
<key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
</keyset>

Просмотреть файл

@ -75,3 +75,14 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
#identity-popup-content-box.verifiedDomain > #identity-popup-connectedToLabel2 {
display: none;
}
/* ::::: Fullscreen pseudo-toolbar ::::: */
#fullscr-toggler {
display: none;
min-height: 5px;
height: 5px;
}
#navigator-toolbox[inFullscreen="true"] #fullscr-toggler {
display: -moz-box;
}

Просмотреть файл

@ -1531,6 +1531,9 @@ function focusAndSelectUrlBar()
function openLocation()
{
if (window.fullScreen)
FullScreen.mouseoverToggle(true);
if (focusAndSelectUrlBar())
return;
#ifdef XP_MACOSX
@ -1635,8 +1638,24 @@ function BrowserCloseTabOrWindow()
function BrowserTryToCloseWindow()
{
if (WindowIsClosing())
if (WindowIsClosing()) {
if (window.fullScreen) {
gBrowser.mPanelContainer.removeEventListener("mousemove",
FullScreen._collapseCallback, false);
document.removeEventListener("keypress", FullScreen._keyToggleCallback, false);
document.removeEventListener("popupshown", FullScreen._setPopupOpen, false);
document.removeEventListener("popuphidden", FullScreen._setPopupOpen, false);
gPrefService.removeObserver("browser.fullscreen", FullScreen);
var fullScrToggler = document.getElementById("fullscr-toggler");
if (fullScrToggler) {
fullScrToggler.removeEventListener("mouseover", FullScreen._expandCallback, false);
fullScrToggler.removeEventListener("dragenter", FullScreen._expandCallback, false);
}
}
window.close(); // WindowIsClosing does all the necessary checks
}
}
function loadURI(uri, referrer, postData, allowThirdPartyFixup)
@ -1736,9 +1755,14 @@ function getShortcutOrURI(aURL, aPostDataRef) {
aPostDataRef.value = getPostDataStream(postData, param, encodedParam,
"application/x-www-form-urlencoded");
}
else
else if (param) {
// This keyword doesn't take a parameter, but one was provided. Just return
// the original URL.
aPostDataRef.value = null;
return aURL;
}
return shortcutURL;
}
@ -2232,12 +2256,12 @@ function BrowserOnCommand(event) {
if (!event.isTrusted)
return;
var ot = event.originalTarget;
var errorDoc = ot.ownerDocument;
// If the event came from an ssl error page, it is probably either the "Add
// Exception…" or "Get me out of here!" button
if (/^about:neterror\?e=nssBadCert/.test(event.originalTarget.ownerDocument.documentURI)) {
var ot = event.originalTarget;
var errorDoc = ot.ownerDocument;
if (/^about:neterror\?e=nssBadCert/.test(errorDoc.documentURI)) {
if (ot == errorDoc.getElementById('exceptionDialogButton')) {
var params = { exceptionAdded : false };
@ -2260,23 +2284,66 @@ function BrowserOnCommand(event) {
errorDoc.location.reload();
}
else if (ot == errorDoc.getElementById('getMeOutOfHereButton')) {
// Redirect them to a known-functioning page, default start page
var prefs = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getDefaultBranch(null);
var url = "about:blank";
try {
url = prefs.getComplexValue("browser.startup.homepage",
Ci.nsIPrefLocalizedString).data;
// If url is a pipe-delimited set of pages, just take the first one.
if (url.indexOf("|") != -1)
url = url.split("|")[0];
} catch(e) {
Components.utils.reportError("Couldn't get homepage pref: " + e);
}
content.location = url;
getMeOutOfHere();
}
}
else if (/^about:blocked/.test(errorDoc.documentURI)) {
// The event came from a button on a malware/phishing block page
if (ot == errorDoc.getElementById('getMeOutButton')) {
getMeOutOfHere();
}
else if (ot == errorDoc.getElementById('reportButton')) {
// This is the "Why is this site blocked" button. For malware,
// we can fetch a site-specific report, for phishing, we redirect
// to the generic page describing phishing protection.
if (/e=malwareBlocked/.test(errorDoc.documentURI)) {
// Get the stop badware "why is this blocked" report url,
// append the current url, and go there.
try {
var reportURL = gPrefService.getCharPref("browser.safebrowsing.malware.reportURL");
reportURL += content.location.href;
content.location = reportURL;
} catch (e) {
Components.utils.reportError("Couldn't get malware report URL: " + e);
}
}
else if (/e=phishingBlocked/.test(errorDoc.documentURI)) {
try {
content.location = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref("browser.safebrowsing.warning.infoURL");
} catch (e) {
Components.utils.reportError("Couldn't get phishing info URL: " + e);
}
}
}
}
}
/**
* Re-direct the browser to a known-safe page. This function is
* used when, for example, the user browses to a known malware page
* and is presented with about:blocked. The "Get me out of here!"
* button should take the user to the default start page so that even
* when their own homepage is infected, we can get them somewhere safe.
*/
function getMeOutOfHere() {
// Get the start page from the *default* pref branch, not the user's
var prefs = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getDefaultBranch(null);
var url = "about:blank";
try {
url = prefs.getComplexValue("browser.startup.homepage",
Ci.nsIPrefLocalizedString).data;
// If url is a pipe-delimited set of pages, just take the first one.
if (url.indexOf("|") != -1)
url = url.split("|")[0];
} catch(e) {
Components.utils.reportError("Couldn't get homepage pref: " + e);
}
content.location = url;
}
function BrowserFullScreen()
{
@ -2737,8 +2804,10 @@ const DOMLinkHandler = {
// Verify that the load of this icon is legal.
// error pages can load their favicon, to be on the safe side,
// only allow chrome:// favicons
const aboutNeterr = "about:neterror?";
if (targetDoc.documentURI.substr(0, aboutNeterr.length) != aboutNeterr ||
const aboutNeterr = /^about:neterror\?/;
const aboutBlocked = /^about:blocked\?/;
if (!(aboutNeterr.test(targetDoc.documentURI) ||
aboutBlocked.test(targetDoc.documentURI)) ||
!uri.schemeIs("chrome")) {
var ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].
getService(Ci.nsIScriptSecurityManager);
@ -2880,6 +2949,9 @@ const BrowserSearch = {
return;
}
#endif
if (window.fullScreen)
FullScreen.mouseoverToggle(true);
var searchBar = this.searchBar;
if (isElementVisible(searchBar)) {
searchBar.select();
@ -3272,18 +3344,235 @@ function updateEditUIVisibility()
var FullScreen =
{
_XULNS: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
toggle: function()
{
// show/hide all menubars, toolbars, and statusbars (except the full screen toolbar)
this.showXULChrome("toolbar", window.fullScreen);
this.showXULChrome("statusbar", window.fullScreen);
document.getElementById("fullScreenItem").setAttribute("checked", !window.fullScreen);
var fullScrToggler = document.getElementById("fullscr-toggler");
if (!window.fullScreen) {
// Add a tiny toolbar to receive mouseover and dragenter events, and provide affordance.
// This will help simulate the "collapse" metaphor while also requiring less code and
// events than raw listening of mouse coords.
if (!fullScrToggler) {
fullScrToggler = document.createElement("toolbar");
fullScrToggler.id = "fullscr-toggler";
fullScrToggler.setAttribute("customizable", "false");
fullScrToggler.setAttribute("moz-collapsed", "true");
var navBar = document.getElementById("nav-bar");
navBar.parentNode.insertBefore(fullScrToggler, navBar);
}
fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
if (gPrefService.getBoolPref("browser.fullscreen.autohide"))
gBrowser.mPanelContainer.addEventListener("mousemove",
this._collapseCallback, false);
document.addEventListener("keypress", this._keyToggleCallback, false);
document.addEventListener("popupshown", this._setPopupOpen, false);
document.addEventListener("popuphidden", this._setPopupOpen, false);
this._shouldAnimate = true;
this.mouseoverToggle(false);
// Autohide prefs
gPrefService.addObserver("browser.fullscreen", this, false);
}
else {
document.removeEventListener("keypress", this._keyToggleCallback, false);
document.removeEventListener("popupshown", this._setPopupOpen, false);
document.removeEventListener("popuphidden", this._setPopupOpen, false);
gPrefService.removeObserver("browser.fullscreen", this);
if (fullScrToggler) {
fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
}
// The user may quit fullscreen during an animation
clearInterval(this._animationInterval);
getNavToolbox().style.marginTop = "0px";
if (this._isChromeCollapsed)
this.mouseoverToggle(true);
this._isAnimating = false;
// This is needed if they use the context menu to quit fullscreen
this._isPopupOpen = false;
gBrowser.mPanelContainer.removeEventListener("mousemove",
this._collapseCallback, false);
}
},
observe: function(aSubject, aTopic, aData)
{
if (aData == "browser.fullscreen.autohide") {
if (gPrefService.getBoolPref("browser.fullscreen.autohide")) {
gBrowser.mPanelContainer.addEventListener("mousemove",
this._collapseCallback, false);
}
else {
gBrowser.mPanelContainer.removeEventListener("mousemove",
this._collapseCallback, false);
}
}
},
// Event callbacks
_expandCallback: function()
{
FullScreen.mouseoverToggle(true);
},
_collapseCallback: function()
{
FullScreen.mouseoverToggle(false);
},
_keyToggleCallback: function(aEvent)
{
// if we can use the keyboard (eg Ctrl+L or Ctrl+E) to open the toolbars, we
// should provide a way to collapse them too.
if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
FullScreen._shouldAnimate = false;
FullScreen.mouseoverToggle(false, true);
}
// F6 is another shortcut to the address bar, but its not covered in OpenLocation()
else if (aEvent.keyCode == aEvent.DOM_VK_F6)
FullScreen.mouseoverToggle(true);
},
// Checks whether we are allowed to collapse the chrome
_isPopupOpen: false,
_isChromeCollapsed: false,
_safeToCollapse: function(forceHide)
{
if (!gPrefService.getBoolPref("browser.fullscreen.autohide"))
return false;
// a popup menu is open in chrome: don't collapse chrome
if (!forceHide && this._isPopupOpen)
return false;
// a textbox in chrome is focused (location bar anyone?): don't collapse chrome
if (document.commandDispatcher.focusedElement &&
document.commandDispatcher.focusedElement.ownerDocument == document &&
document.commandDispatcher.focusedElement.localName == "input") {
if (forceHide)
// hidden textboxes that still have focus are bad bad bad
document.commandDispatcher.focusedElement.blur();
else
return false;
}
return true;
},
_setPopupOpen: function(aEvent)
{
// Popups should only veto chrome collapsing if they were opened when the chrome was not collapsed.
// Otherwise, they would not affect chrome and the user would expect the chrome to go away.
// e.g. we wouldn't want the autoscroll icon firing this event, so when the user
// toggles chrome when moving mouse to the top, it doesn't go away again.
if (aEvent.type == "popupshown" && !FullScreen._isChromeCollapsed &&
aEvent.target.localName != "tooltip" && aEvent.target.localName != "window")
FullScreen._isPopupOpen = true;
else if (aEvent.type == "popuphidden" && aEvent.target.localName != "tooltip" &&
aEvent.target.localName != "window")
FullScreen._isPopupOpen = false;
},
// Autohide helpers for the context menu item
getAutohide: function(aItem)
{
aItem.setAttribute("checked", gPrefService.getBoolPref("browser.fullscreen.autohide"));
},
setAutohide: function()
{
gPrefService.setBoolPref("browser.fullscreen.autohide", !gPrefService.getBoolPref("browser.fullscreen.autohide"));
},
// Animate the toolbars disappearing
_shouldAnimate: true,
_isAnimating: false,
_animationInterval: null,
_animateUp: function()
{
// check again, the user may have done something before the animation was due to start
if (!window.fullScreen || !FullScreen._safeToCollapse(false)) {
FullScreen._isAnimating = false;
FullScreen._shouldAnimate = true;
return;
}
var navToolbox = getNavToolbox();
var animateFrameAmount = 2;
function animateUpFrame() {
animateFrameAmount *= 2;
if (animateFrameAmount >=
(navToolbox.boxObject.height + gBrowser.mStrip.boxObject.height)) {
// We've animated enough
clearInterval(FullScreen._animationInterval);
navToolbox.style.marginTop = "0px";
FullScreen._isAnimating = false;
FullScreen._shouldAnimate = false; // Just to make sure
FullScreen.mouseoverToggle(false);
return;
}
navToolbox.style.marginTop = (animateFrameAmount * -1) + "px";
}
FullScreen._animationInterval = setInterval(animateUpFrame, 70);
},
mouseoverToggle: function(aShow, forceHide)
{
// Don't do anything if:
// a) we're already in the state we want,
// b) we're animating and will become collapsed soon, or
// c) we can't collapse because it would be undesirable right now
if (aShow != this._isChromeCollapsed || (!aShow && this._isAnimating) ||
(!aShow && !this._safeToCollapse(forceHide)))
return;
// browser.fullscreen.animateUp
// 0 - never animate up
// 1 - animate only for first collapse after entering fullscreen (default for perf's sake)
// 2 - animate every time it collapses
if (gPrefService.getIntPref("browser.fullscreen.animateUp") == 0)
this._shouldAnimate = false;
if (!aShow && this._shouldAnimate) {
this._isAnimating = true;
this._shouldAnimate = false;
setTimeout(this._animateUp, 800);
return;
}
// The chrome is collapsed so don't spam needless mousemove events
if (aShow) {
gBrowser.mPanelContainer.addEventListener("mousemove",
this._collapseCallback, false);
}
else {
gBrowser.mPanelContainer.removeEventListener("mousemove",
this._collapseCallback, false);
}
gBrowser.mStrip.setAttribute("moz-collapsed", !aShow);
var allFSToolbars = document.getElementsByTagNameNS(this._XULNS, "toolbar");
for (var i = 0; i < allFSToolbars.length; i++) {
if (allFSToolbars[i].getAttribute("fullscreentoolbar") == "true")
allFSToolbars[i].setAttribute("moz-collapsed", !aShow);
}
document.getElementById("fullscr-toggler").setAttribute("moz-collapsed", aShow);
this._isChromeCollapsed = !aShow;
if (gPrefService.getIntPref("browser.fullscreen.animateUp") == 2)
this._shouldAnimate = true;
},
showXULChrome: function(aTag, aShow)
{
var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var els = document.getElementsByTagNameNS(XULNS, aTag);
var els = document.getElementsByTagNameNS(this._XULNS, aTag);
for (var i = 0; i < els.length; ++i) {
// XXX don't interfere with previously collapsed toolbars
@ -3299,12 +3588,14 @@ var FullScreen =
els[i].setAttribute("iconsize", "small");
}
// XXX See bug 202978: we disable the context menu
// to prevent customization while in fullscreen, which
// causes menu breakage.
// Give the main nav bar the fullscreen context menu, otherwise remove it
// to prevent breakage
els[i].setAttribute("saved-context",
els[i].getAttribute("context"));
els[i].removeAttribute("context");
if (els[i].id == "nav-bar")
els[i].setAttribute("context", "autohide-context");
else
els[i].removeAttribute("context");
// Set the inFullscreen attribute to allow specific styling
// in fullscreen mode
@ -3314,15 +3605,14 @@ var FullScreen =
function restoreAttr(attrName) {
var savedAttr = "saved-" + attrName;
if (els[i].hasAttribute(savedAttr)) {
var savedValue = els[i].getAttribute(savedAttr);
els[i].setAttribute(attrName, savedValue);
els[i].setAttribute(attrName, els[i].getAttribute(savedAttr));
els[i].removeAttribute(savedAttr);
}
}
restoreAttr("mode");
restoreAttr("iconsize");
restoreAttr("context"); // XXX see above
restoreAttr("context");
els[i].removeAttribute("inFullscreen");
}
@ -3355,11 +3645,15 @@ var FullScreen =
*
* @param aMimeType
* The MIME type to check.
*
* If adding types to this function, please also check the similar
* function in findbar.xml
*/
function mimeTypeIsTextBased(aMimeType)
{
return /^text\/|\+xml$/.test(aMimeType) ||
aMimeType == "application/x-javascript" ||
aMimeType == "application/javascript" ||
aMimeType == "application/xml" ||
aMimeType == "mozilla.application/cached-xul";
}
@ -3865,7 +4159,7 @@ nsBrowserStatusHandler.prototype =
this.securityButton.removeAttribute("label");
this.securityButton.setAttribute("tooltiptext", this._tooltipText);
getIdentityHandler().checkIdentity(this._state, this._host);
getIdentityHandler().checkIdentity(this._state, gBrowser.contentWindow.location);
},
// simulate all change notifications after switching tabs
@ -5975,9 +6269,9 @@ IdentityHandler.prototype = {
IDENTITY_MODE_DOMAIN_VERIFIED : "verifiedDomain", // Minimal SSL CA-signed domain verification
IDENTITY_MODE_UNKNOWN : "unknownIdentity", // No trusted identity information
// Cache the most recently seen SSLStatus and URI to prevent unnecessary updates
// Cache the most recent SSLStatus and Location seen in checkIdentity
_lastStatus : null,
_lastHost : null,
_lastLocation : null,
/**
* Build out a cache of the elements that we need frequently.
@ -6042,14 +6336,14 @@ IdentityHandler.prototype = {
* be called by onSecurityChange
*
* @param PRUint32 state
* @param AUTF8String host
* @param Location location
*/
checkIdentity : function(state, host) {
checkIdentity : function(state, location) {
var currentStatus = gBrowser.securityUI
.QueryInterface(Components.interfaces.nsISSLStatusProvider)
.SSLStatus;
this._lastStatus = currentStatus;
this._lastHost = host;
this._lastLocation = location;
if (state & Components.interfaces.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL)
this.setMode(this.IDENTITY_MODE_IDENTIFIED);
@ -6059,6 +6353,23 @@ IdentityHandler.prototype = {
this.setMode(this.IDENTITY_MODE_UNKNOWN);
},
/**
* Return the eTLD+1 version of the current hostname
*/
getEffectiveHost : function() {
// Cache the eTLDService if this is our first time through
if (!this._eTLDService)
this._eTLDService = Cc["@mozilla.org/network/effective-tld-service;1"]
.getService(Ci.nsIEffectiveTLDService);
try {
return this._eTLDService.getBaseDomainFromHost(this._lastLocation.hostname);
} catch (e) {
// If something goes wrong (e.g. hostname is an IP address) just fail back
// to the full domain.
return this._lastLocation.hostname;
}
},
/**
* Update the UI to reflect the specified mode, which should be one of the
* IDENTITY_MODE_* constants.
@ -6097,24 +6408,15 @@ IdentityHandler.prototype = {
var icon_label = "";
switch (gPrefService.getIntPref("browser.identity.ssl_domain_display")) {
case 2 : // Show full domain
icon_label = this._lastHost;
icon_label = this._lastLocation.hostname;
break;
case 1 : // Show eTLD. Cache eTLD service the first time we need it.
if (!this._eTLDService)
this._eTLDService = Cc["@mozilla.org/network/effective-tld-service;1"]
.getService(Ci.nsIEffectiveTLDService);
try {
icon_label = this._eTLDService.getBaseDomainFromHost(this._lastHost);
} catch (e) {
// If something goes wrong (e.g. _lastHost is an IP address) just fail back
// to the full domain.
icon_label = this._lastHost;
}
case 1 : // Show eTLD.
icon_label = this.getEffectiveHost();
}
// We need a port number for all lookups. If one hasn't been specified, use
// the https default
var lookupHost = this._lastHost;
var lookupHost = this._lastLocation.host;
if (lookupHost.indexOf(':') < 0)
lookupHost += ":443";
@ -6169,35 +6471,18 @@ IdentityHandler.prototype = {
// Initialize the optional strings to empty values
var supplemental = "";
var verifier = "";
// Cache eTLD service if we haven't yet
if (!this._eTLDService)
this._eTLDService = Cc["@mozilla.org/network/effective-tld-service;1"]
.getService(Ci.nsIEffectiveTLDService);
if (newMode == this.IDENTITY_MODE_DOMAIN_VERIFIED) {
var iData = this.getIdentityData();
try {
var host = this._eTLDService.getBaseDomainFromHost(this._lastHost);
} catch (e) {
// Fail back to the full domain.
host = this._lastHost;
}
var owner = this._stringBundle.getString("identity.ownerUnknown");
var host = this.getEffectiveHost();
var owner = this._stringBundle.getString("identity.ownerUnknown2");
verifier = this._identityBox.tooltipText;
supplemental = "";
}
else if (newMode == this.IDENTITY_MODE_IDENTIFIED) {
// If it's identified, then we can populate the dialog with credentials
iData = this.getIdentityData();
try {
host = this._eTLDService.getBaseDomainFromHost(this._lastHost);
} catch (e) {
// Fail back to the full domain.
host = this._lastHost;
}
host = this.getEffectiveHost();
owner = iData.subjectOrg;
verifier = this._identityBox.tooltipText;

Просмотреть файл

@ -159,6 +159,17 @@
<menuseparator observes="blockedPopupsSeparator"/>
</popup>
<menupopup id="autohide-context"
onpopupshowing="FullScreen.getAutohide(this.firstChild);">
<menuitem type="checkbox" label="&fullScreenAutohide.label;"
accesskey="&fullScreenAutohide.accesskey;"
oncommand="FullScreen.setAutohide();"/>
<menuseparator/>
<menuitem label="&fullScreenExit.label;"
accesskey="&fullScreenExit.accesskey;"
oncommand="BrowserFullScreen();"/>
</menupopup>
<popup id="contentAreaContextMenu"
onpopupshowing="if (event.target != this) return true; updateEditUIVisibility(); gContextMenu = new nsContextMenu(this, window.getBrowser()); return gContextMenu.shouldDisplay;"
onpopuphiding="if (event.target == this) { gContextMenu = null; updateEditUIVisibility(); }">
@ -176,7 +187,7 @@
<vbox id="identity-popup-content-box">
<label id="identity-popup-connectedToLabel" value="&identity.connectedTo;"/>
<label id="identity-popup-connectedToLabel2"
value="&identity.unverifiedsite;"/>
value="&identity.unverifiedsite2;"/>
<description id="identity-popup-content-host"/>
<label id="identity-popup-runByLabel" value="&identity.runBy;"/>
<description id="identity-popup-content-owner"/>

Просмотреть файл

@ -297,9 +297,14 @@
for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
var p = this.mTabBrowser.mProgressListeners[i];
if (p)
p.onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress);
try {
p.onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress);
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
@ -398,11 +403,17 @@
if (this.mTabBrowser.mCurrentTab == this.mTab) {
for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
var p = this.mTabBrowser.mProgressListeners[i];
if (p && !oldBlank)
p.onStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
// make sure that the visible status of new blank tabs is correctly set
else if (p && "onUpdateCurrentBrowser" in p)
p.onUpdateCurrentBrowser(aStateFlags, aStatus, "", 0);
if (p)
try {
if (!oldBlank)
p.onStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
// make sure that the visible status of new blank tabs is correctly set
else if ("onUpdateCurrentBrowser" in p)
p.onUpdateCurrentBrowser(aStateFlags, aStatus, "", 0);
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
@ -433,7 +444,12 @@
for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
var p = this.mTabBrowser.mProgressListeners[i];
if (p)
p.onLocationChange(aWebProgress, aRequest, aLocation);
try {
p.onLocationChange(aWebProgress, aRequest, aLocation);
} catch (e) {
// don't inhibit other listeners
Components.utils.reportError(e);
}
}
}
},
@ -447,7 +463,12 @@
for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
var p = this.mTabBrowser.mProgressListeners[i];
if (p)
p.onStatusChange(aWebProgress, aRequest, aStatus, aMessage);
try {
p.onStatusChange(aWebProgress, aRequest, aStatus, aMessage);
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
@ -460,7 +481,12 @@
for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
var p = this.mTabBrowser.mProgressListeners[i];
if (p)
p.onSecurityChange(aWebProgress, aRequest, aState);
try {
p.onSecurityChange(aWebProgress, aRequest, aState);
} catch (e) {
// don't inhibit other listeners
Components.utils.reportError(e);
}
}
}
},
@ -471,8 +497,13 @@
for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
var p = this.mTabBrowser.mProgressListeners[i];
if (p && "onRefreshAttempted" in p) {
if (!p.onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI))
allowRefresh = false;
try {
if (!p.onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI))
allowRefresh = false;
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
return allowRefresh;
@ -515,7 +546,12 @@
for (var i = 0; i < this.mProgressListeners.length; i++) {
var p = this.mProgressListeners[i];
if ('onLinkIconAvailable' in p)
p.onLinkIconAvailable(browser);
try {
p.onLinkIconAvailable(browser);
} catch (e) {
// don't inhibit other listeners
Components.utils.reportError(e);
}
}
]]>
</body>
@ -737,19 +773,23 @@
var i, p;
for (i = 0; i < this.mProgressListeners.length; i++) {
p = this.mProgressListeners[i];
if (p) {
p.onLocationChange(webProgress, null, loc);
if (securityUI)
p.onSecurityChange(webProgress, null, securityUI.state);
if (p)
try {
p.onLocationChange(webProgress, null, loc);
if (securityUI)
p.onSecurityChange(webProgress, null, securityUI.state);
// make sure that all status indicators are properly updated
if ("onUpdateCurrentBrowser" in p) {
var listener = this.mTabListeners[this.mTabContainer.selectedIndex] || null;
if (listener && listener.mStateFlags)
p.onUpdateCurrentBrowser(listener.mStateFlags, listener.mStatus,
listener.mMessage, listener.mTotalProgress);
// make sure that all status indicators are properly updated
if ("onUpdateCurrentBrowser" in p) {
var listener = this.mTabListeners[this.mTabContainer.selectedIndex] || null;
if (listener && listener.mStateFlags)
p.onUpdateCurrentBrowser(listener.mStateFlags, listener.mStatus,
listener.mMessage, listener.mTotalProgress);
}
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
this._fastFind.setDocShell(this.mCurrentBrowser.docShell);
@ -766,7 +806,12 @@
for (i = 0; i < this.mProgressListeners.length; i++) {
p = this.mProgressListeners[i];
if (p)
p.onStateChange(webProgress, null, nsIWebProgressListener.STATE_START | nsIWebProgressListener.STATE_IS_NETWORK, 0);
try {
p.onStateChange(webProgress, null, nsIWebProgressListener.STATE_START | nsIWebProgressListener.STATE_IS_NETWORK, 0);
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
@ -778,7 +823,12 @@
for (i = 0; i < this.mProgressListeners.length; i++) {
p = this.mProgressListeners[i];
if (p)
p.onStateChange(webProgress, null, nsIWebProgressListener.STATE_STOP | nsIWebProgressListener.STATE_IS_NETWORK, 0);
try {
p.onStateChange(webProgress, null, nsIWebProgressListener.STATE_STOP | nsIWebProgressListener.STATE_IS_NETWORK, 0);
} catch (e) {
// don't inhibit other listeners or following code
Components.utils.reportError(e);
}
}
}
@ -2538,41 +2588,38 @@
<xul:spacer flex="1"/>
<xul:hbox class="tabs-bottom" align="center"/>
</xul:vbox>
<xul:vbox>
<xul:hbox xbl:inherits="overflow" class="tabs-container">
<xul:hbox xbl:inherits="overflow" class="tabs-container">
#ifdef XP_MACOSX
<xul:stack>
<xul:spacer class="tabs-left"/>
</xul:stack>
<xul:stack>
<xul:spacer class="tabs-left"/>
</xul:stack>
#endif
<xul:arrowscrollbox anonid="arrowscrollbox" orient="horizontal" flex="1"
style="min-width: 1px;" chromedir="&locale.dir;"
<xul:arrowscrollbox anonid="arrowscrollbox" orient="horizontal" flex="1"
style="min-width: 1px;" chromedir="&locale.dir;"
#ifndef XP_MACOSX
clicktoscroll="true"
clicktoscroll="true"
#endif
class="tabbrowser-arrowscrollbox">
<children/>
</xul:arrowscrollbox>
<xul:stack align="center" pack="end" chromedir="&locale.dir;">
<xul:hbox flex="1" class="tabs-alltabs-box" anonid="alltabs-box"/>
<xul:hbox flex="1" class="tabs-alltabs-box-animate" anonid="alltabs-box-animate"/>
<xul:toolbarbutton class="tabs-alltabs-button" type="menu" anonid="alltabs-button"
tooltipstring="&listAllTabs.label;">
<xul:menupopup class="tabs-alltabs-popup" anonid="alltabs-popup"
position="after_end"/>
</xul:toolbarbutton>
</xul:stack>
class="tabbrowser-arrowscrollbox">
<children/>
</xul:arrowscrollbox>
<xul:stack align="center" pack="end" chromedir="&locale.dir;">
<xul:hbox flex="1" class="tabs-alltabs-box" anonid="alltabs-box"/>
<xul:hbox flex="1" class="tabs-alltabs-box-animate" anonid="alltabs-box-animate"/>
<xul:toolbarbutton class="tabs-alltabs-button" type="menu" anonid="alltabs-button"
tooltipstring="&listAllTabs.label;">
<xul:menupopup class="tabs-alltabs-popup" anonid="alltabs-popup"
position="after_end"/>
</xul:toolbarbutton>
</xul:stack>
#ifdef XP_MACOSX
<xul:hbox anonid="tabstrip-closebutton" class="tabs-closebutton-box" align="center" pack="end" chromedir="&locale.dir;">
<xul:hbox anonid="tabstrip-closebutton" class="tabs-closebutton-box" align="center" pack="end" chromedir="&locale.dir;">
#endif
<xul:toolbarbutton anonid="tabs-closebutton"
class="close-button tabs-closebutton" chromedir="&locale.dir;"/>
<xul:toolbarbutton anonid="tabs-closebutton"
class="close-button tabs-closebutton" chromedir="&locale.dir;"/>
#ifdef XP_MACOSX
</xul:hbox>
#endif
</xul:hbox>
<xul:spacer class="tabs-bottom-spacer"/>
</xul:vbox>
#endif
</xul:hbox>
</xul:stack>
</content>
<implementation implements="nsITimerCallback, nsIDOMEventListener">
@ -3118,9 +3165,18 @@
* double click on the tabbar. (bug 378344)
* In both cases, it is most likely that the close button area has
* been accidentally clicked, therefore we do not close the tab.
*
* We don't want to ignore processing of more than one click event,
* though, since the user might actually be repeatedly clicking to
* close many tabs at once.
*/
if (event.detail > 1)
if (event.detail > 1 && !this._ignoredClick) {
this._ignoredClick = true;
return;
}
// Reset the "ignored click" flag
this._ignoredClick = false;
tabbedBrowser.removeTab(bindingParent);
tabbedBrowser._blockDblClick = true;

Просмотреть файл

@ -53,8 +53,10 @@ _BROWSER_FILES = browser_bug321000.js \
browser_bug405137.js \
browser_bug409481.js \
browser_autodiscovery.js \
browser_bug420160.js \
autodiscovery.html \
moz.png \
browser_getshortcutoruri.js \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -0,0 +1,50 @@
var listener = {
testFunction : null,
handleEvent : function (e) {
this.testFunction();
}
}
var newBrowser;
/* Tests for correct behaviour of getEffectiveHost on identity handler */
function test() {
waitForExplicitFinish();
ok(getIdentityHandler(), "getIdentityHandler should return a result");
ok(gIdentityHandler, "gIdentityHandler should exist");
var newTab = gBrowser.addTab();
gBrowser.selectedTab = newTab;
newBrowser = gBrowser.getBrowserForTab(newTab);
newBrowser.addEventListener("load", listener, true);
listener.testFunction = testNormalDomain;
newBrowser.contentWindow.location = 'http://test1.example.org/';
}
function testNormalDomain() {
is(gIdentityHandler._lastLocation.host, 'test1.example.org', "Identity handler is getting the full location");
is(gIdentityHandler.getEffectiveHost(), 'example.org', "getEffectiveHost should return example.org for test1.example.org");
listener.testFunction = testNormalDomainWithPort;
newBrowser.contentWindow.location = 'http://sub1.test1.example.org:8000/';
}
function testNormalDomainWithPort() {
is(gIdentityHandler._lastLocation.host, 'sub1.test1.example.org:8000', "Identity handler is getting port information");
is(gIdentityHandler.getEffectiveHost(), 'example.org', "getEffectiveHost should return example.org for sub1.test1.example.org:8000");
listener.testFunction = testIPWithPort;
newBrowser.contentWindow.location = 'http://127.0.0.1:8888/';
}
function testIPWithPort() {
is(gIdentityHandler.getEffectiveHost(), '127.0.0.1', "getEffectiveHost should return 127.0.0.1 for 127.0.0.1:8888");
newBrowser.removeEventListener("load", listener, true);
gBrowser.removeCurrentTab();
finish();
}

Просмотреть файл

@ -0,0 +1,139 @@
function makeURI(aURL, aOriginCharset, aBaseURI) {
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
return ioService.newURI(aURL, aOriginCharset, aBaseURI);
}
function getPostDataString(aIS) {
if (!aIS)
return null;
var sis = Cc["@mozilla.org/scriptableinputstream;1"].
createInstance(Ci.nsIScriptableInputStream);
sis.init(aIS);
var dataLines = sis.read(aIS.available()).split("\n");
// only want the last line
return dataLines[dataLines.length-1];
}
function keywordResult(aURL, aPostData) {
this.url = aURL;
this.postData = aPostData;
}
function keyWordData() {}
keyWordData.prototype = {
init: function(aKeyWord, aURL, aPostData, aSearchWord) {
this.keyword = aKeyWord;
this.uri = makeURI(aURL);
this.postData = aPostData;
this.searchWord = aSearchWord;
this.method = (this.postData ? "POST" : "GET");
}
}
function bmKeywordData(aKeyWord, aURL, aPostData, aSearchWord) {
this.init(aKeyWord, aURL, aPostData, aSearchWord);
}
bmKeywordData.prototype = new keyWordData();
function searchKeywordData(aKeyWord, aURL, aPostData, aSearchWord) {
this.init(aKeyWord, aURL, aPostData, aSearchWord);
}
searchKeywordData.prototype = new keyWordData();
var testData = [
[new bmKeywordData("bmget", "http://bmget/search=%s", null, "foo"),
new keywordResult("http://bmget/search=foo", null)],
[new bmKeywordData("bmpost", "http://bmpost/", "search=%s", "foo2"),
new keywordResult("http://bmpost/", "search=foo2")],
[new bmKeywordData("bmpostget", "http://bmpostget/search1=%s", "search2=%s", "foo3"),
new keywordResult("http://bmpostget/search1=foo3", "search2=foo3")],
[new bmKeywordData("bmget-nosearch", "http://bmget-nosearch/", null, ""),
new keywordResult("http://bmget-nosearch/", null)],
[new searchKeywordData("searchget", "http://searchget/?search={searchTerms}", null, "foo4"),
new keywordResult("http://searchget/?search=foo4", null)],
[new searchKeywordData("searchpost", "http://searchpost/", "search={searchTerms}", "foo5"),
new keywordResult("http://searchpost/", "search=foo5")],
[new searchKeywordData("searchpostget", "http://searchpostget/?search1={searchTerms}", "search2={searchTerms}", "foo6"),
new keywordResult("http://searchpostget/?search1=foo6", "search2=foo6")],
// Bookmark keywords that don't take parameters should not be activated if a
// parameter is passed (bug 420328).
[new bmKeywordData("bmget-noparam", "http://bmget-noparam/", null, "foo7"),
new keywordResult(null, null)],
[new bmKeywordData("bmpost-noparam", "http://bmpost-noparam/", "not_a=param", "foo8"),
new keywordResult(null, null)],
// Test escaping (%s = escaped, %S = raw)
// UTF-8 default
[new bmKeywordData("bmget-escaping", "http://bmget/?esc=%s&raw=%S", null, "foé"),
new keywordResult("http://bmget/?esc=fo%C3%A9&raw=foé", null)],
// Explicitly-defined ISO-8859-1
[new bmKeywordData("bmget-escaping2", "http://bmget/?esc=%s&raw=%S&mozcharset=ISO-8859-1", null, "foé"),
new keywordResult("http://bmget/?esc=fo%E9&raw=foé", null)],
];
function test() {
setupKeywords();
for each (var item in testData) {
var [data, result] = item;
var postData = {};
var query = data.keyword;
if (data.searchWord)
query += " " + data.searchWord;
var url = getShortcutOrURI(query, postData);
// null result.url means we should expect the same query we sent in
var expected = result.url || query;
is(url, expected, "got correct URL for " + data.keyword);
is(getPostDataString(postData.value), result.postData, "got correct postData for " + data.keyword);
}
cleanupKeywords();
}
var gBMFolder = null;
var gAddedEngines = [];
function setupKeywords() {
var searchService = Cc["@mozilla.org/browser/search-service;1"].
getService(Ci.nsIBrowserSearchService);
gBMFolder = Application.bookmarks.addFolder("keyword-test");
for each (var item in testData) {
var data = item[0];
if (data instanceof bmKeywordData) {
var bm = gBMFolder.addBookmark(data.keyword, data.uri);
bm.keyword = data.keyword;
if (data.postData)
bm.annotations.set("bookmarkProperties/POSTData", data.postData, Ci.nsIAnnotationService.EXPIRE_SESSION);
}
if (data instanceof searchKeywordData) {
searchService.addEngineWithDetails(data.keyword, "", data.keyword, "", data.method, data.uri.spec);
var addedEngine = searchService.getEngineByName(data.keyword);
if (data.postData) {
var [paramName, paramValue] = data.postData.split("=");
addedEngine.addParam(paramName, paramValue, null);
}
gAddedEngines.push(addedEngine);
}
}
}
function cleanupKeywords() {
var searchService = Cc["@mozilla.org/browser/search-service;1"].
getService(Ci.nsIBrowserSearchService);
gBMFolder.remove();
gAddedEngines.map(searchService.removeEngine);
}

Просмотреть файл

@ -13,6 +13,7 @@ browser.jar:
* content/browser/aboutDialog.xul (content/aboutDialog.xul)
* content/browser/aboutDialog.js (content/aboutDialog.js)
content/browser/aboutDialog.css (content/aboutDialog.css)
* content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml)
* content/browser/browser.css (content/browser.css)
* content/browser/browser.js (content/browser.js)
* content/browser/browser.xul (content/browser.xul)

Просмотреть файл

@ -53,6 +53,7 @@ XPIDLSRCS = \
EXTRA_PP_COMPONENTS = \
nsBrowserContentHandler.js \
nsBrowserGlue.js \
aboutRobots.js \
$(NULL)
EXTRA_JS_MODULES = distribution.js

Просмотреть файл

@ -0,0 +1,73 @@
/* ***** 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 About:IceCream.
*
* The Initial Developer of the Original Code is Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ryan Flint <rflint@mozilla.com>
* Justin Dolske <dolske@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
* 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 ***** */
const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
function AboutRobots() {}
AboutRobots.prototype = {
classDescription: "About Robots",
contractID: "@mozilla.org/network/protocol/about;1?what=robots",
classID: Components.ID("{e18da21c-a4b8-4be5-98aa-942e1e19f35c}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
getURIFlags: function(aURI) {
return (Ci.nsIAboutModule.ALLOW_SCRIPT |
Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT);
},
newChannel: function(aURI) {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].
getService(Ci.nsIScriptSecurityManager);
var channel = ios.newChannel("chrome://browser/content/aboutRobots.xhtml",
null, null);
var principal = secMan.getCodebasePrincipal(aURI);
channel.originalURI = aURI;
channel.owner = principal;
return channel;
}
};
function NSGetModule(compMgr, fileSpec)
XPCOMUtils.generateModule([AboutRobots]);

Просмотреть файл

@ -169,16 +169,12 @@ ServiceInfo.prototype = {
function WebContentConverterRegistrar() {}
WebContentConverterRegistrar.prototype = {
_stringBundle: null,
get stringBundle() {
if (!this._stringBundle) {
this._stringBundle = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService).
createBundle(STRING_BUNDLE_URI);
}
return this._stringBundle;
var sb = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService).
createBundle(STRING_BUNDLE_URI);
delete WebContentConverterRegistrar.prototype.stringBundle;
return WebContentConverterRegistrar.prototype.stringBundle = sb;
},
_getFormattedString: function WCCR__getFormattedString(key, params) {

Просмотреть файл

@ -45,6 +45,8 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/distribution.js");
const PREF_EM_NEW_ADDONS_LIST = "extensions.newAddons";
// Factory object
const BrowserGlueServiceFactory = {
_instance: null,
@ -89,6 +91,9 @@ BrowserGlue.prototype = {
case "final-ui-startup":
this._onProfileStartup();
break;
case "sessionstore-windows-restored":
this._onBrowserStartup();
break;
case "browser:purge-session-history":
// reset the console service's error buffer
const cs = Cc["@mozilla.org/consoleservice;1"].
@ -122,6 +127,7 @@ BrowserGlue.prototype = {
osvr.addObserver(this, "xpcom-shutdown", false);
osvr.addObserver(this, "prefservice:after-app-defaults", false);
osvr.addObserver(this, "final-ui-startup", false);
osvr.addObserver(this, "sessionstore-windows-restored", false);
osvr.addObserver(this, "browser:purge-session-history", false);
osvr.addObserver(this, "quit-application-requested", false);
osvr.addObserver(this, "quit-application-granted", false);
@ -138,6 +144,7 @@ BrowserGlue.prototype = {
osvr.removeObserver(this, "xpcom-shutdown");
osvr.removeObserver(this, "prefservice:after-app-defaults");
osvr.removeObserver(this, "final-ui-startup");
osvr.removeObserver(this, "sessionstore-windows-restored");
osvr.removeObserver(this, "browser:purge-session-history");
osvr.removeObserver(this, "quit-application-requested");
osvr.removeObserver(this, "quit-application-granted");
@ -202,6 +209,32 @@ BrowserGlue.prototype = {
this.Sanitizer.onShutdown();
},
// Browser startup complete. All initial windows have opened.
_onBrowserStartup: function()
{
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
// If new add-ons were installed during startup open the add-ons manager.
if (prefBranch.prefHasUserValue(PREF_EM_NEW_ADDONS_LIST)) {
var args = Cc["@mozilla.org/supports-array;1"].
createInstance(Ci.nsISupportsArray);
var str = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
str.data = "";
args.AppendElement(str);
var str = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
str.data = prefBranch.getCharPref(PREF_EM_NEW_ADDONS_LIST);
args.AppendElement(str);
const EMURL = "chrome://mozapps/content/extensions/extensions.xul";
const EMFEATURES = "chrome,menubar,extra-chrome,toolbar,dialog=no,resizable";
var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
ww.openWindow(null, EMURL, "_blank", EMFEATURES, args);
prefBranch.clearUserPref(PREF_EM_NEW_ADDONS_LIST);
}
},
_onQuitRequest: function(aCancelQuit, aQuitType)
{
// If user has already dismissed quit request, then do nothing
@ -418,6 +451,7 @@ BrowserGlue.prototype = {
var collapsed = this._rdf.GetResource("collapsed");
var target;
var moveHome;
var homePattern = /(?:^|,)home-button(?:$|,)/;
// get an nsIRDFResource for the PersonalToolbar item
var personalBar = this._rdf.GetResource("chrome://browser/content/browser.xul#PersonalToolbar");
@ -427,15 +461,19 @@ BrowserGlue.prototype = {
var navBar = this._rdf.GetResource("chrome://browser/content/browser.xul#nav-bar");
target = this._getPersist(navBar, currentSet);
if (target) {
let originalTarget = target;
// move Home if we find it in the nav-bar and the personal toolbar isn't collapsed
moveHome = !personalBarCollapsed && (target.indexOf("home-button") != -1);
if (moveHome)
target = target.replace("home-button", "");
if (!personalBarCollapsed)
target = target.replace(homePattern, ",");
moveHome = (target != originalTarget);
// add the new combined back and forward button
target = "unified-back-forward-button," + target;
if (!/(?:^|,)unified-back-forward-button(?:$|,)/.test(target))
target = "unified-back-forward-button," + target;
this._setPersist(navBar, currentSet, target);
if (target != originalTarget)
this._setPersist(navBar, currentSet, target);
} else {
// nav-bar doesn't have a currentset, so the defaultset will be used,
// which means Home will be moved
@ -446,7 +484,7 @@ BrowserGlue.prototype = {
// If the personal toolbar has a currentset, add Home. The defaultset will be
// used otherwise.
target = this._getPersist(personalBar, currentSet);
if (target && target.indexOf("home-button") == -1)
if (target && !homePattern.test(target))
this._setPersist(personalBar, currentSet, "home-button," + target);
// uncollapse the personal toolbar

Просмотреть файл

@ -162,7 +162,7 @@
<textbox id="editBMPanel_tagsField"
onblur="gEditItemOverlay.onTagsFieldBlur();"
observes="paneElementsBroadcaster"
emptytext="&editBookmarkOverlay.tagsEmptyText.label;"/>
emptytext="&editBookmarkOverlay.tagsEmptyDesc.label;"/>
<button id="editBMPanel_tagsSelectorExpander"
class="expander-down"
tooltiptext="&editBookmarkOverlay.tagsExpanderDown.tooltip;"

Просмотреть файл

@ -94,6 +94,13 @@ var PlacesOrganizer = {
for (var i=0; i < elements.length; i++) {
document.getElementById(elements[i]).setAttribute("disabled", "true");
}
// 3. Disable the keyboard shortcut for the History menu back/forward
// in order to support those in the Library
var historyMenuBack = document.getElementById("historyMenuBack");
historyMenuBack.removeAttribute("key");
var historyMenuForward = document.getElementById("historyMenuForward");
historyMenuForward.removeAttribute("key");
#endif
},

Просмотреть файл

@ -64,6 +64,8 @@
%editMenuOverlayDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<window id="places"
@ -133,6 +135,37 @@
command="OrganizerCommand_find:current"
key="&cmd.find.key;"
modifiers="accel,shift"/>
<!-- Back/Forward Keys Support -->
#ifndef XP_MACOSX
<key id="placesKey_goBackKb"
keycode="VK_LEFT"
command="OrganizerCommand:Back"
modifiers="alt"/>
<key id="placesKey_goForwardKb"
keycode="VK_RIGHT"
command="OrganizerCommand:Forward"
modifiers="alt"/>
#else
<key id="placesKey_goBackKb"
keycode="VK_LEFT"
command="OrganizerCommand:Back"
modifiers="accel"/>
<key id="placesKey_goForwardKb"
keycode="VK_RIGHT"
command="OrganizerCommand:Forward"
modifiers="accel"/>
#endif
#ifdef XP_UNIX
<key id="placesKey_goBackKb2"
key="&goBackCmd.commandKey;"
command="OrganizerCommand:Back"
modifiers="accel"/>
<key id="placesKey_goForwardKb2"
key="&goForwardCmd.commandKey;"
command="OrganizerCommand:Forward"
modifiers="accel"/>
#endif
</keyset>
<keyset id="editMenuKeys">
@ -418,37 +451,38 @@
<tree id="placeContent" class="placesTree" context="placesContext"
flex="1" type="places"
flatList="true"
enableColumnDrag="true"
onkeypress="if (event.keyCode == KeyEvent.DOM_VK_RETURN) PlacesOrganizer.openSelectedNode(event);"
ondblclick="PlacesOrganizer.openSelectedNode(event);"
onopenflatcontainer="PlacesOrganizer.openFlatContainer(aContainer);"
onselect="PlacesOrganizer.onContentTreeSelect();"
onclick="PlacesOrganizer.onTreeClick(event);">
<treecols id="placeContentColumns">
<treecol label="&col.name.label;" anonid="title" flex="5" primary="true"
<treecol label="&col.name.label;" id="placesContentTitle" anonid="title" flex="5" primary="true" ordinal="1"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.tags.label;" anonid="tags" flex="2"
<treecol label="&col.tags.label;" id="placesContentTags" anonid="tags" flex="2"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.url.label;" anonid="url" flex="5"
<treecol label="&col.url.label;" id="placesContentUrl" anonid="url" flex="5"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.lastvisit.label;" anonid="date" flex="1" hidden="true"
<treecol label="&col.lastvisit.label;" id="placesContentDate" anonid="date" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.visitcount.label;" anonid="visitCount" flex="1" hidden="true"
<treecol label="&col.visitcount.label;" id="placesContentVisitCount" anonid="visitCount" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.keyword.label;" anonid="keyword" flex="1" hidden="true"
<treecol label="&col.keyword.label;" id="placesContentKeyword" anonid="keyword" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.description.label;" anonid="description" flex="1" hidden="true"
<treecol label="&col.description.label;" id="placesContentDescription" anonid="description" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.dateadded.label;" anonid="dateAdded" flex="1" hidden="true"
<treecol label="&col.dateadded.label;" id="placesContentDateAdded" anonid="dateAdded" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.lastmodified.label;" anonid="lastModified" flex="1" hidden="true"
<treecol label="&col.lastmodified.label;" id="placesContentLastModified" anonid="lastModified" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
</treecols>
<treechildren flex="1"/>

Просмотреть файл

@ -830,16 +830,21 @@
onDragOver: function TBV_DO_onDragOver(event, flavor, session) {
PlacesControllerDragHelper.currentDropTarget = event.target;
var dropPoint = this._getDropPoint(event);
var ib = this._self._dropIndicatorBar;
if (this._ibTimer) {
this._ibTimer.cancel();
this._ibTimer = null;
}
if (dropPoint.folderNode) {
// Dropping over a menubutton, set styles and timer to open folder.
if (this._overFolder.node != dropPoint.folderNode) {
if (dropPoint.folderNode ||
event.originalTarget == this._self._chevron) {
// Dropping over a menubutton or chevron button
// set styles and timer to open relative menupopup
var overNode = dropPoint.folderNode || this._self._chevron;
if (this._overFolder.node != overNode) {
this._clearOverFolder();
this._overFolder.node = dropPoint.folderNode;
this._overFolder.node = overNode;
this._overFolder.openTimer = this._setTimer(this._overFolder.hoverTime);
}
if (!this._overFolder.node.hasAttribute("dragover"))

Просмотреть файл

@ -438,7 +438,8 @@ PlacesTreeView.prototype = {
COLUMN_TYPE_TAGS: 9,
_getColumnType: function PTV__getColumnType(aColumn) {
var columnType = aColumn.id || aColumn.element.getAttribute("anonid");
var columnType = aColumn.element.getAttribute("anonid") || aColumn.id;
switch (columnType) {
case "title":
return this.COLUMN_TYPE_TITLE;
@ -1095,8 +1096,8 @@ PlacesTreeView.prototype = {
getImageSrc: function PTV_getImageSrc(aRow, aColumn) {
this._ensureValidRow(aRow);
// only the first column has an image
if (aColumn.index != 0)
// only the title column has an image
if (this._getColumnType(aColumn) != this.COLUMN_TYPE_TITLE)
return "";
var node = this._visibleElements[aRow].node;

Просмотреть файл

@ -579,10 +579,25 @@ placesEditBookmarkURITransactions.prototype = {
doTransaction: function PEBUT_doTransaction() {
this._oldURI = PlacesUtils.bookmarks.getBookmarkURI(this._id);
PlacesUtils.bookmarks.changeBookmarkURI(this._id, this._newURI);
// move tags from old URI to new URI
this._tags = PlacesUtils.tagging.getTagsForURI(this._oldURI, {});
if (this._tags.length != 0) {
// only untag the old URI if this is the only bookmark
if (PlacesUtils.getBookmarksForURI(this._oldURI, {}).length == 0)
PlacesUtils.tagging.untagURI(this._oldURI, this._tags);
PlacesUtils.tagging.tagURI(this._newURI, this._tags);
}
},
undoTransaction: function PEBUT_undoTransaction() {
PlacesUtils.bookmarks.changeBookmarkURI(this._id, this._oldURI);
// move tags from new URI to old URI
if (this._tags.length != 0) {
// only untag the new URI if this is the only bookmark
if (PlacesUtils.getBookmarksForURI(this._newURI, {}).length == 0)
PlacesUtils.tagging.untagURI(this._newURI, this._tags);
PlacesUtils.tagging.tagURI(this._oldURI, this._tags);
}
}
};

Просмотреть файл

@ -232,7 +232,7 @@
label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
oncommand="gAdvancedPane.clearCache();"/>
</hbox>
<hbox>
<hbox align="center">
<checkbox id="offlineNotify" flex="1"
label="&offlineNotify.label;" accesskey="&offlineNotify.accesskey;"
preference="browser.offline-apps.notify"

Просмотреть файл

@ -99,7 +99,7 @@
<radiogroup id="networkProxyType" preference="network.proxy.type"
onsyncfrompreference="return gConnectionsDialog.readProxyType();">
<radio value="0" label="&directTypeRadio.label;" accesskey="&directTypeRadio.accesskey;"/>
<radio value="0" label="&noProxyTypeRadio.label;" accesskey="&noProxyTypeRadio.accesskey;"/>
<radio value="4" label="&WPADTypeRadio.label;" accesskey="&WPADTypeRadio.accesskey;"/>
<radio value="5" label="&systemTypeRadio.label;" accesskey="&systemTypeRadio.accesskey;" id="systemPref" hidden="true"/>
<radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;"/>

Просмотреть файл

@ -158,8 +158,7 @@
<radio id="saveTo" value="true"
label="&saveTo.label;"
accesskey="&saveTo.accesskey;"
xmlns:aaa="http://www.w3.org/2005/07/aaa"
aaa:labelledby="saveTo downloadFolder"/>
aria-labelledby="saveTo downloadFolder"/>
<filefield id="downloadFolder" flex="1"
preference="browser.download.folderList"
preference-editable="true"

Просмотреть файл

@ -101,8 +101,7 @@
<script type="application/x-javascript" src="chrome://browser/content/preferences/privacy.js"/>
<!-- History -->
<groupbox id="historyGroup"
xmlns:aaa="http://www.w3.org/2005/07/aaa">
<groupbox id="historyGroup">
<caption label="&history.label;"/>
<hbox align="center">
@ -110,9 +109,9 @@
label="&rememberDaysBefore.label;"
accesskey="&rememberDaysBefore.accesskey;"
oncommand="gPrivacyPane.onchangeHistoryDaysCheck();"
aaa:labelledby="rememberHistoryDays historyDays rememberAfter"/>
aria-labelledby="rememberHistoryDays historyDays rememberAfter"/>
<textbox id="historyDays" type="number" size="3"
aaa:labelledby="rememberHistoryDays historyDays rememberAfter"
aria-labelledby="rememberHistoryDays historyDays rememberAfter"
onkeyup="gPrivacyPane.onkeyupHistoryDaysText();"
preference="browser.history_expire_days_min"/>
<label id="rememberAfter"> &rememberDaysAfter.label;</label>

Просмотреть файл

@ -134,7 +134,7 @@
<hbox id="showPasswordsBox">
<spacer flex="1"/>
<button id="showPasswords"
label="&showPasswords.label;" accesskey="&showPasswords.accesskey;"
label="&savedPasswords.label;" accesskey="&savedPasswords.accesskey;"
oncommand="gSecurityPane.showPasswords();"
preference="pref.privacy.disable_button.view_passwords"/>
</hbox>

Просмотреть файл

@ -136,16 +136,28 @@ PROT_Application.prototype.getReportURL = function(name) {
PROT_Application.prototype.newChannel = function(uri) {
var ioService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
var childURI = ioService.newURI("chrome://browser/content/safebrowsing/blockedSite.xhtml",
null, null);
var channel = ioService.newChannelFromURI(childURI);
channel.originalURI = uri;
// Drop chrome privilege
var principal = secMan.getCodebasePrincipal(uri);
channel.owner = principal;
return channel;
}
PROT_Application.prototype.getURIFlags = function(uri) {
return Ci.nsIAboutModule.ALLOW_SCRIPT;
// We don't particularly *want* people linking to this from
// untrusted content, but given that bad sites can cause this page
// to appear (e.g. by having an iframe pointing to known malware),
// we should code as though this is explicitly possible.
return Ci.nsIAboutModule.ALLOW_SCRIPT |
Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT;
}
PROT_Application.prototype.QueryInterface = function(iid) {

Просмотреть файл

@ -95,32 +95,11 @@
*/
function getHostString()
{
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var url = getURL();
try {
return ios.newURI(url, null, null).host;
} catch (e) {
return url;
}
return document.location.hostname;
}
// Elements that tend to need content set
var errorTitleText, errorShortDescText, errorLongDesc, errorLongDescText;
// The string bundles managing strings for various blocked page scenarios
var sb = srGetStrBundle("chrome://browser/locale/safebrowsing/blockedSite.properties");
var brandBundle = srGetStrBundle("chrome://branding/locale/brand.properties");
var brandShortName = brandBundle.GetStringFromName("brandShortName");
function initPage()
{
// Set up the cached elements
errorTitleText = document.getElementById("errorTitleText");
errorShortDescText = document.getElementById("errorShortDescText");
errorLongDesc = document.getElementById("errorLongDesc");
errorLongDescText = document.getElementById("errorLongDescText");
// Handoff to the appropriate initializer, based on error code
switch(getErrorCode()) {
case "malwareBlocked" :
@ -137,11 +116,20 @@
*/
function initPage_malware()
{
document.title = sb.GetStringFromName("malware.title");
errorTitleText.textContent = document.title;
errorShortDescText.textContent = sb.formatStringFromName("malware.shortDesc",
[getHostString()], 1);
errorLongDesc.innerHTML = sb.GetStringFromName("malware.longDesc");
// Remove phishing strings
var el = document.getElementById("errorTitleText_phishing");
el.parentNode.removeChild(el);
el = document.getElementById("errorShortDescText_phishing");
el.parentNode.removeChild(el);
el = document.getElementById("errorLongDescText_phishing");
el.parentNode.removeChild(el);
// Set sitename
document.getElementById("malware_sitename").textContent = getHostString();
document.title = document.getElementById("errorTitleText_malware")
.innerHTML;
}
/**
@ -149,26 +137,20 @@
*/
function initPage_phishing()
{
document.title = sb.GetStringFromName("phishing.title");
errorTitleText.textContent = document.title;
errorShortDescText.textContent = sb.formatStringFromName("phishing.shortDesc",
[getHostString()], 1);
var longDesc = sb.GetStringFromName("phishing.longDesc");
// Remove malware strings
var el = document.getElementById("errorTitleText_malware");
el.parentNode.removeChild(el);
// If we have a more-info link for the phishing information, add it in,
// otherwise just use the generic text
var faqURL = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref("browser.safebrowsing.warning.infoURL");
if(faqURL && faqURL != "about:blank") {
longDesc += sb.formatStringFromName("phishing.learnMoreLink",
[brandShortName], 1);
errorLongDesc.innerHTML = longDesc;
document.getElementById("faqLink").setAttribute("href", faqURL);
}
else
errorLongDesc.innerHTML = longDesc;
el = document.getElementById("errorShortDescText_malware");
el.parentNode.removeChild(el);
el = document.getElementById("errorLongDescText_malware");
el.parentNode.removeChild(el);
// Set sitename
document.getElementById("phishing_sitename").textContent = getHostString();
document.title = document.getElementById("errorTitleText_phishing")
.innerHTML;
}
]]></script>
</head>
@ -178,25 +160,31 @@
<!-- Error Title -->
<div id="errorTitle">
<h1 id="errorTitleText" />
<h1 id="errorTitleText_phishing">&safeb.blocked.phishing.title;</h1>
<h1 id="errorTitleText_malware">&safeb.blocked.malware.title;</h1>
</div>
<div id="errorLongContent">
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
<p id="errorShortDescText_phishing">&safeb.blocked.phishing.shortDesc;</p>
<p id="errorShortDescText_malware">&safeb.blocked.malware.shortDesc;</p>
</div>
<!-- Long Description -->
<div id="errorLongDesc">
<p id="errorLongDescText" />
<p id="errorLongDescText_phishing">&safeb.blocked.phishing.longDesc;</p>
<p id="errorLongDescText_malware">&safeb.blocked.malware.longDesc;</p>
</div>
<!-- Action buttons -->
<div id="buttons">
<!-- Commands handled in browser.js -->
<xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="getMeOutButton" label="&safeb.palm.accept.label;" oncommand="window.home();" />
id="getMeOutButton" label="&safeb.palm.accept.label;"/>
<xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="reportButton" label="&safeb.palm.report.label;"/>
</div>
</div>
</div>

Просмотреть файл

@ -38,13 +38,13 @@ var safebrowsing = {
appContext: null,
startup: function() {
setTimeout(safebrowsing.deferredStartup, 2000);
setTimeout(function() {
safebrowsing.deferredStartup();
}, 2000);
window.removeEventListener("load", safebrowsing.startup, false);
},
deferredStartup: function() {
this.appContext = Cc["@mozilla.org/safebrowsing/application;1"].
getService().wrappedJSObject;
this.appContext.initialize();
},
@ -56,6 +56,15 @@ var safebrowsing = {
else
broadcaster.disabled = true;
},
/**
* Lazy init getter for appContext
*/
get appContext() {
delete this.appContext;
return this.appContext = Cc["@mozilla.org/safebrowsing/application;1"]
.getService().wrappedJSObject;
},
/**
* Used to report a phishing page or a false positive

Просмотреть файл

@ -2754,6 +2754,12 @@ SearchService.prototype = {
engineToRemove.hidden = true;
engineToRemove.alias = null;
} else {
// Cancel the lazy serialization timer if it's running
if (engineToRemove._serializeTimer) {
engineToRemove._serializeTimer.cancel();
engineToRemove._serializeTimer = null;
}
// Remove the engine file from disk (this might throw)
engineToRemove._remove();
engineToRemove._file = null;

Просмотреть файл

@ -302,7 +302,7 @@ Preference.prototype = {
get type() {
var value = "";
var type = this._prefs.getPrefType(name);
var type = this.branch._prefs.getPrefType(this._name);
switch (type) {
case Ci.nsIPrefBranch2.PREF_STRING:

Просмотреть файл

@ -11,9 +11,9 @@ function test() {
// test getting non-existing values
var itemValue = Application.prefs.getValue(testdata.missing, "default");
is(itemValue, "default", "Check 'Application.prefs.getValue' for non-existing item");
is(Application.prefs.get(testdata.missing), null, "Check 'Application.prefs.get' for non-existing item");
// test setting and getting a value
Application.prefs.setValue(testdata.dummy, "dummy");
itemValue = Application.prefs.getValue(testdata.dummy, "default");
@ -23,7 +23,7 @@ function test() {
Application.prefs.setValue(testdata.dummy, "smarty");
itemValue = Application.prefs.getValue(testdata.dummy, "default");
is(itemValue, "smarty", "Check 'Application.prefs.getValue' for overwritten item");
// test setting and getting a value
Application.prefs.get(testdata.dummy).value = "dummy2";
itemValue = Application.prefs.get(testdata.dummy).value;
@ -31,44 +31,48 @@ function test() {
// test resetting a pref [since there is no default value, the pref should disappear]
Application.prefs.get(testdata.dummy).reset();
var itemValue = Application.prefs.getValue(testdata.dummy, "default");
itemValue = Application.prefs.getValue(testdata.dummy, "default");
is(itemValue, "default", "Check 'Application.prefs.getValue' for reset pref");
// test to see if a non-existant property exists
ok(!Application.prefs.has(testdata.dummy), "Check non-existant property for existance");
// PREF: string browser.active_color == #EE0000
// test to see if an existing string property exists
ok(Application.prefs.has(testdata.string), "Check existing string property for existance");
// test accessing a non-existant string property
var val = Application.prefs.getValue(testdata.dummy, "default");
is(val, "default", "Check non-existant string property for expected value");
// test accessing an existing string property
var val = Application.prefs.getValue(testdata.string, "default");
is(val, "#EE0000", "Check existing string property for expected value");
// test manipulating an existing string property
Application.prefs.setValue(testdata.string, "#EF0000");
var val = Application.prefs.getValue(testdata.string, "default");
is(val, "#EF0000", "Set existing string property");
// test getting the type of an existing string property
var type = Application.prefs.get(testdata.string).type;
is(type, "String", "Check 'Application.prefs.get().type' for string pref");
// test resetting an existing string property
Application.prefs.get(testdata.string).reset();
var val = Application.prefs.getValue(testdata.string, "default");
is(val, "#EE0000", "Reset existing string property");
// PREF: integer permissions.default.image == 1
// test to see if an existing integer property exists
ok(Application.prefs.has(testdata.integer), "Check existing integer property for existance");
// test accessing a non-existant integer property
var val = Application.prefs.getValue(testdata.dummy, 0);
is(val, 0, "Check non-existant integer property for expected value");
// test accessing an existing integer property
var val = Application.prefs.getValue(testdata.integer, 0);
is(val, 1, "Check existing integer property for expected value");
@ -77,35 +81,43 @@ function test() {
Application.prefs.setValue(testdata.integer, 0);
var val = Application.prefs.getValue(testdata.integer, 1);
is(val, 0, "Set existing integer property");
// test getting the type of an existing integer property
var type = Application.prefs.get(testdata.integer).type;
is(type, "Number", "Check 'Application.prefs.get().type' for integer pref");
// test resetting an existing integer property
Application.prefs.get(testdata.integer).reset();
var val = Application.prefs.getValue(testdata.integer, 0);
is(val, 1, "Reset existing integer property");
// PREF: boolean browser.blink_allowed == true
// test to see if an existing boolean property exists
ok(Application.prefs.has(testdata.boolean), "Check existing boolean property for existance");
// test accessing a non-existant boolean property
var val = Application.prefs.getValue(testdata.dummy, true);
ok(val, "Check non-existant boolean property for expected value");
// test accessing an existing boolean property
var val = Application.prefs.getValue(testdata.boolean, false);
ok(val, "Check existing boolean property for expected value");
// test manipulating an existing boolean property
Application.prefs.setValue(testdata.boolean, false);
var val = Application.prefs.getValue(testdata.boolean, true);
ok(!val, "Set existing boolean property");
// test getting the type of an existing boolean property
var type = Application.prefs.get(testdata.boolean).type;
is(type, "Boolean", "Check 'Application.prefs.get().type' for boolean pref");
// test resetting an existing boolean property
Application.prefs.get(testdata.boolean).reset();
var val = Application.prefs.getValue(testdata.boolean, false);
ok(val, "Reset existing string property for expected value");
// test getting all preferences
var allPrefs = Application.prefs.all;
ok(allPrefs.length >= 800, "Check 'Application.prefs.all' for the right number of preferences");
@ -113,29 +125,29 @@ function test() {
// test the value of the preference root
is(Application.prefs.root, "", "Check the Application preference root");
// test for user changed preferences
ok(Application.prefs.get("browser.shell.checkDefaultBrowser").modified, "A single preference is marked as modified.");
ok(!Application.prefs.get(testdata.string).modified, "A single preference is marked as not modified.");
// test for a locked preference
var pref = Application.prefs.get(testdata.string);
ok(!pref.locked, "A single preference should not be locked.");
pref.locked = true;
ok(pref.locked, "A single preference should be locked.");
try {
prev.value = "test value";
ok(false, "A locked preference should not be able to be modified.");
} catch(e){
ok(true, "A locked preference should not be able to be modified.");
}
pref.locked = false;
ok(!pref.locked, "A single preference should not be locked.");
// check for change event when setting a value
waitForExplicitFinish();
Application.prefs.events.addListener("change", onPrefChange);
@ -153,6 +165,6 @@ function onPrefChange(evt) {
function onPrefChange2(evt) {
is(evt.data, testdata.dummy, "Check 'Application.prefs.set' fired a change event for a single preference");
Application.prefs.events.removeListener("change", onPrefChange2);
finish();
}

Просмотреть файл

@ -241,6 +241,7 @@ bin/components/nsContentDispatchChooser.js
bin/components/nsHandlerService.js
bin/components/nsWebHandlerApp.js
bin/components/libdbusservice.so
bin/components/aboutRobots.js
; Modules
bin/modules/*

Просмотреть файл

@ -240,6 +240,7 @@ bin\components\nsContentPrefService.js
bin\components\nsContentDispatchChooser.js
bin\components\nsHandlerService.js
bin\components\nsWebHandlerApp.js
bin\components\aboutRobots.js
; Modules
bin\modules\*

Просмотреть файл

@ -16,7 +16,7 @@
<!-- Movie: Blade Runner. Batty: "I've seen things you people wouldn't believe..." -->
<!ENTITY robots.errorLongDesc2 "Robots have seen things you people wouldn't believe.">
<!-- Book: Hitchiker's Guide To The Galaxy. What the Sirius Cybernetics Corporation calls robots. -->
<!ENTITY robots.errorLongDesc3 "Robots are Your Plastic Pal Who's Fun To Be With">
<!ENTITY robots.errorLongDesc3 "Robots are Your Plastic Pal Who's Fun To Be With.">
<!-- TV: Futurama. Bender's first line is "Bite my shiny metal ass." -->
<!ENTITY robots.errorLongDesc4 "Robots have shiny metal posteriors which should not be bitten.">
<!-- TV: Battlestar Galactica (2004 series). From the opening text. -->

Просмотреть файл

@ -64,7 +64,7 @@
<!ENTITY subscribeToPageMenupopup.label "Subscribe to This Page">
<!ENTITY subscribeToPageMenuitem.label "Subscribe to This Page…">
<!ENTITY addCurPagesCmd.label "Bookmark All Tabs…">
<!ENTITY showAllBookmarksCmd.label "Show All Bookmarks…">
<!ENTITY showAllBookmarksCmd2.label "Organize Bookmarks">
<!ENTITY bookmarkAllCmd.label "Bookmark All Tabs…">
<!ENTITY backCmd.label "Back">
@ -176,7 +176,7 @@
<!ENTITY historyUndoMenu.label "Recently Closed Tabs">
<!ENTITY historyHomeCmd.label "Home">
<!ENTITY showAllHistoryCmd.label "Show All History">
<!ENTITY showAllHistoryCmd2.label "Show All History">
<!ENTITY showAllHistoryCmd.commandkey "H">
<!ENTITY openCmd.commandkey "l">
@ -362,7 +362,7 @@
<!ENTITY editBookmark.edit.label "Edit…">
<!ENTITY editBookmark.edit.accessKey "E">
<!ENTITY identity.unverifiedsite "You are connected to an unverified site.">
<!ENTITY identity.unverifiedsite2 "This web site does not supply identity information.">
<!ENTITY identity.connectedTo "You are connected to">
<!-- Localization note (identity.runBy) : This string appears between a
domain name (above) and an organization name (below). E.g.

Просмотреть файл

@ -119,7 +119,7 @@ identity.unencrypted=Your connection to this web site is not encrypted.
identity.unknown.tooltip=This web site does not supply identity information.
identity.ownerUnknown=(no information provided)
identity.ownerUnknown2=(unknown)
# Downloads Monitor Panel
# LOCALIZATION NOTE (activeDownloads, pausedDownloads): Semi-colon list of plural

Просмотреть файл

@ -12,7 +12,7 @@
<!ENTITY editBookmarkOverlay.expanderUp.tooltip "Hide">
<!ENTITY editBookmarkOverlay.tags.label "Tags:">
<!ENTITY editBookmarkOverlay.tags.accesskey "T">
<!ENTITY editBookmarkOverlay.tagsEmptyText.label "Separate tags with commas.">
<!ENTITY editBookmarkOverlay.tagsEmptyDesc.label "Separate tags with commas">
<!ENTITY editBookmarkOverlay.description.label "Description:">
<!ENTITY editBookmarkOverlay.description.accesskey "D">
<!ENTITY editBookmarkOverlay.keyword.label "Keyword:">

Просмотреть файл

@ -40,6 +40,8 @@
<!ENTITY allowScripts.label "Allow scripts to:">
<!ENTITY moveResizeWindows.label "Move or resize existing windows">
<!ENTITY moveResizeWindows.accesskey "M">
<!ENTITY moveResizeNotAllowed.label "Scripts may not move or resize existing windows">
<!ENTITY raiseLowerWindows.label "Raise or lower windows">
<!ENTITY raiseLowerWindows.accesskey "R">

Просмотреть файл

@ -4,8 +4,8 @@
<!ENTITY window.macWidth "39em">
<!ENTITY proxyTitle.label "Configure Proxies to Access the Internet">
<!ENTITY directTypeRadio.label "Direct connection to the Internet">
<!ENTITY directTypeRadio.accesskey "d">
<!ENTITY noProxyTypeRadio.label "No proxy">
<!ENTITY noProxyTypeRadio.accesskey "x">
<!ENTITY systemTypeRadio.label "Use system proxy settings">
<!ENTITY systemTypeRadio.accesskey "u">
<!ENTITY WPADTypeRadio.label "Auto-detect proxy settings for this network">

Просмотреть файл

@ -22,6 +22,9 @@
<!ENTITY acceptCookies.label "Accept cookies from sites">
<!ENTITY acceptCookies.accesskey "c">
<!ENTITY acceptThirdParty.label "Accept third-party cookies">
<!ENTITY acceptThirdParty.accesskey "p">
<!ENTITY keepUntil.label "Keep until:">
<!ENTITY keepUntil.accesskey "K">

Просмотреть файл

@ -30,8 +30,8 @@
<!ENTITY changeMasterPassword.label "Change Master Password…">
<!ENTITY changeMasterPassword.accesskey "M">
<!ENTITY showPasswords.label "Show Passwords…">
<!ENTITY showPasswords.accesskey "P">
<!ENTITY savedPasswords.label "Saved Passwords…">
<!ENTITY savedPasswords.accesskey "P">
<!ENTITY warnings.label "Warning Messages">

Просмотреть файл

@ -1,12 +1,7 @@
malware.title=Suspected Attack Site!
malware.title2=Reported Attack Site!
malware.shortDesc=The web site at %S has been reported as an attack site and has been blocked based on your security preferences.
malware.longDesc=<p>Attack sites try to install programs that steal private information, use your computer to attack others, or damage your system.</p>\n<p>Web site owners who believe their site has been reported as an attack site in error may <a href='http://www.stopbadware.org/home/reviewinfo' >request a review</a>.</p>
malware.longDesc2=<p>Attack sites try to install programs that steal private information, use your computer to attack others, or damage your system.</p>\n<p>Some attack sites intentionally distribute harmful software, but many are compromised without the knowledge or permission of their owners.</p>
phishing.title=Suspected Web Forgery!
phishing.shortDesc=The web site at %S has been reported as a web forgery designed to trick users into sharing personal or financial information.
phishing.longDesc=<p>Entering any personal information on this page may result in identity theft or other fraud.</p><p>These types of web forgeries are used in scams known as phishing attacks, in which fraudulent web pages and emails are used to imitate sources you may trust.</p>
# Localization note (phishing.learnMoreLink): please leave the HTML tags as-is.
# A localized href is pulled in from user preferences automatically. The anchor
# text, as well as the rest of the sentence, should be translated.
phishing.learnMoreLink=<p>You can find out more about <a id="faqLink" href="">how %S protects you</a> from phishing attacks.</p>
phishing.title2=Reported Web Forgery!
phishing.shortDesc2=The web site at %S has been reported as a web forgery and has been blocked based on your security preferences.
phishing.longDesc2=<p>Web forgeries are designed to trick you into revealing personal or financial information by imitating sources you may trust.</p><p>Entering any information on this web page may result in identity theft or other fraud.</p>

Просмотреть файл

@ -13,5 +13,16 @@
<!ENTITY safeb.palm.decline.label "Ignore this warning">
<!ENTITY safeb.palm.decline.statustext "Close warning" >
<!ENTITY safeb.palm.notforgery.label2 "This isn't a web forgery…">
<!ENTITY safeb.palm.report.label "Why was this site blocked?">
<!ENTITY safeb.urlbaricon.tooltip "This page might be dangerous; click for details.">
<!ENTITY safeb.blocked.malware.title "Reported Attack Site!">
<!-- Localization note (safeb.blocked.malware.shortDesc) - Please don't translate the contents of the <span id="malware_sitename"/> tag. It will be replaced at runtime with a domain name (e.g. www.badsite.com) -->
<!ENTITY safeb.blocked.malware.shortDesc "This web site at <span id='malware_sitename'/> has been reported as an attack site and has been blocked based on your security preferences.">
<!ENTITY safeb.blocked.malware.longDesc "<p>Attack sites try to install programs that steal private information, use your computer to attack others, or damage your system.</p><p>Some attack sites intentionally distribute harmful software, but many are compromised without the knowledge or permission of their owners.</p>">
<!ENTITY safeb.blocked.phishing.title "Reported Web Forgery!">
<!-- Localization note (safeb.blocked.phishing.shortDesc) - Please don't translate the contents of the <span id="phishing_sitename"/> tag. It will be replaced at runtime with a domain name (e.g. www.badsite.com) -->
<!ENTITY safeb.blocked.phishing.shortDesc "This web site at <span id='phishing_sitename'/> has been reported as a web forgery and has been blocked based on your security preferences.">
<!ENTITY safeb.blocked.phishing.longDesc "<p>Web forgeries are designed to trick you into revealing personal or financial information by imitating sources you may trust.</p><p>Entering any information on this web page may result in identity theft or other fraud.</p>">

Просмотреть файл

@ -468,9 +468,9 @@ Contributors:
<em>Change Master Password…</em> button. If a master password is already
set, you will need to enter it in order to change or remove the master password.</p>
<p><em>Show Passwords…</em><br/>
<p><em>Saved Passwords…</em><br/>
You can manage saved passwords and delete individual passwords by clicking
the <em>View Saved Passwords</em> button.</p>
the <em>Saved Passwords</em> button.</p>
<h3 id="warning_messages">Warning Messages</h3>
<p>Click the <em>Settings…</em> button to configure the security warnings

Просмотреть файл

@ -61,6 +61,7 @@ CONTEXT_SAFE_MODE=$BrandShortName &Safe Mode
SAFE_MODE=Safe Mode
OPTIONS_PAGE_TITLE=Setup Type
OPTIONS_PAGE_SUBTITLE=Choose setup options
OPTIONS_MAKE_DEFAULT=&Use $BrandShortName as my default web browser
SHORTCUTS_PAGE_TITLE=Set Up Shortcuts
SHORTCUTS_PAGE_SUBTITLE=Create Program Icons
SUMMARY_PAGE_TITLE=Summary
@ -68,6 +69,7 @@ SUMMARY_PAGE_SUBTITLE=Ready to start installing $BrandShortName
SUMMARY_INSTALLED_TO=$BrandShortName will be installed to the following location:
SUMMARY_REBOOT_REQUIRED_INSTALL=A restart of your computer may be required to complete the installation.
SUMMARY_REBOOT_REQUIRED_UNINSTALL=A restart of your computer may be required to complete the uninstall.
SUMMARY_MAKE_DEAFULT=$BrandShortName will be set as your default web browser.
SUMMARY_CLICK=Click Install to continue.
SURVEY_TEXT=&Tell us what you thought of $BrandShortName
LAUNCH_TEXT=&Launch $BrandShortName now

Просмотреть файл

@ -2,7 +2,7 @@
<ShortName>Amazon.com</ShortName>
<Description>Amazon.com Search</Description>
<InputEncoding>ISO-8859-1</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsQAAALEAGtI711AAAAB3RJTUUH0wESEi0MqTATXwAAAjVJREFUeJyFUlGLElEU/mbVHd2aaaRgWGyJgmXRINiXfJCeRgaiLEiKgYXoRQrqRejNH7D1uNBDPvbWtGxvS64IG2IIQQhxScpYMpt1l1qdptVVZ+z2oM6qu9KBC4dzv/Od73z3AmPROmjeVlWVKopCRVGkHMdRURSpoig0lUrRcfxI6LoelWV5GwCddOLx+PEklmVej0QiI80Oh4OyLHuE5Fgl/aJ9gsEgzefzm4SQzVgs9n8VqqqO7EwIsUGEkEscx9kEsizbd85BEo3eenzzRkRstTsfAVwRBOH+EP/DSb4x4wVN0wq5XE7MZDKz5XIZlUoFtVoNu7u7NkaWZaTTaWZEQV8qDYfDKBaLkwZOVkAI8UuS9GkwiWVZNBr7sLZeo1V6hb/GFrxGwW6s84twzYbgGBRM0/yZzWZtQCKRQGhuD80PT0DbdUzxF9DmA2jzAbiNIjztHUzvvT+UIoqi7TLHcVTX9QeWZVLLMikh5Nzwf2h9USlNgtIk6NSAoNlsYjgXBOG50+liAGCe3/72ayOGP28f9fZ2ewEAv89GYRMEAgGboNvtYjBtf0PB9BsZJz8/Q7dR7d3Xeia75+/0XsGyTEqNrzC/p9HVSzCr7w4N+7GGOr+IE6GnOH3+KgCgo2XhAeCak+DU16PUWL0Mr1EYfdO+027/PZxaWIKJmY4kSaX1lysXnat+HARXMOM5wzA0iSP/etDILixhp9aGz+djAEDTtLt8aflFt1GFcG2NAYB/rN8dqx12fbIAAAAASUVORK5CYII=</Image>
<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=</Image>
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/">
<Param name="field-keywords" value="{searchTerms}"/>
<Param name="mode" value="blended"/>

Просмотреть файл

@ -2,7 +2,7 @@
<ShortName>Creative Commons</ShortName>
<Description>Find photos, movies, music, and text to rip, sample, mash, and share.</Description>
<InputEncoding>utf-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA2UExURf///wAAAD8/P+/v7y8vL19fX9/f37+/vw8PD8/Pz09PT5+fn4+Pj6+vr29vbx8fH39/f////3TGU44AAAASdFJOU///////////////////////AOK/vxIAAACWSURBVHjaNI8LEsQgCEMJIvi3vf9lN3bbN6MD0USUm3QFaVNYc7kBuvLZ0xG8oLkQV1iiYBjyktFE+tk+FCEGl3oFT0aSQBaoVDAmAyWkmOCitVfHTvV4BEsWxqyleE+PYLQAi5b9WJShPnh7MnQytDP1IxmfvZXq22dkTkpZ4/TT/qPfiX/dqoXJz+dItE0tx6l/AgwA0e4FeJjn5bsAAAAASUVORK5CYII=</Image>
<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJUSURBVDiNjZO9S1thGMXPvTfJFbnkipNkLLS0ksFg0M0lf4CboNCEgIIg/RiKtEOn0qGWTtbVoBYcIji10I9J0ApWCjp0kRaXdhHjTW4+uGnur4NJ8GOwZ3nf4TnnfZ5z3scAdBGGYdyVdN+yrGHTNNOtVqsVhuG+pO+S3gE/LtV3BIxzPDJNc8FxHGN0dNRKpVIGoJ2dndr+/r5Vr9cl6bmkN0AoSQIEyHXdj5KYnZ3F932uolKpkM/nK5KQ9FmSCZwLOI7zQBLr6+vXiFdRLBaDtsiTTve3YrFYkM/nbyR3MDU1dSKpLumO+vr6Xruui+d5AFSrVVZWVtjY2KDRaABwdHTE4uIie3t7AJTLZaLRaFXSCyUSid1MJgOA53n09/eTTqdJJpPMzc2xurqKbduMj48Tj8fZ3d0FYHBw8FjSezmOU56fnwdgeXkZ27ap1WpUKhWazSZjY2Nks1kASqVSd4zp6eljSX/MtiHdRDpnEATyfb+bkiSVSqXu3TCM8xgHBga+dkY4OzvDdV2GhoZIJBLMzMxQKBSIRqNkMhlisRhbW1sAJJPJn5I+KB6Pv7poou/7rK2tsbm5SRAEXROXlpY4ODgAoFarYdu2J+llN8ZcLvffMeZyud+SGpLuCVBPT89jSRQKhRvJxWKxISmU9JTOT5Rk9Pb2fpHE5OQkJycn14inp6dMTEx4bdM/SbKAy8sk6WEkElmwLCuSSqUYGRmxgHB7e7t+eHgYazabgaRnkt7SeZnr63xbUtYwjGHTNNNhGP4F9iR9a6/zr4v1/wDE1D9XlC4rrAAAAABJRU5ErkJggg==</Image>
<Url type="text/html" method="GET" template="http://search.creativecommons.org/">
<Param name="q" value="{searchTerms}"/>
<Param name="sourceid" value="Mozilla-search"/>

Просмотреть файл

@ -2,7 +2,7 @@
<ShortName>eBay</ShortName>
<Description>eBay - Online actions</Description>
<InputEncoding>ISO-8859-1</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAMQAAAAAAMz/zMwAADMAzOfn1sxmAP///5kAZpnM////AACZM/777zPMAP+ZAP8AAP9mmf/MzMwAZjNmAADMM/+ZM/9mM//MMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAQUAP8ALAAAAAAQABAAAAVPoCGOZGmeaKqiQDkMYqAoBqMELpxUlVTfBohjeHjBLJLZZCF0GASOAWJQSFAUE1FTwIUNKoYKTQslGCLSb6MBFD2G3Zdo0k4tVvi8fl8KAQA7</Image>
<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAADAAAAA/wAAAABAAABAQAAAgEAAAMBAAAD/QAAAAIAAAECAAACAgAAAwIAAAP+AAAAAwAAAQMAAAIDAAADAwAAA/8AAAAD/AABA/wAAgP8AAMD/AAD//wAAAABAAEAAQACAAEAAwABAAP8AQAAAQEAAQEBAAIBAQADAQEAA/0BAAACAQABAgEAAgIBAAMCAQAD/gEAAAMBAAEDAQACAwEAAwMBAAP/AQAAA/0AAQP9AAID/QADA/0AA//9AAAAAgABAAIAAgACAAMAAgAD/AIAAAECAAEBAgACAQIAAwECAAP9AgAAAgIAAQICAAICAgADAgIAA/4CAAADAgABAwIAAgMCAAMDAgAD/wIAAAP+AAED/gACA/4AAwP+AAP//gAAAAMAAQADAAIAAwADAAMAA/wDAAABAwABAQMAAgEDAAMBAwAD/QMAAAIDAAECAwACAgMAAwIDAAP+AwAAAwMAAQMDAAIDAwADAwMAA/8DAAAD/wABA/8AAgP/AAMD/wAD//8AAAAD/AEAA/wCAAP8AwAD/AP8A/wAAQP8AQED/AIBA/wDAQP8A/0D/AACA/wBAgP8AgID/AMCA/wD/gP8AAMD/AEDA/wCAwP8AwMD/AP/A/wAA//8AQP//AID//wDA//8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8fHx8fHx8fHx8fHx8AAB8cGRkUFAcHBx8fBUKfAAAfFBkfHxNHF4cb29vCnwAAHxkZFBQUBx8HG98bwp8fAB8ZGR8UGQcXhxvb28KFXx8fHZkZGRNHBwcfG8jCgoQfAB8fHx8HBx8b29vCnwPCnwAAAB8fBwcfHx8EBB8Dwp8AAAAAHx8fHwAfHx8AHx8fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAD//wAA//8AAP//AACAAwAAAAMAAAADAAAAAQAAAAAAAAAAAACAAAAA4AAAAPCIAAD//wAA//8AAP//AAA=</Image>
<Url type="text/html" method="GET" template="http://search.ebay.com/search/search.dll">
<Param name="query" value="{searchTerms}"/>
<Param name="MfcISAPICommand" value="GetResult"/>

Просмотреть файл

@ -455,7 +455,7 @@ menuitem[key="key_openHelp"] {
list-style-image: url("chrome://browser/skin/Toolbar.png");
}
.toolbarbutton-1 .toolbarbutton-icon {
.toolbarbutton-1 > .toolbarbutton-icon {
-moz-margin-end: 0px;
}
@ -601,10 +601,6 @@ toolbar[iconsize="small"] .toolbarbutton-1 {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
}
toolbar[iconsize="small"] .toolbarbutton-1 .toolbarbutton-icon {
-moz-margin-end: 0px;
}
toolbar[iconsize="small"] .toolbarbutton-1[type="menu-button"] {
border: 0 !important;
}

Двоичные данные
browser/themes/gnomestripe/browser/identity.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 10 KiB

После

Ширина:  |  Высота:  |  Размер: 9.5 KiB

Просмотреть файл

@ -150,7 +150,7 @@ groupbox.treebox .groupbox-body {
}
#general-security-identity {
white-space: -moz-pre-wrap;
white-space: pre-wrap;
line-height: 2em;
}

Просмотреть файл

@ -298,13 +298,6 @@ toolbar[mode="icons"] #forward-button .toolbarbutton-text-box,
display: none;
}
toolbar[mode="icons"] #back-button .toolbarbutton-text-box,
toolbar[mode="icons"] #forward-button .toolbarbutton-text-box,
#back-button .toolbarbutton-menubutton-dropmarker,
#forward-button .toolbarbutton-menubutton-dropmarker {
display: none;
}
/* ----- DEFAULT PRIMARY TOOLBAR BUTTONS ----- */
.toolbarbutton-text-shadow,

Просмотреть файл

@ -147,7 +147,7 @@ groupbox.treebox .groupbox-body {
}
#general-security-identity {
white-space: -moz-pre-wrap;
white-space: pre-wrap;
line-height: 2em;
}

Просмотреть файл

@ -189,7 +189,7 @@ menuitem.bookmark-item {
list-style-image: url("chrome://browser/skin/Toolbar.png");
}
.toolbarbutton-1 .toolbarbutton-icon {
.toolbarbutton-1 > .toolbarbutton-icon {
-moz-margin-end: 0px;
}
@ -198,7 +198,8 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
min-width: 57px;
}
.toolbarbutton-1, .toolbarbutton-menubutton-button {
.toolbarbutton-1,
.toolbarbutton-menubutton-button {
padding: 5px;
}
@ -208,19 +209,14 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
/* ::::: unified back and forward buttons ::::: */
/* wrapper containing back, forward, and dropmarker, when unified with keyhole icons */
toolbar[iconsize="large"][mode="icons"] #unified-back-forward-button > .toolbarbutton-1 {
-moz-appearance: none;
border: none;
padding: 0;
}
/* unified back button with keyhole icons */
toolbar[iconsize="large"][mode="icons"] #back-button {
-moz-appearance: none;
-moz-image-region: rect(0px 398px 34px 360px);
padding: 0;
-moz-padding-start: 2px;
border: none;
}
toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):hover {
-moz-image-region: rect(34px 398px 68px 360px);
@ -250,7 +246,10 @@ toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disab
/* unified forward button with keyhole icons */
toolbar[iconsize="large"][mode="icons"] #forward-button {
-moz-appearance: none;
-moz-image-region: rect(3px 424px 31px 398px);
padding: 0;
border: none;
}
toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):hover {
-moz-image-region: rect(37px 424px 65px 398px);
@ -291,7 +290,6 @@ toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker > image {
display: -moz-box;
margin: 0;
padding-top: 1px;
}
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker > dropmarker {
@ -330,10 +328,6 @@ toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"
/* ::::: 24px primary toolbar buttons ::::: */
toolbar:not([iconsize="small"]) .toolbarbutton-1 .toolbarbutton-icon {
padding-top: 1px;
}
/* back button */
#back-button {
@ -507,7 +501,7 @@ toolbar:not([iconsize="small"]) .toolbarbutton-1 .toolbarbutton-icon {
/* new tab button */
toolbar:not([iconsize="small"]) #new-tab-button .toolbarbutton-icon {
toolbar:not([iconsize="small"]) #new-tab-button > .toolbarbutton-icon {
padding-left: 1px;
}
#new-tab-button {
@ -525,7 +519,7 @@ toolbar:not([iconsize="small"]) #new-tab-button .toolbarbutton-icon {
/* new window button */
toolbar:not([iconsize="small"]) #new-window-button .toolbarbutton-icon {
toolbar:not([iconsize="small"]) #new-window-button > .toolbarbutton-icon {
padding-left: 1px;
}
#new-window-button {
@ -594,17 +588,13 @@ toolbar[iconsize="small"] .toolbarbutton-1 {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
}
toolbar[iconsize="small"] .toolbarbutton-1 .toolbarbutton-icon {
-moz-margin-end: 0px;
}
toolbar[iconsize="small"] .toolbarbutton-1[type="menu-button"] {
border: 0 !important;
}
/* back button */
toolbar[iconsize="small"] #back-button .toolbarbutton-icon {
toolbar[iconsize="small"] #back-button > .toolbarbutton-icon {
padding-right: 1px;
}
toolbar[iconsize="small"] #back-button {
@ -641,7 +631,7 @@ menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
/* forward button */
toolbar[iconsize="small"] #forward-button .toolbarbutton-icon {
toolbar[iconsize="small"] #forward-button > .toolbarbutton-icon {
padding-right: 1px;
}
toolbar[iconsize="small"] #forward-button {
@ -678,7 +668,7 @@ menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
/* stop button */
toolbar[iconsize="small"] #stop-button .toolbarbutton-icon {
toolbar[iconsize="small"] #stop-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #stop-button {
@ -696,7 +686,7 @@ toolbar[iconsize="small"] #stop-button:not([disabled="true"]):hover:active {
/* reload button */
toolbar[iconsize="small"] #reload-button .toolbarbutton-icon {
toolbar[iconsize="small"] #reload-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #reload-button {
@ -714,7 +704,7 @@ toolbar[iconsize="small"] #reload-button:not([disabled="true"]):hover:active {
/* home button */
toolbar[iconsize="small"] #home-button.toolbarbutton-1 .toolbarbutton-icon {
toolbar[iconsize="small"] #home-button.toolbarbutton-1 > .toolbarbutton-icon {
padding-left: 1px;
}
#home-button.bookmark-item {
@ -739,7 +729,7 @@ toolbar[iconsize="small"] #home-button:not([disabled="true"]):hover:active ,
/* download manager button */
toolbar[iconsize="small"] #downloads-button .toolbarbutton-icon {
toolbar[iconsize="small"] #downloads-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #downloads-button {
@ -757,7 +747,7 @@ toolbar[iconsize="small"] #downloads-button:not([disabled="true"]):hover:active
/* history sidebar button */
toolbar[iconsize="small"] #history-button .toolbarbutton-icon {
toolbar[iconsize="small"] #history-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #history-button {
@ -778,7 +768,7 @@ toolbar[iconsize="small"] #history-button:not([disabled="true"]):not([checked="t
/* bookmark sidebar button */
toolbar[iconsize="small"] #bookmarks-button .toolbarbutton-icon {
toolbar[iconsize="small"] #bookmarks-button > .toolbarbutton-icon {
padding-left: 2px;
}
toolbar[iconsize="small"] #bookmarks-button {
@ -799,7 +789,7 @@ toolbar[iconsize="small"] #bookmarks-button:not([disabled="true"]):not([checked=
/* print button */
toolbar[iconsize="small"] #print-button .toolbarbutton-icon {
toolbar[iconsize="small"] #print-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #print-button {
@ -817,7 +807,7 @@ toolbar[iconsize="small"] #print-button:not([disabled="true"]):hover:active {
/* new tab button */
toolbar[iconsize="small"] #new-tab-button .toolbarbutton-icon {
toolbar[iconsize="small"] #new-tab-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #new-tab-button {
@ -850,7 +840,7 @@ toolbar[iconsize="small"] #new-window-button:not([disabled="true"]):hover:active
/* cut button */
toolbar[iconsize="small"] #cut-button .toolbarbutton-icon {
toolbar[iconsize="small"] #cut-button > .toolbarbutton-icon {
padding-right: 1px;
}
toolbar[iconsize="small"] #cut-button {
@ -868,7 +858,7 @@ toolbar[iconsize="small"] #cut-button:not([disabled="true"]):hover:active {
/* copy button */
toolbar[iconsize="small"] #copy-button .toolbarbutton-icon {
toolbar[iconsize="small"] #copy-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #copy-button {
@ -886,7 +876,7 @@ toolbar[iconsize="small"] #copy-button:not([disabled="true"]):hover:active {
/* paste button */
toolbar[iconsize="small"] #paste-button .toolbarbutton-icon {
toolbar[iconsize="small"] #paste-button > .toolbarbutton-icon {
padding-left: 1px;
}
toolbar[iconsize="small"] #paste-button {
@ -1192,8 +1182,7 @@ toolbar[mode="text"] #navigator-throbber[busy="true"] {
/* Tabstrip */
.tabbrowser-tabs {
padding-top: 0px;
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tabbrowser-tabs-bkgnd.png");
background-repeat: repeat-x;
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tabbrowser-tabs-bkgnd.png") repeat-x;
}
.tabs-container:not([overflow="true"]) {
@ -1229,13 +1218,14 @@ toolbar[mode="text"] #navigator-throbber[busy="true"] {
.tabbrowser-tab:not([selected="true"]):hover {
margin: 2px 0px 4px;
padding: 2px 1px 1px;
background: url("chrome://browser/skin/tabbrowser/tab-active-bkgnd.png") repeat-x;
background-image: url("chrome://browser/skin/tabbrowser/tab-hover-bkgnd.png");
}
.tabbrowser-tab[selected="true"] {
margin: 2px 0px 3px;
padding: 1px;
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tab-active-bkgnd.png") repeat-x;
background-image: url("chrome://browser/skin/tabbrowser/tab-active-bkgnd.png");
background-color: -moz-dialog;
font-weight: bold;
}
@ -1342,8 +1332,7 @@ tabpanels {
-moz-border-top-colors: ThreeDShadow rgba(255,255,255,.3);
-moz-border-right-colors: ThreeDShadow;
-moz-border-left-colors: ThreeDShadow rgba(255,255,255,.3);
background: url("chrome://browser/skin/tabbrowser/tab-bkgnd.png");
background-repeat: repeat-x;
background: url("chrome://browser/skin/tabbrowser/tab-bkgnd.png") repeat-x;
-moz-image-region: rect(0, 11px, 14px, 0);
}
@ -1355,8 +1344,7 @@ tabpanels {
-moz-border-top-colors: ThreeDShadow;
-moz-border-right-colors: ThreeDShadow;
-moz-border-left-colors: ThreeDShadow transparent;
background: url("chrome://browser/skin/tabbrowser/tab-active-bkgnd.png");
background-repeat: repeat-x;
background-image: url("chrome://browser/skin/tabbrowser/tab-hover-bkgnd.png");
}
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled="true"]):hover,
@ -1484,8 +1472,7 @@ stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
.tabs-container > .tabs-closebutton {
margin: 3px 0px 3px;
padding: 4px 2px 2px;
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tab-active-bkgnd.png");
background-repeat: repeat-x;
background: -moz-dialog url("chrome://browser/skin/tabbrowser/tab-active-bkgnd.png") repeat-x;
border-left: 1px solid threedshadow;
border-top: 1px solid threedshadow;
-moz-border-radius-topleft: 2px;

Просмотреть файл

@ -144,6 +144,8 @@ classic.jar:
skin/classic/aero/browser/tabbrowser/tab-bkgnd.png (tabbrowser/tab-bkgnd.png)
skin/classic/browser/tabbrowser/tab-active-bkgnd.png (tabbrowser/tab-active-bkgnd.png)
skin/classic/aero/browser/tabbrowser/tab-active-bkgnd.png (tabbrowser/tab-active-bkgnd.png)
skin/classic/browser/tabbrowser/tab-hover-bkgnd.png (tabbrowser/tab-hover-bkgnd.png)
skin/classic/aero/browser/tabbrowser/tab-hover-bkgnd.png (tabbrowser/tab-hover-bkgnd.png)
skin/classic/browser/tabbrowser/tabstrip-bottom.png (tabbrowser/tabstrip-bottom.png)
skin/classic/aero/browser/tabbrowser/tabstrip-bottom.png (tabbrowser/tabstrip-bottom.png)
icon.png

Просмотреть файл

@ -168,7 +168,7 @@ groupbox.treebox .groupbox-body {
}
#general-security-identity {
white-space: -moz-pre-wrap;
white-space: pre-wrap;
line-height: 2em;
}

Двоичные данные
browser/themes/winstripe/browser/tabbrowser/tab-hover-bkgnd.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 892 B

Просмотреть файл

@ -224,7 +224,7 @@ interface nsIPrincipal : nsISerializable
* if the load is not allowed.
* @throws NS_ERROR_DOM_BAD_URI if the load is not allowed.
*/
[noscript] void checkMayLoad(in nsIUri uri, in boolean report);
[noscript] void checkMayLoad(in nsIURI uri, in boolean report);
/**
* The subject name for the certificate. This actually identifies the

Просмотреть файл

@ -700,6 +700,7 @@ nsChromeRegistry::Canonify(nsIURL* aChromeURL)
return NS_ERROR_DOM_BAD_URI;
break;
case '?':
case '#':
pos = end;
continue;
}

Просмотреть файл

@ -183,6 +183,29 @@ clobber clobber_all: clean
# Do everything from scratch
everything: clean build
####################################
# Profile-Guided Optimization
# To use this, you should set the following variables in your mozconfig
# mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
#
# The profile script should exercise the functionality to be included
# in the profile feedback.
#
# This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
# is usable in multi-pass builds, where you might not have a runnable
# application until all the build passes and postflight scripts have run.
ifdef MOZ_OBJDIR
PGO_OBJDIR = $(MOZ_OBJDIR)
else
PGO_OBJDIR := $(TOPSRCDIR)
endif
profiledbuild::
$(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_GENERATE=1
OBJDIR=${PGO_OBJDIR} $(PROFILE_GEN_SCRIPT)
$(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
$(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_USE=1
#####################################################
# Build date unification
@ -198,7 +221,7 @@ endif
#####################################################
# Preflight, before building any project
build profiledbuild alldep preflight_all::
build alldep preflight_all::
ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
# Don't run preflight_all for individual projects in multi-project builds
# (when MOZ_CURRENT_PROJECT is set.)
@ -222,7 +245,7 @@ endif
# loop through them.
ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
configure depend build profiledbuild install export libs clean realclean distclean alldep preflight postflight::
configure depend build install export libs clean realclean distclean alldep preflight postflight maybe_clobber_profiledbuild::
set -e; \
for app in $(MOZ_BUILD_PROJECTS); do \
$(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
@ -308,7 +331,7 @@ depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
####################################
# Preflight
build profiledbuild alldep preflight::
build alldep preflight::
ifdef MOZ_PREFLIGHT
set -e; \
for mkfile in $(MOZ_PREFLIGHT); do \
@ -322,31 +345,17 @@ endif
build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
$(MOZ_MAKE)
####################################
# Profile-feedback build (gcc only)
# To use this, you should set the following variables in your mozconfig
# mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
#
# The profile script should exercise the functionality to be included
# in the profile feedback.
profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
$(MOZ_MAKE) MOZ_PROFILE_GENERATE=1
OBJDIR=${OBJDIR} $(PROFILE_GEN_SCRIPT)
$(MOZ_MAKE) maybe_clobber_profiledbuild
$(MOZ_MAKE) MOZ_PROFILE_USE=1
####################################
# Other targets
# Pass these target onto the real build system
install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
install export libs clean realclean distclean alldep maybe_clobber_profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
$(MOZ_MAKE) $@
####################################
# Postflight
build profiledbuild alldep postflight::
build alldep postflight::
ifdef MOZ_POSTFLIGHT
set -e; \
for mkfile in $(MOZ_POSTFLIGHT); do \
@ -359,7 +368,7 @@ endif # MOZ_CURRENT_PROJECT
####################################
# Postflight, after building all projects
build profiledbuild alldep postflight_all::
build alldep postflight_all::
ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
# Don't run postflight_all for individual projects in multi-project builds
# (when MOZ_CURRENT_PROJECT is set.)
@ -394,4 +403,4 @@ cleansrcdir:
echo-variable-%:
@echo $($*)
.PHONY: checkout real_checkout depend build profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all
.PHONY: checkout real_checkout depend build profiledbuild maybe_clobber_profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all

Просмотреть файл

@ -283,6 +283,7 @@ MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE = @MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE@
PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@

Просмотреть файл

@ -351,6 +351,11 @@ DSO_PIC_CFLAGS=
endif
endif
# This comes from configure
ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
NO_PROFILE_GUIDED_OPTIMIZE = 1
endif
# Enable profile-based feedback
ifndef NO_PROFILE_GUIDED_OPTIMIZE
ifdef MOZ_PROFILE_GENERATE

Просмотреть файл

@ -117,7 +117,7 @@ LIBART_VERSION=2.3.4
CAIRO_VERSION=1.5.2
GLITZ_VERSION=0.4.0
PANGO_VERSION=1.10.0
GTK2_VERSION=1.8.0
GTK2_VERSION=2.10.0
MAKE_VERSION=3.78
WINDRES_VERSION=2.14.90
W32API_VERSION=3.8
@ -6540,6 +6540,15 @@ dnl Test for profiling options
dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
dnl Provide a switch to disable PGO even when called via profiledbuild.
MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
[ --disable-profile-guided-optimization
Don't build with PGO even if called via make profiledbuild],
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fprofile-generate"

Просмотреть файл

@ -901,10 +901,13 @@ public:
*
* @param aContextNode the node which is used to resolve namespaces
* @param aFragment the string which is parsed to a DocumentFragment
* @param aWillOwnFragment is PR_TRUE if ownership of the fragment should be
* transferred to the caller.
* @param aReturn [out] the created DocumentFragment
*/
static nsresult CreateContextualFragment(nsIDOMNode* aContextNode,
const nsAString& aFragment,
PRBool aWillOwnFragment,
nsIDOMDocumentFragment** aReturn);
/**

Просмотреть файл

@ -1714,7 +1714,7 @@ nsTransferableFactory::SerializeNodeOrSelection(nsIDOMWindow* inWindow,
NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
PRUint32 flags = nsIDocumentEncoder::OutputAbsoluteLinks |
nsIDocumentEncoder::OutputEncodeW3CEntities;
nsIDocumentEncoder::OutputEncodeHTMLEntities;
nsCOMPtr<nsIDOMRange> range;
nsCOMPtr<nsISelection> selection;
if (inNode) {

Просмотреть файл

@ -3354,6 +3354,7 @@ nsContentUtils::IsValidNodeName(nsIAtom *aLocalName, nsIAtom *aPrefix,
nsresult
nsContentUtils::CreateContextualFragment(nsIDOMNode* aContextNode,
const nsAString& aFragment,
PRBool aWillOwnFragment,
nsIDOMDocumentFragment** aReturn)
{
NS_ENSURE_ARG(aContextNode);
@ -3499,7 +3500,7 @@ nsContentUtils::CreateContextualFragment(nsIDOMNode* aContextNode,
rv = parser->ParseFragment(aFragment, nsnull, tagStack,
!bHTML, contentType, mode);
if (NS_SUCCEEDED(rv)) {
rv = sink->GetFragment(aReturn);
rv = sink->GetFragment(aWillOwnFragment, aReturn);
}
document->SetFragmentParser(parser);

Просмотреть файл

@ -137,7 +137,6 @@
#include "nsCycleCollectionParticipant.h"
#include "nsCCUncollectableMarker.h"
#include "nsCycleCollector.h"
#ifdef MOZ_SVG
PRBool NS_SVG_TestFeature(const nsAString &fstr);
@ -1200,9 +1199,6 @@ nsGenericElement::~nsGenericElement()
{
NS_PRECONDITION(!IsInDoc(),
"Please remove this from the document properly");
#ifdef DEBUG
nsCycleCollector_DEBUG_wasFreed(static_cast<nsINode*>(this));
#endif
}
NS_IMETHODIMP
@ -2229,9 +2225,6 @@ nsGenericElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent)
}
nsNodeUtils::ParentChainChanged(this);
#ifdef DEBUG
nsCycleCollector_DEBUG_shouldBeFreed(static_cast<nsINode*>(this));
#endif
}
nsresult

Просмотреть файл

@ -597,7 +597,7 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag)
// Try to figure out here whether we have a
// preformatted style attribute.
//
// Trigger on the presence of a "-moz-pre-wrap" in the
// Trigger on the presence of a "pre-wrap" in the
// style attribute. That's a very simplistic way to do
// it, but better than nothing.
// Also set mWrapColumn to the value given there

Просмотреть файл

@ -1794,8 +1794,9 @@ nsRange::CreateContextualFragment(const nsAString& aFragment,
nsIDOMDocumentFragment** aReturn)
{
nsCOMPtr<nsIDOMNode> start = do_QueryInterface(mStartParent);
return
mIsPositioned
? nsContentUtils::CreateContextualFragment(start, aFragment, aReturn)
: NS_ERROR_FAILURE;
if (mIsPositioned) {
return nsContentUtils::CreateContextualFragment(start, aFragment, PR_TRUE,
aReturn);
}
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -175,6 +175,7 @@ _TEST_FILES = test_bug5141.html \
test_bug417384.html \
test_bug418214.html \
test_bug420609.xhtml \
test_bug420700.html \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=420700
-->
<head>
<title>Test for Bug 420700</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=420700">Mozilla Bug 420700</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
var r = document.createRange();
r.selectNode(document.documentElement);
var df = r.createContextualFragment("<p>BAD</p>");
var display = document.getElementById("display");
display.innerHTML = "<p>GOOD</p>";
var p = display.firstChild;
is(p.textContent, "GOOD", "createContextualFragment tests");
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function stringify(a) {
if (a)
return a.toSource();
return ''+a;
}
var args = [undefined, null, [], {}, 0, "0"];
var stringArgs = args.map(stringify);
function test_method(context, method, arity) {
function testParams(existingParams, depth) {
for each (var arg in stringArgs) {
var code = "context[method](" + existingParams + arg + ")";
try {
eval(code);
} catch (ex) {
// Exceptions are expected
}
if (depth < arity)
testParams(existingParams + arg + ",", depth + 1);
}
}
testParams("", 1);
}
function startTest() {
var canvas = document.getElementById("img");
var context = canvas.getContext('2d');;
test_method(context, "getImageData", 4);
test_method(context, "putImageData", 3);
}
</script>
</head>
<body onload="startTest()">
<canvas id="img">No canvas support.</canvas>
</body>
</html>

Просмотреть файл

@ -0,0 +1 @@
load 421715-1.html

Просмотреть файл

@ -420,6 +420,31 @@ protected:
PRInt32 *widthOut, PRInt32 *heightOut,
nsIPrincipal **prinOut,
PRBool *forceWriteOnlyOut);
// other helpers
void GetAppUnitsValues(PRUint32 *perDevPixel, PRUint32 *perCSSPixel) {
// If we don't have a canvas element, we just return something generic.
PRUint32 devPixel = 60;
PRUint32 cssPixel = 60;
nsCOMPtr<nsINode> elem = do_QueryInterface(mCanvasElement);
if (elem) {
nsIDocument *doc = elem->GetOwnerDoc();
if (!doc) goto FINISH;
nsIPresShell *ps = doc->GetPrimaryShell();
if (!ps) goto FINISH;
nsPresContext *pc = ps->GetPresContext();
if (!pc) goto FINISH;
devPixel = pc->AppUnitsPerDevPixel();
cssPixel = pc->AppUnitsPerCSSPixel();
}
FINISH:
if (perDevPixel)
*perDevPixel = devPixel;
if (perCSSPixel)
*perCSSPixel = cssPixel;
}
};
NS_IMPL_ADDREF(nsCanvasRenderingContext2D)
@ -570,7 +595,13 @@ nsCanvasRenderingContext2D::DoDrawImageSecurityCheck(nsIPrincipal* aPrincipal,
PRBool forceWriteOnly)
{
NS_PRECONDITION(aPrincipal, "Must have a principal here");
// Callers should ensure that mCanvasElement is non-null before calling this
if (!mCanvasElement) {
NS_WARNING("DoDrawImageSecurityCheck called without canvas element!");
return;
}
if (mCanvasElement->IsWriteOnly())
return;
@ -610,6 +641,9 @@ nsCanvasRenderingContext2D::ApplyStyle(PRInt32 aWhichStyle)
nsCanvasPattern* pattern = CurrentState().patternStyles[aWhichStyle];
if (pattern) {
if (!mCanvasElement)
return;
DoDrawImageSecurityCheck(pattern->Principal(),
pattern->GetForceWriteOnly());
pattern->Apply(mCairo);
@ -1432,21 +1466,28 @@ nsCanvasRenderingContext2D::SetMozTextStyle(const nsAString& textStyle)
if(mTextStyle.Equals(textStyle)) return NS_OK;
nsCOMPtr<nsINode> elem = do_QueryInterface(mCanvasElement);
NS_ASSERTION(elem, "Canvas element must be a dom node");
if (!elem) {
NS_WARNING("Canvas element must be an nsINode and non-null");
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPrincipal> elemPrincipal;
nsCOMPtr<nsIDocument> elemDocument;
nsIPrincipal* elemPrincipal = elem->NodePrincipal();
nsIDocument* elemDocument = elem->GetOwnerDoc();
elemPrincipal = elem->NodePrincipal();
elemDocument = elem->GetOwnerDoc();
if (!elemDocument || !elemPrincipal) {
NS_WARNING("Element is missing document or principal");
return NS_ERROR_FAILURE;
}
NS_ASSERTION(elemDocument && elemPrincipal, "Element is missing document or principal");
nsIPresShell* presShell = elemDocument->GetPrimaryShell();
if (!presShell)
return NS_ERROR_FAILURE;
nsIURI *docURL = elemDocument->GetDocumentURI();
nsIURI *baseURL = elemDocument->GetBaseURI();
nsCString langGroup;
elemDocument->GetPrimaryShell()->GetPresContext()->GetLangGroup()->ToUTF8String(langGroup);
presShell->GetPresContext()->GetLangGroup()->ToUTF8String(langGroup);
nsCOMArray<nsIStyleRule> rules;
PRBool changed;
@ -1469,14 +1510,14 @@ nsCanvasRenderingContext2D::SetMozTextStyle(const nsAString& textStyle)
rules.AppendObject(rule);
nsStyleSet *styleSet = elemDocument->GetPrimaryShell()->StyleSet();
nsStyleSet *styleSet = presShell->StyleSet();
nsRefPtr<nsStyleContext> sc = styleSet->ResolveStyleForRules(nsnull,rules);
const nsStyleFont *fontStyle = sc->GetStyleFont();
NS_ASSERTION(fontStyle, "Could not obtain font style");
PRUint32 aupdp = elemDocument->GetPrimaryShell()->GetPresContext()->AppUnitsPerDevPixel();
PRUint32 aupdp = presShell->GetPresContext()->AppUnitsPerDevPixel();
gfxFontStyle style(fontStyle->mFont.style,
fontStyle->mFont.weight,
@ -1514,16 +1555,13 @@ gfxFontGroup *nsCanvasRenderingContext2D::GetCurrentFontStyle()
NS_IMETHODIMP
nsCanvasRenderingContext2D::MozDrawText(const nsAString& textToDraw)
{
nsCOMPtr<nsINode> elem = do_QueryInterface(mCanvasElement);
NS_ASSERTION(elem, "Canvas element must be an nsINode");
nsCOMPtr<nsIDocument> elemDocument(elem->GetOwnerDoc());
const PRUnichar* textdata;
textToDraw.GetData(&textdata);
PRUint32 textrunflags = 0;
PRUint32 aupdp = elemDocument->GetPrimaryShell()->GetPresContext()->AppUnitsPerDevPixel();
PRUint32 aupdp;
GetAppUnitsValues(&aupdp, NULL);
gfxTextRunCache::AutoTextRun textRun;
textRun = gfxTextRunCache::MakeTextRun(textdata,
@ -1554,16 +1592,12 @@ nsCanvasRenderingContext2D::MozDrawText(const nsAString& textToDraw)
NS_IMETHODIMP
nsCanvasRenderingContext2D::MozMeasureText(const nsAString& textToMeasure, float *retVal)
{
nsCOMPtr<nsINode> elem = do_QueryInterface(mCanvasElement);
NS_ASSERTION(elem, "Canvas element must be an nsINode");
nsCOMPtr<nsIDocument> elemDocument(elem->GetOwnerDoc());
const PRUnichar* textdata;
textToMeasure.GetData(&textdata);
PRUint32 textrunflags = 0;
PRUint32 aupdp = elemDocument->GetPrimaryShell()->GetPresContext()->AppUnitsPerDevPixel();
PRUint32 aupdp, aupcp;
GetAppUnitsValues(&aupdp, &aupcp);
gfxTextRunCache::AutoTextRun textRun;
textRun = gfxTextRunCache::MakeTextRun(textdata,
@ -1580,23 +1614,20 @@ nsCanvasRenderingContext2D::MozMeasureText(const nsAString& textToMeasure, float
gfxTextRun::Metrics metrics = textRun->MeasureText(/* offset = */ 0, textToMeasure.Length(),
tightBoundingBox, mThebesContext,
nsnull);
*retVal = float(metrics.mAdvanceWidth/gfxFloat(elemDocument->GetPrimaryShell()->GetPresContext()->AppUnitsPerCSSPixel()));
*retVal = float(metrics.mAdvanceWidth/gfxFloat(aupcp));
return NS_OK;
}
NS_IMETHODIMP
nsCanvasRenderingContext2D::MozPathText(const nsAString& textToPath)
{
nsCOMPtr<nsINode> elem = do_QueryInterface(mCanvasElement);
NS_ASSERTION(elem, "Canvas element must be an nsINode");
nsCOMPtr<nsIDocument> elemDocument(elem->GetOwnerDoc());
const PRUnichar* textdata;
textToPath.GetData(&textdata);
PRUint32 textrunflags = 0;
PRUint32 aupdp = elemDocument->GetPrimaryShell()->GetPresContext()->AppUnitsPerDevPixel();
PRUint32 aupdp;
GetAppUnitsValues(&aupdp, NULL);
gfxTextRunCache::AutoTextRun textRun;
textRun = gfxTextRunCache::MakeTextRun(textdata,
@ -1626,16 +1657,13 @@ nsCanvasRenderingContext2D::MozTextAlongPath(const nsAString& textToDraw, PRBool
// Most of this code is copied from its svg equivalent
nsRefPtr<gfxFlattenedPath> path(mThebesContext->GetFlattenedPath());
nsCOMPtr<nsINode> elem = do_QueryInterface(mCanvasElement);
NS_ASSERTION(elem, "Canvas element must be an nsINode");
nsCOMPtr<nsIDocument> elemDocument(elem->GetOwnerDoc());
const PRUnichar* textdata;
textToDraw.GetData(&textdata);
PRUint32 textrunflags = 0;
PRUint32 aupdp = elemDocument->GetPrimaryShell()->GetPresContext()->AppUnitsPerDevPixel();
PRUint32 aupdp;
GetAppUnitsValues(&aupdp, NULL);
gfxTextRunCache::AutoTextRun textRun;
textRun = gfxTextRunCache::MakeTextRun(textdata,
@ -1709,7 +1737,7 @@ nsCanvasRenderingContext2D::MozTextAlongPath(const nsAString& textToDraw, PRBool
mThebesContext->SetMatrix(matrix);
}
delete[] cp;
delete [] cp;
return NS_OK;
}
@ -1851,6 +1879,11 @@ nsCanvasRenderingContext2D::DrawImage()
{
nsresult rv;
// we can't do a security check without a canvas element, so
// just skip this entirely
if (!mCanvasElement)
return NS_ERROR_FAILURE;
nsAXPCNativeCallContext *ncc = nsnull;
rv = nsContentUtils::XPConnect()->
GetCurrentNativeCallContext(&ncc);
@ -2220,9 +2253,18 @@ nsCanvasRenderingContext2D::CairoSurfaceFromElement(nsIDOMElement *imgElt,
if (heightOut)
*heightOut = imgHeight;
nsRefPtr<gfxASurface> gfxsurf;
rv = img->GetSurface(getter_AddRefs(gfxsurf));
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<gfxPattern> gfxpattern;
img->GetPattern(getter_AddRefs(gfxpattern));
nsRefPtr<gfxASurface> gfxsurf = gfxpattern->GetSurface();
if (!gfxsurf) {
gfxsurf = new gfxImageSurface (gfxIntSize(imgWidth, imgHeight), gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxContext> ctx = new gfxContext(gfxsurf);
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
ctx->SetPattern(gfxpattern);
ctx->Paint();
}
*aCairoSurface = gfxsurf->CairoSurface();
cairo_surface_reference (*aCairoSurface);
@ -2351,7 +2393,7 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, PRInt32 aX, PRInt3
NS_IMETHODIMP
nsCanvasRenderingContext2D::GetImageData()
{
if (!mValid)
if (!mValid || !mCanvasElement)
return NS_ERROR_FAILURE;
if (mCanvasElement->IsWriteOnly() && !nsContentUtils::IsCallerTrustedForRead()) {
@ -2506,6 +2548,9 @@ nsCanvasRenderingContext2D::PutImageData()
if (!JS_ConvertArguments (ctx, argc, argv, "ojj", &dataObject, &x, &y))
return NS_ERROR_DOM_SYNTAX_ERR;
if (!dataObject)
return NS_ERROR_DOM_SYNTAX_ERR;
int32 w, h;
JSObject *dataArray;
jsval v;

Просмотреть файл

@ -746,6 +746,7 @@ nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
nsCOMPtr<nsIDOMNode> thisNode(do_QueryInterface(static_cast<nsIContent *>
(this)));
nsresult rv = nsContentUtils::CreateContextualFragment(thisNode, aInnerHTML,
PR_FALSE,
getter_AddRefs(df));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIDOMNode> tmpNode;

Просмотреть файл

@ -119,7 +119,8 @@ public:
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
// nsIFragmentContentSink
NS_IMETHOD GetFragment(nsIDOMDocumentFragment** aFragment);
NS_IMETHOD GetFragment(PRBool aWillOwnFragment,
nsIDOMDocumentFragment** aFragment);
NS_IMETHOD SetTargetDocument(nsIDocument* aDocument);
NS_IMETHOD WillBuildContent();
NS_IMETHOD DidBuildContent();
@ -608,10 +609,15 @@ nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
}
NS_IMETHODIMP
nsHTMLFragmentContentSink::GetFragment(nsIDOMDocumentFragment** aFragment)
nsHTMLFragmentContentSink::GetFragment(PRBool aWillOwnFragment,
nsIDOMDocumentFragment** aFragment)
{
if (mRoot) {
return CallQueryInterface(mRoot, aFragment);
nsresult rv = CallQueryInterface(mRoot, aFragment);
if (NS_SUCCEEDED(rv) && aWillOwnFragment) {
mRoot = nsnull;
}
return rv;
}
*aFragment = nsnull;

Просмотреть файл

@ -45,5 +45,9 @@ include $(DEPTH)/config/autoconf.mk
DIRS = src
ifdef MOZ_MOCHITEST
DIRS += test
endif
include $(topsrcdir)/config/rules.mk

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше