Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-11507

Html5 DnD may remain stuck under WebKit when there are multiple big files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.6.0-HF16
    • Fix Version/s: 5.6.0-HF17, 5.7.1
    • Component/s: Seam / JSF UI

      Description

      Under WebKit the load can not be used because it may be filed a little bit too early (load is completed on the client side but not the server side).

      The current DnD code does a workaround using 2 tricks :

      • use progress event : 100% => means completed
      • track state change

      When files are big, the last progress event may be 99.9999% but there is usually no notfication on progress for completion.

      This means we have to rely on "state change".

      However, there is currently a closure issue in the way the onreadystatechange callback is defined.

      Initial code : the closure on xhr is not done correctly

       xhr.onreadystatechange = function() {readyStateChange(xhr, opts)}
      

      Modified code : force closure to be sure the call backs will contain the correct values

      xhr.onreadystatechange = (function(xhr,opts) { return function() {readyStateChange(xhr, opts)}})(xhr,opts);
      

      NB : JavaScript is such a nice language ...

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: