| Index: sdk/lib/html/dart2js/html_dart2js.dart
|
| diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
|
| index 0dec810aca4c80984e2a627074e74f5414f7a73e..66a070bce03980bd8d991c2ffd2d328692514cdb 100644
|
| --- a/sdk/lib/html/dart2js/html_dart2js.dart
|
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart
|
| @@ -111,7 +111,7 @@ abstract class _EntryArray implements List<Entry> native "EntryArray" {}
|
|
|
| @DocsEditable()
|
| @DomName('AbstractWorker')
|
| -class AbstractWorker extends Interceptor implements EventTarget native "AbstractWorker" {
|
| +abstract class AbstractWorker extends Interceptor implements EventTarget native "AbstractWorker" {
|
| // To suppress missing implicit constructor warnings.
|
| factory AbstractWorker._() { throw new UnsupportedError("Not supported"); }
|
|
|
| @@ -266,6 +266,12 @@ class AnchorElement extends HtmlElement implements UrlUtils native "HTMLAnchorEl
|
| @DocsEditable()
|
| String href;
|
|
|
| + @DomName('HTMLAnchorElement.origin')
|
| + @DocsEditable()
|
| + // WebKit only
|
| + @Experimental() // non-standard
|
| + final String origin;
|
| +
|
| @DomName('HTMLAnchorElement.password')
|
| @DocsEditable()
|
| @Experimental() // untriaged
|
| @@ -2038,7 +2044,7 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRend
|
| return JS('List<num>', '#.getLineDash()', this);
|
| } else if (JS('bool', '!!#.webkitLineDash', this)) {
|
| return JS('List<num>', '#.webkitLineDash', this);
|
| - }
|
| + }
|
| }
|
|
|
| @SupportedBrowser(SupportedBrowser.CHROME)
|
| @@ -2865,7 +2871,7 @@ class CssRule extends Interceptor native "CSSRule" {
|
|
|
|
|
| @DomName('CSSStyleDeclaration')
|
| - class CssStyleDeclaration extends Interceptor with
|
| + class CssStyleDeclaration extends Interceptor with
|
| CssStyleDeclarationBase native "CSSStyleDeclaration,MSStyleCSSProperties,CSS2Properties" {
|
| factory CssStyleDeclaration() => new CssStyleDeclaration.css('');
|
|
|
| @@ -2874,7 +2880,7 @@ class CssRule extends Interceptor native "CSSRule" {
|
| style.cssText = css;
|
| return style;
|
| }
|
| -
|
| +
|
| String getPropertyValue(String propertyName) {
|
| var propValue = _getPropertyValue(propertyName);
|
| return propValue != null ? propValue : '';
|
| @@ -2894,7 +2900,7 @@ class CssRule extends Interceptor native "CSSRule" {
|
| }
|
| } catch (e) {}
|
| }
|
| -
|
| +
|
| /**
|
| * Checks to see if CSS Transitions are supported.
|
| */
|
| @@ -2974,7 +2980,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
|
| }
|
|
|
| abstract class CssStyleDeclarationBase {
|
| - String getPropertyValue(String propertyName);
|
| + String getPropertyValue(String propertyName);
|
| void setProperty(String propertyName, String value, [String priority]);
|
|
|
| // TODO(jacobr): generate this list of properties using the existing script.
|
| @@ -3834,8 +3840,8 @@ abstract class CssStyleDeclarationBase {
|
| }
|
|
|
| /** Gets the value of "box-sizing" */
|
| - String get boxSizing => Device.isFirefox ?
|
| - getPropertyValue('${Device.cssPrefix}box-sizing') :
|
| + String get boxSizing => Device.isFirefox ?
|
| + getPropertyValue('${Device.cssPrefix}box-sizing') :
|
| getPropertyValue('box-sizing');
|
|
|
| /** Sets the value of "box-sizing" */
|
| @@ -7843,16 +7849,19 @@ class DocumentFragment extends Node implements ParentNode native "DocumentFragme
|
| validator: validator, treeSanitizer: treeSanitizer);
|
| }
|
|
|
| + HtmlCollection get _children => throw new UnimplementedError(
|
| + 'Use _docChildren instead');
|
| +
|
| // Native field is used only by Dart code so does not lead to instantiation
|
| // of native classes
|
| @Creates('Null')
|
| - List<Element> _children;
|
| + List<Element> _docChildren;
|
|
|
| List<Element> get children {
|
| - if (_children == null) {
|
| - _children = new FilteredElementList(this);
|
| + if (_docChildren == null) {
|
| + _docChildren = new FilteredElementList(this);
|
| }
|
| - return _children;
|
| + return _docChildren;
|
| }
|
|
|
| void set children(List<Element> value) {
|
| @@ -7914,7 +7923,7 @@ class DocumentFragment extends Node implements ParentNode native "DocumentFragme
|
| this.append(new DocumentFragment.html(text));
|
| }
|
|
|
| - /**
|
| + /**
|
| * Alias for [querySelector]. Note this function is deprecated because its
|
| * semantics will be changing in the future.
|
| */
|
| @@ -7925,7 +7934,7 @@ class DocumentFragment extends Node implements ParentNode native "DocumentFragme
|
| return querySelector(relativeSelectors);
|
| }
|
|
|
| - /**
|
| + /**
|
| * Alias for [querySelectorAll]. Note this function is deprecated because its
|
| * semantics will be changing in the future.
|
| */
|
| @@ -7985,21 +7994,6 @@ class DocumentFragment extends Node implements ParentNode native "DocumentFragme
|
|
|
|
|
| @DocsEditable()
|
| -@DomName('DocumentType')
|
| -// http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
|
| -@deprecated // stable
|
| -class DocumentType extends Node implements ChildNode native "DocumentType" {
|
| - // To suppress missing implicit constructor warnings.
|
| - factory DocumentType._() { throw new UnsupportedError("Not supported"); }
|
| -
|
| - // From ChildNode
|
| -}
|
| -// 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
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| -
|
| -@DocsEditable()
|
| @DomName('DOMError')
|
| class DomError extends Interceptor native "DOMError" {
|
| // To suppress missing implicit constructor warnings.
|
| @@ -8086,11 +8080,11 @@ class DomImplementation extends Interceptor native "DOMImplementation" {
|
|
|
| @DomName('DOMImplementation.createDocument')
|
| @DocsEditable()
|
| - Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) native;
|
| + Document createDocument(String namespaceURI, String qualifiedName, _DocumentType doctype) native;
|
|
|
| @DomName('DOMImplementation.createDocumentType')
|
| @DocsEditable()
|
| - DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) native;
|
| + _DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) native;
|
|
|
| @JSName('createHTMLDocument')
|
| @DomName('DOMImplementation.createHTMLDocument')
|
| @@ -10901,19 +10895,6 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
|
| @DocsEditable()
|
| bool hidden;
|
|
|
| - /**
|
| - * The current state of IME composition.
|
| - *
|
| - * ## Other resources
|
| - *
|
| - * * [Input method editor specification]
|
| - * (http://www.w3.org/TR/ime-api/) from W3C.
|
| - */
|
| - @DomName('Element.inputMethodContext')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - final InputMethodContext inputMethodContext;
|
| -
|
| @DomName('Element.isContentEditable')
|
| @DocsEditable()
|
| final bool isContentEditable;
|
| @@ -12084,7 +12065,7 @@ class Event extends Interceptor native "Event" {
|
| e._initEvent(name, canBubble, cancelable);
|
| return e;
|
| }
|
| -
|
| +
|
| /** The CSS selector involved with event delegation. */
|
| String _selector;
|
|
|
| @@ -12402,18 +12383,18 @@ class ElementEvents extends Events {
|
| /* Raw event target. */
|
| final Element _ptr;
|
| static final webkitEvents = {
|
| - 'animationend' : 'webkitAnimationEnd',
|
| - 'animationiteration' : 'webkitAnimationIteration',
|
| - 'animationstart' : 'webkitAnimationStart',
|
| - 'fullscreenchange' : 'webkitfullscreenchange',
|
| + 'animationend' : 'webkitAnimationEnd',
|
| + 'animationiteration' : 'webkitAnimationIteration',
|
| + 'animationstart' : 'webkitAnimationStart',
|
| + 'fullscreenchange' : 'webkitfullscreenchange',
|
| 'fullscreenerror' : 'webkitfullscreenerror',
|
| - 'keyadded' : 'webkitkeyadded',
|
| - 'keyerror' : 'webkitkeyerror',
|
| - 'keymessage' : 'webkitkeymessage',
|
| - 'needkey' : 'webkitneedkey',
|
| - 'pointerlockchange' : 'webkitpointerlockchange',
|
| - 'pointerlockerror' : 'webkitpointerlockerror',
|
| - 'resourcetimingbufferfull' : 'webkitresourcetimingbufferfull',
|
| + 'keyadded' : 'webkitkeyadded',
|
| + 'keyerror' : 'webkitkeyerror',
|
| + 'keymessage' : 'webkitkeymessage',
|
| + 'needkey' : 'webkitneedkey',
|
| + 'pointerlockchange' : 'webkitpointerlockchange',
|
| + 'pointerlockerror' : 'webkitpointerlockerror',
|
| + 'resourcetimingbufferfull' : 'webkitresourcetimingbufferfull',
|
| 'transitionend': 'webkitTransitionEnd',
|
| 'speechchange' : 'webkitSpeechChange'
|
| };
|
| @@ -14512,10 +14493,6 @@ class HtmlDocument extends Document native "HTMLDocument" {
|
| class HtmlFormControlsCollection extends HtmlCollection native "HTMLFormControlsCollection" {
|
| // To suppress missing implicit constructor warnings.
|
| factory HtmlFormControlsCollection._() { throw new UnsupportedError("Not supported"); }
|
| -
|
| - @DomName('HTMLFormControlsCollection.__getter__')
|
| - @DocsEditable()
|
| - Node __getter__(int index) native;
|
| }
|
| // 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
|
| @@ -16537,15 +16514,15 @@ class KeyPair extends Interceptor native "KeyPair" {
|
| @DomName('KeyboardEvent')
|
| class KeyboardEvent extends UIEvent native "KeyboardEvent" {
|
|
|
| - /**
|
| - * Programmatically create a KeyboardEvent.
|
| + /**
|
| + * Programmatically create a KeyboardEvent.
|
| *
|
| * Due to browser differences, keyCode, charCode, or keyIdentifier values
|
| * cannot be specified in this base level constructor. This constructor
|
| * enables the user to programmatically create and dispatch a [KeyboardEvent],
|
| * but it will not contain any particular key content. For programmatically
|
| * creating keyboard events with specific key value contents, see the custom
|
| - * Event [KeyEvent].
|
| + * Event [KeyEvent].
|
| */
|
| factory KeyboardEvent(String type,
|
| {Window view, bool canBubble: true, bool cancelable: true,
|
| @@ -26472,10 +26449,10 @@ class Url extends Interceptor implements UrlUtils native "URL" {
|
|
|
| static String createObjectUrlFromSource(MediaSource source) =>
|
| JS('String', '(self.URL || self.webkitURL).createObjectURL(#)', source);
|
| -
|
| +
|
| static String createObjectUrlFromStream(MediaStream stream) =>
|
| JS('String', '(self.URL || self.webkitURL).createObjectURL(#)', stream);
|
| -
|
| +
|
| static String createObjectUrlFromBlob(Blob blob) =>
|
| JS('String', '(self.URL || self.webkitURL).createObjectURL(#)', blob);
|
|
|
| @@ -29226,6 +29203,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
|
| @@ -29255,11 +29241,6 @@ abstract class WindowEventHandlers extends EventTarget {
|
| // To suppress missing implicit constructor warnings.
|
| factory WindowEventHandlers._() { throw new UnsupportedError("Not supported"); }
|
|
|
| - @DomName('WindowEventHandlers.beforeunloadEvent')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamProvider<Event>('beforeunload');
|
| -
|
| @DomName('WindowEventHandlers.hashchangeEvent')
|
| @DocsEditable()
|
| @Experimental() // untriaged
|
| @@ -29300,11 +29281,6 @@ abstract class WindowEventHandlers extends EventTarget {
|
| @Experimental() // untriaged
|
| static const EventStreamProvider<Event> unloadEvent = const EventStreamProvider<Event>('unload');
|
|
|
| - @DomName('WindowEventHandlers.onbeforeunload')
|
| - @DocsEditable()
|
| - @Experimental() // untriaged
|
| - Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
|
| -
|
| @DomName('WindowEventHandlers.onhashchange')
|
| @DocsEditable()
|
| @Experimental() // untriaged
|
| @@ -30383,6 +30359,21 @@ abstract class _DirectoryReaderSync extends Interceptor native "DirectoryReaderS
|
|
|
|
|
| @DocsEditable()
|
| +@DomName('DocumentType')
|
| +// http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
|
| +@deprecated // stable
|
| +abstract class _DocumentType extends Node implements ChildNode native "DocumentType" {
|
| + // To suppress missing implicit constructor warnings.
|
| + factory _DocumentType._() { throw new UnsupportedError("Not supported"); }
|
| +
|
| + // From ChildNode
|
| +}
|
| +// 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
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +
|
| +@DocsEditable()
|
| @DomName('WebKitPoint')
|
| @SupportedBrowser(SupportedBrowser.CHROME)
|
| @SupportedBrowser(SupportedBrowser.SAFARI)
|
| @@ -31632,7 +31623,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.
|
|
|
| /**
|
| @@ -32705,6 +32696,9 @@ class _CustomEventStreamProvider<T extends Event>
|
| String getEventType(EventTarget target) {
|
| return _eventTypeGetter(target);
|
| }
|
| +
|
| + String get _eventType =>
|
| + throw new UnsupportedError('Access type through getEventType method.');
|
| }
|
| // DO NOT EDIT- this file is generated from running tool/generator.sh.
|
|
|
| @@ -34939,6 +34933,10 @@ abstract class ReadyState {
|
| */
|
| class _WrappedEvent implements Event {
|
| final Event wrapped;
|
| +
|
| + /** The CSS selector involved with event delegation. */
|
| + String _selector;
|
| +
|
| _WrappedEvent(this.wrapped);
|
|
|
| bool get bubbles => wrapped.bubbles;
|
| @@ -34976,6 +34974,43 @@ 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;
|
| +
|
| + dynamic get _get_currentTarget => wrapped._get_currentTarget;
|
| +
|
| + dynamic get _get_target => wrapped._get_target;
|
| }
|
| // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| @@ -35093,7 +35128,7 @@ class FixedSizeListIterator<T> implements Iterator<T> {
|
| final int _length; // Cache array length for faster access.
|
| int _position;
|
| T _current;
|
| -
|
| +
|
| FixedSizeListIterator(List<T> array)
|
| : _array = array,
|
| _position = -1,
|
| @@ -35629,6 +35664,17 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
|
| throw new UnsupportedError(
|
| "Cannot initialize a KeyboardEvent from a KeyEvent.");
|
| }
|
| + int get _layerX => throw new UnsupportedError('Not applicable to KeyEvent');
|
| + int get _layerY => throw new UnsupportedError('Not applicable to KeyEvent');
|
| + int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent');
|
| + int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent');
|
| + @Experimental() // untriaged
|
| + bool getModifierState(String keyArgument) => throw new UnimplementedError();
|
| + @Experimental() // untriaged
|
| + int get location => throw new UnimplementedError();
|
| + @Experimental() // untriaged
|
| + bool get repeat => throw new UnimplementedError();
|
| + dynamic get _get_view => throw new UnimplementedError();
|
| }
|
| // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
|
|