return ctx.querySelectorAll(selector);\r
}-*/;\r
\r
+ public static native NodeList<Element> elementsByTagName(String selector,\r
+ Node ctx) /*-{\r
+ return ctx.getElementsByTagName(selector);\r
+ }-*/;\r
+ \r
+ public static native NodeList<Element> elementsByClassName(String selector,\r
+ Node ctx) /*-{\r
+ return ctx.getElementsByClassName(selector);\r
+ }-*/;\r
+ \r
public static NodeList<Element> veryQuickId(String id, Node ctx) {\r
Document d = ctx.getNodeType() == Node.DOCUMENT_NODE\r
? ctx.<Document> cast() : ctx.getOwnerDocument();\r
if (selector.matches("#[\\w\\-]+")) {\r
sw.println("return "\r
+ wrap(method, "veryQuickId(\"" + selector.substring(1) + "\", root)") + ";");\r
+ } else if (selector.equals("*") || selector.matches("[\\w\\-]+")) {\r
+ sw.println("return "\r
+ + wrap(method, "elementsByTagName(\"" + selector + "\", root)") + ";");\r
+ } else if (selector.matches("\\.[\\w\\-]+")) {\r
+ sw.println("return "\r
+ + wrap(method, "elementsByClassName(\"" + selector.substring(1) + "\", root)") + ";");\r
} else if (selector.contains("!=")) {\r
sw.println("return "\r
+ wrap(method, "querySelectorAll(\"" \r
if (selector.matches("#[\\w\\-]+")) {\r
sw.println("return "\r
+ wrap(method, "veryQuickId(\"" + selector.substring(1) + "\", root)") + ";");\r
+ } else if (selector.equals("*") || selector.matches("[\\w\\-]+")) {\r
+ sw.println("return "\r
+ + wrap(method, "elementsByTagName(\"" + selector + "\", root)") + ";");\r
+ } else if (selector.matches("\\.[\\w\\-]+")) {\r
+ sw.println("return "\r
+ + wrap(method, "elementsByClassName(\"" + selector.substring(1) + "\", root)") + ";");\r
} else if (selector.matches(SelectorEngineNativeIE8.NATIVE_EXCEPTIONS_REGEXP)) {\r
super.generateMethodBody(sw, method, treeLogger, hasContext);\r
} else {\r
if (selector.matches("#[\\w\\-]+")) {\r
sw.println("return "\r
+ wrap(method, "veryQuickId(\"" + selector.substring(1) + "\", root)") + ";");\r
+ } else if (selector.equals("*") || selector.matches("[\\w\\-]+")) {\r
+ sw.println("return "\r
+ + wrap(method, "elementsByTagName(\"" + selector + "\", root)") + ";");\r
+ } else if (selector.matches("\\.[\\w\\-]+")) {\r
+ sw.println("return "\r
+ + wrap(method, "elementsByClassName(\"" + selector.substring(1) + "\", root)") + ";");\r
} else if (selector.matches(SelectorEngineNative.NATIVE_EXCEPTIONS_REGEXP)) {\r
super.generateMethodBody(sw, method, treeLogger, hasContext);\r
} else {\r
\r
@Override\r
protected String getImplSuffix() {\r
- return "IE8" + super.getImplSuffix();\r
+ return "IE9" + super.getImplSuffix();\r
}\r
\r
@Override\r