Chromium Code Reviews| 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 /** | 5 /** |
| 6 * @fileoverview This contains an implementation of the EventTarget interface | 6 * @fileoverview This contains an implementation of the EventTarget interface |
| 7 * as defined by DOM Level 2 Events. | 7 * as defined by DOM Level 2 Events. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 cr.define('cr', function() { | 10 cr.define('cr', function() { |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * Creates a new EventTarget. This class implements the DOM level 2 | 13 * Creates a new EventTarget. This class implements the DOM level 2 |
| 14 * EventTarget interface and can be used wherever those are used. | 14 * EventTarget interface and can be used wherever those are used. |
| 15 * @constructor | 15 * @constructor |
| 16 * @implements {EventTarget} | |
|
Dan Beam
2014/09/23 00:46:34
this is a confusing statement. i assume this mean
Vitaly Pavlenko
2014/09/23 01:05:17
Yes, all our constructors are visible to Closure c
| |
| 16 */ | 17 */ |
| 17 function EventTarget() { | 18 function EventTarget() { |
| 18 } | 19 } |
| 19 | 20 |
| 20 EventTarget.prototype = { | 21 EventTarget.prototype = { |
| 21 | 22 |
| 22 /** | 23 /** |
| 23 * Adds an event listener to the target. | 24 * Adds an event listener to the target. |
| 24 * @param {string} type The name of the event. | 25 * @param {string} type The name of the event. |
| 25 * @param {!Function|{handleEvent:Function}} handler The handler for the | 26 * @param {!Function|{handleEvent:Function}} handler The handler for the |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 | 93 |
| 93 return !prevented && !event.defaultPrevented; | 94 return !prevented && !event.defaultPrevented; |
| 94 } | 95 } |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 // Export | 98 // Export |
| 98 return { | 99 return { |
| 99 EventTarget: EventTarget | 100 EventTarget: EventTarget |
| 100 }; | 101 }; |
| 101 }); | 102 }); |
| OLD | NEW |