From 671aa981cd11f50315b16a93a5ddab5c2915073a Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Wed, 10 Dec 2008 23:30:54 -0800 Subject: [PATCH] Backout bug 461680 and bustage fixes due to still failing on Linux and possible leaks. --- .../content/tests/widgets/test_videocontrols.html | 12 +- toolkit/content/widgets/videocontrols.xml | 129 ++++++++------------- .../pinstripe/global/media/videocontrols.css | 2 +- .../winstripe/global/media/videocontrols.css | 2 +- 4 files changed, 58 insertions(+), 87 deletions(-) diff --git a/toolkit/content/tests/widgets/test_videocontrols.html b/toolkit/content/tests/widgets/test_videocontrols.html index 8607fb304..93c526a81 100644 --- a/toolkit/content/tests/widgets/test_videocontrols.html +++ b/toolkit/content/tests/widgets/test_videocontrols.html @@ -31,16 +31,14 @@ function runTest(event) { is(video.muted, false, "checking video mute state"); // Let the fadein happen - video.addEventListener("mouseover", runTest, false); synthesizeMouse(video, 12, 228, { type : "mouseover" }); + setTimeout(runTest, 0, { type: "setTimeout" }); break; case 2: - is(event.type, "mouseover", "checking event type"); - video.removeEventListener("mouseover", runTest, false); - // Click the play button. Do this from a timeout, lest the test's - // mouseover handler fire before the video control's handler. - setTimeout("synthesizeMouse(video, 12, 228, { });", 0); + is(event.type, "setTimeout", "checking event type"); + // Click the play button + synthesizeMouse(video, 12, 228, { }); break; case 3: @@ -81,7 +79,7 @@ function runTest(event) { break; default: - throw "unexpected test #" + testnum + " w/ event " + event.type; + throw "unexpected test #" + testnum + " w/ event " + event.name; } testnum++; diff --git a/toolkit/content/widgets/videocontrols.xml b/toolkit/content/widgets/videocontrols.xml index 5ae6c992b..e5f44ca17 100644 --- a/toolkit/content/widgets/videocontrols.xml +++ b/toolkit/content/widgets/videocontrols.xml @@ -14,7 +14,7 @@ - + @@ -77,18 +77,15 @@ 1) - pos = 1; - - // Calculate the opacity for our position in the animation. - var opacity; - if (self.fadingIn) - opacity = Math.pow(pos, 0.5); - else - opacity = Math.pow(1 - pos, 0.5); - self.controlsVisible = (opacity ? true : false); - - self.controlBar.style.opacity = opacity; - - // Use .visibility to ignore mouse clicks when hidden. - if (self.controlsVisible) - self.controlBar.style.visibility = "visible"; - else - self.controlBar.style.visibility = "hidden"; - - // Is the animation done? - if (pos == 1) { - clearInterval(self.fadeTimer); - self.fadeTimer = null; - self.fadeTime = 0; + fadeControls : function (self) { + self.log("fadeControls @" + self.animationStep); + self.animationStep += self.animationDirection; + + if (self.animationStep <= 0) { + self.animationStep = 0; + clearInterval(self.animationTimer); + self.animationTimer = null; + } else if (self.animationStep >= self.animationSteps) { + self.animationStep = self.animationSteps; + clearInterval(self.animationTimer); + self.animationTimer = null; } + + // XXX might be good to do logarithmic steps, maybe use timer error too (for smoothness)? + self.controls.style.opacity = self.animationStep / self.animationSteps; }, togglePause : function () { @@ -192,11 +143,11 @@ isChildNode : function (node) { while (node) { - if (node == this.video) + if (node == this.controls) break; node = node.parentNode; } - return (node == this.video); + return (node == this); }, log : function (msg) { @@ -211,16 +162,15 @@ - this.Utils.onMouseInOut(event); + + - this.Utils.onMouseInOut(event); + diff --git a/toolkit/themes/pinstripe/global/media/videocontrols.css b/toolkit/themes/pinstripe/global/media/videocontrols.css index 70f2bab50..47e1ae6db 100644 --- a/toolkit/themes/pinstripe/global/media/videocontrols.css +++ b/toolkit/themes/pinstripe/global/media/videocontrols.css @@ -1,6 +1,6 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -#controlBar { +#controlsBackground { height: 24px; background-color: #656363; } diff --git a/toolkit/themes/winstripe/global/media/videocontrols.css b/toolkit/themes/winstripe/global/media/videocontrols.css index 70f2bab50..47e1ae6db 100644 --- a/toolkit/themes/winstripe/global/media/videocontrols.css +++ b/toolkit/themes/winstripe/global/media/videocontrols.css @@ -1,6 +1,6 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -#controlBar { +#controlsBackground { height: 24px; background-color: #656363; } -- 2.11.4.GIT