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

Unified Diff: webkit/port/page/Location.cpp

Issue 10700: Fix assignment of a javascript: URL to window.location.href... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 12 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 | « no previous file | webkit/tools/layout_tests/test_lists/win/tests_fixable.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/page/Location.cpp
===================================================================
--- webkit/port/page/Location.cpp (revision 5331)
+++ webkit/port/page/Location.cpp (working copy)
@@ -147,7 +147,10 @@
return;
Frame* activeFrame = ScriptController::retrieveActiveFrame();
- if (activeFrame && !url.protocolIs("javascript")) {
+ if (!activeFrame)
+ return;
+
+ if (!url.protocolIs("javascript") || ScriptController::isSafeScript(frame)) {
bool user_gesture = activeFrame->script()->processingUserGesture();
frame->loader()->scheduleLocationChange(url.string(),
activeFrame->loader()->outgoingReferrer(), lock_history, user_gesture);
@@ -206,11 +209,7 @@
if (!active_frame->loader()->shouldAllowNavigation(m_frame))
return;
- // Allows cross domain access except javascript url.
- if (!parseURL(value).startsWith("javascript:", false) ||
- ScriptController::isSafeScript(m_frame)) {
- navigateIfAllowed(m_frame, active_frame->loader()->completeURL(value), false);
- }
+ navigateIfAllowed(m_frame, active_frame->loader()->completeURL(value), false);
}
void Location::setPathname(const String& pathname) {
@@ -280,11 +279,7 @@
if (!active_frame->loader()->shouldAllowNavigation(m_frame))
return;
- // Allows cross domain access except javascript url.
- if (!parseURL(url).startsWith("javascript:", false) ||
- ScriptController::isSafeScript(m_frame)) {
- navigateIfAllowed(m_frame, active_frame->loader()->completeURL(url), true);
- }
+ navigateIfAllowed(m_frame, active_frame->loader()->completeURL(url), true);
}
void Location::assign(const String& url) {
@@ -298,12 +293,9 @@
if (!active_frame->loader()->shouldAllowNavigation(m_frame))
return;
- if (!parseURL(url).startsWith("javascript:", false) ||
- ScriptController::isSafeScript(m_frame)) {
- navigateIfAllowed(m_frame, active_frame->loader()->completeURL(url), false);
- }
+ navigateIfAllowed(m_frame, active_frame->loader()->completeURL(url), false);
}
+
#endif // USE(V8)
-
} // namespace WebCore
« no previous file with comments | « no previous file | webkit/tools/layout_tests/test_lists/win/tests_fixable.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698