mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-03 04:52:54 +00:00
Merge the last green birch cset to m-c.
This commit is contained in:
commit
545af1073c
@ -1,4 +1,4 @@
|
||||
{
|
||||
"revision": "5e60cb6fc0e09cefe242a6fb0159fbd09360cc1a",
|
||||
"revision": "9093c20568e0b754c5e288290ba68836d5f397f1",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -2044,8 +2044,11 @@ void MediaDecoderStateMachine::DecodeSeek()
|
||||
}
|
||||
}
|
||||
mDecoder->StartProgressUpdates();
|
||||
if (mState == DECODER_STATE_DORMANT || mState == DECODER_STATE_SHUTDOWN)
|
||||
if (mState == DECODER_STATE_DECODING_METADATA ||
|
||||
mState == DECODER_STATE_DORMANT ||
|
||||
mState == DECODER_STATE_SHUTDOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to decode another frame to detect if we're at the end...
|
||||
LOG(PR_LOG_DEBUG, ("%p Seek completed, mCurrentFrameTime=%lld\n",
|
||||
|
@ -583,14 +583,18 @@ BrowserElementChild.prototype = {
|
||||
_getSystemCtxMenuData: function(elem) {
|
||||
if ((elem instanceof Ci.nsIDOMHTMLAnchorElement && elem.href) ||
|
||||
(elem instanceof Ci.nsIDOMHTMLAreaElement && elem.href)) {
|
||||
return elem.href;
|
||||
return {uri: elem.href};
|
||||
}
|
||||
if (elem instanceof Ci.nsIImageLoadingContent && elem.currentURI) {
|
||||
return elem.currentURI.spec;
|
||||
return {uri: elem.currentURI.spec};
|
||||
}
|
||||
if ((elem instanceof Ci.nsIDOMHTMLMediaElement) ||
|
||||
(elem instanceof Ci.nsIDOMHTMLImageElement)) {
|
||||
return elem.currentSrc || elem.src;
|
||||
if (elem instanceof Ci.nsIDOMHTMLImageElement) {
|
||||
return {uri: elem.src};
|
||||
}
|
||||
if (elem instanceof Ci.nsIDOMHTMLMediaElement) {
|
||||
let hasVideo = !(elem.readyState >= elem.HAVE_METADATA &&
|
||||
(elem.videoWidth == 0 || elem.videoHeight == 0));
|
||||
return {uri: elem.currentSrc || elem.src, hasVideo: hasVideo};
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
@ -16,6 +16,8 @@ include $(DEPTH)/config/autoconf.mk
|
||||
# process. Default is OOP.
|
||||
|
||||
MOCHITEST_FILES = \
|
||||
$(topsrcdir)/browser/base/content/test/audio.ogg \
|
||||
$(topsrcdir)/content/media/test/short-video.ogv \
|
||||
file_empty_script.js \
|
||||
file_empty.html \
|
||||
file_focus.html \
|
||||
|
@ -4,6 +4,9 @@ SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
let audioUrl = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/audio.ogg';
|
||||
let videoUrl = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/short-video.ogv';
|
||||
|
||||
function runTests() {
|
||||
createIframe(function onIframeLoaded() {
|
||||
checkEmptyContextMenu();
|
||||
@ -114,17 +117,68 @@ function checkCallbackWithoutPreventDefault() {
|
||||
checkContextMenuCallbackForId(detail, id, function onCallbackFired(label) {
|
||||
is(label, null, 'Callback label should be null');
|
||||
|
||||
SimpleTest.finish();
|
||||
checkImageContextMenu();
|
||||
});
|
||||
}, /* ignorePreventDefault */ true);
|
||||
}
|
||||
|
||||
function checkImageContextMenu() {
|
||||
sendContextMenuTo('#menu3-trigger', function onContextMenu(detail) {
|
||||
var target = detail.systemTargets[0];
|
||||
is(target.nodeName, 'IMG', 'Reports correct nodeName');
|
||||
is(target.data.uri, 'example.png', 'Reports correct uri');
|
||||
|
||||
checkVideoContextMenu();
|
||||
}, /* ignorePreventDefault */ true);
|
||||
}
|
||||
|
||||
function checkVideoContextMenu() {
|
||||
sendContextMenuTo('#menu4-trigger', function onContextMenu(detail) {
|
||||
var target = detail.systemTargets[0];
|
||||
is(target.nodeName, 'VIDEO', 'Reports correct nodeName');
|
||||
is(target.data.uri, videoUrl, 'Reports uri correctly in data');
|
||||
is(target.data.hasVideo, true, 'Video data in video tag does "hasVideo"');
|
||||
|
||||
checkAudioContextMenu();
|
||||
}, /* ignorePreventDefault */ true);
|
||||
}
|
||||
|
||||
function checkAudioContextMenu() {
|
||||
sendContextMenuTo('#menu6-trigger', function onContextMenu(detail) {
|
||||
var target = detail.systemTargets[0];
|
||||
is(target.nodeName, 'AUDIO', 'Reports correct nodeName');
|
||||
is(target.data.uri, audioUrl, 'Reports uri correctly in data');
|
||||
|
||||
checkAudioinVideoContextMenu();
|
||||
}, /* ignorePreventDefault */ true);
|
||||
}
|
||||
|
||||
function checkAudioinVideoContextMenu() {
|
||||
sendSrcTo('#menu5-trigger', audioUrl, function onSrcSet() {
|
||||
sendContextMenuTo('#menu5-trigger', function onContextMenu(detail) {
|
||||
var target = detail.systemTargets[0];
|
||||
is(target.nodeName, 'VIDEO', 'Reports correct nodeName');
|
||||
is(target.data.uri, audioUrl, 'Reports uri correctly in data');
|
||||
is(target.data.hasVideo, false, 'Audio data in video tag reports no "hasVideo"');
|
||||
|
||||
SimpleTest.finish();
|
||||
}, /* ignorePreventDefault */ true);
|
||||
});
|
||||
}
|
||||
|
||||
/* Helpers */
|
||||
var mm = null;
|
||||
var previousContextMenuDetail = null;
|
||||
var currentContextMenuDetail = null;
|
||||
|
||||
function sendSrcTo(selector, src, callback) {
|
||||
mm.sendAsyncMessage('setsrc', { 'selector': selector, 'src': src });
|
||||
mm.addMessageListener('test:srcset', function onSrcSet(msg) {
|
||||
mm.removeMessageListener('test:srcset', onSrcSet);
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function sendContextMenuTo(selector, callback, ignorePreventDefault) {
|
||||
iframe.addEventListener('mozbrowsercontextmenu', function oncontextmenu(e) {
|
||||
iframe.removeEventListener(e.type, oncontextmenu);
|
||||
@ -178,6 +232,10 @@ function createIframe(callback) {
|
||||
'</menu>' +
|
||||
'<div id="menu1-trigger" contextmenu="menu1"><a id="inner-link" href="foo.html">Menu 1</a></div>' +
|
||||
'<a href="bar.html" contextmenu="menu2"><img id="menu2-trigger" src="example.png" /></a>' +
|
||||
'<img id="menu3-trigger" src="example.png" />' +
|
||||
'<video id="menu4-trigger" src="' + videoUrl + '"></video>' +
|
||||
'<video id="menu5-trigger" preload="metadata"></video>' +
|
||||
'<audio id="menu6-trigger" src="' + audioUrl + '"></audio>' +
|
||||
'</body></html>';
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
@ -191,6 +249,15 @@ function createIframe(callback) {
|
||||
document.querySelector(msg.data.selector).dispatchEvent(evt);
|
||||
});
|
||||
|
||||
addMessageListener('setsrc', function onContextMenu(msg) {
|
||||
var wrappedTarget = content.document.querySelector(msg.data.selector);
|
||||
var target = XPCNativeWrapper.unwrap(wrappedTarget);
|
||||
target.addEventListener('loadedmetadata', function() {
|
||||
sendAsyncMessage('test:srcset');
|
||||
});
|
||||
target.src = msg.data.src;
|
||||
});
|
||||
|
||||
addMessageListener('browser-element-api:call', function onCallback(msg) {
|
||||
if (msg.data.msg_name != 'fire-ctx-callback')
|
||||
return;
|
||||
|
@ -435,7 +435,7 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
|
||||
aBatteryInfo->charging() = true;
|
||||
}
|
||||
|
||||
if (aBatteryInfo->charging() && (aBatteryInfo->level() < 1.0)) {
|
||||
if (!aBatteryInfo->charging() || (aBatteryInfo->level() < 1.0)) {
|
||||
aBatteryInfo->remainingTime() = dom::battery::kUnknownRemainingTime;
|
||||
} else {
|
||||
aBatteryInfo->remainingTime() = dom::battery::kDefaultRemainingTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user