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

Side by Side 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-19T15:06:27 Follow review comments 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
« no previous file with comments | « no previous file | Source/core/layout/LayoutText.cpp » ('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 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <div id="target"> abc </div>
5 <div id="log"></div>
6 <script>
7 var target = document.getElementById('target').firstChild;
8 function clientRectLeftOfNodeOffsetAt(offset) {
9 var range = document.createRange();
10 range.setStart(target, offset);
11 var rects = range.getClientRects();
12 return rects.length ? rects[0].left : 'no rects';
13 }
14 test(function() {
15 assert_equals(clientRectLeftOfNodeOffsetAt(0), clientRectLeftOfNodeOffsetAt( 3), '0');
16 assert_equals(clientRectLeftOfNodeOffsetAt(1), clientRectLeftOfNodeOffsetAt( 3), '1');
17 assert_equals(clientRectLeftOfNodeOffsetAt(2), clientRectLeftOfNodeOffsetAt( 3), '2');
18 }, 'leading whitespaces');
19
20 test(function() {
21 assert_greater_than(clientRectLeftOfNodeOffsetAt(6), clientRectLeftOfNodeOff setAt(5), '6');
22 assert_equals(clientRectLeftOfNodeOffsetAt(7), clientRectLeftOfNodeOffsetAt( 6), '7');
23 assert_equals(clientRectLeftOfNodeOffsetAt(8), clientRectLeftOfNodeOffsetAt( 6), '8');
24 }, 'trailing whitespaces');
25 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698