Commit eccbfd32 authored by andersca@apple.com's avatar andersca@apple.com

* WebProcess/WebPage/WebFrame.cpp:

(WebKit::WebFrame::url):
Get the URL from the loader, not from the document.

Reviewed by Sam Weinig.

(WebKit::WebFrame::suggestedFilenameForResourceWithURL):
Return the correct suggested filename for the main resource.

(WebKit::WebFrame::mimeTypeForResourceWithURL):
Return the correct mime type for the main resource.



git-svn-id: svn://svn.chromium.org/blink/trunk@80945 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 433cdb1a
2011-03-12 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::url):
Get the URL from the loader, not from the document.
(WebKit::WebFrame::suggestedFilenameForResourceWithURL):
Return the correct suggested filename for the main resource.
(WebKit::WebFrame::mimeTypeForResourceWithURL):
Return the correct mime type for the main resource.
2011-03-12 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
......
......@@ -335,7 +335,11 @@ String WebFrame::url() const
if (!m_coreFrame)
return String();
return m_coreFrame->document()->url().string();
DocumentLoader* documentLoader = m_coreFrame->loader()->documentLoader();
if (!documentLoader)
return String();
return documentLoader->url().string();
}
String WebFrame::innerText() const
......@@ -612,6 +616,11 @@ String WebFrame::suggestedFilenameForResourceWithURL(const KURL& url) const
if (!loader)
return String();
// First, try the main resource.
if (loader->url() == url)
return loader->response().suggestedFilename();
// Next, try subresources.
RefPtr<ArchiveResource> resource = loader->subresource(url);
if (!resource)
return String();
......@@ -628,6 +637,11 @@ String WebFrame::mimeTypeForResourceWithURL(const KURL& url) const
if (!loader)
return String();
// First, try the main resource.
if (loader->url() == url)
return loader->response().mimeType();
// Next, try subresources.
RefPtr<ArchiveResource> resource = loader->subresource(url);
if (resource)
return resource->mimeType();
......
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