Use _self to represnet self-navigation, like in the HTML5 spec
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 03:47:20 +0000 (03:47 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Apr 2012 03:47:20 +0000 (03:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83834

Reviewed by Eric Seidel.

This patch aligns the internal state representation of the FrameLoader
more closely with the HTML5 spec.  Both the null string and "_self"
represent self-navigation, but the HTML5 spec distinguishes them when
navigating seamless iframes.  In that case, "_self" is explicit
self-navigation, whereas a null string will get redirected to the
"master" frame (the closest enclosing non-seamless frame).

This patch shouldn't have any observable behavior changes, but it will
be useful when we merge in the seamless branch from GitHub.
(See https://github.com/eseidel/webkit/commit/df0e71fcacdb0e7e45fe669afe1314cec5b76523
which contains this change.)

Once the seamless branch lands, this change will be tested by a number
of tests in
https://github.com/eseidel/webkit/tree/seamless/LayoutTests/fast/frames/seamless
including seamless-hyperlink.html.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadURL):

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

Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp

index 708aea7..2963c21 100644 (file)
@@ -1,3 +1,31 @@
+2012-04-12  Adam Barth  <abarth@webkit.org>
+
+        Use _self to represnet self-navigation, like in the HTML5 spec
+        https://bugs.webkit.org/show_bug.cgi?id=83834
+
+        Reviewed by Eric Seidel.
+
+        This patch aligns the internal state representation of the FrameLoader
+        more closely with the HTML5 spec.  Both the null string and "_self"
+        represent self-navigation, but the HTML5 spec distinguishes them when
+        navigating seamless iframes.  In that case, "_self" is explicit
+        self-navigation, whereas a null string will get redirected to the
+        "master" frame (the closest enclosing non-seamless frame).
+
+        This patch shouldn't have any observable behavior changes, but it will
+        be useful when we merge in the seamless branch from GitHub.
+        (See https://github.com/eseidel/webkit/commit/df0e71fcacdb0e7e45fe669afe1314cec5b76523
+        which contains this change.)
+
+        Once the seamless branch lands, this change will be tested by a number
+        of tests in
+        https://github.com/eseidel/webkit/tree/seamless/LayoutTests/fast/frames/seamless
+        including seamless-hyperlink.html.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadURLIntoChildFrame):
+        (WebCore::FrameLoader::loadURL):
+
 2012-04-12  James Robinson  <jamesr@chromium.org>
 
         [chromium] Move WebVideoFrame into Platform and remove WebCore::VideoFrameChromium wrapper API
index adb3f8b..57bef6a 100644 (file)
@@ -804,7 +804,7 @@ void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
         }
     }
 
-    childFrame->loader()->loadURL(url, referer, String(), false, FrameLoadTypeRedirectWithLockedBackForwardList, 0, 0);
+    childFrame->loader()->loadURL(url, referer, "_self", false, FrameLoadTypeRedirectWithLockedBackForwardList, 0, 0);
 }
 
 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
@@ -1193,7 +1193,7 @@ void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const Stri
     // The search for a target frame is done earlier in the case of form submission.
     Frame* targetFrame = isFormSubmission ? 0 : findFrameForNavigation(frameName);
     if (targetFrame && targetFrame != m_frame) {
-        targetFrame->loader()->loadURL(newURL, referrer, String(), lockHistory, newLoadType, event, formState.release());
+        targetFrame->loader()->loadURL(newURL, referrer, "_self", lockHistory, newLoadType, event, formState.release());
         return;
     }