Opened 8 years ago

Closed 8 years ago

#12558 closed defect (fixed)

[patch][ccla]dojox.gfx.vml.Rect.setShape might not work as expected with mix of % and regular width/height

Reported by: Patrick Ruzand Owned by: Chris Mitchell
Priority: high Milestone: 1.7
Component: DojoX GFX Version: 1.6.0
Keywords: 1.7-mobile Cc: ccmitchellusa@…, drschwar@…, deanw@…, evanhuangwei@…, heguyi@…, rqruanqi@…, zhongsq@…, Evan
Blocked By: Blocking:

Description

in vml.js

dojox.gfx.vml.Rect.setShape method is doing:

style. width = (typeof shape.width == "string" && shape.width.indexOf("%") >= 0) ? shape.width : shape.width.toFixed(); style.height = (typeof shape.width == "string" && shape.height.indexOf("%") >= 0) ? shape.height : shape.height.toFixed();

Note that in the line above, 'width' is used instead of the 'height' property when setting the style.height. if the shape width is Number but the shape height is a String with % the height won't be correctly set. I guess the second line should be:

style. height = (typeof shape.height == "string" && shape.height.indexOf("%") >= 0) ? shape.height : shape.height.toFixed();

Attachments (2)

12558.patch (2.3 KB) - added by Patrick Ruzand 8 years ago.
patch (vml.js) + test
12558.2.patch (2.4 KB) - added by Patrick Ruzand 8 years ago.
fix base dir

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by Patrick Ruzand

Attachment: 12558.patch added

patch (vml.js) + test

comment:1 Changed 8 years ago by Chris Mitchell

Cc: ccmitchellusa@… drschwar@… deanw@… evanhuangwei@… heguyi@… rqruanqi@… zhongsq@… added

comment:2 Changed 8 years ago by Patrick Ruzand

new patch: fix patch base directory (base dir. was dojox/gfx/, now root of dojox/)

Changed 8 years ago by Patrick Ruzand

Attachment: 12558.2.patch added

fix base dir

comment:3 Changed 8 years ago by Chris Mitchell

Resolution: fixed
Status: newclosed

comment:4 Changed 8 years ago by Eugene Lazutkin

The patch makes sense --- typos should be fixed as they spotted, but I see that while it is closed, there is no associated change set. Did robot miss the change?

comment:5 Changed 8 years ago by bill

It was [24407] from Chris.

comment:6 Changed 8 years ago by Evan

Cc: Evan added

comment:7 Changed 8 years ago by bill

Resolution: fixed
Status: closedreopened

From Karl on the mailing list:

So... in dojox.gfx.vml there is this line that ChrisM updated ~4months ago...

style.height = (typeof shape.width == "string" && shape.height.indexOf("%") >= 0) ? shape.height : shape.height.toFixed();

Its throwing an error because height is being returned as -14... should we be trapping this case back to 0?

This only happens in IE7 so far... IE8 works.

comment:8 Changed 8 years ago by bill

Owner: changed from Eugene Lazutkin to Chris Mitchell
Status: reopenednew

comment:9 Changed 8 years ago by Karl Tiedt

Resolution: fixed
Status: newclosed

Moving this back to closed since it was only a reference for the problem, not a regression.

Note: See TracTickets for help on using tickets.