Title: [178966] trunk
Revision
178966
Author
msab...@apple.com
Date
2015-01-22 16:15:51 -0800 (Thu, 22 Jan 2015)

Log Message

REGRESSION (174847): can't view NHK(Japan's national public broadcasting organization)’s news pages
https://bugs.webkit.org/show_bug.cgi?id=140794

Reviewed by Anders Carlsson.

Source/WebCore:

If a document.open has been set, return it instead of always returning a new,
non-cached instance of jsHTMLDocumentPrototypeFunctionOpen.

Test: js/dom/document-overwrite-open.html

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

LayoutTests:

* js/dom/document-overwrite-open-expected.txt: Added.
* js/dom/document-overwrite-open.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (178965 => 178966)


--- trunk/LayoutTests/ChangeLog	2015-01-22 23:46:41 UTC (rev 178965)
+++ trunk/LayoutTests/ChangeLog	2015-01-23 00:15:51 UTC (rev 178966)
@@ -1,3 +1,13 @@
+2015-01-22  Michael Saboff  <msab...@apple.com>
+
+        REGRESSION (174847): can't view NHK(Japan's national public broadcasting organization)’s news pages
+        https://bugs.webkit.org/show_bug.cgi?id=140794
+
+        Reviewed by Anders Carlsson.
+
+        * js/dom/document-overwrite-open-expected.txt: Added.
+        * js/dom/document-overwrite-open.html: Added.
+
 2015-01-22  Roger Fong  <roger_f...@apple.com>
 
         [WebGL2] Create empty interface files for new WebGL2 objects.

Added: trunk/LayoutTests/js/dom/document-overwrite-open-expected.txt (0 => 178966)


--- trunk/LayoutTests/js/dom/document-overwrite-open-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/dom/document-overwrite-open-expected.txt	2015-01-23 00:15:51 UTC (rev 178966)
@@ -0,0 +1,7 @@
+This page tests that the document function open() can be overwritten with a user provided function. If the test passes, you'll see PASS messages below.
+
+PASS: document.open was overwritten.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/dom/document-overwrite-open.html (0 => 178966)


--- trunk/LayoutTests/js/dom/document-overwrite-open.html	                        (rev 0)
+++ trunk/LayoutTests/js/dom/document-overwrite-open.html	2015-01-23 00:15:51 UTC (rev 178966)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p>This page tests that the document function open() can be overwritten with a user provided function. If the test passes, you'll see PASS messages below.</p>
+<pre id="console"></pre>
+<script>
+
+document.open = function() {
+    debug("PASS: document.open was overwritten.");
+}
+
+document.open();
+
+if (this.testRunner)
+    testRunner.dumpAsText();
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (178965 => 178966)


--- trunk/Source/WebCore/ChangeLog	2015-01-22 23:46:41 UTC (rev 178965)
+++ trunk/Source/WebCore/ChangeLog	2015-01-23 00:15:51 UTC (rev 178966)
@@ -1,3 +1,18 @@
+2015-01-22  Michael Saboff  <msab...@apple.com>
+
+        REGRESSION (174847): can't view NHK(Japan's national public broadcasting organization)’s news pages
+        https://bugs.webkit.org/show_bug.cgi?id=140794
+
+        Reviewed by Anders Carlsson.
+
+        If a document.open has been set, return it instead of always returning a new,
+        non-cached instance of jsHTMLDocumentPrototypeFunctionOpen.
+
+        Test: js/dom/document-overwrite-open.html
+
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::getOwnPropertySlot):
+
 2015-01-22  Zalan Bujtas  <za...@apple.com>
 
         Simple line layout: Reset LineState when starting a new line.

Modified: trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp (178965 => 178966)


--- trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp	2015-01-22 23:46:41 UTC (rev 178965)
+++ trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp	2015-01-23 00:15:51 UTC (rev 178966)
@@ -64,6 +64,9 @@
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
 
     if (propertyName == "open") {
+        if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
+            return true;
+
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsHTMLDocumentPrototypeFunctionOpen, 2>);
         return true;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to