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

Side by Side Diff: LayoutTests/editing/selection/offset-from-point-complex-scripts.html

Issue 1314543003: Fix ShapeResult::offsetForPosition for RTL scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: TestExpectations in PS3 was uploaded from wrong PC Created 5 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <div id="container">
4 <p>مَ متن</p>
5 </div>
6 <div id=log></div>
7 <script>
8 testOffsetFromPoint(container.firstElementChild);
9
10 function testOffsetFromPoint(element) {
11 var y = element.offsetTop + element.offsetHeight / 2;
12 var xmin = element.offsetLeft;
13 var xmax = xmin + element.offsetWidth;
14 var lastCharacterOffset = null;
15 var results = [];
16 for (var x = xmin - 1; x <= xmax + 1; ++x) {
17 var result = document.caretRangeFromPoint(x, y);
18 var characterOffset = result ? result.startOffset : null;
19 if (characterOffset === lastCharacterOffset)
20 continue;
21 results.push(characterOffset);
22 lastCharacterOffset = characterOffset;
23 }
24 var div = document.createElement("div");
25 div.innerText = results.join(" ");
26 log.appendChild(div);
27 }
28
29 if (window.testRunner) {
30 container.style.display = "none";
31 testRunner.dumpAsText();
32 }
33 </script>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/editing/selection/offset-from-point-complex-scripts-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698