Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2015-04-27 12:41:39 +02:00
commit f46f633c46
268 changed files with 3972 additions and 1824 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
@ -137,7 +137,7 @@
<project name="kernel/common" path="kernel" revision="65d2a18bd4ab0f1ed36a76c1e3c4f9ae98f345b9"/>
<project name="platform/system/core" path="system/core" revision="7992618bd4ee33ce96897675a5c0a9b619122f13"/>
<project name="u-boot" path="u-boot" revision="f1502910977ac88f43da7bf9277c3523ad4b0b2f"/>
<project name="vendor/sprd/gps" path="vendor/sprd/gps" revision="4c59900937dc2e978b7b14b7f1ea617e3d5d550e"/>
<project name="vendor/sprd/gps" path="vendor/sprd/gps" revision="7d6e1269be7186b2073fa568958b357826692c4b"/>
<project name="vendor/sprd/open-source" path="vendor/sprd/open-source" revision="e503b1d14d7fdee532b8f391407299da193c1b2d"/>
<project name="vendor/sprd/partner" path="vendor/sprd/partner" revision="8649c7145972251af11b0639997edfecabfc7c2e"/>
<project name="vendor/sprd/proprietories" path="vendor/sprd/proprietories" revision="d2466593022f7078aaaf69026adf3367c2adb7bb"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9a9797062c6001d6346504161c51187a2968466b"/>

View File

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9a9797062c6001d6346504161c51187a2968466b"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

View File

@ -17,10 +17,10 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "b4c949cdc780893897c9b45c1adea46e2eb694ff",
"git_revision": "581df5e5cad323e811fffef69553278c1fb695a4",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "70ab08a2dadc6cf89a4d9579c3696517faf807b8",
"revision": "ff5f26779cfb9e131a652bbaef13eb5f36ace6de",
"repo_path": "integration/gaia-central"
}

View File

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b4c949cdc780893897c9b45c1adea46e2eb694ff"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="581df5e5cad323e811fffef69553278c1fb695a4"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="bdd03caf084e1b9279155bd232bc718a38c47cbc"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>

View File

@ -743,7 +743,6 @@
#endif
@RESPATH@/@PREF_DIR@/channel-prefs.js
@RESPATH@/greprefs.js
@RESPATH@/defaults/autoconfig/platform.js
@RESPATH@/defaults/autoconfig/prefcalls.js
@RESPATH@/defaults/profile/prefs.js

View File

@ -1535,6 +1535,9 @@ pref("devtools.webconsole.filter.info", true);
pref("devtools.webconsole.filter.log", true);
pref("devtools.webconsole.filter.secerror", true);
pref("devtools.webconsole.filter.secwarn", true);
pref("devtools.webconsole.filter.serviceworkers", false);
pref("devtools.webconsole.filter.sharedworkers", false);
pref("devtools.webconsole.filter.windowlessworkers", false);
// Remember the Browser Console filters
pref("devtools.browserconsole.filter.network", true);
@ -1553,6 +1556,9 @@ pref("devtools.browserconsole.filter.info", true);
pref("devtools.browserconsole.filter.log", true);
pref("devtools.browserconsole.filter.secerror", true);
pref("devtools.browserconsole.filter.secwarn", true);
pref("devtools.browserconsole.filter.serviceworkers", true);
pref("devtools.browserconsole.filter.sharedworkers", true);
pref("devtools.browserconsole.filter.windowlessworkers", true);
// Text size in the Web Console. Use 0 for the system default size.
pref("devtools.webconsole.fontSize", 0);

View File

@ -1,6 +1,7 @@
/* Tests for correct behaviour of getEffectiveHost on identity handler */
function test() {
waitForExplicitFinish();
requestLongerTimeout(2);
ok(gIdentityHandler, "gIdentityHandler should exist");

View File

@ -76,6 +76,7 @@ support-files =
test-console-extras.html
test-console-replaced-api.html
test-console.html
test-console-workers.html
test-console-table.html
test-console-output-02.html
test-console-output-03.html
@ -317,6 +318,7 @@ skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
[browser_webconsole_completion.js]
[browser_webconsole_console_extras.js]
[browser_webconsole_console_logging_api.js]
[browser_webconsole_console_logging_workers_api.js]
[browser_webconsole_count.js]
[browser_webconsole_dont_navigate_on_doubleclick.js]
[browser_webconsole_execution_scope.js]

View File

@ -22,7 +22,10 @@ const prefs = {
"error",
"warn",
"info",
"log"
"log",
"serviceworkers",
"sharedworkers",
"windowlessworkers"
]
};

View File

@ -0,0 +1,44 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the basic console.log()-style APIs and filtering work for sharedWorkers
"use strict";
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-workers.html";
function pushPrefEnv()
{
let deferred = promise.defer();
let options = {'set': [["dom.workers.sharedWorkers.enabled", true]]};
SpecialPowers.pushPrefEnv(options, deferred.resolve);
return deferred.promise;
}
let test = asyncTest(function*() {
yield pushPrefEnv();
yield loadTab(TEST_URI);
let hud = yield openConsole();
yield waitForMessages({
webconsole: hud,
messages: [{
text: "foo-bar-shared-worker"
}],
});
hud.setFilterState('sharedworkers', false);
is(hud.outputNode.querySelectorAll(".filtered-by-type").length, 1,
"1 message hidden for sharedworkers (logging turned off)")
hud.setFilterState('sharedworkers', true);
is(hud.outputNode.querySelectorAll(".filtered-by-type").length, 0,
"1 message shown for sharedworkers (logging turned on)")
hud.setFilterState('sharedworkers', false);
hud.jsterm.clearOutput(true);
});

View File

@ -0,0 +1,13 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US"><head>
<meta charset="utf-8">
<title>Console test</title>
</head>
<body>
<script type="text/javascript">
var sw = new SharedWorker('data:application/javascript,console.log("foo-bar-shared-worker");');
</script>
</body>
</html>

View File

