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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 void History::go(ExecutionContext* context, int delta) { | 132 void History::go(ExecutionContext* context, int delta) { |
133 if (!frame() || !frame()->loader().client()) | 133 if (!frame() || !frame()->loader().client()) |
134 return; | 134 return; |
135 | 135 |
136 DCHECK(isMainThread()); | 136 DCHECK(isMainThread()); |
137 Document* activeDocument = toDocument(context); | 137 Document* activeDocument = toDocument(context); |
138 if (!activeDocument) | 138 if (!activeDocument) |
139 return; | 139 return; |
140 | 140 |
141 if (!activeDocument->frame() || | 141 if (!activeDocument->frame() || |
142 !activeDocument->frame()->canNavigate(*frame())) { | 142 !activeDocument->frame()->canNavigate(*frame()) || |
| 143 !activeDocument->frame()->isNavigationAllowed() || |
| 144 !NavigationDisablerForBeforeUnload::isNavigationAllowed()) { |
143 return; | 145 return; |
144 } | 146 } |
145 if (!NavigationDisablerForUnload::isNavigationAllowed()) | |
146 return; | |
147 | 147 |
148 if (delta) { | 148 if (delta) { |
149 frame()->loader().client()->navigateBackForward(delta); | 149 frame()->loader().client()->navigateBackForward(delta); |
150 } else { | 150 } else { |
151 // 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. |
152 // Otherwise, navigation happens on the root frame. | 152 // Otherwise, navigation happens on the root frame. |
153 // This behavior is designed in the following spec. | 153 // This behavior is designed in the following spec. |
154 // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go | 154 // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go |
155 FrameLoadType reloadType = | 155 FrameLoadType reloadType = |
156 RuntimeEnabledFeatures::fasterLocationReloadEnabled() | 156 RuntimeEnabledFeatures::fasterLocationReloadEnabled() |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 frame()->document()->url().elidedString() + "'."); | 220 frame()->document()->url().elidedString() + "'."); |
221 return; | 221 return; |
222 } | 222 } |
223 | 223 |
224 frame()->loader().updateForSameDocumentNavigation( | 224 frame()->loader().updateForSameDocumentNavigation( |
225 fullURL, SameDocumentNavigationHistoryApi, std::move(data), | 225 fullURL, SameDocumentNavigationHistoryApi, std::move(data), |
226 restorationType, type, frame()->document()); | 226 restorationType, type, frame()->document()); |
227 } | 227 } |
228 | 228 |
229 } // namespace blink | 229 } // namespace blink |
OLD | NEW |