Bug Tracker

Modify

Ticket #10125 (closed bug: invalid)

Opened 21 months ago

Last modified 13 months ago

Canvas creation Height/Div problem

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

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});

Change History

comment:1 Changed 21 months ago by Py

comment:2 Changed 21 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to core

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.

comment:3 Changed 21 months ago by addyosmani

#10040 is a duplicate of this ticket.

comment:4 Changed 13 months ago by rwaldron

#11715 is a duplicate of this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.