Commit 6e82feb0 authored by eric@webkit.org's avatar eric@webkit.org

2009-04-29 Mike Belshe <mike@belshe.com>

        Reviewed by Eric Seidel.

        Update location while page is loading.
        https://bugs.webkit.org/show_bug.cgi?id=21597

        Tested by:
        - fast/dom/location-new-window-no-crash
        - fast/dom/Window/window-open-pending-url

        * page/Location.cpp:

git-svn-id: svn://svn.chromium.org/blink/trunk@43014 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2194040a
2009-04-29 Mike Belshe <mike@belshe.com>
Reviewed by Eric Seidel.
Update location while page is loading.
https://bugs.webkit.org/show_bug.cgi?id=21597
* fast/dom/Window/window-open-pending-url-expected.txt:
* fast/dom/location-new-window-no-crash-expected.txt:
* fast/dom/resources/location-new-window-no-crash.js:
2009-04-29 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Rubber-stamped by Mark Rowe.
location: /
href: /
pathname: /
location: about:blank
href: about:blank
pathname: blank
host:
hostname:
hash:
port:
protocol: :
protocol: about:
search:
......@@ -3,13 +3,13 @@ Tests that manipulating location properties in a just-created window object does
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS testWindow.location.toString() is '/'
PASS testWindow.location.href is '/'
PASS testWindow.location.protocol is ':'
PASS testWindow.location.toString() is 'about:blank'
PASS testWindow.location.href is 'about:blank'
PASS testWindow.location.protocol is 'about:'
PASS testWindow.location.host is ''
PASS testWindow.location.hostname is ''
PASS testWindow.location.port is ''
PASS testWindow.location.pathname is '/'
PASS testWindow.location.pathname is 'blank'
PASS testWindow.location.search is ''
PASS testWindow.location.hash is ''
PASS testWindow.location.href = 'data:text/plain,b' is 'data:text/plain,b'
......@@ -23,13 +23,13 @@ PASS testWindow.location.hash = 'h' is 'h'
PASS testWindow.location.assign('data:text/plain,i') is undefined
PASS testWindow.location.replace('data:text/plain,j') is undefined
PASS testWindow.location.reload() is undefined
PASS testWindow.location.toString() is '/'
PASS testWindow.location.href is '/'
PASS testWindow.location.protocol is ':'
PASS testWindow.location.toString() is 'about:blank'
PASS testWindow.location.href is 'about:blank'
PASS testWindow.location.protocol is 'about:'
PASS testWindow.location.host is ''
PASS testWindow.location.hostname is ''
PASS testWindow.location.port is ''
PASS testWindow.location.pathname is '/'
PASS testWindow.location.pathname is 'blank'
PASS testWindow.location.search is ''
PASS testWindow.location.hash is ''
PASS successfullyParsed is true
......
......@@ -11,13 +11,13 @@ var testWindow = open("data:text/plain,a");
// of the test. We're checking behavior when the object was just created and is not yet at its new
// location.
shouldBe("testWindow.location.toString()", "'/'"); // Firefox returns about:blank
shouldBe("testWindow.location.href", "'/'"); // Firefox returns about:blank
shouldBe("testWindow.location.protocol", "':'"); // Firefox returns about:
shouldBe("testWindow.location.toString()", "'about:blank'");
shouldBe("testWindow.location.href", "'about:blank'");
shouldBe("testWindow.location.protocol", "'about:'");
shouldBe("testWindow.location.host", "''"); // Firefox throws an exception
shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception
shouldBe("testWindow.location.port", "''");
shouldBe("testWindow.location.pathname", "'/'"); // Firefox returns the empty string
shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empty string
shouldBe("testWindow.location.search", "''");
shouldBe("testWindow.location.hash", "''");
......@@ -34,13 +34,13 @@ shouldBe("testWindow.location.assign('data:text/plain,i')", "undefined");
shouldBe("testWindow.location.replace('data:text/plain,j')", "undefined");
shouldBe("testWindow.location.reload()", "undefined");
shouldBe("testWindow.location.toString()", "'/'"); // Firefox returns about:blank
shouldBe("testWindow.location.href", "'/'"); // Firefox returns about:blank
shouldBe("testWindow.location.protocol", "':'"); // Firefox returns about:
shouldBe("testWindow.location.toString()", "'about:blank'");
shouldBe("testWindow.location.href", "'about:blank'");
shouldBe("testWindow.location.protocol", "'about:'");
shouldBe("testWindow.location.host", "''"); // Firefox throws an exception
shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception
shouldBe("testWindow.location.port", "''");
shouldBe("testWindow.location.pathname", "'/'"); // Firefox returns the empty string
shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empty string
shouldBe("testWindow.location.search", "''");
shouldBe("testWindow.location.hash", "''");
......
2009-04-29 Mike Belshe <mike@belshe.com>
Reviewed by Eric Seidel.
Update location while page is loading.
https://bugs.webkit.org/show_bug.cgi?id=21597
Tested by:
- fast/dom/location-new-window-no-crash
- fast/dom/Window/window-open-pending-url
* page/Location.cpp:
2009-04-29 Feng Qian <feng@chromium.org>
Reviewed by Darin Adler.
......@@ -49,7 +49,12 @@ void Location::disconnectFrame()
inline const KURL& Location::url() const
{
ASSERT(m_frame);
return m_frame->loader()->url();
const KURL& url = m_frame->loader()->url();
if (!url.isValid())
return blankURL(); // Use "about:blank" while the page is still loading (before we have a frame).
return url;
}
String Location::href() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment