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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12541020: Consolidating platform code into dart:html_common (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // TODO(jacobr): use _Lists.dart to remove some of the duplicated 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated
8 // functionality. 8 // functionality.
9 class _ChildrenElementList implements List { 9 class _ChildrenElementList implements List {
10 // Raw Element. 10 // Raw Element.
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 } 844 }
845 845
846 @DomName('Element.webkitTransitionEndEvent') 846 @DomName('Element.webkitTransitionEndEvent')
847 static const EventStreamProvider<TransitionEvent> transitionEndEvent = 847 static const EventStreamProvider<TransitionEvent> transitionEndEvent =
848 const _CustomEventStreamProvider<TransitionEvent>( 848 const _CustomEventStreamProvider<TransitionEvent>(
849 Element._determineTransitionEventType); 849 Element._determineTransitionEventType);
850 850
851 static String _determineTransitionEventType(EventTarget e) { 851 static String _determineTransitionEventType(EventTarget e) {
852 // Unfortunately the normal 'ontransitionend' style checks don't work here. 852 // Unfortunately the normal 'ontransitionend' style checks don't work here.
853 if (_Device.isWebKit) { 853 if (Device.isWebKit) {
854 return 'webkitTransitionEnd'; 854 return 'webkitTransitionEnd';
855 } else if (_Device.isOpera) { 855 } else if (Device.isOpera) {
856 return 'oTransitionEnd'; 856 return 'oTransitionEnd';
857 } 857 }
858 return 'transitionend'; 858 return 'transitionend';
859 } 859 }
860 /** 860 /**
861 * Creates a text node and inserts it into the DOM at the specified location. 861 * Creates a text node and inserts it into the DOM at the specified location.
862 * 862 *
863 * To see the possible values for [where], read the doc for 863 * To see the possible values for [where], read the doc for
864 * [insertAdjacentHtml]. 864 * [insertAdjacentHtml].
865 * 865 *
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 // 1) Cache the dummy parent elements required to use innerHTML rather than 1011 // 1) Cache the dummy parent elements required to use innerHTML rather than
1012 // creating them every call. 1012 // creating them every call.
1013 // 2) Verify that the html does not contain leading or trailing text nodes. 1013 // 2) Verify that the html does not contain leading or trailing text nodes.
1014 // 3) Verify that the html does not contain both <head> and <body> tags. 1014 // 3) Verify that the html does not contain both <head> and <body> tags.
1015 // 4) Detatch the created element from its dummy parent. 1015 // 4) Detatch the created element from its dummy parent.
1016 String parentTag = 'div'; 1016 String parentTag = 'div';
1017 String tag; 1017 String tag;
1018 final match = _START_TAG_REGEXP.firstMatch(html); 1018 final match = _START_TAG_REGEXP.firstMatch(html);
1019 if (match != null) { 1019 if (match != null) {
1020 tag = match.group(1).toLowerCase(); 1020 tag = match.group(1).toLowerCase();
1021 if (_Device.isIE && _TABLE_TAGS.containsKey(tag)) { 1021 if (Device.isIE && _TABLE_TAGS.containsKey(tag)) {
1022 return _createTableForIE(html, tag); 1022 return _createTableForIE(html, tag);
1023 } 1023 }
1024 parentTag = _CUSTOM_PARENT_TAG_MAP[tag]; 1024 parentTag = _CUSTOM_PARENT_TAG_MAP[tag];
1025 if (parentTag == null) parentTag = 'div'; 1025 if (parentTag == null) parentTag = 'div';
1026 } 1026 }
1027 1027
1028 final temp = new Element.tag(parentTag); 1028 final temp = new Element.tag(parentTag);
1029 temp.innerHtml = html; 1029 temp.innerHtml = html;
1030 1030
1031 Element element; 1031 Element element;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 const ScrollAlignment._internal(this._value); 1123 const ScrollAlignment._internal(this._value);
1124 toString() => 'ScrollAlignment.$_value'; 1124 toString() => 'ScrollAlignment.$_value';
1125 1125
1126 /// Attempt to align the element to the top of the scrollable area. 1126 /// Attempt to align the element to the top of the scrollable area.
1127 static const TOP = const ScrollAlignment._internal('TOP'); 1127 static const TOP = const ScrollAlignment._internal('TOP');
1128 /// Attempt to center the element in the scrollable area. 1128 /// Attempt to center the element in the scrollable area.
1129 static const CENTER = const ScrollAlignment._internal('CENTER'); 1129 static const CENTER = const ScrollAlignment._internal('CENTER');
1130 /// Attempt to align the element to the bottom of the scrollable area. 1130 /// Attempt to align the element to the bottom of the scrollable area.
1131 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1131 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1132 } 1132 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_DOMException.darttemplate ('k') | tools/dom/templates/html/impl/impl_Event.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698