Back out 3 changesets (bug 1274520) for failures in various videocontrols tests

CLOSED TREE

Backed out changeset 788365ddaf61 (bug 1274520)
Backed out changeset 6c204be833d1 (bug 1274520)
Backed out changeset 4f15271e5488 (bug 1274520)
This commit is contained in:
Phil Ringnalda 2016-05-24 19:45:17 -07:00
Родитель 50134ac5fb
Коммит 0ce9dc7391
3 изменённых файлов: 20 добавлений и 53 удалений

Просмотреть файл

@ -1337,19 +1337,6 @@ EventListenerManager::Disconnect()
RemoveAllListeners();
}
static EventListenerFlags
GetEventListenerFlagsFromOptions(const EventListenerOptions& aOptions)
{
EventListenerFlags flags;
flags.mCapture = aOptions.mCapture;
if (aOptions.mMozSystemGroup) {
JSContext* cx = nsContentUtils::GetCurrentJSContext();
MOZ_ASSERT(cx, "Not being called from JS?");
flags.mInSystemGroup = IsChromeOrXBL(cx, nullptr);
}
return flags;
}
void
EventListenerManager::AddEventListener(
const nsAString& aType,
@ -1374,9 +1361,8 @@ EventListenerManager::AddEventListener(
if (aOptions.IsBoolean()) {
flags.mCapture = aOptions.GetAsBoolean();
} else {
const auto& options = aOptions.GetAsAddEventListenerOptions();
flags = GetEventListenerFlagsFromOptions(options);
flags.mPassive = options.mPassive;
flags.mCapture = aOptions.GetAsAddEventListenerOptions().mCapture;
flags.mPassive = aOptions.GetAsAddEventListenerOptions().mPassive;
}
flags.mAllowUntrustedEvents = aWantsUntrusted;
return AddEventListenerByType(aListenerHolder, aType, flags);
@ -1400,12 +1386,9 @@ EventListenerManager::RemoveEventListener(
const dom::EventListenerOptionsOrBoolean& aOptions)
{
EventListenerFlags flags;
if (aOptions.IsBoolean()) {
flags.mCapture = aOptions.GetAsBoolean();
} else {
const auto& options = aOptions.GetAsEventListenerOptions();
flags = GetEventListenerFlagsFromOptions(options);
}
flags.mCapture =
aOptions.IsBoolean() ? aOptions.GetAsBoolean()
: aOptions.GetAsEventListenerOptions().mCapture;
RemoveEventListenerByType(aListenerHolder, aType, flags);
}

Просмотреть файл

@ -13,9 +13,6 @@
dictionary EventListenerOptions {
boolean capture = false;
/* This is a Mozilla extension only available in Chrome and XBL.
Setting to true make the listener be added to the system group. */
boolean mozSystemGroup = false;
};
dictionary AddEventListenerOptions : EventListenerOptions {

Просмотреть файл

@ -631,17 +631,11 @@
},
terminateEventListeners : function () {
for (let event of this.videoEvents) {
this.video.removeEventListener(event, this, {
capture: true,
mozSystemGroup: true
});
}
for (let event of this.videoEvents)
this.video.removeEventListener(event, this, false);
for (let element of this.controlListeners) {
element.item.removeEventListener(element.event, element.func,
{ mozSystemGroup: true });
}
for (let element of this.controlListeners)
element.item.removeEventListener(element.event, element.func, false);
delete this.controlListeners;
@ -1336,15 +1330,10 @@
this.setupNewLoadState();
// Use the handleEvent() callback for all media events.
// Only the "error" event listener must capture, so that it can trap error
// events from <source> children, which don't bubble. But we use capture
// for all events in order to simplify the event listener add/remove.
for (let event of this.videoEvents) {
this.video.addEventListener(event, this, {
capture: true,
mozSystemGroup: true
});
}
// The "error" event listener must capture, so that it can trap error events
// from the <source> children, which don't bubble.
for (let event of this.videoEvents)
this.video.addEventListener(event, this, (event == "error") ? true : false);
var self = this;
@ -1354,7 +1343,7 @@
function addListener(elem, eventName, func) {
let boundFunc = func.bind(self);
self.controlListeners.push({ item: elem, event: eventName, func: boundFunc });
elem.addEventListener(eventName, boundFunc, { mozSystemGroup: true });
elem.addEventListener(eventName, boundFunc, false);
}
addListener(this.muteButton, "command", this.toggleMute);
@ -1366,7 +1355,7 @@
addListener(this.videocontrols, "resizevideocontrols", this.adjustControlSize);
addListener(this.videocontrols, "transitionend", this.onTransitionEnd);
addListener(this.video.ownerDocument, "fullscreenchange", this.onFullscreenChange);
addListener(this.video.ownerDocument, "mozfullscreenchange", this.onFullscreenChange);
addListener(this.video, "keypress", this.keyHandler);
addListener(this.videocontrols, "dragstart", function(event) {
@ -1680,12 +1669,10 @@
controlListeners: [],
terminateEventListeners : function () {
for (let event of this.videoEvents)
this.video.removeEventListener(event, this, { mozSystemGroup: true });
this.video.removeEventListener(event, this, false);
for (let element of this.controlListeners) {
element.item.removeEventListener(element.event, element.func,
{ mozSystemGroup: true });
}
for (let element of this.controlListeners)
element.item.removeEventListener(element.event, element.func, false);
delete this.controlListeners;
},
@ -1749,13 +1736,13 @@
function addListener(elem, eventName, func) {
let boundFunc = func.bind(self);
self.controlListeners.push({ item: elem, event: eventName, func: boundFunc });
elem.addEventListener(eventName, boundFunc, { mozSystemGroup: true });
elem.addEventListener(eventName, boundFunc, false);
}
addListener(this.clickToPlay, "click", this.clickToPlayClickHandler);
addListener(this.video, "MozNoControlsBlockedVideo", this.blockedVideoHandler);
for (let event of this.videoEvents) {
this.video.addEventListener(event, this, { mozSystemGroup: true });
this.video.addEventListener(event, this, false);
}
if (this.video.autoplay && !this.video.mozAutoplayEnabled) {