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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 12474007: Revert 20127 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index ab1e30c8731a1358a604b11d0c607f5c2b420f54..dd1078ac78f88177f55e84d9b26974643d6f6217 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -6184,50 +6184,14 @@ class DeviceOrientationEvent extends Event native "*DeviceOrientationEvent" {
void $dom_initDeviceOrientationEvent(String type, bool bubbles, bool cancelable, num alpha, num beta, num gamma, bool absolute) native;
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
+@DocsEditable
@DomName('DirectoryEntry')
class DirectoryEntry extends Entry native "*DirectoryEntry" {
-
- /**
- * Create a new directory with the specified `path`. If `exclusive` is true,
- * the returned Future will complete with an error if a directory already
- * exists with the specified `path`.
- */
- Future<Entry> createDirectory(String path, {bool exclusive: false}) {
- return _getDirectory(path, options:
- {'create': true, 'exclusive': exclusive});
- }
-
- /**
- * Retrieve an already existing directory entry. The returned future will
- * result in an error if a directory at `path` does not exist or if the item
- * at `path` is not a directory.
- */
- Future<Entry> getDirectory(String path) {
- return _getDirectory(path);
- }
-
- /**
- * Create a new file with the specified `path`. If `exclusive` is true,
- * the returned Future will complete with an error if a file already
- * exists at the specified `path`.
- */
- Future<Entry> createFile(String path, {bool exclusive: false}) {
- return _getFile(path, options: {'create': true, 'exclusive': exclusive});
- }
-
- /**
- * Retrieve an already existing file entry. The returned future will
- * result in an error if a file at `path` does not exist or if the item at
- * `path` is not a file.
- */
- Future<Entry> getFile(String path) {
- return _getFile(path);
- }
@DomName('DirectoryEntry.createReader')
@DocsEditable
@@ -6235,48 +6199,48 @@ class DirectoryEntry extends Entry native "*DirectoryEntry" {
@DomName('DirectoryEntry.getDirectory')
@DocsEditable
- void __getDirectory(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
+ void _getDirectory(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
if (?errorCallback) {
var options_1 = convertDartToNative_Dictionary(options);
- ___getDirectory_1(path, options_1, successCallback, errorCallback);
+ __getDirectory_1(path, options_1, successCallback, errorCallback);
return;
}
if (?successCallback) {
var options_2 = convertDartToNative_Dictionary(options);
- ___getDirectory_2(path, options_2, successCallback);
+ __getDirectory_2(path, options_2, successCallback);
return;
}
if (?options) {
var options_3 = convertDartToNative_Dictionary(options);
- ___getDirectory_3(path, options_3);
+ __getDirectory_3(path, options_3);
return;
}
- ___getDirectory_4(path);
+ __getDirectory_4(path);
return;
}
@JSName('getDirectory')
@DomName('DirectoryEntry.getDirectory')
@DocsEditable
- void ___getDirectory_1(path, options, _EntryCallback successCallback, _ErrorCallback errorCallback) native;
+ void __getDirectory_1(path, options, _EntryCallback successCallback, _ErrorCallback errorCallback) native;
@JSName('getDirectory')
@DomName('DirectoryEntry.getDirectory')
@DocsEditable
- void ___getDirectory_2(path, options, _EntryCallback successCallback) native;
+ void __getDirectory_2(path, options, _EntryCallback successCallback) native;
@JSName('getDirectory')
@DomName('DirectoryEntry.getDirectory')
@DocsEditable
- void ___getDirectory_3(path, options) native;
+ void __getDirectory_3(path, options) native;
@JSName('getDirectory')
@DomName('DirectoryEntry.getDirectory')
@DocsEditable
- void ___getDirectory_4(path) native;
+ void __getDirectory_4(path) native;
@JSName('getDirectory')
@DomName('DirectoryEntry.getDirectory')
@DocsEditable
- Future<Entry> _getDirectory(String path, {Map options}) {
+ Future<Entry> getDirectory(String path, {Map options}) {
var completer = new Completer<Entry>();
- __getDirectory(path, options : options,
+ _getDirectory(path, options : options,
successCallback : (value) { completer.complete(value); },
errorCallback : (error) { completer.completeError(error); });
return completer.future;
@@ -6284,48 +6248,48 @@ class DirectoryEntry extends Entry native "*DirectoryEntry" {
@DomName('DirectoryEntry.getFile')
@DocsEditable
- void __getFile(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
+ void _getFile(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
if (?errorCallback) {
var options_1 = convertDartToNative_Dictionary(options);
- ___getFile_1(path, options_1, successCallback, errorCallback);
+ __getFile_1(path, options_1, successCallback, errorCallback);
return;
}
if (?successCallback) {
var options_2 = convertDartToNative_Dictionary(options);
- ___getFile_2(path, options_2, successCallback);
+ __getFile_2(path, options_2, successCallback);
return;
}
if (?options) {
var options_3 = convertDartToNative_Dictionary(options);
- ___getFile_3(path, options_3);
+ __getFile_3(path, options_3);
return;
}
- ___getFile_4(path);
+ __getFile_4(path);
return;
}
@JSName('getFile')
@DomName('DirectoryEntry.getFile')
@DocsEditable
- void ___getFile_1(path, options, _EntryCallback successCallback, _ErrorCallback errorCallback) native;
+ void __getFile_1(path, options, _EntryCallback successCallback, _ErrorCallback errorCallback) native;
@JSName('getFile')
@DomName('DirectoryEntry.getFile')
@DocsEditable
- void ___getFile_2(path, options, _EntryCallback successCallback) native;
+ void __getFile_2(path, options, _EntryCallback successCallback) native;
@JSName('getFile')
@DomName('DirectoryEntry.getFile')
@DocsEditable
- void ___getFile_3(path, options) native;
+ void __getFile_3(path, options) native;
@JSName('getFile')
@DomName('DirectoryEntry.getFile')
@DocsEditable
- void ___getFile_4(path) native;
+ void __getFile_4(path) native;
@JSName('getFile')
@DomName('DirectoryEntry.getFile')
@DocsEditable
- Future<Entry> _getFile(String path, {Map options}) {
+ Future<Entry> getFile(String path, {Map options}) {
var completer = new Completer<Entry>();
- __getFile(path, options : options,
+ _getFile(path, options : options,
successCallback : (value) { completer.complete(value); },
errorCallback : (error) { completer.completeError(error); });
return completer.future;
@@ -6346,9 +6310,7 @@ class DirectoryEntry extends Entry native "*DirectoryEntry" {
(error) { completer.completeError(error); });
return completer.future;
}
-
}
-
// 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.
@@ -10463,19 +10425,14 @@ class EventException native "*EventException" {
@DocsEditable
String toString() native;
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
+@DocsEditable
@DomName('EventSource')
class EventSource extends EventTarget native "*EventSource" {
- factory EventSource(String title, {withCredentials: false}) {
- var parsedOptions = {
- 'withCredentials': withCredentials,
- };
- return EventSource._factoryEventSource(title, parsedOptions);
- }
@DomName('EventSource.errorEvent')
@DocsEditable
@@ -10491,7 +10448,7 @@ class EventSource extends EventTarget native "*EventSource" {
@DomName('EventSource.EventSource')
@DocsEditable
- static EventSource _factoryEventSource(String url, [Map eventSourceInit]) {
+ factory EventSource(String url, [Map eventSourceInit]) {
if (?eventSourceInit) {
return EventSource._create_1(url, eventSourceInit);
}
@@ -10547,7 +10504,6 @@ class EventSource extends EventTarget native "*EventSource" {
@DomName('EventSource.onopen')
@DocsEditable
Stream<Event> get onOpen => openEvent.forTarget(this);
-
}
// 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
@@ -17264,7 +17220,8 @@ class MutationObserver native "*MutationObserver" {
}
void observe(Node target,
- {bool childList,
+ {Map options,
+ bool childList,
bool attributes,
bool characterData,
bool subtree,
@@ -17275,6 +17232,19 @@ class MutationObserver native "*MutationObserver" {
// Parse options into map of known type.
var parsedOptions = _createDict();
+ if (options != null) {
+ options.forEach((k, v) {
+ if (_boolKeys.containsKey(k)) {
+ _add(parsedOptions, k, true == v);
+ } else if (k == 'attributeFilter') {
+ _add(parsedOptions, k, _fixupList(v));
+ } else {
+ throw new ArgumentError(
+ "Illegal MutationObserver.observe option '$k'");
+ }
+ });
+ }
+
// Override options passed in the map with named optional arguments.
override(key, value) {
if (value != null) _add(parsedOptions, key, value);
@@ -18385,18 +18355,13 @@ class Notation extends Node native "*Notation" {
@DomName('Notification')
class Notification extends EventTarget native "*Notification" {
-
- factory Notification(String title, {String titleDir: null, String body: null,
- String bodyDir: null, String tag: null, String iconUrl: null}) {
-
- var parsedOptions = {};
- if (titleDir != null) parsedOptions['titleDir'] = titleDir;
- if (body != null) parsedOptions['body'] = body;
- if (bodyDir != null) parsedOptions['bodyDir'] = bodyDir;
- if (tag != null) parsedOptions['tag'] = tag;
- if (iconUrl != null) parsedOptions['iconUrl'] = iconUrl;
-
- return Notification._factoryNotification(title, parsedOptions);
+ factory Notification(String title, [Map options]) {
+ if (?options) {
+ return JS('Notification', 'new Notification(#,#)', title,
+ convertDartToNative_SerializedScriptValue(options));
+ } else {
+ return JS('Notification', 'new Notification(#)', title);
+ }
}
@DomName('Notification.clickEvent')
@@ -18419,17 +18384,6 @@ class Notification extends EventTarget native "*Notification" {
@DocsEditable
static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
- @DomName('Notification.Notification')
- @DocsEditable
- static Notification _factoryNotification(String title, [Map options]) {
- if (?options) {
- return Notification._create_1(title, options);
- }
- return Notification._create_2(title);
- }
- static Notification _create_1(title, options) => JS('Notification', 'new Notification(#,#)', title, options);
- static Notification _create_2(title) => JS('Notification', 'new Notification(#)', title);
-
@DomName('Notification.dir')
@DocsEditable
String dir;
@@ -26695,17 +26649,6 @@ class Window extends EventTarget implements WindowBase native "@*DOMWindow" {
JS('void', '#.setImmediate(#)', this, convertDartClosureToJS(callback, 0));
}
- /**
- * Access a sandboxed file system of the specified `size`. If `persistent` is
- * true, the application will request permission from the user to create
- * lasting storage. This storage cannot be freed without the user's
- * permission. Returns a [Future] whose value stores a reference to the
- * sandboxed file system for use. Because the file system is sandboxed,
- * applications cannot access file systems created in other web pages.
- */
- Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) {
- return _requestFileSystem(persistent? 1 : 0, size);
- }
@DomName('DOMWindow.DOMContentLoadedEvent')
@DocsEditable
@@ -27168,16 +27111,16 @@ class Window extends EventTarget implements WindowBase native "@*DOMWindow" {
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental
- void __requestFileSystem(int type, int size, _FileSystemCallback successCallback, [_ErrorCallback errorCallback]) native;
+ void _requestFileSystem(int type, int size, _FileSystemCallback successCallback, [_ErrorCallback errorCallback]) native;
@JSName('webkitRequestFileSystem')
@DomName('DOMWindow.webkitRequestFileSystem')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental
- Future<FileSystem> _requestFileSystem(int type, int size) {
+ Future<FileSystem> requestFileSystem(int type, int size) {
var completer = new Completer<FileSystem>();
- __requestFileSystem(type, size,
+ _requestFileSystem(type, size,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
@@ -27469,59 +27412,13 @@ class Worker extends AbstractWorker native "*Worker" {
@DocsEditable
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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.
@DomName('WorkerContext')
class WorkerContext extends EventTarget native "*WorkerContext" {
- /**
- * Gets an instance of the Indexed DB factory to being using Indexed DB.
- *
- * Use [IdbFactory.supported] to check if Indexed DB is supported on the
- * current platform.
- */
- @SupportedBrowser(SupportedBrowser.CHROME, '23.0')
- @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')
- @SupportedBrowser(SupportedBrowser.IE, '10.0')
- @Experimental
- IdbFactory get indexedDB =>
- JS('IdbFactory',
- '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
- this, this, this);
-
- /**
- * Access a sandboxed file system of the specified `size`. If `persistent` is
- * true, the application will request permission from the user to create
- * lasting storage. This storage cannot be freed without the user's
- * permission. Returns a [Future] whose value stores a reference to the
- * sandboxed file system for use. Because the file system is sandboxed,
- * applications cannot access file systems created in other web pages.
- */
- @DomName('WorkerContext.webkitRequestFileSystem')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @Experimental
- Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) {
- return _requestFileSystem(persistent? 1 : 0, size);
- }
-
- /**
- * Access a sandboxed file system of the specified `size`. If `persistent` is
- * true, the application will request permission from the user to create
- * lasting storage. This storage cannot be freed without the user's
- * permission. This call will block until a reference to the synchronous file
- * system API has been obtained. Because the file system is sandboxed,
- * applications cannot access file systems created in other web pages.
- */
- @DomName('WorkerContext.webkitRequestFileSystemSync')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @Experimental
- FileSystemSync requestFileSystemSync(int size, {bool persistent: false}) {
- return _requestFileSystemSync(persistent? 1 : 0, size);
- }
@DomName('WorkerContext.errorEvent')
@DocsEditable
@@ -27608,16 +27505,16 @@ class WorkerContext extends EventTarget native "*WorkerContext" {
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental
- void __requestFileSystem(int type, int size, [_FileSystemCallback successCallback, _ErrorCallback errorCallback]) native;
+ void _requestFileSystem(int type, int size, [_FileSystemCallback successCallback, _ErrorCallback errorCallback]) native;
@JSName('webkitRequestFileSystem')
@DomName('WorkerContext.webkitRequestFileSystem')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental
- Future<FileSystem> _requestFileSystem(int type, int size) {
+ Future<FileSystem> requestFileSystem(int type, int size) {
var completer = new Completer<FileSystem>();
- __requestFileSystem(type, size,
+ _requestFileSystem(type, size,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
@@ -27628,7 +27525,7 @@ class WorkerContext extends EventTarget native "*WorkerContext" {
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental
- FileSystemSync _requestFileSystemSync(int type, int size) native;
+ FileSystemSync requestFileSystemSync(int type, int size) native;
@JSName('webkitResolveLocalFileSystemSyncURL')
@DomName('WorkerContext.webkitResolveLocalFileSystemSyncURL')
@@ -27661,6 +27558,21 @@ class WorkerContext extends EventTarget native "*WorkerContext" {
@DocsEditable
Stream<Event> get onError => errorEvent.forTarget(this);
+
+ /**
+ * Gets an instance of the Indexed DB factory to being using Indexed DB.
+ *
+ * Use [IdbFactory.supported] to check if Indexed DB is supported on the
+ * current platform.
+ */
+ @SupportedBrowser(SupportedBrowser.CHROME, '23.0')
+ @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')
+ @SupportedBrowser(SupportedBrowser.IE, '10.0')
+ @Experimental
+ IdbFactory get indexedDB =>
+ JS('IdbFactory',
+ '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
+ this, this, this);
}
// 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
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698