| 940 | test_enlarge_list1 : function() |
| 941 | { |
| 942 | var range = getRange( 'S1', null ); |
| 943 | range.enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ); |
| 944 | |
| 945 | assert.areSame( document.getElementById( '_EnlargeP7' ), range.startContainer.$, 'range.startContainer' ); |
| 946 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 947 | assert.areSame( document.getElementById( '_EnlargeP7' ), range.endContainer.$, 'range.endContainer' ); |
| 948 | assert.areSame( 3, range.endOffset, 'range.endOffset' ); |
| 949 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 950 | }, |
| 951 | |
| 952 | test_enlarge_list2 : function() |
| 953 | { |
| 954 | var range = getRange( 'S2', 'E2' ); |
| 955 | range.enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ); |
| 956 | |
| 957 | assert.areSame( document.getElementById( '_EnlargeP8' ), range.startContainer.$, 'range.startContainer' ); |
| 958 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 959 | assert.areSame( document.getElementById( '_EnlargeP8' ), range.endContainer.$, 'range.endContainer' ); |
| 960 | assert.areSame( 4, range.endOffset, 'range.endOffset' ); |
| 961 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 962 | }, |
| 963 | |
| 964 | test_enlarge_list3 : function() |
| 965 | { |
| 966 | var range = getRange( 'S3', null ); |
| 967 | range.enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ); |
| 968 | |
| 969 | assert.areSame( document.getElementById( '_EnlargeP9' ), range.startContainer.$, 'range.startContainer' ); |
| 970 | assert.areSame( 2, range.startOffset, 'range.startOffset' ); |
| 971 | assert.areSame( document.getElementById( '_EnlargeP9' ), range.endContainer.$, 'range.endContainer' ); |
| 972 | assert.areSame( 3, range.endOffset, 'range.endOffset' ); |
| 973 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 974 | }, |
| 975 | |
| 976 | test_enlarge_list4 : function() |
| 977 | { |
| 978 | var range = getRange( 'S4', null ); |
| 979 | range.enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ); |
| 980 | |
| 981 | assert.areSame( document.getElementById( '_EnlargeP10' ), range.startContainer.$, 'range.startContainer' ); |
| 982 | assert.areSame( 3, range.startOffset, 'range.startOffset' ); |
| 983 | assert.areSame( document.getElementById( '_EnlargeP10' ), range.endContainer.$, 'range.endContainer' ); |
| 984 | assert.areSame( 5, range.endOffset, 'range.endOffset' ); |
| 985 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 986 | }, |
| 987 | |
| 988 | test_enlarge_list5 : function() |
| 989 | { |
| 990 | var range = getRange( 'S9', null ); |
| 991 | var bookmark = range.createBookmark(); |
| 992 | range.enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ); |
| 993 | |
| 994 | assert.areSame( document.getElementById( '_EnlargeP15' ), range.startContainer.$, 'range.startContainer' ); |
| 995 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 996 | assert.areSame( document.getElementById( '_EnlargeP15' ), range.endContainer.$, 'range.endContainer' ); |
| 997 | assert.areSame( 4, range.endOffset, 'range.endOffset' ); |
| 998 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 999 | range.moveToBookmark( bookmark ); |
| 1000 | }, |
| 1001 | |
| 1002 | test_enlarge_block1 : function() |
| 1003 | { |
| 1004 | var range = getRange( 'S5', null ); |
| 1005 | range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); |
| 1006 | |
| 1007 | assert.areSame( document.getElementById( '_EnlargeP11' ), range.startContainer.$, 'range.startContainer' ); |
| 1008 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 1009 | assert.areSame( document.getElementById( '_EnlargeP11'), range.endContainer.$, 'range.endContainer' ); |
| 1010 | assert.areSame( 5, range.endOffset, 'range.endOffset' ); |
| 1011 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 1012 | }, |
| 1013 | |
| 1014 | test_enlarge_block2 : function() |
| 1015 | { |
| 1016 | var range = getRange( 'S10', null ); |
| 1017 | var bookmark = range.createBookmark(); |
| 1018 | range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); |
| 1019 | |
| 1020 | assert.areSame( document.getElementById( '_EnlargeP16' ), range.startContainer.$, 'range.startContainer' ); |
| 1021 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 1022 | assert.areSame( document.getElementById( '_EnlargeP16'), range.endContainer.$, 'range.endContainer' ); |
| 1023 | assert.areSame( 5, range.endOffset, 'range.endOffset' ); |
| 1024 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 1025 | range.moveToBookmark( bookmark ); |
| 1026 | }, |
| 1027 | |
| 1028 | test_enlarge_block3 : function() |
| 1029 | { |
| 1030 | var range = getRange( 'S6', null ); |
| 1031 | range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); |
| 1032 | |
| 1033 | assert.areSame( document.getElementById( '_EnlargeP12' ), range.startContainer.$, 'range.startContainer' ); |
| 1034 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 1035 | assert.areSame( document.getElementById( '_EnlargeP12'), range.endContainer.$, 'range.endContainer' ); |
| 1036 | assert.areSame( 2, range.endOffset, 'range.endOffset' ); |
| 1037 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 1038 | }, |
| 1039 | |
| 1040 | test_enlarge_block4 : function() |
| 1041 | { |
| 1042 | var range = getRange( 'S7', null ); |
| 1043 | range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); |
| 1044 | |
| 1045 | assert.areSame( document.getElementById( '_EnlargeP13' ), range.startContainer.$, 'range.startContainer' ); |
| 1046 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 1047 | assert.areSame( document.getElementById( '_EnlargeP13'), range.endContainer.$, 'range.endContainer' ); |
| 1048 | assert.areSame( 2, range.endOffset, 'range.endOffset' ); |
| 1049 | assert.isFalse( range.collapsed, 'range.collapsed' ); |
| 1050 | }, |
| 1051 | |
| 1052 | test_enlarge_block5 : function() |
| 1053 | { |
| 1054 | var range = getRange( 'S8', null ); |
| 1055 | range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); |
| 1056 | |
| 1057 | assert.areSame( document.getElementById( '_EnlargeP14' ), range.startContainer.$, 'range.startContainer' ); |
| 1058 | assert.areSame( 0, range.startOffset, 'range.startOffset' ); |
| 1059 | range.isTrue( range.collapsed, 'range.collapsed' ); |
| 1060 | }, |
| 1061 | |