Merge m-c to inbound, a=merge

--HG--
extra : commitid : CprilDXCNVx
This commit is contained in:
Wes Kocher 2015-10-27 14:15:23 -07:00
commit 8d99befba7
109 changed files with 1050 additions and 766 deletions

View File

@ -679,7 +679,7 @@ pref("javascript.options.mem.gc_max_empty_chunk_count", 2);
pref("ui.showHideScrollbars", 1);
pref("ui.useOverlayScrollbars", 1);
pref("ui.scrollbarFadeBeginDelay", 450);
pref("ui.scrollbarFadeDuration", 200);
pref("ui.scrollbarFadeDuration", 0);
// Scrollbar position follows the document `dir` attribute
pref("layout.scrollbar.side", 1);

View File

@ -403,17 +403,14 @@ var shell = {
webNav.QueryInterface(Ci.nsIDocShell).windowDraggingAllowed = true;
#endif
this.allowedAudioChannels = new Map();
let audioChannels = systemAppFrame.allowedAudioChannels;
audioChannels && audioChannels.forEach(function(audioChannel) {
this.allowedAudioChannels.set(audioChannel.name, audioChannel);
audioChannel.addEventListener('activestatechanged', this);
// Set all audio channels as unmuted by default
// because some audio in System app will be played
// before AudioChannelService[1] is Gaia is loaded.
// [1]: https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/audio_channel_service.js
audioChannel.setMuted(false);
}.bind(this));
});
// On firefox mulet, shell.html is loaded in a tab
// and we have to listen on the chrome event handler
@ -683,18 +680,6 @@ var shell = {
case 'unload':
this.stop();
break;
case 'activestatechanged':
var channel = evt.target;
// TODO: We should get the `isActive` state from evt.isActive.
// Then we don't need to do `channel.isActive()` here.
channel.isActive().onsuccess = function(evt) {
SystemAppProxy._sendCustomEvent('mozSystemWindowChromeEvent', {
type: 'system-audiochannel-state-changed',
name: channel.name,
isActive: evt.target.result
});
}.bind(this);
break;
}
},
@ -904,11 +889,6 @@ var CustomEventManager = {
case 'inputregistry-remove':
KeyboardHelper.handleEvent(detail);
break;
case 'system-audiochannel-list':
case 'system-audiochannel-mute':
case 'system-audiochannel-volume':
SystemAppMozBrowserHelper.handleEvent(detail);
break;
case 'do-command':
DoCommandHelper.handleEvent(detail.cmd);
break;
@ -1076,63 +1056,6 @@ var KeyboardHelper = {
}
};
var SystemAppMozBrowserHelper = {
handleEvent: function systemAppMozBrowser_handleEvent(detail) {
let request;
let name;
switch (detail.type) {
case 'system-audiochannel-list':
let audioChannels = [];
shell.allowedAudioChannels.forEach(function(value, name) {
audioChannels.push(name);
});
SystemAppProxy._sendCustomEvent('mozSystemWindowChromeEvent', {
type: 'system-audiochannel-list',
audioChannels: audioChannels
});
break;
case 'system-audiochannel-mute':
name = detail.name;
let isMuted = detail.isMuted;
request = shell.allowedAudioChannels.get(name).setMuted(isMuted);
request.onsuccess = function() {
SystemAppProxy._sendCustomEvent('mozSystemWindowChromeEvent', {
type: 'system-audiochannel-mute-onsuccess',
name: name,
isMuted: isMuted
});
};
request.onerror = function() {
SystemAppProxy._sendCustomEvent('mozSystemWindowChromeEvent', {
type: 'system-audiochannel-mute-onerror',
name: name,
isMuted: isMuted
});
};
break;
case 'system-audiochannel-volume':
name = detail.name;
let volume = detail.volume;
request = shell.allowedAudioChannels.get(name).setVolume(volume);
request.onsuccess = function() {
sSystemAppProxy._sendCustomEvent('mozSystemWindowChromeEvent', {
type: 'system-audiochannel-volume-onsuccess',
name: name,
volume: volume
});
};
request.onerror = function() {
SystemAppProxy._sendCustomEvent('mozSystemWindowChromeEvent', {
type: 'system-audiochannel-volume-onerror',
name: name,
volume: volume
});
};
break;
}
}
};
// This is the backend for Gaia's screenshot feature. Gaia requests a
// screenshot by sending a mozContentEvent with detail.type set to
// 'take-screenshot'. Then we take a screenshot and send a

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
@ -24,7 +24,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
@ -24,7 +24,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

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="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

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="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<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="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<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="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

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="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
@ -24,7 +24,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "b6ede3d0fdec5fc922e9ca3401e60db461bf705c",
"git_revision": "a26eadc5e1133d5112b6cbc10badbb7670a1090f",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "220b45ec153f267a2efc58275a30a665a4ec9e57",
"revision": "a99ff14b3258f49f5902775a5e3b849f3455714a",
"repo_path": "integration/gaia-central"
}

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
@ -24,7 +24,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

View File

@ -18,10 +18,10 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b6ede3d0fdec5fc922e9ca3401e60db461bf705c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="a26eadc5e1133d5112b6cbc10badbb7670a1090f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
@ -24,7 +24,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
<project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1837d370a964a9719160c79155a07980f2ea4bdf"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<!-- 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"/>

View File

@ -936,8 +936,8 @@ chatbox[customSize] {
}
chatbox[customSize="loopChatEnabled"] {
/* 325px as defined per UX */
height: 325px;
/* 430px as defined per UX */
height: 430px;
}
#chat-window[customSize="loopChatEnabled"] {
@ -946,8 +946,13 @@ chatbox[customSize="loopChatEnabled"] {
}
chatbox[customSize="loopChatMessageAppended"] {
/* 400px as defined per UX */
height: 400px;
/* 430px as defined per UX */
height: 430px;
}
chatbox[customSize="loopChatDisabledMessageAppended"] {
/* 388px as defined per UX */
height: 388px;
}
#chat-window[customSize="loopChatMessageAppended"] {
@ -971,8 +976,8 @@ chatbar {
}
chatbar[customSize] > .chatbar-innerbox {
/* 425px to make room for the maximum custom-size chatbox; currently 'loopChatMessageAppended'. */
margin-top: -425px;
/* 450px to make room for the maximum custom-size chatbox; currently 'loopChatMessageAppended'. */
margin-top: -450px;
}
/* Apply crisp rendering for favicons at exactly 2dppx resolution */

View File

@ -2,6 +2,7 @@
support-files =
file_dom_notifications.html
[browser_notification_close.js]
[browser_notification_do_not_disturb.js]
[browser_notification_open_settings.js]
[browser_notification_remove_permission.js]

View File

@ -0,0 +1,48 @@
"use strict";
let tab;
let notification;
let notificationURL = "http://example.org/browser/browser/base/content/test/alerts/file_dom_notifications.html";
add_task(function* test_notificationClose() {
let pm = Services.perms;
pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION);
yield BrowserTestUtils.withNewTab({
gBrowser,
url: notificationURL
}, function* dummyTabTask(aBrowser) {
let win = aBrowser.contentWindow.wrappedJSObject;
notification = win.showNotification2();
yield BrowserTestUtils.waitForEvent(notification, "show");
info("Notification alert showing");
let alertWindow = Services.wm.getMostRecentWindow("alert:alert");
if (!alertWindow) {
ok(true, "Notifications don't use XUL windows on all platforms.");
notification.close();
return;
}
let alertCloseButton = alertWindow.document.querySelector(".alertCloseButton");
is(alertCloseButton.localName, "toolbarbutton", "close button found");
let promiseBeforeUnloadEvent =
BrowserTestUtils.waitForEvent(alertWindow, "beforeunload");
let closedTime = alertWindow.Date.now();
alertCloseButton.click();
info("Clicked on close button");
let beforeUnloadEvent = yield promiseBeforeUnloadEvent;
ok(true, "Alert should close when the close button is clicked");
let currentTime = alertWindow.Date.now();
// The notification will self-close at 12 seconds, so this checks
// that the notification closed before the timeout.
ok(currentTime - closedTime < 5000,
"Close requested at " + closedTime + ", actually closed at " + currentTime);
});
});
add_task(function* cleanup() {
Services.perms.remove(makeURI(notificationURL), "desktop-notification");
});

View File

