Changes between Version 2 and Version 3 of Ticket #15884, comment 4


Ignore:
Timestamp:
Aug 24, 2012, 9:16:47 AM (7 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15884, comment 4

    v2 v3  
    33During initialization, when _WidgetBase applies the attributes (ie, calls custom setters for each attribute), _WidgetBase calls _setContentAttr(empty-document-fragment).    _WidgetBase expects that call to be synchronous, but it isn't.   _setContentAttr() calls _setContent(), and that calls setter.set(), that calls dojox/html/_base.js::onEnd(), and that calls ready(), to wait for any possible <script>require(...)</script> type blocks (in the !ContentPane content) to complete running.
    44
    5 So, while ready() is "blocking", _WidgetBase continues applying attributes, and calls_setHrefAttr().   _setHrefAttr() creates the onLoadDeferred to signal when the href has finished downloading and parsing.     Then while that href download is running, ready() stops blocking, so it calls _onLoadHandler, and resolves the onLoadDeferred created by _setHrefAttr().
     5So, while ready() is "blocking", _WidgetBase continues applying attributes, and calls_setHrefAttr().   _setHrefAttr() creates the onLoadDeferred to signal when the href has finished downloading and parsing.     Then while that href download is running, ready() stops blocking, so it calls _onLoadHandler(), and _onLoadHandler() resolves the onLoadDeferred created by _setHrefAttr().
    66
    7 In other words, _setContentAttr() and _setHrefAttr() unexpectedly overlap each other, and the problem is made worse because there's a instance-level onLoadDeferred property that gets confused between them.
     7In other words, _setContentAttr() and _setHrefAttr() unexpectedly effectively overlap each other, and the problem is made worse because there's a instance-level onLoadDeferred property that gets confused between them.
    88
    99PS: the content is actually set three times, once to the original content (the empty !DocumentFragment), once to "Loading..." (but in this case the isFakeContent flag is set), and finally to the content of the href.