[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
japhet at chromium.org
japhet at chromium.org
Wed Dec 22 12:56:44 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 5b16b71765f4b7d8b1360aa5be64cab65fe57a38
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 2 16:19:36 2010 +0000
2010-09-02 Nate Chapin <japhet at chromium.org>
Reviewed by Adam Barth.
Remove m_URL from FrameLoader and instead depend on Document's url.
FrameLoader::url() will be removed in a later patch.
http://bugs.webkit.org/show_bug.cgi?id=41165
No new tests, since this predominantly a refactor. Updating
fast/dom/early-frame-url.html.
* WebCore.exp.in:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::updateURLForPushOrReplaceState):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::iconURL):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::didExplicitOpen):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::url):
(WebCore::FrameLoader::setOutgoingReferrer):
(WebCore::FrameLoader::startIconLoader):
(WebCore::FrameLoader::commitIconURLToIconDatabase):
(WebCore::FrameLoader::finishedParsing):
(WebCore::FrameLoader::checkIfDisplayInsecureContent):
(WebCore::FrameLoader::checkIfRunInsecureContent):
(WebCore::FrameLoader::updateFirstPartyForCookies):
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::open):
(WebCore::FrameLoader::shouldScrollToAnchor):
* loader/FrameLoader.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2a8bda1..6b386ab 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-02 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Update a test that busy-waits when it shouldn't and therefore makes
+ assumptions about the initialization sequence of Document::url() that
+ are no longer valid.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41165.
+
+ * fast/dom/resources/a.html:
+
2010-09-01 Tony Gentilcore <tonyg at chromium.org>
Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/dom/resources/a.html b/LayoutTests/fast/dom/resources/a.html
index 0cc3292..0bd2ad7 100644
--- a/LayoutTests/fast/dom/resources/a.html
+++ b/LayoutTests/fast/dom/resources/a.html
@@ -1,9 +1,12 @@
<HTML>
<HEAD>
<SCRIPT>
-function writeDot()
+function checkURL()
{
- while(!parent.frames[1].document.URL) { }
+ if (!parent.frames[1].document.URL)
+ setTimeout(checkURL, 0);
+ else if (window.layoutTestController)
+ layoutTestController.notifyDone();
}
</SCRIPT>
</HEAD>
@@ -11,10 +14,8 @@ function writeDot()
This test checks whether document.URL is initially set to an empty
value or "about:blank" for frames. The right answer is
"about:blank". If it is empty, then this test will hang.
- <script>
- writeDot();
- if (window.layoutTestController)
- layoutTestController.notifyDone();
- </script>
+<script>
+ checkURL();
+</script>
</BODY>
</HTML>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 454d91a..06b0aa6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,40 @@
+2010-09-02 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Remove m_URL from FrameLoader and instead depend on Document's url.
+ FrameLoader::url() will be removed in a later patch.
+
+ http://bugs.webkit.org/show_bug.cgi?id=41165
+
+ No new tests, since this predominantly a refactor. Updating
+ fast/dom/early-frame-url.html.
+
+ * WebCore.exp.in:
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::updateURLForPushOrReplaceState):
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::begin):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::iconURL):
+ (WebCore::FrameLoader::didOpenURL):
+ (WebCore::FrameLoader::didExplicitOpen):
+ (WebCore::FrameLoader::receivedFirstData):
+ (WebCore::FrameLoader::url):
+ (WebCore::FrameLoader::setOutgoingReferrer):
+ (WebCore::FrameLoader::startIconLoader):
+ (WebCore::FrameLoader::commitIconURLToIconDatabase):
+ (WebCore::FrameLoader::finishedParsing):
+ (WebCore::FrameLoader::checkIfDisplayInsecureContent):
+ (WebCore::FrameLoader::checkIfRunInsecureContent):
+ (WebCore::FrameLoader::updateFirstPartyForCookies):
+ (WebCore::FrameLoader::loadInSameDocument):
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ (WebCore::FrameLoader::open):
+ (WebCore::FrameLoader::shouldScrollToAnchor):
+ * loader/FrameLoader.h:
+
2010-09-01 Tony Gentilcore <tonyg at chromium.org>
Reviewed by Adam Barth.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index e8b4fe7..9509103 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -860,6 +860,7 @@ __ZNK7WebCore11FrameLoader14frameHasLoadedEv
__ZNK7WebCore11FrameLoader16outgoingReferrerEv
__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
+__ZNK7WebCore11FrameLoader3urlEv
__ZNK7WebCore11FrameLoader8loadTypeEv
__ZNK7WebCore11HistoryItem10visitCountEv
__ZNK7WebCore11HistoryItem11hasChildrenEv
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index dbf447d..b95ecbb 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -417,7 +417,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
m_frame = frame;
- if (frame || !url.isEmpty())
+ if (!url.isEmpty() || (frame && !frame->loader()->stateMachine()->creatingInitialEmptyDocument()))
setURL(url);
m_axObjectCache = 0;
@@ -4424,9 +4424,8 @@ void Document::updateURLForPushOrReplaceState(const KURL& url)
if (!f)
return;
- // FIXME: Eliminate this redundancy.
setURL(url);
- f->loader()->setURL(url);
+ f->loader()->setOutgoingReferrer(url);
f->loader()->documentLoader()->replaceRequestURLForSameDocumentNavigation(url);
}
diff --git a/WebCore/loader/DocumentWriter.cpp b/WebCore/loader/DocumentWriter.cpp
index cd82d6e..a400c68 100644
--- a/WebCore/loader/DocumentWriter.cpp
+++ b/WebCore/loader/DocumentWriter.cpp
@@ -126,7 +126,7 @@ void DocumentWriter::begin(const KURL& url, bool dispatch, SecurityOrigin* origi
if (resetScripting)
m_frame->script()->updatePlatformScriptObjects();
- m_frame->loader()->setURL(url);
+ m_frame->loader()->setOutgoingReferrer(url);
m_frame->setDocument(document);
if (m_decoder)
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index ccbccc9..cbabe99 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -471,15 +471,16 @@ KURL FrameLoader::iconURL()
return KURL(ParsedURLString, m_frame->document()->iconURL());
// Don't return a favicon iconURL unless we're http or https
- if (!m_URL.protocolInHTTPFamily())
+ KURL documentURL = m_frame->document()->url();
+ if (!documentURL.protocolInHTTPFamily())
return KURL();
KURL url;
- bool couldSetProtocol = url.setProtocol(m_URL.protocol());
+ bool couldSetProtocol = url.setProtocol(documentURL.protocol());
ASSERT_UNUSED(couldSetProtocol, couldSetProtocol);
- url.setHost(m_URL.host());
- if (m_URL.hasPort())
- url.setPort(m_URL.port());
+ url.setHost(documentURL.host());
+ if (documentURL.hasPort())
+ url.setPort(documentURL.port());
url.setPath("/favicon.ico");
return url;
}
@@ -508,10 +509,7 @@ bool FrameLoader::didOpenURL(const KURL& url)
window->setDefaultStatus(String());
}
}
- m_URL = url;
- if (m_URL.protocolInHTTPFamily() && !m_URL.host().isEmpty() && m_URL.path().isEmpty())
- m_URL.setPath("/");
- m_workingURL = m_URL;
+ m_workingURL = url;
started();
@@ -531,9 +529,7 @@ void FrameLoader::didExplicitOpen()
// from a subsequent window.document.open / window.document.write call.
// Canceling redirection here works for all cases because document.open
// implicitly precedes document.write.
- m_frame->redirectScheduler()->cancel();
- if (m_frame->document()->url() != blankURL())
- m_URL = m_frame->document()->url();
+ m_frame->redirectScheduler()->cancel();
}
@@ -624,21 +620,26 @@ void FrameLoader::receivedFirstData()
return;
if (url.isEmpty())
- url = m_URL.string();
+ url = m_frame->document()->url().string();
else
url = m_frame->document()->completeURL(url).string();
m_frame->redirectScheduler()->scheduleRedirect(delay, url);
}
-void FrameLoader::setURL(const KURL& url)
+const KURL& FrameLoader::url() const
+{
+ ASSERT(m_frame->document());
+ return m_frame->document()->url();
+}
+
+void FrameLoader::setOutgoingReferrer(const KURL& url)
{
KURL ref(url);
ref.setUser(String());
ref.setPass(String());
ref.removeFragmentIdentifier();
m_outgoingReferrer = ref.string();
- m_URL = url;
}
void FrameLoader::didBeginDocument(bool dispatch)
@@ -713,7 +714,7 @@ void FrameLoader::startIconLoader()
if (!iconDatabase()->iconDataKnownForIconURL(urlString)) {
LOG(IconDatabase, "Told not to load icon %s but icon data is not yet available - registering for notification and requesting load from disk", urlString.ascii().data());
m_client->registerForIconNotification();
- iconDatabase()->iconForPageURL(m_URL.string(), IntSize(0, 0));
+ iconDatabase()->iconForPageURL(m_frame->document()->url().string(), IntSize(0, 0));
iconDatabase()->iconForPageURL(originalRequestURL().string(), IntSize(0, 0));
} else
m_client->dispatchDidReceiveIcon();
@@ -750,8 +751,8 @@ void FrameLoader::startIconLoader()
void FrameLoader::commitIconURLToIconDatabase(const KURL& icon)
{
ASSERT(iconDatabase());
- LOG(IconDatabase, "Committing iconURL %s to database for pageURLs %s and %s", icon.string().ascii().data(), m_URL.string().ascii().data(), originalRequestURL().string().ascii().data());
- iconDatabase()->setIconURLForPageURL(icon.string(), m_URL.string());
+ LOG(IconDatabase, "Committing iconURL %s to database for pageURLs %s and %s", icon.string().ascii().data(), m_frame->document()->url().string().ascii().data(), originalRequestURL().string().ascii().data());
+ iconDatabase()->setIconURLForPageURL(icon.string(), m_frame->document()->url().string());
iconDatabase()->setIconURLForPageURL(icon.string(), originalRequestURL().string());
}
@@ -777,7 +778,7 @@ void FrameLoader::finishedParsing()
// Check if the scrollbars are really needed for the content.
// If not, remove them, relayout, and repaint.
m_frame->view()->restoreScrollbar();
- m_frame->view()->scrollToFragment(m_URL);
+ m_frame->view()->scrollToFragment(m_frame->document()->url());
}
void FrameLoader::loadDone()
@@ -1005,7 +1006,7 @@ void FrameLoader::checkIfDisplayInsecureContent(SecurityOrigin* context, const K
return;
String message = String::format("The page at %s displayed insecure content from %s.\n",
- m_URL.string().utf8().data(), url.string().utf8().data());
+ m_frame->document()->url().string().utf8().data(), url.string().utf8().data());
m_frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message, 1, String());
m_client->didDisplayInsecureContent();
@@ -1017,7 +1018,7 @@ void FrameLoader::checkIfRunInsecureContent(SecurityOrigin* context, const KURL&
return;
String message = String::format("The page at %s ran insecure content from %s.\n",
- m_URL.string().utf8().data(), url.string().utf8().data());
+ m_frame->document()->url().string().utf8().data(), url.string().utf8().data());
m_frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message, 1, String());
m_client->didRunInsecureContent(context);
@@ -1101,7 +1102,7 @@ void FrameLoader::updateFirstPartyForCookies()
if (m_frame->tree()->parent())
setFirstPartyForCookies(m_frame->tree()->parent()->document()->firstPartyForCookies());
else
- setFirstPartyForCookies(m_URL);
+ setFirstPartyForCookies(m_frame->document()->url());
}
void FrameLoader::setFirstPartyForCookies(const KURL& url)
@@ -1119,6 +1120,7 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta
ASSERT(!stateObject || (stateObject && !isNewNavigation));
// Update the data source's request with the new URL to fake the URL change
+ KURL oldURL = m_frame->document()->url();
m_frame->document()->setURL(url);
documentLoader()->replaceRequestURLForSameDocumentNavigation(url);
if (isNewNavigation && !shouldTreatURLAsSameAsCurrent(url) && !stateObject) {
@@ -1136,11 +1138,8 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta
history()->updateBackForwardListForFragmentScroll();
}
- String oldURL;
- bool hashChange = equalIgnoringFragmentIdentifier(url, m_URL) && url.fragmentIdentifier() != m_URL.fragmentIdentifier();
- oldURL = m_URL;
+ bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragmentIdentifier() != oldURL.fragmentIdentifier();
- m_URL = url;
history()->updateForSameDocumentNavigation();
// If we were in the autoscroll/panScroll mode we want to stop it before following the link to the anchor
@@ -1154,7 +1153,7 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta
// We need to scroll to the fragment whether or not a hash change occurred, since
// the user might have scrolled since the previous navigation.
if (FrameView* view = m_frame->view())
- view->scrollToFragment(m_URL);
+ view->scrollToFragment(url);
m_isComplete = false;
checkCompleted();
@@ -1821,7 +1820,8 @@ void FrameLoader::commitProvisionalLoad()
RefPtr<CachedPage> cachedPage = m_loadingFromCachedPage ? pageCache()->get(history()->provisionalItem()) : 0;
RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
- LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame->tree()->name().string().utf8().data(), m_URL.string().utf8().data(),
+ LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame->tree()->name().string().utf8().data(),
+ m_frame->document() ? m_frame->document()->url().string().utf8().data() : "",
pdl ? pdl->url().string().utf8().data() : "<no provisional DocumentLoader>");
// Check to see if we need to cache the page we are navigating away from into the back/forward cache.
@@ -1861,7 +1861,8 @@ void FrameLoader::commitProvisionalLoad()
didOpenURL(url);
}
- LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->name().string().utf8().data(), m_URL.string().utf8().data());
+ LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->name().string().utf8().data(),
+ m_frame->document() ? m_frame->document()->url().string().utf8().data() : "");
if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect())
history()->updateForClientRedirect();
@@ -2105,7 +2106,6 @@ void FrameLoader::open(CachedFrameBase& cachedFrame)
if (url.protocolInHTTPFamily() && !url.host().isEmpty() && url.path().isEmpty())
url.setPath("/");
- m_URL = url;
m_workingURL = url;
started();
@@ -2857,7 +2857,7 @@ bool FrameLoader::shouldScrollToAnchor(bool isFormSubmission, FrameLoadType load
&& loadType != FrameLoadTypeReload
&& loadType != FrameLoadTypeReloadFromOrigin
&& loadType != FrameLoadTypeSame
- && !shouldReload(this->url(), url)
+ && !shouldReload(m_frame->document()->url(), url)
// We don't want to just scroll if a link from within a
// frameset is trying to reload the frameset into _top.
&& !m_frame->document()->isFrameSet();
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 5adcf41..33ad438 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -266,10 +266,8 @@ public:
void frameDetached();
- const KURL& url() const { return m_URL; }
-
- // setURL is a low-level setter and does not trigger loading.
- void setURL(const KURL&);
+ const KURL& url() const;
+ void setOutgoingReferrer(const KURL&);
void loadDone();
void finishedParsing();
@@ -470,7 +468,6 @@ private:
RefPtr<SerializedScriptValue> m_pendingStateObject;
- KURL m_URL;
KURL m_workingURL;
OwnPtr<IconLoader> m_iconLoader;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list