Merge mozilla-central into Electrolysis

--HG--
rename : modules/plugin/base/src/nsPluginHostImpl.cpp => modules/plugin/base/src/nsPluginHost.cpp
This commit is contained in:
Benjamin Smedberg 2009-07-20 09:36:23 -04:00
commit 8094281085
1518 changed files with 45527 additions and 88918 deletions

View File

@ -27,3 +27,6 @@ _OPT\.OBJ/
# SpiderMonkey configury
^js/src/configure$
^js/src/autom4te.cache$
# Java HTML5 parser classes
^parser/html/java/.*\.class$

View File

@ -68,7 +68,9 @@ ifdef MOZ_MEMORY
tier_base_dirs += memory/jemalloc
endif
ifdef COMPILE_ENVIRONMENT
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
endif
TIERS += testharness

View File

@ -18,7 +18,7 @@ on http://developer.mozilla.org, you can try asking your question in a
mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups
are accessible on Google Groups, or news.mozilla.org with a NNTP reader.]
You can download nightly development builds from the the Mozilla FTP server.
You can download nightly development builds from the Mozilla FTP server.
Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy. Firefox nightlies, for example, can be found at:

View File

@ -925,6 +925,41 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsARIAGridCellAccessible,
////////////////////////////////////////////////////////////////////////////////
// nsAccessible
nsresult
nsARIAGridCellAccessible::GetARIAState(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetARIAState(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
// Return if the gridcell has aria-selected="true".
if (*aState & nsIAccessibleStates::STATE_SELECTED)
return NS_OK;
// Check aria-selected="true" on the row.
nsCOMPtr<nsIAccessible> row;
GetParent(getter_AddRefs(row));
if (nsAccUtils::Role(row) != nsIAccessibleRole::ROLE_ROW)
return NS_OK;
nsRefPtr<nsAccessible> acc = nsAccUtils::QueryAccessible(row);
nsCOMPtr<nsIDOMNode> rowNode;
acc->GetDOMNode(getter_AddRefs(rowNode));
NS_ENSURE_STATE(rowNode);
nsCOMPtr<nsIContent> rowContent(do_QueryInterface(rowNode));
if (nsAccUtils::HasDefinedARIAToken(rowContent,
nsAccessibilityAtoms::aria_selected) &&
!rowContent->AttrValueIs(kNameSpaceID_None,
nsAccessibilityAtoms::aria_selected,
nsAccessibilityAtoms::_false, eCaseMatters)) {
*aState |= nsIAccessibleStates::STATE_SELECTABLE |
nsIAccessibleStates::STATE_SELECTED;
}
return NS_OK;
}
nsresult
nsARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
{

View File

@ -140,6 +140,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsAccessible
virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
};

View File

@ -655,18 +655,18 @@ nsAccUtils::GetRoleMapEntry(nsIDOMNode *aNode)
nsWhitespaceTokenizer tokenizer(roleString);
while (tokenizer.hasMoreTokens()) {
// Do a binary search through table for the next role in role list
const char *role = NS_LossyConvertUTF16toASCII(tokenizer.nextToken()).get();
PRInt32 low = 0;
PRInt32 high = nsARIAMap::gWAIRoleMapLength;
while (low <= high) {
PRInt32 index = low + ((high - low) / 2);
PRInt32 compare = PL_strcmp(role, nsARIAMap::gWAIRoleMap[index].roleString);
NS_LossyConvertUTF16toASCII role(tokenizer.nextToken());
PRUint32 low = 0;
PRUint32 high = nsARIAMap::gWAIRoleMapLength;
while (low < high) {
PRUint32 index = (low + high) / 2;
PRInt32 compare = PL_strcmp(role.get(), nsARIAMap::gWAIRoleMap[index].roleString);
if (compare == 0) {
// The role attribute maps to an entry in the role table
return &nsARIAMap::gWAIRoleMap[index];
}
if (compare < 0) {
high = index - 1;
high = index;
}
else {
low = index + 1;

View File

@ -284,9 +284,9 @@ nsHTMLImageAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
if (!domNode)
return NS_ERROR_INVALID_ARG;
nsCOMPtr<nsILink> link(do_QueryInterface(domNode));
nsCOMPtr<nsIContent> link(do_QueryInterface(domNode));
if (link)
link->GetHrefURI(aURI);
*aURI = link->GetHrefURI().get();
return NS_OK;
}

View File

@ -82,11 +82,7 @@ nsHTMLLinkAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
*aState |= nsIAccessibleStates::STATE_SELECTABLE;
}
nsCOMPtr<nsILink> link = do_QueryInterface(mDOMNode);
NS_ENSURE_STATE(link);
nsLinkState linkState;
link->GetLinkState(linkState);
nsLinkState linkState = content->GetLinkState();
if (linkState == eLinkState_NotLink || linkState == eLinkState_Unknown) {
// This is a either named anchor (a link with also a name attribute) or
// it doesn't have any attributes. Check if 'click' event handler is
@ -180,10 +176,11 @@ nsHTMLLinkAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
if (aIndex != 0)
return NS_ERROR_INVALID_ARG;
nsCOMPtr<nsILink> link(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIContent> link(do_QueryInterface(mDOMNode));
NS_ENSURE_STATE(link);
return link->GetHrefURI(aURI);
*aURI = link->GetHrefURI().get();
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
@ -192,13 +189,11 @@ nsHTMLLinkAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
PRBool
nsHTMLLinkAccessible::IsLinked()
{
nsCOMPtr<nsILink> link(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIContent> link(do_QueryInterface(mDOMNode));
if (!link)
return PR_FALSE;
nsLinkState linkState;
nsresult rv = link->GetLinkState(linkState);
nsLinkState linkState = link->GetLinkState();
return NS_SUCCEEDED(rv) && linkState != eLinkState_NotLink &&
linkState != eLinkState_Unknown;
return linkState != eLinkState_NotLink && linkState != eLinkState_Unknown;
}

View File

@ -74,7 +74,6 @@ nsHyperTextAccessibleWrap(aDomNode, aShell)
// nsAccessible
/* unsigned long getRole (); */
nsresult
nsHTMLTableCellAccessible::GetRoleInternal(PRUint32 *aResult)
{
@ -82,6 +81,29 @@ nsHTMLTableCellAccessible::GetRoleInternal(PRUint32 *aResult)
return NS_OK;
}
nsresult
nsHTMLTableCellAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv= nsHyperTextAccessibleWrap::GetStateInternal(aState, aExtraState);
NS_ENSURE_A11Y_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mWeakShell);
nsIFrame *frame = presShell->GetPrimaryFrameFor(content);
NS_ASSERTION(frame, "No frame for valid cell accessible!");
if (frame) {
*aState |= nsIAccessibleStates::STATE_SELECTABLE;
PRBool isSelected = PR_FALSE;
frame->GetSelected(&isSelected);
if (isSelected)
*aState |= nsIAccessibleStates::STATE_SELECTED;
}
return NS_OK;
}
nsresult
nsHTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
{
@ -619,16 +641,30 @@ nsHTMLTableAccessible::GetSelectedCellsCount(PRUint32* aCount)
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
nsITableLayout *tableLayout = nsnull;
rv = GetTableLayout(&tableLayout);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
PRBool isSelected = PR_FALSE;
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);
rv = tableLayout->GetCellDataAt(rowIndex, columnIndex,
*getter_AddRefs(domElement),
startRowIndex, startColIndex,
rowSpan, colSpan,
actualRowSpan, actualColSpan,
isSelected);
if (state)
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
startColIndex == columnIndex && isSelected) {
(*aCount)++;
}
}
}
@ -698,6 +734,15 @@ nsHTMLTableAccessible::GetSelectedCells(PRUint32 *aNumCells,
rv = GetColumns(&columnsCount);
NS_ENSURE_SUCCESS(rv, rv);
nsITableLayout *tableLayout = nsnull;
rv = GetTableLayout(&tableLayout);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
PRBool isSelected = PR_FALSE;
PRInt32 cellsCount = columnsCount * rowsCount;
nsAutoArrayPtr<PRBool> states(new PRBool[cellsCount]);
NS_ENSURE_TRUE(states, NS_ERROR_OUT_OF_MEMORY);
@ -706,11 +751,20 @@ nsHTMLTableAccessible::GetSelectedCells(PRUint32 *aNumCells,
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);
rv = tableLayout->GetCellDataAt(rowIndex, columnIndex,
*getter_AddRefs(domElement),
startRowIndex, startColIndex,
rowSpan, colSpan,
actualRowSpan, actualColSpan,
isSelected);
if (states[index])
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
startColIndex == columnIndex && isSelected) {
states[index] = PR_TRUE;
(*aNumCells)++;
} else {
states[index] = PR_FALSE;
}
}
}
@ -1245,49 +1299,48 @@ NS_IMETHODIMP nsHTMLTableAccessible::GetDescription(nsAString& aDescription)
return NS_OK;
}
PRBool nsHTMLTableAccessible::HasDescendant(const char *aTagName, PRBool aAllowEmpty)
PRBool
nsHTMLTableAccessible::HasDescendant(const nsAString& aTagName,
PRBool aAllowEmpty)
{
nsCOMPtr<nsIDOMElement> tableElt(do_QueryInterface(mDOMNode));
NS_ENSURE_TRUE(tableElt, PR_FALSE);
nsCOMPtr<nsIDOMNodeList> nodeList;
nsAutoString tagName;
tagName.AssignWithConversion(aTagName);
tableElt->GetElementsByTagName(tagName, getter_AddRefs(nodeList));
tableElt->GetElementsByTagName(aTagName, getter_AddRefs(nodeList));
NS_ENSURE_TRUE(nodeList, PR_FALSE);
PRUint32 length;
nodeList->GetLength(&length);
if (length == 1) {
// Make sure it's not the table itself
nsCOMPtr<nsIDOMNode> foundItem;
nodeList->Item(0, getter_AddRefs(foundItem));
if (foundItem == mDOMNode) {
return PR_FALSE;
}
if (!aAllowEmpty) {
// Make sure that the item we found has contents
// and either has multiple children or the
// found item is not a whitespace-only text node
nsCOMPtr<nsIContent> foundItemContent = do_QueryInterface(foundItem);
if (!foundItemContent) {
return PR_FALSE;
}
if (foundItemContent->GetChildCount() > 1) {
return PR_TRUE; // Treat multiple child nodes as non-empty
}
nsIContent *innerItemContent = foundItemContent->GetChildAt(0);
if (!innerItemContent || innerItemContent->TextIsOnlyWhitespace()) {
return PR_FALSE;
}
}
return PR_TRUE;
}
return length > 0;
nsCOMPtr<nsIDOMNode> foundItem;
nodeList->Item(0, getter_AddRefs(foundItem));
if (!foundItem)
return PR_FALSE;
if (aAllowEmpty)
return PR_TRUE;
// Make sure that the item we found has contents and either has multiple
// children or the found item is not a whitespace-only text node.
nsCOMPtr<nsIContent> foundItemContent = do_QueryInterface(foundItem);
if (foundItemContent->GetChildCount() > 1)
return PR_TRUE; // Treat multiple child nodes as non-empty
nsIContent *innerItemContent = foundItemContent->GetChildAt(0);
if (innerItemContent && !innerItemContent->TextIsOnlyWhitespace())
return PR_TRUE;
// If we found more than one node then return true not depending on
// aAllowEmpty flag.
// XXX it might be dummy but bug 501375 where we changed this addresses
// performance problems only. Note, currently 'aAllowEmpty' flag is used for
// caption element only. On another hand we create accessible object for
// the first entry of caption element (see
// nsHTMLTableAccessible::CacheChildren).
nodeList->Item(1, getter_AddRefs(foundItem));
return !!foundItem;
}
NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForLayout)
NS_IMETHODIMP
nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForLayout)
{
// Implement a heuristic to determine if table is most likely used for layout
// XXX do we want to look for rowspan or colspan, especialy that span all but a couple cells
@ -1322,7 +1375,8 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
}
}
// Check role and role attribute
// Check to see if an ARIA role overrides the role from native markup,
// but for which we still expose table semantics (treegrid, for example).
PRBool hasNonTableRole =
(nsAccUtils::Role(this) != nsIAccessibleRole::ROLE_TABLE);
if (hasNonTableRole) {
@ -1330,17 +1384,23 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
}
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
RETURN_LAYOUT_ANSWER(PR_TRUE, "Has role attribute, and role is table");
// Role attribute is present, but overridden roles have already been dealt with.
// Only landmarks and other roles that don't override the role from native
// markup are left to deal with here.
RETURN_LAYOUT_ANSWER(PR_FALSE, "Has role attribute, weak role, and role is table");
}
// Check for legitimate data table elements or attributes
nsAutoString summary;
if ((content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, summary) && !summary.IsEmpty()) ||
HasDescendant("caption", PR_FALSE) || HasDescendant("th") || HasDescendant("thead") ||
HasDescendant("tfoot") || HasDescendant("colgroup")) {
HasDescendant(NS_LITERAL_STRING("caption"), PR_FALSE) ||
HasDescendant(NS_LITERAL_STRING("th")) ||
HasDescendant(NS_LITERAL_STRING("thead")) ||
HasDescendant(NS_LITERAL_STRING("tfoot")) ||
HasDescendant(NS_LITERAL_STRING("colgroup"))) {
RETURN_LAYOUT_ANSWER(PR_FALSE, "Has caption, summary, th, thead, tfoot or colgroup -- legitimate table structures");
}
if (HasDescendant("table")) {
if (HasDescendant(NS_LITERAL_STRING("table"))) {
RETURN_LAYOUT_ANSWER(PR_TRUE, "Has a nested table within it");
}
@ -1450,7 +1510,10 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
RETURN_LAYOUT_ANSWER(PR_TRUE, "2-4 columns, 10 cells or less, non-bordered");
}
if (HasDescendant("embed") || HasDescendant("object") || HasDescendant("applet") || HasDescendant("iframe")) {
if (HasDescendant(NS_LITERAL_STRING("embed")) ||
HasDescendant(NS_LITERAL_STRING("object")) ||
HasDescendant(NS_LITERAL_STRING("applet")) ||
HasDescendant(NS_LITERAL_STRING("iframe"))) {
RETURN_LAYOUT_ANSWER(PR_TRUE, "Has no borders, and has iframe, object, applet or iframe, typical of advertisements");
}

View File

@ -61,6 +61,7 @@ public:
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
protected:
@ -210,7 +211,16 @@ protected:
virtual void CacheChildren();
nsresult GetTableNode(nsIDOMNode **_retval);
nsresult GetTableLayout(nsITableLayout **aLayoutObject);
PRBool HasDescendant(const char *aTagName, PRBool aAllowEmpty = PR_TRUE);
/**
* Return true if table has an element with the given tag name.
*
* @param aTagName [in] tag name of searched element
* @param aAllowEmpty [in, optional] points if found element can be empty
* or contain whitespace text only.
*/
PRBool HasDescendant(const nsAString& aTagName, PRBool aAllowEmpty = PR_TRUE);
#ifdef SHOW_LAYOUT_HEURISTIC
nsAutoString mLayoutHeuristic;
#endif

View File

@ -76,6 +76,7 @@ _TEST_FILES =\
test_aria_role_equation.html \
test_aria_role_grid.html \
test_aria_roles.html \
test_aria_roles.xul \
test_aria_token_attrs.html \
test_bug420863.html \
$(warning test_childAtPoint.html temporarily disabled) \
@ -124,10 +125,11 @@ _TEST_FILES =\
test_states_frames.html \
test_table_1.html \
test_table_2.html \
test_table_3.html \
test_table_4.html \
test_table_indexes.html \
test_table_indexes_ariagrid.html \
test_table_layoutguess.html \
test_table_sels.html \
test_table_sels_ariagrid.html \
test_textattrs.html \
test_textboxes.html \

View File

@ -4,7 +4,7 @@
/**
* Test object attributes.
*
* @param aAccOrElmOrID [in] the ID, DOM node or accessible
* @param aAccOrElmOrID [in] the accessible identifier
* @param aAttrs [in] the map of expected object attributes
* (name/value pairs)
* @param aSkipUnexpectedAttrs [in] points this function doesn't fail if
@ -12,22 +12,19 @@
*/
function testAttrs(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs)
{
var accessible = getAccessible(aAccOrElmOrID);
if (!accessible)
return;
testAttrsInternal(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs);
}
var attrs = null;
try {
attrs = accessible.attributes;
} catch (e) { }
if (!attrs) {
ok(false, "Can't get object attributes for " + aAccOrElmOrID);
return;
}
var errorMsg = " for " + aAccOrElmOrID;
compareAttrs(errorMsg, attrs, aAttrs, aSkipUnexpectedAttrs);
/**
* Test object attributes that must not be present.
*
* @param aAccOrElmOrID [in] the accessible identifier
* @param aAbsentAttrs [in] map of attributes that should not be
* present (name/value pairs)
*/
function testAbsentAttrs(aAccOrElmOrID, aAbsentAttrs, aSkipUnexpectedAttrs)
{
testAttrsInternal(aAccOrElmOrID, {}, true, aAbsentAttrs);
}
/**
@ -169,7 +166,29 @@ function getTextAttributes(aID, aAccessible, aIncludeDefAttrs, aOffset,
return null;
}
function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs)
function testAttrsInternal(aAccOrElmOrID, aAttrs, aSkipUnexpectedAttrs,
aAbsentAttrs)
{
var accessible = getAccessible(aAccOrElmOrID);
if (!accessible)
return;
var attrs = null;
try {
attrs = accessible.attributes;
} catch (e) { }
if (!attrs) {
ok(false, "Can't get object attributes for " + aAccOrElmOrID);
return;
}
var errorMsg = " for " + aAccOrElmOrID;
compareAttrs(errorMsg, attrs, aAttrs, aSkipUnexpectedAttrs, aAbsentAttrs);
}
function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs,
aAbsentAttrs)
{
var enumerate = aAttrs.enumerate();
while (enumerate.hasMoreElements()) {
@ -200,4 +219,19 @@ function compareAttrs(aErrorMsg, aAttrs, aExpectedAttrs, aSkipUnexpectedAttrs)
ok(false,
"There is no expected attribute '" + name + "' " + aErrorMsg);
}
if (aAbsentAttrs)
for (var name in aAbsentAttrs) {
var value = "";
try {
value = aAttrs.getStringProperty(name);
} catch(e) { }
if (value)
ok(false,
"There is an unexpected attribute '" + name + "' " + aErrorMsg);
else
ok(true,
"There is no unexpected attribute '" + name + "' " + aErrorMsg);
}
}

View File

@ -87,6 +87,12 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
isState(state & STATE_CHECKED, 0, false,
"Mixed element cannot be state checked!");
// selected/selectable
if (state & STATE_SELECTED) {
isState(state & STATE_SELECTABLE, STATE_SELECTABLE, false,
"Selected element should be selectable!");
}
// unavailable
if ((state & STATE_UNAVAILABLE)
&& (getRole(aAccOrElmOrID) != ROLE_GROUPING))

View File

@ -1,3 +1,12 @@
/**
* This file provides set of helper functions to test nsIAccessibleTable
* interface.
*
* Required:
* common.js
* states.js
*/
/**
* Test table indexes.
*
@ -20,6 +29,16 @@ function testTableIndexes(aIdentifier, aIdxes)
var colCount = aIdxes[rowIdx].length;
for (var colIdx = 0; colIdx < colCount; colIdx++) {
var idx = aIdxes[rowIdx][colIdx];
// cellRefAt
try {
cellAcc = null;
cellAcc = tableAcc.cellRefAt(rowIdx, colIdx);
} catch (e) { }
ok(idx != -1 && cellAcc || idx == -1 && !cellAcc,
id + ": Can't get cell accessible at row = " + rowIdx + ", column = " + colIdx);
if (idx != - 1) {
// getRowAtIndex
var origRowIdx = rowIdx;
@ -51,15 +70,6 @@ function testTableIndexes(aIdentifier, aIdxes)
is(obtainedColIdx, origColIdx,
id + ": column for index " + idx +" is not correct");
// cellRefAt
try {
cellAcc = null;
cellAcc = tableAcc.cellRefAt(rowIdx, colIdx);
} catch (e) { }
ok(cellAcc,
id + ": Can't get cell accessible at row = " + rowIdx + ", column = " + colIdx);
// 'table-cell-index' attribute
if (cellAcc) {
var attrs = cellAcc.attributes;
@ -116,7 +126,7 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg)
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
var isColSelected = true;
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
if (!aCellsArray[rowIdx][colIdx]) {
if (aCellsArray[rowIdx][colIdx] == false) {
isColSelected = false;
break;
}
@ -156,7 +166,7 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg)
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
var isRowSelected = true;
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
if (!aCellsArray[rowIdx][colIdx]) {
if (aCellsArray[rowIdx][colIdx] == false) {
isRowSelected = false;
break;
}
@ -194,6 +204,9 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg)
// isCellSelected test
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] == undefined)
continue;
is(acc.isCellSelected(rowIdx, colIdx), aCellsArray[rowIdx][colIdx],
msg + "Wrong selection state of cell at " + rowIdx + " row and " +
colIdx + " column for " + prettyName(aIdentifier));
@ -220,6 +233,21 @@ function testTableSelection(aIdentifier, aCellsArray, aMsg)
is (actualSelCells[i], selCells[i],
msg + "Cell at index " + selCells[i] + " should be selected.");
}
// selected states tests
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] == undefined)
continue;
var cell = acc.cellRefAt(rowIdx, colIdx);
var isSel = aCellsArray[rowIdx][colIdx];
if (isSel)
testStates(cell, STATE_SELECTED);
else
testStates(cell, STATE_SELECTABLE, 0, STATE_SELECTED);
}
}
}
/**
@ -232,8 +260,10 @@ function testUnselectTableColumn(aIdentifier, aColIdx, aCellsArray)
return;
var rowsCount = aCellsArray.length;
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++)
aCellsArray[rowIdx][aColIdx] = false;
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
if (aCellsArray[rowIdx][aColIdx] != undefined)
aCellsArray[rowIdx][aColIdx] = false;
}
acc.unselectColumn(aColIdx);
testTableSelection(aIdentifier, aCellsArray,
@ -253,8 +283,10 @@ function testSelectTableColumn(aIdentifier, aColIdx, aCellsArray)
var colsCount = aCellsArray[0].length;
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
for (var colIdx = 0; colIdx < colsCount; colIdx++)
aCellsArray[rowIdx][colIdx] = (colIdx == aColIdx);
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] != undefined)
aCellsArray[rowIdx][colIdx] = (colIdx == aColIdx);
}
}
acc.selectColumn(aColIdx);
@ -272,8 +304,10 @@ function testUnselectTableRow(aIdentifier, aRowIdx, aCellsArray)
return;
var colsCount = aCellsArray[0].length;
for (var colIdx = 0; colIdx < colsCount; colIdx++)
aCellsArray[aRowIdx][colIdx] = false;
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[aRowIdx][colIdx] != undefined)
aCellsArray[aRowIdx][colIdx] = false;
}
acc.unselectRow(aRowIdx);
testTableSelection(aIdentifier, aCellsArray,
@ -293,8 +327,10 @@ function testSelectTableRow(aIdentifier, aRowIdx, aCellsArray)
var colsCount = aCellsArray[0].length;
for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {
for (var colIdx = 0; colIdx < colsCount; colIdx++)
aCellsArray[rowIdx][colIdx] = (rowIdx == aRowIdx);
for (var colIdx = 0; colIdx < colsCount; colIdx++) {
if (aCellsArray[rowIdx][colIdx] != undefined)
aCellsArray[rowIdx][colIdx] = (rowIdx == aRowIdx);
}
}
acc.selectRow(aRowIdx);

View File

@ -0,0 +1,57 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Accessibility Name Calculating Test.">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript">
<![CDATA[
function doTest()
{
ok(!isAccessible("presentation_label"),
"Presentation label shouldn't be accessible.");
ok(!isAccessible("presentation_descr"),
"Presentation description shouldn't be accessible.");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=494345"
title="Do not create accessibles for XUL label or description having a role of 'presentation'">
Mozilla Bug 494345
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<vbox flex="1">
<label id="presentation_label" role="presentation" value="label"/>
<description id="presentation_descr" role="presentation" value="description"/>
</vbox>
</hbox>
</window>

View File

@ -20,8 +20,6 @@ function doTest()
var accTable = getAccessible("table", [nsIAccessibleTable]);
is(accTable.getIndexAt(2,4), 17, "wrong index returned");
is(accTable.getColumnAtIndex(18), 5, "got wrong column");
is(accTable.getRowAtIndex(10), 1, "wrong row");
is(accTable.getColumnExtentAt(2,2), 2, "colspan wrong");
is(accTable.getColumnExtentAt(0,3), 2, "colspan wrong");
is(accTable.getColumnExtentAt(3,5), 1, "colspan");
@ -30,31 +28,9 @@ function doTest()
is(accTable.getColumnExtentAt(2,3), 1, "colspan wrong");
is(accTable.cellRefAt(2,1).firstChild.name, "c1", "wrong cell");
// bug 417912
var accTable2 = getAccessible("table2", [nsIAccessibleTable]);
testCellAt(accTable2, 0, 0, true);
testCellAt(accTable2, 0, 1, true);
testCellAt(accTable2, 0, 2, true);
testCellAt(accTable2, 1, 0, true);
testCellAt(accTable2, 1, 1, false);
testCellAt(accTable2, 1, 2, true);
testCellAt(accTable2, 2, 0, true);
testCellAt(accTable2, 2, 1, true);
testCellAt(accTable2, 2, 2, true);
SimpleTest.finish();
}
function testCellAt(aTable, aRow, aColumn, aSucceeded)
{
try {
aTable.cellRefAt(aRow, aColumn);
ok(aSucceeded, "cell is available at (" + aRow + ", " + aColumn + ").");
} catch (e) {
ok(!aSucceeded, "cell is not available at (" + aRow + ", " + aColumn + ").");
}
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
@ -111,14 +87,5 @@ addLoadEvent(doTest);
</tbody>
</table>
</center>
<br><br><b>Testing Table 2:</b><br><br>
<center>
<table cellpadding="2" cellspacing="2" border="1" width="50%" id="table2">
<tr><td>1</td><td>2</td><td rowspan=3>3</td>
<tr><td>4</td>
<tr><td>5</td><td>6</td>
</table>
</center>
</body>
</html>

View File

@ -1,121 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> nsIAccessibleTable Interface Test Case </title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="text/javascript">
function doTest()
{
var accTable = getAccessible("table", [nsIAccessibleTable]);
is(accTable.getSelectedCells({}).length, 0, "no cell selected");
for (var i = 0; i < 4; i++) {
accTable.selectRow(i);
for (var j = 0; j < 4; j++)
if (i == j)
ok(accTable.isRowSelected(i),"row not selected");
else
todo(!accTable.isRowSelected(i),"row selected");
}
todo_is(accTable.selectedRowsCount, 1, "only one row should be selected");
todo_is(accTable.getSelectedRows({}).length, 1,
"only one row should be selected");
for (var i = 0; i < 4; i++) {
accTable.unselectRow(i);
ok(!accTable.isRowSelected(i), "row still selected");
}
todo_is(accTable.getSelectedCells({}).length, 0, "no cell selected");
todo_is(accTable.selectedCellsCount, 0, "no cell selected");
var s = window.getSelection();
if (s.rangeCount > 0)
s.removeAllRanges();
is(accTable.getSelectedCells({}).length, 0, "no cell selected");
is(accTable.selectedCellsCount, 0, "no cell selected");
for (var i = 0; i < 8; i++) {
accTable.selectColumn(i);
for (var j = 0; j < 8; j++)
if (i ==j)
ok(accTable.isColumnSelected(i),"column not selected");
else
todo(!accTable.isColumnSelected(i),"column is selected");
}
todo_is(accTable.selectedColumnsCount, 1,
"only one column should be selected");
todo_is(accTable.getSelectedColumns({}).length, 1,
"only one column should be selected");
for (var i = 0; i < 8; i++) {
accTable.unselectColumn(i);
ok(!accTable.isColumnSelected(i),"column still selected");
}
is(accTable.selectedColumnsCount, 0, "no column should be selected");
ok(!accTable.isProbablyForLayout(), "table is not for layout");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<!-- Test Table -->
<br><br><b> Testing Table:</b><br><br>
<center>
<table cellpadding="2" cellspacing="2" border="1" width="50%" id="table">
<tbody>
<tr>
<td><br></td>
<td><br></td>
<td rowspan="1" colspan="2"><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td rowspan="4" colspan="1"><br></td>
</tr>
<tr>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<td><br></td>
<td rowspan="2" colspan="2">c1</td>
<td><br></td>
<td><br></td>
<td rowspan="2" colspan="1"><br></td>
<td><br></td>
</tr>
<tr>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
</tbody>
</table>
</center>
</body>
</html>

View File

@ -84,6 +84,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
testTableIndexes("tableinsane3", idxes);
//////////////////////////////////////////////////////////////////////////
// tableinsane3.2 (cell holes, row spans, fixed in bug 417912)
idxes = [
[0, 1, 2],
[3, -1, 2],
[4, 5, 2]
];
testTableIndexes("tableinsane3.2", idxes);
//////////////////////////////////////////////////////////////////////////
// tableinsane4 (empty row groups/rows and cell holes)
idxes = [
@ -97,7 +107,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
testTableIndexes("tableinsane4", idxes);
//////////////////////////////////////////////////////////////////////////
// tableinsane4 (just a crazy table)
// tableinsane5 (just a crazy table)
idxes = [
[ 0, 1, 2, -1, -1],
[-1, -1, -1, -1, -1],
@ -108,6 +118,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
];
testTableIndexes("tableinsane5", idxes);
//////////////////////////////////////////////////////////////////////////
// tableinsane6 (overlapping cells, mad table)
idxes = [
[ 0, 1, 2, -1, -1],
[-1, -1, -1, -1, -1],
[ 3, 4, 5, -1, -1],
[ 6, 6, 7, -1, -1],
[ 8, 9, 7, -1, -1],
[ 10, 9, 7, 11, 12]
];
testTableIndexes("tableinsane6", idxes);
SimpleTest.finish();
}
@ -276,6 +298,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
</tbody>
</table>
<table cellpadding="2" cellspacing="2" border="1" id="tableinsane3.2">
<tr><td>1</td><td>2</td><td rowspan=3>3</td>
<tr><td>4</td>
<tr><td>5</td><td>6</td>
</table>
<table border="1" id="tableinsane4">
<caption>test empty rows + cellmap holes</caption>
<thead>
@ -342,5 +370,39 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
</tbody>
<table border="1" id="tableinsane6" >
<caption>overlapping cells</caption>
<thead>
<tr>
<th>header cell 0</th>
<th>header cell 1</th>
<th>header cell 2</th>
</tr>
</thead>
<tbody><tr></tr></tbody>
<tbody></tbody>
<tbody></tbody>
<tbody>
<tr>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td colspan="2">6</td>
<td rowspan="0">7</td>
</tr>
<tr>
<td>8</td>
<td rowspan="0">9</td>
</tr>
<tr>
<td colspan="3">10</td>
<td>11</td>
<td>12</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,345 @@
<html>
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=495388 -->
<head>
<title>test nsHTMLTableAccessible::IsProbablyForLayout implementation</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
<script type="application/javascript">
function doTest()
{
// Attribute we're looking for
var attr = {
"layout-guess": "true"
};
// table with role of grid
testAbsentAttrs("table1", attr);
// table with landmark role
testAbsentAttrs("table2", attr);
// table with summary
testAbsentAttrs("table3", attr);
// table with caption
testAbsentAttrs("table4", attr);
// table with empty caption
testAttrs("table4.2", attr, true);
// table with two captions
testAbsentAttrs("table4.3", attr);
// table with th element
testAbsentAttrs("table5", attr);
// table with thead element
testAbsentAttrs("table6", attr);
// table with tfoot element
testAbsentAttrs("table7", attr);
// table with colgroup element
testAbsentAttrs("table8", attr);
// layout table with nested table
testAttrs("table9", attr, true);
// layout table with 1 column
testAttrs("table10", attr, true);
// layout table with 1 row
testAttrs("table11", attr, true);
// table with 5 columns
testAbsentAttrs("table12", attr);
// table with a bordered cell
testAbsentAttrs("table13", attr);
// table with alternating row background colors
testAbsentAttrs("table14", attr);
// table with 3 columns and 21 rows
testAbsentAttrs("table15", attr);
// layout table that has a 100% width
testAttrs("table16", attr, true);
// layout table that has a 95% width in pixels
testAttrs("table17", attr, true);
// layout table with less than 10 columns
testAttrs("table18", attr, true);
// layout table with embedded iframe
testAttrs("table19", attr, true);
// tree grid, no layout table
testAbsentAttrs("table20", attr);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=495388"
title="Don't treat tables that have a landmark role as layout table">
Mozilla Bug 495388
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<!-- Table with role of grid -->
<table id="table1" role="grid">
<tr>
<th>Sender</th>
<th>Subject</th>
<th>Date</th>
</tr>
<tr>
<td>Marco</td>
<td>Test</td>
<td>June 12</td>
</tr>
<tr>
<td>David</td>
<td>Another test</td>
<td>June 12</td>
</tr>
<tr>
<td>Alex</td>
<td>Third test</td>
<td>June 12</td>
</tr>
</table>
<!-- table with landmark role -->
<table id="table2" role="main">
<tr>
<th>Sender</th>
<th>Subject</th>
<th>Date</th>
</tr>
<tr>
<td>Marco</td>
<td>Test</td>
<td>June 12</td>
</tr>
<tr>
<td>David</td>
<td>Another test</td>
<td>June 12</td>
</tr>
<tr>
<td>Alex</td>
<td>Third test</td>
<td>June 12</td>
</tr>
</table>
<!-- table with summary -->
<table id="table3" summary="This is a table">
<tr>
<td>Cell1</td><td>cell2</td>
</tr>
</table>
<!-- table with caption -->
<table id="table4">
<caption>This is a table</caption>
<tr>
<td>Cell1</td><td>cell2</td>
</tr>
</table>
<!-- table with empty caption -->
<table id="table4.2">
<caption> </caption>
<tr>
<td>Cell1</td><td>cell2</td>
</tr>
</table>
<!-- table with two captions -->
<table id="table4.3">
<caption> </caption>
<tr>
<td>Cell1</td><td>cell2</td>
</tr>
<caption>a caption</caption>
</table>
<!-- table with th element -->
<table id="table5">
<tr>
<th>Cell1</th><th>cell2</th>
</tr>
</table>
<!-- table with thead element -->
<table id="table6">
<thead>
<tr>
<td>Cell1</td><td>cell2</td>
</tr>
</thead>
</table>
<!-- table with tfoot element -->
<table id="table7">
<tfoot>
<tr>
<td>Cell1</td><td>cell2</td>
</tr>
</tfoot>
</table>
<!-- table with colgroup element -->
<table id="table8">
<tr>
<colgroup><td>Cell1</td><td>cell2</td></colgroup>
</tr>
</table>
<!-- layout table with nested table -->
<table id="table9">
<tr>
<td><table><tr><td>Cell</td></tr></table></td>
</tr>
</table>
<!-- layout table with 1 column -->
<table id="table10">
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
</table>
<!-- layout table with 1 row and purposely many columns -->
<table id="table11">
<tr><td>Col1</td><td>Col2</td><td>Col3</td><td>Col4</td><td>Col5</td></tr>
</table>
<!-- table with 5 columns -->
<table id="table12">
<tr><td>Col1</td><td>Col2</td><td>Col3</td><td>Col4</td><td>Col5</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td><td>Col4</td><td>Col5</td></tr>
</table>
<!-- table with a bordered cell -->
<table id="table13" border="1" width="100%" bordercolor="#0000FF">
<tr>
<td bordercolor="#000000"> </td>
<td bordercolor="#000000"> </td>
<td bordercolor="#000000"> </td>
</tr>
<tr>
<td bordercolor="#000000"> </td>
<td bordercolor="#000000"> </td>
<td bordercolor="#000000"> </td>
</tr>
</table>
<!-- table with alternating row background colors -->
<table id="table14" width="100%">
<tr style="background-color: #0000FF;">
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr style="background-color: #00FF00;">
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<!-- table with 3 columns and 21 rows -->
<table id="table15" border="0">
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
</table>
<!-- layout table that has a 100% width -->
<table id="table16" width="100%">
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
</table>
<!-- layout table that has a 95% width in pixels -->
<table id="table17" width="98%">
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
<tr><td>Col1</td><td>Col2</td><td>Col3</td></tr>
</table>
<!-- layout table with less than 10 columns -->
<table id="table18">
<tr>
<td>Marco</td>
<td>Test</td>
<td>June 12</td>
</tr>
<tr>
<td>David</td>
<td>Another test</td>
<td>June 12</td>
</tr>
<tr>
<td>Alex</td>
<td>Third test</td>
<td>June 12</td>
</tr>
</table>
<!-- layout table with embedded iframe -->
<table id="table19">
<tr><td><iframe id="frame"></iframe></td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td></tr>
</table>
<!-- tree grid, no layout table -->
<table id="table20" role="treegrid">
<tr role="treeitem"><td>Cell1</td><td>Cell2</td></tr>
</table>
</body>
</html>

View File

@ -0,0 +1,146 @@
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>nsIAccesible selection methods testing for HTML table</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/states.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/table.js"></script>
<script type="text/javascript">
function doTest()
{
var cellsArray =
[
[false, false, false, undefined, false, false, false, false],
[false, false, false, false, false, false, false, undefined],
[false, false, undefined, false, false, false, false, undefined],
[false, false, undefined, false, false, undefined, false, undefined]
];
testTableSelection("table", cellsArray);
testSelectTableRow("table", 0, cellsArray);
var accTable = getAccessible("table", [nsIAccessibleTable]);
for (var i = 0; i < 4; i++) {
accTable.selectRow(i);
for (var j = 0; j < 4; j++)
if (i == j)
ok(accTable.isRowSelected(i),"row not selected");
else
todo(!accTable.isRowSelected(i),"row selected");
}
todo_is(accTable.selectedRowsCount, 1, "only one row should be selected");
todo_is(accTable.getSelectedRows({}).length, 1,
"only one row should be selected");
for (var i = 0; i < 4; i++) {
accTable.unselectRow(i);
ok(!accTable.isRowSelected(i), "row still selected");
}
todo_is(accTable.getSelectedCells({}).length, 0, "no cell selected");
todo_is(accTable.selectedCellsCount, 0, "no cell selected");
var s = window.getSelection();
if (s.rangeCount > 0)
s.removeAllRanges();
is(accTable.getSelectedCells({}).length, 0, "no cell selected");
is(accTable.selectedCellsCount, 0, "no cell selected");
for (var i = 0; i < 8; i++) {
accTable.selectColumn(i);
for (var j = 0; j < 8; j++)
if (i ==j)
ok(accTable.isColumnSelected(i),"column not selected");
else
todo(!accTable.isColumnSelected(i),"column is selected");
}
todo_is(accTable.selectedColumnsCount, 1,
"only one column should be selected");
todo_is(accTable.getSelectedColumns({}).length, 1,
"only one column should be selected");
for (var i = 0; i < 8; i++) {
accTable.unselectColumn(i);
ok(!accTable.isColumnSelected(i),"column still selected");
}
is(accTable.selectedColumnsCount, 0, "no column should be selected");
ok(!accTable.isProbablyForLayout(), "table is not for layout");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052"
title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently">
Mozilla Bug 410052
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=501635"
title="nsHTMLTableAccessible::GetSelectedCells contains index duplicates for spanned rows or columns">
Mozilla Bug 501635
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<!-- Test Table -->
<br><br><b> Testing Table:</b><br><br>
<center>
<table cellpadding="2" cellspacing="2" border="1" width="50%" id="table">
<tbody>
<tr>
<td><br></td>
<td><br></td>
<td rowspan="1" colspan="2"><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td rowspan="4" colspan="1"><br></td>
</tr>
<tr>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<td><br></td>
<td rowspan="2" colspan="2">c1</td>
<td><br></td>
<td><br></td>
<td rowspan="2" colspan="1"><br></td>
<td><br></td>
</tr>
<tr>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
</tbody>
</table>
</center>
</body>
</html>

View File

@ -4,7 +4,7 @@
https://bugzilla.mozilla.org/show_bug.cgi?id=410052
-->
<head>
<title>Table indexes chrome tests</title>
<title>nsIAccesible selection methods testing for ARIA grid</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
@ -15,6 +15,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/states.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/table.js"></script>

View File

@ -192,7 +192,9 @@ endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
endif
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
RCINCLUDE = splash.rc
ifndef GNU_CC
RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
@ -301,8 +303,6 @@ ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
ICON_FILES = \
$(DIST)/branding/mozicon128.png \
$(DIST)/branding/mozicon50.xpm \
$(DIST)/branding/mozicon16.xpm \
$(DIST)/branding/document.png \
$(NULL)
@ -323,7 +323,7 @@ endif
export::
ifndef MOZ_BRANDING_DIRECTORY
$(NSINSTALL) -D $(DIST)/branding
ifeq ($(OS_ARCH),WINNT)
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
cp $(srcdir)/firefox.ico $(DIST)/branding/firefox.ico
cp $(srcdir)/firefox.ico $(DIST)/branding/app.ico
cp $(srcdir)/document.ico $(DIST)/branding/document.ico
@ -337,8 +337,6 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
endif
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
cp $(srcdir)/mozicon128.png $(DIST)/branding/mozicon128.png
cp $(srcdir)/mozicon16.xpm $(DIST)/branding/mozicon16.xpm
cp $(srcdir)/mozicon50.xpm $(DIST)/branding/mozicon50.xpm
cp $(srcdir)/document.png $(DIST)/branding/document.png
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
@ -403,7 +401,7 @@ endif
-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns
echo -n APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
# remove CVS dirs from packaged app
find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;

View File

@ -1,156 +0,0 @@
/* XPM */
static char * mozicon16_xpm[] = {
"16 16 137 2",
" c None",
". c #388BBF",
"+ c #59ADD6",
"@ c #68CEEF",
"# c #62CCEE",
"$ c #45AAD7",
"% c #3578AF",
"& c #4A93C3",
"* c #5EA9D2",
"= c #72D1EF",
"- c #6DCCEC",
"; c #4B9FCE",
"> c #3483BA",
", c #1E67A5",
"' c #1B6BA5",
") c #2F7AB0",
"! c #48B9E0",
"~ c #5CC2E5",
"{ c #6ED0EE",
"] c #6FC9E9",
"^ c #4994C5",
"/ c #3783B9",
"( c #1E5D9D",
"_ c #1463A1",
": c #028DC4",
"< c #128DC3",
"[ c #27ABD7",
"} c #3CB8E0",
"| c #4EC0E5",
"1 c #5BC3E6",
"2 c #50A2CE",
"3 c #3B7EB5",
"4 c #3C93C4",
"5 c #2164A1",
"6 c #145A9A",
"7 c #0E8FC4",
"8 c #007EBA",
"9 c #0694C8",
"0 c #1896C7",
"a c #2B99C9",
"b c #3CB7DE",
"c c #48B9DF",
"d c #3E95C5",
"e c #2E71AB",
"f c #399DCA",
"g c #34A9D4",
"h c #2387BE",
"i c #1388C0",
"j c #0059A1",
"k c #005C9E",
"l c #00498B",
"m c #095897",
"n c #1869A3",
"o c #289CCA",
"p c #34B1DA",
"q c #3BB3DB",
"r c #3BB3DA",
"s c #35AFD7",
"t c #2BA2CF",
"u c #1E6AA2",
"v c #106AA7",
"w c #0258A0",
"x c #00357F",
"y c #002D71",
"z c #003175",
"A c #013A7E",
"B c #084889",
"C c #1577AF",
"D c #1FA1CF",
"E c #26A3D1",
"F c #28A2CF",
"G c #269ACA",
"H c #2088BE",
"I c #174784",
"J c #0B1F5F",
"K c #012568",
"L c #00206A",
"M c #00185A",
"N c #001F62",
"O c #002569",
"P c #002C70",
"Q c #0567A7",
"R c #0D81BB",
"S c #1485BD",
"T c #1883BC",
"U c #177DB7",
"V c #144A88",
"W c #0C1D5C",
"X c #030B47",
"Y c #00023B",
"Z c #00207A",
"` c #002072",
" . c #00236B",
".. c #001556",
"+. c #001B5E",
"@. c #003D81",
"#. c #01599E",
"$. c #04559E",
"%. c #0761A6",
"&. c #085499",
"*. c #061958",
"=. c #020843",
"-. c #000137",
";. c #001C79",
">. c #00155D",
",. c #000945",
"'. c #000B49",
"). c #000E4C",
"!. c #002367",
"~. c #002A6F",
"{. c #003E8B",
"]. c #003787",
"^. c #00175C",
"/. c #000035",
"(. c #000030",
"_. c #000E67",
":. c #00043B",
"<. c #000339",
"[. c #00043C",
"}. c #00053E",
"|. c #00063F",
"1. c #000E4F",
"2. c #00247E",
"3. c #00166A",
"4. c #00002E",
"5. c #00014F",
"6. c #000029",
"7. c #00012F",
"8. c #000953",
"9. c #000E6E",
"0. c #000A6C",
"a. c #000563",
"b. c #00002F",
"c. c #00001D",
"d. c #000025",
"e. c #000040",
"f. c #000033",
" ",
" . + @ # $ ",
" % & * = - ; > , ",
" ' ) ! ~ { ] ^ / ( _ ",
" : < [ } | 1 2 3 4 5 6 7 ",
" 8 9 0 a b c d e f g h i ",
" j k l m n o p q r s t u v w ",
" x y z A B C D E F G H I J K ",
" L M N O P Q R S T U V W X Y ",
" Z ` ...+.@.#.$.%.&.*.=.-. ",
" ;.>.,.'.).!.~.{.].^./.(. ",
" _.:.<.[.}.|.1.2.3.4. ",
" 5.6.(.4.7.8.9.0.a. ",
" b.b.c.d.e.f. ",
" ",
" "};

File diff suppressed because it is too large Load Diff

View File

@ -257,7 +257,14 @@ pref("browser.urlbar.default.behavior", 0);
pref("browser.download.saveLinkAsFilenameTimeout", 1000);
pref("browser.download.useDownloadDir", true);
#ifdef WINCE
pref("browser.download.folderList", 2);
// Bug 499807: use Hard Disk filesystem because Desktop is short on space.
pref("browser.download.dir", "\\Hard Disk");
#else
pref("browser.download.folderList", 1);
#endif
pref("browser.download.manager.showAlertOnComplete", true);
pref("browser.download.manager.showAlertInterval", 2000);
pref("browser.download.manager.retention", 2);
@ -319,7 +326,11 @@ pref("browser.link.open_newwindow", 3);
pref("browser.link.open_newwindow.restriction", 2);
// Tabbed browser
#ifndef WINCE
pref("browser.tabs.autoHide", false);
#else
pref("browser.tabs.autoHide", true);
#endif
pref("browser.tabs.closeWindowWithLastTab", true);
pref("browser.tabs.warnOnClose", true);
pref("browser.tabs.warnOnOpen", true);
@ -374,6 +385,11 @@ pref("general.warnOnAboutConfig", false);
pref("javascript.options.showInConsole", false);
#endif
#ifdef WINCE
// Set the threshold higher to avoid some slow script warnings
pref("dom.max_script_run_time", 20);
#endif
// Make the status bar reliably present and unaffected by pages
pref("dom.disable_window_open_feature.status", true);
// This is the pref to control the location bar, change this to true to
@ -840,6 +856,37 @@ pref("browser.bookmarks.editDialog.firstEditField", "namePicker");
// base url for the wifi geolocation network provider
pref("geo.wifi.uri", "https://www.google.com/loc/json");
#ifdef WINCE
// tweak awesomebar -- increase the delay until a search happens, and reduce
// the amount of time spent waiting for a search result
pref("browser.urlbar.search.chunkSize", 100);
pref("browser.urlbar.search.timeout", 500);
pref("browser.urlbar.delay", 1000);
// disable safe browsing, due to perf hit
pref("browser.safebrowsing.enabled", false);
pref("browser.safebrowsing.malware.enabled", false);
// don't check for default browser
pref("browser.shell.checkDefaultBrowser", false);
// disable bfcache for memory
pref("browser.sessionhistory.max_total_viewers", 0);
// tweak default content sink prefs
pref("content.sink.interactive_deflect_count", 10); /* default 0 */
pref("content.sink.perf_deflect_count", 50); /* default 200 */
pref("content.sink.interactive_parse_time", 5000); /* default 3000 */
pref("content.sink.perf_parse_time", 150000); /* default 360000 */
pref("content.sink.pending_event_mode", 0); /* default 1 */
pref("content.sink.event_probe_rate", 1); /* default 1 */
pref("content.sink.interactive_time", 750000); /* default 750000 */
pref("content.sink.initial_perf_time", 500000); /* default 2000000 */
pref("content.sink.enable_perf_mode", 0); /* default 0; 0 == switch, 1 == stay interactive, 2 == stay perf */
#endif /* WINCE */
// Whether to use a panel that looks like an OS X sheet for customization
#ifdef XP_MACOSX
pref("toolbar.customization.usesheet", true);

View File

@ -87,9 +87,11 @@ install::
endif
ifneq (,$(filter windows mac cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
ifneq ($(OS_ARCH),WINCE)
DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1
endif
endif
ifneq (,$(BUILD_OFFICIAL)$(MOZILLA_OFFICIAL))
ifdef MOZILLA_OFFICIAL
DEFINES += -DOFFICIAL_BUILD=1
endif

View File

@ -88,6 +88,7 @@
accesskey="&sendPageCmd.accesskey;"
command="Browser:SendLink"/>
<menuseparator/>
#ifndef WINCE
<menuitem id="menu_printSetup"
label="&printSetupCmd.label;"
accesskey="&printSetupCmd.accesskey;"
@ -110,6 +111,7 @@
oncommand="BrowserImport();"/>
#ifndef XP_MACOSX
<menuseparator/>
#endif
#endif
<menuitem id="goOfflineMenuitem"
label="&goOfflineCmd.label;"
@ -227,7 +229,11 @@
accesskey="&taskbarCmd.accesskey;"
type="checkbox"
command="cmd_toggleTaskbar"
#ifndef WINCE
checked="true" />
#else
checked="false" />
#endif
<menu id="viewSidebarMenuMenu"
label="&viewSidebarMenu.label;"
accesskey="&viewSidebarMenu.accesskey;">

View File

@ -181,16 +181,14 @@ var StarUI = {
rows.insertBefore(header, rows.firstChild);
header.hidden = false;
var bundle = this._element("bundle_browser");
// Set panel title:
// if we are batching, i.e. the bookmark has been added now,
// then show Page Bookmarked, else if the bookmark did already exist,
// we are about editing it, then use Edit This Bookmark.
this._element("editBookmarkPanelTitle").value =
this._batching ?
bundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
bundle.getString("editBookmarkPanel.editBookmarkTitle");
gNavigatorBundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
gNavigatorBundle.getString("editBookmarkPanel.editBookmarkTitle");
// No description; show the Done, Cancel;
// hide the Edit, Undo buttons
@ -207,7 +205,7 @@ var StarUI = {
// The label of the remove button differs if the URI is bookmarked
// multiple times.
var bookmarks = PlacesUtils.getBookmarksForURI(gBrowser.currentURI);
var forms = bundle.getString("editBookmark.removeBookmarks.label");
var forms = gNavigatorBundle.getString("editBookmark.removeBookmarks.label");
var label = PluralForm.get(bookmarks.length, forms).replace("#1", bookmarks.length);
this._element("editBookmarkPanelRemoveButton").label = label;
@ -249,18 +247,17 @@ var StarUI = {
function PCH_showPageBookmarkedNotification(aItemId, aAnchorElement, aPosition) {
this._blockCommands(); // un-done in the popuphiding handler
var bundle = this._element("bundle_browser");
var brandBundle = this._element("bundle_brand");
var brandShortName = brandBundle.getString("brandShortName");
// "Page Bookmarked" title
this._element("editBookmarkPanelTitle").value =
bundle.getString("editBookmarkPanel.pageBookmarkedTitle");
gNavigatorBundle.getString("editBookmarkPanel.pageBookmarkedTitle");
// description
this._element("editBookmarkPanelDescription").textContent =
bundle.getFormattedString("editBookmarkPanel.pageBookmarkedDescription",
[brandShortName]);
gNavigatorBundle.getFormattedString("editBookmarkPanel.pageBookmarkedDescription",
[brandShortName]);
// show the "Edit.." button and the Remove Bookmark button, hide the
// undo-remove-bookmark button.
@ -310,12 +307,11 @@ var StarUI = {
if (this._batching) {
PlacesUIUtils.ptm.endBatch();
PlacesUIUtils.ptm.beginBatch(); // allow undo from within the notification
var bundle = this._element("bundle_browser");
// "Bookmark Removed" title (the description field is already empty in
// this mode)
this._element("editBookmarkPanelTitle").value =
bundle.getString("editBookmarkPanel.bookmarkedRemovedTitle");
gNavigatorBundle.getString("editBookmarkPanel.bookmarkedRemovedTitle");
// hide the edit panel
this.quitEditMode();
@ -1148,17 +1144,16 @@ var PlacesStarButton = {
if (!starIcon)
return;
var browserBundle = document.getElementById("bundle_browser");
var uri = getBrowser().currentURI;
this._starred = uri && (PlacesUtils.getMostRecentBookmarkForURI(uri) != -1 ||
PlacesUtils.getMostRecentFolderForFeedURI(uri) != -1);
if (this._starred) {
starIcon.setAttribute("starred", "true");
starIcon.setAttribute("tooltiptext", browserBundle.getString("starButtonOn.tooltip"));
starIcon.setAttribute("tooltiptext", gNavigatorBundle.getString("starButtonOn.tooltip"));
}
else {
starIcon.removeAttribute("starred");
starIcon.setAttribute("tooltiptext", browserBundle.getString("starButtonOff.tooltip"));
starIcon.setAttribute("tooltiptext", gNavigatorBundle.getString("starButtonOff.tooltip"));
}
},

View File

@ -125,7 +125,7 @@
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
<command id="Tools:Sanitize"
oncommand="Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null);"/>
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window || null);"/>
<command id="Tools:PrivateBrowsing" oncommand="gPrivateBrowsingUI.toggleMode();"/>
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>

View File

@ -65,6 +65,13 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
font-weight: bold;
}
%ifdef MOZ_WIDGET_GTK2
/* Bookmarks override the "images-in-menus" metric in xul.css */
.bookmark-item > .menu-iconic-left {
visibility: inherit;
}
%endif
#editBMPanel_tagsSelector {
/* override default listbox width from xul.css */
width: auto;
@ -105,12 +112,6 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
display: none;
}
/* Bug 483950 - Hide domain name in status bar pending removal */
#security-button > label {
display: none;
}
/* ::::: Fullscreen pseudo-toolbar ::::: */
#fullscr-toggler {
display: none;

View File

@ -65,12 +65,7 @@ let Ci = Components.interfaces;
let Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
const MAX_HISTORY_MENU_ITEMS = 15;
// We use this once, for Clear Private Data
const GLUE_CID = "@mozilla.org/browser/browserglue;1";
const nsIWebNavigation = Ci.nsIWebNavigation;
var gCharsetMenu = null;
var gLastBrowserCharset = null;
@ -198,14 +193,12 @@ function UpdateBackForwardCommands(aWebNavigation) {
* Click-and-Hold implementation for the Back and Forward buttons
* XXXmano: should this live in toolbarbutton.xml?
*/
function ClickAndHoldMouseDownCallback(aButton)
{
function ClickAndHoldMouseDownCallback(aButton) {
aButton.open = true;
gClickAndHoldTimer = null;
}
function ClickAndHoldMouseDown(aEvent)
{
function ClickAndHoldMouseDown(aEvent) {
/**
* 1. Only left click starts the click and hold timer.
* 2. Exclude the dropmarker area. This is done by excluding
@ -223,49 +216,35 @@ function ClickAndHoldMouseDown(aEvent)
setTimeout(ClickAndHoldMouseDownCallback, 500, aEvent.currentTarget);
}
function MayStopClickAndHoldTimer(aEvent)
{
function MayStopClickAndHoldTimer(aEvent) {
// Note passing null here is a no-op
clearTimeout(gClickAndHoldTimer);
}
function ClickAndHoldStopEvent(aEvent)
{
function ClickAndHoldStopEvent(aEvent) {
if (aEvent.originalTarget.localName != "menuitem" &&
aEvent.currentTarget.open)
aEvent.stopPropagation();
}
function SetClickAndHoldHandlers()
{
function _addClickAndHoldListenersOnElement(aElm)
{
aElm.addEventListener("mousedown",
ClickAndHoldMouseDown,
false);
aElm.addEventListener("mouseup",
MayStopClickAndHoldTimer,
false);
aElm.addEventListener("mouseout",
MayStopClickAndHoldTimer,
false);
function SetClickAndHoldHandlers() {
function _addClickAndHoldListenersOnElement(aElm) {
aElm.addEventListener("mousedown", ClickAndHoldMouseDown, false);
aElm.addEventListener("mouseup", MayStopClickAndHoldTimer, false);
aElm.addEventListener("mouseout", MayStopClickAndHoldTimer, false);
// don't propagate onclick and oncommand events after
// click-and-hold opened the drop-down menu
aElm.addEventListener("command",
ClickAndHoldStopEvent,
true);
aElm.addEventListener("click",
ClickAndHoldStopEvent,
true);
aElm.addEventListener("command", ClickAndHoldStopEvent, true);
aElm.addEventListener("click", ClickAndHoldStopEvent, true);
}
// Bug 414797: Clone the dropmarker's menu into both the back and
// the forward buttons.
var unifiedButton = document.getElementById("unified-back-forward-button");
if (unifiedButton && !unifiedButton._clickHandlersAttached) {
if (unifiedButton && !unifiedButton._clickHandlersAttached) {
var popup = document.getElementById("back-forward-dropmarker")
.firstChild.cloneNode(true);
.firstChild.cloneNode(true);
var backButton = document.getElementById("back-button");
backButton.setAttribute("type", "menu-button");
backButton.appendChild(popup);
@ -359,22 +338,21 @@ const gPopupBlockerObserver = {
// it.
if (!gBrowser.pageReport.reported) {
if (gPrefService.getBoolPref("privacy.popups.showBrowserMessage")) {
var bundle_browser = document.getElementById("bundle_browser");
var brandBundle = document.getElementById("bundle_brand");
var brandShortName = brandBundle.getString("brandShortName");
var message;
var popupCount = gBrowser.pageReport.length;
#ifdef XP_WIN
var popupButtonText = bundle_browser.getString("popupWarningButton");
var popupButtonAccesskey = bundle_browser.getString("popupWarningButton.accesskey");
var popupButtonText = gNavigatorBundle.getString("popupWarningButton");
var popupButtonAccesskey = gNavigatorBundle.getString("popupWarningButton.accesskey");
#else
var popupButtonText = bundle_browser.getString("popupWarningButtonUnix");
var popupButtonAccesskey = bundle_browser.getString("popupWarningButtonUnix.accesskey");
var popupButtonText = gNavigatorBundle.getString("popupWarningButtonUnix");
var popupButtonAccesskey = gNavigatorBundle.getString("popupWarningButtonUnix.accesskey");
#endif
if (popupCount > 1)
message = bundle_browser.getFormattedString("popupWarningMultiple", [brandShortName, popupCount]);
message = gNavigatorBundle.getFormattedString("popupWarningMultiple", [brandShortName, popupCount]);
else
message = bundle_browser.getFormattedString("popupWarning", [brandShortName]);
message = gNavigatorBundle.getFormattedString("popupWarning", [brandShortName]);
var notificationBox = gBrowser.getNotificationBox();
var notification = notificationBox.getNotificationWithValue("popup-blocked");
@ -416,7 +394,6 @@ const gPopupBlockerObserver = {
fillPopupList: function (aEvent)
{
var bundle_browser = document.getElementById("bundle_browser");
// XXXben - rather than using |currentURI| here, which breaks down on multi-framed sites
// we should really walk the pageReport and create a list of "allow for <host>"
// menuitems for the common subset of hosts present in the report, this will
@ -431,18 +408,17 @@ const gPopupBlockerObserver = {
try {
blockedPopupAllowSite.removeAttribute("hidden");
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
.getService(this._kIPM);
var pm = Cc["@mozilla.org/permissionmanager;1"].getService(this._kIPM);
if (pm.testPermission(uri, "popup") == this._kIPM.ALLOW_ACTION) {
// Offer an item to block popups for this site, if a whitelist entry exists
// already for it.
var blockString = bundle_browser.getFormattedString("popupBlock", [uri.host]);
let blockString = gNavigatorBundle.getFormattedString("popupBlock", [uri.host]);
blockedPopupAllowSite.setAttribute("label", blockString);
blockedPopupAllowSite.setAttribute("block", "true");
}
else {
// Offer an item to allow popups for this site
var allowString = bundle_browser.getFormattedString("popupAllow", [uri.host]);
let allowString = gNavigatorBundle.getFormattedString("popupAllow", [uri.host]);
blockedPopupAllowSite.setAttribute("label", allowString);
blockedPopupAllowSite.removeAttribute("block");
}
@ -484,8 +460,8 @@ const gPopupBlockerObserver = {
foundUsablePopupURI = true;
var menuitem = document.createElement("menuitem");
var label = bundle_browser.getFormattedString("popupShowPopupPrefix",
[popupURIspec]);
var label = gNavigatorBundle.getFormattedString("popupShowPopupPrefix",
[popupURIspec]);
menuitem.setAttribute("label", label);
menuitem.setAttribute("popupWindowURI", popupURIspec);
menuitem.setAttribute("popupWindowFeatures", pageReport[i].popupWindowFeatures);
@ -510,9 +486,9 @@ const gPopupBlockerObserver = {
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
blockedPopupDontShowMessage.setAttribute("checked", !showMessage);
if (aEvent.target.localName == "popup")
blockedPopupDontShowMessage.setAttribute("label", bundle_browser.getString("popupWarningDontShowFromMessage"));
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
else
blockedPopupDontShowMessage.setAttribute("label", bundle_browser.getString("popupWarningDontShowFromStatusbar"));
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromStatusbar"));
},
showBlockedPopup: function (aEvent)
@ -612,7 +588,6 @@ const gXPInstallObserver = {
observe: function (aSubject, aTopic, aData)
{
var brandBundle = document.getElementById("bundle_brand");
var browserBundle = document.getElementById("bundle_browser");
switch (aTopic) {
case "xpinstall-install-blocked":
var installInfo = aSubject.QueryInterface(Components.interfaces.nsIXPIInstallInfo);
@ -628,16 +603,16 @@ const gXPInstallObserver = {
if (!gPrefService.getBoolPref("xpinstall.enabled")) {
notificationName = "xpinstall-disabled"
if (gPrefService.prefIsLocked("xpinstall.enabled")) {
messageString = browserBundle.getString("xpinstallDisabledMessageLocked");
messageString = gNavigatorBundle.getString("xpinstallDisabledMessageLocked");
buttons = [];
}
else {
messageString = browserBundle.getFormattedString("xpinstallDisabledMessage",
[brandShortName, host]);
messageString = gNavigatorBundle.getFormattedString("xpinstallDisabledMessage",
[brandShortName, host]);
buttons = [{
label: browserBundle.getString("xpinstallDisabledButton"),
accessKey: browserBundle.getString("xpinstallDisabledButton.accesskey"),
label: gNavigatorBundle.getString("xpinstallDisabledButton"),
accessKey: gNavigatorBundle.getString("xpinstallDisabledButton.accesskey"),
popup: null,
callback: function editPrefs() {
gPrefService.setBoolPref("xpinstall.enabled", true);
@ -648,12 +623,12 @@ const gXPInstallObserver = {
}
else {
notificationName = "xpinstall"
messageString = browserBundle.getFormattedString("xpinstallPromptWarning",
[brandShortName, host]);
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptWarning",
[brandShortName, host]);
buttons = [{
label: browserBundle.getString("xpinstallPromptAllowButton"),
accessKey: browserBundle.getString("xpinstallPromptAllowButton.accesskey"),
label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"),
popup: null,
callback: function() {
var mgr = Components.classes["@mozilla.org/xpinstall/install-manager;1"]
@ -1572,40 +1547,36 @@ function initializeSanitizer()
* a) User has customized any privacy.item prefs
* b) privacy.sanitize.sanitizeOnShutdown is set
*/
(function() {
var prefService = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService);
if (!prefService.getBoolPref("privacy.sanitize.migrateFx3Prefs")) {
var itemBranch = prefService.getBranch("privacy.item.");
var itemCount = { value: 0 };
var itemArray = itemBranch.getChildList("", itemCount);
if (!gPrefService.getBoolPref("privacy.sanitize.migrateFx3Prefs")) {
let itemBranch = gPrefService.getBranch("privacy.item.");
let itemCount = { value: 0 };
let itemArray = itemBranch.getChildList("", itemCount);
// See if any privacy.item prefs are set
var doMigrate = itemArray.some(function (name) itemBranch.prefHasUserValue(name));
// Or if sanitizeOnShutdown is set
if (!doMigrate)
doMigrate = prefService.getBoolPref("privacy.sanitize.sanitizeOnShutdown");
// See if any privacy.item prefs are set
let doMigrate = itemArray.some(function (name) itemBranch.prefHasUserValue(name));
// Or if sanitizeOnShutdown is set
if (!doMigrate)
doMigrate = gPrefService.getBoolPref("privacy.sanitize.sanitizeOnShutdown");
if (doMigrate) {
var cpdBranch = prefService.getBranch("privacy.cpd.");
var clearOnShutdownBranch = prefService.getBranch("privacy.clearOnShutdown.");
itemArray.forEach(function (name) {
try {
// don't migrate password or offlineApps clearing in the CRH dialog since
// there's no UI for those anymore. They default to false. bug 497656
if (name != "passwords" && name != "offlineApps")
cpdBranch.setBoolPref(name, itemBranch.getBoolPref(name));
clearOnShutdownBranch.setBoolPref(name, itemBranch.getBoolPref(name));
}
catch(e) {
Components.utils.reportError("Exception thrown during privacy pref migration: " + e);
}
});
}
prefService.setBoolPref("privacy.sanitize.migrateFx3Prefs", true);
if (doMigrate) {
let cpdBranch = gPrefService.getBranch("privacy.cpd.");
let clearOnShutdownBranch = gPrefService.getBranch("privacy.clearOnShutdown.");
itemArray.forEach(function (name) {
try {
// don't migrate password or offlineApps clearing in the CRH dialog since
// there's no UI for those anymore. They default to false. bug 497656
if (name != "passwords" && name != "offlineApps")
cpdBranch.setBoolPref(name, itemBranch.getBoolPref(name));
clearOnShutdownBranch.setBoolPref(name, itemBranch.getBoolPref(name));
}
catch(e) {
Cu.reportError("Exception thrown during privacy pref migration: " + e);
}
});
}
})();
gPrefService.setBoolPref("privacy.sanitize.migrateFx3Prefs", true);
}
}
function gotoHistoryIndex(aEvent)
@ -2675,16 +2646,22 @@ var browserDragAndDrop = {
case "text/x-moz-url":
var split = dt.getData(type).split("\n");
return [split[0], split[1]];
case "application/x-moz-file":
var file = dt.mozGetDataAt(type, 0);
var name = file instanceof Components.interfaces.nsIFile ? file.leafName : "";
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var fileHandler = ioService.getProtocolHandler("file")
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
return [fileHandler.getURLSpecFromFile(file), name];
}
}
// For shortcuts, we want to check for the file type last, so that the
// url pointed to in one of the url types is found first before the file
// type, which points to the actual file.
var file = dt.mozGetDataAt("application/x-moz-file", 0);
if (file) {
var name = file instanceof Ci.nsIFile ? file.leafName : "";
var ioService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
var fileHandler = ioService.getProtocolHandler("file")
.QueryInterface(Ci.nsIFileProtocolHandler);
return [fileHandler.getURLSpecFromFile(file), name];
}
return [ , ];
},
@ -3169,24 +3146,22 @@ function FillHistoryMenu(aParent) {
var webNav = getWebNavigation();
var sessionHistory = webNav.sessionHistory;
var bundle_browser = document.getElementById("bundle_browser");
var count = sessionHistory.count;
var index = sessionHistory.index;
var end;
if (count <= 1) // don't display the popup for a single item
return false;
const MAX_HISTORY_MENU_ITEMS = 15;
var index = sessionHistory.index;
var half_length = Math.floor(MAX_HISTORY_MENU_ITEMS / 2);
var start = Math.max(index - half_length, 0);
end = Math.min(start == 0 ? MAX_HISTORY_MENU_ITEMS : index + half_length + 1, count);
var end = Math.min(start == 0 ? MAX_HISTORY_MENU_ITEMS : index + half_length + 1, count);
if (end == count)
start = Math.max(count - MAX_HISTORY_MENU_ITEMS, 0);
var tooltipBack = bundle_browser.getString("tabHistory.goBack");
var tooltipCurrent = bundle_browser.getString("tabHistory.current");
var tooltipForward = bundle_browser.getString("tabHistory.goForward");
var tooltipBack = gNavigatorBundle.getString("tabHistory.goBack");
var tooltipCurrent = gNavigatorBundle.getString("tabHistory.current");
var tooltipForward = gNavigatorBundle.getString("tabHistory.goForward");
for (var j = end - 1; j >= start; j--) {
let item = document.createElement("menuitem");
@ -4156,7 +4131,6 @@ var XULBrowserWindow = {
// Properties used to cache security state used to update the UI
_state: null,
_host: undefined,
_tooltipText: null,
_hostChanged: false, // onLocationChange will flip this bit
@ -4181,11 +4155,13 @@ var XULBrowserWindow = {
}
this._state = aState;
#ifdef DEBUG
try {
this._host = gBrowser.contentWindow.location.host;
} catch(ex) {
this._host = null;
}
#endif
this._hostChanged = false;
this._tooltipText = gBrowser.securityUI.tooltipText
@ -4200,17 +4176,14 @@ var XULBrowserWindow = {
wpl.STATE_SECURE_MED |
wpl.STATE_SECURE_LOW;
var level;
var setHost = false;
switch (this._state & wpl_security_bits) {
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_HIGH:
level = "high";
setHost = true;
break;
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_MED:
case wpl.STATE_IS_SECURE | wpl.STATE_SECURE_LOW:
level = "low";
setHost = true;
break;
case wpl.STATE_IS_BROKEN:
level = "broken";
@ -4231,11 +4204,6 @@ var XULBrowserWindow = {
gURLBar.removeAttribute("level");
}
if (setHost && this._host)
this.securityButton.setAttribute("label", this._host);
else
this.securityButton.removeAttribute("label");
this.securityButton.setAttribute("tooltiptext", this._tooltipText);
// Don't pass in the actual location object, since it can cause us to
@ -4430,8 +4398,9 @@ nsBrowserAccess.prototype =
if (!window.document.documentElement.getAttribute("chromehidden"))
win = window;
else {
var browserGlue = Cc[GLUE_CID].getService(Ci.nsIBrowserGlue);
win = browserGlue.getMostRecentBrowserWindow();
win = Cc["@mozilla.org/browser/browserglue;1"]
.getService(Ci.nsIBrowserGlue)
.getMostRecentBrowserWindow();
needToFocusWin = true;
}
@ -5481,19 +5450,17 @@ var OfflineApps = {
var notificationBox = gBrowser.getNotificationBox(aBrowser);
var notification = notificationBox.getNotificationWithValue("offline-app-usage");
if (!notification) {
var bundle_browser = document.getElementById("bundle_browser");
var buttons = [{
label: bundle_browser.getString("offlineApps.manageUsage"),
accessKey: bundle_browser.getString("offlineApps.manageUsageAccessKey"),
label: gNavigatorBundle.getString("offlineApps.manageUsage"),
accessKey: gNavigatorBundle.getString("offlineApps.manageUsageAccessKey"),
callback: OfflineApps.manage
}];
var warnQuota = gPrefService.getIntPref("offline-apps.quota.warn");
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
var message = bundle_browser.getFormattedString("offlineApps.usage",
[ aURI.host,
warnQuota / 1024 ]);
var message = gNavigatorBundle.getFormattedString("offlineApps.usage",
[ aURI.host,
warnQuota / 1024 ]);
notificationBox.appendNotification(message, "offline-app-usage",
"chrome://browser/skin/Info.png",
@ -5587,33 +5554,31 @@ var OfflineApps = {
if (notification) {
notification.documents.push(aContentWindow.document);
} else {
var bundle_browser = document.getElementById("bundle_browser");
var buttons = [{
label: bundle_browser.getString("offlineApps.allow"),
accessKey: bundle_browser.getString("offlineApps.allowAccessKey"),
label: gNavigatorBundle.getString("offlineApps.allow"),
accessKey: gNavigatorBundle.getString("offlineApps.allowAccessKey"),
callback: function() {
for (var i = 0; i < notification.documents.length; i++) {
OfflineApps.allowSite(notification.documents[i]);
}
}
},{
label: bundle_browser.getString("offlineApps.never"),
accessKey: bundle_browser.getString("offlineApps.neverAccessKey"),
label: gNavigatorBundle.getString("offlineApps.never"),
accessKey: gNavigatorBundle.getString("offlineApps.neverAccessKey"),
callback: function() {
for (var i = 0; i < notification.documents.length; i++) {
OfflineApps.disallowSite(notification.documents[i]);
}
}
},{
label: bundle_browser.getString("offlineApps.notNow"),
accessKey: bundle_browser.getString("offlineApps.notNowAccessKey"),
label: gNavigatorBundle.getString("offlineApps.notNow"),
accessKey: gNavigatorBundle.getString("offlineApps.notNowAccessKey"),
callback: function() { /* noop */ }
}];
const priority = notificationBox.PRIORITY_INFO_LOW;
var message = bundle_browser.getFormattedString("offlineApps.available",
[ host ]);
var message = gNavigatorBundle.getFormattedString("offlineApps.available",
[ host ]);
notification =
notificationBox.appendNotification(message, notificationID,
"chrome://browser/skin/Info.png",
@ -6347,21 +6312,17 @@ var gIdentityHandler = {
_lastLocation : null,
// smart getters
get _stringBundle () {
delete this._stringBundle;
return this._stringBundle = document.getElementById("bundle_browser");
},
get _staticStrings () {
delete this._staticStrings;
this._staticStrings = {};
this._staticStrings[this.IDENTITY_MODE_DOMAIN_VERIFIED] = {
encryption_label: this._stringBundle.getString("identity.encrypted")
encryption_label: gNavigatorBundle.getString("identity.encrypted")
};
this._staticStrings[this.IDENTITY_MODE_IDENTIFIED] = {
encryption_label: this._stringBundle.getString("identity.encrypted")
encryption_label: gNavigatorBundle.getString("identity.encrypted")
};
this._staticStrings[this.IDENTITY_MODE_UNKNOWN] = {
encryption_label: this._stringBundle.getString("identity.unencrypted")
encryption_label: gNavigatorBundle.getString("identity.unencrypted")
};
return this._staticStrings;
},
@ -6407,6 +6368,11 @@ var gIdentityHandler = {
delete this._identityIconLabel;
return this._identityIconLabel = document.getElementById("identity-icon-label");
},
get _overrideService () {
delete this._overrideService;
return this._overrideService = Cc["@mozilla.org/security/certoverride;1"]
.getService(Ci.nsICertOverrideService);
},
/**
* Rebuild cache of the elements that may or may not exist depending
@ -6552,15 +6518,10 @@ var gIdentityHandler = {
if (lookupHost.indexOf(':') < 0)
lookupHost += ":443";
// Cache the override service the first time we need to check it
if (!this._overrideService)
this._overrideService = Components.classes["@mozilla.org/security/certoverride;1"]
.getService(Components.interfaces.nsICertOverrideService);
// Verifier is either the CA Org, for a normal cert, or a special string
// for certs that are trusted because of a security exception.
var tooltip = this._stringBundle.getFormattedString("identity.identified.verifier",
[iData.caOrg]);
var tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
[iData.caOrg]);
// Check whether this site is a security exception. XPConnect does the right
// thing here in terms of converting _lastLocation.port from string to int, but
@ -6569,21 +6530,21 @@ var gIdentityHandler = {
if (this._overrideService.hasMatchingOverride(this._lastLocation.hostname,
(this._lastLocation.port || 443),
iData.cert, {}, {}))
tooltip = this._stringBundle.getString("identity.identified.verified_by_you");
tooltip = gNavigatorBundle.getString("identity.identified.verified_by_you");
}
else if (newMode == this.IDENTITY_MODE_IDENTIFIED) {
// If it's identified, then we can populate the dialog with credentials
iData = this.getIdentityData();
tooltip = this._stringBundle.getFormattedString("identity.identified.verifier",
[iData.caOrg]);
tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
[iData.caOrg]);
if (iData.country)
icon_label = this._stringBundle.getFormattedString("identity.identified.title_with_country",
[iData.subjectOrg, iData.country]);
icon_label = gNavigatorBundle.getFormattedString("identity.identified.title_with_country",
[iData.subjectOrg, iData.country]);
else
icon_label = iData.subjectOrg;
}
else {
tooltip = this._stringBundle.getString("identity.unknown.tooltip");
tooltip = gNavigatorBundle.getString("identity.unknown.tooltip");
icon_label = "";
}
@ -6614,7 +6575,7 @@ var gIdentityHandler = {
if (newMode == this.IDENTITY_MODE_DOMAIN_VERIFIED) {
var iData = this.getIdentityData();
var host = this.getEffectiveHost();
var owner = this._stringBundle.getString("identity.ownerUnknown2");
var owner = gNavigatorBundle.getString("identity.ownerUnknown2");
verifier = this._identityBox.tooltipText;
supplemental = "";
}
@ -6629,8 +6590,8 @@ var gIdentityHandler = {
if (iData.city)
supplemental += iData.city + "\n";
if (iData.state && iData.country)
supplemental += this._stringBundle.getFormattedString("identity.identified.state_and_country",
[iData.state, iData.country]);
supplemental += gNavigatorBundle.getFormattedString("identity.identified.state_and_country",
[iData.state, iData.country]);
else if (iData.state) // State only
supplemental += iData.state;
else if (iData.country) // Country only
@ -6722,10 +6683,8 @@ let DownloadMonitorPanel = {
this._panel = document.getElementById("download-monitor");
// Cache the status strings
let (bundle = document.getElementById("bundle_browser")) {
this._activeStr = bundle.getString("activeDownloads");
this._pausedStr = bundle.getString("pausedDownloads");
}
this._activeStr = gNavigatorBundle.getString("activeDownloads");
this._pausedStr = gNavigatorBundle.getString("pausedDownloads");
gDownloadMgr.addListener(this);
this._listening = true;

View File

@ -279,6 +279,9 @@
</tooltip>
<toolbox id="navigator-toolbox" class="toolbox-top" mode="icons"
#ifdef WINCE
defaulticonsize="small" iconsize="small"
#endif
defaultmode="icons">
<!-- Menu -->
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
@ -506,12 +509,21 @@
<toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
fullscreentoolbar="true" mode="icons" iconsize="large"
fullscreentoolbar="true" mode="icons"
#ifdef WINCE
iconsize="small" defaulticonsize="small"
#else
iconsize="large"
#endif
customizable="true"
#ifdef XP_MACOSX
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container"
#else
#ifdef WINCE
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,navigator-throbber,fullscreenflex,window-controls"
#else
defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,fullscreenflex,window-controls"
#endif
#endif
context="toolbar-context-menu">
#ifndef XP_MACOSX
@ -540,6 +552,9 @@
context="toolbar-context-menu"
defaultset="personal-bookmarks"
toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
#ifdef WINCE
collapsed="true"
#endif
customizable="true"/>
</toolbox>
@ -575,6 +590,9 @@
<findbar browserid="content" id="FindToolbar"/>
<statusbar class="chromeclass-status" id="status-bar"
#ifdef WINCE
hidden="true"
#endif
ondrop="contentAreaDNDObserver.onDrop(event)">
<statusbarpanel id="statusbar-display" label="" flex="1"/>
<statusbarpanel class="statusbarpanel-progress" collapsed="true" id="statusbar-progresspanel">
@ -583,9 +601,9 @@
<statusbarpanel id="download-monitor" class="statusbarpanel-iconic-text"
tooltiptext="&downloadMonitor2.tooltip;" hidden="true"
command="Tools:Downloads"/>
<statusbarpanel id="security-button" class="statusbarpanel-iconic-text"
<statusbarpanel id="security-button" class="statusbarpanel-iconic"
hidden="true"
ondblclick="if (event.button == 0) displaySecurityInfo();"/>
onclick="if (event.button == 0 &amp;&amp; event.detail == 1) displaySecurityInfo();"/>
<statusbarpanel id="page-report-button" type="menu"
class="statusbarpanel-menu-iconic"
hidden="true"

View File

@ -76,7 +76,7 @@
<row id="link-url">
<separator orient="vertical"/>
<label value="&link-url.label; "/>
<textbox readonly="true" id="link-url-text"/>
<textbox readonly="true" id="link-url-text" class="uri-element"/>
</row>
<row id="link-target">
<separator orient="vertical"/>
@ -125,7 +125,7 @@
<row id="image-url">
<separator orient="vertical"/>
<label value="&image-url.label; "/>
<textbox readonly="true" id="image-url-text"/>
<textbox readonly="true" id="image-url-text" class="uri-element"/>
</row>
<row id="image-type">
<separator orient="vertical"/>

View File

@ -180,10 +180,14 @@ nsContextMenu.prototype = {
this.showItem("context-saveimage", this.onLoadedImage || this.onCanvas);
this.showItem("context-savevideo", this.onVideo);
this.showItem("context-saveaudio", this.onAudio);
this.setItemAttr("context-savevideo", "disabled", !this.mediaURL);
this.setItemAttr("context-saveaudio", "disabled", !this.mediaURL);
// Send media URL (but not for canvas, since it's a big data: URL)
this.showItem("context-sendimage", this.onImage);
this.showItem("context-sendvideo", this.onVideo);
this.showItem("context-sendaudio", this.onAudio);
this.setItemAttr("context-sendvideo", "disabled", !this.mediaURL);
this.setItemAttr("context-sendaudio", "disabled", !this.mediaURL);
},
initViewItems: function CM_initViewItems() {
@ -231,6 +235,7 @@ nsContextMenu.prototype = {
(!this.onStandaloneImage || this.inFrame)) || this.onCanvas);
this.showItem("context-viewvideo", this.onVideo);
this.setItemAttr("context-viewvideo", "disabled", !this.mediaURL);
// View background image depends on whether there is one.
this.showItem("context-viewbgimage", shouldShow);
@ -380,6 +385,8 @@ nsContextMenu.prototype = {
this.showItem("context-copyimage", this.onImage);
this.showItem("context-copyvideourl", this.onVideo);
this.showItem("context-copyaudiourl", this.onAudio);
this.setItemAttr("context-copyvideourl", "disabled", !this.mediaURL);
this.setItemAttr("context-copyaudiourl", "disabled", !this.mediaURL);
this.showItem("context-sep-copyimage", this.onImage ||
this.onVideo || this.onAudio);
},
@ -392,12 +399,22 @@ nsContextMenu.prototype = {
initMediaPlayerItems: function() {
var onMedia = (this.onVideo || this.onAudio);
// Several mutually exclusive items... play/pause, mute/unmute, show/hide
this.showItem("context-media-play", onMedia && this.target.paused);
this.showItem("context-media-pause", onMedia && !this.target.paused);
this.showItem("context-media-play", onMedia && (this.target.paused || this.target.ended));
this.showItem("context-media-pause", onMedia && !this.target.paused && !this.target.ended);
this.showItem("context-media-mute", onMedia && !this.target.muted);
this.showItem("context-media-unmute", onMedia && this.target.muted);
this.showItem("context-media-showcontrols", onMedia && !this.target.controls)
this.showItem("context-media-hidecontrols", onMedia && this.target.controls)
// Disable them when there isn't a valid media source loaded.
if (onMedia) {
var hasError = (this.target.error != null);
this.setItemAttr("context-media-play", "disabled", hasError);
this.setItemAttr("context-media-pause", "disabled", hasError);
this.setItemAttr("context-media-mute", "disabled", hasError);
this.setItemAttr("context-media-unmute", "disabled", hasError);
this.setItemAttr("context-media-showcontrols", "disabled", hasError);
this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
}
this.showItem("context-media-sep-commands", onMedia);
},
@ -468,11 +485,11 @@ nsContextMenu.prototype = {
}
else if (this.target instanceof HTMLVideoElement) {
this.onVideo = true;
this.mediaURL = this.target.currentSrc;
this.mediaURL = this.target.currentSrc || this.target.src;
}
else if (this.target instanceof HTMLAudioElement) {
this.onAudio = true;
this.mediaURL = this.target.currentSrc;
this.mediaURL = this.target.currentSrc || this.target.src;
}
else if (this.target instanceof HTMLInputElement ) {
this.onTextInput = this.isTargetATextBox(this.target);
@ -1020,8 +1037,7 @@ nsContextMenu.prototype = {
var brandBundle = document.getElementById("bundle_brand");
var app = brandBundle.getString("brandShortName");
var bundle_browser = document.getElementById("bundle_browser");
var message = bundle_browser.getFormattedString(aBlock ?
var message = gNavigatorBundle.getFormattedString(aBlock ?
"imageBlockedWarning" : "imageAllowedWarning", [app, uri.host]);
var notificationBox = this.browser.getNotificationBox();
@ -1032,8 +1048,8 @@ nsContextMenu.prototype = {
else {
var self = this;
var buttons = [{
label: bundle_browser.getString("undo"),
accessKey: bundle_browser.getString("undo.accessKey"),
label: gNavigatorBundle.getString("undo"),
accessKey: gNavigatorBundle.getString("undo.accessKey"),
callback: function() { self.toggleImageBlocking(!aBlock); }
}];
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;

View File

@ -318,8 +318,8 @@
<vbox id="permList" flex="1">
<vbox>
<label value="&permImage;" control="permImageGroup imageRadioGroup"/>
<hbox id="permImageGroup" role="group">
<label id="permImageLabel" value="&permImage;" control="imageRadioGroup"/>
<hbox role="group" aria-labelledby="permImageLabel">
<checkbox id="imageDef" command="cmd_imageDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="imageRadioGroup" orient="horizontal">
@ -329,8 +329,8 @@
</hbox>
</vbox>
<vbox>
<label value="&permPopup;" control="permPopupGroup popupRadioGroup"/>
<hbox id="permPopupGroup" role="group">
<label id="permPopupLabel" value="&permPopup;" control="popupRadioGroup"/>
<hbox role="group" aria-labelledby="permPopupLabel">
<checkbox id="popupDef" command="cmd_popupDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="popupRadioGroup" orient="horizontal">
@ -340,8 +340,8 @@
</hbox>
</vbox>
<vbox>
<label value="&permCookie;" control="permCookieGroup cookieRadioGroup"/>
<hbox id="permCookieGroup" role="group">
<label id="permCookieLabel" value="&permCookie;" control="cookieRadioGroup"/>
<hbox role="group" aria-labelledby="permCookieLabel">
<checkbox id="cookieDef" command="cmd_cookieDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="cookieRadioGroup" orient="horizontal">
@ -352,8 +352,8 @@
</hbox>
</vbox>
<vbox>
<label value="&permInstall;" control="permInstallGroup installRadioGroup"/>
<hbox id="permInstallGroup" role="group">
<label id="permInstallLabel" value="&permInstall;" control="installRadioGroup"/>
<hbox role="group" aria-labelledby="permInstallLabel">
<checkbox id="installDef" command="cmd_installDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="installRadioGroup" orient="horizontal">
@ -364,8 +364,8 @@
</vbox>
<vbox>
<label value="&permGeo;" control="permGeoGroup geoRadioGroup"/>
<hbox id="permGeoGroup" role="group">
<label id="permGeoLabel" value="&permGeo;" control="geoRadioGroup"/>
<hbox role="group" aria-labelledby="permGeoLabel">
<checkbox id="geoDef" command="cmd_geoDef" label="&permAskAlways;"/>
<spacer flex="1"/>
<radiogroup id="geoRadioGroup" orient="horizontal">

View File

@ -10,7 +10,12 @@
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-arrowscrollbox");
}
.tab-close-button, .tabs-closebutton {
.tabs-alltabs-popup {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-alltabs-popup");
}
.tab-close-button,
.tabs-closebutton {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-close-tab-button");
}

View File

@ -941,12 +941,6 @@
if (evt.target != this.contentDocument)
return;
var i = 0;
for ( ; i < this.parentNode.parentNode.childNodes.length; i++) {
if (this.parentNode.parentNode.childNodes[i].firstChild == this)
break;
}
var tabBrowser = this.parentNode.parentNode.parentNode.parentNode;
var tab = document.getAnonymousElementByAttribute(tabBrowser, "linkedpanel", this.parentNode.id);
@ -1195,16 +1189,13 @@
this.mTabContainer.appendChild(t);
if (document.defaultView
.getComputedStyle(this.mTabContainer, "")
.direction == "rtl") {
if (this.tabContainer.mTabstrip._isRTLScrollbox) {
/* In RTL UI, the tab is visually added to the left side of the
* tabstrip. This means the tabstip has to be scrolled back in
* order to make sure the same set of tabs is visible before and
* after the new tab is added */
this.mTabContainer.mTabstrip.scrollBoxObject
.scrollBy(this.mTabContainer.firstChild.boxObject.width, 0);
this.tabContainer.mTabstrip.scrollByPixels(this.mTabs[0].clientWidth);
}
// invalidate cache, because mTabContainer is about to change
@ -1283,21 +1274,21 @@
}
}
// |setTimeout| here to ensure we're post reflow
var _delayedUpdate = function(aTabContainer) {
aTabContainer.adjustTabstrip();
this.tabContainer.adjustTabstrip();
// Do this asynchronically, as we don't know yet if the tab
// will be selected.
setTimeout(function (aTabContainer) {
if (aTabContainer.selectedItem != t)
aTabContainer._notifyBackgroundTab(t);
}, 0, this.tabContainer);
// XXXmano: this is a temporary workaround to bug 343585
// We need to manually update the scroll buttons disabled state
// if a tab was inserted to the overflow area or removed from it
// without any scrolling and when the tabbar has already
// overflowed.
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
}
setTimeout(_delayedUpdate, 0, this.mTabContainer);
// XXXmano: this is a temporary workaround for bug 345399
// We need to manually update the scroll buttons disabled state
// if a tab was inserted to the overflow area or removed from it
// without any scrolling and when the tabbar has already
// overflowed.
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
// Dispatch a new tab notification. We do this once we're
// entirely done, so that things are in a consistent state
@ -1505,15 +1496,12 @@
while (this._removingTabs.length)
this._endRemoveTab([this._removingTabs[0], false]);
} else if (!this._windowIsClosing) {
// see notes in addTab
function _delayedUpdate(aTabContainer) {
aTabContainer.adjustTabstrip();
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
};
setTimeout(_delayedUpdate, 0, this.tabContainer);
if (aNewTab && gURLBar)
gURLBar.focus();
this.tabContainer.adjustTabstrip();
// workaround for bug 345399
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
}
// We're going to remove the tab and the browser now.
@ -1977,8 +1965,9 @@
var newIndex = this.getNewIndex(aEvent);
var ib = this.mTabDropIndicatorBar;
var ind = ib.firstChild;
var tabStripBoxObject = tabStrip.scrollBoxObject;
var minMargin = tabStripBoxObject.x - this.boxObject.x;
var scrollRect = tabStrip.scrollClientRect;
var rect = this.getBoundingClientRect();
var minMargin = scrollRect.left - rect.left;
// make sure we don't place the tab drop indicator past the
// edge, or the containing box will flex and stretch
// the tab drop indicator bar, which will flex the url bar.
@ -1986,13 +1975,13 @@
// just use first value if you can figure out how to get
// the tab drop indicator to crop instead of flex and stretch
// the tab drop indicator bar.
var maxMargin = Math.min(minMargin + tabStripBoxObject.width,
ib.boxObject.x + ib.boxObject.width -
ind.boxObject.width);
var maxMargin = Math.min(minMargin + scrollRect.width,
ib.getBoundingClientRect().right -
ind.clientWidth);
if (!ltr)
[minMargin, maxMargin] = [this.boxObject.width - maxMargin,
this.boxObject.width - minMargin];
var newMargin, tabBoxObject;
[minMargin, maxMargin] = [this.clientWidth - maxMargin,
this.clientWidth - minMargin];
var newMargin;
if (pixelsToScroll) {
// if we are scrolling, put the drop indicator at the edge
// so that it doesn't jump while scrolling
@ -2000,21 +1989,18 @@
}
else {
if (newIndex == this.mTabs.length) {
tabBoxObject = this.mTabs[newIndex-1].boxObject;
let tabRect = this.mTabs[newIndex-1].getBoundingClientRect();
if (ltr)
newMargin = tabBoxObject.screenX - this.boxObject.screenX
+ tabBoxObject.width;
newMargin = tabRect.right - rect.left;
else
newMargin = this.boxObject.screenX - tabBoxObject.screenX
+ this.boxObject.width;
newMargin = rect.right - tabRect.left;
}
else {
tabBoxObject = this.mTabs[newIndex].boxObject;
let tabRect = this.mTabs[newIndex].getBoundingClientRect();
if (ltr)
newMargin = tabBoxObject.screenX - this.boxObject.screenX;
newMargin = tabRect.left - rect.left;
else
newMargin = this.boxObject.screenX - tabBoxObject.screenX
+ this.boxObject.width - tabBoxObject.width;
newMargin = rect.right - tabRect.right;
}
// ensure we never place the drop indicator beyond our limits
if (newMargin < minMargin)
@ -2245,7 +2231,7 @@
this.mTabContainer.childNodes[i]._selected = false;
}
this.mCurrentTab._selected = true;
this.mTabContainer.mTabstrip.scrollBoxObject.ensureElementIsVisible(this.mCurrentTab);
this.mTabContainer.mTabstrip.ensureElementIsVisible(this.mCurrentTab, false);
var evt = document.createEvent("UIEvents");
evt.initUIEvent("TabMove", true, false, window, oldPosition);
@ -2804,7 +2790,7 @@
this._scrollButtonDownBox.collapsed = false;
this._scrollButtonDownBoxAnimate.collapsed = false;
#endif
this.scrollBoxObject.ensureElementIsVisible(tabs.selectedItem);
this.ensureElementIsVisible(tabs.selectedItem, false);
]]></handler>
#ifdef XP_MACOSX
@ -3003,10 +2989,7 @@
this.setAttribute("closebuttons", "activetab");
break;
case 1:
var width = this.firstChild.boxObject.width;
// 0 width is an invalid value and indicates
// an item without display, so ignore.
if (width > this.mTabClipWidth || width == 0)
if (this.firstChild.getBoundingClientRect().width > this.mTabClipWidth)
this.setAttribute("closebuttons", "alltabs");
else
this.setAttribute("closebuttons", "activetab");
@ -3048,15 +3031,9 @@
// of the tabstrip, we need to ensure that we stay
// completely scrolled to the right side
var tabStrip = this.mTabstrip;
var scrollPos = {};
tabStrip.scrollBoxObject.getPosition(scrollPos, {});
var scrolledSize = {};
tabStrip.scrollBoxObject.getScrolledSize(scrolledSize, {});
if (scrollPos.value + tabStrip.boxObject.width >=
scrolledSize.value) {
if (tabStrip.scrollPosition + tabStrip.scrollClientSize >=
tabStrip.scrollSize)
tabStrip.scrollByPixels(-1);
}
} catch (e) {}
]]></body>
</method>
@ -3078,6 +3055,11 @@
]]></body>
</method>
<field name="mAllTabsPopup">
document.getAnonymousElementByAttribute(this,
"anonid", "alltabs-popup");
</field>
<field name="mAllTabsBoxAnimate">
document.getAnonymousElementByAttribute(this,
"anonid",
@ -3120,30 +3102,26 @@
<method name="_notifyBackgroundTab">
<parameter name="aTab"/>
<body><![CDATA[
var tsbo = this.mTabstrip.scrollBoxObject;
var tsboStart = tsbo.screenX;
var tsboEnd = tsboStart + tsbo.width;
var ctbo = aTab.boxObject;
var ctboStart = ctbo.screenX;
var ctboEnd = ctboStart + ctbo.width;
var scrollRect = this.mTabstrip.scrollClientRect;
var tab = aTab.getBoundingClientRect();
// Is the new tab already completely visible?
if (tsboStart <= ctboStart && ctboEnd <= tsboEnd)
if (scrollRect.left <= tab.left && tab.right <= scrollRect.right)
return;
if (this.mTabstrip.smoothScroll) {
var selStart = this.selectedItem.boxObject.screenX;
var selEnd = selStart + this.selectedItem.boxObject.width;
let selected = this.selectedItem.getBoundingClientRect();
// Can we make both the new tab and the selected tab completely visible?
if (Math.max(ctboEnd - selStart, selEnd - ctboStart) <= tsbo.width) {
if (Math.max(tab.right - selected.left, selected.right - tab.left) <=
scrollRect.width) {
this.mTabstrip.ensureElementIsVisible(aTab);
return;
}
this.mTabstrip._smoothScrollByPixels(this.mTabstrip._isRTLScrollbox ?
selEnd - tsboEnd : selStart - tsboStart);
selected.right - scrollRect.right :
selected.left - scrollRect.left);
}
// start the flash timer
@ -3270,6 +3248,7 @@
<implementation>
<field name="mOverCloseButton">false</field>
<field name="mCorrespondingMenuitem">null</field>
</implementation>
<handlers>
@ -3311,4 +3290,213 @@
</handlers>
</binding>
<binding id="tabbrowser-alltabs-popup"
extends="chrome://global/content/bindings/popup.xml#popup">
<implementation implements="nsIDOMEventListener">
<field name="_xulWindow">
null
</field>
<constructor><![CDATA[
// We cannot cache the XULBrowserWindow object itself since it might
// be set after this binding is constructed.
try {
this._xulWindow =
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
.treeOwner
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIXULWindow);
}
catch(ex) { }
]]></constructor>
<method name="_menuItemOnCommand">
<parameter name="aEvent"/>
<body><![CDATA[
var tabcontainer = document.getBindingParent(this);
tabcontainer.selectedItem = aEvent.target.tab;
]]></body>
</method>
<method name="_tabOnAttrModified">
<parameter name="aEvent"/>
<body><![CDATA[
var menuItem = aEvent.target.mCorrespondingMenuitem;
if (menuItem) {
var attrName = aEvent.attrName;
switch (attrName) {
case "label":
case "crop":
case "busy":
case "image":
case "selected":
if (aEvent.attrChange == aEvent.REMOVAL)
menuItem.removeAttribute(attrName);
else
menuItem.setAttribute(attrName, aEvent.newValue);
}
}
]]></body>
</method>
<method name="_tabOnTabClose">
<parameter name="aEvent"/>
<body><![CDATA[
var menuItem = aEvent.target.mCorrespondingMenuitem;
if (menuItem)
this.removeChild(menuItem);
]]></body>
</method>
<method name="handleEvent">
<parameter name="aEvent"/>
<body><![CDATA[
if (!aEvent.isTrusted)
return;
switch (aEvent.type) {
case "command":
this._menuItemOnCommand(aEvent);
break;
case "DOMAttrModified":
this._tabOnAttrModified(aEvent);
break;
case "TabClose":
this._tabOnTabClose(aEvent);
break;
case "TabOpen":
this._createTabMenuItem(aEvent.originalTarget);
break;
case "scroll":
this._updateTabsVisibilityStatus();
break;
}
]]></body>
</method>
<method name="_updateTabsVisibilityStatus">
<body><![CDATA[
var tabContainer = document.getBindingParent(this);
// We don't want menu item decoration unless there is overflow.
if (tabContainer.getAttribute("overflow") != "true")
return;
var tabstripBO = tabContainer.mTabstrip.scrollBoxObject;
for (var i = 0; i < this.childNodes.length; i++) {
var curTabBO = this.childNodes[i].tab.boxObject;
if (curTabBO.screenX >= tabstripBO.screenX &&
curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width)
this.childNodes[i].setAttribute("tabIsVisible", "true");
else
this.childNodes[i].removeAttribute("tabIsVisible");
}
]]></body>
</method>
<method name="_createTabMenuItem">
<parameter name="aTab"/>
<body><![CDATA[
var menuItem = document.createElementNS(
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"menuitem");
menuItem.setAttribute("class", "menuitem-iconic alltabs-item");
menuItem.setAttribute("label", aTab.label);
menuItem.setAttribute("crop", aTab.getAttribute("crop"));
menuItem.setAttribute("image", aTab.getAttribute("image"));
if (aTab.hasAttribute("busy"))
menuItem.setAttribute("busy", aTab.getAttribute("busy"));
if (aTab.selected)
menuItem.setAttribute("selected", "true");
// Keep some attributes of the menuitem in sync with its
// corresponding tab (e.g. the tab label)
aTab.mCorrespondingMenuitem = menuItem;
aTab.addEventListener("DOMAttrModified", this, false);
aTab.addEventListener("TabClose", this, false);
menuItem.tab = aTab;
menuItem.addEventListener("command", this, false);
this.appendChild(menuItem);
return menuItem;
]]></body>
</method>
</implementation>
<handlers>
<handler event="popupshowing">
<![CDATA[
// set up the menu popup
var tabcontainer = document.getBindingParent(this);
var tabs = tabcontainer.childNodes;
// Listen for changes in the tab bar.
var tabbrowser = document.getBindingParent(tabcontainer);
tabbrowser.addEventListener("TabOpen", this, false);
tabcontainer.mTabstrip.addEventListener("scroll", this, false);
// if an animation is in progress and the user
// clicks on the "all tabs" button, stop the animation
tabcontainer._stopAnimation();
for (var i = 0; i < tabs.length; i++) {
this._createTabMenuItem(tabs[i]);
}
this._updateTabsVisibilityStatus();
]]></handler>
<handler event="popuphiding">
<![CDATA[
// clear out the menu popup and remove the listeners
while (this.hasChildNodes()) {
var menuItem = this.lastChild;
menuItem.removeEventListener("command", this, false);
menuItem.tab.removeEventListener("DOMAttrModified", this, false);
menuItem.tab.removeEventListener("TabClose", this, false);
menuItem.tab.mCorrespondingMenuitem = null;
this.removeChild(menuItem);
}
var tabcontainer = document.getBindingParent(this);
tabcontainer.mTabstrip.removeEventListener("scroll", this, false);
document.getBindingParent(tabcontainer).removeEventListener("TabOpen", this, false);
]]></handler>
<handler event="DOMMenuItemActive">
<![CDATA[
if (!this._xulWindow || !this._xulWindow.XULBrowserWindow)
return;
var tab = event.target.tab;
if (tab) {
var statusText = tab.linkedBrowser.currentURI.spec;
if (statusText == "about:blank") {
// XXXhack: Passing a space here (and not "")
// to make sure the the browser implementation would
// still consider it a hovered link.
statusText = " ";
}
this._xulWindow.XULBrowserWindow.setOverLink(statusText, null);
}
]]></handler>
<handler event="DOMMenuItemInactive">
<![CDATA[
if (!this._xulWindow || !this._xulWindow.XULBrowserWindow)
return;
this._xulWindow.XULBrowserWindow.setOverLink("", null);
]]></handler>
</handlers>
</binding>
</bindings>

View File

@ -43,13 +43,15 @@ relativesrcdir = browser/base/content/test
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES = test_feed_discovery.html \
_TEST_FILES = \
test_feed_discovery.html \
feed_discovery.html \
test_bug395533.html \
bug395533-data.txt \
test_contextmenu.html \
subtst_contextmenu.html \
ctxmenu-image.png \
video.ogg \
test_offlineNotification.html \
offlineChild.html \
offlineChild.cacheManifest \
@ -63,7 +65,6 @@ _TEST_FILES = test_feed_discovery.html \
$(NULL)
# The following tests are disabled because they are unreliable:
# browser_bug321000.js is bug 474081
# browser_bug423833.js is bug 428712
# browser_sanitize-download-history.js is bug 432425
#
@ -71,7 +72,9 @@ _TEST_FILES = test_feed_discovery.html \
# back to the clear recent history dialog (santize.xul), if it ever is (bug
# 480169)
_BROWSER_FILES = browser_sanitize-timespans.js \
_BROWSER_FILES = \
browser_bug321000.js \
browser_sanitize-timespans.js \
browser_bug405137.js \
browser_bug409481.js \
browser_bug413915.js \
@ -97,7 +100,7 @@ _BROWSER_FILES = browser_sanitize-timespans.js \
browser_ctrlTab.js \
browser_selectTabAtIndex.js \
browser_gestureSupport.js \
browser_feed_tab.js \
browser_pageInfo.js \
feed_tab.html \
browser_pluginnotification.js \
plugin_unknown.html \

View File

@ -3,10 +3,6 @@ const Ci = Components.interfaces;
const gCompleteState = Ci.nsIWebProgressListener.STATE_STOP +
Ci.nsIWebProgressListener.STATE_IS_NETWORK;
function LOG(str) {
dump(str + "\n");
}
var gFrontProgressListener = {
onProgressChange: function (aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
@ -15,7 +11,7 @@ var gFrontProgressListener = {
onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
var state = "onStateChange";
LOG("FrontProgress: " + state + " 0x" + aStateFlags.toString(16));
info("FrontProgress: " + state + " 0x" + aStateFlags.toString(16));
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener");
gFrontNotificationsPos++;
@ -23,7 +19,7 @@ var gFrontProgressListener = {
onLocationChange: function (aWebProgress, aRequest, aLocationURI) {
var state = "onLocationChange";
LOG("FrontProgress: " + state + " " + aLocationURI.spec);
info("FrontProgress: " + state + " " + aLocationURI.spec);
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener");
gFrontNotificationsPos++;
@ -34,7 +30,7 @@ var gFrontProgressListener = {
onSecurityChange: function (aWebProgress, aRequest, aState) {
var state = "onSecurityChange";
LOG("FrontProgress: " + state + " 0x" + aState.toString(16));
info("FrontProgress: " + state + " 0x" + aState.toString(16));
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener");
gFrontNotificationsPos++;
@ -49,7 +45,7 @@ var gAllProgressListener = {
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
var state = "onStateChange";
LOG("AllProgress: " + state + " 0x" + aStateFlags.toString(16));
info("AllProgress: " + state + " 0x" + aStateFlags.toString(16));
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener");
is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener");
@ -64,7 +60,7 @@ var gAllProgressListener = {
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {
var state = "onLocationChange";
LOG("AllProgress: " + state + " " + aLocationURI.spec);
info("AllProgress: " + state + " " + aLocationURI.spec);
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener");
is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener");
@ -78,7 +74,7 @@ var gAllProgressListener = {
onSecurityChange: function (aBrowser, aWebProgress, aRequest, aState) {
var state = "onSecurityChange";
LOG("AllProgress: " + state + " 0x" + aState.toString(16));
info("AllProgress: " + state + " 0x" + aState.toString(16));
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener");
is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener");
@ -92,7 +88,6 @@ var gTestPage = "/browser/browser/base/content/test/alltabslistener.html";
var gNextTest;
function test() {
LOG("Running tests from alltabslistener.js");
waitForExplicitFinish();
gBackgroundTab = gBrowser.addTab("about:blank");
@ -120,7 +115,7 @@ function startTests() {
}
function startTest1() {
LOG("\nTest 1");
info("\nTest 1");
gBrowser.addProgressListener(gFrontProgressListener);
gBrowser.addTabsProgressListener(gAllProgressListener);
@ -135,7 +130,7 @@ function startTest1() {
}
function startTest2() {
LOG("\nTest 2");
info("\nTest 2");
gAllNotifications = [
"onStateChange",
"onLocationChange",
@ -148,7 +143,7 @@ function startTest2() {
}
function startTest3() {
LOG("\nTest 3");
info("\nTest 3");
gAllNotifications = [
"onStateChange",
"onLocationChange",
@ -160,7 +155,7 @@ function startTest3() {
}
function startTest4() {
LOG("\nTest 4");
info("\nTest 4");
gAllNotifications = [
"onStateChange",
"onLocationChange",
@ -173,7 +168,7 @@ function startTest4() {
}
function startTest5() {
LOG("\nTest 5");
info("\nTest 5");
// Switch the foreground browser
[gForegroundBrowser, gBackgroundBrowser] = [gBackgroundBrowser, gForegroundBrowser];
[gForegroundTab, gBackgroundTab] = [gBackgroundTab, gForegroundTab];
@ -193,7 +188,7 @@ function startTest5() {
}
function startTest6() {
LOG("\nTest 6");
info("\nTest 6");
gAllNotifications = [
"onStateChange",
"onLocationChange",
@ -205,7 +200,6 @@ function startTest6() {
}
function finishTest() {
LOG("\nFinished tests from alltabslistener.js");
gBrowser.removeProgressListener(gFrontProgressListener);
gBrowser.removeTabsProgressListener(gAllProgressListener);
gBrowser.removeTab(gBackgroundTab);

View File

@ -1,48 +1,72 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
* ***** 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 Firefox Browser Test Code.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ted Mielczarek <ted.mielczarek@gmail.com> (Original Author)
* Marco Bonardo <mak77@bonardo.net>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const Ci = Components.interfaces;
const Cc = Components.classes;
const kUrlBarElm = document.getElementById('urlbar');
const kSearchBarElm = document.getElementById('searchbar');
const kTestString = " hello hello \n world\nworld ";
function testPaste(name, element, expected) {
element.focus();
listener.expected = expected;
listener.name = name;
// Pasting is async because the Accel+V codepath ends up going through
// DocumentViewerImpl::FireClipboardEvent.
EventUtils.synthesizeKey("v", { accelKey: true });
}
var gTests = [
var listener = {
expected: "",
name: "",
handleEvent: function(event) {
var element = event.target;
is(element.value, this.expected, this.name);
switch (element) {
case kUrlBarElm:
continue_test();
case kSearchBarElm:
finish_test();
}
}
}
{ desc: "Urlbar strips newlines and surrounding whitespace",
element: gURLBar,
expected: kTestString.replace(/\s*\n\s*/g,'')
},
// test bug 23485 and bug 321000
// urlbar should strip newlines,
// search bar should replace newlines with spaces
{ desc: "Searchbar replaces newlines with spaces",
element: document.getElementById('searchbar'),
expected: kTestString.replace('\n',' ','g')
},
];
// Test for bug 23485 and bug 321000.
// Urlbar should strip newlines,
// search bar should replace newlines with spaces.
function test() {
waitForExplicitFinish();
// register listeners
kUrlBarElm.addEventListener("input", listener, true);
kSearchBarElm.addEventListener("input", listener, true);
// Put a multi-line string in the clipboard
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper)
.copyString(kTestString);
// Put a multi-line string in the clipboard.
info("About to put a string in clipboard");
Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper)
.copyString(kTestString);
// Setting the clipboard value is an async OS operation, so we need to poll
// the clipboard for valid data before going on.
@ -51,53 +75,84 @@ function test() {
var runCount = 0;
function poll_clipboard() {
// Poll for a maximum of 5s
// Poll for a maximum of 5s (each run happens after 100ms).
if (++runCount > 50) {
// Log the failure
// Log the failure.
ok(false, "Timed out while polling clipboard for pasted data");
// Cleanup and interrupt the test
// Cleanup and interrupt the test.
finish_test();
return;
}
var clip = Components.classes["@mozilla.org/widget/clipboard;1"].
getService(Components.interfaces.nsIClipboard);
var trans = Components.classes["@mozilla.org/widget/transferable;1"].
createInstance(Components.interfaces.nsITransferable);
info("Polling clipboard cycle " + runCount);
var clip = Cc["@mozilla.org/widget/clipboard;1"].
getService(Ci.nsIClipboard);
var trans = Cc["@mozilla.org/widget/transferable;1"].
createInstance(Ci.nsITransferable);
trans.addDataFlavor("text/unicode");
var str = new Object();
try {
// This code could throw if the clipboard is not set
clip.getData(trans,clip.kGlobalClipboard);
trans.getTransferData("text/unicode",str,{});
str = str.value.QueryInterface(Components.interfaces.nsISupportsString);
} catch (ex) {}
// This code could throw if the clipboard is not set yet.
clip.getData(trans, clip.kGlobalClipboard);
trans.getTransferData("text/unicode", str, {});
str = str.value.QueryInterface(Ci.nsISupportsString);
}
catch(ex) {}
if (kTestString == str) {
testPaste('urlbar strips newlines and surrounding whitespace',
kUrlBarElm,
kTestString.replace(/\s*\n\s*/g,''));
next_test();
}
else
setTimeout(poll_clipboard, 100);
}
function continue_test() {
testPaste('searchbar replaces newlines with spaces',
kSearchBarElm,
kTestString.replace('\n',' ','g'));
function next_test() {
if (gTests.length) {
var currentTest = gTests.shift();
test_paste(currentTest);
}
else {
// No more tests to run.
// Clear the clipboard, emptyClipboard would not clear the native one, so
// we are setting it to an empty string.
Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper)
.copyString("");
finish();
}
}
function finish_test() {
kUrlBarElm.removeEventListener("input", listener, true);
kSearchBarElm.removeEventListener("input", listener, true);
// Clear the clipboard, emptyClipboard would not clear the native one, so
// setting it to an empty string.
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper)
.copyString("");
// Clear fields
kUrlBarElm.value="";
kSearchBarElm.value="";
finish();
function test_paste(aCurrentTest) {
var element = aCurrentTest.element;
// Register input listener.
var inputListener = {
test: aCurrentTest,
handleEvent: function(event) {
var element = event.target;
element.removeEventListener("input", this, false);
is(element.value, this.test.expected, this.test.desc);
// Clear the field and go to next test.
element.value = "";
setTimeout(next_test, 0);
}
}
element.addEventListener("input", inputListener, false);
// Focus the window.
window.focus();
// Focus the element and wait for focus event.
info("About to focus " + element.id);
element.addEventListener("focus", function() {
element.removeEventListener("focus", arguments.callee, false);
executeSoon(function() {
// Pasting is async because the Accel+V codepath ends up going through
// DocumentViewerImpl::FireClipboardEvent.
info("Pasting into " + element.id);
EventUtils.synthesizeKey("v", { accelKey: true });
});
}, false);
element.focus();
}

View File

@ -1,54 +0,0 @@
function test() {
waitForExplicitFinish();
var pageInfo, obs;
var gTestPage = gBrowser.addTab();
gBrowser.selectedTab = gTestPage;
gTestPage.linkedBrowser.addEventListener("load", handleLoad, true);
content.location =
"http://localhost:8888/browser/browser/base/content/test/feed_tab.html";
gTestPage.focus();
var observer = {
observe: function(win, topic, data) {
if (topic != "page-info-dialog-loaded")
return;
obs.removeObserver(observer, "page-info-dialog-loaded");
handlePageInfo();
}
};
function handleLoad() {
pageInfo = BrowserPageInfo();
obs = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
obs.addObserver(observer, "page-info-dialog-loaded", false);
}
function handlePageInfo() {
function $(aId) { return pageInfo.document.getElementById(aId) };
var feedTab = $("feedTab");
var feedListbox = $("feedListbox");
ok(feedListbox, "Feed list is null (feeds tab is broken)");
var feedRowsNum = feedListbox.getRowCount();
ok(feedRowsNum == 3, "Number of feeds listed: " +
feedRowsNum + ", should be 3");
for (var i = 0; i < feedRowsNum; i++) {
let feedItem = feedListbox.getItemAtIndex(i);
ok(feedItem.getAttribute("name") == (i+1),
"Name given: " + feedItem.getAttribute("name") + ", should be " + (i+1));
}
pageInfo.close();
gTestPage.focus();
gBrowser.removeCurrentTab();
finish();
}
}

View File

@ -0,0 +1,99 @@
function test() {
waitForExplicitFinish();
var pageInfo, obs, atTest = 0;
var gTestPage = gBrowser.addTab();
gBrowser.selectedTab = gTestPage;
gTestPage.linkedBrowser.addEventListener("load", handleLoad, true);
content.location =
"https://example.com/browser/browser/base/content/test/feed_tab.html";
gTestPage.focus();
var observer = {
observe: function(win, topic, data) {
if (topic != "page-info-dialog-loaded")
return;
switch(atTest) {
case 0:
atTest++;
handlePageInfo();
break;
case 1:
atTest++;
pageInfo = win;
testLockClick();
break;
case 2:
atTest++;
obs.removeObserver(observer, "page-info-dialog-loaded");
testLockDoubleClick();
break;
}
}
}
function handleLoad() {
pageInfo = BrowserPageInfo();
obs = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
obs.addObserver(observer, "page-info-dialog-loaded", false);
}
function $(aId) { return pageInfo.document.getElementById(aId) };
function handlePageInfo() {
var feedTab = $("feedTab");
var feedListbox = $("feedListbox");
ok(feedListbox, "Feed list is null (feeds tab is broken)");
var feedRowsNum = feedListbox.getRowCount();
ok(feedRowsNum == 3, "Number of feeds listed: " +
feedRowsNum + ", should be 3");
for (var i = 0; i < feedRowsNum; i++) {
let feedItem = feedListbox.getItemAtIndex(i);
ok(feedItem.getAttribute("name") == (i+1),
"Name given: " + feedItem.getAttribute("name") + ", should be " + (i+1));
}
pageInfo.addEventListener("unload", function() {
pageInfo.removeEventListener("unload", arguments.callee, false);
var lockIcon = document.getElementById("security-button");
EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 1});
}, false);
pageInfo.close();
}
function testLockClick() {
var deck = $("mainDeck");
is(deck.selectedPanel.id, "securityPanel", "The security tab should open when the lock icon is clicked");
pageInfo.addEventListener("unload", function() {
pageInfo.removeEventListener("unload", arguments.callee, false);
var lockIcon = document.getElementById("security-button");
EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 1});
EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 2});
}, false);
pageInfo.close();
}
function testLockDoubleClick() {
var pageInfoDialogs = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getEnumerator("Browser:page-info");
var i = 0;
while(pageInfoDialogs.hasMoreElements()) {
i++;
pageInfo = pageInfoDialogs.getNext();
pageInfo.close();
}
is(i, 1, "When the lock is clicked twice there should be only one page info dialog");
gTestPage.focus();
gBrowser.removeCurrentTab();
finish();
}
}

View File

@ -12,7 +12,11 @@ Browser context menu subtest.
<input id="test-input"><br>
<img id="test-image" src="ctxmenu-image.png">
<canvas id="test-canvas" width="100" height="100" style="background-color: blue"></canvas>
<video id="test-video" width="100" height="100" style="background-color: orange"></video>
<video id="test-video-ok" src="video.ogg" width="100" height="100" style="background-color: green"></video>
<video id="test-video-bad" src="bogus.duh" width="100" height="100" style="background-color: orange"></video>
<video id="test-video-bad2" width="100" height="100" style="background-color: yellow">
<source src="bogus.duh" type="video/durrrr;">
</video>
<iframe id="test-iframe" width="98" height="98" style="border: 1px solid black"></iframe>
</body>

View File

@ -76,9 +76,11 @@ function getVisibleMenuItems(aMenu) {
else
accessKeys[key] = item.id
items.push(item.id);
items.push(!item.disabled);
} else if (item.nodeName == "menuseparator") {
ok(true, "--- seperator id is " + item.id);
items.push("---");
items.push(null);
} else if (item.nodeName == "menu") {
ok(item.id, "child menu #" + i + " has an ID");
ok(key, "menu has an access key");
@ -87,9 +89,11 @@ function getVisibleMenuItems(aMenu) {
else
accessKeys[key] = item.id
items.push(item.id);
items.push(!item.disabled);
// Add a dummy item to that the indexes in checkMenu are the same
// for expectedItems and actualItems.
items.push([]);
items.push(null);
} else {
ok(false, "child #" + i + " of menu ID " + aMenu.id +
" has an unknown type (" + item.nodeName + ")");
@ -105,24 +109,37 @@ function checkContextMenu(expectedItems) {
/*
* checkMenu - checks to see if the specified <menupopup> contains the
* expected items, as specified by an array of element IDs. To check the
* contents of a submenu, include a nested array after the expected <menu> ID.
* For example: ["foo, "submenu", ["sub1", "sub2"], "bar"]
* expected items and state.
* expectedItems is a array of (1) item IDs and (2) a boolean specifying if
* the item is enabled or not (or null to ignore it). Submenus can be checked
* by providing a nested array entry after the expected <menu> ID.
* For example: ["blah", true, // item enabled
* "submenu", null, // submenu
* ["sub1", true, // submenu contents
* "sub2", false], null, // submenu contents
* "lol", false] // item disabled
*
*/
function checkMenu(menu, expectedItems) {
var actualItems = getVisibleMenuItems(menu);
//ok(false, "Items are: " + actualItems);
for (var i = 0; i < expectedItems.length; i++) {
if (expectedItems[i] instanceof Array) {
for (var i = 0; i < expectedItems.length; i+=2) {
var actualItem = actualItems[i];
var actualEnabled = actualItems[i + 1];
var expectedItem = expectedItems[i];
var expectedEnabled = expectedItems[i + 1];
if (expectedItem instanceof Array) {
ok(true, "Checking submenu...");
var menuID = expectedItems[i - 1]; // The last item was the menu ID.
var menuID = expectedItems[i - 2]; // The last item was the menu ID.
var submenu = menu.getElementsByAttribute("id", menuID)[0];
ok(submenu && submenu.nodeName == "menu", "got expected submenu element");
checkMenu(submenu.menupopup, expectedItems[i]);
checkMenu(submenu.menupopup, expectedItem);
} else {
is(actualItems[i], expectedItems[i],
"checking item #" + i + " (" + expectedItems[i] + ")");
is(actualItem, expectedItem,
"checking item #" + i/2 + " (" + expectedItem + ") name");
if (expectedEnabled != null)
is(actualEnabled, expectedEnabled,
"checking item #" + i/2 + " (" + expectedItem + ") enabled state");
}
}
// Could find unexpected extra items at the end...
@ -150,136 +167,166 @@ function runTest(testNum) {
case 2:
// Context menu for plain text
checkContextMenu(["context-back",
"context-forward",
"context-reload",
"context-stop",
"---",
"context-bookmarkpage",
"context-savepage",
"context-sendpage",
"---",
"context-viewbgimage",
"context-selectall",
"---",
"context-viewsource",
"context-viewinfo"]);
checkContextMenu(["context-back", false,
"context-forward", false,
"context-reload", true,
"context-stop", false,
"---", null,
"context-bookmarkpage", true,
"context-savepage", true,
"context-sendpage", true,
"---", null,
"context-viewbgimage", false,
"context-selectall", true,
"---", null,
"context-viewsource", true,
"context-viewinfo", true]);
closeContextMenu()
openContextMenuFor(link); // Invoke context menu for next test.
break;
case 3:
// Context menu for text link
checkContextMenu(["context-openlink",
"context-openlinkintab",
"---",
"context-bookmarklink",
"context-savelink",
"context-sendlink",
"context-copylink",
"---",
"context-metadata"]);
checkContextMenu(["context-openlink", true,
"context-openlinkintab", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-sendlink", true,
"context-copylink", true,
"---", null,
"context-metadata", true]);
closeContextMenu()
openContextMenuFor(mailto); // Invoke context menu for next test.
break;
case 4:
// Context menu for text mailto-link
checkContextMenu(["context-copyemail",
"---",
"context-metadata"]);
checkContextMenu(["context-copyemail", true,
"---", null,
"context-metadata", true]);
closeContextMenu()
openContextMenuFor(input); // Invoke context menu for next test.
break;
case 5:
// Context menu for text input field
checkContextMenu(["context-undo",
"---",
"context-cut",
"context-copy",
"context-paste",
"context-delete",
"---",
"context-selectall",
"---",
"spell-check-enabled"]);
checkContextMenu(["context-undo", false,
"---", null,
"context-cut", false,
"context-copy", false,
"context-paste", null, // ignore clipboard state
"context-delete", false,
"---", null,
"context-selectall", true,
"---", null,
"spell-check-enabled", true]);
closeContextMenu()
openContextMenuFor(img); // Invoke context menu for next test.
break;
case 6:
// Context menu for an image
checkContextMenu(["context-viewimage",
"context-copyimage-contents",
"context-copyimage",
"---",
"context-saveimage",
"context-sendimage",
"context-setDesktopBackground",
"context-blockimage",
"---",
"context-metadata"]);
checkContextMenu(["context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-blockimage", true,
"---", null,
"context-metadata", true]);
closeContextMenu();
openContextMenuFor(canvas); // Invoke context menu for next test.
break;
case 7:
// Context menu for a canvas
checkContextMenu(["context-viewimage",
"context-saveimage",
"context-bookmarkpage",
"context-selectall"]);
checkContextMenu(["context-viewimage", true,
"context-saveimage", true,
"context-bookmarkpage", true,
"context-selectall", true]);
closeContextMenu();
openContextMenuFor(video); // Invoke context menu for next test.
openContextMenuFor(video_ok); // Invoke context menu for next test.
break;
case 8:
// Context menu for a video
checkContextMenu(["context-media-play",
"context-media-mute",
"context-media-showcontrols",
"---",
"context-viewvideo",
"context-copyvideourl",
"---",
"context-savevideo",
"context-sendvideo"]);
// Context menu for a video (with a VALID media source)
checkContextMenu(["context-media-play", true,
"context-media-mute", true,
"context-media-showcontrols", true,
"---", null,
"context-viewvideo", true,
"context-copyvideourl", true,
"---", null,
"context-savevideo", true,
"context-sendvideo", true]);
closeContextMenu();
openContextMenuFor(video_bad); // Invoke context menu for next test.
break;
case 9:
// Context menu for a video (with a INVALID media source)
checkContextMenu(["context-media-play", false,
"context-media-mute", false,
"context-media-showcontrols", false,
"---", null,
"context-viewvideo", true,
"context-copyvideourl", true,
"---", null,
"context-savevideo", true,
"context-sendvideo", true]);
closeContextMenu();
openContextMenuFor(video_bad2); // Invoke context menu for next test.
break;
case 10:
// Context menu for a video (with a INVALID media source)
checkContextMenu(["context-media-play", false,
"context-media-mute", false,
"context-media-showcontrols", false,
"---", null,
"context-viewvideo", false,
"context-copyvideourl", false,
"---", null,
"context-savevideo", false,
"context-sendvideo", false]);
closeContextMenu();
openContextMenuFor(iframe); // Invoke context menu for next test.
break;
case 9:
case 11:
// Context menu for an iframe
checkContextMenu(["context-back",
"context-forward",
"context-reload",
"context-stop",
"---",
"context-bookmarkpage",
"context-savepage",
"context-sendpage",
"---",
"context-viewbgimage",
"context-selectall",
"---",
"frame",
["context-showonlythisframe",
"context-openframe",
"context-openframeintab",
"---",
"context-reloadframe",
"---",
"context-bookmarkframe",
"context-saveframe",
"---",
"context-printframe",
"---",
"context-viewframesource",
"context-viewframeinfo"],
"---",
"context-viewsource",
"context-viewinfo"]);
checkContextMenu(["context-back", false,
"context-forward", false,
"context-reload", true,
"context-stop", false,
"---", null,
"context-bookmarkpage", true,
"context-savepage", true,
"context-sendpage", true,
"---", null,
"context-viewbgimage", false,
"context-selectall", true,
"---", null,
"frame", null,
["context-showonlythisframe", true,
"context-openframe", true,
"context-openframeintab", true,
"---", null,
"context-reloadframe", true,
"---", null,
"context-bookmarkframe", true,
"context-saveframe", true,
"---", null,
"context-printframe", true,
"---", null,
"context-viewframesource", true,
"context-viewframeinfo", true], null,
"---", null,
"context-viewsource", true,
"context-viewinfo", true]);
closeContextMenu();
subwindow.close();
@ -327,7 +374,9 @@ function startTest() {
input = subwindow.document.getElementById("test-input");
img = subwindow.document.getElementById("test-image");
canvas = subwindow.document.getElementById("test-canvas");
video = subwindow.document.getElementById("test-video");
video_ok = subwindow.document.getElementById("test-video-ok");
video_bad = subwindow.document.getElementById("test-video-bad");
video_bad2 = subwindow.document.getElementById("test-video-bad2");
iframe = subwindow.document.getElementById("test-iframe");
contextMenu.addEventListener("popupshown", function() { runTest(++testNum); }, false);

Binary file not shown.

View File

@ -81,6 +81,7 @@
</commandset>
<popupset id="mainPopupSet">
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
<popup id="contentAreaContextMenu"
onpopupshowing="if (event.target != this)
return true;
@ -94,6 +95,6 @@
<commandset id="editMenuCommands"/>
<browser id="web-panels-browser" persist="cachedurl" type="content" flex="1"
context="contentAreaContextMenu"
context="contentAreaContextMenu" tooltip="aHTMLTooltip"
onclick="return window.parent.contentAreaClick(event, true);"/>
</page>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

View File

@ -24,8 +24,6 @@ BROWSER_APP_FILES = \
default32.png \
default48.png \
mozicon128.png \
mozicon16.xpm \
mozicon50.xpm \
firefox.ico \
document.ico \
$(NULL)
@ -36,8 +34,6 @@ export::
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
cp $(srcdir)/document.png $(DIST)/branding/document.png
$(NSINSTALL) -D $(DIST)/install
cp $(srcdir)/header.png $(DIST)/install/header.png
cp $(srcdir)/watermark.png $(DIST)/install/watermark.png
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
cp $(srcdir)/firefox.icns $(DIST)/branding/firefox.icns
@ -46,8 +42,10 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
cp $(srcdir)/background.png $(DIST)/branding/background.png
cp $(srcdir)/disk.icns $(DIST)/branding/disk.icns
endif
ifeq ($(OS_ARCH),WINNT)
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
cp $(srcdir)/firefox.ico $(DIST)/branding/app.ico
endif
ifeq ($(OS_ARCH),WINNT)
cp $(srcdir)/branding.nsi $(DIST)/branding/branding.nsi
cp $(srcdir)/wizHeader.bmp $(DIST)/branding/wizHeader.bmp
cp $(srcdir)/wizHeaderRTL.bmp $(DIST)/branding/wizHeaderRTL.bmp
@ -57,6 +55,4 @@ ifeq ($(OS_ARCH),OS2)
cp $(srcdir)/firefox-os2.ico $(DIST)/branding/firefox.ico
cp $(srcdir)/firefox-os2.ico $(DIST)/branding/app.ico
cp $(srcdir)/document-os2.ico $(DIST)/branding/document.ico
cp $(srcdir)/Header.bmp $(DIST)/branding/Header.bmp
cp $(srcdir)/Watermrk.bmp $(DIST)/branding/Watermrk.bmp
endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,156 +0,0 @@
/* XPM */
static char * mozicon16_xpm[] = {
"16 16 137 2",
" c None",
". c #388BBF",
"+ c #59ADD6",
"@ c #68CEEF",
"# c #62CCEE",
"$ c #45AAD7",
"% c #3578AF",
"& c #4A93C3",
"* c #5EA9D2",
"= c #72D1EF",
"- c #6DCCEC",
"; c #4B9FCE",
"> c #3483BA",
", c #1E67A5",
"' c #1B6BA5",
") c #2F7AB0",
"! c #48B9E0",
"~ c #5CC2E5",
"{ c #6ED0EE",
"] c #6FC9E9",
"^ c #4994C5",
"/ c #3783B9",
"( c #1E5D9D",
"_ c #1463A1",
": c #028DC4",
"< c #128DC3",
"[ c #27ABD7",
"} c #3CB8E0",
"| c #4EC0E5",
"1 c #5BC3E6",
"2 c #50A2CE",
"3 c #3B7EB5",
"4 c #3C93C4",
"5 c #2164A1",
"6 c #145A9A",
"7 c #0E8FC4",
"8 c #007EBA",
"9 c #0694C8",
"0 c #1896C7",
"a c #2B99C9",
"b c #3CB7DE",
"c c #48B9DF",
"d c #3E95C5",
"e c #2E71AB",
"f c #399DCA",
"g c #34A9D4",
"h c #2387BE",
"i c #1388C0",
"j c #0059A1",
"k c #005C9E",
"l c #00498B",
"m c #095897",
"n c #1869A3",
"o c #289CCA",
"p c #34B1DA",
"q c #3BB3DB",
"r c #3BB3DA",
"s c #35AFD7",
"t c #2BA2CF",
"u c #1E6AA2",
"v c #106AA7",
"w c #0258A0",
"x c #00357F",
"y c #002D71",
"z c #003175",
"A c #013A7E",
"B c #084889",
"C c #1577AF",
"D c #1FA1CF",
"E c #26A3D1",
"F c #28A2CF",
"G c #269ACA",
"H c #2088BE",
"I c #174784",
"J c #0B1F5F",
"K c #012568",
"L c #00206A",
"M c #00185A",
"N c #001F62",
"O c #002569",
"P c #002C70",
"Q c #0567A7",
"R c #0D81BB",
"S c #1485BD",
"T c #1883BC",
"U c #177DB7",
"V c #144A88",
"W c #0C1D5C",
"X c #030B47",
"Y c #00023B",
"Z c #00207A",
"` c #002072",
" . c #00236B",
".. c #001556",
"+. c #001B5E",
"@. c #003D81",
"#. c #01599E",
"$. c #04559E",
"%. c #0761A6",
"&. c #085499",
"*. c #061958",
"=. c #020843",
"-. c #000137",
";. c #001C79",
">. c #00155D",
",. c #000945",
"'. c #000B49",
"). c #000E4C",
"!. c #002367",
"~. c #002A6F",
"{. c #003E8B",
"]. c #003787",
"^. c #00175C",
"/. c #000035",
"(. c #000030",
"_. c #000E67",
":. c #00043B",
"<. c #000339",
"[. c #00043C",
"}. c #00053E",
"|. c #00063F",
"1. c #000E4F",
"2. c #00247E",
"3. c #00166A",
"4. c #00002E",
"5. c #00014F",
"6. c #000029",
"7. c #00012F",
"8. c #000953",
"9. c #000E6E",
"0. c #000A6C",
"a. c #000563",
"b. c #00002F",
"c. c #00001D",
"d. c #000025",
"e. c #000040",
"f. c #000033",
" ",
" . + @ # $ ",
" % & * = - ; > , ",
" ' ) ! ~ { ] ^ / ( _ ",
" : < [ } | 1 2 3 4 5 6 7 ",
" 8 9 0 a b c d e f g h i ",
" j k l m n o p q r s t u v w ",
" x y z A B C D E F G H I J K ",
" L M N O P Q R S T U V W X Y ",
" Z ` ...+.@.#.$.%.&.*.=.-. ",
" ;.>.,.'.).!.~.{.].^./.(. ",
" _.:.<.[.}.|.1.2.3.4. ",
" 5.6.(.4.7.8.9.0.a. ",
" b.b.c.d.e.f. ",
" ",
" "};

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -83,7 +83,7 @@ endif
DIRS += build
ifneq (,$(BUILD_OFFICIAL)$(MOZILLA_OFFICIAL))
ifdef MOZILLA_OFFICIAL
DEFINES += -DOFFICIAL_BUILD=1
endif

View File

@ -2147,6 +2147,7 @@ MicrosummaryResource.prototype = {
this._iframe.docShell.allowMetaRedirects = false;
this._iframe.docShell.allowSubframes = false;
this._iframe.docShell.allowImages = false;
this._iframe.docShell.allowDNSPrefetch = false;
var parseHandler = {
_self: this,

View File

@ -55,7 +55,16 @@ var SidebarUtils = {
var x = { }, y = { }, w = { }, h = { };
tbo.getCoordsForCellItem(row.value, col.value, "image",
x, y, w, h);
mouseInGutter = aEvent.clientX < x.value;
// getCoordsForCellItem returns the x coordinate in logical coordinates
// (i.e., starting from the left and right sides in LTR and RTL modes,
// respectively.) Therefore, we make sure to exclude the blank area
// before the tree item icon (that is, to the left or right of it in
// LTR and RTL modes, respectively) from the click target area.
var isRTL = window.getComputedStyle(aTree, null).direction == "rtl";
if (isRTL)
mouseInGutter = aEvent.clientX > x.value;
else
mouseInGutter = aEvent.clientX < x.value;
}
#ifdef XP_MACOSX

View File

@ -760,7 +760,7 @@
orientation = Ci.nsITreeView.DROP_ON;
}
return this.view.canDrop(row.value, orientation);
return this.view.canDrop(row.value, orientation, aEvent.dataTransfer);
]]></body>
</method>
@ -769,8 +769,8 @@
<parameter name="aEvent"/>
<parameter name="aFlavour"/>
<parameter name="aDragSession"/>
<body><![CDATA[
if (!this.canDrop(aEvent, aDragSession))
<body><![CDATA[
if (!this.canDrop(aEvent, aDragSession, aEvent.dataTransfer))
aEvent.dataTransfer.effectAllowed = "none";
]]></body>
</method>

View File

@ -255,7 +255,7 @@ gTests.push({
tagsField.popup.selectedIndex = 0;
is(tree.view.selection.count, 1,
"We have selected a tag from the autocomplete popup");
dump("About to focus the autocomplete results tree\n");
info("About to focus the autocomplete results tree");
tree.focus();
EventUtils.synthesizeKey("VK_RETURN", {}, self.window);
break;
@ -269,7 +269,7 @@ gTests.push({
tagsField.popup.addEventListener("popuphidden", popupListener, true);
// Open tags autocomplete popup.
dump("About to focus the tagsField\n");
info("About to focus the tagsField");
tagsField.focus();
tagsField.value = "";
EventUtils.synthesizeKey("t", {}, this.window);
@ -327,7 +327,7 @@ gTests.push({
}, false);
namePicker.value = "n";
userEnteredName.label = "n";
dump("About to focus the namePicker field\n");
info("About to focus the namePicker field");
namePicker.focus();
EventUtils.synthesizeKey("VK_RETURN", {}, this.window);
},
@ -413,7 +413,7 @@ gTests.push({
tagsField.popup.selectedIndex = 0;
is(tree.view.selection.count, 1,
"We have selected a tag from the autocomplete popup");
dump("About to focus the autocomplete results tree\n");
info("About to focus the autocomplete results tree");
tree.focus();
EventUtils.synthesizeKey("VK_ESCAPE", {}, self.window);
break;
@ -427,7 +427,7 @@ gTests.push({
tagsField.popup.addEventListener("popuphidden", popupListener, true);
// Open tags autocomplete popup.
dump("About to focus the tagsField\n");
info("About to focus the tagsField");
tagsField.focus();
tagsField.value = "";
EventUtils.synthesizeKey("t", {}, this.window);
@ -529,7 +529,6 @@ gTests.push({
//------------------------------------------------------------------------------
function test() {
dump("Starting test browser_bookmarksProperties.js\n");
waitForExplicitFinish();
// Sanity checks.
ok(PlacesUtils, "PlacesUtils in context");
@ -543,14 +542,13 @@ function runNextTest() {
// Cleanup from previous test.
if (gCurrentTest) {
gCurrentTest.cleanup();
ok(true, "*** FINISHED TEST ***");
info("End of test: " + gCurrentTest.desc);
}
if (gTests.length > 0) {
// Goto next tests.
gCurrentTest = gTests.shift();
ok(true, "*** TEST: " + gCurrentTest.desc);
dump("*** TEST: " + gCurrentTest.desc + "\n");
info("Start of test: " + gCurrentTest.desc);
gCurrentTest.setup();
execute_test_in_sidebar();
}
@ -599,8 +597,8 @@ function open_properties_dialog() {
if (aTopic === "domwindowopened") {
ww.unregisterNotification(this);
var win = aSubject.QueryInterface(Ci.nsIDOMWindow);
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
win.addEventListener("focus", function(event) {
win.removeEventListener("focus", arguments.callee, false);
// Windows has been loaded, execute our test now.
executeSoon(function () {
// Ensure overlay is loaded

View File

@ -239,8 +239,7 @@ var gTests = [
function nextTest() {
if (gTests.length) {
var test = gTests.shift();
dump("TEST: " + test.desc + "\n");
ok(true, "TEST: " + test.desc);
info("Start of test: " + test.desc);
test.run();
setTimeout(nextTest, 0);

View File

@ -162,8 +162,7 @@ gTests.push({
function nextTest() {
if (gTests.length) {
var test = gTests.shift();
ok(true, "TEST: " + test.desc);
dump("TEST: " + test.desc + "\n");
info("Start of test: " + test.desc);
test.run();
}
else {
@ -194,7 +193,6 @@ var windowObserver = {
};
function test() {
dump("Starting test browser_library_left_pane_commands.js\n");
waitForExplicitFinish();
// Sanity checks.
ok(PlacesUtils, "PlacesUtils is running in chrome context");

View File

@ -254,7 +254,6 @@ gTests.push({
function test() {
waitForExplicitFinish();
dump("Starting test browser_library_middleclick.js\n");
// Sanity checks.
ok(PlacesUtils, "PlacesUtils in context");
@ -301,8 +300,7 @@ function runNextTest() {
if (gTests.length > 0) {
// Goto next test.
gCurrentTest = gTests.shift();
ok(true, "*** TEST: " + gCurrentTest.desc);
dump("*** TEST: " + gCurrentTest.desc + "\n");
info("Start of test: " + gCurrentTest.desc);
// Test setup will set Library so that the bookmark to be opened is the
// first node in the content (right pane) tree.
gCurrentTest.setup();

View File

@ -43,7 +43,6 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
function test() {
dump("Starting test browser_views_liveupdate.js\n");
waitForExplicitFinish();
// Sanity checks.

View File

@ -330,3 +330,13 @@ function dump_table(aName)
stmt.finalize();
stmt = null;
}
/**
* Flushes any events in the event loop of the main thread.
*/
function flush_main_thread_events()
{
let tm = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
while (tm.mainThread.hasPendingEvents())
tm.mainThread.processNextEvent(false);
}

View File

@ -41,9 +41,7 @@
// event loop long before code like this would run.
// Not doing so could cause us to close the connection before all tasks have
// been completed, and that would crash badly.
let tm = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
while (tm.mainThread.hasPendingEvents())
tm.mainThread.processNextEvent(false);
flush_main_thread_events();
// XPCShell doesn't dispatch quit-application, to ensure cleanup we have to
// dispatch it after each test run.
@ -52,6 +50,9 @@ var os = Cc['@mozilla.org/observer-service;1'].
os.notifyObservers(null, "quit-application-granted", null);
os.notifyObservers(null, "quit-application", null);
// Run the event loop, since we enqueue some statement finalization.
flush_main_thread_events();
// try to close the connection so we can remove places.sqlite
var pip = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService).

View File

@ -298,18 +298,6 @@ PrivateBrowsingService.prototype = {
getService(Ci.nsIHttpAuthManager);
authMgr.clearAll();
// Prevent any SSL sockets from remaining open. Without this, SSL
// websites may fail to load after switching the private browsing mode
// because the SSL sockets may still be open while the corresponding
// NSS resources have been destroyed by the logoutAndTeardown call
// above. See bug 463256 for more information.
let ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
if (!ios.offline) {
ios.offline = true;
ios.offline = false;
}
if (!this._inPrivateBrowsing) {
// Clear the error console
let consoleService = Cc["@mozilla.org/consoleservice;1"].

View File

@ -59,9 +59,8 @@ _BROWSER_TEST_FILES = \
browser_privatebrowsing_urlbarfocus.js \
browser_privatebrowsing_forgetthissite.js \
browser_privatebrowsing_pageinfo.js \
browser_privatebrowsing_sslsite_transition.js \
$(NULL)
# Test for bug 463256 disabled until we figure why it fails intermittently (bug 486640)
# browser_privatebrowsing_sslsite_transition.js \
libs:: $(_BROWSER_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)

View File

@ -36,9 +36,7 @@
* ***** END LICENSE BLOCK ***** */
// This test makes sure that SSL sites load correctly after leaving the
// Private Browsing mode (bug 463256).
// This test is disabled until we figure why it fails intermittently (bug 486640).
// Private Browsing mode (bug 463256 and bug 496335).
function test() {
// initialization
@ -78,3 +76,5 @@ function test() {
}, true);
browser.contentWindow.location = kTestURL;
waitForExplicitFinish();
}

View File

@ -35,8 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
// This tests the private browsing service to make sure it switches the offline
// status as expected (see bug 463256).
// This tests the private browsing service to make sure it no longer switches
// the offline status (see bug 463256).
function run_test_on_service() {
// initialization
@ -59,15 +59,11 @@ function run_test_on_service() {
// enter the private browsing mode, and wait for the about:pb page to load
pb.privateBrowsingEnabled = true;
do_check_eq(observer.events.length, 2);
do_check_eq(observer.events[0], "offline");
do_check_eq(observer.events[1], "online");
do_check_eq(observer.events.length, 0);
// leave the private browsing mode, and wait for the SSL page to load again
pb.privateBrowsingEnabled = false;
do_check_eq(observer.events.length, 4);
do_check_eq(observer.events[2], "offline");
do_check_eq(observer.events[3], "online");
do_check_eq(observer.events.length, 0);
os.removeObserver(observer, "network:offline-status-changed", false);
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");

View File

@ -49,7 +49,7 @@ ifdef ENABLE_TESTS
DIRS += content/test
endif
ifneq (,$(BUILD_OFFICIAL)$(MOZILLA_OFFICIAL))
ifdef MOZILLA_OFFICIAL
DEFINES += -DOFFICIAL_BUILD=1
endif

View File

@ -1507,17 +1507,12 @@ SessionStoreService.prototype = {
_updateCookieHosts: function sss_updateCookieHosts(aWindow) {
var hosts = this._windows[aWindow.__SSi]._hosts = {};
// get all possible subdomain levels for a given URL
var _this = this;
// get the domain for each URL
function extractHosts(aEntry) {
if (/^https?:\/\/(?:[^@\/\s]+@)?([\w.-]+)/.test(aEntry.url) &&
!hosts[RegExp.$1] && _this._checkPrivacyLevel(_this._getURIFromString(aEntry.url).schemeIs("https"))) {
var host = RegExp.$1;
var ix;
for (ix = host.indexOf(".") + 1; ix; ix = host.indexOf(".", ix) + 1) {
hosts[host.substr(ix)] = true;
if (/^https?:\/\/(?:[^@\/\s]+@)?([\w.-]+)/.test(aEntry.url)) {
if (!hosts[RegExp.$1] && _this._checkPrivacyLevel(_this._getURIFromString(aEntry.url).schemeIs("https"))) {
hosts[RegExp.$1] = true;
}
hosts[host] = true;
}
else if (/^file:\/\/([^\/]*)/.test(aEntry.url)) {
hosts[RegExp.$1] = true;
@ -1526,7 +1521,8 @@ SessionStoreService.prototype = {
aEntry.children.forEach(extractHosts);
}
}
var _this = this;
this._windows[aWindow.__SSi].tabs.forEach(function(aTabData) { aTabData.entries.forEach(extractHosts); });
},
@ -1536,36 +1532,60 @@ SessionStoreService.prototype = {
* array of Window references
*/
_updateCookies: function sss_updateCookies(aWindows) {
var cookiesEnum = Cc["@mozilla.org/cookiemanager;1"].
getService(Ci.nsICookieManager).enumerator;
function addCookieToHash(aHash, aHost, aPath, aName, aCookie) {
// lazily build up a 3-dimensional hash, with
// aHost, aPath, and aName as keys
if (!aHash[aHost])
aHash[aHost] = {};
if (!aHash[aHost][aPath])
aHash[aHost][aPath] = {};
if (!aHash[aHost][aPath][aName])
aHash[aHost][aPath][aName] = {};
aHash[aHost][aPath][aName] = aCookie;
}
var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
// collect the cookies per window
for (var i = 0; i < aWindows.length; i++)
aWindows[i].cookies = [];
var jscookies = {};
var _this = this;
// MAX_EXPIRY should be 2^63-1, but JavaScript can't handle that precision
var MAX_EXPIRY = Math.pow(2, 62);
while (cookiesEnum.hasMoreElements()) {
var cookie = cookiesEnum.getNext().QueryInterface(Ci.nsICookie2);
if (cookie.isSession && this._checkPrivacyLevel(cookie.isSecure)) {
var jscookie = null;
aWindows.forEach(function(aWindow) {
if (aWindow._hosts && aWindow._hosts[cookie.rawHost]) {
// serialize the cookie when it's first needed
if (!jscookie) {
jscookie = { host: cookie.host, value: cookie.value };
aWindows.forEach(function(aWindow) {
for (var host in aWindow._hosts) {
var list = cm.getCookiesFromHost(host);
while (list.hasMoreElements()) {
var cookie = list.getNext().QueryInterface(Ci.nsICookie2);
if (cookie.isSession && _this._checkPrivacyLevel(cookie.isSecure)) {
// use the cookie's host, path, and name as keys into a hash,
// to make sure we serialize each cookie only once
var isInHash = false;
try {
if (jscookies[cookie.host][cookie.path][cookie.name])
isInHash = true;
} catch (e) {
// not in hash yet
}
if (!isInHash) {
var jscookie = { "host": cookie.host, "value": cookie.value };
// only add attributes with non-default values (saving a few bits)
if (cookie.path) jscookie.path = cookie.path;
if (cookie.name) jscookie.name = cookie.name;
if (cookie.isSecure) jscookie.secure = true;
if (cookie.isHttpOnly) jscookie.httponly = true;
if (cookie.expiry < MAX_EXPIRY) jscookie.expiry = cookie.expiry;
addCookieToHash(jscookies, cookie.host, cookie.path, cookie.name, jscookie);
}
aWindow.cookies.push(jscookie);
aWindow.cookies.push(jscookies[cookie.host][cookie.path][cookie.name]);
}
});
}
}
}
});
// don't include empty cookie sections
for (i = 0; i < aWindows.length; i++)
if (aWindows[i].cookies.length == 0)
@ -1889,9 +1909,8 @@ SessionStoreService.prototype = {
if (aTabs.length > 0) {
// Determine if we can optimize & load visible tabs first
let tabScrollBoxObject = tabbrowser.tabContainer.mTabstrip.scrollBoxObject;
let tabBoxObject = aTabs[0].boxObject;
let maxVisibleTabs = Math.ceil(tabScrollBoxObject.width / tabBoxObject.width);
let maxVisibleTabs = Math.ceil(tabbrowser.tabContainer.mTabstrip.scrollClientSize /
aTabs[0].clientWidth);
// make sure we restore visible tabs first, if there are enough
if (maxVisibleTabs < aTabs.length && aSelectTab > 1) {
@ -2582,6 +2601,7 @@ SessionStoreService.prototype = {
_getWindowDimension: function sss_getWindowDimension(aWindow, aAttribute) {
if (aAttribute == "sizemode") {
switch (aWindow.windowState) {
case aWindow.STATE_FULLSCREEN:
case aWindow.STATE_MAXIMIZED:
return "maximized";
case aWindow.STATE_MINIMIZED:

View File

@ -64,6 +64,8 @@ _BROWSER_TEST_FILES = \
browser_394759_privatebrowsing.js \
browser_408470.js \
browser_408470_sample.html \
browser_423132.js \
browser_423132_sample.html \
browser_447951.js \
browser_447951_sample.html \
browser_448741.js \

View File

@ -0,0 +1,107 @@
/* ***** 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 sessionstore test code.
*
* The Initial Developer of the Original Code is
* Daniel Witte <dwitte@mozilla.com>.
* Portions created by the Initial Developer are Copyright (C) 2009
* 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 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 ***** */
function test() {
// test that cookies are stored and restored correctly by sessionstore,
// bug 423132.
// test setup
waitForExplicitFinish();
let cs = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
cs.removeAll();
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
// make sure that sessionstore.js can be forced to be created by setting
// the interval pref to 0
gPrefService.setIntPref("browser.sessionstore.interval", 0);
const testURL = "http://localhost:8888/browser/" +
"browser/components/sessionstore/test/browser/browser_423132_sample.html";
// open a new window
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", "about:blank");
// make sure sessionstore saves the cookie data, then close the window
newWin.addEventListener("load", function (aEvent) {
newWin.removeEventListener("load", arguments.callee, false);
newWin.gBrowser.selectedBrowser.loadURI(testURL, null, null);
newWin.gBrowser.addEventListener("load", function (aEvent) {
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
// get the sessionstore state for the window
let state = ss.getWindowState(newWin);
// verify our cookie got set during pageload
let e = cs.enumerator;
let cookie;
let i = 0;
while (e.hasMoreElements()) {
cookie = e.getNext().QueryInterface(Ci.nsICookie);
i++;
}
is(i, 1, "expected one cookie");
// remove the cookie
cs.removeAll();
// restore the window state
ss.setWindowState(newWin, state, true);
// at this point, the cookie should be restored...
e = cs.enumerator;
let cookie2;
while (e.hasMoreElements()) {
cookie2 = e.getNext().QueryInterface(Ci.nsICookie);
if (cookie.name == cookie2.name)
break;
}
is(cookie.name, cookie2.name, "cookie name successfully restored");
is(cookie.value, cookie2.value, "cookie value successfully restored");
is(cookie.path, cookie2.path, "cookie path successfully restored");
// clean up
gPrefService.clearUserPref("browser.sessionstore.interval");
cs.removeAll();
newWin.close();
finish();
}, true);
}, false);
}

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
// generate an enormous random number...
var r = Math.floor(Math.random() * Math.pow(2, 62)).toString();
// ... and use it to set a randomly named cookie
document.cookie = r + "=value; path=/ohai";
</script>
<body>
</body>
</html>

View File

@ -86,7 +86,11 @@
#define REG_FAILED(val) \
(val != ERROR_SUCCESS)
#ifndef WINCE
NS_IMPL_ISUPPORTS2(nsWindowsShellService, nsIWindowsShellService, nsIShellService)
#else
NS_IMPL_ISUPPORTS1(nsWindowsShellService, nsIShellService)
#endif
static nsresult
OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
@ -106,6 +110,33 @@ OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
return NS_OK;
}
#ifdef WINCE
static nsresult
OpenKeyForWriting(HKEY aStartKey, const nsAString& aKeyName, HKEY* aKey)
{
const nsString &flatName = PromiseFlatString(aKeyName);
DWORD dwDisp = 0;
DWORD res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL,
0, KEY_READ | KEY_WRITE, NULL, aKey,
&dwDisp);
switch (res) {
case ERROR_SUCCESS:
break;
case ERROR_ACCESS_DENIED:
return NS_ERROR_FILE_ACCESS_DENIED;
case ERROR_FILE_NOT_FOUND:
res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL,
0, KEY_READ | KEY_WRITE, NULL, aKey,
NULL);
if (res != ERROR_SUCCESS)
return NS_ERROR_FILE_ACCESS_DENIED;
}
return NS_OK;
}
#endif
///////////////////////////////////////////////////////////////////////////////
// Default Browser Registry Settings
//
@ -181,30 +212,52 @@ typedef struct {
char* valueData;
} SETTING;
#ifndef WINCE
#define APP_REG_NAME L"Firefox"
#define CLS_HTML "FirefoxHTML"
#define CLS_URL "FirefoxURL"
#define VAL_OPEN "\"%APPPATH%\" -requestPending -osint -url \"%1\""
#define VAL_FILE_ICON "%APPPATH%,1"
#else
#define VAL_OPEN "\"%APPPATH%\" -osint -url \"%1\""
#define VAL_FILE_ICON "%APPPATH%,-2"
#endif
#define DI "\\DefaultIcon"
#define SOP "\\shell\\open\\command"
#define CLS_HTML "FirefoxHTML"
#define CLS_URL "FirefoxURL"
#define VAL_FILE_ICON "%APPPATH%,1"
#define VAL_OPEN "\"%APPPATH%\" -requestPending -osint -url \"%1\""
#define MAKE_KEY_NAME1(PREFIX, MID) \
PREFIX MID
// The DefaultIcon registry key value should never be used when checking if
// Firefox is the default browser since other applications (e.g. MS Office) may
// modify the DefaultIcon registry key value to add Icon Handlers.
// see http://msdn2.microsoft.com/en-us/library/aa969357.aspx for more info.
// Firefox is the default browser for file handlers since other applications
// (e.g. MS Office) may modify the DefaultIcon registry key value to add Icon
// Handlers. see http://msdn2.microsoft.com/en-us/library/aa969357.aspx for
// more info.
static SETTING gSettings[] = {
// File Extension Class - as of 1.8.1.2 the value for VAL_OPEN is also checked
// for CLS_HTML since Firefox should also own opeing local files when set as
// the default browser.
#ifndef WINCE
// File Handler Class
{ MAKE_KEY_NAME1(CLS_HTML, SOP), "", VAL_OPEN },
// Protocol Handler Class - for Vista and above
{ MAKE_KEY_NAME1(CLS_URL, SOP), "", VAL_OPEN },
#else
{ MAKE_KEY_NAME1("FTP", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("FTP", SOP), "", VAL_OPEN },
// File handlers for Windows CE
{ MAKE_KEY_NAME1("bmpfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("bmpfile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("giffile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("giffile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("jpegfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("jpegfile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("pngfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("pngfile", SOP), "", VAL_OPEN },
{ MAKE_KEY_NAME1("htmlfile", DI), "", VAL_FILE_ICON },
{ MAKE_KEY_NAME1("htmlfile", SOP), "", VAL_OPEN },
#endif
// Protocol Handlers
{ MAKE_KEY_NAME1("HTTP", DI), "", VAL_FILE_ICON },
@ -213,6 +266,7 @@ static SETTING gSettings[] = {
{ MAKE_KEY_NAME1("HTTPS", SOP), "", VAL_OPEN }
};
#ifndef WINCE
PRBool
nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
{
@ -236,6 +290,7 @@ nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
#endif
return PR_FALSE;
}
#endif
NS_IMETHODIMP
nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
@ -295,10 +350,12 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
}
}
#ifndef WINCE
// Only check if Firefox is the default browser on Vista if the previous
// checks show that Firefox is the default browser.
if (*aIsDefaultBrowser)
IsDefaultBrowserVista(aIsDefaultBrowser);
#endif
return NS_OK;
}
@ -306,6 +363,7 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
NS_IMETHODIMP
nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUsers)
{
#ifndef WINCE
nsresult rv;
nsCOMPtr<nsIProperties> directoryService =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
@ -342,10 +400,91 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
#else
SETTING* settings;
SETTING* end = gSettings + sizeof(gSettings)/sizeof(SETTING);
PRUnichar exePath[MAX_BUF];
if (!::GetModuleFileNameW(0, exePath, MAX_BUF))
return NS_ERROR_FAILURE;
nsAutoString appLongPath(exePath);
// The .png registry key isn't present by default so also add Content Type.
SetRegKey(NS_LITERAL_STRING(".png"), EmptyString(),
NS_LITERAL_STRING("pngfile"));
SetRegKey(NS_LITERAL_STRING(".png"), NS_LITERAL_STRING("Content Type"),
NS_LITERAL_STRING("image/png"));
// Set these keys to their default value for a clean install in case another
// app has changed these keys.
SetRegKey(NS_LITERAL_STRING(".htm"), EmptyString(),
NS_LITERAL_STRING("htmlfile"));
SetRegKey(NS_LITERAL_STRING(".html"), EmptyString(),
NS_LITERAL_STRING("htmlfile"));
SetRegKey(NS_LITERAL_STRING(".bmp"), EmptyString(),
NS_LITERAL_STRING("bmpfile"));
SetRegKey(NS_LITERAL_STRING(".gif"), EmptyString(),
NS_LITERAL_STRING("giffile"));
SetRegKey(NS_LITERAL_STRING(".jpe"), EmptyString(),
NS_LITERAL_STRING("jpegfile"));
SetRegKey(NS_LITERAL_STRING(".jpg"), EmptyString(),
NS_LITERAL_STRING("jpegfile"));
SetRegKey(NS_LITERAL_STRING(".jpeg"), EmptyString(),
NS_LITERAL_STRING("jpegfile"));
for (settings = gSettings; settings < end; ++settings) {
NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData);
NS_ConvertUTF8toUTF16 key(settings->keyName);
NS_ConvertUTF8toUTF16 value(settings->valueName);
PRInt32 offset = dataLongPath.Find("%APPPATH%");
dataLongPath.Replace(offset, 9, appLongPath);
SetRegKey(key, value, dataLongPath);
}
// On Windows CE RegFlushKey can negatively impact performance if there are a
// lot of pending writes to the HKEY_CLASSES_ROOT registry hive but it is
// necessary to save the values in the case where the user performs a hard
// power off of the device.
::RegFlushKey(HKEY_CLASSES_ROOT);
#endif
return NS_OK;
}
#ifdef WINCE
void
nsWindowsShellService::SetRegKey(const nsString& aKeyName,
const nsString& aValueName,
const nsString& aValue)
{
PRUnichar buf[MAX_BUF];
DWORD len = sizeof buf;
HKEY theKey;
nsresult rv = OpenKeyForWriting(HKEY_CLASSES_ROOT, aKeyName, &theKey);
if (NS_FAILED(rv))
return;
// Get the current value.
DWORD res = ::RegQueryValueExW(theKey, PromiseFlatString(aValueName).get(),
NULL, NULL, (LPBYTE)buf, &len);
// Set the new value if it doesn't exist or it is different than the current
// value.
nsAutoString current(buf);
if (REG_FAILED(res) || !current.Equals(aValue)) {
const nsString &flatValue = PromiseFlatString(aValue);
::RegSetValueExW(theKey, PromiseFlatString(aValueName).get(),
0, REG_SZ, (const BYTE *)flatValue.get(),
(flatValue.Length() + 1) * sizeof(PRUnichar));
}
// Close the key we opened.
::RegCloseKey(theKey);
}
#endif
NS_IMETHODIMP
nsWindowsShellService::GetShouldCheckDefaultBrowser(PRBool* aResult)
{
@ -715,6 +854,7 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
return NS_OK;
}
#ifndef WINCE
NS_IMETHODIMP
nsWindowsShellService::GetUnreadMailCount(PRUint32* aCount)
{
@ -774,6 +914,7 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
::RegCloseKey(mailKey);
return PR_FALSE;
}
#endif
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,

View File

@ -46,7 +46,11 @@
#include <windows.h>
#include <ole2.h>
#ifndef WINCE
class nsWindowsShellService : public nsIWindowsShellService
#else
class nsWindowsShellService : public nsIShellService
#endif
{
public:
nsWindowsShellService() : mCheckedThisSession(PR_FALSE) {};
@ -54,12 +58,20 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
#ifndef WINCE
NS_DECL_NSIWINDOWSSHELLSERVICE
#endif
protected:
#ifndef WINCE
PRBool IsDefaultBrowserVista(PRBool* aIsDefaultBrowser);
PRBool GetMailAccountKey(HKEY* aResult);
#else
void SetRegKey(const nsString& aKeyName,
const nsString& aValueName,
const nsString& aValue);
#endif
private:
PRBool mCheckedThisSession;

View File

@ -645,3 +645,4 @@ mozcrt19.dll
xpicleanup@BIN_SUFFIX@
chrome.manifest
install.rdf
@DLL_PREFIX@jsj@DLL_SUFFIX@

View File

@ -1109,11 +1109,6 @@ statusbarpanel#statusbar-display {
-moz-padding-start: 0;
}
#security-button {
min-width: 20px;
-moz-box-direction: reverse;
}
#security-button[level="high"],
#security-button[level="low"] {
list-style-image: url("chrome://browser/skin/Secure.png");
@ -1123,11 +1118,6 @@ statusbarpanel#statusbar-display {
list-style-image: url("chrome://browser/skin/Security-broken.png");
}
/* XXXsw prevent margins of a value-less label from shifting the image */
#security-button > label:not([value]) {
display: none;
}
#page-report-button {
list-style-image: url("chrome://browser/skin/Info.png");
width: 20px;
@ -1311,6 +1301,28 @@ tabpanels {
margin: 2px 0 1px;
}
.tabs-alltabs-button[type="menu"] > .toolbarbutton-menu-dropmarker {
margin-bottom: -2px;
}
.tabs-alltabs-button[type="menu"] > .toolbarbutton-icon {
display: none;
}
/* All tabs menupopup */
.alltabs-item > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/icons/folder-item.png");
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
.alltabs-item[selected="true"] {
font-weight: bold;
}
.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
}
/* Sidebar */
#sidebar-box .tabs-closebutton {
margin-bottom: 0px !important;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 192 B

View File

@ -1406,10 +1406,6 @@ sidebarheader > .tabs-closebutton > .toolbarbutton-text {
/* ----- SECURITY DISPLAY ----- */
#security-button {
-moz-box-direction: reverse;
}
#security-button[level="high"] ,
#security-button[level="low"] {
list-style-image: url("chrome://browser/skin/Secure-statusbar.png");
@ -1733,6 +1729,7 @@ tabbrowser > tabbox > tabpanels {
.tabs-alltabs-button:hover {
-moz-image-region: rect(0, 44px, 20px, 22px);
}
.tabs-alltabs-button[type="menu"][open="true"],
.tabs-alltabs-button:hover:active {
-moz-image-region: rect(0, 66px, 20px, 44px);
}
@ -1745,6 +1742,7 @@ tabbrowser > tabbox > tabpanels {
background-color: rgba(0,0,0,0.20);
}
.tabs-alltabs-button[type="menu"] > .toolbarbutton-menu-dropmarker,
.tabs-alltabs-button > .toolbarbutton-text {
display: none;
}
@ -1761,6 +1759,20 @@ tabbrowser > tabbox > tabpanels {
opacity: 0.0;
}
/* All Tabs Menupopup */
.alltabs-item > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/tree/item.png");
}
.alltabs-item[selected="true"] {
font-weight: bold;
}
.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
}
/* Tabstrip close button */
.tabs-closebutton {
-moz-padding-end: 4px;
list-style-image: url("chrome://global/skin/icons/closetab.png");

View File

@ -1286,11 +1286,6 @@ statusbarpanel#statusbar-display {
border-top: none;
}
#security-button {
min-width: 20px;
-moz-box-direction: reverse;
}
#security-button[level="high"],
#security-button[level="low"] {
list-style-image: url("chrome://browser/skin/Secure.png");
@ -1300,11 +1295,6 @@ statusbarpanel#statusbar-display {
list-style-image: url("chrome://browser/skin/Security-broken.png");
}
/* XXXsw prevent margins of a value-less label from shifting the image */
#security-button > label:not([value]) {
display: none;
}
#page-report-button {
width: 20px;
list-style-image: url("chrome://browser/skin/Info.png");
@ -1571,8 +1561,26 @@ tabpanels {
.tabs-alltabs-button > .toolbarbutton-icon {
list-style-image: url("chrome://browser/skin/tabbrowser/alltabs.png");
margin: 6px 0 4px;
-moz-image-region: auto;
-moz-image-region: rect(0, 14px, 20px, 0);
}
.tabs-alltabs-button:hover:active > .toolbarbutton-icon {
-moz-image-region: rect(0, 28px, 20px, 14px);
}
.tabs-alltabs-button[type="menu"] > .toolbarbutton-icon {
list-style-image: url("chrome://browser/skin/mainwindow-dropdown-arrow.png");
margin: 5px 0 4px;
-moz-image-region: rect(0, 13px, 11px, 0);
}
.tabs-alltabs-button[type="menu"] > .toolbarbutton-menu-dropmarker {
display: none;
}
.tabs-alltabs-button[type="menu"]:hover:active > .toolbarbutton-icon,
.tabs-alltabs-button[type="menu"][open="true"] > .toolbarbutton-icon {
-moz-image-region: rect(0, 26px, 11px, 13px);
}
.tabs-alltabs-box-animate {
@ -1588,6 +1596,20 @@ stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
background-image: url("chrome://browser/skin/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png");
}
/* All tabs menupopup */
.alltabs-item > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/icons/folder-item.png");
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
.alltabs-item[selected="true"] {
font-weight: bold;
}
.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
}
/* Tabstrip close button */
.tabs-closebutton {
-moz-appearance: none;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 719 B

View File

@ -24,7 +24,7 @@ endif
_PROFILE_DIR = $(TARGET_DEPTH)/_profile/pgo
_SYMBOLS_PATH = $(TARGET_DIST)/crashreporter-symbols
ABSOLUTE_TOPSRCDIR = $(call core_abspath,$(topsrcdir))
ABSOLUTE_TOPSRCDIR = $(call core_abspath,$(MOZILLA_DIR))
_CERTS_SRC_DIR = $(ABSOLUTE_TOPSRCDIR)/build/pgo/certs
AUTOMATION_PPARGS = \
@ -65,10 +65,10 @@ AUTOMATION_PPARGS += -DIS_DEBUG_BUILD=0
endif
$(CURDIR)/automationutils.py:
$(INSTALL) $(topsrcdir)/build/automationutils.py .
$(INSTALL) $(MOZILLA_DIR)/build/automationutils.py .
automation.py: $(topsrcdir)/build/automation.py.in $(topsrcdir)/build/automation-build.mk $(CURDIR)/automationutils.py
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
automation.py: $(MOZILLA_DIR)/build/automation.py.in $(MOZILLA_DIR)/build/automation-build.mk $(CURDIR)/automationutils.py
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
GARBAGE += automation.py $(CURDIR)/automationutils.py

View File

@ -0,0 +1,88 @@
#!/bin/bash
# ***** 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 the installdmg.sh script from taols utilities
#
# The Initial Developer of the Original Code is
# Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris AtLee <catlee@mozilla.com>
# Robert Kaiser <kairo@kairo.at>
#
# 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 *****
# Unpack a disk image to a specified target folder
#
# Usage: unpack-diskimage <image_file>
# <mountpoint>
# <target_path>
DMG_PATH=$1
MOUNTPOINT=$2
TARGETPATH=$3
# How long to wait before giving up waiting for the mount to finish (seconds)
TIMEOUT=90
# If mnt already exists, then the previous run may not have cleaned up
# properly. We should try to umount and remove the mnt directory.
if [ -d $MOUNTPOINT ]; then
echo "mnt already exists, trying to clean up"
hdiutil detach $MOUNTPOINT -force
rm -rdfv $MOUNTPOINT
fi
# Install an on-exit handler that will unmount and remove the '$MOUNTPOINT' directory
trap "{ if [ -d $MOUNTPOINT ]; then hdiutil detach $MOUNTPOINT -force; rm -rdfv $MOUNTPOINT; fi; }" EXIT
mkdir -p $MOUNTPOINT
hdiutil attach -verbose -noautoopen -mountpoint $MOUNTPOINT "$DMG_PATH"
# Wait for files to show up
# hdiutil uses a helper process, diskimages-helper, which isn't always done its
# work by the time hdiutil exits. So we wait until something shows up in the
# mnt directory. Due to the async nature of diskimages-helper, the best thing
# we can do is to make sure the glob() rsync is making can find files.
i=0
while [ "$(echo $MOUNTPOINT/*)" == "$MOUNTPOINT/*" ]; do
if [ $i -gt $TIMEOUT ]; then
echo "No files found, exiting"
exit 1
fi
sleep 1
i=$(expr $i + 1)
done
# Now we can copy everything out of the $MOUNTPOINT directory into the target directory
rsync -av $MOUNTPOINT/* $MOUNTPOINT/.DS_Store $MOUNTPOINT/.background $MOUNTPOINT/.VolumeIcon.icns $TARGETPATH/.
hdiutil detach $MOUNTPOINT
rm -rdf $MOUNTPOINT
# diskimage-helper prints messages to stdout asynchronously as well, sleep
# for a bit to ensure they don't disturb following commands in a script that
# might parse stdout messages
sleep 5

View File

@ -20,6 +20,7 @@
#
# Contributor(s):
# John Wolfe <wolfe@lobo.us>
# Vladimir Vukicevic <vladimir@pobox.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
@ -39,7 +40,8 @@
# make-wince-cab.py --- Given a directory, walk it and make an
# installer based upon the contents of that directory
#
# Usage: python make-wince-inf.py CABWIZ_PATH SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME
# Usage:
# python make-wince-inf.py [-s] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME
#
# Walk through the relative directory SOURCE_DIR, parsing filenames
# Checks for duplicate filenames and renames where needed
@ -57,15 +59,18 @@
# python make_wince_inf.py /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/SmartDevices/SDK/SDKTools/cabwiz.exe dist/fennec Fennec fennec-0.11.en-US.wince-arm.cab
#
# ARGS:
# cabiz_path - Path to CABWIZ.EXE executable inside Visual Studio
# -s - Don't pass /compress to cabwiz (generate CAB compatible with Windows CE)
#
# source_dir - sub-directory which contains the target program
# CABWIZ_PATH - If specified, will use this cabwiz.exe executable. Otherwise, will attempt
# to find one using $VSINSTALLDIR.
#
# SOURCE_DIR - sub-directory which contains the target program
# NOTE: It is assumed that the application name is SOURCE_DIR.exe
# EXAMPLE: source_dir=fennec, there should be a fennec/fennec.exe application
#
# program_name - Name of the program to place inside the INF file
# PROGRAM_NAME - Name of the program to place inside the INF file
#
# cab_final_name - actual final name for the produced CAB file
# CAB_FINAL_NAME - actual final name for the produced CAB file
#
# NOTE: In our example, "fennec" is the directory [source_name]
# "fennec.exe" is the application [$(source_name).exe], and
@ -80,6 +85,7 @@ import fnmatch
import string
import shutil
CompressFlag = "/compress"
class FileEntry:
def __init__(self, dirpath, dircount, filename, filecount, actual_filename):
@ -301,12 +307,12 @@ def output_inf_file(program_name, app_name):
def make_cab_file(cabwiz_path, program_name, cab_final_name):
make_cab_command = "\"%s\" %s.inf /compress" % (cabwiz_path, program_name)
make_cab_command = "\"%s\" %s %s.inf" % (cabwiz_path, CompressFlag, program_name)
print "INFORMATION: Executing command to make %s CAB file (only works on BASH)" % program_name
print " [%s]" % make_cab_command
sys.stdout.flush()
success = call([cabwiz_path, "%s.inf" % program_name, "/compress"],
success = call([cabwiz_path, "%s.inf" % program_name, CompressFlag],
stdout=open("NUL:","w"), stderr=STDOUT)
if not os.path.isfile("%s.CAB" % program_name):
@ -336,21 +342,35 @@ def purge_copied_files():
def main():
if len(sys.argv) != 5:
print >> sys.stderr, "Usage: %s CABWIZ_PATH SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % sys.argv[0]
print >> sys.stderr, "Example: %s /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/ fennec Fennec fennec-0.11.en-US.wince-arm.cab" % sys.argv[0]
args = sys.argv
if len(args) < 4 or len(args) > 6:
print >> sys.stderr, "Usage: %s [-s] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0]
print >> sys.stderr, "Example: %s /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/ fennec Fennec fennec-0.11.en-US.wince-arm.cab" % args[0]
sys.exit(1)
cabwiz_path = sys.argv[1]
source_dir = sys.argv[2]
program_name = sys.argv[3]
app_name = "%s.exe" % source_dir
cab_final_name = sys.argv[4]
args = args[1:]
if not os.path.isfile(cabwiz_path):
if args[0] == "-s":
global CompressFlag
CompressFlag = ""
args = args[1:]
cabwiz_path = None
if len(args) == 4:
cabwiz_path = args[0]
args = args[1:]
else:
if "VSINSTALLDIR" in os.environ:
cabwiz_path = os.path.join(os.environ["VSINSTALLDIR"], "SmartDevices", "SDK", "SDKTools", "cabwiz.exe")
source_dir = args[0]
program_name = args[1]
app_name = "%s.exe" % source_dir
cab_final_name = args[2]
if cabwiz_path is None or not os.path.isfile(cabwiz_path):
print """***************************************************************************
ERROR: CABWIZ_PATH is not a valid file!
Perhaps your VSINSTALLDIR is not properly set up?
ERROR: CABWIZ_PATH is not a valid file, or cabwiz couldn't be found!
EXITING...
***************************************************************************"""
sys.exit(2)

View File

@ -130,6 +130,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
unsigned short * _wgetcwd(unsigned short* dir, unsigned long size);
unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength );
int _unlink(const char *filename );
int _wchdir(const unsigned short* path);
/* The time stuff should be defined here, but it can't be because it
is already defined in time.h.

View File

@ -6,6 +6,7 @@ SetEnvironmentVariableW
_unlink
_wfullpath
_wgetcwd
_wchdir
abort
clock
errno

View File

@ -115,10 +115,21 @@ int errno = 0;
unsigned short * _wgetcwd(unsigned short * dir, unsigned long size)
{
if (!dir)
return 0;
unsigned short tmp[MAX_PATH] = {0};
GetEnvironmentVariableW(L"CWD", tmp, size);
if (tmp && tmp[0]) {
if (wcslen(tmp) > size)
return 0;
wcscpy(dir, tmp);
return dir;
}
unsigned long i;
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH);
for (i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {}
dir[i + 1] = TCHAR('\0');
SetEnvironmentVariableW(L"CWD", dir);
return dir;
}
@ -150,6 +161,10 @@ unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPa
return NULL;
}
int _wchdir(const WCHAR* path) {
return SetEnvironmentVariableW(L"CWD", path);
}
int _unlink(const char *filename)
{
unsigned short wname[MAX_PATH];

View File

@ -72,6 +72,7 @@ endif
CFLAGS += \
-DVC_PATH='"$(subst \,\\,$(VCINSTALLDIR))\\"' \
-DWM_SDK_PATH='"$(subst \,\\,$(WINCE_SDK_DIR))\\"' \
-DOGLES_SDK_PATH='"$(subst \,\\,$(OGLES_SDK_DIR))\\"' \
-DMOZCE_DEVENV='"$(MOZCE_DEVENV)"' \
-DTOPSRCDIR='"$(TOPSRCDIR)"' \
$(NULL)

View File

@ -25,6 +25,7 @@ main(int argc, char **argv)
#ifdef MOZ_MEMORY
args[i++] = "/DMOZ_MEMORY";
#endif
args[i++] = "/I\"" ATL_INC "\"";
args[i++] = "/DMOZCE_STATIC_BUILD";
args[i++] = "/DUNICODE";
args[i++] = "/D_UNICODE_";
@ -38,6 +39,7 @@ main(int argc, char **argv)
// args[i++] = "/DPOCKETPC2003_UI_MODEL";
args[i++] = "/D_WINDOWS";
args[i++] = "/DNO_ERRNO";
args[i++] = "/D_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA";
args[i++] = "/GS-"; // disable security checks
args[i++] = "/GR-"; // disable C++ RTTI

View File

@ -11,11 +11,11 @@ main(int argc, char **argv)
int s = 0;
args[i++] = RC_PATH;
args[i++] = "/I\"" WCE_RC_INC "\"";
args[i++] = "/I\"" WM_SDK_INC "\"";
args[i++] = "/I\"" WM_SDK_INC "\"";
argpath_conv(&argv[1], &args[i]);
// dumpargs(args);
//dumpargs(args);
return run(args);
}

View File

@ -23,8 +23,19 @@ void checkLinkArgs(int* k, int* s, int* i, int* j, char** args, char** argv) {
void addLinkArgs(int k, int s, int *i, int *j, char** args, char** argv) {
args[(*i)++] = "/LIBPATH:\"" WCE_LIB "\"";
args[(*i)++] = "/LIBPATH:\"" WCE_CRT "\"";
args[(*i)++] = "/LIBPATH:\"" ATL_LIB "\"";
args[(*i)++] = "/LIBPATH:\"" OGLES_SDK_LIB "\"";
args[(*i)++] = "/NODEFAULTLIB";
args[(*i)++] = "/MAP";
args[(*i)++] = "/MAPINFO:EXPORTS";
if (getenv("LOCK_DLLS") != NULL) {
// lock our dlls in memory
args[(*i)++] = "/SECTION:.text,\!P";
args[(*i)++] = "/SECTION:.rdata,\!P";
}
#ifdef HAVE_SHUNT // simple test to see if we're in configure or not
if(getenv("NO_SHUNT") == NULL) {
args[(*i)++] = "/LIBPATH:\"" SHUNT_LIB "\"";

View File

@ -199,8 +199,8 @@ DWORD run(char** args)
_putenv("LIBPATH=");
_putenv("CC=");
_putenv("INCLUDE=" SHUNT_INC ";" WM_SDK_INC ";" WCE_INC);
_putenv("LIB=" WCE_LIB ";" WCE_CRT);
_putenv("INCLUDE=" SHUNT_INC ";" WM_SDK_INC ";" OGLES_SDK_INC ";" WCE_INC);
_putenv("LIB=" WCE_LIB ";" OGLES_SDK_LIB ";" WCE_CRT);
for (j=1; args[j]; j++)
{

View File

@ -5,6 +5,8 @@
#include <stdio.h>
#include <process.h>
#define OGLES_SDK_INC OGLES_SDK_PATH "inc"
#define OGLES_SDK_LIB OGLES_SDK_PATH "lib\\wince\\nvap\\release"
#define WCE_BIN VC_PATH "ce\\bin\\x86_arm\\"
#define WCE_RC_BIN WIN_SDK_PATH "bin\\"
#define WCE_CRT VC_PATH "ce\\lib\\armv4i"
@ -12,6 +14,8 @@
#define WCE_LIB WM_SDK_PATH "Lib/Armv4i"
#define WCE_RC_INC VC_PATH "ce\\atlmfc\\include"
#define WCE_INC VC_PATH "ce\\include"
#define ATL_INC VC_PATH "ce\\atlmfc\\include"
#define ATL_LIB VC_PATH "ce\\atlmfc\\lib\\armv4i"
#ifndef SHUNT_LIB
#define SHUNT_LIB ""

View File

@ -51,15 +51,6 @@ interface nsIURI;
[ptr] native JSContext(JSContext);
[ptr] native JSPrincipals(JSPrincipals);
/**
* WARNING!! The JEP needs to call GetOrigin() to support
* JavaScript-to-Java LiveConnect. So every change to the nsIPrincipal
* interface (big enough to change its IID) also breaks JavaScript-to-Java
* LiveConnect on mac.
*
* If you REALLY have to change this interface, please mark your bug as
* blocking bug 293973.
*/
[scriptable, uuid(b8268b9a-2403-44ed-81e3-614075c92034)]
interface nsIPrincipal : nsISerializable
{

View File

@ -41,15 +41,6 @@
interface nsIURI;
interface nsIChannel;
/**
* WARNING!! The JEP needs to call GetSubjectPrincipal()
* to support JavaScript-to-Java LiveConnect. So every change to the
* nsIScriptSecurityManager interface (big enough to change its IID) also
* breaks JavaScript-to-Java LiveConnect on mac.
*
* If you REALLY have to change this interface, please mark your bug as
* blocking bug 293973.
*/
[scriptable, uuid(f8e350b9-9f31-451a-8c8f-d10fea26b780)]
interface nsIScriptSecurityManager : nsIXPCSecurityManager
{

View File

@ -107,9 +107,8 @@ PRBool nsScriptSecurityManager::sStrictFileOriginPolicy = PR_TRUE;
// Info we need about the JSClasses used by XPConnects wrapped
// natives, to avoid having to QI to nsIXPConnectWrappedNative all the
// time when doing security checks.
static const JSClass *sXPCWrappedNativeJSClass;
static JSGetObjectOps sXPCWrappedNativeGetObjOps1;
static JSGetObjectOps sXPCWrappedNativeGetObjOps2;
static JSEqualityOp sXPCWrappedNativeEqualityOps;
static JSEqualityOp sXPCSlimWrapperEqualityOps;
///////////////////////////
@ -2311,38 +2310,24 @@ nsScriptSecurityManager::doGetObjectPrincipal(JSObject *aObj
// Note: jsClass is set before this loop, and also at the
// *end* of this loop.
// NOTE: These class and getObjectOps hook checks better match
// NOTE: These class and equality hook checks better match
// what IS_WRAPPER_CLASS() does in xpconnect!
if (jsClass == sXPCWrappedNativeJSClass ||
jsClass->getObjectOps == sXPCWrappedNativeGetObjOps1 ||
jsClass->getObjectOps == sXPCWrappedNativeGetObjOps2) {
nsIXPConnectWrappedNative *xpcWrapper =
(nsIXPConnectWrappedNative *)caps_GetJSPrivate(aObj);
if (xpcWrapper) {
JSEqualityOp op =
(jsClass->flags & JSCLASS_IS_EXTENDED) ?
reinterpret_cast<const JSExtendedClass*>(jsClass)->equality :
nsnull;
if (op == sXPCWrappedNativeEqualityOps ||
op == sXPCSlimWrapperEqualityOps) {
result = sXPConnect->GetPrincipal(aObj,
#ifdef DEBUG
if (aAllowShortCircuit) {
aAllowShortCircuit
#else
PR_TRUE
#endif
result = xpcWrapper->GetObjectPrincipal();
if (result) {
break;
}
#ifdef DEBUG
}
#endif
// If not, check if it points to an
// nsIScriptObjectPrincipal
nsCOMPtr<nsIScriptObjectPrincipal> objPrin =
do_QueryWrappedNative(xpcWrapper);
if (objPrin) {
result = objPrin->GetPrincipal();
if (result) {
break;
}
}
);
if (result) {
break;
}
} else if (!(~jsClass->flags & (JSCLASS_HAS_PRIVATE |
JSCLASS_PRIVATE_IS_NSISUPPORTS))) {
@ -3309,9 +3294,8 @@ nsresult nsScriptSecurityManager::Init()
JS_SetRuntimeSecurityCallbacks(sRuntime, &securityCallbacks);
NS_ASSERTION(!oldcallbacks, "Someone else set security callbacks!");
sXPConnect->GetXPCWrappedNativeJSClassInfo(&sXPCWrappedNativeJSClass,
&sXPCWrappedNativeGetObjOps1,
&sXPCWrappedNativeGetObjOps2);
sXPConnect->GetXPCWrappedNativeJSClassInfo(&sXPCWrappedNativeEqualityOps,
&sXPCSlimWrapperEqualityOps);
return NS_OK;
}

View File

@ -309,8 +309,8 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext)
JSObject *securityObj;
if (JSVAL_IS_OBJECT(v)) {
/*
* "netscape" property of window object exists; must be LiveConnect
* package. Get the "security" property.
* "netscape" property of window object exists; get the
* "security" property.
*/
obj = JSVAL_TO_OBJECT(v);
if (!JS_GetProperty(cx, obj, "security", &v) || !JSVAL_IS_OBJECT(v))

View File

@ -273,6 +273,7 @@ MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
COMPILE_ENVIRONMENT = @COMPILE_ENVIRONMENT@
CROSS_COMPILE = @CROSS_COMPILE@
WCHAR_CFLAGS = @WCHAR_CFLAGS@
@ -585,8 +586,6 @@ GSSAPI_INCLUDES = @GSSAPI_INCLUDES@
USE_GSSAPI = @USE_GSSAPI@
MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
BUILD_OFFICIAL = @BUILD_OFFICIAL@
MOZ_MILESTONE_RELEASE = @MOZ_MILESTONE_RELEASE@
# Win32 options
MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@
@ -623,8 +622,12 @@ MOZ_PHOENIX = @MOZ_PHOENIX@
MOZ_XULRUNNER = @MOZ_XULRUNNER@
WINCE = @WINCE@
WINCE_SDK_DIR = @WINCE_SDK_DIR@
OGLES_SDK_DIR = @OGLES_SDK_DIR@
WINCE_WINDOWS_MOBILE = @WINCE_WINDOWS_MOBILE@
HAS_OGLES = @HAS_OGLES@
MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
NS_OSSO = @NS_OSSO@

View File

@ -44,9 +44,6 @@ include $(DEPTH)/config/autoconf.mk
USE_STATIC_LIBS = 1
# undefine (as best we can, thanks gmake!) so we don't need build_number
MOZILLA_OFFICIAL =
BUILD_OFFICIAL =
MODULE = mkdepend
HOST_PROGRAM = mkdepend$(BIN_SUFFIX)
ifdef GNU_CC

View File

@ -2,16 +2,8 @@
* The nsinstall command for Win32
*
* Our gmake makefiles use the nsinstall command to create the
* object directories or installing headers and libs to ns/dist.
* The shmsdos shell has nsinstall as a built-in command. However,
* if we use another shell like MKS toolkit's sh, we need to have
* the nsinstall command separately.
*
* This file was generated by just taking the part of shmsdos.c
* needed by nsinstall and deleting the recursive directory copy code.
*
* To build, say
* nmake /f nsinstall.mak
* object directories or installing headers and libs. This code was originally
* taken from shmsdos.c
*/
#include <direct.h>
@ -47,6 +39,7 @@ static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
#define LONGPATH_PREFIX L"\\\\?\\"
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
#define STR_LEN(a) (ARRAY_LEN(a) - 1)
/* changes all forward slashes in token to back slashes */
void changeForwardSlashesTpBackSlashes ( wchar_t *arg )
@ -254,7 +247,7 @@ sh_DoCopy(wchar_t *srcFileName,
DWORD r;
wchar_t longSrc[1004] = LONGPATH_PREFIX;
wchar_t longDst[1004] = LONGPATH_PREFIX;
r = GetFullPathName(srcFileName, 1000, longSrc + ARRAY_LEN(LONGPATH_PREFIX) - 1, NULL);
r = GetFullPathName(srcFileName, 1000, longSrc + STR_LEN(LONGPATH_PREFIX), NULL);
if (!r) {
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
srcFileName, sh_GetLastErrorMessage());

Some files were not shown because too many files have changed in this diff Show More