Opened 3 years ago

Closed 3 years ago

#15939 closed defect (fixed)

dojo/request/iframe eats form when one is used

Reported by: kgf Owned by: BryanForbes
Priority: blocker Milestone: 1.8.1
Component: IO Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

Description

This is reproducible with the following simple test code (call test() in the console):

<!DOCTYPE html>
<html>
  <body>
    <form id="f" method="post">
      <input name="foo">
    </form>
    <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js" data-dojo-config="async:true"></script>
    <script>
      var test;
      require(["dojo/request/iframe"], function(iframe){
        test = function(){
          iframe.post("test.php", {
            form: "f"
          }).then(function(data){
            console.log(data);
          });
        };
      });
    </script>
  </body>
</html>

It seems to me that unlike dojo/io/iframe which used formToObject to serialize form data, dojo/request/iframe might be manipulating the form directly, which seems kind of unsafe. I could be misreading though.

(Originally reported on the mailing list: http://mail.dojotoolkit.org/pipermail/dojo-interest/2012-September/070213.html)

Change History (4)

comment:1 Changed 3 years ago by BryanForbes

  • Milestone changed from tbd to 1.8.1
  • Priority changed from undecided to blocker

comment:2 Changed 3 years ago by BryanForbes

In [29647]:

Fix position getting set on form in DOM. refs #15939 !strict

comment:3 Changed 3 years ago by BryanForbes

In [29648]:

Fix position getting set on form in DOM for 1.8. refs #15939 !strict

comment:4 Changed 3 years ago by BryanForbes

  • Resolution set to fixed
  • Status changed from new to closed

The form wasn't getting "eaten", but rather the position was getting set on it and moved out of the viewport because of some faulty logic to check if the form was in the DOM. This has been fixed and should be in 1.8.1.

Note: See TracTickets for help on using tickets.