@ -64,7 +64,7 @@ function onAlertShowing() {
is(doNotDisturbMenuItem.localName, "menuitem", "menuitem found");
alertWindow.addEventListener("beforeunload", onAlertClosing);
doNotDisturbMenuItem.click();
info("Clicked on do-not-disturb menuitem")
info("Clicked on do-not-disturb menuitem");
}
function onAlertClosing(event) {

View File

@ -199,10 +199,16 @@ extensions.registerAPI((extension, context) => {
},
onLocationChange(browser, webProgress, request, locationURI, flags) {
if (!webProgress.isTopLevel) {
return;
}
let gBrowser = browser.ownerDocument.defaultView.gBrowser;
let tab = gBrowser.getTabForBrowser(browser);
let tabId = TabManager.getId(tab);
let [needed, changeInfo] = sanitize(extension, {url: locationURI.spec});
let [needed, changeInfo] = sanitize(extension, {
status: webProgress.isLoadingDocument ? "loading" : "complete",
url: locationURI.spec
});
if (needed) {
fire(tabId, changeInfo, TabManager.convert(extension, tab));
}
@ -213,11 +219,12 @@ extensions.registerAPI((extension, context) => {
AllWindowEvents.addListener("TabAttrModified", listener);
AllWindowEvents.addListener("TabPinned", listener);
AllWindowEvents.addListener("TabUnpinned", listener);
return () => {
AllWindowEvents.removeListener("progress", progressListener);
AllWindowEvents.addListener("TabAttrModified", listener);
AllWindowEvents.addListener("TabPinned", listener);
AllWindowEvents.addListener("TabUnpinned", listener);
AllWindowEvents.removeListener("TabAttrModified", listener);
AllWindowEvents.removeListener("TabPinned", listener);
AllWindowEvents.removeListener("TabUnpinned", listener);
};
}).api(),

View File

@ -530,7 +530,7 @@ global.AllWindowEvents = {
let listeners = this._listeners.get(type);
listeners.delete(listener);
if (listeners.length == 0) {
if (listeners.size == 0) {
this._listeners.delete(type);
if (this._listeners.size == 0) {
WindowListManager.removeOpenListener(this.openListener);

View File

@ -3,6 +3,8 @@ support-files =
head.js
context.html
ctxmenu-image.png
context_tabs_onUpdated_page.html
context_tabs_onUpdated_iframe.html
[browser_ext_simple.js]
[browser_ext_currentWindow.js]
@ -16,6 +18,7 @@ support-files =
[browser_ext_tabs_executeScript.js]
[browser_ext_tabs_query.js]
[browser_ext_tabs_update.js]
[browser_ext_tabs_onUpdated.js]
[browser_ext_tabs_sendMessage.js]
[browser_ext_windows_update.js]
[browser_ext_contentscript_connect.js]

View File

@ -1,21 +1,3 @@
function* focusWindow(win)
{
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
if (fm.activeWindow == win) {
return;
}
let promise = new Promise(resolve => {
win.addEventListener("focus", function listener() {
win.removeEventListener("focus", listener, true);
resolve();
}, true);
});
win.focus();
yield promise;
}
function genericChecker()
{
var kind = "background";

View File

@ -0,0 +1,78 @@
add_task(function* () {
let win1 = yield BrowserTestUtils.openNewBrowserWindow();
yield focusWindow(win1);
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"permissions": ["tabs"],
"content_scripts": [{
"matches": ["http://mochi.test/*/context_tabs_onUpdated_page.html"],
"js": ["content-script.js"],
"run_at": "document_start"
},],
},
background: function() {
var pageURL = "http://mochi.test:8888/browser/browser/components/extensions/test/browser/context_tabs_onUpdated_page.html";
var expectedSequence = [
{ status: "loading" },
{ status: "loading", url: pageURL },
{ status: "complete" }
];
var collectedSequence = [];
browser.tabs.onUpdated.addListener(function (tabId, updatedInfo) {
collectedSequence.push(updatedInfo);
});
browser.runtime.onMessage.addListener(function () {
if (collectedSequence.length !== expectedSequence.length) {
browser.test.assertEq(
JSON.stringify(expectedSequence),
JSON.stringify(collectedSequence),
"got unexpected number of updateInfo data"
);
} else {
for (var i = 0; i < expectedSequence.length; i++) {
browser.test.assertEq(
expectedSequence[i].status,
collectedSequence[i].status,
"check updatedInfo status"
);
if (expectedSequence[i].url || collectedSequence[i].url) {
browser.test.assertEq(
expectedSequence[i].url,
collectedSequence[i].url,
"check updatedInfo url"
);
}
}
}
browser.test.notifyPass("tabs.onUpdated");
});
browser.tabs.create({ url: pageURL });
},
files: {
"content-script.js": `
window.addEventListener("message", function(evt) {
if (evt.data == "frame-updated") {
browser.runtime.sendMessage("load-completed");
}
}, true);
`,
}
});
yield Promise.all([
extension.startup(),
extension.awaitFinish("tabs.onUpdated")
]);
yield extension.unload();
yield BrowserTestUtils.closeWindow(win1);
});

View File

@ -0,0 +1,17 @@
<html>
<body>
<h3>test iframe</h3>
<script>
window.onload = function() {
window.onhashchange = function() {
window.parent.postMessage("updated-iframe-url", "*");
}
// NOTE: without the this setTimeout the location change is not fired
// even without the "fire only for top level windows" fix
setTimeout(function() {
window.location.hash="updated-iframe-url";
}, 0);
}
</script>
</body>
</html>

View File

@ -0,0 +1,16 @@
<html>
<body>
<h3>test page</h3>
<iframe src="about:blank"></iframe>
<script>
window.onmessage = function(evt) {
if (evt.data === "updated-iframe-url") {
window.postMessage("frame-updated", "*");
}
};
window.onload = function() {
document.querySelector('iframe').setAttribute("src", "context_tabs_onUpdated_iframe.html");
};
</script>
</body>
</html>

View File

@ -5,3 +5,21 @@ function makeWidgetId(id)
id = id.toLowerCase();
return id.replace(/[^a-z0-9_-]/g, "_");
}
function* focusWindow(win)
{
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
if (fm.activeWindow == win) {
return;
}
let promise = new Promise(resolve => {
win.addEventListener("focus", function listener() {
win.removeEventListener("focus", listener, true);
resolve();
}, true);
});
win.focus();
yield promise;
}

View File

@ -530,13 +530,13 @@ body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
}
.context-url-view-wrapper {
padding: 12px;
margin-bottom: 0.5em;
padding: 14px 15px;
background-color: #dbf7ff;
}
.showing-room-name > .text-chat-entries > .text-chat-scroller > .context-url-view-wrapper {
padding-top: 0;
margin-bottom: 0;
}
.room-context {
@ -755,7 +755,7 @@ body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
.media-wrapper > .focus-stream {
width: 100%;
/* A reasonable height */
height: 70%;
height: 55%;
}
.media-wrapper.receiving-screen-share > .focus-stream {
@ -831,7 +831,7 @@ body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
.desktop-room-wrapper > .media-layout > .media-wrapper > .text-chat-view {
/* This is temp, to echo the .media-wrapper > .text-chat-view above */
height: 30%;
height: 45%;
}
.media-wrapper.receiving-screen-share > .screen {
@ -930,7 +930,12 @@ body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
.media-wrapper > .focus-stream {
flex: 1 1 auto;
height: auto;
/* To keep the aspect ratio of video. Update accordingly with chatbox[customSize] width */
height: 263px;
}
.desktop-room-wrapper > .media-layout > .media-wrapper > .text-chat-view {
height: calc(100% - 263px);
}
}
@ -960,6 +965,10 @@ body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
text-align: start;
}
.text-chat-scroller div:nth-child(2) {
margin-top: .5em;
}
/* Sent text chat entries should be on the right */
.text-chat-entry.sent {
/* aligns paragraph to right side */
@ -1208,8 +1217,6 @@ html[dir="rtl"] .text-chat-entry.received .text-chat-arrow {
.text-chat-view {
display: flex;
flex-flow: column nowrap;
/* 120px max-height of .text-chat-entries plus 40px of .text-chat-box */
max-height: 160px;
/* 60px min-height of .text-chat-entries plus 40px of .text-chat-box */
min-height: 100px;
height: auto;
@ -1220,7 +1227,6 @@ html[dir="rtl"] .text-chat-entry.received .text-chat-arrow {
.text-chat-entries {
flex: 1 1 auto;
max-height: 120px;
min-height: 60px;
}

View File

@ -119,7 +119,11 @@ loop.store.TextChatStore = (function() {
// Notify MozLoopService if appropriate that a message has been appended
// and it should therefore check if we need a different sized window or not.
if (message.contentType !== CHAT_CONTENT_TYPES.ROOM_NAME) {
window.dispatchEvent(new CustomEvent("LoopChatMessageAppended"));
if (this._storeState.textChatEnabled) {
window.dispatchEvent(new CustomEvent("LoopChatMessageAppended"));
} else {
window.dispatchEvent(new CustomEvent("LoopChatDisabledMessageAppended"));
}
}
},

View File

@ -963,6 +963,7 @@ var MozLoopServiceInternal = {
const kSizeMap = {
LoopChatEnabled: "loopChatEnabled",
LoopChatDisabledMessageAppended: "loopChatDisabledMessageAppended",
LoopChatMessageAppended: "loopChatMessageAppended"
};
@ -981,6 +982,7 @@ var MozLoopServiceInternal = {
window.addEventListener("LoopChatEnabled", onChatEvent);
window.addEventListener("LoopChatMessageAppended", onChatEvent);
window.addEventListener("LoopChatDisabledMessageAppended", onChatEvent);
injectLoopAPI(window);

View File

@ -96,6 +96,7 @@ describe("loop.store.TextChatStore", function() {
});
it("should dispatch a LoopChatMessageAppended event", function() {
store.setStoreState({ textChatEnabled: true });
store.receivedTextChatMessage({
contentType: CHAT_CONTENT_TYPES.TEXT,
message: "Hello!"
@ -141,6 +142,7 @@ describe("loop.store.TextChatStore", function() {
});
it("should dipatch a LoopChatMessageAppended event", function() {
store.setStoreState({ textChatEnabled: true });
store.sendTextChatMessage({
contentType: CHAT_CONTENT_TYPES.TEXT,
message: "Hello!"
@ -246,6 +248,23 @@ describe("loop.store.TextChatStore", function() {
}]);
});
it("should dispatch a LoopChatDisabledMessageAppended event", function() {
store.setStoreState({ textChatEnabled: false });
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "Let's share!",
roomUrl: "fake",
roomContextUrls: [{
description: "A wonderful event2",
location: "http://wonderful.invalid2",
thumbnail: "fake2"
}]
}));
sinon.assert.calledOnce(window.dispatchEvent);
sinon.assert.calledWithExactly(window.dispatchEvent,
new CustomEvent("LoopChatDisabledMessageAppended"));
});
it("should not dispatch a LoopChatMessageAppended event", function() {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "Let's share!",

View File

@ -898,7 +898,7 @@
),
React.createElement(Section, {name: "DesktopRoomConversationView"},
React.createElement(FramedExample, {height: 398,
React.createElement(FramedExample, {height: 448,
onContentsRendered: invitationRoomStore.activeRoomStore.forcedUpdate,
summary: "Desktop room conversation (invitation, text-chat inclusion/scrollbars don't happen in real client)",
width: 348},
@ -932,7 +932,7 @@
),
React.createElement(FramedExample, {dashed: true,
height: 398,
height: 448,
onContentsRendered: desktopRoomStoreLoading.activeRoomStore.forcedUpdate,
summary: "Desktop room conversation (loading)",
width: 348},
@ -952,7 +952,7 @@
),
React.createElement(FramedExample, {dashed: true,
height: 398,
height: 448,
onContentsRendered: roomStore.activeRoomStore.forcedUpdate,
summary: "Desktop room conversation",
width: 348},
@ -1006,7 +1006,7 @@
),
React.createElement(FramedExample, {dashed: true,
height: 398,
height: 448,
onContentsRendered: desktopLocalFaceMuteRoomStore.activeRoomStore.forcedUpdate,
summary: "Desktop room conversation local face-mute",
width: 348},
@ -1022,7 +1022,7 @@
),
React.createElement(FramedExample, {dashed: true,
height: 398,
height: 448,
onContentsRendered: desktopRemoteFaceMuteRoomStore.activeRoomStore.forcedUpdate,
summary: "Desktop room conversation remote face-mute",
width: 348},

View File

@ -898,7 +898,7 @@
</Section>
<Section name="DesktopRoomConversationView">
<FramedExample height={398}
<FramedExample height={448}
onContentsRendered={invitationRoomStore.activeRoomStore.forcedUpdate}
summary="Desktop room conversation (invitation, text-chat inclusion/scrollbars don't happen in real client)"
width={348}>
@ -932,7 +932,7 @@
</FramedExample>
<FramedExample dashed={true}
height={398}
height={448}
onContentsRendered={desktopRoomStoreLoading.activeRoomStore.forcedUpdate}
summary="Desktop room conversation (loading)"
width={348}>
@ -952,7 +952,7 @@
</FramedExample>
<FramedExample dashed={true}
height={398}
height={448}
onContentsRendered={roomStore.activeRoomStore.forcedUpdate}
summary="Desktop room conversation"
width={348}>
@ -1006,7 +1006,7 @@
</FramedExample>
<FramedExample dashed={true}
height={398}
height={448}
onContentsRendered={desktopLocalFaceMuteRoomStore.activeRoomStore.forcedUpdate}
summary="Desktop room conversation local face-mute"
width={348}>
@ -1022,7 +1022,7 @@
</FramedExample>
<FramedExample dashed={true}
height={398}
height={448}
onContentsRendered={desktopRemoteFaceMuteRoomStore.activeRoomStore.forcedUpdate}
summary="Desktop room conversation remote face-mute"
width={348} >

View File

@ -2669,20 +2669,36 @@ ContentPermissionPrompt.prototype = {
_promptWebNotifications : function(aRequest) {
var message = gBrowserBundle.GetStringFromName("webNotifications.receiveFromSite");
var actions = [
{
stringId: "webNotifications.alwaysReceive",
action: Ci.nsIPermissionManager.ALLOW_ACTION,
expireType: null,
callback: function() {},
},
{
stringId: "webNotifications.neverShow",
action: Ci.nsIPermissionManager.DENY_ACTION,
expireType: null,
callback: function() {},
},
];
var actions;
var browser = this._getBrowserForRequest(aRequest);
// Only show "allow for session" in PB mode, we don't
// support "allow for session" in non-PB mode.
if (PrivateBrowsingUtils.isBrowserPrivate(browser)) {
actions = [
{
stringId: "webNotifications.receiveForSession",
action: Ci.nsIPermissionManager.ALLOW_ACTION,
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
callback: function() {},
}
];
} else {
actions = [
{
stringId: "webNotifications.alwaysReceive",
action: Ci.nsIPermissionManager.ALLOW_ACTION,
expireType: null,
callback: function() {},
},
{
stringId: "webNotifications.neverShow",
action: Ci.nsIPermissionManager.DENY_ACTION,
expireType: null,
callback: function() {},
},
];
}
var options = {
learnMoreURL: Services.urlFormatter.formatURLPref("browser.push.warning.infoURL"),

View File

@ -375,6 +375,8 @@ geolocation.neverShareLocation.accesskey=N
geolocation.shareWithSite2=Would you like to share your location with this site?
geolocation.shareWithFile2=Would you like to share your location with this file?
webNotifications.receiveForSession=Receive for this session
webNotifications.receiveForSession.accesskey=s
webNotifications.alwaysReceive=Always Receive Notifications
webNotifications.alwaysReceive.accesskey=A
webNotifications.neverShow=Always Block Notifications

View File

@ -48,9 +48,8 @@ mozstdName=Disconnect.me basic protection (Recommended).
mozstdDesc=Allows some trackers so websites function properly.
mozfullName=Disconnect.me strict protection.
mozfullDesc=Blocks known trackers. Some sites may not function properly.
# LOCALIZATION NOTE (blocklistChangeRequiresRestart, restartTitle): %S = brandShortName
# LOCALIZATION NOTE (blocklistChangeRequiresRestart): %S = brandShortName
blocklistChangeRequiresRestart=%S must restart to change block lists.
shouldRestartTitle=Restart %S
#### Master Password

View File

@ -29,6 +29,7 @@
"mozilla/components-imports": 1,
"mozilla/import-headjs-globals": 1,
"mozilla/mark-test-function-used": 1,
"mozilla/var-only-at-top-level": 1,
// Disallow using variables outside the blocks they are defined (especially
// since only let and const are used, see "no-var").
@ -270,8 +271,9 @@
"no-unused-vars": 2,
// Allow using variables before they are defined.
"no-use-before-define": 0,
// Require let or const instead of var.
"no-var": 2,
// We use var-only-at-top-level instead of no-var as we allow top level
// vars.
"no-var": 0,
// Allow using TODO/FIXME comments.
"no-warning-comments": 0,
// Disallow use of the with statement.

View File

@ -9,7 +9,9 @@ const { getSnapshotStatusText } = require("../utils");
const { snapshotState: states } = require("../constants");
const { snapshot: snapshotModel } = require("../models");
const TAKE_SNAPSHOT_TEXT = "Take snapshot";
const TREE_ROW_HEIGHT = 10;
// If HEAP_TREE_ROW_HEIGHT changes, be sure to change `var(--heap-tree-row-height)`
// in `devtools/client/themes/memory.css`
const HEAP_TREE_ROW_HEIGHT = 14;
/**
* Creates a hash map mapping node IDs to its parent node.
@ -45,7 +47,7 @@ function createTreeProperties (census) {
renderItem: (item, depth, focused, arrow) => new TreeItem({ item, depth, focused, arrow }),
getRoots: () => census.children,
getKey: node => node.id,
itemHeight: TREE_ROW_HEIGHT,
itemHeight: HEAP_TREE_ROW_HEIGHT,
};
}
@ -85,6 +87,13 @@ const Heap = module.exports = createClass({
break;
case states.SAVED_CENSUS:
pane = dom.div({ className: "heap-view-panel", "data-state": "loaded" },
dom.div({ className: "header" },
dom.span({ className: "heap-tree-item-bytes" }, "Bytes"),
dom.span({ className: "heap-tree-item-count" }, "Count"),
dom.span({ className: "heap-tree-item-total-bytes" }, "Total Bytes"),
dom.span({ className: "heap-tree-item-total-count" }, "Total Count"),
dom.span({ className: "heap-tree-item-name" }, "Name")
),
Tree(createTreeProperties(snapshot.census))
);
break;

View File

@ -15,13 +15,15 @@ const TreeItem = module.exports = createClass({
render() {
let { item, depth, arrow, focused } = this.props;
return dom.div({ className: "heap-tree-item", style: { marginLeft: depth * INDENT }},
arrow,
dom.span({ className: "heap-tree-item-name" }, item.name),
return dom.div({ className: "heap-tree-item" },
dom.span({ className: "heap-tree-item-bytes" }, item.bytes),
dom.span({ className: "heap-tree-item-count" }, item.count),
dom.span({ className: "heap-tree-item-total-bytes" }, item.totalBytes),
dom.span({ className: "heap-tree-item-total-count" }, item.totalCount)
dom.span({ className: "heap-tree-item-total-count" }, item.totalCount),
dom.span({ className: "heap-tree-item-name", style: { marginLeft: depth * INDENT }},
arrow,
item.name
)
);
}
});

View File

@ -141,6 +141,14 @@ A marker generated via `console.timeStamp(label)`.
* DOMString causeName - the label passed into `console.timeStamp(label)`
if passed in.
## document::DOMContentLoaded
A marker generated when the DOMContentLoaded event is fired.
## document::Load
A marker generated when the document's "load" event is fired.
## Parse HTML
## Parse XML

View File

@ -91,6 +91,16 @@ const TIMELINE_BLUEPRINT = {
label: L10N.getStr("marker.label.domevent"),
fields: Formatters.DOMEventFields,
},
"document::DOMContentLoaded": {
group: 1,
colorName: "graphs-full-red",
label: "DOMContentLoaded"
},
"document::Load": {
group: 1,
colorName: "graphs-full-blue",
label: "Load"
},
"Javascript": {
group: 1,
colorName: "graphs-yellow",

View File

@ -56,6 +56,7 @@ skip-if = true # Bug 1161817
[browser_perf-loading-02.js]
[browser_perf-marker-details-01.js]
skip-if = os == 'linux' # Bug 1172120
[browser_perf-markers-docload.js]
[browser_perf-options-01.js]
[browser_perf-options-02.js]
[browser_perf-options-03.js]

View File

@ -0,0 +1,68 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if the sidebar is updated with "DOMContentLoaded" and "load" markers.
*/
function* spawnTest() {
let { panel } = yield initPerformance(SIMPLE_URL);
let { PerformanceController } = panel.panelWin;
loadFrameScripts();
yield startRecording(panel);
ok(true, "Recording has started.");
evalInDebuggee("document.location.reload()");
yield waitUntil(() => {
// Wait until we get the necessary markers.
let markers = PerformanceController.getCurrentRecording().getMarkers();
if (!markers.some(m => m.name == "document::DOMContentLoaded") ||
!markers.some(m => m.name == "document::Load")) {
return false;
}
ok(markers.filter(m => m.name == "document::DOMContentLoaded").length == 1,
"There should only be one `DOMContentLoaded` marker.");
ok(markers.filter(m => m.name == "document::Load").length == 1,
"There should only be one `load` marker.");
return true;
});
yield stopRecording(panel);
ok(true, "Recording has ended.");
yield teardown(panel);
finish();
}
/**
* Takes a string `script` and evaluates it directly in the content
* in potentially a different process.
*/
function evalInDebuggee (script) {
let { generateUUID } = Cc['@mozilla.org/uuid-generator;1'].getService(Ci.nsIUUIDGenerator);
let deferred = Promise.defer();
if (!mm) {
throw new Error("`loadFrameScripts()` must be called when using MessageManager.");
}
let id = generateUUID().toString();
mm.sendAsyncMessage("devtools:test:eval", { script: script, id: id });
mm.addMessageListener("devtools:test:eval:response", handler);
function handler ({ data }) {
if (id !== data.id) {
return;
}
mm.removeMessageListener("devtools:test:eval:response", handler);
deferred.resolve(data.value);
}
return deferred.promise;
}

View File

@ -33,4 +33,30 @@ add_task(function *() {
is(widget.getCssValue(),
"drop-shadow(2px 1px 5px black) url(example.svg#filter)",
"setCssValue should work for string-typed values");
info("Test parsing of mixed-case function names");
widget.setCssValue("BLUR(2px) Contrast(200%) Drop-Shadow(2px 1px 5px Black)");
is(widget.getCssValue(),
"BLUR(2px) Contrast(200%) Drop-Shadow(2px 1px 5px Black)",
"setCssValue should work for mixed-case function names");
info("Test parsing of invalid filter value");
widget.setCssValue("totallyinvalid");
is(widget.getCssValue(), "none",
"setCssValue should turn completely invalid value to 'none'");
info("Test parsing of invalid function argument");
widget.setCssValue("blur('hello')");
is(widget.getCssValue(), "blur(0px)",
"setCssValue should replace invalid function argument with default");
info("Test parsing of invalid function argument #2");
widget.setCssValue("drop-shadow(whatever)");
is(widget.getCssValue(), "drop-shadow()",
"setCssValue should replace invalid drop-shadow argument with empty string");
info("Test parsing of mixed invalid argument");
widget.setCssValue("contrast(5%) whatever invert('xxx')");
is(widget.getCssValue(), "contrast(5%) invert(0%)",
"setCssValue should handle multiple errors");
});

View File

@ -22,6 +22,7 @@ function* performTest() {
testParseCssProperty(doc, parser);
testParseCssVar(doc, parser);
testParseURL(doc, parser);
testParseFilter(doc, parser);
host.destroy();
}
@ -249,3 +250,13 @@ function testParseURL(doc, parser) {
target.innerHTML = "";
}
}
function testParseFilter(doc, parser) {
let frag = parser.parseCssProperty("filter", "something invalid", {
filterSwatchClass: "test-filterswatch"
});
let swatchCount = frag.querySelectorAll(".test-filterswatch").length;
is(swatchCount, 1, "filter swatch was created");
}

View File

@ -10,8 +10,10 @@
*/
const EventEmitter = require("devtools/shared/event-emitter");
const { Cu } = require("chrome");
const { ViewHelpers } = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
const { Cu, Cc, Ci } = require("chrome");
const { ViewHelpers } =
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm",
{});
const STRINGS_URI = "chrome://browser/locale/devtools/filterwidget.properties";
const L10N = new ViewHelpers.L10N(STRINGS_URI);
const {cssTokenizer} = require("devtools/client/shared/css-parsing-utils");
@ -19,6 +21,10 @@ const {cssTokenizer} = require("devtools/client/shared/css-parsing-utils");
loader.lazyGetter(this, "asyncStorage",
() => require("devtools/shared/async-storage"));
loader.lazyGetter(this, "DOMUtils", () => {
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
});
const DEFAULT_FILTER_TYPE = "length";
const UNIT_MAPPING = {
percentage: "%",
@ -307,8 +313,11 @@ CSSFilterEditorWidget.prototype = {
let value = startValue + direction * multiplier;
const [min, max] = this._definition(filter.name).range;
value = value < min ? min :
value > max ? max : value;
if (value < min) {
value = min;
} else if (value > max) {
value = max;
}
input.value = fixFloat(value);
@ -323,8 +332,8 @@ CSSFilterEditorWidget.prototype = {
let {start, end, value} = num;
let split = input.value.split("");
let computed = fixFloat(value + direction * multiplier),
dotIndex = computed.indexOf(".0");
let computed = fixFloat(value + direction * multiplier);
let dotIndex = computed.indexOf(".0");
if (dotIndex > -1) {
computed = computed.slice(0, -2);
@ -343,10 +352,10 @@ CSSFilterEditorWidget.prototype = {
},
_input: function(e) {
let filterEl = e.target.closest(".filter"),
index = this._getFilterElementIndex(filterEl),
filter = this.filters[index],
def = this._definition(filter.name);
let filterEl = e.target.closest(".filter");
let index = this._getFilterElementIndex(filterEl);
let filter = this.filters[index];
let def = this._definition(filter.name);
if (def.type !== "string") {
e.target.value = fixFloat(e.target.value);
@ -366,9 +375,9 @@ CSSFilterEditorWidget.prototype = {
this.el.classList.add("dragging");
// label-dragging
} else if (e.target.classList.contains("devtools-draglabel")) {
let label = e.target,
input = filterEl.querySelector("input"),
index = this._getFilterElementIndex(filterEl);
let label = e.target;
let input = filterEl.querySelector("input");
let index = this._getFilterElementIndex(filterEl);
this._dragging = {
index, label, input,
@ -386,19 +395,7 @@ CSSFilterEditorWidget.prototype = {
}
const key = select.value;
const def = this._definition(key);
// UNIT_MAPPING[string] is an empty string (falsy), so
// using || doesn't work here
const unitLabel = typeof UNIT_MAPPING[def.type] === "undefined" ?
UNIT_MAPPING[DEFAULT_FILTER_TYPE] :
UNIT_MAPPING[def.type];
// string-type filters have no default value but a placeholder instead
if (!unitLabel) {
this.add(key);
} else {
this.add(key, def.range[0] + unitLabel);
}
this.add(key, null);
this.render();
},
@ -423,9 +420,9 @@ CSSFilterEditorWidget.prototype = {
},
_dragFilterElement: function(e) {
const rect = this.filtersList.getBoundingClientRect(),
top = e.pageY - LIST_PADDING,
bottom = e.pageY + LIST_PADDING;
const rect = this.filtersList.getBoundingClientRect();
let top = e.pageY - LIST_PADDING;
let bottom = e.pageY + LIST_PADDING;
// don't allow dragging over top/bottom of list
if (top < rect.top || bottom > rect.bottom) {
return;
@ -439,8 +436,11 @@ CSSFilterEditorWidget.prototype = {
// change is the number of _steps_ taken from initial position
// i.e. how many elements we have passed
let change = delta / LIST_ITEM_HEIGHT;
change = change > 0 ? Math.floor(change) :
change < 0 ? Math.ceil(change) : change;
if (change > 0) {
change = Math.floor(change);
} else if (change < 0) {
change = Math.ceil(change);
}
const children = this.filtersList.children;
const index = [...children].indexOf(filterEl);
@ -489,8 +489,11 @@ CSSFilterEditorWidget.prototype = {
const filter = this.filters[dragging.index];
const [min, max] = this._definition(filter.name).range;
value = value < min ? min :
value > max ? max : value;
if (value < min) {
value = min;
} else if (value > max) {
value = max;
}
input.value = fixFloat(value);
@ -551,8 +554,8 @@ CSSFilterEditorWidget.prototype = {
_savePreset: function(e) {
e.preventDefault();
let name = this.addPresetInput.value,
value = this.getCssValue();
let name = this.addPresetInput.value;
let value = this.getCssValue();
if (!name || !value || value === "none") {
this.emit("preset-save-error");
@ -593,9 +596,9 @@ CSSFilterEditorWidget.prototype = {
let el = base.cloneNode(true);
let [name, value] = el.children,
label = name.children[1],
[input, unitPreview] = value.children;
let [name, value] = el.children;
let label = name.children[1];
let [input, unitPreview] = value.children;
let min, max;
if (def.range) {
@ -615,11 +618,11 @@ CSSFilterEditorWidget.prototype = {
input.max = max;
}
input.step = "0.1";
break;
break;
case "string":
input.type = "text";
input.placeholder = def.placeholder;
break;
break;
}
// use photoshop-style label-dragging
@ -637,7 +640,8 @@ CSSFilterEditorWidget.prototype = {
this.filtersList.appendChild(el);
}
let lastInput = this.filtersList.querySelector(`.filter:last-of-type input`);
let lastInput =
this.filtersList.querySelector(`.filter:last-of-type input`);
if (lastInput) {
lastInput.focus();
// move cursor to end of input
@ -685,6 +689,7 @@ CSSFilterEditorWidget.prototype = {
* filter's definition
*/
_definition: function(name) {
name = name.toLowerCase();
return filterList.find(a => a.name === name);
},
@ -708,6 +713,14 @@ CSSFilterEditorWidget.prototype = {
}
for (let {name, value} of tokenizeFilterValue(cssValue)) {
// If the specified value is invalid, replace it with the
// default.
if (name !== "url") {
if (!DOMUtils.cssPropertyIsValid("filter", name + "(" + value + ")")) {
value = null;
}
}
this.add(name, value);
}
@ -722,15 +735,31 @@ CSSFilterEditorWidget.prototype = {
* filter name (e.g. blur)
* @param {String} value
* value of the filter (e.g. 30px, 20%)
* If this is |null|, then a default value may be supplied.
* @return {Number}
* The index of the new filter in the current list of filters
*/
add: function(name, value = "") {
add: function(name, value) {
const def = this._definition(name);
if (!def) {
return false;
}
if (value === null) {
// UNIT_MAPPING[string] is an empty string (falsy), so
// using || doesn't work here
const unitLabel = typeof UNIT_MAPPING[def.type] === "undefined" ?
UNIT_MAPPING[DEFAULT_FILTER_TYPE] :
UNIT_MAPPING[def.type];
// string-type filters have no default value but a placeholder instead
if (!unitLabel) {
value = "";
} else {
value = def.range[0] + unitLabel;
}
}
let unit = def.type === "string"
? ""
: (/[a-zA-Z%]+/.exec(value) || [])[0];
@ -752,7 +781,7 @@ CSSFilterEditorWidget.prototype = {
}
}
const index = this.filters.push({value, unit, name: def.name}) - 1;
const index = this.filters.push({value, unit, name}) - 1;
this.emit("updated", this.getCssValue());
return index;
@ -940,8 +969,8 @@ function getNeighbourNumber(string, index) {
return null;
}
let left = /-?[0-9.]*$/.exec(string.slice(0, index)),
right = /-?[0-9.]*/.exec(string.slice(index));
let left = /-?[0-9.]*$/.exec(string.slice(0, index));
let right = /-?[0-9.]*/.exec(string.slice(index));
left = left ? left[0] : "";
right = right ? right[0] : "";

View File

@ -19,9 +19,24 @@
--row-hover-background-color: rgba(76,158,217,0.2);
}
html, .theme-body, #app, #memory-tool, #memory-tool-container {
height: 100%;
}
.theme-body {
overflow: hidden;
background-color: var(--theme-body-background);
}
#memory-tool-container {
display: flex;
flex-direction: row;
--toolbar-height: 20px;
/**
* If --heap-tree-row-height changes, be sure to change HEAP_TREE_ROW_HEIGHT
* in `devtools/client/memory/components/heap.js`.
*/
--heap-tree-row-height: 14px;
}
/**
@ -63,7 +78,7 @@
display: flex;
flex-direction: row;
align-items: center;
height: 20px;
height: var(--toolbar-height);
}
/**
@ -91,13 +106,18 @@
width: 186px;
list-style-type: none;
font-size: 12px;
height: 100%;
overflow-y: scroll;
background-color: var(--theme-toolbar-background);
border-color: var(--theme-splitter-color);
color: var(--theme-body-color-alt);
border-left-width: 1px;
}
.list > li {
height: 40px;
color: var(--theme-body-color);
border-bottom: 1px solid transparent;
border-top: 1px solid rgba(128,128,128,0.15);
border-bottom: 1px solid rgba(128,128,128,0.15);
padding: 8px;
cursor: pointer;
}
@ -127,6 +147,9 @@
#heap-view {
flex: 1 1 auto;
border-color: var(--theme-splitter-color);
color: var(--theme-body-color)
border-left-width: 1px;
}
#heap-view .heap-view-panel {
@ -138,65 +161,86 @@
}
/**
* Heap View
* Heap Tree View
*/
.heap-view {
position: relative;
#heap-view .theme-twisty {
float: left;
}
.heap-view .theme-twisty {
text-align: end;
.tree {
height: 100%;
overflow-y: scroll;
}
.heap-tree-item {
.tree .header {
height: 17px;
overflow: hidden;
color: var(--theme-body-color);
background-color: var(--theme-tab-toolbar-background);
}
.tree span {
border-left-color: var(--cell-border-color);
border-left-width: 1px;
}
.tree-node {
height: var(--heap-tree-row-height);
}
.heap-tree-item, .header {
list-style-type: none;
/* display: none; */
height: var(--heap-tree-row-height);
}
.heap-tree-item[expanded] {
display: block;
.heap-tree-item span, .header span {
float: left;
}
.heap-tree-item:nth-child(2n) {
.tree-node:nth-child(2n) {
background-color: var(--row-alt-background-color);
}
.heap-tree-item:hover {
.tree-node:hover {
background-color: var(--row-hover-background-color);
}
.heap-tree-item:focus {
.tree-node:focus {
background-color: var(--theme-selection-background);
}
.heap-tree-item:focus description {
color: var(--theme-selection-color) !important;
.header {
background-color: var(--theme-tab-toolbar-background);
}
.heap-tree-item:focus .call-tree-cell {
-moz-border-end-color: var(--focus-cell-border-color);
}
.heap-tree-cell[type="bytes"], .heap-tree-cell[type="count"] {
position: absolute;
text-align: right;
width: 40px;
}
.heap-tree-cell[type="name"] {
width: 150px;
.header span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
text-align: center;
font-size: 90%;
}
.heap-tree-cell[type="count"] {
left: 300px;
.heap-tree-item-bytes,
.heap-tree-item-count,
.heap-tree-item-total-bytes,
.heap-tree-item-total-count {
text-align: right;
border-right: var(--cell-border-color) 1px solid;
padding-right: 5px;
}
.heap-tree-cell[type="bytes"] {
left: 250px;
.heap-tree-item-count,
.heap-tree-item-total-count {
width: 5vw;
}
.heap-tree-item-bytes,
.heap-tree-item-total-bytes {
width: 7vw;
}
.heap-tree-item-name {
padding-left: 10px;
}

View File

@ -549,6 +549,15 @@
* Marker colors
*/
menuitem.marker-color-graphs-full-red:before,
.marker-color-graphs-full-red {
background-color: var(--theme-graphs-full-red);
}
menuitem.marker-color-graphs-full-blue:before,
.marker-color-graphs-full-blue {
background-color: var(--theme-graphs-full-blue);
}
menuitem.marker-color-graphs-green:before,
.marker-color-graphs-green {
background-color: var(--theme-graphs-green);

View File

@ -51,6 +51,8 @@
--theme-graphs-orange: #d97e00;
--theme-graphs-red: #e57180;
--theme-graphs-grey: #cccccc;
--theme-graphs-full-red: #f00;
--theme-graphs-full-blue: #00f;
}
:root.theme-dark {
@ -90,4 +92,6 @@
--theme-graphs-orange: #d96629;
--theme-graphs-red: #eb5368;
--theme-graphs-grey: #757873;
--theme-graphs-full-red: #f00;
--theme-graphs-full-blue: #00f;
}

View File

@ -77,7 +77,10 @@ OutputParser.prototype = {
safeCssPropertySupportsType(name, DOMUtils.TYPE_COLOR) ||
safeCssPropertySupportsType(name, DOMUtils.TYPE_GRADIENT);
if (this._cssPropertySupportsValue(name, value)) {
// The filter property is special in that we want to show the
// swatch even if the value is invalid, because this way the user
// can easily use the editor to fix it.
if (options.expectFilter || this._cssPropertySupportsValue(name, value)) {
return this._parse(value, options);
}
this._appendTextNode(value);

View File

@ -130,6 +130,7 @@ function _setAppProperties(aObj, aApp) {
aObj.kind = aApp.kind;
aObj.enabled = aApp.enabled !== undefined ? aApp.enabled : true;
aObj.sideloaded = aApp.sideloaded;
aObj.extensionVersion = aApp.extensionVersion;
#ifdef MOZ_B2GDROID
aObj.android_packagename = aApp.android_packagename;
aObj.android_classname = aApp.android_classname;

View File

@ -138,6 +138,10 @@ this.UserCustomizations = {
result.icons = aManifest.icons;
}
if (aManifest.version) {
result.version = aManifest.version;
}
// chrome extension manifests have a single 'author' property, that we
// map to 'developer.name'.
// Note that it has to match the one in the mini-manifest.

View File

@ -3812,6 +3812,10 @@ this.DOMApplicationRegistry = {
throw "INVALID_MANIFEST";
}
newManifest = UserCustomizations.convertManifest(newManifest);
// Keep track of the add-on version, to use for blocklisting.
if (newManifest.version) {
aNewApp.extensionVersion = newManifest.version;
}
}
if (!AppsUtils.checkManifest(newManifest, aOldApp)) {

View File

@ -79,10 +79,12 @@ function installApp(manifestURL, expectedError) {
apps.push(req.result);
is(req.result.manifestURL, manifestURL, "app installed");
if (req.result.installState == "installed") {
is(req.result.manifest.version, "1.0", "correct version");
is(req.result.installState, "installed", "app downloaded");
continueTest();
} else {
req.result.ondownloadapplied = function() {
is(req.result.manifest.version, "1.0", "correct version");
is(req.result.installState, "installed", "app downloaded");
continueTest();
}

View File

@ -164,11 +164,11 @@ function runTest() {
ok(app, "App is non-null");
is(app.manifestURL, gManifestURL, "App manifest url is correct.");
var context = {"manifestURL": app.manifestURL, "isInBrowserElement": false};
var context = {manifestURL: app.manifestURL};
SpecialPowers.pushPermissions([{"type": "homescreen-webapps-manage",
"allow": 1,
"context": context}], continueTest);
SpecialPowers.pushPermissions([{type: "homescreen-webapps-manage",
allow: 1,
context: context}], continueTest);
yield undefined;
// Launch the app.

View File

@ -1607,9 +1607,10 @@ Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
return nullptr;
}
// Hardcoded web-extensions feature which is b2g specific.
// Hardcoded extensions features which are b2g specific.
#ifdef MOZ_B2G
if (aName.EqualsLiteral("web-extensions")) {
if (aName.EqualsLiteral("web-extensions") ||
aName.EqualsLiteral("late-customization")) {
p->MaybeResolve(true);
return p.forget();
}
@ -1622,6 +1623,7 @@ Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
#ifdef MOZ_B2G
, "manifest.chrome.navigation"
, "manifest.precompile"
, "manifest.role.homescreen"
#endif
};

View File

@ -5109,6 +5109,14 @@ nsDocument::DispatchContentLoadedEvents()
NS_LITERAL_STRING("DOMContentLoaded"),
true, false);
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
nsIDocShell* docShell = this->GetDocShell();
if (timelines && timelines->HasConsumer(docShell)) {
timelines->AddMarkerForDocShell(
docShell, "document::DOMContentLoaded", MarkerTracingType::TIMESTAMP);
}
if (mTiming) {
mTiming->NotifyDOMContentLoadedEnd(nsIDocument::GetDocumentURI());
}

View File

@ -126,6 +126,7 @@ SpecialPowers.pushPermissions([
info("Adding B2G specific tests");
tests.push(createManifestTest("manifest.chrome.navigation"));
tests.push(createManifestTest("manifest.precompile"));
tests.push(createManifestTest("manifest.role.homescreen"));
}
runNextTest();
ok(true, "Test DONE");

View File

@ -65,11 +65,19 @@ function testExtensions() {
return Promise.resolve();
}
return navigator.hasFeature("web-extensions").then(function(value) {
is(value, true, "Resolve the Promise with " + value + " for web-extensions");
}, function() {
ok(false, "The Promise should not be rejected");
var builtInFeatures = [
{feature: "web-extensions", value: true},
{feature: "late-customization", value: true}
];
builtInFeatures.forEach(function(x) {
navigator.hasFeature(x.feature).then(function(value) {
is(value, x.value, "Resolve the Promise with " + value + " for feature: " + x.feature);
}).catch(function(ex) {
ok(false, "The Promise should not be rejected");
});
});
return Promise.resolve();
}
SpecialPowers.pushPermissions([

View File

@ -32,8 +32,8 @@ function setUp() {
let appId = gAppsService.getAppLocalIdByManifestURL(APP_MANIFEST);
SpecialPowers.addPermission("foobar", true, { url: APP_URL,
appId: appId,
isInBrowserElement: false });
originAttributes: { appId: appId }
});
SpecialPowers.pushPrefEnv({"set":[['dom.mozBrowserFramesEnabled', true],
['dom.ipc.browser_frames.oop_by_default', true]]}, runNextTest);
}

View File

@ -103,15 +103,17 @@
addEventListener("load", function() {
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.pushPermissions([
{ "type": "browser", "allow": 1, "context": { "url": principal.URI.spec,
"appId": principal.appId,
"isInBrowserElement": false }},
{ "type": "browser", "allow": 1, "context": { "url": principal.URI.spec,
"appId": principal.appId,
"isInBrowserElement": true }}
{ type: "browser", allow: 1, context: { url: principal.URI.spec,
originAttributes: {
appId: principal.appId
}}},
{ type: "browser", allow: 1, context: { url: principal.URI.spec,
originAttributes: {
appId: principal.appId,
inBrowser: true }}}
], () => {
SpecialPowers.pushPrefEnv({
"set": [
set: [
["dom.mozBrowserFramesEnabled", true],
["dom.ipc.browser_frames.oop_by_default", false],
]

View File

@ -477,6 +477,11 @@ BluetoothPbapManager::NotifyPbapRequest(const ObexHeaderSet& aHeader)
reqId.AssignLiteral(PULL_VCARD_ENTRY_REQ_ID);
tagCount = MOZ_ARRAY_LENGTH(sVCardEntryTags);
tags = sVCardEntryTags;
// Convert relative path to absolute path if it's not using X-BT-UID.
if (name.Find(NS_LITERAL_STRING("X-BT-UID")) == kNotFound) {
name = mCurrentPath + NS_LITERAL_STRING("/") + name;
}
} else {
BT_LOGR("Unknown PBAP request type: %s",
NS_ConvertUTF16toUTF8(type).get());

View File

@ -22,17 +22,16 @@ function runTest() {
document.body.appendChild(iframe);
var context = { 'url': 'http://example.org',
'appId': SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
'isInBrowserElement': true };
var context = {url: 'http://example.org',
originAttributes: {inBrowser: true}};
SpecialPowers.pushPermissions([
{'type': 'browser', 'allow': 1, 'context': context},
{'type': 'embed-apps', 'allow': 1, 'context': context}
{type: 'browser', allow: 1, context: context},
{type: 'embed-apps', allow: 1, context: context}
], function() {
iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_browserElement_AllowEmbedAppsInNestedOOIframe.html';
});
}
addEventListener('testready', () => {
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.tabs.nested.enabled", true]]}, runTest);
SpecialPowers.pushPrefEnv({set: [["dom.ipc.tabs.nested.enabled", true]]}, runTest);
});

View File

@ -343,13 +343,14 @@ function testCut2(e) {
// Give our origin permission to open browsers, and remove it when the test is complete.
var principal = SpecialPowers.wrap(document).nodePrincipal;
var context = { 'url': SpecialPowers.wrap(principal.URI).spec,
'appId': principal.appId,
'isInBrowserElement': true };
var context = { url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true }};
addEventListener('testready', function() {
SpecialPowers.pushPermissions([
{'type': 'browser', 'allow': 1, 'context': context}
{type: 'browser', allow: 1, context: context}
], runTest);
});

View File

@ -28,12 +28,11 @@ function runTest() {
document.body.appendChild(iframe);
var context = { 'url': 'http://example.org',
'appId': SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
'isInBrowserElement': true };
var context = {url: 'http://example.org',
originAttributes: {inBrowser: true}};
SpecialPowers.pushPermissions([
{'type': 'browser', 'allow': 1, 'context': context},
{'type': 'embed-apps', 'allow': 1, 'context': context}
{type: 'browser', allow: 1, context: context},
{type: 'embed-apps', allow: 1, context: context}
], function() {
iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_browserElement_DisallowEmbedAppsInOOP.html';
});

View File

@ -14,16 +14,18 @@ function runTest() {
allow: true,
context: {
url: frameUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
},{
type: 'browser',
allow: true,
context: {
url: frameUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
}], createFrame);
}

View File

@ -36,8 +36,7 @@ function runTest() {
allow: true,
context: {
url: imeUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {inBrowser: true}
}
}], SimpleTest.waitForFocus.bind(SimpleTest, createFrames));
}

View File

@ -18,9 +18,11 @@ var iframe;
function runTest() {
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.addPermission("browser", true, { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.addPermission("browser", true, {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', 'true');
@ -75,10 +77,11 @@ function finish() {
iframe.removeEventListener('mozbrowsershowmodalprompt', checkMessage);
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.removePermission("browser", { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.removePermission("browser", {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
SimpleTest.finish();
}

View File

@ -12,9 +12,11 @@ browserElementTestHelpers.addPermission();
function runTest() {
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.addPermission("browser", true, { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.addPermission("browser", true, {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', 'true');
@ -56,9 +58,11 @@ function runTest() {
function finish() {
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.removePermission("browser", { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.removePermission("browser", {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
SimpleTest.finish();
}

View File

@ -22,15 +22,19 @@ SpecialPowers.addPermission("embed-apps", true, document);
// Give our origin permission to open browsers, and remove it when the test is complete.
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.addPermission("browser", true, { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.addPermission("browser", true, {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
addEventListener('unload', function() {
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.removePermission("browser", { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.removePermission("browser", {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
});
function runTest() {

View File

@ -21,15 +21,19 @@ browserElementTestHelpers.enableProcessPriorityManager();
// Give our origin permission to open browsers, and remove it when the test is complete.
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.addPermission("browser", true, { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.addPermission("browser", true, {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
addEventListener('unload', function() {
var principal = SpecialPowers.wrap(document).nodePrincipal;
SpecialPowers.removePermission("browser", { url: SpecialPowers.wrap(principal.URI).spec,
appId: principal.appId,
isInBrowserElement: true });
SpecialPowers.removePermission("browser", {url: SpecialPowers.wrap(principal.URI).spec,
originAttributes: {
appId: principal.appId,
inBrowser: true
}});
});
function runTest() {

View File

@ -35,16 +35,7 @@ function runTests(testFile, order) {
// adapted from dom/indexedDB/test/helpers.js
function clearStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.clearStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.clearStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}

View File

@ -24,46 +24,19 @@ function setupTestIframe() {
function clearStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.clearStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.clearStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}
function storageUsage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.getStorageUsageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.getStorageUsageForDoc(SpecialPowers.wrap(document), resolve);
});
}
function resetStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.resetStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.resetStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}

View File

@ -24,46 +24,19 @@ function setupTestIframe() {
function clearStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.clearStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.clearStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}
function storageUsage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.getStorageUsageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.getStorageUsageForDoc(SpecialPowers.wrap(document), resolve);
});
}
function resetStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.resetStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.resetStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}

View File

@ -23,16 +23,7 @@ function setupTestIframe() {
function resetStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.resetStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.resetStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}

View File

@ -24,46 +24,19 @@ function setupTestIframe() {
function clearStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.clearStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.clearStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}
function storageUsage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.getStorageUsageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.getStorageUsageForDoc(SpecialPowers.wrap(document), resolve);
});
}
function resetStorage() {
return new Promise(function(resolve, reject) {
var principal = SpecialPowers.wrap(document).nodePrincipal;
var appId, inBrowser;
var nsIPrincipal = SpecialPowers.Components.interfaces.nsIPrincipal;
if (principal.appId != nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.resetStorageForURI(document.documentURI, resolve, appId,
inBrowser);
SpecialPowers.resetStorageForDoc(SpecialPowers.wrap(document), resolve);
});
}

View File

@ -189,17 +189,7 @@ function grabFileUsageAndContinueHandler(usage, fileUsage)
function getUsage(usageHandler)
{
let principal = SpecialPowers.wrap(document).nodePrincipal;
let appId, inBrowser;
if (principal.appId != Components.interfaces.nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != Components.interfaces.nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.getStorageUsageForURI(window.document.documentURI,
usageHandler,
appId,
inBrowser);
SpecialPowers.getStorageUsageForDoc(SpecialPowers.wrap(document), usageHandler);
}
function getFileId(file)

View File

@ -34,14 +34,7 @@ function executeSoon(aFun)
}
function clearAllDatabases(callback) {
let principal = SpecialPowers.wrap(document).nodePrincipal;
let appId, inBrowser;
if (principal.appId != Components.interfaces.nsIPrincipal.UNKNOWN_APP_ID &&
principal.appId != Components.interfaces.nsIPrincipal.NO_APP_ID) {
appId = principal.appId;
inBrowser = principal.isInBrowserElement;
}
SpecialPowers.clearStorageForURI(document.documentURI, callback, appId, inBrowser);
SpecialPowers.clearStorageForDoc(SpecialPowers.wrap(document), callback);
}
var testHarnessGenerator = testHarnessSteps();

View File

@ -117,11 +117,9 @@ function start()
}
SpecialPowers.addPermission("browser", true, document);
SpecialPowers.addPermission("browser", true, { manifestURL: manifestURL,
isInBrowserElement: false });
SpecialPowers.addPermission("browser", true, { manifestURL: manifestURL });
SpecialPowers.addPermission("embed-apps", true, document);
SpecialPowers.addPermission("indexedDB", true, { manifestURL: manifestURL,
isInBrowserElement: false });
SpecialPowers.addPermission("indexedDB", true, { manifestURL: manifestURL });
SpecialPowers.setAllAppsLaunchable(true);

View File

@ -91,8 +91,9 @@ function runTest() {
allow: true,
context: {
url: imeUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
}], function() {
keyboardA.src = imeUrl;

View File

@ -78,8 +78,9 @@ function runTest() {
allow: true,
context: {
url: imeUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
}], function() {
// STEP 2c: Tell Gecko to use this iframe as its keyboard app

View File

@ -141,8 +141,9 @@ function setupInputAppFrame() {
allow: true,
context: {
url: imeUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
}], function() {
let mm = SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);

View File

@ -70,8 +70,9 @@ function setupInputAppFrame() {
allow: true,
context: {
url: imeUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
}], function() {
let mm = appFrameMM =

View File

@ -103,8 +103,9 @@ function setupInputAppFrame() {
allow: true,
context: {
url: imeUrl,
appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
isInBrowserElement: true
originAttributes: {
inBrowser: true
}
}
}], function() {
let mm = appFrameMM =

View File

@ -33,8 +33,7 @@ var tests = [
function() {
var appId = gAppsService.getAppLocalIdByManifestURL(embedAppHostedManifestURL);
var context = { url: embedApp.origin,
appId: appId,
isInBrowserElement: false };
originAttributes: { appId: appId } };
setupOpenAppPermission(context, runTests);
},

View File

@ -33,8 +33,7 @@ var tests = [
function() {
var appId = gAppsService.getAppLocalIdByManifestURL(embedAppHostedManifestURL);
var context = { url: embedApp.origin,
appId: appId,
isInBrowserElement: false };
originAttributes: { appId: appId } };
setupOpenAppPermission(context, runTests);
},

View File

@ -53,8 +53,7 @@ function test1() {
if (!SpecialPowers.hasPermission( PERMISSION_TYPE,
{ url: APP_URL,
appId: appId,
isInBrowserElement: false })) {
originAttributes: { appId: appId }})) {
errorHandler('[test 1] App should have permission: ' + PERMISSION_TYPE);
}
@ -82,8 +81,7 @@ function test2() {
if (!SpecialPowers.hasPermission( PERMISSION_TYPE,
{ url: APP_URL,
appId: appId,
isInBrowserElement: false })) {
originAttributes: { appId: appId }})) {
errorHandler('[test 2] App should have permission: ' + PERMISSION_TYPE);
}
@ -111,8 +109,7 @@ function test3() {
if (!SpecialPowers.hasPermission(PERMISSION_TYPE,
{ url: APP_URL,
appId: appId,
isInBrowserElement: false })) {
originAttributes: { appId: appId }})) {
errorHandler('[test 3] App should have permission: ' + PERMISSION_TYPE);
}
}
@ -148,8 +145,7 @@ function test4() {
if (!SpecialPowers.hasPermission(PERMISSION_TYPE,
{ url: APP_URL,
appId: appId,
isInBrowserElement: false })) {
originAttributes: { appId: appId }})) {
errorHandler('[test 4] App should have permission: ' + PERMISSION_TYPE);
}
}
@ -174,8 +170,7 @@ function test5() {
if (!SpecialPowers.hasPermission( PERMISSION_TYPE,
{ url: APP_URL,
appId: appId,
isInBrowserElement: false })) {
originAttributes: { appId: appId }})) {
errorHandler('[test 5] App should have permission: ' + PERMISSION_TYPE);
}
@ -290,8 +285,7 @@ function addPermissionToApp(appURL, manifestURL) {
"expireType":permManager.EXPIRE_SESSION,
"expireTime":now + SESSION_PERSIST_MINUTES*60*1000,
"context": { url: appURL,
appId: appId,
isInBrowserElement:false }
originAttributes: { appId: appId } }
}
], function() {
runTests();
@ -303,8 +297,7 @@ function runNextIfAppHasPermission(round, expect, appURL, manifestURL) {
var hasPerm = SpecialPowers.hasPermission(PERMISSION_TYPE,
{ url: appURL,
appId: appId,
isInBrowserElement: false });
originAttributes: { appId: appId }});
var result = (expect==hasPerm);
if (result) {
runTests();

View File

@ -33,8 +33,7 @@ var tests = [
function() {
var appId = gAppsService.getAppLocalIdByManifestURL(embedAppHostedManifestURL);
var context = { url: embedApp.origin,
appId: appId,
isInBrowserElement: false };
originAttributes: { appId: appId } };
setupOpenAppPermission(context, runTests);
},

View File

@ -22,8 +22,9 @@ function installApp(aTestToken, aTemplate) {
var appId = gAppsService.getAppLocalIdByManifestURL(gApp.manifestURL);
SpecialPowers.addPermission("tv", true, { url: gApp.origin,
appId: appId,
isInBrowserElement: false });
originAttributes: {
appId: appId
}});
runTest();
}

View File

@ -990,6 +990,14 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
"content-document-loaded",
nullptr);
// Notify any devtools about the load.
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (timelines && timelines->HasConsumer(docShell)) {
timelines->AddMarkerForDocShell(
docShell, "document::Load", MarkerTracingType::TIMESTAMP);
}
EventDispatcher::Dispatch(window, mPresContext, &event, nullptr, &status);
if (timing) {
timing->NotifyLoadEventEnd();

View File

@ -91,6 +91,7 @@
android:logo="@drawable/logo"
android:name="@MOZ_ANDROID_APPLICATION_CLASS@"
android:hardwareAccelerated="true"
android:allowBackup="false"
# The preprocessor does not yet support arbitrary parentheses, so this cannot
# be parenthesized thus to clarify that the logical AND operator has precedence:
# !defined(MOZILLA_OFFICIAL) || (defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG))

View File

@ -2573,12 +2573,24 @@ var NativeWindow = {
imageLocationCopyableContext: {
matches: function imageLinkCopyableContextMatches(aElement) {
if (aElement instanceof Ci.nsIDOMHTMLImageElement) {
// The image is blocked by Tap-to-load Images
if (aElement.hasAttribute("data-ctv-src") && !aElement.hasAttribute("data-ctv-show")) {
return false;
}
}
return (aElement instanceof Ci.nsIImageLoadingContent && aElement.currentURI);
}
},
imageSaveableContext: {
matches: function imageSaveableContextMatches(aElement) {
if (aElement instanceof Ci.nsIDOMHTMLImageElement) {
// The image is blocked by Tap-to-load Images
if (aElement.hasAttribute("data-ctv-src") && !aElement.hasAttribute("data-ctv-show")) {
return false;
}
}
if (aElement instanceof Ci.nsIImageLoadingContent && aElement.currentURI) {
// The image must be loaded to allow saving
let request = aElement.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);

View File

@ -13,6 +13,9 @@ should be imported by head.js (as far as we can correctly resolve the path).
``mark-test-function-used`` simply marks test (the test method) as used. This
avoids ESLint telling us that the function is never called.
``var-only-at-top-level`` Marks all var declarations that are not at the top
level invalid.
+-------+-----------------------+
| Possible values for all rules |
+-------+-----------------------+
@ -31,6 +34,7 @@ Example configuration::
"mozilla/components-imports": 1,
"mozilla/import-headjs-globals": 1,
"mozilla/mark-test-function-used": 1,
"mozilla/var-only-at-top-level": 1,
}
.. toctree::
@ -39,3 +43,4 @@ Example configuration::
components-imports
import-headjs-globals
mark-test-function-used
var-only-at-top-level

View File

@ -0,0 +1,10 @@
.. _var-only-at-top-level:
=======================
var-only-at-top-level
=======================
Rule Details
------------
Marks all var declarations that are not at the top level invalid.

View File

@ -15,11 +15,13 @@ module.exports = {
rules: {
"components-imports": require("../lib/rules/components-imports"),
"import-headjs-globals": require("../lib/rules/import-headjs-globals"),
"mark-test-function-used": require("../lib/rules/mark-test-function-used")
"mark-test-function-used": require("../lib/rules/mark-test-function-used"),
"var-only-at-top-level": require("../lib/rules/var-only-at-top-level")
},
rulesConfig: {
"components-imports": 0,
"import-headjs-globals": 0,
"mark-test-function-used": 0
"mark-test-function-used": 0,
"var-only-at-top-level": 0
}
};

View File

@ -85,7 +85,7 @@ module.exports = function(context) {
Program: function(node) {
var pathAndFilename = this.getFilename();
var processPath = process.cwd();
var isTest = /.*\/browser_.+\.js$/.test(pathAndFilename);
var isTest = /.*[\\/]browser_.+\.js$/.test(pathAndFilename);
if (!isTest) {
return;

View File

@ -0,0 +1,36 @@
/**
* @fileoverview Marks all var declarations that are not at the top level
* invalid.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
var helpers = require("../helpers");
module.exports = function(context) {
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
"VariableDeclaration": function(node) {
if (node.kind === "var") {
var ancestors = context.getAncestors();
var parent = ancestors.pop();
if (parent.type === "Program") {
return;
}
context.report(node, "Unexpected var, use let or const instead.");
}
}
};
};

View File

@ -69,8 +69,7 @@ function installApp(aTestToken, aTemplate) {
function pushPermissionsToApp() {
var appId = gAppsService.getAppLocalIdByManifestURL(gApp.manifestURL);
var context = { url: gApp.origin,
appId: appId,
isInBrowserElement: false };
originAttributes: {appId: appId}};
SpecialPowers.pushPermissions([
{ "type": "pAppPermission", "allow": true, "context": context }
], testPermissionsForApp);
@ -79,8 +78,7 @@ function pushPermissionsToApp() {
function testPermissionsForApp() {
var appId = gAppsService.getAppLocalIdByManifestURL(gApp.manifestURL);
var context = { url: gApp.origin,
appId: appId,
isInBrowserElement: false };
originAttributes: {appId: appId}};
ok(SpecialPowers.hasPermission('pAppPermission', context), 'pAppPermission should have permission');
uninstallApp();
}
@ -95,10 +93,10 @@ function uninstallApp() {
function testPermissionsForSelfAndApp() {
var appId = gAppsService.getAppLocalIdByManifestURL(gApp.manifestURL);
var context = { url: gApp.origin,
appId: appId,
isInBrowserElement: false };
ok(!SpecialPowers.hasPermission('pAppPermission', context), 'pAppPermission should not have permission');
is(appId, 0, "appId should become NO_APP_ID");
// since gApp is uninstalled, calling SpecialPowers.hasPermission with the
// app's properties (manifestURL, origin, principal, ... etc) will throw.
// So we don't need to test hasPermission for the app.
ok(SpecialPowers.hasPermission('pAppPermission', document), 'pAppPermission should have permission');

View File

@ -57,8 +57,7 @@ function starttest(){
SpecialPowers.addPermission(perms[0], true, origin);
SpecialPowers.addPermission(perms[1], true, {manifestURL: manifest});
SpecialPowers.addPermission(perms[2], true, document);
SpecialPowers.addPermission(perms[3], true, {url: origin,
appId: Ci.nsIScriptSecurityManager.NO_APP_ID});
SpecialPowers.addPermission(perms[3], true, {url: origin});
is(Services.perms.testPermissionFromPrincipal(noappPrincipal, perms[0]),
allow, "Set permission by string");
@ -74,8 +73,7 @@ function starttest(){
SpecialPowers.removePermission(perms[0], origin);
SpecialPowers.removePermission(perms[1], {manifestURL: manifest});
SpecialPowers.removePermission(perms[2], document);
SpecialPowers.removePermission(perms[3], {url: origin,
appId: Ci.nsIScriptSecurityManager.NO_APP_ID});
SpecialPowers.removePermission(perms[3], {url: origin});
is(Services.perms.testPermissionFromPrincipal(noappPrincipal, perms[0]),
unknown, "Removed permission by string");

View File

@ -234,7 +234,9 @@ SpecialPowersObserver.prototype = new SpecialPowersObserverAPI();
// We need to ensure that it looks the same as a real permission,
// so we fake these properties.
msg.permission = {
principal: { appId: permission.principal.appId },
principal: {
originAttributes: {appId: permission.principal.appId}
},
type: permission.type
};
default:

View File

@ -321,11 +321,7 @@ SpecialPowersObserverAPI.prototype = {
case "SPPermissionManager": {
let msg = aMessage.json;
let secMan = Services.scriptSecurityManager;
// TODO: Bug 1196665 - Add originAttributes into SpecialPowers
let attrs = {appId: msg.appId, inBrowser: msg.isInBrowserElement};
let principal = secMan.createCodebasePrincipal(this._getURI(msg.url), attrs);
let principal = msg.principal;
switch (msg.op) {
case "add":
@ -336,17 +332,10 @@ SpecialPowersObserverAPI.prototype = {
break;
case "has":
let hasPerm = Services.perms.testPermissionFromPrincipal(principal, msg.type);
if (hasPerm == Ci.nsIPermissionManager.ALLOW_ACTION)
return true;
return false;
break;
return hasPerm == Ci.nsIPermissionManager.ALLOW_ACTION;
case "test":
let testPerm = Services.perms.testPermissionFromPrincipal(principal, msg.type, msg.value);
if (testPerm == msg.value) {
return true;
}
return false;
break;
return testPerm == msg.value;
default:
throw new SpecialPowersError(
"Invalid operation for SPPermissionManager");
@ -510,18 +499,13 @@ SpecialPowersObserverAPI.prototype = {
.frameLoader
.messageManager;
let msg = aMessage.data;
let principal = msg.principal;
let op = msg.op;
if (op != 'clear' && op != 'getUsage' && op != 'reset') {
throw new SpecialPowersError('Invalid operation for SPQuotaManager');
}
let secMan = Services.scriptSecurityManager;
let principal = secMan.createCodebasePrincipal(this._getURI(msg.uri), {
appId: msg.appId,
inBrowser: msg.inBrowser,
});
if (op == 'clear') {
qm.clearStoragesForPrincipal(principal);
} else if (op == 'reset') {

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