Closed
Bug 683855
Opened 13 years ago
Closed 12 years ago
Implement input.{width,height}
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: Ms2ger, Assigned: tbsaunde)
References
()
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
6.23 KB,
patch
|
Ms2ger
:
feedback+
|
Details | Diff | Splinter Review |
10.84 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
As discussed.
Comment 1•13 years ago
|
||
Attachment #557486 -
Flags: review?(Ms2ger)
Updated•13 years ago
|
Whiteboard: [needs review]
Reporter | ||
Updated•13 years ago
|
Attachment #557486 -
Flags: review?(Ms2ger) → feedback+
Comment 2•13 years ago
|
||
Try server push:
http://tbpl.allizom.org/?tree=Try&usebuildbot=1&rev=9e3d51151949
Updated•13 years ago
|
Attachment #557486 -
Flags: review?(Olli.Pettay)
Comment 3•13 years ago
|
||
Since .width/.height are mainly for the same use case what img has them, they should work the
same way, IMO.
Could you file a spec bug? (Or explain why the properties in <input type="image"> and <img> should work differently)
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
You are right Olli. I've been naive enough to believe the specs would mess up something that simple but indeed, IE has those two attributes reflected as numbers and having them behaving like the image element seems to make sense.
Updated•13 years ago
|
Attachment #557486 -
Flags: review?(Olli.Pettay)
Updated•13 years ago
|
Whiteboard: [needs review]
Comment 6•13 years ago
|
||
The specs have changed and it should now behave like img.
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #636999 -
Flags: review?(bzbarsky)
Comment 8•12 years ago
|
||
Comment on attachment 636999 [details] [diff] [review]
patch 2
>+nsGenericHTMLElement::GetWidthHeight(imgIRequest *aRequest)
Let's call this "GetWidthHeightForImage".
>+++ b/content/html/content/src/nsGenericHTMLElement.h
>+ * Get width and hight, using given request if attributes are unset.
s/hight/height/ and s/request/image request/
>+++ b/content/html/content/src/nsHTMLInputElement.cpp
>+nsHTMLInputElement::SetHeight(PRUint32 aHeight)
>+{
>+ nsAutoString value;
>+ value.AppendInt(aHeight);
>+
>+ return nsGenericHTMLElement::SetAttr(kNameSpaceID_None, nsGkAtoms::height,
>+ value, true);
Document that this is not using SetIntAttr because we have an unsigned integer?
Though maybe we should just add an overload of SetIntAttr that takes PRUint32....
>+nsHTMLInputElement::GetWidth(PRUint32 *aWidth)
>+return NS_OK;
Fix the indent, please.
>+++ b/dom/interfaces/html/nsIDOMHTMLInputElement.idl
Please rev the IID and fix the indentaion here too.
r=me with those nits and a better commit message. ;)
Attachment #636999 -
Flags: review?(bzbarsky) → review+
Reporter | ||
Comment 10•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #8)
> >+++ b/content/html/content/src/nsHTMLInputElement.cpp
> >+nsHTMLInputElement::SetHeight(PRUint32 aHeight)
> >+{
> >+ nsAutoString value;
> >+ value.AppendInt(aHeight);
> >+
> >+ return nsGenericHTMLElement::SetAttr(kNameSpaceID_None, nsGkAtoms::height,
> >+ value, true);
>
> Document that this is not using SetIntAttr because we have an unsigned
> integer?
>
> Though maybe we should just add an overload of SetIntAttr that takes
> PRUint32....
Something like SetUnsignedIntAttr(), maybe?
Comment 11•12 years ago
|
||
Seems fine to me.
Assignee | ||
Comment 12•12 years ago
|
||
Comment 13•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Keywords: dev-doc-needed
Comment 15•11 years ago
|
||
Documentation updated:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input
and
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/16
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•