Created attachment 557486 [details] [diff] [review]
Try server push:
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)
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.
The specs have changed and it should now behave like img.
Created attachment 636999 [details] [diff] [review]
Comment on attachment 636999 [details] [diff] [review]
Let's call this "GetWidthHeightForImage".
>+ * Get width and hight, using given request if attributes are unset.
s/hight/height/ and s/request/image request/
>+ nsAutoString value;
>+ 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....
Fix the indent, please.
Please rev the IID and fix the indentaion here too.
r=me with those nits and a better commit message. ;)
Thank you for working on that Trevor! :)
(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
> Though maybe we should just add an overload of SetIntAttr that takes
Something like SetUnsignedIntAttr(), maybe?
Seems fine to me.
*** Bug 772207 has been marked as a duplicate of this bug. ***