This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29378 - width and height attirbute should allow floating point numbers
Summary: width and height attirbute should allow floating point numbers
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard: whatwg-resolved
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-15 07:34 UTC by sa-takagi
Modified: 2016-04-21 16:54 UTC (History)
6 users (show)

See Also:


Attachments

Description sa-takagi 2016-01-15 07:34:27 UTC
Currnet HTML specification says that the width and height attributes on img, iframe, embed, object, video and input element are valid non-negative INTEGERS. https://www.w3.org/html/wg/drafts/html/master/semantics.html#attr-dim-width

On the other hand, 'width' and 'height' CSS property corresponding to them are <number> which allows decimal point. https://www.w3.org/TR/CSS2/visudet.html#the-width-property

I noticed it, when checking the HTML5 elements in SVG subtrees chapter of the SVG2 draft. It will cause confusion, since width and height attribute of SVG's graphics elements allows decimal point. https://svgwg.org/svg2-draft/embedded.html#HTMLElements

Furthermore, I have noticed that webkit and blink handles the width and height attribute of html as decimal point values. 
See this test: http://svg2.mbsrv.net/devinfo/devstd/embedWH/

Please take into consideration that width and height of html attribute allow decimal point values.
Comment 1 Simon Pieters 2016-01-15 12:14:16 UTC
Would you like to also file an issue about this at https://github.com/whatwg/html/issues ?
Comment 2 sa-takagi 2016-01-19 03:35:50 UTC
Posted;
https://github.com/whatwg/html/issues/533

(In reply to Simon Pieters from comment #1)
> Would you like to also file an issue about this at
> https://github.com/whatwg/html/issues ?
Comment 3 Simon Pieters 2016-01-19 09:02:08 UTC
Thank you!
Comment 4 Arron Eicholz 2016-04-21 16:54:15 UTC
HTML5.1 Bugzilla Bug Triage: Fixed

The algorithm for image candidate string now covers floating-point numbers.

...
4. Zero or one of the following:

A width descriptor, consisting of: a space character, a valid non-negative integer giving a number greater than zero representing the width descriptor value, and a U+0077 LATIN SMALL LETTER W character.

A pixel density descriptor, consisting of: a space character, a valid floating-point number giving a number greater than zero representing the pixel density descriptor value, and a U+0078 LATIN SMALL LETTER X character.
...