Ticket #608 (closed defect: fixed)
IE 100% CPU due to BackgroundIframe (was: HtmlTooltip causes IE to run amok with onResized events)
| Reported by: | Hannes Wyss <hannes.wyss@…> | Owned by: | bill |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 0.2 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Steps to reproduce:
- Visit archive.dojotoolkit.org/nightly/tests/widget/test_Tooltip.html using IE 6.0
- Open the Task-Manager. On my AMD 1GHz, the CPU is running at 100%.
- Activate all tooltips on the page. As I get to the last 4, CPU usage goes down towards 0%
HtmlToolTip? works around a positioning-bug in IE using a BackgroundIframe?:
src/widget/html/ToolTip.js:
42 // IE bug workaround
43 this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
src/html.js:
898 // TODO: this function shouldn't be necessary but setting width=height=100% doesn't work!
899 onResized: function(){
900 if(this.iframe && this.domNode){
901 var w = dojo.style.getOuterWidth(this.domNode);
902 var h = dojo.style.getOuterHeight(this.domNode);
903 if (w == 0 || h == 0 ){
904 dojo.lang.setTimeout(this, this.onResized, 50);
905 return;
906 }
907 var s = this.iframe.style;
908 s.width = w + "px";
909 s.height = h + "px";
910 }
911 },
AFAICS what happens is this: As the page loads, onResized events are triggered for each ToolTip? on the page.
Apparently width and height are not defined for nodes that have never been displayed. Thus bgIframe.onResized keeps retriggering itself every 50ms.
Suggested Fix: none found yet, but I'll keep looking.
Change History
Note: See
TracTickets for help on using
tickets.