Skip to main content

Bug Tracker

Side navigation

#10125 closed bug (invalid)

Opened August 24, 2011 07:38AM UTC

Closed August 24, 2011 01:56PM UTC

Last modified May 07, 2012 02:53PM UTC

Canvas creation Height/Div problem

Reported by: Py Owned by:
Priority: low Milestone: None
Component: core Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

When creating a canvas using the following:

$("<canvas/>",{"height":100,"width":100});

You would expect a canvas created with it's width and height set to the value specified.

However, the current implementation transform those width and height to css width and height.

To implement a correct canvas, the following is needed.

$("<canvas/>").attr({"height":100,"width":100});

Attachments (0)
Change History (4)

Changed August 24, 2011 07:47AM UTC by Py comment:1

Changed August 24, 2011 01:56PM UTC by timmywil comment:2

component: unfiledcore
priority: undecidedlow
resolution: → invalid
status: newclosed

This is the desired behavior. Use the .attr() method to specifically set the width/height attributes. As you can see from the fiddle, the style tag takes precedence over the width/height attributes. It is used for that reason.

Changed September 04, 2011 07:58PM UTC by addyosmani comment:3

#10040 is a duplicate of this ticket.

Changed May 07, 2012 02:53PM UTC by rwaldron comment:4

#11715 is a duplicate of this ticket.