merging from cvs-trunk-mirror 2007/07/12 (restores ability to compile SpiderMonkey with c++)

This commit is contained in:
edward.lee@engineering.uiuc.edu 2007-07-12 10:41:14 -07:00
Родитель 4712a475e5 9d20d7d546
Коммит 8d4ef8df0b
336 изменённых файлов: 5157 добавлений и 12490 удалений

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

@ -43,7 +43,7 @@
interface nsIEditor;
[scriptable, uuid(1e9884d3-4017-4032-a121-e0185d166db5)]
[scriptable, uuid(52837507-202d-4e72-a482-5f068a1fd720)]
interface nsIAccessibleEditableText : nsISupports
{
/**
@ -105,9 +105,9 @@ interface nsIAccessibleEditableText : nsISupports
void pasteText (in long position);
/**
* Returns an editor.
* Returns an editor associated with the accessible.
*/
[noscript] readonly attribute nsIEditor editor;
[noscript] readonly attribute nsIEditor associatedEditor;
};
/*

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

@ -99,6 +99,7 @@ interface nsIAccessibleProvider : nsISupports
const long XULToolbar = 0x00001029;
const long XULToolbarSeparator = 0x00001030;
const long XULTooltip = 0x00001031;
const long XULToolbarButton = 0x00001032;
/**

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

@ -43,7 +43,7 @@
interface nsIAccessible;
[scriptable, uuid(dc13d184-a6df-45a1-92f0-5476fdaebc5a)]
[scriptable, uuid(dcc1e5c3-966e-45b2-b30a-839d35432b24)]
interface nsIAccessibleTable : nsISupports
{
readonly attribute nsIAccessible caption;
@ -64,12 +64,32 @@ interface nsIAccessibleTable : nsISupports
*/
nsIAccessible cellRefAt(in long row, in long column);
/**
* get an index
*/
long getIndexAt (in long row, in long column);
long getColumnAtIndex (in long index);
long getRowAtIndex (in long index);
/**
* Translates the given row and column indices into the corresponding cell
* index.
*
* @param row - index of the row of the table for which to return the cell
* index.
* @param column - index of the column of the table for which to return
* the cell index.
*/
long getIndexAt(in long row, in long column);
/**
* Translates the given child index into the corresponding column index.
*
* @param index - index of the child of the table for which to return
* the column index.
*/
long getColumnAtIndex(in long index);
/**
* Translates the given child index into the corresponding row index.
*
* @param index - index of the child of the table for which to return
* the row index.
*/
long getRowAtIndex(in long index);
/**
* Returns the number of columns occupied by the accessible object
@ -136,6 +156,30 @@ interface nsIAccessibleTable : nsISupports
*/
boolean isCellSelected(in long row, in long column);
/**
* Returns the total number of selected cells.
*/
readonly attribute unsigned long selectedCellsCount;
/**
* Returns the total number of selected columns.
*/
readonly attribute unsigned long selectedColumnsCount;
/**
* Returns the total number of selected rows.
*/
readonly attribute unsigned long selectedRowsCount;
/**
* Returns a list of cells indexes currently selected.
*
* @param cellsSize - length of array
* @param cells - array of indexes of selected cells
*/
void getSelectedCells(out unsigned long cellsSize,
[retval, array, size_is(cellsSize)] out long cells);
/**
* Returns a list of column indexes currently selected.
*

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

@ -129,6 +129,31 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::GetRowHeader(nsIAccessibleTable **aRowHea
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeAccessibleWrap::GetSelectedCellsCount(PRUint32* aCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeAccessibleWrap::GetSelectedColumnsCount(PRUint32* aCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeAccessibleWrap::GetSelectedRowsCount(PRUint32* aCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeAccessibleWrap::GetSelectedCells(PRUint32 *aNumCells,
PRInt32 **aCells)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsXULTreeAccessibleWrap::GetSelectedColumns(PRUint32 *aNumColumns, PRInt32 **aColumns)
{
// If all the row has been selected, then all the columns are selected.
@ -452,6 +477,31 @@ NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetRowHeader(nsIAccessibleTable *
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeColumnsAccessibleWrap::GetSelectedCellsCount(PRUint32* aCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeColumnsAccessibleWrap::GetSelectedColumnsCount(PRUint32* aCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeColumnsAccessibleWrap::GetSelectedRowsCount(PRUint32* aCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsXULTreeColumnsAccessibleWrap::GetSelectedCells(PRUint32 *aNumCells,
PRInt32 **aCells)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetSelectedColumns(PRUint32 *columnsSize, PRInt32 **columns)
{
// Header can not be selected.

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

@ -132,6 +132,9 @@ ACCESSIBILITY_ATOM(thead, "thead")
ACCESSIBILITY_ATOM(textarea, "textarea") // XForms
ACCESSIBILITY_ATOM(textbox, "textbox") // XUL
ACCESSIBILITY_ATOM(toolbaritem, "toolbaritem") // XUL
ACCESSIBILITY_ATOM(toolbarseparator, "toolbarseparator") // XUL
ACCESSIBILITY_ATOM(toolbarspring, "toolbarspring") // XUL
ACCESSIBILITY_ATOM(toolbarspacer, "toolbarspacer") // XUL
ACCESSIBILITY_ATOM(tooltip, "tooltip") // XUL
ACCESSIBILITY_ATOM(tr, "tr")
ACCESSIBILITY_ATOM(ul, "ul")

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

@ -1642,6 +1642,9 @@ nsresult nsAccessibilityService::GetAccessibleByType(nsIDOMNode *aNode,
case nsIAccessibleProvider::XULTooltip:
*aAccessible = new nsXULTooltipAccessible(aNode, weakShell);
break;
case nsIAccessibleProvider::XULToolbarButton:
*aAccessible = new nsXULToolbarButtonAccessible(aNode, weakShell);
break;
#endif // MOZ_XUL
#ifndef DISABLE_XFORMS_HOOKS

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

@ -306,6 +306,135 @@ nsHTMLTableAccessible::GetRowHeader(nsIAccessibleTable **aRowHeader)
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetSelectedCellsCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
PRInt32 rowsCount = 0;
nsresult rv = GetRows(&rowsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 columnsCount = 0;
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 rowIndex;
for (rowIndex = 0; rowIndex < rowsCount; rowIndex++) {
PRInt32 columnIndex;
for (columnIndex = 0; columnIndex < columnsCount; columnIndex++) {
PRBool state = PR_FALSE;
rv = IsCellSelected(rowIndex, columnIndex, &state);
NS_ENSURE_SUCCESS(rv, rv);
if (state)
(*aCount)++;
}
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetSelectedColumnsCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
PRInt32 count = 0;
nsresult rv = GetColumns(&count);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 index;
for (index = 0; index < count; index++) {
PRBool state = PR_FALSE;
rv = IsColumnSelected(index, &state);
NS_ENSURE_SUCCESS(rv, rv);
if (state)
(*aCount)++;
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetSelectedRowsCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
PRInt32 count = 0;
nsresult rv = GetRows(&count);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 index;
for (index = 0; index < count; index++) {
PRBool state = PR_FALSE;
rv = IsRowSelected(index, &state);
NS_ENSURE_SUCCESS(rv, rv);
if (state)
(*aCount)++;
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetSelectedCells(PRUint32 *aNumCells,
PRInt32 **aCells)
{
NS_ENSURE_ARG_POINTER(aNumCells);
*aNumCells = 0;
NS_ENSURE_ARG_POINTER(aCells);
*aCells = nsnull;
PRInt32 rowsCount = 0;
nsresult rv = GetRows(&rowsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 columnsCount = 0;
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 cellsCount = columnsCount * rowsCount;
nsAutoArrayPtr<PRBool> states(new PRBool[cellsCount]);
NS_ENSURE_TRUE(states, NS_ERROR_OUT_OF_MEMORY);
PRInt32 rowIndex, index;
for (rowIndex = 0, index = 0; rowIndex < rowsCount; rowIndex++) {
PRInt32 columnIndex;
for (columnIndex = 0; columnIndex < columnsCount; columnIndex++, index++) {
rv = IsCellSelected(rowIndex, columnIndex, &states[index]);
NS_ENSURE_SUCCESS(rv, rv);
if (states[index])
(*aNumCells)++;
}
}
PRInt32 *cellsArray =
(PRInt32 *)nsMemory::Alloc((*aNumCells) * sizeof(PRInt32));
NS_ENSURE_TRUE(cellsArray, NS_ERROR_OUT_OF_MEMORY);
PRInt32 curr = 0;
for (rowIndex = 0, index = 0; rowIndex < rowsCount; rowIndex++) {
PRInt32 columnIndex;
for (columnIndex = 0; columnIndex < columnsCount; columnIndex++, index++) {
if (states[index]) {
PRInt32 cellIndex = -1;
GetIndexAt(rowIndex, columnIndex, &cellIndex);
cellsArray[curr++] = cellIndex;
}
}
}
*aCells = cellsArray;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetSelectedColumns(PRUint32 *aNumColumns,
PRInt32 **aColumns)

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

@ -1135,7 +1135,7 @@ NS_IMETHODIMP nsHyperTextAccessible::PasteText(PRInt32 aPosition)
}
NS_IMETHODIMP
nsHyperTextAccessible::GetEditor(nsIEditor **aEditor)
nsHyperTextAccessible::GetAssociatedEditor(nsIEditor **aEditor)
{
NS_ENSURE_ARG_POINTER(aEditor);

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

@ -63,7 +63,6 @@ REQUIRES = content \
CMMSRCS = nsAccessNodeWrap.mm \
nsDocAccessibleWrap.mm \
nsRootAccessibleWrap.mm \
nsAccessibleWrap.mm \
mozAccessible.mm \

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

@ -154,6 +154,7 @@ nsAccessibleWrap::Shutdown ()
return nsAccessible::Shutdown();
}
NS_IMETHODIMP
nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
{
NS_ENSURE_ARG_POINTER(aEvent);

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

@ -47,6 +47,7 @@ class nsApplicationAccessibleWrap: public nsApplicationAccessible
{
public:
static void PreCreate() {}
static void Unload() {}
};
#endif

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

@ -1,82 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Håkan Waara <hwaara@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsDocAccessibleWrap.h"
#import "mozAccessible.h"
#import "mozAccessibleWrapper.h"
nsDocAccessibleWrap::nsDocAccessibleWrap(nsIDOMNode *aDOMNode, nsIWeakReference *aShell):
nsDocAccessible(aDOMNode, aShell)
{
}
nsDocAccessibleWrap::~nsDocAccessibleWrap()
{
}
NS_IMETHODIMP
nsDocAccessibleWrap::FireToolkitEvent(PRUint32 aEvent, nsIAccessible* aAccessible, void* aData)
{
NS_ENSURE_ARG_POINTER(aAccessible);
// this will notify xpcom observers, before we notify the OS
nsDocAccessible::FireToolkitEvent(aEvent, aAccessible, aData);
// ignore everything but focus-changed and value-changed events for now.
if (aEvent != nsIAccessibleEvent::EVENT_FOCUS &&
aEvent != nsIAccessibleEvent::EVENT_VALUE_CHANGE)
return NS_OK;
mozAccessible *nativeAcc = nil;
aAccessible->GetNativeInterface((void**)&nativeAcc);
if (!nativeAcc)
return NS_ERROR_FAILURE;
switch (aEvent) {
case nsIAccessibleEvent::EVENT_FOCUS:
[nativeAcc didReceiveFocus];
break;
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
[nativeAcc valueDidChange];
break;
}
return NS_OK;
}

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

@ -267,21 +267,51 @@ STDMETHODIMP
CAccessibleTable::get_nSelectedChildren(long *aChildCount)
{
*aChildCount = 0;
return E_NOTIMPL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRUint32 count = 0;
nsresult rv = tableAcc->GetSelectedCellsCount(&count);
*aChildCount = count;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_nSelectedColumns(long *aColumnCount)
{
*aColumnCount = 0;
return E_NOTIMPL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRUint32 count = 0;
nsresult rv = tableAcc->GetSelectedColumnsCount(&count);
*aColumnCount = count;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
CAccessibleTable::get_nSelectedRows(long *aRowCount)
{
*aRowCount = 0;
return E_NOTIMPL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRUint32 count = 0;
nsresult rv = tableAcc->GetSelectedRowsCount(&count);
*aRowCount = count;
return NS_FAILED(rv) ? E_FAIL : S_OK;
}
STDMETHODIMP
@ -371,28 +401,22 @@ CAccessibleTable::get_rowIndex(long aChildIndex, long *aRowIndex)
STDMETHODIMP
CAccessibleTable::get_selectedChildren(long aMaxChildren, long **aChildren,
long *nChildren)
long *aNChildren)
{
*aChildren = NULL;
*nChildren = 0;
return E_NOTIMPL;
return GetSelectedItems(aMaxChildren, aChildren, aNChildren, ITEMSTYPE_CELLS);
}
STDMETHODIMP
CAccessibleTable::get_selectedColumns(long aMaxColumns, long **aColumns,
long *aNColumns)
{
*aColumns = NULL;
*aNColumns = 0;
return E_NOTIMPL;
return GetSelectedItems(aMaxColumns, aColumns, aNColumns, ITEMSTYPE_COLUMNS);
}
STDMETHODIMP
CAccessibleTable::get_selectedRows(long aMaxRows, long **aRows, long *aNRows)
{
*aRows = NULL;
*aNRows = 0;
return E_NOTIMPL;
return GetSelectedItems(aMaxRows, aRows, aNRows, ITEMSTYPE_ROWS);
}
STDMETHODIMP
@ -506,8 +530,45 @@ CAccessibleTable::get_rowColumnExtentsAtIndex(long aIndex, long *aRow,
*aColumn = 0;
*aRowExtents = 0;
*aColumnExtents = 0;
*aIsSelected = false;
return E_NOTIMPL;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRInt32 row = -1;
nsresult rv = tableAcc->GetRowAtIndex(aIndex, &row);
if (NS_FAILED(rv))
return E_FAIL;
PRInt32 column = -1;
rv = tableAcc->GetColumnAtIndex(aIndex, &column);
if (NS_FAILED(rv))
return E_FAIL;
PRInt32 rowExtents = 0;
rv = tableAcc->GetRowExtentAt(row, column, &rowExtents);
if (NS_FAILED(rv))
return E_FAIL;
PRInt32 columnExtents = 0;
rv = tableAcc->GetColumnExtentAt(row, column, &columnExtents);
if (NS_FAILED(rv))
return E_FAIL;
PRBool isSelected = PR_FALSE;
rv = tableAcc->IsCellSelected(row, column, &isSelected);
if (NS_FAILED(rv))
return E_FAIL;
*aRow = row;
*aColumn = column;
*aRowExtents = rowExtents;
*aColumnExtents = columnExtents;
*aIsSelected = isSelected;
return S_OK;
}
STDMETHODIMP
@ -517,3 +578,50 @@ CAccessibleTable::get_modelChange(IA2TableModelChange *aModelChange)
return E_NOTIMPL;
}
// CAccessibleTable
HRESULT
CAccessibleTable::GetSelectedItems(long aMaxItems, long **aItems,
long *aItemsCount, eItemsType aType)
{
*aItemsCount = 0;
nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(this));
NS_ASSERTION(tableAcc, CANT_QUERY_ASSERTION_MSG);
if (!tableAcc)
return E_FAIL;
PRUint32 size = 0;
PRInt32 *items = NULL;
nsresult rv = NS_OK;
switch (aType) {
case ITEMSTYPE_CELLS:
rv = tableAcc->GetSelectedCells(&size, &items);
break;
case ITEMSTYPE_COLUMNS:
rv = tableAcc->GetSelectedColumns(&size, &items);
break;
case ITEMSTYPE_ROWS:
rv = tableAcc->GetSelectedRows(&size, &items);
break;
default:
return E_FAIL;
}
if (NS_FAILED(rv))
return E_FAIL;
if (size == 0 || !items)
return S_OK;
PRUint32 maxSize = size < (PRUint32)aMaxItems ? size : aMaxItems;
*aItemsCount = maxSize;
for (PRUint32 index = 0; index < maxSize; ++index)
(*aItems)[index] = items[index];
nsMemory::Free(items);
return S_OK;
}

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

@ -169,6 +169,16 @@ public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_modelChange(
/* [retval][out] */ IA2TableModelChange *modelChange);
private:
enum eItemsType {
ITEMSTYPE_CELLS,
ITEMSTYPE_COLUMNS,
ITEMSTYPE_ROWS
};
HRESULT GetSelectedItems(long aMaxItems, long **aItems, long *aItemsCount,
eItemsType aType);
};
#endif

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

