Merge m-c to b2ginbound a=merge CLOSED TREE

This commit is contained in:
Wes Kocher 2015-03-19 19:31:35 -07:00
commit e69f767407
1185 changed files with 4738 additions and 3118 deletions

View File

@ -205,22 +205,22 @@ MARKUPMAP(mmultiscripts_,
roles::MATHML_MULTISCRIPTS)
MARKUPMAP(mtable_,
New_HyperText,
New_HTMLTableAccessible,
roles::MATHML_TABLE,
AttrFromDOM(align, align),
AttrFromDOM(columnlines_, columnlines_),
AttrFromDOM(rowlines_, rowlines_))
MARKUPMAP(mlabeledtr_,
New_HyperText,
New_HTMLTableRowAccessible,
roles::MATHML_LABELED_ROW)
MARKUPMAP(mtr_,
New_HyperText,
New_HTMLTableRowAccessible,
roles::MATHML_TABLE_ROW)
MARKUPMAP(mtd_,
New_HyperText,
New_HTMLTableCellAccessible,
roles::MATHML_CELL)
MARKUPMAP(maction_,

View File

@ -200,6 +200,18 @@ static Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext)
static Accessible* New_HTMLProgress(nsIContent* aContent, Accessible* aContext)
{ return new HTMLProgressMeterAccessible(aContent, aContext->Document()); }
static Accessible*
New_HTMLTableAccessible(nsIContent* aContent, Accessible* aContext)
{ return new HTMLTableAccessible(aContent, aContext->Document()); }
static Accessible*
New_HTMLTableRowAccessible(nsIContent* aContent, Accessible* aContext)
{ return new HTMLTableRowAccessible(aContent, aContext->Document()); }
static Accessible*
New_HTMLTableCellAccessible(nsIContent* aContent, Accessible* aContext)
{ return new HTMLTableCellAccessible(aContent, aContext->Document()); }
static Accessible*
New_HTMLTableHeaderCell(nsIContent* aContent, Accessible* aContext)
{

View File

@ -60,6 +60,9 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableCellAccessible, HyperTextAccessible)
role
HTMLTableCellAccessible::NativeRole()
{
if (mContent->IsMathMLElement(nsGkAtoms::mtd_)) {
return roles::MATHML_CELL;
}
return roles::CELL;
}
@ -148,8 +151,7 @@ HTMLTableCellAccessible::Table() const
{
Accessible* parent = const_cast<HTMLTableCellAccessible*>(this);
while ((parent = parent->Parent())) {
roles::Role role = parent->Role();
if (role == roles::TABLE || role == roles::TREE_TABLE)
if (parent->IsTable())
return parent->AsTable();
}
@ -349,6 +351,11 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableRowAccessible, Accessible)
role
HTMLTableRowAccessible::NativeRole()
{
if (mContent->IsMathMLElement(nsGkAtoms::mtr_)) {
return roles::MATHML_TABLE_ROW;
} else if (mContent->IsMathMLElement(nsGkAtoms::mlabeledtr_)) {
return roles::MATHML_LABELED_ROW;
}
return roles::ROW;
}
@ -384,6 +391,9 @@ HTMLTableAccessible::CacheChildren()
role
HTMLTableAccessible::NativeRole()
{
if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
return roles::MATHML_TABLE;
}
return roles::TABLE;
}
@ -421,6 +431,11 @@ HTMLTableAccessible::NativeAttributes()
{
nsCOMPtr<nsIPersistentProperties> attributes =
AccessibleWrap::NativeAttributes();
if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
GetAccService()->MarkupAttributes(mContent, attributes);
}
if (IsProbablyLayoutTable()) {
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("layout-guess"),

View File

@ -27,6 +27,13 @@ const kNoColumnHeader = 0;
const kListboxColumnHeader = 1;
const kTreeColumnHeader = 2;
/**
* Constants to define table type.
*/
const kTable = 0;
const kTreeTable = 1;
const kMathTable = 2;
/**
* Test table structure and related methods.
*
@ -37,10 +44,11 @@ const kTreeColumnHeader = 2;
* arranged into the list.
* @param aCaption [in] caption text if any
* @param aSummary [in] summary text if any
* @param aIsTreeTable [in] specifies whether given table is tree table
* @param aTableType [in] specifies the table type.
* @param aRowRoles [in] array of row roles.
*/
function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
aCaption, aSummary, aIsTreeTable)
aCaption, aSummary, aTableType, aRowRoles)
{
var tableNode = getNode(aIdentifier);
var isGrid = tableNode.getAttribute("role") == "grid" ||
@ -52,9 +60,19 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
// Test table accessible tree.
var tableObj = {
role: aIsTreeTable ? ROLE_TREE_TABLE : ROLE_TABLE,
children: []
};
switch (aTableType) {
case kTable:
tableObj.role = ROLE_TABLE;
break;
case kTreeTable:
tableObj.role = ROLE_TREE_TABLE;
break;
case kMathTable:
tableObj.role = ROLE_MATHML_TABLE;
break;
}
// caption accessible handling
if (aCaption) {
@ -99,7 +117,7 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
// rows and cells accessibles
for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
var rowObj = {
role: ROLE_ROW,
role: aRowRoles ? aRowRoles[rowIdx] : ROLE_ROW,
children: []
};
@ -109,7 +127,8 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
var role = ROLE_NOTHING;
switch (celltype) {
case kDataCell:
role = (isGrid ? ROLE_GRID_CELL : ROLE_CELL);
role = (aTableType == kMathTable ? ROLE_MATHML_CELL :
(isGrid ? ROLE_GRID_CELL : ROLE_CELL));
break;
case kRowHeaderCell:
role = ROLE_ROWHEADER;

View File

@ -9,6 +9,7 @@
[test_indexes_table.html]
[test_indexes_tree.xul]
[test_layoutguess.html]
[test_mtable.html]
[test_sels_ariagrid.html]
[test_sels_listbox.xul]
[test_sels_table.html]

View File

@ -0,0 +1,128 @@
<!DOCTYPE html>
<html>
<head>
<title>MathML table tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../table.js"></script>
<script type="application/javascript">
function doTest()
{
// 'Simple' table
var idxes = [
[0, 1],
[2, 3]
];
testTableIndexes("simple", idxes);
var cellsArray = [
[kDataCell, kDataCell],
[kDataCell, kDataCell]
];
var rowsArray = [ROLE_MATHML_TABLE_ROW, ROLE_MATHML_TABLE_ROW];
testTableStruct("simple", cellsArray, kNoColumnHeader,
"", "", kMathTable, rowsArray);
// 'Complex' table
idxes = [
[0, 0, 0],
[1, 1, 2],
[1, 1, 3]
];
testTableIndexes("complex", idxes);
cellsArray = [
[kDataCell, kColSpanned, kColSpanned],
[kDataCell, kColSpanned, kDataCell],
[kRowSpanned, kSpanned, kDataCell],
];
rowsArray = [
ROLE_MATHML_TABLE_ROW,
ROLE_MATHML_TABLE_ROW,
ROLE_MATHML_TABLE_ROW
];
testTableStruct("complex", cellsArray, kNoColumnHeader,
"", "", kMathTable, rowsArray);
// 'Simple' table with mlabeledtr
// At the moment we do not implement mlabeledtr but just hide the label
// with display: none. Thus we just test the role for now. See bug 689641.
var idxes = [[0]];
testTableIndexes("simple_label", idxes);
var cellsArray = [[kDataCell]];
rowsArray = [ROLE_MATHML_LABELED_ROW];
testTableStruct("simple_label", cellsArray, kNoColumnHeader,
"", "", kMathTable, rowsArray);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<math>
<mtable id="simple">
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
</mtr>
</mtable>
<mtable id="complex">
<mtr>
<mtd columnspan="3">
<mtext>1 x 3</mtext>
</mtd>
</mtr>
<mtr>
<mtd rowspan="2" columnspan="2">
<mtext>2 x 2</mtext>
</mtd>
<mtd>
<mtext>1 x 1</mtext>
</mtd>
</mtr>
<mtr>
<mtd>
<mtext>1 x 1</mtext>
</mtd>
</mtr>
</mtable>
<mtable id="simple_label">
<mlabeledtr>
<mtd><mtext>1</mtext></mtd>
<mtd><mtext>label</mtext></mtd>
</mlabeledtr>
</mtable>
</math>
</body>
</html>

View File

@ -28,7 +28,8 @@
[kDataCell, kDataCell, kDataCell]
];
testTableStruct("treegrid", cellsArray, kNoColumnHeader, "", "", true);
testTableStruct("treegrid", cellsArray, kNoColumnHeader, "", "",
kTreeTable);
SimpleTest.finish();
}

View File

@ -23,6 +23,11 @@ XPCOMUtils.defineLazyGetter(this, "B2GTabList", function() {
return B2GTabList;
});
// Load the discovery module eagerly, so that it can set a device name at
// startup. This does not cause discovery to start listening for packets, as
// that only happens once DevTools is enabled.
devtools.require("devtools/toolkit/discovery/discovery");
let RemoteDebugger = {
_listening: false,

View File

@ -25,7 +25,7 @@ const Observer = {
start: function () {
Services.obs.addObserver(this, 'remote-browser-shown', false);
Services.obs.addObserver(this, 'inprocess-browser-shown', false);
Services.obs.addObserver(this, 'message-manager-disconnect', false);
Services.obs.addObserver(this, 'message-manager-close', false);
SystemAppProxy.getFrames().forEach(frame => {
let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
@ -40,7 +40,7 @@ const Observer = {
stop: function () {
Services.obs.removeObserver(this, 'remote-browser-shown');
Services.obs.removeObserver(this, 'inprocess-browser-shown');
Services.obs.removeObserver(this, 'message-manager-disconnect');
Services.obs.removeObserver(this, 'message-manager-close');
this._frames.clear();
this._apps.clear();
},
@ -61,7 +61,7 @@ const Observer = {
break;
// Every time an iframe is destroyed, its message manager also is
case 'message-manager-disconnect':
case 'message-manager-close':
this.onMessageManagerDestroyed(subject);
break;
}

View File

@ -369,7 +369,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PanelFrame", "resource:///modules/Panel
this._maybeShowBrowserSharingInfoBar();
// Get the first window Id for the listener.
listener(null, gBrowser.selectedTab.linkedBrowser.outerWindowID);
listener(null, gBrowser.selectedBrowser.outerWindowID);
},
/**
@ -463,7 +463,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PanelFrame", "resource:///modules/Panel
* @return {Boolean} |true| if the infobar was hidden here.
*/
_hideBrowserSharingInfoBar: function(permanently = false, browser) {
browser = browser || gBrowser.selectedTab.linkedBrowser;
browser = browser || gBrowser.selectedBrowser;
let box = gBrowser.getNotificationBox(browser);
let notification = box.getNotificationWithValue(kBrowserSharingNotificationId);
let removed = false;
@ -497,7 +497,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PanelFrame", "resource:///modules/Panel
// We've changed the tab, so get the new window id.
for (let listener of this._tabChangeListeners) {
try {
listener(null, gBrowser.selectedTab.linkedBrowser.outerWindowID);
listener(null, gBrowser.selectedBrowser.outerWindowID);
} catch (ex) {
Cu.reportError("Tab switch caused an error: " + ex.message);
}

View File

@ -485,7 +485,7 @@ let AboutReaderListener = {
init: function() {
addEventListener("AboutReaderContentLoaded", this, false, true);
addEventListener("pageshow", this, false);
addEventListener("DOMContentLoaded", this, false);
addEventListener("pagehide", this, false);
addMessageListener("Reader:ParseDocument", this);
},
@ -525,7 +525,7 @@ let AboutReaderListener = {
sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: false });
break;
case "pageshow":
case "DOMContentLoaded":
if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader) {
return;
}

View File

@ -22,7 +22,7 @@ add_task(function*() {
EventUtils.synthesizeKey("VK_RETURN", {});
yield promiseTabLoadEvent(gBrowser.selectedTab);
is(gBrowser.selectedTab.linkedBrowser.currentURI.spec,
is(gBrowser.selectedBrowser.currentURI.spec,
"http://example.com/?q=beard",
"Latest typed characters should have been used");
});

View File

@ -283,7 +283,7 @@ function injectLoopAPI(targetWindow) {
writable: true,
value: function(listener) {
let win = Services.wm.getMostRecentWindow("navigator:browser");
let browser = win && win.gBrowser.selectedTab.linkedBrowser;
let browser = win && win.gBrowser.selectedBrowser;
if (!win || !browser) {
// This may happen when an undocked conversation window is the only
// window left.

View File

@ -142,7 +142,7 @@ add_task(function* test_infoBar() {
yield promiseWindowIdReceivedOnAdd(handlers[0]);
let getInfoBar = function() {
let box = gBrowser.getNotificationBox(gBrowser.selectedTab.linkedBrowser);
let box = gBrowser.getNotificationBox(gBrowser.selectedBrowser);
return box.getNotificationWithValue(kBrowserSharingNotificationId);
};

View File

@ -26,7 +26,7 @@ var gContentPane = {
row.removeAttribute("hidden");
}
setEventListener("font.language.group", "change",
setEventListener("font.language.group", "blur",
gContentPane._rebuildFonts);
setEventListener("popupPolicyButton", "command",
gContentPane.showPopupExceptions);

View File

@ -279,42 +279,6 @@ ContentRestoreInternal.prototype = {
});
},
/**
* Accumulates a list of frames that need to be restored for the given browser
* element. A frame is only restored if its current URL matches the one saved
* in the session data. Each frame to be restored is returned along with its
* associated session data.
*
* @param browser the browser being restored
* @return an array of [frame, data] pairs
*/
getFramesToRestore: function (content, data) {
function hasExpectedURL(aDocument, aURL) {
return !aURL || aURL.replace(/#.*/, "") == aDocument.location.href.replace(/#.*/, "");
}
let frameList = [];
function enumerateFrame(content, data) {
// Skip the frame if the user has navigated away before loading finished.
if (!hasExpectedURL(content.document, data.url)) {
return;
}
frameList.push([content, data]);
for (let i = 0; i < content.frames.length; i++) {
if (data.children && data.children[i]) {
enumerateFrame(content.frames[i], data.children[i]);
}
}
}
enumerateFrame(content, data);
return frameList;
},
/**
* Finish restoring the tab by filling in form data and setting the scroll
* position. The restore is complete when this function exits. It should be
@ -329,34 +293,12 @@ ContentRestoreInternal.prototype = {
let {entry, pageStyle, formdata, scrollPositions} = this._restoringDocument;
this._restoringDocument = null;
let window = this.docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
let frameList = this.getFramesToRestore(window, entry);
// Support the old pageStyle format.
if (typeof(pageStyle) === "string") {
PageStyle.restore(this.docShell, frameList, pageStyle);
} else {
PageStyle.restoreTree(this.docShell, pageStyle);
}
let window = this.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
PageStyle.restoreTree(this.docShell, pageStyle);
FormData.restoreTree(window, formdata);
ScrollPosition.restoreTree(window, scrollPositions);
// We need to support the old form and scroll data for a while at least.
for (let [frame, data] of frameList) {
if (data.hasOwnProperty("formdata") || data.hasOwnProperty("innerHTML")) {
let formdata = data.formdata || {};
formdata.url = data.url;
if (data.hasOwnProperty("innerHTML")) {
formdata.innerHTML = data.innerHTML;
}
FormData.restore(frame, formdata);
}
ScrollPosition.restore(frame, data.scroll || "");
}
},
/**

View File

@ -16,10 +16,6 @@ this.PageStyle = Object.freeze({
return PageStyleInternal.collect(docShell, frameTree);
},
restore: function (docShell, frameList, pageStyle) {
PageStyleInternal.restore(docShell, frameList, pageStyle);
},
restoreTree: function (docShell, data) {
PageStyleInternal.restoreTree(docShell, data);
}
@ -55,29 +51,6 @@ let PageStyleInternal = {
return result && Object.keys(result).length ? result : null;
},
/**
* Restore the selected style sheet of all the frames in frameList
* to match |pageStyle|.
* @param docShell the root docshell of all the frames
* @param frameList a list of [frame, data] pairs, where frame is a
* DOM window and data is the session restore data associated with
* it.
* @param pageStyle the title of the style sheet to apply
*/
restore: function (docShell, frameList, pageStyle) {
let disabled = pageStyle == NO_STYLE;
let markupDocumentViewer =
docShell.contentViewer;
markupDocumentViewer.authorStyleDisabled = disabled;
for (let [frame, data] of frameList) {
Array.forEach(frame.document.styleSheets, function(aSS) {
aSS.disabled = aSS.title && aSS.title != pageStyle;
});
}
},
/**
* Restores pageStyle data for the current frame hierarchy starting at the
* |docShell's| current DOMWindow using the given pageStyle |data|.

View File

@ -754,7 +754,7 @@ function handleRevivedTab() {
// won't be sent or received. The child-process message manager works though,
// despite the fact that we're really running in the parent process.
let browser = docShell.chromeEventHandler;
cpmm.sendSyncMessage("SessionStore:RemoteTabRevived", null, {browser: browser});
cpmm.sendAsyncMessage("SessionStore:RemoteTabRevived", null, {browser: browser});
}
}

View File

@ -72,7 +72,7 @@ support-files =
[browser_cleaner.js]
[browser_cookies.js]
[browser_crashedTabs.js]
skip-if = !e10s || os == "linux" # Waiting on OMTC enabled by default on Linux (Bug 994541)
skip-if = !e10s || !crashreporter
[browser_dying_cache.js]
[browser_dynamic_frames.js]
[browser_form_restore_events.js]
@ -135,9 +135,6 @@ skip-if = true
[browser_485563.js]
[browser_490040.js]
[browser_491168.js]
# Disabled for too many intermittent failures.
# Can be re-enabled once bug 930202 lands.
skip-if = true
[browser_491577.js]
[browser_495495.js]
[browser_500328.js]

View File

@ -19,14 +19,14 @@
// 3c. Check that formdata doesn't require JSON.parse
const CRASH_STATE = {windows: [{tabs: [{entries: [{url: "about:mozilla" }]}]}]};
const STATE = {entries: [createEntry(CRASH_STATE)]};
const STATE2 = {entries: [createEntry({windows: [{tabs: [STATE]}]})]};
const STATE3 = {entries: [createEntry(JSON.stringify(CRASH_STATE))]};
const STATE = createEntries(CRASH_STATE);
const STATE2 = createEntries({windows: [{tabs: [STATE]}]});
const STATE3 = createEntries(JSON.stringify(CRASH_STATE));
function createEntry(sessionData) {
function createEntries(sessionData) {
return {
url: "about:sessionrestore",
formdata: {id: {sessionData: sessionData}}
entries: [{url: "about:sessionrestore"}],
formdata: {id: {sessionData: sessionData}, url: "about:sessionrestore"}
};
}

View File

@ -1,41 +1,42 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
function test() {
/** Test for Bug 491168 **/
waitForExplicitFinish();
const REFERRER1 = "http://example.org/?" + Date.now();
const REFERRER2 = "http://example.org/?" + Math.random();
let tab = gBrowser.addTab();
gBrowser.selectedTab = tab;
const REFERRER1 = "http://example.org/?" + Date.now();
const REFERRER2 = "http://example.org/?" + Math.random();
add_task(function* () {
// Add a new tab.
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
let browser = tab.linkedBrowser;
promiseBrowserLoaded(browser).then(() => {
let tabState = JSON.parse(ss.getTabState(tab));
is(tabState.entries[0].referrer, REFERRER1,
"Referrer retrieved via getTabState matches referrer set via loadURI.");
tabState.entries[0].referrer = REFERRER2;
promiseTabState(tab, tabState).then(() => {
is(window.content.document.referrer, REFERRER2, "document.referrer matches referrer set via setTabState.");
gBrowser.removeTab(tab);
let newTab = ss.undoCloseTab(window, 0);
promiseTabRestored(newTab).then(() => {
is(window.content.document.referrer, REFERRER2, "document.referrer is still correct after closing and reopening the tab.");
gBrowser.removeTab(newTab);
finish();
});
});
});
yield promiseBrowserLoaded(browser);
// Load a new URI with a specific referrer.
let referrerURI = Services.io.newURI(REFERRER1, null, null);
browser.loadURI("http://example.org", referrerURI, null);
yield promiseBrowserLoaded(browser);
TabState.flush(browser);
let tabState = JSON.parse(ss.getTabState(tab));
is(tabState.entries[0].referrer, REFERRER1,
"Referrer retrieved via getTabState matches referrer set via loadURI.");
tabState.entries[0].referrer = REFERRER2;
yield promiseTabState(tab, tabState);
is((yield promiseDocumentReferrer()), REFERRER2,
"document.referrer matches referrer set via setTabState.");
gBrowser.removeCurrentTab();
// Restore the closed tab.
tab = ss.undoCloseTab(window, 0);
yield promiseTabRestored(tab);
is((yield promiseDocumentReferrer()), REFERRER2,
"document.referrer is still correct after closing and reopening the tab.");
gBrowser.removeCurrentTab();
});
function promiseDocumentReferrer() {
return ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
return content.document.referrer;
});
}

View File

@ -2,7 +2,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
let oldState = {
let sessionData = {
windows: [{
tabs: [
{ entries: [{ url: "about:mozilla" }], hidden: true },
@ -10,11 +10,9 @@ function test() {
]
}]
};
let pageData = {
url: "about:sessionrestore",
formdata: { id: { "sessionData": oldState } }
};
let state = { windows: [{ tabs: [{ entries: [pageData] }] }] };
let url = "about:sessionrestore";
let formdata = {id: {sessionData}, url};
let state = { windows: [{ tabs: [{ entries: [{url}], formdata }] }] };
waitForExplicitFinish();

View File

@ -61,7 +61,9 @@ function testTabRestoreData(aFormData, aExpectedValue, aCallback) {
let testURL =
getRootDirectory(gTestPath) + "browser_662743_sample.html";
let tab = gBrowser.addTab(testURL);
let tabState = { entries: [{ url: testURL, formdata: aFormData}] };
aFormData.url = testURL;
let tabState = { entries: [{ url: testURL, }], formdata: aFormData };
promiseBrowserLoaded(tab.linkedBrowser).then(() => {
promiseTabState(tab, tabState).then(() => {

View File

@ -1,8 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
let url = "data:text/html;charset=utf-8,<input%20id='foo'>";
let tabState = {
entries: [{url: "data:text/html;charset=utf-8,<input%20id='foo'>", formdata: { id: { "foo": "bar" } } }]
entries: [{ url }], formdata: { id: { "foo": "bar" }, url }
};
function test() {
@ -24,8 +25,7 @@ function test() {
ss.setTabState(tab, JSON.stringify(tabState));
is(browser.__SS_restoreState, TAB_STATE_NEEDS_RESTORE, "tab needs restoring");
let state = JSON.parse(ss.getTabState(tab));
let formdata = state.entries[0].formdata;
let {formdata} = JSON.parse(ss.getTabState(tab));
is(formdata && formdata.id["foo"], "bar", "tab state's formdata is valid");
promiseTabRestored(tab).then(() => {

View File

@ -7,9 +7,10 @@ const CRASH_SHENTRY = {url: "about:mozilla"};
const CRASH_TAB = {entries: [CRASH_SHENTRY]};
const CRASH_STATE = {windows: [{tabs: [CRASH_TAB]}]};
const TAB_FORMDATA = {id: {sessionData: CRASH_STATE}};
const TAB_SHENTRY = {url: "about:sessionrestore", formdata: TAB_FORMDATA};
const TAB_STATE = {entries: [TAB_SHENTRY]};
const TAB_URL = "about:sessionrestore";
const TAB_FORMDATA = {url: TAB_URL, id: {sessionData: CRASH_STATE}};
const TAB_SHENTRY = {url: TAB_URL};
const TAB_STATE = {entries: [TAB_SHENTRY], formdata: TAB_FORMDATA};
const FRAME_SCRIPT = "data:," +
"content.document.getElementById('errorTryAgain').click()";

View File

@ -15,6 +15,9 @@ registerCleanupFunction(() => {
// Allow tabs to restore on demand so we can test pending states
Services.prefs.clearUserPref("browser.sessionstore.restore_on_demand");
// Running this test in ASAN is slow.
requestLongerTimeout(2);
/**
* Returns a Promise that resolves once a remote <xul:browser> has experienced
* a crash. Also does the job of cleaning up the minidump of the crash.

View File

@ -58,54 +58,6 @@ add_task(function test_formdata() {
Services.prefs.clearUserPref("browser.sessionstore.privacy_level");
});
/**
* This test ensures that we maintain backwards compatibility with the form
* data format used pre Fx 29.
*/
add_task(function test_old_format() {
const URL = "data:text/html;charset=utf-8,<input%20id=input>";
const VALUE = "value-" + Math.random();
// Create a tab with an iframe containing an input field.
let tab = gBrowser.addTab(URL);
let browser = tab.linkedBrowser;
yield promiseBrowserLoaded(browser);
// Check that the form value is restored.
let state = {entries: [{url: URL, formdata: {id: {input: VALUE}}}]};
yield promiseTabState(tab, state);
is((yield getInputValue(browser, "input")), VALUE, "form data restored");
// Cleanup.
gBrowser.removeTab(tab);
});
/**
* This test ensures that we maintain backwards compatibility with the form
* data form used pre Fx 29, esp. the .innerHTML property for editable docs.
*/
add_task(function test_old_format_inner_html() {
const URL = "data:text/html;charset=utf-8,<h1>mozilla</h1>" +
"<script>document.designMode='on'</script>";
const VALUE = "<h1>value-" + Math.random() + "</h1>";
// Create a tab with an iframe containing an input field.
let tab = gBrowser.addTab(URL);
let browser = tab.linkedBrowser;
yield promiseBrowserLoaded(browser);
// Restore the tab state.
let state = {entries: [{url: URL, innerHTML: VALUE}]};
yield promiseTabState(tab, state);
// Check that the innerHTML value was restored.
let html = yield getInnerHTML(browser);
is(html, VALUE, "editable document has been restored correctly");
// Cleanup.
gBrowser.removeTab(tab);
});
/**
* This test ensures that a malicious website can't trick us into restoring
* form data into a wrong website and that we always check the stored URL

View File

@ -71,7 +71,9 @@ function testTabRestoreData(aFormData, aExpectedValue, aCallback) {
let URL = ROOT + "browser_formdata_format_sample.html";
let tab = gBrowser.addTab("about:blank");
let browser = tab.linkedBrowser;
let tabState = { entries: [{ url: URL, formdata: aFormData}] };
aFormData.url = URL;
let tabState = { entries: [{ url: URL }], formdata: aFormData };
Task.spawn(function () {
yield promiseBrowserLoaded(tab.linkedBrowser);

View File

@ -102,30 +102,6 @@ add_task(function test_scroll_nested() {
gBrowser.removeTab(tab2);
});
/**
* This test ensures that by moving scroll positions out of tabData.entries[]
* we still support the old scroll data format stored per shistory entry.
*/
add_task(function test_scroll_old_format() {
const TAB_STATE = { entries: [{url: URL, scroll: SCROLL_STR}] };
// Add a blank tab.
let tab = gBrowser.addTab("about:blank");
let browser = tab.linkedBrowser;
yield promiseBrowserLoaded(browser);
// Apply the tab state with the old format.
yield promiseTabState(tab, TAB_STATE);
// Check that the scroll positions has been applied.
let scroll = yield sendMessage(browser, "ss-test:getScrollPosition");
is(JSON.stringify(scroll), JSON.stringify({x: SCROLL_X, y: SCROLL_Y}),
"scroll position has been restored correctly");
// Cleanup.
gBrowser.removeTab(tab);
});
function checkScroll(tab, expected, msg) {
let browser = tab.linkedBrowser;
TabState.flush(browser);

View File

@ -684,7 +684,7 @@ this.UITour = {
}
this.tourBrowsersByWindow.get(window).add(browser);
Services.obs.addObserver(this, "message-manager-disconnect", false);
Services.obs.addObserver(this, "message-manager-close", false);
window.addEventListener("SSWindowClosing", this);
@ -736,7 +736,7 @@ this.UITour = {
switch (aTopic) {
// The browser message manager is disconnected when the <browser> is
// destroyed and we want to teardown at that point.
case "message-manager-disconnect": {
case "message-manager-close": {
let winEnum = Services.wm.getEnumerator("navigator:browser");
while (winEnum.hasMoreElements()) {
let window = winEnum.getNext();

View File

@ -10,7 +10,7 @@ thisTestLeaksUncaughtRejectionsAndShouldBeFixed("destroy");
function test() {
function isOpen() {
return gBrowser.getBrowserContainer(gBrowser.selectedTab.linkedBrowser)
return gBrowser.getBrowserContainer(gBrowser.selectedBrowser)
.hasAttribute("responsivemode");
}

View File

@ -15,14 +15,26 @@ function quoteString(string) {
let hasDoubleQuotes = string.contains('"');
let hasSingleQuotes = string.contains("'");
let quote = '"';
if (hasDoubleQuotes && !hasSingleQuotes) {
// In this case, no escaping required, just enclose in single-quotes
return "'" + string + "'";
quote = "'";
}
// In all other cases, enclose in double-quotes, and escape any double-quote
// that may be in the string
return '"' + string.replace(/"/g, '\"') + '"';
// Quote special characters as specified by the CSS grammar.
// See http://www.w3.org/TR/CSS2/syndata.html#tokenization
// and http://www.w3.org/TR/CSS2/syndata.html#strings
return quote +
string.replace(/[\\"]/g, match => {
switch (match) {
case '\\':
return '\\\\';
case '"':
if (quote == '"')
return '\\"';
return match;
}
}) +
quote;
}
/**

View File

@ -155,7 +155,7 @@ const TEST_DATA = [
{input: 'content: "this is a \\"string\\""', expected: [{name: "content", value: '\'this is a "string"\'', priority: ""}]},
{input: "content: 'this is a \"string\"'", expected: [{name: "content", value: '\'this is a "string"\'', priority: ""}]},
{input: "content: 'this is a \\'string\\'", expected: [{name: "content", value: '"this is a \'string\'"', priority: ""}]},
{input: "content: 'this \\' is a \" really strange string'", expected: [{name: "content", value: '"this \' is a \" really strange string"', priority: ""}]},
{input: "content: 'this \\' is a \" really strange string'", expected: [{name: "content", value: '"this \' is a \\\" really strange string"', priority: ""}]},
{
input: "content: \"a not s\\\
o very long title\"",

View File

@ -47,6 +47,13 @@ const TEST_DATA = [
value: "\"content!important\"",
priority: ""
}
},
{
input: "\"all the \\\"'\\\\ special characters\"",
expected: {
value: "\"all the \\\"'\\\\ special characters\"",
priority: ""
}
}
];

View File

@ -50,9 +50,9 @@ let consoleOpened = Task.async(function*(aHud) {
// 4 values, and the following properties:
// __defineGetter__ __defineSetter__ __lookupGetter__ __lookupSetter__
// hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString
// toSource unwatch valueOf watch constructor.
is(popup.itemCount, 18, "popup.itemCount is correct");
// __proto__ hasOwnProperty isPrototypeOf propertyIsEnumerable
// toLocaleString toString toSource unwatch valueOf watch constructor.
is(popup.itemCount, 19, "popup.itemCount is correct");
let sameItems = popup.getItems().reverse().map(function(e) {return e.label;});
ok(sameItems.every(function(prop, index) {
@ -61,6 +61,7 @@ let consoleOpened = Task.async(function*(aHud) {
"__defineSetter__",
"__lookupGetter__",
"__lookupSetter__",
"__proto__",
"constructor",
"hasOwnProperty",
"isPrototypeOf",
@ -77,7 +78,7 @@ let consoleOpened = Task.async(function*(aHud) {
"watch",
][index] === prop}), "getItems returns the items we expect");
is(popup.selectedIndex, 17,
is(popup.selectedIndex, 18,
"Index of the first item from bottom is selected.");
EventUtils.synthesizeKey("VK_DOWN", {});
@ -115,7 +116,7 @@ let consoleOpened = Task.async(function*(aHud) {
ok(popup.selectedIndex < currentSelectionIndex, "Index is less after Page UP");
EventUtils.synthesizeKey("VK_END", {});
is(popup.selectedIndex, 17, "index is last after End");
is(popup.selectedIndex, 18, "index is last after End");
EventUtils.synthesizeKey("VK_HOME", {});
is(popup.selectedIndex, 0, "index is first after Home");
@ -152,9 +153,9 @@ function popupHideAfterTab()
ok(popup.isOpen, "popup is open");
is(popup.itemCount, 18, "popup.itemCount is correct");
is(popup.itemCount, 19, "popup.itemCount is correct");
is(popup.selectedIndex, 17, "First index from bottom is selected");
is(popup.selectedIndex, 18, "First index from bottom is selected");
EventUtils.synthesizeKey("VK_DOWN", {});
let prefix = jsterm.inputNode.value.replace(/[\S]/g, " ");
@ -201,9 +202,9 @@ function testReturnKey()
ok(popup.isOpen, "popup is open");
is(popup.itemCount, 18, "popup.itemCount is correct");
is(popup.itemCount, 19, "popup.itemCount is correct");
is(popup.selectedIndex, 17, "First index from bottom is selected");
is(popup.selectedIndex, 18, "First index from bottom is selected");
EventUtils.synthesizeKey("VK_DOWN", {});
let prefix = jsterm.inputNode.value.replace(/[\S]/g, " ");

View File

@ -453,6 +453,10 @@ WiFiRuntime.prototype = {
}
connection.advertisement = service;
connection.authenticator.sendOOB = this.sendOOB;
// Disable the default connection timeout, since QR scanning can take an
// unknown amount of time. This prevents spurious errors (even after
// eventual success) from being shown.
connection.timeoutDelay = 0;
connection.connect();
return promise.resolve();
},

View File

@ -101,9 +101,9 @@ AC_SUBST(CLANG_CXX)
AC_SUBST(CLANG_CL)
if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then
if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 6 ||
if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 7 ||
test "$GCC_MAJOR_VERSION" -lt 4; then
AC_MSG_ERROR([Only GCC 4.6 or newer supported])
AC_MSG_ERROR([Only GCC 4.7 or newer supported])
fi
fi
])

View File

@ -25,9 +25,9 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(Activity, DOMRequest)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
/* virtual */ JSObject*
Activity::WrapObject(JSContext* aCx)
Activity::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return MozActivityBinding::Wrap(aCx, this);
return MozActivityBinding::Wrap(aCx, this, aGivenProto);
}
nsresult

View File

@ -21,7 +21,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(Activity, DOMRequest)
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
static already_AddRefed<Activity>
Constructor(const GlobalObject& aOwner,

View File

@ -66,9 +66,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(Animation, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(Animation, Release)
JSObject*
Animation::WrapObject(JSContext* aCx)
Animation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return AnimationBinding::Wrap(aCx, this);
return AnimationBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<AnimationEffect>

View File

@ -189,7 +189,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Animation)
nsIDocument* GetParentObject() const { return mDocument; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// FIXME: If we succeed in moving transition-specific code to a type of
// AnimationEffect (as per the Web Animations API) we should remove these

View File

@ -15,9 +15,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationEffect, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationEffect, Release)
JSObject*
AnimationEffect::WrapObject(JSContext* aCx)
AnimationEffect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return AnimationEffectBinding::Wrap(aCx, this);
return AnimationEffectBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom

View File

@ -27,7 +27,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationEffect)
Animation* GetParentObject() const { return mAnimation; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// AnimationEffect interface
void GetName(nsString& aRetVal) const {

View File

@ -26,9 +26,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationPlayer)
NS_INTERFACE_MAP_END
JSObject*
AnimationPlayer::WrapObject(JSContext* aCx)
AnimationPlayer::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return dom::AnimationPlayerBinding::Wrap(aCx, this);
return dom::AnimationPlayerBinding::Wrap(aCx, this, aGivenProto);
}
void

View File

@ -64,7 +64,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationPlayer)
AnimationTimeline* GetParentObject() const { return mTimeline; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; }
virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; }

View File

@ -21,9 +21,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationTimeline, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationTimeline, Release)
JSObject*
AnimationTimeline::WrapObject(JSContext* aCx)
AnimationTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return AnimationTimelineBinding::Wrap(aCx, this);
return AnimationTimelineBinding::Wrap(aCx, this, aGivenProto);
}
Nullable<TimeDuration>

View File

@ -41,7 +41,7 @@ public:
{
return mWindow;
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// AnimationTimeline methods
Nullable<TimeDuration> GetCurrentTime() const;

View File

@ -61,9 +61,9 @@ ArchiveReader::~ArchiveReader()
}
/* virtual */ JSObject*
ArchiveReader::WrapObject(JSContext* aCx)
ArchiveReader::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return ArchiveReaderBinding::Wrap(aCx, this);
return ArchiveReaderBinding::Wrap(aCx, this, aGivenProto);
}
nsresult

View File

@ -51,7 +51,7 @@ public:
return mWindow;
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
already_AddRefed<ArchiveRequest> GetFilenames();
already_AddRefed<ArchiveRequest> GetFile(const nsAString& filename);

View File

@ -77,9 +77,9 @@ ArchiveRequest::PreHandleEvent(EventChainPreVisitor& aVisitor)
}
/* virtual */ JSObject*
ArchiveRequest::WrapObject(JSContext* aCx)
ArchiveRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return ArchiveRequestBinding::Wrap(aCx, this);
return ArchiveRequestBinding::Wrap(aCx, this, aGivenProto);
}
ArchiveReader*

View File

@ -26,7 +26,7 @@ BEGIN_ARCHIVEREADER_NAMESPACE
class ArchiveRequest : public mozilla::dom::DOMRequest
{
public:
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
ArchiveReader* Reader() const;

View File

@ -131,9 +131,10 @@ AnonymousContent::GetElementById(const nsAString& aElementId)
bool
AnonymousContent::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto,
JS::MutableHandle<JSObject*> aReflector)
{
return AnonymousContentBinding::Wrap(aCx, this, aReflector);
return AnonymousContentBinding::Wrap(aCx, this, aGivenProto, aReflector);
}
} // dom namespace

View File

@ -27,7 +27,7 @@ public:
explicit AnonymousContent(Element* aContentNode);
nsCOMPtr<Element> GetContentNode();
void SetContentNode(Element* aContentNode);
bool WrapObject(JSContext* aCx, JS::MutableHandle<JSObject*> aReflector);
bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
// WebIDL methods
void SetTextContentForElement(const nsAString& aElementId,

View File

@ -384,9 +384,9 @@ Attr::Shutdown()
}
JSObject*
Attr::WrapNode(JSContext* aCx)
Attr::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return AttrBinding::Wrap(aCx, this);
return AttrBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom

View File

@ -82,7 +82,7 @@ public:
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// WebIDL
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// XPCOM GetName() is OK
// XPCOM GetValue() is OK

View File

@ -34,9 +34,9 @@ BarProp::GetParentObject() const
}
JSObject*
BarProp::WrapObject(JSContext* aCx)
BarProp::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return BarPropBinding::Wrap(aCx, this);
return BarPropBinding::Wrap(aCx, this, aGivenProto);
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(BarProp, mDOMWindow)

View File

@ -40,7 +40,7 @@ public:
nsPIDOMWindow* GetParentObject() const;
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
virtual bool GetVisible(ErrorResult& aRv) = 0;
virtual void SetVisible(bool aVisible, ErrorResult& aRv) = 0;

View File

@ -74,9 +74,9 @@ Comment::Constructor(const GlobalObject& aGlobal,
}
JSObject*
Comment::WrapNode(JSContext *aCx)
Comment::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
{
return CommentBinding::Wrap(aCx, this);
return CommentBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom

View File

@ -72,7 +72,7 @@ public:
ErrorResult& aRv);
protected:
virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
};
} // namespace dom

View File

@ -722,9 +722,9 @@ Console::Observe(nsISupports* aSubject, const char* aTopic,
}
JSObject*
Console::WrapObject(JSContext* aCx)
Console::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return ConsoleBinding::Wrap(aCx, this);
return ConsoleBinding::Wrap(aCx, this, aGivenProto);
}
#define METHOD(name, string) \

View File

@ -44,7 +44,7 @@ public:
}
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
void
Log(JSContext* aCx, const Sequence<JS::Value>& aData);

View File

@ -46,9 +46,9 @@ Crypto::Init(nsIGlobalObject* aParent)
}
/* virtual */ JSObject*
Crypto::WrapObject(JSContext* aCx)
Crypto::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return CryptoBinding::Wrap(aCx, this);
return CryptoBinding::Wrap(aCx, this, aGivenProto);
}
void

View File

@ -50,7 +50,7 @@ public:
}
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
static uint8_t*
GetRandomValues(uint32_t aLength);

View File

@ -76,9 +76,9 @@ DOMCursor::Continue(ErrorResult& aRv)
}
/* virtual */ JSObject*
DOMCursor::WrapObject(JSContext* aCx)
DOMCursor::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMCursorBinding::Wrap(aCx, this);
return DOMCursorBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom

View File

@ -27,7 +27,7 @@ public:
DOMCursor(nsPIDOMWindow* aWindow, nsICursorContinueCallback *aCallback);
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
bool Done() const
{

View File

@ -55,9 +55,9 @@ DOMError::~DOMError()
}
JSObject*
DOMError::WrapObject(JSContext* aCx)
DOMError::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMErrorBinding::Wrap(aCx, this);
return DOMErrorBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<DOMError>

View File

@ -59,7 +59,7 @@ public:
}
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
static already_AddRefed<DOMError>
Constructor(const GlobalObject& global, const nsAString& name,

View File

@ -490,9 +490,9 @@ Exception::Initialize(const nsACString& aMessage, nsresult aResult,
}
JSObject*
Exception::WrapObject(JSContext* cx)
Exception::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
{
return ExceptionBinding::Wrap(cx, this);
return ExceptionBinding::Wrap(cx, this, aGivenProto);
}
void
@ -706,9 +706,9 @@ DOMException::Constructor(GlobalObject& /* unused */,
}
JSObject*
DOMException::WrapObject(JSContext* aCx)
DOMException::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMExceptionBinding::Wrap(aCx, this);
return DOMExceptionBinding::Wrap(aCx, this, aGivenProto);
}
/* static */already_AddRefed<DOMException>

View File

@ -63,7 +63,7 @@ public:
void StowJSVal(JS::Value& aVp);
// WebIDL API
virtual JSObject* WrapObject(JSContext* cx)
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
MOZ_OVERRIDE;
nsISupports* GetParentObject() const { return nullptr; }
@ -136,7 +136,7 @@ public:
NS_IMETHOD ToString(nsACString& aReturn) MOZ_OVERRIDE;
// nsWrapperCache overrides
virtual JSObject* WrapObject(JSContext* aCx)
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
MOZ_OVERRIDE;
static already_AddRefed<DOMException>

View File

@ -29,9 +29,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMImplementation)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMImplementation)
JSObject*
DOMImplementation::WrapObject(JSContext* aCx)
DOMImplementation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMImplementationBinding::Wrap(aCx, this);
return DOMImplementationBinding::Wrap(aCx, this, aGivenProto);
}
bool

View File

@ -52,7 +52,7 @@ public:
return mOwner;
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// nsIDOMDOMImplementation
NS_DECL_NSIDOMDOMIMPLEMENTATION

View File

@ -658,9 +658,9 @@ DOMMatrix::SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv)
}
JSObject*
DOMMatrix::WrapObject(JSContext* aCx)
DOMMatrix::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMMatrixBinding::Wrap(aCx, this);
return DOMMatrixBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom

View File

@ -166,7 +166,7 @@ public:
Constructor(const GlobalObject& aGlobal, const Sequence<double>& aNumberSequence, ErrorResult& aRv);
nsISupports* GetParentObject() const { return mParent; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
#define Set2DMatrixMember(entry2D, entry3D) \
{ \

View File

@ -75,9 +75,9 @@ public:
return mOwner;
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
{
return mozilla::dom::DOMParserBinding::Wrap(aCx, this);
return mozilla::dom::DOMParserBinding::Wrap(aCx, this, aGivenProto);
}
private:

View File

@ -37,7 +37,7 @@ DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY,
}
JSObject*
DOMPoint::WrapObject(JSContext* aCx)
DOMPoint::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMPointBinding::Wrap(aCx, this);
return DOMPointBinding::Wrap(aCx, this, aGivenProto);
}

View File

@ -64,7 +64,7 @@ public:
double aZ, double aW, ErrorResult& aRV);
nsISupports* GetParentObject() const { return mParent; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
void SetX(double aX) { mX = aX; }
void SetY(double aY) { mY = aY; }

View File

@ -38,9 +38,9 @@ DOMQuad::~DOMQuad()
}
JSObject*
DOMQuad::WrapObject(JSContext* aCx)
DOMQuad::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMQuadBinding::Wrap(aCx, this);
return DOMQuadBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<DOMQuad>

View File

@ -35,7 +35,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
nsISupports* GetParentObject() const { return mParent; }
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
static already_AddRefed<DOMQuad>
Constructor(const GlobalObject& aGlobal,

View File

@ -21,10 +21,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRectReadOnly)
NS_INTERFACE_MAP_END
JSObject*
DOMRectReadOnly::WrapObject(JSContext* aCx)
DOMRectReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
MOZ_ASSERT(mParent);
return DOMRectReadOnlyBinding::Wrap(aCx, this);
return DOMRectReadOnlyBinding::Wrap(aCx, this, aGivenProto);
}
// -----------------------------------------------------------------------------
@ -47,10 +47,10 @@ FORWARD_GETTER(Width)
FORWARD_GETTER(Height)
JSObject*
DOMRect::WrapObject(JSContext* aCx)
DOMRect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
MOZ_ASSERT(mParent);
return DOMRectBinding::Wrap(aCx, this);
return DOMRectBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<DOMRect>
@ -99,9 +99,9 @@ DOMRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn)
}
JSObject*
DOMRectList::WrapObject(JSContext *cx)
DOMRectList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
return mozilla::dom::DOMRectListBinding::Wrap(cx, this);
return mozilla::dom::DOMRectListBinding::Wrap(cx, this, aGivenProto);
}
static double

View File

@ -43,7 +43,7 @@ public:
MOZ_ASSERT(mParent);
return mParent;
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
virtual double X() const = 0;
virtual double Y() const = 0;
@ -98,7 +98,7 @@ public:
Constructor(const GlobalObject& aGlobal, double aX, double aY,
double aWidth, double aHeight, ErrorResult& aRV);
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
void SetRect(float aX, float aY, float aWidth, float aHeight) {
mX = aX; mY = aY; mWidth = aWidth; mHeight = aHeight;
@ -161,7 +161,7 @@ public:
NS_DECL_NSIDOMCLIENTRECTLIST
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
nsISupports* GetParentObject()
{

View File

@ -66,9 +66,9 @@ NS_IMPL_ADDREF_INHERITED(DOMRequest, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(DOMRequest, DOMEventTargetHelper)
/* virtual */ JSObject*
DOMRequest::WrapObject(JSContext* aCx)
DOMRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMRequestBinding::Wrap(aCx, this);
return DOMRequestBinding::Wrap(aCx, this, aGivenProto);
}
NS_IMPL_EVENT_HANDLER(DOMRequest, success)

View File

@ -47,7 +47,7 @@ public:
return GetOwner();
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// WebIDL Interface
DOMRequestReadyState ReadyState() const

View File

@ -24,9 +24,9 @@ DOMStringList::~DOMStringList()
}
JSObject*
DOMStringList::WrapObject(JSContext* aCx)
DOMStringList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return DOMStringListBinding::Wrap(aCx, this);
return DOMStringListBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom

View File

@ -24,7 +24,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList)
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
nsISupports* GetParentObject()
{
return nullptr;

View File

@ -24,9 +24,9 @@ namespace mozilla {
namespace dom {
JSObject*
DocumentFragment::WrapNode(JSContext *aCx)
DocumentFragment::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
{
return DocumentFragmentBinding::Wrap(aCx, this);
return DocumentFragmentBinding::Wrap(aCx, this, aGivenProto);
}
bool

View File

@ -65,7 +65,7 @@ public:
Init();
}
virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// nsIContent
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,

View File

@ -60,9 +60,9 @@ namespace mozilla {
namespace dom {
JSObject*
DocumentType::WrapNode(JSContext *cx)
DocumentType::WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
return DocumentTypeBinding::Wrap(cx, this);
return DocumentTypeBinding::Wrap(cx, this, aGivenProto);
}
DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,

View File

@ -77,7 +77,7 @@ public:
protected:
virtual ~DocumentType();
virtual JSObject* WrapNode(JSContext *cx) MOZ_OVERRIDE;
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
nsString mPublicId;
nsString mSystemId;

View File

@ -406,9 +406,9 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
}
JSObject*
Element::WrapObject(JSContext *aCx)
Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx));
JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx, aGivenProto));
if (!obj) {
return nullptr;
}
@ -1108,9 +1108,9 @@ DestinationInsertionPointList::IndexOf(nsIContent* aContent)
}
JSObject*
DestinationInsertionPointList::WrapObject(JSContext* aCx)
DestinationInsertionPointList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return NodeListBinding::Wrap(aCx, this);
return NodeListBinding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<DestinationInsertionPointList>

View File

@ -960,7 +960,7 @@ public:
nsIDOMHTMLCollection** aResult);
void GetClassList(nsISupports** aClassList);
virtual JSObject* WrapObject(JSContext *aCx) MOZ_FINAL MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_FINAL MOZ_OVERRIDE;
nsINode* GetScopeChainParent() const MOZ_OVERRIDE;
@ -1315,7 +1315,7 @@ public:
virtual int32_t IndexOf(nsIContent* aContent) MOZ_OVERRIDE;
virtual nsINode* GetParentObject() MOZ_OVERRIDE { return mParent; }
virtual uint32_t Length() const;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
protected:
virtual ~DestinationInsertionPointList();

