X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTrap.java;h=ea2ea9544fbcf31e73d8f33ddf213fa9e6e60b46;hb=bbfe17b34980e100bcf26ec0c0b1b3fde1992793;hp=c6c6a47bd166b783a8b110c2dd520b877d4275e3;hpb=a81a151e639664cb340cf3726f9e8b9c77d125fb;p=org.ibex.core.git diff --git a/src/org/xwt/Trap.java b/src/org/xwt/Trap.java index c6c6a47..ea2ea95 100644 --- a/src/org/xwt/Trap.java +++ b/src/org/xwt/Trap.java @@ -4,6 +4,7 @@ package org.xwt; import java.util.*; import org.xwt.js.*; import org.xwt.util.*; +import java.io.*; /** * This class encapsulates a single trap placed on a given node. The @@ -15,20 +16,31 @@ public class Trap { // Static Data ////////////////////////////////////////////////////////////// + private static JS.CompiledFunction cascadeHelper = null; + private static String cascadeHelperText = + "return function(q) { var ret = arguments.doTrap;" + + "if (ret != false && !arguments.didCascade) arguments.cascade = q; };"; + static { + try { + cascadeHelper = JS.parse("cascadeHelper", 1, new StringReader(cascadeHelperText)); + cascadeHelper = (JS.CompiledFunction)new JS.Context(cascadeHelper, null, null).resume(null); + } catch (Exception e) { + Log.log(Trap.class, e); + } + } + /** List of properties that cannot be trapped */ private static final Hash PROHIBITED = new Hash(120, 3); static { - // FIXME: review String[] p = new String[] { - "sizetoimage", "shrink", "hshrink", "vshrink", "x", "y", - "width", "height", "flex", "hflex", "vflex", "cols", + "shrink", "hshrink", "vshrink", "x", "y", + "width", "height", "flex", "colspan", "rowspan", "cols", "rows", "align", "invisible", "absolute", "globalx", "globaly", "minwidth", "minheight", "height", "width", "maxwidth", "maxheight", "numchildren", "hpad", "vpad", - "doublebuffered", "cursor", "mousex", "mousey", "xwt", - "static", "mouseinside", "root", "thisbox", "indexof", - "path" + "buffered", "cursor", "mousex", "mousey", + "mouseinside", "thisbox", "indexof", "path", "font", "fontsize" }; for(int i=0; i