Don't create cached functions for HTMLDocument.write*()
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 17:19:49 +0000 (17:19 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 17:19:49 +0000 (17:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137906

Reviewed by Darin Adler.

Made it so that JSHTMLDocument::write() and ::writeln() are always created for every prototype.
This is similar to the change in r174847.

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot):
* html/HTMLDocument.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174985 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/html/HTMLDocument.idl

index 4be7a37..f832c66 100644 (file)
@@ -1,3 +1,17 @@
+2014-10-20  Michael Saboff  <msaboff@apple.com>
+
+        Don't create cached functions for HTMLDocument.write*()
+        https://bugs.webkit.org/show_bug.cgi?id=137906
+
+        Reviewed by Darin Adler.
+
+        Made it so that JSHTMLDocument::write() and ::writeln() are always created for every prototype.
+        This is similar to the change in r174847.
+
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::getOwnPropertySlot):
+        * html/HTMLDocument.idl:
+
 2014-10-21  Chris Dumez  <cdumez@apple.com>
 
         REGRESSION(r174676): It broke the !ENABLE(VIDEO) build
index 9352c9d..8463811 100644 (file)
@@ -66,6 +66,14 @@ bool JSHTMLDocument::getOwnPropertySlot(JSObject* object, ExecState* exec, Prope
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsHTMLDocumentPrototypeFunctionOpen, 2>);
         return true;
     }
+    if (equal(propertyName.publicName(), "write")) {
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsHTMLDocumentPrototypeFunctionWrite, 1>);
+        return true;
+    }
+    if (equal(propertyName.publicName(), "writeln")) {
+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsHTMLDocumentPrototypeFunctionWriteln, 1>);
+        return true;
+    }
 
     if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
index a673acd..ffc6283 100644 (file)
@@ -25,8 +25,8 @@
 ] interface HTMLDocument : Document {
     [Custom, ForwardDeclareInHeader] void open();
     void close();
-    [Custom] void write([Default=Undefined] optional DOMString text);
-    [Custom] void writeln([Default=Undefined] optional DOMString text);
+    [Custom, ForwardDeclareInHeader] void write([Default=Undefined] optional DOMString text);
+    [Custom, ForwardDeclareInHeader] void writeln([Default=Undefined] optional DOMString text);
 
     readonly attribute HTMLCollection embeds;
     readonly attribute HTMLCollection plugins;