import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 915880 - Add onclose event handlers in the MozInterAppMessagePort. r=ehsan,fabrice (5c57a3d571)
- Bug 1227206 - Location.assign and Location.replace should use USVStrings instead DOMStrings, r=bz (5069baa300)
- Bug 912342 - Add MediaStreamTrack.applyConstraints webidl. r=smaug (b43b0e0533)
- Bug 1160123 - Add support for LTE/WCDMA only network selection. r=hsinyi (82f0d18d75)
- Bug 993311 - Convert Network Stats API to WebIDL. r=bzbarsky. (4815cd4b57)
- Bug 993311 - Followup to fix b2g builds r=khuey (1294ac6d8e)
- Bug 1224944 - Improve the comments in NavigatorLanguage interface, r=bz (767104d09f)
- Bug 1233702 - Remove dom.permissions.enabled pref. r=baku (fc6a65d714)
- Bug 1224892 - Caching oscpu' and buildID' like other attributes related to User Agent. r=smaug (2e815d46af)
- Bug 1238205 - Mark Navigator.serviceWorker as SameObject; r=baku (66be34314b)
- Bug 1167541 - Implemented SpeechSynthesisEvent::utterance. r=smaug (eb2239ec4f)
- Bug 1167542 - Implement SpeechSynthesisErrorEvent. r=smaug (bd01bdb144)
- Bug 1238680 - Make dictionary arguments where a dictionary has a required member non-optional; r=bzbarsky (26a34e5279)
- fix tests (0198243cef)
- Bug 1192492 - Support masking of passwords in XUL tree columns. r=Enn,smaug (8594fafcb7)
- Bug 1170452 - Remove constants for texture swizzle and prim restart.  r=smaug (16e00c7565)
- Bug 1237783 - Make sure we correctly turn off appcache. r=ehsan (49f25a95ee)
- Bug 1218152 - Make Window.caches and WorkerGlobalScope.caches SameObject; r=bzbarsky (adf893fdb5)
- Bug 1137398 - disallow creating nested workers from ServiceWorker. r=baku (d720f362eb)
- Bug 931243 - Remove the XMLHttpRequest APIs from ServiceWorkerGlobalScope; r=bzbarsky (52110da15d)
- Bug 1238576 - disable mozApps API on desktop/Android; r=ehsan,ochameau,bz,mcmanus,jmaher,marco (79143c24b3)
- Bug 1233234 - part 1 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in openPrefFile; r=njn (9b2d083dd0)
- Bug 1233234 - part 2 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in pref_savePrefs; r=njn (4946a07998)
- Bug 1244982 - Fix minor double-reporting of memory in prefs code. r=erahm. (872c2c9b32)
- Bug 1233234 - part 3 - clean up UniquePtr usage in WritePrefFile; r=njn (1a37c3dca1)
- Bug 1241549 - Annotate intentional switch fallthrough in hal/linux/UPowerClient.cpp. r=gsvelto (7072ad9642)
- Bug 1167581 - Inconsistent pre-zeroing of ioctl buffers in gecko/hal/gonk/GonkFMRadio.cpp. r=mwu. (9e529cb0ac)
- Bug 1194721: Support Gonk sensors daemon, r=gsvelto (f2f47914ed)
- Bug 1137151: Marked destructors of ref-counted GonkHAL classes as protected, r=dhylands (7fb6a4792f)
- Bug 1116368 - Implementation of battery charging remaining time. r=dhylands (9b04442b6a)
- Bug 1163245 - [Battery][Gonk] Implementation of battery discharging remaining time. r=dhylands (96fb254ae9)
- Bug 1125084 - Uninitialised value use in mozilla::hal_impl::SetScreenBrightness(double). r=dhylands. (41f37994e5)
- Bug 1123628 - mozilla::hal_impl::PriorityClass::~PriorityClass() closes not-open files. r=dhylands. (4ae357d587)
- Bug 1208418: Shut down UeventPoller on XPCOM shutdown to fix the crash when the chrome process exits. r=dhylands (5b1192f310)
- Bug 1194721: Add registry interface and module for Gonk sensors, r=gsvelto (3936dcf96a)
- Bug 1194721: Add poll interface and module for Gonk sensors, r=gsvelto (101c0a2cf2)
- Bug 1194721: Add interface for Gonk sensors daemon, r=gsvelto (5a8ea8e2ad)
- Bug 1150232 - Stop gap solution until we can integrate the graphics docs. r=mstange (5a77195fb2)
- Bug 1235740 - Remove warning for missing Oculus VR Library from terminal output, as it is spammy and not necessary r=dholbert (628eaddc43)
- Bug 1235803 - Remove erroneous assertion r=dholbert (68287ff5ca)
- Bug 1222569 - remove unused variable in gfxDWriteFonts.cpp; r=Bas (c940b5f1e4)
- Bug 1212731 p1 - move GetSampleLangForGroup into base class. r=m_kato (a3cc3da7a7)
- Bug 1212731 p2 - add system font cascade to fontlist for -apple-system generic. r=m_kato (18056700de)
- Bug 1212731 p3 - reftest for system generic handling. r=m_kato (9aa64348b3)
- bit of Bug 1212731 p2 (0a0be8302c)
- Bug 1244017 - remove system font cascade for OSX. r=m_kato (742097b19e)
- Bug 1251995 part 1 - Add helper functions to simplify code. r=jfkthame (f533af33bb)
- Bug 1240739 - Support opacity when rendering color fonts (e.g. emoji). r=jdaggett (27c87cb70b)
- Bug 1251995 part 2 - Add gfxTextRun::Range to replace parameter pairs like (offset, length) and (start, end). r=jfkthame (e87c55be94)
- Bug 1251995 part 3 - Use struct to pass params for gfxTextRun::Draw.  r=jfkthame (fbe0cc3f7d)
- Bug 1251995 part 4 - Use struct to pass params for nsTextFrame::DrawText* functions. r=jfkthame (7d78727d65)
- Remove an extra assignment from gfxSparseBitSet::TestRange, no bug (065a8c74e1)
- Bug 1239603 - don't reject format 12 cmap with odd encoding. r=jfkthame (448ec8ab5e)
- Bug 724538 - When ICU is available in the build, replace most of nsCharProps2 fields with ICU property accessors. r=emk (3578679d8e)
- Bug 1228540 - pt 2 - Remove our HBGetGlyphHOrigin callback, as the default behavior is sufficient. r=jdaggett (9af85e376d)
- Bug 1235407 - Part 1: Add telemetry probe to record forced resets. r=milan (fd1fee75a4)
- Bug 1235407 - Part 2: Add ability to force device resets through gfxWindowsPlatform. r=milan (18479d140c)
- TenFourFox backport of font stuff in attempt of 10.5 support (f9a55f3978)
- Bug 1249212 part 2 - Fix infinity handling in StickyTimeDurationValueCalculator::Multiply; r=froydnj (e696303246)
- Bug 1184695 - Fix some indentation in nsHashPropertyBag. r=poiru (6c1bed1ecd)
- Bug 1182926 - Fix "observer-service-suspect" bustage. r=poiru. (25964b3802)
- Bug 1234542 - Don't use fallible Add in SetStringProperty. r=froydnj (2c9b93264a)
- Bug 1233566: Drop unnecessary newline character from NS_WARNING in nsPersistentProperties. r=froydnj (4ed1b9680d)
- Bug 1193564 - Check result of Read32 in nsSupportsArray::Read. r=erahm (b6983798f9)
- Bug 996105 - Added tests for registry access. Fixed wrong condition in ReadStringValue code. r=bsmedberxg (5945256572)
This commit is contained in:
2024-01-18 10:02:38 +08:00
parent 7f8ba9c1d7
commit 54262da9aa
190 changed files with 6090 additions and 1686 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = e10s
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
support-files =
system.webapp
system.webapp^headers^
+9 -1
View File
@@ -883,6 +883,14 @@ this.InterAppCommService = {
if (DEBUG) {
debug("Unregistering message port for " + manifestURL);
}
let receiver = identity.isPublisher ? identity.pair.subscriber
: identity.pair.publisher;
receiver.target.sendAsyncMessage("InterAppMessagePort:OnClose",
{ manifestURL: receiver.manifestURL,
pageURL: receiver.pageURL,
messagePortID: messagePortID });
delete this._messagePortPairs[messagePortID];
},
@@ -901,7 +909,7 @@ this.InterAppCommService = {
messagePortIDs.push(messagePortID);
// Send a shutdown message to the part of the pair that is still alive.
let actor = pair.publisher.target === aTarget ? pair.subscriber
: pair.publisher;
: pair.publisher;
actor.target.sendAsyncMessage("InterAppMessagePort:Shutdown",
{ manifestURL: actor.manifestURL,
pageURL: actor.pageURL,
+51 -2
View File
@@ -30,7 +30,8 @@ XPCOMUtils.defineLazyServiceGetter(this, "appsService",
"@mozilla.org/AppsService;1",
"nsIAppsService");
const kMessages = ["InterAppMessagePort:OnMessage",
const kMessages = ["InterAppMessagePort:OnClose",
"InterAppMessagePort:OnMessage",
"InterAppMessagePort:Shutdown"];
function InterAppMessagePort() {
@@ -66,6 +67,7 @@ InterAppMessagePort.prototype = {
this._started = false;
this._closed = false;
this._messageQueue = [];
this._deferredClose = false;
},
// WebIDL implementation for constructor.
@@ -131,6 +133,10 @@ InterAppMessagePort.prototype = {
let message = this._messageQueue.shift();
this._dispatchMessage(message);
}
if (this._deferredClose) {
this._dispatchClose();
}
},
close: function() {
@@ -143,6 +149,7 @@ InterAppMessagePort.prototype = {
}
this._closed = true;
this._deferredClose = false;
this._messageQueue.length = 0;
// When this method called on a local port that is entangled with another
@@ -152,6 +159,8 @@ InterAppMessagePort.prototype = {
manifestURL: this._manifestURL });
this.removeMessageListeners(kMessages);
this._dispatchClose();
},
get onmessage() {
@@ -176,6 +185,16 @@ InterAppMessagePort.prototype = {
this.start();
},
get onclose() {
if (DEBUG) debug("Getting onclose handler.");
return this.__DOM_IMPL__.getEventHandler("onclose");
},
set onclose(aHandler) {
if (DEBUG) debug("Setting onclose handler.");
this.__DOM_IMPL__.setEventHandler("onclose", aHandler);
},
_dispatchMessage: function _dispatchMessage(aMessage) {
let wrappedMessage = Cu.cloneInto(aMessage, this._window);
if (DEBUG) {
@@ -189,6 +208,15 @@ InterAppMessagePort.prototype = {
this.__DOM_IMPL__.dispatchEvent(event);
},
_dispatchClose() {
if (DEBUG) debug("_dispatchClose");
let event = new this._window.Event("close", {
bubbles: true,
cancelable: true
});
this.__DOM_IMPL__.dispatchEvent(event);
},
receiveMessage: function(aMessage) {
if (DEBUG) debug("receiveMessage: name: " + aMessage.name);
@@ -217,11 +245,32 @@ InterAppMessagePort.prototype = {
this._dispatchMessage(message.message);
break;
case "InterAppMessagePort:OnClose":
if (this._closed) {
if (DEBUG) debug("close() has been called. Drop the message.");
return;
}
// It is possible that one side of the port posts messages and calls
// close() before calling start() or setting the onmessage handler. In
// that case we need to queue the messages and defer the onclose event
// until the messages are delivered to the other side of the port.
if (!this._started) {
if (DEBUG) debug("Not yet called start(). Defer close notification.");
this._deferredClose = true;
return;
}
this._dispatchClose();
break;
case "InterAppMessagePort:Shutdown":
this.close();
break;
default:
if (DEBUG) debug("Error! Shouldn't fall into this case.");
dump("WARNING - Invalid InterAppMessagePort message type " +
aMessage.name + "\n");
break;
}
}
+4 -1
View File
@@ -8,7 +8,10 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
MOCHITEST_CHROME_MANIFESTS += [
'tests/b2g_chrome.ini',
'tests/chrome.ini'
]
EXPORTS.mozilla.dom += [
'InterAppComm.h',
+6
View File
@@ -0,0 +1,6 @@
[DEFAULT]
skip-if = buildapp != 'b2g'
support-files =
iac/*
[test_iac.html]
+1 -1
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'b2g' || os == 'android'
skip-if = buildapp != 'mulet'
support-files =
asmjs/*
common.js
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Certified hosted app",
"description": "An app that can't only be installed in dev mode.",
"description": "An app that can only be installed in dev mode.",
"launch_path": "/tests/dom/apps/tests/file_app.sjs?apptype=hosted",
"type": "certified"
}
+3
View File
@@ -0,0 +1,3 @@
subscriber.list and publisher.zip contain the lists of files that are part of each app.
To update the packages of both apps when changing one of those files listed on *.list, run makezips.sh.
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
rm publisher/publisher.zip
rm subscriber/subscriber.zip
cd publisher
zip publisher.zip `cat publisher.list`
cd ../subscriber
zip subscriber.zip `cat subscriber.list`
cd ..
+9
View File
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Publisher app for IAC API</title>
<script src="test.js"></script>
</head>
<body>
</body>
</html>
@@ -0,0 +1,5 @@
{
"name": "IAC publisher app",
"launch_path": "/index.html",
"type": "certified"
}
@@ -0,0 +1,3 @@
manifest.webapp
index.html
test.js
Binary file not shown.
+46
View File
@@ -0,0 +1,46 @@
function ok(aCondition, aMessage) {
if (aCondition) {
alert("OK: " + aMessage);
} else {
alert("KO: " + aMessage);
}
}
function ready() {
alert("READY");
}
let _port = null;
let responseReceived = false;
function onmessage(message) {
responseReceived = (message.data == "response");
ok(responseReceived, "response received");
}
function onclose() {
ok(true, "onclose received");
if (responseReceived) {
ready();
}
}
(function makeConnection() {
ok(true, "Connecting");
navigator.mozApps.getSelf().onsuccess = event => {
ok(true, "Got self");
let app = event.target.result;
app.connect("a-connection").then(ports => {
if (!ports || !ports.length) {
return ok(false, "No ports");
}
ok(true, "Got port");
_port = ports[0];
_port.onmessage = onmessage;
_port.onclose = onclose;
_port.postMessage('something');
}).catch(error => {
ok(false, "Unexpected " + error);
});
};
})();
@@ -0,0 +1,6 @@
{
"name": "IAC publisher app",
"launch_path": "/index.html",
"package_path": "publisher.zip",
"type": "certified"
}
@@ -0,0 +1 @@
Content-Type: application/x-web-app-manifest+json
+9
View File
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Subscriber app for IAC API</title>
<script src="test.js"></script>
</head>
<body>
</body>
</html>
@@ -0,0 +1,11 @@
{
"name": "IAC subscriber app",
"launch_path": "/index.html",
"type": "certified",
"connections": {
"a-connection": {
"description": "A connection",
"rules": {}
}
}
}
@@ -0,0 +1,3 @@
manifest.webapp
index.html
test.js
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
let port;
navigator.mozSetMessageHandler('connection', request => {
port = request.port;
port.onmessage = () => {
port.postMessage('response');
port.close();
};
});
alert('READY');
@@ -0,0 +1,12 @@
{
"name": "IAC subscriber app",
"launch_path": "/index.html",
"type": "certified",
"package_path": "subscriber.zip",
"connections": {
"a-connection": {
"description": "A connection",
"rules": {}
}
}
}
@@ -0,0 +1 @@
Content-Type: application/x-web-app-manifest+json
+3 -2
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = e10s
skip-if = buildapp != 'b2g' && buildapp != 'mulet'
support-files =
addons/application.zip
addons/update.webapp
@@ -42,7 +42,8 @@ skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in moch
skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
[test_bug_795164.html]
[test_bug_1168300.html]
skip-if = toolkit == "gonk" # see bug 1175784
skip-if = toolkit == "gonk" || e10s # see bug 1175784
[test_checkInstalled.html]
[test_import_export.html]
[test_install_dev_mode.html]
[test_install_multiple_apps_origin.html]
+237
View File
@@ -0,0 +1,237 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=915880
-->
<head>
<title>Test for IAC API</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/chrome-harness.js"></script>
<script type="application/javascript"
src="http://test/chrome/dom/activities/tests/mochi/common.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={915880}">Mozilla Bug {915880}</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="application/javascript;version=1.7">
SimpleTest.waitForExplicitFinish();
const gURL = "http://test/chrome/dom/apps/tests/iac/";
const IAC_UI_GLUE_CID =
Components.ID("{384afeee-f1d2-4819-9d2e-9b62f6b0e382}");
function registerComponent(aObject, aDescription, aContract, aCid) {
info("Registering " + aCid);
var componentManager =
Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
componentManager.registerFactory(aCid, aDescription, aContract, aObject);
// Keep the id on the object so we can unregister later.
aObject.cid = aCid;
}
function unregisterComponent(aObject) {
info("Unregistering " + aObject.cid);
var componentManager =
Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
componentManager.unregisterFactory(aObject.cid, aObject);
}
let InterAppCommUIGlue = {
// nsISupports implementation.
QueryInterface: function(iid) {
if (iid.equals(Ci.nsISupports) ||
iid.equals(Ci.nsIFactory) ||
iid.equals(Ci.nsIInterAppCommUIGlue)) {
return this;
}
throw Cr.NS_ERROR_NO_INTERFACE;
},
// nsIFactory implementation.
createInstance: function(outer, iid) {
return this.QueryInterface(iid);
},
// nsIInterAppCommUIGlue implementation
selectApps(aCallerID, aPubAppManifestURL, aKeyword, aAppsToSelect) {
return Promise.resolve({
callerID: aCallerID,
keyword: aKeyword,
manifestURL: aPubAppManifestURL,
selectedApps: aAppsToSelect
});
}
};
registerComponent(InterAppCommUIGlue,
"InterAppComm UI Glue",
"@mozilla.org/dom/apps/inter-app-comm-ui-glue;1",
IAC_UI_GLUE_CID);
function finish() {
unregisterComponent(InterAppCommUIGlue);
SimpleTest.finish();
}
function cbError(aEvent) {
ok(false, "Error callback invoked " +
aEvent.target.error.name + " " + aEvent.target.error.message);
finish();
}
let subscriber = null;
let publisher = null;
function installApp(path) {
return new Promise((resolve, reject) => {
let request = navigator.mozApps.installPackage(gURL + path);
request.onerror = () => {
ok(false, request.error.name);
reject();
};
request.onsuccess = () => {
let app = request.result;
ok(app, "App is not null");
if (app.installState == "installed") {
return resolve(app);
}
app.ondownloadapplied = () => {
resolve(app);
};
app.ondownloaderror = () => {
ok(false, "Unexpected download error");
reject();
};
};
});
}
function launchApp(app) {
if (!app) {
ok(false, "No app to launch");
return Promise.reject();
}
return new Promise((resolve, reject) => {
let iframe = document.createElement("iframe");
iframe.setAttribute("mozbrowser", "true");
iframe.setAttribute("mozapp", app.manifestURL);
iframe.addEventListener("mozbrowsershowmodalprompt", e => {
let message = e.detail.message;
if (/OK/.exec(message)) {
ok(true, "Message from app: " + message);
} else if (/KO/.exec(message)) {
ok(false, "Message from app: " + message);
} else if (/READY/.exec(message)) {
ok(true, "Message from app: " + message);
resolve();
} else {
ok(false, "Unexpected message received: " + message);
}
}, false);
let domParent = document.getElementById("container");
domParent.appendChild(iframe);
SpecialPowers.wrap(iframe.contentWindow).location =
app.origin + app.manifest.launch_path;
});
}
const tests = [() => {
info("Test start");
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(() => {
SpecialPowers.autoConfirmAppUninstall(next);
});
}, () => {
info("Installing subscriber app");
installApp("subscriber/update.webapp").then(app => {
subscriber = app;
next();
}).catch(() => {
ok(false, "Unable to install app");
finish();
});
}, () => {
info("Launching " + subscriber.manifest.name);
launchApp(subscriber).then(next);
}, () => {
info("Installing publisher app");
installApp("publisher/update.webapp").then(app => {
publisher = app;
next();
}).catch(() => {
ok(false, "Unable to install app");
finish();
});
}, () => {
info("Launching " + publisher.manifest.name);
launchApp(publisher).then(next);
}, () => {
navigator.mozApps.mgmt.onuninstall = event => {
let app = event.application;
next();
};
let request = navigator.mozApps.mgmt.uninstall(subscriber);
request.onerror = cbError;
}, () => {
navigator.mozApps.mgmt.onuninstall = event => {
let app = event.application;
next();
};
let request = navigator.mozApps.mgmt.uninstall(publisher);
request.onerror = cbError;
}];
const next = () => {
let step = tests.shift();
if (!step) {
return finish();
}
try {
step();
} catch(e) {
ok(false, "Test threw: " + e);
}
}
SpecialPowers.pushPermissions([{
"type": "webapps-manage",
"allow": 1,
"context": document
}, {
"type": "browser",
"allow": 1,
"context": document
}, {
"type": "embed-apps",
"allow": 1,
"context": document
}], () => {
// IAC is only allowed for certified apps. We use dev mode to
// skip the security checks.
SpecialPowers.pushPrefEnv({
"set": [
["dom.mozApps.debug", true],
["dom.apps.developer_mode", true],
["dom.mozBrowserFramesEnabled", true],
["dom.sysmsg.enabled", true]
]
}, next);
});
</script>
<div id="container"></div>
</pre>
</body>
</html>
@@ -155,7 +155,7 @@ var steps = [
PackagedTestHelper.gAppName);
},
function() {
PackagedTestHelper.setAppVersion(1, PackagedTestHelper.next);
PackagedTestHelper.setAppVersion(1, PackagedTestHelper.next);
},
function() {
// Test mini-manifest app name is different from the webapp manifest name.
@@ -19,13 +19,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=985827
var y = navigator.mozContacts;
is(x, y, "Should have gotten the same mozContacts object again");
// Test Javascript-navigator-property objects
x = navigator.mozApps;
is(typeof x, "object", "Should have a mozApps object");
delete navigator.mozApps;
y = navigator.mozApps;
is(x, y, "Should have gotten the same mozApps object again");
</script>
</head>
<body>
@@ -32,11 +32,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=985827
is(nav.mozContacts, nav.mozContacts,
"Should have gotten the same mozContacts object again");
// Test Javascript-navigator-property objects
is(typeof nav.mozApps, "object", "Should have a mozApps object");
is(nav.mozApps, nav.mozApps,
"Should have gotten the same mozApps object again");
SimpleTest.finish();
});
]]>
+4 -4
View File
@@ -26,19 +26,19 @@ function test()
is(nav.foopy, undefined, "We should have an Xray now");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object");
var props = Object.getOwnPropertyNames(nav);
isnot(props.indexOf("mozApps"), -1,
"Should enumerate a mozApps property on navigator xray");
isnot(props.indexOf("mozContacts"), -1,
"Should enumerate a mozContacts property on navigator xray");
var nav = document.getElementById("t2").contentWindow.navigator;
is(nav.foopy, undefined, "We should have an Xray now again");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again");
var found = false;
for (var name in nav) {
if (name == "mozApps") {
if (name == "mozContacts") {
found = true;
}
}
ok(found, "Should enumerate a mozApps property on navigator xray via for...in");
ok(found, "Should enumerate a mozContacts property on navigator xray via for...in");
SimpleTest.finish();
}
+4 -4
View File
@@ -15,17 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=707564
addLoadEvent(function() {
var props = Object.getOwnPropertyNames(frames[0].navigator);
isnot(props.indexOf("mozApps"), -1,
"Should enumerate a mozApps property on navigator");
isnot(props.indexOf("mozContacts"), -1,
"Should enumerate a mozContacts property on navigator");
// Now enumerate a different navigator object
var found = false;
for (var name in frames[1].navigator) {
if (name == "mozApps") {
if (name == "mozContacts") {
found = true;
}
}
ok(found, "Should enumerate a mozApps property on navigator via for...in");
ok(found, "Should enumerate a mozContacts property on navigator via for...in");
SimpleTest.finish();
});
</script>
+2 -2
View File
@@ -20,7 +20,7 @@ support-files =
[test_broadcastchannel_worker.html]
[test_broadcastchannel_worker_alive.html]
[test_broadcastchannel_mozbrowser.html]
skip-if = e10s || buildapp == 'b2g'
skip-if = buildapp != 'mulet'
[test_broadcastchannel_mozbrowser2.html]
skip-if = e10s || buildapp == 'b2g'
skip-if = buildapp != 'mulet'
[test_bfcache.html]
+1 -1
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
support-files =
browserElement_NotifyChannel.js
@@ -22,9 +22,9 @@ skip-if = toolkit=='gonk' || (toolkit == 'gonk' && !debug)
[test_browserElement_oop_Alert.html]
[test_browserElement_oop_AlertInFrame.html]
[test_browserElement_oop_AllowEmbedAppsInNestedOOIframe.html]
skip-if = toolkit=='gonk'
skip-if = toolkit == 'gonk' || buildapp != 'b2g'
[test_browserElement_oop_AppFramePermission.html]
skip-if = (toolkit == 'gonk' && !debug)
skip-if = (toolkit == 'gonk' && !debug) || buildapp != 'b2g'
[test_browserElement_oop_AppWindowNamespace.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_browserElement_oop_Auth.html]
@@ -40,6 +40,7 @@ skip-if = (toolkit == 'gonk' && !debug)
[test_browserElement_oop_DOMRequestError.html]
[test_browserElement_oop_DataURI.html]
[test_browserElement_oop_DisallowEmbedAppsInOOP.html]
skip-if = buildapp != 'b2g'
[test_browserElement_oop_DocumentFirstPaint.html]
[test_browserElement_oop_Download.html]
disabled = bug 1022281
+4 -4
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s
support-files =
../../../browser/base/content/test/general/audio.ogg
../../../dom/media/test/short-video.ogv
@@ -154,7 +154,7 @@ support-files =
skip-if = buildapp == 'b2g'
[test_browserElement_inproc_AlertInFrame.html]
[test_browserElement_inproc_AppFramePermission.html]
skip-if = toolkit == 'android' || buildapp == 'b2g'
skip-if = toolkit == 'android' || buildapp != 'mulet'
[test_browserElement_inproc_AppWindowNamespace.html]
skip-if = toolkit == 'android' || buildapp == 'b2g' # android(TIMED_OUT, bug 783509) androidx86(TIMED_OUT, bug 783509)
[test_browserElement_inproc_Auth.html]
@@ -175,7 +175,7 @@ skip-if = buildapp == 'b2g'
[test_browserElement_inproc_DOMRequestError.html]
[test_browserElement_inproc_DataURI.html]
[test_browserElement_inproc_DisallowEmbedAppsInOOP.html]
skip-if = os == "android" || toolkit == 'gonk' # embed-apps doesn't work in the mochitest app
skip-if = os == "android" || toolkit == 'gonk' || buildapp != 'mulet' # embed-apps doesn't work in the mochitest app
[test_browserElement_inproc_DocumentFirstPaint.html]
[test_browserElement_inproc_Download.html]
disabled = bug 1022281
@@ -213,7 +213,7 @@ skip-if = (toolkit == 'gonk' && !debug)
# Disabled on B2G Emulator because permission cannot be asserted in content process,
# need to fix either bug 1094055 or bug 1020135.
[test_browserElement_inproc_Proxy.html]
skip-if = (toolkit == 'gonk')
skip-if = toolkit == 'gonk' || buildapp == 'mulet'
[test_browserElement_inproc_PurgeHistory.html]
[test_browserElement_inproc_ReloadPostRequest.html]
[test_browserElement_inproc_RemoveBrowserElement.html]
+1 -1
View File
@@ -42,7 +42,7 @@ support-files =
[test_cache_restart.html]
[test_cache_shrink.html]
[test_cache_clear_on_app_uninstall.html]
skip-if = e10s || buildapp == 'b2g' # bug 1178685
skip-if = buildapp != 'mulet' || e10s # bug 1178685
[test_cache_orphaned_cache.html]
[test_cache_orphaned_body.html]
[test_cache_untrusted.html]
+7 -14
View File
@@ -3488,13 +3488,9 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
virtual nscoord GetWidth()
{
gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText(0,
mTextRun->GetLength(),
mDoMeasureBoundingBox ?
gfxFont::TIGHT_INK_EXTENTS :
gfxFont::LOOSE_INK_EXTENTS,
mDrawTarget,
nullptr);
gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText(
mDoMeasureBoundingBox ? gfxFont::TIGHT_INK_EXTENTS
: gfxFont::LOOSE_INK_EXTENTS, mDrawTarget);
// this only measures the height; the total width is gotten from the
// the return value of ProcessText.
@@ -3524,13 +3520,10 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
// glyph string on OS X and DWrite where textrun widths may
// involve fractional pixels.
gfxTextRun::Metrics textRunMetrics =
mTextRun->MeasureText(0,
mTextRun->GetLength(),
mDoMeasureBoundingBox ?
gfxFont::TIGHT_INK_EXTENTS :
gfxFont::LOOSE_INK_EXTENTS,
mDrawTarget,
nullptr);
mTextRun->MeasureText(mDoMeasureBoundingBox ?
gfxFont::TIGHT_INK_EXTENTS :
gfxFont::LOOSE_INK_EXTENTS,
mDrawTarget);
inlineCoord += textRunMetrics.mAdvanceWidth;
// old code was:
// point.x += width * mAppUnitsPerDevPixel;
+1 -1
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = e10s
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
support-files =
file_app_install.html
file_readonly.html
+3 -4
View File
@@ -658,10 +658,9 @@ ContentEventHandler::AppendFontRanges(FontRangeArray& aFontRanges,
}
}
uint32_t skipStart = iter.ConvertOriginalToSkipped(frameXPStart);
uint32_t skipEnd = iter.ConvertOriginalToSkipped(frameXPEnd);
gfxTextRun::GlyphRunIterator runIter(
textRun, skipStart, skipEnd - skipStart);
gfxTextRun::Range skipRange(iter.ConvertOriginalToSkipped(frameXPStart),
iter.ConvertOriginalToSkipped(frameXPEnd));
gfxTextRun::GlyphRunIterator runIter(textRun, skipRange);
int32_t lastXPEndOffset = frameXPStart;
while (runIter.NextRun()) {
gfxFont* font = runIter.GetGlyphRun()->mFont.get();
@@ -489,7 +489,14 @@ const kEventConstructors = {
return new SpeechRecognitionEvent(aName, aProps);
},
},
SpeechSynthesisErrorEvent: { create: function (aName, aProps) {
aProps.error = "synthesis-unavailable";
aProps.utterance = new SpeechSynthesisUtterance("Hello World");
return new SpeechSynthesisErrorEvent(aName, aProps);
},
},
SpeechSynthesisEvent: { create: function (aName, aProps) {
aProps.utterance = new SpeechSynthesisUtterance("Hello World");
return new SpeechSynthesisEvent(aName, aProps);
},
},
+9 -9
View File
@@ -114,10 +114,10 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_app_isolation_inproc.html]
# The app isolation tests are only supposed to run in the main process.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s
skip-if = buildapp == 'b2g' || e10s
[test_app_isolation_oop.html]
# The app isolation tests are only supposed to run in the main process.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s
skip-if = buildapp == 'b2g' || e10s
[test_autoIncrement.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_autoIncrement_indexes.html]
@@ -134,13 +134,13 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blob_worker_crash.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blob_worker_xhr_post.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blob_worker_xhr_post_multifile.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blob_worker_xhr_read.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blob_worker_xhr_read_slice.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blocked_order.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_bug937006.html]
@@ -361,14 +361,14 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_webapp_clearBrowserData_inproc_inproc.html]
# The clearBrowserData tests are only supposed to run in the main process.
# They currently time out on android.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s || toolkit == 'android'
skip-if = buildapp != 'mulet'
[test_webapp_clearBrowserData_inproc_oop.html]
# The clearBrowserData tests are only supposed to run in the main process.
# They currently time out on android.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s || toolkit == 'android'
skip-if = buildapp != 'mulet'
[test_webapp_clearBrowserData_oop_inproc.html]
# The clearBrowserData tests are only supposed to run in the main process.
# They currently time out on android.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s || toolkit == 'android'
skip-if = buildapp != 'mulet'
[test_serviceworker.html]
skip-if = buildapp == 'b2g'
+1 -1
View File
@@ -78,7 +78,7 @@ load 1080986.html
load 1122218.html
load 1127188.html
load 1157994.html
load 1158427.html
skip-if(!B2G) load 1158427.html
load 1185176.html
load 1185192.html
load analyser-channels-1.html
@@ -162,6 +162,7 @@ SpeechSynthesisUtterance::DispatchSpeechSynthesisEvent(const nsAString& aEventTy
SpeechSynthesisEventInit init;
init.mBubbles = false;
init.mCancelable = false;
init.mUtterance = this;
init.mCharIndex = aCharIndex;
init.mElapsedTime = aElapsedTime;
init.mName = aName;
@@ -27,6 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=525444
ok(SpeechSynthesis, "SpeechSynthesis exists in global scope");
ok(SpeechSynthesisVoice, "SpeechSynthesisVoice exists in global scope");
ok(SpeechSynthesisErrorEvent, "SpeechSynthesisErrorEvent exists in global scope");
ok(SpeechSynthesisEvent, "SpeechSynthesisEvent exists in global scope");
// SpeechSynthesisUtterance is the only type that has a constructor
+3 -1
View File
@@ -1,5 +1,5 @@
[DEFAULT]
skip-if = (buildapp != "browser") || e10s
skip-if = e10s
support-files =
file_hasPendingMessage.html
invalid_manifest.webapp
@@ -8,4 +8,6 @@ support-files =
manifest.webapp^headers^
[test_hasPendingMessage.html]
skip-if = buildapp != "browser"
[test_sysmsg_registration.html]
skip-if = buildapp != 'mulet'
@@ -37,6 +37,9 @@ const TEST_DATA = [
}, {
preferredNetworkType: "lte",
expectedErrorMessage: "ModeNotSupported"
}, {
preferredNetworkType: "lte/wcdma",
expectedErrorMessage: "ModeNotSupported"
},
// Test passing an invalid mode. We expect to get an exception here.
{
+18 -92
View File
@@ -111,7 +111,6 @@ NetworkStatsAlarm.prototype = {
const NETWORKSTATSMANAGER_CONTRACTID = "@mozilla.org/networkStatsManager;1";
const NETWORKSTATSMANAGER_CID = Components.ID("{ceb874cd-cc1a-4e65-b404-cc2d3e42425f}");
const nsIDOMMozNetworkStatsManager = Ci.nsIDOMMozNetworkStatsManager;
function NetworkStatsManager() {
if (DEBUG) {
@@ -122,40 +121,25 @@ function NetworkStatsManager() {
NetworkStatsManager.prototype = {
__proto__: DOMRequestIpcHelper.prototype,
checkPrivileges: function checkPrivileges() {
if (!this.hasPrivileges) {
throw Components.Exception("Permission denied", Cr.NS_ERROR_FAILURE);
}
},
getSamples: function getSamples(aNetwork, aStart, aEnd, aOptions) {
this.checkPrivileges();
if (aStart.constructor.name !== "Date" ||
aEnd.constructor.name !== "Date" ||
!(aNetwork instanceof this.window.MozNetworkStatsInterface) ||
aStart > aEnd) {
if (aStart > aEnd) {
throw Components.results.NS_ERROR_INVALID_ARG;
}
let appManifestURL = null;
let browsingTrafficOnly = false;
let serviceType = null;
if (aOptions) {
// appManifestURL is used to query network statistics by app;
// serviceType is used to query network statistics by system service.
// It is illegal to specify both of them at the same time.
if (aOptions.appManifestURL && aOptions.serviceType) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
// browsingTrafficOnly is meaningful only when querying by app.
if (!aOptions.appManifestURL && aOptions.browsingTrafficOnly) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
appManifestURL = aOptions.appManifestURL;
serviceType = aOptions.serviceType;
browsingTrafficOnly = aOptions.browsingTrafficOnly || false;
// appManifestURL is used to query network statistics by app;
// serviceType is used to query network statistics by system service.
// It is illegal to specify both of them at the same time.
if (aOptions.appManifestURL && aOptions.serviceType) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
// browsingTrafficOnly is meaningful only when querying by app.
if (!aOptions.appManifestURL && aOptions.browsingTrafficOnly) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
let appManifestURL = aOptions.appManifestURL;
let serviceType = aOptions.serviceType;
let browsingTrafficOnly = aOptions.browsingTrafficOnly;
// TODO Bug 929410 Date object cannot correctly pass through cpmm/ppmm IPC
// This is just a work-around by passing timestamp numbers.
@@ -175,12 +159,6 @@ NetworkStatsManager.prototype = {
},
clearStats: function clearStats(aNetwork) {
this.checkPrivileges();
if (!aNetwork instanceof this.window.MozNetworkStatsInterface) {
throw Components.results.NS_ERROR_INVALID_ARG;
}
let request = this.createRequest();
cpmm.sendAsyncMessage("NetworkStats:Clear",
{ network: aNetwork.toJSON(),
@@ -189,8 +167,6 @@ NetworkStatsManager.prototype = {
},
clearAllStats: function clearAllStats() {
this.checkPrivileges();
let request = this.createRequest();
cpmm.sendAsyncMessage("NetworkStats:ClearAll",
{id: this.getRequestId(request)});
@@ -198,17 +174,6 @@ NetworkStatsManager.prototype = {
},
addAlarm: function addAlarm(aNetwork, aThreshold, aOptions) {
this.checkPrivileges();
if (!aOptions) {
aOptions = Object.create(null);
}
if (aOptions.startTime && aOptions.startTime.constructor.name !== "Date" ||
!(aNetwork instanceof this.window.MozNetworkStatsInterface)) {
throw Components.results.NS_ERROR_INVALID_ARG;
}
let request = this.createRequest();
cpmm.sendAsyncMessage("NetworkStats:SetAlarm",
{id: this.getRequestId(request),
@@ -222,13 +187,8 @@ NetworkStatsManager.prototype = {
},
getAllAlarms: function getAllAlarms(aNetwork) {
this.checkPrivileges();
let network = null;
if (aNetwork) {
if (!aNetwork instanceof this.window.MozNetworkStatsInterface) {
throw Components.results.NS_ERROR_INVALID_ARG;
}
network = aNetwork.toJSON();
}
@@ -241,8 +201,6 @@ NetworkStatsManager.prototype = {
},
removeAlarms: function removeAlarms(aAlarmId) {
this.checkPrivileges();
if (aAlarmId == 0) {
aAlarmId = -1;
}
@@ -257,8 +215,6 @@ NetworkStatsManager.prototype = {
},
getAvailableNetworks: function getAvailableNetworks() {
this.checkPrivileges();
let request = this.createRequest();
cpmm.sendAsyncMessage("NetworkStats:GetAvailableNetworks",
{ id: this.getRequestId(request) });
@@ -266,8 +222,6 @@ NetworkStatsManager.prototype = {
},
getAvailableServiceTypes: function getAvailableServiceTypes() {
this.checkPrivileges();
let request = this.createRequest();
cpmm.sendAsyncMessage("NetworkStats:GetAvailableServiceTypes",
{ id: this.getRequestId(request) });
@@ -275,12 +229,10 @@ NetworkStatsManager.prototype = {
},
get sampleRate() {
this.checkPrivileges();
return cpmm.sendSyncMessage("NetworkStats:SampleRate")[0];
},
get maxStorageAge() {
this.checkPrivileges();
return cpmm.sendSyncMessage("NetworkStats:MaxStorageAge")[0];
},
@@ -390,27 +342,7 @@ NetworkStatsManager.prototype = {
},
init: function(aWindow) {
// Set navigator.mozNetworkStats to null.
if (!Services.prefs.getBoolPref("dom.mozNetworkStats.enabled")) {
return null;
}
let principal = aWindow.document.nodePrincipal;
let secMan = Services.scriptSecurityManager;
let perm = principal == secMan.getSystemPrincipal() ?
Ci.nsIPermissionManager.ALLOW_ACTION :
Services.perms.testExactPermissionFromPrincipal(principal,
"networkstats-manage");
// Only pages with perm set can use the netstats.
this.hasPrivileges = perm == Ci.nsIPermissionManager.ALLOW_ACTION;
if (DEBUG) {
debug("has privileges: " + this.hasPrivileges);
}
if (!this.hasPrivileges) {
return null;
}
this.initDOMRequestHelper(aWindow, ["NetworkStats:Get:Return",
"NetworkStats:GetAvailableNetworks:Return",
@@ -443,16 +375,10 @@ NetworkStatsManager.prototype = {
},
classID : NETWORKSTATSMANAGER_CID,
QueryInterface : XPCOMUtils.generateQI([nsIDOMMozNetworkStatsManager,
Ci.nsIDOMGlobalPropertyInitializer,
Ci.nsISupportsWeakReference,
Ci.nsIObserver]),
classInfo : XPCOMUtils.generateCI({classID: NETWORKSTATSMANAGER_CID,
contractID: NETWORKSTATSMANAGER_CONTRACTID,
classDescription: "NetworkStatsManager",
interfaces: [nsIDOMMozNetworkStatsManager],
flags: nsIClassInfo.DOM_OBJECT})
contractID : NETWORKSTATSMANAGER_CONTRACTID,
QueryInterface : XPCOMUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer,
Ci.nsISupportsWeakReference,
Ci.nsIObserver]),
}
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkStatsAlarm,
-1
View File
@@ -12,4 +12,3 @@ contract @mozilla.org/networkstatsalarm;1 {a93ea13e-409c-4189-9b1e-95fff220be55}
component {ceb874cd-cc1a-4e65-b404-cc2d3e42425f} NetworkStatsManager.js
contract @mozilla.org/networkStatsManager;1 {ceb874cd-cc1a-4e65-b404-cc2d3e42425f}
category JavaScript-navigator-property mozNetworkStats @mozilla.org/networkStatsManager;1
-1
View File
@@ -12,7 +12,6 @@ XPIDL_SOURCES += [
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
XPIDL_SOURCES += [
'nsIDOMNetworkStatsManager.idl',
'nsIEthernetManager.idl',
'nsINetworkStatsServiceProxy.idl',
]
+10 -12
View File
@@ -48,32 +48,30 @@ var steps = [
};
req.onerror = function () {
ok(req.error.name == "InvalidInterface", "Get InvalidInterface error");
is(req.error.name, "InvalidInterface", "Get InvalidInterface error");
next();
}
},
function () {
ok(true, "Calling addAlarm() with invalid network or parameters.");
var msg = "TypeError: Not enough arguments to MozNetworkStatsManager.addAlarm.";
try {
navigator.mozNetworkStats.addAlarm();
} catch(ex) {
ok(ex.result == SpecialPowers.Cr.NS_ERROR_XPC_NOT_ENOUGH_ARGS,
"addAlarm() throws NS_ERROR_XPC_NOT_ENOUGH_ARGS exception when no parameters");
is(ex.toString(), msg, "addAlarm() throws \"" + msg + "\" when no parameters");
}
try {
navigator.mozNetworkStats.addAlarm(100000);
} catch(ex) {
ok(ex.result == SpecialPowers.Cr.NS_ERROR_XPC_NOT_ENOUGH_ARGS,
"addAlarm() throws NS_ERROR_XPC_NOT_ENOUGH_ARGS exception when no network");
is(ex.toString(), msg, "addAlarm() throws " + msg + " when no network");
}
try {
navigator.mozNetworkStats.addAlarm(new window.MozNetworkStatsInterface(wifi));
} catch(ex) {
ok(ex.result == SpecialPowers.Cr.NS_ERROR_XPC_NOT_ENOUGH_ARGS,
"addAlarm() throws NS_ERROR_XPC_NOT_ENOUGH_ARGS exception when no threshold");
is(ex.toString(), msg, "addAlarm() throws " + msg + " when no threshold");
}
req = navigator.mozNetworkStats
@@ -84,7 +82,7 @@ var steps = [
};
req.onerror = function () {
ok(req.error.name == "InvalidThresholdValue", "Get InvalidThresholdValue error");
is(req.error.name, "InvalidThresholdValue", "Get InvalidThresholdValue error");
next();
}
},
@@ -109,8 +107,8 @@ var steps = [
.getAllAlarms(new window.MozNetworkStatsInterface(wifi));
req.onsuccess = function () {
ok(req.result.length == 1, "Only one alarm");
ok(req.result[0].alarmId == 1, "Get correct alarmId");
is(req.result.length, 1, "Only one alarm");
is(req.result[0].alarmId, 1, "Get correct alarmId");
next();
};
@@ -226,8 +224,8 @@ SpecialPowers.pushPrefEnv({'set': [["dom.mozNetworkStats.enabled", true]]},
ok('mozNetworkStats' in navigator, "navigator.mozNetworkStats should exist");
ok(navigator.mozNetworkStats instanceof SpecialPowers.Ci.nsIDOMMozNetworkStatsManager,
"navigator.mozNetworkStats should be a nsIDOMMozNetworkStatsManager object");
ok(navigator.mozNetworkStats instanceof MozNetworkStatsManager,
"navigator.mozNetworkStats should be a MozNetworkStatsManager object");
test();
});
@@ -333,8 +333,8 @@ SpecialPowers.pushPrefEnv({'set': [["dom.mozNetworkStats.enabled", true]]},
ok('mozNetworkStats' in navigator, "navigator.mozNetworkStats should exist");
ok(navigator.mozNetworkStats instanceof SpecialPowers.Ci.nsIDOMMozNetworkStatsManager,
"navigator.mozNetworkStats should be a nsIDOMMozNetworkStatsManager object");
ok(navigator.mozNetworkStats instanceof MozNetworkStatsManager,
"navigator.mozNetworkStats should be a MozNetworkStatsManager object");
test();
});
@@ -22,10 +22,8 @@ SpecialPowers.pushPrefEnv({'set': [["dom.mozNetworkStats.enabled", false]]},
ok(!SpecialPowers.getBoolPref("dom.mozNetworkStats.enabled"),
"Preference 'dom.mozNetworkStats.enabled' is false.");
ok('mozNetworkStats' in navigator, "navigator.mozNetworkStats should exist");
is(navigator.mozNetworkStats, null,
"mozNetworkStats should be null when not enabled.");
ok(!('mozNetworkStats' in navigator),
"navigator.mozNetworkStats should not exist when pref not set");
SimpleTest.finish();
});
@@ -27,25 +27,11 @@
ok(!SpecialPowers.hasPermission("networkstats-manage", document),
"Has no permission 'networkstats-manage'.");
ok('mozNetworkStats' in navigator, "navigator.mozNetworkStats should exist");
ok(!('mozNetworkStats' in navigator),
"navigator.mozNetworkStats should not exist when permission not set");
is(navigator.mozNetworkStats, null,
"mozNetworkStats should be null when no permission.");
var error;
try {
navigator.mozNetworkStats.getAvailableNetworks;
ok(false,
"Accessing navigator.mozNetworkStats.getAvailableNetworks should throw!");
} catch (ex) {
error = ex;
}
ok(error,
"Got an exception accessing navigator.mozNetworkStats.getAvailableNetworks");
SimpleTest.finish();
}
SimpleTest.finish();
}
</script>
</pre>
</body>
@@ -30,8 +30,8 @@ SpecialPowers.pushPrefEnv({'set': [["dom.mozNetworkStats.enabled", true]]},
ok('mozNetworkStats' in navigator, "navigator.mozNetworkStats should exist");
ok(navigator.mozNetworkStats instanceof SpecialPowers.Ci.nsIDOMMozNetworkStatsManager,
"navigator.mozNetworkStats should be a nsIDOMMozNetworkStatsManager object");
ok(navigator.mozNetworkStats instanceof MozNetworkStatsManager,
"navigator.mozNetworkStats should be a MozNetworkStatsManager object");
SimpleTest.finish();
});
@@ -41,8 +41,8 @@ function filterTimestamp(date) {
}
function getNetworks() {
return [{ id: '0', type: Ci.nsIDOMMozNetworkStatsManager.WIFI },
{ id: '1234', type: Ci.nsIDOMMozNetworkStatsManager.MOBILE }];
return [{ id: '0', type: Ci.nsINetworkInterface.NETWORK_TYPE_WIFI },
{ id: '1234', type: Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE }];
}
function compareNetworks(networkA, networkB) {
@@ -158,12 +158,12 @@ add_test(function test_queue() {
};
// Fill networks with fake network interfaces to enable netd async requests.
var network = {id: "1234", type: Ci.nsIDOMMozNetworkStatsManager.MOBILE};
var network = {id: "1234", type: Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE};
var netId1 = NetworkStatsService.getNetworkId(network.id, network.type);
NetworkStatsService._networks[netId1] = { network: network,
interfaceName: "net1" };
network = {id: "5678", type: Ci.nsIDOMMozNetworkStatsManager.MOBILE};
network = {id: "5678", type: Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE};
var netId2 = NetworkStatsService.getNetworkId(network.id, network.type);
NetworkStatsService._networks[netId2] = { network: network,
interfaceName: "net2" };
+1
View File
@@ -18,6 +18,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(https not work
[test_tcp-socket.html]
[test_udp-socket.html]
[test_webapps-manage.html]
skip-if = buildapp != 'b2g' && buildapp != 'mulet'
[test_camera.html]
disabled = disabled until bug 859593 is fixed
[test_keyboard.html]
@@ -20,7 +20,7 @@ var gData = [
{
perm: ["networkstats-manage"],
obj: "mozNetworkStats",
idl: "nsIDOMMozNetworkStatsManager",
webidl: "MozNetworkStatsManager",
settings: [["dom.mozNetworkStats.enabled", true]],
},
]
+1 -1
View File
@@ -14,7 +14,7 @@ skip-if = os == "android" || toolkit == "gonk"
[test_basic.html]
skip-if = os == "android" || toolkit == "gonk"
[test_basic_app.html]
skip-if = os == "android" || buildapp == 'b2g' || e10s # mozapps
skip-if = buildapp != 'mulet' || e10s # mozapps
[test_wakeUp.html]
run-if = buildapp == 'b2g' && toolkit == 'gonk'
[test_runNow.html]
+1
View File
@@ -176,6 +176,7 @@ skip-if = buildapp == 'b2g' #no ssl support
[test_ignore_unsafe_inline.html]
[test_self_none_as_hostname_confusion.html]
[test_bug949549.html]
skip-if = buildapp != 'b2g' && buildapp != 'mulet'
[test_path_matching.html]
[test_path_matching_redirect.html]
[test_report_uri_missing_in_report_only_header.html]
+3 -1
View File
@@ -390,6 +390,7 @@ this.GECKO_PREFERRED_NETWORK_TYPE_EVDO_ONLY = "evdo";
this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_CDMA_EVDO = "wcdma/gsm/cdma/evdo";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO = "lte/cdma/evdo";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM = "lte/wcdma/gsm";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA = "lte/wcdma";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO = "lte/wcdma/gsm/cdma/evdo";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY = "lte";
this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [
@@ -404,7 +405,8 @@ this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [
GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO,
GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM,
GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO,
GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY
GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY,
GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA
];
this.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT = "gsm,wcdma";
+16 -7
View File
@@ -21,25 +21,34 @@ support-files =
[test_headers_sw_reroute.html]
skip-if = buildapp == 'b2g' # Bug 1137683
[test_headers_mainthread.html]
skip-if = (e10s && debug && os == 'win')
[test_fetch_app_protocol.html]
skip-if = (buildapp != 'b2g' && buildapp != 'mulet')
[test_fetch_basic.html]
skip-if = (e10s && debug && os == 'win')
[test_fetch_basic_sw_reroute.html]
skip-if = buildapp == 'b2g' # Bug 1137683
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
[test_fetch_basic_http.html]
skip-if = (e10s && debug && os == 'win')
[test_fetch_basic_http_sw_reroute.html]
skip-if = e10s || buildapp == 'b2g' # Bug 1173163 for e10s, bug 1137683 for b2g
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
[test_fetch_cors.html]
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) # Bug 1210552 && 1210282
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) || (e10s && debug && os == 'win') # Bug 1210552 && 1210282
[test_fetch_cors_sw_reroute.html]
skip-if = e10s || buildapp == 'b2g' # Bug 1173163 for e10s, bug 1137683 for b2g
skip-if = buildapp == 'b2g' || (toolkit == 'android' && debug) # Bug 1210282
[test_formdataparsing.html]
skip-if = (e10s && debug && os == 'win')
[test_formdataparsing_sw_reroute.html]
skip-if = buildapp == 'b2g' # Bug 1137683
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
[test_request.html]
skip-if = (e10s && debug && os == 'win')
[test_request_cache.html]
skip-if = (e10s && debug && os == 'win')
[test_request_context.html]
skip-if = (e10s && debug && os == 'win')
[test_request_sw_reroute.html]
skip-if = buildapp == 'b2g' # Bug 1137683
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
[test_response.html]
skip-if = (e10s && debug && os == 'win')
[test_response_sw_reroute.html]
skip-if = buildapp == 'b2g' # Bug 1137683
skip-if = buildapp == 'b2g' || (e10s && debug && os == 'win') # Bug 1137683
@@ -1034,17 +1034,19 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SimpleTest", xbl: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SourceBuffer", desktop: true, linux: false, release: false},
"SourceBuffer",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SourceBufferList", desktop: true, linux: false, release: false},
"SourceBufferList",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpeechSynthesisEvent", b2g: true},
{name: "SpeechSynthesisErrorEvent", android: false, nightly: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpeechSynthesis", b2g: true},
{name: "SpeechSynthesisEvent", android: false, nightly: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpeechSynthesisUtterance", b2g: true},
{name: "SpeechSynthesis", android: false, nightly: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpeechSynthesisVoice", b2g: true},
{name: "SpeechSynthesisUtterance", android: false, nightly: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpeechSynthesisVoice", android: false, nightly: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SpecialPowers", xbl: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
@@ -5,7 +5,9 @@ support-files =
page_blank.html
[test_app_uninstall.html]
skip-if = buildapp != 'mulet'
[test_clear_browser_data.html]
skip-if = buildapp != 'mulet'
[test_localStorageBasePrivateBrowsing_perwindowpb.html]
[test_localStorageFromChrome.xhtml]
[test_localStorageQuotaPrivateBrowsing_perwindowpb.html]
@@ -152,7 +152,7 @@ function browserLoadEvent() {
setupStorage(gBrowserStorage.localStorage);
setupStorage(gBrowserStorage.sessionStorage);
navigator.mozApps.mgmt.getNotInstalled().onsuccess = function() {
navigator.mozApps.mgmt.getAll().onsuccess = function() {
for (i in this.result) {
var app = this.result[i];
if (app.manifestURL == gManifestURL) {
@@ -8,6 +8,6 @@ support-files =
[test_notification_storage.html]
[test_bug931307.html]
[test_notification_resend.html]
skip-if = e10s # On e10s, faking the app seems to be failing
skip-if = (buildapp != 'b2g' && buildapp != 'mulet') || e10s # On e10s, faking the app seems to be failing
[test_notification_noresend.html]
skip-if = (toolkit == 'gonk') # Mochitest on Gonk registers an app manifest that messes with the logic
+1
View File
@@ -21,4 +21,5 @@ interface MozInterAppMessagePort : EventTarget {
void close();
attribute EventHandler onmessage;
attribute EventHandler onclose;
};
+2 -2
View File
@@ -40,10 +40,10 @@ interface Location {
attribute USVString hash;
[Throws, UnsafeInPrerendering]
void assign(DOMString url);
void assign(USVString url);
[Throws, CrossOriginCallable, UnsafeInPrerendering]
void replace(DOMString url);
void replace(USVString url);
// XXXbz there is no forceget argument in the spec! See bug 1037721.
[Throws, UnsafeInPrerendering]
+16 -14
View File
@@ -63,24 +63,26 @@ dictionary MediaTrackConstraints : MediaTrackConstraintSet {
sequence<MediaTrackConstraintSet> advanced;
};
interface MediaStreamTrack {
[Exposed=Window]
interface MediaStreamTrack : EventTarget {
readonly attribute DOMString kind;
readonly attribute DOMString id;
readonly attribute DOMString label;
attribute boolean enabled;
// readonly attribute MediaStreamTrackState readyState;
// readonly attribute SourceTypeEnum sourceType;
// readonly attribute DOMString sourceId;
// attribute EventHandler onstarted;
// attribute EventHandler onmute;
// attribute EventHandler onunmute;
// readonly attribute boolean muted;
// attribute EventHandler onmute;
// attribute EventHandler onunmute;
// readonly attribute boolean _readonly;
// readonly attribute boolean remote;
// readonly attribute MediaStreamTrackState readyState;
// attribute EventHandler onended;
// any getConstraint (DOMString constraintName, optional boolean mandatory = false);
// void setConstraint (DOMString constraintName, any constraintValue, optional boolean mandatory = false);
// MediaTrackConstraints? constraints ();
// void applyConstraints (MediaTrackConstraints constraints);
// void prependConstraint (DOMString constraintName, any constraintValue);
// void appendConstraint (DOMString constraintName, any constraintValue);
// attribute EventHandler onoverconstrained;
// MediaStreamTrack clone ();
void stop ();
// MediaTrackCapabilities getCapabilities ();
// MediaTrackConstraints getConstraints ();
// MediaTrackSettings getSettings ();
[Throws]
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);
// attribute EventHandler onoverconstrained;
};
+2 -2
View File
@@ -9,7 +9,7 @@ enum MobilePreferredNetworkType {"wcdma/gsm", "gsm", "wcdma", "wcdma/gsm-auto",
"cdma/evdo", "cdma", "evdo",
"wcdma/gsm/cdma/evdo", "lte/cdma/evdo",
"lte/wcdma/gsm", "lte/wcdma/gsm/cdma/evdo",
"lte"};
"lte", "lte/wcdma"};
enum MobileRoamingMode {"home", "affiliated", "any"};
[Pref="dom.mobileconnection.enabled"]
@@ -190,7 +190,7 @@ interface MozMobileConnection : EventTarget
* result will be a string indicating the current preferred network type.
* The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
* 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
* 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
* 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo', 'lte' or 'lte/wcdma'.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
+3 -3
View File
@@ -14,15 +14,15 @@ dictionary NetworkStatsGetOptions
* Note that, these two options cannot be specified at the same time for now;
* others, an NS_ERROR_NOT_IMPLMENTED exception will be thrown.
*/
DOMString appManifestURL;
DOMString serviceType;
DOMString? appManifestURL = null;
DOMString serviceType = "";
/**
* If it is set as true, only the browsing traffic, which is generated from
* the mozbrowser iframe element within an app, is returned in result.
* If it is set as false or not set, the total traffic, which is generated
* from both the mozapp and mozbrowser iframe elements, is returned.
*/
boolean browsingTrafficOnly;
boolean browsingTrafficOnly = false;
};
dictionary NetworkStatsAlarmOptions
@@ -1,14 +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/. */
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "nsISupports.idl"
interface nsIDOMDOMRequest;
[scriptable, uuid(72c4e583-389d-4d1b-9424-702feabb6055)]
interface nsIDOMMozNetworkStatsManager : nsISupports
{
[NavigatorProperty="mozNetworkStats",
JSImplementation="@mozilla.org/networkStatsManager;1",
CheckAnyPermissions="networkstats-manage",
Pref="dom.mozNetworkStats.enabled"]
interface MozNetworkStatsManager {
/**
* Constants for known interface types.
*/
@@ -21,12 +21,12 @@ interface nsIDOMMozNetworkStatsManager : nsISupports
* If options is provided, per-app or per-system service usage will be
* retrieved; otherwise the target will be overall system usage.
*
* If success, the request result will be an nsIDOMMozNetworkStats object.
* If success, the request result will be an MozNetworkStats object.
*/
nsIDOMDOMRequest getSamples(in nsISupports network,
in jsval start,
in jsval end,
[optional] in jsval options /* NetworkStatsGetOptions */);
DOMRequest getSamples(MozNetworkStatsInterface network,
Date start,
Date end,
optional NetworkStatsGetOptions options);
/**
* Install an alarm on a network. The network must be in the return of
@@ -39,9 +39,9 @@ interface nsIDOMMozNetworkStatsManager : nsISupports
*
* If success, the |result| field of the DOMRequest keeps the alarm Id.
*/
nsIDOMDOMRequest addAlarm(in nsISupports network,
in long long threshold,
[optional] in jsval options /* NetworkStatsAlarmOptions */);
DOMRequest addAlarm(MozNetworkStatsInterface network,
long long threshold,
optional NetworkStatsAlarmOptions options);
/**
* Obtain all alarms for those networks returned by getAvailableNetworks().
@@ -55,33 +55,33 @@ interface nsIDOMMozNetworkStatsManager : nsISupports
* - threshold
* - data
*/
nsIDOMDOMRequest getAllAlarms([optional] in nsISupports network);
DOMRequest getAllAlarms(optional MozNetworkStatsInterface network);
/**
* Remove all network alarms. If an |alarmId| is provided, then only that
* alarm is removed.
*/
nsIDOMDOMRequest removeAlarms([optional] in long alarmId);
DOMRequest removeAlarms(optional unsigned long alarmId = 0);
/**
* Remove all stats related with the provided network from DB.
*/
nsIDOMDOMRequest clearStats(in nsISupports network);
DOMRequest clearStats(MozNetworkStatsInterface network);
/**
* Remove all stats in the database.
*/
nsIDOMDOMRequest clearAllStats();
DOMRequest clearAllStats();
/**
* Return available networks that used to be saved in the database.
*/
nsIDOMDOMRequest getAvailableNetworks(); // array of MozNetworkStatsInterface.
DOMRequest getAvailableNetworks(); // array of MozNetworkStatsInterface.
/**
* Return available service types that used to be saved in the database.
*/
nsIDOMDOMRequest getAvailableServiceTypes(); // array of string.
DOMRequest getAvailableServiceTypes(); // array of string.
/**
* Minimum time in milliseconds between samples stored in the database.
+8 -6
View File
@@ -54,8 +54,10 @@ interface NavigatorID {
[NoInterfaceObject, Exposed=(Window,Worker)]
interface NavigatorLanguage {
// These 2 values are cached. They are updated when pref
// intl.accept_languages is changed.
// These two attributes are cached because this interface is also implemented
// by Workernavigator and this way we don't have to go back to the
// main-thread from the worker thread anytime we need to retrieve them. They
// are updated when pref intl.accept_languages is changed.
[Pure, Cached]
readonly attribute DOMString? language;
@@ -98,7 +100,7 @@ interface NavigatorFeatures {
};
partial interface Navigator {
[Throws, Pref="dom.permissions.enabled"]
[Throws]
readonly attribute Permissions permissions;
};
@@ -188,7 +190,7 @@ Navigator implements NavigatorMobileId;
// nsIDOMNavigator
partial interface Navigator {
[Throws]
[Throws, Constant, Cached]
readonly attribute DOMString oscpu;
// WebKit/Blink support this; Trident/Presto do not.
readonly attribute DOMString vendor;
@@ -198,7 +200,7 @@ partial interface Navigator {
readonly attribute DOMString productSub;
// WebKit/Blink/Trident/Presto support this.
readonly attribute boolean cookieEnabled;
[Throws]
[Throws, Constant, Cached]
readonly attribute DOMString buildID;
[Throws, CheckAnyPermissions="power", UnsafeInPrerendering]
readonly attribute MozPowerManager mozPower;
@@ -418,7 +420,7 @@ partial interface Navigator {
// Service Workers/Navigation Controllers
partial interface Navigator {
[Func="ServiceWorkerContainer::IsEnabled"]
[Func="ServiceWorkerContainer::IsEnabled", SameObject]
readonly attribute ServiceWorkerContainer serviceWorker;
};
+1 -1
View File
@@ -11,7 +11,7 @@
* related or neighboring rights to this work.
*/
[Constructor(DOMString type, optional NotificationEventInit eventInitDict),
[Constructor(DOMString type, NotificationEventInit eventInitDict),
Exposed=ServiceWorker,Func="mozilla::dom::Notification::PrefEnabled"]
interface NotificationEvent : ExtendableEvent {
readonly attribute Notification notification;
+1 -2
View File
@@ -13,8 +13,7 @@ enum PermissionState {
"prompt"
};
[Exposed=(Window),
Pref="dom.permissions.enabled"]
[Exposed=(Window)]
interface PermissionStatus : EventTarget {
readonly attribute PermissionState state;
attribute EventHandler onchange;
+1 -2
View File
@@ -22,8 +22,7 @@ dictionary PushPermissionDescriptor : PermissionDescriptor {
boolean userVisible = false;
};
[Exposed=(Window),
Pref="dom.permissions.enabled"]
[Exposed=(Window)]
interface Permissions {
[Throws]
Promise<PermissionStatus> query(object permission);
@@ -0,0 +1,36 @@
/* -*- 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
* http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
enum SpeechSynthesisErrorCode {
"canceled",
"interrupted",
"audio-busy",
"audio-hardware",
"network",
"synthesis-unavailable",
"synthesis-failed",
"language-unavailable",
"voice-unavailable",
"text-too-long",
"invalid-argument",
};
[Constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict),
Pref="media.webspeech.synth.enabled"]
interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent {
readonly attribute SpeechSynthesisErrorCode error;
};
dictionary SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit
{
required SpeechSynthesisErrorCode error;
};
+3 -1
View File
@@ -10,10 +10,11 @@
* liability, trademark and document use rules apply.
*/
[Constructor(DOMString type, optional SpeechSynthesisEventInit eventInitDict),
[Constructor(DOMString type, SpeechSynthesisEventInit eventInitDict),
Pref="media.webspeech.synth.enabled"]
interface SpeechSynthesisEvent : Event
{
readonly attribute SpeechSynthesisUtterance utterance;
readonly attribute unsigned long charIndex;
readonly attribute float elapsedTime;
readonly attribute DOMString? name;
@@ -21,6 +22,7 @@ interface SpeechSynthesisEvent : Event
dictionary SpeechSynthesisEventInit : EventInit
{
required SpeechSynthesisUtterance utterance;
unsigned long charIndex = 0;
float elapsedTime = 0;
DOMString name = "";
+1
View File
@@ -25,6 +25,7 @@ interface TreeColumn {
const short TYPE_TEXT = 1;
const short TYPE_CHECKBOX = 2;
const short TYPE_PROGRESSMETER = 3;
const short TYPE_PASSWORD = 4;
readonly attribute short type;
TreeColumn? getNext();
-5
View File
@@ -236,7 +236,6 @@ interface WebGL2RenderingContext : WebGLRenderingContext
const GLenum RGB8_SNORM = 0x8F96;
const GLenum RGBA8_SNORM = 0x8F97;
const GLenum SIGNED_NORMALIZED = 0x8F9C;
const GLenum PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69;
const GLenum COPY_READ_BUFFER = 0x8F36;
const GLenum COPY_WRITE_BUFFER = 0x8F37;
const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
@@ -289,10 +288,6 @@ interface WebGL2RenderingContext : WebGLRenderingContext
const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
const GLenum SAMPLER_BINDING = 0x8919;
const GLenum RGB10_A2UI = 0x906F;
const GLenum TEXTURE_SWIZZLE_R = 0x8E42;
const GLenum TEXTURE_SWIZZLE_G = 0x8E43;
const GLenum TEXTURE_SWIZZLE_B = 0x8E44;
const GLenum TEXTURE_SWIZZLE_A = 0x8E45;
const GLenum GREEN = 0x1904;
const GLenum BLUE = 0x1905;
const GLenum INT_2_10_10_10_REV = 0x8D9F;
+2 -2
View File
@@ -69,7 +69,7 @@ typedef any Transferable;
#ifdef HAVE_SIDEBAR
[Replaceable, Throws] readonly attribute External external;
#endif
[Throws] readonly attribute ApplicationCache applicationCache;
[Throws, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
// user prompts
[Throws, UnsafeInPrerendering] void alert();
@@ -269,7 +269,7 @@ Window implements WindowModal;
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
partial interface Window {
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled"]
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
readonly attribute CacheStorage caches;
};
+2 -2
View File
@@ -14,7 +14,7 @@
[Constructor(DOMString scriptURL),
Func="mozilla::dom::workers::WorkerPrivate::WorkerAvailable",
Exposed=(Window,Worker,System)]
Exposed=(Window,DedicatedWorker,SharedWorker,System)]
interface Worker : EventTarget {
void terminate();
@@ -28,6 +28,6 @@ Worker implements AbstractWorker;
[Constructor(DOMString scriptURL),
Func="mozilla::dom::workers::ChromeWorkerPrivate::WorkerAvailable",
Exposed=(Window,Worker,System)]
Exposed=(Window,DedicatedWorker,SharedWorker,System)]
interface ChromeWorker : Worker {
};
+1 -1
View File
@@ -40,7 +40,7 @@ partial interface WorkerGlobalScope {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
partial interface WorkerGlobalScope {
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled"]
[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
readonly attribute CacheStorage caches;
};
+1 -1
View File
@@ -54,7 +54,7 @@ dictionary MozXMLHttpRequestParameters
// c = new(window.ActiveXObject || XMLHttpRequest)("Microsoft.XMLHTTP")
// To handle that, we need a constructor that takes a string.
Constructor(DOMString ignored),
Exposed=(Window,Worker)]
Exposed=(Window,DedicatedWorker,SharedWorker)]
interface XMLHttpRequest : XMLHttpRequestEventTarget {
// event handler
attribute EventHandler onreadystatechange;
+1 -1
View File
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Exposed=(Window,Worker)]
[Exposed=(Window,DedicatedWorker,SharedWorker)]
interface XMLHttpRequestEventTarget : EventTarget {
// event handlers
[SetterThrows=Workers, GetterThrows=Workers]
+1 -1
View File
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Exposed=(Window,Worker)]
[Exposed=(Window,DedicatedWorker,SharedWorker)]
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget {
};
+10 -5
View File
@@ -32,7 +32,6 @@ WEBIDL_FILES = [
'AnonymousContent.webidl',
'AppInfo.webidl',
'AppNotificationServiceOptions.webidl',
'Apps.webidl',
'APZTestData.webidl',
'ArchiveReader.webidl',
'ArchiveRequest.webidl',
@@ -631,7 +630,7 @@ if CONFIG['MOZ_WEBRTC']:
'PeerConnectionImplEnums.webidl',
'PeerConnectionObserver.webidl',
'PeerConnectionObserverEnums.webidl',
'RTCCertificate.webidl',
'RTCCertificate.webidl',
'RTCConfiguration.webidl',
'RTCIceCandidate.webidl',
'RTCIdentityAssertion.webidl',
@@ -656,6 +655,7 @@ if CONFIG['MOZ_WEBSPEECH']:
'SpeechRecognitionResult.webidl',
'SpeechRecognitionResultList.webidl',
'SpeechSynthesis.webidl',
'SpeechSynthesisErrorEvent.webidl',
'SpeechSynthesisEvent.webidl',
'SpeechSynthesisUtterance.webidl',
'SpeechSynthesisVoice.webidl',
@@ -673,7 +673,6 @@ WEBIDL_FILES += [
'DeviceStorageChangeEvent.webidl',
'DOMTransactionEvent.webidl',
'HashChangeEvent.webidl',
'MozApplicationEvent.webidl',
'MozSettingsEvent.webidl',
'PageTransitionEvent.webidl',
'PopStateEvent.webidl',
@@ -751,6 +750,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
'MozNetworkStatsAlarm.webidl',
'MozNetworkStatsData.webidl',
'MozNetworkStatsInterface.webidl',
'MozNetworkStatsManager.webidl',
'MozSpeakerManager.webidl',
'MozWifiCapabilities.webidl',
'MozWifiManager.webidl',
@@ -795,7 +795,6 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'IccChangeEvent.webidl',
'ImageCaptureErrorEvent.webidl',
'MediaStreamEvent.webidl',
'MozApplicationEvent.webidl',
'MozCellBroadcastEvent.webidl',
'MozClirModeEvent.webidl',
'MozContactChangeEvent.webidl',
@@ -845,6 +844,7 @@ if CONFIG['MOZ_WEBRTC']:
if CONFIG['MOZ_WEBSPEECH']:
GENERATED_EVENTS_WEBIDL_FILES += [
'SpeechRecognitionEvent.webidl',
'SpeechSynthesisErrorEvent.webidl',
'SpeechSynthesisEvent.webidl',
]
@@ -906,5 +906,10 @@ if CONFIG['MOZ_PAY']:
if CONFIG['MOZ_B2G']:
WEBIDL_FILES += [
'Identity.webidl'
'Apps.webidl',
'Identity.webidl',
'MozApplicationEvent.webidl'
]
GENERATED_EVENTS_WEBIDL_FILES += [
'MozApplicationEvent.webidl'
]
@@ -190,12 +190,6 @@ var interfaceNamesInGlobalScope =
"TextDecoder",
// IMPORTANT: Do not change this list without review from a DOM peer!
"TextEncoder",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XMLHttpRequest",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XMLHttpRequestEventTarget",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XMLHttpRequestUpload",
// IMPORTANT: Do not change this list without review from a DOM peer!
"URL",
// IMPORTANT: Do not change this list without review from a DOM peer!
+3
View File
@@ -3,5 +3,8 @@ skip-if = buildapp == 'b2g'
support-files = channel_utils.js
[test_app_uninstall_cookies.html]
skip-if = buildapp != 'mulet'
[test_app_uninstall_permissions.html]
skip-if = buildapp != 'mulet'
[test_permissionmanager_app_isolation.html]
@@ -158,8 +158,7 @@ function checkCookie() {
gCurrentCookiesCount = getCookiesCount() - appCookiesCount;
// Not installed means not installed as native app.
navigator.mozApps.mgmt.getNotInstalled().onsuccess = function() {
navigator.mozApps.mgmt.getAll().onsuccess = function() {
for (i in this.result) {
var app = this.result[i];
if (app.manifestURL == gManifestURL) {
@@ -60,12 +60,17 @@ SimpleTest.registerCleanupFunction(() =>
var gManifestURL = "http://www.example.com/chrome/dom/tests/mochitest/webapps/apps/basic.webapp";
// Get the permission count before installing the app so we can compare it to
// the permission count after uninstalling the app.
var currentPermissionCount = getPermissionCountForApp(-1);
function onInstall() {
var testAppId = appsService.getAppLocalIdByManifestURL(gManifestURL);
is(getPermissionCountForApp(testAppId), 0, "App should have no permission");
var currentPermissionCount = getPermissionCountForApp(-1);
// PermissionsManager.installPermissions gets run during the install process,
// and it adds the "indexedDB" permission by default, so the app should have
// that permission.
is(getPermissionCountForApp(testAppId), 1, "App should have 1 permission");
var attrs = {appId: testAppId};
var principal = secMan.createCodebasePrincipal(ioService.newURI("http://www.example.com", null, null),
@@ -85,10 +90,9 @@ function onInstall() {
attrs);
permManager.addFromPrincipal(principal, "foobar", Ci.nsIPermissionManager.ALLOW_ACTION);
is(getPermissionCountForApp(testAppId), 5, "App should have 5 permissions");
is(getPermissionCountForApp(testAppId), 6, "App should have 6 permissions");
// Not installed means not installed as native app.
navigator.mozApps.mgmt.getNotInstalled().onsuccess = function() {
navigator.mozApps.mgmt.getAll().onsuccess = function() {
for (i in this.result) {
var app = this.result[i];
if (app.manifestURL == gManifestURL) {
+9
View File
@@ -0,0 +1,9 @@
========
Graphics
========
The graphics team's documentation is currently using doxygen. We're tracking the work to integrate it better at https://bugzilla.mozilla.org/show_bug.cgi?id=1150232.
For now you can read the graphics source code documentation here:
http://people.mozilla.org/~bgirard/doxygen/gfx/
+1
View File
@@ -31,3 +31,4 @@ if CONFIG['ENABLE_TESTS']:
TEST_DIRS += ['tests']
SPHINX_TREES['gfx'] = 'docs'
+26 -17
View File
@@ -81,7 +81,7 @@ private:
class StubPropertyProvider : public gfxTextRun::PropertyProvider {
public:
virtual void GetHyphenationBreaks(uint32_t aStart, uint32_t aLength,
virtual void GetHyphenationBreaks(gfxTextRun::Range aRange,
bool* aBreakBefore) {
NS_ERROR("This shouldn't be called because we never call BreakAndMeasureText");
}
@@ -101,8 +101,7 @@ public:
NS_ERROR("This shouldn't be called because we never enable hyphens");
return 60;
}
virtual void GetSpacing(uint32_t aStart, uint32_t aLength,
Spacing* aSpacing) {
virtual void GetSpacing(gfxTextRun::Range aRange, Spacing* aSpacing) {
NS_ERROR("This shouldn't be called because we never enable spacing");
}
};
@@ -325,8 +324,11 @@ nsFontMetrics::GetWidth(const char* aString, uint32_t aLength,
StubPropertyProvider provider;
AutoTextRun textRun(this, aDrawTarget, aString, aLength);
return textRun.get() ?
NSToCoordRound(textRun->GetAdvanceWidth(0, aLength, &provider)) : 0;
if (textRun.get()) {
return NSToCoordRound(
textRun->GetAdvanceWidth(Range(0, aLength), &provider));
}
return 0;
}
nscoord
@@ -341,8 +343,11 @@ nsFontMetrics::GetWidth(const char16_t* aString, uint32_t aLength,
StubPropertyProvider provider;
AutoTextRun textRun(this, aDrawTarget, aString, aLength);
return textRun.get() ?
NSToCoordRound(textRun->GetAdvanceWidth(0, aLength, &provider)) : 0;
if (textRun.get()) {
return NSToCoordRound(
textRun->GetAdvanceWidth(Range(0, aLength), &provider));
}
return 0;
}
// Draw a string using this font handle on the surface passed in.
@@ -360,15 +365,17 @@ nsFontMetrics::DrawString(const char *aString, uint32_t aLength,
return;
}
gfxPoint pt(aX, aY);
Range range(0, aLength);
if (mTextRunRTL) {
if (mVertical) {
pt.y += textRun->GetAdvanceWidth(0, aLength, &provider);
pt.y += textRun->GetAdvanceWidth(range, &provider);
} else {
pt.x += textRun->GetAdvanceWidth(0, aLength, &provider);
pt.x += textRun->GetAdvanceWidth(range, &provider);
}
}
textRun->Draw(aContext->ThebesContext(), pt, DrawMode::GLYPH_FILL, 0, aLength,
&provider, nullptr, nullptr);
gfxTextRun::DrawParams params(aContext->ThebesContext());
params.provider = &provider;
textRun->Draw(range, pt, params);
}
void
@@ -386,15 +393,17 @@ nsFontMetrics::DrawString(const char16_t* aString, uint32_t aLength,
return;
}
gfxPoint pt(aX, aY);
Range range(0, aLength);
if (mTextRunRTL) {
if (mVertical) {
pt.y += textRun->GetAdvanceWidth(0, aLength, &provider);
pt.y += textRun->GetAdvanceWidth(range, &provider);
} else {
pt.x += textRun->GetAdvanceWidth(0, aLength, &provider);
pt.x += textRun->GetAdvanceWidth(range, &provider);
}
}
textRun->Draw(aContext->ThebesContext(), pt, DrawMode::GLYPH_FILL, 0, aLength,
&provider, nullptr, nullptr);
gfxTextRun::DrawParams params(aContext->ThebesContext());
params.provider = &provider;
textRun->Draw(range, pt, params);
}
static nsBoundingMetrics
@@ -409,8 +418,8 @@ GetTextBoundingMetrics(nsFontMetrics* aMetrics, const char16_t* aString,
AutoTextRun textRun(aMetrics, aDrawTarget, aString, aLength);
nsBoundingMetrics m;
if (textRun.get()) {
gfxTextRun::Metrics theMetrics =
textRun->MeasureText(0, aLength, aType, aDrawTarget, &provider);
gfxTextRun::Metrics theMetrics = textRun->MeasureText(
gfxTextRun::Range(0, aLength), aType, aDrawTarget, &provider);
m.leftBearing = NSToCoordFloor( theMetrics.mBoundingBox.X());
m.rightBearing = NSToCoordCeil( theMetrics.mBoundingBox.XMost());
+1
View File
@@ -46,6 +46,7 @@ struct nsBoundingMetrics;
class nsFontMetrics final
{
public:
typedef gfxTextRun::Range Range;
typedef mozilla::gfx::DrawTarget DrawTarget;
nsFontMetrics();
-2
View File
@@ -546,8 +546,6 @@ gfxDWriteFont::GetCairoScaledFont()
cairo_dwrite_scaled_font_allow_manual_show_glyphs(mScaledFont,
mAllowManualShowGlyphs);
gfxDWriteFontEntry *fe =
static_cast<gfxDWriteFontEntry*>(mFontEntry.get());
cairo_dwrite_scaled_font_set_force_GDI_classic(mScaledFont,
GetForceGDIClassic());
}
-126
View File
@@ -184,132 +184,6 @@ MapFcWidth(int aFcWidth)
return NS_FONT_STRETCH_ULTRA_EXPANDED;
}
// mapping of moz lang groups ==> default lang
struct MozLangGroupData {
nsIAtom* const& mozLangGroup;
const char *defaultLang;
};
const MozLangGroupData MozLangGroups[] = {
{ nsGkAtoms::x_western, "en" },
{ nsGkAtoms::x_cyrillic, "ru" },
{ nsGkAtoms::x_devanagari, "hi" },
{ nsGkAtoms::x_tamil, "ta" },
{ nsGkAtoms::x_armn, "hy" },
{ nsGkAtoms::x_beng, "bn" },
{ nsGkAtoms::x_cans, "iu" },
{ nsGkAtoms::x_ethi, "am" },
{ nsGkAtoms::x_geor, "ka" },
{ nsGkAtoms::x_gujr, "gu" },
{ nsGkAtoms::x_guru, "pa" },
{ nsGkAtoms::x_khmr, "km" },
{ nsGkAtoms::x_knda, "kn" },
{ nsGkAtoms::x_mlym, "ml" },
{ nsGkAtoms::x_orya, "or" },
{ nsGkAtoms::x_sinh, "si" },
{ nsGkAtoms::x_tamil, "ta" },
{ nsGkAtoms::x_telu, "te" },
{ nsGkAtoms::x_tibt, "bo" },
{ nsGkAtoms::Unicode, 0 }
};
bool
gfxFcPlatformFontList::TryLangForGroup(const nsACString& aOSLang,
nsIAtom* aLangGroup,
nsACString& aFcLang)
{
// Truncate at '.' or '@' from aOSLang, and convert '_' to '-'.
// aOSLang is in the form "language[_territory][.codeset][@modifier]".
// fontconfig takes languages in the form "language-territory".
// nsILanguageAtomService takes languages in the form language-subtag,
// where subtag may be a territory. fontconfig and nsILanguageAtomService
// handle case-conversion for us.
const char *pos, *end;
aOSLang.BeginReading(pos);
aOSLang.EndReading(end);
aFcLang.Truncate();
while (pos < end) {
switch (*pos) {
case '.':
case '@':
end = pos;
break;
case '_':
aFcLang.Append('-');
break;
default:
aFcLang.Append(*pos);
}
++pos;
}
nsILanguageAtomService* langService = GetLangService();
nsIAtom *atom = langService->LookupLanguage(aFcLang);
return atom == aLangGroup;
}
void
gfxFcPlatformFontList::GetSampleLangForGroup(nsIAtom* aLanguage,
nsACString& aLangStr)
{
aLangStr.Truncate();
if (!aLanguage) {
return;
}
// set up lang string
const MozLangGroupData *mozLangGroup = nullptr;
// -- look it up in the list of moz lang groups
for (unsigned int i = 0; i < ArrayLength(MozLangGroups); ++i) {
if (aLanguage == MozLangGroups[i].mozLangGroup) {
mozLangGroup = &MozLangGroups[i];
break;
}
}
// -- not a mozilla lang group? Just return the BCP47 string
// representation of the lang group
if (!mozLangGroup) {
// Not a special mozilla language group.
// Use aLanguage as a language code.
aLanguage->ToUTF8String(aLangStr);
return;
}
// -- check the environment for the user's preferred language that
// corresponds to this mozilla lang group.
const char *languages = getenv("LANGUAGE");
if (languages) {
const char separator = ':';
for (const char *pos = languages; true; ++pos) {
if (*pos == '\0' || *pos == separator) {
if (languages < pos &&
TryLangForGroup(Substring(languages, pos),
aLanguage, aLangStr))
return;
if (*pos == '\0')
break;
languages = pos + 1;
}
}
}
const char *ctype = setlocale(LC_CTYPE, nullptr);
if (ctype &&
TryLangForGroup(nsDependentCString(ctype), aLanguage, aLangStr)) {
return;
}
if (mozLangGroup->defaultLang) {
aLangStr.Assign(mozLangGroup->defaultLang);
} else {
aLangStr.Truncate();
}
}
gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
FcPattern* aFontPattern)
: gfxFontEntry(aFaceName), mFontPattern(aFontPattern),
-6
View File
@@ -245,8 +245,6 @@ public:
mGenericMappings.Clear();
}
void GetSampleLangForGroup(nsIAtom* aLanguage, nsACString& aLangStr);
static FT_Library GetFTLibrary();
protected:
@@ -263,10 +261,6 @@ protected:
// are all pref font settings set to use fontconfig generics?
bool PrefFontListsUseOnlyGenerics();
// helper method for finding an appropriate fontconfig language
bool TryLangForGroup(const nsACString& aOSLang, nsIAtom* aLangGroup,
nsACString& aFcLang);
static void CheckFontUpdates(nsITimer *aTimer, void *aThis);
#ifdef MOZ_BUNDLED_FONTS
+5 -4
View File
@@ -1943,7 +1943,8 @@ gfxFont::DrawEmphasisMarks(gfxTextRun* aShapedText, gfxPoint* aPt,
const EmphasisMarkDrawParams& aParams)
{
gfxFloat& inlineCoord = aParams.isVertical ? aPt->y : aPt->x;
uint32_t markLength = aParams.mark->GetLength();
gfxTextRun::Range markRange(aParams.mark);
gfxTextRun::DrawParams params(aParams.context);
gfxFloat clusterStart = -std::numeric_limits<gfxFloat>::infinity();
bool shouldDrawEmphasisMark = false;
@@ -1965,8 +1966,7 @@ gfxFont::DrawEmphasisMarks(gfxTextRun* aShapedText, gfxPoint* aPt,
// Move the coord backward to get the needed start point.
gfxFloat delta = (clusterAdvance + aParams.advance) / 2;
inlineCoord -= delta;
aParams.mark->Draw(aParams.context, *aPt, DrawMode::GLYPH_FILL,
0, markLength, nullptr, nullptr, nullptr);
aParams.mark->Draw(markRange, *aPt, params);
inlineCoord += delta;
shouldDrawEmphasisMark = false;
}
@@ -3198,7 +3198,8 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
MergeCharactersInTextRun(mergedRun, tempRun,
charsToMergeArray.Elements(),
deletedCharsArray.Elements());
aTextRun->CopyGlyphDataFrom(mergedRun, 0, runLength,
gfxTextRun::Range runRange(0, runLength);
aTextRun->CopyGlyphDataFrom(mergedRun, runRange,
aOffset + runStart);
}
} else {
+17 -17
View File
@@ -388,7 +388,7 @@ gfxFontUtils::ReadCMAPTableFormat14(const uint8_t *aBuf, uint32_t aLength,
#define acceptableUCS4Encoding(p, e, k) \
(((p) == PLATFORM_ID_MICROSOFT && (e) == EncodingIDUCS4ForMicrosoftPlatform) && (k) != 12 || \
((p) == PLATFORM_ID_UNICODE && \
((e) == EncodingIDDefaultForUnicodePlatform || (e) >= EncodingIDUCS4ForUnicodePlatform)))
((e) != EncodingIDUVSForUnicodePlatform)))
#else
#define acceptableFormat4(p,e,k) ((p) == PLATFORM_ID_MICROSOFT && (e) == EncodingIDMicrosoft)
@@ -960,19 +960,19 @@ gfxFontUtils::DetermineFontDataType(const uint8_t *aFontData, uint32_t aFontData
return GFX_USERFONT_UNKNOWN;
}
/* static */
TableDirEntry*
gfxFontUtils::FindTableDirEntry(const void* aFontData, uint32_t aTableTag)
{
const SFNTHeader* header =
reinterpret_cast<const SFNTHeader*>(aFontData);
const TableDirEntry* dir =
reinterpret_cast<const TableDirEntry*>(header + 1);
return static_cast<TableDirEntry*>
(bsearch(&aTableTag, dir, uint16_t(header->numTables),
sizeof(TableDirEntry), DirEntryCmp));
}
/* static */
TableDirEntry*
gfxFontUtils::FindTableDirEntry(const void* aFontData, uint32_t aTableTag)
{
const SFNTHeader* header =
reinterpret_cast<const SFNTHeader*>(aFontData);
const TableDirEntry* dir =
reinterpret_cast<const TableDirEntry*>(header + 1);
return static_cast<TableDirEntry*>
(bsearch(&aTableTag, dir, uint16_t(header->numTables),
sizeof(TableDirEntry), DirEntryCmp));
}
nsresult
gfxFontUtils::RenameFont(const nsAString& aName, const uint8_t *aFontData,
@@ -1057,9 +1057,9 @@ gfxFontUtils::RenameFont(const nsAString& aName, const uint8_t *aFontData,
SFNTHeader *sfntHeader = reinterpret_cast<SFNTHeader*>(newFontData);
// table directory entries begin immediately following SFNT header
TableDirEntry *dirEntry =
FindTableDirEntry(newFontData, TRUETYPE_TAG('n','a','m','e'));
// function only called if font validates, so this should always be true
TableDirEntry *dirEntry =
FindTableDirEntry(newFontData, TRUETYPE_TAG('n','a','m','e'));
// function only called if font validates, so this should always be true
MOZ_ASSERT(dirEntry, "attempt to rename font with no name table");
uint32_t numTables = sfntHeader->numTables;
+12 -13
View File
@@ -98,7 +98,6 @@ public:
bool hasBlocksInRange = false;
endBlock = aEnd >> BLOCK_INDEX_SHIFT;
blockIndex = startBlock;
for (blockIndex = startBlock; blockIndex <= endBlock; blockIndex++) {
if (blockIndex < blockLen && mBlocks[blockIndex])
hasBlocksInRange = true;
@@ -856,18 +855,18 @@ public:
GetFamilyNameFromTable(hb_blob_t *aNameTable,
nsAString& aFamilyName);
// Find the table directory entry for a given table tag, in a (validated)
// buffer of 'sfnt' data. Returns null if the tag is not present.
static mozilla::TableDirEntry*
FindTableDirEntry(const void* aFontData, uint32_t aTableTag);
// Return a blob that wraps a table found within a buffer of font data.
// The blob does NOT own its data; caller guarantees that the buffer
// will remain valid at least as long as the blob.
// Returns null if the specified table is not found.
// This method assumes aFontData is valid 'sfnt' data; before using this,
// caller is responsible to do any sanitization/validation necessary.
static hb_blob_t*
// Find the table directory entry for a given table tag, in a (validated)
// buffer of 'sfnt' data. Returns null if the tag is not present.
static mozilla::TableDirEntry*
FindTableDirEntry(const void* aFontData, uint32_t aTableTag);
// Return a blob that wraps a table found within a buffer of font data.
// The blob does NOT own its data; caller guarantees that the buffer
// will remain valid at least as long as the blob.
// Returns null if the specified table is not found.
// This method assumes aFontData is valid 'sfnt' data; before using this,
// caller is responsible to do any sanitization/validation necessary.
static hb_blob_t*
GetTableFromFontData(const void* aFontData, uint32_t aTableTag);
// create a new name table and build a new font with that name table

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