| 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 17 matching lines...) Expand all Loading... |
| 28 #include "bindings/core/v8/ExceptionState.h" | 28 #include "bindings/core/v8/ExceptionState.h" |
| 29 #include "bindings/core/v8/ScriptState.h" | 29 #include "bindings/core/v8/ScriptState.h" |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 #include "core/frame/LocalFrame.h" | 31 #include "core/frame/LocalFrame.h" |
| 32 #include "core/frame/LocalFrameClient.h" | 32 #include "core/frame/LocalFrameClient.h" |
| 33 #include "core/loader/DocumentLoader.h" | 33 #include "core/loader/DocumentLoader.h" |
| 34 #include "core/loader/FrameLoader.h" | 34 #include "core/loader/FrameLoader.h" |
| 35 #include "core/loader/HistoryItem.h" | 35 #include "core/loader/HistoryItem.h" |
| 36 #include "core/loader/NavigationScheduler.h" | 36 #include "core/loader/NavigationScheduler.h" |
| 37 #include "core/page/Page.h" | 37 #include "core/page/Page.h" |
| 38 #include "platform/RuntimeEnabledFeatures.h" | |
| 39 #include "platform/weborigin/KURL.h" | 38 #include "platform/weborigin/KURL.h" |
| 40 #include "platform/weborigin/SecurityOrigin.h" | 39 #include "platform/weborigin/SecurityOrigin.h" |
| 41 #include "wtf/text/StringView.h" | 40 #include "wtf/text/StringView.h" |
| 42 | 41 |
| 43 namespace blink { | 42 namespace blink { |
| 44 | 43 |
| 45 namespace { | 44 namespace { |
| 46 | 45 |
| 47 bool equalIgnoringPathQueryAndFragment(const KURL& a, const KURL& b) { | 46 bool equalIgnoringPathQueryAndFragment(const KURL& a, const KURL& b) { |
| 48 return StringView(a.getString(), 0, a.pathStart()) == | 47 return StringView(a.getString(), 0, a.pathStart()) == |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return; | 145 return; |
| 147 } | 146 } |
| 148 | 147 |
| 149 if (delta) { | 148 if (delta) { |
| 150 frame()->loader().client()->navigateBackForward(delta); | 149 frame()->loader().client()->navigateBackForward(delta); |
| 151 } else { | 150 } else { |
| 152 // We intentionally call reload() for the current frame if delta is zero. | 151 // We intentionally call reload() for the current frame if delta is zero. |
| 153 // Otherwise, navigation happens on the root frame. | 152 // Otherwise, navigation happens on the root frame. |
| 154 // This behavior is designed in the following spec. | 153 // This behavior is designed in the following spec. |
| 155 // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go | 154 // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go |
| 156 FrameLoadType reloadType = | 155 frame()->reload(FrameLoadTypeReloadMainResource, |
| 157 RuntimeEnabledFeatures::fasterLocationReloadEnabled() | 156 ClientRedirectPolicy::ClientRedirect); |
| 158 ? FrameLoadTypeReloadMainResource | |
| 159 : FrameLoadTypeReload; | |
| 160 frame()->reload(reloadType, ClientRedirectPolicy::ClientRedirect); | |
| 161 } | 157 } |
| 162 } | 158 } |
| 163 | 159 |
| 164 void History::pushState(PassRefPtr<SerializedScriptValue> data, | 160 void History::pushState(PassRefPtr<SerializedScriptValue> data, |
| 165 const String& title, | 161 const String& title, |
| 166 const String& url, | 162 const String& url, |
| 167 ExceptionState& exceptionState) { | 163 ExceptionState& exceptionState) { |
| 168 stateObjectAdded(std::move(data), title, url, scrollRestorationInternal(), | 164 stateObjectAdded(std::move(data), title, url, scrollRestorationInternal(), |
| 169 FrameLoadTypeStandard, exceptionState); | 165 FrameLoadTypeStandard, exceptionState); |
| 170 } | 166 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 frame()->document()->url().elidedString() + "'."); | 225 frame()->document()->url().elidedString() + "'."); |
| 230 return; | 226 return; |
| 231 } | 227 } |
| 232 | 228 |
| 233 frame()->loader().updateForSameDocumentNavigation( | 229 frame()->loader().updateForSameDocumentNavigation( |
| 234 fullURL, SameDocumentNavigationHistoryApi, std::move(data), | 230 fullURL, SameDocumentNavigationHistoryApi, std::move(data), |
| 235 restorationType, type, frame()->document()); | 231 restorationType, type, frame()->document()); |
| 236 } | 232 } |
| 237 | 233 |
| 238 } // namespace blink | 234 } // namespace blink |
| OLD | NEW |