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

Unified Diff: LayoutTests/fast/text/international/bounds-white-space-pre.html

Issue 1303673005: Add a test of getBoundingClientRect() when white-space:pre for complex scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: eae review 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/text/international/bounds-white-space-pre.html
diff --git a/LayoutTests/fast/text/international/bounds-white-space-pre.html b/LayoutTests/fast/text/international/bounds-white-space-pre.html
new file mode 100644
index 0000000000000000000000000000000000000000..bfa20e7c6d073bd0c8217acb78736e1575248322
--- /dev/null
+++ b/LayoutTests/fast/text/international/bounds-white-space-pre.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+#container {
+ font-size: 25px;
+}
+</style>
+<div id="container">
+ <div>شییش ی ی ی ی ی</div>
+ <div style="white-space:pre">شییش ی ی ی ی ی</div>
+</div>
+<script>
+runTests();
+function runTests() {
+ var expectedNode = container.firstElementChild.firstChild;
+ var targetNode = container.lastElementChild.firstChild;
+ for (var i = 0; i < expectedNode.length; i++) {
+ test(function () {
+ assert_equals(getX(targetNode, i), getX(expectedNode, i));
+ }, "Index " + i);
+ }
+
+ if (window.testRunner)
+ container.style.display = "none";
+}
+
+function getX(node, offset) {
+ var range = document.createRange();
+ range.setStart(node, offset);
+ range.setEnd(node, offset + 1);
+ var bounds = range.getBoundingClientRect();
+ return bounds.left;
+}
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698