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

Side by Side Diff: LayoutTests/fast/scroll-behavior/bordered-container-child-scroll.html

Issue 568453002: Removing container's Left & Top border from computed scroll offset bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removing parent's left & top border from computed scroll rect. Created 6 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
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
leviw_travelin_and_unemployed 2014/10/08 20:18:42 nit: you don't need the head or html tags
Ambarish 2014/10/10 11:28:45 Done.
Ambarish 2014/10/10 11:28:45 Done.
4 <script src="../../resources/js-test.js"></script>
5 <style type="text/css">
leviw_travelin_and_unemployed 2014/10/08 20:18:42 nit: you don't need the "type=..."
Ambarish 2014/10/10 11:28:45 Done.
6 .grid {
7 width: 165px;
8 height: 165px;
9 border: solid 5px purple;
10 overflow-x: scroll;
11 }
12 .row {
13 width: 150px;
14 height: 25px;
15 }
16 .column {
17 width: 50px;
18 height: 25px;
19 box-sizing: border-box;
20 background: black;
leviw_travelin_and_unemployed 2014/10/08 20:19:14 A lot of these styles are simply unnecessary. Take
Ambarish 2014/10/10 11:28:45 Done.
21 outline: solid 1px green;
22 outline-offset: -1px;
23 }
24 </style>
25 </head>
26 <body>
27 <script>
28 description('Issue crbug.com/295848: element.scrollIntoViewIfNeeded( ) does not scroll the entire element render box into view.');
29 // This html comprieses testing if parent border is not affecting sc rollLeft and scrollTop value, when a child element is auto scrolled.
30 // When child at row index 8 and column 5 is scrolled into view from bottom left, the scrollTop & scrollLeft should be 75 & 150 respectively.
31 // When child at row index 1 and column 2 is scrolled into view from top right, the scrollTop & scrollLeft should be 25 & 100 respectively.
32
33 if (window.testRunner)
34 testRunner.dumpAsText(true);
35
36 var scrollTop;
37 var scrollLeft;
38 var row;
39 var column;
40 var columnDiv;
41 var grid = document.createElement('div');
42 grid.id = "Grid";
43 grid.className = 'grid';
44 document.body.appendChild(grid);
leviw_travelin_and_unemployed 2014/10/08 20:18:42 Why not just have the grid in the DOM to start? I
Ambarish 2014/10/10 11:28:45 Done.
45
46 for (var i = 0; i < 10; i++) {
47 row = document.createElement('tr');
48 row.className = 'row';
49 for (var j = 0; j < 7; j++) {
50 column = document.createElement('td');
51 columnDiv = document.createElement('div');
52 columnDiv.className = 'column';
53 if ((i == 8 && j == 5) || (i == 1 && j == 2))
54 columnDiv.style.backgroundColor = "white";
leviw_travelin_and_unemployed 2014/10/08 20:18:42 Why?
Ambarish 2014/10/10 11:28:45 Done.
55 column.appendChild(columnDiv);
56 row.appendChild(column);
57 }
58 grid.appendChild(row);
59 }
60
61 row = grid.getElementsByTagName('tr')[8];
62 column = row.getElementsByTagName('td')[5];
63 column.scrollIntoViewIfNeeded(false);
64 scrollTop = grid.scrollTop;
65 shouldBeEqualToNumber('scrollTop', 75);
66 scrollLeft = grid.scrollLeft;
67 shouldBeEqualToNumber('scrollLeft', 150);
68
69 row = grid.getElementsByTagName('tr')[1];
70 column = row.getElementsByTagName('td')[2];
71 column.scrollIntoViewIfNeeded(false);
72 scrollTop = grid.scrollTop;
73 shouldBeEqualToNumber('scrollTop', 25);
74 scrollLeft = grid.scrollLeft;
75 shouldBeEqualToNumber('scrollLeft', 100);
76
77 </script>
78 </body>
79 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698