static void pseudoClassNotSupportedWhenUsedDirectly(String pseudoClass) { throw new PseudoClassOnlySupportedThroughIsOrFilterException(pseudoClass); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(ONLY_OF_TYPE_PSEUDO_CLASS_NO_COLON); // we haven't implemented this using XPath yet... return new ConditionSimpleComponent(onlyOfTypePseudoClassFilter); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(ONLY_OF_TYPE_PSEUDO_CLASS_NO_COLON); // we haven't implemented this using XPath yet... return new ConditionSimpleComponent(onlyOfTypePseudoClassFilter); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(CHECKED_PSEUDO_CLASS_NO_COLON); // NOTE: This XPath does not work. Sometimes an element is checked WITHOUT having a checked attribute return new ConditionSimpleComponent("[" + "(" + "(self::input and (@type = 'radio' or @type = 'checkbox') and @checked) " + "or " + "(" + SELECTED_PSEUDO_CONDITION + ")" + ")" + "]"); }
static void pseudoClassNotSupportedWhenUsedDirectly(String pseudoClass) { throw new PseudoClassOnlySupportedThroughIsOrFilterException(pseudoClass); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(FOCUSABLE_PSEUDO_CLASS_NO_COLON); // after filtering with XPath, we still have to check visibility (filter)... return new ConditionSimpleComponent("[" + FOCUSABLE_XPATH + "]", focusablePseudoClassFilter); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(VISIBLE_PSEUDO_CLASS_NO_COLON); // we can't use XPath because it can't see the styles affecting the element's classes, which can pretty much // turn any element, including <html> itself or <head>, visible. return new ConditionSimpleComponent(VISIBLE_FILTER); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(HIDDEN_PSEUDO_CLASS_NO_COLON); // we can't use XPath because it can't see the styles affecting the element's classes, which can pretty much // turn any element, including <html> itself or <head>, visible. return new ConditionSimpleComponent(HIDDEN_FILTER); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(CHECKED_PSEUDO_CLASS_NO_COLON); // NOTE: This XPath does not work. Sometimes an element is checked WITHOUT having a checked attribute return new ConditionSimpleComponent("[" + "(" + "(self::input and (@type = 'radio' or @type = 'checkbox') and @checked) " + "or " + "(" + SELECTED_PSEUDO_CONDITION + ")" + ")" + "]"); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(VISIBLE_PSEUDO_CLASS_NO_COLON); // we can't use XPath because it can't see the styles affecting the element's classes, which can pretty much // turn any element, including <html> itself or <head>, visible. return new ConditionSimpleComponent(VISIBLE_FILTER); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(FOCUSABLE_PSEUDO_CLASS_NO_COLON); // after filtering with XPath, we still have to check visibility (filter)... return new ConditionSimpleComponent("[" + FOCUSABLE_XPATH + "]", focusablePseudoClassFilter); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(TABBABLE_PSEUDO_CLASS_NO_COLON); // :tabbable is not fully XPath supported (if the 'display:none' is in a CSS class, it won't know)!!! return new ConditionSimpleComponent("[(" + FocusablePseudoClass.FOCUSABLE_XPATH + " and (not(@tabindex) or @tabindex > -1))]", tabbablePseudoClassFilter); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(FOCUS_PSEUDO_CLASS_NO_COLON); // there is no XPath construct for checking focus... return new ConditionSimpleComponent(FOCUS_FILTER); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(SELECTED_PSEUDO_CLASS_NO_COLON); return new ConditionSimpleComponent(SELECTED_PSEUDO_CONDITIONAL_EXPRESSION); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(FOCUS_PSEUDO_CLASS_NO_COLON); // there is no XPath construct for checking focus... return new ConditionSimpleComponent(FOCUS_FILTER); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(SELECTED_PSEUDO_CLASS_NO_COLON); return new ConditionSimpleComponent(SELECTED_PSEUDO_CONDITIONAL_EXPRESSION); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(TABBABLE_PSEUDO_CLASS_NO_COLON); // :tabbable is not fully XPath supported (if the 'display:none' is in a CSS class, it won't know)!!! return new ConditionSimpleComponent("[(" + FocusablePseudoClass.FOCUSABLE_XPATH + " and (not(@tabindex) or @tabindex > -1))]", tabbablePseudoClassFilter); }
@Override public ConditionSimpleComponent pseudoClassToXPath(PseudoClassSelector pseudoClassSelector) { pseudoClassNotSupportedWhenUsedDirectly(HIDDEN_PSEUDO_CLASS_NO_COLON); // we can't use XPath because it can't see the styles affecting the element's classes, which can pretty much // turn any element, including <html> itself or <head>, visible. return new ConditionSimpleComponent(HIDDEN_FILTER); }