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 html; | 5 part of html; |
6 | 6 |
7 class _CustomEventFactoryProvider { | 7 class _CustomEventFactoryProvider { |
8 static CustomEvent createCustomEvent(String type, [bool canBubble = true, | 8 static CustomEvent createCustomEvent(String type, [bool canBubble = true, |
9 bool cancelable = true, Object detail = null]) { | 9 bool cancelable = true, Object detail = null]) { |
10 final CustomEvent e = document.$dom_createEvent("CustomEvent"); | 10 final CustomEvent e = document.$dom_createEvent("CustomEvent"); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 style.cssText = css; | 42 style.cssText = css; |
43 return style; | 43 return style; |
44 } | 44 } |
45 | 45 |
46 static CssStyleDeclaration createCssStyleDeclaration() { | 46 static CssStyleDeclaration createCssStyleDeclaration() { |
47 return new CssStyleDeclaration.css(''); | 47 return new CssStyleDeclaration.css(''); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 class _DocumentFragmentFactoryProvider { | 51 class _DocumentFragmentFactoryProvider { |
52 /** @domName Document.createDocumentFragment */ | 52 @DomName('Document.createDocumentFragment') |
53 static DocumentFragment createDocumentFragment() => | 53 static DocumentFragment createDocumentFragment() => |
54 document.createDocumentFragment(); | 54 document.createDocumentFragment(); |
55 | 55 |
56 static DocumentFragment createDocumentFragment_html(String html) { | 56 static DocumentFragment createDocumentFragment_html(String html) { |
57 final fragment = new DocumentFragment(); | 57 final fragment = new DocumentFragment(); |
58 fragment.innerHtml = html; | 58 fragment.innerHtml = html; |
59 return fragment; | 59 return fragment; |
60 } | 60 } |
61 | 61 |
62 // TODO(nweiz): enable this when XML is ported. | 62 // TODO(nweiz): enable this when XML is ported. |
(...skipping 12 matching lines...) Expand all Loading... |
75 final fragment = new DocumentFragment(); | 75 final fragment = new DocumentFragment(); |
76 final e = new svg.SvgSvgElement(); | 76 final e = new svg.SvgSvgElement(); |
77 e.innerHtml = svgContent; | 77 e.innerHtml = svgContent; |
78 | 78 |
79 // Copy list first since we don't want liveness during iteration. | 79 // Copy list first since we don't want liveness during iteration. |
80 final List nodes = new List.from(e.nodes); | 80 final List nodes = new List.from(e.nodes); |
81 fragment.nodes.addAll(nodes); | 81 fragment.nodes.addAll(nodes); |
82 return fragment; | 82 return fragment; |
83 } | 83 } |
84 } | 84 } |
OLD | NEW |