Remove V8DOMWindowShell::setLocation
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 04:39:58 +0000 (04:39 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 04:39:58 +0000 (04:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83833

Reviewed by Eric Seidel.

V8DOMWindowShell::setLocation is only used by document.location.  It's
more direct for document.location to call Location::setHref directly.
This integrates correctly with the navigation rules for
<iframe seamless>.

(See https://github.com/eseidel/webkit/compare/master...seamless for
more context about the connection with seamless.)

Reviewed on GitHub:
https://github.com/abarth/webkit/commit/48601729d53a6ac39df5a43b22218c91330c3f61

* bindings/v8/V8DOMWindowShell.cpp:
(WebCore):
* bindings/v8/V8DOMWindowShell.h:
(V8DOMWindowShell):
* bindings/v8/custom/V8DocumentLocationCustom.cpp:
(WebCore::V8Document::locationAccessorSetter):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
Source/WebCore/bindings/v8/V8DOMWindowShell.h
Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp

index df5c0d4..3b38a72 100644 (file)
@@ -1,3 +1,28 @@
+2012-04-12  Adam Barth  <abarth@webkit.org>
+
+        Remove V8DOMWindowShell::setLocation
+        https://bugs.webkit.org/show_bug.cgi?id=83833
+
+        Reviewed by Eric Seidel.
+
+        V8DOMWindowShell::setLocation is only used by document.location.  It's
+        more direct for document.location to call Location::setHref directly.
+        This integrates correctly with the navigation rules for
+        <iframe seamless>.
+
+        (See https://github.com/eseidel/webkit/compare/master...seamless for
+        more context about the connection with seamless.)
+
+        Reviewed on GitHub:
+        https://github.com/abarth/webkit/commit/48601729d53a6ac39df5a43b22218c91330c3f61
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore):
+        * bindings/v8/V8DOMWindowShell.h:
+        (V8DOMWindowShell):
+        * bindings/v8/custom/V8DocumentLocationCustom.cpp:
+        (WebCore::V8Document::locationAccessorSetter):
+
 2012-04-12  Levi Weintraub  <leviw@chromium.org>
 
         Prepare functions in LengthFunctions.h for LayoutUnits
index 078415b..1c44a41 100644 (file)
@@ -594,10 +594,4 @@ void V8DOMWindowShell::updateSecurityOrigin()
     setSecurityToken();
 }
 
-void V8DOMWindowShell::setLocation(DOMWindow* window, const String& locationString)
-{
-    State<V8Binding>* state = V8BindingState::Only();
-    window->setLocation(locationString, state->activeWindow(), state->firstWindow());
-}
-
 } // WebCore
index 73cb539..0676f14 100644 (file)
@@ -78,8 +78,6 @@ public:
 
     void destroyGlobal();
 
-    static void setLocation(DOMWindow*, const String& relativeURL);
-
     V8BindingPerContextData* perContextData() { return m_perContextData.get(); }
 
 private:
index f86054b..4cabd95 100644 (file)
@@ -26,7 +26,9 @@
 
 #include "DOMWindow.h"
 #include "Frame.h"
+#include "Location.h"
 #include "V8Binding.h"
+#include "V8BindingState.h"
 #include "V8Location.h"
 #include "V8Proxy.h"
 
@@ -48,9 +50,19 @@ void V8Document::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8
     if (!document->frame())
         return;
 
+    State<V8Binding>* state = V8BindingState::Only();
+
+    DOMWindow* activeWindow = state->activeWindow();
+    if (!activeWindow)
+      return;
+
+    DOMWindow* firstWindow = state->firstWindow();
+    if (!firstWindow)
+      return;
+
     DOMWindow* window = document->frame()->domWindow();
-    // setLocation does security checks. // XXXMB- verify!
-    V8DOMWindowShell::setLocation(window, toWebCoreString(value));
+    if (Location* location = window->location())
+        location->setHref(toWebCoreString(value), activeWindow, firstWindow);
 }
 
 } // namespace WebCore