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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/editing/selection/offset-from-point-complex-scripts.html
diff --git a/LayoutTests/editing/selection/offset-from-point-complex-scripts.html b/LayoutTests/editing/selection/offset-from-point-complex-scripts.html
new file mode 100644
index 0000000000000000000000000000000000000000..398453f6a464e23d837219d420e45abd4aaf73b4
--- /dev/null
+++ b/LayoutTests/editing/selection/offset-from-point-complex-scripts.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div id="container">
+ <p>مَ متن</p>
+</div>
+<div id=log></div>
+<script>
+testOffsetFromPoint(container.firstElementChild);
+
+function testOffsetFromPoint(element) {
+ var y = element.offsetTop + element.offsetHeight / 2;
+ var xmin = element.offsetLeft;
+ var xmax = xmin + element.offsetWidth;
+ var lastCharacterOffset = null;
+ var results = [];
+ for (var x = xmin - 1; x <= xmax + 1; ++x) {
+ var result = document.caretRangeFromPoint(x, y);
+ var characterOffset = result ? result.startOffset : null;
+ if (characterOffset === lastCharacterOffset)
+ continue;
+ results.push(characterOffset);
+ lastCharacterOffset = characterOffset;
+ }
+ var div = document.createElement("div");
+ div.innerText = results.join(" ");
+ log.appendChild(div);
+}
+
+if (window.testRunner) {
+ container.style.display = "none";
+ testRunner.dumpAsText();
+}
+</script>
« 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