LayoutTests:
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2007 23:49:58 +0000 (23:49 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2007 23:49:58 +0000 (23:49 +0000)
        Reviewed by Anders

        <rdar://problem/5061826> and
        http://bugs.webkit.org/show_bug.cgi?id=12863
        Implement window.stop()

        * http/tests/misc/window-dot-stop-expected.txt: Added.
        * http/tests/misc/window-dot-stop.html: Added.

WebCore:

        Reviewed by Anders

        <rdar://problem/5061826> and
        http://bugs.webkit.org/show_bug.cgi?id=12863
        Implement window.stop()

        * bindings/js/kjs_window.cpp:
        (KJS::WindowFunc::callAsFunction): Add case Window::Stop
        * bindings/js/kjs_window.h:
        (KJS::Window::): Add "Stop"

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

LayoutTests/ChangeLog
LayoutTests/http/tests/misc/window-dot-stop-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/window-dot-stop.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_window.cpp
WebCore/bindings/js/kjs_window.h

index 36ac285..552df6d 100644 (file)
@@ -1,3 +1,14 @@
+2007-03-16  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders
+
+        <rdar://problem/5061826> and
+        http://bugs.webkit.org/show_bug.cgi?id=12863
+        Implement window.stop()
+
+        * http/tests/misc/window-dot-stop-expected.txt: Added.
+        * http/tests/misc/window-dot-stop.html: Added.
+
 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by john
diff --git a/LayoutTests/http/tests/misc/window-dot-stop-expected.txt b/LayoutTests/http/tests/misc/window-dot-stop-expected.txt
new file mode 100644 (file)
index 0000000..6838213
--- /dev/null
@@ -0,0 +1,6 @@
+http://127.0.0.1:8000/incremental/slow-utf8-text.pl - willSendRequest <NSURLRequest http://127.0.0.1:8000/incremental/slow-utf8-text.pl> redirectResponse (null)
+http://127.0.0.1:8000/incremental/slow-utf8-text.pl - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/incremental/slow-utf8-text.pl">
+<unknown> - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code -999, failing URL "http://127.0.0.1:8000/misc/window-dot-stop.html">
+This tests for the successful use of window.stop()
+
+
diff --git a/LayoutTests/http/tests/misc/window-dot-stop.html b/LayoutTests/http/tests/misc/window-dot-stop.html
new file mode 100644 (file)
index 0000000..390fc88
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.dumpResourceLoadCallbacks();
+        layoutTestController.waitUntilDone();
+    }
+</script>
+<body>
+This tests for the successful use of window.stop()<br>
+<iframe src="http://127.0.0.1:8000/incremental/slow-utf8-text.pl"></iframe><br>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    setTimeout("layoutTestController.notifyDone()", 0); 
+}
+window.stop();
+</script>
+TEST FAILED:  If window.stop() works, you shouldn't be able to see this and the above iframe should not have loaded.
+</body>
+</html>
index 8ffeee1..30944d8 100644 (file)
@@ -1,3 +1,16 @@
+2007-03-16  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders
+
+        <rdar://problem/5061826> and
+        http://bugs.webkit.org/show_bug.cgi?id=12863
+        Implement window.stop()
+
+        * bindings/js/kjs_window.cpp:
+        (KJS::WindowFunc::callAsFunction): Add case Window::Stop
+        * bindings/js/kjs_window.h:
+        (KJS::Window::): Add "Stop"
+
 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Brady Eidson.
index 646a021..ab121dc 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
                        projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
index 9f21554..d7f15a3 100644 (file)
@@ -323,7 +323,8 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 };
   onbeforeunload Window::Onbeforeunload DontDelete
   frameElement  Window::FrameElement    DontDelete|ReadOnly
   showModalDialog Window::ShowModalDialog    DontDelete|Function 1
-  find            Window::Find               DontDelete|Function 7
+  find          Window::Find            DontDelete|Function 7
+  stop          Window::Stop            DontDelete|Function 0
 @end
 */
 KJS_IMPLEMENT_PROTOTYPE_FUNCTION(WindowFunc)
@@ -1831,6 +1832,9 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
     JSValue* result = showModalDialog(exec, window, args);
     return result;
   }
+  case Window::Stop:
+        frame->loader()->stopAllLoaders();
+        return jsUndefined();
   case Window::Find:
       if (!window->isSafeScript(exec))
           return jsUndefined();
index b1d7597..eaff6e6 100644 (file)
@@ -180,7 +180,7 @@ namespace KJS {
            Onfocus, Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove,
            Onmouseout, Onmouseover, Onmouseup, OnWindowMouseWheel, Onreset, Onresize, Onscroll, Onsearch,
            Onselect, Onsubmit, Onunload, Onbeforeunload,
-           Statusbar, Toolbar, FrameElement, ShowModalDialog, Find };
+           Statusbar, Toolbar, FrameElement, ShowModalDialog, Find, Stop };
 
   private:
     JSValue* getListener(ExecState*, const WebCore::AtomicString& eventType) const;