Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

naturalHeight and naturalWidth property new or deprecated?

Tags:

javascript

dom

naturalHeight and naturalWidth property of HTMLImageElement object is not mentioned in mozilla website Link

Although both properties works fine in Firefox but i don't see this in documentation.

Is it a deprecated property or new in HTML5?

Can someone give me a link where these properties are defined in standard?

like image 396
P K Avatar asked Apr 09 '12 16:04

P K


1 Answers

Definitely not deprecated. Checking the HTML5 spec for the img element, we can see:

The IDL attributes naturalWidth and naturalHeight must return the intrinsic width and height of the image, in CSS pixels, if the image is available, or else 0. [CSS]

like image 165
Matthew Avatar answered Nov 03 '22 20:11

Matthew