diff --git a/tests/html/exceptions_test.dart b/tests/html/exceptions_test.dart index 5521d29d579..b8f26ab8aa3 100644 --- a/tests/html/exceptions_test.dart +++ b/tests/html/exceptions_test.dart @@ -11,8 +11,8 @@ main() { // Intentionally do not initialize it! try { document.dispatchEvent(event); - } on EventException catch (e) { - expect(e.name, DomException.UNSPECIFIED_EVENT_TYPE); + } on DomException catch (e) { + expect(e.name, DomException.INVALID_STATE); } }); } diff --git a/tests/html/worker_test.dart b/tests/html/worker_test.dart index 81b8558d96a..d24394bb74d 100644 --- a/tests/html/worker_test.dart +++ b/tests/html/worker_test.dart @@ -37,9 +37,10 @@ main() { var blob = new Blob([workerScript], 'text/javascript'); var url = Url.createObjectUrl(blob); var worker = new Worker(url); - return worker.onMessage.first.then((e) { + var test = expectAsync1((e) { expect(e.data, 'WorkerMessage'); }); + worker.onMessage.first.then(test); }); }); } diff --git a/tools/dom/dom.json b/tools/dom/dom.json index e70a639de6d..9c560e4a668 100644 --- a/tools/dom/dom.json +++ b/tools/dom/dom.json @@ -1265,7 +1265,7 @@ }, "support_level": "stable" }, - "DOMWindow": { + "Window": { "members": { "CSS": { "comment": "http://www.w3.org/TR/css3-conditional/#the-css-interface" diff --git a/tools/dom/idl/dart/dart.idl b/tools/dom/idl/dart/dart.idl index 873e6725341..565b4b82b23 100644 --- a/tools/dom/idl/dart/dart.idl +++ b/tools/dom/idl/dart/dart.idl @@ -40,8 +40,11 @@ interface ScriptProcessorNode { [Custom] void _setEventListener(EventListener eventListener); }; +/* +// TODO(vsm): How should this interact with the new ChildNode and +// ParentNode interfaces? // Force ElementTraversal. WebKit defines these directly. -interface ElementTraversal { +interface ElementTraversal : ChildNode, ParentNode { readonly attribute unsigned long childElementCount; readonly attribute Element firstElementChild; readonly attribute Element lastElementChild; @@ -49,6 +52,7 @@ interface ElementTraversal { readonly attribute Element previousElementSibling; }; Element implements ElementTraversal; +*/ [Callback] interface TimeoutHandler { @@ -221,7 +225,7 @@ interface Blob { [Supplemental, Constructor(float x, float y) ] -interface DOMPoint { +interface WebKitPoint { }; [Supplemental, Callback] // Add missing Callback attribute. @@ -324,3 +328,7 @@ interface Location { [CustomSetter] attribute DOMString search; [CustomSetter] attribute DOMString hash; }; + + +[Supplemental] +interface Window : EventTarget {}; diff --git a/tools/dom/scripts/dartgenerator.py b/tools/dom/scripts/dartgenerator.py index 8635eff719d..5954d4e2c3b 100755 --- a/tools/dom/scripts/dartgenerator.py +++ b/tools/dom/scripts/dartgenerator.py @@ -86,7 +86,7 @@ class DartGenerator(object): self._IsCompoundType(database, type_name)): continue # Ignore constructor warnings. - if not (interface.id in ['DOMWindow', 'WorkerContext'] and + if not (interface.id in ['Window', 'WorkerContext'] and type_name.endswith('Constructor')): _logger.warn('removing %s in %s which has unidentified type %s' % (node_name, interface.id, type_name)) @@ -213,6 +213,7 @@ class DartGenerator(object): ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg')]) for interface in database.GetInterfaces(): for operation in interface.operations: - call_with = operation.ext_attrs.get('CallWith', '').split('|') + call_with = (operation.ext_attrs.get('CallWith', '').split('|') + + operation.ext_attrs.get('ConstructorCallWith', '').split('|')) if 'ScriptArguments' in call_with: operation.arguments.append(ARG) diff --git a/tools/dom/scripts/dartmetadata.py b/tools/dom/scripts/dartmetadata.py index 00d638f0483..90695708c46 100644 --- a/tools/dom/scripts/dartmetadata.py +++ b/tools/dom/scripts/dartmetadata.py @@ -60,7 +60,7 @@ _dart2js_annotations = monitored.Dict('dartmetadata._dart2js_annotations', { "@Creates('Null')", ], - # Normally DOMWindow is nevernull, but starting from a