@ -69,7 +69,6 @@ REQUIRES = content \
CPPSRCS = \
nsAccessNodeWrap.cpp \
nsAccessibleWrap.cpp \
nsDocAccessibleWrap.cpp \
nsRootAccessibleWrap.cpp \
$(NULL)

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

@ -47,6 +47,7 @@ class nsApplicationAccessibleWrap: public nsApplicationAccessible
{
public:
static void PreCreate() {}
static void Unload() {}
};
#endif

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

@ -642,6 +642,67 @@ NS_IMETHODIMP nsXULStatusBarAccessible::GetRole(PRUint32 *_retval)
return NS_OK;
}
/**
* XUL Toolbar Button
*/
nsXULToolbarButtonAccessible::nsXULToolbarButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsXULButtonAccessible(aNode, aShell)
{
}
nsresult
nsXULToolbarButtonAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
nsresult rv = nsXULButtonAccessible::GetAttributesInternal(aAttributes);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAccessible> parent(GetParent());
PRInt32 setSize = 0;
PRInt32 posInSet = 0;
if (parent) {
nsCOMPtr<nsIAccessible> sibling;
nsCOMPtr<nsIAccessible> tempSibling;
parent->GetFirstChild(getter_AddRefs(sibling));
while (sibling) {
if (IsSeparator(sibling)) { // end of a group of buttons
if (posInSet)
break; // we've found our group, so we're done
setSize = 0; // not our group, so start a new group
} else {
setSize++; // another button in the group
if (sibling == this)
posInSet = setSize; // we've found our button
}
sibling->GetNextSibling(getter_AddRefs(tempSibling));
sibling.swap(tempSibling);
}
}
nsAccUtils::SetAccGroupAttrs(aAttributes, 0, posInSet, setSize);
return NS_OK;
}
PRBool
nsXULToolbarButtonAccessible::IsSeparator(nsIAccessible *aAccessible)
{
nsCOMPtr<nsIDOMNode> domNode;
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aAccessible));
accessNode->GetDOMNode(getter_AddRefs(domNode));
nsCOMPtr<nsIContent> contentDomNode(do_QueryInterface(domNode));
if (!contentDomNode)
return PR_FALSE;
return (contentDomNode->Tag() == nsAccessibilityAtoms::toolbarseparator) ||
(contentDomNode->Tag() == nsAccessibilityAtoms::toolbarspacer) ||
(contentDomNode->Tag() == nsAccessibilityAtoms::toolbarspring);
}
/**
* XUL ToolBar
*/

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

@ -132,6 +132,14 @@ public:
NS_IMETHOD GetRole(PRUint32 *aRole);
};
class nsXULToolbarButtonAccessible : public nsXULButtonAccessible
{
public:
nsXULToolbarButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
static PRBool IsSeparator(nsIAccessible *aAccessible);
};
class nsXULToolbarAccessible : public nsAccessibleWrap
{
public:

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

@ -692,7 +692,6 @@ xpfe/components/related/Makefile
xpfe/components/related/src/Makefile
xpfe/components/related/public/Makefile
xpfe/components/search/Makefile
xpfe/components/search/datasets/Makefile
xpfe/components/search/public/Makefile
xpfe/components/search/src/Makefile
xpfe/components/sidebar/Makefile

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

@ -57,7 +57,7 @@ static void Output(const char *fmt, ... )
#if defined(XP_WIN) && !MOZ_WINCONSOLE
char msg[2048];
vsnprintf(msg, sizeof(msg), fmt, ap);
_vsnprintf(msg, sizeof(msg), fmt, ap);
MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
#else

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

@ -279,7 +279,6 @@ pref("browser.bookmarks.sort.resource", "rdf:http://home.netscape.com/NC-rdf#Nam
pref("dom.disable_open_during_load", true);
#ifdef DEBUG
pref("javascript.options.showInConsole", true);
pref("javascript.options.strict", true);
pref("general.warnOnAboutConfig", false);
#else
pref("javascript.options.showInConsole", false);

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

@ -2608,12 +2608,11 @@ function FillInHTMLTooltip(tipElement)
tipElement = tipElement.parentNode;
}
var tipNode = document.getElementById("aHTMLTooltip").firstChild;
var label = tipNode.firstChild;
var tipNode = document.getElementById("aHTMLTooltip");
tipNode.style.direction = direction;
for each (var t in [titleText, XLinkTitleText]) {
if (t && /\S/.test(t)) {
tipNode.style.direction = direction;
// Per HTML 4.01 6.2 (CDATA section), literal CRs and tabs should be
// replaced with spaces, and LFs should be removed entirely.
@ -2622,9 +2621,8 @@ function FillInHTMLTooltip(tipElement)
// distinguish that from a literal character in the source by this point.
t = t.replace(/[\r\t]/g, ' ');
t = t.replace(/\n/g, '');
label.textContent = t;
tipNode.setAttribute("label", t);
retVal = true;
}
}

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

@ -101,11 +101,7 @@
onpopupshowing="return BrowserForwardMenu(event);"
oncommand="gotoHistoryIndex(event);"
onclick="checkForMiddleClick(this, event);"/>
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);">
<hbox>
<label flex="1" class="htmltooltip-label"/>
</hbox>
</tooltip>
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
<panel type="autocomplete" chromedir="&locale.dir;" id="PopupAutoComplete"/>

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