@ -8,7 +8,7 @@
const {Cc, Ci, Cu} = require("chrome");
let WebConsoleUtils = require("devtools/toolkit/webconsole/utils").Utils;
const {Utils: WebConsoleUtils, CONSOLE_WORKER_IDS} = require("devtools/toolkit/webconsole/utils");
loader.lazyServiceGetter(this, "clipboardHelper",
"@mozilla.org/widget/clipboardhelper;1",
@ -138,6 +138,10 @@ const LEVELS = {
count: SEVERITY_LOG
};
// This array contains the prefKey for the workers and it must keep them in the
// same order as CONSOLE_WORKER_IDS
const WORKERTYPES_PREFKEYS = [ 'sharedworkers', 'serviceworkers', 'windowlessworkers' ];
// The lowest HTTP response code (inclusive) that is considered an error.
const MIN_HTTP_ERROR_CODE = 400;
// The highest HTTP response code (inclusive) that is considered an error.
@ -649,7 +653,8 @@ WebConsoleFrame.prototype = {
{
let prefs = ["network", "networkinfo", "csserror", "cssparser", "csslog",
"exception", "jswarn", "jslog", "error", "info", "warn", "log",
"secerror", "secwarn", "netwarn", "netxhr"];
"secerror", "secwarn", "netwarn", "netxhr", "sharedworkers",
"serviceworkers", "windowlessworkers"];
for (let pref of prefs) {
this.filterPrefs[pref] = Services.prefs
.getBoolPref(this._filterPrefsPrefix + pref);
@ -1026,8 +1031,11 @@ WebConsoleFrame.prototype = {
// (filter="error", filter="cssparser", etc.) and add or remove the
// "filtered-by-type" class, which turns on or off the display.
let attribute = WORKERTYPES_PREFKEYS.indexOf(aPrefKey) == -1
? 'filter' : 'workerType';
let xpath = ".//*[contains(@class, 'message') and " +
"@filter='" + aPrefKey + "']";
"@" + attribute + "='" + aPrefKey + "']";
let result = doc.evaluate(xpath, outputNode, null,
Ci.nsIDOMXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (let i = 0; i < result.snapshotLength; i++) {
@ -1088,6 +1096,12 @@ WebConsoleFrame.prototype = {
isFiltered = true;
}
// Filter by worker type
if ("workerType" in aNode && !this.getFilterState(aNode.workerType)) {
aNode.classList.add("filtered-by-type");
isFiltered = true;
}
// Filter on the search string.
let search = this.filterBox.value;
let text = aNode.clipboardText;
@ -1365,6 +1379,12 @@ WebConsoleFrame.prototype = {
}
}
let workerTypeID = CONSOLE_WORKER_IDS.indexOf(aMessage.workerType);
if (workerTypeID != -1) {
node.workerType = WORKERTYPES_PREFKEYS[workerTypeID];
node.setAttribute('workerType', WORKERTYPES_PREFKEYS[workerTypeID]);
}
return node;
},

View File

@ -161,6 +161,13 @@ function goUpdateConsoleCommands() {
prefKey="info"/>
<menuitem label="&btnConsoleLog;" type="checkbox" autocheck="false"
prefKey="log"/>
<menuseparator />
<menuitem label="&btnConsoleSharedWorkers;" type="checkbox"
autocheck="false" prefKey="sharedworkers"/>
<menuitem label="&btnConsoleServiceWorkers;" type="checkbox"
autocheck="false" prefKey="serviceworkers"/>
<menuitem label="&btnConsoleWindowlessWorkers;" type="checkbox"
autocheck="false" prefKey="windowlessworkers"/>
</menupopup>
</toolbarbutton>
</hbox>

View File

@ -698,7 +698,6 @@
@RESPATH@/browser/@PREF_DIR@/firefox.js
@RESPATH@/browser/@PREF_DIR@/firefox-branding.js
@RESPATH@/greprefs.js
@RESPATH@/defaults/autoconfig/platform.js
@RESPATH@/defaults/autoconfig/prefcalls.js
@RESPATH@/browser/defaults/profile/prefs.js

View File

@ -72,6 +72,8 @@ InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
SetOverwrite on
; serviceinstall.cpp also uses this key, in case the path is changed, update
; there too.
!define MaintUninstallKey \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"

View File

@ -76,6 +76,16 @@
<!ENTITY btnConsoleXhr "XHR">
<!ENTITY btnConsoleReflows "Reflows">
<!-- LOCALIZATION NODE (btnConsoleSharedWorkers) the term "Shared Workers"
- should not be translated. -->
<!ENTITY btnConsoleSharedWorkers "Shared Workers">
<!-- LOCALIZATION NODE (btnConsoleServiceWorkers) the term "Service Workers"
- should not be translated. -->
<!ENTITY btnConsoleServiceWorkers "Service Workers">
<!-- LOCALIZATION NODE (btnConsoleWindowlessWorkers) the term "Workers"
- should not be translated. -->
<!ENTITY btnConsoleWindowlessWorkers "Add-on or Chrome Workers">
<!ENTITY filterOutput.placeholder "Filter output">
<!ENTITY btnClear.label "Clear">
<!ENTITY btnClear.tooltip "Clear the Web Console output">

View File

@ -401,6 +401,16 @@ def environment(xrePath, env=None, crashreporter=True, debugger=False, dmdPath=N
else:
log.info(message)
tsan = bool(mozinfo.info.get("tsan"))
if tsan and mozinfo.isLinux:
# Symbolizer support.
llvmsym = os.path.join(xrePath, "llvm-symbolizer")
if os.path.isfile(llvmsym):
env["TSAN_OPTIONS"] = "external_symbolizer_path=%s" % llvmsym
log.info("INFO | runtests.py | TSan using symbolizer at %s" % llvmsym)
else:
log.info("TEST-UNEXPECTED-FAIL | runtests.py | Failed to find TSan symbolizer at %s" % llvmsym)
return env
def dumpScreen(utilityPath):

View File

@ -44,6 +44,7 @@ gyp_vars = {
'moz_widget_toolkit_gonk': 0,
'moz_webrtc_omx': 0,
'moz_webrtc_mediacodec': 0,
# (for vp8) chromium sets to 0 also
'use_temporal_layers': 0,
@ -80,6 +81,7 @@ elif os == 'Android':
else:
gyp_vars.update(
gtest_target_type='executable',
moz_webrtc_mediacodec=1,
android_toolchain=CONFIG['ANDROID_TOOLCHAIN'],
)

View File

@ -1170,14 +1170,6 @@ endif #} XPT_NAME
################################################################################
# Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
ifneq (,$(filter %.js,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS)))
ifeq (,$(filter %.manifest,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS)))
ifndef NO_JS_MANIFEST
$(error .js component without matching .manifest. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0)
endif
endif
endif
ifdef EXTRA_COMPONENTS
misc:: $(EXTRA_COMPONENTS)
ifndef NO_DIST_INSTALL

View File

@ -158,7 +158,7 @@ class nsDocShell final
friend class nsDSURIContentListener;
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(nsDocShell)
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(nsDocShell)
// Object Management
nsDocShell();

View File

@ -32,6 +32,25 @@ Animation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
return dom::AnimationBinding::Wrap(aCx, this, aGivenProto);
}
// ---------------------------------------------------------------------------
//
// Animation interface:
//
// ---------------------------------------------------------------------------
void
Animation::SetEffect(KeyframeEffectReadonly* aEffect)
{
if (mEffect) {
mEffect->SetParentTime(Nullable<TimeDuration>());
}
mEffect = aEffect;
if (mEffect) {
mEffect->SetParentTime(GetCurrentTime());
}
UpdateRelevance();
}
void
Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
{
@ -73,6 +92,7 @@ Animation::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
PostUpdate();
}
// http://w3c.github.io/web-animations/#current-time
Nullable<TimeDuration>
Animation::GetCurrentTime() const
{
@ -92,27 +112,6 @@ Animation::GetCurrentTime() const
return result;
}
// Implements http://w3c.github.io/web-animations/#silently-set-the-current-time
void
Animation::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
{
if (!mHoldTime.IsNull() ||
!mTimeline ||
mTimeline->GetCurrentTime().IsNull() ||
mPlaybackRate == 0.0
/*or, once supported, if we have a pending pause task*/) {
mHoldTime.SetValue(aSeekTime);
if (!mTimeline || mTimeline->GetCurrentTime().IsNull()) {
mStartTime.SetNull();
}
} else {
mStartTime.SetValue(mTimeline->GetCurrentTime().Value() -
(aSeekTime.MultDouble(1 / mPlaybackRate)));
}
mPreviousCurrentTime.SetNull();
}
// Implements http://w3c.github.io/web-animations/#set-the-current-time
void
Animation::SetCurrentTime(const TimeDuration& aSeekTime)
@ -143,18 +142,6 @@ Animation::SetPlaybackRate(double aPlaybackRate)
}
}
void
Animation::SilentlySetPlaybackRate(double aPlaybackRate)
{
Nullable<TimeDuration> previousTime = GetCurrentTime();
mPlaybackRate = aPlaybackRate;
if (!previousTime.IsNull()) {
ErrorResult rv;
SilentlySetCurrentTime(previousTime.Value());
MOZ_ASSERT(!rv.Failed(), "Should not assert for non-null time");
}
}
AnimationPlayState
Animation::PlayState() const
{
@ -217,11 +204,17 @@ Animation::GetFinished(ErrorResult& aRv)
return mFinished;
}
void
Animation::Cancel()
{
DoCancel();
PostUpdate();
}
// https://w3c.github.io/web-animations/#finish-an-animation
void
Animation::Finish(ErrorResult& aRv)
{
// https://w3c.github.io/web-animations/#finish-an-animation
if (mPlaybackRate == 0 ||
(mPlaybackRate > 0 && EffectEnd() == TimeDuration::Forever())) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
@ -253,12 +246,16 @@ Animation::Play(LimitBehavior aLimitBehavior)
void
Animation::Pause()
{
// TODO: The DoPause() call should not be synchronous (bug 1109390). See
// http://w3c.github.io/web-animations/#pausing-an-animation-section
DoPause();
PostUpdate();
}
// ---------------------------------------------------------------------------
//
// JS wrappers for Animation interface:
//
// ---------------------------------------------------------------------------
Nullable<double>
Animation::GetStartTimeAsDouble() const
{
@ -291,18 +288,7 @@ Animation::SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
return SetCurrentTime(TimeDuration::FromMilliseconds(aCurrentTime.Value()));
}
void
Animation::SetEffect(KeyframeEffectReadonly* aEffect)
{
if (mEffect) {
mEffect->SetParentTime(Nullable<TimeDuration>());
}
mEffect = aEffect;
if (mEffect) {
mEffect->SetParentTime(GetCurrentTime());
}
UpdateRelevance();
}
// ---------------------------------------------------------------------------
void
Animation::Tick()
@ -375,8 +361,41 @@ Animation::GetCurrentOrPendingStartTime() const
return result;
}
// http://w3c.github.io/web-animations/#silently-set-the-current-time
void
Animation::Cancel()
Animation::SilentlySetCurrentTime(const TimeDuration& aSeekTime)
{
if (!mHoldTime.IsNull() ||
mStartTime.IsNull() ||
!mTimeline ||
mTimeline->GetCurrentTime().IsNull() ||
mPlaybackRate == 0.0) {
mHoldTime.SetValue(aSeekTime);
if (!mTimeline || mTimeline->GetCurrentTime().IsNull()) {
mStartTime.SetNull();
}
} else {
mStartTime.SetValue(mTimeline->GetCurrentTime().Value() -
(aSeekTime.MultDouble(1 / mPlaybackRate)));
}
mPreviousCurrentTime.SetNull();
}
void
Animation::SilentlySetPlaybackRate(double aPlaybackRate)
{
Nullable<TimeDuration> previousTime = GetCurrentTime();
mPlaybackRate = aPlaybackRate;
if (!previousTime.IsNull()) {
ErrorResult rv;
SilentlySetCurrentTime(previousTime.Value());
MOZ_ASSERT(!rv.Failed(), "Should not assert for non-null time");
}
}
void
Animation::DoCancel()
{
if (mPendingState != PendingState::NotPending) {
CancelPendingTasks();
@ -519,6 +538,7 @@ Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
}
}
// http://w3c.github.io/web-animations/#play-an-animation
void
Animation::DoPlay(LimitBehavior aLimitBehavior)
{
@ -582,6 +602,7 @@ Animation::DoPlay(LimitBehavior aLimitBehavior)
UpdateTiming();
}
// http://w3c.github.io/web-animations/#pause-an-animation
void
Animation::DoPause()
{

View File

@ -73,36 +73,43 @@ public:
virtual CSSAnimation* AsCSSAnimation() { return nullptr; }
virtual CSSTransition* AsCSSTransition() { return nullptr; }
// Flag to pass to DoPlay to indicate that it should not carry out finishing
// behavior (reset the current time to the beginning of the active duration).
enum LimitBehavior {
AutoRewind = 0,
Continue = 1
/**
* Flag to pass to Play to indicate whether or not it should automatically
* rewind the current time to the start point if the animation is finished.
* For regular calls to play() from script we should do this, but when a CSS
* animation's animation-play-state changes we shouldn't rewind the animation.
*/
enum class LimitBehavior {
AutoRewind,
Continue
};
// Animation methods
// Animation interface methods
KeyframeEffectReadonly* GetEffect() const { return mEffect; }
void SetEffect(KeyframeEffectReadonly* aEffect);
DocumentTimeline* Timeline() const { return mTimeline; }
Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
void SetStartTime(const Nullable<TimeDuration>& aNewStartTime);
Nullable<TimeDuration> GetCurrentTime() const;
void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
void SetCurrentTime(const TimeDuration& aNewCurrentTime);
double PlaybackRate() const { return mPlaybackRate; }
void SetPlaybackRate(double aPlaybackRate);
void SilentlySetPlaybackRate(double aPlaybackRate);
AnimationPlayState PlayState() const;
virtual Promise* GetReady(ErrorResult& aRv);
virtual Promise* GetFinished(ErrorResult& aRv);
void Cancel();
virtual void Finish(ErrorResult& aRv);
virtual void Play(LimitBehavior aLimitBehavior);
virtual void Pause();
bool IsRunningOnCompositor() const { return mIsRunningOnCompositor; }
// Wrapper functions for Animation DOM methods when called
// from script. We often use the same methods internally and from
// script but when called from script we (or one of our subclasses) perform
// extra steps such as flushing style or converting the return type.
// from script.
//
// We often use the same methods internally and from script but when called
// from script we (or one of our subclasses) perform extra steps such as
// flushing style or converting the return type.
Nullable<double> GetStartTimeAsDouble() const;
void SetStartTimeAsDouble(const Nullable<double>& aStartTime);
Nullable<double> GetCurrentTimeAsDouble() const;
@ -110,12 +117,18 @@ public:
ErrorResult& aRv);
virtual AnimationPlayState PlayStateFromJS() const { return PlayState(); }
virtual void PlayFromJS() { Play(LimitBehavior::AutoRewind); }
// PauseFromJS is currently only here for symmetry with PlayFromJS but
// in future we will likely have to flush style in
// CSSAnimation::PauseFromJS so we leave it for now.
/**
* PauseFromJS is currently only here for symmetry with PlayFromJS but
* in future we will likely have to flush style in
* CSSAnimation::PauseFromJS so we leave it for now.
*/
void PauseFromJS() { Pause(); }
// Wrapper functions for Animation DOM methods when called from style.
//
// Typically these DOM methods also notify style of changes but when
// we are calling from style we don't need to do this.
void CancelFromStyle() { DoCancel(); }
void SetEffect(KeyframeEffectReadonly* aEffect);
void Tick();
/**
@ -170,17 +183,17 @@ public:
* animation from any PendingAnimationTracker it may have been added to.
*/
void TriggerOnNextTick(const Nullable<TimeDuration>& aReadyTime);
// Testing only: Start or pause a pending animation using the current timeline
// time. This is used to support existing tests that expect animations to
// begin immediately. Ideally we would rewrite the those tests and get rid of
// this method, but there are a lot of them.
//
// As with TriggerOnNextTick, the caller of this method is responsible for
// removing the animation from any PendingAnimationTracker it may have been
// added to.
/**
* Testing only: Start or pause a pending animation using the current
* timeline time. This is used to support existing tests that expect
* animations to begin immediately. Ideally we would rewrite the those tests
* and get rid of this method, but there are a lot of them.
*
* As with TriggerOnNextTick, the caller of this method is responsible for
* removing the animation from any PendingAnimationTracker it may have been
* added to.
*/
void TriggerNow();
/**
* When StartOnNextTick is called, we store the ready time but we don't apply
* it until the next tick. In the meantime, GetStartTime() will return null.
@ -201,8 +214,6 @@ public:
*/
Nullable<TimeDuration> GetCurrentOrPendingStartTime() const;
void Cancel();
const nsString& Name() const
{
return mEffect ? mEffect->Name() : EmptyString();
@ -243,30 +254,32 @@ public:
(PlayState() == AnimationPlayState::Running ||
mPendingState == PendingState::PlayPending);
}
bool IsRelevant() const { return mIsRelevant; }
void UpdateRelevance();
void SetIsRunningOnCompositor() { mIsRunningOnCompositor = true; }
void ClearIsRunningOnCompositor() { mIsRunningOnCompositor = false; }
// Returns true if this animation does not currently need to update
// style on the main thread (e.g. because it is empty, or is
// running on the compositor).
/**
* Returns true if this animation does not currently need to update
* style on the main thread (e.g. because it is empty, or is
* running on the compositor).
*/
bool CanThrottle() const;
// Updates |aStyleRule| with the animation values of this animation's effect,
// if any.
// Any properties already contained in |aSetProperties| are not changed. Any
// properties that are changed are added to |aSetProperties|.
// |aNeedsRefreshes| will be set to true if this animation expects to update
// the style rule on the next refresh driver tick as well (because it
// is running and has an effect to sample).
/**
* Updates |aStyleRule| with the animation values of this animation's effect,
* if any.
* Any properties already contained in |aSetProperties| are not changed. Any
* properties that are changed are added to |aSetProperties|.
* |aNeedsRefreshes| will be set to true if this animation expects to update
* the style rule on the next refresh driver tick as well (because it
* is running and has an effect to sample).
*/
void ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties,
bool& aNeedsRefreshes);
protected:
void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
void SilentlySetPlaybackRate(double aPlaybackRate);
void DoCancel();
void DoPlay(LimitBehavior aLimitBehavior);
void DoPause();
void ResumeAt(const TimeDuration& aReadyTime);

View File

@ -573,7 +573,8 @@ function assert_records(expected, desc) {
// Test that starting a single animation that is cancelled by updating
// the animation-iteration-count property dispatches an added notification
// and then a removed notification.
addAsyncAnimTest("single_animation_cancelled_fill", aOptions, function*() {
addAsyncAnimTest("single_animation_cancelled_iteration_count",
aOptions, function*() {
// Start a short, repeated animation.
e.style = "animation: anim 0.5s infinite;";
@ -605,6 +606,44 @@ function assert_records(expected, desc) {
e.style = "";
});
// Test that starting a single animation that is cancelled by calling
// cancel() dispatches an added notification and then a removed
// notification.
addAsyncAnimTest("single_animation_cancelled_api", aOptions, function*() {
// Start a short, filled animation.
e.style = "animation: anim 100s forwards;";
// The animation should cause the creation of a single Animation.
var animations = e.getAnimations();
is(animations.length, 1, "getAnimations().length after animation start");
// Wait for the single MutationRecord for the Animation addition to
// be delivered.
yield await_frame();
assert_records([{ added: animations, changed: [], removed: [] }],
"records after animation start");
// Cancel the animation
animations[0].cancel();
// Wait for the single MutationRecord for the Animation removal to
// be delivered.
yield await_frame();
assert_records([{ added: [], changed: [], removed: animations }],
"records after animation end");
// Re-trigger the animation
animations[0].play();
yield await_frame();
// Wait for the single MutationRecord for the Animation (re-)addition to
// be delivered.
assert_records([{ added: animations, changed: [], removed: [] }],
"records after animation start");
e.style = "";
});
// Test that updating an animation property dispatches a changed notification.
[
{ name: "duration", prop: "animationDuration", val: "200s" },

View File

@ -0,0 +1,164 @@
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<div id="log"></div>
<style>
@keyframes translateAnim {
to { transform: translate(100px) }
}
@keyframes marginLeftAnim {
to { margin-left: 100px }
}
@keyframes marginLeftAnim100To200 {
from { margin-left: 100px }
to { margin-left: 200px }
}
</style>
<script>
'use strict';
async_test(function(t) {
var div = addDiv(t, { style: 'animation: translateAnim 100s' });
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
assert_not_equals(getComputedStyle(div).transform, 'none',
'transform style is animated before cancelling');
animation.cancel();
assert_equals(getComputedStyle(div).transform, 'none',
'transform style is no longer animated after cancelling');
t.done();
}));
}, 'Animated style is cleared after cancelling a running CSS animation');
async_test(function(t) {
var div = addDiv(t, { style: 'animation: translateAnim 100s forwards' });
var animation = div.getAnimations()[0];
animation.finish();
animation.ready.then(t.step_func(function() {
assert_not_equals(getComputedStyle(div).transform, 'none',
'transform style is filling before cancelling');
animation.cancel();
assert_equals(getComputedStyle(div).transform, 'none',
'fill style is cleared after cancelling');
t.done();
}));
}, 'Animated style is cleared after cancelling a filling CSS animation');
async_test(function(t) {
var div = addDiv(t, { style: 'animation: translateAnim 100s' });
var animation = div.getAnimations()[0];
div.addEventListener('animationend', t.step_func(function() {
assert_unreached('Got unexpected end event on cancelled animation');
}));
animation.ready.then(t.step_func(function() {
// Seek to just before the end then cancel
animation.currentTime = 99.9 * 1000;
animation.cancel();
// Then wait a couple of frames and check that no event was dispatched
return waitForAnimationFrames(2);
})).then(t.step_func(function() {
t.done();
}));
}, 'Cancelled CSS animations do not dispatch events');
test(function(t) {
var div = addDiv(t, { style: 'animation: marginLeftAnim 100s linear' });
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is not animated after cancelling');
animation.currentTime = 50 * 1000;
assert_equals(getComputedStyle(div).marginLeft, '50px',
'margin-left style is updated when cancelled animation is'
+ ' seeked');
}, 'After cancelling an animation, it can still be seeked');
async_test(function(t) {
var div =
addDiv(t, { style: 'animation: marginLeftAnim100To200 100s linear' });
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is not animated after cancelling');
animation.play();
assert_equals(getComputedStyle(div).marginLeft, '100px',
'margin-left style is animated after re-starting animation');
return animation.ready;
})).then(t.step_func(function() {
assert_equals(animation.playState, 'running',
'Animation succeeds in running after being re-started');
t.done();
}));
}, 'After cancelling an animation, it can still be re-used');
test(function(t) {
var div =
addDiv(t, { style: 'animation: marginLeftAnim100To200 100s linear' });
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is not animated after cancelling');
// Trigger a change to some animation properties and check that this
// doesn't cause the animation to become live again
div.style.animationDuration = '200s';
flushComputedStyle(div);
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is still not animated after updating'
+ ' animation-duration');
assert_equals(animation.playState, 'idle',
'Animation is still idle after updating animation-duration');
}, 'After cancelling an animation, updating animation properties doesn\'t make'
+ ' it live again');
test(function(t) {
var div =
addDiv(t, { style: 'animation: marginLeftAnim100To200 100s linear' });
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is not animated after cancelling');
// Make some changes to animation-play-state and check that the
// animation doesn't become live again. This is because it should be
// possible to cancel an animation from script such that all future
// changes to style are ignored.
// Redundant change
div.style.animationPlayState = 'running';
assert_equals(animation.playState, 'idle',
'Animation is still idle after a redundant change to'
+ ' animation-play-state');
// Pause
div.style.animationPlayState = 'paused';
assert_equals(animation.playState, 'idle',
'Animation is still idle after setting'
+ ' animation-play-state: paused');
// Play
div.style.animationPlayState = 'running';
assert_equals(animation.playState, 'idle',
'Animation is still idle after re-setting'
+ ' animation-play-state: running');
}, 'After cancelling an animation, updating animation-play-state doesn\'t'
+ ' make it live again');
</script>
</html>

View File

@ -511,7 +511,7 @@ async_test(function(t) {
'animation has finished');
t.done();
}));
}, 'Test Animation.currentTime clamping');
}, 'Animation.currentTime clamping');
async_test(function(t) {
var div = addDiv(t, {'class': 'animated-div'});
@ -533,7 +533,17 @@ async_test(function(t) {
'animation running in reverse has finished and currentTime is zero');
t.done();
}));
}, 'Test Animation.currentTime clamping for reversed animation');
}, 'Animation.currentTime clamping for reversed animation');
test(function(t) {
var div = addDiv(t, {'class': 'animated-div'});
div.style.animation = 'anim 100s';
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(animation.currentTime, null,
'The currentTime of a cancelled animation should be null');
}, 'Animation.currentTime after cancelling');
</script>
</body>

View File

@ -140,13 +140,11 @@ async_test(function(t) {
animation.finished.then(t.step_func(function() {
assert_unreached('finished promise is fulfilled');
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'finished promise is rejected with AbortError');
assert_not_equals(animation.finished, previousFinishedPromise,
'Finished promise should change after the original is ' +
'rejected');
assert_equals(err.name, 'AbortError',
'finished promise is rejected with AbortError');
assert_equals(animation.playState, 'idle',
'Animation is idle after animation was cancelled');
})).then(t.step_func(function() {
t.done();
}));
@ -174,13 +172,11 @@ async_test(function(t) {
animation.finished.then(t.step_func(function() {
assert_unreached('finished promise was fulfilled');
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'finished promise is rejected with AbortError');
assert_not_equals(animation.finished, previousFinishedPromise,
'Finished promise should change after the original is ' +
'rejected');
assert_equals(err.name, 'AbortError',
'finished promise is rejected with AbortError');
assert_equals(animation.playState, 'idle',
'Animation is idle after animation was cancelled');
})).then(t.step_func(function() {
t.done();
}));
@ -192,6 +188,72 @@ async_test(function(t) {
}, 'finished promise is rejected when an animation is cancelled by changing ' +
'the animation property');
async_test(function(t) {
var div = addDiv(t);
div.style.animation = ANIM_PROP_VAL;
var animation = div.getAnimations()[0];
var previousFinishedPromise = animation.finished;
// Set up listeners on finished promise
animation.finished.then(t.step_func(function() {
assert_unreached('finished promise was fulfilled');
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'finished promise is rejected with AbortError');
assert_not_equals(animation.finished, previousFinishedPromise,
'Finished promise should change after the original is ' +
'rejected');
})).then(t.step_func(function() {
t.done();
}));
animation.cancel();
}, 'finished promise is rejected when an animation is cancelled by calling ' +
'cancel()');
async_test(function(t) {
var div = addDiv(t);
div.style.animation = ANIM_PROP_VAL;
var animation = div.getAnimations()[0];
var previousFinishedPromise = animation.finished;
animation.currentTime = ANIM_DURATION;
animation.finished.then(t.step_func(function() {
animation.cancel();
assert_not_equals(animation.finished, previousFinishedPromise,
'A new finished promise should be created when'
+ ' cancelling a finished player');
})).then(t.step_func(function() {
t.done();
}));
}, 'cancelling an already-finished player replaces the finished promise');
async_test(function(t) {
var div = addDiv(t);
div.style.animation = ANIM_PROP_VAL;
var animation = div.getAnimations()[0];
animation.cancel();
// The spec says we still create a new finished promise and reject the old
// one even if we're already idle. That behavior might change, but for now
// test that we do that.
animation.finished.catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'finished promise is rejected with AbortError');
t.done();
}));
// Redundant call to cancel();
var previousFinishedPromise = animation.finished;
animation.cancel();
assert_not_equals(animation.finished, previousFinishedPromise,
'A redundant call to cancel() should still generate a new'
+ ' finished promise');
}, 'cancelling an idle player still replaces the finished promise');
async_test(function(t) {
var div = addDiv(t);
div.style.animation = ANIM_PROP_VAL;
@ -286,5 +348,4 @@ async_test(function(t) {
}));
}, 'Test finished promise changes when animationPlayState set to running');
</script>

