Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Loosen the BrowserEvent target from Node to EventTarget. This helps i…

…solates the "lie" to

BrowserEvent class until we can fix the places that rely on the target being a Node.

R=chrishenry
DELTA=8  (3 added, 0 deleted, 5 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=5772


git-svn-id: http://closure-library.googlecode.com/svn/trunk@2274 0b95b8e8-c90f-11de-9d4f-f947ee5921c8
  • Loading branch information...
commit 402c562b2e7f6801831ba083b55fc9f872c600c6 1 parent 5f0a61a
johnlenz@google.com authored
7 closure/goog/events/browserevent.js
View
@@ -60,7 +60,7 @@ goog.require('goog.userAgent');
* The content of this object will not be initialized if no event object is
* provided. If this is the case, init() needs to be invoked separately.
* @param {Event=} opt_e Browser event object.
- * @param {Node=} opt_currentTarget Current target for event.
+ * @param {EventTarget=} opt_currentTarget Current target for event.
* @constructor
* @extends {goog.events.Event}
*/
@@ -236,7 +236,7 @@ goog.events.BrowserEvent.prototype.event_ = null;
* Accepts a browser event object and creates a patched, cross browser event
* object.
* @param {Event} e Browser event object.
- * @param {Node=} opt_currentTarget Current target for event.
+ * @param {EventTarget=} opt_currentTarget Current target for event.
*/
goog.events.BrowserEvent.prototype.init = function(e, opt_currentTarget) {
var type = this.type = e.type;
@@ -245,7 +245,8 @@ goog.events.BrowserEvent.prototype.init = function(e, opt_currentTarget) {
// TODO(nicksantos): Change this.target to type EventTarget.
this.target = /** @type {Node} */ (e.target) || e.srcElement;
- this.currentTarget = opt_currentTarget;
+ // TODO(nicksantos): Change this.currentTarget to type EventTarget.
+ this.currentTarget = /** @type {Node} */ (opt_currentTarget);
var relatedTarget = /** @type {Node} */ (e.relatedTarget);
if (relatedTarget) {
6 closure/goog/events/events.js
View
@@ -950,7 +950,8 @@ goog.events.handleBrowserEvent_ = function(key, opt_evt) {
}
var evt = new goog.events.BrowserEvent();
- evt.init(ieEvent, /** @type {Node} */ (this));
+ // TODO(user): update @this for this function
+ evt.init(ieEvent, /** @type {EventTarget} */ (this));
retval = true;
try {
@@ -1004,7 +1005,8 @@ goog.events.handleBrowserEvent_ = function(key, opt_evt) {
} // IE
// Caught a non-IE DOM event. 1 additional argument which is the event object
- var be = new goog.events.BrowserEvent(opt_evt, /** @type {Node} */ (this));
+ var be = new goog.events.BrowserEvent(
+ opt_evt, /** @type {EventTarget} */ (this));
retval = goog.events.fireListener(listener, be);
return retval;
};
Please sign in to comment.
Something went wrong with that request. Please try again.