View File

@ -265,9 +265,9 @@ EventSource::Init(nsISupports* aOwner,
}
/* virtual */ JSObject*
EventSource::WrapObject(JSContext* aCx)
EventSource::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return EventSourceBinding::Wrap(aCx, this);
return EventSourceBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<EventSource>

View File

@ -58,7 +58,7 @@ public:
NS_DECL_NSIINTERFACEREQUESTOR
// nsWrapperCache
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// WebIDL
nsPIDOMWindow*

View File

@ -559,10 +559,10 @@ File::IsMemoryFile()
}
JSObject*
File::WrapObject(JSContext* aCx)
File::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return IsFile() ? FileBinding::Wrap(aCx, this)
: BlobBinding::Wrap(aCx, this);
return IsFile() ? FileBinding::Wrap(aCx, this, aGivenProto)
: BlobBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<File>
@ -1235,9 +1235,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(FileList)
NS_IMPL_CYCLE_COLLECTING_RELEASE(FileList)
JSObject*
FileList::WrapObject(JSContext *cx)
FileList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
return mozilla::dom::FileListBinding::Wrap(cx, this);
return mozilla::dom::FileListBinding::Wrap(cx, this, aGivenProto);
}
NS_IMETHODIMP

View File

@ -189,7 +189,7 @@ public:
const ChromeFilePropertyBag& aBag,
ErrorResult& aRv);
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
uint64_t GetSize(ErrorResult& aRv);
@ -828,7 +828,7 @@ public:
NS_DECL_NSIDOMFILELIST
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
nsISupports* GetParentObject()
{

View File

@ -401,9 +401,9 @@ NS_INTERFACE_TABLE_HEAD(nsChildContentList)
NS_INTERFACE_MAP_END
JSObject*
nsChildContentList::WrapObject(JSContext *cx)
nsChildContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
return NodeListBinding::Wrap(cx, this);
return NodeListBinding::Wrap(cx, this, aGivenProto);
}
NS_IMETHODIMP

