Skip to content

Commit

Permalink
Merge pull request #16 from Hixie/remove-event-target
Browse files Browse the repository at this point in the history
Remove EventTarget, and subsequent fallout.
  • Loading branch information
Hixie committed Jul 16, 2015
2 parents b3ad3c4 + ce5aa75 commit 3670c60
Show file tree
Hide file tree
Showing 177 changed files with 168 additions and 9,379 deletions.
3 changes: 0 additions & 3 deletions sky/engine/bindings/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ source_set("bindings") {
"builtin_natives.h",
"builtin_sky.cc",
"builtin_sky.h",
"custom/dart_element_custom.cc",
"dart_callback.cc",
"dart_callback.h",
"dart_event_listener.cc",
"dart_event_listener.h",
"exception_messages.cc",
"exception_messages.h",
"exception_state.cc",
Expand Down
5 changes: 1 addition & 4 deletions sky/engine/bindings/IDLExtendedAttributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@

ActiveDOMObject
CachedAttribute=*
CallWith=ExecutionContext|ScriptState|ScriptArguments|ActiveWindow|FirstWindow|ThisValue
CallWith=ScriptState|ScriptArguments|ActiveWindow|FirstWindow|ThisValue
Constructor
# FIXME: remove [ConstructorCallWith=Document], as can instead use
# [ConstructorCallWith=ExecutionContext] + toDocument(executionContext)
ConstructorCallWith=ExecutionContext|Document
Custom=|Getter|Setter|VisitDOMWrapper|Wrap|PropertyGetter|PropertyEnumerator|PropertyQuery
CustomConstructor
CustomElementCallbacks
Expand Down
7 changes: 0 additions & 7 deletions sky/engine/bindings/builtin_sky.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ BuiltinSky::BuiltinSky(DOMDartState* dart_state) {
BuiltinSky::~BuiltinSky() {
}

void BuiltinSky::InstallWindow(DOMDartState* dart_state) {
CHECK(!LogIfError(Dart_SetField(library_.value(),
ToDart("window"),
ToDart(dart_state->CurrentWindow()))));
// TODO(abarth): Retain the document wrapper.
}

void BuiltinSky::InstallView(View* view) {
CHECK(!LogIfError(
Dart_SetField(library_.value(), ToDart("view"), ToDart(view))));
Expand Down
1 change: 0 additions & 1 deletion sky/engine/bindings/builtin_sky.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class BuiltinSky : public DartClassProvider {
explicit BuiltinSky(DOMDartState* dart_state);
~BuiltinSky();

void InstallWindow(DOMDartState* dart_state);
void InstallView(View* view);

// DartClassProvider:
Expand Down
36 changes: 0 additions & 36 deletions sky/engine/bindings/custom/dart_element_custom.cc

This file was deleted.

84 changes: 0 additions & 84 deletions sky/engine/bindings/dart_event_listener.cc

This file was deleted.

59 changes: 0 additions & 59 deletions sky/engine/bindings/dart_event_listener.h

This file was deleted.

2 changes: 1 addition & 1 deletion sky/engine/bindings/scheduled_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ScheduledAction::ScheduledAction(DartState* dart_state, Dart_Handle closure)
ScheduledAction::~ScheduledAction() {
}

void ScheduledAction::Execute(ExecutionContext*) {
void ScheduledAction::Execute() {
if (!closure_.dart_state())
return;
DartIsolateScope scope(closure_.dart_state()->isolate());
Expand Down
2 changes: 1 addition & 1 deletion sky/engine/bindings/scheduled_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ScheduledAction {

~ScheduledAction();

void Execute(ExecutionContext*);
void Execute();

private:
ScheduledAction(DartState* dart_state, Dart_Handle closure);
Expand Down
14 changes: 2 additions & 12 deletions sky/engine/bindings/scripts/dart_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,6 @@ def cpp_argument(argument):
if idl_type.name == 'MojoDataPipeConsumer':
return '%s.Pass()' % argument_name

if idl_type.name == 'EventListener':
if (interface.name == 'EventTarget' and
method.name == 'removeEventListener'):
# FIXME: remove this special case by moving get() into
# EventTarget::removeEventListener
return '%s.get()' % argument_name
return argument.name
if idl_type.is_callback_interface:
return '%s.release()' % argument_name
return argument_name
Expand Down Expand Up @@ -235,11 +228,8 @@ def dart_value_to_local_cpp_value(interface, has_type_checking_interface,
idl_type = argument.idl_type
name = argument.name

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

Expand Down
11 changes: 1 addition & 10 deletions sky/engine/bindings/scripts/dart_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class methods.
NON_WRAPPER_TYPES = frozenset([
'CompareHow',
'DartValue',
'EventHandler',
'EventListener',
'MediaQueryListListener',
'NodeFilter',
])
Expand Down Expand Up @@ -106,7 +104,6 @@ class methods.
CPP_SPECIAL_CONVERSION_RULES = {
'CompareHow': 'Range::CompareHow',
'Date': 'double',
'EventHandler': 'EventListener*',
'MediaQueryListListener': 'RefPtrWillBeRawPtr<MediaQueryListListener>',
'Promise': 'ScriptPromise',
# FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345529
Expand Down Expand Up @@ -257,8 +254,6 @@ def includes_for_cpp_class(class_name, relative_dir_posix):
INCLUDES_FOR_TYPE = {
'object': set(),
'CompareHow': set(),
'EventHandler': set(),
'EventListener': set(),
'MediaQueryListListener': set(['sky/engine/core/css/MediaQueryListListener.h']),
'NodeList': set(['sky/engine/core/dom/NodeList.h',
'sky/engine/core/dom/StaticNodeList.h']),
Expand Down Expand Up @@ -358,7 +353,6 @@ def pass_by_value_format(typename, null_check="{null_check}"):
'unsigned long long': 'DartConverter<unsigned long long>::FromArguments(args, {index}, exception)',
# Interface types
'CompareHow': 'static_cast<Range::CompareHow>(0) /* FIXME, DART_TO_CPP_VALUE[CompareHow] */',
'EventTarget': '0 /* FIXME, DART_TO_CPP_VALUE[EventTarget] */',
'MediaQueryListListener': 'nullptr /* FIXME, DART_TO_CPP_VALUE[MediaQueryListener] */',
'NodeFilter': 'nullptr /* FIXME, DART_TO_CPP_VALUE[NodeFilter] */',
'Promise': 'DartUtilities::dartToScriptPromise{null_check}(args, {index})',
Expand Down Expand Up @@ -645,7 +639,6 @@ def dart_conversion_type(idl_type, extended_attributes):
# and then use general Dart_SetReturnValue.
'array': 'Dart_SetReturnValue(args, {cpp_value})',
'Date': 'Dart_SetReturnValue(args, {cpp_value})',
'EventHandler': DART_FIX_ME,
'ScriptPromise': 'Dart_SetReturnValue(args, {cpp_value})',
'DartValue': 'DartConverter<DartValue*>::SetReturnValue(args, {cpp_value})',
# DOMWrapper
Expand Down Expand Up @@ -678,7 +671,7 @@ def dom_wrapper_conversion_type():
idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes)
this_dart_conversion_type = idl_type.dart_conversion_type(extended_attributes)
# SetReturn-specific overrides
if this_dart_conversion_type in ['Date', 'EventHandler', 'ScriptPromise', 'SerializedScriptValue', 'array']:
if this_dart_conversion_type in ['Date', 'ScriptPromise', 'SerializedScriptValue', 'array']:
# Convert value to Dart and then use general Dart_SetReturnValue
# FIXME(vsm): Why do we differ from V8 here? It doesn't have a
# creation_context.
Expand Down Expand Up @@ -753,8 +746,6 @@ def dart_set_return_value_union(idl_type, cpp_value, extended_attributes=None,
'unrestricted double': 'DartConverter<double>::ToDart({cpp_value})',
# FIXME(vsm): Dart_Null?
'void': '',
# Special cases
'EventHandler': '-----OOPS TO DART-EVENT---',
# We need to generate the NullCheck version in some cases.
'ScriptPromise': 'DartUtilities::scriptPromiseToDart({cpp_value})',
'DartValue': 'DartConverter<DartValue*>::ToDart({cpp_value})',
Expand Down
2 changes: 0 additions & 2 deletions sky/engine/bindings/scripts/v8_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ def argument_context(interface, method, argument, index):
def cpp_value(interface, method, number_of_arguments):
def cpp_argument(argument):
idl_type = argument.idl_type
if idl_type.name == 'EventListener':
return argument.name
if (idl_type.is_callback_interface or
idl_type.name in ['NodeFilter', 'NodeFilterOrNull']):
# FIXME: remove this special case
Expand Down
8 changes: 0 additions & 8 deletions sky/engine/bindings/scripts/v8_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class methods.

NON_WRAPPER_TYPES = frozenset([
'CompareHow',
'EventHandler',
'EventListener',
'NodeFilter',
'SerializedScriptValue',
])
Expand Down Expand Up @@ -102,7 +100,6 @@ class methods.
CPP_SPECIAL_CONVERSION_RULES = {
'CompareHow': 'Range::CompareHow',
'Date': 'double',
'EventHandler': 'EventListener*',
'Promise': 'ScriptPromise',
'ScriptValue': 'ScriptValue',
'boolean': 'bool',
Expand Down Expand Up @@ -201,11 +198,6 @@ def includes_for_cpp_class(class_name, relative_dir_posix):
INCLUDES_FOR_TYPE = {
'object': set(),
'CompareHow': set(),
'EventHandler': set(['bindings/core/v8/V8AbstractEventListener.h',
'bindings/core/v8/V8EventListenerList.h']),
'EventListener': set(['bindings/core/v8/BindingSecurity.h',
'bindings/core/v8/V8EventListenerList.h',
'core/frame/LocalDOMWindow.h']),
'NodeList': set(['bindings/core/v8/V8NodeList.h',
'core/dom/NodeList.h',
'core/dom/StaticNodeList.h']),
Expand Down
Loading

0 comments on commit 3670c60

Please sign in to comment.