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

Side by Side Diff: LayoutTests/editing/selection/find-yensign-and-backslash.html

Issue 27030014: Remove Backslash-as-JPY hack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TextCodec/Encoding added Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/editing/selection/find-yensign-and-backslash-with-japanese-fonts.html » ('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 <html>
3 <head>
4 <meta charset="UTF-8">
5 <script>
6
7 if (window.testRunner)
8 testRunner.dumpAsText();
9
10 function shouldBeTrue(condition, testName)
11 {
12 var result = testName + ": ";
13 if (condition)
14 result += "PASS";
15 else
16 result += "FAIL";
17
18 document.getElementById("results").innerHTML += result + "<br>";
19 }
20
21 function test()
22 {
23 // With these encodings, backslashes will be transcoded into yen signs.
24 var encodings = ["EUC-JP", "Shift_JIS", "ISO-2022-JP"];
25 for (var i = 0; i < encodings.length; i++) {
26 var encoding = encodings[i];
27 var frameDocument = frames[i].document;
28 shouldBeTrue(frameDocument.execCommand("FindString", false, "¥-in-body") , "We can find a backslash in " + encoding + " page by finding a yen sign");
29 shouldBeTrue(frameDocument.execCommand("FindString", false, "¥-in-input" ), "We can find a backslash in " + encoding + " text control by finding a yen si gn");
30 }
31
32 shouldBeTrue(!document.execCommand("FindString", false, "¥-in-body"), "We ca n NOT find a backslash in UTF8 page by finding a yen sign");
33 shouldBeTrue(!document.execCommand("FindString", false, "¥-in-input"), "We c an NOT find a backslash in UTF8 text control by finding a yen sign");
34 }
35
36 </script>
37 </head>
38 <body onload="test()">
39
40 <div>\-in-body</div>
41 <input value=\-in-input>
42 <iframe src="data:text/html;charset=EUC-JP,<body>\-in-body<input value=\-in-inpu t></body>"></iframe>
43 <iframe src="data:text/html;charset=Shift_JIS,<body>\-in-body<input value=\-in-i nput></body>"></iframe>
44 <iframe src="data:text/html;charset=ISO-2022-JP,<body>\-in-body<input value=\-in -input></body>"></iframe>
45
46 <p>Results</p>
47
48 <p id="results">
49 </p>
50 </body>
51 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/selection/find-yensign-and-backslash-with-japanese-fonts.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698