Title: [174847] trunk
Revision
174847
Author
msab...@apple.com
Date
2014-10-17 15:58:33 -0700 (Fri, 17 Oct 2014)

Log Message

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.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (174846 => 174847)


--- trunk/LayoutTests/ChangeLog	2014-10-17 22:30:43 UTC (rev 174846)
+++ trunk/LayoutTests/ChangeLog	2014-10-17 22:58:33 UTC (rev 174847)
@@ -1,3 +1,25 @@
+2014-10-17  Michael Saboff  <msab...@apple.com>
+
+        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 "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.
+
 2014-10-17  Benjamin Poulain  <benja...@webkit.org>
 
         Make a better use of the available registers when compiling nested selector lists

Modified: trunk/LayoutTests/fast/dom/wrapper-scope-expected.txt (174846 => 174847)


--- 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)
@@ -11,10 +11,6 @@
 PASS inner.Window.constructor.isInner is true
 PASS inner.Window.constructor.prototype.isInner is true
 PASS inner.Window.__proto__.isInner is true
-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
 PASS inner.console.isInner is true
 PASS inner.console.constructor.isInner is true
 PASS inner.console.constructor.prototype.isInner is true
@@ -35,10 +31,6 @@
 PASS inner.navigator.constructor.isInner is true
 PASS inner.navigator.constructor.prototype.isInner is true
 PASS inner.navigator.__proto__.isInner is true
-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
 PASS inner.window.isInner is true
 PASS inner.window.constructor.isInner is true
 PASS inner.window.constructor.prototype.isInner is true

Modified: trunk/LayoutTests/fast/dom/wrapper-scope.html (174846 => 174847)


--- 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)
@@ -15,13 +15,11 @@
 var pathsToTest = [
     'HTMLElement',
     'Window',
-    'close',
     'console',
     'document',
     'document.body',
     'document.childNodes',
     'navigator',
-    'postMessage',
     'window',
 ];
 

Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt (174846 => 174847)


--- 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)
@@ -349,16 +349,13 @@
 ALERT: PASS: window.addEventListener should be 'function addEventListener() {    [native code]}' and is.
 ALERT: PASS: window.alert should be 'function alert() {    [native code]}' and is.
 ALERT: PASS: window.atob should be 'function atob() {    [native code]}' and is.
-ALERT: PASS: window.blur should be 'function blur() {    [native code]}' and is.
 ALERT: PASS: window.btoa should be 'function btoa() {    [native code]}' and is.
 ALERT: PASS: window.captureEvents should be 'function captureEvents() {    [native code]}' and is.
 ALERT: PASS: window.clearInterval should be 'function clearInterval() {    [native code]}' and is.
 ALERT: PASS: window.clearTimeout should be 'function clearTimeout() {    [native code]}' and is.
-ALERT: PASS: window.close should be 'function close() {    [native code]}' and is.
 ALERT: PASS: window.confirm should be 'function confirm() {    [native code]}' and is.
 ALERT: PASS: window.eval should be 'function eval() {    [native code]}' and is.
 ALERT: PASS: window.find should be 'function find() {    [native code]}' and is.
-ALERT: PASS: window.focus should be 'function focus() {    [native code]}' and is.
 ALERT: PASS: window.getComputedStyle should be 'function getComputedStyle() {    [native code]}' and is.
 ALERT: PASS: window.getMatchedCSSRules should be 'function getMatchedCSSRules() {    [native code]}' and is.
 ALERT: PASS: window.getSelection should be 'function getSelection() {    [native code]}' and is.

Modified: trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html (174846 => 174847)


--- 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)
@@ -216,16 +216,13 @@
         var addEventListenerOld = window.addEventListener;
         var alertOld = window.alert;
         var atobOld = window.atob;
-        var blurOld = window.blur;
         var btoaOld = window.btoa;
         var captureEventsOld = window.captureEvents;
         var clearIntervalOld = window.clearInterval;
         var clearTimeoutOld = window.clearTimeout;
-        var closeOld = window.close;
         var confirmOld = window.confirm;
         var evalOld = window.eval;
         var findOld = window.find;
-        var focusOld = window.focus;
         var getComputedStyleOld = window.getComputedStyle;
         var getMatchedCSSRulesOld = window.getMatchedCSSRules;
         var getSelectionOld = window.getSelection;
@@ -432,16 +429,13 @@
             shouldBe("window.addEventListener", "addEventListenerOld");
             shouldBe("window.alert", "alertOld");
             shouldBe("window.atob", "atobOld");
-            shouldBe("window.blur", "blurOld");
             shouldBe("window.btoa", "btoaOld");
             shouldBe("window.captureEvents", "captureEventsOld");
             shouldBe("window.clearInterval", "clearIntervalOld");
             shouldBe("window.clearTimeout", "clearTimeoutOld");
-            shouldBe("window.close", "closeOld");
             shouldBe("window.confirm", "confirmOld");
             shouldBe("window.eval", "evalOld");
             shouldBe("window.find", "findOld");
-            shouldBe("window.focus", "focusOld");
             shouldBe("window.getComputedStyle", "getComputedStyleOld");
             shouldBe("window.getMatchedCSSRules", "getMatchedCSSRulesOld");
             shouldBe("window.getSelection", "getSelectionOld");

Modified: trunk/LayoutTests/js/dom/global-function-resolve-expected.txt (174846 => 174847)


--- 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)
@@ -13,112 +13,110 @@
 PASS cachedFunctions[3]() is clearTimeout
 PASS cachedFunctions[4]() is clientInformation
 PASS cachedFunctions[4]() is clientInformation
-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
+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
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/js/dom/script-tests/global-function-resolve.js (174846 => 174847)


--- 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)
@@ -6,7 +6,6 @@
     'clearInterval',
     'clearTimeout',
     'clientInformation',
-    'close',
     'closed',
     'confirm',
     'console',

Modified: trunk/Source/WebCore/ChangeLog (174846 => 174847)


--- 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)
@@ -1,3 +1,24 @@
+2014-10-17  Michael Saboff  <msab...@apple.com>
+
+        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.
+
 2014-10-17  Simon Fraser  <simon.fra...@apple.com>
 
         [iOS] Speculative fix for a crash under RenderLayerCompositor::updateScrollCoordinatedLayer()

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (174846 => 174847)


--- 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)
@@ -149,25 +149,17 @@
     // Also, it's important to get the implementation straight out of the DOMWindow prototype regardless of
     // what prototype is actually set on this object.
     if (propertyName == exec->propertyNames().blur) {
-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
-            return true;
-        }
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
+        return true;
     } else if (propertyName == exec->propertyNames().close) {
-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
-            return true;
-        }
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
+        return true;
     } else if (propertyName == exec->propertyNames().focus) {
-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
-            return true;
-        }
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
+        return true;
     } else if (propertyName == exec->propertyNames().postMessage) {
-        if (!allowsAccess) {
-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
-            return true;
-        }
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
+        return true;
     } else if (propertyName == exec->propertyNames().showModalDialog) {
         if (!DOMWindow::canShowModalDialog(thisObject->impl().frame())) {
             slot.setUndefined();

Modified: trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp (174846 => 174847)


--- 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)
@@ -57,6 +57,30 @@
     return atomicPropertyName && document->hasDocumentNamedItem(*atomicPropertyName);
 }
 
+bool JSHTMLDocument::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+    JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(object);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    if (propertyName == Identifier(exec, "open")) {
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsHTMLDocumentPrototypeFunctionOpen, 2>);
+        return true;
+    }
+
+    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
+        return true;
+    }
+
+    const HashTableValue* entry = JSHTMLDocument::info()->staticPropHashTable->entry(propertyName);
+    if (entry) {
+        slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
+        return true;
+    }
+
+    return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
+}
+
 EncodedJSValue JSHTMLDocument::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)
 {
     JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(slotBase);

Modified: trunk/Source/WebCore/html/HTMLDocument.idl (174846 => 174847)


--- 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)
@@ -19,10 +19,11 @@
  */
 
 [
+    CustomGetOwnPropertySlot,
     CustomNamedGetter,
     NewImpurePropertyFiresWatchpoints,
 ] interface HTMLDocument : Document {
-    [Custom] void open();
+    [Custom, ForwardDeclareInHeader] void open();
     void close();
     [Custom] void write([Default=Undefined] optional DOMString text);
     [Custom] void writeln([Default=Undefined] optional DOMString text);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to