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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/custom/getClientRects.html

Issue 2349653002: Added support of getClientRects() for SVG Elements. (Closed)
Patch Set: Align with review comments Created 4 years, 2 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/Element.h » ('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 <title>Element.getClientRects() on an SVGElement</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <style>
6 body {
7 margin-left:0px;
8 margin-top:0px;
9 }
10 </style>
11 <body>
12 <svg width="100px" height="100px">
13 <rect x="20" y="30" width="40" height="50" />
14 </svg>
15 <svg width="100px" height="100px">
16 <g>
17 <text x="10" y="10">svg text</text>
18 <foreignObject x="10" y="30" width="50" height="50"> foreign object text </f oreignObject>
19 </g>
20 </svg>
21 <script>
22 test(function() {
23 var list1 = document.querySelector("rect").getClientRects();
24 assert_equals(list1.length, 1);
25 var r = list1[0];
26 assert_equals(r.left, 20);
27 assert_equals(r.top, 30);
28 assert_equals(r.width, 40);
29 assert_equals(r.height, 50);
30 assert_equals(r.right, 60);
31 assert_equals(r.bottom, 80);
32
33 var gElem = document.querySelector("g");
34 var list2 = gElem.getClientRects();
35 assert_equals(list2.length, 1);
36 var r1 = list2[0];
37 var r2 = gElem.getBoundingClientRect();
38 assert_equals(r1.left, r2.left);
39 assert_equals(r1.top, r2.top);
40 assert_equals(r1.width, r2.width);
41 assert_equals(r1.height, r2.height);
42 assert_equals(r1.right, r2.right);
43 assert_equals(r1.bottom, r2.bottom);
44 });
45 </script>
46 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698