View File

@ -66,4 +66,24 @@ test(function(t) {
+ ' animation-play-state (got: ' + animation.playState + ')');
}, 'Animation.playState updates when resumed by setting style');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'anim 1000s';
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(animation.playState, 'idle');
}, 'Animation returns correct playState when cancelled');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'anim 1000s';
var animation = div.getAnimations()[0];
animation.cancel();
animation.currentTime = 50 * 1000;
assert_equals(animation.playState, 'paused',
'After seeking an idle animation, it is effectively paused');
}, 'After cancelling an animation, seeking it makes it paused');
</script>

View File

@ -96,8 +96,6 @@ async_test(function(t) {
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'ready promise is rejected with AbortError');
assert_equals(animation.playState, 'idle',
'Animation is idle after animation was cancelled');
})).then(t.step_func(function() {
t.done();
}));
@ -128,8 +126,6 @@ async_test(function(t) {
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'ready promise is rejected with AbortError');
assert_equals(animation.playState, 'idle',
'Animation is idle after animation was cancelled');
})).then(t.step_func(function() {
t.done();
}));
@ -141,6 +137,47 @@ async_test(function(t) {
}, 'ready promise is rejected when an animation is cancelled by updating'
+ ' the animation property');
async_test(function(t) {
var div = addDiv(t);
div.style.animation = 'abc 100s';
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
assert_unreached('ready promise was fulfilled');
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'ready promise is rejected with AbortError');
})).then(t.step_func(function() {
t.done();
}));
animation.cancel();
}, 'ready promise is rejected when a play-pending animation is cancelled by'
+ ' calling cancel()');
async_test(function(t) {
var div = addDiv(t);
div.style.animation = 'abc 100s';
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
animation.pause();
// Set up listeners on pause-pending ready promise
animation.ready.then(t.step_func(function() {
assert_unreached('ready promise was fulfilled');
})).catch(t.step_func(function(err) {
assert_equals(err.name, 'AbortError',
'ready promise is rejected with AbortError');
})).then(t.step_func(function() {
t.done();
}));
animation.cancel();
}));
}, 'ready promise is rejected when a pause-pending animation is cancelled by'
+ ' calling cancel()');
async_test(function(t) {
var div = addDiv(t, { style: 'animation: abc 100s' });
var animation = div.getAnimations()[0];

View File

@ -539,7 +539,20 @@ async_test(function(t) {
})).then(function() {
t.done();
});
}, 'Animation.startTime after paused');
}, 'Animation.startTime after pausing');
async_test(function(t) {
var div = addDiv(t, {'class': 'animated-div'});
div.style.animation = 'anim 100s';
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
animation.cancel();
assert_equals(animation.startTime, null,
'The startTime of a cancelled animation should be null');
t.done();
}));
}, 'Animation.startTime after cancelling');
</script>
</body>

View File

@ -250,4 +250,23 @@ test(function(t) {
+ ' duration changes');
}, 'getAnimations returns objects with the same identity');
test(function(t) {
var div = addDiv(t);
div.style.animation = 'anim1 100s';
assert_equals(div.getAnimations().length, 1,
'getAnimations returns an animation before cancelling');
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(div.getAnimations().length, 0,
'getAnimations does not return cancelled animations');
animation.play();
assert_equals(div.getAnimations().length, 1,
'getAnimations returns cancelled animations that have been re-started');
}, 'getAnimations for CSS Animations that are cancelled');
</script>

View File

@ -0,0 +1,129 @@
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<div id="log"></div>
<script>
'use strict';
async_test(function(t) {
var div = addDiv(t, { style: 'margin-left: 0px' });
flushComputedStyle(div);
div.style.transition = 'margin-left 100s';
div.style.marginLeft = '1000px';
flushComputedStyle(div);
var animation = div.getAnimations()[0];
animation.ready.then(waitForFrame).then(t.step_func(function() {
assert_not_equals(getComputedStyle(div).marginLeft, '1000px',
'transform style is animated before cancelling');
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, div.style.marginLeft,
'transform style is no longer animated after cancelling');
t.done();
}));
}, 'Animated style is cleared after cancelling a running CSS transition');
async_test(function(t) {
var div = addDiv(t, { style: 'margin-left: 0px' });
flushComputedStyle(div);
div.style.transition = 'margin-left 100s';
div.style.marginLeft = '1000px';
flushComputedStyle(div);
div.addEventListener('transitionend', t.step_func(function() {
assert_unreached('Got unexpected end event on cancelled transition');
}));
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
// Seek to just before the end then cancel
animation.currentTime = 99.9 * 1000;
animation.cancel();
// Then wait a couple of frames and check that no event was dispatched
return waitForAnimationFrames(2);
})).then(t.step_func(function() {
t.done();
}));
}, 'Cancelled CSS transitions do not dispatch events');
async_test(function(t) {
var div = addDiv(t, { style: 'margin-left: 0px' });
flushComputedStyle(div);
div.style.transition = 'margin-left 100s';
div.style.marginLeft = '1000px';
flushComputedStyle(div);
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '1000px',
'margin-left style is not animated after cancelling');
animation.play();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is animated after re-starting transition');
return animation.ready;
})).then(t.step_func(function() {
assert_equals(animation.playState, 'running',
'Transition succeeds in running after being re-started');
t.done();
}));
}, 'After cancelling a transition, it can still be re-used');
async_test(function(t) {
var div = addDiv(t, { style: 'margin-left: 0px' });
flushComputedStyle(div);
div.style.transition = 'margin-left 100s';
div.style.marginLeft = '1000px';
flushComputedStyle(div);
var animation = div.getAnimations()[0];
animation.ready.then(t.step_func(function() {
animation.finish();
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '1000px',
'margin-left style is not animated after cancelling');
animation.play();
assert_equals(getComputedStyle(div).marginLeft, '0px',
'margin-left style is animated after re-starting transition');
return animation.ready;
})).then(t.step_func(function() {
assert_equals(animation.playState, 'running',
'Transition succeeds in running after being re-started');
t.done();
}));
}, 'After cancelling a finished transition, it can still be re-used');
test(function(t) {
var div = addDiv(t, { style: 'margin-left: 0px' });
flushComputedStyle(div);
div.style.transition = 'margin-left 100s';
div.style.marginLeft = '1000px';
flushComputedStyle(div);
var animation = div.getAnimations()[0];
animation.cancel();
assert_equals(getComputedStyle(div).marginLeft, '1000px',
'margin-left style is not animated after cancelling');
// Trigger a change to a transition property and check that this
// doesn't cause the animation to become live again
div.style.transitionDuration = '200s';
flushComputedStyle(div);
assert_equals(getComputedStyle(div).marginLeft, '1000px',
'margin-left style is still not animated after updating'
+ ' transition-duration');
assert_equals(animation.playState, 'idle',
'Transition is still idle after updating transition-duration');
}, 'After cancelling a transition, updating transition properties doesn\'t make'
+ ' it live again');
</script>
</html>

View File

@ -3,6 +3,7 @@ support-files =
testcommon.js
[css-animations/test_animations-dynamic-changes.html]
[css-animations/test_animation-cancel.html]
[css-animations/test_animation-currenttime.html]
[css-animations/test_animation-finish.html]
[css-animations/test_animation-finished.html]
@ -14,6 +15,7 @@ support-files =
[css-animations/test_effect-target.html]
[css-animations/test_element-get-animations.html]
skip-if = buildapp == 'mulet'
[css-transitions/test_animation-cancel.html]
[css-transitions/test_animation-currenttime.html]
[css-transitions/test_animation-finished.html]
[css-transitions/test_animation-pausing.html]

View File

@ -526,7 +526,7 @@ private:
id = NS_LITERAL_STRING("Worker");
}
mCallData->SetIDs(id, frame.mFilename);
mCallData->SetIDs(frame.mFilename, id);
}
// Now we could have the correct window (if we are not window-less).

View File

@ -592,9 +592,7 @@ public:
FileImplTemporaryFileBlob(PRFileDesc* aFD, uint64_t aStartPos,
uint64_t aLength, const nsAString& aContentType)
: FileImplBase(aContentType, aLength)
, mLength(aLength)
, mStartPos(aStartPos)
, mContentType(aContentType)
{
mFileDescOwner = new nsTemporaryFileInputStream::FileDescOwner(aFD);
}
@ -610,17 +608,14 @@ private:
uint64_t aStart, uint64_t aLength,
const nsAString& aContentType)
: FileImplBase(aContentType, aLength)
, mLength(aLength)
, mStartPos(aStart)
, mFileDescOwner(aOther->mFileDescOwner)
, mContentType(aContentType) {}
{}
~FileImplTemporaryFileBlob() {}
uint64_t mLength;
uint64_t mStartPos;
nsRefPtr<nsTemporaryFileInputStream::FileDescOwner> mFileDescOwner;
nsString mContentType;
};
class FileImplFile : public FileImplBase

View File

@ -72,7 +72,6 @@
#include "nsMemory.h"
// includes needed for the prototype chain interfaces
#include "nsIDOMCSSCharsetRule.h"
#include "nsIDOMCSSImportRule.h"
#include "nsIDOMCSSMediaRule.h"
#include "nsIDOMCSSFontFaceRule.h"
@ -208,8 +207,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// CSS classes
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSCharsetRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
@ -600,10 +597,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSCharsetRule, nsIDOMCSSCharsetRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCharsetRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_END

View File

@ -9,7 +9,6 @@ DOMCI_CLASS(DOMConstructor)
// CSS classes
DOMCI_CLASS(CSSStyleRule)
DOMCI_CLASS(CSSCharsetRule)
DOMCI_CLASS(CSSImportRule)
DOMCI_CLASS(CSSMediaRule)
DOMCI_CLASS(CSSNameSpaceRule)

View File

@ -881,6 +881,7 @@ GK_ATOM(onstatechange, "onstatechange")
GK_ATOM(onstatuschanged, "onstatuschanged")
GK_ATOM(onstkcommand, "onstkcommand")
GK_ATOM(onstksessionend, "onstksessionend")
GK_ATOM(onstorageareachanged, "onstorageareachanged")
GK_ATOM(onsubmit, "onsubmit")
GK_ATOM(onsuccess, "onsuccess")
GK_ATOM(ontypechange, "ontypechange")

View File

