1) On line 301 of LzTextSprite, could you move your new check (for
fixed line height) above the comment, with it's own comment, something
like:
// If the font size has been set, we already know the line height
It's confusing in the place where it is right now.
2) But, I have a question about that too: since we are trying to
model swf semantics, will there ever be a case where there is a
default font size for the <text> but the content, being HTML,
specifies a larger font size? In that case, is lineHeight meant to be
the default font size, or the font that is in the content?
3) Rather than reusing styleKey, could you make a new key, say
mdivKey, just so I understand that is what it is for? Presumably the
_sizedomcache should use that key, rather than the cacheFullKey?
4) On line 510 there is unreachable code.
5) Your comment above line 515 is a restatement of my comment below
the line. If you like yours better, how about sign and date it and
delete mine?
6) If _measureTextContent is never called, maybe it should just go
away? Along with the comment in getTextDimension that says it it
inlined?
Otherwise approved.
On 2009-04-30, at 18:00EDT, Max Carlson wrote:
Change 20090430-maxcarlson-n by maxcarl...@bank on 2009-04-30
14:56:24 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Reduce calls to getTextDimension()
Bugs Fixed: LPP-8016 - Performance differences between OL 4.0.x and
4.3.x
Technical Reviewer: ptw
QA Reviewer: hminsky
Details: LzSprite - Clear out additional cache to prevent leaks in IE.
LzTextSprite - Cache lineheight when the CSS value is set directly
to prevent measuring it later. Reuse measurement divs when the
style is equivalent.
Tests: test/lztest/lztest-textheight.lzx?
debug=true&lzr=dhtml&lzt=testboth runs as before, webtop has around
half the number of calls to getTextDimension().
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/20090430-maxcarlson-n.tar