Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2489 closed defect (fixed)

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

Reported by: jwiltshire@… Owned by: alex
Priority: high Milestone:
Component: lfx Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

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 (2)

test.html (781 bytes) - added by jwiltshire@… 12 years ago.
Test case that demonstrates the problem
patch.txt (957 bytes) - added by jwiltshire@… 12 years ago.
Patch that resolves the issue

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by jwiltshire@…

Attachment: test.html added

Test case that demonstrates the problem

Changed 12 years ago by jwiltshire@…

Attachment: patch.txt added

Patch that resolves the issue

comment:1 Changed 12 years ago by jwiltshire@…

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

comment:2 Changed 12 years ago by alex

Milestone: 0.4.2
Owner: changed from Bryan Forbes to alex
Status: newassigned

accepting for 0.4.2

comment:3 Changed 12 years ago by alex

Resolution: fixed
Status: assignedclosed

(In [7515]) fixes #2489

comment:4 Changed 12 years ago by (none)

Milestone: 0.4.2

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.