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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2565673003: Fix window.history.go() with no parameter. (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index ca23114424b25110cd961183512fc18ee9f53b60..cff662181169824c51ec832b6ec7aa8ff486880a 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -3084,8 +3084,15 @@ - (BOOL)handleWindowHistoryForwardMessage:(base::DictionaryValue*)message
- (BOOL)handleWindowHistoryGoMessage:(base::DictionaryValue*)message
context:(NSDictionary*)context {
+ std::string valueKey = "value";
+ if (!message->HasKey(valueKey)) {
+ // window.history.go() with no input parameter should behave as
Eugene But (OOO till 7-30) 2016/12/09 22:58:19 Should we fix this in JS as follows?: |invokeOnHo
kkhorimoto 2016/12/13 00:30:56 Done.
+ // window.history.go(0).
+ [self goDelta:0];
+ return YES;
+ }
int delta = 0;
- if (message->GetInteger("value", &delta)) {
+ if (message->GetInteger(valueKey, &delta)) {
[self goDelta:delta];
return YES;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698