| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 63 // factory DocumentFragment.xml(String xml) { | 63 // factory DocumentFragment.xml(String xml) { |
| 64 // final fragment = new DocumentFragment(); | 64 // final fragment = new DocumentFragment(); |
| 65 // final e = new XMLElement.tag("xml"); | 65 // final e = new XMLElement.tag("xml"); |
| 66 // e.innerHTML = xml; | 66 // e.innerHtml = xml; |
| 67 // | 67 // |
| 68 // // Copy list first since we don't want liveness during iteration. | 68 // // Copy list first since we don't want liveness during iteration. |
| 69 // final List nodes = new List.from(e.nodes); | 69 // final List nodes = new List.from(e.nodes); |
| 70 // fragment.nodes.addAll(nodes); | 70 // fragment.nodes.addAll(nodes); |
| 71 // return fragment; | 71 // return fragment; |
| 72 // } | 72 // } |
| 73 | 73 |
| 74 static DocumentFragment createDocumentFragment_svg(String svgContent) { | 74 static DocumentFragment createDocumentFragment_svg(String svgContent) { |
| 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 |