зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to autoland
This commit is contained in:
Коммит
bcbe2e1fcc
|
@ -352,7 +352,7 @@ public:
|
|||
}
|
||||
void ContentRemoved(nsIContent* aContainerNode, nsIContent* aChildNode)
|
||||
{
|
||||
ContentRemoved(GetAccessibleOrContainer(aContainerNode), aChildNode);
|
||||
ContentRemoved(AccessibleOrTrueContainer(aContainerNode), aChildNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Add select options test</title>
|
||||
<title>HTML select options test</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
|
@ -91,7 +91,36 @@
|
|||
}
|
||||
}
|
||||
|
||||
//gA11yEventDumpID = "debug";
|
||||
/**
|
||||
* Setting @href on option makes the accessible to recreate.
|
||||
*/
|
||||
function setHrefOnOption()
|
||||
{
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_HIDE, 's2_o'),
|
||||
new invokerChecker(EVENT_SHOW, 's2_o'),
|
||||
];
|
||||
|
||||
this.invoke = function setHrefOnOption_setHref()
|
||||
{
|
||||
getNode('s2_o').setAttribute('href', '1');
|
||||
}
|
||||
|
||||
this.finalCheck = function() {
|
||||
var tree =
|
||||
{ COMBOBOX: [
|
||||
{ COMBOBOX_LIST: [
|
||||
{ COMBOBOX_OPTION: [ ] }
|
||||
] }
|
||||
] };
|
||||
testAccessibleTree('s2', tree);
|
||||
}
|
||||
|
||||
this.getID = function removeptions_getID()
|
||||
{
|
||||
return "setting @href on select option";
|
||||
}
|
||||
}
|
||||
|
||||
function doTest()
|
||||
{
|
||||
|
@ -99,6 +128,7 @@
|
|||
|
||||
gQueue.push(new addOptions("select"));
|
||||
gQueue.push(new removeOptions("select"));
|
||||
gQueue.push(new setHrefOnOption());
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
|
||||
|
@ -109,22 +139,12 @@
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=616452"
|
||||
title="Bug 616452 - Dynamically inserted select options aren't reflected in accessible tree">
|
||||
Mozilla Bug 616452</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=616940"
|
||||
title="Removed select option accessibles aren't removed until hide event is fired">
|
||||
Mozilla Bug 616940</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<select id="select"></select>
|
||||
|
||||
<div id="debug"/>
|
||||
<select id="s2"><option id="s2_o"></option></select>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -598,6 +598,10 @@
|
|||
&certerror.wrongSystemTime;
|
||||
</div>
|
||||
|
||||
<div id="wrongSystemTimeWithoutReferencePanel" style="display: none;">
|
||||
&certerror.wrongSystemTimeWithoutReference;
|
||||
</div>
|
||||
|
||||
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
|
||||
<div id="errorLongDesc" />
|
||||
|
||||
|
|
|
@ -1481,6 +1481,10 @@ var BookmarkingUI = {
|
|||
options.maxResults = kMaxResults;
|
||||
let query = PlacesUtils.history.getNewQuery();
|
||||
|
||||
let sh = Cc["@mozilla.org/network/serialization-helper;1"]
|
||||
.getService(Ci.nsISerializationHelper);
|
||||
let loadingPrincipal = sh.serializeToString(document.nodePrincipal);
|
||||
|
||||
let fragment = document.createDocumentFragment();
|
||||
let root = PlacesUtils.history.executeQuery(query, options).root;
|
||||
root.containerOpen = true;
|
||||
|
@ -1500,6 +1504,7 @@ var BookmarkingUI = {
|
|||
aExtraCSSClass);
|
||||
if (icon) {
|
||||
item.setAttribute("image", icon);
|
||||
item.setAttribute("loadingprincipal", loadingPrincipal);
|
||||
}
|
||||
item._placesNode = node;
|
||||
fragment.appendChild(item);
|
||||
|
|
|
@ -305,8 +305,8 @@ var AboutNetAndCertErrorListener = {
|
|||
learnMoreLink.href = baseURL + "security-error";
|
||||
break;
|
||||
|
||||
// in case the certificate expired we make sure the system clock
|
||||
// matches settings server (kinto) time
|
||||
// In case the certificate expired we make sure the system clock
|
||||
// matches the blocklist ping (Kinto) time and is not before the build date.
|
||||
case SEC_ERROR_EXPIRED_CERTIFICATE:
|
||||
case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
|
||||
case SEC_ERROR_OCSP_FUTURE_RESPONSE:
|
||||
|
@ -314,27 +314,55 @@ var AboutNetAndCertErrorListener = {
|
|||
case MOZILLA_PKIX_ERROR_NOT_YET_VALID_CERTIFICATE:
|
||||
case MOZILLA_PKIX_ERROR_NOT_YET_VALID_ISSUER_CERTIFICATE:
|
||||
|
||||
// use blocklist stats if available
|
||||
// We check against Kinto time first if available, because that allows us
|
||||
// to give the user an approximation of what the correct time is.
|
||||
let difference = 0;
|
||||
if (Services.prefs.getPrefType(PREF_BLOCKLIST_CLOCK_SKEW_SECONDS)) {
|
||||
let difference = Services.prefs.getIntPref(PREF_BLOCKLIST_CLOCK_SKEW_SECONDS);
|
||||
difference = Services.prefs.getIntPref(PREF_BLOCKLIST_CLOCK_SKEW_SECONDS);
|
||||
}
|
||||
|
||||
// if the difference is more than a day
|
||||
if (Math.abs(difference) > 60 * 60 * 24) {
|
||||
// If the difference is more than a day.
|
||||
if (Math.abs(difference) > 60 * 60 * 24) {
|
||||
let formatter = new Intl.DateTimeFormat();
|
||||
let systemDate = formatter.format(new Date());
|
||||
// negative difference means local time is behind server time
|
||||
let actualDate = formatter.format(new Date(Date.now() - difference * 1000));
|
||||
|
||||
content.document.getElementById("wrongSystemTime_URL")
|
||||
.textContent = content.document.location.hostname;
|
||||
content.document.getElementById("wrongSystemTime_systemDate")
|
||||
.textContent = systemDate;
|
||||
content.document.getElementById("wrongSystemTime_actualDate")
|
||||
.textContent = actualDate;
|
||||
|
||||
content.document.getElementById("errorShortDesc")
|
||||
.style.display = "none";
|
||||
content.document.getElementById("wrongSystemTimePanel")
|
||||
.style.display = "block";
|
||||
|
||||
// If there is no clock skew with Kinto servers, check against the build date.
|
||||
// (The Kinto ping could have happened when the time was still right, or not at all)
|
||||
} else {
|
||||
let appBuildID = Services.appinfo.appBuildID;
|
||||
|
||||
let year = parseInt(appBuildID.substr(0, 4), 10);
|
||||
let month = parseInt(appBuildID.substr(4, 2), 10) - 1;
|
||||
let day = parseInt(appBuildID.substr(6, 2), 10);
|
||||
|
||||
let buildDate = new Date(year, month, day);
|
||||
let systemDate = new Date();
|
||||
|
||||
if (buildDate > systemDate) {
|
||||
let formatter = new Intl.DateTimeFormat();
|
||||
let systemDate = formatter.format(new Date());
|
||||
// negative difference means local time is behind server time
|
||||
let actualDate = formatter.format(new Date(Date.now() - difference * 1000));
|
||||
|
||||
content.document.getElementById("wrongSystemTime_URL")
|
||||
content.document.getElementById("wrongSystemTimeWithoutReference_URL")
|
||||
.textContent = content.document.location.hostname;
|
||||
content.document.getElementById("wrongSystemTime_systemDate")
|
||||
.textContent = systemDate;
|
||||
content.document.getElementById("wrongSystemTime_actualDate")
|
||||
.textContent = actualDate;
|
||||
content.document.getElementById("wrongSystemTimeWithoutReference_systemDate")
|
||||
.textContent = formatter.format(systemDate);
|
||||
|
||||
content.document.getElementById("errorShortDesc")
|
||||
.style.display = "none";
|
||||
content.document.getElementById("wrongSystemTimePanel")
|
||||
content.document.getElementById("wrongSystemTimeWithoutReferencePanel")
|
||||
.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ support-files =
|
|||
browser_bug678392-1.html
|
||||
browser_bug678392-2.html
|
||||
browser_bug970746.xhtml
|
||||
browser_fxa_oauth.html
|
||||
browser_fxa_oauth_with_keys.html
|
||||
browser_fxa_web_channel.html
|
||||
browser_registerProtocolHandler_notification.html
|
||||
browser_star_hsts.sjs
|
||||
|
@ -320,7 +318,6 @@ skip-if = os == "linux" # Linux: Intermittent failures - bug 941575.
|
|||
[browser_fxaccounts.js]
|
||||
support-files = fxa_profile_handler.sjs
|
||||
[browser_fxa_migrate.js]
|
||||
[browser_fxa_oauth.js]
|
||||
[browser_fxa_web_channel.js]
|
||||
[browser_gestureSupport.js]
|
||||
skip-if = e10s # Bug 863514 - no gesture support.
|
||||
|
|
|
@ -105,6 +105,19 @@ add_task(function* checkBadStsCert() {
|
|||
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
|
||||
// This checks that the appinfo.appBuildID starts with a date string,
|
||||
// which is required for the misconfigured system time check.
|
||||
add_task(function* checkAppBuildIDIsDate() {
|
||||
let appBuildID = Services.appinfo.appBuildID;
|
||||
let year = parseInt(appBuildID.substr(0, 4), 10);
|
||||
let month = parseInt(appBuildID.substr(4, 2), 10);
|
||||
let day = parseInt(appBuildID.substr(6, 2), 10);
|
||||
|
||||
ok(year >= 2016 && year <= 2100, "appBuildID contains a valid year");
|
||||
ok(month >= 1 && month <= 12, "appBuildID contains a valid month");
|
||||
ok(day >= 1 && day <= 31, "appBuildID contains a valid day");
|
||||
});
|
||||
|
||||
const PREF_BLOCKLIST_CLOCK_SKEW_SECONDS = "services.blocklist.clock_skew_seconds";
|
||||
|
||||
add_task(function* checkWrongSystemTimeWarning() {
|
||||
|
@ -151,7 +164,7 @@ add_task(function* checkWrongSystemTimeWarning() {
|
|||
let message = yield Task.spawn(setUpPage);
|
||||
|
||||
isnot(message.divDisplay, "none", "Wrong time message information is visible");
|
||||
ok(message.text.includes("because your clock appears to show the wrong time"),
|
||||
ok(message.text.includes("clock appears to show the wrong time"),
|
||||
"Correct error message found");
|
||||
ok(message.text.includes("expired.example.com"), "URL found in error message");
|
||||
ok(message.systemDate.includes(localDateFmt), "correct local date displayed");
|
||||
|
@ -172,7 +185,7 @@ add_task(function* checkWrongSystemTimeWarning() {
|
|||
message = yield Task.spawn(setUpPage);
|
||||
|
||||
isnot(message.divDisplay, "none", "Wrong time message information is visible");
|
||||
ok(message.text.includes("because your clock appears to show the wrong time"),
|
||||
ok(message.text.includes("clock appears to show the wrong time"),
|
||||
"Correct error message found");
|
||||
ok(message.text.includes("expired.example.com"), "URL found in error message");
|
||||
ok(message.systemDate.includes(localDateFmt), "correct local date displayed");
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>fxa_oauth_test</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var event = new window.CustomEvent("WebChannelMessageToChrome", {
|
||||
// Note: This intentionally sends an object instead of a string, to ensure both work
|
||||
// (see browser_fxa_oauth_with_keys.html for the other test)
|
||||
detail: {
|
||||
id: "oauth_client_id",
|
||||
message: {
|
||||
command: "oauth_complete",
|
||||
data: {
|
||||
state: "state",
|
||||
code: "code1",
|
||||
closeWindow: "signin",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
window.dispatchEvent(event);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,327 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
//
|
||||
// Whitelisting this test.
|
||||
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
||||
//
|
||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.docShell is null");
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsOAuthClient",
|
||||
"resource://gre/modules/FxAccountsOAuthClient.jsm");
|
||||
|
||||
const HTTP_PATH = "http://example.com";
|
||||
const HTTP_ENDPOINT = "/browser/browser/base/content/test/general/browser_fxa_oauth.html";
|
||||
const HTTP_ENDPOINT_WITH_KEYS = "/browser/browser/base/content/test/general/browser_fxa_oauth_with_keys.html";
|
||||
|
||||
var gTests = [
|
||||
{
|
||||
desc: "FxA OAuth - should open a new tab, complete OAuth flow",
|
||||
run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tabOpened = false;
|
||||
let properURL = "http://example.com/browser/browser/base/content/test/general/browser_fxa_oauth.html";
|
||||
let queryStrings = [
|
||||
"action=signin",
|
||||
"client_id=client_id",
|
||||
"scope=",
|
||||
"state=state",
|
||||
"webChannelId=oauth_client_id",
|
||||
];
|
||||
queryStrings.sort();
|
||||
|
||||
waitForTab(function(tab) {
|
||||
Assert.ok("Tab successfully opened");
|
||||
Assert.ok(gBrowser.currentURI.spec.split("?")[0], properURL, "Check URL without params");
|
||||
let actualURL = new URL(gBrowser.currentURI.spec);
|
||||
let actualQueryStrings = actualURL.search.substring(1).split("&");
|
||||
actualQueryStrings.sort();
|
||||
Assert.equal(actualQueryStrings.length, queryStrings.length, "Check number of params");
|
||||
|
||||
for (let i = 0; i < queryStrings.length; i++) {
|
||||
Assert.equal(actualQueryStrings[i], queryStrings[i], "Check parameter " + i);
|
||||
}
|
||||
|
||||
tabOpened = true;
|
||||
});
|
||||
|
||||
let client = new FxAccountsOAuthClient({
|
||||
parameters: {
|
||||
state: "state",
|
||||
client_id: "client_id",
|
||||
oauth_uri: HTTP_PATH,
|
||||
content_uri: HTTP_PATH,
|
||||
},
|
||||
authorizationEndpoint: HTTP_ENDPOINT
|
||||
});
|
||||
|
||||
client.onComplete = function(tokenData) {
|
||||
Assert.ok(tabOpened);
|
||||
Assert.equal(tokenData.code, "code1");
|
||||
Assert.equal(tokenData.state, "state");
|
||||
resolve();
|
||||
};
|
||||
|
||||
client.onError = reject;
|
||||
|
||||
client.launchWebFlow();
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "FxA OAuth - should open a new tab, complete OAuth flow when forcing auth",
|
||||
run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tabOpened = false;
|
||||
let properURL = "http://example.com/browser/browser/base/content/test/general/browser_fxa_oauth.html";
|
||||
let queryStrings = [
|
||||
"action=force_auth",
|
||||
"client_id=client_id",
|
||||
"scope=",
|
||||
"state=state",
|
||||
"webChannelId=oauth_client_id",
|
||||
"email=test%40invalid.com",
|
||||
];
|
||||
queryStrings.sort();
|
||||
|
||||
waitForTab(function(tab) {
|
||||
Assert.ok("Tab successfully opened");
|
||||
Assert.ok(gBrowser.currentURI.spec.split("?")[0], properURL, "Check URL without params");
|
||||
|
||||
let actualURL = new URL(gBrowser.currentURI.spec);
|
||||
let actualQueryStrings = actualURL.search.substring(1).split("&");
|
||||
actualQueryStrings.sort();
|
||||
Assert.equal(actualQueryStrings.length, queryStrings.length, "Check number of params");
|
||||
|
||||
for (let i = 0; i < queryStrings.length; i++) {
|
||||
Assert.equal(actualQueryStrings[i], queryStrings[i], "Check parameter " + i);
|
||||
}
|
||||
|
||||
tabOpened = true;
|
||||
});
|
||||
|
||||
let client = new FxAccountsOAuthClient({
|
||||
parameters: {
|
||||
state: "state",
|
||||
client_id: "client_id",
|
||||
oauth_uri: HTTP_PATH,
|
||||
content_uri: HTTP_PATH,
|
||||
action: "force_auth",
|
||||
email: "test@invalid.com"
|
||||
},
|
||||
authorizationEndpoint: HTTP_ENDPOINT
|
||||
});
|
||||
|
||||
client.onComplete = function(tokenData) {
|
||||
Assert.ok(tabOpened);
|
||||
Assert.equal(tokenData.code, "code1");
|
||||
Assert.equal(tokenData.state, "state");
|
||||
resolve();
|
||||
};
|
||||
|
||||
client.onError = reject;
|
||||
|
||||
client.launchWebFlow();
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "FxA OAuth - should receive an error when there's a state mismatch",
|
||||
run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tabOpened = false;
|
||||
|
||||
waitForTab(function(tab) {
|
||||
Assert.ok("Tab successfully opened");
|
||||
|
||||
// It should have passed in the expected non-matching state value.
|
||||
let queryString = gBrowser.currentURI.spec.split("?")[1];
|
||||
Assert.ok(queryString.indexOf("state=different-state") >= 0);
|
||||
|
||||
tabOpened = true;
|
||||
});
|
||||
|
||||
let client = new FxAccountsOAuthClient({
|
||||
parameters: {
|
||||
state: "different-state",
|
||||
client_id: "client_id",
|
||||
oauth_uri: HTTP_PATH,
|
||||
content_uri: HTTP_PATH,
|
||||
},
|
||||
authorizationEndpoint: HTTP_ENDPOINT
|
||||
});
|
||||
|
||||
client.onComplete = reject;
|
||||
|
||||
client.onError = function(err) {
|
||||
Assert.ok(tabOpened);
|
||||
Assert.equal(err.message, "OAuth flow failed. State doesn't match");
|
||||
resolve();
|
||||
};
|
||||
|
||||
client.launchWebFlow();
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "FxA OAuth - should be able to request keys during OAuth flow",
|
||||
run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tabOpened = false;
|
||||
|
||||
waitForTab(function(tab) {
|
||||
Assert.ok("Tab successfully opened");
|
||||
|
||||
// It should have asked for keys.
|
||||
let queryString = gBrowser.currentURI.spec.split("?")[1];
|
||||
Assert.ok(queryString.indexOf("keys=true") >= 0);
|
||||
|
||||
tabOpened = true;
|
||||
});
|
||||
|
||||
let client = new FxAccountsOAuthClient({
|
||||
parameters: {
|
||||
state: "state",
|
||||
client_id: "client_id",
|
||||
oauth_uri: HTTP_PATH,
|
||||
content_uri: HTTP_PATH,
|
||||
keys: true,
|
||||
},
|
||||
authorizationEndpoint: HTTP_ENDPOINT_WITH_KEYS
|
||||
});
|
||||
|
||||
client.onComplete = function(tokenData, keys) {
|
||||
Assert.ok(tabOpened);
|
||||
Assert.equal(tokenData.code, "code1");
|
||||
Assert.equal(tokenData.state, "state");
|
||||
Assert.deepEqual(keys.kAr, {k: "kAr"});
|
||||
Assert.deepEqual(keys.kBr, {k: "kBr"});
|
||||
resolve();
|
||||
};
|
||||
|
||||
client.onError = reject;
|
||||
|
||||
client.launchWebFlow();
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "FxA OAuth - should not receive keys if not explicitly requested",
|
||||
run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tabOpened = false;
|
||||
|
||||
waitForTab(function(tab) {
|
||||
Assert.ok("Tab successfully opened");
|
||||
|
||||
// It should not have asked for keys.
|
||||
let queryString = gBrowser.currentURI.spec.split("?")[1];
|
||||
Assert.ok(queryString.indexOf("keys=true") == -1);
|
||||
|
||||
tabOpened = true;
|
||||
});
|
||||
|
||||
let client = new FxAccountsOAuthClient({
|
||||
parameters: {
|
||||
state: "state",
|
||||
client_id: "client_id",
|
||||
oauth_uri: HTTP_PATH,
|
||||
content_uri: HTTP_PATH
|
||||
},
|
||||
// This endpoint will cause the completion message to contain keys.
|
||||
authorizationEndpoint: HTTP_ENDPOINT_WITH_KEYS
|
||||
});
|
||||
|
||||
client.onComplete = function(tokenData, keys) {
|
||||
Assert.ok(tabOpened);
|
||||
Assert.equal(tokenData.code, "code1");
|
||||
Assert.equal(tokenData.state, "state");
|
||||
Assert.strictEqual(keys, undefined);
|
||||
resolve();
|
||||
};
|
||||
|
||||
client.onError = reject;
|
||||
|
||||
client.launchWebFlow();
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "FxA OAuth - should receive an error if keys could not be obtained",
|
||||
run() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let tabOpened = false;
|
||||
|
||||
waitForTab(function(tab) {
|
||||
Assert.ok("Tab successfully opened");
|
||||
|
||||
// It should have asked for keys.
|
||||
let queryString = gBrowser.currentURI.spec.split("?")[1];
|
||||
Assert.ok(queryString.indexOf("keys=true") >= 0);
|
||||
|
||||
tabOpened = true;
|
||||
});
|
||||
|
||||
let client = new FxAccountsOAuthClient({
|
||||
parameters: {
|
||||
state: "state",
|
||||
client_id: "client_id",
|
||||
oauth_uri: HTTP_PATH,
|
||||
content_uri: HTTP_PATH,
|
||||
keys: true,
|
||||
},
|
||||
// This endpoint will cause the completion message not to contain keys.
|
||||
authorizationEndpoint: HTTP_ENDPOINT
|
||||
});
|
||||
|
||||
client.onComplete = reject;
|
||||
|
||||
client.onError = function(err) {
|
||||
Assert.ok(tabOpened);
|
||||
Assert.equal(err.message, "OAuth flow failed. Keys were not returned");
|
||||
resolve();
|
||||
};
|
||||
|
||||
client.launchWebFlow();
|
||||
});
|
||||
}
|
||||
}
|
||||
]; // gTests
|
||||
|
||||
function waitForTab(aCallback) {
|
||||
let container = gBrowser.tabContainer;
|
||||
container.addEventListener("TabOpen", function tabOpener(event) {
|
||||
container.removeEventListener("TabOpen", tabOpener);
|
||||
gBrowser.addEventListener("load", function listener() {
|
||||
gBrowser.removeEventListener("load", listener, true);
|
||||
let tab = event.target;
|
||||
aCallback(tab);
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
Task.spawn(function* () {
|
||||
const webchannelWhitelistPref = "webchannel.allowObject.urlWhitelist";
|
||||
let origWhitelist = Services.prefs.getCharPref(webchannelWhitelistPref);
|
||||
let newWhitelist = origWhitelist + " http://example.com";
|
||||
Services.prefs.setCharPref(webchannelWhitelistPref, newWhitelist);
|
||||
try {
|
||||
for (let testCase of gTests) {
|
||||
info("Running: " + testCase.desc);
|
||||
yield testCase.run();
|
||||
}
|
||||
} finally {
|
||||
Services.prefs.clearUserPref(webchannelWhitelistPref);
|
||||
}
|
||||
}).then(finish, ex => {
|
||||
Assert.ok(false, "Unexpected Exception: " + ex);
|
||||
finish();
|
||||
});
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>fxa_oauth_test</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var event = new window.CustomEvent("WebChannelMessageToChrome", {
|
||||
// Note: This intentionally sends a string instead of an object, to ensure both work
|
||||
// (see browser_fxa_oauth.html for the other test)
|
||||
detail: JSON.stringify({
|
||||
id: "oauth_client_id",
|
||||
message: {
|
||||
command: "oauth_complete",
|
||||
data: {
|
||||
state: "state",
|
||||
code: "code1",
|
||||
closeWindow: "signin",
|
||||
// Keys normally contain more information, but this is enough
|
||||
// to keep Loop's tests happy.
|
||||
keys: { kAr: { k: "kAr" }, kBr: { k: "kBr" }},
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
window.dispatchEvent(event);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -32,6 +32,10 @@ let gWhitelist = [{
|
|||
file: "netError.dtd",
|
||||
key: "certerror.wrongSystemTime",
|
||||
type: "single-quote"
|
||||
}, {
|
||||
file: "netError.dtd",
|
||||
key: "certerror.wrongSystemTimeWithoutReference",
|
||||
type: "single-quote"
|
||||
}, {
|
||||
file: "phishing-afterload-warning-message.dtd",
|
||||
key: "safeb.blocked.malwarePage.shortDesc",
|
||||
|
|
|
@ -1161,7 +1161,9 @@ DownloadsPlacesView.prototype = {
|
|||
isCommandEnabled(aCommand) {
|
||||
switch (aCommand) {
|
||||
case "cmd_copy":
|
||||
return this._richlistbox.selectedItems.length > 0;
|
||||
case "downloadsCmd_openReferrer":
|
||||
case "downloadShowMenuItem":
|
||||
return this._richlistbox.selectedItems.length == 1;
|
||||
case "cmd_selectAll":
|
||||
return true;
|
||||
case "cmd_paste":
|
||||
|
|
|
@ -122,7 +122,7 @@ var SessionStorageInternal = {
|
|||
// There is no need to pass documentURI, it's only used to fill documentURI property of
|
||||
// domstorage event, which in this case has no consumer. Prevention of events in case
|
||||
// of missing documentURI will be solved in a followup bug to bug 600307.
|
||||
let storage = storageManager.createStorage(window, principal, "");
|
||||
let storage = storageManager.createStorage(window, principal, "", aDocShell.usePrivateBrowsing);
|
||||
|
||||
for (let key of Object.keys(data)) {
|
||||
try {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/linux64/nightly"
|
||||
|
||||
export LLVM_CONFIG="${TOOLTOOL_DIR}/clang/bin/llvm-config"
|
||||
|
||||
ac_add_options --enable-stylo
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/linux64/debug"
|
||||
|
||||
export LLVM_CONFIG="${TOOLTOOL_DIR}/clang/bin/llvm-config"
|
||||
|
||||
ac_add_options --enable-stylo
|
||||
|
|
|
@ -31,5 +31,13 @@
|
|||
"unpack": true,
|
||||
"digest": "b89c40dbf28c2bd54fadf017c15a8789f6e7611252a623cc3a1507e3dd6fc9e5a50d746e81776ba856e33fdc99b4a6413ba7c3ac0aed5f4835705da2b758ef22",
|
||||
"size": 1020700
|
||||
},
|
||||
{
|
||||
"version": "clang + llvm 3.9.0, built from SVN r290136",
|
||||
"size": 151724092,
|
||||
"digest": "4ab5ff2131e4ce4888d38c17feb192c19bc6ede83abef55af7d2f29e2446f6335dc860377fa25cbb0283b3958c0a3d377a3cfdc7705a85d4843e3ab357ddca7f",
|
||||
"algorithm": "sha512",
|
||||
"filename": "clang.tar.xz",
|
||||
"unpack": true
|
||||
}
|
||||
]
|
||||
|
|
|
@ -444,6 +444,8 @@
|
|||
@RESPATH@/components/PlacesCategoriesStarter.js
|
||||
@RESPATH@/components/ColorAnalyzer.js
|
||||
@RESPATH@/components/PageThumbsProtocol.js
|
||||
@RESPATH@/components/mozProtocolHandler.js
|
||||
@RESPATH@/components/mozProtocolHandler.manifest
|
||||
@RESPATH@/components/nsDefaultCLH.manifest
|
||||
@RESPATH@/components/nsDefaultCLH.js
|
||||
@RESPATH@/components/nsContentPrefService.manifest
|
||||
|
|
|
@ -197,9 +197,11 @@ was trying to connect. -->
|
|||
<!ENTITY weakCryptoAdvanced.longDesc "<span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe.">
|
||||
<!ENTITY weakCryptoAdvanced.override "(Not secure) Try loading <span class='hostname'></span> using outdated security">
|
||||
|
||||
<!-- LOCALIZATION NOTE (certerror.wrongSystemTime) - The <span id='..' /> tags will be injected with actual values,
|
||||
please leave them unchanged. -->
|
||||
<!ENTITY certerror.wrongSystemTime "<p>A secure connection to <span id='wrongSystemTime_URL'/> isn’t possible because your clock appears to show the wrong time.</p> <p>Your computer thinks it is <span id='wrongSystemTime_systemDate'/>, when it should be <span id='wrongSystemTime_actualDate'/>. To fix this problem, change your date and time settings to match the correct time.</p>">
|
||||
<!-- LOCALIZATION NOTE (certerror.wrongSystemTime,
|
||||
certerror.wrongSystemTimeWithoutReference) - The <span id='..' />
|
||||
tags will be injected with actual values, please leave them unchanged. -->
|
||||
<!ENTITY certerror.wrongSystemTime "<p> &brandShortName; did not connect to <span id='wrongSystemTime_URL'/> because your computer’s clock appears to show the wrong time and this is preventing a secure connection.</p> <p>Your computer is set to <span id='wrongSystemTime_systemDate'/>, when it should be <span id='wrongSystemTime_actualDate'/>. To fix this problem, change your date and time settings to match the correct time.</p>">
|
||||
<!ENTITY certerror.wrongSystemTimeWithoutReference "<p>&brandShortName; did not connect to <span id='wrongSystemTimeWithoutReference_URL'/> because your computer’s clock appears to show the wrong time and this is preventing a secure connection.</p> <p>Your computer is set to <span id='wrongSystemTimeWithoutReference_systemDate'/>. To fix this problem, change your date and time settings to match the correct time.</p>">
|
||||
|
||||
<!ENTITY certerror.pagetitle1 "Insecure Connection">
|
||||
<!ENTITY certerror.whatShouldIDo.badStsCertExplanation "This site uses HTTP
|
||||
|
|
|
@ -554,6 +554,11 @@ function prompt(aBrowser, aRequest) {
|
|||
function listDevices(menupopup, devices) {
|
||||
while (menupopup.lastChild)
|
||||
menupopup.removeChild(menupopup.lastChild);
|
||||
// Removing the child nodes of the menupopup doesn't clear the value
|
||||
// attribute of the menulist. This can have unfortunate side effects
|
||||
// when the list is rebuilt with a different content, so we remove
|
||||
// the value attribute explicitly.
|
||||
menupopup.parentNode.removeAttribute("value");
|
||||
|
||||
for (let device of devices)
|
||||
addDeviceToList(menupopup, device.name, device.deviceIndex);
|
||||
|
|
|
@ -470,32 +470,21 @@ if __name__ == "__main__":
|
|||
|
||||
if not os.path.exists(source_dir):
|
||||
os.makedirs(source_dir)
|
||||
if os.path.exists(llvm_source_dir):
|
||||
svn_update(llvm_source_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, llvm_repo, llvm_source_dir, llvm_revision)
|
||||
if os.path.exists(clang_source_dir):
|
||||
svn_update(clang_source_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, clang_repo, clang_source_dir, llvm_revision)
|
||||
if os.path.exists(compiler_rt_source_dir):
|
||||
svn_update(compiler_rt_source_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, compiler_repo, compiler_rt_source_dir, llvm_revision)
|
||||
if os.path.exists(libcxx_source_dir):
|
||||
svn_update(libcxx_source_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, libcxx_repo, libcxx_source_dir, llvm_revision)
|
||||
|
||||
def checkout_or_update(repo, checkout_dir):
|
||||
if os.path.exists(checkout_dir):
|
||||
svn_update(checkout_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, repo, checkout_dir, llvm_revision)
|
||||
|
||||
checkout_or_update(llvm_repo, llvm_source_dir)
|
||||
checkout_or_update(clang_repo, clang_source_dir)
|
||||
checkout_or_update(compiler_repo, compiler_rt_source_dir)
|
||||
checkout_or_update(libcxx_repo, libcxx_source_dir)
|
||||
if libcxxabi_repo:
|
||||
if os.path.exists(libcxxabi_source_dir):
|
||||
svn_update(libcxxabi_source_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, libcxxabi_repo, libcxxabi_source_dir, llvm_revision)
|
||||
checkout_or_update(libcxxabi_repo, libcxxabi_source_dir)
|
||||
if extra_repo:
|
||||
if os.path.exists(extra_source_dir):
|
||||
svn_update(extra_source_dir, llvm_revision)
|
||||
else:
|
||||
svn_co(source_dir, extra_repo, extra_source_dir, llvm_revision)
|
||||
checkout_or_update(extra_repo, extra_source_dir)
|
||||
for p in config.get("patches", {}).get(get_platform(), []):
|
||||
patch(p, source_dir)
|
||||
|
||||
|
|
|
@ -1,30 +1,27 @@
|
|||
{
|
||||
"llvm_revision": "262557",
|
||||
"llvm_revision": "290136",
|
||||
"stages": "3",
|
||||
"build_libcxx": true,
|
||||
"build_type": "Release",
|
||||
"assertions": false,
|
||||
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_380/final",
|
||||
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_380/final",
|
||||
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_380/final",
|
||||
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_380/final",
|
||||
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_380/final",
|
||||
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_390/final",
|
||||
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_390/final",
|
||||
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_390/final",
|
||||
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_390/final",
|
||||
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_390/final",
|
||||
"python_path": "/usr/bin/python2.7",
|
||||
"gcc_dir": "/home/worker/workspace/build/src/gcc",
|
||||
"cc": "/home/worker/workspace/build/src/gcc/bin/gcc",
|
||||
"cxx": "/home/worker/workspace/build/src/gcc/bin/g++",
|
||||
"patches": {
|
||||
"macosx64": [
|
||||
"llvm-debug-frame.patch",
|
||||
"return-empty-string-non-mangled.patch"
|
||||
"llvm-debug-frame.patch"
|
||||
],
|
||||
"linux64": [
|
||||
"llvm-debug-frame.patch",
|
||||
"return-empty-string-non-mangled.patch"
|
||||
"llvm-debug-frame.patch"
|
||||
],
|
||||
"linux32": [
|
||||
"llvm-debug-frame.patch",
|
||||
"return-empty-string-non-mangled.patch"
|
||||
"llvm-debug-frame.patch"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,3 +109,6 @@ if CONFIG['INTEL_ARCHITECTURE']:
|
|||
|
||||
if CONFIG['MACOS_SDK_DIR']:
|
||||
gyp_vars['mac_sdk_path'] = CONFIG['MACOS_SDK_DIR']
|
||||
|
||||
if not CONFIG['MOZ_SYSTEM_LIBVPX']:
|
||||
gyp_vars['libvpx_dir'] = '/media/libvpx/libvpx'
|
||||
|
|
|
@ -21,6 +21,7 @@ const URLs = new Map([
|
|||
["data:text/html,Hi", true, false, true],
|
||||
["view-source:data:text/html,Hi", false, false, true],
|
||||
["javascript:alert('hi')", true, false, true],
|
||||
["moz://a", false, false, true],
|
||||
]],
|
||||
["feed:http://www.example.com", [
|
||||
["http://www.example2.com", true, true, true],
|
||||
|
@ -36,6 +37,7 @@ const URLs = new Map([
|
|||
["data:text/html,Hi", true, false, true],
|
||||
["view-source:data:text/html,Hi", false, false, true],
|
||||
["javascript:alert('hi')", true, false, true],
|
||||
["moz://a", false, false, true],
|
||||
]],
|
||||
["view-source:http://www.example.com", [
|
||||
["http://www.example2.com", true, true, true],
|
||||
|
@ -51,6 +53,7 @@ const URLs = new Map([
|
|||
["data:text/html,Hi", true, false, true],
|
||||
["view-source:data:text/html,Hi", true, false, true],
|
||||
["javascript:alert('hi')", true, false, true],
|
||||
["moz://a", false, false, true],
|
||||
]],
|
||||
["about:foo", [
|
||||
["about:foo?", true, true, true],
|
||||
|
@ -63,6 +66,7 @@ const URLs = new Map([
|
|||
["about:bar?foo#baz", false, false, true],
|
||||
["about:bar?foo", false, false, true],
|
||||
["http://www.example.com/", true, true, true],
|
||||
["moz://a", false, false, true],
|
||||
]],
|
||||
]);
|
||||
|
||||
|
|
|
@ -942,7 +942,13 @@ ifndef MOZ_OPTIMIZE
|
|||
rustflags_override = RUSTFLAGS='-C opt-level=0'
|
||||
endif
|
||||
|
||||
CARGO_BUILD = env $(rustflags_override) CARGO_TARGET_DIR=. RUSTC=$(RUSTC) MOZ_DIST=$(ABS_DIST) $(CARGO) build $(cargo_build_flags)
|
||||
CARGO_BUILD = env $(rustflags_override) \
|
||||
CARGO_TARGET_DIR=. \
|
||||
RUSTC=$(RUSTC) \
|
||||
MOZ_DIST=$(ABS_DIST) \
|
||||
LIBCLANG_PATH=$(MOZ_LIBCLANG_PATH) \
|
||||
CLANG_PATH=$(MOZ_CLANG_PATH) \
|
||||
$(CARGO) build $(cargo_build_flags)
|
||||
|
||||
ifdef RUST_LIBRARY_FILE
|
||||
|
||||
|
|
|
@ -74,12 +74,10 @@
|
|||
|
||||
/* Set flex attribute to Toolbox buttons and Picker container so,
|
||||
they don't overlap with the tab bar */
|
||||
#toolbox-buttons-start,
|
||||
#toolbox-buttons-end {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#toolbox-picker-container {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
#toolbox-buttons-start {
|
||||
|
@ -318,8 +316,9 @@
|
|||
/* Command buttons */
|
||||
|
||||
.command-button {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
/* !important is needed to override .devtools-button rules in common.css */
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ TimeoutManager::Initialize()
|
|||
DEFAULT_MIN_TRACKING_TIMEOUT_VALUE);
|
||||
Preferences::AddIntVarCache(&gMinTrackingBackgroundTimeoutValue,
|
||||
"dom.min_tracking_background_timeout_value",
|
||||
DEFAULT_MIN_BACKGROUND_TIMEOUT_VALUE);
|
||||
DEFAULT_MIN_TRACKING_BACKGROUND_TIMEOUT_VALUE);
|
||||
Preferences::AddIntVarCache(&gTimeoutBucketingStrategy,
|
||||
"dom.timeout_bucketing_strategy",
|
||||
TRACKING_SEPARATE_TIMEOUT_BUCKETING_STRATEGY);
|
||||
|
|
|
@ -189,6 +189,7 @@
|
|||
#include "nsReferencedElement.h"
|
||||
#include "nsSandboxFlags.h"
|
||||
#include "nsScriptSecurityManager.h"
|
||||
#include "nsSerializationHelper.h"
|
||||
#include "nsStreamUtils.h"
|
||||
#include "nsTextEditorState.h"
|
||||
#include "nsTextFragment.h"
|
||||
|
@ -9779,3 +9780,33 @@ nsContentUtils::AppendDocumentLevelNativeAnonymousContentTo(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsContentUtils::GetContentPolicyTypeForUIImageLoading(nsIContent* aLoadingNode,
|
||||
nsIPrincipal** aLoadingPrincipal,
|
||||
nsContentPolicyType& aContentPolicyType)
|
||||
{
|
||||
// Use the serialized loadingPrincipal from the image element. Fall back
|
||||
// to mContent's principal (SystemPrincipal) if not available.
|
||||
aContentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE;
|
||||
nsCOMPtr<nsIPrincipal> loadingPrincipal = aLoadingNode->NodePrincipal();
|
||||
nsAutoString imageLoadingPrincipal;
|
||||
aLoadingNode->GetAttr(kNameSpaceID_None, nsGkAtoms::loadingprincipal,
|
||||
imageLoadingPrincipal);
|
||||
if (!imageLoadingPrincipal.IsEmpty()) {
|
||||
nsCOMPtr<nsISupports> serializedPrincipal;
|
||||
NS_DeserializeObject(NS_ConvertUTF16toUTF8(imageLoadingPrincipal),
|
||||
getter_AddRefs(serializedPrincipal));
|
||||
loadingPrincipal = do_QueryInterface(serializedPrincipal);
|
||||
|
||||
if (loadingPrincipal) {
|
||||
// Set the content policy type to TYPE_INTERNAL_IMAGE_FAVICON for
|
||||
// indicating it's a favicon loading.
|
||||
aContentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON;
|
||||
} else {
|
||||
// Fallback if the deserialization is failed.
|
||||
loadingPrincipal = aLoadingNode->NodePrincipal();
|
||||
}
|
||||
}
|
||||
loadingPrincipal.forget(aLoadingPrincipal);
|
||||
}
|
||||
|
|
|
@ -2743,6 +2743,16 @@ public:
|
|||
nsIDocument* aDocument,
|
||||
nsTArray<nsIContent*>& aElements);
|
||||
|
||||
/**
|
||||
* Returns the content policy type that should be used for loading images
|
||||
* for displaying in the UI. The sources of such images can be <xul:image>,
|
||||
* <xul:menuitem> on OSX where we load the image through nsMenuItemIconX, etc.
|
||||
*/
|
||||
static void
|
||||
GetContentPolicyTypeForUIImageLoading(nsIContent* aLoadingNode,
|
||||
nsIPrincipal** aLoadingPrincipal,
|
||||
nsContentPolicyType& aContentPolicyType);
|
||||
|
||||
private:
|
||||
static bool InitializeEventTable();
|
||||
|
||||
|
|
|
@ -69,21 +69,10 @@
|
|||
#include "nsIDOMEventTarget.h"
|
||||
|
||||
// CSS related includes
|
||||
#include "nsCSSRules.h"
|
||||
#include "nsIDOMCSSRule.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
// includes needed for the prototype chain interfaces
|
||||
#include "nsIDOMCSSKeyframeRule.h"
|
||||
#include "nsIDOMCSSKeyframesRule.h"
|
||||
#include "nsIDOMCSSImportRule.h"
|
||||
#include "nsIDOMCSSMediaRule.h"
|
||||
#include "nsIDOMCSSFontFaceRule.h"
|
||||
#include "nsIDOMCSSMozDocumentRule.h"
|
||||
#include "nsIDOMCSSSupportsRule.h"
|
||||
#include "nsIDOMCSSCounterStyleRule.h"
|
||||
#include "nsIDOMCSSPageRule.h"
|
||||
#include "nsIDOMCSSStyleRule.h"
|
||||
#include "nsIDOMXULCommandDispatcher.h"
|
||||
#include "nsIControllers.h"
|
||||
#ifdef MOZ_XUL
|
||||
|
@ -189,16 +178,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
|
||||
// Misc Core related classes
|
||||
|
||||
// CSS classes
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSNameSpaceRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
// XUL classes
|
||||
#ifdef MOZ_XUL
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULCommandDispatcher, nsDOMGenericSH,
|
||||
|
@ -221,15 +200,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
DEFAULT_SCRIPTABLE_FLAGS)
|
||||
#endif
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager,
|
||||
nsMessageManagerSH<nsEventTargetSH>,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
|
@ -246,20 +216,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSKeyframeRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSKeyframesRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSCounterStyleRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSPageRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
|
||||
|
@ -512,22 +468,6 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSMediaRule, nsIDOMCSSMediaRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMediaRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSNameSpaceRule, nsIDOMCSSRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
DOM_CLASSINFO_MAP_BEGIN(XULCommandDispatcher, nsIDOMXULCommandDispatcher)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandDispatcher)
|
||||
|
@ -561,18 +501,6 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_END
|
||||
#endif
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSMozDocumentRule, nsIDOMCSSMozDocumentRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMozDocumentRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSSupportsRule, nsIDOMCSSSupportsRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
|
||||
|
@ -603,26 +531,6 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframeRule, nsIDOMCSSKeyframeRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframeRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframesRule, nsIDOMCSSKeyframesRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframesRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSCounterStyleRule, nsIDOMCSSCounterStyleRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSPageRule, nsIDOMCSSPageRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPageRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(CSSFontFeatureValuesRule, nsIDOMCSSFontFeatureValuesRule)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
|
|
@ -19,12 +19,6 @@ enum nsDOMClassInfoID
|
|||
eDOMClassInfo_DOMPrototype_id,
|
||||
eDOMClassInfo_DOMConstructor_id,
|
||||
|
||||
// CSS classes
|
||||
eDOMClassInfo_CSSStyleRule_id,
|
||||
eDOMClassInfo_CSSImportRule_id,
|
||||
eDOMClassInfo_CSSMediaRule_id,
|
||||
eDOMClassInfo_CSSNameSpaceRule_id,
|
||||
|
||||
// XUL classes
|
||||
#ifdef MOZ_XUL
|
||||
eDOMClassInfo_XULCommandDispatcher_id,
|
||||
|
@ -40,27 +34,11 @@ enum nsDOMClassInfoID
|
|||
eDOMClassInfo_XULTreeBuilder_id,
|
||||
#endif
|
||||
|
||||
eDOMClassInfo_CSSMozDocumentRule_id,
|
||||
eDOMClassInfo_CSSSupportsRule_id,
|
||||
|
||||
// @font-face in CSS
|
||||
eDOMClassInfo_CSSFontFaceRule_id,
|
||||
|
||||
eDOMClassInfo_ContentFrameMessageManager_id,
|
||||
eDOMClassInfo_ContentProcessMessageManager_id,
|
||||
eDOMClassInfo_ChromeMessageBroadcaster_id,
|
||||
eDOMClassInfo_ChromeMessageSender_id,
|
||||
|
||||
eDOMClassInfo_CSSKeyframeRule_id,
|
||||
eDOMClassInfo_CSSKeyframesRule_id,
|
||||
|
||||
// @counter-style in CSS
|
||||
eDOMClassInfo_CSSCounterStyleRule_id,
|
||||
|
||||
eDOMClassInfo_CSSPageRule_id,
|
||||
|
||||
eDOMClassInfo_CSSFontFeatureValuesRule_id,
|
||||
|
||||
eDOMClassInfo_XULControlElement_id,
|
||||
eDOMClassInfo_XULLabeledControlElement_id,
|
||||
eDOMClassInfo_XULButtonElement_id,
|
||||
|
|
|
@ -5198,7 +5198,7 @@ nsDocument::StyleRuleChanged(StyleSheet* aSheet,
|
|||
DO_STYLESHEET_NOTIFICATION(StyleRuleChangeEvent,
|
||||
"StyleRuleChanged",
|
||||
mRule,
|
||||
aStyleRule ? aStyleRule->GetDOMRule() : nullptr);
|
||||
aStyleRule);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5212,8 +5212,7 @@ nsDocument::StyleRuleAdded(StyleSheet* aSheet,
|
|||
DO_STYLESHEET_NOTIFICATION(StyleRuleChangeEvent,
|
||||
"StyleRuleAdded",
|
||||
mRule,
|
||||
aStyleRule ? aStyleRule->GetDOMRule()
|
||||
: nullptr);
|
||||
aStyleRule);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5227,8 +5226,7 @@ nsDocument::StyleRuleRemoved(StyleSheet* aSheet,
|
|||
DO_STYLESHEET_NOTIFICATION(StyleRuleChangeEvent,
|
||||
"StyleRuleRemoved",
|
||||
mRule,
|
||||
aStyleRule ? aStyleRule->GetDOMRule()
|
||||
: nullptr);
|
||||
aStyleRule);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10675,10 +10675,9 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT_IF(!mIsChrome, (principal->GetPrivateBrowsingId() > 0) == IsPrivateBrowsing());
|
||||
|
||||
nsCOMPtr<nsIDOMStorage> storage;
|
||||
aError = storageManager->CreateStorage(AsInner(), principal, documentURI,
|
||||
IsPrivateBrowsing(),
|
||||
getter_AddRefs(storage));
|
||||
if (aError.Failed()) {
|
||||
return nullptr;
|
||||
|
@ -10741,12 +10740,9 @@ nsGlobalWindow::GetLocalStorage(ErrorResult& aError)
|
|||
}
|
||||
}
|
||||
|
||||
//XXX huseby -- was causing crashes see bug 1321969. Bug 1322760 covers
|
||||
//investigating and fixing the following assert.
|
||||
//MOZ_DIAGNOSTIC_ASSERT((principal->GetPrivateBrowsingId() > 0) == IsPrivateBrowsing());
|
||||
|
||||
nsCOMPtr<nsIDOMStorage> storage;
|
||||
aError = storageManager->CreateStorage(AsInner(), principal, documentURI,
|
||||
IsPrivateBrowsing(),
|
||||
getter_AddRefs(storage));
|
||||
if (aError.Failed()) {
|
||||
return nullptr;
|
||||
|
@ -11599,15 +11595,10 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
uint32_t privateBrowsingId = 0;
|
||||
nsIPrincipal *storagePrincipal = changingStorage->GetPrincipal();
|
||||
rv = storagePrincipal->GetPrivateBrowsingId(&privateBrowsingId);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
if (changingStorage->IsPrivate() != IsPrivateBrowsing()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
MOZ_ASSERT((privateBrowsingId > 0) == isPrivateBrowsing);
|
||||
|
||||
switch (changingStorage->GetType())
|
||||
{
|
||||
case Storage::SessionStorage:
|
||||
|
|
|
@ -145,7 +145,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool PreservingWrapper()
|
||||
bool PreservingWrapper() const
|
||||
{
|
||||
return HasWrapperFlag(WRAPPER_BIT_PRESERVED);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
/**
|
||||
* Returns true if the object has a non-gray wrapper.
|
||||
*/
|
||||
bool IsBlack();
|
||||
bool IsBlack() const;
|
||||
|
||||
/**
|
||||
* Returns true if the object has a black wrapper,
|
||||
|
@ -272,6 +272,9 @@ protected:
|
|||
}
|
||||
|
||||
private:
|
||||
// Friend declarations for things that need to be able to call
|
||||
// SetIsNotDOMBinding(). The goal is to get rid of all of these, and
|
||||
// SetIsNotDOMBinding() too.
|
||||
friend class mozilla::dom::TabChildGlobal;
|
||||
friend class mozilla::dom::ProcessGlobal;
|
||||
friend class SandboxPrivate;
|
||||
|
|
|
@ -22,7 +22,7 @@ nsWrapperCache::GetWrapper() const
|
|||
}
|
||||
|
||||
inline bool
|
||||
nsWrapperCache::IsBlack()
|
||||
nsWrapperCache::IsBlack() const
|
||||
{
|
||||
JSObject* o = GetWrapperPreserveColor();
|
||||
return o && !JS::ObjectIsMarkedGray(o);
|
||||
|
|
|
@ -42,11 +42,6 @@ function onLoadEnd1(e) {
|
|||
opener.sendAsyncMessage("file.modify", fileData2);
|
||||
}
|
||||
|
||||
function onLoadEnd2(e) {
|
||||
e.target.removeEventListener('loadend', onLoadEnd2);
|
||||
ok(false, "This method should not be called - loadEnd2!");
|
||||
}
|
||||
|
||||
function onError1(e) {
|
||||
ok(false, "This method should not be called - error1!");
|
||||
}
|
||||
|
@ -65,7 +60,6 @@ function onFileOpened(blob) {
|
|||
}
|
||||
|
||||
function onFileModified(blob) {
|
||||
r.addEventListener("loadend", onLoadEnd2);
|
||||
r.removeEventListener('error', onError1);
|
||||
r.addEventListener("error", onError2);
|
||||
r.readAsArrayBuffer(firstBlob);
|
||||
|
|
|
@ -196,23 +196,96 @@ DOMInterfaces = {
|
|||
'nativeType': 'nsDOMCSSDeclaration'
|
||||
},
|
||||
|
||||
'CSSConditionRule': {
|
||||
'concrete': False,
|
||||
'nativeType': 'mozilla::css::ConditionRule',
|
||||
'headerFile': 'mozilla/css/GroupRule.h',
|
||||
},
|
||||
|
||||
'CSSCounterStyleRule': {
|
||||
'nativeType': 'nsCSSCounterStyleRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSFontFaceRule': {
|
||||
'nativeType': 'nsCSSFontFaceRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSFontFeatureValuesRule': {
|
||||
'nativeType': 'nsCSSFontFeatureValuesRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSGroupingRule': {
|
||||
'concrete': False,
|
||||
'nativeType': 'mozilla::css::GroupRule',
|
||||
},
|
||||
|
||||
'CSSImportRule': {
|
||||
'nativeType': 'mozilla::css::ImportRule',
|
||||
},
|
||||
|
||||
'CSSKeyframeRule': {
|
||||
'nativeType': 'nsCSSKeyframeRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSKeyframesRule': {
|
||||
'nativeType': 'nsCSSKeyframesRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSLexer': {
|
||||
'wrapperCache': False
|
||||
},
|
||||
|
||||
'CSSMediaRule': {
|
||||
'nativeType': 'mozilla::css::MediaRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSMozDocumentRule': {
|
||||
'nativeType': 'mozilla::css::DocumentRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSNamespaceRule': {
|
||||
'nativeType': 'mozilla::css::NameSpaceRule',
|
||||
},
|
||||
|
||||
'CSSPageRule': {
|
||||
'nativeType': 'nsCSSPageRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSPrimitiveValue': {
|
||||
'nativeType': 'nsROCSSPrimitiveValue',
|
||||
},
|
||||
|
||||
'CSSRule': {
|
||||
'concrete': False,
|
||||
'nativeType': 'mozilla::css::Rule'
|
||||
},
|
||||
|
||||
'CSSStyleDeclaration': {
|
||||
'nativeType': 'nsICSSDeclaration'
|
||||
},
|
||||
|
||||
'CSSStyleRule': {
|
||||
'nativeType': 'mozilla::BindingStyleRule',
|
||||
},
|
||||
|
||||
'CSSStyleSheet': {
|
||||
'nativeType': 'mozilla::StyleSheet',
|
||||
'binaryNames': { 'ownerRule': 'DOMOwnerRule' },
|
||||
},
|
||||
|
||||
'CSSSupportsRule': {
|
||||
'nativeType': 'mozilla::CSSSupportsRule',
|
||||
'headerFile': 'nsCSSRules.h',
|
||||
},
|
||||
|
||||
'CSSValue': {
|
||||
'concrete': False
|
||||
},
|
||||
|
@ -1660,7 +1733,6 @@ def addExternalIface(iface, nativeType=None, headerFile=None,
|
|||
|
||||
addExternalIface('ApplicationCache', nativeType='nsIDOMOfflineResourceList')
|
||||
addExternalIface('Counter')
|
||||
addExternalIface('CSSRule')
|
||||
addExternalIface('RTCDataChannel', nativeType='nsIDOMDataChannel')
|
||||
addExternalIface('HitRegionOptions', nativeType='nsISupports')
|
||||
addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
|
||||
|
|
|
@ -203,9 +203,7 @@ ReadFuncBinaryString(nsIInputStream* in,
|
|||
}
|
||||
|
||||
nsresult
|
||||
FileReader::DoOnLoadEnd(nsresult aStatus,
|
||||
nsAString& aSuccessEvent,
|
||||
nsAString& aTerminationEvent)
|
||||
FileReader::DoOnLoadEnd(nsresult aStatus)
|
||||
{
|
||||
// Make sure we drop all the objects that could hold files open now.
|
||||
nsCOMPtr<nsIAsyncInputStream> stream;
|
||||
|
@ -223,14 +221,10 @@ FileReader::DoOnLoadEnd(nsresult aStatus,
|
|||
// In case we read a different number of bytes, we can assume that the
|
||||
// underlying storage has changed. We should not continue.
|
||||
if (mDataLen != mTotal) {
|
||||
DispatchError(NS_ERROR_FAILURE, aTerminationEvent);
|
||||
FreeFileData();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
aSuccessEvent = NS_LITERAL_STRING(LOAD_STR);
|
||||
aTerminationEvent = NS_LITERAL_STRING(LOADEND_STR);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
switch (mDataFormat) {
|
||||
case FILE_AS_ARRAYBUFFER: {
|
||||
|
@ -241,7 +235,8 @@ FileReader::DoOnLoadEnd(nsresult aStatus,
|
|||
}
|
||||
|
||||
RootResultArrayBuffer();
|
||||
mResultArrayBuffer = JS_NewArrayBufferWithContents(jsapi.cx(), mDataLen, mFileData);
|
||||
mResultArrayBuffer =
|
||||
JS_NewArrayBufferWithContents(jsapi.cx(), mDataLen, mFileData);
|
||||
if (!mResultArrayBuffer) {
|
||||
JS_ClearPendingException(jsapi.cx());
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -535,10 +530,10 @@ FileReader::ClearProgressEventTimer()
|
|||
}
|
||||
|
||||
void
|
||||
FileReader::DispatchError(nsresult rv, nsAString& finalEvent)
|
||||
FileReader::DispatchError(nsresult aRv)
|
||||
{
|
||||
// Set the status attribute, and dispatch the error event
|
||||
switch (rv) {
|
||||
switch (aRv) {
|
||||
case NS_ERROR_FILE_NOT_FOUND:
|
||||
mError = new DOMError(GetOwner(), NS_LITERAL_STRING("NotFoundError"));
|
||||
break;
|
||||
|
@ -552,7 +547,7 @@ FileReader::DispatchError(nsresult rv, nsAString& finalEvent)
|
|||
|
||||
// Dispatch error event to signify load failure
|
||||
DispatchProgressEvent(NS_LITERAL_STRING(ERROR_STR));
|
||||
DispatchProgressEvent(finalEvent);
|
||||
DispatchProgressEvent(NS_LITERAL_STRING(LOADEND_STR));
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -649,19 +644,21 @@ FileReader::OnLoadEnd(nsresult aStatus)
|
|||
// FileReader must be in DONE stage after an operation
|
||||
mReadyState = DONE;
|
||||
|
||||
nsAutoString successEvent, termEvent;
|
||||
nsresult rv = DoOnLoadEnd(aStatus, successEvent, termEvent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsresult rv = DoOnLoadEnd(aStatus);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
DispatchError(rv);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Set the status field as appropriate
|
||||
if (NS_FAILED(aStatus)) {
|
||||
DispatchError(aStatus, termEvent);
|
||||
DispatchError(aStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Dispatch event to signify end of a successful operation
|
||||
DispatchProgressEvent(successEvent);
|
||||
DispatchProgressEvent(termEvent);
|
||||
DispatchProgressEvent(NS_LITERAL_STRING(LOAD_STR));
|
||||
DispatchProgressEvent(NS_LITERAL_STRING(LOADEND_STR));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -141,14 +141,13 @@ private:
|
|||
|
||||
void StartProgressEventTimer();
|
||||
void ClearProgressEventTimer();
|
||||
void DispatchError(nsresult rv, nsAString& finalEvent);
|
||||
void DispatchError(nsresult aRv);
|
||||
nsresult DispatchProgressEvent(const nsAString& aType);
|
||||
|
||||
nsresult DoAsyncWait();
|
||||
nsresult DoReadData(uint64_t aCount);
|
||||
|
||||
nsresult DoOnLoadEnd(nsresult aStatus, nsAString& aSuccessEvent,
|
||||
nsAString& aTerminationEvent);
|
||||
nsresult DoOnLoadEnd(nsresult aStatus);
|
||||
|
||||
void FreeFileData()
|
||||
{
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(9b5e48ce-d84c-4e31-aff5-34e9f4141313)]
|
||||
interface nsIDOMCSSCounterStyleRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSCounterStyleRule : nsISupports
|
||||
{
|
||||
attribute DOMString name;
|
||||
attribute DOMString system;
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(db971017-fe0c-4529-972c-8217f2fee217)]
|
||||
interface nsIDOMCSSFontFaceRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSFontFaceRule : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(a343d27f-1da6-4fc3-9355-d4ca434f958e)]
|
||||
interface nsIDOMCSSFontFeatureValuesRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSFontFeatureValuesRule : nsISupports
|
||||
{
|
||||
attribute DOMString fontFamily;
|
||||
// raises(DOMException) on setting
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSRuleList;
|
||||
|
||||
/**
|
||||
* Interface for at-rules that have child rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(a0e3324a-f911-4baf-9591-5322c76cbb0d)]
|
||||
interface nsIDOMCSSGroupingRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSGroupingRule : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMMediaList;
|
||||
interface nsIDOMCSSStyleSheet;
|
||||
|
||||
[scriptable, uuid(d3b2b914-01ef-4663-beda-a6475a26f491)]
|
||||
interface nsIDOMCSSImportRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSImportRule : nsISupports
|
||||
{
|
||||
readonly attribute DOMString href;
|
||||
readonly attribute nsIDOMMediaList media;
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(a281a8b4-eaa2-49a8-8b97-acc2814a57c9)]
|
||||
interface nsIDOMCSSKeyframeRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSKeyframeRule : nsISupports
|
||||
{
|
||||
attribute DOMString keyText;
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSRuleList;
|
||||
interface nsIDOMCSSKeyframeRule;
|
||||
|
||||
[scriptable, uuid(400f4b70-ad0a-4047-aba4-ee8019f6b907)]
|
||||
interface nsIDOMCSSKeyframesRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSKeyframesRule : nsISupports
|
||||
{
|
||||
attribute DOMString name;
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
interface nsIDOMMediaList;
|
||||
|
||||
/**
|
||||
* Interface for @media rules in the CSS OM.
|
||||
*/
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(c119072b-7d2f-4aeb-a90d-e2d6b606c32a)]
|
||||
interface nsIDOMCSSPageRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSPageRule : nsISupports
|
||||
{
|
||||
//attribute DOMString selectorText;
|
||||
// raises(DOMException) on setting
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
|
||||
[scriptable, uuid(b5e9af48-a7c2-4f88-aae3-58307af4b5a5)]
|
||||
interface nsIDOMCSSStyleRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSStyleRule : nsISupports
|
||||
{
|
||||
attribute DOMString selectorText;
|
||||
// raises(DOMException) on setting
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMCSSRule.idl"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(98f4c27b-fb35-4355-8fd9-546c4697d71a)]
|
||||
interface nsIDOMCSSUnknownRule : nsIDOMCSSRule
|
||||
interface nsIDOMCSSUnknownRule : nsISupports
|
||||
{
|
||||
};
|
||||
|
|
|
@ -39,7 +39,8 @@ interface nsIDOMStorageManager : nsISupports
|
|||
*/
|
||||
nsIDOMStorage createStorage(in mozIDOMWindow aWindow,
|
||||
in nsIPrincipal aPrincipal,
|
||||
in DOMString aDocumentURI);
|
||||
in DOMString aDocumentURI,
|
||||
[optional] in bool aPrivate);
|
||||
/**
|
||||
* Returns instance of DOM storage object for given principal.
|
||||
* If there is no storage managed for the scope, then null is returned and
|
||||
|
@ -54,7 +55,8 @@ interface nsIDOMStorageManager : nsISupports
|
|||
* Whether the demanding document is running in Private Browsing mode or not.
|
||||
*/
|
||||
nsIDOMStorage getStorage(in mozIDOMWindow aWindow,
|
||||
in nsIPrincipal aPrincipal);
|
||||
in nsIPrincipal aPrincipal,
|
||||
[optional] in bool aPrivate);
|
||||
|
||||
/**
|
||||
* Clones given storage into this storage manager.
|
||||
|
@ -98,5 +100,6 @@ interface nsIDOMStorageManager : nsISupports
|
|||
* or createStorage method instead.
|
||||
*/
|
||||
nsIDOMStorage getLocalStorageForPrincipal(in nsIPrincipal aPrincipal,
|
||||
in DOMString aDocumentURI);
|
||||
in DOMString aDocumentURI,
|
||||
[optional] in bool aPrivate);
|
||||
};
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define PREF_VOLUME_SCALE "media.volume_scale"
|
||||
#define PREF_CUBEB_LATENCY_PLAYBACK "media.cubeb_latency_playback_ms"
|
||||
#define PREF_CUBEB_LATENCY_MSG "media.cubeb_latency_msg_frames"
|
||||
#define PREF_CUBEB_LOG_LEVEL "media.cubeb.log_level"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -131,6 +132,20 @@ void PrefChanged(const char* aPref, void* aClosure)
|
|||
// We don't want to limit the upper limit too much, so that people can
|
||||
// experiment.
|
||||
sCubebMSGLatencyInFrames = std::min<uint32_t>(std::max<uint32_t>(value, 128), 1e6);
|
||||
} else if (strcmp(aPref, PREF_CUBEB_LOG_LEVEL) == 0) {
|
||||
nsAdoptingString value = Preferences::GetString(aPref);
|
||||
NS_ConvertUTF16toUTF8 utf8(value);
|
||||
LogModule* cubebLog = LogModule::Get("cubeb");
|
||||
if (strcmp(utf8.get(), "verbose") == 0) {
|
||||
cubeb_set_log_callback(CUBEB_LOG_VERBOSE, CubebLogCallback);
|
||||
cubebLog->SetLevel(LogLevel::Verbose);
|
||||
} else if (strcmp(utf8.get(), "normal") == 0) {
|
||||
cubeb_set_log_callback(CUBEB_LOG_NORMAL, CubebLogCallback);
|
||||
cubebLog->SetLevel(LogLevel::Error);
|
||||
} else if (utf8.IsEmpty()) {
|
||||
cubeb_set_log_callback(CUBEB_LOG_DISABLED, nullptr);
|
||||
cubebLog->SetLevel(LogLevel::Disabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,6 +323,7 @@ void InitLibrary()
|
|||
PrefChanged(PREF_CUBEB_LATENCY_MSG, nullptr);
|
||||
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_PLAYBACK);
|
||||
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LATENCY_MSG);
|
||||
Preferences::RegisterCallback(PrefChanged, PREF_CUBEB_LOG_LEVEL);
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction(&InitBrandName));
|
||||
#endif
|
||||
|
@ -318,6 +334,7 @@ void ShutdownLibrary()
|
|||
Preferences::UnregisterCallback(PrefChanged, PREF_VOLUME_SCALE);
|
||||
Preferences::UnregisterCallback(PrefChanged, PREF_CUBEB_LATENCY_PLAYBACK);
|
||||
Preferences::UnregisterCallback(PrefChanged, PREF_CUBEB_LATENCY_MSG);
|
||||
Preferences::UnregisterCallback(PrefChanged, PREF_CUBEB_LOG_LEVEL);
|
||||
|
||||
StaticMutexAutoLock lock(sMutex);
|
||||
if (sCubebContext) {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "nsTArray.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/TypedArray.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
|
|
@ -2736,17 +2736,6 @@ PluginModuleParent::NPP_NewInternal(NPMIMEType pluginType, NPP instance,
|
|||
values.AppendElement(opaqueAttributeValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Update the flashvar bgcolor if it's not set, fixes a rendering problem with
|
||||
// async plugin painting and transparent flash.
|
||||
if (supportsAsyncRender) {
|
||||
NS_NAMED_LITERAL_CSTRING(bgcolorAttributeName, "bgcolor");
|
||||
NS_NAMED_LITERAL_CSTRING(bgcolorAttributeDefault, "#FFFFFF");
|
||||
if (!names.Contains(bgcolorAttributeName)) {
|
||||
names.AppendElement(bgcolorAttributeName);
|
||||
values.AppendElement(bgcolorAttributeDefault);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -43,12 +43,14 @@ Storage::Storage(nsPIDOMWindowInner* aWindow,
|
|||
StorageManagerBase* aManager,
|
||||
StorageCache* aCache,
|
||||
const nsAString& aDocumentURI,
|
||||
nsIPrincipal* aPrincipal)
|
||||
nsIPrincipal* aPrincipal,
|
||||
bool aIsPrivate)
|
||||
: mWindow(aWindow)
|
||||
, mManager(aManager)
|
||||
, mCache(aCache)
|
||||
, mDocumentURI(aDocumentURI)
|
||||
, mPrincipal(aPrincipal)
|
||||
, mIsPrivate(aIsPrivate)
|
||||
, mIsSessionOnly(false)
|
||||
{
|
||||
mCache->Preload();
|
||||
|
@ -241,6 +243,8 @@ bool
|
|||
Storage::CanUseStorage(nsIPrincipal& aSubjectPrincipal)
|
||||
{
|
||||
// This method is responsible for correct setting of mIsSessionOnly.
|
||||
// It doesn't work with mIsPrivate flag at all, since it is checked
|
||||
// regardless mIsSessionOnly flag in DOMStorageCache code.
|
||||
|
||||
if (!mozilla::Preferences::GetBool(kStorageEnabled)) {
|
||||
return false;
|
||||
|
@ -280,17 +284,6 @@ Storage::PrincipalEquals(nsIPrincipal* aPrincipal)
|
|||
return PrincipalsEqual(mPrincipal, aPrincipal);
|
||||
}
|
||||
|
||||
bool
|
||||
Storage::IsPrivate() const
|
||||
{
|
||||
uint32_t privateBrowsingId = 0;
|
||||
nsresult rv = mPrincipal->GetPrivateBrowsingId(&privateBrowsingId);
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
}
|
||||
return privateBrowsingId > 0;
|
||||
}
|
||||
|
||||
bool
|
||||
Storage::CanAccess(nsIPrincipal* aPrincipal)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,8 @@ public:
|
|||
StorageManagerBase* aManager,
|
||||
StorageCache* aCache,
|
||||
const nsAString& aDocumentURI,
|
||||
nsIPrincipal* aPrincipal);
|
||||
nsIPrincipal* aPrincipal,
|
||||
bool aIsPrivate);
|
||||
|
||||
// WebIDL
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
|
@ -119,7 +120,7 @@ public:
|
|||
void Clear(nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aRv);
|
||||
|
||||
bool IsPrivate() const;
|
||||
bool IsPrivate() const { return mIsPrivate; }
|
||||
bool IsSessionOnly() const { return mIsSessionOnly; }
|
||||
|
||||
bool IsForkOf(const Storage* aOther) const
|
||||
|
@ -153,6 +154,9 @@ private:
|
|||
// been created for
|
||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||
|
||||
// Whether this storage is running in private-browsing window.
|
||||
bool mIsPrivate : 1;
|
||||
|
||||
// Whether storage is set to persist data only per session, may change
|
||||
// dynamically and is set by CanUseStorage function that is called
|
||||
// before any operation on the storage.
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
|
||||
// The set of methods that are invoked by DOM storage web API.
|
||||
// We are passing the Storage object just to let the cache
|
||||
// read properties like mPrincipal and mSessionOnly.
|
||||
// read properties like mPrivate, mPrincipal and mSessionOnly.
|
||||
// Get* methods return error when load from the database has failed.
|
||||
nsresult GetLength(const Storage* aStorage, uint32_t* aRetval);
|
||||
nsresult GetKey(const Storage* aStorage, uint32_t index, nsAString& aRetval);
|
||||
|
|
|
@ -313,6 +313,7 @@ StorageManagerBase::GetStorageInternal(bool aCreate,
|
|||
mozIDOMWindow* aWindow,
|
||||
nsIPrincipal* aPrincipal,
|
||||
const nsAString& aDocumentURI,
|
||||
bool aPrivate,
|
||||
nsIDOMStorage** aRetval)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -363,7 +364,7 @@ StorageManagerBase::GetStorageInternal(bool aCreate,
|
|||
nsCOMPtr<nsPIDOMWindowInner> inner = nsPIDOMWindowInner::From(aWindow);
|
||||
|
||||
nsCOMPtr<nsIDOMStorage> storage = new Storage(
|
||||
inner, this, cache, aDocumentURI, aPrincipal);
|
||||
inner, this, cache, aDocumentURI, aPrincipal, aPrivate);
|
||||
storage.forget(aRetval);
|
||||
}
|
||||
|
||||
|
@ -373,24 +374,29 @@ StorageManagerBase::GetStorageInternal(bool aCreate,
|
|||
NS_IMETHODIMP
|
||||
StorageManagerBase::PrecacheStorage(nsIPrincipal* aPrincipal)
|
||||
{
|
||||
return GetStorageInternal(true, nullptr, aPrincipal, EmptyString(), nullptr);
|
||||
return GetStorageInternal(true, nullptr, aPrincipal, EmptyString(), false,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StorageManagerBase::CreateStorage(mozIDOMWindow* aWindow,
|
||||
nsIPrincipal* aPrincipal,
|
||||
const nsAString& aDocumentURI,
|
||||
bool aPrivate,
|
||||
nsIDOMStorage** aRetval)
|
||||
{
|
||||
return GetStorageInternal(true, aWindow, aPrincipal, aDocumentURI, aRetval);
|
||||
return GetStorageInternal(true, aWindow, aPrincipal, aDocumentURI, aPrivate,
|
||||
aRetval);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StorageManagerBase::GetStorage(mozIDOMWindow* aWindow,
|
||||
nsIPrincipal* aPrincipal,
|
||||
bool aPrivate,
|
||||
nsIDOMStorage** aRetval)
|
||||
{
|
||||
return GetStorageInternal(false, aWindow, aPrincipal, EmptyString(), aRetval);
|
||||
return GetStorageInternal(false, aWindow, aPrincipal, EmptyString(), aPrivate,
|
||||
aRetval);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -470,13 +476,14 @@ StorageManagerBase::CheckStorage(nsIPrincipal* aPrincipal,
|
|||
NS_IMETHODIMP
|
||||
StorageManagerBase::GetLocalStorageForPrincipal(nsIPrincipal* aPrincipal,
|
||||
const nsAString& aDocumentURI,
|
||||
bool aPrivate,
|
||||
nsIDOMStorage** aRetval)
|
||||
{
|
||||
if (mType != LocalStorage) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
return CreateStorage(nullptr, aPrincipal, aDocumentURI, aRetval);
|
||||
return CreateStorage(nullptr, aPrincipal, aDocumentURI, aPrivate, aRetval);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -95,6 +95,7 @@ private:
|
|||
mozIDOMWindow* aWindow,
|
||||
nsIPrincipal* aPrincipal,
|
||||
const nsAString& aDocumentURI,
|
||||
bool aPrivate,
|
||||
nsIDOMStorage** aRetval);
|
||||
|
||||
// Suffix->origin->cache map
|
||||
|
|
|
@ -249,7 +249,7 @@ var interfaceNamesInGlobalScope =
|
|||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSMozDocumentRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSNameSpaceRule",
|
||||
"CSSNamespaceRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"CSSPageRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-conditional/#the-cssconditionrule-interface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-conditional/#the-cssconditionrule-interface
|
||||
interface CSSConditionRule : CSSGroupingRule {
|
||||
[SetterThrows]
|
||||
attribute DOMString conditionText;
|
||||
};
|
|
@ -0,0 +1,23 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-counter-styles-3/#the-csscounterstylerule-interface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-counter-styles-3/#the-csscounterstylerule-interface
|
||||
interface CSSCounterStyleRule : CSSRule {
|
||||
attribute DOMString name;
|
||||
attribute DOMString system;
|
||||
attribute DOMString symbols;
|
||||
attribute DOMString additiveSymbols;
|
||||
attribute DOMString negative;
|
||||
attribute DOMString prefix;
|
||||
attribute DOMString suffix;
|
||||
attribute DOMString range;
|
||||
attribute DOMString pad;
|
||||
attribute DOMString speakAs;
|
||||
attribute DOMString fallback;
|
||||
};
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-fonts/#om-fontface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-fonts/#om-fontface
|
||||
// But we implement a very old draft, apparently....
|
||||
// See bug 1058408 for implementing the current spec.
|
||||
interface CSSFontFaceRule : CSSRule {
|
||||
[SameObject] readonly attribute CSSStyleDeclaration style;
|
||||
};
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-fonts/#om-fontfeaturevalues
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-fonts/#om-fontfeaturevalues
|
||||
// but we don't implement anything remotely resembling the spec.
|
||||
interface CSSFontFeatureValuesRule : CSSRule {
|
||||
[SetterThrows]
|
||||
attribute DOMString fontFamily;
|
||||
|
||||
// Not yet implemented
|
||||
// readonly attribute CSSFontFeatureValuesMap annotation;
|
||||
// readonly attribute CSSFontFeatureValuesMap ornaments;
|
||||
// readonly attribute CSSFontFeatureValuesMap stylistic;
|
||||
// readonly attribute CSSFontFeatureValuesMap swash;
|
||||
// readonly attribute CSSFontFeatureValuesMap characterVariant;
|
||||
// readonly attribute CSSFontFeatureValuesMap styleset;
|
||||
};
|
||||
|
||||
partial interface CSSFontFeatureValuesRule {
|
||||
// Gecko addition?
|
||||
[SetterThrows]
|
||||
attribute DOMString valueText;
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#cssgroupingrule
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#cssgroupingrule
|
||||
interface CSSGroupingRule : CSSRule {
|
||||
[SameObject] readonly attribute CSSRuleList cssRules;
|
||||
[Throws]
|
||||
unsigned long insertRule(DOMString rule, unsigned long index);
|
||||
[Throws]
|
||||
void deleteRule(unsigned long index);
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#cssimportrule
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#cssimportrule
|
||||
interface CSSImportRule : CSSRule {
|
||||
readonly attribute DOMString href;
|
||||
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
|
||||
// Per spec, the .styleSheet is never null, but in our implementation it can
|
||||
// be. See <https://bugzilla.mozilla.org/show_bug.cgi?id=1326509>.
|
||||
[SameObject] readonly attribute CSSStyleSheet? styleSheet;
|
||||
};
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-animations/#interface-csskeyframerule
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-animations/#interface-csskeyframerule
|
||||
interface CSSKeyframeRule : CSSRule {
|
||||
attribute DOMString keyText;
|
||||
readonly attribute CSSStyleDeclaration style;
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-animations/#interface-csskeyframesrule
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-animations/#interface-csskeyframesrule
|
||||
interface CSSKeyframesRule : CSSRule {
|
||||
attribute DOMString name;
|
||||
readonly attribute CSSRuleList cssRules;
|
||||
|
||||
void appendRule(DOMString rule);
|
||||
void deleteRule(DOMString select);
|
||||
CSSKeyframeRule? findRule(DOMString select);
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#the-cssmediarule-interface
|
||||
* https://drafts.csswg.org/css-conditional/#the-cssmediarule-interface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#the-cssmediarule-interface and
|
||||
// https://drafts.csswg.org/css-conditional/#the-cssmediarule-interface
|
||||
// except they disagree with each other. We're taking the inheritance from
|
||||
// css-conditional and the PutForwards behavior from cssom.
|
||||
interface CSSMediaRule : CSSConditionRule {
|
||||
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
|
||||
};
|
|
@ -0,0 +1,10 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
// This is a non-standard interface for @-moz-document rules
|
||||
interface CSSMozDocumentRule : CSSConditionRule {
|
||||
// XXX Add access to the URL list.
|
||||
};
|
|
@ -0,0 +1,16 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#cssnamespacerule
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#cssnamespacerule
|
||||
interface CSSNamespaceRule : CSSRule {
|
||||
// Not implemented yet. <See
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1326514>.
|
||||
// readonly attribute DOMString namespaceURI;
|
||||
// readonly attribute DOMString prefix;
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#the-csspagerule-interface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#the-csspagerule-interface
|
||||
// Per spec, this should inherit from CSSGroupingRule, but we don't
|
||||
// implement this yet.
|
||||
interface CSSPageRule : CSSRule {
|
||||
// selectorText not implemented yet
|
||||
// attribute DOMString selectorText;
|
||||
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
|
||||
};
|
|
@ -0,0 +1,52 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#the-cssrule-interface
|
||||
* https://drafts.csswg.org/css-animations/#interface-cssrule
|
||||
* https://drafts.csswg.org/css-counter-styles-3/#extentions-to-cssrule-interface
|
||||
* https://drafts.csswg.org/css-conditional-3/#extentions-to-cssrule-interface
|
||||
* https://drafts.csswg.org/css-fonts-3/#om-fontfeaturevalues
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#the-cssrule-interface
|
||||
interface CSSRule {
|
||||
|
||||
const unsigned short STYLE_RULE = 1;
|
||||
const unsigned short CHARSET_RULE = 2; // historical
|
||||
const unsigned short IMPORT_RULE = 3;
|
||||
const unsigned short MEDIA_RULE = 4;
|
||||
const unsigned short FONT_FACE_RULE = 5;
|
||||
const unsigned short PAGE_RULE = 6;
|
||||
// FIXME: We don't support MARGIN_RULE yet.
|
||||
// XXXbz Should we expose the constant anyway?
|
||||
// const unsigned short MARGIN_RULE = 9;
|
||||
const unsigned short NAMESPACE_RULE = 10;
|
||||
readonly attribute unsigned short type;
|
||||
attribute DOMString cssText;
|
||||
readonly attribute CSSRule? parentRule;
|
||||
readonly attribute CSSStyleSheet? parentStyleSheet;
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-animations/#interface-cssrule
|
||||
partial interface CSSRule {
|
||||
const unsigned short KEYFRAMES_RULE = 7;
|
||||
const unsigned short KEYFRAME_RULE = 8;
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-counter-styles-3/#extentions-to-cssrule-interface
|
||||
partial interface CSSRule {
|
||||
const unsigned short COUNTER_STYLE_RULE = 11;
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-conditional-3/#extentions-to-cssrule-interface
|
||||
partial interface CSSRule {
|
||||
const unsigned short SUPPORTS_RULE = 12;
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-fonts-3/#om-fontfeaturevalues
|
||||
partial interface CSSRule {
|
||||
const unsigned short FONT_FEATURE_VALUES_RULE = 14;
|
||||
};
|
|
@ -7,8 +7,6 @@
|
|||
* http://dev.w3.org/csswg/cssom/
|
||||
*/
|
||||
|
||||
interface CSSRule;
|
||||
|
||||
interface CSSStyleDeclaration {
|
||||
[SetterThrows]
|
||||
attribute DOMString cssText;
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/cssom/#the-cssstylerule-interface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/cssom/#the-cssstylerule-interface
|
||||
interface CSSStyleRule : CSSRule {
|
||||
attribute DOMString selectorText;
|
||||
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
|
||||
};
|
|
@ -7,8 +7,6 @@
|
|||
* http://dev.w3.org/csswg/cssom/
|
||||
*/
|
||||
|
||||
interface CSSRule;
|
||||
|
||||
enum CSSStyleSheetParsingMode {
|
||||
"author",
|
||||
"user",
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://drafts.csswg.org/css-conditional/#the-csssupportsrule-interface
|
||||
*/
|
||||
|
||||
// https://drafts.csswg.org/css-conditional/#the-csssupportsrule-interface
|
||||
interface CSSSupportsRule : CSSConditionRule {
|
||||
};
|
|
@ -24,8 +24,10 @@ BoxObject implements LegacyQueryInterface;
|
|||
CaretPosition implements LegacyQueryInterface;
|
||||
Comment implements LegacyQueryInterface;
|
||||
Crypto implements LegacyQueryInterface;
|
||||
CSSMozDocumentRule implements LegacyQueryInterface;
|
||||
CSSPrimitiveValue implements LegacyQueryInterface;
|
||||
CSSStyleDeclaration implements LegacyQueryInterface;
|
||||
CSSStyleRule implements LegacyQueryInterface;
|
||||
CSSValueList implements LegacyQueryInterface;
|
||||
DOMImplementation implements LegacyQueryInterface;
|
||||
DOMParser implements LegacyQueryInterface;
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
interface CSSRule;
|
||||
|
||||
[ChromeOnly, Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict)]
|
||||
interface StyleRuleChangeEvent : Event
|
||||
{
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
* http://dev.w3.org/csswg/cssom/
|
||||
*/
|
||||
|
||||
interface CSSRule;
|
||||
|
||||
interface StyleSheet {
|
||||
[Constant]
|
||||
readonly attribute DOMString type;
|
||||
|
|
|
@ -89,12 +89,27 @@ WEBIDL_FILES = [
|
|||
'CSPReport.webidl',
|
||||
'CSS.webidl',
|
||||
'CSSAnimation.webidl',
|
||||
'CSSConditionRule.webidl',
|
||||
'CSSCounterStyleRule.webidl',
|
||||
'CSSFontFaceRule.webidl',
|
||||
'CSSFontFeatureValuesRule.webidl',
|
||||
'CSSGroupingRule.webidl',
|
||||
'CSSImportRule.webidl',
|
||||
'CSSKeyframeRule.webidl',
|
||||
'CSSKeyframesRule.webidl',
|
||||
'CSSLexer.webidl',
|
||||
'CSSMediaRule.webidl',
|
||||
'CSSMozDocumentRule.webidl',
|
||||
'CSSNamespaceRule.webidl',
|
||||
'CSSPageRule.webidl',
|
||||
'CSSPrimitiveValue.webidl',
|
||||
'CSSPseudoElement.webidl',
|
||||
'CSSRule.webidl',
|
||||
'CSSRuleList.webidl',
|
||||
'CSSStyleDeclaration.webidl',
|
||||
'CSSStyleRule.webidl',
|
||||
'CSSStyleSheet.webidl',
|
||||
'CSSSupportsRule.webidl',
|
||||
'CSSTransition.webidl',
|
||||
'CSSValue.webidl',
|
||||
'CSSValueList.webidl',
|
||||
|
|
|
@ -208,6 +208,8 @@ public:
|
|||
// since otherwise nsJSUtils::EvaluateString will set it up for us.
|
||||
compileOptions.setNoScriptRval(true);
|
||||
|
||||
JSAutoCompartment comp(cx, globalObj);
|
||||
|
||||
JS::Rooted<JS::Value> unused(cx);
|
||||
if (!JS::Evaluate(cx, compileOptions, buffer, &unused)) {
|
||||
ErrorResult error;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "mozilla/layers/ImageBridgeParent.h"
|
||||
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
||||
#include "mozilla/layers/LayerTreeOwnerTracker.h"
|
||||
#include "mozilla/layers/UiCompositorControllerParent.h"
|
||||
#include "nsDebugImpl.h"
|
||||
#include "nsExceptionHandler.h"
|
||||
#include "nsThreadManager.h"
|
||||
|
@ -219,6 +220,13 @@ GPUParent::RecvInitVRManager(Endpoint<PVRManagerParent>&& aEndpoint)
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
GPUParent::RecvInitUiCompositorController(Endpoint<PUiCompositorControllerParent>&& aEndpoint)
|
||||
{
|
||||
UiCompositorControllerParent::Start(Move(aEndpoint));
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
GPUParent::RecvUpdatePref(const GfxPrefSetting& setting)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
mozilla::ipc::IPCResult RecvInitVsyncBridge(Endpoint<PVsyncBridgeParent>&& aVsyncEndpoint) override;
|
||||
mozilla::ipc::IPCResult RecvInitImageBridge(Endpoint<PImageBridgeParent>&& aEndpoint) override;
|
||||
mozilla::ipc::IPCResult RecvInitVRManager(Endpoint<PVRManagerParent>&& aEndpoint) override;
|
||||
mozilla::ipc::IPCResult RecvInitUiCompositorController(Endpoint<PUiCompositorControllerParent>&& aEndpoint) override;
|
||||
mozilla::ipc::IPCResult RecvUpdatePref(const GfxPrefSetting& pref) override;
|
||||
mozilla::ipc::IPCResult RecvUpdateVar(const GfxVarUpdate& pref) override;
|
||||
mozilla::ipc::IPCResult RecvNewWidgetCompositor(
|
||||
|
|
|
@ -33,6 +33,11 @@
|
|||
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
#include "mozilla/widget/AndroidUiThread.h"
|
||||
#include "mozilla/layers/UiCompositorControllerChild.h"
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
|
@ -229,6 +234,44 @@ GPUProcessManager::EnsureVRManager()
|
|||
VRManagerChild::InitWithGPUProcess(Move(childPipe));
|
||||
}
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
void
|
||||
GPUProcessManager::EnsureUiCompositorController()
|
||||
{
|
||||
if (UiCompositorControllerChild::IsInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureGPUReady();
|
||||
|
||||
RefPtr<nsThread> uiThread;
|
||||
|
||||
uiThread = GetAndroidUiThread();
|
||||
|
||||
MOZ_ASSERT(uiThread);
|
||||
|
||||
if (!mGPUChild) {
|
||||
UiCompositorControllerChild::InitSameProcess(uiThread);
|
||||
return;
|
||||
}
|
||||
|
||||
ipc::Endpoint<PUiCompositorControllerParent> parentPipe;
|
||||
ipc::Endpoint<PUiCompositorControllerChild> childPipe;
|
||||
nsresult rv = PUiCompositorController::CreateEndpoints(
|
||||
mGPUChild->OtherPid(),
|
||||
base::GetCurrentProcId(),
|
||||
&parentPipe,
|
||||
&childPipe);
|
||||
if (NS_FAILED(rv)) {
|
||||
DisableGPUProcess("Failed to create PUiCompositorController endpoints");
|
||||
return;
|
||||
}
|
||||
|
||||
mGPUChild->SendInitUiCompositorController(Move(parentPipe));
|
||||
UiCompositorControllerChild::InitWithGPUProcess(uiThread, mProcessToken, Move(childPipe));
|
||||
}
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
void
|
||||
GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
|
||||
{
|
||||
|
@ -482,6 +525,9 @@ GPUProcessManager::DestroyProcess()
|
|||
mVsyncBridge->Close();
|
||||
mVsyncBridge = nullptr;
|
||||
}
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
UiCompositorControllerChild::Shutdown();
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
}
|
||||
|
||||
RefPtr<CompositorSession>
|
||||
|
@ -497,6 +543,9 @@ GPUProcessManager::CreateTopLevelCompositor(nsBaseWidget* aWidget,
|
|||
EnsureGPUReady();
|
||||
EnsureImageBridgeChild();
|
||||
EnsureVRManager();
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
EnsureUiCompositorController();
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
if (mGPUChild) {
|
||||
RefPtr<CompositorSession> session = CreateRemoteSession(
|
||||
|
|
|
@ -193,6 +193,7 @@ private:
|
|||
|
||||
void EnsureImageBridgeChild();
|
||||
void EnsureVRManager();
|
||||
void EnsureUiCompositorController();
|
||||
|
||||
RefPtr<CompositorSession> CreateRemoteSession(
|
||||
nsBaseWidget* aWidget,
|
||||
|
|
|
@ -8,6 +8,7 @@ include protocol PCompositorBridge;
|
|||
include protocol PImageBridge;
|
||||
include protocol PVRManager;
|
||||
include protocol PVsyncBridge;
|
||||
include protocol PUiCompositorController;
|
||||
include protocol PVideoDecoderManager;
|
||||
|
||||
using base::ProcessId from "base/process.h";
|
||||
|
@ -52,6 +53,7 @@ parent:
|
|||
async InitVsyncBridge(Endpoint<PVsyncBridgeParent> endpoint);
|
||||
async InitImageBridge(Endpoint<PImageBridgeParent> endpoint);
|
||||
async InitVRManager(Endpoint<PVRManagerParent> endpoint);
|
||||
async InitUiCompositorController(Endpoint<PUiCompositorControllerParent> endpoint);
|
||||
|
||||
// Called to update a gfx preference or variable.
|
||||
async UpdatePref(GfxPrefSetting pref);
|
||||
|
|
|
@ -421,10 +421,11 @@ CompositorBridgeParent::~CompositorBridgeParent()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositorBridgeParent::ForceIsFirstPaint()
|
||||
mozilla::ipc::IPCResult
|
||||
CompositorBridgeParent::RecvForceIsFirstPaint()
|
||||
{
|
||||
mCompositionManager->ForceIsFirstPaint();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1117,6 +1118,13 @@ CompositorBridgeParent::GetAPZCTreeManager()
|
|||
return mApzcTreeManager;
|
||||
}
|
||||
|
||||
CompositorBridgeParent*
|
||||
CompositorBridgeParent::GetCompositorBridgeParentFromLayersId(const uint64_t& aLayersId)
|
||||
{
|
||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||
return sIndirectLayerTrees[aLayersId].mParent;
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorBridgeParent::CanComposite()
|
||||
{
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
* The information refresh happens because the compositor will call
|
||||
* SetFirstPaintViewport on the next frame of composition.
|
||||
*/
|
||||
void ForceIsFirstPaint();
|
||||
mozilla::ipc::IPCResult RecvForceIsFirstPaint() override;
|
||||
|
||||
static void SetShadowProperties(Layer* aLayer);
|
||||
|
||||
|
@ -441,6 +441,7 @@ public:
|
|||
return mOptions;
|
||||
}
|
||||
|
||||
static CompositorBridgeParent* GetCompositorBridgeParentFromLayersId(const uint64_t& aLayersId);
|
||||
private:
|
||||
|
||||
void Initialize();
|
||||
|
@ -480,12 +481,16 @@ protected:
|
|||
void SetEGLSurfaceSize(int width, int height);
|
||||
|
||||
void InitializeLayerManager(const nsTArray<LayersBackend>& aBackendHints);
|
||||
|
||||
public:
|
||||
void PauseComposition();
|
||||
void ResumeComposition();
|
||||
void ResumeCompositionAndResize(int width, int height);
|
||||
void Invalidate();
|
||||
|
||||
protected:
|
||||
void ForceComposition();
|
||||
void CancelCurrentCompositeTask();
|
||||
void Invalidate();
|
||||
|
||||
// CompositorVsyncSchedulerOwner
|
||||
bool IsPendingComposite() override;
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
virtual mozilla::ipc::IPCResult RecvWillClose() override { return IPC_OK(); }
|
||||
virtual mozilla::ipc::IPCResult RecvPause() override { return IPC_OK(); }
|
||||
virtual mozilla::ipc::IPCResult RecvResume() override { return IPC_OK(); }
|
||||
virtual mozilla::ipc::IPCResult RecvForceIsFirstPaint() override { return IPC_OK(); }
|
||||
virtual mozilla::ipc::IPCResult RecvNotifyChildCreated(const uint64_t& child) override;
|
||||
virtual mozilla::ipc::IPCResult RecvNotifyChildRecreated(const uint64_t& child) override { return IPC_FAIL_NO_REASON(this); }
|
||||
virtual mozilla::ipc::IPCResult RecvAdoptChild(const uint64_t& child) override { return IPC_FAIL_NO_REASON(this); }
|
||||
|
|
|
@ -177,6 +177,7 @@ parent:
|
|||
// the compositor needs to pause/resume in lockstep with the application.
|
||||
sync Pause();
|
||||
sync Resume();
|
||||
async ForceIsFirstPaint();
|
||||
|
||||
// See bug 1316632 comment #33 for why this has to be sync. Otherwise,
|
||||
// there are ordering issues with SendPLayerTransactionConstructor.
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=8 et :
|
||||
*/
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
/**
|
||||
* The PUiCompositorController protocol is used to pause and resume the
|
||||
* compositor from the UI thread. Primarily used on Android to coordinate registering and
|
||||
* releasing the surface with the compositor.
|
||||
*/
|
||||
sync protocol PUiCompositorController
|
||||
{
|
||||
|
||||
parent:
|
||||
// Pause/resume the compositor. These are intended to be used on mobile, when
|
||||
// the compositor needs to pause/resume in lockstep with the application.
|
||||
sync Pause(uint64_t layersId);
|
||||
sync Resume(uint64_t layersId);
|
||||
sync ResumeAndResize(uint64_t layersId, int32_t height, int32_t width);
|
||||
async InvalidateAndRender(uint64_t layersId);
|
||||
};
|
||||
|
||||
} // layers
|
||||
} // mozilla
|
|
@ -0,0 +1,184 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "UiCompositorControllerChild.h"
|
||||
#include "UiCompositorControllerParent.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
static bool sInitialized = false;
|
||||
static StaticRefPtr<UiCompositorControllerChild> sChild;
|
||||
static StaticRefPtr<UiCompositorControllerParent> sParent;
|
||||
|
||||
UiCompositorControllerChild::UiCompositorControllerChild(RefPtr<nsThread> aThread, const uint64_t& aProcessToken)
|
||||
: mUiThread(aThread),
|
||||
mProcessToken(aProcessToken)
|
||||
{
|
||||
}
|
||||
|
||||
UiCompositorControllerChild::~UiCompositorControllerChild()
|
||||
{
|
||||
}
|
||||
|
||||
/* static */ UiCompositorControllerChild*
|
||||
UiCompositorControllerChild::Get()
|
||||
{
|
||||
return sChild;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
UiCompositorControllerChild::IsInitialized()
|
||||
{
|
||||
return sInitialized;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
UiCompositorControllerChild::Shutdown()
|
||||
{
|
||||
RefPtr<UiCompositorControllerChild> child = sChild;
|
||||
if (child) {
|
||||
child->Close();
|
||||
sInitialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
UiCompositorControllerChild::InitSameProcess(RefPtr<nsThread> aThread)
|
||||
{
|
||||
MOZ_ASSERT(!sChild);
|
||||
MOZ_ASSERT(!sParent);
|
||||
MOZ_ASSERT(aThread);
|
||||
MOZ_ASSERT(!sInitialized);
|
||||
|
||||
sInitialized = true;
|
||||
RefPtr<UiCompositorControllerChild> child = new UiCompositorControllerChild(aThread, 0);
|
||||
sParent = new UiCompositorControllerParent();
|
||||
aThread->Dispatch(NewRunnableMethod(child, &UiCompositorControllerChild::OpenForSameProcess), nsIThread::DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
UiCompositorControllerChild::InitWithGPUProcess(RefPtr<nsThread> aThread,
|
||||
const uint64_t& aProcessToken,
|
||||
Endpoint<PUiCompositorControllerChild>&& aEndpoint)
|
||||
{
|
||||
MOZ_ASSERT(!sChild);
|
||||
MOZ_ASSERT(!sParent);
|
||||
MOZ_ASSERT(aThread);
|
||||
MOZ_ASSERT(!sInitialized);
|
||||
|
||||
sInitialized = true;
|
||||
RefPtr<UiCompositorControllerChild> child = new UiCompositorControllerChild(aThread, aProcessToken);
|
||||
|
||||
RefPtr<nsIRunnable> task = NewRunnableMethod<Endpoint<PUiCompositorControllerChild>&&>(
|
||||
child, &UiCompositorControllerChild::OpenForGPUProcess, Move(aEndpoint));
|
||||
|
||||
aThread->Dispatch(task.forget(), nsIThread::DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::OpenForSameProcess()
|
||||
{
|
||||
MOZ_ASSERT(sParent);
|
||||
MOZ_ASSERT(!sChild);
|
||||
MOZ_ASSERT(IsOnUiThread());
|
||||
|
||||
if (!Open(sParent->GetIPCChannel(),
|
||||
mozilla::layers::CompositorThreadHolder::Loop(),
|
||||
mozilla::ipc::ChildSide)) {
|
||||
sParent = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
AddRef();
|
||||
sChild = this;
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::OpenForGPUProcess(Endpoint<PUiCompositorControllerChild>&& aEndpoint)
|
||||
{
|
||||
MOZ_ASSERT(!sChild);
|
||||
MOZ_ASSERT(IsOnUiThread());
|
||||
|
||||
if (!aEndpoint.Bind(this)) {
|
||||
// The GPU Process Manager might be gone if we receive ActorDestroy very
|
||||
// late in shutdown.
|
||||
if (GPUProcessManager* gpm = GPUProcessManager::Get()) {
|
||||
gpm->NotifyRemoteActorDestroyed(mProcessToken);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
AddRef();
|
||||
sChild = this;
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::Close()
|
||||
{
|
||||
if (!IsOnUiThread()) {
|
||||
mUiThread->Dispatch(NewRunnableMethod(this, &UiCompositorControllerChild::Close), nsIThread::DISPATCH_NORMAL);
|
||||
return;
|
||||
}
|
||||
|
||||
// We clear mProcessToken when the channel is closed.
|
||||
if (!mProcessToken) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear the process token so we don't notify the GPUProcessManager. It already
|
||||
// knows we're closed since it manually called Close, and in fact the GPM could
|
||||
// have already been destroyed during shutdown.
|
||||
mProcessToken = 0;
|
||||
if (this == sChild) {
|
||||
sChild = nullptr;
|
||||
}
|
||||
|
||||
// Close the underlying IPC channel.
|
||||
PUiCompositorControllerChild::Close();
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
if (mProcessToken) {
|
||||
GPUProcessManager::Get()->NotifyRemoteActorDestroyed(mProcessToken);
|
||||
mProcessToken = 0;
|
||||
sParent = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::DeallocPUiCompositorControllerChild()
|
||||
{
|
||||
Release();
|
||||
sInitialized = false;
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::ProcessingError(Result aCode, const char* aReason)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(aCode == MsgDropped, "Processing error in UiCompositorControllerChild");
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerChild::HandleFatalError(const char* aName, const char* aMsg) const
|
||||
{
|
||||
dom::ContentChild::FatalErrorIfNotUsingGPUProcess(aName, aMsg, OtherPid());
|
||||
}
|
||||
|
||||
bool
|
||||
UiCompositorControllerChild::IsOnUiThread() const
|
||||
{
|
||||
return NS_GetCurrentThread() == mUiThread;
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
|
@ -0,0 +1,51 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#ifndef include_gfx_ipc_UiCompositorControllerChild_h
|
||||
#define include_gfx_ipc_UiCompositorControllerChild_h
|
||||
|
||||
#include "mozilla/layers/PUiCompositorControllerChild.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include <nsThread.h>
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class UiCompositorControllerChild final : public PUiCompositorControllerChild
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UiCompositorControllerChild)
|
||||
|
||||
static bool IsInitialized();
|
||||
static void Shutdown();
|
||||
static UiCompositorControllerChild* Get();
|
||||
static void InitSameProcess(RefPtr<nsThread> aThread);
|
||||
static void InitWithGPUProcess(RefPtr<nsThread> aThread,
|
||||
const uint64_t& aProcessToken,
|
||||
Endpoint<PUiCompositorControllerChild>&& aEndpoint);
|
||||
|
||||
void Close();
|
||||
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void DeallocPUiCompositorControllerChild() override;
|
||||
void ProcessingError(Result aCode, const char* aReason) override;
|
||||
|
||||
virtual void HandleFatalError(const char* aName, const char* aMsg) const override;
|
||||
|
||||
private:
|
||||
UiCompositorControllerChild(RefPtr<nsThread> aThread, const uint64_t& aProcessToken);
|
||||
~UiCompositorControllerChild();
|
||||
void OpenForSameProcess();
|
||||
void OpenForGPUProcess(Endpoint<PUiCompositorControllerChild>&& aEndpoint);
|
||||
bool IsOnUiThread() const;
|
||||
|
||||
RefPtr<nsThread> mUiThread;
|
||||
uint64_t mProcessToken;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // include_gfx_ipc_UiCompositorControllerChild_h
|
|
@ -0,0 +1,118 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#include "UiCompositorControllerParent.h"
|
||||
#include "mozilla/layers/CompositorBridgeParent.h"
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
RefPtr<UiCompositorControllerParent>
|
||||
UiCompositorControllerParent::Start(Endpoint<PUiCompositorControllerParent>&& aEndpoint)
|
||||
{
|
||||
RefPtr<UiCompositorControllerParent> parent = new UiCompositorControllerParent();
|
||||
|
||||
RefPtr<Runnable> task = NewRunnableMethod<Endpoint<PUiCompositorControllerParent>&&>(
|
||||
parent, &UiCompositorControllerParent::Open, Move(aEndpoint));
|
||||
CompositorThreadHolder::Loop()->PostTask(task.forget());
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
UiCompositorControllerParent::UiCompositorControllerParent()
|
||||
{
|
||||
MOZ_COUNT_CTOR(UiCompositorControllerParent);
|
||||
}
|
||||
|
||||
UiCompositorControllerParent::~UiCompositorControllerParent()
|
||||
{
|
||||
MOZ_COUNT_DTOR(UiCompositorControllerParent);
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerParent::Open(Endpoint<PUiCompositorControllerParent>&& aEndpoint)
|
||||
{
|
||||
if (!aEndpoint.Bind(this)) {
|
||||
// We can't recover from this.
|
||||
MOZ_CRASH("Failed to bind UiCompositorControllerParent to endpoint");
|
||||
}
|
||||
AddRef();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
UiCompositorControllerParent::RecvPause(const uint64_t& aLayersId)
|
||||
{
|
||||
CompositorBridgeParent* parent = CompositorBridgeParent::GetCompositorBridgeParentFromLayersId(aLayersId);
|
||||
if (parent) {
|
||||
parent->PauseComposition();
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
UiCompositorControllerParent::RecvResume(const uint64_t& aLayersId)
|
||||
{
|
||||
CompositorBridgeParent* parent = CompositorBridgeParent::GetCompositorBridgeParentFromLayersId(aLayersId);
|
||||
if (parent) {
|
||||
parent->ResumeComposition();
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
UiCompositorControllerParent::RecvResumeAndResize(const uint64_t& aLayersId,
|
||||
const int32_t& aHeight,
|
||||
const int32_t& aWidth)
|
||||
{
|
||||
CompositorBridgeParent* parent = CompositorBridgeParent::GetCompositorBridgeParentFromLayersId(aLayersId);
|
||||
if (parent) {
|
||||
parent->ResumeCompositionAndResize(aHeight, aWidth);
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
UiCompositorControllerParent::RecvInvalidateAndRender(const uint64_t& aLayersId)
|
||||
{
|
||||
CompositorBridgeParent* parent = CompositorBridgeParent::GetCompositorBridgeParentFromLayersId(aLayersId);
|
||||
if (parent) {
|
||||
parent->Invalidate();
|
||||
parent->ScheduleComposition();
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerParent::Shutdown()
|
||||
{
|
||||
MessageLoop* ccloop = CompositorThreadHolder::Loop();
|
||||
if (MessageLoop::current() != ccloop) {
|
||||
ccloop->PostTask(NewRunnableMethod(this, &UiCompositorControllerParent::ShutdownImpl));
|
||||
return;
|
||||
}
|
||||
|
||||
ShutdownImpl();
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerParent::ShutdownImpl()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
UiCompositorControllerParent::DeallocPUiCompositorControllerParent()
|
||||
{
|
||||
Release();
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
|
@ -0,0 +1,47 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#ifndef include_gfx_ipc_UiCompositorControllerParent_h
|
||||
#define include_gfx_ipc_UiCompositorControllerParent_h
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/layers/PUiCompositorControllerParent.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class UiCompositorControllerParent final : public PUiCompositorControllerParent
|
||||
{
|
||||
public:
|
||||
UiCompositorControllerParent();
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UiCompositorControllerParent)
|
||||
|
||||
static RefPtr<UiCompositorControllerParent> Start(Endpoint<PUiCompositorControllerParent>&& aEndpoint);
|
||||
|
||||
mozilla::ipc::IPCResult RecvPause(const uint64_t& aLayersId) override;
|
||||
mozilla::ipc::IPCResult RecvResume(const uint64_t& aLayersId) override;
|
||||
mozilla::ipc::IPCResult RecvResumeAndResize(const uint64_t& aLayersId,
|
||||
const int32_t& aHeight,
|
||||
const int32_t& aWidth) override;
|
||||
mozilla::ipc::IPCResult RecvInvalidateAndRender(const uint64_t& aLayersId) override;
|
||||
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void DeallocPUiCompositorControllerParent() override;
|
||||
|
||||
void Shutdown();
|
||||
|
||||
private:
|
||||
~UiCompositorControllerParent();
|
||||
|
||||
void Open(Endpoint<PUiCompositorControllerParent>&& aEndpoint);
|
||||
void ShutdownImpl();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // include_gfx_ipc_UiCompositorControllerParent_h
|
|
@ -183,6 +183,8 @@ EXPORTS.mozilla.layers += [
|
|||
'ipc/SharedRGBImage.h',
|
||||
'ipc/SynchronousTask.h',
|
||||
'ipc/TextureForwarder.h',
|
||||
'ipc/UiCompositorControllerChild.h',
|
||||
'ipc/UiCompositorControllerParent.h',
|
||||
'ipc/VideoBridgeChild.h',
|
||||
'ipc/VideoBridgeParent.h',
|
||||
'LayerMetricsWrapper.h',
|
||||
|
@ -347,6 +349,8 @@ UNIFIED_SOURCES += [
|
|||
'ipc/ShadowLayers.cpp',
|
||||
'ipc/SharedPlanarYCbCrImage.cpp',
|
||||
'ipc/SharedRGBImage.cpp',
|
||||
'ipc/UiCompositorControllerChild.cpp',
|
||||
'ipc/UiCompositorControllerParent.cpp',
|
||||
'ipc/VideoBridgeChild.cpp',
|
||||
'ipc/VideoBridgeParent.cpp',
|
||||
'LayerScope.cpp',
|
||||
|
@ -394,7 +398,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
|||
'opengl/MacIOSurfaceTextureHostOGL.cpp',
|
||||
]
|
||||
|
||||
IPDL_SOURCES = [
|
||||
IPDL_SOURCES += [
|
||||
'ipc/LayersMessages.ipdlh',
|
||||
'ipc/LayersSurfaces.ipdlh',
|
||||
'ipc/PAPZ.ipdl',
|
||||
|
@ -403,6 +407,7 @@ IPDL_SOURCES = [
|
|||
'ipc/PImageBridge.ipdl',
|
||||
'ipc/PLayerTransaction.ipdl',
|
||||
'ipc/PTexture.ipdl',
|
||||
'ipc/PUiCompositorController.ipdl',
|
||||
'ipc/PVideoBridge.ipdl',
|
||||
]
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "TexturePoolOGL.h"
|
||||
#include "mozilla/layers/UiCompositorControllerChild.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_SKIA
|
||||
|
@ -962,7 +963,9 @@ gfxPlatform::ShutdownLayersIPC()
|
|||
gfx::VRManagerChild::ShutDown();
|
||||
layers::CompositorBridgeChild::ShutDown();
|
||||
layers::ImageBridgeChild::ShutDown();
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
layers::UiCompositorControllerChild::Shutdown();
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
// This has to happen after shutting down the child protocols.
|
||||
layers::CompositorThreadHolder::Shutdown();
|
||||
} else {
|
||||
|
|
|
@ -248,8 +248,119 @@ class ObjectOpResult
|
|||
}
|
||||
};
|
||||
|
||||
class PropertyResult
|
||||
{
|
||||
union {
|
||||
js::Shape* shape_;
|
||||
uintptr_t bits_;
|
||||
};
|
||||
|
||||
static const uintptr_t NotFound = 0;
|
||||
static const uintptr_t NonNativeProperty = 1;
|
||||
static const uintptr_t DenseOrTypedArrayElement = 1;
|
||||
|
||||
public:
|
||||
PropertyResult() : bits_(NotFound) {}
|
||||
|
||||
explicit PropertyResult(js::Shape* propertyShape)
|
||||
: shape_(propertyShape)
|
||||
{
|
||||
MOZ_ASSERT(!isFound() || isNativeProperty());
|
||||
}
|
||||
|
||||
explicit operator bool() const {
|
||||
return isFound();
|
||||
}
|
||||
|
||||
bool isFound() const {
|
||||
return bits_ != NotFound;
|
||||
}
|
||||
|
||||
bool isNonNativeProperty() const {
|
||||
return bits_ == NonNativeProperty;
|
||||
}
|
||||
|
||||
bool isDenseOrTypedArrayElement() const {
|
||||
return bits_ == DenseOrTypedArrayElement;
|
||||
}
|
||||
|
||||
bool isNativeProperty() const {
|
||||
return isFound() && !isNonNativeProperty();
|
||||
}
|
||||
|
||||
js::Shape* maybeShape() const {
|
||||
MOZ_ASSERT(!isNonNativeProperty());
|
||||
return isFound() ? shape_ : nullptr;
|
||||
}
|
||||
|
||||
js::Shape* shape() const {
|
||||
MOZ_ASSERT(isNativeProperty());
|
||||
return shape_;
|
||||
}
|
||||
|
||||
void setNotFound() {
|
||||
bits_ = NotFound;
|
||||
}
|
||||
|
||||
void setNativeProperty(js::Shape* propertyShape) {
|
||||
shape_ = propertyShape;
|
||||
MOZ_ASSERT(isNativeProperty());
|
||||
}
|
||||
|
||||
void setNonNativeProperty() {
|
||||
bits_ = NonNativeProperty;
|
||||
}
|
||||
|
||||
void setDenseOrTypedArrayElement() {
|
||||
bits_ = DenseOrTypedArrayElement;
|
||||
}
|
||||
|
||||
void trace(JSTracer* trc);
|
||||
};
|
||||
|
||||
} // namespace JS
|
||||
|
||||
namespace js {
|
||||
|
||||
template <class Wrapper>
|
||||
class WrappedPtrOperations<JS::PropertyResult, Wrapper>
|
||||
{
|
||||
const JS::PropertyResult& value() const { return static_cast<const Wrapper*>(this)->get(); }
|
||||
|
||||
public:
|
||||
bool isFound() const { return value().isFound(); }
|
||||
explicit operator bool() const { return bool(value()); }
|
||||
js::Shape* maybeShape() const { return value().maybeShape(); }
|
||||
js::Shape* shape() const { return value().shape(); }
|
||||
bool isNativeProperty() const { return value().isNativeProperty(); }
|
||||
bool isNonNativeProperty() const { return value().isNonNativeProperty(); }
|
||||
bool isDenseOrTypedArrayElement() const { return value().isDenseOrTypedArrayElement(); }
|
||||
js::Shape* asTaggedShape() const { return value().asTaggedShape(); }
|
||||
};
|
||||
|
||||
template <class Wrapper>
|
||||
class MutableWrappedPtrOperations<JS::PropertyResult, Wrapper>
|
||||
: public WrappedPtrOperations<JS::PropertyResult, Wrapper>
|
||||
{
|
||||
JS::PropertyResult& value() { return static_cast<Wrapper*>(this)->get(); }
|
||||
|
||||
public:
|
||||
void setNotFound() {
|
||||
value().setNotFound();
|
||||
}
|
||||
void setNativeProperty(js::Shape* shape) {
|
||||
value().setNativeProperty(shape);
|
||||
}
|
||||
void setNonNativeProperty() {
|
||||
value().setNonNativeProperty();
|
||||
}
|
||||
void setDenseOrTypedArrayElement() {
|
||||
value().setDenseOrTypedArrayElement();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace js
|
||||
|
||||
// JSClass operation signatures.
|
||||
|
||||
/**
|
||||
|
@ -405,7 +516,7 @@ namespace js {
|
|||
|
||||
typedef bool
|
||||
(* LookupPropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
|
||||
JS::MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
|
||||
JS::MutableHandleObject objp, JS::MutableHandle<JS::PropertyResult> propp);
|
||||
typedef bool
|
||||
(* DefinePropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
|
||||
JS::Handle<JS::PropertyDescriptor> desc,
|
||||
|
|
|
@ -46,6 +46,7 @@ class MOZ_STACK_CLASS SourceBufferHolder;
|
|||
class HandleValueArray;
|
||||
|
||||
class ObjectOpResult;
|
||||
class PropertyResult;
|
||||
|
||||
class Symbol;
|
||||
enum class SymbolCode: uint32_t;
|
||||
|
@ -155,6 +156,7 @@ using JS::FalseHandleValue;
|
|||
using JS::HandleValueArray;
|
||||
|
||||
using JS::ObjectOpResult;
|
||||
using JS::PropertyResult;
|
||||
|
||||
using JS::Zone;
|
||||
|
||||
|
|
|
@ -68,18 +68,18 @@ js::obj_propertyIsEnumerable(JSContext* cx, unsigned argc, Value* vp)
|
|||
JSObject* obj = &args.thisv().toObject();
|
||||
|
||||
/* Step 3. */
|
||||
Shape* shape;
|
||||
PropertyResult prop;
|
||||
if (obj->isNative() &&
|
||||
NativeLookupOwnProperty<NoGC>(cx, &obj->as<NativeObject>(), id, &shape))
|
||||
NativeLookupOwnProperty<NoGC>(cx, &obj->as<NativeObject>(), id, &prop))
|
||||
{
|
||||
/* Step 4. */
|
||||
if (!shape) {
|
||||
if (!prop) {
|
||||
args.rval().setBoolean(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Step 5. */
|
||||
unsigned attrs = GetShapeAttributes(obj, shape);
|
||||
unsigned attrs = GetPropertyAttributes(obj, prop);
|
||||
args.rval().setBoolean((attrs & JSPROP_ENUMERATE) != 0);
|
||||
return true;
|
||||
}
|
||||
|
@ -580,11 +580,11 @@ js::obj_hasOwnProperty(JSContext* cx, unsigned argc, Value* vp)
|
|||
jsid id;
|
||||
if (args.thisv().isObject() && ValueToId<NoGC>(cx, idValue, &id)) {
|
||||
JSObject* obj = &args.thisv().toObject();
|
||||
Shape* prop;
|
||||
PropertyResult prop;
|
||||
if (obj->isNative() &&
|
||||
NativeLookupOwnProperty<NoGC>(cx, &obj->as<NativeObject>(), id, &prop))
|
||||
{
|
||||
args.rval().setBoolean(!!prop);
|
||||
args.rval().setBoolean(prop.isFound());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -839,7 +839,7 @@ EnumerableOwnProperties(JSContext* cx, const JS::CallArgs& args, EnumerableOwnPr
|
|||
value = nobj->getDenseOrTypedArrayElement(JSID_TO_INT(id));
|
||||
} else {
|
||||
shape = nobj->lookup(cx, id);
|
||||
if (!shape || !(GetShapeAttributes(nobj, shape) & JSPROP_ENUMERATE))
|
||||
if (!shape || !(shape->attributes() & JSPROP_ENUMERATE))
|
||||
continue;
|
||||
if (!shape->isAccessorShape()) {
|
||||
if (!NativeGetExistingProperty(cx, nobj, nobj, shape, &value))
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче