windowData = JavaScriptObject.createObject().cast();\r
dataCache = JavaScriptObject.createObject().cast();\r
}\r
- item = item == window ? windowData : item;\r
+ item = item == window || item.getNodeName() == null? windowData : item;\r
if (item == null) {\r
return value;\r
}\r
*/\r
public int scrollLeft() {\r
Element e = get(0);\r
- if (e == window) {\r
+ if (e == window || e.getNodeName() == null) {\r
return Window.getScrollLeft();\r
} else if (e == (Node) document) {\r
return document.getScrollLeft();\r
*/\r
public GQuery scrollLeft(int left) {\r
for (Element e : elements()) {\r
- if (e == window || e == (Node) document) {\r
+ if (e == window || e.getNodeName() == null || e == (Node) document) {\r
Window.scrollTo(left, $(e).scrollTop());\r
} else {\r
e.setPropertyInt("scrollLeft", left);\r
*/\r
public int scrollTop() {\r
Element e = get(0);\r
- if (e == window) {\r
+ if (e == window || e.getNodeName() == null) {\r
return Window.getScrollTop();\r
} else if (e == (Node) document) {\r
return document.getScrollTop();\r
*/\r
public GQuery scrollTop(int top) {\r
for (Element e : elements()) {\r
- if (e == window || e == (Node) document) {\r
+ if (e == window || e.getNodeName() == null || e == (Node) document) {\r
Window.scrollTo($(e).scrollLeft(), top);\r
} else {\r
e.setPropertyInt("scrollTop", top);\r
windowData = JavaScriptObject.createObject().cast();\r
dataCache = JavaScriptObject.createObject().cast();\r
}\r
- item = item == window ? windowData : item;\r
+ item = item == window || item.getNodeName() == null? windowData : item;\r
int id = item.hashCode();\r
if (name != null) {\r
if (dataCache.exists(id)) {\r