OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <script src="../resources/run-after-layout-and-paint.js"></script> |
| 3 <!-- Text is injected after page load into the center of the initial text. |
| 4 This results in an InlineTextBox with start() > 0, which allows testing |
| 5 to make sure composition underlines are still painted in the right place. --> |
| 6 <div id="markSplit">abc def</div> |
| 7 <div id="markSplitTruncated" style="white-space: nowrap; overflow: hidden; text-
overflow: ellipsis; width: 8em;">abcdefghi jklmnopqr</div> |
| 8 <script> |
| 9 function injectText(node, offset) { |
| 10 var textNode = node.firstChild; |
| 11 var replacementNode = textNode.splitText(offset); |
| 12 var newTextNode = document.createTextNode(' xxx '); |
| 13 node.insertBefore(newTextNode, replacementNode); |
| 14 } |
| 15 |
| 16 function highlightRange(node) { |
| 17 var range = document.createRange(); |
| 18 var textNode = node.childNodes[2]; |
| 19 range.setStart(textNode, 0); |
| 20 range.setEnd(textNode, 4); |
| 21 if (typeof internals !== 'undefined') |
| 22 internals.addActiveSuggestionMarker(range, 'orange', 'thin', 'lightBlue'
); |
| 23 } |
| 24 |
| 25 onload = runAfterLayoutAndPaint(function() { |
| 26 injectText(markSplit, 3); |
| 27 // TODO(wkorman): This ITB has start=1, end=3, truncation=USHRT_MAX, len=3. |
| 28 // Validate that the actual painting behavior is what's expected. |
| 29 highlightRange(markSplit); |
| 30 |
| 31 injectText(markSplitTruncated, 9); |
| 32 // TODO(wkorman): This ITB has start=1, end=9, truncation=3, len=9. Validate |
| 33 // that the actual painting behavior is what's expected. |
| 34 highlightRange(markSplitTruncated); |
| 35 }, true); |
| 36 </script> |
OLD | NEW |