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

Side by Side Diff: third_party/WebKit/LayoutTests/resources/check-layout-th.js

Issue 1729073002: Update SVG tests ahead of offset* removal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update flexitem.html and grid-item-display.html too Created 4 years, 9 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
1 (function() { 1 (function() {
2 // Test is initiated from body.onload, so explicit done() call is required. 2 // Test is initiated from body.onload, so explicit done() call is required.
3 setup({ explicit_done: true }); 3 setup({ explicit_done: true });
4 4
5 function checkSubtreeExpectedValues(t, parent, prefix) 5 function checkSubtreeExpectedValues(t, parent, prefix)
6 { 6 {
7 var checkedLayout = checkExpectedValues(t, parent, prefix); 7 var checkedLayout = checkExpectedValues(t, parent, prefix);
8 Array.prototype.forEach.call(parent.childNodes, function(node) { 8 Array.prototype.forEach.call(parent.childNodes, function(node) {
9 checkedLayout |= checkSubtreeExpectedValues(t, node, prefix); 9 checkedLayout |= checkSubtreeExpectedValues(t, node, prefix);
10 }); 10 });
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 var expectedWidth = checkAttribute(output, node, "data-expected-scroll-width "); 62 var expectedWidth = checkAttribute(output, node, "data-expected-scroll-width ");
63 if (expectedWidth) { 63 if (expectedWidth) {
64 assert_tolerance(node.scrollWidth, expectedWidth, prefix + "scrollWidth" ); 64 assert_tolerance(node.scrollWidth, expectedWidth, prefix + "scrollWidth" );
65 } 65 }
66 66
67 var expectedHeight = checkAttribute(output, node, "data-expected-scroll-heig ht"); 67 var expectedHeight = checkAttribute(output, node, "data-expected-scroll-heig ht");
68 if (expectedHeight) { 68 if (expectedHeight) {
69 assert_tolerance(node.scrollHeight, expectedHeight, prefix + "scrollHeig ht"); 69 assert_tolerance(node.scrollHeight, expectedHeight, prefix + "scrollHeig ht");
70 } 70 }
71 71
72 var expectedWidth = checkAttribute(output, node, "data-expected-bounding-cli ent-rect-width");
73 if (expectedWidth) {
74 assert_tolerance(node.getBoundingClientRect().width, expectedWidth, pref ix + "getBoundingClientRect().width");
75 }
76
72 var expectedOffset = checkAttribute(output, node, "data-total-x"); 77 var expectedOffset = checkAttribute(output, node, "data-total-x");
73 if (expectedOffset) { 78 if (expectedOffset) {
74 var totalLeft = node.clientLeft + node.offsetLeft; 79 var totalLeft = node.clientLeft + node.offsetLeft;
75 assert_tolerance(totalLeft, expectedOffset, prefix + 80 assert_tolerance(totalLeft, expectedOffset, prefix +
76 "clientLeft+offsetLeft (" + node.clientLeft + " + " + n ode.offsetLeft + ")"); 81 "clientLeft+offsetLeft (" + node.clientLeft + " + " + n ode.offsetLeft + ")");
77 } 82 }
78 83
79 var expectedOffset = checkAttribute(output, node, "data-total-y"); 84 var expectedOffset = checkAttribute(output, node, "data-total-y");
80 if (expectedOffset) { 85 if (expectedOffset) {
81 var totalTop = node.clientTop + node.offsetTop; 86 var totalTop = node.clientTop + node.offsetTop;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 186 }
182 }, selectorList + ' ' + String(++testNumber)); 187 }, selectorList + ' ' + String(++testNumber));
183 }); 188 });
184 if (!checkedLayout) { 189 if (!checkedLayout) {
185 console.error("No valid data-* attributes found in selector list : " + s electorList); 190 console.error("No valid data-* attributes found in selector list : " + s electorList);
186 } 191 }
187 done(); 192 done();
188 }; 193 };
189 194
190 })(); 195 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698