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 14036 - WF2: Make HTMLInputElement.width and HTMLInputElement.height work like <img>'s .width and .height
Summary: WF2: Make HTMLInputElement.width and HTMLInputElement.height work like <img>'...
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
Depends on:
Reported: 2011-09-05 21:43 UTC by Olli Pettay
Modified: 2011-10-28 00:11 UTC (History)
7 users (show)

See Also:


Description Olli Pettay 2011-09-05 21:43:47 UTC

Comment 1 Mounir Lamouri 2011-09-06 15:54:59 UTC
FWIW, IE [1] is the only browser I've found implementing these two attributes and there are reflected as number, not string.

[1] Tested with version 9 only.
Comment 2 Anne 2011-10-07 09:34:59 UTC
Do they also have the additional magic that width/height on <img> have?
Comment 3 Ian 'Hixie' Hickson 2011-10-21 22:42:01 UTC
They're DOMString because historically they've been able to take percentages, too.

Note that these attributes are new (see bug 6477), so be wary when testing UAs.

I guess I can change them to unsigned long if people think that's a good idea? I don't really care either way here.
Comment 4 Anne 2011-10-22 00:42:02 UTC
Opera recently added them (not sure if shipping) and we decided to make them behave the same way as <img>, including the rendered height/width bit.

Making <input type=image> and <img> alike seems like a good idea to me.
Comment 5 Mounir Lamouri 2011-10-24 10:31:44 UTC
(In reply to comment #4)
> Making <input type=image> and <img> alike seems like a good idea to me.

I agree. It's probably more convenient for authors if the behavior of those attribute is consistent between elements.
Comment 6 Ian 'Hixie' Hickson 2011-10-27 23:55:23 UTC
Seems reasonable. Will do.
Comment 7 Ian 'Hixie' Hickson 2011-10-28 00:11:12 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 8 contributor 2011-10-28 00:11:52 UTC
Checked in as WHATWG revision r6775.
Check-in comment: Define input.width and input.height.