[Laszlo-dev] For Review: Change 20080624-maxcarlson-X Summary: Make text size measurement consistent in DHTML
André Bargull
a.bargull at intensis.de
Wed Jun 25 12:27:49 PDT 2008
Doesn't work quite right, try this testcase to spot the differences
dhtml<->swf:
(if used ff2 for testing)
> <canvas debug="true" width="100%" height="300" >
>
> <dataset name="dstext" >
> <text>Lorem ipsum dolor sit amet, consectetuer adipiscing
> elit. Nunc ac ante sed ante imperdiet auctor.</text>
> <text>Lorem ipsum dolor sit amet</text>
> </dataset>
>
> <view name="container" width="100%" layout="axis:y;spacing:20">
> <view layout="axis:x;spacing:10" >
> <text id="a" datapath="dstext:/text[1]/text()"
> multiline="true" resize="false" width="120" height="40"
> bgcolor="#eaeaea" />
> <text id="b" datapath="dstext:/text[1]/text()"
> multiline="true" resize="true" width="120" bgcolor="#eaeaea" />
>
> <inputtext id="c" datapath="dstext:/text[1]/text()"
> multiline="true" resize="false" width="120" height="40"
> bgcolor="#eaeaea" />
> <inputtext id="d" datapath="dstext:/text[1]/text()"
> multiline="true" resize="true" width="120" bgcolor="#eaeaea" />
> </view>
> <view layout="axis:x;spacing:10" >
> <text id="e" datapath="dstext:/text[2]/text()"
> multiline="false" resize="false" width="120" height="40"
> bgcolor="#eaeaea" />
> <text id="f" datapath="dstext:/text[2]/text()"
> multiline="false" resize="true" bgcolor="#eaeaea" />
>
> <inputtext id="g" datapath="dstext:/text[2]/text()"
> multiline="false" resize="false" width="120" height="40"
> bgcolor="#eaeaea" />
> <inputtext id="h" datapath="dstext:/text[2]/text()"
> multiline="false" resize="true" bgcolor="#eaeaea" />
> </view>
> </view>
>
> <handler name="oninit" >this.dotest();</handler>
>
> <method name="dotest" ><![CDATA[
> var sv:Array =
> this.container.subviews[0].subviews.concat(this.container.subviews[1].subviews);
> for (var i:int = 0; i < sv.length; ++i) {
> var t = sv[i];
> Debug.write("%s.sprite.getTextfieldHeight() = %d", t.id,
> t.sprite.getTextfieldHeight());
> Debug.write("%s.sprite.getTextHeight() = %d", t.id,
> t.sprite.getTextHeight());
> }
> ]]></method>
>
> </canvas>
On 6/25/2008 3:30 AM, Max Carlson wrote:
> Change 20080624-maxcarlson-X by maxcarlson at Roboto on 2008-06-24
> 18:15:54 PDT
> in /Users/maxcarlson/openlaszlo/trunk-clean
> for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Make text size measurement consistent in DHTML
>
> New Features: line height for multiline text in dhtml now matches Flash
>
> Bugs Fixed: LPP-6524 - DHTML text sizing and line height is not
> consistent across swf8 and dhtml
>
> Technical Reviewer: promanik, a.bargull at intensis.de
> QA Reviewer: ptw
>
> Details: LzSprite.js - Set line height of lzswftext to 120% to match
> Flash. Add text_height_includes_margins quirk and set to true in
> Firefox 3. Shorten lookups of lz.embed.browser and break out firefox
> version testing in __updateQuirks(). Adjust lzswftext line height to
> be 119% in Firefox 2 and 118% in Firefox 3.
>
> LzTextSprite.js - If text_height_includes_margins quirk is true, set
> horizontal padding to 2 and skip adding to line height for multiline
> text. Don't tweak whiteSpace style for single-line text - it causes
> the text to wrap in Firefox 3.
>
> Tests: /test/lfc/legals/text.lzx should look consistent acreoss swf
> and dhtml in Firefox 2.0.14, 3.0, IE 7, Opera 9.5 and Safari 3.1.1.
> Should look like this:
>
> ------------------------------------------------------------------------
>
>
>
> Files:
> M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
> M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
>
> Changeset:
> http://svn.openlaszlo.org/openlaszlo/patches/20080624-maxcarlson-X.tar
>
More information about the Laszlo-dev
mailing list