| OLD | NEW |
| 1 library html; | 1 library html; |
| 2 | 2 |
| 3 import 'dart:html_common'; | 3 import 'dart:html_common'; |
| 4 import 'dart:indexed_db'; |
| 4 import 'dart:isolate'; | 5 import 'dart:isolate'; |
| 5 import 'dart:json'; | 6 import 'dart:json'; |
| 6 import 'dart:svg' as svg; | 7 import 'dart:svg' as svg; |
| 7 import 'dart:web_audio' as web_audio; | 8 import 'dart:web_audio' as web_audio; |
| 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 9 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9 // for details. All rights reserved. Use of this source code is governed by a | 10 // for details. All rights reserved. Use of this source code is governed by a |
| 10 // BSD-style license that can be found in the LICENSE file. | 11 // BSD-style license that can be found in the LICENSE file. |
| 11 | 12 |
| 12 // DO NOT EDIT | 13 // DO NOT EDIT |
| 13 // Auto-generated dart:html library. | 14 // Auto-generated dart:html library. |
| (...skipping 9552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9566 | 9567 |
| 9567 EventListenerList get loadStart => this['loadstart']; | 9568 EventListenerList get loadStart => this['loadstart']; |
| 9568 | 9569 |
| 9569 EventListenerList get progress => this['progress']; | 9570 EventListenerList get progress => this['progress']; |
| 9570 } | 9571 } |
| 9571 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 9572 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9572 // for details. All rights reserved. Use of this source code is governed by a | 9573 // for details. All rights reserved. Use of this source code is governed by a |
| 9573 // BSD-style license that can be found in the LICENSE file. | 9574 // BSD-style license that can be found in the LICENSE file. |
| 9574 | 9575 |
| 9575 | 9576 |
| 9576 /// @domName IDBAny; @docsEditable true | |
| 9577 class IDBAny native "*IDBAny" { | |
| 9578 } | |
| 9579 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9580 // for details. All rights reserved. Use of this source code is governed by a | |
| 9581 // BSD-style license that can be found in the LICENSE file. | |
| 9582 | |
| 9583 | |
| 9584 /// @domName IDBCursor; @docsEditable true | |
| 9585 class IDBCursor native "*IDBCursor" { | |
| 9586 | |
| 9587 static const int NEXT = 0; | |
| 9588 | |
| 9589 static const int NEXT_NO_DUPLICATE = 1; | |
| 9590 | |
| 9591 static const int PREV = 2; | |
| 9592 | |
| 9593 static const int PREV_NO_DUPLICATE = 3; | |
| 9594 | |
| 9595 /// @domName IDBCursor.direction; @docsEditable true | |
| 9596 final String direction; | |
| 9597 | |
| 9598 /// @domName IDBCursor.key; @docsEditable true | |
| 9599 @_annotation_Creates_IDBKey @_annotation_Returns_IDBKey | |
| 9600 final Object key; | |
| 9601 | |
| 9602 /// @domName IDBCursor.primaryKey; @docsEditable true | |
| 9603 final Object primaryKey; | |
| 9604 | |
| 9605 /// @domName IDBCursor.source; @docsEditable true | |
| 9606 final dynamic source; | |
| 9607 | |
| 9608 /// @domName IDBCursor.advance; @docsEditable true | |
| 9609 void advance(int count) native; | |
| 9610 | |
| 9611 /// @domName IDBCursor.continueFunction; @docsEditable true | |
| 9612 void continueFunction([/*IDBKey*/ key]) { | |
| 9613 if (?key) { | |
| 9614 var key_1 = _convertDartToNative_IDBKey(key); | |
| 9615 _continueFunction_1(key_1); | |
| 9616 return; | |
| 9617 } | |
| 9618 _continueFunction_2(); | |
| 9619 return; | |
| 9620 } | |
| 9621 @JSName('continue') | |
| 9622 void _continueFunction_1(key) native; | |
| 9623 @JSName('continue') | |
| 9624 void _continueFunction_2() native; | |
| 9625 | |
| 9626 /// @domName IDBCursor.delete; @docsEditable true | |
| 9627 IDBRequest delete() native; | |
| 9628 | |
| 9629 /// @domName IDBCursor.update; @docsEditable true | |
| 9630 IDBRequest update(/*any*/ value) { | |
| 9631 var value_1 = convertDartToNative_SerializedScriptValue(value); | |
| 9632 return _update_1(value_1); | |
| 9633 } | |
| 9634 @JSName('update') | |
| 9635 IDBRequest _update_1(value) native; | |
| 9636 } | |
| 9637 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9638 // for details. All rights reserved. Use of this source code is governed by a | |
| 9639 // BSD-style license that can be found in the LICENSE file. | |
| 9640 | |
| 9641 | |
| 9642 /// @domName IDBCursorWithValue; @docsEditable true | |
| 9643 class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" { | |
| 9644 | |
| 9645 /// @domName IDBCursorWithValue.value; @docsEditable true | |
| 9646 @annotation_Creates_SerializedScriptValue @annotation_Returns_SerializedScript
Value | |
| 9647 final Object value; | |
| 9648 } | |
| 9649 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9650 // for details. All rights reserved. Use of this source code is governed by a | |
| 9651 // BSD-style license that can be found in the LICENSE file. | |
| 9652 | |
| 9653 | |
| 9654 /// @domName IDBDatabase | |
| 9655 class IDBDatabase extends EventTarget native "*IDBDatabase" { | |
| 9656 | |
| 9657 IDBTransaction transaction(storeName_OR_storeNames, String mode) { | |
| 9658 if (mode != 'readonly' && mode != 'readwrite') { | |
| 9659 throw new ArgumentError(mode); | |
| 9660 } | |
| 9661 | |
| 9662 // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>, | |
| 9663 // and copy to JavaScript array if necessary. | |
| 9664 | |
| 9665 if (_transaction_fn != null) { | |
| 9666 return _transaction_fn(this, storeName_OR_storeNames, mode); | |
| 9667 } | |
| 9668 | |
| 9669 // Try and create a transaction with a string mode. Browsers that expect a | |
| 9670 // numeric mode tend to convert the string into a number. This fails | |
| 9671 // silently, resulting in zero ('readonly'). | |
| 9672 var txn = _transaction(storeName_OR_storeNames, mode); | |
| 9673 if (_hasNumericMode(txn)) { | |
| 9674 _transaction_fn = _transaction_numeric_mode; | |
| 9675 txn = _transaction_fn(this, storeName_OR_storeNames, mode); | |
| 9676 } else { | |
| 9677 _transaction_fn = _transaction_string_mode; | |
| 9678 } | |
| 9679 return txn; | |
| 9680 } | |
| 9681 | |
| 9682 static IDBTransaction _transaction_string_mode(IDBDatabase db, stores, mode) { | |
| 9683 return db._transaction(stores, mode); | |
| 9684 } | |
| 9685 | |
| 9686 static IDBTransaction _transaction_numeric_mode(IDBDatabase db, stores, mode)
{ | |
| 9687 int intMode; | |
| 9688 if (mode == 'readonly') intMode = IDBTransaction.READ_ONLY; | |
| 9689 if (mode == 'readwrite') intMode = IDBTransaction.READ_WRITE; | |
| 9690 return db._transaction(stores, intMode); | |
| 9691 } | |
| 9692 | |
| 9693 @JSName('transaction') | |
| 9694 IDBTransaction _transaction(stores, mode) native; | |
| 9695 | |
| 9696 static bool _hasNumericMode(txn) => | |
| 9697 JS('bool', 'typeof(#.mode) === "number"', txn); | |
| 9698 | |
| 9699 | |
| 9700 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 9701 IDBDatabaseEvents get on => | |
| 9702 new IDBDatabaseEvents(this); | |
| 9703 | |
| 9704 /// @domName IDBDatabase.name; @docsEditable true | |
| 9705 final String name; | |
| 9706 | |
| 9707 /// @domName IDBDatabase.objectStoreNames; @docsEditable true | |
| 9708 @Returns('_DOMStringList') @Creates('_DOMStringList') | |
| 9709 final List<String> objectStoreNames; | |
| 9710 | |
| 9711 /// @domName IDBDatabase.version; @docsEditable true | |
| 9712 final dynamic version; | |
| 9713 | |
| 9714 /// @domName IDBDatabase.addEventListener; @docsEditable true | |
| 9715 @JSName('addEventListener') | |
| 9716 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | |
| 9717 | |
| 9718 /// @domName IDBDatabase.close; @docsEditable true | |
| 9719 void close() native; | |
| 9720 | |
| 9721 /// @domName IDBDatabase.createObjectStore; @docsEditable true | |
| 9722 IDBObjectStore createObjectStore(String name, [Map options]) { | |
| 9723 if (?options) { | |
| 9724 var options_1 = convertDartToNative_Dictionary(options); | |
| 9725 return _createObjectStore_1(name, options_1); | |
| 9726 } | |
| 9727 return _createObjectStore_2(name); | |
| 9728 } | |
| 9729 @JSName('createObjectStore') | |
| 9730 IDBObjectStore _createObjectStore_1(name, options) native; | |
| 9731 @JSName('createObjectStore') | |
| 9732 IDBObjectStore _createObjectStore_2(name) native; | |
| 9733 | |
| 9734 /// @domName IDBDatabase.deleteObjectStore; @docsEditable true | |
| 9735 void deleteObjectStore(String name) native; | |
| 9736 | |
| 9737 /// @domName IDBDatabase.dispatchEvent; @docsEditable true | |
| 9738 @JSName('dispatchEvent') | |
| 9739 bool $dom_dispatchEvent(Event evt) native; | |
| 9740 | |
| 9741 /// @domName IDBDatabase.removeEventListener; @docsEditable true | |
| 9742 @JSName('removeEventListener') | |
| 9743 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | |
| 9744 | |
| 9745 /// @domName IDBDatabase.setVersion; @docsEditable true | |
| 9746 IDBVersionChangeRequest setVersion(String version) native; | |
| 9747 } | |
| 9748 | |
| 9749 // TODO(sra): This should be a static member of IDBTransaction but dart2js | |
| 9750 // can't handle that. Move it back after dart2js is completely done. | |
| 9751 var _transaction_fn; // Assigned one of the static methods. | |
| 9752 | |
| 9753 class IDBDatabaseEvents extends Events { | |
| 9754 IDBDatabaseEvents(EventTarget _ptr) : super(_ptr); | |
| 9755 | |
| 9756 EventListenerList get abort => this['abort']; | |
| 9757 | |
| 9758 EventListenerList get error => this['error']; | |
| 9759 | |
| 9760 EventListenerList get versionChange => this['versionchange']; | |
| 9761 } | |
| 9762 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9763 // for details. All rights reserved. Use of this source code is governed by a | |
| 9764 // BSD-style license that can be found in the LICENSE file. | |
| 9765 | |
| 9766 | |
| 9767 /// @domName IDBDatabaseException; @docsEditable true | |
| 9768 class IDBDatabaseException native "*IDBDatabaseException" { | |
| 9769 | |
| 9770 static const int ABORT_ERR = 20; | |
| 9771 | |
| 9772 static const int CONSTRAINT_ERR = 4; | |
| 9773 | |
| 9774 static const int DATA_ERR = 5; | |
| 9775 | |
| 9776 static const int NON_TRANSIENT_ERR = 2; | |
| 9777 | |
| 9778 static const int NOT_ALLOWED_ERR = 6; | |
| 9779 | |
| 9780 static const int NOT_FOUND_ERR = 8; | |
| 9781 | |
| 9782 static const int NO_ERR = 0; | |
| 9783 | |
| 9784 static const int QUOTA_ERR = 22; | |
| 9785 | |
| 9786 static const int READ_ONLY_ERR = 9; | |
| 9787 | |
| 9788 static const int TIMEOUT_ERR = 23; | |
| 9789 | |
| 9790 static const int TRANSACTION_INACTIVE_ERR = 7; | |
| 9791 | |
| 9792 static const int UNKNOWN_ERR = 1; | |
| 9793 | |
| 9794 static const int VER_ERR = 12; | |
| 9795 | |
| 9796 /// @domName IDBDatabaseException.code; @docsEditable true | |
| 9797 final int code; | |
| 9798 | |
| 9799 /// @domName IDBDatabaseException.message; @docsEditable true | |
| 9800 final String message; | |
| 9801 | |
| 9802 /// @domName IDBDatabaseException.name; @docsEditable true | |
| 9803 final String name; | |
| 9804 | |
| 9805 /// @domName IDBDatabaseException.toString; @docsEditable true | |
| 9806 String toString() native; | |
| 9807 } | |
| 9808 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9809 // for details. All rights reserved. Use of this source code is governed by a | |
| 9810 // BSD-style license that can be found in the LICENSE file. | |
| 9811 | |
| 9812 | |
| 9813 /// @domName IDBFactory; @docsEditable true | |
| 9814 class IDBFactory native "*IDBFactory" { | |
| 9815 | |
| 9816 /// @domName IDBFactory.cmp; @docsEditable true | |
| 9817 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) { | |
| 9818 var first_1 = _convertDartToNative_IDBKey(first); | |
| 9819 var second_2 = _convertDartToNative_IDBKey(second); | |
| 9820 return _cmp_1(first_1, second_2); | |
| 9821 } | |
| 9822 @JSName('cmp') | |
| 9823 int _cmp_1(first, second) native; | |
| 9824 | |
| 9825 /// @domName IDBFactory.deleteDatabase; @docsEditable true | |
| 9826 IDBVersionChangeRequest deleteDatabase(String name) native; | |
| 9827 | |
| 9828 /// @domName IDBFactory.open; @docsEditable true | |
| 9829 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBDatabase') | |
| 9830 IDBOpenDBRequest open(String name, [int version]) native; | |
| 9831 | |
| 9832 /// @domName IDBFactory.webkitGetDatabaseNames; @docsEditable true | |
| 9833 IDBRequest webkitGetDatabaseNames() native; | |
| 9834 } | |
| 9835 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9836 // for details. All rights reserved. Use of this source code is governed by a | |
| 9837 // BSD-style license that can be found in the LICENSE file. | |
| 9838 | |
| 9839 | |
| 9840 /// @domName IDBIndex; @docsEditable true | |
| 9841 class IDBIndex native "*IDBIndex" { | |
| 9842 | |
| 9843 /// @domName IDBIndex.keyPath; @docsEditable true | |
| 9844 final dynamic keyPath; | |
| 9845 | |
| 9846 /// @domName IDBIndex.multiEntry; @docsEditable true | |
| 9847 final bool multiEntry; | |
| 9848 | |
| 9849 /// @domName IDBIndex.name; @docsEditable true | |
| 9850 final String name; | |
| 9851 | |
| 9852 /// @domName IDBIndex.objectStore; @docsEditable true | |
| 9853 final IDBObjectStore objectStore; | |
| 9854 | |
| 9855 /// @domName IDBIndex.unique; @docsEditable true | |
| 9856 final bool unique; | |
| 9857 | |
| 9858 /// @domName IDBIndex.count; @docsEditable true | |
| 9859 IDBRequest count([key_OR_range]) { | |
| 9860 if (!?key_OR_range) { | |
| 9861 return _count_1(); | |
| 9862 } | |
| 9863 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
) { | |
| 9864 return _count_2(key_OR_range); | |
| 9865 } | |
| 9866 if (?key_OR_range) { | |
| 9867 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | |
| 9868 return _count_3(key_1); | |
| 9869 } | |
| 9870 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 9871 } | |
| 9872 @JSName('count') | |
| 9873 IDBRequest _count_1() native; | |
| 9874 @JSName('count') | |
| 9875 IDBRequest _count_2(IDBKeyRange range) native; | |
| 9876 @JSName('count') | |
| 9877 IDBRequest _count_3(key) native; | |
| 9878 | |
| 9879 /// @domName IDBIndex.get; @docsEditable true | |
| 9880 IDBRequest get(key) { | |
| 9881 if ((?key && (key is IDBKeyRange || key == null))) { | |
| 9882 return _get_1(key); | |
| 9883 } | |
| 9884 if (?key) { | |
| 9885 var key_1 = _convertDartToNative_IDBKey(key); | |
| 9886 return _get_2(key_1); | |
| 9887 } | |
| 9888 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 9889 } | |
| 9890 @JSName('get') | |
| 9891 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc
riptValue | |
| 9892 IDBRequest _get_1(IDBKeyRange key) native; | |
| 9893 @JSName('get') | |
| 9894 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc
riptValue | |
| 9895 IDBRequest _get_2(key) native; | |
| 9896 | |
| 9897 /// @domName IDBIndex.getKey; @docsEditable true | |
| 9898 IDBRequest getKey(key) { | |
| 9899 if ((?key && (key is IDBKeyRange || key == null))) { | |
| 9900 return _getKey_1(key); | |
| 9901 } | |
| 9902 if (?key) { | |
| 9903 var key_1 = _convertDartToNative_IDBKey(key); | |
| 9904 return _getKey_2(key_1); | |
| 9905 } | |
| 9906 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 9907 } | |
| 9908 @JSName('getKey') | |
| 9909 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc
riptValue @Creates('IDBObjectStore') | |
| 9910 IDBRequest _getKey_1(IDBKeyRange key) native; | |
| 9911 @JSName('getKey') | |
| 9912 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc
riptValue @Creates('IDBObjectStore') | |
| 9913 IDBRequest _getKey_2(key) native; | |
| 9914 | |
| 9915 /// @domName IDBIndex.openCursor; @docsEditable true | |
| 9916 IDBRequest openCursor([key_OR_range, String direction]) { | |
| 9917 if (!?key_OR_range && | |
| 9918 !?direction) { | |
| 9919 return _openCursor_1(); | |
| 9920 } | |
| 9921 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
&& | |
| 9922 !?direction) { | |
| 9923 return _openCursor_2(key_OR_range); | |
| 9924 } | |
| 9925 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
) { | |
| 9926 return _openCursor_3(key_OR_range, direction); | |
| 9927 } | |
| 9928 if (?key_OR_range && | |
| 9929 !?direction) { | |
| 9930 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | |
| 9931 return _openCursor_4(key_1); | |
| 9932 } | |
| 9933 if (?key_OR_range) { | |
| 9934 var key_2 = _convertDartToNative_IDBKey(key_OR_range); | |
| 9935 return _openCursor_5(key_2, direction); | |
| 9936 } | |
| 9937 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 9938 } | |
| 9939 @JSName('openCursor') | |
| 9940 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9941 IDBRequest _openCursor_1() native; | |
| 9942 @JSName('openCursor') | |
| 9943 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9944 IDBRequest _openCursor_2(IDBKeyRange range) native; | |
| 9945 @JSName('openCursor') | |
| 9946 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9947 IDBRequest _openCursor_3(IDBKeyRange range, direction) native; | |
| 9948 @JSName('openCursor') | |
| 9949 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9950 IDBRequest _openCursor_4(key) native; | |
| 9951 @JSName('openCursor') | |
| 9952 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9953 IDBRequest _openCursor_5(key, direction) native; | |
| 9954 | |
| 9955 /// @domName IDBIndex.openKeyCursor; @docsEditable true | |
| 9956 IDBRequest openKeyCursor([key_OR_range, String direction]) { | |
| 9957 if (!?key_OR_range && | |
| 9958 !?direction) { | |
| 9959 return _openKeyCursor_1(); | |
| 9960 } | |
| 9961 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
&& | |
| 9962 !?direction) { | |
| 9963 return _openKeyCursor_2(key_OR_range); | |
| 9964 } | |
| 9965 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
) { | |
| 9966 return _openKeyCursor_3(key_OR_range, direction); | |
| 9967 } | |
| 9968 if (?key_OR_range && | |
| 9969 !?direction) { | |
| 9970 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | |
| 9971 return _openKeyCursor_4(key_1); | |
| 9972 } | |
| 9973 if (?key_OR_range) { | |
| 9974 var key_2 = _convertDartToNative_IDBKey(key_OR_range); | |
| 9975 return _openKeyCursor_5(key_2, direction); | |
| 9976 } | |
| 9977 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 9978 } | |
| 9979 @JSName('openKeyCursor') | |
| 9980 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9981 IDBRequest _openKeyCursor_1() native; | |
| 9982 @JSName('openKeyCursor') | |
| 9983 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9984 IDBRequest _openKeyCursor_2(IDBKeyRange range) native; | |
| 9985 @JSName('openKeyCursor') | |
| 9986 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9987 IDBRequest _openKeyCursor_3(IDBKeyRange range, direction) native; | |
| 9988 @JSName('openKeyCursor') | |
| 9989 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9990 IDBRequest _openKeyCursor_4(key) native; | |
| 9991 @JSName('openKeyCursor') | |
| 9992 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 9993 IDBRequest _openKeyCursor_5(key, direction) native; | |
| 9994 } | |
| 9995 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 9996 // for details. All rights reserved. Use of this source code is governed by a | |
| 9997 // BSD-style license that can be found in the LICENSE file. | |
| 9998 | |
| 9999 | |
| 10000 /// @domName IDBKey; @docsEditable true | |
| 10001 class IDBKey native "*IDBKey" { | |
| 10002 } | |
| 10003 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10004 // for details. All rights reserved. Use of this source code is governed by a | |
| 10005 // BSD-style license that can be found in the LICENSE file. | |
| 10006 | |
| 10007 | |
| 10008 /// @domName IDBKeyRange | |
| 10009 class IDBKeyRange native "*IDBKeyRange" { | |
| 10010 /** | |
| 10011 * @domName IDBKeyRange.only | |
| 10012 */ | |
| 10013 factory IDBKeyRange.only(/*IDBKey*/ value) => | |
| 10014 _IDBKeyRangeFactoryProvider.createIDBKeyRange_only(value); | |
| 10015 | |
| 10016 /** | |
| 10017 * @domName IDBKeyRange.lowerBound | |
| 10018 */ | |
| 10019 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) => | |
| 10020 _IDBKeyRangeFactoryProvider.createIDBKeyRange_lowerBound(bound, open); | |
| 10021 | |
| 10022 /** | |
| 10023 * @domName IDBKeyRange.upperBound | |
| 10024 */ | |
| 10025 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) => | |
| 10026 _IDBKeyRangeFactoryProvider.createIDBKeyRange_upperBound(bound, open); | |
| 10027 | |
| 10028 /** | |
| 10029 * @domName IDBKeyRange.bound | |
| 10030 */ | |
| 10031 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper, | |
| 10032 [bool lowerOpen = false, bool upperOpen = false]) => | |
| 10033 _IDBKeyRangeFactoryProvider.createIDBKeyRange_bound( | |
| 10034 lower, upper, lowerOpen, upperOpen); | |
| 10035 | |
| 10036 | |
| 10037 /// @domName IDBKeyRange.lower; @docsEditable true | |
| 10038 dynamic get lower => _convertNativeToDart_IDBKey(this._lower); | |
| 10039 @JSName('lower') | |
| 10040 final dynamic _lower; | |
| 10041 | |
| 10042 /// @domName IDBKeyRange.lowerOpen; @docsEditable true | |
| 10043 final bool lowerOpen; | |
| 10044 | |
| 10045 /// @domName IDBKeyRange.upper; @docsEditable true | |
| 10046 dynamic get upper => _convertNativeToDart_IDBKey(this._upper); | |
| 10047 @JSName('upper') | |
| 10048 final dynamic _upper; | |
| 10049 | |
| 10050 /// @domName IDBKeyRange.upperOpen; @docsEditable true | |
| 10051 final bool upperOpen; | |
| 10052 | |
| 10053 /// @domName IDBKeyRange.bound_; @docsEditable true | |
| 10054 static IDBKeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen,
bool upperOpen]) { | |
| 10055 if (?upperOpen) { | |
| 10056 var lower_1 = _convertDartToNative_IDBKey(lower); | |
| 10057 var upper_2 = _convertDartToNative_IDBKey(upper); | |
| 10058 return _bound__1(lower_1, upper_2, lowerOpen, upperOpen); | |
| 10059 } | |
| 10060 if (?lowerOpen) { | |
| 10061 var lower_3 = _convertDartToNative_IDBKey(lower); | |
| 10062 var upper_4 = _convertDartToNative_IDBKey(upper); | |
| 10063 return _bound__2(lower_3, upper_4, lowerOpen); | |
| 10064 } | |
| 10065 var lower_5 = _convertDartToNative_IDBKey(lower); | |
| 10066 var upper_6 = _convertDartToNative_IDBKey(upper); | |
| 10067 return _bound__3(lower_5, upper_6); | |
| 10068 } | |
| 10069 @JSName('bound') | |
| 10070 static IDBKeyRange _bound__1(lower, upper, lowerOpen, upperOpen) native; | |
| 10071 @JSName('bound') | |
| 10072 static IDBKeyRange _bound__2(lower, upper, lowerOpen) native; | |
| 10073 @JSName('bound') | |
| 10074 static IDBKeyRange _bound__3(lower, upper) native; | |
| 10075 | |
| 10076 /// @domName IDBKeyRange.lowerBound_; @docsEditable true | |
| 10077 static IDBKeyRange lowerBound_(/*IDBKey*/ bound, [bool open]) { | |
| 10078 if (?open) { | |
| 10079 var bound_1 = _convertDartToNative_IDBKey(bound); | |
| 10080 return _lowerBound__1(bound_1, open); | |
| 10081 } | |
| 10082 var bound_2 = _convertDartToNative_IDBKey(bound); | |
| 10083 return _lowerBound__2(bound_2); | |
| 10084 } | |
| 10085 @JSName('lowerBound') | |
| 10086 static IDBKeyRange _lowerBound__1(bound, open) native; | |
| 10087 @JSName('lowerBound') | |
| 10088 static IDBKeyRange _lowerBound__2(bound) native; | |
| 10089 | |
| 10090 /// @domName IDBKeyRange.only_; @docsEditable true | |
| 10091 static IDBKeyRange only_(/*IDBKey*/ value) { | |
| 10092 var value_1 = _convertDartToNative_IDBKey(value); | |
| 10093 return _only__1(value_1); | |
| 10094 } | |
| 10095 @JSName('only') | |
| 10096 static IDBKeyRange _only__1(value) native; | |
| 10097 | |
| 10098 /// @domName IDBKeyRange.upperBound_; @docsEditable true | |
| 10099 static IDBKeyRange upperBound_(/*IDBKey*/ bound, [bool open]) { | |
| 10100 if (?open) { | |
| 10101 var bound_1 = _convertDartToNative_IDBKey(bound); | |
| 10102 return _upperBound__1(bound_1, open); | |
| 10103 } | |
| 10104 var bound_2 = _convertDartToNative_IDBKey(bound); | |
| 10105 return _upperBound__2(bound_2); | |
| 10106 } | |
| 10107 @JSName('upperBound') | |
| 10108 static IDBKeyRange _upperBound__1(bound, open) native; | |
| 10109 @JSName('upperBound') | |
| 10110 static IDBKeyRange _upperBound__2(bound) native; | |
| 10111 | |
| 10112 } | |
| 10113 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10114 // for details. All rights reserved. Use of this source code is governed by a | |
| 10115 // BSD-style license that can be found in the LICENSE file. | |
| 10116 | |
| 10117 | |
| 10118 /// @domName IDBObjectStore; @docsEditable true | |
| 10119 class IDBObjectStore native "*IDBObjectStore" { | |
| 10120 | |
| 10121 /// @domName IDBObjectStore.autoIncrement; @docsEditable true | |
| 10122 final bool autoIncrement; | |
| 10123 | |
| 10124 /// @domName IDBObjectStore.indexNames; @docsEditable true | |
| 10125 @Returns('_DOMStringList') @Creates('_DOMStringList') | |
| 10126 final List<String> indexNames; | |
| 10127 | |
| 10128 /// @domName IDBObjectStore.keyPath; @docsEditable true | |
| 10129 final dynamic keyPath; | |
| 10130 | |
| 10131 /// @domName IDBObjectStore.name; @docsEditable true | |
| 10132 final String name; | |
| 10133 | |
| 10134 /// @domName IDBObjectStore.transaction; @docsEditable true | |
| 10135 final IDBTransaction transaction; | |
| 10136 | |
| 10137 /// @domName IDBObjectStore.add; @docsEditable true | |
| 10138 IDBRequest add(/*any*/ value, [/*IDBKey*/ key]) { | |
| 10139 if (?key) { | |
| 10140 var value_1 = convertDartToNative_SerializedScriptValue(value); | |
| 10141 var key_2 = _convertDartToNative_IDBKey(key); | |
| 10142 return _add_1(value_1, key_2); | |
| 10143 } | |
| 10144 var value_3 = convertDartToNative_SerializedScriptValue(value); | |
| 10145 return _add_2(value_3); | |
| 10146 } | |
| 10147 @JSName('add') | |
| 10148 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey | |
| 10149 IDBRequest _add_1(value, key) native; | |
| 10150 @JSName('add') | |
| 10151 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey | |
| 10152 IDBRequest _add_2(value) native; | |
| 10153 | |
| 10154 /// @domName IDBObjectStore.clear; @docsEditable true | |
| 10155 IDBRequest clear() native; | |
| 10156 | |
| 10157 /// @domName IDBObjectStore.count; @docsEditable true | |
| 10158 IDBRequest count([key_OR_range]) { | |
| 10159 if (!?key_OR_range) { | |
| 10160 return _count_1(); | |
| 10161 } | |
| 10162 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
) { | |
| 10163 return _count_2(key_OR_range); | |
| 10164 } | |
| 10165 if (?key_OR_range) { | |
| 10166 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | |
| 10167 return _count_3(key_1); | |
| 10168 } | |
| 10169 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 10170 } | |
| 10171 @JSName('count') | |
| 10172 IDBRequest _count_1() native; | |
| 10173 @JSName('count') | |
| 10174 IDBRequest _count_2(IDBKeyRange range) native; | |
| 10175 @JSName('count') | |
| 10176 IDBRequest _count_3(key) native; | |
| 10177 | |
| 10178 /// @domName IDBObjectStore.createIndex; @docsEditable true | |
| 10179 IDBIndex createIndex(String name, keyPath, [Map options]) { | |
| 10180 if ((?keyPath && (keyPath is List<String> || keyPath == null)) && | |
| 10181 !?options) { | |
| 10182 List keyPath_1 = convertDartToNative_StringArray(keyPath); | |
| 10183 return _createIndex_1(name, keyPath_1); | |
| 10184 } | |
| 10185 if ((?keyPath && (keyPath is List<String> || keyPath == null))) { | |
| 10186 List keyPath_2 = convertDartToNative_StringArray(keyPath); | |
| 10187 var options_3 = convertDartToNative_Dictionary(options); | |
| 10188 return _createIndex_2(name, keyPath_2, options_3); | |
| 10189 } | |
| 10190 if ((?keyPath && (keyPath is String || keyPath == null)) && | |
| 10191 !?options) { | |
| 10192 return _createIndex_3(name, keyPath); | |
| 10193 } | |
| 10194 if ((?keyPath && (keyPath is String || keyPath == null))) { | |
| 10195 var options_4 = convertDartToNative_Dictionary(options); | |
| 10196 return _createIndex_4(name, keyPath, options_4); | |
| 10197 } | |
| 10198 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 10199 } | |
| 10200 @JSName('createIndex') | |
| 10201 IDBIndex _createIndex_1(name, List keyPath) native; | |
| 10202 @JSName('createIndex') | |
| 10203 IDBIndex _createIndex_2(name, List keyPath, options) native; | |
| 10204 @JSName('createIndex') | |
| 10205 IDBIndex _createIndex_3(name, String keyPath) native; | |
| 10206 @JSName('createIndex') | |
| 10207 IDBIndex _createIndex_4(name, String keyPath, options) native; | |
| 10208 | |
| 10209 /// @domName IDBObjectStore.delete; @docsEditable true | |
| 10210 IDBRequest delete(key_OR_keyRange) { | |
| 10211 if ((?key_OR_keyRange && (key_OR_keyRange is IDBKeyRange || key_OR_keyRange
== null))) { | |
| 10212 return _delete_1(key_OR_keyRange); | |
| 10213 } | |
| 10214 if (?key_OR_keyRange) { | |
| 10215 var key_1 = _convertDartToNative_IDBKey(key_OR_keyRange); | |
| 10216 return _delete_2(key_1); | |
| 10217 } | |
| 10218 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 10219 } | |
| 10220 @JSName('delete') | |
| 10221 IDBRequest _delete_1(IDBKeyRange keyRange) native; | |
| 10222 @JSName('delete') | |
| 10223 IDBRequest _delete_2(key) native; | |
| 10224 | |
| 10225 /// @domName IDBObjectStore.deleteIndex; @docsEditable true | |
| 10226 void deleteIndex(String name) native; | |
| 10227 | |
| 10228 /// @domName IDBObjectStore.getObject; @docsEditable true | |
| 10229 IDBRequest getObject(key) { | |
| 10230 if ((?key && (key is IDBKeyRange || key == null))) { | |
| 10231 return _getObject_1(key); | |
| 10232 } | |
| 10233 if (?key) { | |
| 10234 var key_1 = _convertDartToNative_IDBKey(key); | |
| 10235 return _getObject_2(key_1); | |
| 10236 } | |
| 10237 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 10238 } | |
| 10239 @JSName('get') | |
| 10240 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc
riptValue | |
| 10241 IDBRequest _getObject_1(IDBKeyRange key) native; | |
| 10242 @JSName('get') | |
| 10243 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc
riptValue | |
| 10244 IDBRequest _getObject_2(key) native; | |
| 10245 | |
| 10246 /// @domName IDBObjectStore.index; @docsEditable true | |
| 10247 IDBIndex index(String name) native; | |
| 10248 | |
| 10249 /// @domName IDBObjectStore.openCursor; @docsEditable true | |
| 10250 IDBRequest openCursor([key_OR_range, String direction]) { | |
| 10251 if (!?key_OR_range && | |
| 10252 !?direction) { | |
| 10253 return _openCursor_1(); | |
| 10254 } | |
| 10255 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
&& | |
| 10256 !?direction) { | |
| 10257 return _openCursor_2(key_OR_range); | |
| 10258 } | |
| 10259 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null))
) { | |
| 10260 return _openCursor_3(key_OR_range, direction); | |
| 10261 } | |
| 10262 if (?key_OR_range && | |
| 10263 !?direction) { | |
| 10264 var key_1 = _convertDartToNative_IDBKey(key_OR_range); | |
| 10265 return _openCursor_4(key_1); | |
| 10266 } | |
| 10267 if (?key_OR_range) { | |
| 10268 var key_2 = _convertDartToNative_IDBKey(key_OR_range); | |
| 10269 return _openCursor_5(key_2, direction); | |
| 10270 } | |
| 10271 throw new ArgumentError("Incorrect number or type of arguments"); | |
| 10272 } | |
| 10273 @JSName('openCursor') | |
| 10274 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 10275 IDBRequest _openCursor_1() native; | |
| 10276 @JSName('openCursor') | |
| 10277 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 10278 IDBRequest _openCursor_2(IDBKeyRange range) native; | |
| 10279 @JSName('openCursor') | |
| 10280 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 10281 IDBRequest _openCursor_3(IDBKeyRange range, direction) native; | |
| 10282 @JSName('openCursor') | |
| 10283 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 10284 IDBRequest _openCursor_4(key) native; | |
| 10285 @JSName('openCursor') | |
| 10286 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor') | |
| 10287 IDBRequest _openCursor_5(key, direction) native; | |
| 10288 | |
| 10289 /// @domName IDBObjectStore.put; @docsEditable true | |
| 10290 IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) { | |
| 10291 if (?key) { | |
| 10292 var value_1 = convertDartToNative_SerializedScriptValue(value); | |
| 10293 var key_2 = _convertDartToNative_IDBKey(key); | |
| 10294 return _put_1(value_1, key_2); | |
| 10295 } | |
| 10296 var value_3 = convertDartToNative_SerializedScriptValue(value); | |
| 10297 return _put_2(value_3); | |
| 10298 } | |
| 10299 @JSName('put') | |
| 10300 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey | |
| 10301 IDBRequest _put_1(value, key) native; | |
| 10302 @JSName('put') | |
| 10303 @Returns('IDBRequest') @Creates('IDBRequest') @_annotation_Creates_IDBKey | |
| 10304 IDBRequest _put_2(value) native; | |
| 10305 } | |
| 10306 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10307 // for details. All rights reserved. Use of this source code is governed by a | |
| 10308 // BSD-style license that can be found in the LICENSE file. | |
| 10309 | |
| 10310 | |
| 10311 /// @domName IDBOpenDBRequest; @docsEditable true | |
| 10312 class IDBOpenDBRequest extends IDBRequest implements EventTarget native "*IDBOpe
nDBRequest" { | |
| 10313 | |
| 10314 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 10315 IDBOpenDBRequestEvents get on => | |
| 10316 new IDBOpenDBRequestEvents(this); | |
| 10317 } | |
| 10318 | |
| 10319 class IDBOpenDBRequestEvents extends IDBRequestEvents { | |
| 10320 IDBOpenDBRequestEvents(EventTarget _ptr) : super(_ptr); | |
| 10321 | |
| 10322 EventListenerList get blocked => this['blocked']; | |
| 10323 | |
| 10324 EventListenerList get upgradeNeeded => this['upgradeneeded']; | |
| 10325 } | |
| 10326 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10327 // for details. All rights reserved. Use of this source code is governed by a | |
| 10328 // BSD-style license that can be found in the LICENSE file. | |
| 10329 | |
| 10330 | |
| 10331 /// @domName IDBRequest; @docsEditable true | |
| 10332 class IDBRequest extends EventTarget native "*IDBRequest" { | |
| 10333 | |
| 10334 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 10335 IDBRequestEvents get on => | |
| 10336 new IDBRequestEvents(this); | |
| 10337 | |
| 10338 /// @domName IDBRequest.error; @docsEditable true | |
| 10339 final DOMError error; | |
| 10340 | |
| 10341 /// @domName IDBRequest.errorCode; @docsEditable true | |
| 10342 final int errorCode; | |
| 10343 | |
| 10344 /// @domName IDBRequest.readyState; @docsEditable true | |
| 10345 final String readyState; | |
| 10346 | |
| 10347 /// @domName IDBRequest.result; @docsEditable true | |
| 10348 dynamic get result => _convertNativeToDart_IDBAny(this._result); | |
| 10349 @JSName('result') | |
| 10350 @Creates('Null') | |
| 10351 final dynamic _result; | |
| 10352 | |
| 10353 /// @domName IDBRequest.source; @docsEditable true | |
| 10354 @Creates('Null') | |
| 10355 final dynamic source; | |
| 10356 | |
| 10357 /// @domName IDBRequest.transaction; @docsEditable true | |
| 10358 final IDBTransaction transaction; | |
| 10359 | |
| 10360 /// @domName IDBRequest.webkitErrorMessage; @docsEditable true | |
| 10361 final String webkitErrorMessage; | |
| 10362 | |
| 10363 /// @domName IDBRequest.addEventListener; @docsEditable true | |
| 10364 @JSName('addEventListener') | |
| 10365 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | |
| 10366 | |
| 10367 /// @domName IDBRequest.dispatchEvent; @docsEditable true | |
| 10368 @JSName('dispatchEvent') | |
| 10369 bool $dom_dispatchEvent(Event evt) native; | |
| 10370 | |
| 10371 /// @domName IDBRequest.removeEventListener; @docsEditable true | |
| 10372 @JSName('removeEventListener') | |
| 10373 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | |
| 10374 } | |
| 10375 | |
| 10376 class IDBRequestEvents extends Events { | |
| 10377 IDBRequestEvents(EventTarget _ptr) : super(_ptr); | |
| 10378 | |
| 10379 EventListenerList get error => this['error']; | |
| 10380 | |
| 10381 EventListenerList get success => this['success']; | |
| 10382 } | |
| 10383 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10384 // for details. All rights reserved. Use of this source code is governed by a | |
| 10385 // BSD-style license that can be found in the LICENSE file. | |
| 10386 | |
| 10387 | |
| 10388 /// @domName IDBTransaction; @docsEditable true | |
| 10389 class IDBTransaction extends EventTarget native "*IDBTransaction" { | |
| 10390 | |
| 10391 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 10392 IDBTransactionEvents get on => | |
| 10393 new IDBTransactionEvents(this); | |
| 10394 | |
| 10395 static const int READ_ONLY = 0; | |
| 10396 | |
| 10397 static const int READ_WRITE = 1; | |
| 10398 | |
| 10399 static const int VERSION_CHANGE = 2; | |
| 10400 | |
| 10401 /// @domName IDBTransaction.db; @docsEditable true | |
| 10402 final IDBDatabase db; | |
| 10403 | |
| 10404 /// @domName IDBTransaction.error; @docsEditable true | |
| 10405 final DOMError error; | |
| 10406 | |
| 10407 /// @domName IDBTransaction.mode; @docsEditable true | |
| 10408 final String mode; | |
| 10409 | |
| 10410 /// @domName IDBTransaction.abort; @docsEditable true | |
| 10411 void abort() native; | |
| 10412 | |
| 10413 /// @domName IDBTransaction.addEventListener; @docsEditable true | |
| 10414 @JSName('addEventListener') | |
| 10415 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | |
| 10416 | |
| 10417 /// @domName IDBTransaction.dispatchEvent; @docsEditable true | |
| 10418 @JSName('dispatchEvent') | |
| 10419 bool $dom_dispatchEvent(Event evt) native; | |
| 10420 | |
| 10421 /// @domName IDBTransaction.objectStore; @docsEditable true | |
| 10422 IDBObjectStore objectStore(String name) native; | |
| 10423 | |
| 10424 /// @domName IDBTransaction.removeEventListener; @docsEditable true | |
| 10425 @JSName('removeEventListener') | |
| 10426 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native; | |
| 10427 } | |
| 10428 | |
| 10429 class IDBTransactionEvents extends Events { | |
| 10430 IDBTransactionEvents(EventTarget _ptr) : super(_ptr); | |
| 10431 | |
| 10432 EventListenerList get abort => this['abort']; | |
| 10433 | |
| 10434 EventListenerList get complete => this['complete']; | |
| 10435 | |
| 10436 EventListenerList get error => this['error']; | |
| 10437 } | |
| 10438 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10439 // for details. All rights reserved. Use of this source code is governed by a | |
| 10440 // BSD-style license that can be found in the LICENSE file. | |
| 10441 | |
| 10442 | |
| 10443 /// @domName IDBVersionChangeEvent; @docsEditable true | |
| 10444 class IDBUpgradeNeededEvent extends Event native "*IDBVersionChangeEvent" { | |
| 10445 | |
| 10446 /// @domName IDBVersionChangeEvent.newVersion; @docsEditable true | |
| 10447 final int newVersion; | |
| 10448 | |
| 10449 /// @domName IDBVersionChangeEvent.oldVersion; @docsEditable true | |
| 10450 final int oldVersion; | |
| 10451 } | |
| 10452 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10453 // for details. All rights reserved. Use of this source code is governed by a | |
| 10454 // BSD-style license that can be found in the LICENSE file. | |
| 10455 | |
| 10456 | |
| 10457 /// @domName IDBVersionChangeEvent; @docsEditable true | |
| 10458 class IDBVersionChangeEvent extends Event native "*IDBVersionChangeEvent" { | |
| 10459 | |
| 10460 /// @domName IDBVersionChangeEvent.version; @docsEditable true | |
| 10461 final String version; | |
| 10462 } | |
| 10463 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10464 // for details. All rights reserved. Use of this source code is governed by a | |
| 10465 // BSD-style license that can be found in the LICENSE file. | |
| 10466 | |
| 10467 | |
| 10468 /// @domName IDBVersionChangeRequest; @docsEditable true | |
| 10469 class IDBVersionChangeRequest extends IDBRequest implements EventTarget native "
*IDBVersionChangeRequest" { | |
| 10470 | |
| 10471 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | |
| 10472 IDBVersionChangeRequestEvents get on => | |
| 10473 new IDBVersionChangeRequestEvents(this); | |
| 10474 } | |
| 10475 | |
| 10476 class IDBVersionChangeRequestEvents extends IDBRequestEvents { | |
| 10477 IDBVersionChangeRequestEvents(EventTarget _ptr) : super(_ptr); | |
| 10478 | |
| 10479 EventListenerList get blocked => this['blocked']; | |
| 10480 } | |
| 10481 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 10482 // for details. All rights reserved. Use of this source code is governed by a | |
| 10483 // BSD-style license that can be found in the LICENSE file. | |
| 10484 | |
| 10485 | |
| 10486 /// @domName HTMLIFrameElement; @docsEditable true | 9577 /// @domName HTMLIFrameElement; @docsEditable true |
| 10487 class IFrameElement extends Element implements Element native "*HTMLIFrameElemen
t" { | 9578 class IFrameElement extends Element implements Element native "*HTMLIFrameElemen
t" { |
| 10488 | 9579 |
| 10489 factory IFrameElement() => document.$dom_createElement("iframe"); | 9580 factory IFrameElement() => document.$dom_createElement("iframe"); |
| 10490 | 9581 |
| 10491 /// @domName HTMLIFrameElement.align; @docsEditable true | 9582 /// @domName HTMLIFrameElement.align; @docsEditable true |
| 10492 String align; | 9583 String align; |
| 10493 | 9584 |
| 10494 /// @domName HTMLIFrameElement.contentWindow; @docsEditable true | 9585 /// @domName HTMLIFrameElement.contentWindow; @docsEditable true |
| 10495 Window get contentWindow => _convertNativeToDart_Window(this._contentWindow); | 9586 Window get contentWindow => _convertNativeToDart_Window(this._contentWindow); |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11641 $this.requestAnimationFrame = function(callback) { | 10732 $this.requestAnimationFrame = function(callback) { |
| 11642 return window.setTimeout(function() { | 10733 return window.setTimeout(function() { |
| 11643 callback(Date.now()); | 10734 callback(Date.now()); |
| 11644 }, 16 /* 16ms ~= 60fps */); | 10735 }, 16 /* 16ms ~= 60fps */); |
| 11645 }; | 10736 }; |
| 11646 $this.cancelAnimationFrame = function(id) { clearTimeout(id); } | 10737 $this.cancelAnimationFrame = function(id) { clearTimeout(id); } |
| 11647 })(#)""", | 10738 })(#)""", |
| 11648 this); | 10739 this); |
| 11649 } | 10740 } |
| 11650 | 10741 |
| 11651 IDBFactory get indexedDB => | 10742 IdbFactory get indexedDB => |
| 11652 JS('IDBFactory', | 10743 JS('IdbFactory', |
| 11653 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', | 10744 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', |
| 11654 this, this, this); | 10745 this, this, this); |
| 11655 | 10746 |
| 11656 /** | 10747 /** |
| 11657 * Lookup a port by its [name]. Return null if no port is | 10748 * Lookup a port by its [name]. Return null if no port is |
| 11658 * registered under [name]. | 10749 * registered under [name]. |
| 11659 */ | 10750 */ |
| 11660 SendPortSync lookupPort(String name) { | 10751 SendPortSync lookupPort(String name) { |
| 11661 var port = JSON.parse(document.documentElement.attributes['dart-port:$name']
); | 10752 var port = JSON.parse(document.documentElement.attributes['dart-port:$name']
); |
| 11662 return _deserialize(port); | 10753 return _deserialize(port); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11809 | 10900 |
| 11810 /// @domName Window.toolbar; @docsEditable true | 10901 /// @domName Window.toolbar; @docsEditable true |
| 11811 final BarInfo toolbar; | 10902 final BarInfo toolbar; |
| 11812 | 10903 |
| 11813 /// @domName Window.top; @docsEditable true | 10904 /// @domName Window.top; @docsEditable true |
| 11814 Window get top => _convertNativeToDart_Window(this._top); | 10905 Window get top => _convertNativeToDart_Window(this._top); |
| 11815 @JSName('top') | 10906 @JSName('top') |
| 11816 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 10907 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') |
| 11817 final dynamic _top; | 10908 final dynamic _top; |
| 11818 | 10909 |
| 11819 /// @domName DOMWindow.webkitIndexedDB; @docsEditable true | |
| 11820 final IDBFactory webkitIndexedDB; | |
| 11821 | |
| 11822 /// @domName DOMWindow.webkitNotifications; @docsEditable true | 10910 /// @domName DOMWindow.webkitNotifications; @docsEditable true |
| 11823 final NotificationCenter webkitNotifications; | 10911 final NotificationCenter webkitNotifications; |
| 11824 | 10912 |
| 11825 /// @domName DOMWindow.webkitStorageInfo; @docsEditable true | 10913 /// @domName DOMWindow.webkitStorageInfo; @docsEditable true |
| 11826 final StorageInfo webkitStorageInfo; | 10914 final StorageInfo webkitStorageInfo; |
| 11827 | 10915 |
| 11828 /// @domName Window.window; @docsEditable true | 10916 /// @domName Window.window; @docsEditable true |
| 11829 Window get window => _convertNativeToDart_Window(this._window); | 10917 Window get window => _convertNativeToDart_Window(this._window); |
| 11830 @JSName('window') | 10918 @JSName('window') |
| 11831 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') | 10919 @Creates('LocalWindow|=Object') @Returns('LocalWindow|=Object') |
| (...skipping 8005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19837 class WorkerEvents extends AbstractWorkerEvents { | 18925 class WorkerEvents extends AbstractWorkerEvents { |
| 19838 WorkerEvents(EventTarget _ptr) : super(_ptr); | 18926 WorkerEvents(EventTarget _ptr) : super(_ptr); |
| 19839 | 18927 |
| 19840 EventListenerList get message => this['message']; | 18928 EventListenerList get message => this['message']; |
| 19841 } | 18929 } |
| 19842 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 18930 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 19843 // for details. All rights reserved. Use of this source code is governed by a | 18931 // for details. All rights reserved. Use of this source code is governed by a |
| 19844 // BSD-style license that can be found in the LICENSE file. | 18932 // BSD-style license that can be found in the LICENSE file. |
| 19845 | 18933 |
| 19846 | 18934 |
| 19847 /// @domName WorkerContext; @docsEditable true | 18935 /// @domName WorkerContext |
| 19848 class WorkerContext extends EventTarget native "*WorkerContext" { | 18936 class WorkerContext extends EventTarget native "*WorkerContext" { |
| 19849 | 18937 |
| 19850 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true | 18938 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev
entTarget.dispatchEvent; @docsEditable true |
| 19851 WorkerContextEvents get on => | 18939 WorkerContextEvents get on => |
| 19852 new WorkerContextEvents(this); | 18940 new WorkerContextEvents(this); |
| 19853 | 18941 |
| 19854 static const int PERSISTENT = 1; | 18942 static const int PERSISTENT = 1; |
| 19855 | 18943 |
| 19856 static const int TEMPORARY = 0; | 18944 static const int TEMPORARY = 0; |
| 19857 | 18945 |
| 19858 /// @domName WorkerContext.indexedDB; @docsEditable true | |
| 19859 final IDBFactory indexedDB; | |
| 19860 | |
| 19861 /// @domName WorkerContext.location; @docsEditable true | 18946 /// @domName WorkerContext.location; @docsEditable true |
| 19862 final WorkerLocation location; | 18947 final WorkerLocation location; |
| 19863 | 18948 |
| 19864 /// @domName WorkerContext.navigator; @docsEditable true | 18949 /// @domName WorkerContext.navigator; @docsEditable true |
| 19865 final WorkerNavigator navigator; | 18950 final WorkerNavigator navigator; |
| 19866 | 18951 |
| 19867 /// @domName WorkerContext.self; @docsEditable true | 18952 /// @domName WorkerContext.self; @docsEditable true |
| 19868 final WorkerContext self; | 18953 final WorkerContext self; |
| 19869 | 18954 |
| 19870 /// @domName WorkerContext.webkitIndexedDB; @docsEditable true | |
| 19871 final IDBFactory webkitIndexedDB; | |
| 19872 | |
| 19873 /// @domName WorkerContext.webkitNotifications; @docsEditable true | 18955 /// @domName WorkerContext.webkitNotifications; @docsEditable true |
| 19874 final NotificationCenter webkitNotifications; | 18956 final NotificationCenter webkitNotifications; |
| 19875 | 18957 |
| 19876 /// @domName WorkerContext.addEventListener; @docsEditable true | 18958 /// @domName WorkerContext.addEventListener; @docsEditable true |
| 19877 @JSName('addEventListener') | 18959 @JSName('addEventListener') |
| 19878 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; | 18960 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native; |
| 19879 | 18961 |
| 19880 /// @domName WorkerContext.clearInterval; @docsEditable true | 18962 /// @domName WorkerContext.clearInterval; @docsEditable true |
| 19881 void clearInterval(int handle) native; | 18963 void clearInterval(int handle) native; |
| 19882 | 18964 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19915 /// @domName WorkerContext.webkitRequestFileSystemSync; @docsEditable true | 18997 /// @domName WorkerContext.webkitRequestFileSystemSync; @docsEditable true |
| 19916 DOMFileSystemSync webkitRequestFileSystemSync(int type, int size) native; | 18998 DOMFileSystemSync webkitRequestFileSystemSync(int type, int size) native; |
| 19917 | 18999 |
| 19918 /// @domName WorkerContext.webkitResolveLocalFileSystemSyncURL; @docsEditable
true | 19000 /// @domName WorkerContext.webkitResolveLocalFileSystemSyncURL; @docsEditable
true |
| 19919 @JSName('webkitResolveLocalFileSystemSyncURL') | 19001 @JSName('webkitResolveLocalFileSystemSyncURL') |
| 19920 EntrySync webkitResolveLocalFileSystemSyncUrl(String url) native; | 19002 EntrySync webkitResolveLocalFileSystemSyncUrl(String url) native; |
| 19921 | 19003 |
| 19922 /// @domName WorkerContext.webkitResolveLocalFileSystemURL; @docsEditable true | 19004 /// @domName WorkerContext.webkitResolveLocalFileSystemURL; @docsEditable true |
| 19923 @JSName('webkitResolveLocalFileSystemURL') | 19005 @JSName('webkitResolveLocalFileSystemURL') |
| 19924 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback
, [ErrorCallback errorCallback]) native; | 19006 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback
, [ErrorCallback errorCallback]) native; |
| 19007 |
| 19008 |
| 19009 IdbFactory get indexedDB => |
| 19010 JS('IdbFactory', |
| 19011 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', |
| 19012 this, this, this); |
| 19925 } | 19013 } |
| 19926 | 19014 |
| 19927 class WorkerContextEvents extends Events { | 19015 class WorkerContextEvents extends Events { |
| 19928 WorkerContextEvents(EventTarget _ptr) : super(_ptr); | 19016 WorkerContextEvents(EventTarget _ptr) : super(_ptr); |
| 19929 | 19017 |
| 19930 EventListenerList get error => this['error']; | 19018 EventListenerList get error => this['error']; |
| 19931 } | 19019 } |
| 19932 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 19020 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 19933 // for details. All rights reserved. Use of this source code is governed by a | 19021 // for details. All rights reserved. Use of this source code is governed by a |
| 19934 // BSD-style license that can be found in the LICENSE file. | 19022 // BSD-style license that can be found in the LICENSE file. |
| (...skipping 4452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24387 | 23475 |
| 24388 // We can get rid of this conversion if _TypedImageData implements the fields | 23476 // We can get rid of this conversion if _TypedImageData implements the fields |
| 24389 // with native names. | 23477 // with native names. |
| 24390 _convertDartToNative_ImageData(ImageData imageData) { | 23478 _convertDartToNative_ImageData(ImageData imageData) { |
| 24391 if (imageData is _TypedImageData) { | 23479 if (imageData is _TypedImageData) { |
| 24392 return JS('', '{data: #, height: #, width: #}', | 23480 return JS('', '{data: #, height: #, width: #}', |
| 24393 imageData.data, imageData.height, imageData.width); | 23481 imageData.data, imageData.height, imageData.width); |
| 24394 } | 23482 } |
| 24395 return imageData; | 23483 return imageData; |
| 24396 } | 23484 } |
| 24397 | |
| 24398 | |
| 24399 // ----------------------------------------------------------------------------- | |
| 24400 | |
| 24401 /** | |
| 24402 * Converts a native IDBKey into a Dart object. | |
| 24403 * | |
| 24404 * May return the original input. May mutate the original input (but will be | |
| 24405 * idempotent if mutation occurs). It is assumed that this conversion happens | |
| 24406 * on native IDBKeys on all paths that return IDBKeys from native DOM calls. | |
| 24407 * | |
| 24408 * If necessary, JavaScript Dates are converted into Dart Dates. | |
| 24409 */ | |
| 24410 _convertNativeToDart_IDBKey(nativeKey) { | |
| 24411 containsDate(object) { | |
| 24412 if (isJavaScriptDate(object)) return true; | |
| 24413 if (object is List) { | |
| 24414 for (int i = 0; i < object.length; i++) { | |
| 24415 if (containsDate(object[i])) return true; | |
| 24416 } | |
| 24417 } | |
| 24418 return false; // number, string. | |
| 24419 } | |
| 24420 if (containsDate(nativeKey)) { | |
| 24421 throw new UnimplementedError('IDBKey containing Date'); | |
| 24422 } | |
| 24423 // TODO: Cache conversion somewhere? | |
| 24424 return nativeKey; | |
| 24425 } | |
| 24426 | |
| 24427 /** | |
| 24428 * Converts a Dart object into a valid IDBKey. | |
| 24429 * | |
| 24430 * May return the original input. Does not mutate input. | |
| 24431 * | |
| 24432 * If necessary, [dartKey] may be copied to ensure all lists are converted into | |
| 24433 * JavaScript Arrays and Dart Dates into JavaScript Dates. | |
| 24434 */ | |
| 24435 _convertDartToNative_IDBKey(dartKey) { | |
| 24436 // TODO: Implement. | |
| 24437 return dartKey; | |
| 24438 } | |
| 24439 | |
| 24440 | |
| 24441 | |
| 24442 /// May modify original. If so, action is idempotent. | |
| 24443 _convertNativeToDart_IDBAny(object) { | |
| 24444 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false); | |
| 24445 } | |
| 24446 | |
| 24447 | |
| 24448 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add Date. | |
| 24449 const _annotation_Creates_IDBKey = const Creates(_idbKey); | |
| 24450 const _annotation_Returns_IDBKey = const Returns(_idbKey); | |
| 24451 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 23485 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24452 // for details. All rights reserved. Use of this source code is governed by a | 23486 // for details. All rights reserved. Use of this source code is governed by a |
| 24453 // BSD-style license that can be found in the LICENSE file. | 23487 // BSD-style license that can be found in the LICENSE file. |
| 24454 | 23488 |
| 24455 | 23489 |
| 24456 // TODO(vsm): Unify with Dartium version. | 23490 // TODO(vsm): Unify with Dartium version. |
| 24457 class _DOMWindowCrossFrame implements Window { | 23491 class _DOMWindowCrossFrame implements Window { |
| 24458 // Private window. Note, this is a window in another frame, so it | 23492 // Private window. Note, this is a window in another frame, so it |
| 24459 // cannot be typed as "Window" as its prototype is not patched | 23493 // cannot be typed as "Window" as its prototype is not patched |
| 24460 // properly. Its fields and methods can only be accessed via JavaScript. | 23494 // properly. Its fields and methods can only be accessed via JavaScript. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24663 | 23697 |
| 24664 class _WebSocketFactoryProvider { | 23698 class _WebSocketFactoryProvider { |
| 24665 static WebSocket createWebSocket(String url) => | 23699 static WebSocket createWebSocket(String url) => |
| 24666 JS('WebSocket', 'new WebSocket(#)', url); | 23700 JS('WebSocket', 'new WebSocket(#)', url); |
| 24667 } | 23701 } |
| 24668 | 23702 |
| 24669 class _TextFactoryProvider { | 23703 class _TextFactoryProvider { |
| 24670 static Text createText(String data) => | 23704 static Text createText(String data) => |
| 24671 JS('Text', 'document.createTextNode(#)', data); | 23705 JS('Text', 'document.createTextNode(#)', data); |
| 24672 } | 23706 } |
| 24673 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 24674 // for details. All rights reserved. Use of this source code is governed by a | |
| 24675 // BSD-style license that can be found in the LICENSE file. | |
| 24676 | |
| 24677 | |
| 24678 class _IDBKeyRangeFactoryProvider { | |
| 24679 | |
| 24680 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) => | |
| 24681 _only(_class(), _translateKey(value)); | |
| 24682 | |
| 24683 static IDBKeyRange createIDBKeyRange_lowerBound( | |
| 24684 /*IDBKey*/ bound, [bool open = false]) => | |
| 24685 _lowerBound(_class(), _translateKey(bound), open); | |
| 24686 | |
| 24687 static IDBKeyRange createIDBKeyRange_upperBound( | |
| 24688 /*IDBKey*/ bound, [bool open = false]) => | |
| 24689 _upperBound(_class(), _translateKey(bound), open); | |
| 24690 | |
| 24691 static IDBKeyRange createIDBKeyRange_bound(/*IDBKey*/ lower, /*IDBKey*/ upper, | |
| 24692 [bool lowerOpen = false, bool upperOpen = false]) => | |
| 24693 _bound(_class(), _translateKey(lower), _translateKey(upper), | |
| 24694 lowerOpen, upperOpen); | |
| 24695 | |
| 24696 static var _cachedClass; | |
| 24697 | |
| 24698 static _class() { | |
| 24699 if (_cachedClass != null) return _cachedClass; | |
| 24700 return _cachedClass = _uncachedClass(); | |
| 24701 } | |
| 24702 | |
| 24703 static _uncachedClass() => | |
| 24704 JS('var', | |
| 24705 '''window.webkitIDBKeyRange || window.mozIDBKeyRange || | |
| 24706 window.msIDBKeyRange || window.IDBKeyRange'''); | |
| 24707 | |
| 24708 static _translateKey(idbkey) => idbkey; // TODO: fixme. | |
| 24709 | |
| 24710 static IDBKeyRange _only(cls, value) => | |
| 24711 JS('IDBKeyRange', '#.only(#)', cls, value); | |
| 24712 | |
| 24713 static IDBKeyRange _lowerBound(cls, bound, open) => | |
| 24714 JS('IDBKeyRange', '#.lowerBound(#, #)', cls, bound, open); | |
| 24715 | |
| 24716 static IDBKeyRange _upperBound(cls, bound, open) => | |
| 24717 JS('IDBKeyRange', '#.upperBound(#, #)', cls, bound, open); | |
| 24718 | |
| 24719 static IDBKeyRange _bound(cls, lower, upper, lowerOpen, upperOpen) => | |
| 24720 JS('IDBKeyRange', '#.bound(#, #, #, #)', | |
| 24721 cls, lower, upper, lowerOpen, upperOpen); | |
| 24722 } | |
| 24723 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 23707 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 24724 // for details. All rights reserved. Use of this source code is governed by a | 23708 // for details. All rights reserved. Use of this source code is governed by a |
| 24725 // BSD-style license that can be found in the LICENSE file. | 23709 // BSD-style license that can be found in the LICENSE file. |
| 24726 | 23710 |
| 24727 | 23711 |
| 24728 // On Firefox 11, the object obtained from 'window.location' is very strange. | 23712 // On Firefox 11, the object obtained from 'window.location' is very strange. |
| 24729 // It can't be monkey-patched and seems immune to putting methods on | 23713 // It can't be monkey-patched and seems immune to putting methods on |
| 24730 // Object.prototype. We are forced to wrap the object. | 23714 // Object.prototype. We are forced to wrap the object. |
| 24731 | 23715 |
| 24732 class _LocationWrapper implements LocalLocation { | 23716 class _LocationWrapper implements LocalLocation { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 25079 if (length < 0) throw new ArgumentError('length'); | 24063 if (length < 0) throw new ArgumentError('length'); |
| 25080 if (start < 0) throw new RangeError.value(start); | 24064 if (start < 0) throw new RangeError.value(start); |
| 25081 int end = start + length; | 24065 int end = start + length; |
| 25082 if (end > a.length) throw new RangeError.value(end); | 24066 if (end > a.length) throw new RangeError.value(end); |
| 25083 for (int i = start; i < end; i++) { | 24067 for (int i = start; i < end; i++) { |
| 25084 accumulator.add(a[i]); | 24068 accumulator.add(a[i]); |
| 25085 } | 24069 } |
| 25086 return accumulator; | 24070 return accumulator; |
| 25087 } | 24071 } |
| 25088 } | 24072 } |
| OLD | NEW |