Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/LayoutTests/editing/active-suggestion-marker-split.html

Issue 2925543003: [ActiveSuggestionMarker #3] Add painting for ActiveSuggestionMarker (Closed)
Patch Set: marker_with_formatting => styleable_marker Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698