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

Side by Side Diff: tools/dom/src/shared_FactoryProviders.dart

Issue 16335012: Fixing some of the tests disabled from the chrome IDL roll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 part of html;
6
7 class _CssStyleDeclarationFactoryProvider {
8 static CssStyleDeclaration createCssStyleDeclaration_css(String css) {
9 final style = new Element.tag('div').style;
10 style.cssText = css;
11 return style;
12 }
13
14 static CssStyleDeclaration createCssStyleDeclaration() {
15 return new CssStyleDeclaration.css('');
16 }
17 }
18
19 class _DocumentFragmentFactoryProvider {
20 @DomName('Document.createDocumentFragment')
21 static DocumentFragment createDocumentFragment() =>
22 document.createDocumentFragment();
23
24 static DocumentFragment createDocumentFragment_html(String html) {
25 final fragment = new DocumentFragment();
26 fragment.innerHtml = html;
27 return fragment;
28 }
29
30 // TODO(nweiz): enable this when XML is ported.
31 // factory DocumentFragment.xml(String xml) {
32 // final fragment = new DocumentFragment();
33 // final e = new XMLElement.tag("xml");
34 // e.innerHtml = xml;
35 //
36 // // Copy list first since we don't want liveness during iteration.
37 // final List nodes = new List.from(e.nodes);
38 // fragment.nodes.addAll(nodes);
39 // return fragment;
40 // }
41
42 static DocumentFragment createDocumentFragment_svg(String svgContent) {
43 final fragment = new DocumentFragment();
44 final e = new svg.SvgSvgElement();
45 e.innerHtml = svgContent;
46
47 // Copy list first since we don't want liveness during iteration.
48 final List nodes = new List.from(e.nodes);
49 fragment.nodes.addAll(nodes);
50 return fragment;
51 }
52 }
OLDNEW
« no previous file with comments | « tools/dom/src/dartium_FactoryProviders.dart ('k') | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698