return ":lang(" + c.getLang() + ")";
@Override public boolean isCondition(WebDriver driver, WebElement element, ArgumentMap argumentMap, Selector selectorUpToThisPoint, LangCondition langCondition) { String wantedLangIndex = langCondition.getLang(); String wantedLang = argumentMap.get(wantedLangIndex); return wantedLang.equals(SelectorUtils.lang(element)); }
@Override public boolean isCondition(WebDriver driver, WebElement element, ArgumentMap argumentMap, Selector selectorUpToThisPoint, LangCondition langCondition) { String wantedLangIndex = langCondition.getLang(); String wantedLang = argumentMap.get(wantedLangIndex); return wantedLang.equals(SelectorUtils.lang(element)); }
@Override public ConditionSimpleComponent conditionToXPath(ArgumentMap argumentMap, Selector simpleSelector, LangCondition langCondition) { String wantedLangIndex = langCondition.getLang(); String wantedLang = argumentMap.get(wantedLangIndex); return new ConditionSimpleComponent("[ancestor-or-self::*[@lang][1]/@lang = '" + wantedLang + "']"); }
@Override public ConditionSimpleComponent conditionToXPath(ArgumentMap argumentMap, Selector simpleSelector, LangCondition langCondition) { String wantedLangIndex = langCondition.getLang(); String wantedLang = argumentMap.get(wantedLangIndex); return new ConditionSimpleComponent("[ancestor-or-self::*[@lang][1]/@lang = '" + wantedLang + "']"); }
final LangCondition lc = (LangCondition) condition; for (DomNode node = element; node instanceof HtmlElement; node = node.getParentNode()) { if (((HtmlElement) node).getAttribute("lang").startsWith(lc.getLang())) { return true;
final LangCondition lc = (LangCondition) condition; for (DomNode node = element; node instanceof HtmlElement; node = node.getParentNode()) { if (((HtmlElement) node).getAttribute("lang").startsWith(lc.getLang())) { return true;
final LangCondition lc = (LangCondition) condition; for (DomNode node = element; node instanceof HtmlElement; node = node.getParentNode()) { if (((HtmlElement) node).getAttribute("lang").startsWith(lc.getLang())) { return true;
return ":lang(" + c.getLang() + ")";
return ":lang(" + c.getLang() + ")";