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

Unified Diff: LayoutTests/fast/dom/Range/getClientRects-leading-trailing-whitespaces.html

Issue 361683002: Make LayoutText::absoluteQuadsForRange to consider leading/trailing whitespaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-18T16:38:30 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 | Source/core/layout/LayoutText.cpp » ('j') | Source/core/layout/LayoutText.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Range/getClientRects-leading-trailing-whitespaces.html
diff --git a/LayoutTests/fast/dom/Range/getClientRects-leading-trailing-whitespaces.html b/LayoutTests/fast/dom/Range/getClientRects-leading-trailing-whitespaces.html
new file mode 100644
index 0000000000000000000000000000000000000000..6799cd459eb0760df993850970f7e15e011a1a66
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/getClientRects-leading-trailing-whitespaces.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="target"> abc </div>
+<div id="log"></div>
+<script>
+var target = document.getElementById('target').firstChild;
+var results = [0, 1, 2, 3, 4, 5, 6, 7, 8].map(function(offset) {
eae 2015/08/18 16:14:45 Please avoid doing data driven tests, while compac
yosin_UTC9 2015/08/19 06:08:55 Done.
+ var range = document.createRange();
+ range.setStart(target, offset);
+ var rects = range.getClientRects();
+ return rects.length ? rects[0].left : 'no rects';
+});
+test(function() {
+ assert_equals(results[0], results[3], '0');
+ assert_equals(results[1], results[3], '1');
+ assert_equals(results[2], results[3], '2');
+}, 'leading whitespaces');
+
+test(function() {
+ assert_greater_than(results[6], results[5], '6');
+ assert_equals(results[7], results[6], '7');
+ assert_equals(results[8], results[6], '8');
+}, 'trailing whitespaces');
+</script>
« no previous file with comments | « no previous file | Source/core/layout/LayoutText.cpp » ('j') | Source/core/layout/LayoutText.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698