Merge m-c to fx-team, a=merge

--HG--
extra : commitid : CZJ0xfIX4ut
This commit is contained in:
Wes Kocher 2015-10-27 14:22:25 -07:00
commit 02fda7e9df
193 changed files with 2068 additions and 1413 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

@ -5136,11 +5136,10 @@
<method name="_getDragTargetTab">
<parameter name="event"/>
<parameter name="isLink"/>
<body><![CDATA[
let tab = event.target.localName == "tab" ? event.target : null;
if (tab &&
(event.type == "drop" || event.type == "dragover") &&
event.dataTransfer.dropEffect == "link") {
if (tab && isLink) {
let boxObject = tab.boxObject;
if (event.screenX < boxObject.screenX + boxObject.width * .25 ||
event.screenX > boxObject.screenX + boxObject.width * .75)
@ -5152,9 +5151,10 @@
<method name="_getDropIndex">
<parameter name="event"/>
<parameter name="isLink"/>
<body><![CDATA[
var tabs = this.childNodes;
var tab = this._getDragTargetTab(event);
var tab = this._getDragTargetTab(event, isLink);
if (window.getComputedStyle(this, null).direction == "ltr") {
for (let i = tab ? tab._tPos : 0; i < tabs.length; i++)
if (event.screenX < tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2)
@ -5168,13 +5168,13 @@
]]></body>
</method>
<method name="_setEffectAllowedForDataTransfer">
<method name="_getDropEffectForTabDrag">
<parameter name="event"/>
<body><![CDATA[
var dt = event.dataTransfer;
// Disallow dropping multiple items
if (dt.mozItemCount > 1)
return dt.effectAllowed = "none";
return "none";
var types = dt.mozTypesAt(0);
var sourceNode = null;
@ -5190,22 +5190,20 @@
// and vice versa.
if (PrivateBrowsingUtils.isWindowPrivate(window) !=
PrivateBrowsingUtils.isWindowPrivate(sourceNode.ownerDocument.defaultView))
return dt.effectAllowed = "none";
return "none";
if (window.gMultiProcessBrowser !=
sourceNode.ownerDocument.defaultView.gMultiProcessBrowser)
return dt.effectAllowed = "none";
return "none";
let copyModifier = this.tabbrowser.AppConstants.platform == "macosx" ? event.altKey : event.ctrlKey;
return dt.effectAllowed = copyModifier ? "copy" : "move";
return dt.dropEffect == "copy" ? "copy" : "move";
}
}
if (browserDragAndDrop.canDropLink(event)) {
// Here we need to do this manually
return dt.effectAllowed = dt.dropEffect = "link";
return "link";
}
return dt.effectAllowed = "none";
return "none";
]]></body>
</method>
@ -5482,7 +5480,7 @@
]]></handler>
<handler event="dragstart"><![CDATA[
var tab = this._getDragTargetTab(event);
var tab = this._getDragTargetTab(event, false);
if (!tab || this._isCustomizing)
return;
@ -5556,7 +5554,7 @@
]]></handler>
<handler event="dragover"><![CDATA[
var effects = this._setEffectAllowedForDataTransfer(event);
var effects = this._getDropEffectForTabDrag(event);
var ind = this._tabDropIndicator;
if (effects == "" || effects == "none") {
@ -5597,7 +5595,7 @@
this._finishAnimateTabMove();
if (effects == "link") {
let tab = this._getDragTargetTab(event);
let tab = this._getDragTargetTab(event, true);
if (tab) {
if (!this._dragTime)
this._dragTime = Date.now();
@ -5623,7 +5621,7 @@
newMargin = (pixelsToScroll > 0) ? maxMargin : minMargin;
}
else {
let newIndex = this._getDropIndex(event);
let newIndex = this._getDropIndex(event, effects == "link");
if (newIndex == this.childNodes.length) {
let tabRect = this.childNodes[newIndex-1].getBoundingClientRect();
if (ltr)
@ -5654,7 +5652,7 @@
var dt = event.dataTransfer;
var dropEffect = dt.dropEffect;
var draggedTab;
if (dropEffect != "link") { // copy or move
if (dt.mozTypesAt(0)[0] == TAB_DROP_TYPE) { // tab copy or move
draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
// not our drop then
if (!draggedTab)
@ -5665,7 +5663,7 @@
event.stopPropagation();
if (draggedTab && dropEffect == "copy") {
// copy the dropped tab (wherever it's from)
let newIndex = this._getDropIndex(event);
let newIndex = this._getDropIndex(event, false);
let newTab = this.tabbrowser.duplicateTab(draggedTab);
this.tabbrowser.moveTabTo(newTab, newIndex);
if (draggedTab.parentNode != this || event.shiftKey)
@ -5684,7 +5682,7 @@
// swap the dropped tab with a new one we create and then close
// it in the other window (making it seem to have moved between
// windows)
let newIndex = this._getDropIndex(event);
let newIndex = this._getDropIndex(event, false);
let newTab = this.tabbrowser.addTab("about:blank");
let newBrowser = this.tabbrowser.getBrowserForTab(newTab);
let draggedBrowserURL = draggedTab.linkedBrowser.currentURI.spec;
@ -5732,10 +5730,10 @@
if (event.shiftKey)
bgLoad = !bgLoad;
let tab = this._getDragTargetTab(event);
let tab = this._getDragTargetTab(event, true);
if (!tab || dropEffect == "copy") {
// We're adding a new tab.
let newIndex = this._getDropIndex(event);
let newIndex = this._getDropIndex(event, true);
let newTab = this.tabbrowser.loadOneTab(url, {inBackground: bgLoad, allowThirdPartyFixup: true});
this.tabbrowser.moveTabTo(newTab, newIndex);
} else {

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

@ -60,8 +60,6 @@ NS_IMETHODIMP AudioChannelAgent::GetAudioChannelType(int32_t *aAudioChannelType)
return NS_OK;
}
/* boolean init (in nsIDOMWindow window, in long channelType,
* in nsIAudioChannelAgentCallback callback); */
NS_IMETHODIMP
AudioChannelAgent::Init(nsIDOMWindow* aWindow, int32_t aChannelType,
nsIAudioChannelAgentCallback *aCallback)
@ -70,8 +68,6 @@ AudioChannelAgent::Init(nsIDOMWindow* aWindow, int32_t aChannelType,
/* useWeakRef = */ false);
}
/* boolean initWithWeakCallback (in nsIDOMWindow window, in long channelType,
* in nsIAudioChannelAgentCallback callback); */
NS_IMETHODIMP
AudioChannelAgent::InitWithWeakCallback(nsIDOMWindow* aWindow,
int32_t aChannelType,

View File

@ -323,13 +323,16 @@ AudioChannelService::GetState(nsPIDOMWindow* aWindow, uint32_t aAudioChannel,
MOZ_ASSERT(aVolume && aMuted);
MOZ_ASSERT(aAudioChannel < NUMBER_OF_AUDIO_CHANNELS);
*aVolume = 1.0;
*aMuted = false;
if (!aWindow || !aWindow->IsOuterWindow()) {
*aVolume = 0.0;
*aMuted = true;
return;
}
*aVolume = 1.0;
*aMuted = false;
AudioChannelWindow* winData = nullptr;
nsCOMPtr<nsPIDOMWindow> window = aWindow;

View File

@ -448,9 +448,6 @@ Exception::ToString(nsACString& _retval)
return NS_OK;
}
/* void initialize (in AUTF8String aMessage, in nsresult aResult,
* in AUTF8String aName, in nsIStackFrame aLocation,
* in nsISupports aData, in nsIException aInner); */
NS_IMETHODIMP
Exception::Initialize(const nsACString& aMessage, nsresult aResult,
const nsACString& aName, nsIStackFrame *aLocation,

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

@ -7606,7 +7606,6 @@ nsIDocument::GetDocumentURIObject() const
}
// readonly attribute DOMString compatMode;
// Returns "BackCompat" if we are in quirks mode, "CSS1Compat" if we are
// in almost standards or full standards mode. See bug 105640. This was
// implemented to match MSIE's compatMode property.

View File

@ -2856,8 +2856,7 @@ nsObjectLoadingContent::ScriptRequestPluginInstance(JSContext* aCx,
aCx == nsContentUtils::GetCurrentJSContext());
bool callerIsContentJS = (nsContentUtils::GetCurrentJSContext() &&
!nsContentUtils::IsCallerChrome() &&
!nsContentUtils::IsCallerContentXBL() &&
JS_IsRunning(aCx));
!nsContentUtils::IsCallerContentXBL());
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));

View File

@ -23,7 +23,6 @@
#include "nsNetUtil.h"
#include "nsAutoPtr.h"
#include "nsStreamUtils.h"
#include "nsCORSListenerProxy.h"
#include <algorithm>
using mozilla::net::ReferrerPolicy;
@ -42,7 +41,7 @@ public:
NS_DECL_ISUPPORTS
nsresult LoadDocument(nsIChannel* aChannel, nsIPrincipal *aLoaderPrincipal,
nsresult LoadDocument(nsIChannel* aChannel,
bool aChannelIsSync, bool aForceToXML,
ReferrerPolicy aReferrerPolicy,
nsIDOMDocument** aResult);
@ -130,29 +129,29 @@ NS_IMPL_ISUPPORTS(nsSyncLoader,
nsresult
nsSyncLoader::LoadDocument(nsIChannel* aChannel,
nsIPrincipal *aLoaderPrincipal,
bool aChannelIsSync,
bool aForceToXML,
ReferrerPolicy aReferrerPolicy,
nsIDOMDocument **aResult)
{
NS_ENSURE_ARG(aChannel);
NS_ENSURE_ARG_POINTER(aResult);
*aResult = nullptr;
nsresult rv = NS_OK;
nsCOMPtr<nsIURI> loaderUri;
if (aLoaderPrincipal) {
aLoaderPrincipal->GetURI(getter_AddRefs(loaderUri));
}
mChannel = aChannel;
nsCOMPtr<nsIHttpChannel> http = do_QueryInterface(mChannel);
if (http) {
http->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
NS_LITERAL_CSTRING("text/xml,application/xml,application/xhtml+xml,*/*;q=0.1"),
false);
if (loaderUri) {
http->SetReferrerWithPolicy(loaderUri, aReferrerPolicy);
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
if (loadInfo) {
nsCOMPtr<nsIURI> loaderUri;
loadInfo->TriggeringPrincipal()->GetURI(getter_AddRefs(loaderUri));
if (loaderUri) {
http->SetReferrerWithPolicy(loaderUri, aReferrerPolicy);
}
}
}
@ -186,14 +185,6 @@ nsSyncLoader::LoadDocument(nsIChannel* aChannel,
listener.swap(forceListener);
}
if (aLoaderPrincipal) {
RefPtr<nsCORSListenerProxy> corsListener =
new nsCORSListenerProxy(listener, aLoaderPrincipal, false);
rv = corsListener->Init(mChannel, DataURIHandling::Disallow);
NS_ENSURE_SUCCESS(rv, rv);
listener = corsListener;
}
if (aChannelIsSync) {
rv = PushSyncStream(listener);
}
@ -226,7 +217,7 @@ nsSyncLoader::PushAsyncStream(nsIStreamListener* aListener)
mAsyncLoadStatus = NS_OK;
// Start reading from the channel
nsresult rv = mChannel->AsyncOpen(this, nullptr);
nsresult rv = mChannel->AsyncOpen2(this);
if (NS_SUCCEEDED(rv)) {
// process events until we're finished.
@ -254,7 +245,7 @@ nsresult
nsSyncLoader::PushSyncStream(nsIStreamListener* aListener)
{
nsCOMPtr<nsIInputStream> in;
nsresult rv = mChannel->Open(getter_AddRefs(in));
nsresult rv = mChannel->Open2(getter_AddRefs(in));
NS_ENSURE_SUCCESS(rv, rv);
mLoading = true;
@ -309,8 +300,12 @@ nsSyncLoader::GetInterface(const nsIID & aIID,
/* static */
nsresult
nsSyncLoadService::LoadDocument(nsIURI *aURI, nsIPrincipal *aLoaderPrincipal,
nsILoadGroup *aLoadGroup, bool aForceToXML,
nsSyncLoadService::LoadDocument(nsIURI *aURI,
nsContentPolicyType aContentPolicyType,
nsIPrincipal *aLoaderPrincipal,
nsSecurityFlags aSecurityFlags,
nsILoadGroup *aLoadGroup,
bool aForceToXML,
ReferrerPolicy aReferrerPolicy,
nsIDOMDocument** aResult)
{
@ -318,8 +313,8 @@ nsSyncLoadService::LoadDocument(nsIURI *aURI, nsIPrincipal *aLoaderPrincipal,
nsresult rv = NS_NewChannel(getter_AddRefs(channel),
aURI,
aLoaderPrincipal,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
aSecurityFlags,
aContentPolicyType,
aLoadGroup);
NS_ENSURE_SUCCESS(rv, rv);
@ -328,15 +323,12 @@ nsSyncLoadService::LoadDocument(nsIURI *aURI, nsIPrincipal *aLoaderPrincipal,
}
bool isChrome = false, isResource = false;
bool isSync = (NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) &&
isChrome) ||
(NS_SUCCEEDED(aURI->SchemeIs("resource", &isResource)) &&
isResource);
bool isSync =
(NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)) && isChrome) ||
(NS_SUCCEEDED(aURI->SchemeIs("resource", &isResource)) && isResource);
RefPtr<nsSyncLoader> loader = new nsSyncLoader();
return loader->LoadDocument(channel, aLoaderPrincipal, isSync,
aForceToXML, aReferrerPolicy, aResult);
return loader->LoadDocument(channel, isSync, aForceToXML,
aReferrerPolicy, aResult);
}
/* static */

View File

@ -29,17 +29,22 @@ public:
* Synchronously load the document from the specified URI.
*
* @param aURI URI to load the document from.
* @param aContentPolicyType contentPolicyType to be set on the channel
* @param aLoaderPrincipal Principal of loading document. For security
* checks and referrer header. May be null if no
* security checks should be done.
* checks and referrer header.
* @param aSecurityFlags securityFlags to be set on the channel
* @param aLoadGroup The loadgroup to use for loading the document.
* @param aForceToXML Whether to parse the document as XML, regardless of
* content type.
* @param referrerPolicy Referrer policy.
* @param aResult [out] The document loaded from the URI.
*/
static nsresult LoadDocument(nsIURI *aURI, nsIPrincipal *aLoaderPrincipal,
nsILoadGroup *aLoadGroup, bool aForceToXML,
static nsresult LoadDocument(nsIURI *aURI,
nsContentPolicyType aContentPolicyType,
nsIPrincipal *aLoaderPrincipal,
nsSecurityFlags aSecurityFlags,
nsILoadGroup *aLoadGroup,
bool aForceToXML,
mozilla::net::ReferrerPolicy aReferrerPolicy,
nsIDOMDocument** aResult);

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

@ -162,6 +162,9 @@ ThrowNoSetterArg(JSContext* aCx, prototypes::ID aProtoId)
} // namespace dom
struct ErrorResult::Message {
Message() { MOZ_COUNT_CTOR(ErrorResult::Message); }
~Message() { MOZ_COUNT_DTOR(ErrorResult::Message); }
nsTArray<nsString> mArgs;
dom::ErrNum mErrorNumber;

View File

@ -3262,8 +3262,7 @@ class IDLValue(IDLObject):
elif self.type.isInteger() and type.isFloat():
# Convert an integer literal into float
if -2**24 <= self.value <= 2**24:
floatType = BuiltinTypes[IDLBuiltinType.Types.float]
return IDLValue(self.location, floatType, float(self.value))
return IDLValue(self.location, type, float(self.value))
else:
raise WebIDLError("Converting value %s to %s will lose precision." %
(self.value, type), [location])
@ -3281,7 +3280,7 @@ class IDLValue(IDLObject):
math.isnan(self.value))):
raise WebIDLError("Trying to convert unrestricted value %s to non-unrestricted"
% self.value, [location])
return self
return IDLValue(self.location, type, self.value)
elif self.type.isString() and type.isUSVString():
# Allow USVStrings to use default value just like
# DOMString. No coercion is required in this case as Codegen.py

View File

@ -1,5 +1,30 @@
import WebIDL
expected = [
("::TestConsts::zero", "zero", "Byte", 0),
("::TestConsts::b", "b", "Byte", -1),
("::TestConsts::o", "o", "Octet", 2),
("::TestConsts::s", "s", "Short", -3),
("::TestConsts::us", "us", "UnsignedShort", 4),
("::TestConsts::l", "l", "Long", -5),
("::TestConsts::ul", "ul", "UnsignedLong", 6),
("::TestConsts::ull", "ull", "UnsignedLongLong", 7),
("::TestConsts::ll", "ll", "LongLong", -8),
("::TestConsts::t", "t", "Boolean", True),
("::TestConsts::f", "f", "Boolean", False),
("::TestConsts::n", "n", "BooleanOrNull", None),
("::TestConsts::nt", "nt", "BooleanOrNull", True),
("::TestConsts::nf", "nf", "BooleanOrNull", False),
("::TestConsts::fl", "fl", "Float", 0.2),
("::TestConsts::db", "db", "Double", 0.2),
("::TestConsts::ufl", "ufl", "UnrestrictedFloat", 0.2),
("::TestConsts::udb", "udb", "UnrestrictedDouble", 0.2),
("::TestConsts::fli", "fli", "Float", 2),
("::TestConsts::dbi", "dbi", "Double", 2),
("::TestConsts::ufli", "ufli", "UnrestrictedFloat", 2),
("::TestConsts::udbi", "udbi", "UnrestrictedDouble", 2),
]
def WebIDLTest(parser, harness):
parser.parse("""
interface TestConsts {
@ -17,6 +42,14 @@ def WebIDLTest(parser, harness):
const boolean? n = null;
const boolean? nt = true;
const boolean? nf = false;
const float fl = 0.2;
const double db = 0.2;
const unrestricted float ufl = 0.2;
const unrestricted double udb = 0.2;
const float fli = 2;
const double dbi = 2;
const unrestricted float ufli = 2;
const unrestricted double udbi = 2;
};
""")
@ -29,11 +62,9 @@ def WebIDLTest(parser, harness):
"Should be an IDLInterface")
harness.check(iface.identifier.QName(), "::TestConsts", "Interface has the right QName")
harness.check(iface.identifier.name, "TestConsts", "Interface has the right name")
harness.check(len(iface.members), 14, "Expect 14 members")
harness.check(len(iface.members), len(expected), "Expect %s members" % len(expected))
consts = iface.members
def checkConst(const, QName, name, type, value):
for (const, (QName, name, type, value)) in zip(iface.members, expected):
harness.ok(isinstance(const, WebIDL.IDLConst),
"Should be an IDLConst")
harness.ok(const.isConst(), "Const is a const")
@ -47,18 +78,3 @@ def WebIDLTest(parser, harness):
"Const's value has the same type as the type")
harness.check(const.value.value, value, "Const value has the right value.")
checkConst(consts[0], "::TestConsts::zero", "zero", "Byte", 0)
checkConst(consts[1], "::TestConsts::b", "b", "Byte", -1)
checkConst(consts[2], "::TestConsts::o", "o", "Octet", 2)
checkConst(consts[3], "::TestConsts::s", "s", "Short", -3)
checkConst(consts[4], "::TestConsts::us", "us", "UnsignedShort", 4)
checkConst(consts[5], "::TestConsts::l", "l", "Long", -5)
checkConst(consts[6], "::TestConsts::ul", "ul", "UnsignedLong", 6)
checkConst(consts[7], "::TestConsts::ull", "ull", "UnsignedLongLong", 7)
checkConst(consts[8], "::TestConsts::ll", "ll", "LongLong", -8)
checkConst(consts[9], "::TestConsts::t", "t", "Boolean", True)
checkConst(consts[10], "::TestConsts::f", "f", "Boolean", False)
checkConst(consts[11], "::TestConsts::n", "n", "BooleanOrNull", None)
checkConst(consts[12], "::TestConsts::nt", "nt", "BooleanOrNull", True)
checkConst(consts[13], "::TestConsts::nf", "nf", "BooleanOrNull", 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

@ -1414,7 +1414,7 @@ CanvasRenderingContext2D::EnsureTarget(RenderingMode aRenderingMode)
mBufferProvider = new PersistentBufferProviderBasic(mTarget);
mIsSkiaGL = true;
} else {
printf_stderr("Failed to create a SkiaGL DrawTarget, falling back to software\n");
gfxCriticalNote << "Failed to create a SkiaGL DrawTarget, falling back to software\n";
mode = RenderingMode::SoftwareBackendMode;
}
}
@ -1470,6 +1470,10 @@ CanvasRenderingContext2D::EnsureTarget(RenderingMode aRenderingMode)
mTarget = sErrorTarget;
}
// Drop a note in the debug builds if we ever use accelerated Skia canvas.
if (mIsSkiaGL && mTarget && mTarget->GetType() == DrawTargetType::HARDWARE_RASTER) {
gfxWarningOnce() << "Using SkiaGL canvas.";
}
return mode;
}
@ -5329,9 +5333,6 @@ CanvasRenderingContext2D::PutImageData(ImageData& imageData, double dx,
JS::ToInt32(dirtyHeight));
}
// void putImageData (in ImageData d, in float x, in float y);
// void putImageData (in ImageData d, in double x, in double y, in double dirtyX, in double dirtyY, in double dirtyWidth, in double dirtyHeight);
nsresult
CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w, uint32_t h,
dom::Uint8ClampedArray* aArray,

View File

@ -59,8 +59,6 @@ NS_IMETHODIMP GamepadServiceTest::RemoveGamepad(uint32_t aIndex)
return NS_OK;
}
/* void newButtonEvent (in uint32_t index, in uint32_t button,
in boolean pressed); */
NS_IMETHODIMP GamepadServiceTest::NewButtonEvent(uint32_t aIndex,
uint32_t aButton,
bool aPressed)
@ -69,8 +67,6 @@ NS_IMETHODIMP GamepadServiceTest::NewButtonEvent(uint32_t aIndex,
return NS_OK;
}
/* void newButtonEvent (in uint32_t index, in uint32_t button,
in boolean pressed, double value); */
NS_IMETHODIMP GamepadServiceTest::NewButtonValueEvent(uint32_t aIndex,
uint32_t aButton,
bool aPressed,
@ -80,8 +76,6 @@ NS_IMETHODIMP GamepadServiceTest::NewButtonValueEvent(uint32_t aIndex,
return NS_OK;
}
/* void newAxisMoveEvent (in uint32_t index, in uint32_t axis,
in double value); */
NS_IMETHODIMP GamepadServiceTest::NewAxisMoveEvent(uint32_t aIndex,
uint32_t aAxis,
double aValue)

View File

@ -3194,8 +3194,6 @@ ConvertToMidasInternalCommand(const nsAString & inCommandID,
}
/* TODO: don't let this call do anything if the page is not done loading */
/* boolean execCommand(in DOMString commandID, in boolean doShowUI,
in DOMString value); */
NS_IMETHODIMP
nsHTMLDocument::ExecCommand(const nsAString& commandID,
bool doShowUI,

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

@ -129,7 +129,7 @@ function sendKeyAndAssertResult(testdata) {
charCode: 0,
code: expectedValues.code || '',
keyCode: expectedValues.keyCode || 0,
location: 0,
location: expectedValues.location ? expectedValues.location : 0,
repeat: expectedValues.repeat || false,
value: gCurrentValue,
shift: false,
@ -145,7 +145,7 @@ function sendKeyAndAssertResult(testdata) {
charCode: expectedValues.charCode,
code: expectedValues.code || '',
keyCode: expectedValues.charCode ? 0 : expectedValues.keyCode,
location: 0,
location: expectedValues.location ? expectedValues.location : 0,
repeat: expectedValues.repeat || false,
value: gCurrentValue,
shift: false,
@ -156,9 +156,22 @@ function sendKeyAndAssertResult(testdata) {
}
if (testdata.expectedInput) {
switch (testdata.expectedInput) {
case 'Enter':
gCurrentValue += '\n';
break;
case 'Backspace':
gCurrentValue =
gCurrentValue.substr(0, gCurrentValue.length - 1);
break;
default:
gCurrentValue += testdata.expectedInput;
break;
}
expectedEventDetail.push({
type: 'input',
value: gCurrentValue += testdata.expectedInput
value: gCurrentValue
});
}
@ -169,7 +182,7 @@ function sendKeyAndAssertResult(testdata) {
charCode: 0,
code: expectedValues.code || '',
keyCode: expectedValues.keyCode || 0,
location: 0,
location: expectedValues.location ? expectedValues.location : 0,
repeat: expectedValues.repeat || false,
value: gCurrentValue,
shift: false,
@ -1052,6 +1065,117 @@ function runSendKeyEnterTests() {
return promiseQueue;
}
function runSendKeyNumpadTests() {
gTestDescription = 'runSendKeyNumpadTests(): ';
var promiseQueue = Promise.resolve();
var tests = [];
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
.forEach(function(key) {
let charCode = key.charCodeAt(0);
tests.push({
dict: {
key: key,
code: 'Numpad' + key
},
expectedKeypress: true,
expectedInput: key,
expectedValues: {
key: key, code: 'Numpad' + key,
keyCode: charCode, charCode: charCode,
location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
}
});
});
[['+', 'NumpadAdd'],
[',', 'NumpadComma'],
['.', 'NumpadDecimal'],
['.', 'NumpadComma'], // Locale-specific NumpadComma
[',', 'NumpadDecimal'], // Locale-specific NumpadDecimal
['/', 'NumpadDivide'],
['=', 'NumpadEqual'],
// ['#', 'NumpadHash'], // Not supported yet.
['*', 'NumpadMultiply'],
['(', 'NumpadParenLeft'],
[')', 'NumpadParenRight'],
// ['*', 'NumpadStar'], // Not supported yet.
['-', 'NumpadSubtract']].forEach(function([key, code]) {
tests.push({
dict: {
key: key,
code: code
},
expectedKeypress: true,
expectedInput: key,
expectedValues: {
key: key, code: code, keyCode: 0, charCode: key.charCodeAt(0),
location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
}
});
});
[
'NumpadComma', // Locale-specific NumpadComma -- outputs nothing
'NumpadClear',
'NumpadClearEntry',
'NumpadMemoryAdd',
'NumpadMemoryClear',
'NumpadMemoryRecall',
'NumpadMemoryStore',
'NumpadMemorySubtract'
].forEach(function(code) {
tests.push({
dict: {
key: 'Unidentified',
code: code
},
expectedKeypress: true,
expectedValues: {
key: 'Unidentified', code: code, keyCode: 0, charCode: 0,
location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
}
});
});
tests.push({
dict: {
key: 'Enter',
code: 'NumpadEnter'
},
expectedKeypress: true,
expectedInput: '\n',
expectedValues: {
key: 'Enter', code: 'NumpadEnter',
keyCode: KeyboardEvent.DOM_VK_RETURN, charCode: 0,
location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
}
});
tests.push({
dict: {
key: 'Backspace',
code: 'NumpadBackspace'
},
expectedKeypress: true,
expectedInput: 'Backspace', // Special value
expectedValues: {
key: 'Backspace', code: 'NumpadBackspace',
keyCode: KeyboardEvent.DOM_VK_BACK_SPACE, charCode: 0,
location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
}
});
tests.forEach((test) => {
promiseQueue = promiseQueue.then(() => {
return sendKeyAndAssertResult(test);
});
});
return promiseQueue;
}
function runSendKeyRejectionTests() {
gTestDescription = 'runSendKeyRejectionTests(): ';
var promiseQueue = Promise.resolve();
@ -1636,6 +1760,7 @@ function runTest() {
.then(() => runSendKeyUSKeyboardSymbolsTests())
.then(() => runSendKeyGreekLettersTests())
.then(() => runSendKeyEnterTests())
.then(() => runSendKeyNumpadTests())
.then(() => runSendKeyRejectionTests())
.then(() => runCompositionWithKeyEventTests())
.then(() => runCompositionWithoutKeyEventTests())

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

@ -184,7 +184,7 @@ static char const *const gWebMCodecs[7] = {
#endif
/* static */ bool
DecoderTraits::IsWebMType(const nsACString& aType)
DecoderTraits::IsWebMTypeAndEnabled(const nsACString& aType)
{
#ifdef MOZ_WEBM
if (!MediaDecoder::IsWebMEnabled()) {
@ -200,7 +200,7 @@ DecoderTraits::IsWebMType(const nsACString& aType)
static bool
IsGStreamerSupportedType(const nsACString& aMimeType)
{
if (DecoderTraits::IsWebMType(aMimeType))
if (DecoderTraits::IsWebMTypeAndEnabled(aMimeType))
return false;
if (!MediaDecoder::IsGStreamerEnabled())
@ -352,7 +352,7 @@ IsMP4SupportedType(const nsACString& aType,
#endif
/* static */ bool
DecoderTraits::IsMP4Type(const nsACString& aType)
DecoderTraits::IsMP4TypeAndEnabled(const nsACString& aType)
{
#ifdef MOZ_FMP4
return IsMP4SupportedType(aType);
@ -364,6 +364,9 @@ static bool
IsMP3SupportedType(const nsACString& aType,
const nsAString& aCodecs = EmptyString())
{
#ifdef MOZ_OMX_DECODER
return false;
#endif
return MP3Decoder::CanHandleMediaType(aType, aCodecs);
}
@ -435,12 +438,12 @@ DecoderTraits::CanHandleCodecsType(const char* aMIMEType,
}
#endif
#if !defined(MOZ_OMX_WEBM_DECODER)
if (IsWebMType(nsDependentCString(aMIMEType))) {
if (IsWebMTypeAndEnabled(nsDependentCString(aMIMEType))) {
codecList = gWebMCodecs;
}
#endif
#ifdef MOZ_FMP4
if (IsMP4Type(nsDependentCString(aMIMEType))) {
if (IsMP4TypeAndEnabled(nsDependentCString(aMIMEType))) {
if (IsMP4SupportedType(nsDependentCString(aMIMEType), aRequestedCodecs)) {
return CANPLAY_YES;
} else {
@ -530,11 +533,11 @@ DecoderTraits::CanHandleMediaType(const char* aMIMEType,
return CANPLAY_MAYBE;
}
#endif
if (IsMP4Type(nsDependentCString(aMIMEType))) {
if (IsMP4TypeAndEnabled(nsDependentCString(aMIMEType))) {
return CANPLAY_MAYBE;
}
#if !defined(MOZ_OMX_WEBM_DECODER)
if (IsWebMType(nsDependentCString(aMIMEType))) {
if (IsWebMTypeAndEnabled(nsDependentCString(aMIMEType))) {
return CANPLAY_MAYBE;
}
#endif
@ -662,7 +665,7 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
return decoder.forget();
}
#endif
if (DecoderTraits::IsWebMType(aType)) {
if (DecoderTraits::IsWebMTypeAndEnabled(aType)) {
decoder = new WebMDecoder(aOwner);
return decoder.forget();
}
@ -744,7 +747,7 @@ MediaDecoderReader* DecoderTraits::CreateReader(const nsACString& aType, Abstrac
decoderReader = new AndroidMediaReader(aDecoder, aType);
} else
#endif
if (IsWebMType(aType)) {
if (IsWebMTypeAndEnabled(aType)) {
decoderReader = Preferences::GetBool("media.format-reader.webm", true) ?
static_cast<MediaDecoderReader*>(new MediaFormatReader(aDecoder, new WebMDemuxer(aDecoder->GetResource()))) :
new WebMReader(aDecoder);
@ -784,7 +787,7 @@ bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType)
(IsOmxSupportedType(aType) &&
!IsB2GSupportOnlyType(aType)) ||
#endif
IsWebMType(aType) ||
IsWebMTypeAndEnabled(aType) ||
#ifdef MOZ_GSTREAMER
IsGStreamerSupportedType(aType) ||
#endif

View File

@ -70,8 +70,8 @@ public:
// OnConnected signal. (currently RTSP only)
static bool DecoderWaitsForOnConnected(const nsACString& aType);
static bool IsWebMType(const nsACString& aType);
static bool IsMP4Type(const nsACString& aType);
static bool IsWebMTypeAndEnabled(const nsACString& aType);
static bool IsMP4TypeAndEnabled(const nsACString& aType);
};
} // namespace mozilla

View File

@ -69,6 +69,21 @@ static const char* const gMediaSourceTypes[6] = {
nullptr
};
// Returns true if we should enable MSE webm regardless of preferences.
// 1. If MP4/H264 isn't supported:
// * Windows XP
// * Windows Vista and Server 2008 without the optional "Platform Update Supplement"
// * N/KN editions (Europe and Korea) of Windows 7/8/8.1/10 without the
// optional "Windows Media Feature Pack"
static bool
IsWebMForced()
{
bool mp4supported =
DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"));
return !mp4supported;
}
static nsresult
IsTypeSupported(const nsAString& aType)
{
@ -88,7 +103,7 @@ IsTypeSupported(const nsAString& aType)
for (uint32_t i = 0; gMediaSourceTypes[i]; ++i) {
if (mimeType.EqualsASCII(gMediaSourceTypes[i])) {
if (DecoderTraits::IsMP4Type(mimeTypeUTF8)) {
if (DecoderTraits::IsMP4TypeAndEnabled(mimeTypeUTF8)) {
if (!Preferences::GetBool("media.mediasource.mp4.enabled", false)) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
@ -98,8 +113,9 @@ IsTypeSupported(const nsAString& aType)
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
return NS_OK;
} else if (DecoderTraits::IsWebMType(mimeTypeUTF8)) {
if (!Preferences::GetBool("media.mediasource.webm.enabled", false)) {
} else if (DecoderTraits::IsWebMTypeAndEnabled(mimeTypeUTF8)) {
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
IsWebMForced())) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
if (hasCodecs &&

View File

@ -376,7 +376,13 @@ TrackBuffersManager::CompleteResetParserState()
// to discard now.
track->mQueuedSamples.Clear();
}
// 6. Remove all bytes from the input buffer.
// 6. If the mode attribute equals "sequence", then set the group start timestamp to the group end timestamp
if (mSourceBufferAttributes->GetAppendMode() == SourceBufferAppendMode::Sequence) {
mGroupStartTimestamp = Some(mGroupEndTimestamp);
}
// 7. Remove all bytes from the input buffer.
mIncomingBuffers.Clear();
mInputBuffer = nullptr;
if (mCurrentInputBuffer) {
@ -401,7 +407,7 @@ TrackBuffersManager::CompleteResetParserState()
}
RecreateParser(true);
// 7. Set append state to WAITING_FOR_SEGMENT.
// 8. Set append state to WAITING_FOR_SEGMENT.
SetAppendState(AppendState::WAITING_FOR_SEGMENT);
// Reject our promise immediately.

View File

@ -100,7 +100,7 @@ nsresult
DoCORSChecks(nsIChannel* aChannel, nsILoadInfo* aLoadInfo,
nsCOMPtr<nsIStreamListener>& aInAndOutListener)
{
MOZ_ASSERT(aInAndOutListener, "can not perform CORS checks without a listener");
MOZ_RELEASE_ASSERT(aInAndOutListener, "can not perform CORS checks without a listener");
nsIPrincipal* loadingPrincipal = aLoadInfo->LoadingPrincipal();
RefPtr<nsCORSListenerProxy> corsListener =
new nsCORSListenerProxy(aInAndOutListener,

View File

@ -156,7 +156,6 @@ DOMSVGPathSeg::IndexIsValid()
// Implementation of DOMSVGPathSeg sub-classes below this point
#define IMPL_PROP_WITH_TYPE(segName, propName, index, type) \
/* attribute type propName; */ \
type \
DOMSVGPathSeg##segName::propName() \
{ \

View File

@ -338,7 +338,6 @@ StumblerInfo::DumpStumblerInfo()
target->Dispatch(event, NS_DISPATCH_NORMAL);
}
/* void notifyGetCellInfoList (in uint32_t count, [array, size_is (count)] in nsICellInfo result); */
NS_IMETHODIMP
StumblerInfo::NotifyGetCellInfoList(uint32_t count, nsICellInfo** aCellInfos)
{
@ -353,7 +352,6 @@ StumblerInfo::NotifyGetCellInfoList(uint32_t count, nsICellInfo** aCellInfos)
return NS_OK;
}
/* void notifyGetCellInfoListFailed (in DOMString error); */
NS_IMETHODIMP StumblerInfo::NotifyGetCellInfoListFailed(const nsAString& error)
{
MOZ_ASSERT(NS_IsMainThread());

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

@ -102,7 +102,9 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMDocument> xslDocument;
rv = nsSyncLoadService::LoadDocument(xslUri, nsContentUtils::GetSystemPrincipal(),
rv = nsSyncLoadService::LoadDocument(xslUri, nsIContentPolicy::TYPE_XSLT,
nsContentUtils::GetSystemPrincipal(),
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nullptr, true, mozilla::net::RP_Default,
getter_AddRefs(xslDocument));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -15,8 +15,10 @@
#include "nsIPrincipal.h"
nsresult
txParseDocumentFromURI(const nsAString& aHref, const txXPathNode& aLoader,
nsAString& aErrMsg, txXPathNode** aResult)
txParseDocumentFromURI(const nsAString& aHref,
const txXPathNode& aLoader,
nsAString& aErrMsg,
txXPathNode** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = nullptr;
@ -36,7 +38,9 @@ txParseDocumentFromURI(const nsAString& aHref, const txXPathNode& aLoader,
nsIDOMDocument* theDocument = nullptr;
nsAutoSyncOperation sync(loaderDocument);
rv = nsSyncLoadService::LoadDocument(documentURI,
nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST,
loaderDocument->NodePrincipal(),
nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS,
loadGroup, true,
loaderDocument->GetReferrerPolicy(),
&theDocument);

View File

@ -629,20 +629,6 @@ txSyncCompileObserver::loadURI(const nsAString& aUri,
getter_AddRefs(referrerPrincipal));
NS_ENSURE_SUCCESS(rv, rv);
// Content Policy
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_INTERNAL_STYLESHEET,
uri,
referrerPrincipal,
nullptr,
NS_LITERAL_CSTRING("application/xml"),
nullptr,
&shouldLoad);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_CP_REJECTED(shouldLoad)) {
return NS_ERROR_DOM_BAD_URI;
}
// This is probably called by js, a loadGroup for the channel doesn't
// make sense.
nsCOMPtr<nsINode> source;
@ -652,8 +638,12 @@ txSyncCompileObserver::loadURI(const nsAString& aUri,
}
nsAutoSyncOperation sync(source ? source->OwnerDoc() : nullptr);
nsCOMPtr<nsIDOMDocument> document;
rv = nsSyncLoadService::LoadDocument(uri, referrerPrincipal, nullptr,
false, aReferrerPolicy,
rv = nsSyncLoadService::LoadDocument(uri, nsIContentPolicy::TYPE_XSLT,
referrerPrincipal,
nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS,
nullptr, false,
aReferrerPolicy,
getter_AddRefs(document));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -85,10 +85,6 @@ NS_IMETHODIMP nsTransactionList::ItemIsBatch(int32_t aIndex, bool *aIsBatch)
return item->GetIsBatch(aIsBatch);
}
/* void getData (in long aIndex,
[optional] out unsigned long aLength,
[array, size_is (aLength), retval]
out nsISupports aData); */
NS_IMETHODIMP nsTransactionList::GetData(int32_t aIndex,
uint32_t *aLength,
nsISupports ***aData)

View File

@ -415,9 +415,6 @@ NS_IMETHODIMP nsWebBrowserPersist::SetProgressListener(
return NS_OK;
}
/* void saveURI (in nsIURI aURI, in nsISupports aCacheKey, in nsIURI aReferrer,
in nsIInputStream aPostData, in wstring aExtraHeaders,
in nsISupports aFile, in nsILoadContext aPrivayContext); */
NS_IMETHODIMP nsWebBrowserPersist::SaveURI(
nsIURI *aURI, nsISupports *aCacheKey,
nsIURI *aReferrer, uint32_t aReferrerPolicy,
@ -533,7 +530,6 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveDocument(
return rv;
}
/* void cancel(nsresult aReason); */
NS_IMETHODIMP nsWebBrowserPersist::Cancel(nsresult aReason)
{
mCancel = true;
@ -1002,8 +998,6 @@ nsWebBrowserPersist::OnDataAvailable(
// nsWebBrowserPersist::nsIProgressEventSink
//*****************************************************************************
/* void onProgress (in nsIRequest request, in nsISupports ctxt,
in long long aProgress, in long long aProgressMax); */
NS_IMETHODIMP nsWebBrowserPersist::OnProgress(
nsIRequest *request, nsISupports *ctxt, int64_t aProgress,
int64_t aProgressMax)
@ -1055,8 +1049,6 @@ NS_IMETHODIMP nsWebBrowserPersist::OnProgress(
return NS_OK;
}
/* void onStatus (in nsIRequest request, in nsISupports ctxt,
in nsresult status, in wstring statusArg); */
NS_IMETHODIMP nsWebBrowserPersist::OnStatus(
nsIRequest *request, nsISupports *ctxt, nsresult status,
const char16_t *statusArg)

View File

@ -546,20 +546,17 @@ typedef Log<LOG_CRITICAL, CriticalLogger> CriticalLog;
// firstTime = false;
// gfxCriticalError() << "This message only shows up once;
// }
#ifdef GFX_LOG_DEBUG
#if defined(DEBUG)
#define gfxDebug mozilla::gfx::DebugLog
#define gfxDebugOnce static gfxDebug GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxDebug
#else
#define gfxDebug if (1) ; else mozilla::gfx::NoLog
#define gfxDebugOnce if (1) ; else mozilla::gfx::NoLog
#endif
#ifdef GFX_LOG_WARNING
// Have gfxWarning available (behind a runtime preference)
#define gfxWarning mozilla::gfx::WarningLog
#define gfxWarningOnce static gfxWarning GFX_LOGGING_GLUE(sOnceAtLine,__LINE__) = gfxWarning
#else
#define gfxWarning if (1) ; else mozilla::gfx::NoLog
#define gfxWarningOnce if (1) ; else mozilla::gfx::NoLog
#endif
// In the debug build, this is equivalent to the default gfxCriticalError.
// In the non-debug build, on nightly and dev edition, it will MOZ_CRASH.

View File

@ -42,7 +42,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>USE_SSE2;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);GFX_LOG_DEBUG;GFX_LOG_WARNING;MFBT_STAND_ALONE;XP_WIN</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_SSE2;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);MFBT_STAND_ALONE;XP_WIN</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -62,7 +62,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>USE_SSE2;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);GFX_LOG_WARNING</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_SSE2;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

View File

@ -179,17 +179,6 @@ for var in ('USE_CAIRO', 'MOZ2D_HAS_MOZ_CAIRO'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'gonk', 'qt'):
DEFINES['MOZ_ENABLE_FREETYPE'] = True
if CONFIG['MOZ_DEBUG']:
DEFINES['GFX_LOG_DEBUG'] = True
DEFINES['GFX_LOG_WARNING'] = True
# Define the GFX_LOG_WARNING in release builds (available, but controlled by a
# preference), though we may want to consider only doing it in the nightly
# build, if the size of gfxWarning() code ends up making a difference.
# See bug 1074952.
# if CONFIG['NIGHTLY_BUILD']:
DEFINES['GFX_LOG_WARNING'] = True
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'gonk', 'qt'):

View File

@ -11,6 +11,13 @@
#include "gfx2DGlue.h"
#include "nsAppRunner.h"
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
#include "libdisplay/GonkDisplay.h" // for GonkDisplay
#include <ui/Fence.h>
#include "nsWindow.h"
#include "nsScreenManagerGonk.h"
#endif
namespace mozilla {
namespace gfx {
class Matrix4x4;
@ -353,5 +360,49 @@ DecomposeIntoNoRepeatRects(const gfx::Rect& aRect,
return 4;
}
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
void
Compositor::SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget)
{
// OpenGL does not provide ReleaseFence for rendering.
// Instead use DispAcquireFence as layer buffer's ReleaseFence
// to prevent flickering and tearing.
// DispAcquireFence is DisplaySurface's AcquireFence.
// AcquireFence will be signaled when a buffer's content is available.
// See Bug 974152.
if (!aLayer || !aWidget) {
return;
}
nsWindow* window = static_cast<nsWindow*>(aWidget);
RefPtr<FenceHandle::FdObj> fence = new FenceHandle::FdObj(
window->GetScreen()->GetPrevDispAcquireFd());
mReleaseFenceHandle.Merge(FenceHandle(fence));
}
FenceHandle
Compositor::GetReleaseFence()
{
if (!mReleaseFenceHandle.IsValid()) {
return FenceHandle();
}
RefPtr<FenceHandle::FdObj> fdObj = mReleaseFenceHandle.GetDupFdObj();
return FenceHandle(fdObj);
}
#else
void
Compositor::SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget)
{
}
FenceHandle
Compositor::GetReleaseFence()
{
return FenceHandle();
}
#endif
} // namespace layers
} // namespace mozilla

View File

@ -370,12 +370,9 @@ public:
*/
virtual void EndFrame() = 0;
virtual void SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget) {}
virtual void SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget);
virtual FenceHandle GetReleaseFence()
{
return FenceHandle();
}
virtual FenceHandle GetReleaseFence();
/**
* Post-rendering stuff if the rendering is done outside of this Compositor
@ -541,6 +538,10 @@ protected:
RefPtr<gfx::DrawTarget> mTarget;
gfx::IntRect mTargetBounds;
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
FenceHandle mReleaseFenceHandle;
#endif
private:
static LayersBackend sBackend;

View File

@ -397,18 +397,15 @@ ConvertOmxYUVFormatToRGB565(android::sp<GraphicBuffer>& aBuffer,
return OK;
}
already_AddRefed<gfx::SourceSurface>
GrallocImage::GetAsSourceSurface()
already_AddRefed<gfx::DataSourceSurface>
GetDataSourceSurfaceFrom(android::sp<android::GraphicBuffer>& aGraphicBuffer,
gfx::IntSize aSize,
const layers::PlanarYCbCrData& aYcbcrData)
{
if (!mTextureClient) {
return nullptr;
}
android::sp<GraphicBuffer> graphicBuffer =
mTextureClient->GetGraphicBuffer();
MOZ_ASSERT(aGraphicBuffer.get());
RefPtr<gfx::DataSourceSurface> surface =
gfx::Factory::CreateDataSourceSurface(GetSize(), gfx::SurfaceFormat::R5G6B5);
gfx::Factory::CreateDataSourceSurface(aSize, gfx::SurfaceFormat::R5G6B5);
if (NS_WARN_IF(!surface)) {
return nullptr;
}
@ -420,13 +417,13 @@ GrallocImage::GetAsSourceSurface()
}
int32_t rv;
rv = ConvertOmxYUVFormatToRGB565(graphicBuffer, surface, &mappedSurface, mData);
rv = ConvertOmxYUVFormatToRGB565(aGraphicBuffer, surface, &mappedSurface, aYcbcrData);
if (rv == OK) {
surface->Unmap();
return surface.forget();
}
rv = ConvertVendorYUVFormatToRGB565(graphicBuffer, surface, &mappedSurface);
rv = ConvertVendorYUVFormatToRGB565(aGraphicBuffer, surface, &mappedSurface);
surface->Unmap();
if (rv != OK) {
NS_WARNING("Unknown color format");
@ -436,6 +433,22 @@ GrallocImage::GetAsSourceSurface()
return surface.forget();
}
already_AddRefed<gfx::SourceSurface>
GrallocImage::GetAsSourceSurface()
{
if (!mTextureClient) {
return nullptr;
}
android::sp<GraphicBuffer> graphicBuffer =
mTextureClient->GetGraphicBuffer();
RefPtr<gfx::DataSourceSurface> surface =
GetDataSourceSurfaceFrom(graphicBuffer, mSize, mData);
return surface.forget();
}
android::sp<android::GraphicBuffer>
GrallocImage::GetGraphicBuffer() const
{

View File

@ -22,6 +22,11 @@ namespace layers {
class GrallocTextureClientOGL;
already_AddRefed<gfx::DataSourceSurface>
GetDataSourceSurfaceFrom(android::sp<android::GraphicBuffer>& aGraphicBuffer,
gfx::IntSize aSize,
const layers::PlanarYCbCrData& aYcbcrData);
/**
* The YUV format supported by Android HAL
*

View File

@ -0,0 +1,291 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GrallocTextureHostBasic.h"
#include "GrallocImages.h" // for GetDataSourceSurfaceFrom()
#include "mozilla/layers/SharedBufferManagerParent.h"
#if ANDROID_VERSION >= 17
#include <ui/Fence.h>
#endif
namespace mozilla {
namespace layers {
static SurfaceFormat
HalFormatToSurfaceFormat(int aHalFormat, TextureFlags aFlags)
{
bool swapRB = bool(aFlags & TextureFlags::RB_SWAPPED);
switch (aHalFormat) {
case android::PIXEL_FORMAT_BGRA_8888:
return swapRB ? gfx::SurfaceFormat::R8G8B8A8 : gfx::SurfaceFormat::B8G8R8A8;
case android::PIXEL_FORMAT_RGBA_8888:
return swapRB ? gfx::SurfaceFormat::B8G8R8A8 : gfx::SurfaceFormat::R8G8B8A8;
case android::PIXEL_FORMAT_RGBX_8888:
return swapRB ? gfx::SurfaceFormat::B8G8R8X8 : gfx::SurfaceFormat::R8G8B8X8;
case android::PIXEL_FORMAT_RGB_565:
return gfx::SurfaceFormat::R5G6B5;
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
case HAL_PIXEL_FORMAT_YCbCr_422_I:
case GrallocImage::HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
case GrallocImage::HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_YV12:
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
#endif
// Needs convert to RGB565
return gfx::SurfaceFormat::R5G6B5;
default:
if (aHalFormat >= 0x100 && aHalFormat <= 0x1FF) {
// Reserved range for HAL specific formats.
// Needs convert to RGB565
return gfx::SurfaceFormat::R5G6B5;
} else {
MOZ_CRASH("Unhandled HAL pixel format");
return SurfaceFormat::UNKNOWN; // not reached
}
}
}
static bool
NeedsConvertFromYUVtoRGB565(int aHalFormat)
{
switch (aHalFormat) {
case android::PIXEL_FORMAT_BGRA_8888:
case android::PIXEL_FORMAT_RGBA_8888:
case android::PIXEL_FORMAT_RGBX_8888:
case android::PIXEL_FORMAT_RGB_565:
return false;
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
case HAL_PIXEL_FORMAT_YCbCr_422_I:
case GrallocImage::HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
case GrallocImage::HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_YV12:
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
#endif
return true;
default:
if (aHalFormat >= 0x100 && aHalFormat <= 0x1FF) {
// Reserved range for HAL specific formats.
return true;
} else {
MOZ_CRASH("Unhandled HAL pixel format");
return false; // not reached
}
}
}
GrallocTextureHostBasic::GrallocTextureHostBasic(
TextureFlags aFlags,
const NewSurfaceDescriptorGralloc& aDescriptor)
: TextureHost(aFlags)
, mGrallocHandle(aDescriptor)
, mSize(0, 0)
, mCropSize(0, 0)
, mFormat(gfx::SurfaceFormat::UNKNOWN)
, mIsOpaque(aDescriptor.isOpaque())
{
android::GraphicBuffer* grallocBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
MOZ_ASSERT(grallocBuffer);
if (grallocBuffer) {
mFormat =
HalFormatToSurfaceFormat(grallocBuffer->getPixelFormat(),
aFlags & TextureFlags::RB_SWAPPED);
mSize = gfx::IntSize(grallocBuffer->getWidth(), grallocBuffer->getHeight());
mCropSize = mSize;
} else {
printf_stderr("gralloc buffer is nullptr\n");
}
}
bool
GrallocTextureHostBasic::Lock()
{
if (!mCompositor || !IsValid()) {
return false;
}
if (mTextureSource) {
return true;
}
android::sp<android::GraphicBuffer> graphicBuffer =
GetGraphicBufferFromDesc(mGrallocHandle);
MOZ_ASSERT(graphicBuffer.get());
RefPtr<gfx::DataSourceSurface> surf;
if (NeedsConvertFromYUVtoRGB565(graphicBuffer->getPixelFormat())) {
PlanarYCbCrData ycbcrData;
surf = GetDataSourceSurfaceFrom(graphicBuffer,
mCropSize,
ycbcrData);
} else {
uint32_t usage = GRALLOC_USAGE_SW_READ_OFTEN;
int32_t rv = graphicBuffer->lock(usage,
reinterpret_cast<void**>(&mMappedBuffer));
if (rv) {
mMappedBuffer = nullptr;
NS_WARNING("Couldn't lock graphic buffer");
return false;
}
surf = Factory::CreateWrappingDataSourceSurface(
mMappedBuffer,
graphicBuffer->getStride() * gfx::BytesPerPixel(mFormat),
mCropSize,
mFormat);
}
mTextureSource = mCompositor->CreateDataTextureSource(mFlags);
mTextureSource->Update(surf, nullptr);
return true;
}
bool
GrallocTextureHostBasic::IsValid() const
{
android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
return graphicBuffer != nullptr;
}
bool
GrallocTextureHostBasic::BindTextureSource(CompositableTextureSourceRef& aTexture)
{
aTexture = mTextureSource;
return !!aTexture;
}
void
GrallocTextureHostBasic::UnbindTextureSource()
{
ClearTextureSource();
}
void
GrallocTextureHostBasic::ClearTextureSource()
{
mTextureSource = nullptr;
if (mMappedBuffer) {
android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
MOZ_ASSERT(graphicBuffer);
mMappedBuffer = nullptr;
graphicBuffer->unlock();
}
}
void
GrallocTextureHostBasic::SetCompositor(Compositor* aCompositor)
{
BasicCompositor* compositor = static_cast<BasicCompositor*>(aCompositor);
mCompositor = compositor;
if (mTextureSource) {
mTextureSource->SetCompositor(compositor);
}
}
gfx::SurfaceFormat
GrallocTextureHostBasic::GetFormat() const {
return mFormat;
}
void
GrallocTextureHostBasic::WaitAcquireFenceHandleSyncComplete()
{
if (!mAcquireFenceHandle.IsValid()) {
return;
}
#if ANDROID_VERSION >= 17
RefPtr<FenceHandle::FdObj> fdObj = mAcquireFenceHandle.GetAndResetFdObj();
android::sp<android::Fence> fence(
new android::Fence(fdObj->GetAndResetFd()));
// Wait fece complete with timeout.
// If a source of the fence becomes invalid because of error,
// fene complete is not signaled. See Bug 1061435.
int rv = fence->wait(400 /*400 msec*/);
if (rv != android::OK) {
NS_ERROR("failed to wait fence complete");
}
#endif
}
void
GrallocTextureHostBasic::SetCropRect(nsIntRect aCropRect)
{
MOZ_ASSERT(aCropRect.TopLeft() == IntPoint(0, 0));
MOZ_ASSERT(!aCropRect.IsEmpty());
MOZ_ASSERT(aCropRect.width <= mSize.width);
MOZ_ASSERT(aCropRect.height <= mSize.height);
gfx::IntSize cropSize(aCropRect.width, aCropRect.height);
if (mCropSize == cropSize) {
return;
}
mCropSize = cropSize;
ClearTextureSource();
}
void
GrallocTextureHostBasic::DeallocateSharedData()
{
ClearTextureSource();
if (mGrallocHandle.buffer().type() != MaybeMagicGrallocBufferHandle::Tnull_t) {
MaybeMagicGrallocBufferHandle handle = mGrallocHandle.buffer();
base::ProcessId owner;
if (handle.type() == MaybeMagicGrallocBufferHandle::TGrallocBufferRef) {
owner = handle.get_GrallocBufferRef().mOwner;
}
else {
owner = handle.get_MagicGrallocBufferHandle().mRef.mOwner;
}
SharedBufferManagerParent::DropGrallocBuffer(owner, mGrallocHandle);
}
}
void
GrallocTextureHostBasic::ForgetSharedData()
{
ClearTextureSource();
}
void
GrallocTextureHostBasic::DeallocateDeviceData()
{
ClearTextureSource();
}
LayerRenderState
GrallocTextureHostBasic::GetRenderState()
{
android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
if (graphicBuffer) {
LayerRenderStateFlags flags = LayerRenderStateFlags::LAYER_RENDER_STATE_DEFAULT;
if (mIsOpaque) {
flags |= LayerRenderStateFlags::OPAQUE;
}
if (mFlags & TextureFlags::ORIGIN_BOTTOM_LEFT) {
flags |= LayerRenderStateFlags::ORIGIN_BOTTOM_LEFT;
}
if (mFlags & TextureFlags::RB_SWAPPED) {
flags |= LayerRenderStateFlags::FORMAT_RB_SWAP;
}
return LayerRenderState(graphicBuffer,
mCropSize,
flags,
this);
}
return LayerRenderState();
}
} // namespace layers
} // namespace mozilla

View File

@ -0,0 +1,86 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_GFX_GRALLOCTEXTUREHOST_BASIC_H
#define MOZILLA_GFX_GRALLOCTEXTUREHOST_BASIC_H
#include "mozilla/layers/BasicCompositor.h"
#include "mozilla/layers/ShadowLayerUtilsGralloc.h"
#include "mozilla/layers/TextureHostBasic.h"
namespace mozilla {
namespace layers {
class BasicCompositor;
/**
* A TextureHost for shared gralloc
*
* Most of the logic actually happens in GrallocTextureSourceBasic.
*/
class GrallocTextureHostBasic : public TextureHost
{
public:
GrallocTextureHostBasic(TextureFlags aFlags,
const NewSurfaceDescriptorGralloc& aDescriptor);
virtual void SetCompositor(Compositor* aCompositor) override;
virtual bool Lock() override;
virtual gfx::SurfaceFormat GetFormat() const override;
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
virtual void UnbindTextureSource() override;
virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override
{
return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
}
virtual void WaitAcquireFenceHandleSyncComplete() override;
virtual gfx::IntSize GetSize() const override { return mCropSize; }
virtual void SetCropRect(nsIntRect aCropRect) override;
virtual void DeallocateSharedData() override;
virtual void ForgetSharedData() override;
virtual void DeallocateDeviceData() override;
virtual LayerRenderState GetRenderState() override;
bool IsValid() const;
void ClearTextureSource();
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() override { return "GrallocTextureHostBasic"; }
#endif
protected:
RefPtr<BasicCompositor> mCompositor;
RefPtr<DataTextureSource> mTextureSource;
NewSurfaceDescriptorGralloc mGrallocHandle;
// gralloc buffer size.
gfx::IntSize mSize;
// Size reported by TextureClient, can be different in some cases (video?),
// used by LayerRenderState.
gfx::IntSize mCropSize;
gfx::SurfaceFormat mFormat;
bool mIsOpaque;
/**
* Points to a mapped gralloc buffer when TextureSource is valid.
*/
uint8_t* mMappedBuffer;
};
} // namespace layers
} // namespace mozilla
#endif // MOZILLA_GFX_GRALLOCTEXTUREHOST_BASIC_H

View File

@ -7,6 +7,9 @@
#ifdef XP_MACOSX
#include "MacIOSurfaceTextureHostBasic.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include "GrallocTextureHostBasic.h"
#endif
using namespace mozilla::gl;
using namespace mozilla::gfx;
@ -25,6 +28,13 @@ CreateTextureHostBasic(const SurfaceDescriptor& aDesc,
aDesc.get_SurfaceDescriptorMacIOSurface();
return MakeAndAddRef<MacIOSurfaceTextureHostBasic>(aFlags, desc);
}
#endif
#ifdef MOZ_WIDGET_GONK
if (aDesc.type() == SurfaceDescriptor::TNewSurfaceDescriptorGralloc) {
const NewSurfaceDescriptorGralloc& desc =
aDesc.get_NewSurfaceDescriptorGralloc();
return MakeAndAddRef<GrallocTextureHostBasic>(aFlags, desc);
}
#endif
return CreateBackendIndependentTextureHost(aDesc, aDeallocator, aFlags);
}

View File

@ -14,9 +14,12 @@
#include "SharedSurface.h"
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/GrallocTextureClient.h"
#include "SharedSurfaceGralloc.h"
#endif
using namespace mozilla::gl;
namespace mozilla {
namespace layers {

View File

@ -214,10 +214,10 @@ TextureHost::Create(const SurfaceDescriptor& aDesc,
return CreateBackendIndependentTextureHost(aDesc, aDeallocator, aFlags);
case SurfaceDescriptor::TEGLImageDescriptor:
case SurfaceDescriptor::TNewSurfaceDescriptorGralloc:
case SurfaceDescriptor::TSurfaceTextureDescriptor:
return CreateTextureHostOGL(aDesc, aDeallocator, aFlags);
case SurfaceDescriptor::TNewSurfaceDescriptorGralloc:
case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface:
if (aBackend == LayersBackend::LAYERS_OPENGL) {
return CreateTextureHostOGL(aDesc, aDeallocator, aFlags);

View File

@ -670,6 +670,9 @@ SharedTextureClientD3D9::SharedTextureClientD3D9(ISurfaceAllocator* aAllocator,
SharedTextureClientD3D9::~SharedTextureClientD3D9()
{
MOZ_COUNT_DTOR(SharedTextureClientD3D9);
if (mTexture) {
gfxWindowsPlatform::sD3D9SharedTextureUsed -= mDesc.Width * mDesc.Height * 4;
}
}
void
@ -678,9 +681,6 @@ SharedTextureClientD3D9::FinalizeOnIPDLThread()
if (mTexture && mActor) {
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<IDirect3DTexture9>>(mTexture));
}
if (mTexture) {
gfxWindowsPlatform::sD3D9SharedTextureUsed -= mDesc.Width * mDesc.Height * 4;
}
}
// static

View File

@ -217,9 +217,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
# has full system permissions there.
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
EXPORTS.mozilla.layers += [
'basic/GrallocTextureHostBasic.h',
'ipc/ShadowLayerUtilsGralloc.h',
]
UNIFIED_SOURCES += [
'basic/GrallocTextureHostBasic.cpp',
'GrallocImages.cpp',
'opengl/EGLImageHelpers.cpp',
'opengl/GrallocTextureClient.cpp',

View File

@ -51,13 +51,6 @@
#include "GeckoProfiler.h"
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
#include "libdisplay/GonkDisplay.h" // for GonkDisplay
#include <ui/Fence.h>
#include "nsWindow.h"
#include "nsScreenManagerGonk.h"
#endif
namespace mozilla {
using namespace std;
@ -1458,50 +1451,6 @@ CompositorOGL::EndFrame()
}
}
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
void
CompositorOGL::SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget)
{
// OpenGL does not provide ReleaseFence for rendering.
// Instead use DispAcquireFence as layer buffer's ReleaseFence
// to prevent flickering and tearing.
// DispAcquireFence is DisplaySurface's AcquireFence.
// AcquireFence will be signaled when a buffer's content is available.
// See Bug 974152.
if (!aLayer || !aWidget) {
return;
}
nsWindow* window = static_cast<nsWindow*>(aWidget);
RefPtr<FenceHandle::FdObj> fence = new FenceHandle::FdObj(
window->GetScreen()->GetPrevDispAcquireFd());
mReleaseFenceHandle.Merge(FenceHandle(fence));
}
FenceHandle
CompositorOGL::GetReleaseFence()
{
if (!mReleaseFenceHandle.IsValid()) {
return FenceHandle();
}
RefPtr<FenceHandle::FdObj> fdObj = mReleaseFenceHandle.GetDupFdObj();
return FenceHandle(fdObj);
}
#else
void
CompositorOGL::SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget)
{
}
FenceHandle
CompositorOGL::GetReleaseFence()
{
return FenceHandle();
}
#endif
void
CompositorOGL::EndFrameForExternalComposition(const gfx::Matrix& aTransform)
{

View File

@ -232,8 +232,6 @@ public:
const gfx::Rect& aVisibleRect) override;
virtual void EndFrame() override;
virtual void SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget) override;
virtual FenceHandle GetReleaseFence() override;
virtual void EndFrameForExternalComposition(const gfx::Matrix& aTransform) override;
virtual bool SupportsPartialTextureUpdate() override;
@ -452,7 +450,6 @@ private:
*/
gfx::IntSize mViewportSize;
FenceHandle mReleaseFenceHandle;
ShaderProgramOGL *mCurrentProgram;
gfx::Rect mRenderBound;

View File

@ -118,7 +118,7 @@ GrallocTextureHostOGL::GrallocTextureHostOGL(TextureFlags aFlags,
mSize = gfx::IntSize(graphicBuffer->getWidth(), graphicBuffer->getHeight());
mCropSize = mSize;
} else {
printf_stderr("gralloc buffer is nullptr");
printf_stderr("gralloc buffer is nullptr\n");
}
}
@ -419,7 +419,7 @@ GrallocTextureHostOGL::WaitAcquireFenceHandleSyncComplete()
EGLint status = sEGLLibrary.fClientWaitSync(EGL_DISPLAY(),
sync,
0,
400000000 /*400 usec*/);
400000000 /*400 msec*/);
if (status != LOCAL_EGL_CONDITION_SATISFIED) {
NS_ERROR("failed to wait native fence sync");
}

View File

@ -0,0 +1,5 @@
<!DOCTYPE HTML>
<html style="font-size: 70368744177663%; -moz-background-size: 2199023255552em 809464690865px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC);">
<body>
</body>
</html>

View File

@ -0,0 +1,2 @@
<html><body style="font-size-adjust: -18446744073709552000; font-weight: bold;">&#x9385;</body></html>

View File

@ -0,0 +1 @@
<html style="-moz-box-shadow: 0 0 0.2em blue; -moz-appearance: button;"><body style="padding: 113in;"></body></html>

View File

@ -79,10 +79,12 @@ load 483120-2.xhtml
load 487549-1.html
load 487724-1.html
load 490777-1.html
load 516512-1.html
load 532726-1.html
load 538065-1.html
load 546870-1.html
load 557348-1.html
load 563740-1.html
load 580100-1.html
load 580212-1.html
load 580233-1.html
@ -90,6 +92,7 @@ load 580719-1.html
load 593526.html
load 593526.xul
load 594654-1.xhtml
load 595042-1.html
load 595727-1.html
load 624198.xhtml
load 633453-1.html

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