| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 * @param {number} index | 223 * @param {number} index |
| 224 * @return {number} | 224 * @return {number} |
| 225 */ | 225 */ |
| 226 _cachedItemHeight: function(index) | 226 _cachedItemHeight: function(index) |
| 227 { | 227 { |
| 228 return index === 0 ? this._cumulativeHeights[0] : this._cumulativeHeight
s[index] - this._cumulativeHeights[index - 1]; | 228 return index === 0 ? this._cumulativeHeights[0] : this._cumulativeHeight
s[index] - this._cumulativeHeights[index - 1]; |
| 229 }, | 229 }, |
| 230 | 230 |
| 231 /** | 231 /** |
| 232 * @param {?Selection} selection | 232 * @param {?Selection} selection |
| 233 * @suppressGlobalPropertiesCheck |
| 233 */ | 234 */ |
| 234 _isSelectionBackwards: function(selection) | 235 _isSelectionBackwards: function(selection) |
| 235 { | 236 { |
| 236 if (!selection || !selection.rangeCount) | 237 if (!selection || !selection.rangeCount) |
| 237 return false; | 238 return false; |
| 238 var range = document.createRange(); | 239 var range = document.createRange(); |
| 239 range.setStart(selection.anchorNode, selection.anchorOffset); | 240 range.setStart(selection.anchorNode, selection.anchorOffset); |
| 240 range.setEnd(selection.focusNode, selection.focusOffset); | 241 range.setEnd(selection.focusNode, selection.focusOffset); |
| 241 return range.collapsed; | 242 return range.collapsed; |
| 242 }, | 243 }, |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 602 |
| 602 /** | 603 /** |
| 603 * @return {number} | 604 * @return {number} |
| 604 */ | 605 */ |
| 605 _visibleHeight: function() | 606 _visibleHeight: function() |
| 606 { | 607 { |
| 607 // Use offsetHeight instead of clientHeight to avoid being affected by h
orizontal scroll. | 608 // Use offsetHeight instead of clientHeight to avoid being affected by h
orizontal scroll. |
| 608 return this.element.offsetHeight; | 609 return this.element.offsetHeight; |
| 609 } | 610 } |
| 610 } | 611 } |
| OLD | NEW |