Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 140753009: Fix MOAR warnings for dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/html_common/lists.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 52544f05df4bf0b0da12e75cba7a9a6cbff1a49d..90b4b15b3aa6a8f7981e77ad698c26f50f30d886 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -31536,6 +31536,15 @@ class _BeforeUnloadEventStreamProvider implements
String getEventType(EventTarget target) {
return _eventType;
}
+
+ ElementStream<BeforeUnloadEvent> forElement(Element e, {bool useCapture: false}) {
+ return new _ElementEventStreamImpl(e, _eventType, useCapture);
+ }
+
+ ElementStream<BeforeUnloadEvent> _forElementList(ElementList e,
+ {bool useCapture: false}) {
+ return new _ElementListEventStreamImpl(e, _eventType, useCapture);
+ }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -33860,6 +33869,10 @@ abstract class _XMLHttpRequestProgressEvent extends ProgressEvent {
*/
class _WrappedEvent implements Event {
final Event wrapped;
+
+ /** The CSS selector involved with event delegation. */
+ String _selector;
+
_WrappedEvent(this.wrapped);
bool get bubbles => wrapped.bubbles;
@@ -33897,6 +33910,39 @@ class _WrappedEvent implements Event {
void stopPropagation() {
wrapped.stopPropagation();
}
+
+ /**
+ * A pointer to the element whose CSS selector matched within which an event
+ * was fired. If this Event was not associated with any Event delegation,
+ * accessing this value will throw an [UnsupportedError].
+ */
+ Element get matchingTarget {
+ if (_selector == null) {
+ throw new UnsupportedError('Cannot call matchingTarget if this Event did'
+ ' not arise as a result of event delegation.');
+ }
+ var currentTarget = this.currentTarget;
+ var target = this.target;
+ var matchedTarget;
+ do {
+ if (target.matches(_selector)) return target;
+ target = target.parent;
+ } while (target != null && target != currentTarget.parent);
+ throw new StateError('No selector matched for populating matchedTarget.');
+ }
+
+ /**
+ * This event's path, taking into account shadow DOM.
+ *
+ * ## Other resources
+ *
+ * * [Shadow DOM extensions to Event]
+ * (http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event) from
+ * W3C.
+ */
+ // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#extensions-to-event
+ @Experimental()
+ List<Node> get path => wrapped.path;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -34230,7 +34276,7 @@ abstract class CanvasImageSource {}
* * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN.
* * [Window](http://www.w3.org/TR/Window/) from the W3C.
*/
-abstract class WindowBase implements EventTarget {
+abstract class WindowBase {
// Fields.
/**
@@ -38525,7 +38571,7 @@ class _Utils {
// TODO(vsm): Move these checks into native code.
ClassMirror cls = reflectClass(type);
if (_isBuiltinType(cls)) {
- throw new UnsupportedError("Invalid custom element from ${cls.owner.uri}.");
+ throw new UnsupportedError("Invalid custom element from ${(cls.owner as LibraryMirror).uri}.");
}
var className = MirrorSystem.getName(cls.simpleName);
var createdConstructor = cls.declarations[new Symbol('$className.created')];
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/html_common/lists.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698