| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 * @param {number} width | 199 * @param {number} width |
| 200 * @param {number} height | 200 * @param {number} height |
| 201 */ | 201 */ |
| 202 function Size(width, height) | 202 function Size(width, height) |
| 203 { | 203 { |
| 204 this.width = width; | 204 this.width = width; |
| 205 this.height = height; | 205 this.height = height; |
| 206 } | 206 } |
| 207 | 207 |
| 208 /** | 208 /** |
| 209 * @param {?Size} size |
| 210 * @return {boolean} |
| 211 */ |
| 212 Size.prototype.isEqual = function(size) |
| 213 { |
| 214 return !!size && this.width === size.width && this.height === size.height; |
| 215 }; |
| 216 |
| 217 /** |
| 209 * @param {?Element=} containerElement | 218 * @param {?Element=} containerElement |
| 210 * @return {!Size} | 219 * @return {!Size} |
| 211 */ | 220 */ |
| 212 Element.prototype.measurePreferredSize = function(containerElement) | 221 Element.prototype.measurePreferredSize = function(containerElement) |
| 213 { | 222 { |
| 214 containerElement = containerElement || document.body; | 223 containerElement = containerElement || document.body; |
| 215 containerElement.appendChild(this); | 224 containerElement.appendChild(this); |
| 216 this.positionAt(0, 0); | 225 this.positionAt(0, 0); |
| 217 var result = new Size(this.offsetWidth, this.offsetHeight); | 226 var result = new Size(this.offsetWidth, this.offsetHeight); |
| 218 this.positionAt(undefined, undefined); | 227 this.positionAt(undefined, undefined); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 */ | 594 */ |
| 586 function isEnterKey(event) { | 595 function isEnterKey(event) { |
| 587 // Check if in IME. | 596 // Check if in IME. |
| 588 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; | 597 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; |
| 589 } | 598 } |
| 590 | 599 |
| 591 function consumeEvent(e) | 600 function consumeEvent(e) |
| 592 { | 601 { |
| 593 e.consume(); | 602 e.consume(); |
| 594 } | 603 } |
| OLD | NEW |