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

Side by Side Diff: ios/web/web_state/js/resources/core.js

Issue 2763173002: Form submission with blank target is broken. (Closed)
Patch Set: Remove targetsFrame key/value from form submit call. Created 3 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file adheres to closure-compiler conventions in order to enable 5 // This file adheres to closure-compiler conventions in order to enable
6 // compilation with ADVANCED_OPTIMIZATIONS. In particular, members that are to 6 // compilation with ADVANCED_OPTIMIZATIONS. In particular, members that are to
7 // be accessed externally should be specified in this['style'] as opposed to 7 // be accessed externally should be specified in this['style'] as opposed to
8 // this.style because member identifiers are minified by default. 8 // this.style because member identifiers are minified by default.
9 // See http://goo.gl/FwOgy 9 // See http://goo.gl/FwOgy
10 10
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // Flush the message queue. 548 // Flush the message queue.
549 if (__gCrWeb.message) { 549 if (__gCrWeb.message) {
550 __gCrWeb.message.invokeQueues(); 550 __gCrWeb.message.invokeQueues();
551 } 551 }
552 552
553 // Capture form submit actions. 553 // Capture form submit actions.
554 document.addEventListener('submit', function(evt) { 554 document.addEventListener('submit', function(evt) {
555 if (evt['defaultPrevented']) 555 if (evt['defaultPrevented'])
556 return; 556 return;
557 557
558 var form = evt.target; 558 var action = evt.target.getAttribute('action');
Eugene But (OOO till 7-30) 2017/03/30 00:59:03 Optional nit: JavaScript Style Guide encourages t
michaeldo 2017/03/30 06:43:28 Done.
559 var targetsFrame = form.target && hasFrame_(window, form.target);
560
561 var action = form.getAttribute('action');
562 // Default action is to re-submit to same page. 559 // Default action is to re-submit to same page.
563 if (!action) 560 if (!action)
564 action = document.location.href; 561 action = document.location.href;
565 invokeOnHost_({ 562 invokeOnHost_({
566 'command': 'document.submit', 563 'command': 'document.submit',
567 'formName': __gCrWeb.common.getFormIdentifier(evt.srcElement), 564 'formName': __gCrWeb.common.getFormIdentifier(evt.srcElement),
568 'href': __gCrWeb['getFullyQualifiedURL'](action), 565 'href': __gCrWeb['getFullyQualifiedURL'](action)
569 'targetsFrame': targetsFrame
570 }); 566 });
571 }, false); 567 }, false);
572 568
573 addFormEventListeners_(); 569 addFormEventListeners_();
574 570
575 }()); // End of anonymous object 571 }()); // End of anonymous object
OLDNEW
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698