OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (!m_frame || !m_frame->loader().client()) | 169 if (!m_frame || !m_frame->loader().client()) |
170 return; | 170 return; |
171 | 171 |
172 ASSERT(isMainThread()); | 172 ASSERT(isMainThread()); |
173 Document* activeDocument = toDocument(context); | 173 Document* activeDocument = toDocument(context); |
174 if (!activeDocument) | 174 if (!activeDocument) |
175 return; | 175 return; |
176 | 176 |
177 if (!activeDocument->frame() || !activeDocument->frame()->canNavigate(*m_fra
me)) | 177 if (!activeDocument->frame() || !activeDocument->frame()->canNavigate(*m_fra
me)) |
178 return; | 178 return; |
179 if (!NavigationDisablerForBeforeUnload::isNavigationAllowed()) | 179 if (!NavigationDisablerForUnload::isNavigationAllowed()) |
180 return; | 180 return; |
181 | 181 |
182 // We intentionally call reload() for the current frame if delta is zero. | 182 // We intentionally call reload() for the current frame if delta is zero. |
183 // Otherwise, navigation happens on the root frame. | 183 // Otherwise, navigation happens on the root frame. |
184 // This behavior is designed in the following spec. | 184 // This behavior is designed in the following spec. |
185 // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go | 185 // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go |
186 if (delta) | 186 if (delta) |
187 m_frame->loader().client()->navigateBackForward(delta); | 187 m_frame->loader().client()->navigateBackForward(delta); |
188 else | 188 else |
189 m_frame->reload(FrameLoadTypeReload, ClientRedirectPolicy::ClientRedirec
t); | 189 m_frame->reload(FrameLoadTypeReload, ClientRedirectPolicy::ClientRedirec
t); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (!canChangeToUrl(fullURL, m_frame->document()->getSecurityOrigin(), m_fra
me->document()->url())) { | 234 if (!canChangeToUrl(fullURL, m_frame->document()->getSecurityOrigin(), m_fra
me->document()->url())) { |
235 // We can safely expose the URL to JavaScript, as a) no redirection take
s place: JavaScript already had this URL, b) JavaScript can only access a same-o
rigin History object. | 235 // We can safely expose the URL to JavaScript, as a) no redirection take
s place: JavaScript already had this URL, b) JavaScript can only access a same-o
rigin History object. |
236 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->getSecurityOrigin()->toString() + "' and URL '" + m_frame->doc
ument()->url().elidedString() + "'."); | 236 exceptionState.throwSecurityError("A history state object with URL '" +
fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f
rame->document()->getSecurityOrigin()->toString() + "' and URL '" + m_frame->doc
ument()->url().elidedString() + "'."); |
237 return; | 237 return; |
238 } | 238 } |
239 | 239 |
240 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, restorationType, type, m_frame->document()); | 240 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig
ationHistoryApi, data, restorationType, type, m_frame->document()); |
241 } | 241 } |
242 | 242 |
243 } // namespace blink | 243 } // namespace blink |
OLD | NEW |