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

Side by Side Diff: LayoutTests/editing/editing.js

Issue 19888007: Bold and Italic style get stuck when applied on a selection having content with mixed editability (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bold and Italic style get stuck when applied on a selection having content with mixed editability Created 7 years, 4 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 | LayoutTests/editing/style/toggle-style-bold-italic.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 //------------------------------------------------------------------------------ ------------------------- 1 //------------------------------------------------------------------------------ -------------------------
2 // Java script library to run editing layout tests 2 // Java script library to run editing layout tests
3 3
4 var commandCount = 1; 4 var commandCount = 1;
5 var commandDelay = window.location.search.substring(1); 5 var commandDelay = window.location.search.substring(1);
6 if (commandDelay == '') 6 if (commandDelay == '')
7 commandDelay = 0; 7 commandDelay = 0;
8 var selection = window.getSelection(); 8 var selection = window.getSelection();
9 9
10 //------------------------------------------------------------------------------ ------------------------- 10 //------------------------------------------------------------------------------ -------------------------
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 if (window.testRunner) 897 if (window.testRunner)
898 testRunner.dumpEditingCallbacks(); 898 testRunner.dumpEditingCallbacks();
899 899
900 var elem = document.getElementById("test"); 900 var elem = document.getElementById("test");
901 var selection = window.getSelection(); 901 var selection = window.getSelection();
902 selection.setPosition(elem, 0); 902 selection.setPosition(elem, 0);
903 editingTest(); 903 editingTest();
904 } 904 }
905 905
906 var dumpAsText = false; 906 var dumpAsText = false;
907 var markupResultList = document.createElement('ol'); 907 var elementsForDumpingMarkupList = [document.createElement('ol')];
908 908
909 function runDumpAsTextEditingTest(enableCallbacks) { 909 function runDumpAsTextEditingTest(enableCallbacks) {
910 if (window.testRunner) { 910 if (window.testRunner) {
911 testRunner.dumpAsText(); 911 testRunner.dumpAsText();
912 if (enableCallbacks) 912 if (enableCallbacks)
913 testRunner.dumpEditingCallbacks(); 913 testRunner.dumpEditingCallbacks();
914 } 914 }
915 915
916 dumpAsText = true; 916 dumpAsText = true;
917 917
918 var elem = document.getElementById("test"); 918 var elem = document.getElementById("test");
919 var selection = window.getSelection(); 919 var selection = window.getSelection();
920 selection.setPosition(elem, 0); 920 selection.setPosition(elem, 0);
921 editingTest(); 921 editingTest();
922 922
923 document.body.appendChild(markupResultList); 923 for (var i = 0; i < elementsForDumpingMarkupList.length; i++)
924 document.body.appendChild(elementsForDumpingMarkupList[i]);
924 } 925 }
925 926
926 function debugForDumpAsText(name) { 927 function debugForDumpAsText(name) {
927 if (dumpAsText && document.getElementById("root")) { 928 if (dumpAsText && document.getElementById("root")) {
928 var newItem = document.createElement('li'); 929 var newItem = document.createElement('li');
929 newItem.appendChild(document.createTextNode(name+": "+document.getElemen tById("root").innerHTML)); 930 newItem.appendChild(document.createTextNode(name+": "+document.getElemen tById("root").innerHTML));
930 markupResultList.appendChild(newItem); 931 elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].ap pendChild(newItem);
931 } 932 }
932 } 933 }
933 934
935 function startNewMarkupGroup(label) {
936 if (!elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].h asChildNodes())
937 elementsForDumpingMarkupList.pop();
938 elementsForDumpingMarkupList.push(document.createElement('br'));
939 elementsForDumpingMarkupList.push(document.createTextNode(label));
940 elementsForDumpingMarkupList.push(document.createElement('ol'));
941 }
942
934 //------------------------------------------------------------------------------ ------------------------- 943 //------------------------------------------------------------------------------ -------------------------
935 944
936 945
937 function execBackColorCommand() { 946 function execBackColorCommand() {
938 document.execCommand("BackColor", false, "Chartreuse"); 947 document.execCommand("BackColor", false, "Chartreuse");
939 debugForDumpAsText('execBackColorCommand'); 948 debugForDumpAsText('execBackColorCommand');
940 } 949 }
941 function backColorCommand() { 950 function backColorCommand() {
942 if (commandDelay > 0) { 951 if (commandDelay > 0) {
943 queueCommand(execBackColorCommand, commandCount * commandDelay); 952 queueCommand(execBackColorCommand, commandCount * commandDelay);
(...skipping 27 matching lines...) Expand all
971 function executeCommand(command,arg1,arg2) { 980 function executeCommand(command,arg1,arg2) {
972 if (commandDelay > 0) { 981 if (commandDelay > 0) {
973 queueCommand(runCommand, commandCount * commandDelay); 982 queueCommand(runCommand, commandCount * commandDelay);
974 commandCount++; 983 commandCount++;
975 } 984 }
976 else { 985 else {
977 runCommand(command,arg1,arg2); 986 runCommand(command,arg1,arg2);
978 } 987 }
979 } 988 }
980 989
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/style/toggle-style-bold-italic.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698