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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/composition-marker-basic.html

Issue 2906953002: [DMC #26] Add CompositionMarker::Thickness enum (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/composition-marker-split.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <script src="../resources/run-after-layout-and-paint.js"></script> 2 <script src="../resources/run-after-layout-and-paint.js"></script>
3 <!-- Tests various permutations of composition underlines in LTR and RTL text. 3 <!-- Tests various permutations of composition underlines in LTR and RTL text.
4 These are normally used by foreign language IME (Input Method Extension). --> 4 These are normally used by foreign language IME (Input Method Extension). -->
5 <div dir="rtl" style="float: right;"> 5 <div dir="rtl" style="float: right;">
6 <p>RTL</p> 6 <p>RTL</p>
7 <div id="markRtlAll" dir="rtl">abcdef</div> 7 <div id="markRtlAll" dir="rtl">abcdef</div>
8 <div id="markRtlAllThick">abcdef</div> 8 <div id="markRtlAllThick">abcdef</div>
9 <div id="markRtlBeginning">abcdef</div> 9 <div id="markRtlBeginning">abcdef</div>
10 <div id="markRtlAllExceptFirstAndLast">abcdef</div> 10 <div id="markRtlAllExceptFirstAndLast">abcdef</div>
(...skipping 18 matching lines...) Expand all
29 function highlightRange(elem, start, end, underlineColor, thick, backgroundColor ) { 29 function highlightRange(elem, start, end, underlineColor, thick, backgroundColor ) {
30 var range = document.createRange(); 30 var range = document.createRange();
31 var textNode = elem.firstChild; 31 var textNode = elem.firstChild;
32 range.setStart(textNode, start); 32 range.setStart(textNode, start);
33 range.setEnd(textNode, end); 33 range.setEnd(textNode, end);
34 if (typeof internals !== 'undefined') 34 if (typeof internals !== 'undefined')
35 internals.addCompositionMarker(range, underlineColor, thick, backgroundC olor); 35 internals.addCompositionMarker(range, underlineColor, thick, backgroundC olor);
36 }; 36 };
37 37
38 function highlightRangeSimple(elem, start, end) { 38 function highlightRangeSimple(elem, start, end) {
39 highlightRange(elem, start, end, 'orange', false, 'lightBlue'); 39 highlightRange(elem, start, end, 'orange', 'thin', 'lightBlue');
40 }; 40 };
41 41
42 function highlightAcrossNodes(startNode, start, endNode, end) { 42 function highlightAcrossNodes(startNode, start, endNode, end) {
43 var range = document.createRange(); 43 var range = document.createRange();
44 range.setStart(startNode, start); 44 range.setStart(startNode, start);
45 range.setEnd(endNode, end); 45 range.setEnd(endNode, end);
46 if (typeof internals !== 'undefined') 46 if (typeof internals !== 'undefined')
47 internals.addCompositionMarker(range, 'orange', false, 'lightBlue'); 47 internals.addCompositionMarker(range, 'orange', 'thin', 'lightBlue');
48 }; 48 };
49 49
50 onload = runAfterLayoutAndPaint(function() { 50 onload = runAfterLayoutAndPaint(function() {
51 highlightRangeSimple(markAll, 0, 6); 51 highlightRangeSimple(markAll, 0, 6);
52 highlightRange(markAllThick, 0, 6, 'orange', true, 'lightBlue'); 52 highlightRange(markAllThick, 0, 6, 'orange', 'thick', 'lightBlue');
53 highlightRange(markAllDifferentColors, 0, 6, 'purple', true, 'lightYellow'); 53 highlightRange(markAllDifferentColors, 0, 6, 'purple', 'thick', 'lightYellow ');
54 highlightRangeSimple(markBeginning, 0, 3); 54 highlightRangeSimple(markBeginning, 0, 3);
55 highlightRangeSimple(markAllExceptFirstAndLast, 1, 5); 55 highlightRangeSimple(markAllExceptFirstAndLast, 1, 5);
56 highlightRangeSimple(markEnd, 3, 6); 56 highlightRangeSimple(markEnd, 3, 6);
57 highlightRangeSimple(markNothingZero, 0, 0); 57 highlightRangeSimple(markNothingZero, 0, 0);
58 highlightRangeSimple(markNothingEnd, 6, 6); 58 highlightRangeSimple(markNothingEnd, 6, 6);
59 59
60 highlightRangeSimple(markRtlAll, 0, 6); 60 highlightRangeSimple(markRtlAll, 0, 6);
61 highlightRange(markRtlAllThick, 0, 6, 'orange', true, 'lightBlue'); 61 highlightRange(markRtlAllThick, 0, 6, 'orange', 'thick', 'lightBlue');
62 highlightRangeSimple(markRtlBeginning, 0, 3); 62 highlightRangeSimple(markRtlBeginning, 0, 3);
63 highlightRangeSimple(markRtlAllExceptFirstAndLast, 1, 5); 63 highlightRangeSimple(markRtlAllExceptFirstAndLast, 1, 5);
64 highlightRangeSimple(markRtlEnd, 3, 6); 64 highlightRangeSimple(markRtlEnd, 3, 6);
65 65
66 highlightAcrossNodes(markAcrossNodes.childNodes[0].firstChild, 3, 66 highlightAcrossNodes(markAcrossNodes.childNodes[0].firstChild, 3,
67 markAcrossNodes.childNodes[1].firstChild, 3); 67 markAcrossNodes.childNodes[1].firstChild, 3);
68 highlightAcrossNodes(markRtlAcrossNodes.childNodes[0].firstChild, 3, 68 highlightAcrossNodes(markRtlAcrossNodes.childNodes[0].firstChild, 3,
69 markRtlAcrossNodes.childNodes[1].firstChild, 3); 69 markRtlAcrossNodes.childNodes[1].firstChild, 3);
70 }, true); 70 }, true);
71 </script> 71 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/composition-marker-split.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698