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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Range/range-spanning-elements-bounding-client-rect.html

Issue 2209513002: Exclude start/end container in Range::getBorderAndTextQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 4 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 | third_party/WebKit/Source/core/dom/Range.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 <html>
3 <head>
4 <title>Tests getBoundingClientRect for ranges spanning multiple elements </title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 </head>
8 <style>
9 p { visibility: hidden; }
10 p > span { text-decoration: underline; }
11 </style>
12 <body>
13 <p id="test">Test that getBoundingClientRect <span>returns the correct
14 results for ranges spanning multiple</span> elements.</p>
15 <p id="reference">Test that getBoundingClientRect <span>returns</span>
16 the correct results for ranges spanning multiple elements.</p>
17 <script>
18 test(function() {
19 var element = document.getElementById('test');
20 var span = element.getElementsByTagName('span')[0];
21 var range = document.createRange();
22 range.setStart(element.firstChild, 10);
23 range.setEnd(element.firstElementChild.firstChild, 7);
24
25 element = document.getElementById('reference');
26 var reference = document.createRange();
27 reference.setStart(element.firstChild, 10);
28 reference.setEnd(element.firstElementChild.firstChild, 7);
29
30 assert_equals(
31 Math.round(range.getBoundingClientRect().width),
32 Math.round(reference.getBoundingClientRect().width),
33 'Width of range should match reference range.');
34 assert_less_than(
35 Math.round(range.getBoundingClientRect().width),
36 Math.round(span.getBoundingClientRect().width),
37 'Width of range should be less than inner span.');
38 }, 'Check reported width of range.');
39 </script>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698