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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 function isEnterKey(event) { | 541 function isEnterKey(event) { |
542 // Check if in IME. | 542 // Check if in IME. |
543 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; | 543 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; |
544 } | 544 } |
545 | 545 |
546 function consumeEvent(e) | 546 function consumeEvent(e) |
547 { | 547 { |
548 e.consume(); | 548 e.consume(); |
549 } | 549 } |
550 | 550 |
551 window.isUnderTest = false; | |
552 | |
553 /** | 551 /** |
554 * Mutation observers leak memory. Keep track of them and disconnect | 552 * Mutation observers leak memory. Keep track of them and disconnect |
555 * on unload. | 553 * on unload. |
556 * @constructor | 554 * @constructor |
557 * @param {function(Array.<WebKitMutation>)} handler | 555 * @param {function(Array.<WebKitMutation>)} handler |
558 */ | 556 */ |
559 function NonLeakingMutationObserver(handler) | 557 function NonLeakingMutationObserver(handler) |
560 { | 558 { |
561 this._observer = new WebKitMutationObserver(handler); | 559 this._observer = new WebKitMutationObserver(handler); |
562 NonLeakingMutationObserver._instances.push(this); | 560 NonLeakingMutationObserver._instances.push(this); |
(...skipping 21 matching lines...) Expand all Loading... |
584 | 582 |
585 disconnect: function() | 583 disconnect: function() |
586 { | 584 { |
587 if (this._observer) | 585 if (this._observer) |
588 this._observer.disconnect(); | 586 this._observer.disconnect(); |
589 NonLeakingMutationObserver._instances.remove(this); | 587 NonLeakingMutationObserver._instances.remove(this); |
590 delete this._observer; | 588 delete this._observer; |
591 } | 589 } |
592 } | 590 } |
593 | 591 |
OLD | NEW |