@ -725,43 +725,15 @@ MicrosummaryService.prototype = {
},
_getField: function MSS__getField(aBookmarkId, aFieldName) {
var fieldValue;
switch(aFieldName) {
case FIELD_MICSUM_EXPIRATION:
fieldValue = this._ans.getItemAnnotationInt64(aBookmarkId, aFieldName);
break;
case FIELD_MICSUM_GEN_URI:
case FIELD_GENERATED_TITLE:
case FIELD_CONTENT_TYPE:
default:
fieldValue = this._ans.getItemAnnotationString(aBookmarkId, aFieldName);
break;
}
return fieldValue;
return this._ans.getItemAnnotation(aBookmarkId, aFieldName);
},
_setField: function MSS__setField(aBookmarkId, aFieldName, aFieldValue) {
switch(aFieldName) {
case FIELD_MICSUM_EXPIRATION:
this._ans.setItemAnnotationInt64(aBookmarkId,
aFieldName,
aFieldValue,
0,
this._ans.EXPIRE_NEVER);
break;
case FIELD_MICSUM_GEN_URI:
case FIELD_GENERATED_TITLE:
case FIELD_CONTENT_TYPE:
default:
this._ans.setItemAnnotationString(aBookmarkId,
aFieldName,
aFieldValue,
0,
this._ans.EXPIRE_NEVER);
break;
}
this._ans.setItemAnnotation(aBookmarkId,
aFieldName,
aFieldValue,
0,
this._ans.EXPIRE_NEVER);
},
_clearField: function MSS__clearField(aBookmarkId, aFieldName) {

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

@ -61,6 +61,7 @@ const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
const nsICategoryManager = Components.interfaces.nsICategoryManager;
const nsIWebNavigationInfo = Components.interfaces.nsIWebNavigationInfo;
const nsIBrowserSearchService = Components.interfaces.nsIBrowserSearchService;
const nsICommandLineValidator = Components.interfaces.nsICommandLineValidator;
const NS_BINDING_ABORTED = 0x804b0002;
const NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
@ -301,6 +302,7 @@ var nsBrowserContentHandler = {
!iid.equals(nsICommandLineHandler) &&
!iid.equals(nsIBrowserHandler) &&
!iid.equals(nsIContentHandler) &&
!iid.equals(nsICommandLineValidator) &&
!iid.equals(nsIFactory))
throw Components.results.NS_ERROR_NO_INTERFACE;
@ -604,6 +606,21 @@ var nsBrowserContentHandler = {
request.cancel(NS_BINDING_ABORTED);
},
/* nsICommandLineValidator */
validate : function bch_validate(cmdLine) {
// Other handlers may use osint so only handle the osint flag if the url
// flag is also present and the command line is valid.
var osintFlagIdx = cmdLine.findFlag("osint", false);
var urlFlagIdx = cmdLine.findFlag("url", false);
if (urlFlagIdx > -1 && (osintFlagIdx > -1 ||
cmdLine.state == nsICommandLine.STATE_REMOTE_EXPLICIT)) {
var urlParam = cmdLine.getArgument(urlFlagIdx + 1);
if (cmdLine.length != urlFlagIdx + 2 || /firefoxurl:/.test(urlParam))
throw NS_ERROR_ABORT;
cmdLine.handleFlag("osint", false)
}
},
/* nsIFactory */
createInstance: function bch_CI(outer, iid) {
if (outer != null)
@ -866,6 +883,9 @@ var Module = {
catMan.addCategoryEntry("command-line-handler",
"x-default",
dch_contractID, true, true);
catMan.addCategoryEntry("command-line-validator",
"b-browser",
bch_contractID, true, true);
},
unregisterSelf : function mod_unregself(compMgr, location, type) {
@ -880,6 +900,8 @@ var Module = {
"m-browser", true);
catMan.deleteCategoryEntry("command-line-handler",
"x-default", true);
catMan.deleteCategoryEntry("command-line-validator",
"b-browser", true);
},
canUnload: function(compMgr) {

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

@ -315,8 +315,8 @@ var BookmarkPropertiesPanel = {
// XXXmano: unify the two id fields
var itemId = dialogInfo.type == "bookmark" ? this._bookmarkId : this._folderId;
if (annos.itemHasAnnotation(itemId, DESCRIPTION_ANNO)) {
this._itemDescription = annos.getItemAnnotationString(itemId,
DESCRIPTION_ANNO);
this._itemDescription = annos.getItemAnnotation(itemId,
DESCRIPTION_ANNO);
}
}
},
@ -412,7 +412,7 @@ var BookmarkPropertiesPanel = {
*/
var folders = [];
for (var i=0; i < folderIds.length; i++) {
var lastUsed = annos.getItemAnnotationInt64(folderIds[i], LAST_USED_ANNO);
var lastUsed = annos.getItemAnnotation(folderIds[i], LAST_USED_ANNO);
folders.push({ folderId: folderIds[i], lastUsed: lastUsed });
}
folders.sort(function(a, b) {
@ -1118,9 +1118,9 @@ var BookmarkPropertiesPanel = {
// We'll figure out when/if to expire the annotation if it turns out
// we keep this recently-used-folders implementation
PlacesUtils.annotations
.setItemAnnotationInt64(aFolderId, LAST_USED_ANNO,
new Date().getTime(), 0,
Ci.nsIAnnotationService.EXPIRE_NEVER);
.setItemAnnotation(aFolderId, LAST_USED_ANNO,
new Date().getTime(), 0,
Ci.nsIAnnotationService.EXPIRE_NEVER);
},
newFolder: function BPP_newFolder() {

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

@ -139,7 +139,7 @@ PlacesController.prototype = {
return false;
if (this._view.hasSingleSelection && PlacesUtils.nodeIsFolder(node)) {
var contents = PlacesUtils.getFolderContents(node.itemId, false, false);
var contents = PlacesUtils.getFolderContents(node.itemId, false, false).root;
for (var i = 0; i < contents.childCount; ++i) {
var child = contents.getChild(i);
if (PlacesUtils.nodeIsURI(child))
@ -894,7 +894,7 @@ PlacesController.prototype = {
// Open each uri in the folder in a tab.
var index = firstIndex;
var urlsToOpen = [];
var contents = PlacesUtils.getFolderContents(node.itemId, false, false);
var contents = PlacesUtils.getFolderContents(node.itemId, false, false).root;
for (var i = 0; i < contents.childCount; ++i) {
var child = contents.getChild(i);
if (PlacesUtils.nodeIsURI(child))
@ -1874,7 +1874,7 @@ PlacesRemoveFolderTransaction.prototype = {
*/
_saveFolderContents: function PRFT__saveFolderContents() {
this._transactions = [];
var contents = this.utils.getFolderContents(this._id, false, false);
var contents = this.utils.getFolderContents(this._id, false, false).root;
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
for (var i = 0; i < contents.childCount; ++i) {
@ -2075,13 +2075,13 @@ PlacesEditItemDescriptionTransaction.prototype = {
if (annos.itemHasAnnotation(this.id, this.DESCRIPTION_ANNO)) {
this._oldDescription =
annos.getItemAnnotationString(this.id, this.DESCRIPTION_ANNO);
annos.getItemAnnotation(this.id, this.DESCRIPTION_ANNO);
}
if (this._newDescription) {
annos.setItemAnnotationString(this.id, this.DESCRIPTION_ANNO,
this._newDescription, 0,
this.nsIAnnotationService.EXPIRE_NEVER);
annos.setItemAnnotation(this.id, this.DESCRIPTION_ANNO,
this._newDescription, 0,
this.nsIAnnotationService.EXPIRE_NEVER);
}
else if (this._oldDescription)
annos.removeItemAnnotation(this.id, this.DESCRIPTION_ANNO);
@ -2091,9 +2091,9 @@ PlacesEditItemDescriptionTransaction.prototype = {
const annos = this.utils.annotations;
if (this._oldDescription) {
annos.setItemAnnotationString(this.id, this.DESCRIPTION_ANNO,
this._oldDescription, 0,
this.nsIAnnotationService.EXPIRE_NEVER);
annos.setItemAnnotation(this.id, this.DESCRIPTION_ANNO,
this._oldDescription, 0,
this.nsIAnnotationService.EXPIRE_NEVER);
}
else if (annos.itemHasAnnotation(this.id, this.DESCRIPTION_ANNO))
annos.removeItemAnnotation(this.id, this.DESCRIPTION_ANNO);
@ -2235,7 +2235,7 @@ PlacesSortFolderByNameTransaction.prototype = {
doTransaction: function PSSFBN_doTransaction() {
this._oldOrder = [];
var contents = this.utils.getFolderContents(this._folderId, false, false);
var contents = this.utils.getFolderContents(this._folderId, false, false).root;
var count = contents.childCount;
// sort between separators

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

@ -217,10 +217,8 @@ var PlacesOrganizer = {
var findCommand = document.getElementById("OrganizerCommand_find:current");
var findLabel = PlacesUtils.getFormattedString("findInPrefix", [node.title]);
findCommand.setAttribute("label", findLabel);
if (PlacesSearchBox.filterCollection == "collection") {
if (PlacesSearchBox.filterCollection == "collection")
PlacesSearchBox.updateCollectionTitle(node.title);
PlacesSearchBox.syncGrayText();
}
},
/**
@ -318,8 +316,8 @@ var PlacesOrganizer = {
var selectedNode = aView.selectedNode;
if (selectedNode) {
if (PlacesUtils.nodeIsFolder(selectedNode)) {
var childsCount =
PlacesUtils.getFolderContents(selectedNode.itemId).childCount;
var childsCount =
PlacesUtils.getFolderContents(selectedNode.itemId).root.childCount;
statusText = PlacesUtils.getFormattedString("status_foldercount",
[childsCount]);
}
@ -410,6 +408,8 @@ var PlacesSearchBox = {
}
else
this.searchFilter.grayText = PlacesUtils.getString("searchByDefault");
this.syncGrayText();
},
/**

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

@ -64,26 +64,26 @@
<xul:hbox class="bookmarks-toolbar-items places-toolbar-items" flex="1">
<children/>
</xul:hbox>
<xul:hbox mousethrough="always"
flex="1"
pack="end">
<xul:toolbarbutton type="menu"
class="chevron"
mousethrough="never"
collapsed="true">
<xul:menupopup type="places"
anonid="chevronPopup"
#ifndef XP_MACOSX
context="placesContext"
#endif
/>
</xul:toolbarbutton>
</xul:hbox>
<xul:toolbarbutton class="bookmark-item bookmarks-toolbar-customize"
mousethrough="never"
label="&bookmarksToolbarItem.label;"/>
</xul:hbox>
</xul:vbox>
<xul:hbox mousethrough="always"
flex="1"
pack="end">
<xul:toolbarbutton type="menu"
class="chevron"
mousethrough="never"
collapsed="true">
<xul:menupopup type="places"
anonid="chevronPopup"
#ifndef XP_MACOSX
context="placesContext"
#endif
/>
</xul:toolbarbutton>
</xul:hbox>
</content>
<implementation>
@ -168,7 +168,7 @@
// service provides no mechanism for doing so.
for (var i = 0; i < bookmarks.length; i++) {
this.__generatedTitles[bookmarks[i]] =
annotations.getItemAnnotationString(bookmarks[i], "bookmarks/generatedTitle");
annotations.getItemAnnotation(bookmarks[i], "bookmarks/generatedTitle");
}
}
@ -252,7 +252,7 @@
var siteURIString;
try {
siteURIString =
PlacesUtils.annotations.getItemAnnotationString(folder, "livemark/siteURI");
PlacesUtils.annotations.getItemAnnotation(folder, "livemark/siteURI");
}
catch (ex) {}
// end duplication
@ -913,7 +913,7 @@
NS_ASSERT(aAnnoName == "bookmarks/generatedTitle",
"annotation " + aAnnoName + ", is not 'bookmarks/generatedTitle'");
var newTitle =
PlacesUtils.annotations.getItemAnnotationString(aItemId, aAnnoName);
PlacesUtils.annotations.getItemAnnotation(aItemId, aAnnoName);
this._self._generatedTitles[aItemId] = newTitle;
this._doRebuild();
},
@ -1082,7 +1082,7 @@
if (event.target.localName == "toolbarbutton" ||
event.target.localName == "toolbarseparator")
this._selection = event.target.node;
else
else
this._selection = this.getResult().root;
]]></handler>
<handler event="draggesture"><![CDATA[

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

@ -436,8 +436,13 @@
<!-- nsIPlacesView -->
<property name="insertionPoint">
<getter><![CDATA[
var orientation = NHRVO.DROP_AFTER;
// there is no insertion point for history queries
// so bail out now and save a lot of work when updating commands
var options = asQuery(this.getResult().root).queryOptions;
if (options.queryType == options.QUERY_TYPE_HISTORY)
return null;
var orientation = NHRVO.DROP_AFTER;
// If there is no selection, insert at the end of the container.
if (!this.hasSelection) {
var index = this.view.rowCount - 1;
@ -468,7 +473,7 @@
// selections - if the last element within a multi-selection is an
// open folder, insert _adajacent_ to the selection.
//
// If the sole selection is the bookmarks toolbar folder, we nsert
// If the sole selection is the bookmarks toolbar folder, we insert
// into it even if it is not opened
if (this.hasSingleSelection && resultView.isContainer(max.value) &&
(resultView.isContainerOpen(max.value) ||

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

@ -1043,7 +1043,7 @@ PlacesTreeView.prototype = {
case this.COLUMN_TYPE_DESCRIPTION:
const annos = PlacesUtils.annotations;
if (annos.itemHasAnnotation(node.itemId, DESCRIPTION_ANNO))
return annos.getItemAnnotationString(node.itemId, DESCRIPTION_ANNO)
return annos.getItemAnnotation(node.itemId, DESCRIPTION_ANNO)
return "";
case this.COLUMN_TYPE_DATEADDED:
if (node.dateAdded)

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

@ -709,7 +709,7 @@ var PlacesUtils = {
},
/**
* Generates a HistoryResultNode for the contents of a folder.
* Generates a nsINavHistoryResult for the contents of a folder.
* @param folderId
* The folder to open
* @param [optional] excludeItems
@ -719,8 +719,8 @@ var PlacesUtils = {
* True to make query items expand as new containers. For managing,
* you want this to be false, for menus and such, you want this to
* be true.
* @returns A HistoryContainerResultNode containing the contents of the
* folder. This container is guaranteed to be open.
* @returns A nsINavHistoryResult containing the contents of the
* folder. The result.root is guaranteed to be open.
*/
getFolderContents:
function PU_getFolderContents(aFolderId, aExcludeItems, aExpandQueries) {
@ -733,7 +733,8 @@ var PlacesUtils = {
var result = this.history.executeQuery(query, options);
result.root.containerOpen = true;
return asContainer(result.root);
asContainer(result.root);
return result;
},
/**
@ -1143,25 +1144,14 @@ var PlacesUtils = {
for (var i = 0; i < annoNames.length; i++) {
var flags = {}, exp = {}, mimeType = {}, storageType = {};
annosvc.getPageAnnotationInfo(aURI, annoNames[i], flags, exp, mimeType, storageType);
switch (storageType.value) {
case annosvc.TYPE_INT32:
val = annosvc.getPageAnnotationInt32(aURI, annoNames[i]);
break;
case annosvc.TYPE_INT64:
val = annosvc.getPageAnnotationInt64(aURI, annoNames[i]);
break;
case annosvc.TYPE_DOUBLE:
val = annosvc.getPageAnnotationDouble(aURI, annoNames[i]);
break;
case annosvc.TYPE_STRING:
val = annosvc.getPageAnnotationString(aURI, annoNames[i]);
break;
case annosvc.TYPE_BINARY:
var data = {}, length = {}, mimeType = {};
annosvc.getPageAnnotationBinary(aURI, annoNames[i], data, length, mimeType);
val = data.value;
break;
if (storageType.value == annosvc.TYPE_BINARY) {
var data = {}, length = {}, mimeType = {};
annosvc.getPageAnnotationBinary(aURI, annoNames[i], data, length, mimeType);
val = data.value;
}
else
val = annosvc.getPageAnnotation(aURI, annoNames[i]);
annos.push({name: annoNames[i],
flags: flags.value,
expires: exp.value,
@ -1173,7 +1163,7 @@ var PlacesUtils = {
},
/**
* Fetch all annotations for a URI, including all properties of each
* Fetch all annotations for an item, including all properties of each
* annotation which would be required to recreate it.
* @param aItemId
* The identifier of the itme for which annotations are to be
@ -1187,27 +1177,15 @@ var PlacesUtils = {
var annoNames = annosvc.getItemAnnotationNames(aItemId, {});
for (var i = 0; i < annoNames.length; i++) {
var flags = {}, exp = {}, mimeType = {}, storageType = {};
annosvc.getItemAnnotationInfo(aItemId, annoNames[i], flags, exp,
mimeType, storageType);
switch (storageType.value) {
case annosvc.TYPE_INT32:
val = annosvc.getItemAnnotationInt32(aItemId, annoNames[i]);
break;
case annosvc.TYPE_INT64:
val = annosvc.getItemAnnotationInt64(aItemId, annoNames[i]);
break;
case annosvc.TYPE_DOUBLE:
val = annosvc.getItemAnnotationDouble(aItemId, annoNames[i]);
break;
case annosvc.TYPE_STRING:
val = annosvc.getItemAnnotationString(aItemId, annoNames[i]);
break;
case annosvc.TYPE_BINARY:
var data = {}, length = {}, mimeType = {};
annosvc.getItemAnnotationBinary(aItemId, annoNames[i], data, length, mimeType);
val = data.value;
break;
annosvc.getItemAnnotationInfo(aItemId, annoNames[i], flags, exp, mimeType, storageType);
if (storageType.value == annosvc.TYPE_BINARY) {
var data = {}, length = {}, mimeType = {};
annosvc.geItemAnnotationBinary(aItemId, annoNames[i], data, length, mimeType);
val = data.value;
}
else
val = annosvc.getItemAnnotation(aItemId, annoNames[i]);
annos.push({name: annoNames[i],
flags: flags.value,
expires: exp.value,
@ -1230,34 +1208,20 @@ var PlacesUtils = {
setAnnotationsForURI: function PU_setAnnotationsForURI(aURI, aAnnos) {
var annosvc = this.annotations;
aAnnos.forEach(function(anno) {
switch (anno.type) {
case annosvc.TYPE_INT32:
annosvc.setPageAnnotationInt32(aURI, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_INT64:
annosvc.setPageAnnotationInt64(aURI, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_DOUBLE:
annosvc.setPageAnnotationDouble(aURI, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_STRING:
annosvc.setPageAnnotationString(aURI, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_BINARY:
annosvc.setPageAnnotationBinary(aURI, anno.name, anno.value,
anno.value.length, anno.mimeType,
anno.flags, anno.expires);
break;
if (anno.type == annosvc.TYPE_BINARY) {
annosvc.setPageAnnotationBinary(aURI, anno.name, anno.value,
anno.value.length, anno.mimeType,
anno.flags, anno.expires);
}
else {
annosvc.setPageAnnotation(aURI, anno.name, anno.value,
anno.flags, anno.expires);
}
});
},
/**
* Annotate a URI with a batch of annotations.
* Annotate an item with a batch of annotations.
* @param aItemId
* The identifier of the item for which annotations are to be set
* @param aAnnotations
@ -1268,28 +1232,14 @@ var PlacesUtils = {
setAnnotationsForItem: function PU_setAnnotationsForItem(aItemId, aAnnos) {
var annosvc = this.annotations;
aAnnos.forEach(function(anno) {
switch (anno.type) {
case annosvc.TYPE_INT32:
annosvc.setItemAnnotationInt32(aItemId, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_INT64:
annosvc.setItemAnnotationInt64(aItemId, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_DOUBLE:
annosvc.setItemAnnotationDouble(aItemId, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_STRING:
annosvc.setItemAnnotationString(aItemId, anno.name, anno.value,
anno.flags, anno.expires);
break;
case annosvc.TYPE_BINARY:
annosvc.setItemAnnotationBinary(aItemId, anno.name, anno.value,
anno.value.length, anno.mimeType,
anno.flags, anno.expires);
break;
if (anno.type == annosvc.TYPE_BINARY) {
annosvc.setItemAnnotationBinary(aItemId, anno.name, anno.value,
anno.value.length, anno.mimeType,
anno.flags, anno.expires);
}
else {
annosvc.setItemAnnotation(aItemId, anno.name, anno.value,
anno.flags, anno.expires);
}
});
},
@ -1357,7 +1307,7 @@ var PlacesUtils = {
setPostDataForURI: function PU_setPostDataForURI(aURI, aPostData) {
const annos = this.annotations;
if (aPostData)
annos.setPageAnnotationString(aURI, POST_DATA_ANNO, aPostData, 0, 0);
annos.setPageAnnotation(aURI, POST_DATA_ANNO, aPostData, 0, 0);
else if (annos.pageHasAnnotation(aURI, POST_DATA_ANNO))
annos.removePageAnnotation(aURI, POST_DATA_ANNO);
},
@ -1370,7 +1320,7 @@ var PlacesUtils = {
getPostDataForURI: function PU_getPostDataForURI(aURI) {
const annos = this.annotations;
if (annos.pageHasAnnotation(aURI, POST_DATA_ANNO))
return annos.getPageAnnotationString(aURI, POST_DATA_ANNO);
return annos.getPageAnnotation(aURI, POST_DATA_ANNO);
return null;
}

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

@ -650,8 +650,17 @@ BookmarkContentSink::HandleContainerEnd()
BookmarkImportFrame& frame = CurFrame();
if (frame.mContainerNesting > 0)
frame.mContainerNesting --;
if (mFrames.Length() > 1 && frame.mContainerNesting == 0)
if (mFrames.Length() > 1 && frame.mContainerNesting == 0) {
// we also need to re-set the imported last-modified date here. Otherwise
// the addition of items will override the imported field.
BookmarkImportFrame& prevFrame = PreviousFrame();
if (prevFrame.mPreviousLastModifiedDate > 0) {
nsresult rv = mBookmarksService->SetItemLastModified(frame.mContainerID,
prevFrame.mPreviousLastModifiedDate);
NS_ASSERTION(NS_SUCCEEDED(rv), "SetItemLastModified failed");
}
PopFrame();
}
}

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

@ -228,8 +228,7 @@ function testCanonicalBookmarks(aFolder) {
do_check_true(annosvc.itemHasAnnotation(testFolder.itemId,
DESCRIPTION_ANNO));
do_check_eq("folder test comment",
annosvc.getItemAnnotationString(testFolder.itemId,
DESCRIPTION_ANNO));
annosvc.getItemAnnotation(testFolder.itemId, DESCRIPTION_ANNO));
// open test folder, and test the children
testFolder.containerOpen = true;
var cc = testFolder.childCount;
@ -258,17 +257,17 @@ function testCanonicalBookmarks(aFolder) {
var pageURI = iosvc.newURI(testBookmark1.uri, "", null);
do_check_true(annosvc.pageHasAnnotation(pageURI, POST_DATA_ANNO));
do_check_eq("hidden1%3Dbar&text1%3D%25s",
annosvc.getPageAnnotationString(pageURI, POST_DATA_ANNO));
annosvc.getPageAnnotation(pageURI, POST_DATA_ANNO));
// last charset
do_check_true(annosvc.pageHasAnnotation(pageURI, LAST_CHARSET_ANNO));
do_check_eq("ISO-8859-1", annosvc.getPageAnnotationString(pageURI,
LAST_CHARSET_ANNO));
do_check_eq("ISO-8859-1", annosvc.getPageAnnotation(pageURI,
LAST_CHARSET_ANNO));
// description
do_check_true(annosvc.itemHasAnnotation(testBookmark1.itemId,
DESCRIPTION_ANNO));
do_check_eq("item description",
annosvc.getItemAnnotationString(testBookmark1.itemId,
DESCRIPTION_ANNO));
annosvc.getItemAnnotation(testBookmark1.itemId,
DESCRIPTION_ANNO));
/*
// XXX Bug 380468

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

@ -204,15 +204,15 @@
<groupbox id="cacheGroup">
<caption label="&cache.label;"/>
<hbox id="cacheSizeBox" align="center">
<label control="cacheSize"
<hbox align="center">
<label id="useCacheBefore"
accesskey="&useCacheBefore.accesskey;">&useCacheBefore.label;</label>
<textbox id="cacheSize" size="2"
preference="browser.cache.disk.capacity"
onsyncfrompreference="return gAdvancedPane.readCacheSize();"
onsynctopreference="return gAdvancedPane.writeCacheSize();"
aaa:labelledby="cacheSizeBox"/>
<label flex="1">&useCacheAfter.label;</label>
aaa:labelledby="useCacheBefore cacheSize useCacheAfter"/>
<label id="useCacheAfter" flex="1">&useCacheAfter.label;</label>
<button id="clearCacheButton" icon="clear"
label="&clearDataNow.label2;"
oncommand="gAdvancedPane.clearCache();"/>

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

@ -91,7 +91,7 @@ var SelectBookmarkDialog = {
var names = [];
var selectedNode = bookmarks.selectedNode;
if (PlacesUtils.nodeIsFolder(selectedNode)) {
var contents = PlacesUtils.getFolderContents(selectedNode.itemId);
var contents = PlacesUtils.getFolderContents(selectedNode.itemId).root;
var cc = contents.childCount;
for (var i = 0; i < cc; ++i) {
var node = contents.getChild(i);

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

@ -581,6 +581,8 @@
<method name="initialize">
<body><![CDATA[
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// Initialize fields
this._stringBundle = this._getParentSearchbar()._stringBundle;
this._formHistSvc =
@ -601,9 +603,9 @@
var cxmenu = document.getAnonymousElementByAttribute(textBox,
"anonid", "input-box-contextmenu");
var element = document.createElementNS(XUL_NS, "menuseparator");
var element = document.createElementNS(kXULNS, "menuseparator");
cxmenu.appendChild(element);
element = document.createElementNS(XUL_NS, "menuitem");
element = document.createElementNS(kXULNS, "menuitem");
var label = this._stringBundle.getString("cmd_clearHistory");
var akey = this._stringBundle.getString("cmd_clearHistory_accesskey");
element.setAttribute("label", label);
@ -612,7 +614,7 @@
cxmenu.appendChild(element);
element = document.createElementNS(XUL_NS, "menuitem");
element = document.createElementNS(kXULNS, "menuitem");
label = this._stringBundle.getString("cmd_showSuggestions");
akey = this._stringBundle.getString("cmd_showSuggestions_accesskey");
element.setAttribute("anonid", "toggle-suggest-item");

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

@ -351,8 +351,6 @@ SessionStoreService.prototype = {
handleEvent: function sss_handleEvent(aEvent) {
switch (aEvent.type) {
case "load":
this.onTabLoad(aEvent.currentTarget.ownerDocument.defaultView, aEvent.currentTarget, aEvent);
break;
case "pageshow":
this.onTabLoad(aEvent.currentTarget.ownerDocument.defaultView, aEvent.currentTarget, aEvent);
break;
@ -582,6 +580,9 @@ SessionStoreService.prototype = {
delete aPanel.__SS_data;
delete aPanel.__SS_text;
this.saveStateDelayed(aWindow);
// attempt to update the current URL we send in a crash report
this._updateCrashReportURL(aWindow);
},
/**
@ -611,6 +612,9 @@ SessionStoreService.prototype = {
if (this._loadState == STATE_RUNNING) {
this._windows[aWindow.__SSi].selected = aPanels.selectedIndex;
this.saveStateDelayed(aWindow);
// attempt to update the current URL we send in a crash report
this._updateCrashReportURL(aWindow);
}
},
@ -1869,11 +1873,26 @@ SessionStoreService.prototype = {
* @param string
* @returns nsIURI
*/
_getURIFromString: function sss_getURIFromString(aString) {
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return ioService.newURI(aString, null, null);
},
_getURIFromString: function sss_getURIFromString(aString) {
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return ioService.newURI(aString, null, null);
},
/**
* Annotate a breakpad crash report with the currently selected tab's URL.
*/
_updateCrashReportURL: function sss_updateCrashReportURL(aWindow) {
var currentUrl = aWindow.getBrowser().currentURI.spec;
try {
var cr = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsICrashReporter);
cr.annotateCrashReport("URL", currentUrl);
}
catch (ex) {
// if breakpad isn't built, we can't annotate the report
}
},
/**
* safe eval'ing

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

@ -151,7 +151,7 @@ OpenKeyForWriting(HKEY aStartKey, const char* aKeyName, HKEY* aKey,
//
// HKCU\SOFTWARE\Classes\FirefoxHTML\
// DefaultIcon (default) REG_SZ <apppath>,1
// shell\open\command (default) REG_SZ <apppath> -url "%1" -requestPending
// shell\open\command (default) REG_SZ <apppath> -requestPending -osint -url "%1"
// shell\open\ddeexec (default) REG_SZ "%1",,0,0,,,,
// shell\open\ddeexec NoActivateHandler REG_SZ
// \Application (default) REG_SZ Firefox
@ -163,7 +163,7 @@ OpenKeyForWriting(HKEY aStartKey, const char* aKeyName, HKEY* aKey,
// EditFlags REG_DWORD 2
// FriendlyTypeName REG_SZ <appname> URL
// DefaultIcon (default) REG_SZ <apppath>,1
// shell\open\command (default) REG_SZ <apppath> -url "%1" -requestPending
// shell\open\command (default) REG_SZ <apppath> -requestPending -osint -url "%1"
// shell\open\ddeexec (default) REG_SZ "%1",,0,0,,,,
// shell\open\ddeexec NoActivateHandler REG_SZ
// \Application (default) REG_SZ Firefox
@ -177,7 +177,7 @@ OpenKeyForWriting(HKEY aStartKey, const char* aKeyName, HKEY* aKey,
//
// HKCU\SOFTWARE\Classes\<protocol>\
// DefaultIcon (default) REG_SZ <apppath>,1
// shell\open\command (default) REG_SZ <apppath> -url "%1" -requestPending
// shell\open\command (default) REG_SZ <apppath> -requestPending -osint -url "%1"
// shell\open\ddeexec (default) REG_SZ "%1",,0,0,,,,
// shell\open\ddeexec NoActivateHandler REG_SZ
// \Application (default) REG_SZ Firefox
@ -232,7 +232,7 @@ typedef struct {
#define CLS_HTML "FirefoxHTML"
#define CLS_URL "FirefoxURL"
#define VAL_FILE_ICON "%APPPATH%,1"
#define VAL_OPEN "\"%APPPATH%\" -url \"%1\" -requestPending"
#define VAL_OPEN "\"%APPPATH%\" -requestPending -osint -url \"%1\""
#define MAKE_KEY_NAME1(PREFIX, MID) \
PREFIX MID

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

@ -776,43 +776,11 @@ Annotations.prototype = {
},
get : function(aName) {
var value = null;
var type = Utilities.annotations.getItemAnnotationType(this._id, aName);
switch (type) {
case Ci.nsIAnnotationService.TYPE_INT32:
value = Utilities.annotations.getItemAnnotationInt32(this._id, aName);
break;
case Ci.nsIAnnotationService.TYPE_INT64:
value = Utilities.annotations.getItemAnnotationInt64(this._id, aName);
break;
case Ci.nsIAnnotationService.TYPE_DOUBLE:
value = Utilities.annotations.getItemAnnotationDouble(this._id, aName);
break;
case Ci.nsIAnnotationService.TYPE_STRING:
value = Utilities.annotations.getItemAnnotationString(this._id, aName);
break;
default:
throw("Unknown annotation type specified.");
}
return value;
return Utilities.annotations.getItemAnnotation(this._id, aName);
},
set : function(aName, aValue, aExpiration) {
var type = aValue != null ? aValue.constructor.name : "";
switch (type) {
case "String":
Utilities.annotations.setItemAnnotationString(this._id, aName, aValue, 0, aExpiration);
break;
case "Boolean":
Utilities.annotations.setItemAnnotationInt32(this._id, aName, aValue, 0, aExpiration);
break;
case "Number":
Utilities.annotations.setItemAnnotationDouble(this._id, aName, aValue, 0, aExpiration);
break;
default:
throw("Unknown annotation value specified.");
}
Utilities.annotations.setItemAnnotation(this._id, aName, aValue, 0, aExpiration);
},
remove : function(aName) {

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

@ -136,7 +136,7 @@
GetFullPathName $8 "$INSTDIR\${FileMainEXE}"
StrCpy $0 "SOFTWARE\Classes"
StrCpy $2 "$\"$8$\" -url $\"%1$\" -requestPending"
StrCpy $2 "$\"$8$\" -requestPending -osint -url $\"%1$\""
; Associate the file handlers with FirefoxHTML
WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML"
@ -364,7 +364,7 @@
; Store the command to open the app with an url in a register for easy access.
GetFullPathName $8 "$INSTDIR\${FileMainEXE}"
StrCpy $1 "$\"$8$\" -url $\"%1$\" -requestPending"
StrCpy $1 "$\"$8$\" -requestPending -osint -url $\"%1$\""
; Always set the file and protocol handlers since they may specify a
; different path and the path is used by Vista when setting associations.

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

@ -1332,10 +1332,3 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
-moz-border-bottom-colors: -moz-mac-menushadow -moz-mac-menushadow ThreeDShadow !important;
-moz-border-left-colors: ThreeDLightShadow ThreeDHighlight !important;
}
/* ::::: Tooltips (multi-line) from content ::::: */
.htmltooltip-label {
max-width: 40em;
margin: 0;
white-space: -moz-pre-wrap;
}

Двоичные данные
browser/themes/winstripe/browser/Close-tab.png

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

До

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

Двоичные данные
browser/themes/winstripe/browser/Go-rtl.png

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

До

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

Двоичные данные
browser/themes/winstripe/browser/Go.png

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

До

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

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

До

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

Двоичные данные
browser/themes/winstripe/browser/Search-rtl.png

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

До

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

Двоичные данные
browser/themes/winstripe/browser/Search.png

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

До

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

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

@ -1460,10 +1460,3 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
-moz-border-bottom-colors: #000000;
}
%endif
/* ::::: Tooltips (multi-line) from content ::::: */
.htmltooltip-label {
max-width: 40em;
margin: 0;
white-space: -moz-pre-wrap;
}

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

До

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

Двоичные данные
browser/themes/winstripe/browser/page-themes.png

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

До

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

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

@ -618,12 +618,12 @@ nsPrincipal::GetHashValue(PRUint32* aValue)
// If there is a certificate, it takes precendence over the codebase.
if (mCert) {
*aValue = nsCRT::HashCode(mCert->fingerprint.get(), nsnull);
*aValue = nsCRT::HashCode(mCert->fingerprint.get());
}
else {
nsCAutoString str;
mCodebase->GetSpec(str);
*aValue = nsCRT::HashCode(str.get(), nsnull);
*aValue = nsCRT::HashCode(str.get());
}
return NS_OK;

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

@ -429,7 +429,7 @@ ifdef SHARED_LIBRARY
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -bundle
else
EXTRA_DSO_LDOPTS += -dynamiclib -install_name @executable_path/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1
EXTRA_DSO_LDOPTS += -dynamiclib -install_name @executable_path/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module
endif
endif
endif
@ -1288,12 +1288,18 @@ $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.m Makefile Makefile.in
%.s: %.cpp
$(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
%.s: %.cc
$(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
%.s: %.c
$(CC) -S $(COMPILE_CFLAGS) $(_VPATH_SRCS)
%.i: %.cpp
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i
%.i: %.cc
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i
%.i: %.c
$(CC) -C -E $(COMPILE_CFLAGS) $(_VPATH_SRCS) > $*.i

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

@ -1068,6 +1068,25 @@ public:
const nsACString& aMimeGuess = EmptyCString(),
nsISupports* aExtra = nsnull);
/**
* Trigger a link with uri aLinkURI. If aClick is false, this triggers a
* mouseover on the link, otherwise it triggers a load after doing a
* security check using aContent's principal.
*
* @param aContent the node on which a link was triggered.
* @param aPresContext the pres context, must be non-null.
* @param aLinkURI the URI of the link, must be non-null.
* @param aTargetSpec the target (like target=, may be empty).
* @param aClick whether this was a click or not (if false, this method
* assumes you just hovered over the link).
* @param aIsUserTriggered whether the user triggered the link. This would be
* false for loads from auto XLinks or from the
* click() method if we ever implement it.
*/
static void TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
nsIURI *aLinkURI, const nsString& aTargetSpec,
PRBool aClick, PRBool aIsUserTriggered);
private:
static PRBool InitializeEventTable();
@ -1205,7 +1224,7 @@ private:
#define NS_INTERFACE_MAP_ENTRY_TEAROFF(_interface, _allocator) \
if (aIID.Equals(NS_GET_IID(_interface))) { \
foundInterface = static_cast<_interface *>(_allocator); \
foundInterface = static_cast<_interface *>(_allocator); \
if (!foundInterface) { \
*aInstancePtr = nsnull; \
return NS_ERROR_OUT_OF_MEMORY; \

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

@ -60,55 +60,66 @@ class nsChildContentList;
class nsNodeWeakReference;
class nsNodeSupportsWeakRefTearoff;
// This bit will be set if the node doesn't have nsSlots
#define NODE_DOESNT_HAVE_SLOTS 0x00000001U
enum {
// This bit will be set if the node doesn't have nsSlots
NODE_DOESNT_HAVE_SLOTS = 0x00000001U,
// This bit will be set if the node has a listener manager in the listener
// manager hash
#define NODE_HAS_LISTENERMANAGER 0x00000002U
// This bit will be set if the node has a listener manager in the listener
// manager hash
NODE_HAS_LISTENERMANAGER = 0x00000002U,
// Whether this node has had any properties set on it
#define NODE_HAS_PROPERTIES 0x00000004U
// Whether this node has had any properties set on it
NODE_HAS_PROPERTIES = 0x00000004U,
// Whether this node is anonymous
// NOTE: Should only be used on nsIContent nodes
#define NODE_IS_ANONYMOUS 0x00000008U
// Whether this node is anonymous
// NOTE: Should only be used on nsIContent nodes
NODE_IS_ANONYMOUS = 0x00000008U,
// Whether this node is anonymous for events
// NOTE: Should only be used on nsIContent nodes
#define NODE_IS_ANONYMOUS_FOR_EVENTS 0x00000010U
// Whether this node is anonymous for events
// NOTE: Should only be used on nsIContent nodes
NODE_IS_ANONYMOUS_FOR_EVENTS = 0x00000010U,
// Whether this node may have a frame
// NOTE: Should only be used on nsIContent nodes
#define NODE_MAY_HAVE_FRAME 0x00000020U
// Whether this node may have a frame
// NOTE: Should only be used on nsIContent nodes
NODE_MAY_HAVE_FRAME = 0x00000020U,
// Forces the XBL code to treat this node as if it were
// in the document and therefore should get bindings attached.
#define NODE_FORCE_XBL_BINDINGS 0x00000040U
// Forces the XBL code to treat this node as if it were
// in the document and therefore should get bindings attached.
NODE_FORCE_XBL_BINDINGS = 0x00000040U,
// Whether a binding manager may have a pointer to this
#define NODE_MAY_BE_IN_BINDING_MNGR 0x00000080U
// Whether a binding manager may have a pointer to this
NODE_MAY_BE_IN_BINDING_MNGR = 0x00000080U,
#define NODE_IS_EDITABLE 0x00000100U
NODE_IS_EDITABLE = 0x00000100U,
// Four bits for the script-type ID
#define NODE_SCRIPT_TYPE_OFFSET 9
// Four bits for the script-type ID
NODE_SCRIPT_TYPE_OFFSET = 9,
// Remaining bits are node type specific.
#define NODE_TYPE_SPECIFIC_BITS_OFFSET 0x0d
NODE_SCRIPT_TYPE_SIZE = 4,
// Useful macro for getting a node given an nsIContent and an nsIDocument
// Returns the first argument cast to nsINode if it is non-null, otherwise
// returns the second (which may be null)
#define NODE_FROM(content_, document_) \
((content_) ? static_cast<nsINode*>((content_)) : \
static_cast<nsINode*>((document_)))
// Remaining bits are node type specific.
NODE_TYPE_SPECIFIC_BITS_OFFSET =
NODE_SCRIPT_TYPE_OFFSET + NODE_SCRIPT_TYPE_SIZE
};
// Useful inline function for getting a node given an nsIContent and an
// nsIDocument. Returns the first argument cast to nsINode if it is non-null,
// otherwise returns the second (which may be null). We use type variables
// instead of nsIContent* and nsIDocument* because the actual types must be
// known for the cast to work.
template<class C, class D>
inline nsINode* NODE_FROM(C& aContent, D& aDocument)
{
if (aContent)
return static_cast<nsINode*>(aContent);
return static_cast<nsINode*>(aDocument);
}
// IID for the nsINode interface
#define NS_INODE_IID \
{ 0xd3e63f80, 0x9e98, 0x47d7, \
{ 0xac, 0x8d, 0xad, 0x6f, 0x20, 0x6c, 0xe7, 0xc6 } }
{ 0x8cef8b4e, 0x4b7f, 0x4f86, \
{ 0xba, 0x64, 0x75, 0xdf, 0xed, 0x0d, 0xa2, 0x3e } }
// hack to make egcs / gcc 2.95.2 happy
class nsINode_base : public nsPIDOMEventTarget {
@ -608,6 +619,15 @@ public:
}
}
PRBool IsEditable() const
{
#ifdef _IMPL_NS_LAYOUT
return IsEditableInternal();
#else
return IsEditableExternal();
#endif
}
protected:
// Override this function to create a custom slots class.
@ -643,6 +663,12 @@ protected:
return slots;
}
PRBool IsEditableInternal() const;
virtual PRBool IsEditableExternal() const
{
return IsEditableInternal();
}
nsCOMPtr<nsINodeInfo> mNodeInfo;
enum { PARENT_BIT_INDOCUMENT = 1 << 0, PARENT_BIT_PARENT_IS_CONTENT = 1 << 1 };

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

@ -86,9 +86,18 @@ public:
return u == 0x0020 || u == 0x200b/*ZWSP*/ || u == '\n' || u == '\t';
}
static inline PRBool IsComplexASCIIChar(PRUnichar u)
{
return !((0x0030 <= u && u <= 0x0039) ||
(0x0041 <= u && u <= 0x005A) ||
(0x0061 <= u && u <= 0x007A));
}
static inline PRBool IsComplexChar(PRUnichar u)
{
return (0x1100 <= u && u <= 0x11ff) ||
return IsComplexASCIIChar(u) ||
(0x1100 <= u && u <= 0x11ff) ||
(0x2000 <= u && u <= 0x21ff) ||
(0x2e80 <= u && u <= 0xd7ff) ||
(0xf900 <= u && u <= 0xfaff) ||
(0xff00 <= u && u <= 0xffef);

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

@ -269,14 +269,20 @@ nsContentSink::StyleSheetLoaded(nsICSSStyleSheet* aSheet,
NS_ASSERTION(mPendingSheetCount > 0, "How'd that happen?");
--mPendingSheetCount;
if (mPendingSheetCount == 0 && mDeferredLayoutStart) {
// We might not have really started layout, since this sheet was still
// loading. Do it now. Probably doesn't matter whether we do this
// before or after we unblock scripts, but before feels saner. Note that
// if mDeferredLayoutStart is true, that means any subclass StartLayout()
// stuff that needs to happen has already happened, so we don't need to
// worry about it.
StartLayout(PR_FALSE);
if (mPendingSheetCount == 0 &&
(mDeferredLayoutStart || mDeferredFlushTags)) {
if (mDeferredFlushTags) {
FlushTags();
}
if (mDeferredLayoutStart) {
// We might not have really started layout, since this sheet was still
// loading. Do it now. Probably doesn't matter whether we do this
// before or after we unblock scripts, but before feels saner. Note
// that if mDeferredLayoutStart is true, that means any subclass
// StartLayout() stuff that needs to happen has already happened, so we
// don't need to worry about it.
StartLayout(PR_FALSE);
}
// Go ahead and try to scroll to our ref if we have one
TryToScrollToRef();
@ -1019,7 +1025,7 @@ nsContentSink::StartLayout(PRBool aIgnorePendingSheets)
mDeferredLayoutStart = PR_TRUE;
if (!aIgnorePendingSheets && mPendingSheetCount > 0) {
if (!aIgnorePendingSheets && WaitForPendingSheets()) {
// Bail out; we'll start layout when the sheets load
return;
}
@ -1172,11 +1178,16 @@ nsContentSink::Notify(nsITimer *timer)
}
#endif
FlushTags();
if (WaitForPendingSheets()) {
mDeferredFlushTags = PR_TRUE;
} else {
FlushTags();
// Now try and scroll to the reference
// XXX Should we scroll unconditionally for history loads??
TryToScrollToRef();
}
// Now try and scroll to the reference
// XXX Should we scroll unconditionally for history loads??
TryToScrollToRef();
mNotificationTimer = nsnull;
MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::Notify()\n"));
MOZ_TIMER_STOP(mWatch);
@ -1191,6 +1202,11 @@ nsContentSink::IsTimeToNotify()
return PR_FALSE;
}
if (WaitForPendingSheets()) {
mDeferredFlushTags = PR_TRUE;
return PR_FALSE;
}
PRTime now = PR_Now();
PRInt64 interval, diff;
@ -1213,7 +1229,9 @@ nsContentSink::WillInterruptImpl()
SINK_TRACE(gContentSinkLogModuleInfo, SINK_TRACE_CALLS,
("nsContentSink::WillInterrupt: this=%p", this));
#ifndef SINK_NO_INCREMENTAL
if (mNotifyOnTimer && mLayoutStarted) {
if (WaitForPendingSheets()) {
mDeferredFlushTags = PR_TRUE;
} else if (mNotifyOnTimer && mLayoutStarted) {
if (mBackoffCount && !mInMonolithicContainer) {
PRInt64 now = PR_Now();
PRInt64 interval = GetNotificationInterval();

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

@ -211,6 +211,10 @@ protected:
void TryToScrollToRef();
// Later on we might want to make this more involved somehow
// (e.g. stop waiting after some timeout or whatnot).
PRBool WaitForPendingSheets() { return mPendingSheetCount > 0; }
private:
// People shouldn't be allocating this class directly. All subclasses should
// be allocated using a zeroing operator new.
@ -276,7 +280,9 @@ protected:
PRUint8 mHaveOfflineResources : 1;
// true if offline-resource links should be saved to the offline cache
PRUint8 mSaveOfflineResources : 1;
// If true, we deferred notifications until sheets load
PRUint8 mDeferredFlushTags : 1;
// -- Can interrupt parsing members --
PRUint32 mDelayTimerStart;

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

@ -3623,3 +3623,46 @@ nsContentUtils::CheckSecurityBeforeLoad(nsIURI* aURIToLoad,
}
return sSecurityManager->CheckSameOriginURI(loadingURI, aURIToLoad);
}
/* static */
void
nsContentUtils::TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
nsIURI *aLinkURI, const nsString &aTargetSpec,
PRBool aClick, PRBool aIsUserTriggered)
{
NS_ASSERTION(aPresContext, "Need a nsPresContext");
NS_PRECONDITION(aLinkURI, "No link URI");
if (aContent->IsEditable()) {
return;
}
nsILinkHandler *handler = aPresContext->GetLinkHandler();
if (!handler) {
return;
}
if (!aClick) {
handler->OnOverLink(aContent, aLinkURI, aTargetSpec.get());
return;
}
// Check that this page is allowed to load this URI.
nsresult proceed = NS_OK;
if (sSecurityManager) {
PRUint32 flag =
aIsUserTriggered ?
(PRUint32)nsIScriptSecurityManager::STANDARD :
(PRUint32)nsIScriptSecurityManager::LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT;
proceed =
sSecurityManager->CheckLoadURIWithPrincipal(aContent->NodePrincipal(),
aLinkURI, flag);
}
// Only pass off the click event if the script security manager says it's ok.
if (NS_SUCCEEDED(proceed)) {
handler->OnLinkClick(aContent, aLinkURI, aTargetSpec.get());
}
}

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

@ -291,6 +291,20 @@ nsINode::RemoveMutationObserver(nsIMutationObserver* aMutationObserver)
}
}
PRBool
nsINode::IsEditableInternal() const
{
if (HasFlag(NODE_IS_EDITABLE)) {
// The node is in an editable contentEditable subtree.
return PR_TRUE;
}
nsIDocument *doc = GetCurrentDoc();
// Check if the node is in a document and the document is in designMode.
return doc && doc->HasFlag(NODE_IS_EDITABLE);
}
//----------------------------------------------------------------------
void
@ -308,15 +322,8 @@ nsIContent::SetNativeAnonymous(PRBool aAnonymous)
PRInt32
nsIContent::IntrinsicState() const
{
PRBool editable = HasFlag(NODE_IS_EDITABLE);
if (!editable) {
nsIDocument *doc = GetCurrentDoc();
if (doc) {
editable = doc->HasFlag(NODE_IS_EDITABLE);
}
}
return editable ? NS_EVENT_STATE_MOZ_READWRITE : NS_EVENT_STATE_MOZ_READONLY;
return IsEditable() ? NS_EVENT_STATE_MOZ_READWRITE :
NS_EVENT_STATE_MOZ_READONLY;
}
void
@ -3414,44 +3421,6 @@ nsGenericElement::LeaveLink(nsPresContext* aPresContext)
return handler->OnLeaveLink();
}
nsresult
nsGenericElement::TriggerLink(nsPresContext* aPresContext,
nsIURI* aLinkURI,
const nsAFlatString& aTargetSpec,
PRBool aClick,
PRBool aIsUserTriggered)
{
NS_PRECONDITION(aLinkURI, "No link URI");
nsresult rv = NS_OK;
nsILinkHandler *handler = aPresContext->GetLinkHandler();
if (!handler) return NS_OK;
if (aClick) {
nsresult proceed = NS_OK;
// Check that this page is allowed to load this URI.
nsCOMPtr<nsIScriptSecurityManager> securityManager =
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv)) {
PRUint32 flag =
aIsUserTriggered ?
(PRUint32) nsIScriptSecurityManager::STANDARD :
(PRUint32) nsIScriptSecurityManager::LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT;
proceed =
securityManager->CheckLoadURIWithPrincipal(NodePrincipal(), aLinkURI,
flag);
}
// Only pass off the click event if the script security manager
// says it's ok.
if (NS_SUCCEEDED(proceed))
handler->OnLinkClick(this, aLinkURI, aTargetSpec.get());
} else {
handler->OnOverLink(this, aLinkURI, aTargetSpec.get());
}
return rv;
}
nsresult
nsGenericElement::AddScriptEventListener(nsIAtom* aEventName,
const nsAString& aValue,
@ -3626,6 +3595,10 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
}
}
if (aNotify) {
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, modType);
}
if (aFireMutation) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_ATTRMODIFIED);
@ -3651,10 +3624,6 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
}
if (aNotify) {
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, modType);
}
if (aNamespaceID == kNameSpaceID_XMLEvents &&
aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
mNodeInfo->GetDocument()->AddXMLEventsContent(this);
@ -4165,7 +4134,8 @@ nsGenericElement::PreHandleEventForLinks(nsEventChainPreVisitor& aVisitor)
{
nsAutoString target;
GetLinkTarget(target);
rv = TriggerLink(aVisitor.mPresContext, absURI, target, PR_FALSE, PR_TRUE);
nsContentUtils::TriggerLink(this, aVisitor.mPresContext, absURI, target,
PR_FALSE, PR_TRUE);
}
break;
@ -4269,7 +4239,8 @@ nsGenericElement::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
{
nsAutoString target;
GetLinkTarget(target);
rv = TriggerLink(aVisitor.mPresContext, absURI, target, PR_TRUE, PR_TRUE);
nsContentUtils::TriggerLink(this, aVisitor.mPresContext, absURI, target,
PR_TRUE, PR_TRUE);
}
break;

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

@ -553,26 +553,6 @@ public:
const nsAString& aValue,
PRBool aDefer = PR_TRUE);
/**
* Trigger a link with uri aLinkURI. If aClick is false, this triggers a
* mouseover on the link, otherwise it triggers a load, after doing a
* security check. The node principal of |this| is used for the security
* check.
*
* @param aPresContext the pres context.
* @param aLinkURI the URI of the link
* @param aTargetSpec the target (like target=, may be empty)
* @param aClick whether this was a click or not (if false, it assumes you
* just hovered over the link)
* @param aIsUserTriggered whether the user triggered the link.
* This would be false for loads from auto XLinks or from the
* click() method if we ever implement it.
*/
nsresult TriggerLink(nsPresContext* aPresContext,
nsIURI* aLinkURI,
const nsAFlatString& aTargetSpec,
PRBool aClick,
PRBool aIsUserTriggered);
/**
* Do whatever needs to be done when the mouse leaves a link
*/

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

@ -214,6 +214,10 @@ nsLineBreaker::AppendText(nsIAtom* aLangGroup, const PRUint8* aText, PRUint32 aL
while (offset < aLength && !IsSpace(aText[offset])) {
mCurrentWord.AppendElement(aText[offset]);
if (!mCurrentWordContainsComplexChar &&
IsComplexASCIIChar(aText[offset])) {
mCurrentWordContainsComplexChar = PR_TRUE;
}
++offset;
}
@ -249,6 +253,7 @@ nsLineBreaker::AppendText(nsIAtom* aLangGroup, const PRUint8* aText, PRUint32 aL
}
}
PRUint32 wordStart = offset;
PRBool wordHasComplexChar = PR_FALSE;
for (;;) {
PRUint8 ch = aText[offset];
@ -261,17 +266,31 @@ nsLineBreaker::AppendText(nsIAtom* aLangGroup, const PRUint8* aText, PRUint32 aL
mAfterSpace = isSpace;
if (isSpace) {
// The current word can't have any complex characters inside it
// because this is 8-bit text, so just ignore it
if (offset > wordStart && wordHasComplexChar) {
if (aFlags & BREAK_ALLOW_INSIDE) {
// Save current start-of-word state because GetJISx4051Breaks will
// set it to false
PRPackedBool currentStart = breakState[wordStart];
nsContentUtils::LineBreaker()->
GetJISx4051Breaks(aText + wordStart, offset - wordStart,
breakState.Elements() + wordStart);
breakState[wordStart] = currentStart;
}
wordHasComplexChar = PR_FALSE;
}
++offset;
if (offset >= aLength)
break;
wordStart = offset;
} else {
if (!wordHasComplexChar && IsComplexASCIIChar(ch)) {
wordHasComplexChar = PR_TRUE;
}
++offset;
if (offset >= aLength) {
// Save this word
mCurrentWordContainsComplexChar = PR_FALSE;
mCurrentWordContainsComplexChar = wordHasComplexChar;
PRUint32 len = offset - wordStart;
PRUnichar* elems = mCurrentWord.AppendElements(len);
if (!elems)
@ -285,8 +304,6 @@ nsLineBreaker::AppendText(nsIAtom* aLangGroup, const PRUint8* aText, PRUint32 aL
offset = wordStart + 1;
break;
}
// We can't break inside words in 8-bit text (no complex characters), so
// there is no need to do anything else to handle words
}
}

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

@ -1103,7 +1103,7 @@ NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo, PRBool aFromParser)\
if (NS_SUCCEEDED(rv)) \
return rv; \
\
rv = DOMQueryInterface(static_cast<_base_if *>(this), aIID, \
rv = DOMQueryInterface(static_cast<_base_if *>(this), aIID, \
aInstancePtr); \
\
if (NS_SUCCEEDED(rv)) \
@ -1134,7 +1134,7 @@ NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo, PRBool aFromParser)\
if (NS_SUCCEEDED(rv)) \
return rv; \
\
rv = DOMQueryInterface(static_cast<_base_if *>(this), aIID, \
rv = DOMQueryInterface(static_cast<_base_if *>(this), aIID, \
aInstancePtr); \
\
if (NS_SUCCEEDED(rv)) \

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

@ -981,7 +981,7 @@ nsHTMLFormElement::SubmitSubmission(nsIFormSubmission* aFormSubmission)
nsIDocument* doc = GetCurrentDoc();
nsCOMPtr<nsISupports> container = doc ? doc->GetContainer() : nsnull;
nsCOMPtr<nsILinkHandler> linkHandler(do_QueryInterface(container));
if (!linkHandler) {
if (!linkHandler || IsEditable()) {
mIsSubmitting = PR_FALSE;
return NS_OK;
}

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

@ -76,6 +76,7 @@ _TEST_FILES = test_bug589.html \
test_bug375003-1.html \
test_bug375003-2.html \
test_bug384419.html \
test_bug386496.html \
test_bug386728.html \
$(NULL)

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

@ -0,0 +1,56 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=386496
-->
<head>
<title>Test for Bug 386496</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.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=386496">Mozilla Bug 386496</a>
<p id="display"></p>
<div id="content">
<div id="frameContent">
<a id="a" href="http://a.invalid/">Link</a>
</div>
<iframe id="testIframe"></iframe>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 386496 **/
var frame = document.getElementById("testIframe");
function finishTest() {
is(frame.contentWindow.location, "about:blank");
SimpleTest.finish();
}
function testDesignMode() {
frame.style.display = 'block';
var frameContent = frame.contentDocument.adoptNode(document.getElementById("frameContent"));
frame.contentDocument.body.appendChild(frameContent);
frame.contentDocument.designMode = "on";
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
var event = frame.contentDocument.createEvent('MouseEvent');
event.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false,
false, false, 0, null);
frame.contentDocument.getElementById("a").dispatchEvent(event);
setTimeout(finishTest, 100);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(testDesignMode);
</script>
</pre>
</body>
</html>

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

@ -30,8 +30,8 @@ function testContentEditable() {
frame.style.display = 'block';
var frameContent = frame.contentDocument.adoptNode(document.getElementById("frameContent"));
frame.contentDocument.body.appendChild(frameContent);
frame.contentDocument.contentEditable = "true";
frame.contentDocument.contentEditable = "false";
frame.contentDocument.getElementById("edit").contentEditable = "true";
frame.contentDocument.getElementById("edit").contentEditable = "false";
frame.contentDocument.getElementById("button_on").click();
is(frame.contentDocument.getElementById("edit").contentEditable, "true");
}

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

@ -1340,6 +1340,7 @@ SinkContext::AddText(const nsAString& aText)
nsresult
SinkContext::FlushTags()
{
mSink->mDeferredFlushTags = PR_FALSE;
PRBool oldBeganUpdate = mSink->mBeganUpdate;
PRUint32 oldUpdates = mSink->mUpdatesInNotification;

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

@ -359,7 +359,7 @@ nsSVGImageElement::ConstructPath(gfxContext *aCtx)
GetAnimatedLengthValues(&x, &y, &width, &height, nsnull);
if (width == 0 || height == 0)
if (width <= 0 || height <= 0)
return;
aCtx->Rectangle(gfxRect(x, y, width, height));

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

@ -97,8 +97,14 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGSVGElementBase)
nsSVGSVGElement::nsSVGSVGElement(nsINodeInfo* aNodeInfo)
: nsSVGSVGElementBase(aNodeInfo),
mCoordCtx(nsnull),
mViewportWidth(0),
mViewportHeight(0),
mCoordCtxMmPerPx(0),
mRedrawSuspendCount(0)
mPreviousTranslate_x(0),
mPreviousTranslate_y(0),
mPreviousScale(0),
mRedrawSuspendCount(0),
mDispatchEvent(PR_FALSE)
{
}

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

@ -139,6 +139,7 @@ nsXBLResourceLoader::LoadResources(PRBool* aResult)
// Kick off the load of the stylesheet.
// Always load chrome synchronously
// XXXbz should that still do a content policy check?
PRBool chrome;
nsresult rv;
if (NS_SUCCEEDED(url->SchemeIs("chrome", &chrome)) && chrome)
@ -154,7 +155,7 @@ nsXBLResourceLoader::LoadResources(PRBool* aResult)
}
else
{
rv = cssLoader->LoadSheet(url, this);
rv = cssLoader->LoadSheet(url, docURL, doc->NodePrincipal(), this);
if (NS_SUCCEEDED(rv))
++mPendingSheets;
}

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

@ -188,8 +188,7 @@ nsXMLElement::MaybeTriggerAutoLink(nsIDocShell *aShell)
nsresult rv = DocShellToPresContext(aShell, getter_AddRefs(pc));
NS_ENSURE_SUCCESS(rv, rv);
rv = TriggerLink(pc, absURI, target, PR_TRUE, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
nsContentUtils::TriggerLink(this, pc, absURI, target, PR_TRUE, PR_FALSE);
return special_rv; // return GetLinkTargetAndAutoType's special rv!
}

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

@ -1066,17 +1066,24 @@ nsXMLContentSink::HandleStartElement(const PRUnichar *aName,
// Some HTML nodes need DoneCreatingElement() called to initialize
// properly (eg form state restoration).
if (nodeInfo->NamespaceID() == kNameSpaceID_XHTML &&
(nodeInfo->NameAtom() == nsGkAtoms::input ||
nodeInfo->NameAtom() == nsGkAtoms::button)) {
content->DoneCreatingElement();
if (nodeInfo->NamespaceID() == kNameSpaceID_XHTML) {
if (nodeInfo->NameAtom() == nsGkAtoms::input ||
nodeInfo->NameAtom() == nsGkAtoms::button) {
content->DoneCreatingElement();
} else if (nodeInfo->NameAtom() == nsGkAtoms::head && !mCurrentHead) {
mCurrentHead = content;
}
}
if (IsMonolithicContainer(nodeInfo)) {
mInMonolithicContainer++;
}
MaybeStartLayout(PR_FALSE);
if (content != mDocElement && !mCurrentHead) {
// This isn't the root and we're not inside an XHTML <head>.
// Might need to start layout
MaybeStartLayout(PR_FALSE);
}
return aInterruptable && NS_SUCCEEDED(result) ? DidProcessATokenImpl() :
result;
@ -1122,10 +1129,17 @@ nsXMLContentSink::HandleEndElement(const PRUnichar *aName,
result = CloseElement(content);
if (mCurrentHead == content) {
mCurrentHead = nsnull;
}
if (mDocElement == content) {
// XXXbz for roots that don't want to be appended on open, we
// probably need to deal here.... (and stop appending them on open).
mState = eXMLContentSinkState_InEpilog;
// We might have had no occasion to start layout yet. Do so now.
MaybeStartLayout(PR_FALSE);
}
PRInt32 stackLen = mContentStack.Length();
@ -1591,6 +1605,7 @@ nsXMLContentSink::FlushPendingNotifications(mozFlushType aType)
nsresult
nsXMLContentSink::FlushTags()
{
mDeferredFlushTags = PR_FALSE;
PRBool oldBeganUpdate = mBeganUpdate;
PRUint32 oldUpdates = mUpdatesInNotification;

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

@ -183,6 +183,7 @@ protected:
PRBool aInterruptable);
nsIContent* mDocElement;
nsCOMPtr<nsIContent> mCurrentHead; // When set, we're in an XHTML <haed>
PRUnichar* mText;
XMLContentSinkState mState;

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

@ -48,12 +48,12 @@
#ifdef NS_BUILD_REFCNT_LOGGING
#define LOG_CHUNK_MOVE(_start, _new_start, _count) \
{ \
txXPathNode *start = const_cast<txXPathNode*>(_start); \
txXPathNode *start = const_cast<txXPathNode*>(_start); \
while (start < _start + _count) { \
NS_LogDtor(start, "txXPathNode", sizeof(*start)); \
++start; \
} \
start = const_cast<txXPathNode*>(_new_start); \
start = const_cast<txXPathNode*>(_new_start); \
while (start < _new_start + _count) { \
NS_LogCtor(start, "txXPathNode", sizeof(*start)); \
++start; \

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

@ -1297,6 +1297,18 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
}
}
if (doc) {
nsXBLBinding *binding = doc->BindingManager()->GetBinding(this);
if (binding)
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify);
}
if (aNotify) {
nsNodeUtils::AttributeChanged(this, aNameSpaceID, aName,
nsIDOMMutationEvent::REMOVAL);
}
if (hasMutationListeners) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_ATTRMODIFIED);
@ -1312,18 +1324,6 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
nsnull, &mutation);
}
if (doc) {
nsXBLBinding *binding = doc->BindingManager()->GetBinding(this);
if (binding)
binding->AttributeChanged(aName, aNameSpaceID, PR_TRUE, aNotify);
}
if (aNotify) {
nsNodeUtils::AttributeChanged(this, aNameSpaceID, aName,
nsIDOMMutationEvent::REMOVAL);
}
return NS_OK;
}

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

@ -199,8 +199,8 @@ struct BroadcastListener {
nsXULDocument::nsXULDocument(void)
: nsXMLDocument("application/vnd.mozilla.xul+xml"),
mResolutionPhase(nsForwardReference::eStart),
mState(eState_Master)
mState(eState_Master),
mResolutionPhase(nsForwardReference::eStart)
{
// NOTE! nsDocument::operator new() zeroes out all members, so don't
@ -2594,9 +2594,6 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic,
*aShouldReturn = PR_FALSE;
*aFailureFromContent = PR_FALSE;
nsCOMPtr<nsIScriptSecurityManager> secMan = do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gXULLog, PR_LOG_DEBUG)) {
nsCAutoString urlspec;
@ -2610,6 +2607,9 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic,
if (aIsDynamic)
mResolutionPhase = nsForwardReference::eStart;
nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
NS_ENSURE_TRUE(secMan, NS_ERROR_NOT_AVAILABLE);
// Chrome documents are allowed to load overlays from anywhere.
// Also, any document may load a chrome:// overlay.
// In all other cases, the overlay is only allowed to load if
@ -2675,10 +2675,9 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic,
// Not there. Initiate a load.
PR_LOG(gXULLog, PR_LOG_DEBUG, ("xul: overlay was not cached"));
// No one ever uses overlay principals for anything, so it's OK to give
// them the null principal. Too bad this code insists on the sort of
// syncloading that can't provide us the right principal from the
// channel...
// We'll set the right principal on the proto doc when we get
// OnStartRequest from the parser, so just pass in a null principal for
// now.
nsCOMPtr<nsIParser> parser;
rv = PrepareToLoadPrototype(aURI, "view", nsnull, getter_AddRefs(parser));
if (NS_FAILED(rv)) return rv;
@ -2695,7 +2694,8 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic,
// Add an observer to the parser; this'll get called when
// Necko fires its On[Start|Stop]Request() notifications,
// and will let us recover from a missing overlay.
ParserObserver* parserObserver = new ParserObserver(this);
ParserObserver* parserObserver =
new ParserObserver(this, mCurrentPrototype);
if (! parserObserver)
return NS_ERROR_OUT_OF_MEMORY;
@ -3699,7 +3699,9 @@ nsXULDocument::AddPrototypeSheets()
nsCOMPtr<nsIURI> uri = sheets[i];
nsCOMPtr<nsICSSStyleSheet> incompleteSheet;
rv = CSSLoader()->LoadSheet(uri, this, getter_AddRefs(incompleteSheet));
rv = CSSLoader()->LoadSheet(uri, mCurrentPrototype->GetURI(),
mCurrentPrototype->DocumentPrincipal(),
this, getter_AddRefs(incompleteSheet));
// XXXldb We need to prevent bogus sheets from being held in the
// prototype's list, but until then, don't propagate the failure
@ -4332,15 +4334,14 @@ nsXULDocument::CachedChromeStreamListener::OnDataAvailable(nsIRequest *request,
// ParserObserver
//
nsXULDocument::ParserObserver::ParserObserver(nsXULDocument* aDocument)
: mDocument(aDocument)
nsXULDocument::ParserObserver::ParserObserver(nsXULDocument* aDocument,
nsXULPrototypeDocument* aPrototype)
: mDocument(aDocument), mPrototype(aPrototype)
{
NS_ADDREF(mDocument);
}
nsXULDocument::ParserObserver::~ParserObserver()
{
NS_IF_RELEASE(mDocument);
}
NS_IMPL_ISUPPORTS1(nsXULDocument::ParserObserver, nsIRequestObserver)
@ -4349,6 +4350,22 @@ NS_IMETHODIMP
nsXULDocument::ParserObserver::OnStartRequest(nsIRequest *request,
nsISupports* aContext)
{
// Guard against buggy channels calling OnStartRequest multiple times.
if (mPrototype) {
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
if (channel && secMan) {
nsCOMPtr<nsIPrincipal> principal;
secMan->GetChannelPrincipal(channel, getter_AddRefs(principal));
// Failure there is ok -- it'll just set a (safe) null principal
mPrototype->SetDocumentPrincipal(principal);
}
// Make sure to avoid cycles
mPrototype = nsnull;
}
return NS_OK;
}
@ -4377,7 +4394,7 @@ nsXULDocument::ParserObserver::OnStopRequest(nsIRequest *request,
// Drop the reference to the document to break cycle between the
// document, the parser, the content sink, and the parser
// observer.
NS_RELEASE(mDocument);
mDocument = nsnull;
return rv;
}

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

@ -658,11 +658,13 @@ protected:
class ParserObserver : public nsIRequestObserver {
protected:
nsXULDocument* mDocument;
nsRefPtr<nsXULDocument> mDocument;
nsRefPtr<nsXULPrototypeDocument> mPrototype;
virtual ~ParserObserver();
public:
ParserObserver(nsXULDocument* aDocument);
ParserObserver(nsXULDocument* aDocument,
nsXULPrototypeDocument* aPrototype);
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER

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

@ -541,6 +541,11 @@ nsXULPrototypeDocument::DocumentPrincipal()
return mNodeInfoManager->DocumentPrincipal();
}
void
nsXULPrototypeDocument::SetDocumentPrincipal(nsIPrincipal* aPrincipal)
{
mNodeInfoManager->SetDocumentPrincipal(aPrincipal);
}
nsNodeInfoManager*
nsXULPrototypeDocument::GetNodeInfoManager()

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

@ -5230,6 +5230,12 @@ nsDocShell::BeginRestore(nsIContentViewer *aContentViewer, PRBool aTop)
}
if (!aTop) {
// This point corresponds to us having gotten OnStartRequest or
// STATE_START, so do the same thing that CreateContentViewer does at
// this point to ensure that unload/pagehide events for this document
// will fire when it's unloaded again.
mFiredUnloadEvent = PR_FALSE;
// For non-top frames, there is no notion of making sure that the
// previous document is in the domwindow when STATE_START notifications
// happen. We can just call BeginRestore for all of the child shells
@ -6292,6 +6298,10 @@ nsDocShell::InternalLoad(nsIURI * aURI,
nsIDocShell** aDocShell,
nsIRequest** aRequest)
{
if (mFiredUnloadEvent) {
return NS_OK; // JS may not handle returning of an error code
}
nsresult rv = NS_OK;
#ifdef PR_LOGGING

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

@ -773,7 +773,7 @@ nsWebShell::OnLinkClick(nsIContent* aContent,
return NS_OK;
}
if (aContent->HasFlag(NODE_IS_EDITABLE)) {
if (aContent->IsEditable()) {
return NS_OK;
}
@ -804,7 +804,7 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
return NS_OK;
}
if (aContent->HasFlag(NODE_IS_EDITABLE)) {
if (aContent->IsEditable()) {
return NS_OK;
}
@ -903,7 +903,7 @@ nsWebShell::OnOverLink(nsIContent* aContent,
nsIURI* aURI,
const PRUnichar* aTargetSpec)
{
if (aContent->HasFlag(NODE_IS_EDITABLE)) {
if (aContent->IsEditable()) {
return NS_OK;
}

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

@ -41,6 +41,9 @@ srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = docshell/test
DIRS += chrome \
$(NULL)
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

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

@ -1,4 +1,3 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
@ -12,16 +11,14 @@
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# Sylvain Pasche <sylvain.pasche@gmail.com>.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# leaf nunes <leaf@mozilla.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
@ -41,33 +38,15 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = docshell/test/chrome
include $(DEPTH)/config/autoconf.mk
ifdef CYGDRIVE_MOUNT
OBJDIR = $(shell cygpath -t mixed -ai $(DEPTH))
else
OBJDIR = $(shell cd $(DEPTH) && pwd)
endif
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
MODULE = xpinstall
STUB_NAME = $(PKG_BASENAME).stub-installer
SEA_NAME = $(PKG_BASENAME).installer
ifeq (,$(INSTALLER_URL))
INSTALLER_URL = "http://ftp.mozilla.org/pub/mozilla.org/pub/seamonkey/nightly/latest-trunk/os2-xpi"
endif
include $(topsrcdir)/config/config.mk
installer: $(srcdir)/$(STUB_NAME).jst
$(PERL) $(srcdir)/makeall.pl -aurl $(INSTALLER_URL) -objdir $(OBJDIR) \
-instname $(SEA_NAME) -stubname $(STUB_NAME)
include $(topsrcdir)/config/rules.mk
$(srcdir)/$(STUB_NAME).jst: mozilla-os2-stub-installer.jst
sed -e "s|seamonkey-os2-stub-installer|$(STUB_NAME)|" $^ > $@
_TEST_FILES = \
test_bug364461.xul \
bug364461_window.xul \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)

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

@ -0,0 +1,317 @@
<?xml version="1.0"?>
<!-- ***** 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 bug 364461 mochitest
-
- The Initial Developer of the Original Code is
- Sylvain Pasche <sylvain.pasche@gmail.com>.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. 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 ***** -->
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window id="364461Test"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="600"
height="600"
onload="onLoad();"
title="364461 test">
<script type="application/javascript"><![CDATA[
const LISTEN_EVENTS = ["load", "unload", "pageshow", "pagehide"];
const MISSING_EVENTS_TIMEOUT = 5000;
var gBrowser;
var gTestsIterator;
var gExpected = [];
var gMissingEventsTimeoutId;
function ok(condition, message) {
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
}
function is(a, b, message) {
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
}
function finish() {
clearTimeout(gMissingEventsTimeoutId);
for each (let eventType in LISTEN_EVENTS) {
gBrowser.removeEventListener(eventType, eventListener, true);
}
window.close();
window.opener.wrappedJSObject.SimpleTest.finish();
}
function onLoad() {
gBrowser = document.getElementById("content");
for each (let eventType in LISTEN_EVENTS) {
gBrowser.addEventListener(eventType, eventListener, true);
}
gMissingEventsTimeoutId = setTimeout(function() {
ok(false, "Did not receive all expected events");
finish();
}, MISSING_EVENTS_TIMEOUT);
gTestsIterator = testsIterator();
nextTest();
}
function eventListener(event) {
ok(gExpected.length >= 1, "Unexpected event " + event.type);
if (gExpected.length == 0) {
// in case of unexpected event, try to continue anyway
setTimeout(nextTest, 0);
return;
}
var exp = gExpected.shift();
is(event.type, exp.type, "Invalid event received");
if (typeof(exp.persisted) != "undefined") {
is(event.persisted, exp.persisted, "Invalid persisted state");
}
if (exp.title) {
ok(event.originalTarget instanceof HTMLDocument,
"originalTarget not a HTMLDocument");
is(event.originalTarget.title, exp.title, "titles don't match");
}
if (gExpected.length == 0) {
setTimeout(nextTest, 0);
}
}
function nextTest() {
try {
gTestsIterator.next();
} catch (err if err instanceof StopIteration) {
finish();
}
}
function testsIterator() {
// Tests 1 + 2:
// Back/forward between two simple documents. Bfcache will be used.
var test1Doc = "data:text/html,<html><head><title>test1</title></head>" +
"<body>test1</body></html>";
gExpected = [{type: "pagehide", persisted: true},
{type: "load", title: "test1"},
{type: "pageshow", title: "test1", persisted: false}];
gBrowser.loadURI(test1Doc);
yield;
var test2Doc = "data:text/html,<html><head><title>test2</title></head>" +
"<body>test2</body></html>";
gExpected = [{type: "pagehide", title: "test1", persisted: true},
{type: "load", title: "test2"},
{type: "pageshow", title: "test2", persisted: false}];
gBrowser.loadURI(test2Doc);
yield;
gExpected = [{type: "pagehide", title: "test2", persisted: true},
{type: "pageshow", title: "test1", persisted: true}];
gBrowser.goBack();
yield;
gExpected = [{type: "pagehide", title: "test1", persisted: true},
{type: "pageshow", title: "test2", persisted: true}];
gBrowser.goForward();
yield;
// Tests 3 + 4:
// Back/forward between a two-level deep iframed document and a simple
// document. Bfcache will be used and events should be dispatched to
// all frames.
var test3Doc = "data:text/html,<html><head><title>test3</title>" +
"</head><body>" +
"<iframe src='data:text/html," +
"<html><head><title>test3-nested1</title></head>" +
"<body>test3-nested1" +
"<iframe src=\"data:text/html," +
"<html><head><title>test3-nested2</title></head>" +
"<body>test3-nested2</body></html>\">" +
"</iframe>" +
"</body></html>'>" +
"</iframe>" +
"</body></html>";
gExpected = [{type: "pagehide", title: "test2", persisted: true},
{type: "load", title: "test3-nested2"},
{type: "pageshow", title: "test3-nested2", persisted: false},
{type: "load", title: "test3-nested1"},
{type: "pageshow", title: "test3-nested1", persisted: false},
{type: "load", title: "test3"},
{type: "pageshow", title: "test3", persisted: false}];
gBrowser.loadURI(test3Doc);
yield;
var test4Doc = "data:text/html,<html><head><title>test4</title></head>" +
"<body>test4</body></html>";
gExpected = [{type: "pagehide", title: "test3", persisted: true},
{type: "pagehide", title: "test3-nested1", persisted: true},
{type: "pagehide", title: "test3-nested2", persisted: true},
{type: "load", title: "test4"},
{type: "pageshow", title: "test4", persisted: false}];
gBrowser.loadURI(test4Doc);
yield;
gExpected = [{type: "pagehide", title: "test4", persisted: true},
{type: "pageshow", title: "test3-nested2", persisted: true},
{type: "pageshow", title: "test3-nested1", persisted: true},
{type: "pageshow", title: "test3", persisted: true}];
gBrowser.goBack();
yield;
// This is where the two nested pagehide are not dispatched in bug 364461
gExpected = [{type: "pagehide", title: "test3", persisted: true},
{type: "pagehide", title: "test3-nested1", persisted: true},
{type: "pagehide", title: "test3-nested2", persisted: true},
{type: "pageshow", title: "test4", persisted: true}];
gBrowser.goForward();
yield;
// Tests 5 + 6:
// Back/forward between a document containing an unload handler and a
// a simple document. Bfcache won't be used for the first one (see
// http://developer.mozilla.org/en/docs/Using_Firefox_1.5_caching).
var test5Doc = "data:text/html,<html><head><title>test5</title></head>" +
"<body onunload='while(false) { /* nop */ }'>" +
"test5</body></html>";
gExpected = [{type: "pagehide", title: "test4", persisted: true},
{type: "load", title: "test5"},
{type: "pageshow", title: "test5", persisted: false}];
gBrowser.loadURI(test5Doc);
yield;
var test6Doc = "data:text/html,<html><head><title>test6</title></head>" +
"<body>test6</body></html>";
gExpected = [{type: "pagehide", title: "test5", persisted: false},
{type: "unload", title: "test5"},
{type: "load", title: "test6"},
{type: "pageshow", title: "test6", persisted: false}];
gBrowser.loadURI(test6Doc);
yield;
gExpected = [{type: "pagehide", title: "test6", persisted: true},
{type: "load", title: "test5"},
{type: "pageshow", title: "test5", persisted: false}];
gBrowser.goBack();
yield;
gExpected = [{type: "pagehide", title: "test5", persisted: false},
{type: "unload", title: "test5"},
{type: "pageshow", title: "test6", persisted: true}];
gBrowser.goForward();
yield;
// Test 7:
// Testcase from https://bugzilla.mozilla.org/show_bug.cgi?id=384977#c10
// Check that navigation is not blocked after a document is restored
// from bfcache
var test7Doc = "data:text/html,<html><head><title>test7</title>" +
"</head><body>" +
"<iframe src='data:text/html," +
"<html><head><title>test7-nested1</title></head>" +
"<body>test7-nested1<br/>" +
"<a href=\"data:text/plain,aaa\" target=\"_main\">" +
"Click me, hit back, click me again</a>" +
"</body></html>'>" +
"</iframe>" +
"</body></html>";
gExpected = [{type: "pagehide", title: "test6", persisted: true},
{type: "load", title: "test7-nested1"},
{type: "pageshow", title: "test7-nested1", persisted: false},
{type: "load", title: "test7"},
{type: "pageshow", title: "test7", persisted: false}];
gBrowser.loadURI(test7Doc);
yield;
// Simulates a click on the link inside the iframe
function clickIframeLink() {
var iframe = gBrowser.contentDocument.getElementsByTagName("iframe")[0];
var w = iframe.contentWindow;
var d = iframe.contentDocument;
var evt = d.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, w,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
d.getElementsByTagName("a")[0].dispatchEvent(evt);
}
gExpected = [{type: "pagehide", title: "test7", persisted: true},
{type: "pagehide", title: "test7-nested1", persisted: true},
{type: "load"},
{type: "pageshow", persisted: false}];
clickIframeLink();
yield;
is(gBrowser.currentURI.spec, "data:text/plain,aaa",
"Navigation is blocked when clicking link");
gExpected = [{type: "pagehide", persisted: true},
{type: "pageshow", title: "test7-nested1", persisted: true},
{type: "pageshow", title: "test7", persisted: true}];
gBrowser.goBack();
yield;
gExpected = [{type: "pagehide", title: "test7", persisted: true},
{type: "pagehide", title: "test7-nested1", persisted: true},
{type: "load"},
{type: "pageshow", persisted: false}];
clickIframeLink();
yield;
is(gBrowser.currentURI.spec, "data:text/plain,aaa",
"Navigation is blocked when clicking link");
// nextTest has to be called from here, as no events are fired in this
// step
setTimeout(nextTest, 0);
yield;
}
]]></script>
<browser type="content-primary" flex="1" id="content" src="about:blank"/>
</window>

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

@ -0,0 +1,42 @@
<?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"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=364461
-->
<window title="Mozilla Bug 364461"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<title>Test for Bug 364461</title>
<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>
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=364461">Mozilla Bug 364461</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
/** Test for Bug 364461 **/
SimpleTest.waitForExplicitFinish();
window.open("bug364461_window.xul", "bug364461",
"chrome,width=600,height=600");
]]>
</script>
</window>

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

@ -904,7 +904,7 @@ nsClipboardDragDropHookCommand::GetCommandStateParams(const char *aCommandName,
NS_NEWXPCOM(theCmd, _cmdClass); \
if (!theCmd) return NS_ERROR_OUT_OF_MEMORY; \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}
#define NS_REGISTER_FIRST_COMMAND(_cmdClass, _cmdName) \
@ -921,7 +921,7 @@ nsClipboardDragDropHookCommand::GetCommandStateParams(const char *aCommandName,
#define NS_REGISTER_LAST_COMMAND(_cmdClass, _cmdName) \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}

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

@ -52,7 +52,6 @@
#include "nsIDOMKeyEvent.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMChromeWindow.h"
#include "nsIScriptSecurityManager.h"
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
@ -76,7 +75,6 @@
#include "nsScriptNameSpaceManager.h"
#include "nsThreadUtils.h"
#include "nsITimer.h"
#include "nsDOMClassInfo.h"
#include "nsIAtom.h"
#include "nsContentUtils.h"
#include "jscntxt.h"
@ -273,10 +271,6 @@ NS_ScriptErrorReporter(JSContext *cx,
const char *message,
JSErrorReport *report)
{
NS_ASSERTION(message || report,
"Must have a message or a report; otherwise what are we "
"reporting?");
// XXX this means we are not going to get error reports on non DOM contexts
nsIScriptContext *context = nsJSUtils::GetDynamicScriptContext(cx);
@ -293,15 +287,12 @@ NS_ScriptErrorReporter(JSContext *cx,
nsAutoString fileName, msg;
NS_NAMED_LITERAL_STRING(xoriginMsg, "Script error.");
if (report) {
fileName.AssignWithConversion(report->filename);
fileName.AssignWithConversion(report->filename);
const PRUnichar *m = reinterpret_cast<const PRUnichar*>
const PRUnichar *m = reinterpret_cast<const PRUnichar*>
(report->ucmessage);
if (m) {
msg.Assign(m);
}
if (m) {
msg.Assign(m);
}
if (msg.IsEmpty() && message) {
@ -322,9 +313,8 @@ NS_ScriptErrorReporter(JSContext *cx,
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(globalObject));
nsIDocShell *docShell = win ? win->GetDocShell() : nsnull;
if (docShell &&
(!report ||
(report->errorNumber != JSMSG_OUT_OF_MEMORY &&
!JSREPORT_IS_WARNING(report->flags)))) {
(report->errorNumber != JSMSG_OUT_OF_MEMORY &&
!JSREPORT_IS_WARNING(report->flags))) {
static PRInt32 errorDepth; // Recursion prevention
++errorDepth;
@ -339,7 +329,7 @@ NS_ScriptErrorReporter(JSContext *cx,
nsCOMPtr<nsIScriptObjectPrincipal> sop(do_QueryInterface(win));
nsIPrincipal *p = sop->GetPrincipal();
PRBool sameOrigin = !(report && report->filename);
PRBool sameOrigin = (report->filename == nsnull);
if (p && !sameOrigin) {
nsCOMPtr<nsIURI> errorURI;
@ -361,7 +351,7 @@ NS_ScriptErrorReporter(JSContext *cx,
if (sameOrigin) {
errorevent.errorMsg = msg.get();
errorevent.lineNr = report ? report->lineno : 0;
errorevent.lineNr = report->lineno;
} else {
errorevent.errorMsg = xoriginMsg.get();
errorevent.lineNr = 0;
@ -398,18 +388,13 @@ NS_ScriptErrorReporter(JSContext *cx,
? "chrome javascript"
: "content javascript";
if (report) {
PRUint32 column = report->uctokenptr - report->uclinebuf;
PRUint32 column = report->uctokenptr - report->uclinebuf;
rv = errorObject->Init(msg.get(), fileName.get(),
reinterpret_cast<const PRUnichar*>
(report->uclinebuf),
report->lineno, column, report->flags,
category);
} else if (message) {
rv = errorObject->Init(msg.get(), nsnull, nsnull, 0, 0, 0,
category);
}
rv = errorObject->Init(msg.get(), fileName.get(),
reinterpret_cast<const PRUnichar*>
(report->uclinebuf),
report->lineno, column, report->flags,
category);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIConsoleService> consoleService =
@ -428,49 +413,42 @@ NS_ScriptErrorReporter(JSContext *cx,
// mozilla with -console.
nsCAutoString error;
error.Assign("JavaScript ");
if (!report) {
error.Append("[no report]: ");
error.Append(message);
if (JSREPORT_IS_STRICT(report->flags))
error.Append("strict ");
if (JSREPORT_IS_WARNING(report->flags))
error.Append("warning: ");
else
error.Append("error: ");
error.Append(report->filename);
error.Append(", line ");
error.AppendInt(report->lineno, 10);
error.Append(": ");
if (report->ucmessage) {
AppendUTF16toUTF8(reinterpret_cast<const PRUnichar*>(report->ucmessage),
error);
} else {
if (JSREPORT_IS_STRICT(report->flags))
error.Append("strict ");
if (JSREPORT_IS_WARNING(report->flags))
error.Append("warning: ");
else
error.Append("error: ");
error.Append(report->filename);
error.Append(", line ");
error.AppendInt(report->lineno, 10);
error.Append(": ");
if (report->ucmessage) {
AppendUTF16toUTF8(reinterpret_cast<const PRUnichar*>(report->ucmessage),
error);
} else {
error.Append(message);
}
if (status != nsEventStatus_eIgnore && !JSREPORT_IS_WARNING(report->flags))
error.Append(" Error was suppressed by event handler\n");
error.Append(message);
}
if (status != nsEventStatus_eIgnore && !JSREPORT_IS_WARNING(report->flags))
error.Append(" Error was suppressed by event handler\n");
fprintf(stderr, "%s\n", error.get());
fflush(stderr);
#endif
#ifdef PR_LOGGING
if (report) {
if (!gJSDiagnostics)
gJSDiagnostics = PR_NewLogModule("JSDiagnostics");
if (!gJSDiagnostics)
gJSDiagnostics = PR_NewLogModule("JSDiagnostics");
if (gJSDiagnostics) {
PR_LOG(gJSDiagnostics,
JSREPORT_IS_WARNING(report->flags) ? PR_LOG_WARNING : PR_LOG_ERROR,
("file %s, line %u: %s\n%s%s",
report->filename, report->lineno, message,
report->linebuf ? report->linebuf : "",
(report->linebuf &&
report->linebuf[strlen(report->linebuf)-1] != '\n')
? "\n"
: ""));
}
if (gJSDiagnostics) {
PR_LOG(gJSDiagnostics,
JSREPORT_IS_WARNING(report->flags) ? PR_LOG_WARNING : PR_LOG_ERROR,
("file %s, line %u: %s\n%s%s",
report->filename, report->lineno, message,
report->linebuf ? report->linebuf : "",
(report->linebuf &&
report->linebuf[strlen(report->linebuf)-1] != '\n')
? "\n"
: ""));
}
#endif
}
@ -932,6 +910,18 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
else
newDefaultJSOptions &= ~JSOPTION_STRICT;
#ifdef DEBUG
// In debug builds, warnings are always enabled in chrome context
// Note this callback is also called from context's InitClasses thus we don't
// need to enable this directly from InitContext
if ((newDefaultJSOptions & JSOPTION_STRICT) == 0) {
nsIScriptGlobalObject *global = context->GetGlobalObject();
nsCOMPtr<nsIDOMChromeWindow> chromeWindow(do_QueryInterface(global));
if (chromeWindow)
newDefaultJSOptions |= JSOPTION_STRICT;
}
#endif
PRBool werror = nsContentUtils::GetBoolPref(js_werror_option_str);
if (werror)
newDefaultJSOptions |= JSOPTION_WERROR;
@ -963,11 +953,7 @@ nsJSContext::nsJSContext(JSRuntime *aRuntime) : mGCOnDestruction(PR_TRUE)
mDefaultJSOptions = JSOPTION_PRIVATE_IS_NSISUPPORTS
| JSOPTION_NATIVE_BRANCH_CALLBACK
| JSOPTION_ANONFUNFIX
#ifdef DEBUG
| JSOPTION_STRICT // lint catching for development
#endif
;
| JSOPTION_ANONFUNFIX;
// Let xpconnect resync its JSContext tracker. We do this before creating
// a new JSContext just in case the heap manager recycles the JSContext
@ -985,7 +971,6 @@ nsJSContext::nsJSContext(JSRuntime *aRuntime) : mGCOnDestruction(PR_TRUE)
nsContentUtils::RegisterPrefCallback(js_options_dot_str,
JSOptionChangedCallback,
this);
JSOptionChangedCallback(js_options_dot_str, this);
::JS_SetBranchCallback(mContext, DOMBranchCallback);
@ -3044,6 +3029,8 @@ nsJSContext::InitClasses(void *aGlobalObj)
::JS_DefineFunctions(mContext, globalObj, JProfFunctions);
#endif
JSOptionChangedCallback(js_options_dot_str, this);
return rv;
}

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

@ -48,7 +48,7 @@
NS_NEWXPCOM(theCmd, _cmdClass); \
if (!theCmd) return NS_ERROR_OUT_OF_MEMORY; \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}
#define NS_REGISTER_FIRST_COMMAND(_cmdClass, _cmdName) \
@ -65,7 +65,7 @@
#define NS_REGISTER_LAST_COMMAND(_cmdClass, _cmdName) \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}
#define NS_REGISTER_STYLE_COMMAND(_cmdClass, _cmdName, _styleTag) \
@ -73,7 +73,7 @@
_cmdClass* theCmd = new _cmdClass(_styleTag); \
if (!theCmd) return NS_ERROR_OUT_OF_MEMORY; \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}
#define NS_REGISTER_TAG_COMMAND(_cmdClass, _cmdName, _tagName) \
@ -81,7 +81,7 @@
_cmdClass* theCmd = new _cmdClass(_tagName); \
if (!theCmd) return NS_ERROR_OUT_OF_MEMORY; \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}

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

@ -51,7 +51,7 @@
NS_NEWXPCOM(theCmd, _cmdClass); \
if (!theCmd) return NS_ERROR_OUT_OF_MEMORY; \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}
#define NS_REGISTER_FIRST_COMMAND(_cmdClass, _cmdName) \
@ -68,7 +68,7 @@
#define NS_REGISTER_LAST_COMMAND(_cmdClass, _cmdName) \
rv = inCommandTable->RegisterCommand(_cmdName, \
static_cast<nsIControllerCommand *>(theCmd)); \
static_cast<nsIControllerCommand *>(theCmd)); \
}

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

@ -3552,7 +3552,7 @@ nsHTMLEditor::ReplaceStyleSheet(const nsAString& aURL)
rv = NS_NewURI(getter_AddRefs(uaURI), aURL);
NS_ENSURE_SUCCESS(rv, rv);
rv = cssLoader->LoadSheet(uaURI, this);
rv = cssLoader->LoadSheet(uaURI, nsnull, nsnull, this);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;

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

@ -969,14 +969,16 @@ NS_NewEditorCompositionListener(nsIDOMEventListener** aInstancePtrResult, nsIEdi
nsresult
NS_NewEditorFocusListener(nsIDOMEventListener ** aInstancePtrResult,
nsIEditor *aEditor)
nsIEditor *aEditor,
nsIPresShell *aPresShell)
{
nsTextEditorFocusListener* it = new nsTextEditorFocusListener();
if (nsnull == it) {
nsTextEditorFocusListener* it =
new nsTextEditorFocusListener(aEditor, aPresShell);
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetEditor(aEditor);
return it->QueryInterface(NS_GET_IID(nsIDOMEventListener), (void **) aInstancePtrResult);
return CallQueryInterface(it, aInstancePtrResult);
}
@ -988,7 +990,10 @@ NS_NewEditorFocusListener(nsIDOMEventListener ** aInstancePtrResult,
NS_IMPL_ISUPPORTS2(nsTextEditorFocusListener, nsIDOMEventListener, nsIDOMFocusListener)
nsTextEditorFocusListener::nsTextEditorFocusListener()
nsTextEditorFocusListener::nsTextEditorFocusListener(nsIEditor *aEditor,
nsIPresShell *aShell)
: mEditor(aEditor),
mPresShell(do_GetWeakReference(aShell))
{
}
@ -1034,27 +1039,54 @@ IsTargetFocused(nsIDOMEventTarget* aTarget)
return (focusedContent == content);
}
static nsIContent*
FindEditableRoot(nsIContent *aContent)
static already_AddRefed<nsIContent>
FindSelectionRoot(nsIEditor *aEditor, nsIContent *aContent)
{
PRUint32 flags;
aEditor->GetFlags(&flags);
nsIDocument *document = aContent->GetCurrentDoc();
if (!document) {
return nsnull;
}
nsIContent *root;
if (document->HasFlag(NODE_IS_EDITABLE)) {
return document->GetRootContent();
NS_IF_ADDREF(root = document->GetRootContent());
return root;
}
if (flags & nsIPlaintextEditor::eEditorReadonlyMask) {
// We still want to allow selection in a readonly editor.
nsCOMPtr<nsIDOMElement> rootElement;
aEditor->GetRootElement(getter_AddRefs(rootElement));
CallQueryInterface(rootElement, &root);
if (!root) {
nsIDocument *document = aContent->GetCurrentDoc();
if (document) {
NS_IF_ADDREF(root = document->GetRootContent());
}
}
return root;
}
if (!aContent->HasFlag(NODE_IS_EDITABLE)) {
return nsnull;
}
// For non-readonly editors we want to find the root of the editable subtree
// containing aContent.
nsIContent *parent, *content = aContent;
while ((parent = content->GetParent()) && parent->HasFlag(NODE_IS_EDITABLE)) {
content = parent;
}
NS_IF_ADDREF(content);
return content;
}
@ -1085,17 +1117,18 @@ nsTextEditorFocusListener::Focus(nsIDOMEvent* aEvent)
{ // only enable caret and selection if the editor is not disabled
nsCOMPtr<nsIContent> content = do_QueryInterface(target);
nsIContent *editableRoot = content ? FindEditableRoot(content) : nsnull;
nsCOMPtr<nsIContent> editableRoot =
content ? FindSelectionRoot(mEditor, content) : nsnull;
nsCOMPtr<nsISelectionController> selCon;
mEditor->GetSelectionController(getter_AddRefs(selCon));
nsCOMPtr<nsIPresShell> presShell = do_QueryInterface(selCon);
if (selCon && editableRoot)
{
nsCOMPtr<nsISelection> selection;
selCon->GetSelection(nsISelectionController::SELECTION_NORMAL,
getter_AddRefs(selection));
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
if (presShell && selection) {
nsCOMPtr<nsICaret> caret;
presShell->GetCaret(getter_AddRefs(caret));

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

@ -248,16 +248,11 @@ class nsTextEditorFocusListener : public nsIDOMFocusListener
public:
/** default constructor
*/
nsTextEditorFocusListener();
nsTextEditorFocusListener(nsIEditor *aEditor, nsIPresShell *aPresShell);
/** default destructor
*/
virtual ~nsTextEditorFocusListener();
/** SetEditor gives an address to the editor that will be accessed
* @param aEditor the editor this listener calls for editing operations
*/
void SetEditor(nsIEditor *aEditor){mEditor = aEditor;}
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
@ -269,6 +264,7 @@ public:
protected:
nsIEditor* mEditor; // weak reference
nsWeakPtr mPresShell;
};
@ -296,7 +292,9 @@ extern nsresult NS_NewEditorCompositionListener(nsIDOMEventListener** aInstanceP
/** factory for the editor composition listener
*/
extern nsresult NS_NewEditorFocusListener(nsIDOMEventListener** aInstancePtrResult, nsIEditor *aEditor);
extern nsresult
NS_NewEditorFocusListener(nsIDOMEventListener** aInstancePtrResult,
nsIEditor *aEditor, nsIPresShell *aPresShell);
#endif //editorInterfaces_h__

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

@ -300,16 +300,17 @@ nsPlaintextEditor::CreateEventListeners()
this);
}
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShellWeak);
if (!mDragListenerP) {
// get a drag listener
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShellWeak);
rv |= NS_NewEditorDragListener(getter_AddRefs(mDragListenerP), presShell,
this);
}
if (!mFocusListenerP) {
// get a focus listener
rv |= NS_NewEditorFocusListener(getter_AddRefs(mFocusListenerP), this);
rv |= NS_NewEditorFocusListener(getter_AddRefs(mFocusListenerP),
this, presShell);
}
return rv;

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

@ -1842,6 +1842,8 @@ END_COM_MAP()
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMElement));
// XXX Not checking whether content is editable,
// should we?
lh->OnLinkClick(content, uri,
szTargetFrame ? szTargetFrame : mUseTarget);
}

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

@ -277,6 +277,7 @@ public:
protected:
nsCOMPtr<nsIThreadJSContextStack> mService;
JSContext *mContext;
nsCOMPtr<nsIScriptContext> mContextKungFuDeathGrip;
};
JSContextAutoPopper::JSContextAutoPopper() : mContext(nsnull)
@ -309,6 +310,7 @@ nsresult JSContextAutoPopper::Push(JSContext *cx)
// Save cx in mContext to indicate need to pop.
if (cx && NS_SUCCEEDED(mService->Push(cx))) {
mContext = cx;
mContextKungFuDeathGrip = nsWWJSUtils::GetDynamicScriptContext(cx);
}
}
return mContext ? NS_OK : NS_ERROR_FAILURE;

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

@ -66,6 +66,8 @@ inspector.jar:
content/inspector/tests/allskin.xul (resources/content/tests/allskin.xul)
content/inspector/viewers/accessibleObject/accessibleObject.js (resources/content/viewers/accessibleObject/accessibleObject.js)
content/inspector/viewers/accessibleObject/accessibleObject.xul (resources/content/viewers/accessibleObject/accessibleObject.xul)
content/inspector/viewers/accessibleProps/accessibleProps.js (resources/content/viewers/accessibleProps/accessibleProps.js)
content/inspector/viewers/accessibleProps/accessibleProps.xul (resources/content/viewers/accessibleProps/accessibleProps.xul)
content/inspector/viewers/computedStyle/computedStyle.js (resources/content/viewers/computedStyle/computedStyle.js)
content/inspector/viewers/computedStyle/computedStyle.xul (resources/content/viewers/computedStyle/computedStyle.xul)
content/inspector/viewers/dom/FindDialog.js (resources/content/viewers/dom/FindDialog.js)

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

@ -113,6 +113,29 @@
]]></ins:filter>
</rdf:Description>
</rdf:li>
<rdf:li>
<rdf:Description ins:uid="accessibleProps"
ins:panels="bxObjectPanel bxObjPanel"
ins:description="Accessible Properties">
<ins:filter><![CDATA[
if (!linkedViewer || linkedViewer.uid != "dom" ||
!linkedViewer.getAccessibleNodes() ||
!(object instanceof Components.interfaces.nsIDOMNode))
return false;
try {
var accService =
Components.classes["@mozilla.org/accessibleRetrieval;1"]
.getService(Components.interfaces.nsIAccessibleRetrieval);
return accService.getAttachedAccessibleFor(object);
} catch(e) {
return false;
}
]]></ins:filter>
</rdf:Description>
</rdf:li>
</rdf:Seq>
</rdf:RDF>

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

@ -0,0 +1,231 @@
/* ***** 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 DOM Inspector.
*
* The Initial Developer of the Original Code is
* Alexander Surkov.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
* Vasiliy Potapenko <vasiliy.potapenko@gmail.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 ***** */
///////////////////////////////////////////////////////////////////////////////
//// Global Variables
var viewer;
///////////////////////////////////////////////////////////////////////////////
//// Initialization/Destruction
window.addEventListener("load", AccessiblePropsViewer_initialize, false);
function AccessiblePropsViewer_initialize()
{
viewer = new AccessiblePropsViewer();
viewer.initialize(parent.FrameExchange.receiveData(window));
}
///////////////////////////////////////////////////////////////////////////////
//// class AccessiblePropsViewer
function AccessiblePropsViewer()
{
this.mURL = window.location;
this.mObsMan = new ObserverManager(this);
this.mAccService = Components.classes["@mozilla.org/accessibleRetrieval;1"]
.getService(Components.interfaces.nsIAccessibleRetrieval);
}
AccessiblePropsViewer.prototype =
{
mSubject: null,
mPane: null,
mAccSubject: null,
mAccService: null,
get uid() { return "accessibleProps" },
get pane() { return this.mPane },
get subject() { return this.mSubject },
set subject(aObject)
{
this.mSubject = aObject;
this.updateView();
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
},
initialize: function initialize(aPane)
{
this.mPane = aPane;
aPane.notifyViewerReady(this);
},
isCommandEnabled: function isCommandEnabled(aCommand)
{
return false;
},
getCommand: function getCommand(aCommand)
{
return null;
},
destroy: function destroy() {},
// event dispatching
addObserver: function addObserver(aEvent, aObserver)
{
this.mObsMan.addObserver(aEvent, aObserver);
},
removeObserver: function removeObserver(aEvent, aObserver)
{
this.mObsMan.removeObserver(aEvent, aObserver);
},
// private
updateView: function updateView()
{
this.clearView();
try {
this.mAccSubject = this.mAccService.getAccessibleFor(this.mSubject);
} catch(e) {
dump("Failed to get accessible object for node.");
return;
}
var containers = document.getElementsByAttribute("prop", "*");
for (var i = 0; i < containers.length; ++i) {
var value = "";
try {
var prop = containers[i].getAttribute("prop");
value = this[prop];
} catch (e) {
dump("Accessibility " + prop + " property is not available.\n");
}
if (value instanceof Array)
containers[i].textContent = value.join(", ");
else
containers[i].textContent = value;
}
var attrs = this.mAccSubject.attributes;
if (attrs) {
var enumerate = attrs.enumerate();
while (enumerate.hasMoreElements())
this.addAccessibleAttribute(enumerate.getNext());
}
},
addAccessibleAttribute: function addAccessibleAttribute(aElement)
{
var prop = aElement.QueryInterface(Components.interfaces.nsIPropertyElement);
var trAttrBody = document.getElementById("trAttrBody");
var ti = document.createElement("treeitem");
var tr = document.createElement("treerow");
var tc = document.createElement("treecell");
tc.setAttribute("label", prop.key);
tr.appendChild(tc);
tc = document.createElement("treecell");
tc.setAttribute("label", prop.value);
tr.appendChild(tc);
ti.appendChild(tr);
trAttrBody.appendChild(ti);
},
removeAccessibleAttributes: function removeAccessibleAttributes()
{
var trAttrBody = document.getElementById("trAttrBody");
while (trAttrBody.hasChildNodes())
trAttrBody.removeChild(trAttrBody.lastChild)
},
clearView: function clearView()
{
var containers = document.getElementsByAttribute("prop", "*");
for (var i = 0; i < containers.length; ++i)
containers[i].textContent = "";
this.removeAccessibleAttributes();
},
get role()
{
return this.mAccService.getStringRole(this.mAccSubject.finalRole);
},
get name()
{
return this.mAccSubject.name;
},
get description()
{
return this.mAccSubject.description;
},
get value()
{
return this.mAccSubject.value;
},
get state()
{
var stateObj = {value: null};
var extStateObj = {value: null};
this.mAccSubject.getFinalState(stateObj, extStateObj);
var list = [];
states = this.mAccService.getStringStates(stateObj.value, extStateObj.value);
for (var i = 0; i < states.length; i++)
list.push(states.item(i));
return list;
},
get actionNames()
{
var list = [];
var count = this.mAccSubject.numActions;
for (var i = 0; i < count; i++)
list.push(this.mAccSubject.getActionName(i));
return list;
}
};

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

@ -0,0 +1,99 @@
<?xml version="1.0"?>
<!-- ***** 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 DOM Inspector.
-
- The Initial Developer of the Original Code is
- Alexander Surkov.
- Portions created by the Initial Developer are Copyright (C) 2006
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Alexander Surkov <surkov.alexander@gmail.com> (original author)
- Vasiliy Potapenko <vasiliy.potapenko@gmail.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 page [
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/accessibleProps.dtd"> %dtd3;
]>
<?xml-stylesheet href="chrome://inspector/skin"?>
<page id="winAccessibleProps"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
<script type="application/javascript"
src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
<script type="application/javascript"
src="chrome://inspector/content/viewers/accessibleProps/accessibleProps.js"/>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<description>&descRole.label;</description>
<description prop="role"/>
</row>
<row>
<description>&descName.label;</description>
<description prop="name"/>
</row>
<row>
<description>&descDescription.label;</description>
<description prop="description"/>
</row>
<row>
<description>&descValue.label;</description>
<description prop="value"/>
</row>
<row>
<description>&descState.label;</description>
<description prop="state"/>
</row>
<row>
<description>&descActionName.label;</description>
<description prop="actionNames"/>
</row>
</rows>
</grid>
<tree flex="1">
<treecols>
<treecol label="attrKey" flex="1"/>
<treecol label="attrValue" flex="2"/>
</treecols>
<treechildren id="trAttrBody"/>
</tree>
</page>

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

@ -0,0 +1,44 @@
<!-- ***** BEGIN LICENSE BLOCK *****
#if 0
- 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 DOM Inspector.
-
- The Initial Developer of the Original Code is
- Vasiliy Potapenko
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Vasiliy Potapenko <vasiliy.potapenko@gmail.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 LGPL or the GPL. 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.
-
#endif
- ***** END LICENSE BLOCK ***** -->
<!ENTITY descRole.label "Role:">
<!ENTITY descName.label "Name:">
<!ENTITY descDescription.label "Description:">
<!ENTITY descValue.label "Value:">
<!ENTITY descState.label "State:">
<!ENTITY descActionName.label "Action Name:">

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