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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 442f5f0ba5aff4db1d9ea92d5612772b0bb171e7..e80fe5f251f29aa9e16d03c0cb3d331186e3acb8 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -2693,9 +2693,13 @@ class CssRule extends NativeFieldWrapperClass1 {
@DomName('CSSStyleDeclaration')
class CssStyleDeclaration extends NativeFieldWrapperClass1 {
- factory CssStyleDeclaration() => _CssStyleDeclarationFactoryProvider.createCssStyleDeclaration();
- factory CssStyleDeclaration.css(String css) =>
- _CssStyleDeclarationFactoryProvider.createCssStyleDeclaration_css(css);
+ factory CssStyleDeclaration() => new CssStyleDeclaration.css('');
+
+ factory CssStyleDeclaration.css(String css) {
+ final style = new Element.tag('div').style;
+ style.cssText = css;
+ return style;
+ }
CssStyleDeclaration.internal();
@@ -7314,11 +7318,24 @@ class Document extends Node
@DomName('DocumentFragment')
class DocumentFragment extends Node {
- factory DocumentFragment.html(String html) =>
- _DocumentFragmentFactoryProvider.createDocumentFragment_html(html);
+ factory DocumentFragment() => document.createDocumentFragment();
+
+ factory DocumentFragment.html(String html) {
+ final fragment = new DocumentFragment();
+ fragment.innerHtml = html;
+ return fragment;
+ }
- factory DocumentFragment.svg(String svgContent) =>
- _DocumentFragmentFactoryProvider.createDocumentFragment_svg(svgContent);
+ factory DocumentFragment.svg(String svgContent) {
+ final fragment = new DocumentFragment();
+ final e = new svg.SvgSvgElement();
+ e.innerHtml = svgContent;
+
+ // Copy list first since we don't want liveness during iteration.
+ final List nodes = new List.from(e.nodes);
+ fragment.nodes.addAll(nodes);
+ return fragment;
+ }
List<Element> _children;
@@ -7380,15 +7397,6 @@ class DocumentFragment extends Node {
DocumentFragment.internal() : super.internal();
- @DomName('DocumentFragment.DocumentFragment')
- @DocsEditable
- factory DocumentFragment() {
- return DocumentFragment._create_1();
- }
-
- @DocsEditable
- static DocumentFragment _create_1() native "DocumentFragment__create_1constructorCallback";
-
@DomName('DocumentFragment.childElementCount')
@DocsEditable
@Experimental // untriaged
@@ -19072,16 +19080,9 @@ typedef void RtcStatsCallback(RtcStatsResponse response);
@DomName('Range')
@Unstable
class Range extends NativeFieldWrapperClass1 {
- Range.internal();
-
- @DomName('Range.Range')
- @DocsEditable
- factory Range() {
- return Range._create_1();
- }
+ factory Range() => document.$dom_createRange();
- @DocsEditable
- static Range _create_1() native "Range__create_1constructorCallback";
+ Range.internal();
@DomName('Range.END_TO_END')
@DocsEditable
@@ -22333,17 +22334,9 @@ option[template] {
@DomName('Text')
class Text extends CharacterData {
+ factory Text(String data) => document.$dom_createTextNode(data);
Text.internal() : super.internal();
- @DomName('Text.Text')
- @DocsEditable
- factory Text([String data]) {
- return Text._create_1(data);
- }
-
- @DocsEditable
- static Text _create_1(data) native "Text__create_1constructorCallback";
-
@DomName('Text.webkitInsertionParent')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@@ -30428,57 +30421,6 @@ class _HttpRequestUtils {
return request;
}
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-class _CssStyleDeclarationFactoryProvider {
- static CssStyleDeclaration createCssStyleDeclaration_css(String css) {
- final style = new Element.tag('div').style;
- style.cssText = css;
- return style;
- }
-
- static CssStyleDeclaration createCssStyleDeclaration() {
- return new CssStyleDeclaration.css('');
- }
-}
-
-class _DocumentFragmentFactoryProvider {
- @DomName('Document.createDocumentFragment')
- static DocumentFragment createDocumentFragment() =>
- document.createDocumentFragment();
-
- static DocumentFragment createDocumentFragment_html(String html) {
- final fragment = new DocumentFragment();
- fragment.innerHtml = html;
- return fragment;
- }
-
- // TODO(nweiz): enable this when XML is ported.
- // factory DocumentFragment.xml(String xml) {
- // final fragment = new DocumentFragment();
- // final e = new XMLElement.tag("xml");
- // e.innerHtml = xml;
- //
- // // Copy list first since we don't want liveness during iteration.
- // final List nodes = new List.from(e.nodes);
- // fragment.nodes.addAll(nodes);
- // return fragment;
- // }
-
- static DocumentFragment createDocumentFragment_svg(String svgContent) {
- final fragment = new DocumentFragment();
- final e = new svg.SvgSvgElement();
- e.innerHtml = svgContent;
-
- // Copy list first since we don't want liveness during iteration.
- final List nodes = new List.from(e.nodes);
- fragment.nodes.addAll(nodes);
- return fragment;
- }
-}
/**
* A custom KeyboardEvent that attempts to eliminate cross-browser
* inconsistencies, and also provide both keyCode and charCode information
@@ -30583,14 +30525,6 @@ class KeyEvent extends _WrappedEvent implements KeyboardEvent {
"Cannot initialize a KeyboardEvent from a KeyEvent.");
}
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-class _TextFactoryProvider {
- static Text createText(String data) => document.$dom_createTextNode(data);
-}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698