| OLD | NEW |
| 1 #library('html'); | 1 #library('html'); |
| 2 | 2 |
| 3 #import('dart:dom', prefix:'dom'); | 3 #import('dart:dom', prefix:'dom'); |
| 4 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 4 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 5 // for details. All rights reserved. Use of this source code is governed by a | 5 // for details. All rights reserved. Use of this source code is governed by a |
| 6 // BSD-style license that can be found in the LICENSE file. | 6 // BSD-style license that can be found in the LICENSE file. |
| 7 | 7 |
| 8 // DO NOT EDIT | 8 // DO NOT EDIT |
| 9 // Auto-generated Dart HTML library. | 9 // Auto-generated Dart HTML library. |
| 10 | 10 |
| (...skipping 16809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16820 class _CSSMatrixFactoryProvider { | 16820 class _CSSMatrixFactoryProvider { |
| 16821 | 16821 |
| 16822 factory CSSMatrix([String spec = '']) { | 16822 factory CSSMatrix([String spec = '']) { |
| 16823 return new CSSMatrixWrappingImplementation._wrap( | 16823 return new CSSMatrixWrappingImplementation._wrap( |
| 16824 new dom.WebKitCSSMatrix(spec)); | 16824 new dom.WebKitCSSMatrix(spec)); |
| 16825 } | 16825 } |
| 16826 } | 16826 } |
| 16827 | 16827 |
| 16828 class _PointFactoryProvider { | 16828 class _PointFactoryProvider { |
| 16829 | 16829 |
| 16830 /** @domName Window.createWebKitPoint */ |
| 16830 factory Point(num x, num y) { | 16831 factory Point(num x, num y) { |
| 16831 return new PointWrappingImplementation._wrap(new dom.WebKitPoint(x, y)); | 16832 return new PointWrappingImplementation._wrap(new dom.WebKitPoint(x, y)); |
| 16832 } | 16833 } |
| 16833 } | 16834 } |
| 16834 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 16835 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 16835 // for details. All rights reserved. Use of this source code is governed by a | 16836 // for details. All rights reserved. Use of this source code is governed by a |
| 16836 // BSD-style license that can be found in the LICENSE file. | 16837 // BSD-style license that can be found in the LICENSE file. |
| 16837 | 16838 |
| 16838 // Iterator for lists with fixed size. | 16839 // Iterator for lists with fixed size. |
| 16839 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> { | 16840 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> { |
| (...skipping 5605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22445 final List<ClientRect> clientRects = const <ClientRect>[]; | 22446 final List<ClientRect> clientRects = const <ClientRect>[]; |
| 22446 | 22447 |
| 22447 const EmptyElementRect(); | 22448 const EmptyElementRect(); |
| 22448 } | 22449 } |
| 22449 | 22450 |
| 22450 class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation
implements DocumentFragment { | 22451 class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation
implements DocumentFragment { |
| 22451 ElementList _elements; | 22452 ElementList _elements; |
| 22452 | 22453 |
| 22453 DocumentFragmentWrappingImplementation._wrap(ptr) : super._wrap(ptr) {} | 22454 DocumentFragmentWrappingImplementation._wrap(ptr) : super._wrap(ptr) {} |
| 22454 | 22455 |
| 22456 /** @domName Document.createDocumentFragment */ |
| 22455 factory DocumentFragmentWrappingImplementation() { | 22457 factory DocumentFragmentWrappingImplementation() { |
| 22456 return new DocumentFragmentWrappingImplementation._wrap( | 22458 return new DocumentFragmentWrappingImplementation._wrap( |
| 22457 dom.document.createDocumentFragment()); | 22459 dom.document.createDocumentFragment()); |
| 22458 } | 22460 } |
| 22459 | 22461 |
| 22460 factory DocumentFragmentWrappingImplementation.html(String html) { | 22462 factory DocumentFragmentWrappingImplementation.html(String html) { |
| 22461 var fragment = new DocumentFragment(); | 22463 var fragment = new DocumentFragment(); |
| 22462 fragment.innerHTML = html; | 22464 fragment.innerHTML = html; |
| 22463 return fragment; | 22465 return fragment; |
| 22464 } | 22466 } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22688 class DocumentWrappingImplementation extends ElementWrappingImplementation imple
ments Document { | 22690 class DocumentWrappingImplementation extends ElementWrappingImplementation imple
ments Document { |
| 22689 | 22691 |
| 22690 final _documentPtr; | 22692 final _documentPtr; |
| 22691 | 22693 |
| 22692 DocumentWrappingImplementation._wrap(this._documentPtr, ptr) : super._wrap(ptr
) { | 22694 DocumentWrappingImplementation._wrap(this._documentPtr, ptr) : super._wrap(ptr
) { |
| 22693 // We have to set the back ptr on the document as well as the documentElemen
t | 22695 // We have to set the back ptr on the document as well as the documentElemen
t |
| 22694 // so that it is always simple to detect when an existing wrapper exists. | 22696 // so that it is always simple to detect when an existing wrapper exists. |
| 22695 _documentPtr.dartObjectLocalStorage = this; | 22697 _documentPtr.dartObjectLocalStorage = this; |
| 22696 } | 22698 } |
| 22697 | 22699 |
| 22700 /** @domName HTMLDocument.activeElement */ |
| 22698 Element get activeElement() => LevelDom.wrapElement(_documentPtr.activeElement
); | 22701 Element get activeElement() => LevelDom.wrapElement(_documentPtr.activeElement
); |
| 22699 | 22702 |
| 22700 Node get parent() => null; | 22703 Node get parent() => null; |
| 22701 | 22704 |
| 22705 /** @domName Document.body */ |
| 22702 Element get body() => LevelDom.wrapElement(_documentPtr.body); | 22706 Element get body() => LevelDom.wrapElement(_documentPtr.body); |
| 22703 | 22707 |
| 22708 /** @domName Document.body */ |
| 22704 void set body(Element value) { _documentPtr.body = LevelDom.unwrap(value); } | 22709 void set body(Element value) { _documentPtr.body = LevelDom.unwrap(value); } |
| 22705 | 22710 |
| 22711 /** @domName Document.charset */ |
| 22706 String get charset() => _documentPtr.charset; | 22712 String get charset() => _documentPtr.charset; |
| 22707 | 22713 |
| 22714 /** @domName Document.charset */ |
| 22708 void set charset(String value) { _documentPtr.charset = value; } | 22715 void set charset(String value) { _documentPtr.charset = value; } |
| 22709 | 22716 |
| 22717 /** @domName Document.cookie */ |
| 22710 String get cookie() => _documentPtr.cookie; | 22718 String get cookie() => _documentPtr.cookie; |
| 22711 | 22719 |
| 22720 /** @domName Document.cookie */ |
| 22712 void set cookie(String value) { _documentPtr.cookie = value; } | 22721 void set cookie(String value) { _documentPtr.cookie = value; } |
| 22713 | 22722 |
| 22723 /** @domName Document.defaultView */ |
| 22714 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView); | 22724 Window get window() => LevelDom.wrapWindow(_documentPtr.defaultView); |
| 22715 | 22725 |
| 22726 /** @domName HTMLDocument.designMode */ |
| 22716 void set designMode(String value) { _documentPtr.designMode = value; } | 22727 void set designMode(String value) { _documentPtr.designMode = value; } |
| 22717 | 22728 |
| 22729 /** @domName Document.domain */ |
| 22718 String get domain() => _documentPtr.domain; | 22730 String get domain() => _documentPtr.domain; |
| 22719 | 22731 |
| 22732 /** @domName Document.head */ |
| 22720 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head); | 22733 HeadElement get head() => LevelDom.wrapHeadElement(_documentPtr.head); |
| 22721 | 22734 |
| 22735 /** @domName Document.lastModified */ |
| 22722 String get lastModified() => _documentPtr.lastModified; | 22736 String get lastModified() => _documentPtr.lastModified; |
| 22723 | 22737 |
| 22738 /** @domName Document.readyState */ |
| 22724 String get readyState() => _documentPtr.readyState; | 22739 String get readyState() => _documentPtr.readyState; |
| 22725 | 22740 |
| 22741 /** @domName Document.referrer */ |
| 22726 String get referrer() => _documentPtr.referrer; | 22742 String get referrer() => _documentPtr.referrer; |
| 22727 | 22743 |
| 22744 /** @domName Document.styleSheets */ |
| 22728 StyleSheetList get styleSheets() => LevelDom.wrapStyleSheetList(_documentPtr.s
tyleSheets); | 22745 StyleSheetList get styleSheets() => LevelDom.wrapStyleSheetList(_documentPtr.s
tyleSheets); |
| 22729 | 22746 |
| 22747 /** @domName Document.title */ |
| 22730 String get title() => _documentPtr.title; | 22748 String get title() => _documentPtr.title; |
| 22731 | 22749 |
| 22750 /** @domName Document.title */ |
| 22732 void set title(String value) { _documentPtr.title = value; } | 22751 void set title(String value) { _documentPtr.title = value; } |
| 22733 | 22752 |
| 22753 /** @domName Document.webkitHidden */ |
| 22734 bool get webkitHidden() => _documentPtr.webkitHidden; | 22754 bool get webkitHidden() => _documentPtr.webkitHidden; |
| 22735 | 22755 |
| 22756 /** @domName Document.webkitVisibilityState */ |
| 22736 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; | 22757 String get webkitVisibilityState() => _documentPtr.webkitVisibilityState; |
| 22737 | 22758 |
| 22759 /** @domName Document.caretRangeFromPoint */ |
| 22738 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { | 22760 Future<Range> caretRangeFromPoint([int x = null, int y = null]) { |
| 22739 return _createMeasurementFuture( | 22761 return _createMeasurementFuture( |
| 22740 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), | 22762 () => LevelDom.wrapRange(_documentPtr.caretRangeFromPoint(x, y)), |
| 22741 new Completer<Range>()); | 22763 new Completer<Range>()); |
| 22742 } | 22764 } |
| 22743 | 22765 |
| 22766 /** @domName Document.createElement */ |
| 22744 Element createElement([String tagName = null]) { | 22767 Element createElement([String tagName = null]) { |
| 22745 return LevelDom.wrapElement(_documentPtr.createElement(tagName)); | 22768 return LevelDom.wrapElement(_documentPtr.createElement(tagName)); |
| 22746 } | 22769 } |
| 22747 | 22770 |
| 22771 /** @domName Document.createEvent */ |
| 22748 Event createEvent([String eventType = null]) { | 22772 Event createEvent([String eventType = null]) { |
| 22749 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); | 22773 return LevelDom.wrapEvent(_documentPtr.createEvent(eventType)); |
| 22750 } | 22774 } |
| 22751 | 22775 |
| 22776 /** @domName Document.elementFromPoint */ |
| 22752 Future<Element> elementFromPoint([int x = null, int y = null]) { | 22777 Future<Element> elementFromPoint([int x = null, int y = null]) { |
| 22753 return _createMeasurementFuture( | 22778 return _createMeasurementFuture( |
| 22754 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), | 22779 () => LevelDom.wrapElement(_documentPtr.elementFromPoint(x, y)), |
| 22755 new Completer<Element>()); | 22780 new Completer<Element>()); |
| 22756 } | 22781 } |
| 22757 | 22782 |
| 22783 /** @domName Document.execCommand */ |
| 22758 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { | 22784 bool execCommand([String command = null, bool userInterface = null, String val
ue = null]) { |
| 22759 return _documentPtr.execCommand(command, userInterface, value); | 22785 return _documentPtr.execCommand(command, userInterface, value); |
| 22760 } | 22786 } |
| 22761 | 22787 |
| 22788 /** @domName Document.getCSSCanvasContext */ |
| 22762 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, | 22789 CanvasRenderingContext getCSSCanvasContext(String contextId, String name, |
| 22763 int width, int height) { | 22790 int width, int height) { |
| 22764 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); | 22791 return LevelDom.wrapCanvasRenderingContext(_documentPtr.getCSSCanvasContext(
contextId, name, width, height)); |
| 22765 } | 22792 } |
| 22766 | 22793 |
| 22794 /** @domName Document.queryCommandEnabled */ |
| 22767 bool queryCommandEnabled([String command = null]) { | 22795 bool queryCommandEnabled([String command = null]) { |
| 22768 return _documentPtr.queryCommandEnabled(command); | 22796 return _documentPtr.queryCommandEnabled(command); |
| 22769 } | 22797 } |
| 22770 | 22798 |
| 22799 /** @domName Document.queryCommandIndeterm */ |
| 22771 bool queryCommandIndeterm([String command = null]) { | 22800 bool queryCommandIndeterm([String command = null]) { |
| 22772 return _documentPtr.queryCommandIndeterm(command); | 22801 return _documentPtr.queryCommandIndeterm(command); |
| 22773 } | 22802 } |
| 22774 | 22803 |
| 22804 /** @domName Document.queryCommandState */ |
| 22775 bool queryCommandState([String command = null]) { | 22805 bool queryCommandState([String command = null]) { |
| 22776 return _documentPtr.queryCommandState(command); | 22806 return _documentPtr.queryCommandState(command); |
| 22777 } | 22807 } |
| 22778 | 22808 |
| 22809 /** @domName Document.queryCommandSupported */ |
| 22779 bool queryCommandSupported([String command = null]) { | 22810 bool queryCommandSupported([String command = null]) { |
| 22780 return _documentPtr.queryCommandSupported(command); | 22811 return _documentPtr.queryCommandSupported(command); |
| 22781 } | 22812 } |
| 22782 | 22813 |
| 22814 /** @domName Document.queryCommandValue */ |
| 22783 String queryCommandValue([String command = null]) { | 22815 String queryCommandValue([String command = null]) { |
| 22784 return _documentPtr.queryCommandValue(command); | 22816 return _documentPtr.queryCommandValue(command); |
| 22785 } | 22817 } |
| 22786 | 22818 |
| 22787 String get manifest() => _ptr.manifest; | 22819 String get manifest() => _ptr.manifest; |
| 22788 | 22820 |
| 22789 void set manifest(String value) { _ptr.manifest = value; } | 22821 void set manifest(String value) { _ptr.manifest = value; } |
| 22790 | 22822 |
| 22791 DocumentEvents get on() { | 22823 DocumentEvents get on() { |
| 22792 if (_on === null) { | 22824 if (_on === null) { |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23377 bool containsValue(String value) { | 23409 bool containsValue(String value) { |
| 23378 final attributes = _element.attributes; | 23410 final attributes = _element.attributes; |
| 23379 for (int i = 0, len = attributes.length; i < len; i++) { | 23411 for (int i = 0, len = attributes.length; i < len; i++) { |
| 23380 if(value == attributes.item(i).value) { | 23412 if(value == attributes.item(i).value) { |
| 23381 return true; | 23413 return true; |
| 23382 } | 23414 } |
| 23383 } | 23415 } |
| 23384 return false; | 23416 return false; |
| 23385 } | 23417 } |
| 23386 | 23418 |
| 23419 /** @domName Element.hasAttribute */ |
| 23387 bool containsKey(String key) { | 23420 bool containsKey(String key) { |
| 23388 return _element.hasAttribute(key); | 23421 return _element.hasAttribute(key); |
| 23389 } | 23422 } |
| 23390 | 23423 |
| 23424 /** @domName Element.getAttribute */ |
| 23391 String operator [](String key) { | 23425 String operator [](String key) { |
| 23392 return _element.getAttribute(key); | 23426 return _element.getAttribute(key); |
| 23393 } | 23427 } |
| 23394 | 23428 |
| 23429 /** @domName Element.setAttribute */ |
| 23395 void operator []=(String key, String value) { | 23430 void operator []=(String key, String value) { |
| 23396 _element.setAttribute(key, value); | 23431 _element.setAttribute(key, value); |
| 23397 } | 23432 } |
| 23398 | 23433 |
| 23399 String putIfAbsent(String key, String ifAbsent()) { | 23434 String putIfAbsent(String key, String ifAbsent()) { |
| 23400 if (!containsKey(key)) { | 23435 if (!containsKey(key)) { |
| 23401 this[key] = ifAbsent(); | 23436 this[key] = ifAbsent(); |
| 23402 } | 23437 } |
| 23403 } | 23438 } |
| 23404 | 23439 |
| 23440 /** @domName Element.removeAttribute */ |
| 23405 String remove(String key) { | 23441 String remove(String key) { |
| 23406 _element.removeAttribute(key); | 23442 _element.removeAttribute(key); |
| 23407 } | 23443 } |
| 23408 | 23444 |
| 23409 void clear() { | 23445 void clear() { |
| 23410 final attributes = _element.attributes; | 23446 final attributes = _element.attributes; |
| 23411 for (int i = attributes.length - 1; i >= 0; i--) { | 23447 for (int i = attributes.length - 1; i >= 0; i--) { |
| 23412 _element.removeAttribute(attributes.item(i).name); | 23448 _element.removeAttribute(attributes.item(i).name); |
| 23413 } | 23449 } |
| 23414 } | 23450 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23523 } | 23559 } |
| 23524 | 23560 |
| 23525 String toString() => "($left, $top, $width, $height)"; | 23561 String toString() => "($left, $top, $width, $height)"; |
| 23526 } | 23562 } |
| 23527 | 23563 |
| 23528 // TODO(jacobr): we cannot currently be lazy about calculating the client | 23564 // TODO(jacobr): we cannot currently be lazy about calculating the client |
| 23529 // rects as we must perform all measurement queries at a safe point to avoid | 23565 // rects as we must perform all measurement queries at a safe point to avoid |
| 23530 // triggering unneeded layouts. | 23566 // triggering unneeded layouts. |
| 23531 /** | 23567 /** |
| 23532 * All your element measurement needs in one place | 23568 * All your element measurement needs in one place |
| 23569 * @domName none |
| 23533 */ | 23570 */ |
| 23534 class ElementRectWrappingImplementation implements ElementRect { | 23571 class ElementRectWrappingImplementation implements ElementRect { |
| 23535 final ClientRect client; | 23572 final ClientRect client; |
| 23536 final ClientRect offset; | 23573 final ClientRect offset; |
| 23537 final ClientRect scroll; | 23574 final ClientRect scroll; |
| 23538 | 23575 |
| 23539 // TODO(jacobr): should we move these outside of ElementRect to avoid the | 23576 // TODO(jacobr): should we move these outside of ElementRect to avoid the |
| 23540 // overhead of computing them every time even though they are rarely used. | 23577 // overhead of computing them every time even though they are rarely used. |
| 23541 // This should be type dom.ClientRect but that fails on dartium. b/5522629 | 23578 // This should be type dom.ClientRect but that fails on dartium. b/5522629 |
| 23542 final _boundingClientRect; | 23579 final _boundingClientRect; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23756 } | 23793 } |
| 23757 | 23794 |
| 23758 bool contains(Node element) { | 23795 bool contains(Node element) { |
| 23759 return _ptr.contains(LevelDom.unwrap(element)); | 23796 return _ptr.contains(LevelDom.unwrap(element)); |
| 23760 } | 23797 } |
| 23761 | 23798 |
| 23762 void focus() { | 23799 void focus() { |
| 23763 _ptr.focus(); | 23800 _ptr.focus(); |
| 23764 } | 23801 } |
| 23765 | 23802 |
| 23803 /** @domName HTMLElement.insertAdjacentElement */ |
| 23766 Element insertAdjacentElement([String where = null, Element element = null]) { | 23804 Element insertAdjacentElement([String where = null, Element element = null]) { |
| 23767 return LevelDom.wrapElement(_ptr.insertAdjacentElement(where, LevelDom.unwra
p(element))); | 23805 return LevelDom.wrapElement(_ptr.insertAdjacentElement(where, LevelDom.unwra
p(element))); |
| 23768 } | 23806 } |
| 23769 | 23807 |
| 23808 /** @domName HTMLElement.insertAdjacentHTML */ |
| 23770 void insertAdjacentHTML([String position_OR_where = null, String text = null])
{ | 23809 void insertAdjacentHTML([String position_OR_where = null, String text = null])
{ |
| 23771 _ptr.insertAdjacentHTML(position_OR_where, text); | 23810 _ptr.insertAdjacentHTML(position_OR_where, text); |
| 23772 } | 23811 } |
| 23773 | 23812 |
| 23813 /** @domName HTMLElement.insertAdjacentText */ |
| 23774 void insertAdjacentText([String where = null, String text = null]) { | 23814 void insertAdjacentText([String where = null, String text = null]) { |
| 23775 _ptr.insertAdjacentText(where, text); | 23815 _ptr.insertAdjacentText(where, text); |
| 23776 } | 23816 } |
| 23777 | 23817 |
| 23778 Element query(String selectors) { | 23818 Element query(String selectors) { |
| 23779 // TODO(jacobr): scope fix. | 23819 // TODO(jacobr): scope fix. |
| 23780 return LevelDom.wrapElement(_ptr.querySelector(selectors)); | 23820 return LevelDom.wrapElement(_ptr.querySelector(selectors)); |
| 23781 } | 23821 } |
| 23782 | 23822 |
| 23783 ElementList queryAll(String selectors) { | 23823 ElementList queryAll(String selectors) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 23798 } | 23838 } |
| 23799 | 23839 |
| 23800 bool matchesSelector([String selectors = null]) { | 23840 bool matchesSelector([String selectors = null]) { |
| 23801 return _ptr.webkitMatchesSelector(selectors); | 23841 return _ptr.webkitMatchesSelector(selectors); |
| 23802 } | 23842 } |
| 23803 | 23843 |
| 23804 void set scrollLeft(int value) { _ptr.scrollLeft = value; } | 23844 void set scrollLeft(int value) { _ptr.scrollLeft = value; } |
| 23805 | 23845 |
| 23806 void set scrollTop(int value) { _ptr.scrollTop = value; } | 23846 void set scrollTop(int value) { _ptr.scrollTop = value; } |
| 23807 | 23847 |
| 23848 /** @domName getClientRects */ |
| 23808 Future<ElementRect> get rect() { | 23849 Future<ElementRect> get rect() { |
| 23809 return _createMeasurementFuture( | 23850 return _createMeasurementFuture( |
| 23810 () => new ElementRectWrappingImplementation(_ptr), | 23851 () => new ElementRectWrappingImplementation(_ptr), |
| 23811 new Completer<ElementRect>()); | 23852 new Completer<ElementRect>()); |
| 23812 } | 23853 } |
| 23813 | 23854 |
| 23814 Future<CSSStyleDeclaration> get computedStyle() { | 23855 Future<CSSStyleDeclaration> get computedStyle() { |
| 23815 // TODO(jacobr): last param should be null, see b/5045788 | 23856 // TODO(jacobr): last param should be null, see b/5045788 |
| 23816 return getComputedStyle(''); | 23857 return getComputedStyle(''); |
| 23817 } | 23858 } |
| 23818 | 23859 |
| 23860 /** @domName Window.getComputedStyle */ |
| 23819 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) { | 23861 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) { |
| 23820 return _createMeasurementFuture(() => | 23862 return _createMeasurementFuture(() => |
| 23821 LevelDom.wrapCSSStyleDeclaration( | 23863 LevelDom.wrapCSSStyleDeclaration( |
| 23822 dom.window.getComputedStyle(_ptr, pseudoElement)), | 23864 dom.window.getComputedStyle(_ptr, pseudoElement)), |
| 23823 new Completer<CSSStyleDeclaration>()); | 23865 new Completer<CSSStyleDeclaration>()); |
| 23824 } | 23866 } |
| 23825 | 23867 |
| 23826 ElementEvents get on() { | 23868 ElementEvents get on() { |
| 23827 if (_on === null) { | 23869 if (_on === null) { |
| 23828 _on = new ElementEventsImplementation._wrap(_ptr); | 23870 _on = new ElementEventsImplementation._wrap(_ptr); |
| (...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25283 | 25325 |
| 25284 bool some(bool f(Node element)) { | 25326 bool some(bool f(Node element)) { |
| 25285 for(Node element in this) { | 25327 for(Node element in this) { |
| 25286 if (f(element)) { | 25328 if (f(element)) { |
| 25287 return true; | 25329 return true; |
| 25288 } | 25330 } |
| 25289 }; | 25331 }; |
| 25290 return false; | 25332 return false; |
| 25291 } | 25333 } |
| 25292 | 25334 |
| 25335 /** @domName Node.hasChildNodes */ |
| 25293 bool isEmpty() { | 25336 bool isEmpty() { |
| 25294 return _node.hasChildNodes(); | 25337 return _node.hasChildNodes(); |
| 25295 } | 25338 } |
| 25296 | 25339 |
| 25297 int get length() { | 25340 int get length() { |
| 25298 return _childNodes.length; | 25341 return _childNodes.length; |
| 25299 } | 25342 } |
| 25300 | 25343 |
| 25301 Node operator [](int index) { | 25344 Node operator [](int index) { |
| 25302 return LevelDom.wrapNode(_childNodes[index]); | 25345 return LevelDom.wrapNode(_childNodes[index]); |
| 25303 } | 25346 } |
| 25304 | 25347 |
| 25305 void operator []=(int index, Node value) { | 25348 void operator []=(int index, Node value) { |
| 25306 _childNodes[index] = LevelDom.unwrap(value); | 25349 _childNodes[index] = LevelDom.unwrap(value); |
| 25307 } | 25350 } |
| 25308 | 25351 |
| 25309 void set length(int newLength) { | 25352 void set length(int newLength) { |
| 25310 throw new UnsupportedOperationException(''); | 25353 throw new UnsupportedOperationException(''); |
| 25311 } | 25354 } |
| 25312 | 25355 |
| 25356 /** @domName Node.appendChild */ |
| 25313 Node add(Node value) { | 25357 Node add(Node value) { |
| 25314 _node.appendChild(LevelDom.unwrap(value)); | 25358 _node.appendChild(LevelDom.unwrap(value)); |
| 25315 return value; | 25359 return value; |
| 25316 } | 25360 } |
| 25317 | 25361 |
| 25318 Node addLast(Node value) { | 25362 Node addLast(Node value) { |
| 25319 _node.appendChild(LevelDom.unwrap(value)); | 25363 _node.appendChild(LevelDom.unwrap(value)); |
| 25320 return value; | 25364 return value; |
| 25321 } | 25365 } |
| 25322 | 25366 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25422 } | 25466 } |
| 25423 | 25467 |
| 25424 Node remove() { | 25468 Node remove() { |
| 25425 // TODO(jacobr): should we throw an exception if parent is already null? | 25469 // TODO(jacobr): should we throw an exception if parent is already null? |
| 25426 if (_ptr.parentNode !== null) { | 25470 if (_ptr.parentNode !== null) { |
| 25427 _ptr.parentNode.removeChild(_ptr); | 25471 _ptr.parentNode.removeChild(_ptr); |
| 25428 } | 25472 } |
| 25429 return this; | 25473 return this; |
| 25430 } | 25474 } |
| 25431 | 25475 |
| 25476 /** @domName Node.contains */ |
| 25432 bool contains(Node otherNode) { | 25477 bool contains(Node otherNode) { |
| 25433 // TODO: Feature detect and use built in. | 25478 // TODO: Feature detect and use built in. |
| 25434 while (otherNode != null && otherNode != this) { | 25479 while (otherNode != null && otherNode != this) { |
| 25435 otherNode = otherNode.parent; | 25480 otherNode = otherNode.parent; |
| 25436 } | 25481 } |
| 25437 return otherNode == this; | 25482 return otherNode == this; |
| 25438 } | 25483 } |
| 25439 | 25484 |
| 25440 // TODO(jacobr): remove when/if List supports a method similar to | 25485 // TODO(jacobr): remove when/if List supports a method similar to |
| 25441 // insertBefore or we switch NodeList to implement LinkedList rather than | 25486 // insertBefore or we switch NodeList to implement LinkedList rather than |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25547 | 25592 |
| 25548 bool get verticalOverflow(); | 25593 bool get verticalOverflow(); |
| 25549 } | 25594 } |
| 25550 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 25595 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 25551 // for details. All rights reserved. Use of this source code is governed by a | 25596 // for details. All rights reserved. Use of this source code is governed by a |
| 25552 // BSD-style license that can be found in the LICENSE file. | 25597 // BSD-style license that can be found in the LICENSE file. |
| 25553 | 25598 |
| 25554 class OverflowEventWrappingImplementation extends EventWrappingImplementation im
plements OverflowEvent { | 25599 class OverflowEventWrappingImplementation extends EventWrappingImplementation im
plements OverflowEvent { |
| 25555 OverflowEventWrappingImplementation._wrap(ptr) : super._wrap(ptr); | 25600 OverflowEventWrappingImplementation._wrap(ptr) : super._wrap(ptr); |
| 25556 | 25601 |
| 25602 /** @domName OverflowEvent.initOverflowEvent */ |
| 25557 factory OverflowEventWrappingImplementation(int orient, | 25603 factory OverflowEventWrappingImplementation(int orient, |
| 25558 bool horizontalOverflow, bool verticalOverflow) { | 25604 bool horizontalOverflow, bool verticalOverflow) { |
| 25559 final e = dom.document.createEvent("OverflowEvent"); | 25605 final e = dom.document.createEvent("OverflowEvent"); |
| 25560 e.initOverflowEvent(orient, horizontalOverflow, verticalOverflow); | 25606 e.initOverflowEvent(orient, horizontalOverflow, verticalOverflow); |
| 25561 return LevelDom.wrapOverflowEvent(e); | 25607 return LevelDom.wrapOverflowEvent(e); |
| 25562 } | 25608 } |
| 25563 | 25609 |
| 25564 bool get horizontalOverflow() => _ptr.horizontalOverflow; | 25610 bool get horizontalOverflow() => _ptr.horizontalOverflow; |
| 25565 | 25611 |
| 25566 int get orient() => _ptr.orient; | 25612 int get orient() => _ptr.orient; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25765 return LevelDom.wrapTextEvent(e); | 25811 return LevelDom.wrapTextEvent(e); |
| 25766 } | 25812 } |
| 25767 | 25813 |
| 25768 String get data() => _ptr.data; | 25814 String get data() => _ptr.data; |
| 25769 } | 25815 } |
| 25770 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 25816 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 25771 // for details. All rights reserved. Use of this source code is governed by a | 25817 // for details. All rights reserved. Use of this source code is governed by a |
| 25772 // BSD-style license that can be found in the LICENSE file. | 25818 // BSD-style license that can be found in the LICENSE file. |
| 25773 | 25819 |
| 25774 class TextWrappingImplementation extends CharacterDataWrappingImplementation imp
lements Text { | 25820 class TextWrappingImplementation extends CharacterDataWrappingImplementation imp
lements Text { |
| 25821 /** @domName Document.createTextNode */ |
| 25775 factory TextWrappingImplementation(String content) { | 25822 factory TextWrappingImplementation(String content) { |
| 25776 return new TextWrappingImplementation._wrap( | 25823 return new TextWrappingImplementation._wrap( |
| 25777 dom.document.createTextNode(content)); | 25824 dom.document.createTextNode(content)); |
| 25778 } | 25825 } |
| 25779 | 25826 |
| 25780 TextWrappingImplementation._wrap(ptr) : super._wrap(ptr); | 25827 TextWrappingImplementation._wrap(ptr) : super._wrap(ptr); |
| 25781 | 25828 |
| 25782 String get wholeText() => _ptr.wholeText; | 25829 String get wholeText() => _ptr.wholeText; |
| 25783 | 25830 |
| 25784 Text replaceWholeText([String content = null]) { | 25831 Text replaceWholeText([String content = null]) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25827 | 25874 |
| 25828 TouchList get touches(); | 25875 TouchList get touches(); |
| 25829 } | 25876 } |
| 25830 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 25877 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 25831 // for details. All rights reserved. Use of this source code is governed by a | 25878 // for details. All rights reserved. Use of this source code is governed by a |
| 25832 // BSD-style license that can be found in the LICENSE file. | 25879 // BSD-style license that can be found in the LICENSE file. |
| 25833 | 25880 |
| 25834 class TouchEventWrappingImplementation extends UIEventWrappingImplementation imp
lements TouchEvent { | 25881 class TouchEventWrappingImplementation extends UIEventWrappingImplementation imp
lements TouchEvent { |
| 25835 TouchEventWrappingImplementation._wrap(ptr) : super._wrap(ptr); | 25882 TouchEventWrappingImplementation._wrap(ptr) : super._wrap(ptr); |
| 25836 | 25883 |
| 25837 TouchEvent(TouchList touches, TouchList targetTouches, | 25884 factory TouchEvent(TouchList touches, TouchList targetTouches, |
| 25838 TouchList changedTouches, String type, Window view, int screenX, | 25885 TouchList changedTouches, String type, Window view, int screenX, |
| 25839 int screenY, int clientX, int clientY, [bool ctrlKey = false, | 25886 int screenY, int clientX, int clientY, [bool ctrlKey = false, |
| 25840 bool altKey = false, bool shiftKey = false, bool metaKey = false]) { | 25887 bool altKey = false, bool shiftKey = false, bool metaKey = false]) { |
| 25841 final e = dom.document.createEvent("TouchEvent"); | 25888 final e = dom.document.createEvent("TouchEvent"); |
| 25842 e.initTouchEvent(LevelDom.unwrap(touches), LevelDom.unwrap(targetTouches), | 25889 e.initTouchEvent(LevelDom.unwrap(touches), LevelDom.unwrap(targetTouches), |
| 25843 LevelDom.unwrap(changedTouches), type, LevelDom.unwrap(view), screenX, | 25890 LevelDom.unwrap(changedTouches), type, LevelDom.unwrap(view), screenX, |
| 25844 screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey); | 25891 screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey); |
| 25845 return LevelDom.wrapTouchEvent(e); | 25892 return LevelDom.wrapTouchEvent(e); |
| 25846 } | 25893 } |
| 25847 | 25894 |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 26544 EventListenerList get unLoad() => _get('unload'); | 26591 EventListenerList get unLoad() => _get('unload'); |
| 26545 EventListenerList get volumeChange() => _get('volumechange'); | 26592 EventListenerList get volumeChange() => _get('volumechange'); |
| 26546 EventListenerList get waiting() => _get('waiting'); | 26593 EventListenerList get waiting() => _get('waiting'); |
| 26547 EventListenerList get animationEnd() => _get('webkitAnimationEnd'); | 26594 EventListenerList get animationEnd() => _get('webkitAnimationEnd'); |
| 26548 EventListenerList get animationIteration() => _get('webkitAnimationIteration')
; | 26595 EventListenerList get animationIteration() => _get('webkitAnimationIteration')
; |
| 26549 EventListenerList get animationStart() => _get('webkitAnimationStart'); | 26596 EventListenerList get animationStart() => _get('webkitAnimationStart'); |
| 26550 EventListenerList get transitionEnd() => _get('webkitTransitionEnd'); | 26597 EventListenerList get transitionEnd() => _get('webkitTransitionEnd'); |
| 26551 EventListenerList get contentLoaded() => _get('DOMContentLoaded'); | 26598 EventListenerList get contentLoaded() => _get('DOMContentLoaded'); |
| 26552 } | 26599 } |
| 26553 | 26600 |
| 26601 /** @domName Window */ |
| 26554 class WindowWrappingImplementation extends EventTargetWrappingImplementation imp
lements Window { | 26602 class WindowWrappingImplementation extends EventTargetWrappingImplementation imp
lements Window { |
| 26555 WindowWrappingImplementation._wrap(ptr) : super._wrap(ptr); | 26603 WindowWrappingImplementation._wrap(ptr) : super._wrap(ptr); |
| 26556 | 26604 |
| 26557 DOMApplicationCache get applicationCache() => LevelDom.wrapDOMApplicationCache
(_ptr.applicationCache); | 26605 DOMApplicationCache get applicationCache() => LevelDom.wrapDOMApplicationCache
(_ptr.applicationCache); |
| 26558 | 26606 |
| 26559 Navigator get clientInformation() => LevelDom.wrapNavigator(_ptr.clientInforma
tion); | 26607 Navigator get clientInformation() => LevelDom.wrapNavigator(_ptr.clientInforma
tion); |
| 26560 | 26608 |
| 26561 void set clientInformation(Navigator value) { _ptr.clientInformation = LevelDo
m.unwrap(value); } | 26609 void set clientInformation(Navigator value) { _ptr.clientInformation = LevelDo
m.unwrap(value); } |
| 26562 | 26610 |
| 26563 bool get closed() => _ptr.closed; | 26611 bool get closed() => _ptr.closed; |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 27522 EventListenerList get load() => _get('load'); | 27570 EventListenerList get load() => _get('load'); |
| 27523 EventListenerList get loadStart() => _get('loadstart'); | 27571 EventListenerList get loadStart() => _get('loadstart'); |
| 27524 EventListenerList get progress() => _get('progress'); | 27572 EventListenerList get progress() => _get('progress'); |
| 27525 EventListenerList get readyStateChange() => _get('readystatechange'); | 27573 EventListenerList get readyStateChange() => _get('readystatechange'); |
| 27526 } | 27574 } |
| 27527 | 27575 |
| 27528 class XMLHttpRequestWrappingImplementation extends EventTargetWrappingImplementa
tion implements XMLHttpRequest { | 27576 class XMLHttpRequestWrappingImplementation extends EventTargetWrappingImplementa
tion implements XMLHttpRequest { |
| 27529 XMLHttpRequestWrappingImplementation._wrap( | 27577 XMLHttpRequestWrappingImplementation._wrap( |
| 27530 dom.XMLHttpRequest ptr) : super._wrap(ptr); | 27578 dom.XMLHttpRequest ptr) : super._wrap(ptr); |
| 27531 | 27579 |
| 27580 /** @domName Window.createXMLHttpRequest */ |
| 27532 factory XMLHttpRequestWrappingImplementation() { | 27581 factory XMLHttpRequestWrappingImplementation() { |
| 27533 return new XMLHttpRequestWrappingImplementation._wrap( | 27582 return new XMLHttpRequestWrappingImplementation._wrap( |
| 27534 new dom.XMLHttpRequest()); | 27583 new dom.XMLHttpRequest()); |
| 27535 } | 27584 } |
| 27536 | 27585 |
| 27537 factory XMLHttpRequestWrappingImplementation.getTEMPNAME(String url, | 27586 factory XMLHttpRequestWrappingImplementation.getTEMPNAME(String url, |
| 27538 onSuccess(XMLHttpRequest request)) { | 27587 onSuccess(XMLHttpRequest request)) { |
| 27539 final request = new XMLHttpRequest(); | 27588 final request = new XMLHttpRequest(); |
| 27540 request.open('GET', url, true); | 27589 request.open('GET', url, true); |
| 27541 | 27590 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 27633 _ptr.setRequestHeader(header, value); | 27682 _ptr.setRequestHeader(header, value); |
| 27634 } | 27683 } |
| 27635 | 27684 |
| 27636 XMLHttpRequestEvents get on() { | 27685 XMLHttpRequestEvents get on() { |
| 27637 if (_on === null) { | 27686 if (_on === null) { |
| 27638 _on = new XMLHttpRequestEventsImplementation._wrap(_ptr); | 27687 _on = new XMLHttpRequestEventsImplementation._wrap(_ptr); |
| 27639 } | 27688 } |
| 27640 return _on; | 27689 return _on; |
| 27641 } | 27690 } |
| 27642 } | 27691 } |
| OLD | NEW |