| 566 | function getParent (el) { return el.parentNode === doc ? null : el.parentNode; } |
| 567 | function isInput (el) { return el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable(el); } |
| 568 | function isEditable (el) { |
| 569 | if (!el) { return false; } // no parents were editable |
| 570 | if (el.contentEditable === 'false') { return false; } // stop the lookup |
| 571 | if (el.contentEditable === 'true') { return true; } // found a contentEditable element in the chain |
| 572 | return isEditable(getParent(el)); // contentEditable is set to 'inherit' |
| 573 | } |
| 574 | |
| 575 | function nextEl (el) { |
| 576 | return el.nextElementSibling || manually(); |