[webkit-reviews] review requested: [Bug 18703] changing the 'size' property on a text input does not affect its length : [Attachment 24610] Possible patch to bug 18703

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 23 13:22:42 PDT 2008


Glenn Wilson <gwilson at google.com> has asked  for review:
Bug 18703: changing the 'size' property on a text input does not affect its
length
https://bugs.webkit.org/show_bug.cgi?id=18703

Attachment 24610: Possible patch to bug 18703
https://bugs.webkit.org/attachment.cgi?id=24610&action=edit

------- Additional Comments from Glenn Wilson <gwilson at google.com>
Here is an improved patch for this issue; I think this addresses Darin's
points.

Instead of telling the renderer that the element is dirty in setSize of
HTMLInputElement, instead, this patch adds a small bit of logic to Element's
setAttribute method.  HTMLInputElement's setSize and parseMappedAttributes
functions both invoke Element.setAttribute, so calling either will show the
input resizing.

Additionally, I updated the layout test to verify that setting the size and
setAttribute("size") will update the size.

The other 'invalidation' methods (setChanged and attributeChanged,
specifically) did not seem to incur a later re-layout, so outside of defining a
new method, I had to call setNeedsLayoutAndPrefWidthsRecalc.  I think this
logic is correct: resizing an element that already had a size could have
dramatic effects on how a page is sized and layed out, right?

This logic was added to both setAttribute methods in dom/Element.  I'm not sure
why these two methods are not refactored, since they look strikingly similar,
but I don't know enough about their differences to refactor them here.


More information about the webkit-reviews mailing list