Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#3891 closed defect (fixed)

TitlePane/fx.wipeOut() fail because dojo.style(node, "height") returns 0 (IE)

Reported by: bill Owned by: bill
Priority: high Milestone: 0.9
Component: fx Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

See test_TitlePane.html on IE; each pane closes instantly rather than wiping closed, because dojo/_base/fx.js calls

prop.start = dojo.style(this.node, p);

(where p=="height"), which returns 0, even though the node is visible. Node has style.cssText="height: auto".

So, something has to be updated, either html.js, _base/fx.js, dojo/fx.js, or TitlePane.js. Seems like the problem is in html.js but I guess it's debatable?

Change History (8)

comment:1 Changed 12 years ago by bill

Description: modified (diff)
Summary: dojo.html(node, "height") returns 0 for visible node with height: auto (IE)dojo.style(node, "height") returns 0 for visible node with height: auto (IE)

comment:2 Changed 12 years ago by sjmiles

Resolution: invalid
Status: newclosed

dojo.style uses getComputedStyle.

Querying computedStyle.height is not a good idea to get the actual node height. In particular, on IE the computedStyle is still just "auto"

You should use a box method or simply node.offsetHeight.

comment:3 Changed 12 years ago by bill

Resolution: invalid
Status: closedreopened

We need to change some code before this ticket can be closed. If we don't change dojo.html, the alternative is to modify fx to special case height (and width, I guess) when getting a style.

comment:4 Changed 12 years ago by sjmiles

I always consider the title of the ticket to state it's objective. As stated, this ticket is not a valid bug. I imagined you would open a new ticket for the fx problem.

comment:5 Changed 12 years ago by bill

Component: HTMLfx
Owner: changed from sjmiles to bill
Status: reopenednew
Summary: dojo.style(node, "height") returns 0 for visible node with height: auto (IE)TitlePane/fx.wipeOut() fail because dojo.style(node, "height") returns 0 (IE)

OK, I'm uneasy about dojo.html() have browser specific behavior but I'll add workaround code into fx for now.

comment:6 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [9858]) dojo.style(node, "height") can return "auto" or "" on IE rather than a number, so use offsetHeight instead. Fixes #3891.

comment:7 Changed 12 years ago by sjmiles

This change probably will cause additional problems because node.style.height and offsetHeight are not always symmetrical (depending on box-model, borders, and padding).

comment:8 Changed 12 years ago by bill

That's true, but in general height/width related animation won't work on nodes that have border/padding/margin, because of those box-model differences. Maybe it should be browser specific code, only accessing offsetHeight for IE.

Note: See TracTickets for help on using tickets.