@ -36,7 +36,7 @@
performance.mark("test");
var marks_type = performance.getEntriesByType("mark");
is(marks_type.length, 3, "Number of marks by type should be 3");
var marks_name = performance.getEntriesByType("mark");
var marks_name = performance.getEntriesByName("test");
is(marks_name.length, 3, "Number of marks by name should be 3");
var mark = marks_name[0];
is(mark.name, "test", "mark name should be 'test'");

View File

@ -223,13 +223,12 @@ ErrorResult::ReportErrorWithMessage(JSContext* aCx)
void
ErrorResult::ClearMessage()
{
if (IsErrorWithMessage()) {
delete mMessage;
mMessage = nullptr;
MOZ_ASSERT(IsErrorWithMessage());
delete mMessage;
mMessage = nullptr;
#ifdef DEBUG
mHasMessage = false;
mHasMessage = false;
#endif
}
}
void
@ -378,6 +377,24 @@ ErrorResult::operator=(ErrorResult&& aRHS)
return *this;
}
void
ErrorResult::SuppressException()
{
WouldReportJSException();
if (IsErrorWithMessage()) {
ClearMessage();
} else if (IsJSException()) {
JSContext* cx = nsContentUtils::GetDefaultJSContextForThread();
// Just steal it into a stack value (unrooting it in the process)
// that we then allow to die.
JS::Rooted<JS::Value> temp(cx);
StealJSException(cx, &temp);
}
// We don't use AssignErrorCode, because we want to override existing error
// states, which AssignErrorCode is not allowed to do.
mResult = NS_OK;
}
namespace dom {
bool

View File

@ -77,10 +77,23 @@ public:
AssignErrorCode(rv);
}
// Use SuppressException when you want to suppress any exception that might be
// on the ErrorResult. After this call, the ErrorResult will be back a "no
// exception thrown" state.
void SuppressException();
// Use StealNSResult() when you want to safely convert the ErrorResult to an
// nsresult that you will then return to a caller. This will
// SuppressException(), since there will no longer be a way to report it.
nsresult StealNSResult() {
nsresult rv = ErrorCode();
SuppressException();
return rv;
}
void ThrowTypeError(const dom::ErrNum errorNumber, ...);
void ThrowRangeError(const dom::ErrNum errorNumber, ...);
void ReportErrorWithMessage(JSContext* cx);
void ClearMessage();
bool IsErrorWithMessage() const { return ErrorCode() == NS_ERROR_TYPE_ERR || ErrorCode() == NS_ERROR_RANGE_ERR; }
// Facilities for throwing a preexisting JS exception value via this
@ -170,6 +183,8 @@ private:
mResult = aRv;
}
void ClearMessage();
nsresult mResult;
struct Message;
// mMessage is set by ThrowErrorWithMessage and cleared (and deallocated) by

View File

@ -585,13 +585,25 @@ BrowserElementChild.prototype = {
},
_ClickHandler: function(e) {
let elem = e.target;
if (elem instanceof Ci.nsIDOMHTMLAnchorElement && elem.href) {
// Open in a new tab if middle click or ctrl/cmd-click.
if ((Services.appinfo.OS == 'Darwin' && e.metaKey) ||
(Services.appinfo.OS != 'Darwin' && e.ctrlKey) ||
e.button == 1) {
sendAsyncMsg('opentab', {url: elem.href});
let isHTMLLink = node =>
((node instanceof Ci.nsIDOMHTMLAnchorElement && node.href) ||
(node instanceof Ci.nsIDOMHTMLAreaElement && node.href) ||
node instanceof Ci.nsIDOMHTMLLinkElement);
// Open in a new tab if middle click or ctrl/cmd-click,
// and e.target is a link or inside a link.
if ((Services.appinfo.OS == 'Darwin' && e.metaKey) ||
(Services.appinfo.OS != 'Darwin' && e.ctrlKey) ||
e.button == 1) {
let node = e.target;
while (node && !isHTMLLink(node)) {
node = node.parentNode;
}
if (node) {
sendAsyncMsg('opentab', {url: node.href});
}
}
},

View File

@ -52,7 +52,7 @@ function runTest() {
iframeOuter = document.createElement('iframe');
iframeOuter.setAttribute('mozbrowser', 'true');
if (createEmbededFrame) {
iframeOuter.src = "file_NestedFramesOuter_CopyPaste.html";
iframeOuter.src = "file_empty.html";
}
document.body.appendChild(iframeOuter);
@ -67,7 +67,10 @@ function runTest() {
.QueryInterface(SpecialPowers.Ci.nsIFrameLoaderOwner)
.frameLoader.docShell.contentViewer.DOMDocument.defaultView;
var contentDoc = contentWin.document;
iframeInner = contentDoc.getElementById('iframeInner');
iframeInner = contentDoc.createElement('iframe');
iframeInner.setAttribute('mozbrowser', true);
iframeInner.setAttribute('remote', 'false');
contentDoc.body.appendChild(iframeInner);
iframeInner.addEventListener("mozbrowserloadend", function onloadendinner(e) {
iframeInner.removeEventListener("mozbrowserloadend", onloadendinner);
mm = SpecialPowers.getBrowserFrameMessageManager(iframeInner);

View File

@ -51,7 +51,7 @@ function runTest() {
iframe.sendMouseEvent('mouseup', x, y, 1, 1, 0);
}
let onMiddleClick= e => {
let onMiddleClick = e => {
is(e.detail.url, 'http://example.com/', 'URL matches');
iframe.removeEventListener('mozbrowseropentab', onMiddleClick);
SimpleTest.finish();
@ -63,7 +63,7 @@ function runTest() {
});
iframe.src = 'data:text/html,<body style="margin:0"><a href="http://example.com">click here</a></body>';
iframe.src = 'data:text/html,<body style="margin:0"><a href="http://example.com"><span>click here</span></a></body>';
}
addEventListener('testready', runTest);

View File

@ -1,21 +0,0 @@
<html>
<body>
<p>file_NestedFramesOuter_CopyPaste.html</p>
<script>
addEventListener('load', function() {
setTimeout(createIframe, 0);
});
function createIframe()
{
var iframe = document.createElement('iframe');
iframe.setAttribute('id', 'iframeInner');
iframe.setAttribute('mozbrowser', true);
iframe.setAttribute('remote', 'false');
document.body.appendChild(iframe);
}
</script>
</body>
</html>

View File

@ -116,7 +116,6 @@ support-files =
file_inputmethod.html
file_post_request.html
file_wyciwyg.html
file_NestedFramesOuter_CopyPaste.html
# Note: browserElementTestHelpers.js looks at the test's filename to determine
# whether the test should be OOP. "_oop_" signals OOP, "_inproc_" signals in

View File

@ -195,7 +195,7 @@ CacheOpParent::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
// void_t() to ensure that we don't leak actors on the child side.
if (aRv.Failed()) {
unused << Send__delete__(this, aRv, void_t());
aRv.ClearMessage(); // This may contain a TypeError.
aRv.SuppressException(); // We serialiazed it, as best we could.
return;
}

View File

@ -79,7 +79,7 @@ CacheStorage::CreateOnMainThread(Namespace aNamespace, nsIGlobalObject* aGlobal,
if (nullPrincipal) {
NS_WARNING("CacheStorage not supported on null principal.");
aRv.Throw(NS_ERROR_FAILURE);
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
@ -91,7 +91,7 @@ CacheStorage::CreateOnMainThread(Namespace aNamespace, nsIGlobalObject* aGlobal,
aPrincipal->GetUnknownAppId(&unknownAppId);
if (unknownAppId) {
NS_WARNING("CacheStorage not supported on principal with unknown appId.");
aRv.Throw(NS_ERROR_FAILURE);
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
@ -126,7 +126,7 @@ CacheStorage::CreateOnWorker(Namespace aNamespace, nsIGlobalObject* aGlobal,
const PrincipalInfo& principalInfo = aWorkerPrivate->GetPrincipalInfo();
if (principalInfo.type() == PrincipalInfo::TNullPrincipalInfo) {
NS_WARNING("CacheStorage not supported on null principal.");
aRv.Throw(NS_ERROR_FAILURE);
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
@ -134,7 +134,7 @@ CacheStorage::CreateOnWorker(Namespace aNamespace, nsIGlobalObject* aGlobal,
principalInfo.get_ContentPrincipalInfo().appId() ==
nsIScriptSecurityManager::UNKNOWN_APP_ID) {
NS_WARNING("CacheStorage not supported on principal with unknown appId.");
aRv.Throw(NS_ERROR_FAILURE);
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}

View File

@ -983,14 +983,14 @@ MatchByVaryHeader(mozIStorageConnection* aConn,
nsAutoCString queryValue;
queryHeaders->Get(header, queryValue, errorResult);
if (errorResult.Failed()) {
errorResult.ClearMessage();
errorResult.SuppressException();
MOZ_ASSERT(queryValue.IsEmpty());
}
nsAutoCString cachedValue;
cachedHeaders->Get(header, cachedValue, errorResult);
if (errorResult.Failed()) {
errorResult.ClearMessage();
errorResult.SuppressException();
MOZ_ASSERT(cachedValue.IsEmpty());
}

View File

@ -160,7 +160,8 @@ FetchPut::~FetchPut()
MOZ_ASSERT(!mListener);
mManager->RemoveListener(this);
mManager->ReleaseCacheId(mCacheId);
mResult.ClearMessage(); // This may contain a TypeError.
mResult.SuppressException(); // XXXbz should we really be ending up here with
// a failed mResult we never reported to anyone?
}
nsresult
@ -389,14 +390,14 @@ FetchPut::MatchInPutList(const CacheRequest& aRequest,
nsAutoCString value;
requestHeaders->Get(header, value, headerRv);
if (NS_WARN_IF(headerRv.Failed())) {
headerRv.ClearMessage();
headerRv.SuppressException();
MOZ_ASSERT(value.IsEmpty());
}
nsAutoCString cachedValue;
cachedRequestHeaders->Get(header, value, headerRv);
if (NS_WARN_IF(headerRv.Failed())) {
headerRv.ClearMessage();
headerRv.SuppressException();
MOZ_ASSERT(cachedValue.IsEmpty());
}

View File

@ -205,18 +205,7 @@ WebGL2Context::TransformFeedbackVaryings(WebGLProgram* program,
if (!ValidateObject("transformFeedbackVaryings: program", program))
return;
GLsizei count = varyings.Length();
GLchar** tmpVaryings = (GLchar**) moz_xmalloc(count * sizeof(GLchar*));
for (GLsizei n = 0; n < count; n++) {
tmpVaryings[n] = (GLchar*) ToNewCString(varyings[n]);
}
GLuint progname = program->mGLName;
MakeContextCurrent();
gl->fTransformFeedbackVaryings(progname, count, tmpVaryings, bufferMode);
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, tmpVaryings);
program->TransformFeedbackVaryings(varyings, bufferMode);
}
already_AddRefed<WebGLActiveInfo>
@ -228,29 +217,5 @@ WebGL2Context::GetTransformFeedbackVarying(WebGLProgram* program, GLuint index)
if (!ValidateObject("getTransformFeedbackVarying: program", program))
return nullptr;
MakeContextCurrent();
GLint len = 0;
GLuint progname = program->mGLName;
gl->fGetProgramiv(progname, LOCAL_GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, &len);
if (!len)
return nullptr;
UniquePtr<char[]> name(new char[len]);
GLint tfsize = 0;
GLuint tftype = 0;
gl->fGetTransformFeedbackVarying(progname, index, len, &len, &tfsize, &tftype, name.get());
if (len == 0 || tfsize == 0 || tftype == 0)
return nullptr;
MOZ_CRASH("todo");
/*
// Reverse lookup of name
nsCString reverseMappedName;
prog->ReverveMapIdentifier(nsDependentCString(name), &reverseMappedName);
nsRefPtr<WebGLActiveInfo> result = new WebGLActiveInfo(tfsize, tftype, nsDependentCString(name.get()));
return result.forget();
*/
return program->GetTransformFeedbackVarying(index);
}

View File

@ -188,7 +188,7 @@ class WebGLContext
public:
WebGLContext();
MOZ_DECLARE_REFCOUNTED_TYPENAME(WebGLContext)
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebGLContext)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS

View File

@ -93,11 +93,13 @@ WebGLContext::BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer)
if (index >= mGLMaxTransformFeedbackSeparateAttribs)
return ErrorInvalidValue("bindBufferBase: index should be less than "
"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS");
break;
case LOCAL_GL_UNIFORM_BUFFER:
if (index >= mGLMaxUniformBufferBindings)
return ErrorInvalidValue("bindBufferBase: index should be less than "
"MAX_UNIFORM_BUFFER_BINDINGS");
break;
default:
return ErrorInvalidEnumInfo("bindBufferBase: target", target);
@ -131,11 +133,14 @@ WebGLContext::BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer,
if (index >= mGLMaxTransformFeedbackSeparateAttribs)
return ErrorInvalidValue("bindBufferRange: index should be less than "
"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS");
break;
case LOCAL_GL_UNIFORM_BUFFER:
if (index >= mGLMaxUniformBufferBindings)
return ErrorInvalidValue("bindBufferRange: index should be less than "
"MAX_UNIFORM_BUFFER_BINDINGS");
break;
default:
return ErrorInvalidEnumInfo("bindBufferRange: target", target);
}
@ -495,6 +500,7 @@ WebGLContext::GetBufferSlotByTargetIndexed(GLenum target, GLuint index)
case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER:
MOZ_ASSERT(index < mGLMaxTransformFeedbackSeparateAttribs);
return mBoundTransformFeedbackBuffers[index];
case LOCAL_GL_UNIFORM_BUFFER:
MOZ_ASSERT(index < mGLMaxUniformBufferBindings);
return mBoundUniformBuffers[index];

View File

@ -30,7 +30,7 @@ class WebGLFramebuffer final
, public SupportsWeakPtr<WebGLFramebuffer>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(WebGLFramebuffer)
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebGLFramebuffer)
class AttachPoint
{

View File

@ -230,7 +230,7 @@ QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl)
gl->fGetProgramiv(prog->mGLName, LOCAL_GL_ACTIVE_UNIFORM_BLOCKS,
(GLint*)&numActiveUniformBlocks);
for (GLuint i = 0; i < numActiveAttribs; i++) {
for (GLuint i = 0; i < numActiveUniformBlocks; i++) {
nsAutoCString mappedName;
mappedName.SetLength(maxUniformBlockLenWithNull - 1);
@ -295,6 +295,7 @@ CreateProgram(gl::GLContext* gl)
WebGLProgram::WebGLProgram(WebGLContext* webgl)
: WebGLContextBoundObject(webgl)
, mGLName(CreateProgram(webgl->GL()))
, mTransformFeedbackBufferMode(LOCAL_GL_NONE)
{
mContext->mPrograms.insertBack(this);
}
@ -432,6 +433,7 @@ already_AddRefed<WebGLActiveInfo>
WebGLProgram::GetActiveUniform(GLuint index) const
{
if (!mMostRecentLinkInfo) {
// According to the spec, this can return null.
nsRefPtr<WebGLActiveInfo> ret = WebGLActiveInfo::CreateInvalid(mContext);
return ret.forget();
}
@ -532,9 +534,11 @@ WebGLProgram::GetProgramParameter(GLenum pname) const
switch (pname) {
case LOCAL_GL_ACTIVE_UNIFORM_BLOCKS:
return JS::Int32Value(GetProgramiv(gl, mGLName, pname));
}
}
case LOCAL_GL_TRANSFORM_FEEDBACK_VARYINGS:
return JS::Int32Value(mTransformFeedbackVaryings.size());
}
}
switch (pname) {
case LOCAL_GL_ATTACHED_SHADERS:
@ -819,6 +823,15 @@ WebGLProgram::LinkProgram()
mVertShader->BindAttribLocation(mGLName, name, index);
}
if (!mTransformFeedbackVaryings.empty()) {
// Bind the transform feedback varyings.
// This can't be done trivially, because we have to deal with mapped names too.
mVertShader->ApplyTransformFeedbackVaryings(mGLName,
mTransformFeedbackVaryings,
mTransformFeedbackBufferMode,
&mTempMappedVaryings);
}
if (LinkAndUpdate())
return true;
@ -896,6 +909,11 @@ WebGLProgram::LinkAndUpdate()
mLinkLog.SetLength(0);
}
// Post link, temporary mapped varying names for transform feedback can be discarded.
// The memory can only be deleted after log is queried or the link status will fail.
std::vector<std::string> empty;
empty.swap(mTempMappedVaryings);
GLint ok = 0;
gl->fGetProgramiv(mGLName, LOCAL_GL_LINK_STATUS, &ok);
if (!ok)
@ -934,6 +952,71 @@ WebGLProgram::FindUniformByMappedName(const nsACString& mappedName,
return false;
}
void
WebGLProgram::TransformFeedbackVaryings(const dom::Sequence<nsString>& varyings,
GLenum bufferMode)
{
if (bufferMode != LOCAL_GL_INTERLEAVED_ATTRIBS &&
bufferMode != LOCAL_GL_SEPARATE_ATTRIBS)
{
mContext->ErrorInvalidEnum("transformFeedbackVaryings: `bufferMode` %s is "
"invalid. Must be one of gl.INTERLEAVED_ATTRIBS or "
"gl.SEPARATE_ATTRIBS.",
mContext->EnumName(bufferMode));
return;
}
size_t varyingsCount = varyings.Length();
if (bufferMode == LOCAL_GL_SEPARATE_ATTRIBS &&
varyingsCount >= mContext->mGLMaxTransformFeedbackSeparateAttribs)
{
mContext->ErrorInvalidValue("transformFeedbackVaryings: Number of `varyings` exc"
"eeds gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.");
return;
}
std::vector<nsCString> asciiVaryings;
for (size_t i = 0; i < varyingsCount; i++) {
if (!ValidateGLSLVariableName(varyings[i], mContext, "transformFeedbackVaryings"))
return;
NS_LossyConvertUTF16toASCII asciiName(varyings[i]);
asciiVaryings.push_back(asciiName);
}
// All validated. Translate the strings and store them until
// program linking.
mTransformFeedbackBufferMode = bufferMode;
mTransformFeedbackVaryings.swap(asciiVaryings);
}
already_AddRefed<WebGLActiveInfo>
WebGLProgram::GetTransformFeedbackVarying(GLuint index)
{
// No docs in the WebGL 2 spec for this function. Taking the language for
// getActiveAttrib, which states that the function returns null on any error.
if (!IsLinked()) {
mContext->ErrorInvalidOperation("getTransformFeedbackVarying: `program` must be "
"linked.");
return nullptr;
}
if (index >= mTransformFeedbackVaryings.size()) {
mContext->ErrorInvalidValue("getTransformFeedbackVarying: `index` is greater or "
"equal to TRANSFORM_FEEDBACK_VARYINGS.");
return nullptr;
}
const nsCString& varyingUserName = mTransformFeedbackVaryings[index];
WebGLActiveInfo* info;
LinkInfo()->FindAttrib(varyingUserName, (const WebGLActiveInfo**) &info);
MOZ_ASSERT(info);
nsRefPtr<WebGLActiveInfo> ret(info);
return ret.forget();
}
bool
WebGLProgram::FindUniformBlockByMappedName(const nsACString& mappedName,
nsCString* const out_userName,

View File

@ -45,6 +45,7 @@ struct LinkedProgramInfo final
, public SupportsWeakPtr<LinkedProgramInfo>
{
MOZ_DECLARE_REFCOUNTED_TYPENAME(LinkedProgramInfo)
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(LinkedProgramInfo)
WebGLProgram* const prog;
std::vector<nsRefPtr<WebGLActiveInfo>> activeAttribs;
@ -172,6 +173,10 @@ public:
nsCString* const out_userName,
bool* const out_isArray) const;
void TransformFeedbackVaryings(const dom::Sequence<nsString>& varyings,
GLenum bufferMode);
already_AddRefed<WebGLActiveInfo> GetTransformFeedbackVarying(GLuint index);
bool IsLinked() const { return mMostRecentLinkInfo; }
const webgl::LinkedProgramInfo* LinkInfo() const {
@ -198,8 +203,13 @@ private:
WebGLRefPtr<WebGLShader> mVertShader;
WebGLRefPtr<WebGLShader> mFragShader;
std::map<nsCString, GLuint> mBoundAttribLocs;
std::vector<nsCString> mTransformFeedbackVaryings;
GLenum mTransformFeedbackBufferMode;
nsCString mLinkLog;
RefPtr<const webgl::LinkedProgramInfo> mMostRecentLinkInfo;
// Storage for transform feedback varyings before link.
// (Work around for bug seen on nVidia drivers.)
std::vector<std::string> mTempMappedVaryings;
};
} // namespace mozilla

View File

@ -354,6 +354,44 @@ WebGLShader::FindUniformBlockByMappedName(const nsACString& mappedName,
return false;
}
void
WebGLShader::ApplyTransformFeedbackVaryings(GLuint prog,
const std::vector<nsCString>& varyings,
GLenum bufferMode,
std::vector<std::string>* out_mappedVaryings) const
{
MOZ_ASSERT(mType == LOCAL_GL_VERTEX_SHADER);
MOZ_ASSERT(!varyings.empty());
MOZ_ASSERT(out_mappedVaryings);
const size_t varyingsCount = varyings.size();
std::vector<std::string> mappedVaryings;
for (size_t i = 0; i < varyingsCount; i++) {
const nsCString& userName = varyings[i];
std::string userNameStr(userName.BeginReading());
const std::string* mappedNameStr = &userNameStr;
// TODO: Are vertex->fragment shader varyings listed under attribs?
if (mValidator)
mValidator->FindAttribMappedNameByUserName(userNameStr, &mappedNameStr);
mappedVaryings.push_back(*mappedNameStr);
}
// Temporary, tight packed array of string pointers into mappedVaryings.
std::vector<const GLchar*> strings;
strings.resize(varyingsCount);
for (size_t i = 0; i < varyingsCount; i++) {
strings[i] = mappedVaryings[i].c_str();
}
mContext->MakeContextCurrent();
mContext->gl->fTransformFeedbackVaryings(prog, varyingsCount, &strings[0], bufferMode);
out_mappedVaryings->swap(mappedVaryings);
}
////////////////////////////////////////////////////////////////////////////////
// Boilerplate

View File

@ -59,6 +59,11 @@ public:
return mTranslationSuccessful && mCompilationSuccessful;
}
void ApplyTransformFeedbackVaryings(GLuint prog,
const std::vector<nsCString>& varyings,
GLenum bufferMode,
std::vector<std::string>* out_mappedVaryings) const;
// Other funcs
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
void Delete();

View File

@ -304,10 +304,6 @@ WebCryptoTask::CalculateResult()
{
MOZ_ASSERT(!NS_IsMainThread());
if (NS_FAILED(mEarlyRv)) {
return mEarlyRv;
}
if (isAlreadyShutDown()) {
return NS_ERROR_DOM_UNKNOWN_ERR;
}
@ -2992,6 +2988,7 @@ WebCryptoTask::CreateExportKeyTask(const nsAString& aFormat,
algName.EqualsLiteral(WEBCRYPTO_ALG_HMAC) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_RSASSA_PKCS1) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_RSA_OAEP) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_ECDSA) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_ECDH) ||
algName.EqualsLiteral(WEBCRYPTO_ALG_DH)) {
return new ExportKeyTask(aFormat, aKey);

View File

@ -10,6 +10,7 @@ support-files =
[test_WebCrypto.html]
[test_WebCrypto_DH.html]
[test_WebCrypto_ECDH.html]
[test_WebCrypto_ECDSA.html]
[test_WebCrypto_JWK.html]
[test_WebCrypto_Normalize.html]
[test_WebCrypto_PBKDF2.html]

View File

@ -67,6 +67,25 @@ TestArray.addTest(
}
);
// -----------------------------------------------------------------------------
TestArray.addTest(
"ECDSA key generation with public key export",
function() {
var that = this;
var alg = { name: "ECDSA", namedCurve: "P-256", hash: "SHA-256" };
var msg = Uint8Array.from([1]);
crypto.subtle.generateKey(alg, false, ["sign", "verify"])
.then(pair => Promise.all([
crypto.subtle.sign(alg, pair.privateKey, msg),
crypto.subtle.exportKey("spki", pair.publicKey)
.then(spki => crypto.subtle.importKey("spki", spki, alg, false, ["verify"]))
]))
.then(sigAndKey => crypto.subtle.verify(alg, sigAndKey[1], sigAndKey[0], msg))
.then(complete(that), error(that))
}
);
// -----------------------------------------------------------------------------
TestArray.addTest(
"ECDSA JWK import and reject a known-bad signature",
@ -131,9 +150,9 @@ TestArray.addTest(
<body>
<div id="content">
<div id="head">
<b>Web</b>Crypto<br>
</div>
<div id="head">
<b>Web</b>Crypto<br>
</div>
<div id="start" onclick="start();">RUN ALL</div>

View File

@ -168,6 +168,10 @@ const kEventConstructors = {
return new DeviceProximityEvent(aName, aProps);
},
},
DeviceStorageAreaChangedEvent: { create: function (aName, aProps) {
return new DeviceStorageAreaChangedEvent(aName, aProps);
},
},
DeviceStorageChangeEvent: { create: function (aName, aProps) {
return new DeviceStorageChangeEvent(aName, aProps);
},

View File

@ -634,7 +634,7 @@ public:
NS_WARNING(nsPrintfCString("Fetch ignoring illegal header - '%s': '%s'",
PromiseFlatCString(aHeader).get(),
PromiseFlatCString(aValue).get()).get());
result.ClearMessage();
result.SuppressException();
}
return NS_OK;
}

View File

@ -26,14 +26,8 @@ HTMLBRElement::~HTMLBRElement()
{
}
NS_IMPL_ISUPPORTS_INHERITED(HTMLBRElement, nsGenericHTMLElement,
nsIDOMHTMLBRElement)
NS_IMPL_ELEMENT_CLONE(HTMLBRElement)
NS_IMPL_STRING_ATTR(HTMLBRElement, Clear, clear)
static const nsAttrValue::EnumTable kClearTable[] = {
{ "left", NS_STYLE_CLEAR_LEFT },
{ "right", NS_STYLE_CLEAR_RIGHT },

View File

@ -7,25 +7,17 @@
#define mozilla_dom_HTMLBRElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLBRElement.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
namespace mozilla {
namespace dom {
class HTMLBRElement final : public nsGenericHTMLElement,
public nsIDOMHTMLBRElement
class HTMLBRElement final : public nsGenericHTMLElement
{
public:
explicit HTMLBRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMHTMLBRElement
NS_DECL_NSIDOMHTMLBRELEMENT
virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
@ -42,6 +34,10 @@ public:
{
return SetHTMLAttr(nsGkAtoms::clear, aClear, aError);
}
void GetClear(DOMString& aClear) const
{
return GetHTMLAttr(nsGkAtoms::clear, aClear);
}
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;

View File

@ -18,9 +18,6 @@ HTMLDivElement::~HTMLDivElement()
{
}
NS_IMPL_ISUPPORTS_INHERITED(HTMLDivElement, nsGenericHTMLElement,
nsIDOMHTMLDivElement)
NS_IMPL_ELEMENT_CLONE(HTMLDivElement)
JSObject*

View File

@ -7,13 +7,11 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLDivElement.h"
namespace mozilla {
namespace dom {
class HTMLDivElement final : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
class HTMLDivElement final : public nsGenericHTMLElement
{
public:
explicit HTMLDivElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
@ -21,24 +19,6 @@ public:
{
}
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMHTMLDivElement
NS_IMETHOD GetAlign(nsAString& aAlign) override
{
DOMString align;
GetAlign(align);
align.ToString(aAlign);
return NS_OK;
}
NS_IMETHOD SetAlign(const nsAString& aAlign) override
{
mozilla::ErrorResult rv;
SetAlign(aAlign, rv);
return rv.ErrorCode();
}
void GetAlign(DOMString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);

View File

@ -21,9 +21,6 @@ HTMLHeadingElement::~HTMLHeadingElement()
{
}
NS_IMPL_ISUPPORTS_INHERITED(HTMLHeadingElement, nsGenericHTMLElement,
nsIDOMHTMLHeadingElement)
NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement)
JSObject*
@ -32,9 +29,6 @@ HTMLHeadingElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
return HTMLHeadingElementBinding::Wrap(aCx, this, aGivenProto);
}
NS_IMPL_STRING_ATTR(HTMLHeadingElement, Align, align)
bool
HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,

View File

@ -7,14 +7,12 @@
#define mozilla_dom_HTMLHeadingElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLHeadingElement.h"
#include "nsGenericHTMLElement.h"
namespace mozilla {
namespace dom {
class HTMLHeadingElement final : public nsGenericHTMLElement,
public nsIDOMHTMLHeadingElement
class HTMLHeadingElement final : public nsGenericHTMLElement
{
public:
explicit HTMLHeadingElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
@ -22,12 +20,6 @@ public:
{
}
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMHTMLHeadingElement
NS_DECL_NSIDOMHTMLHEADINGELEMENT
virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
@ -36,8 +28,14 @@ public:
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
// The XPCOM versions of GetAlign and SetAlign are fine for us for
// use from WebIDL.
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
{
return SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
}
void GetAlign(DOMString& aAlign) const
{
return GetHTMLAttr(nsGkAtoms::align, aAlign);
}
protected:
virtual ~HTMLHeadingElement();

View File

@ -24,13 +24,8 @@ HTMLTableCaptionElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenPr
return HTMLTableCaptionElementBinding::Wrap(aCx, this, aGivenProto);
}
NS_IMPL_ISUPPORTS_INHERITED(HTMLTableCaptionElement, nsGenericHTMLElement,
nsIDOMHTMLTableCaptionElement)
NS_IMPL_ELEMENT_CLONE(HTMLTableCaptionElement)
NS_IMPL_STRING_ATTR(HTMLTableCaptionElement, Align, align)
static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
{ "left", NS_STYLE_CAPTION_SIDE_LEFT },
{ "right", NS_STYLE_CAPTION_SIDE_RIGHT },

View File

@ -7,13 +7,11 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableCaptionElem.h"
namespace mozilla {
namespace dom {
class HTMLTableCaptionElement final : public nsGenericHTMLElement,
public nsIDOMHTMLTableCaptionElement
class HTMLTableCaptionElement final : public nsGenericHTMLElement
{
public:
explicit HTMLTableCaptionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
@ -22,12 +20,6 @@ public:
SetHasWeirdParserInsertionMode();
}
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMHTMLTableCaptionElement
NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT
void GetAlign(DOMString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);

View File

@ -326,9 +326,8 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableElement, Element)
// QueryInterface implementation for HTMLTableElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableElement)
NS_INTERFACE_TABLE_INHERITED(HTMLTableElement, nsIDOMHTMLTableElement)
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLTableElement)
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLTableElement)

View File

@ -7,7 +7,6 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableElement.h"
#include "mozilla/dom/HTMLTableCaptionElement.h"
#include "mozilla/dom/HTMLTableSectionElement.h"
@ -18,8 +17,7 @@ namespace dom {
class TableRowsCollection;
class HTMLTableElement final : public nsGenericHTMLElement,
public nsIDOMHTMLTableElement
class HTMLTableElement final : public nsGenericHTMLElement
{
public:
explicit HTMLTableElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);

View File

@ -28,7 +28,7 @@ HTMLTitleElement::~HTMLTitleElement()
}
NS_IMPL_ISUPPORTS_INHERITED(HTMLTitleElement, nsGenericHTMLElement,
nsIDOMHTMLTitleElement, nsIMutationObserver)
nsIMutationObserver)
NS_IMPL_ELEMENT_CLONE(HTMLTitleElement)
@ -38,20 +38,18 @@ HTMLTitleElement::WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
return HTMLTitleElementBinding::Wrap(cx, this, aGivenProto);
}
NS_IMETHODIMP
HTMLTitleElement::GetText(nsAString& aTitle)
void
HTMLTitleElement::GetText(DOMString& aText, ErrorResult& aError)
{
if (!nsContentUtils::GetNodeTextContent(this, false, aTitle)) {
return NS_ERROR_OUT_OF_MEMORY;
if (!nsContentUtils::GetNodeTextContent(this, false, aText)) {
aError = NS_ERROR_OUT_OF_MEMORY;
}
return NS_OK;
}
NS_IMETHODIMP
HTMLTitleElement::SetText(const nsAString& aTitle)
void
HTMLTitleElement::SetText(const nsAString& aText, ErrorResult& aError)
{
return nsContentUtils::SetNodeTextContent(this, aTitle, true);
aError = nsContentUtils::SetNodeTextContent(this, aText, true);
}
void

View File

@ -7,7 +7,6 @@
#define mozilla_dom_HTMLTITLEElement_h_
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLTitleElement.h"
#include "nsGenericHTMLElement.h"
#include "nsStubMutationObserver.h"
@ -17,7 +16,6 @@ class ErrorResult;
namespace dom {
class HTMLTitleElement final : public nsGenericHTMLElement,
public nsIDOMHTMLTitleElement,
public nsStubMutationObserver
{
public:
@ -29,15 +27,9 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMHTMLTitleElement
NS_DECL_NSIDOMHTMLTITLEELEMENT
//HTMLTitleElement
//The xpcom GetTextContent() never fails so we just use that.
void SetText(const nsAString& aText, ErrorResult& aError)
{
aError = SetText(aText);
}
void GetText(DOMString& aText, ErrorResult& aError);
void SetText(const nsAString& aText, ErrorResult& aError);
// nsIMutationObserver
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED

View File

@ -128,7 +128,7 @@ class RestoreSelectionState;
class nsTextEditorState : public mozilla::SupportsWeakPtr<nsTextEditorState> {
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(nsTextEditorState)
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(nsTextEditorState)
explicit nsTextEditorState(nsITextControlElement* aOwningElement);
~nsTextEditorState();

View File

@ -6419,6 +6419,7 @@
"[[\"stylewithcss\",\"true\"],[\"inserttext\",\"a\"]] \"[foo<u>bar]</u>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"inserttext\",\"a\"]] \"[foo<u>bar]</u>baz\" compare innerHTML":true,
"[[\"inserttext\",\"a\"]] \"[foo<a href=http://www.google.com>bar]</a>baz\" compare innerHTML":true,
"[[\"inserttext\",\"a\"]] \"foo<font color=brown><a href=http://www.google.com>[bar]</a></font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"inserttext\",\"a\"]] \"[foo<font face=sans-serif>bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"inserttext\",\"a\"]] \"[foo<font face=sans-serif>bar]</font>baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"inserttext\",\"a\"]] \"[foo<font size=4>bar]</font>baz\" compare innerHTML":true,

View File

@ -253,7 +253,7 @@ skip-if = (toolkit == 'gonk' && debug) #b2g-debug(debug-only failure)
[dom/ranges/test_Range-isPointInRange.html]
skip-if = (toolkit == 'gonk' && debug) #b2g-debug(debug-only failure)
[dom/ranges/test_Range-mutations.html]
skip-if = buildapp == 'b2g' #Test timed out.
skip-if = buildapp == 'b2g' || android_version == '18' #Test timed out. Bug 1078287
[dom/ranges/test_Range-selectNode.html]
skip-if = (toolkit == 'gonk' && debug) #b2g-debug(debug-only failure)
[dom/ranges/test_Range-set.html]

View File

@ -69,7 +69,6 @@ interface nsIDOMCounter;
interface nsIDOMRect;
interface nsIDOMCSSStyleRule;
interface nsIDOMCSSStyleRuleCollection;
interface nsIDOMHTMLTableCaptionElement;
// Range
interface nsIDOMRange;

View File

@ -6,7 +6,6 @@
XPIDL_SOURCES += [
'nsIDOMCounter.idl',
'nsIDOMCSSCharsetRule.idl',
'nsIDOMCSSConditionRule.idl',
'nsIDOMCSSCounterStyleRule.idl',
'nsIDOMCSSFontFaceRule.idl',

View File

@ -1,13 +0,0 @@
/* -*- 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/. */
#include "nsIDOMCSSRule.idl"
[scriptable, uuid(756c326c-eb38-4342-95e5-5eabea809174)]
interface nsIDOMCSSCharsetRule : nsIDOMCSSRule
{
attribute DOMString encoding;
// raises(DOMException) on setting
};

View File

@ -10,12 +10,10 @@ XPIDL_SOURCES += [
'nsIDOMHTMLAreaElement.idl',
'nsIDOMHTMLBaseElement.idl',
'nsIDOMHTMLBodyElement.idl',
'nsIDOMHTMLBRElement.idl',
'nsIDOMHTMLButtonElement.idl',
'nsIDOMHTMLCanvasElement.idl',
'nsIDOMHTMLCollection.idl',
'nsIDOMHTMLDirectoryElement.idl',
'nsIDOMHTMLDivElement.idl',
'nsIDOMHTMLDocument.idl',
'nsIDOMHTMLElement.idl',
'nsIDOMHTMLEmbedElement.idl',
@ -24,7 +22,6 @@ XPIDL_SOURCES += [
'nsIDOMHTMLFrameElement.idl',
'nsIDOMHTMLFrameSetElement.idl',
'nsIDOMHTMLHeadElement.idl',
'nsIDOMHTMLHeadingElement.idl',
'nsIDOMHTMLHRElement.idl',
'nsIDOMHTMLHtmlElement.idl',
'nsIDOMHTMLIFrameElement.idl',
@ -51,11 +48,8 @@ XPIDL_SOURCES += [
'nsIDOMHTMLSelectElement.idl',
'nsIDOMHTMLSourceElement.idl',
'nsIDOMHTMLStyleElement.idl',
'nsIDOMHTMLTableCaptionElem.idl',
'nsIDOMHTMLTableCellElement.idl',
'nsIDOMHTMLTableElement.idl',
'nsIDOMHTMLTextAreaElement.idl',
'nsIDOMHTMLTitleElement.idl',
'nsIDOMHTMLUListElement.idl',
'nsIDOMMediaError.idl',
'nsIDOMMozBrowserFrame.idl',

View File

@ -1,23 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLBRElement interface is the interface to a [X]HTML br
* element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[uuid(ba8fb51a-e552-4272-b3df-5e63a60b86ee)]
interface nsIDOMHTMLBRElement : nsISupports
{
attribute DOMString clear;
};

View File

@ -1,23 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLDivElement interface is the interface to a [X]HTML
* div element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[uuid(d1b51f44-38e0-4496-8236-b795e36df0e2)]
interface nsIDOMHTMLDivElement : nsISupports
{
attribute DOMString align;
};

View File

@ -1,23 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLHeadingElement interface is the interface to a
* [X]HTML h1, h2, h3, ... element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[uuid(a40b92f7-9da7-4c9f-8a0c-cf5b9e28bb30)]
interface nsIDOMHTMLHeadingElement : nsISupports
{
attribute DOMString align;
};

View File

@ -1,23 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLTableCaptionElement interface is the interface to a
* [X]HTML caption element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[builtinclass, uuid(78f0635b-44d2-4d5c-87de-29d54df6aed6)]
interface nsIDOMHTMLTableCaptionElement : nsISupports
{
attribute DOMString align;
};

View File

@ -1,22 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLTableElement interface is the interface to a [X]HTML
* table element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[uuid(135a30ee-0374-4ee7-9d36-91736bff5fb1)]
interface nsIDOMHTMLTableElement : nsISupports
{
};

View File

@ -1,23 +0,0 @@
/* -*- 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/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLTitleElement interface is the interface to a [X]HTML
* title element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[uuid(e8e5168a-e12e-4946-9fa7-5fe0d6932198)]
interface nsIDOMHTMLTitleElement : nsISupports
{
attribute DOMString text;
};

View File

@ -0,0 +1,18 @@
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
/* 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 ServiceWorkerRegistrarTypes;
namespace mozilla {
namespace dom {
struct BrowserConfiguration
{
ServiceWorkerRegistrationData[] serviceWorkerRegistrations;
};
} // namespace dom
} // namespace mozilla

View File

@ -51,6 +51,7 @@
#include "mozilla/dom/PCycleCollectWithLogsParent.h"
#include "mozilla/dom/PFMRadioParent.h"
#include "mozilla/dom/PMemoryReportRequestParent.h"
#include "mozilla/dom/ServiceWorkerRegistrar.h"
#include "mozilla/dom/asmjscache/AsmJSCache.h"
#include "mozilla/dom/bluetooth/PBluetoothParent.h"
#include "mozilla/dom/cellbroadcast/CellBroadcastParent.h"
@ -4995,6 +4996,28 @@ ContentParent::DeallocPContentPermissionRequestParent(PContentPermissionRequestP
return true;
}
bool
ContentParent::RecvGetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration* aConfig)
{
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
return GetBrowserConfiguration(aURI, *aConfig);;
}
/*static*/ bool
ContentParent::GetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration& aConfig)
{
if (XRE_GetProcessType() == GeckoProcessType_Default) {
nsRefPtr<ServiceWorkerRegistrar> swr = ServiceWorkerRegistrar::Get();
MOZ_ASSERT(swr);
swr->GetRegistrations(aConfig.serviceWorkerRegistrations());
return true;
}
return ContentChild::GetSingleton()->SendGetBrowserConfiguration(aURI, &aConfig);
}
bool
ContentParent::RecvGamepadListenerAdded()
{

View File

@ -218,6 +218,9 @@ public:
static void
DeallocateTabId(const TabId& aTabId, const ContentParentId& aCpId);
static bool
GetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration& aConfig);
void ReportChildAlreadyBlocked();
bool RequestRunToCompletion();
@ -843,6 +846,8 @@ private:
virtual bool RecvUpdateDropEffect(const uint32_t& aDragAction,
const uint32_t& aDropEffect) override;
virtual bool RecvGetBrowserConfiguration(const nsCString& aURI, BrowserConfiguration* aConfig) override;
virtual bool RecvGamepadListenerAdded() override;
virtual bool RecvGamepadListenerRemoved() override;

View File

@ -17,7 +17,7 @@ include protocol PPluginWidget;
include DOMTypes;
include JavaScriptTypes;
include URIParams;
include ServiceWorkerRegistrarTypes;
include BrowserConfiguration;
using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
@ -70,11 +70,6 @@ struct NativeKeyBinding
CommandInt[] richTextCommands;
};
struct BrowserConfiguration
{
ServiceWorkerRegistrationData[] serviceWorkerRegistrations;
};
union MaybeNativeKeyBinding
{
NativeKeyBinding;

View File

@ -58,6 +58,7 @@ include URIParams;
include PluginTypes;
include ProtocolTypes;
include PContentPermission;
include BrowserConfiguration;
// Workaround to prevent error if PContentChild.cpp & PContentBridgeParent.cpp
// are put into different UnifiedProtocolsXX.cpp files.
@ -1028,6 +1029,12 @@ parent:
PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
TabId tabId);
/**
* Send ServiceWorkerRegistrationData to child process.
*/
sync GetBrowserConfiguration(nsCString aUri)
returns (BrowserConfiguration aConfig);
/*
* Tells the parent to start the gamepad listening service if it hasn't already.
*/

View File

@ -13,7 +13,6 @@
#include "mozilla/BrowserElementParent.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/DataTransfer.h"
#include "mozilla/dom/ServiceWorkerRegistrar.h"
#include "mozilla/dom/indexedDB/ActorsParent.h"
#include "mozilla/plugins/PluginWidgetParent.h"
#include "mozilla/EventStateManager.h"
@ -754,16 +753,10 @@ TabParent::SendLoadRemoteScript(const nsString& aURL,
}
bool
TabParent::InitBrowserConfiguration(nsIURI* aURI,
TabParent::InitBrowserConfiguration(const nsCString& aURI,
BrowserConfiguration& aConfiguration)
{
// Get the list of ServiceWorkerRegistation for this origin.
nsRefPtr<ServiceWorkerRegistrar> swr = ServiceWorkerRegistrar::Get();
MOZ_ASSERT(swr);
swr->GetRegistrations(aConfiguration.serviceWorkerRegistrations());
return true;
return ContentParent::GetBrowserConfiguration(aURI, aConfiguration);
}
void
@ -795,7 +788,7 @@ TabParent::LoadURL(nsIURI* aURI)
// This object contains the configuration for this new app.
BrowserConfiguration configuration;
if (NS_WARN_IF(!InitBrowserConfiguration(aURI, configuration))) {
if (NS_WARN_IF(!InitBrowserConfiguration(spec, configuration))) {
return;
}

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