Bug 1400139 part 2. Make window.content non-enumerable. r=mystor

MozReview-Commit-ID: LQkEkdG8wKf
This commit is contained in:
Boris Zbarsky 2017-09-18 21:24:38 -04:00
parent 005450266e
commit 3dc9073bd5
3 changed files with 31 additions and 1 deletions

View File

@ -814,6 +814,7 @@ skip-if = toolkit == 'android'
[test_websocket5.html]
skip-if = toolkit == 'android'
[test_window_constructor.html]
[test_window_content.html]
[test_window_cross_origin_props.html]
[test_window_define_nonconfigurable.html]
[test_window_define_symbol.html]

View File

@ -0,0 +1,28 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1400139
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1400139</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1400139 **/
var props = [];
for (var prop in window) props.push(prop);
is(props.indexOf("content"), -1, "Should not have a property named 'content'");
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1400139">Mozilla Bug 1400139</a>
<p id="display"></p>
<div id="notcontent" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -340,7 +340,8 @@ partial interface Window {
#ifdef NIGHTLY_BUILD
ChromeOnly,
#endif
Replaceable, Throws, NeedsCallerType] readonly attribute object? content;
NonEnumerable, Replaceable, Throws, NeedsCallerType]
readonly attribute object? content;
[Throws, ChromeOnly] any getInterface(IID iid);