Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / lenient-this.html
blob6931f9b0df8e7773bb6b224ffd1ef218c4bc0063
1 <!DOCTYPE html>
2 <title>[LenientThis] test</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6 test(function() {
7 // GlobalEventHandlers.onmouseenter is [LenientThis].
8 assert_equals(document.onmouseenter, null, "|this| is an appropriate object.");
9 assert_equals(Document.prototype.onmouseenter, undefined, "|this| is not an appropriate object.");
10 Document.prototype.onmouseenter = 'foo'; // must not throw.
11 assert_equals(Document.prototype.onmouseenter, undefined, "the value must not change.");
13 // GlobalEventHandlers.onmousedown is NOT [LenientThis].
14 assert_equals(document.onmousedown, null, "|this| is an appropriate object.");
15 assert_throws(null, function() {
16 Document.prototype.onmousedown;
17 }, "Document.prototype is invalid as |this|.");
18 assert_throws(null, function() {
19 Document.prototype.onmousedown = 'foo';
20 }, "Document.prototype is invalid as |this|.");
21 });
22 </script>