Ticket #2489 (closed defect: fixed)

Opened 21 months ago

Last modified 18 months ago

dojo.lfx.html.wipeIn sets node height incorrectly with compressed dojo build

Reported by: jwiltshire@… Owned by: alex
Priority: normal Milestone:
Component: lfx Version: 0.4.1
Severity: normal Keywords:
Cc:

Description

The wipeIn animation causes the size of the node it is animating to continually increase in size every time the animation is called. This only occurs when the following 2 conditions are met: * The DOM node being animated has a non-zero border style (i.e. style="border:1px solid black;" * The page is using a compressed dojo file that has the dojo.lfx.* module included in it. Using an uncompressed dojo build, or loading the module via dojo.require works fine.

I traced this down to the use of 'height' as a variable name, and the subsequent use of 'height' within a 'with (node.style)' block. The compressor seems to be incorrectly replacing the 'height' reference within the with block (which should refer to node.style.height) to the local variable reference.

Here's an extract of the source from dojo/lfx/html.js:

var height= dojo.html.getBorderBox(node).height;
...
anim.connect("beforeBegin", function(){
...
with(node.style){
	overflow = "hidden";
	height = "1px"; // 0 causes IE to display the whole panel
}

The compressed version of this then becomes:

var _41b=dojo.html.getBorderBox(node).height;
...
anim.connect("beforeBegin",function(){
...
with(node.style){
overflow="hidden";
_41b="1px";
}

...when in fact it should be:

var _41b=dojo.html.getBorderBox(node).height;
...
anim.connect("beforeBegin",function(){
...
with(node.style){
overflow="hidden";
height="1px";
}

Renaming the 'height' var to 'nodeHeight' resolves the problem.

Attachments

test.html (0.8 kB) - added by jwiltshire@… 21 months ago.
Test case that demonstrates the problem
patch.txt (0.9 kB) - added by jwiltshire@… 21 months ago.
Patch that resolves the issue

Change History

Changed 21 months ago by jwiltshire@…

Test case that demonstrates the problem

Changed 21 months ago by jwiltshire@…

Patch that resolves the issue

Changed 21 months ago by jwiltshire@…

This issue has also been raised as http://trac.dojotoolkit.org/ticket/2321

Changed 21 months ago by alex

  • status changed from new to assigned
  • owner changed from BryanForbes to alex
  • milestone set to 0.4.2

accepting for 0.4.2

Changed 21 months ago by alex

  • status changed from assigned to closed
  • resolution set to fixed

(In [7515]) fixes #2489

Changed 18 months ago by anonymous

  • milestone deleted

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.