| Index: LayoutTests/fast/dom/lenient-this.html
|
| diff --git a/LayoutTests/fast/dom/lenient-this.html b/LayoutTests/fast/dom/lenient-this.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6931f9b0df8e7773bb6b224ffd1ef218c4bc0063
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/dom/lenient-this.html
|
| @@ -0,0 +1,22 @@
|
| +<!DOCTYPE html>
|
| +<title>[LenientThis] test</title>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +test(function() {
|
| + // GlobalEventHandlers.onmouseenter is [LenientThis].
|
| + assert_equals(document.onmouseenter, null, "|this| is an appropriate object.");
|
| + assert_equals(Document.prototype.onmouseenter, undefined, "|this| is not an appropriate object.");
|
| + Document.prototype.onmouseenter = 'foo'; // must not throw.
|
| + assert_equals(Document.prototype.onmouseenter, undefined, "the value must not change.");
|
| +
|
| + // GlobalEventHandlers.onmousedown is NOT [LenientThis].
|
| + assert_equals(document.onmousedown, null, "|this| is an appropriate object.");
|
| + assert_throws(null, function() {
|
| + Document.prototype.onmousedown;
|
| + }, "Document.prototype is invalid as |this|.");
|
| + assert_throws(null, function() {
|
| + Document.prototype.onmousedown = 'foo';
|
| + }, "Document.prototype is invalid as |this|.");
|
| +});
|
| +</script>
|
|
|