<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174847] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174847">174847</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2014-10-17 15:58:33 -0700 (Fri, 17 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Don't create cached functions that access lexicalGlobalObject()
https://bugs.webkit.org/show_bug.cgi?id=137839

Reviewed by Geoffrey Garen.

Source/WebCore:

Made it so that all the JSDOMWindow special functions blur(), close(), focus() and postMessage()
are always created as needed for every prototype.  Made it so that JSHTMLDocument does
the same for open().  Updated test to account for these methods not being cached

Updated tests accordingly.

* bindings/js/JSDOMWindowCustom.cpp: 
(WebCore::JSDOMWindow::getOwnPropertySlot): Updated to always create cached versions of the
special functions.
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot): Added to create an uncached open() method when
it is first accessed.
* html/HTMLDocument.idl: Added CustomGetOwnPropertySlot and implemented it in JSHTMLDocumentCustom.cpp.

LayoutTests:

Updadted test that check for 

* fast/dom/wrapper-scope-expected.txt:
* fast/dom/wrapper-scope.html:
Removed &quot;close&quot; and &quot;postMessage&quot; from functions to check for wrapper scope.

* http/tests/security/cross-frame-access-put-expected.txt:
* http/tests/security/resources/cross-frame-iframe-for-put-test.html:
Removed &quot;blur&quot;, &quot;close&quot; and &quot;focus&quot; from the functions to test, since this tests that
a parent's and child window's instances are the same.  Now they are always different.

* js/dom/global-function-resolve-expected.txt:
* js/dom/script-tests/global-function-resolve.js:
Removed &quot;close&quot; from this lists of functions to check.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomwrapperscopeexpectedtxt">trunk/LayoutTests/fast/dom/wrapper-scope-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomwrapperscopehtml">trunk/LayoutTests/fast/dom/wrapper-scope.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossframeaccessputexpectedtxt">trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityresourcescrossframeiframeforputtesthtml">trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html</a></li>
<li><a href="#trunkLayoutTestsjsdomglobalfunctionresolveexpectedtxt">trunk/LayoutTests/js/dom/global-function-resolve-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomscripttestsglobalfunctionresolvejs">trunk/LayoutTests/js/dom/script-tests/global-function-resolve.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDocumentidl">trunk/Source/WebCore/html/HTMLDocument.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/ChangeLog        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-10-17  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Don't create cached functions that access lexicalGlobalObject()
+        https://bugs.webkit.org/show_bug.cgi?id=137839
+
+        Reviewed by Geoffrey Garen.
+
+        Updadted test that check for 
+
+        * fast/dom/wrapper-scope-expected.txt:
+        * fast/dom/wrapper-scope.html:
+        Removed &quot;close&quot; and &quot;postMessage&quot; from functions to check for wrapper scope.
+
+        * http/tests/security/cross-frame-access-put-expected.txt:
+        * http/tests/security/resources/cross-frame-iframe-for-put-test.html:
+        Removed &quot;blur&quot;, &quot;close&quot; and &quot;focus&quot; from the functions to test, since this tests that
+        a parent's and child window's instances are the same.  Now they are always different.
+
+        * js/dom/global-function-resolve-expected.txt:
+        * js/dom/script-tests/global-function-resolve.js:
+        Removed &quot;close&quot; from this lists of functions to check.
+
</ins><span class="cx"> 2014-10-17  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Make a better use of the available registers when compiling nested selector lists
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomwrapperscopeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/wrapper-scope-expected.txt (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/wrapper-scope-expected.txt        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/fast/dom/wrapper-scope-expected.txt        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -11,10 +11,6 @@
</span><span class="cx"> PASS inner.Window.constructor.isInner is true
</span><span class="cx"> PASS inner.Window.constructor.prototype.isInner is true
</span><span class="cx"> PASS inner.Window.__proto__.isInner is true
</span><del>-PASS inner.close.isInner is true
-PASS inner.close.constructor.isInner is true
-PASS inner.close.constructor.prototype.isInner is true
-PASS inner.close.__proto__.isInner is true
</del><span class="cx"> PASS inner.console.isInner is true
</span><span class="cx"> PASS inner.console.constructor.isInner is true
</span><span class="cx"> PASS inner.console.constructor.prototype.isInner is true
</span><span class="lines">@@ -35,10 +31,6 @@
</span><span class="cx"> PASS inner.navigator.constructor.isInner is true
</span><span class="cx"> PASS inner.navigator.constructor.prototype.isInner is true
</span><span class="cx"> PASS inner.navigator.__proto__.isInner is true
</span><del>-PASS inner.postMessage.isInner is true
-PASS inner.postMessage.constructor.isInner is true
-PASS inner.postMessage.constructor.prototype.isInner is true
-PASS inner.postMessage.__proto__.isInner is true
</del><span class="cx"> PASS inner.window.isInner is true
</span><span class="cx"> PASS inner.window.constructor.isInner is true
</span><span class="cx"> PASS inner.window.constructor.prototype.isInner is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomwrapperscopehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/wrapper-scope.html (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/wrapper-scope.html        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/fast/dom/wrapper-scope.html        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -15,13 +15,11 @@
</span><span class="cx"> var pathsToTest = [
</span><span class="cx">     'HTMLElement',
</span><span class="cx">     'Window',
</span><del>-    'close',
</del><span class="cx">     'console',
</span><span class="cx">     'document',
</span><span class="cx">     'document.body',
</span><span class="cx">     'document.childNodes',
</span><span class="cx">     'navigator',
</span><del>-    'postMessage',
</del><span class="cx">     'window',
</span><span class="cx"> ];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossframeaccessputexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -349,16 +349,13 @@
</span><span class="cx"> ALERT: PASS: window.addEventListener should be 'function addEventListener() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.alert should be 'function alert() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.atob should be 'function atob() {    [native code]}' and is.
</span><del>-ALERT: PASS: window.blur should be 'function blur() {    [native code]}' and is.
</del><span class="cx"> ALERT: PASS: window.btoa should be 'function btoa() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.captureEvents should be 'function captureEvents() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.clearInterval should be 'function clearInterval() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.clearTimeout should be 'function clearTimeout() {    [native code]}' and is.
</span><del>-ALERT: PASS: window.close should be 'function close() {    [native code]}' and is.
</del><span class="cx"> ALERT: PASS: window.confirm should be 'function confirm() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.eval should be 'function eval() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.find should be 'function find() {    [native code]}' and is.
</span><del>-ALERT: PASS: window.focus should be 'function focus() {    [native code]}' and is.
</del><span class="cx"> ALERT: PASS: window.getComputedStyle should be 'function getComputedStyle() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.getMatchedCSSRules should be 'function getMatchedCSSRules() {    [native code]}' and is.
</span><span class="cx"> ALERT: PASS: window.getSelection should be 'function getSelection() {    [native code]}' and is.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityresourcescrossframeiframeforputtesthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -216,16 +216,13 @@
</span><span class="cx">         var addEventListenerOld = window.addEventListener;
</span><span class="cx">         var alertOld = window.alert;
</span><span class="cx">         var atobOld = window.atob;
</span><del>-        var blurOld = window.blur;
</del><span class="cx">         var btoaOld = window.btoa;
</span><span class="cx">         var captureEventsOld = window.captureEvents;
</span><span class="cx">         var clearIntervalOld = window.clearInterval;
</span><span class="cx">         var clearTimeoutOld = window.clearTimeout;
</span><del>-        var closeOld = window.close;
</del><span class="cx">         var confirmOld = window.confirm;
</span><span class="cx">         var evalOld = window.eval;
</span><span class="cx">         var findOld = window.find;
</span><del>-        var focusOld = window.focus;
</del><span class="cx">         var getComputedStyleOld = window.getComputedStyle;
</span><span class="cx">         var getMatchedCSSRulesOld = window.getMatchedCSSRules;
</span><span class="cx">         var getSelectionOld = window.getSelection;
</span><span class="lines">@@ -432,16 +429,13 @@
</span><span class="cx">             shouldBe(&quot;window.addEventListener&quot;, &quot;addEventListenerOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.alert&quot;, &quot;alertOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.atob&quot;, &quot;atobOld&quot;);
</span><del>-            shouldBe(&quot;window.blur&quot;, &quot;blurOld&quot;);
</del><span class="cx">             shouldBe(&quot;window.btoa&quot;, &quot;btoaOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.captureEvents&quot;, &quot;captureEventsOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.clearInterval&quot;, &quot;clearIntervalOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.clearTimeout&quot;, &quot;clearTimeoutOld&quot;);
</span><del>-            shouldBe(&quot;window.close&quot;, &quot;closeOld&quot;);
</del><span class="cx">             shouldBe(&quot;window.confirm&quot;, &quot;confirmOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.eval&quot;, &quot;evalOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.find&quot;, &quot;findOld&quot;);
</span><del>-            shouldBe(&quot;window.focus&quot;, &quot;focusOld&quot;);
</del><span class="cx">             shouldBe(&quot;window.getComputedStyle&quot;, &quot;getComputedStyleOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.getMatchedCSSRules&quot;, &quot;getMatchedCSSRulesOld&quot;);
</span><span class="cx">             shouldBe(&quot;window.getSelection&quot;, &quot;getSelectionOld&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomglobalfunctionresolveexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/global-function-resolve-expected.txt (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/global-function-resolve-expected.txt        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/js/dom/global-function-resolve-expected.txt        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -13,112 +13,110 @@
</span><span class="cx"> PASS cachedFunctions[3]() is clearTimeout
</span><span class="cx"> PASS cachedFunctions[4]() is clientInformation
</span><span class="cx"> PASS cachedFunctions[4]() is clientInformation
</span><del>-PASS cachedFunctions[5]() is close
-PASS cachedFunctions[5]() is close
-PASS cachedFunctions[6]() is closed
-PASS cachedFunctions[6]() is closed
-PASS cachedFunctions[7]() is confirm
-PASS cachedFunctions[7]() is confirm
-PASS cachedFunctions[8]() is console
-PASS cachedFunctions[8]() is console
-PASS cachedFunctions[9]() is crypto
-PASS cachedFunctions[9]() is crypto
-PASS cachedFunctions[10]() is defaultStatus
-PASS cachedFunctions[10]() is defaultStatus
-PASS cachedFunctions[11]() is defaultstatus
-PASS cachedFunctions[11]() is defaultstatus
-PASS cachedFunctions[12]() is description
-PASS cachedFunctions[12]() is description
-PASS cachedFunctions[13]() is devicePixelRatio
-PASS cachedFunctions[13]() is devicePixelRatio
-PASS cachedFunctions[14]() is dispatchEvent
-PASS cachedFunctions[14]() is dispatchEvent
-PASS cachedFunctions[15]() is document
-PASS cachedFunctions[15]() is document
-PASS cachedFunctions[16]() is getComputedStyle
-PASS cachedFunctions[16]() is getComputedStyle
-PASS cachedFunctions[17]() is getMatchedCSSRules
-PASS cachedFunctions[17]() is getMatchedCSSRules
-PASS cachedFunctions[18]() is getSelection
-PASS cachedFunctions[18]() is getSelection
-PASS cachedFunctions[19]() is history
-PASS cachedFunctions[19]() is history
-PASS cachedFunctions[20]() is innerHeight
-PASS cachedFunctions[20]() is innerHeight
-PASS cachedFunctions[21]() is innerWidth
-PASS cachedFunctions[21]() is innerWidth
-PASS cachedFunctions[22]() is location
-PASS cachedFunctions[22]() is location
-PASS cachedFunctions[23]() is locationbar
-PASS cachedFunctions[23]() is locationbar
-PASS cachedFunctions[24]() is menubar
-PASS cachedFunctions[24]() is menubar
-PASS cachedFunctions[25]() is moveBy
-PASS cachedFunctions[25]() is moveBy
-PASS cachedFunctions[26]() is moveTo
-PASS cachedFunctions[26]() is moveTo
-PASS cachedFunctions[27]() is name
-PASS cachedFunctions[27]() is name
-PASS cachedFunctions[28]() is navigator
-PASS cachedFunctions[28]() is navigator
-PASS cachedFunctions[29]() is open
-PASS cachedFunctions[29]() is open
-PASS cachedFunctions[30]() is openDatabase
-PASS cachedFunctions[30]() is openDatabase
-PASS cachedFunctions[31]() is opener
-PASS cachedFunctions[31]() is opener
-PASS cachedFunctions[32]() is outerHeight
-PASS cachedFunctions[32]() is outerHeight
-PASS cachedFunctions[33]() is outerWidth
-PASS cachedFunctions[33]() is outerWidth
-PASS cachedFunctions[34]() is pageXOffset
-PASS cachedFunctions[34]() is pageXOffset
-PASS cachedFunctions[35]() is pageYOffset
-PASS cachedFunctions[35]() is pageYOffset
-PASS cachedFunctions[36]() is parent
-PASS cachedFunctions[36]() is parent
-PASS cachedFunctions[37]() is prompt
-PASS cachedFunctions[37]() is prompt
-PASS cachedFunctions[38]() is releaseEvents
-PASS cachedFunctions[38]() is releaseEvents
-PASS cachedFunctions[39]() is removeEventListener
-PASS cachedFunctions[39]() is removeEventListener
-PASS cachedFunctions[40]() is resizeBy
-PASS cachedFunctions[40]() is resizeBy
-PASS cachedFunctions[41]() is resizeTo
-PASS cachedFunctions[41]() is resizeTo
-PASS cachedFunctions[42]() is screen
-PASS cachedFunctions[42]() is screen
-PASS cachedFunctions[43]() is screenLeft
-PASS cachedFunctions[43]() is screenLeft
-PASS cachedFunctions[44]() is screenTop
-PASS cachedFunctions[44]() is screenTop
-PASS cachedFunctions[45]() is screenX
-PASS cachedFunctions[45]() is screenX
-PASS cachedFunctions[46]() is screenY
-PASS cachedFunctions[46]() is screenY
-PASS cachedFunctions[47]() is scroll
-PASS cachedFunctions[47]() is scroll
-PASS cachedFunctions[48]() is scrollBy
-PASS cachedFunctions[48]() is scrollBy
-PASS cachedFunctions[49]() is scrollTo
-PASS cachedFunctions[49]() is scrollTo
-PASS cachedFunctions[50]() is scrollX
-PASS cachedFunctions[50]() is scrollX
-PASS cachedFunctions[51]() is scrollY
-PASS cachedFunctions[51]() is scrollY
-PASS cachedFunctions[52]() is setInterval
-PASS cachedFunctions[52]() is setInterval
-PASS cachedFunctions[53]() is setTimeout
-PASS cachedFunctions[53]() is setTimeout
-PASS cachedFunctions[54]() is showModalDialog
-PASS cachedFunctions[54]() is showModalDialog
-PASS cachedFunctions[55]() is status
-PASS cachedFunctions[55]() is status
-PASS cachedFunctions[56]() is stop
-PASS cachedFunctions[56]() is stop
-PASS cachedFunctions[57]() is window
-PASS cachedFunctions[57]() is window
</del><ins>+PASS cachedFunctions[5]() is closed
+PASS cachedFunctions[5]() is closed
+PASS cachedFunctions[6]() is confirm
+PASS cachedFunctions[6]() is confirm
+PASS cachedFunctions[7]() is console
+PASS cachedFunctions[7]() is console
+PASS cachedFunctions[8]() is crypto
+PASS cachedFunctions[8]() is crypto
+PASS cachedFunctions[9]() is defaultStatus
+PASS cachedFunctions[9]() is defaultStatus
+PASS cachedFunctions[10]() is defaultstatus
+PASS cachedFunctions[10]() is defaultstatus
+PASS cachedFunctions[11]() is description
+PASS cachedFunctions[11]() is description
+PASS cachedFunctions[12]() is devicePixelRatio
+PASS cachedFunctions[12]() is devicePixelRatio
+PASS cachedFunctions[13]() is dispatchEvent
+PASS cachedFunctions[13]() is dispatchEvent
+PASS cachedFunctions[14]() is document
+PASS cachedFunctions[14]() is document
+PASS cachedFunctions[15]() is getComputedStyle
+PASS cachedFunctions[15]() is getComputedStyle
+PASS cachedFunctions[16]() is getMatchedCSSRules
+PASS cachedFunctions[16]() is getMatchedCSSRules
+PASS cachedFunctions[17]() is getSelection
+PASS cachedFunctions[17]() is getSelection
+PASS cachedFunctions[18]() is history
+PASS cachedFunctions[18]() is history
+PASS cachedFunctions[19]() is innerHeight
+PASS cachedFunctions[19]() is innerHeight
+PASS cachedFunctions[20]() is innerWidth
+PASS cachedFunctions[20]() is innerWidth
+PASS cachedFunctions[21]() is location
+PASS cachedFunctions[21]() is location
+PASS cachedFunctions[22]() is locationbar
+PASS cachedFunctions[22]() is locationbar
+PASS cachedFunctions[23]() is menubar
+PASS cachedFunctions[23]() is menubar
+PASS cachedFunctions[24]() is moveBy
+PASS cachedFunctions[24]() is moveBy
+PASS cachedFunctions[25]() is moveTo
+PASS cachedFunctions[25]() is moveTo
+PASS cachedFunctions[26]() is name
+PASS cachedFunctions[26]() is name
+PASS cachedFunctions[27]() is navigator
+PASS cachedFunctions[27]() is navigator
+PASS cachedFunctions[28]() is open
+PASS cachedFunctions[28]() is open
+PASS cachedFunctions[29]() is openDatabase
+PASS cachedFunctions[29]() is openDatabase
+PASS cachedFunctions[30]() is opener
+PASS cachedFunctions[30]() is opener
+PASS cachedFunctions[31]() is outerHeight
+PASS cachedFunctions[31]() is outerHeight
+PASS cachedFunctions[32]() is outerWidth
+PASS cachedFunctions[32]() is outerWidth
+PASS cachedFunctions[33]() is pageXOffset
+PASS cachedFunctions[33]() is pageXOffset
+PASS cachedFunctions[34]() is pageYOffset
+PASS cachedFunctions[34]() is pageYOffset
+PASS cachedFunctions[35]() is parent
+PASS cachedFunctions[35]() is parent
+PASS cachedFunctions[36]() is prompt
+PASS cachedFunctions[36]() is prompt
+PASS cachedFunctions[37]() is releaseEvents
+PASS cachedFunctions[37]() is releaseEvents
+PASS cachedFunctions[38]() is removeEventListener
+PASS cachedFunctions[38]() is removeEventListener
+PASS cachedFunctions[39]() is resizeBy
+PASS cachedFunctions[39]() is resizeBy
+PASS cachedFunctions[40]() is resizeTo
+PASS cachedFunctions[40]() is resizeTo
+PASS cachedFunctions[41]() is screen
+PASS cachedFunctions[41]() is screen
+PASS cachedFunctions[42]() is screenLeft
+PASS cachedFunctions[42]() is screenLeft
+PASS cachedFunctions[43]() is screenTop
+PASS cachedFunctions[43]() is screenTop
+PASS cachedFunctions[44]() is screenX
+PASS cachedFunctions[44]() is screenX
+PASS cachedFunctions[45]() is screenY
+PASS cachedFunctions[45]() is screenY
+PASS cachedFunctions[46]() is scroll
+PASS cachedFunctions[46]() is scroll
+PASS cachedFunctions[47]() is scrollBy
+PASS cachedFunctions[47]() is scrollBy
+PASS cachedFunctions[48]() is scrollTo
+PASS cachedFunctions[48]() is scrollTo
+PASS cachedFunctions[49]() is scrollX
+PASS cachedFunctions[49]() is scrollX
+PASS cachedFunctions[50]() is scrollY
+PASS cachedFunctions[50]() is scrollY
+PASS cachedFunctions[51]() is setInterval
+PASS cachedFunctions[51]() is setInterval
+PASS cachedFunctions[52]() is setTimeout
+PASS cachedFunctions[52]() is setTimeout
+PASS cachedFunctions[53]() is showModalDialog
+PASS cachedFunctions[53]() is showModalDialog
+PASS cachedFunctions[54]() is status
+PASS cachedFunctions[54]() is status
+PASS cachedFunctions[55]() is stop
+PASS cachedFunctions[55]() is stop
+PASS cachedFunctions[56]() is window
+PASS cachedFunctions[56]() is window
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomscripttestsglobalfunctionresolvejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/script-tests/global-function-resolve.js (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/global-function-resolve.js        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/js/dom/script-tests/global-function-resolve.js        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -6,7 +6,6 @@
</span><span class="cx">     'clearInterval',
</span><span class="cx">     'clearTimeout',
</span><span class="cx">     'clientInformation',
</span><del>-    'close',
</del><span class="cx">     'closed',
</span><span class="cx">     'confirm',
</span><span class="cx">     'console',
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/Source/WebCore/ChangeLog        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-10-17  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Don't create cached functions that access lexicalGlobalObject()
+        https://bugs.webkit.org/show_bug.cgi?id=137839
+
+        Reviewed by Geoffrey Garen.
+
+        Made it so that all the JSDOMWindow special functions blur(), close(), focus() and postMessage()
+        are always created as needed for every prototype.  Made it so that JSHTMLDocument does
+        the same for open().  Updated test to account for these methods not being cached
+
+        Updated tests accordingly.
+
+        * bindings/js/JSDOMWindowCustom.cpp: 
+        (WebCore::JSDOMWindow::getOwnPropertySlot): Updated to always create cached versions of the
+        special functions.
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::getOwnPropertySlot): Added to create an uncached open() method when
+        it is first accessed.
+        * html/HTMLDocument.idl: Added CustomGetOwnPropertySlot and implemented it in JSHTMLDocumentCustom.cpp.
+
</ins><span class="cx"> 2014-10-17  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Speculative fix for a crash under RenderLayerCompositor::updateScrollCoordinatedLayer()
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -149,25 +149,17 @@
</span><span class="cx">     // Also, it's important to get the implementation straight out of the DOMWindow prototype regardless of
</span><span class="cx">     // what prototype is actually set on this object.
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().blur) {
</span><del>-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionBlur, 0&gt;);
-            return true;
-        }
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionBlur, 0&gt;);
+        return true;
</ins><span class="cx">     } else if (propertyName == exec-&gt;propertyNames().close) {
</span><del>-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionClose, 0&gt;);
-            return true;
-        }
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionClose, 0&gt;);
+        return true;
</ins><span class="cx">     } else if (propertyName == exec-&gt;propertyNames().focus) {
</span><del>-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionFocus, 0&gt;);
-            return true;
-        }
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionFocus, 0&gt;);
+        return true;
</ins><span class="cx">     } else if (propertyName == exec-&gt;propertyNames().postMessage) {
</span><del>-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionPostMessage, 2&gt;);
-            return true;
-        }
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionPostMessage, 2&gt;);
+        return true;
</ins><span class="cx">     } else if (propertyName == exec-&gt;propertyNames().showModalDialog) {
</span><span class="cx">         if (!DOMWindow::canShowModalDialog(thisObject-&gt;impl().frame())) {
</span><span class="cx">             slot.setUndefined();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -57,6 +57,30 @@
</span><span class="cx">     return atomicPropertyName &amp;&amp; document-&gt;hasDocumentNamedItem(*atomicPropertyName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool JSHTMLDocument::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
+{
+    JSHTMLDocument* thisObject = jsCast&lt;JSHTMLDocument*&gt;(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (propertyName == Identifier(exec, &quot;open&quot;)) {
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsHTMLDocumentPrototypeFunctionOpen, 2&gt;);
+        return true;
+    }
+
+    if (canGetItemsForName(exec, &amp;thisObject-&gt;impl(), propertyName)) {
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject-&gt;nameGetter);
+        return true;
+    }
+
+    const HashTableValue* entry = JSHTMLDocument::info()-&gt;staticPropHashTable-&gt;entry(propertyName);
+    if (entry) {
+        slot.setCacheableCustom(thisObject, entry-&gt;attributes(), entry-&gt;propertyGetter());
+        return true;
+    }
+
+    return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
+}
+
</ins><span class="cx"> EncodedJSValue JSHTMLDocument::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)
</span><span class="cx"> {
</span><span class="cx">     JSHTMLDocument* thisObj = jsCast&lt;JSHTMLDocument*&gt;(slotBase);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDocument.idl (174846 => 174847)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDocument.idl        2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/Source/WebCore/html/HTMLDocument.idl        2014-10-17 22:58:33 UTC (rev 174847)
</span><span class="lines">@@ -19,10 +19,11 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    CustomGetOwnPropertySlot,
</ins><span class="cx">     CustomNamedGetter,
</span><span class="cx">     NewImpurePropertyFiresWatchpoints,
</span><span class="cx"> ] interface HTMLDocument : Document {
</span><del>-    [Custom] void open();
</del><ins>+    [Custom, ForwardDeclareInHeader] void open();
</ins><span class="cx">     void close();
</span><span class="cx">     [Custom] void write([Default=Undefined] optional DOMString text);
</span><span class="cx">     [Custom] void writeln([Default=Undefined] optional DOMString text);
</span></span></pre>
</div>
</div>

</body>
</html>