| 511 | |
| 512 | // W3C internals |
| 513 | function nextnode (node, root){ |
| 514 | // in-order traversal |
| 515 | // we've already visited node, so get kids then siblings |
| 516 | if (node.firstChild) return node.firstChild; |
| 517 | if (node.nextSibling) return node.nextSibling; |
| 518 | if (node===root) return null; |
| 519 | while (node.parentNode){ |
| 520 | // get uncles |
| 521 | node = node.parentNode; |
| 522 | if (node == root) return null; |
| 523 | if (node.nextSibling) return node.nextSibling; |
| 524 | } |
| 525 | return null; |
| 526 | } |
| 527 | function w3cmoveBoundary (rng, n, bStart, el){ |
| 528 | // move the boundary (bStart == true ? start : end) n characters forward, up to the end of element el. Forward only! |
| 529 | // if the start is moved after the end, then an exception is raised |