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

Side by Side Diff: LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html

Issue 229793004: Add CharacterData.deleteData()/replaceData() overflow handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test deleteData() + replaceData() overflow handling.");
9
10 var textNode;
11 var range;
12
13 shouldBeNonNull("textNode = new Text('chopped off and then some'); textNode");
14 document.body.appendChild(textNode);
15 document.getSelection().extend(textNode, textNode.length);
16 range = document.getSelection().getRangeAt(0);
17
18 shouldBeEqualToString("textNode.deleteData(11, 0xfffffff7); textNode.data", "cho pped off");
19 shouldBe("range.endOffset", "11");
20 document.body.removeChild(textNode);
21
22 shouldBeNonNull("textNode = new Text('hello world'); textNode");
23 document.body.appendChild(textNode);
24 document.getSelection().extend(textNode, textNode.length);
25 range = document.getSelection().getRangeAt(0);
26
27 shouldBeEqualToString("textNode.replaceData(6, 0xfffffffe, 'bob'); textNode.data ", "hello bob");
28 shouldBe("range.endOffset", "6");
29 document.body.removeChild(textNode);
30
31 shouldBeNonNull("textNode = new Text('hello world'); textNode");
32 shouldBeEqualToString("textNode.replaceData(6, -1, 'bob'); textNode.data", "hell o bob");
33 shouldBeNonNull("textNode = new Text('hello world'); textNode");
34 shouldBeEqualToString("textNode.replaceData(6, -2, 'bob'); textNode.data", "hell o bob");
35 </script>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698