Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 8585026: Merge 100550 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/loader/FrameLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 100576)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -2377,12 +2377,16 @@
// DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HTML], the base URI is computed using
// first the value of the href attribute of the HTML BASE element if any, and the value of the documentURI attribute
// from the Document interface otherwise.
- if (m_baseElementURL.isEmpty()) {
+ if (!m_baseElementURL.isEmpty())
+ m_baseURL = m_baseElementURL;
+ else if (!m_baseURLOverride.isEmpty())
+ m_baseURL = m_baseURLOverride;
+ else {
// The documentURI attribute is an arbitrary string. DOM 3 Core does not specify how it should be resolved,
// so we use a null base URL.
m_baseURL = KURL(KURL(), documentURI());
- } else
- m_baseURL = m_baseElementURL;
+ }
+
if (!m_baseURL.isValid())
m_baseURL = KURL();
@@ -2392,6 +2396,12 @@
m_mappedElementSheet->setFinalURL(m_baseURL);
}
+void Document::setBaseURLOverride(const KURL& url)
+{
+ m_baseURLOverride = url;
+ updateBaseURL();
+}
+
void Document::processBaseElement()
{
// Find the first href attribute in a base element and the first target attribute in a base element.
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698