01: /*
02: * MyGWT Widget Library
03: * Copyright(c) 2007, MyGWT.
04: * licensing@mygwt.net
05: *
06: * http://mygwt.net/license
07: */
08: package net.mygwt.ui.client.impl;
09:
10: import com.google.gwt.user.client.Element;
11:
12: public class MyDOMImpl {
13:
14: public native String getStyle(Element elem, String property) /*-{
15: var value = null;
16: var computed = $wnd.document.defaultView.getComputedStyle(elem, '');
17: if (computed) { // test computed before touching for safari
18: value = computed[property];
19: }
20: return elem.style[property] || value || null;
21: }-*/;
22:
23: public native void setStyle(Element elem, String property,
24: String value) /*-{
25: elem.style[property] = value;
26: }-*/;
27:
28: }
|