From 992776552acce55cfd55b175b488c8ba47c79aee Mon Sep 17 00:00:00 2001 From: "vsm@google.com" Date: Wed, 24 Jul 2013 04:46:29 +0000 Subject: [PATCH] Fixes for Blink roll. TBR=jacobr@google.com,asiva@google.com Review URL: https://codereview.chromium.org//19820007 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25395 260f80e4-7a28-3924-810f-c04153c831b5 --- tests/html/exceptions_test.dart | 4 +- tests/html/worker_test.dart | 3 +- tools/dom/dom.json | 2 +- tools/dom/idl/dart/dart.idl | 12 +++- tools/dom/scripts/dartgenerator.py | 5 +- tools/dom/scripts/dartmetadata.py | 26 +++---- tools/dom/scripts/database.py | 32 +++++++++ tools/dom/scripts/databasebuilder.py | 12 ++-- tools/dom/scripts/fremontcutbuilder.py | 8 +++ tools/dom/scripts/generator.py | 25 +++++-- tools/dom/scripts/htmldartgenerator.py | 41 ++--------- tools/dom/scripts/htmleventgenerator.py | 13 +++- tools/dom/scripts/htmlrenamer.py | 68 +++++++++++-------- tools/dom/scripts/idlparser.py | 5 +- tools/dom/scripts/systemnative.py | 52 ++++++++++---- tools/dom/src/native_DOMImplementation.dart | 20 +++--- .../html/dartium/cpp_header.template | 2 + .../html/dartium/cpp_implementation.template | 4 ++ .../html/impl/impl_Window.darttemplate | 10 +-- 19 files changed, 218 insertions(+), 126 deletions(-) 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