I think you have a copy/paste-oh here: + paddingTop: '1px', + paddingRight: '3px', + paddingBottom: '4px', + paddingLeft: '1px'
I think it's trying to keep a 2px gutter but reconciling with some offset that input elements have. Anyways top+bottom should = 4 not 5, just like left+right does. Padding-top was 0 prior to your change. Otherwise approved. On 2010-09-07, at 18:22, Max Carlson wrote: > Change maxcarlson-20100903-cin by maxcarl...@friendly on 2010-09-03 18:28:08 > PDT > in /Users/maxcarlson/openlaszlo/trunk-clean > for http://svn.openlaszlo.org/openlaszlo/trunk > > Summary: UPDATED: Fix textfield sizing in dhtml > > Bugs Fixed: LPP-9268 - DHTML: padding is not subtracted from width/height for > texts > > Technical Reviewer: [email protected], ptw > QA Reviewer: hminsky > > Details: Updated per ptw's feedback: > >> One quibble: I think `N | 0` is more accepted than `N >> 0` as a way to >> coerce a number to an integer. At least that's what I see in other code >> bases. > > Fixed. > >> One comment: Please add a comment on lzinputtextcontainer explaining why >> there is _not_ padding there. > > That was a bug. I put the padding back in, inputtext now looks good! I also > removed the now superfluous > lzinputtextmultilinecontainer/lzinputtextmultilinecontainer_click styles now > that the containers are the same. > >> Otherwise approved. This moves the padding "inside" the container >> dimension, which was the original intent, except for my confusion over the >> box model. It might be worthwhile to have a longer comment where you >> removed the padding for measurement, explaining how when setting the height >> of a text sprite the container height wants to include the padding/gutter, >> but that when measuring text you want the accurate height of the text. > > Done. > > Otherwise: > > LzSprite - Style text containers with 0px padding, use padding on elements in > containers instead. parseInt()/Math.floor() -> | 0 for a slight speed boost. > > LzTextSprite - Text measurement divs are set to 0px padding to match the > style in LzSprite. Uncomment text padding subtraction in setHeight - the > scrolldiv shouldn't include padding. > > Tests: See test/text/newtextformat.lzx?debug=true&lzr=dhtml matches swf8 and > test/lztest/lztest-textheight.lzx?lzr=dhtml runs like before. > > Files: > M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js > M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js > M WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js > > Changeset: > http://svn.openlaszlo.org/openlaszlo/patches/maxcarlson-20100903-cin.tar >
