It looks to me like your test for setZ() would fail for a value of 0,
which is falsy:
if (!z || z.length == 0)
...
Why not test to see if it's a number, or not null instead?
Also, this could point to a deeper issue. If you can file a bug/add a
testcase that shows setZ() being sent a bogus value that would be great.
It's important the zIndex of the iframe and the view it represents
stay in sync. So, maybe this test should be removed for now...
Otherwise, approved!
On 7/27/10 1:44 PM, [email protected] wrote:
Change 20100727-philip-shd by phi...@philip-i7 on 2010-07-27 16:30:39 EDT
in /cygdrive/c/clients/laszlo/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Modify HTML component so you can style elements inside it.
New Features:
Bugs Fixed: LPP-9244 (partial), LPP-9240
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Details:
html.lzx:
- Added setStyle method to html.lzx. This sends the id/name/value of the
element to style to the iframemanager.
iframemanager.js:
- Added setStyle method to set the style of any element (by id). Any
errors generated are caught and discarded.
- Moved calling asyncCallback until the end of __gotload(). There was a
subtle race condition when you generate the onload event before setting
__loading to false. In my case, the onload event generates a number of
callJavascript() calls back into the iframemanager and expects an
immediate return of the data.
- Added check in setZ to ignore setting z to a null value. setZ is
called by code in html component using the z value from the sprite.
However, I found some cases where the sprite hasn't initialized the z
value.
Tests:
This test will style a div element in the html component when you click
the button.
test10.lzx:
<canvas height="600">
<simplelayout />
<button onclick="parent.myhtml.setStyle('mydiv', 'backgroundColor',
'yellow')">Change Color</button>
<html name="myhtml" width="400" height="100" src="test10.html"/>
</canvas>
test10.html:
<body>
<div id="mydiv">Div text to be styled.</div>
</body>
Files:
M lps/components/extensions/html.lzx
M lps/includes/source/iframemanager.js
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100727-philip-shd.tar
--
Regards,
Max Carlson
OpenLaszlo.org