| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // require: listselectionmodel.js | 5 // require: listselectionmodel.js |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @fileoverview This implements a list control. | 8 * @fileoverview This implements a list control. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // Handle margin collapsing. | 48 // Handle margin collapsing. |
| 49 if (mt < 0 && mb < 0) { | 49 if (mt < 0 && mb < 0) { |
| 50 h += Math.min(mt, mb); | 50 h += Math.min(mt, mb); |
| 51 } else if (mt >= 0 && mb >= 0) { | 51 } else if (mt >= 0 && mb >= 0) { |
| 52 h += Math.max(mt, mb); | 52 h += Math.max(mt, mb); |
| 53 } else { | 53 } else { |
| 54 h += mt + mb; | 54 h += mt + mb; |
| 55 } | 55 } |
| 56 | 56 |
| 57 list.removeChild(item); | 57 list.removeChild(item); |
| 58 return h; | 58 return Math.max(0, h); |
| 59 } | 59 } |
| 60 | 60 |
| 61 function getComputedStyle(el) { | 61 function getComputedStyle(el) { |
| 62 return el.ownerDocument.defaultView.getComputedStyle(el); | 62 return el.ownerDocument.defaultView.getComputedStyle(el); |
| 63 } | 63 } |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Creates a new list element. | 66 * Creates a new list element. |
| 67 * @param {Object=} opt_propertyBag Optional properties. | 67 * @param {Object=} opt_propertyBag Optional properties. |
| 68 * @constructor | 68 * @constructor |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 delete this.cachedItems_[index]; | 498 delete this.cachedItems_[index]; |
| 499 this.redraw(); | 499 this.redraw(); |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 }; | 502 }; |
| 503 | 503 |
| 504 return { | 504 return { |
| 505 List: List | 505 List: List |
| 506 } | 506 } |
| 507 }); | 507 }); |
| OLD | NEW |