Don't create cached functions that access lexicalGlobalObject()
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2014 22:58:33 +0000 (22:58 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2014 22:58:33 +0000 (22:58 +0000)
commit588f989e46b9df3783d90f56107d55824940cfbc
treea8553eeb568384076023b21a69d192b2953e666a
parent08493ae756d23f3818ffc0f086f7ce7ca7b67cc9
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 "close" and "postMessage" 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 "blur", "close" and "focus" 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 "close" from this lists of functions to check.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/wrapper-scope-expected.txt
LayoutTests/fast/dom/wrapper-scope.html
LayoutTests/http/tests/security/cross-frame-access-put-expected.txt
LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html
LayoutTests/js/dom/global-function-resolve-expected.txt
LayoutTests/js/dom/script-tests/global-function-resolve.js
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/html/HTMLDocument.idl