On Sat, Mar 27, 2010 at 12:50 PM, Max Carlson <[email protected]> wrote:

> Not approved yet.  Functionally, it looks good - the text fields now update
> their size when I type into them in dhtml.  I am seeing one strange thing in
> swf8 when running my components demo - I can't click to select text, instead
> every time I click it selects _all_ the text.  The height and width changes
> don't seem to be propagating to parent views in swf8/10.
>

I can see that bug  in swf8 in your demo.lzx app, I'll see if I can figure
out what's
not getting updated.  It looks like it is working properly for me in swf10
though, I get
an i-beam cursor when I move over the text field, and can insert text where
I click.





>
> When running test/lztest/lztest-textheight.lzx?debug=true&lzr=dhtml I see
> some regressions.  With your patch I see five additional errors:
> ERROR: In suite Text Size Test Suite, test 2, failed assertion: inputtext c
> sprite.getTextfieldHeight() within 82±1 got 96
> ERROR: In suite Text Size Test Suite, test 2, failed assertion: inputtext c
> getTextHeight() within 82±1 got 96
> ERROR: In suite Text Size Test Suite, test 2, failed assertion: inputtext d
> getTextfieldHeight() within 82±1 got 96
> ERROR: In suite Text Size Test Suite, test 2, failed assertion: inputtext d
> getTextHeight() within 82±1 got 96
> ERROR: In suite Text Size Test Suite, test 2, failed assertion: inputtext d
> height within 82±1 got 96
>
> These need to be tracked down and resolved.
>

ok

>
>
> I'm not comfortable with the DHTML sprite reading it's owner.hassetheight -
> we need an API to ensure this stays in sync, even if it's an additional
> argument to sprite.setHeig

ht()...
>
>
It might be that we can use the existing setHeight method in LzSprite.
Currently it just
returns if null is passed in, but maybe that should be updating the 'has
fixed height' flag in the sprite.



> Also it seems this:
>                if (sprite.sizeToHeight && sprite.multiline) {
>                    // NOTE: This sequence of operations is needed to
>                    // make autosizing work reliably in IE7. If you do
>                    // not first set the field height to zero before
>                    // looking at scrollHeight, then when you type
>                    // into the field it sometimes scrolls a little
>                    // upwards. There is a visual artifact, a "jump",
>                    // when you add a new line to the end of the
>                    // field. However that seems to be the state of
>                    // the art right now.
>                    d.style.height = "0px";
>                    d.style.height = d.scrollHeight + "px";
>                    d.scrollTop = 0+"px";
>
>                }
> should be wrapped in a quirk if it's really IE-specific...


It's really just that one line that sets the height to zero before resetting
it to scrollHeight
that is IE specific, and it is a no-op in other runtimes as far as I know,
but I'll make a quirk for it.



> On 3/26/10 3:41 PM, Henry Minsky wrote:
>
>> Change 20100325-hqm-i by [email protected] on 2010-03-25 15:07:05 EDT
>>     in /Users/hqm/openlaszlo/trunk
>>     for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: fix for autosizing of inputtext fields
>>
>> New Features:
>>
>> Bugs Fixed: LPP-8591
>>
>> Technical Reviewer: max
>> QA Reviewer: ptw
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Overview:
>>
>> Fix autosizing behavior for inputtext fields.
>>
>>
>>
>>
>> Details:
>>
>> LaszloView.lzs: make updateHeight() update the cached height value
>>
>> LzText.lzs: set_text and set_width call updateHeight instead of the height
>> setter,
>> to prevent the hassetheight flag from getting incorrectly set on
>> autosizing text views.
>>
>> LzInputText.lzs: Changed the call in inputtevent()'s onchange handler, to
>> use updateHeight() instead of the height setter (to prevent turning an
>> autosizing
>> field into a fixed height field)
>>
>> LzSprite.js: modified CSS for multiline input text to use the
>> whiteSpace='pre' CSS option,
>> to get accurate height measurement.
>>
>> LzTextSprite.js: Added 'sizeToHeight' flag, to track whether the the
>> sprite is autosizing. I know the kernel sprite shouldn't be ppeeking
>> at any more properties of the view, but we can do a real cleanup when
>> we design the new text class.
>>
>> [One thing that would be nice is if we allowed the user to change from
>> a single line to a multiline inputtext dynamically, like you can do in
>> SWF. In DHTML, we'd have to destroy the DOM input div and make a new one]
>>
>> LzInputTextSprite.js: in __textEvent(), use a technique to autosize the
>> text height,
>> by asking for it's scrollHeight. This seems to work in IE7, IE8, Firefox.
>> Safari does not like setting the height to zero.
>>
>>
>> Tests:
>>
>> Test case at end of LPP-8591, run in FF, IE7, IE8, Safari, Chrome, Opera
>>
>> 1) Enter text to cause text field to grow in height, see that
>> background size matches the view height.  See that no scrolling
>> happens.
>>
>> 2) Select all and delete text, see height of field and background
>> shrink to single line.
>>
>> 3) Try typing text that auto-wraps, i.e., words with spaces between
>> but no newlines. See that text height grows to contain text, with no
>> scrolling.
>>
>>
>>
>> smokecheck
>> amazon demo
>> calendar demo
>>
>>
>> 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
>> M       WEB-INF/lps/lfc/views/LzInputText.lzs
>> M       WEB-INF/lps/lfc/views/LzText.lzs
>> M       WEB-INF/lps/lfc/views/LaszloView.lzs
>>
>>
>> Changeset:
>> http://svn.openlaszlo.org/openlaszlo/patches/20100325-hqm-i.tar
>>
>
> --
> Regards,
> Max Carlson
> OpenLaszlo.org
>



-- 
Henry Minsky
Software Architect
[email protected]

Reply via email to