| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 class _ChildrenElementList extends ListBase<Element> { | 7 class _ChildrenElementList extends ListBase<Element> { |
| 8 // Raw Element. | 8 // Raw Element. |
| 9 final Element _element; | 9 final Element _element; |
| 10 final HtmlCollection _childElements; | 10 final HtmlCollection _childElements; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 * CustomElement.created() : super.created() { | 354 * CustomElement.created() : super.created() { |
| 355 * // Perform any element initialization. | 355 * // Perform any element initialization. |
| 356 * } | 356 * } |
| 357 * } | 357 * } |
| 358 * document.register('x-custom', CustomElement); | 358 * document.register('x-custom', CustomElement); |
| 359 */ | 359 */ |
| 360 Element.created() : super._created() { | 360 Element.created() : super._created() { |
| 361 // Validate that this is a custom element & perform any additional | 361 // Validate that this is a custom element & perform any additional |
| 362 // initialization. | 362 // initialization. |
| 363 _initializeCustomElement(this); | 363 _initializeCustomElement(this); |
| 364 | |
| 365 createdCallback(); | |
| 366 } | 364 } |
| 367 | 365 |
| 368 /** | 366 /** |
| 369 * Creates the HTML element specified by the tag name. | 367 * Creates the HTML element specified by the tag name. |
| 370 * | 368 * |
| 371 * This is similar to [Document.createElement]. | 369 * This is similar to [Document.createElement]. |
| 372 * [tag] should be a valid HTML tag name. If [tag] is an unknown tag then | 370 * [tag] should be a valid HTML tag name. If [tag] is an unknown tag then |
| 373 * this will create an [UnknownElement]. | 371 * this will create an [UnknownElement]. |
| 374 * | 372 * |
| 375 * var divElement = new Element.tag('div'); | 373 * var divElement = new Element.tag('div'); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 if (pseudoElement == null) { | 665 if (pseudoElement == null) { |
| 668 pseudoElement = ''; | 666 pseudoElement = ''; |
| 669 } | 667 } |
| 670 // TODO(jacobr): last param should be null, see b/5045788 | 668 // TODO(jacobr): last param should be null, see b/5045788 |
| 671 return window._getComputedStyle(this, pseudoElement); | 669 return window._getComputedStyle(this, pseudoElement); |
| 672 } | 670 } |
| 673 | 671 |
| 674 /** | 672 /** |
| 675 * Gets the position of this element relative to the client area of the page. | 673 * Gets the position of this element relative to the client area of the page. |
| 676 */ | 674 */ |
| 677 Rectangle get client => new Rectangle(clientLeft, clientTop, clientWidth, | 675 Rectangle get client => new Rectangle(clientLeft, clientTop, clientWidth, |
| 678 clientHeight); | 676 clientHeight); |
| 679 | 677 |
| 680 /** | 678 /** |
| 681 * Gets the offset of this element relative to its offsetParent. | 679 * Gets the offset of this element relative to its offsetParent. |
| 682 */ | 680 */ |
| 683 Rectangle get offset => new Rectangle(offsetLeft, offsetTop, offsetWidth, | 681 Rectangle get offset => new Rectangle(offsetLeft, offsetTop, offsetWidth, |
| 684 offsetHeight); | 682 offsetHeight); |
| 685 | 683 |
| 686 /** | 684 /** |
| 687 * Adds the specified text after the last child of this element. | 685 * Adds the specified text after the last child of this element. |
| 688 */ | 686 */ |
| 689 void appendText(String text) { | 687 void appendText(String text) { |
| 690 this.insertAdjacentText('beforeend', text); | 688 this.insertAdjacentText('beforeend', text); |
| 691 } | 689 } |
| 692 | 690 |
| 693 /** | 691 /** |
| 694 * Parses the specified text as HTML and adds the resulting node after the | 692 * Parses the specified text as HTML and adds the resulting node after the |
| 695 * last child of this element. | 693 * last child of this element. |
| 696 */ | 694 */ |
| 697 void appendHtml(String text) { | 695 void appendHtml(String text) { |
| 698 this.insertAdjacentHtml('beforeend', text); | 696 this.insertAdjacentHtml('beforeend', text); |
| 699 } | 697 } |
| 700 | 698 |
| 701 /** | 699 /** |
| 702 * Checks to see if the tag name is supported by the current platform. | 700 * Checks to see if the tag name is supported by the current platform. |
| 703 * | 701 * |
| 704 * The tag should be a valid HTML tag name. | 702 * The tag should be a valid HTML tag name. |
| 705 */ | 703 */ |
| 706 static bool isTagSupported(String tag) { | 704 static bool isTagSupported(String tag) { |
| 707 var e = _ElementFactoryProvider.createElement_tag(tag, null); | 705 var e = _ElementFactoryProvider.createElement_tag(tag, null); |
| 708 return e is Element && !(e is UnknownElement); | 706 return e is Element && !(e is UnknownElement); |
| 709 } | 707 } |
| 710 | 708 |
| 711 /** | 709 /** |
| 712 * Called by the DOM when this element has been instantiated. | |
| 713 * | |
| 714 * Will be replaced by created constructor. | |
| 715 */ | |
| 716 @Experimental() | |
| 717 @deprecated | |
| 718 void createdCallback() {} | |
| 719 | |
| 720 /** | |
| 721 * Called by the DOM when this element has been inserted into the live | 710 * Called by the DOM when this element has been inserted into the live |
| 722 * document. | 711 * document. |
| 723 */ | 712 */ |
| 724 @Experimental() | 713 @Experimental() |
| 725 void enteredView() {} | 714 void enteredView() {} |
| 726 | 715 |
| 727 /** | 716 /** |
| 728 * Called by the DOM when this element has been removed from the live | 717 * Called by the DOM when this element has been removed from the live |
| 729 * document. | 718 * document. |
| 730 */ | 719 */ |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 const ScrollAlignment._internal(this._value); | 1398 const ScrollAlignment._internal(this._value); |
| 1410 toString() => 'ScrollAlignment.$_value'; | 1399 toString() => 'ScrollAlignment.$_value'; |
| 1411 | 1400 |
| 1412 /// Attempt to align the element to the top of the scrollable area. | 1401 /// Attempt to align the element to the top of the scrollable area. |
| 1413 static const TOP = const ScrollAlignment._internal('TOP'); | 1402 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1414 /// Attempt to center the element in the scrollable area. | 1403 /// Attempt to center the element in the scrollable area. |
| 1415 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1404 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1416 /// Attempt to align the element to the bottom of the scrollable area. | 1405 /// Attempt to align the element to the bottom of the scrollable area. |
| 1417 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1406 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1418 } | 1407 } |
| OLD | NEW |