MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / cssEscape

Method cssEscape

java/src/org/openqa/selenium/By.java:449–459  ·  view source on GitHub ↗
(String using)

Source from the content-addressed store, hash-verified

447 }
448
449 private String cssEscape(String using) {
450 using = CSS_ESCAPE.matcher(using).replaceAll("\\\\$1");
451 // CSS only requires the leading-digit escape for ASCII 0-9; non-ASCII Unicode digits
452 // (e.g. Arabic-Indic, fullwidth) are already valid identifier-start code points and must
453 // be left untouched, or they collide with the escape for a different ASCII digit.
454 char first = using.isEmpty() ? '\0' : using.charAt(0);
455 if (first >= '0' && first <= '9') {
456 using = "\\" + (30 + Integer.parseInt(using.substring(0, 1))) + " " + using.substring(1);
457 }
458 return using;
459 }
460 }
461}

Callers 1

PreW3CLocatorMethod · 0.95

Calls 2

charAtMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected