Merge inbound to m-c a=merge IGNORE BAD COMMIT MESSAGES

--HG--
extra : amend_source : 6e2cbd26c34b307cfb74a9a2717b369e98b4366a
This commit is contained in:
Wes Kocher 2015-05-14 15:28:47 -07:00
commit c4317a3a59
451 changed files with 5035 additions and 3153 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Merge day clobber
Bug 1163201 needs clobber.

View File

@ -103,6 +103,10 @@ MARKUPMAP(li,
New_HTMLListitem,
0)
MARKUPMAP(map,
nullptr,
roles::TEXT_CONTAINER)
MARKUPMAP(math,
New_HyperText,
roles::MATHML_MATH)
@ -304,6 +308,10 @@ MARKUPMAP(output,
roles::SECTION,
Attr(live, polite))
MARKUPMAP(p,
nullptr,
roles::PARAGRAPH)
MARKUPMAP(progress,
New_HTMLProgress,
0)

View File

@ -981,7 +981,13 @@ enum Role {
*/
RADIO_GROUP = 168,
LAST_ROLE = RADIO_GROUP
/**
* A text container exposing brief amount of information. See related
* TEXT_CONTAINER role.
*/
TEXT = 169,
LAST_ROLE = TEXT
};
} // namespace role

View File

@ -754,7 +754,7 @@ ROLE(TERMINAL,
ROLE(TEXT_CONTAINER,
"text container",
ATK_ROLE_TEXT,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
USE_ROLE_STRING,
IA2_ROLE_TEXT_FRAME,
@ -1367,3 +1367,12 @@ ROLE(RADIO_GROUP,
ROLE_SYSTEM_GROUPING,
ROLE_SYSTEM_GROUPING,
eNoNameRule)
ROLE(TEXT,
"text",
ATK_ROLE_STATIC,
NSAccessibilityGroupRole,
USE_ROLE_STRING,
IA2_ROLE_TEXT_FRAME,
eNameFromSubtreeIfReqRule)

View File

@ -63,12 +63,11 @@ HyperTextAccessible::NativeRole()
if (r != roles::NOTHING)
return r;
// Treat block frames as paragraphs
nsIFrame *frame = GetFrame();
if (frame && frame->GetType() == nsGkAtoms::blockFrame)
return roles::PARAGRAPH;
nsIFrame* frame = GetFrame();
if (frame && frame->GetType() == nsGkAtoms::inlineFrame)
return roles::TEXT;
return roles::TEXT_CONTAINER; // In ATK this works
return roles::TEXT_CONTAINER;
}
uint64_t

View File

@ -8,7 +8,7 @@
/**
* Defines cross platform (Gecko) roles.
*/
[scriptable, uuid(00f9e831-3198-40b7-9186-5251474d4d7a)]
[scriptable, uuid(94add87a-190c-443e-9549-d11131affb2a)]
interface nsIAccessibleRole : nsISupports
{
/**
@ -974,4 +974,10 @@ interface nsIAccessibleRole : nsISupports
* A group containing radio buttons
*/
const unsigned long ROLE_RADIO_GROUP = 168;
/**
* A text container exposing brief amount of information. See related
* TEXT_CONTAINER role.
*/
const unsigned long ROLE_TEXT = 169;
};

View File

@ -70,7 +70,7 @@
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
children: [
{
role: ROLE_TEXT_CONTAINER,
role: ROLE_TEXT,
children: [ { role: ROLE_TEXT_LEAF } ]
}
]
@ -81,7 +81,7 @@
// HTML:address
obj = {
todo_role: ROLE_PARAGRAPH,
role: ROLE_TEXT_CONTAINER,
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
};
testElm("address", obj);
@ -188,7 +188,7 @@
testElm("blockquote", obj);
//////////////////////////////////////////////////////////////////////////
// HTML:br
// HTML:br contained by paragraph
obj = {
role: ROLE_PARAGRAPH,
@ -1062,7 +1062,7 @@
// HTML:pre
obj = {
role: ROLE_PARAGRAPH,
role: ROLE_TEXT_CONTAINER,
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
};
testElm("pre", obj);
@ -1087,7 +1087,7 @@
// HTML:q
obj = {
role: ROLE_TEXT_CONTAINER,
role: ROLE_TEXT,
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
children: [
{ role: ROLE_STATICTEXT }, // left quote
@ -1233,7 +1233,7 @@
// HTML:time
obj = {
role: ROLE_TEXT_CONTAINER,
role: ROLE_TEXT,
attributes: { "xml-roles": "time", "datetime": "2001-05-15 19:00" },
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
};

View File

@ -111,6 +111,7 @@ const ROLE_STATUSBAR = nsIAccessibleRole.ROLE_STATUSBAR;
const ROLE_SWITCH = nsIAccessibleRole.ROLE_SWITCH;
const ROLE_TABLE = nsIAccessibleRole.ROLE_TABLE;
const ROLE_TERM = nsIAccessibleRole.ROLE_TERM;
const ROLE_TEXT = nsIAccessibleRole.ROLE_TEXT;
const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER;
const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;
const ROLE_TOGGLE_BUTTON = nsIAccessibleRole.ROLE_TOGGLE_BUTTON;

View File

@ -39,7 +39,7 @@
testRole("aria_list", ROLE_LIST);
testRole("aria_listbox", ROLE_LISTBOX);
testRole("aria_listitem", ROLE_LISTITEM);
testRole("aria_log", ROLE_TEXT_CONTAINER); // weak role
testRole("aria_log", ROLE_TEXT); // weak role
testRole("aria_marquee", ROLE_ANIMATION);
testRole("aria_math", ROLE_FLAT_EQUATION);
testRole("aria_menu", ROLE_MENUPOPUP);
@ -48,7 +48,7 @@
testRole("aria_menuitemcheckbox", ROLE_CHECK_MENU_ITEM);
testRole("aria_menuitemradio", ROLE_RADIO_MENU_ITEM);
testRole("aria_note", ROLE_NOTE);
testRole("aria_presentation", ROLE_TEXT_CONTAINER); // weak role
testRole("aria_presentation", ROLE_TEXT); // weak role
testRole("aria_progressbar", ROLE_PROGRESSBAR);
testRole("aria_radio", ROLE_RADIOBUTTON);
testRole("aria_radiogroup", ROLE_RADIO_GROUP);
@ -66,7 +66,7 @@
testRole("aria_tablist", ROLE_PAGETABLIST);
testRole("aria_tabpanel", ROLE_PROPERTYPAGE);
testRole("aria_textbox", ROLE_ENTRY);
testRole("aria_timer", ROLE_TEXT_CONTAINER); // weak role
testRole("aria_timer", ROLE_TEXT); // weak role
testRole("aria_toolbar", ROLE_TOOLBAR);
testRole("aria_tooltip", ROLE_TOOLTIP);
testRole("aria_tree", ROLE_OUTLINE);

View File

@ -67,9 +67,9 @@
testRole("definitiondescription", ROLE_DEFINITION);
// Has click, mousedown or mouseup listeners.
testRole("span1", ROLE_TEXT_CONTAINER);
testRole("span2", ROLE_TEXT_CONTAINER);
testRole("span3", ROLE_TEXT_CONTAINER);
testRole("span1", ROLE_TEXT);
testRole("span2", ROLE_TEXT);
testRole("span3", ROLE_TEXT);
// Test role of listbox inside combobox
testRole("listbox1", ROLE_COMBOBOX_LIST);

View File

@ -35,7 +35,7 @@
role: ROLE_LIST,
children: [
{ // li
role: ROLE_PARAGRAPH,
role: ROLE_TEXT_CONTAINER,
children: [
{ // li text leaf
role: ROLE_TEXT_LEAF,

View File

@ -73,10 +73,10 @@
// Presentation list, expose generic accesisble for list items.
tree =
{ SECTION: [ // container
{ PARAGRAPH: [ // li generic accessible inside 'presentation' role
{ TEXT_CONTAINER: [ // li generic accessible inside 'presentation' role
{ TEXT_LEAF: [ ] } // li text
] },
{ PARAGRAPH: [ // li generic accessible inside 'none' role
{ TEXT_CONTAINER: [ // li generic accessible inside 'none' role
{ TEXT_LEAF: [ ] } // li text
] }
] };

View File

@ -20,15 +20,15 @@
{
var tree =
{ DOCUMENT: [
{ PARAGRAPH: [ // head
{ PARAGRAPH: [ // link
{ TEXT_CONTAINER: [ // head
{ TEXT_CONTAINER: [ // link
{ STATICTEXT: [] }, // generated content
{ STATICTEXT: [] } // generated content
] }
] },
{ TEXT_LEAF: [ ] }, // body text
{ ENTRY: [ ] }, // input under document element
{ PARAGRAPH: [ // link under document element
{ TEXT_CONTAINER: [ // link under document element
{ TEXT_LEAF: [ ] }, // link content
{ STATICTEXT: [ ] }, // generated content
{ STATICTEXT: [ ] } // generated content

View File

@ -20,7 +20,7 @@
document.getElementsByTagName("img")[0].firstChild.data = "2";
var accTree = {
role: ROLE_TEXT_CONTAINER,
role: ROLE_TEXT,
children: [ { role: ROLE_TEXT_LEAF } ]
};
testAccessibleTree("the_img", accTree);

View File

@ -120,7 +120,7 @@
children: []
},
{ // abbr tag
role: ROLE_TEXT_CONTAINER,
role: ROLE_TEXT,
name: "accessibility",
children: [
{ // text leaf with actual text
@ -150,7 +150,7 @@
children: []
},
{ // acronym tag
role: ROLE_TEXT_CONTAINER,
role: ROLE_TEXT,
name: "personal computer",
children: [
{ // text leaf with actual text

View File

@ -84,7 +84,7 @@
}
}
function removeTextData(aID)
function removeTextData(aID, aRole)
{
this.containerNode = getNode(aID);
this.textNode = this.containerNode.firstChild;
@ -96,7 +96,7 @@
this.invoke = function removeTextData_invoke()
{
var tree = {
role: ROLE_PARAGRAPH,
role: aRole,
children: [
{
role: ROLE_TEXT_LEAF,
@ -112,7 +112,7 @@
this.finalCheck = function removeTextData_finalCheck()
{
var tree = {
role: ROLE_PARAGRAPH,
role: aRole,
children: []
};
testAccessibleTree(this.containerNode, tree);
@ -147,8 +147,8 @@
gQueue.push(new setOnClickNRoleAttrs("span"));
// text data removal of text node should remove its text accessible
gQueue.push(new removeTextData("p"));
gQueue.push(new removeTextData("pre"));
gQueue.push(new removeTextData("p", ROLE_PARAGRAPH));
gQueue.push(new removeTextData("pre", ROLE_TEXT_CONTAINER));
gQueue.invoke(); // SimpleTest.finish() will be called in the end
}

View File

@ -106,8 +106,11 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
// focus events, to correlate back to data nodes in their internal object
// model.
Accessible* accessible = GetAccessible();
*aUniqueID = - NS_PTR_TO_INT32(accessible ? accessible->UniqueID() :
static_cast<void*>(this));
if (accessible) {
*aUniqueID = AccessibleWrap::GetChildIDFor(accessible);
} else {
*aUniqueID = - NS_PTR_TO_INT32(static_cast<void*>(this));
}
*aNumChildren = mNode->GetChildCount();

View File

@ -50,21 +50,6 @@ var FullScreen = {
this._fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
}
// On OS X Lion we don't want to hide toolbars when entering fullscreen, unless
// we're entering DOM fullscreen, in which case we should hide the toolbars.
// If we're leaving fullscreen, then we'll go through the exit code below to
// make sure toolbars are made visible in the case of DOM fullscreen.
if (enterFS && this.useLionFullScreen) {
if (document.mozFullScreen) {
this.showXULChrome("toolbar", false);
}
else {
gNavToolbox.setAttribute("inFullscreen", true);
document.documentElement.setAttribute("inFullscreen", true);
}
return;
}
// show/hide menubars, toolbars (except the full screen toolbar)
this.showXULChrome("toolbar", !enterFS);
@ -238,9 +223,14 @@ var FullScreen = {
if (!gPrefService.getBoolPref("browser.fullscreen.autohide"))
return false;
// a popup menu is open in chrome: don't collapse chrome
if (!forceHide && this._isPopupOpen)
return false;
if (!forceHide) {
// a popup menu is open in chrome: don't collapse chrome
if (this._isPopupOpen)
return false;
// On OS X Lion we don't want to hide toolbars.
if (this.useLionFullScreen)
return false;
}
// a textbox in chrome is focused (location bar anyone?): don't collapse chrome
if (document.commandDispatcher.focusedElement &&
@ -448,7 +438,7 @@ var FullScreen = {
// Track whether mouse is near the toolbox
this._isChromeCollapsed = false;
if (trackMouse) {
if (trackMouse && !this.useLionFullScreen) {
let rect = gBrowser.mPanelContainer.getBoundingClientRect();
this._mouseTargetRect = {
top: rect.top + 50,

View File

@ -11,13 +11,13 @@ const BASE_URL = Services.prefs.getCharPref("loop.server");
function* checkFxA401() {
let err = MozLoopService.errors.get("login");
ise(err.code, 401, "Check error code");
ise(err.friendlyMessage, getLoopString("could_not_authenticate"),
"Check friendlyMessage");
ise(err.friendlyDetails, getLoopString("password_changed_question"),
"Check friendlyDetails");
ise(err.friendlyDetailsButtonLabel, getLoopString("retry_button"),
"Check friendlyDetailsButtonLabel");
is(err.code, 401, "Check error code");
is(err.friendlyMessage, getLoopString("could_not_authenticate"),
"Check friendlyMessage");
is(err.friendlyDetails, getLoopString("password_changed_question"),
"Check friendlyDetails");
is(err.friendlyDetailsButtonLabel, getLoopString("retry_button"),
"Check friendlyDetailsButtonLabel");
let loopButton = document.getElementById("loop-button");
is(loopButton.getAttribute("state"), "error",
"state of loop button should be error after a 401 with login");
@ -65,11 +65,11 @@ add_task(function* checkOAuthParams() {
yield promiseOAuthParamsSetup(BASE_URL, params);
let client = yield MozLoopServiceInternal.promiseFxAOAuthClient();
for (let key of Object.keys(params)) {
ise(client.parameters[key], params[key], "Check " + key + " was passed to the OAuth client");
is(client.parameters[key], params[key], "Check " + key + " was passed to the OAuth client");
}
let prefName = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA);
let padding = "X".repeat(HAWK_TOKEN_LENGTH - params.client_id.length);
ise(Services.prefs.getCharPref(prefName), params.client_id + padding, "Check FxA hawk token");
is(Services.prefs.getCharPref(prefName), params.client_id + padding, "Check FxA hawk token");
});
add_task(function* basicAuthorization() {
@ -82,7 +82,7 @@ add_task(function* sameOAuthClientForTwoCalls() {
yield resetFxA();
let client1 = yield MozLoopServiceInternal.promiseFxAOAuthClient();
let client2 = yield MozLoopServiceInternal.promiseFxAOAuthClient();
ise(client1, client2, "The same client should be returned");
is(client1, client2, "The same client should be returned");
});
add_task(function* paramsInvalid() {
@ -120,9 +120,9 @@ add_task(function* params_no_hawk_session() {
});
ok(caught, "Should have caught the rejection");
let prefName = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA);
ise(Services.prefs.getPrefType(prefName),
Services.prefs.PREF_INVALID,
"Check FxA hawk token is not set");
is(Services.prefs.getPrefType(prefName),
Services.prefs.PREF_INVALID,
"Check FxA hawk token is not set");
});
add_task(function* params_nonJSON() {
@ -299,9 +299,9 @@ add_task(function* basicAuthorizationAndRegistration() {
statusChangedPromise = promiseObserverNotified("loop-status-changed", "login");
let tokenData = yield MozLoopService.logInToFxA();
yield statusChangedPromise;
ise(tokenData.access_token, "code1_access_token", "Check access_token");
ise(tokenData.scope, "profile", "Check scope");
ise(tokenData.token_type, "bearer", "Check token_type");
is(tokenData.access_token, "code1_access_token", "Check access_token");
is(tokenData.scope, "profile", "Check scope");
is(tokenData.token_type, "bearer", "Check token_type");
is(MozLoopService.userProfile.email, "test@example.com", "email should exist in the profile data");
is(MozLoopService.userProfile.uid, "1234abcd", "uid should exist in the profile data");
@ -309,10 +309,10 @@ add_task(function* basicAuthorizationAndRegistration() {
is(loopButton.getAttribute("state"), "active", "state of loop button should be active when logged in");
let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, "https://localhost/pushUrl/fxa-calls",
"Check registered push URL");
ise(registrationResponse.response.simplePushURLs.rooms, "https://localhost/pushUrl/fxa-rooms",
"Check registered push URL");
is(registrationResponse.response.simplePushURLs.calls, "https://localhost/pushUrl/fxa-calls",
"Check registered push URL");
is(registrationResponse.response.simplePushURLs.rooms, "https://localhost/pushUrl/fxa-rooms",
"Check registered push URL");
let loopPanel = document.getElementById("loop-notification-panel");
loopPanel.hidePopup();
@ -326,8 +326,8 @@ add_task(function* basicAuthorizationAndRegistration() {
yield MozLoopService.logOutFromFxA();
checkLoggedOutState();
registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response, null,
"Check registration was deleted on the server");
is(registrationResponse.response, null,
"Check registration was deleted on the server");
is(visibleEmail.textContent, "Guest", "Guest should be displayed on the panel again after logout");
is(MozLoopService.userProfile, null, "userProfile should be null after logout");
});
@ -350,7 +350,7 @@ add_task(function* loginWithParams401() {
ok(false, "Promise should have rejected");
},
error => {
ise(error.code, 401, "Check error code");
is(error.code, 401, "Check error code");
checkFxAOAuthTokenData(null);
});
@ -365,7 +365,7 @@ add_task(function* logoutWithIncorrectPushURL() {
Services.prefs.setCharPref(fxASessionPref, "X".repeat(HAWK_TOKEN_LENGTH));
yield MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, "calls", pushURL);
let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL");
is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL");
MozLoopServiceInternal.pushURLs.get(LOOP_SESSION_TYPE.FXA).calls = "http://www.example.com/invalid";
let caught = false;
yield MozLoopService.logOutFromFxA().catch((error) => {
@ -374,7 +374,7 @@ add_task(function* logoutWithIncorrectPushURL() {
ok(caught, "Should have caught an error logging out with a mismatched push URL");
checkLoggedOutState();
registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted");
is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted");
});
add_task(function* logoutWithNoPushURL() {
@ -386,12 +386,12 @@ add_task(function* logoutWithNoPushURL() {
yield MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, "calls", pushURL);
let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL");
is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL");
MozLoopServiceInternal.pushURLs.delete(LOOP_SESSION_TYPE.FXA);
yield MozLoopService.logOutFromFxA();
checkLoggedOutState();
registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted");
is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted");
});
add_task(function* loginWithRegistration401() {
@ -411,7 +411,7 @@ add_task(function* loginWithRegistration401() {
ok(false, "Promise should have rejected");
},
error => {
ise(error.code, 401, "Check error code");
is(error.code, 401, "Check error code");
checkFxAOAuthTokenData(null);
});

View File

@ -68,10 +68,10 @@ add_task(function* token_request() {
yield promiseOAuthParamsSetup(BASE_URL, params);
let request = yield promiseToken("my_code", params.state);
ise(request.status, 200, "Check token response status");
ise(request.response.access_token, "my_code_access_token", "Check access_token");
ise(request.response.scope, "profile", "Check scope");
ise(request.response.token_type, "bearer", "Check token_type");
is(request.status, 200, "Check token response status");
is(request.response.access_token, "my_code_access_token", "Check access_token");
is(request.response.scope, "profile", "Check scope");
is(request.response.token_type, "bearer", "Check token_type");
});
add_task(function* token_request_invalid_state() {
@ -84,8 +84,8 @@ add_task(function* token_request_invalid_state() {
};
yield promiseOAuthParamsSetup(BASE_URL, params);
let request = yield promiseToken("my_code", "my_state");
ise(request.status, 400, "Check token response status");
ise(request.response, null, "Check token response body");
is(request.status, 400, "Check token response status");
is(request.response, null, "Check token response body");
});

View File

@ -157,18 +157,18 @@ function* resetFxA() {
}
function checkFxAOAuthTokenData(aValue) {
ise(MozLoopServiceInternal.fxAOAuthTokenData, aValue, "fxAOAuthTokenData should be " + aValue);
is(MozLoopServiceInternal.fxAOAuthTokenData, aValue, "fxAOAuthTokenData should be " + aValue);
}
function checkLoggedOutState() {
let global = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
ise(global.gFxAOAuthClientPromise, null, "gFxAOAuthClientPromise should be cleared");
ise(MozLoopService.userProfile, null, "fxAOAuthProfile should be cleared");
ise(global.gFxAOAuthClient, null, "gFxAOAuthClient should be cleared");
is(global.gFxAOAuthClientPromise, null, "gFxAOAuthClientPromise should be cleared");
is(MozLoopService.userProfile, null, "fxAOAuthProfile should be cleared");
is(global.gFxAOAuthClient, null, "gFxAOAuthClient should be cleared");
checkFxAOAuthTokenData(null);
const fxASessionPref = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA);
ise(Services.prefs.getPrefType(fxASessionPref), Services.prefs.PREF_INVALID,
"FxA hawk session should be cleared anyways");
is(Services.prefs.getPrefType(fxASessionPref), Services.prefs.PREF_INVALID,
"FxA hawk session should be cleared anyways");
}
function promiseDeletedOAuthParams(baseURL) {

View File

@ -38,27 +38,27 @@ let gTests = [{
let dialog = yield dialogPromise;
// Check focus is in the textbox
ise(dialog.document.activeElement.value, "Default text", "Textbox with correct text is focused");
is(dialog.document.activeElement.value, "Default text", "Textbox with correct text is focused");
// Titlebar
ise(content.document.getElementById("dialogTitle").textContent, "Sample sub-dialog",
"Dialog title should be correct initially");
is(content.document.getElementById("dialogTitle").textContent, "Sample sub-dialog",
"Dialog title should be correct initially");
let receivedEvent = waitForEvent(gBrowser.selectedBrowser, "DOMTitleChanged");
dialog.document.title = "Updated title";
// Wait for the title change listener
yield receivedEvent;
ise(content.document.getElementById("dialogTitle").textContent, "Updated title",
"Dialog title should be updated with changes");
is(content.document.getElementById("dialogTitle").textContent, "Updated title",
"Dialog title should be updated with changes");
let closingPromise = promiseDialogClosing(dialog);
// Accept the dialog
dialog.document.documentElement.acceptDialog();
let closingEvent = yield closingPromise;
ise(closingEvent.detail.button, "accept", "closing event should indicate button was 'accept'");
is(closingEvent.detail.button, "accept", "closing event should indicate button was 'accept'");
yield deferredClose.promise;
ise(rv.acceptCount, 1, "return value should have been updated");
is(rv.acceptCount, 1, "return value should have been updated");
},
},
{
@ -76,10 +76,10 @@ let gTests = [{
dialog.document.documentElement.cancelDialog();
let closingEvent = yield closingPromise;
ise(closingEvent.detail.button, "cancel", "closing event should indicate button was 'cancel'");
is(closingEvent.detail.button, "cancel", "closing event should indicate button was 'cancel'");
yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated");
is(rv.acceptCount, 0, "return value should NOT have been updated");
},
},
{
@ -96,10 +96,10 @@ let gTests = [{
dialog.window.close();
let closingEvent = yield closingPromise;
ise(closingEvent.detail.button, null, "closing event should indicate no button was clicked");
is(closingEvent.detail.button, null, "closing event should indicate no button was clicked");
yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated");
is(rv.acceptCount, 0, "return value should NOT have been updated");
},
},
{
@ -115,7 +115,7 @@ let gTests = [{
content.window);
yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated");
is(rv.acceptCount, 0, "return value should NOT have been updated");
},
},
{
@ -131,7 +131,7 @@ let gTests = [{
content.gSubDialog._frame.goBack();
yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated");
is(rv.acceptCount, 0, "return value should NOT have been updated");
},
},
{
@ -146,7 +146,7 @@ let gTests = [{
EventUtils.synthesizeKey("VK_ESCAPE", {}, content.window);
yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated");
is(rv.acceptCount, 0, "return value should NOT have been updated");
},
},
{
@ -157,8 +157,8 @@ let gTests = [{
(aEvent) => dialogClosingCallback(deferredClose, aEvent));
let dialog = yield dialogPromise;
ise(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
ise(content.gSubDialog._frame.style.height, "5em", "Height should be set on the frame from the dialog");
is(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
is(content.gSubDialog._frame.style.height, "5em", "Height should be set on the frame from the dialog");
content.gSubDialog.close();
yield deferredClose.promise;
@ -194,10 +194,10 @@ let gTests = [{
let dialog = yield dialogPromise;
ise(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
is(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
let docEl = content.gSubDialog._frame.contentDocument.documentElement;
ok(docEl.scrollHeight > oldHeight, "Content height increased (from " + oldHeight + " to " + docEl.scrollHeight + ").");
ise(content.gSubDialog._frame.style.height, docEl.scrollHeight + "px", "Height on the frame should be higher now");
is(content.gSubDialog._frame.style.height, docEl.scrollHeight + "px", "Height on the frame should be higher now");
content.gSubDialog.close();
yield deferredClose.promise;
@ -217,7 +217,7 @@ let gTests = [{
let dialog = yield dialogPromise;
ise(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
is(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
let newHeight = content.gSubDialog._frame.contentDocument.documentElement.scrollHeight;
ok(parseInt(content.gSubDialog._frame.style.height) < window.innerHeight,
"Height on the frame should be smaller than window's innerHeight");
@ -261,10 +261,10 @@ function dialogClosingCallback(aPromise, aEvent) {
waitForEvent(content.gSubDialog._frame, "load", 4000).then((aEvt) => {
info("Load event happened: " + !(aEvt instanceof Error));
is_element_hidden(content.gSubDialog._overlay, "Overlay is not visible");
ise(content.gSubDialog._frame.getAttribute("style"), "",
"Check that inline styles were cleared");
ise(content.gSubDialog._frame.contentWindow.location.toString(), "about:blank",
"Check the sub-dialog was unloaded");
is(content.gSubDialog._frame.getAttribute("style"), "",
"Check that inline styles were cleared");
is(content.gSubDialog._frame.contentWindow.location.toString(), "about:blank",
"Check the sub-dialog was unloaded");
if (gTeardownAfterClose) {
content.close();
finish();

View File

@ -51,8 +51,8 @@ function promiseLoadSubDialog(aURL) {
return;
content.gSubDialog._frame.removeEventListener("load", load);
ise(content.gSubDialog._frame.contentWindow.location.toString(), aURL,
"Check the proper URL is loaded");
is(content.gSubDialog._frame.contentWindow.location.toString(), aURL,
"Check the proper URL is loaded");
// Check visibility
is_element_visible(content.gSubDialog._overlay, "Overlay is visible");
@ -66,7 +66,7 @@ function promiseLoadSubDialog(aURL) {
expectedStyleSheetURLs.splice(i, 1);
}
}
ise(expectedStyleSheetURLs.length, 0, "All expectedStyleSheetURLs should have been found");
is(expectedStyleSheetURLs.length, 0, "All expectedStyleSheetURLs should have been found");
resolve(content.gSubDialog._frame.contentWindow);
});

View File

@ -17,10 +17,10 @@ let tests = [
function test_untrusted_host(done) {
loadUITourTestPage(function() {
let bookmarksMenu = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
gContentAPI.showMenu("bookmarks");
ise(bookmarksMenu.open, false, "Bookmark menu should not open on a untrusted host");
is(bookmarksMenu.open, false, "Bookmark menu should not open on a untrusted host");
done();
}, "http://mochi.test:8888/");
@ -45,10 +45,10 @@ let tests = [
function test_unsecure_host(done) {
loadUITourTestPage(function() {
let bookmarksMenu = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
gContentAPI.showMenu("bookmarks");
ise(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
done();
}, "http://example.com/");
@ -69,10 +69,10 @@ let tests = [
Services.prefs.setBoolPref("browser.uitour.enabled", false);
let bookmarksMenu = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
gContentAPI.showMenu("bookmarks");
ise(bookmarksMenu.open, false, "Bookmark menu should not open when feature is disabled");
is(bookmarksMenu.open, false, "Bookmark menu should not open when feature is disabled");
Services.prefs.setBoolPref("browser.uitour.enabled", true);
done();

View File

@ -70,7 +70,7 @@ let tests = [
taskify(function* test_bookmarks_menu() {
let bookmarksMenuButton = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenuButton.open, false, "Menu should initially be closed");
is(bookmarksMenuButton.open, false, "Menu should initially be closed");
gContentAPI.showMenu("bookmarks");
yield waitForConditionPromise(() => {

View File

@ -26,8 +26,8 @@ let tests = [
gContentAPI.showHighlight("urlbar");
waitForElementToBeVisible(highlight, function checkPanelAttributes() {
SimpleTest.executeSoon(() => {
ise(highlight.height, "", "Highlight panel should have no explicit height set");
ise(highlight.width, "", "Highlight panel should have no explicit width set");
is(highlight.height, "", "Highlight panel should have no explicit height set");
is(highlight.width, "", "Highlight panel should have no explicit width set");
done();
});
}, "Highlight should be moved to the urlbar");
@ -40,8 +40,8 @@ let tests = [
gContentAPI.showInfo("urlbar", "new title", "new text");
waitForElementToBeVisible(tooltip, function checkPanelAttributes() {
SimpleTest.executeSoon(() => {
ise(tooltip.height, "", "Info panel should have no explicit height set");
ise(tooltip.width, "", "Info panel should have no explicit width set");
is(tooltip.height, "", "Info panel should have no explicit height set");
is(tooltip.width, "", "Info panel should have no explicit width set");
done();
});
}, "Tooltip should be moved to the urlbar");

View File

@ -31,7 +31,7 @@ let tests = [
taskify(function* test_gettingStartedClicked_linkOpenedWithExpectedParams() {
Services.prefs.setBoolPref("loop.gettingStarted.seen", false);
Services.prefs.setCharPref("loop.gettingStarted.url", "http://example.com");
ise(loopButton.open, false, "Menu should initially be closed");
is(loopButton.open, false, "Menu should initially be closed");
loopButton.click();
yield waitForConditionPromise(() => {
@ -69,7 +69,7 @@ let tests = [
UITour.pageIDsForSession.clear();
Services.prefs.setCharPref("loop.gettingStarted.url", "http://example.com");
ise(loopButton.open, false, "Menu should initially be closed");
is(loopButton.open, false, "Menu should initially be closed");
loopButton.click();
yield waitForConditionPromise(() => {
@ -106,7 +106,7 @@ let tests = [
taskify(function* test_menu_show_hide() {
// The targets to highlight only appear after getting started is launched.
Services.prefs.setBoolPref("loop.gettingStarted.seen", true);
ise(loopButton.open, false, "Menu should initially be closed");
is(loopButton.open, false, "Menu should initially be closed");
gContentAPI.showMenu("loop");
yield waitForConditionPromise(() => {
@ -301,7 +301,7 @@ let tests = [
LoopRooms.open("fakeTourRoom");
}),
taskify(function* test_arrow_panel_position() {
ise(loopButton.open, false, "Menu should initially be closed");
is(loopButton.open, false, "Menu should initially be closed");
let popup = document.getElementById("UITourTooltip");
yield showMenuPromise("loop");
@ -344,7 +344,7 @@ let tests = [
let observationPromise = new Promise((resolve) => {
gContentAPI.observe((event, params) => {
is(event, "Loop:IncomingConversation", "Page should have been notified about incoming conversation");
ise(params.conversationOpen, false, "conversationOpen should be false");
is(params.conversationOpen, false, "conversationOpen should be false");
is(gBrowser.selectedTab, gTestTab, "The same tab should be selected");
resolve();
});

View File

@ -16,7 +16,7 @@ function test() {
let tests = [
taskify(function* test_menu_show_navbar() {
ise(button.open, false, "Menu should initially be closed");
is(button.open, false, "Menu should initially be closed");
gContentAPI.showMenu("pocket");
// The panel gets created dynamically.
@ -36,7 +36,7 @@ let tests = [
taskify(function* test_menu_show_appMenu() {
CustomizableUI.addWidgetToArea("pocket-button", CustomizableUI.AREA_PANEL);
ise(PanelUI.multiView.hasAttribute("panelopen"), false, "Multiview should initially be closed");
is(PanelUI.multiView.hasAttribute("panelopen"), false, "Multiview should initially be closed");
gContentAPI.showMenu("pocket");
yield waitForConditionPromise(() => {

View File

@ -50,9 +50,9 @@ let tests = [
tabBrowser.addEventListener("load", function onload(evt) {
tabBrowser.removeEventListener("load", onload, true);
ise(tabBrowser.contentDocument.location.href,
"about:accounts?action=signup&entrypoint=uitour",
"about:accounts should have replaced the tab");
is(tabBrowser.contentDocument.location.href,
"about:accounts?action=signup&entrypoint=uitour",
"about:accounts should have replaced the tab");
// the iframe in about:accounts will still be loading, so we stop
// that before resetting the pref.

View File

@ -14,39 +14,39 @@ let { WebAudioFront } =
function* testTarget (client, target) {
yield target.makeRemote();
ise(target.hasActor("timeline"), true, "target.hasActor() true when actor exists.");
ise(target.hasActor("webaudio"), true, "target.hasActor() true when actor exists.");
ise(target.hasActor("notreal"), false, "target.hasActor() false when actor does not exist.");
is(target.hasActor("timeline"), true, "target.hasActor() true when actor exists.");
is(target.hasActor("webaudio"), true, "target.hasActor() true when actor exists.");
is(target.hasActor("notreal"), false, "target.hasActor() false when actor does not exist.");
// Create a front to ensure the actor is loaded
let front = new WebAudioFront(target.client, target.form);
let desc = yield target.getActorDescription("webaudio");
ise(desc.typeName, "webaudio",
is(desc.typeName, "webaudio",
"target.getActorDescription() returns definition data for corresponding actor");
ise(desc.events["start-context"]["type"], "startContext",
is(desc.events["start-context"]["type"], "startContext",
"target.getActorDescription() returns event data for corresponding actor");
desc = yield target.getActorDescription("nope");
ise(desc, undefined, "target.getActorDescription() returns undefined for non-existing actor");
is(desc, undefined, "target.getActorDescription() returns undefined for non-existing actor");
desc = yield target.getActorDescription();
ise(desc, undefined, "target.getActorDescription() returns undefined for undefined actor");
is(desc, undefined, "target.getActorDescription() returns undefined for undefined actor");
let hasMethod = yield target.actorHasMethod("audionode", "getType");
ise(hasMethod, true,
is(hasMethod, true,
"target.actorHasMethod() returns true for existing actor with method");
hasMethod = yield target.actorHasMethod("audionode", "nope");
ise(hasMethod, false,
is(hasMethod, false,
"target.actorHasMethod() returns false for existing actor with no method");
hasMethod = yield target.actorHasMethod("nope", "nope");
ise(hasMethod, false,
is(hasMethod, false,
"target.actorHasMethod() returns false for non-existing actor with no method");
hasMethod = yield target.actorHasMethod();
ise(hasMethod, false,
is(hasMethod, false,
"target.actorHasMethod() returns false for undefined params");
ise(target.getTrait("customHighlighters"), true,
is(target.getTrait("customHighlighters"), true,
"target.getTrait() returns boolean when trait exists");
ise(target.getTrait("giddyup"), undefined,
is(target.getTrait("giddyup"), undefined,
"target.getTrait() returns undefined when trait does not exist");
close(target, client);

View File

@ -17,7 +17,7 @@ function spawnTest () {
"A `_profilerStartTime` property exists in the recording model.");
ok(startModel._timelineStartTime !== undefined,
"A `_timelineStartTime` property exists in the recording model.");
ise(startModel._memoryStartTime, 0,
is(startModel._memoryStartTime, 0,
"A `_memoryStartTime` property exists in the recording model, but it's 0.");
yield busyWait(WAIT_TIME);

View File

@ -41,7 +41,7 @@ function compare (actual, expected, type) {
ok(expected[param](value), type + " has a passing value for " + param);
}
else {
ise(value, expected[param], type + " has correct default value and type for " + param);
is(value, expected[param], type + " has correct default value and type for " + param);
}
});

View File

@ -14,10 +14,10 @@ add_task(function*() {
let freq = yield oscNode.getParam("frequency");
info(typeof freq);
ise(freq, 440, "AudioNode:getParam correctly fetches AudioParam");
is(freq, 440, "AudioNode:getParam correctly fetches AudioParam");
let type = yield oscNode.getParam("type");
ise(type, "sine", "AudioNode:getParam correctly fetches non-AudioParam");
is(type, "sine", "AudioNode:getParam correctly fetches non-AudioParam");
type = yield oscNode.getParam("not-a-valid-param");
ok(type.type === "undefined",
@ -25,12 +25,12 @@ add_task(function*() {
let resSuccess = yield oscNode.setParam("frequency", 220);
freq = yield oscNode.getParam("frequency");
ise(freq, 220, "AudioNode:setParam correctly sets a `number` AudioParam");
is(freq, 220, "AudioNode:setParam correctly sets a `number` AudioParam");
is(resSuccess, undefined, "AudioNode:setParam returns undefined for correctly set AudioParam");
resSuccess = yield oscNode.setParam("type", "square");
type = yield oscNode.getParam("type");
ise(type, "square", "AudioNode:setParam correctly sets a `string` non-AudioParam");
is(type, "square", "AudioNode:setParam correctly sets a `string` non-AudioParam");
is(resSuccess, undefined, "AudioNode:setParam returns undefined for correctly set AudioParam");
try {
@ -40,7 +40,7 @@ add_task(function*() {
ok(/is not a finite floating-point/.test(e.message), "AudioNode:setParam returns error with correct message when attempting an invalid assignment");
is(e.type, "TypeError", "AudioNode:setParam returns error with correct type when attempting an invalid assignment");
freq = yield oscNode.getParam("frequency");
ise(freq, 220, "AudioNode:setParam does not modify value when an error occurs");
is(freq, 220, "AudioNode:setParam does not modify value when an error occurs");
}
yield removeTab(target.tab);

View File

@ -26,7 +26,7 @@ add_task(function*() {
is(error.name, "TypeError", "error has correct name");
is(error.message, "Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error has correct message");
is(error.stringified, "TypeError: Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error is stringified correctly");
ise(error.instanceof, true, "error is correctly an instanceof TypeError");
is(error.instanceof, true, "error is correctly an instanceof TypeError");
is(error.fileName, "http://example.com/browser/browser/devtools/webaudioeditor/test/doc_bug_1112378.html", "error has correct fileName");
error = yield evalInDebuggee("throwDOMException()");
@ -37,7 +37,7 @@ add_task(function*() {
is(error.name, "NotSupportedError", "exception has correct name");
is(error.message, "Operation is not supported", "exception has correct message");
is(error.stringified, "NotSupportedError: Operation is not supported", "exception is stringified correctly");
ise(error.instanceof, true, "exception is correctly an instance of DOMException");
is(error.instanceof, true, "exception is correctly an instance of DOMException");
is(error.filename, "http://example.com/browser/browser/devtools/webaudioeditor/test/doc_bug_1112378.html", "exception has correct filename");
yield teardown(target);

View File

@ -19,8 +19,8 @@ add_task(function*() {
]);
var { nodes, edges } = countGraphObjects(panelWin);
ise(nodes, 3, "should only be 3 nodes.");
ise(edges, 2, "should only be 2 edges.");
is(nodes, 3, "should only be 3 nodes.");
is(edges, 2, "should only be 2 edges.");
navigate(target, SIMPLE_NODES_URL);
@ -37,8 +37,8 @@ add_task(function*() {
"The tool's content should reappear without closing and reopening the toolbox.");
var { nodes, edges } = countGraphObjects(panelWin);
ise(nodes, 15, "after navigation, should have 15 nodes");
ise(edges, 0, "after navigation, should have 0 edges.");
is(nodes, 15, "after navigation, should have 15 nodes");
is(edges, 0, "after navigation, should have 0 edges.");
yield teardown(target);
});

View File

@ -19,8 +19,8 @@ add_task(function*() {
]);
let { nodes, edges } = countGraphObjects(panelWin);
ise(nodes, 3, "should only be 3 nodes.");
ise(edges, 2, "should only be 2 edges.");
is(nodes, 3, "should only be 3 nodes.");
is(edges, 2, "should only be 2 edges.");
reload(target);
@ -30,8 +30,8 @@ add_task(function*() {
]);
({ nodes, edges } = countGraphObjects(panelWin));
ise(nodes, 3, "after reload, should only be 3 nodes.");
ise(edges, 2, "after reload, should only be 2 edges.");
is(nodes, 3, "after reload, should only be 3 nodes.");
is(edges, 2, "after reload, should only be 2 edges.");
yield teardown(target);
});

View File

@ -36,7 +36,7 @@ add_task(function*() {
nodeIds = actors.map(actor => actor.actorID);
ok(!InspectorView.isVisible(), "InspectorView hidden on start.");
ise(InspectorView.getCurrentAudioNode(), null,
is(InspectorView.getCurrentAudioNode(), null,
"InspectorView has no current node set on reset.");
yield clickGraphNode(panelWin, nodeIds[2], true);

View File

@ -278,7 +278,7 @@ function checkVariableView (view, index, hash, description = "") {
"Passing property value of " + value + " for " + variable + " " + description);
}
else {
ise(value, hash[variable],
is(value, hash[variable],
"Correct property value of " + hash[variable] + " for " + variable + " " + description);
}
});
@ -540,4 +540,4 @@ const NODE_CONSTRUCTORS = {
"DynamicsCompressorNode": "DynamicsCompressor",
"OscillatorNode": "Oscillator",
"StereoPannerNode": "StereoPanner"
};
};

View File

@ -64,10 +64,10 @@ let inputTests = [
// 7
{
input: "Date.prototype",
output: "Date",
output: /Object \{.*\}/,
printOutput: "Invalid Date",
inspectable: true,
variablesViewLabel: "Date",
variablesViewLabel: "Object",
},
// 8

View File

@ -133,17 +133,6 @@ case "$target" in
AC_MSG_ERROR([not found. Please check your NDK. With the current configuration, it should be in $android_platform])
fi
dnl Old NDK support. If minimum requirement is changed to NDK r8b,
dnl please remove this.
case "$target_cpu" in
i?86)
if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
dnl Old NDK toolchain name
android_tool_prefix="i686-android-linux"
fi
;;
esac
dnl set up compilers
TOOLCHAIN_PREFIX="$android_toolchain/bin/$android_tool_prefix-"
AS="$android_toolchain"/bin/"$android_tool_prefix"-as
@ -223,18 +212,14 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
if test -z "$STLPORT_CPPFLAGS$STLPORT_LIBS"; then
if test -n "$MOZ_ANDROID_LIBSTDCXX" ; then
if test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/libgnustl_static.a"; then
# android-ndk-r8b
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/ -lgnustl_static"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include/backward"
elif test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/libgnustl_static.a"; then
# android-ndk-r7, android-ndk-r7b, android-ndk-r8
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/ -lgnustl_static"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/include"
elif test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/libstdc++.a"; then
# android-ndk-r5c, android-ndk-r6, android-ndk-r6b
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/include"
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/ -lstdc++"
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version"
ndk_libs="$ndk_base/libs/$ANDROID_CPU_ARCH"
ndk_include="$ndk_base/include"
if test -e "$ndk_libs/libgnustl_static.a"; then
STLPORT_LIBS="-L$ndk_libs -lgnustl_static"
STLPORT_CPPFLAGS="-I$ndk_include -I$ndk_include/backward -I$ndk_libs/include"
else
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi

View File

@ -7278,7 +7278,7 @@ if test "$OS_TARGET" = Android; then
if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then
MOZ_GLUE_WRAP_LDFLAGS="${MOZ_GLUE_WRAP_LDFLAGS} -Wl,--wrap=pthread_create,--wrap=epoll_wait,--wrap=poll,--wrap=pthread_cond_timedwait,--wrap=pthread_cond_wait,--wrap=epoll_create,--wrap=epoll_ctl,--wrap=close,--wrap=pthread_key_create,--wrap=pthread_key_delete,--wrap=socketpair,--wrap=pthread_self,--wrap=pthread_mutex_lock,--wrap=pthread_mutex_trylock,--wrap=pthread_join,--wrap=pipe,--wrap=pipe2"
fi
if test "$MOZ_WIDGET_TOOLKIT" = android; then
if test "$MOZ_WIDGET_TOOLKIT" = android -a "$MOZ_ANDROID_MIN_SDK_VERSION" -lt 11; then
MOZ_GLUE_WRAP_LDFLAGS="${MOZ_GLUE_WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
fi
fi

View File

@ -6685,11 +6685,7 @@ nsDocShell::DoAppRedirectIfNeeded(nsIURI* aURI,
nsIDocShellLoadInfo* aLoadInfo,
bool aFirstParty)
{
uint32_t appId;
nsresult rv = GetAppId(&appId);
if (NS_FAILED(rv)) {
return false;
}
uint32_t appId = nsIDocShell::GetAppId();
if (appId != nsIScriptSecurityManager::NO_APP_ID &&
appId != nsIScriptSecurityManager::UNKNOWN_APP_ID) {
@ -6697,7 +6693,7 @@ nsDocShell::DoAppRedirectIfNeeded(nsIURI* aURI,
do_GetService(APPS_SERVICE_CONTRACTID);
NS_ASSERTION(appsService, "No AppsService available");
nsCOMPtr<nsIURI> redirect;
rv = appsService->GetRedirect(appId, aURI, getter_AddRefs(redirect));
nsresult rv = appsService->GetRedirect(appId, aURI, getter_AddRefs(redirect));
if (NS_SUCCEEDED(rv) && redirect) {
rv = LoadURI(redirect, aLoadInfo, nsIWebNavigation::LOAD_FLAGS_NONE,
aFirstParty);
@ -13845,9 +13841,7 @@ nsDocShell::GetAppId(uint32_t* aAppId)
NS_IMETHODIMP
nsDocShell::GetAppManifestURL(nsAString& aAppManifestURL)
{
uint32_t appId;
GetAppId(&appId);
uint32_t appId = nsIDocShell::GetAppId();
if (appId != nsIScriptSecurityManager::NO_APP_ID &&
appId != nsIScriptSecurityManager::UNKNOWN_APP_ID) {
nsCOMPtr<nsIAppsService> appsService =

View File

@ -1,7 +1,7 @@
/**
* Import common SimpleTest methods so that they're usable in this window.
*/
var imports = [ "SimpleTest", "is", "isnot", "ise", "ok", "onerror", "todo",
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror", "todo",
"todo_is", "todo_isnot" ];
for each (var name in imports) {
window[name] = window.opener.wrappedJSObject[name];

View File

@ -13,6 +13,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/SegmentedVector.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/dom/FragmentOrElement.h"
@ -1225,24 +1226,12 @@ FragmentOrElement::FireNodeInserted(nsIDocument* aDoc,
//----------------------------------------------------------------------
// nsISupports implementation
#define SUBTREE_UNBINDINGS_PER_RUNNABLE 500
class ContentUnbinder : public nsRunnable
class ContentUnbinder
{
public:
ContentUnbinder()
{
mLast = this;
}
static const size_t kSegmentSize = sizeof(void*) * 512;
typedef SegmentedVector<nsCOMPtr<nsIContent>, kSegmentSize, InfallibleAllocPolicy> ContentArray;
~ContentUnbinder()
{
Run();
}
void UnbindSubtree(nsIContent* aNode)
static void UnbindSubtree(nsIContent* aNode)
{
if (aNode->NodeType() != nsIDOMNode::ELEMENT_NODE &&
aNode->NodeType() != nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
@ -1268,76 +1257,56 @@ public:
}
}
NS_IMETHOD Run()
// These two methods are based on DeferredFinalizerImpl.
static void*
AppendContentUnbinderPointer(void* aData, void* aObject)
{
ContentArray* contentArray = static_cast<ContentArray*>(aData);
if (!contentArray) {
contentArray = new ContentArray();
}
contentArray->InfallibleAppend(dont_AddRef(static_cast<nsIContent*>(aObject)));
return contentArray;
}
static bool
DeferredFinalize(uint32_t aSliceBudget, void* aData)
{
MOZ_ASSERT(aSliceBudget > 0, "nonsensical/useless call with aSliceBudget == 0");
nsAutoScriptBlocker scriptBlocker;
uint32_t len = mSubtreeRoots.Length();
if (len) {
PRTime start = PR_Now();
for (uint32_t i = 0; i < len; ++i) {
UnbindSubtree(mSubtreeRoots[i]);
}
mSubtreeRoots.Clear();
Telemetry::Accumulate(Telemetry::CYCLE_COLLECTOR_CONTENT_UNBIND,
uint32_t(PR_Now() - start) / PR_USEC_PER_MSEC);
ContentArray* contentArray = static_cast<ContentArray*>(aData);
size_t numToRemove = contentArray->Length();
if (aSliceBudget < numToRemove) {
numToRemove = aSliceBudget;
}
for (size_t i = 0; i < numToRemove; ++i) {
nsCOMPtr<nsIContent> element = contentArray->GetLast().forget();
contentArray->PopLast();
UnbindSubtree(element);
}
nsCycleCollector_dispatchDeferredDeletion();
if (this == sContentUnbinder) {
sContentUnbinder = nullptr;
if (mNext) {
nsRefPtr<ContentUnbinder> next;
next.swap(mNext);
sContentUnbinder = next;
next->mLast = mLast;
mLast = nullptr;
NS_DispatchToMainThread(next);
}
if (contentArray->Length() == 0) {
delete contentArray;
return true;
}
return NS_OK;
return false;
}
static void UnbindAll()
public:
static void
Append(nsIContent* aSubtreeRoot)
{
nsRefPtr<ContentUnbinder> ub = sContentUnbinder;
sContentUnbinder = nullptr;
while (ub) {
ub->Run();
ub = ub->mNext;
}
nsCOMPtr<nsIContent> root = aSubtreeRoot;
mozilla::DeferredFinalize(AppendContentUnbinderPointer, DeferredFinalize, root.forget().take());
}
static void Append(nsIContent* aSubtreeRoot)
{
if (!sContentUnbinder) {
sContentUnbinder = new ContentUnbinder();
nsCOMPtr<nsIRunnable> e = sContentUnbinder;
NS_DispatchToMainThread(e);
}
if (sContentUnbinder->mLast->mSubtreeRoots.Length() >=
SUBTREE_UNBINDINGS_PER_RUNNABLE) {
sContentUnbinder->mLast->mNext = new ContentUnbinder();
sContentUnbinder->mLast = sContentUnbinder->mLast->mNext;
}
sContentUnbinder->mLast->mSubtreeRoots.AppendElement(aSubtreeRoot);
}
private:
nsAutoTArray<nsCOMPtr<nsIContent>,
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
nsRefPtr<ContentUnbinder> mNext;
ContentUnbinder* mLast;
static ContentUnbinder* sContentUnbinder;
};
ContentUnbinder* ContentUnbinder::sContentUnbinder = nullptr;
void
FragmentOrElement::ClearContentUnbinder()
{
ContentUnbinder::UnbindAll();
}
NS_IMPL_CYCLE_COLLECTION_CLASS(FragmentOrElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)

View File

@ -215,7 +215,6 @@ public:
mRefCnt.RemovePurple();
}
static void ClearContentUnbinder();
static bool CanSkip(nsINode* aNode, bool aRemovingAllowed);
static bool CanSkipInCC(nsINode* aNode);
static bool CanSkipThis(nsINode* aNode);

View File

@ -1792,53 +1792,6 @@ WebSocket::CreateAndDispatchCloseEvent(bool aWasClean,
return DispatchDOMEvent(nullptr, event, nullptr, nullptr);
}
namespace {
class PrefEnabledRunnable final : public WorkerMainThreadRunnable
{
public:
explicit PrefEnabledRunnable(WorkerPrivate* aWorkerPrivate)
: WorkerMainThreadRunnable(aWorkerPrivate)
, mEnabled(false)
{ }
bool MainThreadRun() override
{
AssertIsOnMainThread();
mEnabled = Preferences::GetBool("dom.workers.websocket.enabled", false);
return true;
}
bool IsEnabled() const
{
return mEnabled;
}
private:
bool mEnabled;
};
} // anonymous namespace
bool
WebSocket::PrefEnabled(JSContext* /* aCx */, JSObject* /* aGlobal */)
{
// WebSockets are always enabled on main-thread.
if (NS_IsMainThread()) {
return true;
}
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
MOZ_ASSERT(workerPrivate);
workerPrivate->AssertIsOnWorkerThread();
nsRefPtr<PrefEnabledRunnable> runnable =
new PrefEnabledRunnable(workerPrivate);
runnable->Dispatch(workerPrivate->GetJSContext());
return runnable->IsEnabled();
}
nsresult
WebSocketImpl::ParseURL(const nsAString& aURL)
{

View File

@ -317,8 +317,6 @@ nsCCUncollectableMarker::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData)
{
if (!strcmp(aTopic, "xpcom-shutdown")) {
Element::ClearContentUnbinder();
nsCOMPtr<nsIObserverService> obs =
mozilla::services::GetObserverService();
if (!obs)
@ -343,9 +341,6 @@ nsCCUncollectableMarker::Observe(nsISupports* aSubject, const char* aTopic,
!strcmp(aTopic, "cycle-collector-forget-skippable");
bool prepareForCC = !strcmp(aTopic, "cycle-collector-begin");
if (prepareForCC) {
Element::ClearContentUnbinder();
}
// Increase generation to effectively unmark all current objects
if (!++sGeneration) {

View File

@ -22,9 +22,7 @@
NS_IMPL_ISUPPORTS(nsContentPolicy, nsIContentPolicy)
#ifdef PR_LOGGING
static PRLogModuleInfo* gConPolLog;
#endif
nsresult
NS_NewContentPolicy(nsIContentPolicy **aResult)
@ -40,11 +38,9 @@ nsContentPolicy::nsContentPolicy()
: mPolicies(NS_CONTENTPOLICY_CATEGORY)
, mSimplePolicies(NS_SIMPLECONTENTPOLICY_CATEGORY)
{
#ifdef PR_LOGGING
if (! gConPolLog) {
gConPolLog = PR_NewLogModule("nsContentPolicy");
}
#endif
}
nsContentPolicy::~nsContentPolicy()
@ -187,14 +183,12 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
return NS_OK;
}
#ifdef PR_LOGGING
//uses the parameters from ShouldXYZ to produce and log a message
//logType must be a literal string constant
#define LOG_CHECK(logType) \
PR_BEGIN_MACRO \
/* skip all this nonsense if the call failed */ \
if (NS_SUCCEEDED(rv)) { \
/* skip all this nonsense if the call failed or logging is disabled */ \
if (NS_SUCCEEDED(rv) && PR_LOG_TEST(gConPolLog, PR_LOG_DEBUG)) { \
const char *resultName; \
if (decision) { \
resultName = NS_CP_ResponseName(*decision); \
@ -216,12 +210,6 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
} \
PR_END_MACRO
#else //!defined(PR_LOGGING)
#define LOG_CHECK(logType)
#endif //!defined(PR_LOGGING)
NS_IMETHODIMP
nsContentPolicy::ShouldLoad(uint32_t contentType,
nsIURI *contentLocation,

View File

@ -56,7 +56,6 @@ class nsIPrincipal;
case nsIContentPolicy:: name : \
return #name
#ifdef PR_LOGGING
/**
* Returns a string corresponding to the name of the response constant, or
* "<Unknown Response>" if an unknown response value is given.
@ -119,8 +118,6 @@ NS_CP_ContentTypeName(uint32_t contentType)
}
}
#endif // defined(PR_LOGGING)
#undef CASE_RETURN
/* Passes on parameters from its "caller"'s context. */

View File

@ -9,9 +9,7 @@
#include "base/basictypes.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetDataChannelLog();
#endif
#undef LOG
#define LOG(args) PR_LOG(GetDataChannelLog(), PR_LOG_DEBUG, args)

View File

@ -241,10 +241,8 @@ using namespace mozilla::dom;
typedef nsTArray<Link*> LinkArray;
#ifdef PR_LOGGING
static PRLogModuleInfo* gDocumentLeakPRLog;
static PRLogModuleInfo* gCspPRLog;
#endif
#define NAME_NOT_VALID ((nsSimpleContentList*)1)
@ -1591,7 +1589,6 @@ nsDocument::nsDocument(const char* aContentType)
{
SetContentTypeInternal(nsDependentCString(aContentType));
#ifdef PR_LOGGING
if (!gDocumentLeakPRLog)
gDocumentLeakPRLog = PR_NewLogModule("DocumentLeak");
@ -1601,7 +1598,6 @@ nsDocument::nsDocument(const char* aContentType)
if (!gCspPRLog)
gCspPRLog = PR_NewLogModule("CSP");
#endif
// Start out mLastStyleSheetSet as null, per spec
SetDOMStringToNull(mLastStyleSheetSet);
@ -1640,11 +1636,9 @@ nsIDocument::~nsIDocument()
nsDocument::~nsDocument()
{
#ifdef PR_LOGGING
if (gDocumentLeakPRLog)
PR_LOG(gDocumentLeakPRLog, PR_LOG_DEBUG,
("DOCUMENT %p destroyed", this));
#endif
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
@ -2309,13 +2303,11 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
{
NS_PRECONDITION(aURI, "Null URI passed to ResetToURI");
#ifdef PR_LOGGING
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
nsAutoCString spec;
aURI->GetSpec(spec);
PR_LogPrint("DOCUMENT %p ResetToURI %s", this, spec.get());
}
#endif
mSecurityInfo = nullptr;
@ -2644,7 +2636,6 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
nsIStreamListener **aDocListener,
bool aReset, nsIContentSink* aSink)
{
#ifdef PR_LOGGING
if (gDocumentLeakPRLog && PR_LOG_TEST(gDocumentLeakPRLog, PR_LOG_DEBUG)) {
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
@ -2653,17 +2644,9 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
uri->GetSpec(spec);
PR_LogPrint("DOCUMENT %p StartDocumentLoad %s", this, spec.get());
}
#endif
#ifdef DEBUG
{
uint32_t appId;
nsresult rv = NodePrincipal()->GetAppId(&appId);
NS_ENSURE_SUCCESS(rv, rv);
MOZ_ASSERT(appId != nsIScriptSecurityManager::UNKNOWN_APP_ID,
"Document should never have UNKNOWN_APP_ID");
}
#endif
MOZ_ASSERT(NodePrincipal()->GetAppId() != nsIScriptSecurityManager::UNKNOWN_APP_ID,
"Document should never have UNKNOWN_APP_ID");
MOZ_ASSERT(GetReadyStateEnum() == nsIDocument::READYSTATE_UNINITIALIZED,
"Bad readyState");
@ -2787,13 +2770,11 @@ AppendCSPFromHeader(nsIContentSecurityPolicy* csp,
const nsSubstring& policy = tokenizer.nextToken();
rv = csp->AppendPolicy(policy, aReportOnly);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef PR_LOGGING
{
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("CSP refined with policy: \"%s\"",
NS_ConvertUTF16toUTF8(policy).get()));
}
#endif
}
return NS_OK;
}
@ -2830,10 +2811,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
{
nsCOMPtr<nsIContentSecurityPolicy> csp;
if (!CSPService::sCSPEnabled) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("CSP is disabled, skipping CSP init for document %p", this));
#endif
return NS_OK;
}
@ -2864,16 +2843,14 @@ nsDocument::InitCSP(nsIChannel* aChannel)
if (appStatus != nsIPrincipal::APP_STATUS_NOT_INSTALLED) {
nsCOMPtr<nsIAppsService> appsService = do_GetService(APPS_SERVICE_CONTRACTID);
if (appsService) {
uint32_t appId = 0;
if (NS_SUCCEEDED(principal->GetAppId(&appId))) {
appsService->GetManifestCSPByLocalId(appId, appManifestCSP);
if (!appManifestCSP.IsEmpty()) {
applyAppManifestCSP = true;
}
appsService->GetDefaultCSPByLocalId(appId, appDefaultCSP);
if (!appDefaultCSP.IsEmpty()) {
applyAppDefaultCSP = true;
}
uint32_t appId = principal->GetAppId();
appsService->GetManifestCSPByLocalId(appId, appManifestCSP);
if (!appManifestCSP.IsEmpty()) {
applyAppManifestCSP = true;
}
appsService->GetDefaultCSPByLocalId(appId, appDefaultCSP);
if (!appDefaultCSP.IsEmpty()) {
applyAppDefaultCSP = true;
}
}
}
@ -2887,22 +2864,21 @@ nsDocument::InitCSP(nsIChannel* aChannel)
!applyLoopCSP &&
cspHeaderValue.IsEmpty() &&
cspROHeaderValue.IsEmpty()) {
#ifdef PR_LOGGING
nsCOMPtr<nsIURI> chanURI;
aChannel->GetURI(getter_AddRefs(chanURI));
nsAutoCString aspec;
chanURI->GetAsciiSpec(aspec);
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("no CSP for document, %s, %s",
aspec.get(),
applyAppDefaultCSP ? "is app" : "not an app"));
#endif
if (PR_LOG_TEST(gCspPRLog, PR_LOG_DEBUG)) {
nsCOMPtr<nsIURI> chanURI;
aChannel->GetURI(getter_AddRefs(chanURI));
nsAutoCString aspec;
chanURI->GetAsciiSpec(aspec);
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("no CSP for document, %s, %s",
aspec.get(),
applyAppDefaultCSP ? "is app" : "not an app"));
}
return NS_OK;
}
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Document is an app or CSP header specified %p", this));
#endif
nsresult rv;
@ -2921,12 +2897,10 @@ nsDocument::InitCSP(nsIChannel* aChannel)
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s %s",
"This document is sharing principal with another document.",
"Since the document is an app, CSP was already set.",
"Skipping attempt to set CSP."));
#endif
return NS_OK;
}
}
@ -2934,9 +2908,7 @@ nsDocument::InitCSP(nsIChannel* aChannel)
csp = do_CreateInstance("@mozilla.org/cspcontext;1", &rv);
if (NS_FAILED(rv)) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("Failed to create CSP object: %x", rv));
#endif
return rv;
}
@ -2989,10 +2961,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = csp->PermitsAncestry(docShell, &safeAncestry);
if (NS_FAILED(rv) || !safeAncestry) {
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("CSP doesn't like frame's ancestry, not loading."));
#endif
// stop! ERROR page!
aChannel->Cancel(NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION);
}
@ -3011,13 +2981,11 @@ nsDocument::InitCSP(nsIChannel* aChannel)
mReferrerPolicySet = true;
} else if (mReferrerPolicy != referrerPolicy) {
mReferrerPolicy = mozilla::net::RP_No_Referrer;
#ifdef PR_LOGGING
{
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("%s %s",
"CSP wants to set referrer, but nsDocument"
"already has it set. No referrers will be sent"));
}
#endif
}
// Referrer Policy is set separately for the speculative parser in
@ -3027,10 +2995,8 @@ nsDocument::InitCSP(nsIChannel* aChannel)
rv = principal->SetCsp(csp);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef PR_LOGGING
PR_LOG(gCspPRLog, PR_LOG_DEBUG,
("Inserted CSP into principal %p", principal));
#endif
return NS_OK;
}

View File

@ -71,38 +71,27 @@ using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::widget;
#ifdef PR_LOGGING
// Two types of focus pr logging are available:
// 'Focus' for normal focus manager calls
// 'FocusNavigation' for tab and document navigation
PRLogModuleInfo* gFocusLog;
PRLogModuleInfo* gFocusNavigationLog;
#define LOGFOCUS(args) PR_LOG(gFocusLog, 4, args)
#define LOGFOCUSNAVIGATION(args) PR_LOG(gFocusNavigationLog, 4, args)
#define LOGFOCUS(args) PR_LOG(gFocusLog, PR_LOG_DEBUG, args)
#define LOGFOCUSNAVIGATION(args) PR_LOG(gFocusNavigationLog, PR_LOG_DEBUG, args)
#define LOGTAG(log, format, content) \
{ \
if (PR_LOG_TEST(log, PR_LOG_DEBUG)) { \
nsAutoCString tag(NS_LITERAL_CSTRING("(none)")); \
if (content) { \
content->NodeInfo()->NameAtom()->ToUTF8String(tag); \
} \
PR_LOG(log, 4, (format, tag.get())); \
PR_LOG(log, PR_LOG_DEBUG, (format, tag.get())); \
}
#define LOGCONTENT(format, content) LOGTAG(gFocusLog, format, content)
#define LOGCONTENTNAVIGATION(format, content) LOGTAG(gFocusNavigationLog, format, content)
#else
#define LOGFOCUS(args)
#define LOGFOCUSNAVIGATION(args)
#define LOGCONTENT(format, content)
#define LOGCONTENTNAVIGATION(format, content)
#endif
struct nsDelayedBlurOrFocusEvent
{
nsDelayedBlurOrFocusEvent(uint32_t aType,
@ -198,10 +187,8 @@ nsFocusManager::Init()
NS_ADDREF(fm);
sInstance = fm;
#ifdef PR_LOGGING
gFocusLog = PR_NewLogModule("Focus");
gFocusNavigationLog = PR_NewLogModule("FocusNavigation");
#endif
nsIContent::sTabFocusModelAppliesToXUL =
Preferences::GetBool("accessibility.tabfocus_applies_to_xul",
@ -493,7 +480,6 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
{
*aElement = nullptr;
#ifdef PR_LOGGING
LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG) && mFocusedWindow) {
@ -506,7 +492,6 @@ nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
}
LOGCONTENT(" Current Focus: %s", mFocusedContent.get());
#endif
// use FLAG_BYMOVEFOCUS when switching focus with MoveFocus unless one of
// the other focus methods is already set, or we're just moving to the root
@ -653,7 +638,6 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@ -670,7 +654,6 @@ nsFocusManager::WindowRaised(nsIDOMWindow* aWindow)
}
}
}
#endif
if (mActiveWindow == window) {
// The window is already active, so there is no need to focus anything,
@ -751,7 +734,6 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aWindow);
NS_ENSURE_TRUE(window && window->IsOuterWindow(), NS_ERROR_INVALID_ARG);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@ -768,7 +750,6 @@ nsFocusManager::WindowLowered(nsIDOMWindow* aWindow)
}
}
}
#endif
if (mActiveWindow != window)
return NS_OK;
@ -871,7 +852,6 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
window = window->GetOuterWindow();
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@ -889,7 +869,6 @@ nsFocusManager::WindowShown(nsIDOMWindow* aWindow, bool aNeedsFocus)
}
}
}
#endif
if (nsCOMPtr<nsITabChild> child = do_GetInterface(window->GetDocShell())) {
bool active = static_cast<TabChild*>(child.get())->ParentIsActive();
@ -928,7 +907,6 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
window = window->GetOuterWindow();
#ifdef PR_LOGGING
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
LOGFOCUS(("Window %p Hidden [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
nsAutoCString spec;
@ -954,7 +932,6 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
}
}
}
#endif
if (!IsSameOrAncestor(window, mFocusedWindow))
return NS_OK;
@ -1799,7 +1776,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
clearFirstFocusEvent = true;
}
#ifdef PR_LOGGING
LOGCONTENT("Element %s has been focused", aContent);
if (PR_LOG_TEST(gFocusLog, PR_LOG_DEBUG)) {
@ -1810,7 +1786,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
LOGFOCUS((" [Newdoc: %d FocusChanged: %d Raised: %d Flags: %x]",
aIsNewDocument, aFocusChanged, aWindowRaised, aFlags));
}
#endif
if (aIsNewDocument) {
// if this is a new document, update the parent chain of frames so that

View File

@ -246,9 +246,7 @@ class nsIScriptTimeoutHandler;
#include <android/log.h>
#endif
#ifdef PR_LOGGING
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
#ifdef XP_WIN
#include <process.h>
@ -1212,11 +1210,9 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
}
#endif
#ifdef PR_LOGGING
if (gDOMLeakPRLog)
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
("DOMWINDOW %p created outer=%p", this, aOuterWindow));
#endif
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
NS_ASSERTION(!sWindowsById->Get(mWindowID),
@ -1248,10 +1244,8 @@ nsGlobalWindow::Init()
NS_ASSERTION(gEntropyCollector,
"gEntropyCollector should have been initialized!");
#ifdef PR_LOGGING
gDOMLeakPRLog = PR_NewLogModule("DOMLeak");
NS_ASSERTION(gDOMLeakPRLog, "gDOMLeakPRLog should have been initialized!");
#endif
sWindowsById = new WindowByIdTable();
}
@ -1306,11 +1300,9 @@ nsGlobalWindow::~nsGlobalWindow()
}
#endif
#ifdef PR_LOGGING
if (gDOMLeakPRLog)
PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG,
("DOMWINDOW %p destroyed", this));
#endif
if (IsOuterWindow()) {
JSObject *proxy = GetWrapperPreserveColor();
@ -2812,7 +2804,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
NS_PRECONDITION(IsInnerWindow(), "Must only be called on inner windows");
MOZ_ASSERT(aDocument);
#ifdef PR_LOGGING
if (gDOMLeakPRLog && PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
nsIURI *uri = aDocument->GetDocumentURI();
nsAutoCString spec;
@ -2820,7 +2811,6 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
uri->GetSpec(spec);
PR_LogPrint("DOMWINDOW %p SetNewDocument %s", this, spec.get());
}
#endif
mDoc = aDocument;
ClearDocumentDependentSlots(aCx);
@ -8438,13 +8428,8 @@ nsGlobalWindow::PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
nsCOMPtr<nsIPrincipal> principal = nsContentUtils::SubjectPrincipal();
MOZ_ASSERT(principal);
uint32_t appId;
if (NS_WARN_IF(NS_FAILED(principal->GetAppId(&appId))))
return;
bool isInBrowser;
if (NS_WARN_IF(NS_FAILED(principal->GetIsInBrowserElement(&isInBrowser))))
return;
uint32_t appId = principal->GetAppId();
bool isInBrowser = principal->GetIsInBrowserElement();
// Create a nsIPrincipal inheriting the app/browser attributes from the
// caller.
@ -10573,11 +10558,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
if (mSessionStorage) {
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p has %p sessionStorage", this, mSessionStorage.get());
}
#endif
bool canAccess = mSessionStorage->CanAccess(principal);
NS_ASSERTION(canAccess,
"This window owned sessionStorage "
@ -10626,11 +10609,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
mSessionStorage = static_cast<DOMStorage*>(storage.get());
MOZ_ASSERT(mSessionStorage);
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p tried to get a new sessionStorage %p", this, mSessionStorage.get());
}
#endif
if (!mSessionStorage) {
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
@ -10638,11 +10619,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
}
}
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get());
}
#endif
return mSessionStorage;
}
@ -11558,12 +11537,10 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
#ifdef PR_LOGGING
if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) {
PR_LogPrint("nsGlobalWindow %p with sessionStorage %p passing event from %p",
this, mSessionStorage.get(), changingStorage.get());
}
#endif
fireMozStorageChanged = mSessionStorage == changingStorage;
break;

View File

@ -36,9 +36,7 @@ using mozilla::dom::NodeInfo;
#include "prlog.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* gNodeInfoManagerLeakPRLog;
#endif
PLHashNumber
nsNodeInfoManager::GetNodeInfoInnerHashValue(const void *key)
@ -117,14 +115,12 @@ nsNodeInfoManager::nsNodeInfoManager()
{
nsLayoutStatics::AddRef();
#ifdef PR_LOGGING
if (!gNodeInfoManagerLeakPRLog)
gNodeInfoManagerLeakPRLog = PR_NewLogModule("NodeInfoManagerLeak");
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
("NODEINFOMANAGER %p created", this));
#endif
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
NodeInfoInnerKeyCompare,
@ -142,11 +138,9 @@ nsNodeInfoManager::~nsNodeInfoManager()
mBindingManager = nullptr;
#ifdef PR_LOGGING
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
("NODEINFOMANAGER %p destroyed", this));
#endif
nsLayoutStatics::Release();
}
@ -201,11 +195,9 @@ nsNodeInfoManager::Init(nsIDocument *aDocument)
mDocument = aDocument;
#ifdef PR_LOGGING
if (gNodeInfoManagerLeakPRLog)
PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
("NODEINFOMANAGER %p Init document=%p", this, aDocument));
#endif
return NS_OK;
}

View File

@ -106,7 +106,6 @@ static const char *kPrefJavaMIME = "plugin.java.mime";
using namespace mozilla;
using namespace mozilla::dom;
#ifdef PR_LOGGING
static PRLogModuleInfo*
GetObjectLog()
{
@ -115,7 +114,6 @@ GetObjectLog()
sLog = PR_NewLogModule("objlc");
return sLog;
}
#endif
#define LOG(args) PR_LOG(GetObjectLog(), PR_LOG_DEBUG, args)
#define LOG_ENABLED() PR_LOG_TEST(GetObjectLog(), PR_LOG_DEBUG)

View File

@ -54,9 +54,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/unused.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* gCspPRLog;
#endif
using namespace mozilla;
using namespace mozilla::dom;
@ -109,10 +107,8 @@ nsScriptLoader::nsScriptLoader(nsIDocument *aDocument)
mBlockingDOMContentLoaded(false)
{
// enable logging for CSP
#ifdef PR_LOGGING
if (!gCspPRLog)
gCspPRLog = PR_NewLogModule("CSP");
#endif
}
nsScriptLoader::~nsScriptLoader()

View File

@ -107,7 +107,7 @@ function checkResponseXMLAccessThrows(xhr) {
function checkSetResponseType(xhr, type) {
var didthrow = false;
try { xhr.responseType = type; } catch (e) { didthrow = true; }
ise(xhr.responseType, type, "responseType should be " + type);
is(xhr.responseType, type, "responseType should be " + type);
ok(!didthrow, "should not have thrown when setting responseType");
}
function checkSetResponseTypeThrows(xhr, type) {

View File

@ -46,7 +46,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1075702
test1.addEventListener("DOMAttrModified", mutationHandler, true);
var removedNodeAccordingToRemoveNamedItemNS = test1.attributes.removeNamedItemNS(null, "x");
test1.removeEventListener("DOMAttrModified", mutationHandler, true);
ise(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItemNS, "Node removed according to event is not same as node removed by removeNamedItemNS.");
is(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItemNS, "Node removed according to event is not same as node removed by removeNamedItemNS.");
}
testremoveNamedItemNS();
@ -59,7 +59,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1075702
test2.addEventListener("DOMAttrModified", mutationHandler, true);
var removedNodeAccordingToRemoveNamedItem = test2.attributes.removeNamedItem("x");
test2.removeEventListener("DOMAttrModified", mutationHandler, true);
ise(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItem, "Node removed according to event is not same as node removed by removeNamedItem.");
is(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItem, "Node removed according to event is not same as node removed by removeNamedItem.");
}
testremoveNamedItem();

View File

@ -16,30 +16,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=891952
var all = document.all;
is(all["content"], $("content"), "Should find the content");
ok(!("" in all), "Should not have an empty string prop on document.all");
ise(all[""], undefined, "Should not get empty string on document.all");
ise(all.namedItem(""), null,
"namedItem for empty string should return null on document.all");
is(all[""], undefined, "Should not get empty string on document.all");
is(all.namedItem(""), null,
"namedItem for empty string should return null on document.all");
var divs = document.getElementsByTagName("div");
ok(!("" in divs), "Should not have an empty string prop on getElementsByTagName");
ise(divs[""], undefined, "Should not get empty string on getElementsByTagName");
ise(divs.namedItem(""), null,
"namedItem for empty string should return null on getElementsByTagName");
is(divs[""], undefined, "Should not get empty string on getElementsByTagName");
is(divs.namedItem(""), null,
"namedItem for empty string should return null on getElementsByTagName");
var forms = document.forms;
ok(!("" in forms), "Should not have an empty string prop on document.forms");
ise(forms[""], undefined, "Should not get empty string on document.forms");
ise(forms.namedItem(""), null,
"namedItem for empty string should return null on document.forms");
is(forms[""], undefined, "Should not get empty string on document.forms");
is(forms.namedItem(""), null,
"namedItem for empty string should return null on document.forms");
var form = $("form");
ok(!("" in form), "Should not have an empty string prop on form");
ise(form[""], undefined, "Should not get empty string on form");
is(form[""], undefined, "Should not get empty string on form");
var formEls = $("form").elements;
ok(!("" in formEls), "Should not have an empty string prop on form.elements");
ise(formEls[""], undefined, "Should not get empty string on form.elements");
ise(formEls.namedItem(""), null,
"namedItem for empty string should return null on form.elements");
is(formEls[""], undefined, "Should not get empty string on form.elements");
is(formEls.namedItem(""), null,
"namedItem for empty string should return null on form.elements");
SimpleTest.finish();
});

View File

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=999456
SimpleTest.waitForExplicitFinish();
addEventListener("load", function (e) {
ise(e.cancelable, false, "Load events should not be cancelable");
is(e.cancelable, false, "Load events should not be cancelable");
SimpleTest.finish();
});

View File

@ -54,10 +54,10 @@ function testAPIs() {
});
Promise.all(promises).then(function(values) {
for (var i = 0; i < values.length; ++i) {
ise(values[i], APIEndPoints[i].enabled,
"Endpoint " + APIEndPoints[i].name + " resolved with the correct value. " +
"If this is failing because you're changing how an API is exposed, you " +
"must contact the Marketplace team to let them know about the change.");
is(values[i], APIEndPoints[i].enabled,
"Endpoint " + APIEndPoints[i].name + " resolved with the correct value. " +
"If this is failing because you're changing how an API is exposed, you " +
"must contact the Marketplace team to let them know about the change.");
}
SimpleTest.finish();
}, function() {

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=949471
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 949471 **/
ise(history.state, null, "history.state should be null by default");
is(history.state, null, "history.state should be null by default");
</script>
</head>
<body>

View File

@ -26,27 +26,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=930450
var url = new URL('http://www.example.com:8080');
is(url.port, '8080', 'URL.port is 8080');
url.port = '';
ise(url.port, '', 'URL.port is \'\'');
is(url.port, '', 'URL.port is \'\'');
url.port = 0;
ise(url.port, '0', 'URL.port is 0');
is(url.port, '0', 'URL.port is 0');
var link = document.getElementById("link");
is(link.port, '8080', 'URL.port is 8080');
link.port = '';
is(link.href, 'http://www.example.com/', "link.href matches");
ise(link.port, '', 'URL.port is \'\'');
is(link.port, '', 'URL.port is \'\'');
link.port = 0;
is(link.href, 'http://www.example.com:0/', "link.href matches");
ise(link.port, '0', 'URL.port is 0');
is(link.port, '0', 'URL.port is 0');
var area = document.getElementById("area");
is(area.port, '8080', 'URL.port is 8080');
area.port = '';
is(area.href, 'http://www.example.com/', "area.href matches");
ise(area.port, '', 'URL.port is \'\'');
is(area.port, '', 'URL.port is \'\'');
area.port = 0;
is(area.href, 'http://www.example.com:0/', "area.href matches");
ise(area.port, '0', 'URL.port is 0');
is(area.port, '0', 'URL.port is 0');
</script>
</body>

View File

@ -15,19 +15,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107443
Object.defineProperty(window, "nosuchprop", { value: 5 });
throw "didn't throw";
} catch (e) {
ise(e instanceof TypeError, true,
"defineProperty(window) with a non-configurable property should " +
"throw a TypeError, instead got: " + e);
ise(Object.getOwnPropertyDescriptor(window, "nosuchprop"), undefined,
'Window should not have property after an attempt to define it failed');
is(e instanceof TypeError, true,
"defineProperty(window) with a non-configurable property should " +
"throw a TypeError, instead got: " + e);
is(Object.getOwnPropertyDescriptor(window, "nosuchprop"), undefined,
'Window should not have property after an attempt to define it failed');
}
Object.defineProperty(window, "nosuchprop", { value: 7, configurable: true });
var desc = Object.getOwnPropertyDescriptor(window, "nosuchprop");
ise(typeof(desc), "object", "Should have a property now");
ise(desc.configurable, true, "Property should be configurable");
ise(desc.writable, false, "Property should be readonly");
ise(desc.value, 7, "Property should have the right value");
is(typeof(desc), "object", "Should have a property now");
is(desc.configurable, true, "Property should be configurable");
is(desc.writable, false, "Property should be readonly");
is(desc.value, 7, "Property should have the right value");
</script>
</head>
<body>

View File

@ -58,8 +58,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1019417
is(names3.indexOf("crossorigin"), -1,
"Frame with cross-origin changed name should not be in GSP own prop list");
ise(Object.getOwnPropertyDescriptor(gsp, ""), undefined,
"Should not have empty string as a named frame");
is(Object.getOwnPropertyDescriptor(gsp, ""), undefined,
"Should not have empty string as a named frame");
isnot(Object.getOwnPropertyDescriptor(gsp, "x"), undefined,
"Should have about:blank subframe as a named frame");
isnot(Object.getOwnPropertyDescriptor(gsp, "y"), undefined,
@ -68,8 +68,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1019417
"Should have cross-origin subframe as a named frame");
isnot(Object.getOwnPropertyDescriptor(gsp, "sameorigin"), undefined,
"Should have same-origin changed name as a named frame");
ise(Object.getOwnPropertyDescriptor(gsp, "crossorigin"), undefined,
"Should not have cross-origin-origin changed name as a named frame");
is(Object.getOwnPropertyDescriptor(gsp, "crossorigin"), undefined,
"Should not have cross-origin-origin changed name as a named frame");
SimpleTest.finish();
});
</script>

View File

@ -28,7 +28,7 @@ function simplePostTest() {
var x = new XMLHttpRequest();
x.open("POST", "echo.sjs");
x.onload = function() {
ise(x.responseText, "somedata", "Should have processed POST");
is(x.responseText, "somedata", "Should have processed POST");
undefinedPostTest();
}
x.send({toString: function() { return "somedata"; }});
@ -38,7 +38,7 @@ function undefinedPostTest() {
var x = new XMLHttpRequest();
x.open("POST", "echo.sjs");
x.onload = function() {
ise(x.responseText, "undefined", "Should have processed POST");
is(x.responseText, "undefined", "Should have processed POST");
nullPostTest();
}
x.send({toString: function() { return undefined; }});
@ -48,7 +48,7 @@ function nullPostTest() {
var x = new XMLHttpRequest();
x.open("POST", "echo.sjs");
x.onload = function() {
ise(x.responseText, "null", "Should have processed POST");
is(x.responseText, "null", "Should have processed POST");
testExceptionInToString();
}
x.send({toString: function() { return null; }});
@ -64,7 +64,7 @@ function testExceptionInToString() {
try {
x.send({toString: function() { throw "dummy"; }});
} catch(ex) {
ise(ex, "dummy");
is(ex, "dummy");
SimpleTest.finish();
}
}

View File

@ -1086,8 +1086,7 @@ class CGHeaders(CGWrapper):
elif unrolled.isDictionary():
headerSet.add(self.getDeclarationFilename(unrolled.inner))
elif unrolled.isCallback():
# Callbacks are both a type and an object
headerSet.add(self.getDeclarationFilename(unrolled))
headerSet.add(self.getDeclarationFilename(unrolled.callback))
elif unrolled.isFloat() and not unrolled.isUnrestricted():
# Restricted floats are tested for finiteness
bindingHeaders.add("mozilla/FloatingPoint.h")
@ -1276,7 +1275,7 @@ def UnionTypes(unionTypes, config):
# Callbacks always use strong refs, so we need to include
# the right header to be able to Release() in our inlined
# code.
headers.add(CGHeaders.getDeclarationFilename(f))
headers.add(CGHeaders.getDeclarationFilename(f.callback))
elif f.isMozMap():
headers.add("mozilla/dom/MozMap.h")
# And add headers for the type we're parametrized over
@ -5130,7 +5129,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
assert not type.treatNonObjectAsNull() or type.nullable()
assert not type.treatNonObjectAsNull() or not type.treatNonCallableAsNull()
name = type.unroll().identifier.name
callback = type.unroll().callback
name = callback.identifier.name
if type.nullable():
declType = CGGeneric("nsRefPtr<%s>" % name)
else:
@ -6233,7 +6233,7 @@ def getRetvalDeclarationForType(returnType, descriptorProvider,
result = CGGeneric("auto")
return result, None, None, None, conversion
if returnType.isCallback():
name = returnType.unroll().identifier.name
name = returnType.unroll().callback.identifier.name
return CGGeneric("nsRefPtr<%s>" % name), None, None, None, None
if returnType.isAny():
if isMember:
@ -8782,7 +8782,7 @@ def getUnionAccessorSignatureType(type, descriptorProvider):
return CGGeneric(type.inner.identifier.name)
if type.isCallback():
return CGGeneric("%s&" % type.unroll().identifier.name)
return CGGeneric("%s&" % type.unroll().callback.identifier.name)
if type.isAny():
return CGGeneric("JS::Value")
@ -12414,7 +12414,7 @@ class CGForwardDeclarations(CGWrapper):
# Note: Spidermonkey interfaces are typedefs, so can't be
# forward-declared
elif t.isCallback():
builder.addInMozillaDom(str(t))
builder.addInMozillaDom(t.callback.identifier.name)
elif t.isDictionary():
builder.addInMozillaDom(t.inner.identifier.name, isStruct=True)
elif t.isCallbackInterface():
@ -12441,12 +12441,12 @@ class CGForwardDeclarations(CGWrapper):
builder.add(d.nativeType + "Atoms", isStruct=True)
for callback in mainCallbacks:
forwardDeclareForType(callback)
builder.addInMozillaDom(callback.identifier.name)
for t in getTypesFromCallback(callback):
forwardDeclareForType(t, workerness='mainthreadonly')
for callback in workerCallbacks:
forwardDeclareForType(callback)
builder.addInMozillaDom(callback.identifier.name)
for t in getTypesFromCallback(callback):
forwardDeclareForType(t, workerness='workeronly')
@ -12829,7 +12829,7 @@ class CGNativeMember(ClassMethod):
# .forget() to get our already_AddRefed.
return result.define(), "nullptr", "return ${declName}.forget();\n"
if type.isCallback():
return ("already_AddRefed<%s>" % type.unroll().identifier.name,
return ("already_AddRefed<%s>" % type.unroll().callback.identifier.name,
"nullptr", "return ${declName}.forget();\n")
if type.isAny():
if isMember:
@ -13059,7 +13059,7 @@ class CGNativeMember(ClassMethod):
else:
declType = "%s&"
if type.isCallback():
name = type.unroll().identifier.name
name = type.unroll().callback.identifier.name
else:
name = type.unroll().inner.identifier.name
return declType % name, False, False

View File

@ -48,11 +48,10 @@ class Configuration:
"%s\n"
"%s" %
(thing.location, thing.implementor.location))
# Some toplevel things are sadly types, and those have an
# isInterface that doesn't mean the same thing as IDLObject's
# isInterface()...
if (not isinstance(thing, IDLInterface) and
not isinstance(thing, IDLExternalInterface)):
assert not thing.isType();
if not thing.isInterface():
continue
iface = thing
self.interfaces[iface.identifier.name] = iface
@ -800,9 +799,9 @@ def findCallbacksAndDictionaries(inputTypes):
def doFindCallbacksAndDictionaries(types, callbacks, dictionaries):
unhandledTypes = set()
for type in types:
if type.isCallback() and type not in callbacks:
unhandledTypes |= getFlatTypes(getTypesFromCallback(type))
callbacks.add(type)
if type.isCallback() and type.callback not in callbacks:
unhandledTypes |= getFlatTypes(getTypesFromCallback(type.callback))
callbacks.add(type.callback)
elif type.isDictionary() and type.inner not in dictionaries:
d = type.inner
unhandledTypes |= getFlatTypes(getTypesFromDictionary(d))

View File

@ -164,6 +164,9 @@ class IDLObject(object):
def isUnion(self):
return False
def isTypedef(self):
return False
def getUserData(self, key, default):
return self.userData.get(key, default)
@ -1789,11 +1792,11 @@ class IDLType(IDLObject):
def treatNonCallableAsNull(self):
assert self.tag() == IDLType.Tags.callback
return self.nullable() and self.inner._treatNonCallableAsNull
return self.nullable() and self.inner.callback._treatNonCallableAsNull
def treatNonObjectAsNull(self):
assert self.tag() == IDLType.Tags.callback
return self.nullable() and self.inner._treatNonObjectAsNull
return self.nullable() and self.inner.callback._treatNonObjectAsNull
def addExtendedAttributes(self, attrs):
assert len(attrs) == 0
@ -1833,11 +1836,17 @@ class IDLUnresolvedType(IDLType):
assert obj
if obj.isType():
# obj itself might not be complete; deal with that.
assert obj != self
if not obj.isComplete():
obj = obj.complete(scope)
return obj
print obj
assert not obj.isType()
if obj.isTypedef():
assert self.name.name == obj.identifier.name
typedefType = IDLTypedefType(self.location, obj.innerType,
obj.identifier)
assert not typedefType.isComplete()
return typedefType.complete(scope)
elif obj.isCallback() and not obj.isInterface():
assert self.name.name == obj.identifier.name
return IDLCallbackType(self.location, obj)
if self._promiseInnerType and not self._promiseInnerType.isComplete():
self._promiseInnerType = self._promiseInnerType.complete(scope)
@ -2358,23 +2367,17 @@ class IDLArrayType(IDLType):
def _getDependentObjects(self):
return self.inner._getDependentObjects()
class IDLTypedefType(IDLType, IDLObjectWithIdentifier):
class IDLTypedefType(IDLType):
def __init__(self, location, innerType, name):
IDLType.__init__(self, location, innerType.name)
identifier = IDLUnresolvedIdentifier(location, name)
IDLObjectWithIdentifier.__init__(self, location, None, identifier)
IDLType.__init__(self, location, name)
self.inner = innerType
self.name = name
self.builtin = False
def __eq__(self, other):
return isinstance(other, IDLTypedefType) and self.inner == other.inner
def __str__(self):
return self.identifier.name
return self.name
def nullable(self):
return self.inner.nullable()
@ -2442,16 +2445,6 @@ class IDLTypedefType(IDLType, IDLObjectWithIdentifier):
assert self.inner.isComplete()
return self.inner
def finish(self, parentScope):
# Maybe the IDLObjectWithIdentifier for the typedef should be
# a separate thing from the type? If that happens, we can
# remove some hackery around avoiding isInterface() in
# Configuration.py.
self.complete(parentScope)
def validate(self):
pass
# Do we need a resolveType impl? I don't think it's particularly useful....
def tag(self):
@ -2466,6 +2459,31 @@ class IDLTypedefType(IDLType, IDLObjectWithIdentifier):
def _getDependentObjects(self):
return self.inner._getDependentObjects()
class IDLTypedef(IDLObjectWithIdentifier):
def __init__(self, location, parentScope, innerType, name):
identifier = IDLUnresolvedIdentifier(location, name)
IDLObjectWithIdentifier.__init__(self, location, parentScope, identifier)
self.innerType = innerType
def __str__(self):
return "Typedef %s %s" % (self.identifier.name, self.innerType)
def finish(self, parentScope):
if not self.innerType.isComplete():
self.innerType = self.innerType.complete(parentScope)
def validate(self):
pass
def isTypedef(self):
return True
def addExtendedAttributes(self, attrs):
assert len(attrs) == 0
def _getDependentObjects(self):
return self.innerType._getDependentObjects()
class IDLWrapperType(IDLType):
def __init__(self, location, inner, promiseInnerType=None):
IDLType.__init__(self, location, inner.identifier.name)
@ -3655,12 +3673,10 @@ class IDLArgument(IDLObjectWithIdentifier):
def canHaveMissingValue(self):
return self.optional and not self.defaultValue
class IDLCallbackType(IDLType, IDLObjectWithScope):
class IDLCallback(IDLObjectWithScope):
def __init__(self, location, parentScope, identifier, returnType, arguments):
assert isinstance(returnType, IDLType)
IDLType.__init__(self, location, identifier.name)
self._returnType = returnType
# Clone the list
self._arguments = list(arguments)
@ -3680,9 +3696,6 @@ class IDLCallbackType(IDLType, IDLObjectWithScope):
def signatures(self):
return [(self._returnType, self._arguments)]
def tag(self):
return IDLType.Tags.callback
def finish(self, scope):
if not self._returnType.isComplete():
type = self._returnType.complete(scope)
@ -3706,14 +3719,6 @@ class IDLCallbackType(IDLType, IDLObjectWithScope):
def validate(self):
pass
def isDistinguishableFrom(self, other):
if other.isUnion():
# Just forward to the union; it'll deal
return other.isDistinguishableFrom(self)
return (other.isPrimitive() or other.isString() or other.isEnum() or
other.isNonCallbackInterface() or other.isDate() or
other.isSequence())
def addExtendedAttributes(self, attrs):
unhandledAttrs = []
for attr in attrs:
@ -3732,6 +3737,28 @@ class IDLCallbackType(IDLType, IDLObjectWithScope):
def _getDependentObjects(self):
return set([self._returnType] + self._arguments)
class IDLCallbackType(IDLType):
def __init__(self, location, callback):
IDLType.__init__(self, location, callback.identifier.name)
self.callback = callback
def isCallback(self):
return True
def tag(self):
return IDLType.Tags.callback
def isDistinguishableFrom(self, other):
if other.isUnion():
# Just forward to the union; it'll deal
return other.isDistinguishableFrom(self)
return (other.isPrimitive() or other.isString() or other.isEnum() or
other.isNonCallbackInterface() or other.isDate() or
other.isSequence())
def _getDependentObjects(self):
return self.callback._getDependentObjects()
class IDLMethodOverload:
"""
A class that represents a single overload of a WebIDL method. This is not
@ -4738,8 +4765,8 @@ class Parser(Tokenizer):
CallbackRest : IDENTIFIER EQUALS ReturnType LPAREN ArgumentList RPAREN SEMICOLON
"""
identifier = IDLUnresolvedIdentifier(self.getLocation(p, 1), p[1])
p[0] = IDLCallbackType(self.getLocation(p, 1), self.globalScope(),
identifier, p[3], p[5])
p[0] = IDLCallback(self.getLocation(p, 1), self.globalScope(),
identifier, p[3], p[5])
def p_ExceptionMembers(self, p):
"""
@ -4752,8 +4779,8 @@ class Parser(Tokenizer):
"""
Typedef : TYPEDEF Type IDENTIFIER SEMICOLON
"""
typedef = IDLTypedefType(self.getLocation(p, 1), p[2], p[3])
typedef.resolve(self.globalScope())
typedef = IDLTypedef(self.getLocation(p, 1), self.globalScope(),
p[2], p[3])
p[0] = typedef
def p_ImplementsStatement(self, p):
@ -5488,8 +5515,12 @@ class Parser(Tokenizer):
try:
if self.globalScope()._lookupIdentifier(p[1]):
obj = self.globalScope()._lookupIdentifier(p[1])
if obj.isType():
type = obj
assert not obj.isType()
if obj.isTypedef():
type = IDLTypedefType(self.getLocation(p, 1), obj.innerType,
obj.identifier.name)
elif obj.isCallback() and not obj.isInterface():
type = IDLCallbackType(self.getLocation(p, 1), obj)
else:
type = IDLWrapperType(self.getLocation(p, 1), p[1])
p[0] = self.handleModifiers(type, p[2])
@ -5825,9 +5856,7 @@ class Parser(Tokenizer):
for x in xrange(IDLBuiltinType.Types.ArrayBuffer, IDLBuiltinType.Types.Float64Array + 1):
builtin = BuiltinTypes[x]
name = builtin.name
typedef = IDLTypedefType(BuiltinLocation("<builtin type>"), builtin, name)
typedef.resolve(scope)
typedef = IDLTypedef(BuiltinLocation("<builtin type>"), scope, builtin, name)
@ staticmethod
def handleModifiers(type, modifiers):

View File

@ -7,6 +7,7 @@
typedef long myLong;
typedef TestInterface AnotherNameForTestInterface;
typedef TestInterface? NullableTestInterface;
typedef CustomEventInit TestDictionaryTypedef;
interface TestExternalInterface;
@ -1019,6 +1020,7 @@ dictionary Dict : ParentDict {
required object requiredObject;
CustomEventInit customEventInit;
TestDictionaryTypedef dictionaryTypedef;
};
dictionary ParentDict : GrandparentDict {

View File

@ -23,14 +23,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=707564
function test()
{
var nav = document.getElementById("t1").contentWindow.navigator;
ise(nav.foopy, undefined, "We should have an Xray now");
is(nav.foopy, undefined, "We should have an Xray now");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object");
var props = Object.getOwnPropertyNames(nav);
isnot(props.indexOf("mozApps"), -1,
"Should enumerate a mozApps property on navigator xray");
var nav = document.getElementById("t2").contentWindow.navigator;
ise(nav.foopy, undefined, "We should have an Xray now again");
is(nav.foopy, undefined, "We should have an Xray now again");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again");
var found = false;
for (var name in nav) {

View File

@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=957929
function f() {
"use strict";
ise(this, undefined, "Should have undefined this value");
is(this, undefined, "Should have undefined this value");
SimpleTest.finish();
}

View File

@ -23,7 +23,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1041731
function test()
{
var loc = document.getElementById("t").contentWindow.document.location;
ise(loc.toString, loc.toString, "Unforgeable method on the Xray should be cached");
is(loc.toString, loc.toString, "Unforgeable method on the Xray should be cached");
SimpleTest.finish();
}

View File

@ -32,16 +32,16 @@ function checkXrayProperty(obj, name, values)
var value = values.shift();
if (typeof value == "undefined") {
ok(!obj.hasOwnProperty(name), "hasOwnProperty shouldn't see \"" + name + "\" through Xrays");
ise(Object.getOwnPropertyDescriptor(obj, name), undefined, "getOwnPropertyDescriptor shouldn't see \"" + name + "\" through Xrays");
is(Object.getOwnPropertyDescriptor(obj, name), undefined, "getOwnPropertyDescriptor shouldn't see \"" + name + "\" through Xrays");
ok(Object.keys(obj).indexOf(name) == -1, "Enumerating the Xray should not return \"" + name + "\"");
} else {
ok(obj.hasOwnProperty(name), "hasOwnProperty should see \"" + name + "\" through Xrays");
var pd = Object.getOwnPropertyDescriptor(obj, name);
ok(pd, "getOwnPropertyDescriptor should see \"" + name + "\" through Xrays");
if (pd && pd.get) {
ise(pd.get.call(instance), value, "Should get the right value for \"" + name + "\" through Xrays");
is(pd.get.call(instance), value, "Should get the right value for \"" + name + "\" through Xrays");
} else {
ise(obj[name], value, "Should get the right value for \"" + name + "\" through Xrays");
is(obj[name], value, "Should get the right value for \"" + name + "\" through Xrays");
}
if (pd && pd.enumerable) {
ok(Object.keys(obj).indexOf("" + name) > -1, "Enumerating the Xray should return \"" + name + "\"");
@ -62,13 +62,13 @@ function test()
var doc = document.getElementById("t").contentDocument;
var winProto = Object.getPrototypeOf(win);
ise(winProto, win.Window.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(winProto, win.Window.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
var namedPropertiesObject = Object.getPrototypeOf(winProto);
ise(Cu.getClassName(namedPropertiesObject, /* unwrap = */ true), "WindowProperties", "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(Cu.getClassName(namedPropertiesObject, /* unwrap = */ true), "WindowProperties", "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
var eventTargetProto = Object.getPrototypeOf(namedPropertiesObject);
ise(eventTargetProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(eventTargetProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
// Xrays need to filter expandos.
checkWindowXrayProperty(win, "expando", undefined);
@ -94,44 +94,44 @@ function test()
while ((proto = Object.getPrototypeOf(obj))) {
obj = proto;
}
ise(obj, win.Object.prototype, "Object.prototype should be at the end of the prototype chain");
is(obj, win.Object.prototype, "Object.prototype should be at the end of the prototype chain");
// Named properties shouldn't shadow WebIDL- or ECMAScript-defined properties.
checkWindowXrayProperty(win, "addEventListener", undefined, undefined, undefined, eventTargetProto.addEventListener);
ise(win.addEventListener, eventTargetProto.addEventListener, "Named properties shouldn't shadow WebIDL-defined properties");
is(win.addEventListener, eventTargetProto.addEventListener, "Named properties shouldn't shadow WebIDL-defined properties");
ise(win.toString, win.Object.prototype.toString, "Named properties shouldn't shadow ECMAScript-defined properties");
is(win.toString, win.Object.prototype.toString, "Named properties shouldn't shadow ECMAScript-defined properties");
// HTMLDocument
// Unforgeable properties live on the instance.
checkXrayProperty(doc, "location", [ win.location ]);
ise(String(win.location), document.getElementById("t").src,
"Should have the right stringification");
is(String(win.location), document.getElementById("t").src,
"Should have the right stringification");
// HTMLHtmlElement
var elem = doc.documentElement;
var elemProto = Object.getPrototypeOf(elem);
ise(elemProto, win.HTMLHtmlElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(elemProto, win.HTMLHtmlElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.HTMLElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(elemProto, win.HTMLElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.Element.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(elemProto, win.Element.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.Node.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(elemProto, win.Node.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
is(elemProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
// Xrays need to filter expandos.
ok(!("expando" in elem), "Xrays should filter expandos");
// WebIDL-defined properties live on the prototype.
checkXrayProperty(elem, "version", [ undefined, "" ]);
ise(elem.version, "", "WebIDL properties should be exposed through Xrays");
is(elem.version, "", "WebIDL properties should be exposed through Xrays");
// HTMLCollection
var coll = doc.getElementsByTagName("iframe");

View File

@ -22,16 +22,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
ok(e instanceof Error, "Should have an Error here");
ok(!(e instanceof DOMException), "Should not have DOMException here");
ok(!("code" in e), "Should not have a 'code' property");
ise(e.name, "Error", "Should not have an interesting name here");
ise(e.message, "We are a DOMError", "Should have the right message");
ise(e.stack,
"doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:20:7\n",
"Exception stack should still only show our code");
ise(e.fileName,
"http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html",
"Should have the right file name");
ise(e.lineNumber, 20, "Should have the right line number");
ise(e.columnNumber, 6, "Should have the right column number");
is(e.name, "Error", "Should not have an interesting name here");
is(e.message, "We are a DOMError", "Should have the right message");
is(e.stack,
"doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:20:7\n",
"Exception stack should still only show our code");
is(e.fileName,
"http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html",
"Should have the right file name");
is(e.lineNumber, 20, "Should have the right line number");
is(e.columnNumber, 6, "Should have the right column number");
}
try {
@ -39,18 +39,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
} catch (e) {
ok(e instanceof Error, "Should also have an Error here");
ok(e instanceof DOMException, "Should have DOMException here");
ise(e.name, "NotSupportedError", "Should have the right name here");
ise(e.message, "We are a DOMException",
"Should also have the right message");
ise(e.code, DOMException.NOT_SUPPORTED_ERR,
"Should have the right 'code'");
ise(e.stack,
"doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:38:7\n",
"Exception stack should still only show our code");
ise(e.filename,
"http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html",
"Should still have the right file name");
ise(e.lineNumber, 38, "Should still have the right line number");
is(e.name, "NotSupportedError", "Should have the right name here");
is(e.message, "We are a DOMException",
"Should also have the right message");
is(e.code, DOMException.NOT_SUPPORTED_ERR,
"Should have the right 'code'");
is(e.stack,
"doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:38:7\n",
"Exception stack should still only show our code");
is(e.filename,
"http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html",
"Should still have the right file name");
is(e.lineNumber, 38, "Should still have the right line number");
todo_is(e.columnNumber, 7,
"No column number support for DOMException yet");
}

View File

@ -15,20 +15,20 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
SimpleTest.waitForExplicitFinish();
function checkExn(lineNumber, name, message, code, filename, testNumber, stack, exn) {
ise(exn.lineNumber, lineNumber,
"Should have the right line number in test " + testNumber);
ise(exn.name, name,
"Should have the right exception name in test " + testNumber);
ise("filename" in exn ? exn.filename : exn.fileName, filename,
"Should have the right file name in test " + testNumber);
ise(exn.message, message,
"Should have the right message in test " + testNumber);
ise(exn.code, code, "Should have the right .code in test " + testNumber);
is(exn.lineNumber, lineNumber,
"Should have the right line number in test " + testNumber);
is(exn.name, name,
"Should have the right exception name in test " + testNumber);
is("filename" in exn ? exn.filename : exn.fileName, filename,
"Should have the right file name in test " + testNumber);
is(exn.message, message,
"Should have the right message in test " + testNumber);
is(exn.code, code, "Should have the right .code in test " + testNumber);
if (message === "") {
ise(exn.name, "NS_ERROR_UNEXPECTED",
"Should have one of our synthetic exceptions in test " + testNumber);
is(exn.name, "NS_ERROR_UNEXPECTED",
"Should have one of our synthetic exceptions in test " + testNumber);
}
ise(exn.stack, stack, "Should have the right stack in test " + testNumber);
is(exn.stack, stack, "Should have the right stack in test " + testNumber);
}
function ensurePromiseFail(testNumber, value) {

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1066432
testInterfaceJS.testSequenceOverload(nonIterableObject);
ok(false, "Should have thrown in the overload case"); // see long comment above!
} catch (e) {
ise(e.name, "TypeError", "Should get a TypeError for the overload case");
is(e.name, "TypeError", "Should get a TypeError for the overload case");
ok(e.message.includes("not iterable"),
"Should have a message about being non-iterable in the overload case");
}
@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1066432
testInterfaceJS.testSequenceUnion(nonIterableObject);
ok(false, "Should have thrown in the union case");
} catch (e) {
ise(e.name, "TypeError", "Should get a TypeError for the union case");
is(e.name, "TypeError", "Should get a TypeError for the union case");
ok(e.message.includes("not iterable"),
"Should have a message about being non-iterable in the union case");
}

View File

@ -22,15 +22,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1043690
/** Test for Bug 1043690 **/
var f = document.querySelector("form");
var i = document.querySelector("input");
ise(f.getAttribute("action"), null, "Should have no action attribute");
ise(f.action, i, "form.action should be the input");
is(f.getAttribute("action"), null, "Should have no action attribute");
is(f.action, i, "form.action should be the input");
f.action = "http://example.org";
ise(f.getAttribute("action"), "http://example.org",
"Should have an action attribute now");
ise(f.action, i, "form.action should still be the input");
is(f.getAttribute("action"), "http://example.org",
"Should have an action attribute now");
is(f.action, i, "form.action should still be the input");
i.remove();
ise(f.action, "http://example.org/",
"form.action should no longer be shadowed");
is(f.action, "http://example.org/",
"form.action should no longer be shadowed");
</script>

View File

@ -17,13 +17,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=952365
(function() {
onvolumechange = x;
ise(onvolumechange, x,
"Should preserve an object value when assigning to event handler");
is(onvolumechange, x,
"Should preserve an object value when assigning to event handler");
// Test that we don't try to actually call the non-callable object
window.dispatchEvent(new Event("volumechange"));
onvolumechange = 5;
ise(onvolumechange, null,
"Non-object values should become null when assigning to event handler");
is(onvolumechange, null,
"Non-object values should become null when assigning to event handler");
})();
</script>
</head>

View File

@ -464,7 +464,7 @@ public:
// mData may be nullptr
MOZ_ASSERT(mTarget);
MOZ_ASSERT(mAction);
MOZ_ASSERT(mQuotaInfo.mDir);
// mQuotaInfo.mDir may be nullptr if QuotaInitRunnable failed
MOZ_ASSERT(mInitiatingThread);
}

View File

@ -54,6 +54,12 @@ DBAction::RunOnTarget(Resolver* aResolver, const QuotaInfo& aQuotaInfo,
return;
}
rv = dbDir->Append(NS_LITERAL_STRING("cache"));
if (NS_WARN_IF(NS_FAILED(rv))) {
aResolver->Resolve(rv);
return;
}
nsCOMPtr<mozIStorageConnection> conn;
// Attempt to reuse the connection opened by a previous Action.
@ -63,12 +69,6 @@ DBAction::RunOnTarget(Resolver* aResolver, const QuotaInfo& aQuotaInfo,
// If there is no previous Action, then we must open one.
if (!conn) {
rv = dbDir->Append(NS_LITERAL_STRING("cache"));
if (NS_WARN_IF(NS_FAILED(rv))) {
aResolver->Resolve(rv);
return;
}
rv = OpenConnection(aQuotaInfo, dbDir, getter_AddRefs(conn));
if (NS_WARN_IF(NS_FAILED(rv))) {
aResolver->Resolve(rv);
@ -187,6 +187,9 @@ DBAction::WipeDatabase(nsIFile* aDBFile, nsIFile* aDBDir)
nsresult rv = aDBFile->Remove(false);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
// Note, the -wal journal file will be automatically deleted by sqlite when
// the new database is created. No need to explicitly delete it here.
// Delete the morgue as well.
rv = BodyDeleteDir(aDBDir);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }

View File

@ -28,11 +28,11 @@ namespace dom {
namespace cache {
namespace db {
const int32_t kMaxWipeSchemaVersion = 7;
const int32_t kMaxWipeSchemaVersion = 8;
namespace {
const int32_t kLatestSchemaVersion = 7;
const int32_t kLatestSchemaVersion = 8;
const int32_t kMaxEntriesPerStatement = 255;
} // anonymous namespace
@ -343,12 +343,12 @@ InitializeConnection(mozIStorageConnection* aConn)
// need to happen regardless of the schema.
nsAutoCString pragmas(
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
// Switch the journaling mode to TRUNCATE to avoid changing the directory
// structure at the conclusion of every transaction for devices with slower
// file systems.
"PRAGMA journal_mode = TRUNCATE; "
#endif
"PRAGMA journal_mode = WAL; "
// Use default mozStorage 32kb page size for now
// WAL journal can grow to 512kb before being flushed to disk
"PRAGMA wal_autocheckpoint = 16; "
// Always truncate the journal back to 512kb after large transactions
"PRAGMA journal_size_limit = 524288; "
"PRAGMA foreign_keys = ON; "
// Note, the default encoding of UTF-8 is preferred. mozStorage does all

View File

@ -17,12 +17,8 @@
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetCameraLog();
#define DOM_CAMERA_LOG( type, ... ) PR_LOG(GetCameraLog(), (PRLogModuleLevel)type, ( __VA_ARGS__ ))
#else
#define DOM_CAMERA_LOG( type, ... )
#endif
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ )
@ -42,16 +38,12 @@ enum {
* DOM_CAMERA_LOGR() can be called before 'gCameraLog' is set, so
* we need to handle this one a little differently.
*/
#ifdef PR_LOGGING
#define DOM_CAMERA_LOGR( ... ) \
do { \
if (GetCameraLog()) { \
DOM_CAMERA_LOG( DOM_CAMERA_LOG_REFERENCES, __VA_ARGS__ ); \
} \
} while (0)
#else
#define DOM_CAMERA_LOGR( ... )
#endif
#define DOM_CAMERA_LOGT( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_TRACE, __VA_ARGS__ )
#define DOM_CAMERA_LOGI( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_INFO, __VA_ARGS__ )
#define DOM_CAMERA_LOGW( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_WARNING, __VA_ARGS__ )

View File

@ -92,7 +92,6 @@ CameraControlImpl::OnHardwareStateChange(CameraControlListener::HardwareState aN
return;
}
#ifdef PR_LOGGING
const char* state[] = { "uninitialized", "closed", "open", "failed" };
MOZ_ASSERT(aNewState >= 0);
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
@ -101,7 +100,6 @@ CameraControlImpl::OnHardwareStateChange(CameraControlListener::HardwareState aN
} else {
DOM_CAMERA_LOGE("OnHardwareStateChange: got invalid HardwareState value %d\n", aNewState);
}
#endif
mHardwareState = aNewState;
mHardwareStateChangeReason = aReason;
@ -221,7 +219,6 @@ CameraControlImpl::OnPreviewStateChange(CameraControlListener::PreviewState aNew
return;
}
#ifdef PR_LOGGING
const char* state[] = { "stopped", "paused", "started" };
MOZ_ASSERT(aNewState >= 0);
if (static_cast<unsigned int>(aNewState) < sizeof(state) / sizeof(state[0])) {
@ -229,7 +226,6 @@ CameraControlImpl::OnPreviewStateChange(CameraControlListener::PreviewState aNew
} else {
DOM_CAMERA_LOGE("OnPreviewStateChange: got unknown PreviewState value %d\n", aNewState);
}
#endif
mPreviewState = aNewState;
@ -280,7 +276,6 @@ CameraControlImpl::OnUserError(CameraControlListener::UserContext aContext,
// the Camera Thread.
RwLockAutoEnterRead lock(mListenerLock);
#ifdef PR_LOGGING
const char* context[] = {
"StartCamera",
"StopCamera",
@ -305,7 +300,6 @@ CameraControlImpl::OnUserError(CameraControlListener::UserContext aContext,
DOM_CAMERA_LOGE("CameraControlImpl::OnUserError : aContext=%d, aError=0x%x\n",
aContext, aError);
}
#endif
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
CameraControlListener* l = mListeners[i];
@ -321,7 +315,6 @@ CameraControlImpl::OnSystemError(CameraControlListener::SystemContext aContext,
// the Camera Thread.
RwLockAutoEnterRead lock(mListenerLock);
#ifdef PR_LOGGING
const char* context[] = {
"Camera Service"
};
@ -332,7 +325,6 @@ CameraControlImpl::OnSystemError(CameraControlListener::SystemContext aContext,
DOM_CAMERA_LOGE("CameraControlImpl::OnSystemError : aContext=%d, aError=0x%x\n",
aContext, aError);
}
#endif
for (uint32_t i = 0; i < mListeners.Length(); ++i) {
CameraControlListener* l = mListeners[i];

View File

@ -2246,12 +2246,7 @@ OnSystemError(nsGonkCameraControl* gc,
CameraControlListener::SystemContext aWhere,
int32_t aArg1, int32_t aArg2)
{
#ifdef PR_LOGGING
DOM_CAMERA_LOGE("OnSystemError : aWhere=%d, aArg1=%d, aArg2=%d\n", aWhere, aArg1, aArg2);
#else
unused << aArg1;
unused << aArg2;
#endif
gc->OnSystemError(aWhere, NS_ERROR_FAILURE);
}

View File

@ -454,4 +454,4 @@ CameraTestSuite.prototype = {
},
};
ise(SpecialPowers.sanityCheck(), "foo", "SpecialPowers passed sanity check");
is(SpecialPowers.sanityCheck(), "foo", "SpecialPowers passed sanity check");

View File

@ -19,6 +19,8 @@
#include "nsSVGEffects.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
#include "nsWidgetsCID.h"
#include "nsIAppShell.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIFrame.h"
@ -114,6 +116,7 @@
#include "nsDeviceContext.h"
#include "nsFontMetrics.h"
#include "Units.h"
#include "mozilla/Services.h"
#undef free // apparently defined by some windows header, clashing with a free()
// method in SkTypes.h
@ -179,6 +182,64 @@ public:
NS_IMPL_ISUPPORTS(Canvas2dPixelsReporter, nsIMemoryReporter)
class CanvasShutdownObserver : public nsIObserver
{
virtual ~CanvasShutdownObserver() {}
public:
NS_DECL_ISUPPORTS
explicit CanvasShutdownObserver(CanvasRenderingContext2D* aCanvas)
: mCanvas(aCanvas)
{
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
observerService->AddObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID, false);
}
void Shutdown() {
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
observerService->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
}
NS_IMETHOD Observe(nsISupports* aSubject,
const char* aTopic,
const char16_t* aData) override
{
mCanvas->ShutdownTaskQueue();
return NS_OK;
}
private:
CanvasRenderingContext2D* mCanvas;
};
NS_IMPL_ISUPPORTS(CanvasShutdownObserver, nsIObserver);
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
void
CanvasRenderingContext2D::RecordCommand()
{
static uint32_t kBatchSize = 5;
if (++mPendingCommands > kBatchSize) {
mPendingCommands = 0;
FlushDelayedTarget();
return;
}
if (mScheduledFlush) {
return;
}
mScheduledFlush = true;
nsCOMPtr<nsIAppShell> appShell = do_GetService(kAppShellCID);
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(this, &CanvasRenderingContext2D::StableStateReached);
appShell->RunInStableState(r);
}
class CanvasRadialGradient : public CanvasGradient
{
public:
@ -393,6 +454,11 @@ public:
mCtx->CurrentState().filterAdditionalImages,
mPostFilterBounds.TopLeft() - mOffset,
DrawOptions(1.0f, mCompositionOp));
// DrawTargetCapture doesn't properly support filter nodes because they are
// mutable. Block until drawing is done to avoid races.
mCtx->FlushDelayedTarget();
mCtx->FinishDelayedRendering();
}
DrawTarget* DT()
@ -817,6 +883,9 @@ public:
if (!context || !context->mTarget)
return;
context->FlushDelayedTarget();
context->FinishDelayedRendering();
// Since SkiaGL default to store drawing command until flush
// We will have to flush it before present.
context->mTarget->Flush();
@ -938,6 +1007,8 @@ CanvasRenderingContext2D::CanvasRenderingContext2D()
, mZero(false), mOpaque(false)
, mResetLayer(true)
, mIPC(false)
, mPendingCommands(0)
, mScheduledFlush(false)
, mDrawObserver(nullptr)
, mIsEntireFrameInvalid(false)
, mPredictManyRedrawCalls(false), mPathTransformWillUpdate(false)
@ -945,6 +1016,14 @@ CanvasRenderingContext2D::CanvasRenderingContext2D()
{
sNumLivingContexts++;
#ifdef XP_MACOSX
// Restrict async rendering to OSX for now until the failures on other
// platforms get resolved.
mTaskQueue = new MediaTaskQueue(SharedThreadPool::Get(NS_LITERAL_CSTRING("Canvas Rendering"),
4));
mShutdownObserver = new CanvasShutdownObserver(this);
#endif
// The default is to use OpenGL mode
if (!gfxPlatform::GetPlatform()->UseAcceleratedSkiaCanvas()) {
mRenderingMode = RenderingMode::SoftwareBackendMode;
@ -957,6 +1036,9 @@ CanvasRenderingContext2D::CanvasRenderingContext2D()
CanvasRenderingContext2D::~CanvasRenderingContext2D()
{
if (mTaskQueue) {
ShutdownTaskQueue();
}
RemoveDrawObserver();
RemovePostRefreshObserver();
Reset();
@ -979,6 +1061,19 @@ CanvasRenderingContext2D::~CanvasRenderingContext2D()
RemoveDemotableContext(this);
}
void
CanvasRenderingContext2D::ShutdownTaskQueue()
{
mShutdownObserver->Shutdown();
mShutdownObserver = nullptr;
FlushDelayedTarget();
FinishDelayedRendering();
mTaskQueue->BeginShutdown();
mTaskQueue = nullptr;
mDelayedTarget = nullptr;
}
JSObject*
CanvasRenderingContext2D::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
@ -1034,7 +1129,10 @@ CanvasRenderingContext2D::Reset()
gCanvasAzureMemoryUsed -= mWidth * mHeight * 4;
}
FinishDelayedRendering();
mTarget = nullptr;
mDelayedTarget = nullptr;
mFinalTarget = nullptr;
// reset hit regions
mHitRegionsOptions.ClearAndRetainStorage();
@ -1101,6 +1199,8 @@ CanvasRenderingContext2D::StyleColorToString(const nscolor& aColor, nsAString& a
nsresult
CanvasRenderingContext2D::Redraw()
{
RecordCommand();
if (mIsEntireFrameInvalid) {
return NS_OK;
}
@ -1122,6 +1222,7 @@ CanvasRenderingContext2D::Redraw()
void
CanvasRenderingContext2D::Redraw(const mgfx::Rect &r)
{
RecordCommand();
++mInvalidateCount;
if (mIsEntireFrameInvalid) {
@ -1144,6 +1245,18 @@ CanvasRenderingContext2D::Redraw(const mgfx::Rect &r)
mCanvasElement->InvalidateCanvasContent(&r);
}
TemporaryRef<SourceSurface>
CanvasRenderingContext2D::GetSurfaceSnapshot(bool* aPremultAlpha /* = nullptr */)
{
EnsureTarget();
if (aPremultAlpha) {
*aPremultAlpha = true;
}
FlushDelayedTarget();
FinishDelayedRendering();
return mFinalTarget->Snapshot();
}
void
CanvasRenderingContext2D::DidRefresh()
{
@ -1161,6 +1274,7 @@ CanvasRenderingContext2D::RedrawUser(const gfxRect& r)
{
if (mIsEntireFrameInvalid) {
++mInvalidateCount;
RecordCommand();
return;
}
@ -1186,7 +1300,7 @@ bool CanvasRenderingContext2D::SwitchRenderingMode(RenderingMode aRenderingMode)
}
#endif
RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
RefPtr<SourceSurface> snapshot = GetSurfaceSnapshot();
RefPtr<DrawTarget> oldTarget = mTarget;
mTarget = nullptr;
mResetLayer = true;
@ -1360,7 +1474,7 @@ CanvasRenderingContext2D::EnsureTarget(RenderingMode aRenderingMode)
SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
if (glue && glue->GetGrContext() && glue->GetGLContext()) {
mTarget = Factory::CreateDrawTargetSkiaWithGrContext(glue->GetGrContext(), size, format);
mFinalTarget = Factory::CreateDrawTargetSkiaWithGrContext(glue->GetGrContext(), size, format);
if (mTarget) {
AddDemotableContext(this);
} else {
@ -1369,19 +1483,31 @@ CanvasRenderingContext2D::EnsureTarget(RenderingMode aRenderingMode)
}
}
#endif
if (!mTarget) {
mTarget = layerManager->CreateDrawTarget(size, format);
if (!mFinalTarget) {
mFinalTarget = layerManager->CreateDrawTarget(size, format);
}
} else {
mTarget = layerManager->CreateDrawTarget(size, format);
mFinalTarget = layerManager->CreateDrawTarget(size, format);
mode = RenderingMode::SoftwareBackendMode;
}
} else {
mTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(size, format);
mFinalTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(size, format);
mode = RenderingMode::SoftwareBackendMode;
}
}
// Restrict async canvas drawing to OSX for now since we get test failures
// on other platforms.
if (mFinalTarget) {
#ifdef XP_MACOSX
mTarget = mDelayedTarget = mFinalTarget->CreateCaptureDT(size);
#else
mTarget = mFinalTarget;
#endif
}
mPendingCommands = 0;
if (mTarget) {
static bool registered = false;
if (!registered) {
@ -1415,7 +1541,7 @@ CanvasRenderingContext2D::EnsureTarget(RenderingMode aRenderingMode)
Redraw();
} else {
EnsureErrorTarget();
mTarget = sErrorTarget;
mTarget = mFinalTarget = sErrorTarget;
}
return mode;
@ -1435,6 +1561,51 @@ CanvasRenderingContext2D::GetHeight() const
}
#endif
class DrawCaptureTask : public nsRunnable
{
public:
DrawCaptureTask(DrawTargetCapture *aReplay, DrawTarget* aDest)
: mReplay(aReplay)
, mDest(aDest)
{
}
NS_IMETHOD Run()
{
mDest->DrawCapturedDT(mReplay, Matrix());
return NS_OK;
}
private:
RefPtr<DrawTargetCapture> mReplay;
RefPtr<DrawTarget> mDest;
};
void
CanvasRenderingContext2D::FlushDelayedTarget()
{
if (!mDelayedTarget) {
return;
}
mPendingCommands = 0;
nsCOMPtr<nsIRunnable> task = new DrawCaptureTask(mDelayedTarget, mFinalTarget);
mTaskQueue->Dispatch(task.forget());
mDelayedTarget = mFinalTarget->CreateCaptureDT(IntSize(mWidth, mHeight));
mDelayedTarget->SetTransform(mTarget->GetTransform());
mTarget = mDelayedTarget;
}
void
CanvasRenderingContext2D::FinishDelayedRendering()
{
if (mTaskQueue) {
mTaskQueue->AwaitIdle();
}
}
NS_IMETHODIMP
CanvasRenderingContext2D::SetDimensions(int32_t width, int32_t height)
{
@ -1584,7 +1755,7 @@ CanvasRenderingContext2D::GetImageBuffer(uint8_t** aImageBuffer,
*aFormat = 0;
EnsureTarget();
RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
RefPtr<SourceSurface> snapshot = GetSurfaceSnapshot();
if (!snapshot) {
return;
}
@ -2003,7 +2174,7 @@ CanvasRenderingContext2D::CreatePattern(const HTMLImageOrCanvasOrVideoElement& e
// of animated images
nsLayoutUtils::SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromElement(htmlElement,
nsLayoutUtils::SFE_WANT_FIRST_FRAME, mTarget);
nsLayoutUtils::SFE_WANT_FIRST_FRAME, mFinalTarget);
if (!res.mSourceSurface) {
error.Throw(NS_ERROR_NOT_AVAILABLE);
@ -4314,7 +4485,7 @@ CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image
nsLayoutUtils::SurfaceFromElementResult res =
CachedSurfaceFromElement(element);
if (!res.mSourceSurface)
res = nsLayoutUtils::SurfaceFromElement(element, sfeFlags, mTarget);
res = nsLayoutUtils::SurfaceFromElement(element, sfeFlags, mFinalTarget);
if (!res.mSourceSurface && !res.mDrawInfo.mImgContainer) {
// The spec says to silently do nothing in the following cases:
@ -4658,7 +4829,12 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x,
if (gfxPlatform::GetPlatform()->SupportsAzureContentForDrawTarget(mTarget) &&
GlobalAlpha() == 1.0f)
{
thebes = new gfxContext(mTarget);
// Complete any async rendering and use synchronous rendering for DrawWindow
// until we're confident it works for all content.
FlushDelayedTarget();
FinishDelayedRendering();
thebes = new gfxContext(mFinalTarget);
thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21,
matrix._22, matrix._31, matrix._32));
} else {
@ -4915,7 +5091,7 @@ CanvasRenderingContext2D::GetImageDataArray(JSContext* aCx,
IntRect srcReadRect = srcRect.Intersect(destRect);
RefPtr<DataSourceSurface> readback;
if (!srcReadRect.IsEmpty() && !mZero) {
RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
RefPtr<SourceSurface> snapshot = GetSurfaceSnapshot();
if (snapshot) {
readback = snapshot->GetDataSurface();
}
@ -5301,7 +5477,7 @@ CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
return nullptr;
}
mTarget->Flush();
FlushDelayedTarget();
if (!mResetLayer && aOldLayer) {
CanvasRenderingContext2DUserData* userData =
@ -5350,6 +5526,8 @@ CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
userData = new CanvasRenderingContext2DUserData(this);
canvasLayer->SetDidTransactionCallback(
CanvasRenderingContext2DUserData::DidTransactionCallback, userData);
canvasLayer->SetPreTransactionCallback(
CanvasRenderingContext2DUserData::PreTransactionCallback, userData);
canvasLayer->SetUserData(&g2DContextLayerUserData, userData);
CanvasLayer::Data data;
@ -5358,16 +5536,13 @@ CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
GLuint skiaGLTex = SkiaGLTex();
if (skiaGLTex) {
canvasLayer->SetPreTransactionCallback(
CanvasRenderingContext2DUserData::PreTransactionCallback, userData);
SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
MOZ_ASSERT(glue);
data.mGLContext = glue->GetGLContext();
data.mFrontbufferGLTex = skiaGLTex;
} else {
data.mDrawTarget = mTarget;
data.mDrawTarget = mFinalTarget;
}
canvasLayer->Initialize(data);

View File

@ -10,6 +10,7 @@
#include "nsIDOMCanvasRenderingContext2D.h"
#include "nsICanvasRenderingContextInternal.h"
#include "mozilla/RefPtr.h"
#include "mozilla/Monitor.h"
#include "nsColor.h"
#include "mozilla/dom/HTMLCanvasElement.h"
#include "mozilla/dom/HTMLVideoElement.h"
@ -27,6 +28,7 @@
#include "mozilla/EnumeratedArray.h"
#include "FilterSupport.h"
#include "nsSVGEffects.h"
#include "MediaTaskQueue.h"
class nsGlobalWindow;
class nsXULElement;
@ -52,6 +54,7 @@ template<typename T> class Optional;
struct CanvasBidiProcessor;
class CanvasRenderingContext2DUserData;
class CanvasDrawObserver;
class CanvasShutdownObserver;
/**
** CanvasRenderingContext2D
@ -442,14 +445,7 @@ public:
const char16_t* aEncoderOptions,
nsIInputStream **aStream) override;
mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override
{
EnsureTarget();
if (aPremultAlpha) {
*aPremultAlpha = true;
}
return mTarget->Snapshot();
}
mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override;
NS_IMETHOD SetIsOpaque(bool isOpaque) override;
bool GetIsOpaque() override { return mOpaque; }
@ -521,6 +517,7 @@ public:
}
friend class CanvasRenderingContext2DUserData;
friend class CanvasShutdownObserver;
virtual void GetImageBuffer(uint8_t** aImageBuffer, int32_t* aFormat) override;
@ -532,6 +529,21 @@ public:
// return true and fills in the bound rect if element has a hit region.
bool GetHitRegionRect(Element* aElement, nsRect& aRect) override;
/**
* Deferred rendering functions
*/
/**
* Called when the event loop reaches a stable
* state, and trigger us to flush any outstanding
* commands to the rendering thread.
*/
void StableStateReached()
{
mScheduledFlush = false;
FlushDelayedTarget();
}
protected:
nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY,
uint32_t aWidth, uint32_t aHeight,
@ -550,6 +562,8 @@ protected:
nsresult InitializeWithTarget(mozilla::gfx::DrawTarget *surface,
int32_t width, int32_t height);
void ShutdownTaskQueue();
/**
* The number of living nsCanvasRenderingContexts. When this goes down to
* 0, we free the premultiply and unpremultiply tables, if they exist.
@ -713,6 +727,54 @@ protected:
// sErrorTarget.
mozilla::RefPtr<mozilla::gfx::DrawTarget> mTarget;
/**
* Deferred rendering implementation
*/
// If we are using deferred rendering, then this is the current
// deferred rendering target. It is the same pointer as mTarget.
mozilla::RefPtr<mozilla::gfx::DrawTargetCapture> mDelayedTarget;
// If we are using deferred rendering, then this is the actual destination
// buffer.
mozilla::RefPtr<mozilla::gfx::DrawTarget> mFinalTarget;
/**
* Add the current DelayedDrawTarget to the rendering queue,
* schedule a rendering job if required, and create a new
* DelayedDrawTarget.
*/
void FlushDelayedTarget();
/**
* Make sure all commands have been flushed to
* the rendering thread, and block until they
* are completed.
*/
void FinishDelayedRendering();
/**
* Called when a command is added to the current
* delayed draw target.
*
* Either flushes the current batch of commands to
* the rendering thread, or ensures that this happens
* the next time the event loop reaches a stable state.
*/
void RecordCommand();
// The number of commands currently waiting to be sent
// to the rendering thread.
uint32_t mPendingCommands;
// True if we have scheduled FlushDelayedTarget to be
// called in the next browser stable state.
bool mScheduledFlush;
nsRefPtr<MediaTaskQueue> mTaskQueue;
nsRefPtr<CanvasShutdownObserver> mShutdownObserver;
uint32_t SkiaGLTex() const;
// This observes our draw calls at the beginning of the canvas

View File

@ -249,7 +249,7 @@ function checkStrArray(str1, str2, msg) {
}
str1 = optArray(str1).map(normalize_falsy).filter(v => v != "");
str2 = optArray(str2).map(normalize_falsy).filter(v => v != "");
ise(JSON.stringify(str1), JSON.stringify(str2), msg);
is(JSON.stringify(str1), JSON.stringify(str2), msg);
}
function checkPref(pref1, pref2) {
@ -260,7 +260,7 @@ function checkPref(pref1, pref2) {
pref2 = false;
}
}
ise(!!pref1, !!pref2, "Same pref");
is(!!pref1, !!pref2, "Same pref");
}
function checkAddress(adr1, adr2) {
@ -332,7 +332,7 @@ function checkArrayField(array1, array2, func, msg) {
ok(true, msg);
return;
}
ise(array1.length, array2.length, "Same length");
is(array1.length, array2.length, "Same length");
for (var i = 0; i < array1.length; ++i) {
func(array1[i], array2[i], msg);
}

View File

@ -702,13 +702,13 @@ var steps = [
impp: [{value: undefined}],
tel: [{value: undefined}],
});
ise(c.adr[0].streetAddress, undefined, "adr.streetAddress is undefined");
ise(c.adr[0].locality, undefined, "adr.locality is undefined");
ise(c.adr[0].pref, undefined, "adr.pref is undefined");
ise(c.email[0].value, undefined, "email.value is undefined");
ise(c.url[0].value, undefined, "url.value is undefined");
ise(c.impp[0].value, undefined, "impp.value is undefined");
ise(c.tel[0].value, undefined, "tel.value is undefined");
is(c.adr[0].streetAddress, undefined, "adr.streetAddress is undefined");
is(c.adr[0].locality, undefined, "adr.locality is undefined");
is(c.adr[0].pref, undefined, "adr.pref is undefined");
is(c.email[0].value, undefined, "email.value is undefined");
is(c.url[0].value, undefined, "url.value is undefined");
is(c.impp[0].value, undefined, "impp.value is undefined");
is(c.tel[0].value, undefined, "tel.value is undefined");
next();
},
function() {
@ -764,7 +764,7 @@ var steps = [
req.onsuccess = function() {
req = navigator.mozContacts.find(defaultOptions);
req.onsuccess = function() {
ise(req.result.length, 1, "Got 1 contact");
is(req.result.length, 1, "Got 1 contact");
checkContacts(req.result[0], properties1);
next();
};
@ -788,7 +788,7 @@ var steps = [
ok(true, "mozContact.init works as expected");
var c = new mozContact({name: ["Foo"]});
c.init({name: ["Bar"]});
ise(c.name[0], "Bar", "Same name");
is(c.name[0], "Bar", "Same name");
next();
},
function() {
@ -801,7 +801,7 @@ var steps = [
ok(true, "mozContact.init resets properties");
var c = new mozContact({jobTitle: ["Software Engineer"]});
c.init({nickname: ["Jobless Johnny"]});
ise(c.nickname[0], "Jobless Johnny", "Same nickname");
is(c.nickname[0], "Jobless Johnny", "Same nickname");
ok(!c.jobTitle, "jobTitle is not set");
next();
},
@ -818,7 +818,7 @@ var steps = [
filterValue: c.id
});
req.onsuccess = function() {
ise(req.result.length, 0, "Successfully removed contact by ID");
is(req.result.length, 0, "Successfully removed contact by ID");
next();
};
req.onerror = onFailure;

View File

@ -96,8 +96,8 @@ function verifyBlob(blob1, blob2, isLast)
"blob1 is an instance of File");
isnot(blob2 instanceof File, true,
"blob2 is an instance of File");
ise(blob1.size, blob2.size, "Same size");
ise(blob1.type, blob2.type, "Same type");
is(blob1.size, blob2.size, "Same size");
is(blob1.type, blob2.type, "Same type");
var buffer1;
var buffer2;
@ -125,7 +125,7 @@ function verifyBlobArray(blobs1, blobs2)
{
is(blobs1 instanceof Array, true, "blobs1 is an array object");
is(blobs2 instanceof Array, true, "blobs2 is an array object");
ise(blobs1.length, blobs2.length, "Same length");
is(blobs1.length, blobs2.length, "Same length");
if (!blobs1.length) {
next();

View File

@ -95,9 +95,9 @@ var steps = [
filterValue: number1.local};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
is(findResult1.id, sample_id1, "Same ID");
next();
};
req.onerror = onFailure;
@ -109,7 +109,7 @@ var steps = [
filterValue: number1.international};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 0 contacts.");
is(req.result.length, 0, "Found exactly 0 contacts.");
next();
};
req.onerror = onFailure;
@ -122,7 +122,7 @@ var steps = [
filterValue: shortNumber};
req = mozContacts.find(options);
req.onsuccess = function() {
ise(req.result.length, 0, "The prefix short number should not match any contact.");
is(req.result.length, 0, "The prefix short number should not match any contact.");
next();
};
req.onerror = onFailure;
@ -135,7 +135,7 @@ var steps = [
filterValue: shortNumber};
req = mozContacts.find(options);
req.onsuccess = function() {
ise(req.result.length, 0, "The suffix short number should not match any contact.");
is(req.result.length, 0, "The suffix short number should not match any contact.");
next();
};
req.onerror = onFailure;
@ -147,7 +147,7 @@ var steps = [
filterValue: shortNumber};
req = mozContacts.find(options);
req.onsuccess = function() {
ise(req.result.length, 1, "Found the contact equally matching the shortNumber.");
is(req.result.length, 1, "Found the contact equally matching the shortNumber.");
next();
};
req.onerror = onFailure;
@ -171,7 +171,7 @@ var steps = [
filterValue: number1.local};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 0 contact.");
is(req.result.length, 0, "Found exactly 0 contact.");
next();
};
req.onerror = onFailure;
@ -183,7 +183,7 @@ var steps = [
filterValue: number1.international};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 0 contact.");
is(req.result.length, 0, "Found exactly 0 contact.");
next();
};
req.onerror = onFailure;
@ -195,9 +195,9 @@ var steps = [
filterValue: number2.local};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
is(findResult1.id, sample_id1, "Same ID");
next();
};
req.onerror = onFailure;
@ -209,7 +209,7 @@ var steps = [
filterValue: number2.international};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 1 contact.");
is(req.result.length, 0, "Found exactly 1 contact.");
next();
};
req.onerror = onFailure;
@ -241,9 +241,9 @@ var steps = [
filterValue: number3.local};
req = mozContacts.find(options);
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
is(findResult1.id, sample_id1, "Same ID");
next();
};
req.onerror = onFailure;

View File

@ -54,9 +54,9 @@ var steps = [
filterValue: number.international
});
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
is(findResult1.id, sample_id1, "Same ID");
next();
};
req.onerror = onFailure;
@ -69,7 +69,7 @@ var steps = [
filterValue: number.local
});
req.onsuccess = function () {
ise(req.result.length, 1, "Found 0 contacts.");
is(req.result.length, 1, "Found 0 contacts.");
next();
};
req.onerror = onFailure;
@ -92,7 +92,7 @@ var steps = [
ok(true, "Retrieving all contacts");
req = mozContacts.find({});
req.onsuccess = function () {
ise(req.result.length, 1, "One contact.");
is(req.result.length, 1, "One contact.");
findResult1 = req.result[0];
next();
};
@ -106,10 +106,10 @@ var steps = [
filterValue: number.international.slice(-8)
});
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
ise(findResult1.tel[0].value, number.international, "Same Value");
is(findResult1.id, sample_id1, "Same ID");
is(findResult1.tel[0].value, number.international, "Same Value");
next();
};
req.onerror = onFailure;
@ -122,10 +122,10 @@ var steps = [
filterValue: number.international.slice(-9)
});
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
ise(findResult1.tel[0].value, number.international, "Same Value");
is(findResult1.id, sample_id1, "Same ID");
is(findResult1.tel[0].value, number.international, "Same Value");
next();
};
req.onerror = onFailure;
@ -138,7 +138,7 @@ var steps = [
filterValue: number.international.slice(-6)
});
req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly zero contacts.");
is(req.result.length, 0, "Found exactly zero contacts.");
next();
};
req.onerror = onFailure;
@ -161,7 +161,7 @@ var steps = [
ok(true, "Retrieving all contacts");
req = mozContacts.find({});
req.onsuccess = function () {
ise(req.result.length, 1, "One contact.");
is(req.result.length, 1, "One contact.");
findResult1 = req.result[0];
next();
};
@ -175,10 +175,10 @@ var steps = [
filterValue: "022" + landlineNumber.slice(-7)
});
req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact.");
is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID");
ise(findResult1.tel[0].value, landlineNumber, "Same Value");
is(findResult1.id, sample_id1, "Same ID");
is(findResult1.tel[0].value, landlineNumber, "Same Value");
next();
};
req.onerror = onFailure;

View File

@ -86,7 +86,7 @@ var steps = [
var req = mozContacts.getCount();
req.onsuccess = function onsuccess() {
ok(true, "Could access the mozContacts API");
ise(this.result, contactsCount, "Contacts count is correct");
is(this.result, contactsCount, "Contacts count is correct");
next();
};
@ -104,7 +104,7 @@ var steps = [
var req = mozContacts.find();
req.onsuccess = function onsuccess() {
if (this.result) {
ise(this.result.length, contactsCount, "Contacts array length is correct");
is(this.result.length, contactsCount, "Contacts array length is correct");
allContacts = this.result;
next();
} else {

View File

@ -48,7 +48,7 @@ var steps = [
SpecialPowers.pushPermissions([
{type: "downloads", allow: 0, context: document}
], function() {
ise(frames[0].navigator.mozDownloadManager, null, "navigator.mozDownloadManager is null when the page doesn't have permissions");
is(frames[0].navigator.mozDownloadManager, null, "navigator.mozDownloadManager is null when the page doesn't have permissions");
next();
});
},
@ -57,7 +57,7 @@ var steps = [
SpecialPowers.pushPrefEnv({
set: [["dom.mozDownloads.enabled", false]]
}, function() {
ise(navigator.mozDownloadManager, undefined, "navigator.mozDownloadManager is undefined");
is(navigator.mozDownloadManager, undefined, "navigator.mozDownloadManager is undefined");
next();
});
},

View File

@ -858,13 +858,6 @@ EventDispatcher::CreateEvent(EventTarget* aOwner,
}
if (aEventType.LowerCaseEqualsLiteral("scrollareaevent"))
return NS_NewDOMScrollAreaEvent(aDOMEvent, aOwner, aPresContext, nullptr);
if (aEventType.LowerCaseEqualsLiteral("closeevent")) {
CloseEventInit init;
nsRefPtr<CloseEvent> event =
CloseEvent::Constructor(aOwner, EmptyString(), init);
event.forget(aDOMEvent);
return NS_OK;
}
// XXXkhuey Chrome supports popstateevent here, even though it provides no
// initPopStateEvent method. This is nuts ... but copying it is unlikely to
// break the web.

View File

@ -41,7 +41,6 @@ namespace mozilla {
using namespace dom;
using namespace widget;
#ifdef PR_LOGGING
/**
* When a method is called, log its arguments and/or related static variables
* with PR_LOG_ALWAYS. However, if it puts too many logs like
@ -177,7 +176,6 @@ GetNotifyIMEMessageName(IMEMessage aMessage)
return "unacceptable IME notification message";
}
}
#endif // #ifdef PR_LOGGING
nsIContent* IMEStateManager::sContent = nullptr;
nsPresContext* IMEStateManager::sPresContext = nullptr;
@ -194,11 +192,9 @@ TextCompositionArray* IMEStateManager::sTextCompositions = nullptr;
void
IMEStateManager::Init()
{
#ifdef PR_LOGGING
if (!sISMLog) {
sISMLog = PR_NewLogModule("IMEStateManager");
}
#endif
}
// static
@ -232,7 +228,6 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
// there should be only one composition per presContext object.
sTextCompositions->ElementAt(i)->Destroy();
sTextCompositions->RemoveElementAt(i);
#if defined DEBUG || PR_LOGGING
if (sTextCompositions->IndexOf(aPresContext) !=
TextCompositionArray::NoIndex) {
PR_LOG(sISMLog, PR_LOG_ERROR,
@ -240,7 +235,6 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
"TextComposition instance from the array"));
MOZ_CRASH("Failed to remove TextComposition instance from the array");
}
#endif // #if defined DEBUG || PR_LOGGING
}
}
@ -513,15 +507,15 @@ IMEStateManager::OnMouseButtonEventInEditor(nsPresContext* aPresContext,
bool consumed =
sActiveIMEContentObserver->OnMouseButtonEvent(aPresContext, internalEvent);
#ifdef PR_LOGGING
nsAutoString eventType;
aMouseEvent->GetType(eventType);
PR_LOG(sISMLog, PR_LOG_ALWAYS,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"mouse event (type=%s, button=%d) is %s",
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
consumed ? "consumed" : "not consumed"));
#endif
if (PR_LOG_TEST(sISMLog, PR_LOG_ALWAYS)) {
nsAutoString eventType;
aMouseEvent->GetType(eventType);
PR_LOG(sISMLog, PR_LOG_ALWAYS,
("ISM: IMEStateManager::OnMouseButtonEventInEditor(), "
"mouse event (type=%s, button=%d) is %s",
NS_ConvertUTF16toUTF8(eventType).get(), internalEvent->button,
consumed ? "consumed" : "not consumed"));
}
return consumed;
}

View File

@ -127,6 +127,7 @@ Request::Constructor(const GlobalObject& aGlobal,
const RequestInit& aInit, ErrorResult& aRv)
{
nsRefPtr<InternalRequest> request;
bool inputRequestHasBody = false;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
@ -135,6 +136,7 @@ Request::Constructor(const GlobalObject& aGlobal,
nsCOMPtr<nsIInputStream> body;
inputReq->GetBody(getter_AddRefs(body));
if (body) {
inputRequestHasBody = true;
if (inputReq->BodyUsed()) {
aRv.ThrowTypeError(MSG_FETCH_BODY_CONSUMED_ERROR);
return nullptr;
@ -288,7 +290,7 @@ Request::Constructor(const GlobalObject& aGlobal,
return nullptr;
}
if (aInit.mBody.WasPassed()) {
if (aInit.mBody.WasPassed() || inputRequestHasBody) {
// HEAD and GET are not allowed to have a body.
nsAutoCString method;
request->GetMethod(method);
@ -297,7 +299,9 @@ Request::Constructor(const GlobalObject& aGlobal,
aRv.ThrowTypeError(MSG_NO_BODY_ALLOWED_FOR_GET_AND_HEAD);
return nullptr;
}
}
if (aInit.mBody.WasPassed()) {
const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& bodyInit = aInit.mBody.Value();
nsCOMPtr<nsIInputStream> stream;
nsAutoCString contentType;

View File

@ -92,15 +92,10 @@
#include "nsRange.h"
#include <algorithm>
#ifdef PR_LOGGING
static PRLogModuleInfo* gMediaElementLog;
static PRLogModuleInfo* gMediaElementEventsLog;
#define LOG(type, msg) PR_LOG(gMediaElementLog, type, msg)
#define LOG_EVENT(type, msg) PR_LOG(gMediaElementEventsLog, type, msg)
#else
#define LOG(type, msg)
#define LOG_EVENT(type, msg)
#endif
#include "nsIContentSecurityPolicy.h"
@ -2094,14 +2089,12 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
mDisableVideo(false),
mElementInTreeState(ELEMENT_NOT_INTREE)
{
#ifdef PR_LOGGING
if (!gMediaElementLog) {
gMediaElementLog = PR_NewLogModule("nsMediaElement");
}
if (!gMediaElementEventsLog) {
gMediaElementEventsLog = PR_NewLogModule("nsMediaElementEvents");
}
#endif
mAudioChannel = AudioChannelService::GetDefaultAudioChannel();
@ -3597,7 +3590,6 @@ HTMLMediaElement::UpdateReadyStateInternal()
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA);
}
#ifdef PR_LOGGING
static const char* const gReadyStateToString[] = {
"HAVE_NOTHING",
"HAVE_METADATA",
@ -3605,7 +3597,6 @@ static const char* const gReadyStateToString[] = {
"HAVE_FUTURE_DATA",
"HAVE_ENOUGH_DATA"
};
#endif
void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
{
@ -3657,14 +3648,12 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
}
}
#ifdef PR_LOGGING
static const char* const gNetworkStateToString[] = {
"EMPTY",
"IDLE",
"LOADING",
"NO_SOURCE"
};
#endif
void HTMLMediaElement::ChangeNetworkState(nsMediaNetworkState aState)
{

View File

@ -40,12 +40,8 @@
#include "nsThreadUtils.h"
#include "nsVideoFrame.h"
#ifdef PR_LOGGING
static PRLogModuleInfo* gTrackElementLog;
#define LOG(type, msg) PR_LOG(gTrackElementLog, type, msg)
#else
#define LOG(type, msg)
#endif
// Replace the usual NS_IMPL_NS_NEW_HTML_ELEMENT(Track) so
// we can return an UnknownElement instead when pref'd off.
@ -80,11 +76,9 @@ static MOZ_CONSTEXPR const char* kKindTableDefaultString = kKindTable->tag;
HTMLTrackElement::HTMLTrackElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
#ifdef PR_LOGGING
if (!gTrackElementLog) {
gTrackElementLog = PR_NewLogModule("nsTrackElement");
}
#endif
}
HTMLTrackElement::~HTMLTrackElement()

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