View File

@ -56,7 +56,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList)
// nsWrapperCache
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// nsIDOMNodeList interface
NS_DECL_NSIDOMNODELIST

View File

@ -81,9 +81,9 @@ MessageChannel::~MessageChannel()
}
JSObject*
MessageChannel::WrapObject(JSContext* aCx)
MessageChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return MessageChannelBinding::Wrap(aCx, this);
return MessageChannelBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<MessageChannel>

View File

@ -40,7 +40,7 @@ public:
}
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
static already_AddRefed<MessageChannel>
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);

View File

@ -223,7 +223,7 @@ PostMessageReadTransferStructuredClone(JSContext* aCx,
port->BindToOwner(scInfo->mPort->GetOwner());
scInfo->mPorts.Put(port, nullptr);
JS::Rooted<JSObject*> obj(aCx, port->WrapObject(aCx));
JS::Rooted<JSObject*> obj(aCx, port->WrapObject(aCx, JS::NullPtr()));
if (!obj || !JS_WrapObject(aCx, &obj)) {
return false;
}
@ -414,9 +414,9 @@ MessagePort::~MessagePort()
}
JSObject*
MessagePort::WrapObject(JSContext* aCx)
MessagePort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return MessagePortBinding::Wrap(aCx, this);
return MessagePortBinding::Wrap(aCx, this, aGivenProto);
}
void

View File

@ -64,7 +64,7 @@ public:
explicit MessagePort(nsPIDOMWindow* aWindow);
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
virtual void
PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,

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