Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /// The Dart HTML library. | 1 /// The Dart HTML library. |
| 2 /// | 2 /// |
| 3 /// For examples, see | 3 /// For examples, see |
| 4 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples) | 4 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples) |
| 5 /// on Github. | 5 /// on Github. |
| 6 library dart.dom.html; | 6 library dart.dom.html; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 import 'dart:_collection-dev' hide Symbol, deprecated; | 10 import 'dart:_collection-dev' hide Symbol, deprecated; |
| (...skipping 8657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8668 @Experimental() | 8668 @Experimental() |
| 8669 bool get isTemplate => tagName == 'TEMPLATE' || _isAttributeTemplate; | 8669 bool get isTemplate => tagName == 'TEMPLATE' || _isAttributeTemplate; |
| 8670 | 8670 |
| 8671 void _ensureTemplate() { | 8671 void _ensureTemplate() { |
| 8672 if (!isTemplate) { | 8672 if (!isTemplate) { |
| 8673 throw new UnsupportedError('$this is not a template.'); | 8673 throw new UnsupportedError('$this is not a template.'); |
| 8674 } | 8674 } |
| 8675 TemplateElement.decorate(this); | 8675 TemplateElement.decorate(this); |
| 8676 } | 8676 } |
| 8677 | 8677 |
| 8678 /** Provides the coordinates of the element relative to the document. */ | |
| 8679 Point get documentOffset() { | |
|
blois
2013/07/12 23:10:08
Seems like it would be more useful to expose somet
| |
| 8680 final docElem = document.documentElement; | |
| 8681 final box = getBoundingClientRect(); | |
| 8682 return new Point(box.left + window.pageXOffset - docElem.clientLeft, | |
| 8683 box.top + window.pageYOffset - docElem.clientTop); | |
| 8684 } | |
| 8678 // To suppress missing implicit constructor warnings. | 8685 // To suppress missing implicit constructor warnings. |
| 8679 factory Element._() { throw new UnsupportedError("Not supported"); } | 8686 factory Element._() { throw new UnsupportedError("Not supported"); } |
| 8680 | 8687 |
| 8681 @DomName('Element.abortEvent') | 8688 @DomName('Element.abortEvent') |
| 8682 @DocsEditable() | 8689 @DocsEditable() |
| 8683 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort'); | 8690 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort'); |
| 8684 | 8691 |
| 8685 @DomName('Element.beforecopyEvent') | 8692 @DomName('Element.beforecopyEvent') |
| 8686 @DocsEditable() | 8693 @DocsEditable() |
| 8687 static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamPro vider<Event>('beforecopy'); | 8694 static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamPro vider<Event>('beforecopy'); |
| (...skipping 20769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 29457 _position = nextPosition; | 29464 _position = nextPosition; |
| 29458 return true; | 29465 return true; |
| 29459 } | 29466 } |
| 29460 _current = null; | 29467 _current = null; |
| 29461 _position = _array.length; | 29468 _position = _array.length; |
| 29462 return false; | 29469 return false; |
| 29463 } | 29470 } |
| 29464 | 29471 |
| 29465 T get current => _current; | 29472 T get current => _current; |
| 29466 } | 29473 } |
| OLD | NEW |