mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 871887 - Make sure |this|-binding is correct or marquee event listeners. r=bz
This commit is contained in:
parent
d82b494a39
commit
aef9decad9
@ -13,14 +13,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=871887
|
||||
/** Test for Bug 871887 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function checkpoint() {
|
||||
// NB: onstart ends up getting invoked twice, for mysterious and potentially-
|
||||
// IE6-related reasons.
|
||||
function checkpoint(invocant) {
|
||||
ok(true, "onstart called");
|
||||
is(invocant, $('llama'), "this-binding is correct");
|
||||
$('llama').loop = 1;
|
||||
$('llama').scrollDelay = 1;
|
||||
$('llama').scrollAmount = 500;
|
||||
}
|
||||
|
||||
function done() {
|
||||
function done(invocant) {
|
||||
is(invocant, $('llama'), "this-binding is correct");
|
||||
ok(true, "onfinish called");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@ -31,7 +35,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=871887
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=871887">Mozilla Bug 871887</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
<marquee id="llama" onstart="checkpoint();" onfinish="done();">Watch the Llama</marquee>
|
||||
<marquee id="llama" onstart="checkpoint(this);" onfinish="done(this);">Watch the Llama</marquee>
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
@ -265,7 +265,7 @@
|
||||
// NB: Make sure to wrap the constructor in parentheses to
|
||||
// deal with the weird precedence of |new| in JS.
|
||||
var contentFn = new (XPCNativeWrapper.unwrap(window).Function)("event", aValue);
|
||||
this["_on" + aName] = function(e) { return contentFn(e); };
|
||||
this["_on" + aName] = function(e) { return contentFn.call(this, e); };
|
||||
}
|
||||
catch(e) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user