Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / getClientRects-leading-trailing-whitespaces.html
blobe354b72788b6787edf538042512a7a99b2f1a670
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';
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');
20 test(function() {
21 assert_greater_than(clientRectLeftOfNodeOffsetAt(6), clientRectLeftOfNodeOffsetAt(5), '6');
22 assert_equals(clientRectLeftOfNodeOffsetAt(7), clientRectLeftOfNodeOffsetAt(6), '7');
23 assert_equals(clientRectLeftOfNodeOffsetAt(8), clientRectLeftOfNodeOffsetAt(6), '8');
24 }, 'trailing whitespaces');
25 </script>