There's a couple of issues here, mostly having to do with corner cases and the semantics of "resize".
Firstly, there are a couple of errors in the lztest-textheight that are present without my change, these two ERROR: In suite Text Size Test Suite, test 1, failed assertion: FAIL: inputtext5 heightEquals expected 52, got 54 ERROR: In suite Text Size Test Suite, test 1, failed assertion: FAIL: inputtext5.heightEquals expected 52, got 54 The others have to do with how the width of the text field is affected by subsequent calls to setText; whether it should resize it's width to fit the text or not. We have the "resize" property on text which says whether it sizes to fit the text. The value of "resize" defaults to true on LzText . However, I believe that if the user has specified an explicit width in the attributes of the <text > tag, then the LzText construct method should automatically set resize=false, because if the user went to the trouble to specify the text width, they probably want it to stay that width unless explicitly changed. The other error has to do with the system expecting a multiline text field which had no explicit width to default to width 100. That's kind of conflicting with my change which sets the initial width of text fields to the text content width (and which will be zero if the text is empty). There's a comment in the LzText which isn't actually implemented, but it says // To compute our width: // + if text is multiline: // if no width is supplied, use parent width // + if text is single line: // if no width was supplied and there's no constraint, measure the text width: // if empty text content was supplied, use DEFAULT_WIDTH I actually like the idea of defaulting the width to the parent if no width is specified, it seems like that will "do the right thing" most of the time. Perhaps we should implement that? On 6/5/07, Max Carlson <[EMAIL PROTECTED]> wrote:
This change causes some regressions in the following tests: http://localhost:8080/legals-clean/test/lztest/lztest-textheight.lzx?lzr=swf7&debug=true http://localhost:8080/legals-clean/test/lztest/lztest-textheight.lzx?lzr=dhtml&debug=true Also, the new test doesn't pass in DHTML: http://localhost:8080/legals-clean/test/lztest/lztest-lpp-2958.lzx?debug=true&lzr=dhtml Henry Minsky wrote: > Change 20070530-hqm-0 by [EMAIL PROTECTED] on 2007-05-30 09:23:10 EDT > in /cygdrive/c/users/hqm/openlaszlo/legals3 > for http://svn.openlaszlo.org/openlaszlo/branches/legals > > Summary: make sure swf sprite text-width matches LzView text-width > > New Features: > > Bugs Fixed: LPP-2958 > > Technical Reviewer: max (pending) > QA Reviewer: (pending) > Doc Reviewer: (pending) > > Documentation: > > Release Notes: > > Details: > > swf kernel textsprite was setting it's width in some cases without syncing > up it's > LzView owner. > > + I removed the default 100 width on LzText, but left it for LzInputText. > > > > > > Tests: > > test/lztest/lztest-lpp-2958.lzx > > Files: > M WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as > M WEB-INF/lps/lfc/views/LzInputText.lzs > M WEB-INF/lps/lfc/views/LzText.lzs > A test/lztest/lztest-lpp-2958.lzx > > > > -- Regards, Max Carlson OpenLaszlo.org
-- Henry Minsky Software Architect [EMAIL PROTECTED]
