Yup.  Henry and Maynard reported the same.  I'll send a fix in a minute.

On 2009-08-19, at 16:55EDT, Max Carlson wrote:

I think this change has a mistake in it. In some cases, I get an exception in Firebug when mousing around the compose window in webtop:

$1.mouseevent is not a function
anonymous(Object owner=view name: icon uid=511 __LZdiv=div.lzdiv, "onmouseout")LFCdhtml.js (line 8784) anonymous("onmouseout", Object owner=view name: icon uid=511 __LZdiv=div.lzdiv)LFCdhtml.js (line 8807) anonymous("onmouseout", Object owner=view name: icon uid=511 __LZdiv=div.lzdiv)LFCdhtml.js (line 1438)
anonymous(mouseout clientX=289, clientY=92)LFCdhtml.js (line 1665)
[Break on this error] }};$1.mouseevent($2);if($2=="onmousedown") {\nLFCdhtml.js (line 8784)

I tracked this down to this line in LzSprite.js#div.onmouseout = function(e) which was put in by you as part of r14496:

LzMouseKernel.__sendEvent('onmouseout', e.target.owner);

You can't rely on the event object having a target, much less an owner that's a view. This is causing an exception later when the ModeManager tries to call the mouseevent() method on a view that doesn't exist. Also, you may want to use the 'el' property from the top of the method for this to work in IE.

Please test for valid target/owner properties before sending the event - and make sure it works in IE as well. Remember, the mouse may be moving over divs that aren't owned by OL, e.g. the iframe that contains the rich text editor.

[email protected] wrote:
Author: ptw
Date: 2009-08-17 14:04:01 -0700 (Mon, 17 Aug 2009)
New Revision: 14496
Modified:
  openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
  openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20090817-ptw-i by [email protected] on 2009-08-17 10:37:40 EDT
   in /Users/ptw/OpenLaszlo/trunk-2
   for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Correct mouseover/mouseout behavior for clickdivs
Bugs Fixed: LPP-8375 onmouseout even on HTML component is firing onmouseover, not onmouseout Technical Reviewer: max (Message-ID: <[email protected] >)
QA Reviewer: [email protected] (pending)
Details:
   If the fix_clickable quirk is on, ignore mouseover/mouseout events
   that get sent when clickdivs are disabled, because they are
   redundant.  Similarly, when clickdivs are re-enabled by a global
   mouseout event, synthesize a mouseout to the now re-enabled view.
Tests:
   Test case from bug report
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/ LzMouseKernel.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2009-08-17 18:28:41 UTC (rev 14495) +++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2009-08-17 21:04:01 UTC (rev 14496)
@@ -204,8 +204,10 @@
        }
    }
    ,__cachedSelection: null
+    ,__globalClickable: true
    ,setGlobalClickable: function (isclickable){
        var el = document.getElementById('lzcanvasclickdiv');
+        this.__globalClickable = isclickable;
        el.style.display = isclickable ? '' : 'none';
    }
    ,__sendMouseMove: function(e, offsetx, offsety) {
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-08-17 18:28:41 UTC (rev 14495) +++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-08-17 21:04:01 UTC (rev 14496)
@@ -163,6 +163,7 @@
                    }
                }
                if (mousein) {
+ var wasClickable = LzMouseKernel.__globalClickable;
                    if (quirks.fix_ie_clickable) {
                        LzMouseKernel.setGlobalClickable(true);
                    }
@@ -177,6 +178,13 @@
                    LzMouseKernel.setMouseControl(true);
                    LzMouseKernel.__resetMouse();
                    this.mouseisover = true;
+ if (quirks.fix_clickable && (! wasClickable) && LzMouseKernel.__globalClickable) {
+                        // NOTE: [2008-08-17 ptw] (LPP-8375) Forward
+                        // the event to the view, if it would have
+                        // gotten it without the quirk clickability
+                        // diddling
+ LzMouseKernel.__sendEvent('onmouseout', e.target.owner);
+                    }
                } else {
                    if (quirks.focus_on_mouseover) {
if (LzInputTextSprite.prototype.__lastshown == null) {
@@ -1370,6 +1378,21 @@
            }
        }
+ if (this.quirks.fix_clickable && (! LzMouseKernel.__globalClickable)) {
+            // NOTE: [2008-08-17 ptw] (LPP-8375) When the mouse goes
+            // over an html clickdiv, globalClickable gets disabled,
+            // which generates a mouseout -- we want to ignore that.
+ // Simlutaneously, the mouse enters the associated iframe,
+            // which will forward a mouseover to us, but we already
+            // got one, so, we want to ignore that too.  The global
+            // mouseout handler will synthesize a mouseout event for
+            // the html sprite when the mouse leaves the iframe and
+            // re-enables the clickdiv.
+ if ((eventname == 'onmouseout') || (eventname == 'onmouseover')) {
+                return;
+            }
+        }
+
        LzMouseKernel.__sendEvent(eventname, this.owner);
    }
}
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

--
Regards,
Max Carlson
OpenLaszlo.org

Reply via email to