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

Side by Side Diff: lib/src/iron-list/test/helpers.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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 | « lib/src/iron-list/test/dynamic-item-size.html ('k') | lib/src/iron-list/test/hidden-list.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 @license 2 @license
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE 4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS
7 Code distributed by Google as part of the polymer project is also 7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS
9 --> 9 -->
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 function getFirstItemFromList(list) { 66 function getFirstItemFromList(list) {
67 var listRect = list.getBoundingClientRect(); 67 var listRect = list.getBoundingClientRect();
68 return document.elementFromPoint(listRect.left + 1, listRect.top + 1); 68 return document.elementFromPoint(listRect.left + 1, listRect.top + 1);
69 } 69 }
70 70
71 function getLastItemFromList(list) { 71 function getLastItemFromList(list) {
72 var listRect = list.getBoundingClientRect(); 72 var listRect = list.getBoundingClientRect();
73 return document.elementFromPoint(listRect.left + 1, listRect.top + listRect. height - 1); 73 return document.elementFromPoint(listRect.left + 1, listRect.top + listRect. height - 1);
74 } 74 }
75
76 function isFullOfItems(list) {
77 var listRect = list.getBoundingClientRect();
78 var listHeight = listRect.height - 1;
79 var item, y = listRect.top + 1;
80 // IE 10 & 11 doesn't render propertly :(
81 var badPixels = 0;
82 while (y < listHeight) {
83 item = document.elementFromPoint(listRect.left + 1, y);
84 if (item.parentNode && !item.parentNode._templateInstance) {
85 badPixels++;
86 }
87 if (badPixels > 3) {
88 return false;
89 }
90 y += 2;
91 }
92 return true;
93 }
75 </script> 94 </script>
OLDNEW
« no previous file with comments | « lib/src/iron-list/test/dynamic-item-size.html ('k') | lib/src/iron-list/test/hidden-list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698