MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / getTabIndex

Method getTabIndex

src/main/java/org/htmlunit/html/HtmlElement.java:447–462  ·  view source on GitHub ↗

Returns this element's tab index, if it has one. If the tab index is outside the valid range (less than 0 or greater than 32767 ), this method returns #TAB_INDEX_OUT_OF_BOUNDS. If this element does not have a tab index, or its tab index is otherwise invalid, this met

()

Source from the content-addressed store, hash-verified

445 * @return this element's tab index
446 */
447 public Short getTabIndex() {
448 final String index = getAttributeDirect("tabindex");
449 if (index == null || index.isEmpty()) {
450 return null;
451 }
452 try {
453 final long l = Long.parseLong(index);
454 if (l >= 0 && l <= Short.MAX_VALUE) {
455 return Short.valueOf((short) l);
456 }
457 return TAB_INDEX_OUT_OF_BOUNDS;
458 }
459 catch (final NumberFormatException e) {
460 return null;
461 }
462 }
463
464 /**
465 * Returns the first element with the specified tag name that is an ancestor to this element, or

Callers 6

handlesMethod · 0.95
clickMethod · 0.45
focusMethod · 0.45
getTabbableElementsMethod · 0.45

Calls 2

getAttributeDirectMethod · 0.80
isEmptyMethod · 0.65

Tested by

no test coverage detected