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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/user-select/user-select-all-contenteditable.html

Issue 2120913002: [Editing][Regression] Contenteditable w/ "-webkit-user-select:all" should be editable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add selection test Created 4 years, 5 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/Source/core/dom/Node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype HTML>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <script src="../../assert_selection.js"></script>
5 <div id="log"></div>
6 <script>
7 test(function(){
yosin_UTC9 2016/07/08 09:30:50 It seems there are not test for HTMLElement.isCont
yoichio 2016/07/11 06:54:04 Done.
8 assert_selection(
9 '<div contenteditable="true" id="div" style="-webkit-user-select:all">fo o</div>',
10 selection => selection.collapse(selection.document.getElementById('div') , 0),
yosin_UTC9 2016/07/08 09:30:50 Please use other than zero or adding another test
yoichio 2016/07/11 06:54:04 Done.
11 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo</div>');
12 assert_selection(
13 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo</div>',
14 selection => selection.extend(selection.document.getElementById('div'), 1),
15 '<div contenteditable="true" id="div" style="-webkit-user-select:all">^f oo|</div>');
yosin_UTC9 2016/07/08 09:30:50 We should check attempting partial selection becom
yoichio 2016/07/11 06:54:04 Done.
16 assert_selection(
17 '<div contenteditable="true" id="div" style="-webkit-user-select:all">fo o</div>',
18 selection => {
19 var div = selection.document.getElementById('div');
20 selection.setBaseAndExtent(div, 0, div, 1);
21 },
22 '<div contenteditable="true" id="div" style="-webkit-user-select:all">^f oo|</div>');
23 assert_selection(
24 '<div contenteditable="true" id="div" style="-webkit-user-select:all">fo o</div>',
25 selection => {
26 var range = selection.document.createRange();
27 var div = selection.document.getElementById('div');
28 range.setStart(div, 0);
29 range.setEnd(div, 1);
30 selection.addRange(range);
31 },
32 '<div contenteditable="true" id="div" style="-webkit-user-select:all">^f oo|</div>');
33 assert_selection(
34 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo</div>',
35 selection => selection.modify('move', 'forward', 'character'),
36 '<div contenteditable="true" id="div" style="-webkit-user-select:all">f| oo</div>');
37 assert_selection(
38 '<div contenteditable="true" id="div" style="-webkit-user-select:all">f| oo</div>',
39 selection => selection.modify('move', 'backward', 'character'),
40 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo</div>');
41 assert_selection(
42 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo</div>',
43 selection => selection.modify('extend', 'forward', 'character'),
44 '<div contenteditable="true" id="div" style="-webkit-user-select:all">^f oo|</div>');
45 assert_selection(
46 '<div contenteditable="true" id="div" style="-webkit-user-select:all">fo o|</div>',
47 selection => selection.modify('extend', 'backward', 'character'),
48 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo^</div>');
49 },
50 'Selection API can edit in -webkit-user-select:all contenteditable element');
51
52 test(function(){
53 assert_selection(
54 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|f oo</div>',
55 selection => selection.document.execCommand('insertText', false, 'bar'),
56 '<div contenteditable="true" id="div" style="-webkit-user-select:all">ba r|foo</div>');
57 },
58 'Execcommand inserttext in -webkit-user-select:all contenteditable element');
59
60 test(function(){
yosin_UTC9 2016/07/11 01:38:41 Could you move this test case to another file to u
yoichio 2016/07/11 06:54:04 Done.
61 assert_selection(
62 '<div contenteditable="true" id="div" style="-webkit-user-select:all">ba r</div>',
63 selection => {
64 var div = selection.document.getElementById('div');
yosin_UTC9 2016/07/08 09:30:50 Please add assert_not_undefined(window.eventSende
yoichio 2016/07/11 06:54:04 Done.
65 eventSender.mouseMoveTo(selection.document.offsetLeft + div.offsetLe ft + 5, selection.document.offsetTop + div.offsetTop + 5);
66 eventSender.mouseDown();
67 eventSender.mouseUp();
68 eventSender.leapForward(100);
69 },
70 '<div contenteditable="true" id="div" style="-webkit-user-select:all">|b ar</div>');
71 },
72 'User can focus in -webkit-user-select:all contenteditable element');
73 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698