| 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 class _TextFactoryProvider { | 5 class _TextFactoryProvider { |
| 6 | 6 |
| 7 factory Text(data) => document._createTextNode(data); | 7 factory Text(String data) => document._createTextNode(data); |
| 8 } | 8 } |
| 9 | 9 |
| 10 class _EventFactoryProvider { | 10 class _EventFactoryProvider { |
| 11 factory Event(String type, [bool canBubble = true, | 11 factory Event(String type, [bool canBubble = true, |
| 12 bool cancelable = true]) { | 12 bool cancelable = true]) { |
| 13 _EventImpl e = document._createEvent("Event"); | 13 _EventImpl e = document._createEvent("Event"); |
| 14 e._initEvent(type, canBubble, cancelable); | 14 e._initEvent(type, canBubble, cancelable); |
| 15 return e; | 15 return e; |
| 16 } | 16 } |
| 17 } | 17 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 final _START_TAG_REGEXP = const RegExp('<(\\w+)'); | 45 final _START_TAG_REGEXP = const RegExp('<(\\w+)'); |
| 46 class _ElementFactoryProvider { | 46 class _ElementFactoryProvider { |
| 47 static final _CUSTOM_PARENT_TAG_MAP = const { | 47 static final _CUSTOM_PARENT_TAG_MAP = const { |
| 48 'body' : 'html', | 48 'body' : 'html', |
| 49 'head' : 'html', | 49 'head' : 'html', |
| 50 'caption' : 'table', | 50 'caption' : 'table', |
| 51 'td': 'tr', | 51 'td': 'tr', |
| 52 'tbody': 'table', | |
| 53 'colgroup': 'table', | 52 'colgroup': 'table', |
| 54 'col' : 'colgroup', | 53 'col' : 'colgroup', |
| 55 'tr' : 'tbody', | 54 'tr' : 'tbody', |
| 56 'tbody' : 'table', | 55 'tbody' : 'table', |
| 57 'tfoot' : 'table', | 56 'tfoot' : 'table', |
| 58 'thead' : 'table', | 57 'thead' : 'table', |
| 59 'track' : 'audio', | 58 'track' : 'audio', |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 /** @domName Document.createElement */ | 61 /** @domName Document.createElement */ |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 93 } |
| 95 element.remove(); | 94 element.remove(); |
| 96 return element; | 95 return element; |
| 97 } | 96 } |
| 98 | 97 |
| 99 /** @domName Document.createElement */ | 98 /** @domName Document.createElement */ |
| 100 factory Element.tag(String tag) { | 99 factory Element.tag(String tag) { |
| 101 return document._createElement(tag); | 100 return document._createElement(tag); |
| 102 } | 101 } |
| 103 } | 102 } |
| OLD | NEW |