Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3670c60

Browse files
committed
Merge pull request #16 from Hixie/remove-event-target
Remove EventTarget, and subsequent fallout.
2 parents b3ad3c4 + ce5aa75 commit 3670c60

File tree

177 files changed

+168
-9379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+168
-9379
lines changed

sky/engine/bindings/BUILD.gn

-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ source_set("bindings") {
1313
"builtin_natives.h",
1414
"builtin_sky.cc",
1515
"builtin_sky.h",
16-
"custom/dart_element_custom.cc",
1716
"dart_callback.cc",
1817
"dart_callback.h",
19-
"dart_event_listener.cc",
20-
"dart_event_listener.h",
2118
"exception_messages.cc",
2219
"exception_messages.h",
2320
"exception_state.cc",

sky/engine/bindings/IDLExtendedAttributes.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@
3535

3636
ActiveDOMObject
3737
CachedAttribute=*
38-
CallWith=ExecutionContext|ScriptState|ScriptArguments|ActiveWindow|FirstWindow|ThisValue
38+
CallWith=ScriptState|ScriptArguments|ActiveWindow|FirstWindow|ThisValue
3939
Constructor
40-
# FIXME: remove [ConstructorCallWith=Document], as can instead use
41-
# [ConstructorCallWith=ExecutionContext] + toDocument(executionContext)
42-
ConstructorCallWith=ExecutionContext|Document
4340
Custom=|Getter|Setter|VisitDOMWrapper|Wrap|PropertyGetter|PropertyEnumerator|PropertyQuery
4441
CustomConstructor
4542
CustomElementCallbacks

sky/engine/bindings/builtin_sky.cc

-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ BuiltinSky::BuiltinSky(DOMDartState* dart_state) {
2020
BuiltinSky::~BuiltinSky() {
2121
}
2222

23-
void BuiltinSky::InstallWindow(DOMDartState* dart_state) {
24-
CHECK(!LogIfError(Dart_SetField(library_.value(),
25-
ToDart("window"),
26-
ToDart(dart_state->CurrentWindow()))));
27-
// TODO(abarth): Retain the document wrapper.
28-
}
29-
3023
void BuiltinSky::InstallView(View* view) {
3124
CHECK(!LogIfError(
3225
Dart_SetField(library_.value(), ToDart("view"), ToDart(view))));

sky/engine/bindings/builtin_sky.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class BuiltinSky : public DartClassProvider {
1919
explicit BuiltinSky(DOMDartState* dart_state);
2020
~BuiltinSky();
2121

22-
void InstallWindow(DOMDartState* dart_state);
2322
void InstallView(View* view);
2423

2524
// DartClassProvider:

sky/engine/bindings/custom/dart_element_custom.cc

-36
This file was deleted.

sky/engine/bindings/dart_event_listener.cc

-84
This file was deleted.

sky/engine/bindings/dart_event_listener.h

-59
This file was deleted.

sky/engine/bindings/scheduled_action.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ScheduledAction::ScheduledAction(DartState* dart_state, Dart_Handle closure)
1919
ScheduledAction::~ScheduledAction() {
2020
}
2121

22-
void ScheduledAction::Execute(ExecutionContext*) {
22+
void ScheduledAction::Execute() {
2323
if (!closure_.dart_state())
2424
return;
2525
DartIsolateScope scope(closure_.dart_state()->isolate());

sky/engine/bindings/scheduled_action.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ScheduledAction {
2424

2525
~ScheduledAction();
2626

27-
void Execute(ExecutionContext*);
27+
void Execute();
2828

2929
private:
3030
ScheduledAction(DartState* dart_state, Dart_Handle closure);

sky/engine/bindings/scripts/dart_methods.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,6 @@ def cpp_argument(argument):
158158
if idl_type.name == 'MojoDataPipeConsumer':
159159
return '%s.Pass()' % argument_name
160160

161-
if idl_type.name == 'EventListener':
162-
if (interface.name == 'EventTarget' and
163-
method.name == 'removeEventListener'):
164-
# FIXME: remove this special case by moving get() into
165-
# EventTarget::removeEventListener
166-
return '%s.get()' % argument_name
167-
return argument.name
168161
if idl_type.is_callback_interface:
169162
return '%s.release()' % argument_name
170163
return argument_name
@@ -235,11 +228,8 @@ def dart_value_to_local_cpp_value(interface, has_type_checking_interface,
235228
idl_type = argument.idl_type
236229
name = argument.name
237230

238-
# FIXME: V8 has some special logic around the addEventListener and
239-
# removeEventListener methods that should be added in somewhere.
240-
# There is also some logic in systemnative.py to force a null check
241-
# for the useCapture argument of those same methods that we may need to
242-
# pull over.
231+
# TODO(ianh): why don't we need to null-check everything?
232+
# https://github.com/domokit/mojo/issues/280
243233
null_check = ((argument.is_optional and idl_type.is_callback_interface) or
244234
(argument.default_value and argument.default_value.is_null))
245235

sky/engine/bindings/scripts/dart_types.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class methods.
5252
NON_WRAPPER_TYPES = frozenset([
5353
'CompareHow',
5454
'DartValue',
55-
'EventHandler',
56-
'EventListener',
5755
'MediaQueryListListener',
5856
'NodeFilter',
5957
])
@@ -106,7 +104,6 @@ class methods.
106104
CPP_SPECIAL_CONVERSION_RULES = {
107105
'CompareHow': 'Range::CompareHow',
108106
'Date': 'double',
109-
'EventHandler': 'EventListener*',
110107
'MediaQueryListListener': 'RefPtrWillBeRawPtr<MediaQueryListListener>',
111108
'Promise': 'ScriptPromise',
112109
# FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345529
@@ -257,8 +254,6 @@ def includes_for_cpp_class(class_name, relative_dir_posix):
257254
INCLUDES_FOR_TYPE = {
258255
'object': set(),
259256
'CompareHow': set(),
260-
'EventHandler': set(),
261-
'EventListener': set(),
262257
'MediaQueryListListener': set(['sky/engine/core/css/MediaQueryListListener.h']),
263258
'NodeList': set(['sky/engine/core/dom/NodeList.h',
264259
'sky/engine/core/dom/StaticNodeList.h']),
@@ -358,7 +353,6 @@ def pass_by_value_format(typename, null_check="{null_check}"):
358353
'unsigned long long': 'DartConverter<unsigned long long>::FromArguments(args, {index}, exception)',
359354
# Interface types
360355
'CompareHow': 'static_cast<Range::CompareHow>(0) /* FIXME, DART_TO_CPP_VALUE[CompareHow] */',
361-
'EventTarget': '0 /* FIXME, DART_TO_CPP_VALUE[EventTarget] */',
362356
'MediaQueryListListener': 'nullptr /* FIXME, DART_TO_CPP_VALUE[MediaQueryListener] */',
363357
'NodeFilter': 'nullptr /* FIXME, DART_TO_CPP_VALUE[NodeFilter] */',
364358
'Promise': 'DartUtilities::dartToScriptPromise{null_check}(args, {index})',
@@ -645,7 +639,6 @@ def dart_conversion_type(idl_type, extended_attributes):
645639
# and then use general Dart_SetReturnValue.
646640
'array': 'Dart_SetReturnValue(args, {cpp_value})',
647641
'Date': 'Dart_SetReturnValue(args, {cpp_value})',
648-
'EventHandler': DART_FIX_ME,
649642
'ScriptPromise': 'Dart_SetReturnValue(args, {cpp_value})',
650643
'DartValue': 'DartConverter<DartValue*>::SetReturnValue(args, {cpp_value})',
651644
# DOMWrapper
@@ -678,7 +671,7 @@ def dom_wrapper_conversion_type():
678671
idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes)
679672
this_dart_conversion_type = idl_type.dart_conversion_type(extended_attributes)
680673
# SetReturn-specific overrides
681-
if this_dart_conversion_type in ['Date', 'EventHandler', 'ScriptPromise', 'SerializedScriptValue', 'array']:
674+
if this_dart_conversion_type in ['Date', 'ScriptPromise', 'SerializedScriptValue', 'array']:
682675
# Convert value to Dart and then use general Dart_SetReturnValue
683676
# FIXME(vsm): Why do we differ from V8 here? It doesn't have a
684677
# creation_context.
@@ -753,8 +746,6 @@ def dart_set_return_value_union(idl_type, cpp_value, extended_attributes=None,
753746
'unrestricted double': 'DartConverter<double>::ToDart({cpp_value})',
754747
# FIXME(vsm): Dart_Null?
755748
'void': '',
756-
# Special cases
757-
'EventHandler': '-----OOPS TO DART-EVENT---',
758749
# We need to generate the NullCheck version in some cases.
759750
'ScriptPromise': 'DartUtilities::scriptPromiseToDart({cpp_value})',
760751
'DartValue': 'DartConverter<DartValue*>::ToDart({cpp_value})',

sky/engine/bindings/scripts/v8_methods.py

-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ def argument_context(interface, method, argument, index):
200200
def cpp_value(interface, method, number_of_arguments):
201201
def cpp_argument(argument):
202202
idl_type = argument.idl_type
203-
if idl_type.name == 'EventListener':
204-
return argument.name
205203
if (idl_type.is_callback_interface or
206204
idl_type.name in ['NodeFilter', 'NodeFilterOrNull']):
207205
# FIXME: remove this special case

sky/engine/bindings/scripts/v8_types.py

-8
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class methods.
5050

5151
NON_WRAPPER_TYPES = frozenset([
5252
'CompareHow',
53-
'EventHandler',
54-
'EventListener',
5553
'NodeFilter',
5654
'SerializedScriptValue',
5755
])
@@ -102,7 +100,6 @@ class methods.
102100
CPP_SPECIAL_CONVERSION_RULES = {
103101
'CompareHow': 'Range::CompareHow',
104102
'Date': 'double',
105-
'EventHandler': 'EventListener*',
106103
'Promise': 'ScriptPromise',
107104
'ScriptValue': 'ScriptValue',
108105
'boolean': 'bool',
@@ -201,11 +198,6 @@ def includes_for_cpp_class(class_name, relative_dir_posix):
201198
INCLUDES_FOR_TYPE = {
202199
'object': set(),
203200
'CompareHow': set(),
204-
'EventHandler': set(['bindings/core/v8/V8AbstractEventListener.h',
205-
'bindings/core/v8/V8EventListenerList.h']),
206-
'EventListener': set(['bindings/core/v8/BindingSecurity.h',
207-
'bindings/core/v8/V8EventListenerList.h',
208-
'core/frame/LocalDOMWindow.h']),
209201
'NodeList': set(['bindings/core/v8/V8NodeList.h',
210202
'core/dom/NodeList.h',
211203
'core/dom/StaticNodeList.h']),

0 commit comments

Comments
 (0)