OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function MockRowProvider(document, count) { | 5 function MockRowProvider(document, count) { |
6 this.document_ = document; | 6 this.document_ = document; |
7 this.rows_ = new Array(); | 7 this.rows_ = new Array(); |
8 this.rows_.length = count; | 8 this.rows_.length = count; |
9 | 9 |
10 this.rowNodeCache_ = null; | 10 this.rowNodeCache_ = null; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return rec.text; | 77 return rec.text; |
78 }; | 78 }; |
79 | 79 |
80 MockRowProvider.prototype.getRowNode = function(index) { | 80 MockRowProvider.prototype.getRowNode = function(index) { |
81 this.addCallCount('getRowNode'); | 81 this.addCallCount('getRowNode'); |
82 | 82 |
83 if (this.rowNodeCache_ && index in this.rowNodeCache_) | 83 if (this.rowNodeCache_ && index in this.rowNodeCache_) |
84 return this.rowNodeCache_[index]; | 84 return this.rowNodeCache_[index]; |
85 | 85 |
86 var rec = this.getRowRecord_(index); | 86 var rec = this.getRowRecord_(index); |
87 var rowNode = this.document_.createElement('div'); | 87 var rowNode = this.document_.createElement('x-row'); |
88 rowNode.rowIndex = index; | 88 rowNode.rowIndex = index; |
89 rowNode.innerHTML = rec.html; | 89 rowNode.innerHTML = rec.html; |
90 | 90 |
91 if (this.rowNodeCache_) | 91 if (this.rowNodeCache_) |
92 this.rowNodeCache_[index] = rowNode; | 92 this.rowNodeCache_[index] = rowNode; |
93 | 93 |
94 return rowNode; | 94 return rowNode; |
95 }; | 95 }; |
OLD | NEW |