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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 break; | 485 break; |
486 | 486 |
487 curElement = curWindow.frameElement; | 487 curElement = curWindow.frameElement; |
488 curWindow = curWindow.parent; | 488 curWindow = curWindow.parent; |
489 } | 489 } |
490 | 490 |
491 return elementOffset; | 491 return elementOffset; |
492 } | 492 } |
493 | 493 |
494 /** | 494 /** |
495 * @param {!Window} targetWindow | 495 * @param {!Window=} targetWindow |
496 * @return {!AnchorBox} | 496 * @return {!AnchorBox} |
497 */ | 497 */ |
498 Element.prototype.boxInWindow = function(targetWindow) | 498 Element.prototype.boxInWindow = function(targetWindow) |
499 { | 499 { |
500 targetWindow = targetWindow || this.ownerDocument.defaultView; | 500 targetWindow = targetWindow || this.ownerDocument.defaultView; |
501 | 501 |
502 var anchorBox = this.offsetRelativeToWindow(window); | 502 var anchorBox = this.offsetRelativeToWindow(window); |
503 anchorBox.width = Math.min(this.offsetWidth, window.innerWidth - anchorBox.x
); | 503 anchorBox.width = Math.min(this.offsetWidth, window.innerWidth - anchorBox.x
); |
504 anchorBox.height = Math.min(this.offsetHeight, window.innerHeight - anchorBo
x.y); | 504 anchorBox.height = Math.min(this.offsetHeight, window.innerHeight - anchorBo
x.y); |
505 | 505 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 */ | 673 */ |
674 function isEnterKey(event) { | 674 function isEnterKey(event) { |
675 // Check if in IME. | 675 // Check if in IME. |
676 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; | 676 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; |
677 } | 677 } |
678 | 678 |
679 function consumeEvent(e) | 679 function consumeEvent(e) |
680 { | 680 { |
681 e.consume(); | 681 e.consume(); |
682 } | 682 } |
OLD | NEW |