Dartium Roll 38 roll
R=vsm@google.com
TBR=leafp, vsm
Review URL: https://codereview.chromium.org//581453002
git-svn-id: http://dart.googlecode.com/svn/third_party/WebCore@40446 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/bindings/IDLExtendedAttributes.txt b/bindings/IDLExtendedAttributes.txt
index f823705..16296b6 100644
--- a/bindings/IDLExtendedAttributes.txt
+++ b/bindings/IDLExtendedAttributes.txt
@@ -79,6 +79,7 @@
Global=|*
Immutable
ImplementedAs=*
+ImplementedInPrivateScript
InitializedByEventConstructor
LegacyTreatAsPartialInterface
LogActivity=|GetterOnly|SetterOnly
@@ -88,6 +89,7 @@
NamedConstructor=*
NoInterfaceObject
NotEnumerable
+OnlyExposedToPrivateScript
OverrideBuiltins
PartialInterfaceImplementedAs=*
# Valid values for [PerContextEnabled] are Context Features, in
@@ -97,7 +99,6 @@
PrimaryGlobal=|*
PutForwards=*
RaisesException=|Getter|Setter|Constructor
-ReadOnly
Reflect=|*
ReflectEmpty=*
ReflectInvalid=*
@@ -111,10 +112,10 @@
SetWrapperReferenceTo=*
SetterCallWith=ExecutionContext|ScriptArguments|ActiveWindow|FirstWindow
SpecialWrapFor=*
-TreatNullAs=NullString
+TreatNullAs=NullString|EmptyString
TreatReturnedNullStringAs=Null|Undefined
TreatUndefinedAs=NullString
-TypeChecking=Interface|Nullable|Unrestricted
+TypeChecking=Interface|Unrestricted
URL
Unforgeable
WillBeGarbageCollected
diff --git a/bindings/README b/bindings/README
index 53c5767..1a601a7 100644
--- a/bindings/README
+++ b/bindings/README
@@ -6,4 +6,4 @@
The current version corresponds to:
URL: http://src.chromium.org/blink/branches/dart/dartium
-Current revision: 181823
+Current revision: 182210
diff --git a/bindings/dart/scripts/code_generator_dart.py b/bindings/dart/scripts/code_generator_dart.py
index 93a5f8d..3c1c2ea 100644
--- a/bindings/dart/scripts/code_generator_dart.py
+++ b/bindings/dart/scripts/code_generator_dart.py
@@ -128,6 +128,9 @@
interface_name
for interface_name, interface_info in interfaces_info.iteritems()
if 'WillBeGarbageCollected' in interface_info['inherited_extended_attributes']))
+ dart_types.set_component_dirs(dict(
+ (interface_name, interface_info['component_dir'])
+ for interface_name, interface_info in interfaces_info.iteritems()))
def generate_code(self, definitions, interface_name, idl_pickle_filename,
only_if_changed):
@@ -187,7 +190,8 @@
idl_world['callback'] = idl_global_data['callback']
if 'interface_name' in template_contents:
- interface_global = {'name': template_contents['interface_name'],
+ interface_global = {'component_dir': interface_info['component_dir'],
+ 'name': template_contents['interface_name'],
'parent_interface': template_contents['parent_interface'],
'is_active_dom_object': template_contents['is_active_dom_object'],
'is_event_target': template_contents['is_event_target'],
diff --git a/bindings/dart/scripts/dart_attributes.py b/bindings/dart/scripts/dart_attributes.py
index 7536f20..7aaec94 100644
--- a/bindings/dart/scripts/dart_attributes.py
+++ b/bindings/dart/scripts/dart_attributes.py
@@ -44,6 +44,10 @@
def generate_attribute(interface, attribute):
idl_type = attribute.idl_type
base_idl_type = idl_type.base_type
+ # TODO(terry): Work around for DOMString[] base should be IDLTypeArray
+ if base_idl_type == None:
+ # Returns Array or Sequence.
+ base_idl_type = idl_type.inner_name
extended_attributes = attribute.extended_attributes
idl_type.add_includes_for_type()
@@ -83,7 +87,7 @@
if (base_idl_type == 'EventHandler' and
interface.name in ['Window', 'WorkerGlobalScope'] and
attribute.name == 'onerror'):
- includes.add('bindings/v8/V8ErrorHandler.h')
+ includes.add('bindings/core/v8/V8ErrorHandler.h')
is_auto_scope = not 'DartNoAutoScope' in extended_attributes
contents = {
@@ -243,7 +247,7 @@
DartUtilities.has_extended_attribute_value(attribute, 'TypeChecking', 'Nullable')) and
idl_type.is_wrapper_type)
- if attribute.idl_type.is_nullable and not has_type_checking_nullable:
+ if attribute.idl_type.is_explicit_nullable:
arguments.append('isNull')
if contents['is_getter_raises_exception']:
arguments.append('es')
@@ -274,7 +278,7 @@
return CONTENT_ATTRIBUTE_GETTER_NAMES[base_idl_type]
if 'URL' in attribute.extended_attributes:
return 'getURLAttribute'
- return 'getAttribute'
+ return 'fastGetAttribute'
def is_keep_alive_for_gc(interface, attribute):
@@ -337,7 +341,7 @@
'is_setter_suppressed': suppress,
'setter_lvalue': dart_types.check_reserved_name(attribute.name),
'cpp_type': this_cpp_type,
- 'local_cpp_type': idl_type.cpp_type_args(attribute.extended_attributes, used_as_argument=True),
+ 'local_cpp_type': idl_type.cpp_type_args(attribute.extended_attributes, raw_type=True),
'cpp_setter': setter_expression(interface, attribute, contents),
'dart_value_to_local_cpp_value':
attribute.idl_type.dart_value_to_local_cpp_value(
@@ -366,7 +370,7 @@
arguments.append('nullptr')
# if (interface.name in ['Window', 'WorkerGlobalScope'] and
# attribute.name == 'onerror'):
- # includes.add('bindings/v8/V8ErrorHandler.h')
+ # includes.add('bindings/core/v8/V8ErrorHandler.h')
# arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(jsValue, true, info.GetIsolate())')
# else:
# arguments.append('V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate)')
@@ -399,9 +403,18 @@
def scoped_content_attribute_name(interface, attribute):
content_attribute_name = attribute.extended_attributes['Reflect'] or attribute.name.lower()
- namespace = 'SVGNames' if interface.name.startswith('SVG') else 'HTMLNames'
- includes.add('%s.h' % namespace)
- return 'WebCore::%s::%sAttr' % (namespace, content_attribute_name)
+ if interface.name.startswith('SVG'):
+ # SVG's xmlbase/xmlspace/xmllang need special behavior, i.e.
+ # it is in XMLNames namespace and the generated attribute has no xml prefix.
+ if attribute.name.startswith('xml'):
+ namespace = 'XMLNames'
+ content_attribute_name = content_attribute_name[3:]
+ else:
+ namespace = 'SVGNames'
+ else:
+ namespace = 'HTMLNames'
+ includes.add('core/%s.h' % namespace)
+ return '%s::%sAttr' % (namespace, content_attribute_name)
################################################################################
@@ -465,7 +478,7 @@
def is_constructor_attribute(attribute):
# FIXME: replace this with [ConstructorAttribute] extended attribute
- return attribute.idl_type.base_type.endswith('Constructor')
+ return attribute.idl_type.name.endswith('Constructor')
def generate_constructor_getter(interface, attribute, contents):
diff --git a/bindings/dart/scripts/dart_callback_interface.py b/bindings/dart/scripts/dart_callback_interface.py
index 9fb0cea..5120af4 100644
--- a/bindings/dart/scripts/dart_callback_interface.py
+++ b/bindings/dart/scripts/dart_callback_interface.py
@@ -33,18 +33,18 @@
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
-from idl_types import IdlType
+from idl_types import IdlType, IdlTypeBase
import dart_types
from dart_utilities import DartUtilities
from v8_globals import includes
CALLBACK_INTERFACE_H_INCLUDES = frozenset([
- 'bindings/dart/DartCallback.h',
- 'bindings/dart/DartDOMWrapper.h',
- 'bindings/v8/ActiveDOMCallback.h',
+ 'bindings/core/dart/DartCallback.h',
+ 'bindings/core/dart/DartDOMWrapper.h',
+ 'bindings/core/v8/ActiveDOMCallback.h',
])
CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
- 'bindings/dart/DartBindingsCommonIncludes.h',
+ 'bindings/core/dart/DartBindingsCommonIncludes.h',
'wtf/GetPtr.h',
'wtf/RefPtr.h',
])
@@ -57,13 +57,13 @@
return 'const String&'
if idl_type_name == 'void':
return 'void'
- # Callbacks use raw pointers, so used_as_argument=True
- usual_cpp_type = idl_type.cpp_type_args(used_as_argument=True)
+ # Callbacks use raw pointers, so raw_type=True
+ usual_cpp_type = idl_type.cpp_type_args(raw_type=True)
if usual_cpp_type.startswith(('Vector', 'HeapVector', 'WillBeHeapVector')):
return 'const %s&' % usual_cpp_type
return usual_cpp_type
-IdlType.callback_cpp_type = property(cpp_type)
+IdlTypeBase.callback_cpp_type = property(cpp_type)
def generate_callback_interface(callback_interface):
diff --git a/bindings/dart/scripts/dart_interface.py b/bindings/dart/scripts/dart_interface.py
index 6904c6d..c6a5702 100644
--- a/bindings/dart/scripts/dart_interface.py
+++ b/bindings/dart/scripts/dart_interface.py
@@ -34,7 +34,7 @@
from collections import defaultdict
import idl_types
-from idl_types import IdlType, inherits_interface
+from idl_types import IdlType, inherits_interface, IdlArrayOrSequenceType, IdlArrayType
import dart_attributes
import dart_methods
import dart_types
@@ -43,12 +43,13 @@
INTERFACE_H_INCLUDES = frozenset([
- 'bindings/dart/DartDOMWrapper.h',
+ 'bindings/core/dart/DartDOMWrapper.h',
'platform/heap/Handle.h',
])
INTERFACE_CPP_INCLUDES = frozenset([
- 'DartUtilities.h',
+
+ 'bindings/core/dart/DartUtilities.h',
'wtf/GetPtr.h',
'wtf/RefPtr.h',
])
@@ -435,7 +436,7 @@
if inherits_interface(interface.name, 'EventTarget'):
- includes.update(['DartEventListener.h'])
+ includes.update(['bindings/core/dart/DartEventListener.h'])
# [ActiveDOMObject]
is_active_dom_object = 'ActiveDOMObject' in extended_attributes
@@ -458,14 +459,14 @@
reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
if reachable_node_function:
# FIXME(vsm): We may need bindings/dart/DartGCController.h instead.
- includes.update(['bindings/v8/V8GCController.h',
+ includes.update(['bindings/core/v8/V8GCController.h',
'core/dom/Element.h'])
# [SetWrapperReferenceTo]
set_wrapper_reference_to_list = [{
'name': argument.name,
# FIXME: properly should be:
- # 'cpp_type': argument.idl_type.cpp_type_args(used_as_argument=True),
+ # 'cpp_type': argument.idl_type.cpp_type_args(used_as_rvalue_type=True),
# (if type is non-wrapper type like NodeFilter, normally RefPtr)
# Raw pointers faster though, and NodeFilter hacky anyway.
'cpp_type': argument.idl_type.implemented_as + '*',
@@ -547,9 +548,9 @@
any_type_attributes = [attribute for attribute in interface.attributes
if attribute.idl_type.name == 'Any']
if has_event_constructor:
- includes.add('bindings/common/Dictionary.h')
+ includes.add('bindings/core/v8/Dictionary.h')
if any_type_attributes:
- includes.add('bindings/v8/SerializedScriptValue.h')
+ includes.add('bindings/core/v8/SerializedScriptValue.h')
# [NamedConstructor]
named_constructor = generate_named_constructor(interface)
@@ -867,7 +868,7 @@
return ' || '.join(['isUndefinedOrNull(%s)' % cpp_value,
'%s->IsString()' % cpp_value,
'%s->IsObject()' % cpp_value])
- if idl_type.array_or_sequence_type:
+ if idl_type.native_array_element_type:
return '%s->IsArray()' % cpp_value
if idl_type.is_callback_interface:
return ' || '.join(['%s->IsNull()' % cpp_value,
@@ -947,7 +948,9 @@
def cpp_argument(argument):
argument_name = dart_types.check_reserved_name(argument.name)
idl_type = argument.idl_type
- if idl_type.is_typed_array_type:
+ # FIXMEDART: there has to be a cleaner way to check for arraylike
+ # types such as Uint8ClampedArray.
+ if isinstance(idl_type, IdlArrayType) or idl_type.preprocessed_type.is_typed_array_type:
return '%s.get()' % argument_name
return argument_name
@@ -977,7 +980,7 @@
argument_content = {
'cpp_type': idl_type.cpp_type_args(),
- 'local_cpp_type': idl_type.cpp_type_args(argument.extended_attributes, used_as_argument=True),
+ 'local_cpp_type': idl_type.cpp_type_args(argument.extended_attributes, raw_type=True),
# FIXME: check that the default value's type is compatible with the argument's
'default_value': default_value,
# FIXME: remove once [Default] removed and just use argument.default_value
@@ -985,9 +988,9 @@
'idl_type_object': idl_type,
'preprocessed_type': str(idl_type.preprocessed_type),
# Dictionary is special-cased, but arrays and sequences shouldn't be
- 'idl_type': not idl_type.array_or_sequence_type and idl_type.base_type,
+ 'idl_type': idl_type.native_array_element_type,
'index': index,
- 'is_array_or_sequence_type': not not idl_type.array_or_sequence_type,
+ 'is_array_or_sequence_type': not not idl_type.native_array_element_type,
'is_optional': argument.is_optional,
'is_strict_type_checking': False, # Required for overload resolution
'name': argument.name,
diff --git a/bindings/dart/scripts/dart_methods.py b/bindings/dart/scripts/dart_methods.py
index 03d64a5..53997fd 100644
--- a/bindings/dart/scripts/dart_methods.py
+++ b/bindings/dart/scripts/dart_methods.py
@@ -33,8 +33,9 @@
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
-from idl_types import IdlType, IdlUnionType, inherits_interface
+from idl_types import IdlTypeBase, IdlType, IdlUnionType, inherits_interface, IdlArrayOrSequenceType, IdlArrayType
import dart_types
+from idl_definitions import IdlArgument
from dart_utilities import DartUtilities
from v8_globals import includes
@@ -58,11 +59,11 @@
is_call_with_script_arguments = DartUtilities.has_extended_attribute_value(method, 'CallWith', 'ScriptArguments')
if is_call_with_script_arguments:
- includes.update(['bindings/v8/ScriptCallStackFactory.h',
+ includes.update(['bindings/core/v8/ScriptCallStackFactory.h',
'core/inspector/ScriptArguments.h'])
is_call_with_script_state = DartUtilities.has_extended_attribute_value(method, 'CallWith', 'ScriptState')
if is_call_with_script_state:
- includes.add('bindings/dart/DartScriptState.h')
+ includes.add('bindings/core/dart/DartScriptState.h')
is_check_security_for_node = 'CheckSecurity' in extended_attributes
if is_check_security_for_node:
includes.add('bindings/common/BindingSecurity.h')
@@ -81,6 +82,8 @@
if idl_type.union_arguments and len(idl_type.union_arguments) > 0:
this_cpp_type = []
for cpp_type in idl_type.member_types:
+ # FIXMEDART: we shouldn't just assume RefPtr. We should append
+ # WillBeGC as appropriate.
this_cpp_type.append("RefPtr<%s>" % cpp_type)
else:
this_cpp_type = idl_type.cpp_type
@@ -182,9 +185,11 @@
if preprocessed_type == 'unrestricted double':
preprocessed_type = 'double'
argument_data = {
- 'cpp_type': idl_type.cpp_type_args(used_in_cpp_sequence=use_heap_vector_type),
+ 'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attributes,
+ raw_type=True,
+ used_in_cpp_sequence=use_heap_vector_type),
'cpp_value': this_cpp_value,
- 'local_cpp_type': idl_type.cpp_type_args(argument.extended_attributes, used_as_argument=True),
+ 'local_cpp_type': idl_type.cpp_type_args(argument.extended_attributes, raw_type=True),
# FIXME: check that the default value's type is compatible with the argument's
'default_value': str(argument.default_value) if argument.default_value else None,
'enum_validation_expression': idl_type.enum_validation_expression,
@@ -196,9 +201,9 @@
'idl_type_object': idl_type,
'preprocessed_type': preprocessed_type,
# Dictionary is special-cased, but arrays and sequences shouldn't be
- 'idl_type': not idl_type.array_or_sequence_type and idl_type.base_type,
+ 'idl_type': idl_type.base_type,
'index': index,
- 'is_array_or_sequence_type': not not idl_type.array_or_sequence_type,
+ 'is_array_or_sequence_type': not not idl_type.native_array_element_type,
'is_clamp': 'Clamp' in extended_attributes,
'is_callback_interface': idl_type.is_callback_interface,
'is_nullable': idl_type.is_nullable,
@@ -338,11 +343,25 @@
return property_attributes_list
-def union_arguments(idl_type):
- """Return list of ['result0Enabled', 'result0', 'result1Enabled', ...] for union types, for use in setting return value"""
- return [arg
- for i in range(len(idl_type.member_types))
- for arg in ['result%sEnabled' % i, 'result%s' % i]]
+# FIXMEDART: better align this method with the v8 version.
+def union_member_argument_context(idl_type, index):
+ """Returns a context of union member for argument."""
+ return 'result%d' % index
-IdlType.union_arguments = property(lambda self: None)
+def union_arguments(idl_type):
+ return [union_member_argument_context(member_idl_type, index)
+ for index, member_idl_type
+ in enumerate(idl_type.member_types)]
+
+
+def argument_default_cpp_value(argument):
+ if not argument.default_value:
+ return None
+ return argument.idl_type.literal_cpp_value(argument.default_value)
+
+
+IdlTypeBase.union_arguments = None
IdlUnionType.union_arguments = property(union_arguments)
+IdlArgument.default_cpp_value = property(argument_default_cpp_value)
+#IdlType.union_arguments = property(lambda self: None)
+#IdlUnionType.union_arguments = property(union_arguments)
diff --git a/bindings/dart/scripts/dart_types.py b/bindings/dart/scripts/dart_types.py
index 1ca39fb..5078460 100644
--- a/bindings/dart/scripts/dart_types.py
+++ b/bindings/dart/scripts/dart_types.py
@@ -38,7 +38,8 @@
"""
import posixpath
-from idl_types import IdlType, IdlUnionType, TYPE_NAMES
+from idl_types import IdlTypeBase, IdlType, IdlUnionType, TYPE_NAMES, IdlArrayOrSequenceType
+
import dart_attributes # for IdlType.constructor_type_name
from dart_utilities import DartUtilities
from v8_globals import includes
@@ -72,7 +73,8 @@
'Uint32Array': ('unsigned int', 'Uint32List'),
}
-IdlType.is_typed_array_type = property(
+
+IdlTypeBase.is_typed_array_type = property(
lambda self: self.base_type in TYPED_ARRAYS)
@@ -118,7 +120,7 @@
}
-def cpp_type(idl_type, extended_attributes=None, used_as_argument=False, used_in_cpp_sequence=False):
+def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_type=False, used_in_cpp_sequence=False):
"""Returns C++ type corresponding to IDL type.
|idl_type| argument is of type IdlType, while return value is a string
@@ -126,21 +128,25 @@
Args:
idl_type:
IdlType
- used_as_argument:
+ raw_type:
bool, True if idl_type's raw/primitive C++ type should be returned.
- will_be_in_heap_object:
- bool, True if idl_type will be part of a possibly heap allocated
- object (e.g., appears as an element of a C++ heap vector type.)
- The C++ type of an interface type changes, if so.
+ used_as_rvalue_type:
+ bool, True if the C++ type is used as an argument or the return
+ type of a method.
+ used_as_variadic_argument:
+ bool, True if the C++ type is used as a variadic argument of a method.
+ used_in_cpp_sequence:
+ bool, True if the C++ type is used as an element of a container.
+ Containers can be an array, a sequence or a dictionary.
"""
extended_attributes = extended_attributes or {}
idl_type = idl_type.preprocessed_type
# Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- vector_type = cpp_ptr_type('Vector', 'HeapVector', array_or_sequence_type.gc_type)
- return cpp_template_type(vector_type, array_or_sequence_type.cpp_type_args(used_in_cpp_sequence=True))
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ vector_type = cpp_ptr_type('Vector', 'HeapVector', native_array_element_type.gc_type)
+ return cpp_template_type(vector_type, native_array_element_type.cpp_type_args(used_in_cpp_sequence=True))
# Simple types
base_idl_type = idl_type.base_type
@@ -155,38 +161,44 @@
return CPP_SPECIAL_CONVERSION_RULES[base_idl_type]
if base_idl_type in NON_WRAPPER_TYPES:
- return 'RefPtr<%s>' % base_idl_type
+ return ('PassRefPtr<%s>' if used_as_rvalue_type else 'RefPtr<%s>') % base_idl_type
if base_idl_type in ('DOMString', 'ByteString', 'ScalarValueString'):
- if not used_as_argument:
+ if not raw_type:
return 'String'
return 'DartStringAdapter'
- if idl_type.is_typed_array_type and used_as_argument:
+ if idl_type.is_typed_array_type and raw_type:
return 'RefPtr<%s>' % base_idl_type
if idl_type.is_callback_interface:
return 'OwnPtr<%s>' % base_idl_type
if idl_type.is_interface_type:
implemented_as_class = idl_type.implemented_as
- if used_as_argument:
+ if raw_type:
return implemented_as_class + '*'
new_type = 'Member' if used_in_cpp_sequence else 'RawPtr'
- ptr_type = cpp_ptr_type('RefPtr', new_type, idl_type.gc_type)
+ ptr_type = cpp_ptr_type(('PassRefPtr' if used_as_rvalue_type else 'RefPtr'), new_type, idl_type.gc_type)
return cpp_template_type(ptr_type, implemented_as_class)
# Default, assume native type is a pointer with same type name as idl type
return base_idl_type + '*'
-def cpp_type_union(idl_type, extended_attributes=None, used_as_argument=False, will_be_in_heap_object=False):
+def cpp_type_union(idl_type, extended_attributes=None, used_as_rvalue_type=False, will_be_in_heap_object=False):
return (member_type.cpp_type for member_type in idl_type.member_types)
+
# Allow access as idl_type.cpp_type if no arguments
-IdlType.cpp_type = property(cpp_type)
+IdlTypeBase.cpp_type = property(cpp_type)
+IdlTypeBase.cpp_type_args = cpp_type
IdlUnionType.cpp_type = property(cpp_type_union)
-IdlType.cpp_type_args = cpp_type
IdlUnionType.cpp_type_args = cpp_type_union
+IdlTypeBase.native_array_element_type = None
+IdlArrayOrSequenceType.native_array_element_type = property(
+ lambda self: self.element_type)
+
+
def cpp_template_type(template, inner_type):
"""Returns C++ template specialized to type, with space added if needed."""
if inner_type.endswith('>'):
@@ -238,9 +250,11 @@
lambda cls, new_implemented_as_interfaces:
cls.implemented_as_interfaces.update(new_implemented_as_interfaces))
+
# [GarbageCollected]
IdlType.garbage_collected_types = set()
+IdlTypeBase.is_garbage_collected = False
IdlType.is_garbage_collected = property(
lambda self: self.base_type in IdlType.garbage_collected_types)
@@ -252,6 +266,7 @@
# [WillBeGarbageCollected]
IdlType.will_be_garbage_collected_types = set()
+IdlTypeBase.is_will_be_garbage_collected = False
IdlType.is_will_be_garbage_collected = property(
lambda self: self.base_type in IdlType.will_be_garbage_collected_types)
@@ -267,7 +282,7 @@
return 'WillBeGarbageCollectedObject'
return 'RefCountedObject'
-IdlType.gc_type = property(gc_type)
+IdlTypeBase.gc_type = property(gc_type)
################################################################################
@@ -281,7 +296,7 @@
INCLUDES_FOR_TYPE = {
'object': set(),
'CompareHow': set(),
- 'Dictionary': set(['bindings/common/Dictionary.h']),
+ 'Dictionary': set(['bindings/core/v8/Dictionary.h']),
'EventHandler': set(),
'EventListener': set(),
'HTMLCollection': set(['bindings/core/dart/DartHTMLCollection.h',
@@ -298,7 +313,7 @@
'core/html/LabelsNodeList.h']),
'Promise': set(),
'SerializedScriptValue': set(),
- 'ScriptValue': set(['bindings/dart/DartScriptValue.h']),
+ 'ScriptValue': set(['bindings/core/dart/DartScriptValue.h']),
}
@@ -306,9 +321,8 @@
idl_type = idl_type.preprocessed_type
# Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- return includes_for_type(array_or_sequence_type)
+ if idl_type.native_array_element_type:
+ return includes_for_type(idl_type)
# Simple types
base_idl_type = idl_type.base_type
@@ -329,7 +343,10 @@
if base_idl_type.endswith('Constructor'):
# FIXME: replace with a [ConstructorAttribute] extended attribute
base_idl_type = idl_type.constructor_type_name
- return set(['Dart%s.h' % base_idl_type])
+ if base_idl_type not in component_dir:
+ return set()
+ return set(['bindings/%s/dart/Dart%s.h' % (component_dir[base_idl_type],
+ base_idl_type)])
IdlType.includes_for_type = property(includes_for_type)
IdlUnionType.includes_for_type = property(
@@ -340,7 +357,7 @@
def add_includes_for_type(idl_type):
includes.update(idl_type.includes_for_type)
-IdlType.add_includes_for_type = add_includes_for_type
+IdlTypeBase.add_includes_for_type = add_includes_for_type
IdlUnionType.add_includes_for_type = add_includes_for_type
@@ -352,6 +369,13 @@
includes.update(includes_for_interface(interface_name))
+component_dir = {}
+
+
+def set_component_dirs(new_component_dirs):
+ component_dir.update(new_component_dirs)
+
+
################################################################################
# Dart -> C++
################################################################################
@@ -402,9 +426,9 @@
def dart_value_to_cpp_value(idl_type, interface_extended_attributes, extended_attributes, variable_name,
null_check, index, auto_scope=True):
# Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- return dart_value_to_cpp_value_array_or_sequence(array_or_sequence_type, variable_name, index)
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ return dart_value_to_cpp_value_array_or_sequence(native_array_element_type, variable_name, index)
# Simple types
idl_type = idl_type.preprocessed_type
@@ -444,31 +468,30 @@
auto_scope=DartUtilities.bool_to_cpp(auto_scope))
-def dart_value_to_cpp_value_array_or_sequence(array_or_sequence_type, variable_name, index):
+def dart_value_to_cpp_value_array_or_sequence(native_array_element_type, variable_name, index):
# Index is None for setters, index (starting at 0) for method arguments,
# and is used to provide a human-readable exception message
-
if index is None:
index = 0 # special case, meaning "setter"
# else:
# index += 1 # human-readable index
- if (array_or_sequence_type.is_interface_type and
- array_or_sequence_type.name != 'Dictionary'):
- this_cpp_type = array_or_sequence_type.cpp_type
- ref_ptr_type = 'Member' if array_or_sequence_type.is_will_be_garbage_collected else 'RefPtr'
+ if (native_array_element_type.is_interface_type and
+ native_array_element_type.name != 'Dictionary'):
+ this_cpp_type = None
+ ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', native_array_element_type.gc_type)
# FIXME(vsm): We're not using ref_ptr_type....
expression_format = 'DartUtilities::toNativeVector<{cpp_type} >(args, {index}, {variable_name}, exception)'
- add_includes_for_type(array_or_sequence_type)
+ add_includes_for_type(native_array_element_type)
else:
ref_ptr_type = None
- this_cpp_type = array_or_sequence_type.cpp_type
+ this_cpp_type = native_array_element_type.cpp_type
expression_format = 'DartUtilities::toNativeVector<{cpp_type}>(args, {index}, {variable_name}, exception)'
- expression = expression_format.format(array_or_sequence_type=array_or_sequence_type.name,
+
+ expression = expression_format.format(native_array_element_type=native_array_element_type.name,
cpp_type=this_cpp_type, index=index, ref_ptr_type=ref_ptr_type,
variable_name=variable_name)
return expression
-
def dart_value_to_local_cpp_value(idl_type, interface_extended_attributes, extended_attributes,
variable_name, null_check, index=None, auto_scope=True):
"""Returns an expression that converts a Dart value to a C++ value as a local value."""
@@ -480,8 +503,8 @@
return cpp_value
-IdlType.dart_value_to_local_cpp_value = dart_value_to_local_cpp_value
-IdlUnionType.dart_value_to_local_cpp_value = dart_value_to_local_cpp_value
+IdlTypeBase.dart_value_to_local_cpp_value = dart_value_to_local_cpp_value
+#IdlUnionType.dart_value_to_local_cpp_value = dart_value_to_local_cpp_value
# Insure that we don't use C++ reserved names. Today on default is a problem.
@@ -501,7 +524,7 @@
return IdlType('ScriptValue')
return idl_type
-IdlType.preprocessed_type = property(preprocess_idl_type)
+IdlTypeBase.preprocessed_type = property(preprocess_idl_type)
IdlUnionType.preprocessed_type = property(preprocess_idl_type)
@@ -535,10 +558,10 @@
extended_attributes = extended_attributes or {}
# Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- if array_or_sequence_type.is_interface_type:
- add_includes_for_type(array_or_sequence_type)
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ if native_array_element_type.is_interface_type:
+ add_includes_for_type(native_array_element_type)
return 'array'
# Simple types
@@ -575,7 +598,7 @@
# Pointer type
return 'DOMWrapper'
-IdlType.dart_conversion_type = dart_conversion_type
+IdlTypeBase.dart_conversion_type = dart_conversion_type
DART_SET_RETURN_VALUE = {
@@ -642,8 +665,13 @@
if this_dart_conversion_type == 'array':
# FIXME: This is not right if the base type is a primitive, DOMString, etc.
# What is the right check for base type?
- if idl_type.base_type not in DART_TO_CPP_VALUE:
- creation_context = '<Dart%s>' % idl_type.base_type
+ base_type = str(idl_type.element_type)
+ if base_type not in DART_TO_CPP_VALUE:
+ if base_type == 'None':
+ raise Exception('Unknown base type for ' + str(idl_type))
+ creation_context = '<Dart%s>' % base_type
+ if idl_type.is_nullable:
+ creation_context = 'Nullable' + creation_context
cpp_value = idl_type.cpp_value_to_dart_value(cpp_value, creation_context=creation_context,
extended_attributes=extended_attributes)
@@ -680,7 +708,7 @@
for i, member_type in
enumerate(idl_type.member_types)]
-IdlType.dart_set_return_value = dart_set_return_value
+IdlTypeBase.dart_set_return_value = dart_set_return_value
IdlUnionType.dart_set_return_value = dart_set_return_value_union
IdlType.release = property(lambda self: self.is_interface_type)
@@ -725,7 +753,7 @@
idl_type=idl_type.base_type)
return statement
-IdlType.cpp_value_to_dart_value = cpp_value_to_dart_value
+IdlTypeBase.cpp_value_to_dart_value = cpp_value_to_dart_value
# Override idl_type.name to not suffix orNull to the name, in Dart we always
@@ -743,10 +771,8 @@
"""
base_type = idl_type.base_type
base_type_name = TYPE_NAMES.get(base_type, base_type)
- if idl_type.is_array:
- return base_type_name + 'Array'
- if idl_type.is_sequence:
- return base_type_name + 'Sequence'
+ if idl_type.native_array_element_type:
+ return idl_type.inner_name()
return base_type_name
IdlType.name = property(dart_name)
diff --git a/bindings/dart/scripts/dart_utilities.py b/bindings/dart/scripts/dart_utilities.py
index 9966323..4f888d6 100644
--- a/bindings/dart/scripts/dart_utilities.py
+++ b/bindings/dart/scripts/dart_utilities.py
@@ -77,7 +77,7 @@
if not has_logging:
return set()
# TODO(terry): Remove Me?
-# includes.add('bindings/v8/V8DOMActivityLogger.h')
+# includes.add('bindings/core/v8/V8DOMActivityLogger.h')
if activity_logging.endswith('ForIsolatedWorlds'):
return set([''])
return set(['', 'ForMainWorld']) # endswith('ForAllWorlds')
@@ -85,7 +85,7 @@
# [CallWith]
_CALL_WITH_ARGUMENTS = {
- 'ScriptState': '&state',
+ 'ScriptState': 'state',
'ExecutionContext': 'context',
'ScriptArguments': 'scriptArguments.release()',
'ActiveWindow': 'DartUtilities::callingDomWindowForCurrentIsolate()',
diff --git a/bindings/scripts/aggregate_generated_bindings.py b/bindings/scripts/aggregate_generated_bindings.py
index abb2b81..98bbaa9 100755
--- a/bindings/scripts/aggregate_generated_bindings.py
+++ b/bindings/scripts/aggregate_generated_bindings.py
@@ -120,7 +120,7 @@
if not match:
return None
conditional = match.group(1)
- return re.split('([|&])', conditional)
+ return re.split('([|,])', conditional)
def extract_meta_data(file_paths):
diff --git a/bindings/scripts/blink_idl_lexer.py b/bindings/scripts/blink_idl_lexer.py
index bbde342..ba68c6c 100644
--- a/bindings/scripts/blink_idl_lexer.py
+++ b/bindings/scripts/blink_idl_lexer.py
@@ -69,6 +69,7 @@
sys.path.append(tools_dir)
from idl_parser.idl_lexer import IDLLexer
+LEXTAB = 'lextab'
REMOVE_TOKENS = ['COMMENT']
@@ -88,7 +89,8 @@
for token in tokens:
self._RemoveToken(token)
- def __init__(self, debug=False, optimize=True, outputdir=None):
+ def __init__(self, debug=False, optimize=True, outputdir=None,
+ rewrite_tables=False):
if debug:
# Turn off optimization and caching to help debugging
optimize = False
@@ -98,6 +100,16 @@
# as a Python module
sys.path.append(outputdir)
+ if rewrite_tables:
+ tablefile_root = os.path.join(outputdir, LEXTAB)
+ # Also remove the .pyc/.pyo files, or they'll be used even if
+ # the .py file doesn't exist.
+ for ext in ('.py', '.pyc', '.pyo'):
+ try:
+ os.unlink(tablefile_root + ext)
+ except OSError:
+ pass
+
IDLLexer.__init__(self)
# Overrides to parent class
self._RemoveTokens(REMOVE_TOKENS)
@@ -108,6 +120,7 @@
self._lexobj = lex.lex(object=self,
debug=debug,
optimize=optimize,
+ lextab=LEXTAB,
outputdir=outputdir)
@@ -120,7 +133,10 @@
except IndexError as err:
print 'Usage: %s OUTPUT_DIR' % argv[0]
return 1
- lexer = BlinkIDLLexer(outputdir=outputdir)
+ # Important: rewrite_tables=True causes the cache file to be deleted if it
+ # exists, thus making sure that PLY doesn't load it instead of regenerating
+ # the parse table.
+ lexer = BlinkIDLLexer(outputdir=outputdir, rewrite_tables=True)
if __name__ == '__main__':
diff --git a/bindings/scripts/blink_idl_parser.py b/bindings/scripts/blink_idl_parser.py
index 6b205f2..59218a8 100644
--- a/bindings/scripts/blink_idl_parser.py
+++ b/bindings/scripts/blink_idl_parser.py
@@ -71,6 +71,7 @@
from idl_parser.idl_parser import ParseFile as parse_file
from blink_idl_lexer import BlinkIDLLexer
+import blink_idl_lexer
# Explicitly set starting symbol to rule defined only in base parser.
@@ -332,23 +333,17 @@
elif len(p) == 3:
p[0] = ListFromConcat(self.BuildTrue('NULLABLE'), p[2])
- # [b76.1] Add support for compound Extended Attribute values (A&B and A|B)
+ # [b94] Add support for OR Extended Attribute values "A|B"
def p_ExtendedAttributeIdentList(self, p):
- """ExtendedAttributeIdentList : identifier '=' identifier '&' IdentAndList
+ """ExtendedAttributeIdentList : identifier '=' '(' IdentifierList ')'
| identifier '=' identifier '|' IdentOrList"""
- value = self.BuildAttribute('VALUE', p[3] + p[4] + p[5])
+ if type(p[4]) is list:
+ value = self.BuildAttribute('VALUE', ','.join(p[4]))
+ else:
+ value = self.BuildAttribute('VALUE', p[3] + p[4] + p[5])
p[0] = self.BuildNamed('ExtAttribute', p, 1, value)
- # [b76.2] A&B&C
- def p_IdentAndList(self, p):
- """IdentAndList : identifier '&' IdentAndList
- | identifier"""
- if len(p) > 3:
- p[0] = p[1] + p[2] + p[3]
- else:
- p[0] = p[1]
-
- # [b76.3] A|B|C
+ # [b94.1] A|B|C
def p_IdentOrList(self, p):
"""IdentOrList : identifier '|' IdentOrList
| identifier"""
@@ -380,6 +375,8 @@
def __init__(self,
# common parameters
debug=False,
+ # local parameters
+ rewrite_tables=False,
# idl_parser parameters
lexer=None, verbose=False, mute_error=False,
# yacc parameters
@@ -394,6 +391,11 @@
write_tables = True
if outputdir:
picklefile = picklefile or os.path.join(outputdir, 'parsetab.pickle')
+ if rewrite_tables:
+ try:
+ os.unlink(picklefile)
+ except OSError:
+ pass
lexer = lexer or BlinkIDLLexer(debug=debug,
outputdir=outputdir,
@@ -433,13 +435,17 @@
################################################################################
def main(argv):
- # If file itself executed, cache parse table
+ # If file itself executed, cache lex/parse tables
try:
outputdir = argv[1]
except IndexError as err:
print 'Usage: %s OUTPUT_DIR' % argv[0]
return 1
- parser = BlinkIDLParser(outputdir=outputdir)
+ blink_idl_lexer.main(argv)
+ # Important: rewrite_tables=True causes the cache file to be deleted if it
+ # exists, thus making sure that PLY doesn't load it instead of regenerating
+ # the parse table.
+ parser = BlinkIDLParser(outputdir=outputdir, rewrite_tables=True)
if __name__ == '__main__':
diff --git a/bindings/scripts/code_generator_v8.py b/bindings/scripts/code_generator_v8.py
index 778a87e..272b611 100644
--- a/bindings/scripts/code_generator_v8.py
+++ b/bindings/scripts/code_generator_v8.py
@@ -73,17 +73,34 @@
import idl_types
from idl_types import IdlType
import v8_callback_interface
+import v8_dictionary
from v8_globals import includes, interfaces
import v8_interface
import v8_types
from v8_utilities import capitalize, cpp_name, conditional_string, v8_class_name
+def render_template(interface_info, header_template, cpp_template,
+ template_context):
+ template_context['code_generator'] = module_pyname
+
+ # Add includes for any dependencies
+ template_context['header_includes'] = sorted(
+ template_context['header_includes'])
+ includes.update(interface_info.get('dependencies_include_paths', []))
+ template_context['cpp_includes'] = sorted(includes)
+
+ header_text = header_template.render(template_context)
+ cpp_text = cpp_template.render(template_context)
+ return header_text, cpp_text
+
+
class CodeGeneratorV8(object):
- def __init__(self, interfaces_info, cache_dir):
+ def __init__(self, interfaces_info, cache_dir, output_dir):
interfaces_info = interfaces_info or {}
self.interfaces_info = interfaces_info
self.jinja_env = initialize_jinja_env(cache_dir)
+ self.output_dir = output_dir
# Set global type info
idl_types.set_ancestors(dict(
@@ -94,6 +111,10 @@
interface_name
for interface_name, interface_info in interfaces_info.iteritems()
if interface_info['is_callback_interface']))
+ IdlType.set_dictionaries(set(
+ dictionary_name
+ for dictionary_name, interface_info in interfaces_info.iteritems()
+ if interface_info['is_dictionary']))
IdlType.set_implemented_as_interfaces(dict(
(interface_name, interface_info['implemented_as'])
for interface_name, interface_info in interfaces_info.iteritems()
@@ -110,48 +131,100 @@
(interface_name, interface_info['component_dir'])
for interface_name, interface_info in interfaces_info.iteritems()))
- def generate_code(self, definitions, interface_name):
+ def output_paths_for_bindings(self, definition_name):
+ header_path = posixpath.join(self.output_dir,
+ 'V8%s.h' % definition_name)
+ cpp_path = posixpath.join(self.output_dir, 'V8%s.cpp' % definition_name)
+ return header_path, cpp_path
+
+ def output_paths_for_impl(self, definition_name):
+ header_path = posixpath.join(self.output_dir, '%s.h' % definition_name)
+ cpp_path = posixpath.join(self.output_dir, '%s.cpp' % definition_name)
+ return header_path, cpp_path
+
+ def generate_code(self, definitions, definition_name):
"""Returns .h/.cpp code as (header_text, cpp_text)."""
- try:
- interface = definitions.interfaces[interface_name]
- except KeyError:
- raise Exception('%s not in IDL definitions' % interface_name)
-
- # Store other interfaces for introspection
- interfaces.update(definitions.interfaces)
-
# Set local type info
IdlType.set_callback_functions(definitions.callback_functions.keys())
IdlType.set_enums((enum.name, enum.values)
for enum in definitions.enumerations.values())
+ if definition_name in definitions.interfaces:
+ return self.generate_interface_code(
+ definitions, definition_name,
+ definitions.interfaces[definition_name])
+ if definition_name in definitions.dictionaries:
+ return self.generate_dictionary_code(
+ definitions, definition_name,
+ definitions.dictionaries[definition_name])
+ raise ValueError('%s is not in IDL definitions' % definition_name)
+
+ def generate_interface_code(self, definitions, interface_name, interface):
+ # Store other interfaces for introspection
+ interfaces.update(definitions.interfaces)
+
# Select appropriate Jinja template and contents function
if interface.is_callback:
header_template_filename = 'callback_interface.h'
cpp_template_filename = 'callback_interface.cpp'
- generate_contents = v8_callback_interface.generate_callback_interface
+ interface_context = v8_callback_interface.callback_interface_context
else:
header_template_filename = 'interface.h'
cpp_template_filename = 'interface.cpp'
- generate_contents = v8_interface.generate_interface
+ interface_context = v8_interface.interface_context
header_template = self.jinja_env.get_template(header_template_filename)
cpp_template = self.jinja_env.get_template(cpp_template_filename)
- # Generate contents (input parameters for Jinja)
- template_contents = generate_contents(interface)
- template_contents['code_generator'] = module_pyname
-
- # Add includes for interface itself and any dependencies
interface_info = self.interfaces_info[interface_name]
- template_contents['header_includes'].add(interface_info['include_path'])
- template_contents['header_includes'] = sorted(template_contents['header_includes'])
- includes.update(interface_info.get('dependencies_include_paths', []))
- template_contents['cpp_includes'] = sorted(includes)
- # Render Jinja templates
- header_text = header_template.render(template_contents)
- cpp_text = cpp_template.render(template_contents)
- return header_text, cpp_text
+ template_context = interface_context(interface)
+ # Add the include for interface itself
+ template_context['header_includes'].add(interface_info['include_path'])
+ header_text, cpp_text = render_template(
+ interface_info, header_template, cpp_template, template_context)
+ header_path, cpp_path = self.output_paths_for_bindings(interface_name)
+ return (
+ (header_path, header_text),
+ (cpp_path, cpp_text),
+ )
+
+ def generate_dictionary_code(self, definitions, dictionary_name,
+ dictionary):
+ interface_info = self.interfaces_info[dictionary_name]
+ bindings_results = self.generate_dictionary_bindings(
+ dictionary_name, interface_info, dictionary)
+ impl_results = self.generate_dictionary_impl(
+ dictionary_name, interface_info, dictionary)
+ return bindings_results + impl_results
+
+ def generate_dictionary_bindings(self, dictionary_name,
+ interface_info, dictionary):
+ header_template = self.jinja_env.get_template('dictionary_v8.h')
+ cpp_template = self.jinja_env.get_template('dictionary_v8.cpp')
+ template_context = v8_dictionary.dictionary_context(dictionary)
+ # Add the include for interface itself
+ template_context['header_includes'].add(interface_info['include_path'])
+ header_text, cpp_text = render_template(
+ interface_info, header_template, cpp_template, template_context)
+ header_path, cpp_path = self.output_paths_for_bindings(dictionary_name)
+ return (
+ (header_path, header_text),
+ (cpp_path, cpp_text),
+ )
+
+ def generate_dictionary_impl(self, dictionary_name,
+ interface_info, dictionary):
+ header_template = self.jinja_env.get_template('dictionary_impl.h')
+ cpp_template = self.jinja_env.get_template('dictionary_impl.cpp')
+ template_context = v8_dictionary.dictionary_impl_context(
+ dictionary, self.interfaces_info)
+ header_text, cpp_text = render_template(
+ interface_info, header_template, cpp_template, template_context)
+ header_path, cpp_path = self.output_paths_for_impl(dictionary_name)
+ return (
+ (header_path, header_text),
+ (cpp_path, cpp_text),
+ )
def initialize_jinja_env(cache_dir):
@@ -166,11 +239,21 @@
jinja_env.filters.update({
'blink_capitalize': capitalize,
'conditional': conditional_if_endif,
+ 'exposed': exposed_if,
+ 'per_context_enabled': per_context_enabled_if,
'runtime_enabled': runtime_enabled_if,
})
return jinja_env
+def generate_indented_conditional(code, conditional):
+ # Indent if statement to level of original code
+ indent = re.match(' *', code).group(0)
+ return ('%sif (%s) {\n' % (indent, conditional) +
+ ' %s\n' % '\n '.join(code.splitlines()) +
+ '%s}\n' % indent)
+
+
# [Conditional]
def conditional_if_endif(code, conditional_string):
# Jinja2 filter to generate if/endif directive blocks
@@ -181,15 +264,25 @@
'#endif // %s\n' % conditional_string)
+# [Exposed]
+def exposed_if(code, exposed_test):
+ if not exposed_test:
+ return code
+ return generate_indented_conditional(code, 'context && (%s)' % exposed_test)
+
+
+# [PerContextEnabled]
+def per_context_enabled_if(code, per_context_enabled_function):
+ if not per_context_enabled_function:
+ return code
+ return generate_indented_conditional(code, 'context && context->isDocument() && %s(toDocument(context))' % per_context_enabled_function)
+
+
# [RuntimeEnabled]
def runtime_enabled_if(code, runtime_enabled_function_name):
if not runtime_enabled_function_name:
return code
- # Indent if statement to level of original code
- indent = re.match(' *', code).group(0)
- return ('%sif (%s()) {\n' % (indent, runtime_enabled_function_name) +
- ' %s\n' % '\n '.join(code.splitlines()) +
- '%s}\n' % indent)
+ return generate_indented_conditional(code, '%s()' % runtime_enabled_function_name)
################################################################################
diff --git a/bindings/scripts/compute_global_objects.py b/bindings/scripts/compute_global_objects.py
index 93d2eed..2e83e46 100755
--- a/bindings/scripts/compute_global_objects.py
+++ b/bindings/scripts/compute_global_objects.py
@@ -73,9 +73,7 @@
global_value = extended_attributes[global_key]
if global_value:
- # FIXME: In spec names are comma-separated, which makes parsing very
- # difficult (https://www.w3.org/Bugs/Public/show_bug.cgi?id=24959).
- return global_value.split('&')
+ return global_value.strip('()').split(',')
return [interface_name]
diff --git a/bindings/scripts/compute_interfaces_info_individual.py b/bindings/scripts/compute_interfaces_info_individual.py
index c3671d9..d7b58e1 100755
--- a/bindings/scripts/compute_interfaces_info_individual.py
+++ b/bindings/scripts/compute_interfaces_info_individual.py
@@ -47,7 +47,7 @@
import posixpath
import sys
-from utilities import get_file_contents, read_file_to_list, idl_filename_to_interface_name, write_pickle_file, get_interface_extended_attributes_from_idl, is_callback_interface_from_idl, get_partial_interface_name_from_idl, get_implements_from_idl, get_parent_interface, get_put_forward_interfaces_from_idl
+from utilities import get_file_contents, read_file_to_list, idl_filename_to_interface_name, write_pickle_file, get_interface_extended_attributes_from_idl, is_callback_interface_from_idl, is_dictionary_from_idl, get_partial_interface_name_from_idl, get_implements_from_idl, get_parent_interface, get_put_forward_interfaces_from_idl
module_path = os.path.dirname(__file__)
source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
@@ -140,10 +140,11 @@
'implemented_by_interfaces': left_interfaces, # private, merged to next
'implements_interfaces': right_interfaces,
'include_path': this_include_path,
+ 'is_callback_interface': is_callback_interface_from_idl(idl_file_contents),
+ 'is_dictionary': is_dictionary_from_idl(idl_file_contents),
# FIXME: temporary private field, while removing old treatement of
# 'implements': http://crbug.com/360435
'is_legacy_treat_as_partial_interface': 'LegacyTreatAsPartialInterface' in extended_attributes,
- 'is_callback_interface': is_callback_interface_from_idl(idl_file_contents),
'parent': get_parent_interface(idl_file_contents),
# Interfaces that are referenced (used as types) and that we introspect
# during code generation (beyond interface-level data ([ImplementedAs],
diff --git a/bindings/scripts/generate_global_constructors.py b/bindings/scripts/generate_global_constructors.py
index 81838fe..1be2ac3 100755
--- a/bindings/scripts/generate_global_constructors.py
+++ b/bindings/scripts/generate_global_constructors.py
@@ -86,9 +86,7 @@
# member the extended attribute applies to will be exposed only on objects
# associated with ECMAScript global environments whose global object
# implements an interface that has a matching global name.
- # FIXME: In spec names are comma-separated, but that makes parsing very
- # difficult (https://www.w3.org/Bugs/Public/show_bug.cgi?id=24959).
- exposed_global_names = extended_attributes.get('Exposed', 'Window').split('&')
+ exposed_global_names = extended_attributes.get('Exposed', 'Window').strip('()').split(',')
new_constructors_list = generate_global_constructors_list(interface_name, extended_attributes)
for exposed_global_name in exposed_global_names:
global_name_to_constructors[exposed_global_name].extend(new_constructors_list)
diff --git a/bindings/scripts/idl_compiler.py b/bindings/scripts/idl_compiler.py
index 6728aff..c74aae7 100755
--- a/bindings/scripts/idl_compiler.py
+++ b/bindings/scripts/idl_compiler.py
@@ -100,14 +100,13 @@
self.output_directory = output_directory
self.reader = IdlReader(interfaces_info, cache_directory)
- def compile_and_write(self, idl_filename, output_filenames):
+ def compile_and_write(self, idl_filename):
interface_name = idl_filename_to_interface_name(idl_filename)
definitions = self.reader.read_idl_definitions(idl_filename)
output_code_list = self.code_generator.generate_code(
definitions, interface_name)
- for output_code, output_filename in zip(output_code_list,
- output_filenames):
- write_file(output_code, output_filename, self.only_if_changed)
+ for output_path, output_code in output_code_list:
+ write_file(output_code, output_path, self.only_if_changed)
@abc.abstractmethod
def compile_file(self, idl_filename):
@@ -118,15 +117,11 @@
def __init__(self, *args, **kwargs):
IdlCompiler.__init__(self, *args, **kwargs)
self.code_generator = CodeGeneratorV8(self.interfaces_info,
- self.cache_directory)
+ self.cache_directory,
+ self.output_directory)
def compile_file(self, idl_filename):
- interface_name = idl_filename_to_interface_name(idl_filename)
- header_filename = os.path.join(self.output_directory,
- 'V8%s.h' % interface_name)
- cpp_filename = os.path.join(self.output_directory,
- 'V8%s.cpp' % interface_name)
- self.compile_and_write(idl_filename, (header_filename, cpp_filename))
+ self.compile_and_write(idl_filename)
def main():
diff --git a/bindings/scripts/idl_definitions.py b/bindings/scripts/idl_definitions.py
index 50664ba..d5dae32 100644
--- a/bindings/scripts/idl_definitions.py
+++ b/bindings/scripts/idl_definitions.py
@@ -48,8 +48,10 @@
IdlInterface
IdlAttribute < TypedObject
IdlConstant < TypedObject
+ IdlLiteral
IdlOperation < TypedObject
IdlArgument < TypedObject
+ IdlStringifier
IdlException < IdlInterface
(same contents as IdlInterface)
@@ -60,7 +62,7 @@
import abc
-from idl_types import IdlType, IdlUnionType
+from idl_types import IdlType, IdlUnionType, IdlArrayType, IdlSequenceType
SPECIAL_KEYWORD_LIST = ['GETTER', 'SETTER', 'DELETER']
STANDARD_TYPEDEFS = {
@@ -98,12 +100,13 @@
################################################################################
class IdlDefinitions(object):
- def __init__(self, node):
+ def __init__(self, idl_name, node):
"""Args: node: AST root node, class == 'File'"""
self.callback_functions = {}
self.dictionaries = {}
self.enumerations = {}
self.interfaces = {}
+ self.idl_name = idl_name
node_class = node.GetClass()
if node_class != 'File':
@@ -117,26 +120,26 @@
for child in children:
child_class = child.GetClass()
if child_class == 'Interface':
- interface = IdlInterface(child)
+ interface = IdlInterface(idl_name, child)
self.interfaces[interface.name] = interface
elif child_class == 'Exception':
- exception = IdlException(child)
+ exception = IdlException(idl_name, child)
# For simplicity, treat exceptions as interfaces
self.interfaces[exception.name] = exception
elif child_class == 'Typedef':
type_name = child.GetName()
typedefs[type_name] = typedef_node_to_type(child)
elif child_class == 'Enum':
- enumeration = IdlEnum(child)
+ enumeration = IdlEnum(idl_name, child)
self.enumerations[enumeration.name] = enumeration
elif child_class == 'Callback':
- callback_function = IdlCallbackFunction(child)
+ callback_function = IdlCallbackFunction(idl_name, child)
self.callback_functions[callback_function.name] = callback_function
elif child_class == 'Implements':
# Implements is handled at the interface merging step
pass
elif child_class == 'Dictionary':
- dictionary = IdlDictionary(child)
+ dictionary = IdlDictionary(idl_name, child)
self.dictionaries[dictionary.name] = dictionary
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -178,7 +181,7 @@
################################################################################
class IdlCallbackFunction(TypedObject):
- def __init__(self, node):
+ def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
if num_children != 2:
@@ -188,9 +191,10 @@
if arguments_node_class != 'Arguments':
raise ValueError('Expected Arguments node, got %s' % arguments_node_class)
+ self.idl_name = idl_name
self.name = node.GetName()
self.idl_type = type_node_to_type(type_node)
- self.arguments = arguments_node_to_arguments(arguments_node)
+ self.arguments = arguments_node_to_arguments(idl_name, arguments_node)
def resolve_typedefs(self, typedefs):
TypedObject.resolve_typedefs(self, typedefs)
@@ -203,34 +207,42 @@
################################################################################
class IdlDictionary(object):
- def __init__(self, node):
- self.parent = None
+ def __init__(self, idl_name, node):
+ self.extended_attributes = {}
+ self.is_partial = node.GetProperty('Partial') or False
+ self.idl_name = idl_name
self.name = node.GetName()
self.members = []
+ self.parent = None
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'Inherit':
self.parent = child.GetName()
elif child_class == 'Key':
- self.members.append(IdlDictionaryMember(child))
+ self.members.append(IdlDictionaryMember(idl_name, child))
+ elif child_class == 'ExtAttributes':
+ self.extended_attributes = (
+ ext_attributes_node_to_extended_attributes(idl_name, child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
class IdlDictionaryMember(object):
- def __init__(self, node):
+ def __init__(self, idl_name, node):
self.default_value = None
self.extended_attributes = {}
self.idl_type = None
+ self.idl_name = idl_name
self.name = node.GetName()
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'Default':
- self.default_value = child.GetProperty('VALUE')
+ self.default_value = default_node_to_idl_literal(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ self.extended_attributes = (
+ ext_attributes_node_to_extended_attributes(idl_name, child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -241,7 +253,8 @@
class IdlEnum(object):
# FIXME: remove, just treat enums as a dictionary
- def __init__(self, node):
+ def __init__(self, idl_name, node):
+ self.idl_name = idl_name
self.name = node.GetName()
self.values = []
for child in node.GetChildren():
@@ -253,7 +266,7 @@
################################################################################
class IdlInterface(object):
- def __init__(self, node=None):
+ def __init__(self, idl_name, node=None):
self.attributes = []
self.constants = []
self.constructors = []
@@ -261,6 +274,7 @@
self.extended_attributes = {}
self.operations = []
self.parent = None
+ self.stringifier = None
if not node: # Early exit for IdlException.__init__
return
@@ -268,25 +282,29 @@
self.is_exception = False
# FIXME: uppercase 'Partial' => 'PARTIAL' in base IDL parser
self.is_partial = node.GetProperty('Partial') or False
+ self.idl_name = idl_name
self.name = node.GetName()
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
if child_class == 'Attribute':
- self.attributes.append(IdlAttribute(child))
+ self.attributes.append(IdlAttribute(idl_name, child))
elif child_class == 'Const':
- self.constants.append(IdlConstant(child))
+ self.constants.append(IdlConstant(idl_name, child))
elif child_class == 'ExtAttributes':
- extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
self.constructors, self.custom_constructors = (
- extended_attributes_to_constructors(extended_attributes))
+ extended_attributes_to_constructors(idl_name, extended_attributes))
clear_constructor_attributes(extended_attributes)
self.extended_attributes = extended_attributes
elif child_class == 'Operation':
- self.operations.append(IdlOperation(child))
+ self.operations.append(IdlOperation(idl_name, child))
elif child_class == 'Inherit':
self.parent = child.GetName()
+ elif child_class == 'Stringifier':
+ self.stringifier = IdlStringifier(idl_name, child)
+ self.process_stringifier()
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -302,6 +320,14 @@
for operation in self.operations:
operation.resolve_typedefs(typedefs)
+ def process_stringifier(self):
+ """Add the stringifier's attribute or named operation child, if it has
+ one, as a regular attribute/operation of this interface."""
+ if self.stringifier.attribute:
+ self.attributes.append(self.stringifier.attribute)
+ elif self.stringifier.operation:
+ self.operations.append(self.stringifier.operation)
+
def merge(self, other):
"""Merge in another interface's members (e.g., partial interface)"""
self.attributes.extend(other.attributes)
@@ -316,26 +342,27 @@
# are not expected. Thus it is easier to implement exceptions as a
# restricted subclass of interfaces.
# http://www.w3.org/TR/WebIDL/#idl-exceptions
- def __init__(self, node):
+ def __init__(self, idl_name, node):
# Exceptions are similar to Interfaces, but simpler
- IdlInterface.__init__(self)
+ IdlInterface.__init__(self, idl_name)
self.is_callback = False
self.is_exception = True
self.is_partial = False
+ self.idl_name = idl_name
self.name = node.GetName()
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
if child_class == 'Attribute':
- attribute = IdlAttribute(child)
+ attribute = IdlAttribute(idl_name, child)
self.attributes.append(attribute)
elif child_class == 'Const':
- self.constants.append(IdlConstant(child))
+ self.constants.append(IdlConstant(idl_name, child))
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
elif child_class == 'ExceptionOperation':
- self.operations.append(IdlOperation.from_exception_operation_node(child))
+ self.operations.append(IdlOperation.from_exception_operation_node(idl_name, child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -345,9 +372,10 @@
################################################################################
class IdlAttribute(TypedObject):
- def __init__(self, node):
+ def __init__(self, idl_name, node):
self.is_read_only = node.GetProperty('READONLY') or False
self.is_static = node.GetProperty('STATIC') or False
+ self.idl_name = idl_name
self.name = node.GetName()
# Defaults, overridden below
self.idl_type = None
@@ -359,7 +387,7 @@
if child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -369,7 +397,7 @@
################################################################################
class IdlConstant(TypedObject):
- def __init__(self, node):
+ def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
if num_children < 2 or num_children > 3:
@@ -380,15 +408,22 @@
if value_node_class != 'Value':
raise ValueError('Expected Value node, got %s' % value_node_class)
+ self.idl_name = idl_name
self.name = node.GetName()
# ConstType is more limited than Type, so subtree is smaller and
# we don't use the full type_node_to_type function.
self.idl_type = type_node_inner_to_type(type_node)
- self.value = value_node.GetName()
+ # FIXME: This code is unnecessarily complicated due to the rather
+ # inconsistent way the upstream IDL parser outputs default values.
+ # http://crbug.com/374178
+ if value_node.GetProperty('TYPE') == 'float':
+ self.value = value_node.GetProperty('VALUE')
+ else:
+ self.value = value_node.GetName()
if num_children == 3:
ext_attributes_node = children[2]
- self.extended_attributes = ext_attributes_node_to_extended_attributes(ext_attributes_node)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, ext_attributes_node)
else:
self.extended_attributes = {}
@@ -436,7 +471,7 @@
raise ValueError('Unsupported string value: %r' % value)
return IdlLiteral(idl_type, value)
if idl_type == 'integer':
- return IdlLiteral(idl_type, int(node.GetProperty('NAME')))
+ return IdlLiteral(idl_type, int(node.GetProperty('NAME'), base=0))
if idl_type == 'float':
return IdlLiteral(idl_type, float(node.GetProperty('VALUE')))
if idl_type == 'boolean':
@@ -451,7 +486,7 @@
################################################################################
class IdlOperation(TypedObject):
- def __init__(self, node=None):
+ def __init__(self, idl_name, node=None):
self.arguments = []
self.extended_attributes = {}
self.specials = []
@@ -460,6 +495,7 @@
if not node:
self.is_static = False
return
+ self.idl_name = idl_name
self.name = node.GetName() # FIXME: should just be: or ''
# FIXME: AST should use None internally
if self.name == '_unnamed_':
@@ -476,21 +512,21 @@
for child in children:
child_class = child.GetClass()
if child_class == 'Arguments':
- self.arguments = arguments_node_to_arguments(child)
+ self.arguments = arguments_node_to_arguments(idl_name, child)
elif child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@classmethod
- def from_exception_operation_node(cls, node):
+ def from_exception_operation_node(cls, idl_name, node):
# Needed to handle one case in DOMException.idl:
# // Override in a Mozilla compatible format
# [NotEnumerable] DOMString toString();
# FIXME: can we remove this? replace with a stringifier?
- operation = cls()
+ operation = cls(idl_name)
operation.name = node.GetName()
children = node.GetChildren()
if len(children) < 1 or len(children) > 2:
@@ -501,15 +537,15 @@
if len(children) > 1:
ext_attributes_node = children[1]
- operation.extended_attributes = ext_attributes_node_to_extended_attributes(ext_attributes_node)
+ operation.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, ext_attributes_node)
return operation
@classmethod
- def constructor_from_arguments_node(cls, name, arguments_node):
- constructor = cls()
+ def constructor_from_arguments_node(cls, name, idl_name, arguments_node):
+ constructor = cls(idl_name)
constructor.name = name
- constructor.arguments = arguments_node_to_arguments(arguments_node)
+ constructor.arguments = arguments_node_to_arguments(idl_name, arguments_node)
constructor.is_constructor = True
return constructor
@@ -524,11 +560,12 @@
################################################################################
class IdlArgument(TypedObject):
- def __init__(self, node):
+ def __init__(self, idl_name, node):
self.extended_attributes = {}
self.idl_type = None
self.is_optional = node.GetProperty('OPTIONAL') # syntax: (optional T)
self.is_variadic = False # syntax: (T...)
+ self.idl_name = idl_name
self.name = node.GetName()
self.default_value = None
@@ -538,7 +575,7 @@
if child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
elif child_class == 'Argument':
child_name = child.GetName()
if child_name != '...':
@@ -550,22 +587,53 @@
raise ValueError('Unrecognized node class: %s' % child_class)
-def arguments_node_to_arguments(node):
+def arguments_node_to_arguments(idl_name, node):
# [Constructor] and [CustomConstructor] without arguments (the bare form)
# have None instead of an arguments node, but have the same meaning as using
# an empty argument list, [Constructor()], so special-case this.
# http://www.w3.org/TR/WebIDL/#Constructor
if node is None:
return []
- return [IdlArgument(argument_node)
+ return [IdlArgument(idl_name, argument_node)
for argument_node in node.GetChildren()]
################################################################################
+# Stringifiers
+################################################################################
+
+class IdlStringifier(object):
+ def __init__(self, idl_name, node):
+ self.attribute = None
+ self.operation = None
+ self.extended_attributes = {}
+ self.idl_name = idl_name
+
+ for child in node.GetChildren():
+ child_class = child.GetClass()
+ if child_class == 'Attribute':
+ self.attribute = IdlAttribute(idl_name, child)
+ elif child_class == 'Operation':
+ operation = IdlOperation(idl_name, child)
+ if operation.name:
+ self.operation = operation
+ elif child_class == 'ExtAttributes':
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
+ else:
+ raise ValueError('Unrecognized node class: %s' % child_class)
+
+ # Copy the stringifier's extended attributes (such as [Unforgable]) onto
+ # the underlying attribute or operation, if there is one.
+ if self.attribute or self.operation:
+ (self.attribute or self.operation).extended_attributes.update(
+ self.extended_attributes)
+
+
+################################################################################
# Extended attributes
################################################################################
-def ext_attributes_node_to_extended_attributes(node):
+def ext_attributes_node_to_extended_attributes(idl_name, node):
"""
Returns:
Dictionary of {ExtAttributeName: ExtAttributeValue}.
@@ -619,7 +687,7 @@
raise ValueError('[SetWrapperReferenceTo] requires a child, but has none.')
if child_class != 'Arguments':
raise ValueError('[SetWrapperReferenceTo] only supports Arguments as child, but has child of class: %s' % child_class)
- extended_attributes[name] = arguments_node_to_arguments(child)
+ extended_attributes[name] = arguments_node_to_arguments(idl_name, child)
elif child:
raise ValueError('ExtAttributes node with unexpected children: %s' % name)
else:
@@ -636,7 +704,7 @@
return extended_attributes
-def extended_attributes_to_constructors(extended_attributes):
+def extended_attributes_to_constructors(idl_name, extended_attributes):
"""Returns constructors and custom_constructors (lists of IdlOperations).
Auxiliary function for IdlInterface.__init__.
@@ -644,12 +712,12 @@
constructor_list = extended_attributes.get('Constructors', [])
constructors = [
- IdlOperation.constructor_from_arguments_node('Constructor', arguments_node)
+ IdlOperation.constructor_from_arguments_node('Constructor', idl_name, arguments_node)
for arguments_node in constructor_list]
custom_constructor_list = extended_attributes.get('CustomConstructors', [])
custom_constructors = [
- IdlOperation.constructor_from_arguments_node('CustomConstructor', arguments_node)
+ IdlOperation.constructor_from_arguments_node('CustomConstructor', idl_name, arguments_node)
for arguments_node in custom_constructor_list]
if 'NamedConstructor' in extended_attributes:
@@ -661,7 +729,7 @@
if len(children) != 1:
raise ValueError('NamedConstructor node expects 1 child, got %s.' % len(children))
arguments_node = children[0]
- named_constructor = IdlOperation.constructor_from_arguments_node('NamedConstructor', arguments_node)
+ named_constructor = IdlOperation.constructor_from_arguments_node('NamedConstructor', idl_name, arguments_node)
# FIXME: should return named_constructor separately; appended for Perl
constructors.append(named_constructor)
@@ -687,25 +755,23 @@
if len(children) < 1 or len(children) > 2:
raise ValueError('Type node expects 1 or 2 children (type + optional array []), got %s (multi-dimensional arrays are not supported).' % len(children))
+ is_nullable = node.GetProperty('NULLABLE') or False # syntax: T?
type_node_child = children[0]
+ base_type = type_node_inner_to_type(type_node_child, is_nullable=is_nullable)
if len(children) == 2:
array_node = children[1]
array_node_class = array_node.GetClass()
if array_node_class != 'Array':
raise ValueError('Expected Array node as TypeSuffix, got %s node.' % array_node_class)
- # FIXME: use IdlArrayType instead of is_array, once have that
- is_array = True
- else:
- is_array = False
+ array_is_nullable = array_node.GetProperty('NULLABLE') or False
+ return IdlArrayType(base_type, is_nullable=array_is_nullable)
- is_nullable = node.GetProperty('NULLABLE') or False # syntax: T?
-
- return type_node_inner_to_type(type_node_child, is_array=is_array, is_nullable=is_nullable)
+ return base_type
-def type_node_inner_to_type(node, is_array=False, is_nullable=False):
- # FIXME: remove is_array and is_nullable once have IdlArrayType and IdlNullableType
+def type_node_inner_to_type(node, is_nullable=False):
+ # FIXME: remove is_nullable once have IdlNullableType
node_class = node.GetClass()
# Note Type*r*ef, not Typedef, meaning the type is an identifier, thus
# either a typedef shorthand (but not a Typedef declaration itself) or an
@@ -713,16 +779,13 @@
if node_class in ['PrimitiveType', 'Typeref']:
# unrestricted syntax: unrestricted double | unrestricted float
is_unrestricted = node.GetProperty('UNRESTRICTED') or False
- return IdlType(node.GetName(), is_array=is_array, is_nullable=is_nullable, is_unrestricted=is_unrestricted)
+ return IdlType(node.GetName(), is_nullable=is_nullable, is_unrestricted=is_unrestricted)
elif node_class == 'Any':
- return IdlType('any', is_array=is_array, is_nullable=is_nullable)
+ return IdlType('any', is_nullable=is_nullable)
elif node_class == 'Sequence':
- if is_array:
- raise ValueError('Arrays of sequences are not supported')
- return sequence_node_to_type(node, is_nullable=is_nullable)
+ sequence_is_nullable = node.GetProperty('NULLABLE') or False
+ return sequence_node_to_type(node, is_nullable=sequence_is_nullable)
elif node_class == 'UnionType':
- if is_array:
- raise ValueError('Arrays of unions are not supported')
return union_type_node_to_idl_union_type(node, is_nullable=is_nullable)
raise ValueError('Unrecognized node class: %s' % node_class)
@@ -735,8 +798,8 @@
sequence_child_class = sequence_child.GetClass()
if sequence_child_class != 'Type':
raise ValueError('Unrecognized node class: %s' % sequence_child_class)
- element_type = type_node_to_type(sequence_child).base_type
- return IdlType(element_type, is_sequence=True, is_nullable=is_nullable)
+ element_type = type_node_to_type(sequence_child)
+ return IdlSequenceType(element_type, is_nullable=is_nullable)
def typedef_node_to_type(node):
diff --git a/bindings/scripts/idl_reader.py b/bindings/scripts/idl_reader.py
index 3828668..23797a7 100644
--- a/bindings/scripts/idl_reader.py
+++ b/bindings/scripts/idl_reader.py
@@ -70,26 +70,28 @@
ast = blink_idl_parser.parse_file(self.parser, idl_filename)
if not ast:
raise Exception('Failed to parse %s' % idl_filename)
- definitions = IdlDefinitions(ast)
+ idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
+ definitions = IdlDefinitions(idl_file_basename, ast)
if not self.multi_interface:
# Validate file contents with filename convention
# The Blink IDL filenaming convention is that the file
- # <interface_name>.idl MUST contain exactly 1 interface (or exception),
- # and the interface name must agree with the file's basename,
- # unless it is a partial interface.
+ # <definition_name>.idl MUST contain exactly 1 definition
+ # (interface, dictionary or exception), and the definition name must
+ # agree with the file's basename, unless it is a partial definition.
# (e.g., 'partial interface Foo' can be in FooBar.idl).
- number_of_interfaces = len(definitions.interfaces)
- if number_of_interfaces != 1:
+ targets = (definitions.interfaces.values() +
+ definitions.dictionaries.values())
+ number_of_targets = len(targets)
+ if number_of_targets != 1:
raise Exception(
- 'Expected exactly 1 interface in file {0}, but found {1}'
- .format(idl_filename, number_of_interfaces))
- interface = next(definitions.interfaces.itervalues())
- idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
- if not interface.is_partial and interface.name != idl_file_basename:
+ 'Expected exactly 1 definition in file {0}, but found {1}'
+ .format(idl_filename, number_of_targets))
+ target = targets[0]
+ if not target.is_partial and target.name != idl_file_basename:
raise Exception(
- 'Interface name "{0}" disagrees with IDL file basename "{1}".'
- .format(interface.name, idl_file_basename))
+ 'Definition name "{0}" disagrees with IDL file basename "{1}".'
+ .format(target.name, idl_file_basename))
else:
if len(definitions.interfaces) > 1:
print '----- Supplemental interfaces %s' % len(definitions.interfaces)
diff --git a/bindings/scripts/idl_types.py b/bindings/scripts/idl_types.py
index e488e33..d0797a6 100644
--- a/bindings/scripts/idl_types.py
+++ b/bindings/scripts/idl_types.py
@@ -4,8 +4,12 @@
"""IDL type handling.
Classes:
-IdlType
-IdlUnionType
+IdlTypeBase
+ IdlType
+ IdlUnionType
+ IdlArrayOrSequenceType
+ IdlArrayType
+ IdlSequenceType
"""
from collections import defaultdict
@@ -70,6 +74,14 @@
'Date': 'Date',
}
+STRING_TYPES = frozenset([
+ # http://heycam.github.io/webidl/#es-interface-call (step 10.11)
+ # (Interface object [[Call]] method's string types.)
+ 'String',
+ 'ByteString',
+ 'ScalarValueString',
+])
+
################################################################################
# Inheritance
@@ -86,63 +98,120 @@
ancestors.update(new_ancestors)
-################################################################################
-# IdlType
-################################################################################
+class IdlTypeBase(object):
+ """Base class for IdlType, IdlUnionType and IdlArrayOrSequenceType."""
-class IdlType(object):
- # FIXME: incorporate Nullable, etc.
- # FIXME: use nested types: IdlArrayType, IdlNullableType, IdlSequenceType
- # to support types like short?[] vs. short[]?, instead of treating these
- # as orthogonal properties (via flags).
- callback_functions = set()
- callback_interfaces = set()
- enums = {} # name -> values
-
- def __init__(self, base_type, is_array=False, is_sequence=False, is_nullable=False, is_unrestricted=False):
- if is_array and is_sequence:
- raise ValueError('Array of Sequences are not allowed.')
- if is_unrestricted:
- self.base_type = 'unrestricted %s' % base_type
- else:
- self.base_type = base_type
- self.is_array = is_array
- self.is_sequence = is_sequence
+ def __init__(self, is_nullable):
+ self.base_type = None
self.is_nullable = is_nullable
def __str__(self):
- type_string = self.base_type
- if self.is_array:
- return type_string + '[]'
- if self.is_sequence:
- return 'sequence<%s>' % type_string
+ inner_string = self.inner_string
if self.is_nullable:
# FIXME: Dictionary::ConversionContext::setConversionType can't
# handle the '?' in nullable types (passes nullability separately).
# Update that function to handle nullability from the type name,
# simplifying its signature.
- # return type_string + '?'
- return type_string
- return type_string
+ # return inner_string + '?'
+ return inner_string
+ return inner_string
- # FIXME: rename to native_array_element_type and move to v8_types.py
@property
- def array_or_sequence_type(self):
- return self.array_type or self.sequence_type
-
- # FIXME: rename to array_element_type
- @property
- def array_type(self):
- return self.is_array and IdlType(self.base_type)
-
- # FIXME: rename to sequence_element_type
- @property
- def sequence_type(self):
- return self.is_sequence and IdlType(self.base_type)
+ def inner_string(self):
+ raise NotImplementedError(
+ 'inner_string property should be defined in subclasses')
@property
def is_basic_type(self):
- return self.base_type in BASIC_TYPES and not self.array_or_sequence_type
+ return False
+
+ @property
+ def is_callback_function(self):
+ return False
+
+ @property
+ def is_callback_interface(self):
+ return False
+
+ @property
+ def is_dictionary(self):
+ return False
+
+ @property
+ def is_enum(self):
+ return False
+
+ @property
+ def is_integer_type(self):
+ return False
+
+ @property
+ def is_numeric_type(self):
+ return False
+
+ @property
+ def is_primitive_type(self):
+ return False
+
+ @property
+ def is_interface_type(self):
+ return False
+
+ @property
+ def is_string_type(self):
+ return False
+
+ @property
+ def is_union_type(self):
+ return False
+
+ @property
+ def may_raise_exception_on_conversion(self):
+ return False
+
+ @property
+ def name(self):
+ if self.is_nullable:
+ return self.inner_name + 'OrNull'
+ return self.inner_name
+
+ @property
+ def inner_name(self):
+ raise NotImplementedError(
+ 'inner_name property should be defined in subclasses')
+
+ def resolve_typedefs(self, typedefs):
+ raise NotImplementedError(
+ 'resolve_typedefs should be defined in subclasses')
+
+
+################################################################################
+# IdlType
+################################################################################
+
+class IdlType(IdlTypeBase):
+ # FIXME: incorporate Nullable, etc.
+ # to support types like short?[] vs. short[]?, instead of treating these
+ # as orthogonal properties (via flags).
+ callback_functions = set()
+ callback_interfaces = set()
+ dictionaries = set()
+ enums = {} # name -> values
+
+ def __init__(self, base_type, is_nullable=False, is_unrestricted=False):
+ super(IdlType, self).__init__(is_nullable)
+ if is_unrestricted:
+ self.base_type = 'unrestricted %s' % base_type
+ else:
+ self.base_type = base_type
+
+ @property
+ def inner_string(self):
+ return self.base_type
+
+ @property
+ def is_basic_type(self):
+ return self.base_type in BASIC_TYPES
@property
def is_callback_function(self):
@@ -153,11 +222,8 @@
return self.base_type in IdlType.callback_interfaces
@property
- def is_composite_type(self):
- return (self.name == 'Any' or
- self.array_type or
- self.sequence_type or
- self.is_union_type)
+ def is_dictionary(self):
+ return self.base_type in IdlType.dictionaries
@property
def is_enum(self):
@@ -171,15 +237,15 @@
@property
def is_integer_type(self):
- return self.base_type in INTEGER_TYPES and not self.array_or_sequence_type
+ return self.base_type in INTEGER_TYPES
@property
def is_numeric_type(self):
- return self.base_type in NUMERIC_TYPES and not self.array_or_sequence_type
+ return self.base_type in NUMERIC_TYPES
@property
def is_primitive_type(self):
- return self.base_type in PRIMITIVE_TYPES and not self.array_or_sequence_type
+ return self.base_type in PRIMITIVE_TYPES
@property
def is_interface_type(self):
@@ -188,31 +254,34 @@
# http://www.w3.org/TR/WebIDL/#idl-interface
# In C++ these are RefPtr or PassRefPtr types.
return not(self.is_basic_type or
- self.is_composite_type or
self.is_callback_function or
+ self.is_dictionary or
self.is_enum or
+ self.name == 'Any' or
self.name == 'Object' or
self.name == 'Promise') # Promise will be basic in future
@property
+ def is_string_type(self):
+ return self.inner_name in STRING_TYPES
+
+ @property
+ def may_raise_exception_on_conversion(self):
+ return (self.is_integer_type or
+ self.name in ('ByteString', 'ScalarValueString'))
+
+ @property
def is_union_type(self):
return isinstance(self, IdlUnionType)
@property
- def name(self):
- """Return type name.
+ def inner_name(self):
+ """Return type name (or inner type name if nullable)
http://heycam.github.io/webidl/#dfn-type-name
"""
base_type = self.base_type
- base_type_name = TYPE_NAMES.get(base_type, base_type)
- if self.is_array:
- return base_type_name + 'Array'
- if self.is_sequence:
- return base_type_name + 'Sequence'
- if self.is_nullable:
- return base_type_name + 'OrNull'
- return base_type_name
+ return TYPE_NAMES.get(base_type, base_type)
@classmethod
def set_callback_functions(cls, new_callback_functions):
@@ -223,10 +292,17 @@
cls.callback_interfaces.update(new_callback_interfaces)
@classmethod
+ def set_dictionaries(cls, new_dictionaries):
+ cls.dictionaries.update(new_dictionaries)
+
+ @classmethod
def set_enums(cls, new_enums):
cls.enums.update(new_enums)
def resolve_typedefs(self, typedefs):
+ # This function either returns |self|, possibly mutated, or leaves this
+ # object unmodified and returns a different object.
+ # FIXME: Change to never mutate |self|, and rename typedefs_resolved().
if self.base_type not in typedefs:
return self
new_type = typedefs[self.base_type]
@@ -235,16 +311,7 @@
# since can't change type(self)
return new_type
# If type doesn't change, just mutate self to avoid a new object
- # FIXME: a bit ugly; use __init__ instead of setting flags
- self.base_type = new_type.base_type
- # handle array both in use and in typedef itself:
- # typedef Type TypeDef;
- # TypeDef[] ...
- # and:
- # typedef Type[] TypeArray
- # TypeArray ...
- self.is_array |= new_type.is_array
- self.is_sequence |= new_type.is_sequence
+ self.__init__(new_type.base_type, self.is_nullable or new_type.is_nullable)
return self
@@ -252,66 +319,22 @@
# IdlUnionType
################################################################################
-class IdlUnionType(object):
+class IdlUnionType(IdlTypeBase):
# http://heycam.github.io/webidl/#idl-union
- # FIXME: derive from IdlType, instead of stand-alone class, to reduce
- # duplication.
def __init__(self, member_types, is_nullable=False):
+ super(IdlUnionType, self).__init__(is_nullable=is_nullable)
self.member_types = member_types
- self.is_nullable = is_nullable
-
- @property
- def array_or_sequence_type(self):
- return False
-
- @property
- def array_type(self):
- return False
-
- @property
- def is_array(self):
- # We do not support arrays of union types
- return False
-
- @property
- def base_type(self):
- return None
-
- @property
- def is_basic_type(self):
- return False
-
- @property
- def is_callback_function(self):
- return False
-
- @property
- def is_enum(self):
- return False
-
- @property
- def is_integer_type(self):
- return False
-
- @property
- def is_numeric_type(self):
- return False
-
- @property
- def is_primitivee_type(self):
- return False
-
- @property
- def is_sequence(self):
- # We do not support sequences of union types
- return False
@property
def is_union_type(self):
return True
@property
- def name(self):
+ def inner_name(self):
+ """Return type name (or inner type name if nullable)
+
+ http://heycam.github.io/webidl/#dfn-type-name
+ """
return 'Or'.join(member_type.name for member_type in self.member_types)
def resolve_typedefs(self, typedefs):
@@ -319,3 +342,45 @@
typedefs.get(member_type, member_type)
for member_type in self.member_types]
return self
+
+
+################################################################################
+# IdlArrayOrSequenceType, IdlArrayType, IdlSequenceType
+################################################################################
+
+class IdlArrayOrSequenceType(IdlTypeBase):
+ """Base class for IdlArrayType and IdlSequenceType."""
+
+ def __init__(self, element_type, is_nullable=False):
+ super(IdlArrayOrSequenceType, self).__init__(is_nullable)
+ self.element_type = element_type
+
+ def resolve_typedefs(self, typedefs):
+ self.element_type = self.element_type.resolve_typedefs(typedefs)
+ return self
+
+
+class IdlArrayType(IdlArrayOrSequenceType):
+ def __init__(self, element_type, is_nullable=False):
+ super(IdlArrayType, self).__init__(element_type, is_nullable)
+
+ @property
+ def inner_string(self):
+ return '%s[]' % self.element_type
+
+ @property
+ def inner_name(self):
+ return self.element_type.name + 'Array'
+
+
+class IdlSequenceType(IdlArrayOrSequenceType):
+ def __init__(self, element_type, is_nullable=False):
+ super(IdlSequenceType, self).__init__(element_type, is_nullable)
+
+ @property
+ def inner_string(self):
+ return 'sequence<%s>' % self.element_type
+
+ @property
+ def inner_name(self):
+ return self.element_type.name + 'Sequence'
diff --git a/bindings/scripts/idl_validator.py b/bindings/scripts/idl_validator.py
index e527442..29ccd7d 100644
--- a/bindings/scripts/idl_validator.py
+++ b/bindings/scripts/idl_validator.py
@@ -78,7 +78,7 @@
if values_string is None:
values = set([None])
else:
- values = set(re.split('[|&]', values_string))
+ values = set(re.split('[|,]', values_string))
invalid_values = values - valid_values
if invalid_values:
invalid_value = invalid_values.pop()
diff --git a/bindings/scripts/interface_dependency_resolver.py b/bindings/scripts/interface_dependency_resolver.py
index c65d3f6..ece506a 100644
--- a/bindings/scripts/interface_dependency_resolver.py
+++ b/bindings/scripts/interface_dependency_resolver.py
@@ -82,6 +82,9 @@
Args:
definitions: IdlDefinitions object, modified in place
"""
+ if not definitions.interfaces:
+ # This definitions should have a dictionary. Nothing to do for it.
+ return
target_interface = next(definitions.interfaces.itervalues())
interface_name = target_interface.name
interface_info = self.interfaces_info[interface_name]
diff --git a/bindings/scripts/utilities.py b/bindings/scripts/utilities.py
index 0aeabc2..3674765 100644
--- a/bindings/scripts/utilities.py
+++ b/bindings/scripts/utilities.py
@@ -119,6 +119,11 @@
return bool(match)
+def is_dictionary_from_idl(file_contents):
+ match = re.search(r'dictionary\s+\w+\s*{', file_contents)
+ return bool(match)
+
+
def get_parent_interface(file_contents):
match = re.search(r'interface\s+'
r'\w+\s*'
@@ -148,10 +153,10 @@
extended_attributes_string = match.group(1)
extended_attributes = {}
- # FIXME: this splitting is WRONG: it fails on ExtendedAttributeArgList like
- # 'NamedConstructor=Foo(a, b)'
+ # FIXME: this splitting is WRONG: it fails on extended attributes where lists of
+ # multiple values are used, which are seperated by a comma and a space.
parts = [extended_attribute.strip()
- for extended_attribute in extended_attributes_string.split(',')
+ for extended_attribute in re.split(',\s+', extended_attributes_string)
# Discard empty parts, which may exist due to trailing comma
if extended_attribute.strip()]
for part in parts:
diff --git a/bindings/scripts/v8_attributes.py b/bindings/scripts/v8_attributes.py
index 6dcb2d5..bb61ef9 100644
--- a/bindings/scripts/v8_attributes.py
+++ b/bindings/scripts/v8_attributes.py
@@ -41,7 +41,7 @@
from v8_utilities import capitalize, cpp_name, has_extended_attribute, has_extended_attribute_value, scoped_name, strip_suffix, uncapitalize
-def generate_attribute(interface, attribute):
+def attribute_context(interface, attribute):
idl_type = attribute.idl_type
base_idl_type = idl_type.base_type
extended_attributes = attribute.extended_attributes
@@ -52,12 +52,6 @@
is_check_security_for_node = 'CheckSecurity' in extended_attributes
if is_check_security_for_node:
includes.add('bindings/common/BindingSecurity.h')
- # [Custom]
- has_custom_getter = ('Custom' in extended_attributes and
- extended_attributes['Custom'] in [None, 'Getter'])
- has_custom_setter = (not attribute.is_read_only and
- 'Custom' in extended_attributes and
- extended_attributes['Custom'] in [None, 'Setter'])
# [CustomElementCallbacks], [Reflect]
is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attributes
is_reflect = 'Reflect' in extended_attributes
@@ -66,53 +60,45 @@
# [PerWorldBindings]
if 'PerWorldBindings' in extended_attributes:
assert idl_type.is_wrapper_type or 'LogActivity' in extended_attributes, '[PerWorldBindings] should only be used with wrapper types: %s.%s' % (interface.name, attribute.name)
- # [RaisesException], [RaisesException=Setter]
- is_setter_raises_exception = (
- 'RaisesException' in extended_attributes and
- extended_attributes['RaisesException'] in [None, 'Setter'])
# [TypeChecking]
- has_type_checking_interface = (
- (has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
- has_extended_attribute_value(attribute, 'TypeChecking', 'Interface')) and
- idl_type.is_wrapper_type)
- has_type_checking_nullable = (
- (has_extended_attribute_value(interface, 'TypeChecking', 'Nullable') or
- has_extended_attribute_value(attribute, 'TypeChecking', 'Nullable')) and
- idl_type.is_wrapper_type)
has_type_checking_unrestricted = (
(has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or
has_extended_attribute_value(attribute, 'TypeChecking', 'Unrestricted')) and
idl_type.name in ('Float', 'Double'))
+ # [ImplementedInPrivateScript]
+ is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_attributes
+ if is_implemented_in_private_script:
+ includes.add('bindings/core/v8/PrivateScriptRunner.h')
+ includes.add('core/frame/LocalFrame.h')
+ includes.add('platform/ScriptForbiddenScope.h')
+
+ # [OnlyExposedToPrivateScript]
+ is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended_attributes
if (base_idl_type == 'EventHandler' and
interface.name in ['Window', 'WorkerGlobalScope'] and
attribute.name == 'onerror'):
- includes.add('bindings/v8/V8ErrorHandler.h')
+ includes.add('bindings/core/v8/V8ErrorHandler.h')
- contents = {
+ context = {
'access_control_list': access_control_list(attribute),
'activity_logging_world_list_for_getter': v8_utilities.activity_logging_world_list(attribute, 'Getter'), # [ActivityLogging]
'activity_logging_world_list_for_setter': v8_utilities.activity_logging_world_list(attribute, 'Setter'), # [ActivityLogging]
'activity_logging_include_old_value_for_setter': 'LogPreviousValue' in extended_attributes, # [ActivityLogging]
'activity_logging_world_check': v8_utilities.activity_logging_world_check(attribute), # [ActivityLogging]
+ 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
'cached_attribute_validation_method': extended_attributes.get('CachedAttribute'),
'conditional_string': v8_utilities.conditional_string(attribute),
'constructor_type': idl_type.constructor_type_name
if is_constructor_attribute(attribute) else None,
'cpp_name': cpp_name(attribute),
'cpp_type': idl_type.cpp_type,
- 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value='original', creation_context='info.Holder()'),
+ 'cpp_type_initializer': idl_type.cpp_type_initializer,
'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs]
'enum_validation_expression': idl_type.enum_validation_expression,
- 'has_custom_getter': has_custom_getter,
- 'has_custom_setter': has_custom_setter,
- 'has_setter_exception_state':
- is_setter_raises_exception or has_type_checking_interface or
- has_type_checking_nullable or has_type_checking_unrestricted or
- idl_type.is_integer_type or
- idl_type.name in ('ByteString', 'ScalarValueString'),
- 'has_type_checking_interface': has_type_checking_interface,
- 'has_type_checking_nullable': has_type_checking_nullable,
+ 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed]
+ 'has_custom_getter': has_custom_getter(attribute),
+ 'has_custom_setter': has_custom_setter(attribute),
'has_type_checking_unrestricted': has_type_checking_unrestricted,
'idl_type': str(idl_type), # need trailing [] on array for Dictionary::ConversionContext::setConversionType
'is_call_with_execution_context': v8_utilities.has_extended_attribute_value(attribute, 'CallWith', 'ExecutionContext'),
@@ -123,24 +109,27 @@
'is_getter_raises_exception': # [RaisesException]
'RaisesException' in extended_attributes and
extended_attributes['RaisesException'] in (None, 'Getter'),
+ 'is_implemented_in_private_script': is_implemented_in_private_script,
'is_initialized_by_event_constructor':
'InitializedByEventConstructor' in extended_attributes,
'is_keep_alive_for_gc': is_keep_alive_for_gc(interface, attribute),
- 'is_nullable': attribute.idl_type.is_nullable,
+ 'is_nullable': idl_type.is_nullable,
+ 'is_explicit_nullable': idl_type.is_explicit_nullable,
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
'is_read_only': attribute.is_read_only,
'is_reflect': is_reflect,
'is_replaceable': 'Replaceable' in attribute.extended_attributes,
- 'is_setter_call_with_execution_context': v8_utilities.has_extended_attribute_value(attribute, 'SetterCallWith', 'ExecutionContext'),
- 'is_setter_raises_exception': is_setter_raises_exception,
'is_static': attribute.is_static,
'is_url': 'URL' in extended_attributes,
'is_unforgeable': 'Unforgeable' in extended_attributes,
'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs]
'name': attribute.name,
+ 'only_exposed_to_private_script': is_only_exposed_to_private_script,
'per_context_enabled_function': v8_utilities.per_context_enabled_function_name(attribute), # [PerContextEnabled]
+ 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
+ extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->isolate()', used_in_private_script=True),
'property_attributes': property_attributes(attribute),
'put_forwards': 'PutForwards' in extended_attributes,
'reflect_empty': extended_attributes.get('ReflectEmpty'),
@@ -148,36 +137,36 @@
'reflect_missing': extended_attributes.get('ReflectMissing'),
'reflect_only': extended_attributes['ReflectOnly'].split('|')
if 'ReflectOnly' in extended_attributes else None,
- 'setter_callback': setter_callback_name(interface, attribute),
- 'v8_type': v8_types.v8_type(base_idl_type),
'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(attribute), # [RuntimeEnabled]
+ 'setter_callback': setter_callback_name(interface, attribute),
+ 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
'world_suffixes': ['', 'ForMainWorld']
if 'PerWorldBindings' in extended_attributes
else [''], # [PerWorldBindings]
}
if is_constructor_attribute(attribute):
- generate_constructor_getter(interface, attribute, contents)
- return contents
- if not has_custom_getter:
- generate_getter(interface, attribute, contents)
- if (not has_custom_setter and
+ constructor_getter_context(interface, attribute, context)
+ return context
+ if not has_custom_getter(attribute):
+ getter_context(interface, attribute, context)
+ if (not has_custom_setter(attribute) and
(not attribute.is_read_only or 'PutForwards' in extended_attributes)):
- generate_setter(interface, attribute, contents)
+ setter_context(interface, attribute, context)
- return contents
+ return context
################################################################################
# Getter
################################################################################
-def generate_getter(interface, attribute, contents):
+def getter_context(interface, attribute, context):
idl_type = attribute.idl_type
base_idl_type = idl_type.base_type
extended_attributes = attribute.extended_attributes
- cpp_value = getter_expression(interface, attribute, contents)
+ cpp_value = getter_expression(interface, attribute, context)
# Normally we can inline the function call into the return statement to
# avoid the overhead of using a Ref<> temporary, but for some cases
# (nullable types, EventHandler, [CachedAttribute], or if there are
@@ -185,46 +174,65 @@
# FIXME: check if compilers are smart enough to inline this, and if so,
# always use a local variable (for readability and CG simplicity).
release = False
- if (idl_type.is_nullable or
+ if 'ImplementedInPrivateScript' in extended_attributes:
+ if (not idl_type.is_wrapper_type and
+ not idl_type.is_basic_type):
+ raise Exception('Private scripts supports only primitive types and DOM wrappers.')
+
+ context['cpp_value_original'] = cpp_value
+ cpp_value = 'result'
+ # EventHandler has special handling
+ if base_idl_type != 'EventHandler':
+ release = idl_type.release
+ elif (idl_type.is_explicit_nullable or
base_idl_type == 'EventHandler' or
'CachedAttribute' in extended_attributes or
+ 'LogPreviousValue' in extended_attributes or
'ReflectOnly' in extended_attributes or
- contents['is_getter_raises_exception']):
- contents['cpp_value_original'] = cpp_value
- cpp_value = 'v8Value'
+ context['is_keep_alive_for_gc'] or
+ context['is_getter_raises_exception']):
+ context['cpp_value_original'] = cpp_value
+ cpp_value = 'cppValue'
# EventHandler has special handling
- if base_idl_type != 'EventHandler' and idl_type.is_interface_type:
- release = True
+ if base_idl_type != 'EventHandler':
+ release = idl_type.release
def v8_set_return_value_statement(for_main_world=False):
- if contents['is_keep_alive_for_gc']:
+ if context['is_keep_alive_for_gc']:
return 'v8SetReturnValue(info, wrapper)'
return idl_type.v8_set_return_value(cpp_value, extended_attributes=extended_attributes, script_wrappable='impl', release=release, for_main_world=for_main_world)
- contents.update({
+ context.update({
'cpp_value': cpp_value,
- 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value=cpp_value, creation_context='info.Holder()'),
+ 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
+ cpp_value=cpp_value, creation_context='info.Holder()',
+ extended_attributes=extended_attributes),
'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_main_world=True),
'v8_set_return_value': v8_set_return_value_statement(),
})
-def getter_expression(interface, attribute, contents):
+def getter_expression(interface, attribute, context):
arguments = []
this_getter_base_name = getter_base_name(interface, attribute, arguments)
getter_name = scoped_name(interface, attribute, this_getter_base_name)
+ if 'ImplementedInPrivateScript' in attribute.extended_attributes:
+ arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())')
+ arguments.append('impl')
+ arguments.append('&result')
arguments.extend(v8_utilities.call_with_arguments(
attribute.extended_attributes.get('CallWith')))
# Members of IDL partial interface definitions are implemented in C++ as
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and
+ not 'ImplementedInPrivateScript' in attribute.extended_attributes and
not attribute.is_static):
arguments.append('*impl')
- if attribute.idl_type.is_nullable and not contents['has_type_checking_nullable']:
+ if attribute.idl_type.is_explicit_nullable:
arguments.append('isNull')
- if contents['is_getter_raises_exception']:
+ if context['is_getter_raises_exception']:
arguments.append('exceptionState')
return '%s(%s)' % (getter_name, ', '.join(arguments))
@@ -238,6 +246,10 @@
def getter_base_name(interface, attribute, arguments):
extended_attributes = attribute.extended_attributes
+
+ if 'ImplementedInPrivateScript' in extended_attributes:
+ return '%sAttributeGetter' % uncapitalize(cpp_name(attribute))
+
if 'Reflect' not in extended_attributes:
return uncapitalize(cpp_name(attribute))
@@ -282,33 +294,56 @@
# Setter
################################################################################
-def generate_setter(interface, attribute, contents):
- def target_attribute():
+def setter_context(interface, attribute, context):
+ if 'PutForwards' in attribute.extended_attributes:
+ # Use target interface and attribute in place of original interface and
+ # attribute from this point onwards.
target_interface_name = attribute.idl_type.base_type
- target_attribute_name = extended_attributes['PutForwards']
- target_interface = interfaces[target_interface_name]
+ target_attribute_name = attribute.extended_attributes['PutForwards']
+ interface = interfaces[target_interface_name]
try:
- return next(attribute
- for attribute in target_interface.attributes
- if attribute.name == target_attribute_name)
+ attribute = next(candidate
+ for candidate in interface.attributes
+ if candidate.name == target_attribute_name)
except StopIteration:
raise Exception('[PutForward] target not found:\n'
'Attribute "%s" is not present in interface "%s"' %
(target_attribute_name, target_interface_name))
extended_attributes = attribute.extended_attributes
+ idl_type = attribute.idl_type
- if 'PutForwards' in extended_attributes:
- # Use target attribute in place of original attribute
- attribute = target_attribute()
+ # [RaisesException], [RaisesException=Setter]
+ is_setter_raises_exception = (
+ 'RaisesException' in extended_attributes and
+ extended_attributes['RaisesException'] in [None, 'Setter'])
+ # [TypeChecking=Interface]
+ has_type_checking_interface = (
+ (has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
+ has_extended_attribute_value(attribute, 'TypeChecking', 'Interface')) and
+ idl_type.is_wrapper_type)
- contents.update({
- 'cpp_setter': setter_expression(interface, attribute, contents),
- 'v8_value_to_local_cpp_value': attribute.idl_type.v8_value_to_local_cpp_value(extended_attributes, 'v8Value', 'cppValue'),
+ context.update({
+ 'has_setter_exception_state':
+ is_setter_raises_exception or has_type_checking_interface or
+ context['has_type_checking_unrestricted'] or
+ idl_type.may_raise_exception_on_conversion,
+ 'has_type_checking_interface': has_type_checking_interface,
+ 'is_setter_call_with_execution_context': v8_utilities.has_extended_attribute_value(
+ attribute, 'SetterCallWith', 'ExecutionContext'),
+ 'is_setter_raises_exception': is_setter_raises_exception,
+ 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
+ 'cppValue', isolate='scriptState->isolate()',
+ creation_context='scriptState->context()->Global()'),
+ 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
+ extended_attributes, 'v8Value', 'cppValue'),
})
+ # setter_expression() depends on context values we set above.
+ context['cpp_setter'] = setter_expression(interface, attribute, context)
-def setter_expression(interface, attribute, contents):
+
+def setter_expression(interface, attribute, context):
extended_attributes = attribute.extended_attributes
arguments = v8_utilities.call_with_arguments(
extended_attributes.get('SetterCallWith') or
@@ -321,25 +356,30 @@
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in extended_attributes and
+ not 'ImplementedInPrivateScript' in extended_attributes and
not attribute.is_static):
arguments.append('*impl')
idl_type = attribute.idl_type
- if idl_type.base_type == 'EventHandler':
+ if 'ImplementedInPrivateScript' in extended_attributes:
+ arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())')
+ arguments.append('impl')
+ arguments.append('cppValue')
+ elif idl_type.base_type == 'EventHandler':
getter_name = scoped_name(interface, attribute, cpp_name(attribute))
- contents['event_handler_getter_expression'] = '%s(%s)' % (
+ context['event_handler_getter_expression'] = '%s(%s)' % (
getter_name, ', '.join(arguments))
if (interface.name in ['Window', 'WorkerGlobalScope'] and
attribute.name == 'onerror'):
- includes.add('bindings/v8/V8ErrorHandler.h')
+ includes.add('bindings/core/v8/V8ErrorHandler.h')
arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(v8Value, true, V8ScriptState::current(info.GetIsolate()))')
else:
arguments.append('V8EventListenerList::getEventListener(V8ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)')
- elif idl_type.is_interface_type and not idl_type.array_type:
+ elif idl_type.is_interface_type:
# FIXME: should be able to eliminate WTF::getPtr in most or all cases
arguments.append('WTF::getPtr(cppValue)')
else:
arguments.append('cppValue')
- if contents['is_setter_raises_exception']:
+ if context['is_setter_raises_exception']:
arguments.append('exceptionState')
return '%s(%s)' % (setter_name, ', '.join(arguments))
@@ -353,6 +393,9 @@
def setter_base_name(interface, attribute, arguments):
+ if 'ImplementedInPrivateScript' in attribute.extended_attributes:
+ return '%sAttributeSetter' % uncapitalize(cpp_name(attribute))
+
if 'Reflect' not in attribute.extended_attributes:
return 'set%s' % capitalize(cpp_name(attribute))
arguments.append(scoped_content_attribute_name(interface, attribute))
@@ -365,8 +408,17 @@
def scoped_content_attribute_name(interface, attribute):
content_attribute_name = attribute.extended_attributes['Reflect'] or attribute.name.lower()
- namespace = 'SVGNames' if interface.name.startswith('SVG') else 'HTMLNames'
- includes.add('%s.h' % namespace)
+ if interface.name.startswith('SVG'):
+ # SVG's xmlbase/xmlspace/xmllang need special behavior, i.e.
+ # it is in XMLNames namespace and the generated attribute has no xml prefix.
+ if attribute.name.startswith('xml'):
+ namespace = 'XMLNames'
+ content_attribute_name = content_attribute_name[3:]
+ else:
+ namespace = 'SVGNames'
+ else:
+ namespace = 'HTMLNames'
+ includes.add('core/%s.h' % namespace)
return '%s::%sAttr' % (namespace, content_attribute_name)
@@ -381,8 +433,7 @@
if (('Replaceable' in extended_attributes and
'PutForwards' not in extended_attributes) or
is_constructor_attribute(attribute)):
- # FIXME: rename to ForceSetAttributeOnThisCallback, since also used for Constructors
- return '{0}V8Internal::{0}ReplaceableAttributeSetterCallback'.format(cpp_class_name)
+ return '{0}V8Internal::{0}ForceSetAttributeOnThisCallback'.format(cpp_class_name)
if attribute.is_read_only and 'PutForwards' not in extended_attributes:
return '0'
return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribute.name)
@@ -418,6 +469,21 @@
return property_attributes_list or ['v8::None']
+# [Custom], [Custom=Getter]
+def has_custom_getter(attribute):
+ extended_attributes = attribute.extended_attributes
+ return ('Custom' in extended_attributes and
+ extended_attributes['Custom'] in [None, 'Getter'])
+
+
+# [Custom], [Custom=Setter]
+def has_custom_setter(attribute):
+ extended_attributes = attribute.extended_attributes
+ return (not attribute.is_read_only and
+ 'Custom' in extended_attributes and
+ extended_attributes['Custom'] in [None, 'Setter'])
+
+
################################################################################
# Constructors
################################################################################
@@ -429,8 +495,8 @@
def is_constructor_attribute(attribute):
# FIXME: replace this with [ConstructorAttribute] extended attribute
- return attribute.idl_type.base_type.endswith('Constructor')
+ return attribute.idl_type.name.endswith('Constructor')
-def generate_constructor_getter(interface, attribute, contents):
- contents['needs_constructor_getter_callback'] = contents['measure_as'] or contents['deprecate_as']
+def constructor_getter_context(interface, attribute, context):
+ context['needs_constructor_getter_callback'] = context['measure_as'] or context['deprecate_as']
diff --git a/bindings/scripts/v8_callback_interface.py b/bindings/scripts/v8_callback_interface.py
index b1e21d9..eafdba8 100644
--- a/bindings/scripts/v8_callback_interface.py
+++ b/bindings/scripts/v8_callback_interface.py
@@ -28,24 +28,24 @@
"""Generate template values for a callback interface.
-Extends IdlType with property |callback_cpp_type|.
+Extends IdlTypeBase with property |callback_cpp_type|.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
-from idl_types import IdlType
+from idl_types import IdlTypeBase
from v8_globals import includes
import v8_types
import v8_utilities
CALLBACK_INTERFACE_H_INCLUDES = frozenset([
- 'bindings/v8/ActiveDOMCallback.h',
- 'bindings/v8/DOMWrapperWorld.h',
- 'bindings/v8/ScopedPersistent.h',
+ 'bindings/core/v8/ActiveDOMCallback.h',
+ 'bindings/core/v8/DOMWrapperWorld.h',
+ 'bindings/core/v8/ScopedPersistent.h',
])
CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
- 'bindings/v8/V8Binding.h',
- 'bindings/v8/V8Callback.h',
+ 'bindings/core/v8/ScriptController.h',
+ 'bindings/core/v8/V8Binding.h',
'core/dom/ExecutionContext.h',
'wtf/Assertions.h',
'wtf/GetPtr.h',
@@ -61,16 +61,16 @@
return 'const String&'
if idl_type_name == 'void':
return 'void'
- # Callbacks use raw pointers, so used_as_argument=True
- usual_cpp_type = idl_type.cpp_type_args(used_as_argument=True)
- if usual_cpp_type.startswith(('Vector', 'HeapVector', 'WillBeHeapVector')):
- return 'const %s&' % usual_cpp_type
- return usual_cpp_type
+ # Callbacks use raw pointers, so raw_type=True
+ raw_cpp_type = idl_type.cpp_type_args(raw_type=True)
+ if raw_cpp_type.startswith(('Vector', 'HeapVector', 'WillBeHeapVector')):
+ return 'const %s&' % raw_cpp_type
+ return raw_cpp_type
-IdlType.callback_cpp_type = property(cpp_type)
+IdlTypeBase.callback_cpp_type = property(cpp_type)
-def generate_callback_interface(callback_interface):
+def callback_interface_context(callback_interface):
includes.clear()
includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
return {
@@ -78,7 +78,7 @@
'cpp_class': callback_interface.name,
'v8_class': v8_utilities.v8_class_name(callback_interface),
'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
- 'methods': [generate_method(operation)
+ 'methods': [method_context(operation)
for operation in callback_interface.operations
if not v8_utilities.dart_custom_method(operation.extended_attributes)],
}
@@ -90,7 +90,7 @@
argument.idl_type.add_includes_for_type()
-def generate_method(operation):
+def method_context(operation):
extended_attributes = operation.extended_attributes
idl_type = operation.idl_type
idl_type_str = str(idl_type)
@@ -101,27 +101,24 @@
add_includes_for_operation(operation)
call_with = extended_attributes.get('CallWith')
call_with_this_handle = v8_utilities.extended_attribute_value_contains(call_with, 'ThisValue')
- contents = {
+ context = {
'call_with_this_handle': call_with_this_handle,
'cpp_type': idl_type.callback_cpp_type,
- 'custom': is_custom,
'idl_type': idl_type_str,
+ 'is_custom': is_custom,
'name': operation.name,
}
- contents.update(generate_arguments_contents(operation.arguments, call_with_this_handle))
- return contents
+ context.update(arguments_context(operation.arguments,
+ call_with_this_handle))
+ return context
-def generate_arguments_contents(arguments, call_with_this_handle):
- def generate_argument(argument):
+def arguments_context(arguments, call_with_this_handle):
+ def argument_context(argument):
return {
'handle': '%sHandle' % argument.name,
- # FIXME: setting creation_context=v8::Handle<v8::Object>() is
- # wrong, as toV8 then implicitly uses the current context, which
- # causes leaks between isolated worlds if a different context is
- # used.
'cpp_value_to_v8_value': argument.idl_type.cpp_value_to_v8_value(
- argument.name, isolate='isolate',
+ argument.name, isolate='m_scriptState->isolate()',
creation_context='m_scriptState->context()->Global()'),
}
@@ -131,5 +128,5 @@
for argument in arguments)
return {
'argument_declarations': argument_declarations,
- 'arguments': [generate_argument(argument) for argument in arguments],
+ 'arguments': [argument_context(argument) for argument in arguments],
}
diff --git a/bindings/scripts/v8_dictionary.py b/bindings/scripts/v8_dictionary.py
new file mode 100644
index 0000000..6dc772f
--- /dev/null
+++ b/bindings/scripts/v8_dictionary.py
@@ -0,0 +1,135 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Generate template contexts of dictionaries for both v8 bindings and
+implementation classes that are used by blink's core/modules.
+"""
+
+import copy
+import operator
+from v8_globals import includes
+import v8_types
+import v8_utilities
+
+
+DICTIONARY_H_INCLUDES = frozenset([
+ 'bindings/core/v8/V8Binding.h',
+ 'platform/heap/Handle.h',
+])
+
+DICTIONARY_CPP_INCLUDES = frozenset([
+ # FIXME: Remove this, http://crbug.com/321462
+ 'bindings/core/v8/Dictionary.h',
+])
+
+
+def setter_name_for_dictionary_member(member):
+ return 'set%s' % v8_utilities.capitalize(member.name)
+
+
+def has_method_name_for_dictionary_member(member):
+ return 'has%s' % v8_utilities.capitalize(member.name)
+
+
+# Context for V8 bindings
+
+def dictionary_context(dictionary):
+ includes.clear()
+ includes.update(DICTIONARY_CPP_INCLUDES)
+ return {
+ 'cpp_class': v8_utilities.cpp_name(dictionary),
+ 'header_includes': set(DICTIONARY_H_INCLUDES),
+ 'members': [member_context(member)
+ for member in sorted(dictionary.members,
+ key=operator.attrgetter('name'))],
+ 'v8_class': v8_utilities.v8_class_name(dictionary),
+ }
+
+
+def member_context(member):
+ idl_type = member.idl_type
+ idl_type.add_includes_for_type()
+
+ def idl_type_for_default_value():
+ copied_type = copy.copy(idl_type)
+ # IdlType for default values shouldn't be nullable. Otherwise,
+ # it will generate meaningless expression like
+ # 'String("default value").isNull() ? ...'.
+ copied_type.is_nullable = False
+ return copied_type
+
+ def default_values():
+ if not member.default_value:
+ return None, None
+ if member.default_value.is_null:
+ return None, 'v8::Null(isolate)'
+ cpp_default_value = str(member.default_value)
+ v8_default_value = idl_type_for_default_value().cpp_value_to_v8_value(
+ cpp_value=cpp_default_value, isolate='isolate',
+ creation_context='creationContext')
+ return cpp_default_value, v8_default_value
+
+ cpp_default_value, v8_default_value = default_values()
+
+ return {
+ 'cpp_default_value': cpp_default_value,
+ 'cpp_type': idl_type.cpp_type,
+ 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
+ cpp_value='impl->%s()' % member.name, isolate='isolate',
+ creation_context='creationContext',
+ extended_attributes=member.extended_attributes),
+ 'has_method_name': has_method_name_for_dictionary_member(member),
+ 'name': member.name,
+ 'setter_name': setter_name_for_dictionary_member(member),
+ 'v8_default_value': v8_default_value,
+ }
+
+
+# Context for implementation classes
+
+def dictionary_impl_context(dictionary, interfaces_info):
+ includes.clear()
+ header_includes = set(['platform/heap/Handle.h'])
+ return {
+ 'header_includes': header_includes,
+ 'cpp_class': v8_utilities.cpp_name(dictionary),
+ 'members': [member_impl_context(member, interfaces_info,
+ header_includes)
+ for member in dictionary.members],
+ }
+
+
+def member_impl_context(member, interfaces_info, header_includes):
+ idl_type = member.idl_type
+
+ def getter_expression():
+ if idl_type.impl_should_use_nullable_container:
+ return 'm_%s.get()' % member.name
+ return 'm_%s' % member.name
+
+ def has_method_expression():
+ if (idl_type.impl_should_use_nullable_container or
+ idl_type.is_string_type):
+ return '!m_%s.isNull()' % member.name
+ else:
+ return 'm_%s' % member.name
+
+ def member_cpp_type():
+ member_cpp_type = idl_type.cpp_type_args(used_in_cpp_sequence=True)
+ if idl_type.impl_should_use_nullable_container:
+ return v8_types.cpp_template_type('Nullable', member_cpp_type)
+ return member_cpp_type
+
+ header_includes.update(idl_type.impl_includes_for_type(interfaces_info))
+ return {
+ 'getter_expression': getter_expression(),
+ 'has_method_expression': has_method_expression(),
+ 'has_method_name': has_method_name_for_dictionary_member(member),
+ 'is_traceable': (idl_type.is_garbage_collected or
+ idl_type.is_will_be_garbage_collected),
+ 'member_cpp_type': member_cpp_type(),
+ 'name': member.name,
+ 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
+ 'setter_name': setter_name_for_dictionary_member(member),
+ }
diff --git a/bindings/scripts/v8_interface.py b/bindings/scripts/v8_interface.py
index 02f0860..2980628 100644
--- a/bindings/scripts/v8_interface.py
+++ b/bindings/scripts/v8_interface.py
@@ -36,6 +36,8 @@
import itertools
from operator import itemgetter
+import idl_definitions
+from idl_definitions import IdlOperation
import idl_types
from idl_types import IdlType, inherits_interface
import v8_attributes
@@ -48,16 +50,17 @@
INTERFACE_H_INCLUDES = frozenset([
- 'bindings/v8/V8Binding.h',
- 'bindings/v8/V8DOMWrapper.h',
- 'bindings/v8/WrapperTypeInfo.h',
+ 'bindings/common/ScriptWrappable.h',
+ 'bindings/core/v8/V8Binding.h',
+ 'bindings/core/v8/V8DOMWrapper.h',
+ 'bindings/core/v8/WrapperTypeInfo.h',
'platform/heap/Handle.h',
])
INTERFACE_CPP_INCLUDES = frozenset([
- 'bindings/v8/V8ExceptionState.h',
- 'bindings/v8/V8DOMConfiguration.h',
- 'bindings/v8/V8HiddenValue.h',
- 'bindings/v8/V8ObjectConstructor.h',
+ 'bindings/core/v8/V8ExceptionState.h',
+ 'bindings/core/v8/V8DOMConfiguration.h',
+ 'bindings/core/v8/V8HiddenValue.h',
+ 'bindings/core/v8/V8ObjectConstructor.h',
'core/dom/ContextFeatures.h',
'core/dom/Document.h',
'platform/RuntimeEnabledFeatures.h',
@@ -67,7 +70,7 @@
])
-def generate_interface(interface):
+def interface_context(interface):
includes.clear()
includes.update(INTERFACE_CPP_INCLUDES)
header_includes = set(INTERFACE_H_INCLUDES)
@@ -83,8 +86,8 @@
is_document = inherits_interface(interface.name, 'Document')
if is_document:
- includes.update(['bindings/v8/ScriptController.h',
- 'bindings/v8/V8WindowShell.h',
+ includes.update(['bindings/core/v8/ScriptController.h',
+ 'bindings/core/v8/WindowProxy.h',
'core/frame/LocalFrame.h'])
# [ActiveDOMObject]
@@ -106,14 +109,14 @@
# [SetWrapperReferenceFrom]
reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
if reachable_node_function:
- includes.update(['bindings/v8/V8GCController.h',
+ includes.update(['bindings/core/v8/V8GCController.h',
'core/dom/Element.h'])
# [SetWrapperReferenceTo]
set_wrapper_reference_to_list = [{
'name': argument.name,
# FIXME: properly should be:
- # 'cpp_type': argument.idl_type.cpp_type_args(used_as_argument=True),
+ # 'cpp_type': argument.idl_type.cpp_type_args(raw_type=True),
# (if type is non-wrapper type like NodeFilter, normally RefPtr)
# Raw pointers faster though, and NodeFilter hacky anyway.
'cpp_type': argument.idl_type.implemented_as + '*',
@@ -139,7 +142,7 @@
this_gc_type = gc_type(interface)
- template_contents = {
+ context = {
'conditional_string': conditional_string(interface), # [Conditional]
'cpp_class': cpp_name(interface),
'gc_type': this_gc_type,
@@ -175,14 +178,14 @@
}
# Constructors
- constructors = [generate_constructor(interface, constructor)
+ constructors = [constructor_context(interface, constructor)
for constructor in interface.constructors
# FIXME: shouldn't put named constructors with constructors
# (currently needed for Perl compatibility)
# Handle named constructors separately
if constructor.name == 'Constructor']
if len(constructors) > 1:
- template_contents['constructor_overloads'] = generate_overloads(constructors)
+ context['constructor_overloads'] = overloads_context(constructors)
# [CustomConstructor]
custom_constructors = [{ # Only needed for computing interface length
@@ -195,65 +198,76 @@
any_type_attributes = [attribute for attribute in interface.attributes
if attribute.idl_type.name == 'Any']
if has_event_constructor:
- includes.add('bindings/common/Dictionary.h')
+ includes.add('bindings/core/v8/Dictionary.h')
if any_type_attributes:
- includes.add('bindings/v8/SerializedScriptValue.h')
+ includes.add('bindings/core/v8/SerializedScriptValue.h')
# [NamedConstructor]
- named_constructor = generate_named_constructor(interface)
+ named_constructor = named_constructor_context(interface)
if (constructors or custom_constructors or has_event_constructor or
named_constructor):
- includes.add('bindings/v8/V8ObjectConstructor.h')
+ includes.add('bindings/core/v8/V8ObjectConstructor.h')
includes.add('core/frame/LocalDOMWindow.h')
- template_contents.update({
+ context.update({
'any_type_attributes': any_type_attributes,
'constructors': constructors,
'has_custom_constructor': bool(custom_constructors),
'has_event_constructor': has_event_constructor,
'interface_length':
interface_length(interface, constructors + custom_constructors),
- 'is_constructor_call_with_document': has_extended_attribute_value(
- interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWith=Document]
- 'is_constructor_call_with_execution_context': has_extended_attribute_value(
- interface, 'ConstructorCallWith', 'ExecutionContext'), # [ConstructorCallWith=ExeuctionContext]
'is_constructor_raises_exception': extended_attributes.get('RaisesException') == 'Constructor', # [RaisesException=Constructor]
'named_constructor': named_constructor,
})
# Constants
- template_contents.update({
- 'constants': [generate_constant(constant) for constant in interface.constants],
+ context.update({
+ 'constants': [constant_context(constant)
+ for constant in interface.constants],
'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes,
})
# Attributes
- attributes = [v8_attributes.generate_attribute(interface, attribute)
+ attributes = [v8_attributes.attribute_context(interface, attribute)
for attribute in interface.attributes
if not v8_utilities.dart_custom_method(attribute.extended_attributes)]
- template_contents.update({
+ context.update({
'attributes': attributes,
- 'has_accessors': any(attribute['is_expose_js_accessors'] for attribute in attributes),
+ 'has_accessors': any(attribute['is_expose_js_accessors'] and attribute['should_be_exposed_to_script'] for attribute in attributes),
'has_attribute_configuration': any(
not (attribute['is_expose_js_accessors'] or
attribute['is_static'] or
attribute['runtime_enabled_function'] or
attribute['per_context_enabled_function'])
+ and attribute['should_be_exposed_to_script']
for attribute in attributes),
+ 'has_conditional_attributes': any(attribute['per_context_enabled_function'] or attribute['exposed_test'] for attribute in attributes),
'has_constructor_attributes': any(attribute['constructor_type'] for attribute in attributes),
- 'has_per_context_enabled_attributes': any(attribute['per_context_enabled_function'] for attribute in attributes),
'has_replaceable_attributes': any(attribute['is_replaceable'] for attribute in attributes),
})
# Methods
- methods = [v8_methods.generate_method(interface, method)
+ methods = [v8_methods.method_context(interface, method)
for method in interface.operations
if (method.name and # Skip anonymous special operations (methods)
not v8_utilities.dart_custom_method(method.extended_attributes))]
- generate_method_overloads(methods)
+ compute_method_overloads_context(methods)
- per_context_enabled_methods = []
+ # Stringifier
+ if interface.stringifier:
+ stringifier = interface.stringifier
+ method = IdlOperation(interface.idl_name)
+ method.name = 'toString'
+ method.idl_type = IdlType('DOMString')
+ method.extended_attributes.update(stringifier.extended_attributes)
+ if stringifier.attribute:
+ method.extended_attributes['ImplementedAs'] = stringifier.attribute.name
+ elif stringifier.operation:
+ method.extended_attributes['ImplementedAs'] = stringifier.operation.name
+ methods.append(v8_methods.method_context(interface, method))
+
+ conditionally_enabled_methods = []
custom_registration_methods = []
method_configuration_methods = []
@@ -265,20 +279,23 @@
if 'overloads' in method:
overloads = method['overloads']
per_context_enabled_function = overloads['per_context_enabled_function_all']
+ conditionally_exposed_function = overloads['exposed_test_all']
runtime_enabled_function = overloads['runtime_enabled_function_all']
has_custom_registration = overloads['has_custom_registration_all']
else:
per_context_enabled_function = method['per_context_enabled_function']
+ conditionally_exposed_function = method['exposed_test']
runtime_enabled_function = method['runtime_enabled_function']
has_custom_registration = method['has_custom_registration']
- if per_context_enabled_function:
- per_context_enabled_methods.append(method)
+ if per_context_enabled_function or conditionally_exposed_function:
+ conditionally_enabled_methods.append(method)
continue
if runtime_enabled_function or has_custom_registration:
custom_registration_methods.append(method)
continue
- method_configuration_methods.append(method)
+ if method['should_be_exposed_to_script']:
+ method_configuration_methods.append(method)
for method in methods:
# The value of the Function object’s “length” property is a Number
@@ -295,17 +312,19 @@
method['length'] = (method['overloads']['minarg'] if 'overloads' in method else
method['number_of_required_arguments'])
- template_contents.update({
+ context.update({
+ 'conditionally_enabled_methods': conditionally_enabled_methods,
'custom_registration_methods': custom_registration_methods,
'has_origin_safe_method_setter': any(
method['is_check_security_for_frame'] and not method['is_read_only']
for method in methods),
+ 'has_private_script': any(attribute['is_implemented_in_private_script'] for attribute in attributes) or
+ any(method['is_implemented_in_private_script'] for method in methods),
'method_configuration_methods': method_configuration_methods,
- 'per_context_enabled_methods': per_context_enabled_methods,
'methods': methods,
})
- template_contents.update({
+ context.update({
'indexed_property_getter': indexed_property_getter(interface),
'indexed_property_setter': indexed_property_setter(interface),
'indexed_property_deleter': indexed_property_deleter(interface),
@@ -315,11 +334,11 @@
'named_property_deleter': named_property_deleter(interface),
})
- return template_contents
+ return context
# [DeprecateAs], [Reflect], [RuntimeEnabled]
-def generate_constant(constant):
+def constant_context(constant):
# (Blink-only) string literals are unquoted in tokenizer, must be re-quoted
# in C++.
if constant.idl_type.name == 'String':
@@ -330,6 +349,7 @@
extended_attributes = constant.extended_attributes
return {
'cpp_class': extended_attributes.get('PartialInterfaceImplementedAs'),
+ 'idl_type': constant.idl_type.name,
'name': constant.name,
# FIXME: use 'reflected_name' as correct 'name'
'reflected_name': extended_attributes.get('Reflect', constant.name),
@@ -342,17 +362,17 @@
# Overloads
################################################################################
-def generate_method_overloads(methods):
+def compute_method_overloads_context(methods):
# Regular methods
- generate_overloads_by_type([method for method in methods
- if not method['is_static']])
+ compute_method_overloads_context_by_type([method for method in methods
+ if not method['is_static']])
# Static methods
- generate_overloads_by_type([method for method in methods
- if method['is_static']])
+ compute_method_overloads_context_by_type([method for method in methods
+ if method['is_static']])
-def generate_overloads_by_type(methods):
- """Generates |method.overload*| template values.
+def compute_method_overloads_context_by_type(methods):
+ """Computes |method.overload*| template values.
Called separately for static and non-static (regular) methods,
as these are overloaded separately.
@@ -365,7 +385,7 @@
for name, overloads in method_overloads_by_name(methods):
# Resolution function is generated after last overloaded function;
# package necessary information into |method.overloads| for that method.
- overloads[-1]['overloads'] = generate_overloads(overloads)
+ overloads[-1]['overloads'] = overloads_context(overloads)
overloads[-1]['overloads']['name'] = name
@@ -383,7 +403,7 @@
return sort_and_groupby(overloaded_methods, itemgetter('name'))
-def generate_overloads(overloads):
+def overloads_context(overloads):
"""Returns |overloads| template values for a single name.
Sets |method.overload_index| in place for |method| in |overloads|
@@ -424,13 +444,14 @@
return {
'deprecate_all_as': common_value(overloads, 'deprecate_as'), # [DeprecateAs]
+ 'exposed_test_all': common_value(overloads, 'exposed_test'), # [Exposed]
+ 'has_custom_registration_all': common_value(overloads, 'has_custom_registration'),
'length_tests_methods': length_tests_methods(effective_overloads_by_length),
- 'minarg': lengths[0],
# 1. Let maxarg be the length of the longest type list of the
# entries in S.
'maxarg': lengths[-1],
'measure_all_as': common_value(overloads, 'measure_as'), # [MeasureAs]
- 'has_custom_registration_all': common_value(overloads, 'has_custom_registration'),
+ 'minarg': lengths[0],
'per_context_enabled_function_all': common_value(overloads, 'per_context_enabled_function'), # [PerContextEnabled]
'runtime_enabled_function_all': common_value(overloads, 'runtime_enabled_function'), # [RuntimeEnabled]
'valid_arities': lengths
@@ -705,7 +726,7 @@
for idl_type, method in ((idl_type, method)
for idl_type, method in idl_types_methods
if idl_type.is_wrapper_type):
- test = 'V8{idl_type}::hasInstance({cpp_value}, isolate)'.format(idl_type=idl_type.base_type, cpp_value=cpp_value)
+ test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.format(idl_type=idl_type.base_type, cpp_value=cpp_value)
yield test, method
# 8. Otherwise: if V is any kind of object except for a native Date object,
@@ -720,9 +741,9 @@
# http://crbug.com/321462
idl_type, method = next((idl_type, method)
for idl_type, method in idl_types_methods
- if (idl_type.array_or_sequence_type or
+ if (idl_type.native_array_element_type or
idl_type.name == 'Dictionary'))
- if idl_type.array_or_sequence_type:
+ if idl_type.native_array_element_type:
# (We test for Array instead of generic Object to type-check.)
# FIXME: test for Object during resolution, then have type check for
# Array in overloaded method: http://crbug.com/262383
@@ -740,7 +761,7 @@
# only needed if distinguishing between primitive types.)
if len([idl_type.is_primitive_type for idl_type in idl_types]) > 1:
# (Only needed if match in step 11, otherwise redundant.)
- if any(idl_type.name == 'String' or idl_type.is_enum
+ if any(idl_type.is_string_type or idl_type.is_enum
for idl_type in idl_types):
# 10. Otherwise: if V is a Number value, and there is an entry in S
# that has one of the following types at position i of its type
@@ -762,15 +783,12 @@
# 11. Otherwise: if there is an entry in S that has one of the following
# types at position i of its type list,
# • DOMString
+ # • ByteString
+ # • ScalarValueString [a DOMString typedef, per definition.]
# • an enumeration type
- # * ByteString
- # Blink: ScalarValueString is a pending Web IDL addition
try:
method = next(method for idl_type, method in idl_types_methods
- if idl_type.name in ('String',
- 'ByteString',
- 'ScalarValueString') or
- idl_type.is_enum)
+ if idl_type.is_string_type or idl_type.is_enum)
yield 'true', method
except StopIteration:
pass
@@ -839,12 +857,16 @@
################################################################################
# [Constructor]
-def generate_constructor(interface, constructor):
- arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument)
+def constructor_context(interface, constructor):
+ arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument, return_promise=False)
for argument in constructor.arguments)
+ # [RaisesException=Constructor]
+ is_constructor_raises_exception = \
+ interface.extended_attributes.get('RaisesException') == 'Constructor'
+
return {
- 'arguments': [v8_methods.generate_argument(interface, constructor, argument, index)
+ 'arguments': [v8_methods.argument_context(interface, constructor, argument, index)
for index, argument in enumerate(constructor.arguments)],
'arguments_need_try_catch': arguments_need_try_catch,
'cpp_type': cpp_template_type(
@@ -853,20 +875,28 @@
'cpp_value': v8_methods.cpp_value(
interface, constructor, len(constructor.arguments)),
'has_exception_state':
- # [RaisesException=Constructor]
- interface.extended_attributes.get('RaisesException') == 'Constructor' or
+ is_constructor_raises_exception or
any(argument for argument in constructor.arguments
if argument.idl_type.name == 'SerializedScriptValue' or
- argument.idl_type.is_integer_type),
+ argument.idl_type.may_raise_exception_on_conversion),
+ 'is_call_with_document':
+ # [ConstructorCallWith=Document]
+ has_extended_attribute_value(interface,
+ 'ConstructorCallWith', 'Document'),
+ 'is_call_with_execution_context':
+ # [ConstructorCallWith=ExecutionContext]
+ has_extended_attribute_value(interface,
+ 'ConstructorCallWith', 'ExecutionContext'),
'is_constructor': True,
'is_named_constructor': False,
+ 'is_raises_exception': is_constructor_raises_exception,
'number_of_required_arguments':
number_of_required_arguments(constructor),
}
# [NamedConstructor]
-def generate_named_constructor(interface):
+def named_constructor_context(interface):
extended_attributes = interface.extended_attributes
if 'NamedConstructor' not in extended_attributes:
return None
@@ -875,12 +905,12 @@
# for Perl compatibility
idl_constructor = interface.constructors[-1]
assert idl_constructor.name == 'NamedConstructor'
- constructor = generate_constructor(interface, idl_constructor)
- constructor.update({
+ context = constructor_context(interface, idl_constructor)
+ context.update({
'name': extended_attributes['NamedConstructor'],
'is_named_constructor': True,
})
- return constructor
+ return context
def number_of_required_arguments(constructor):
@@ -906,8 +936,10 @@
def property_getter(getter, cpp_arguments):
def is_null_expression(idl_type):
if idl_type.is_union_type:
- return ' && '.join('!result%sEnabled' % i
- for i, _ in enumerate(idl_type.member_types))
+ notnull = ' || '.join([
+ member_argument['null_check_value']
+ for member_argument in idl_type.union_arguments])
+ return '!(%s)' % notnull
if idl_type.name == 'String':
return 'result.isNull()'
if idl_type.is_interface_type:
@@ -925,7 +957,8 @@
cpp_arguments.append('exceptionState')
union_arguments = idl_type.union_arguments
if union_arguments:
- cpp_arguments.extend(union_arguments)
+ cpp_arguments.extend([member_argument['cpp_value']
+ for member_argument in union_arguments])
cpp_value = '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
diff --git a/bindings/scripts/v8_methods.py b/bindings/scripts/v8_methods.py
index 38baa7b..16fceaa 100644
--- a/bindings/scripts/v8_methods.py
+++ b/bindings/scripts/v8_methods.py
@@ -28,12 +28,14 @@
"""Generate template values for methods.
-Extends IdlType and IdlUnionType with property |union_arguments|.
+Extends IdlArgument with property |default_cpp_value|.
+Extends IdlTypeBase and IdlUnionType with property |union_arguments|.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
-from idl_types import IdlType, IdlUnionType, inherits_interface
+from idl_definitions import IdlArgument
+from idl_types import IdlTypeBase, IdlUnionType, inherits_interface
from v8_globals import includes
import v8_types
import v8_utilities
@@ -46,14 +48,13 @@
'DoNotCheckSecurity',
'DoNotCheckSignature',
'NotEnumerable',
- 'ReadOnly',
'Unforgeable',
])
-def argument_needs_try_catch(argument):
+def argument_needs_try_catch(argument, return_promise):
idl_type = argument.idl_type
- base_type = not idl_type.array_or_sequence_type and idl_type.base_type
+ base_type = idl_type.base_type
return not (
# These cases are handled by separate code paths in the
@@ -62,17 +63,29 @@
base_type == 'SerializedScriptValue' or
(argument.is_variadic and idl_type.is_wrapper_type) or
# String and enumeration arguments converted using one of the
- # TOSTRING_* macros in Source/bindings/v8/V8BindingMacros.h don't
- # use a v8::TryCatch.
- (base_type == 'DOMString' and not argument.is_variadic))
+ # TOSTRING_* macros except for _PROMISE variants in
+ # Source/bindings/core/v8/V8BindingMacros.h don't use a v8::TryCatch.
+ (base_type == 'DOMString' and not argument.is_variadic and
+ not return_promise))
-def generate_method(interface, method):
+def use_local_result(method):
+ extended_attributes = method.extended_attributes
+ idl_type = method.idl_type
+ return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or
+ 'ImplementedInPrivateScript' in extended_attributes or
+ 'RaisesException' in extended_attributes or
+ idl_type.is_union_type or
+ idl_type.is_explicit_nullable)
+
+
+def method_context(interface, method):
arguments = method.arguments
extended_attributes = method.extended_attributes
idl_type = method.idl_type
is_static = method.is_static
name = method.name
+ return_promise = idl_type.name == 'Promise'
idl_type.add_includes_for_type()
this_cpp_value = cpp_value(interface, method, len(arguments))
@@ -84,13 +97,22 @@
return 'instanceTemplate'
return 'prototypeTemplate'
+ is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_attributes
+ if is_implemented_in_private_script:
+ includes.add('bindings/core/v8/PrivateScriptRunner.h')
+ includes.add('core/frame/LocalFrame.h')
+ includes.add('platform/ScriptForbiddenScope.h')
+
+ # [OnlyExposedToPrivateScript]
+ is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended_attributes
+
is_call_with_script_arguments = has_extended_attribute_value(method, 'CallWith', 'ScriptArguments')
if is_call_with_script_arguments:
- includes.update(['bindings/v8/ScriptCallStackFactory.h',
+ includes.update(['bindings/core/v8/ScriptCallStackFactory.h',
'core/inspector/ScriptArguments.h'])
is_call_with_script_state = has_extended_attribute_value(method, 'CallWith', 'ScriptState')
if is_call_with_script_state:
- includes.add('bindings/v8/V8ScriptState.h')
+ includes.add('bindings/core/v8/V8ScriptState.h')
is_check_security_for_node = 'CheckSecurity' in extended_attributes
if is_check_security_for_node:
includes.add('bindings/common/BindingSecurity.h')
@@ -98,43 +120,43 @@
if is_custom_element_callbacks:
includes.add('core/dom/custom/CustomElementCallbackDispatcher.h')
- has_event_listener_argument = any(
- argument for argument in arguments
- if argument.idl_type.name == 'EventListener')
is_check_security_for_frame = (
'CheckSecurity' in interface.extended_attributes and
'DoNotCheckSecurity' not in extended_attributes)
is_raises_exception = 'RaisesException' in extended_attributes
- arguments_need_try_catch = any(argument_needs_try_catch(argument)
- for argument in arguments)
+ arguments_need_try_catch = (
+ any(argument_needs_try_catch(argument, return_promise)
+ for argument in arguments))
return {
'activity_logging_world_list': v8_utilities.activity_logging_world_list(method), # [ActivityLogging]
- 'arguments': [generate_argument(interface, method, argument, index)
+ 'arguments': [argument_context(interface, method, argument, index)
for index, argument in enumerate(arguments)],
+ 'argument_declarations_for_private_script':
+ argument_declarations_for_private_script(interface, method),
'arguments_need_try_catch': arguments_need_try_catch,
'conditional_string': v8_utilities.conditional_string(method),
- 'cpp_type': idl_type.cpp_type,
+ 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type)
+ if idl_type.is_explicit_nullable else idl_type.cpp_type),
'cpp_value': this_cpp_value,
+ 'cpp_type_initializer': idl_type.cpp_type_initializer,
'custom_registration_extended_attributes':
CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES.intersection(
extended_attributes.iterkeys()),
'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs]
+ 'exposed_test': v8_utilities.exposed(method, interface), # [Exposed]
'function_template': function_template(),
'has_custom_registration': is_static or
v8_utilities.has_extended_attribute(
method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES),
- 'has_event_listener_argument': has_event_listener_argument,
'has_exception_state':
- has_event_listener_argument or
is_raises_exception or
is_check_security_for_frame or
+ interface.name == 'EventTarget' or # FIXME: merge with is_check_security_for_frame http://crbug.com/383699
any(argument for argument in arguments
- if argument.idl_type.name in ('ByteString',
- 'ScalarValueString',
- 'SerializedScriptValue') or
- argument.idl_type.is_integer_type),
+ if argument.idl_type.name == 'SerializedScriptValue' or
+ argument.idl_type.may_raise_exception_on_conversion),
'idl_type': idl_type.base_type,
'is_call_with_execution_context': has_extended_attribute_value(method, 'CallWith', 'ExecutionContext'),
'is_call_with_script_arguments': is_call_with_script_arguments,
@@ -145,11 +167,13 @@
'is_custom_element_callbacks': is_custom_element_callbacks,
'is_do_not_check_security': 'DoNotCheckSecurity' in extended_attributes,
'is_do_not_check_signature': 'DoNotCheckSignature' in extended_attributes,
+ 'is_explicit_nullable': idl_type.is_explicit_nullable,
+ 'is_implemented_in_private_script': is_implemented_in_private_script,
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
'is_raises_exception': is_raises_exception,
- 'is_read_only': 'ReadOnly' in extended_attributes,
+ 'is_read_only': 'Unforgeable' in extended_attributes,
'is_static': is_static,
'is_variadic': arguments and arguments[-1].is_variadic,
'measure_as': v8_utilities.measure_as(method), # [MeasureAs]
@@ -161,36 +185,47 @@
'number_of_required_or_variadic_arguments': len([
argument for argument in arguments
if not argument.is_optional]),
+ 'only_exposed_to_private_script': is_only_exposed_to_private_script,
'per_context_enabled_function': v8_utilities.per_context_enabled_function_name(method), # [PerContextEnabled]
+ 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
+ extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->isolate()', used_in_private_script=True),
'property_attributes': property_attributes(method),
'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(method), # [RuntimeEnabled]
+ 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSignature' in extended_attributes else 'defaultSignature',
'union_arguments': idl_type.union_arguments,
- 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
+ 'use_local_result': use_local_result(method),
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
- 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended_attributes else [''], # [PerWorldBindings]
+ 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
+ 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended_attributes else [''], # [PerWorldBindings],
}
-def generate_argument(interface, method, argument, index):
+def argument_context(interface, method, argument, index):
extended_attributes = argument.extended_attributes
idl_type = argument.idl_type
this_cpp_value = cpp_value(interface, method, index)
is_variadic_wrapper_type = argument.is_variadic and idl_type.is_wrapper_type
+ return_promise = (method.idl_type.name == 'Promise' if method.idl_type
+ else False)
+
+ if ('ImplementedInPrivateScript' in extended_attributes and
+ not idl_type.is_wrapper_type and
+ not idl_type.is_basic_type):
+ raise Exception('Private scripts supports only primitive types and DOM wrappers.')
return {
'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attributes,
- used_as_argument=True,
+ raw_type=True,
used_as_variadic_argument=argument.is_variadic),
+ 'cpp_type_initializer': idl_type.cpp_type_initializer,
'cpp_value': this_cpp_value,
# FIXME: check that the default value's type is compatible with the argument's
- 'default_value': str(argument.default_value) if argument.default_value else None,
+ 'default_value': argument.default_cpp_value,
'enum_validation_expression': idl_type.enum_validation_expression,
+ 'handle': '%sHandle' % argument.name,
# FIXME: remove once [Default] removed and just use argument.default_value
'has_default': 'Default' in extended_attributes or argument.default_value,
- 'has_event_listener_argument': any(
- argument_so_far for argument_so_far in method.arguments[:index]
- if argument_so_far.idl_type.name == 'EventListener'),
'has_type_checking_interface':
(has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
has_extended_attribute_value(method, 'TypeChecking', 'Interface')) and
@@ -200,7 +235,7 @@
has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted')) and
idl_type.name in ('Float', 'Double'),
# Dictionary is special-cased, but arrays and sequences shouldn't be
- 'idl_type': not idl_type.array_or_sequence_type and idl_type.base_type,
+ 'idl_type': idl_type.base_type,
'idl_type_object': idl_type,
'index': index,
'is_clamp': 'Clamp' in extended_attributes,
@@ -208,15 +243,28 @@
'is_nullable': idl_type.is_nullable,
'is_optional': argument.is_optional,
'is_variadic_wrapper_type': is_variadic_wrapper_type,
- 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc_type),
'is_wrapper_type': idl_type.is_wrapper_type,
'name': argument.name,
- 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
+ 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
+ argument.name, isolate='scriptState->isolate()',
+ creation_context='scriptState->context()->Global()'),
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
- 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, index),
+ 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
+ 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, index, return_promise=return_promise),
+ 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc_type),
}
+def argument_declarations_for_private_script(interface, method):
+ argument_declarations = ['LocalFrame* frame']
+ argument_declarations.append('%s* holderImpl' % interface.name)
+ argument_declarations.extend(['%s %s' % (argument.idl_type.cpp_type_args(
+ used_as_rvalue_type=True), argument.name) for argument in method.arguments])
+ if method.idl_type.name != 'void':
+ argument_declarations.append('%s* %s' % (method.idl_type.cpp_type, 'result'))
+ return argument_declarations
+
+
################################################################################
# Value handling
################################################################################
@@ -225,14 +273,10 @@
def cpp_argument(argument):
idl_type = argument.idl_type
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 or
- idl_type.name in ['NodeFilter', 'XPathNSResolver']):
+ idl_type.name in ['NodeFilter', 'NodeFilterOrNull',
+ 'XPathNSResolver', 'XPathNSResolverOrNull']):
# FIXME: remove this special case
return '%s.release()' % argument.name
return argument.name
@@ -240,23 +284,34 @@
# Truncate omitted optional arguments
arguments = method.arguments[:number_of_arguments]
cpp_arguments = []
+ if 'ImplementedInPrivateScript' in method.extended_attributes:
+ cpp_arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())')
+ cpp_arguments.append('impl')
+
if method.is_constructor:
call_with_values = interface.extended_attributes.get('ConstructorCallWith')
else:
call_with_values = method.extended_attributes.get('CallWith')
cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))
+
# Members of IDL partial interface definitions are implemented in C++ as
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in method.extended_attributes and
+ not 'ImplementedInPrivateScript' in method.extended_attributes and
not method.is_static):
cpp_arguments.append('*impl')
cpp_arguments.extend(cpp_argument(argument) for argument in arguments)
+
this_union_arguments = method.idl_type and method.idl_type.union_arguments
if this_union_arguments:
- cpp_arguments.extend(this_union_arguments)
+ cpp_arguments.extend([member_argument['cpp_value']
+ for member_argument in this_union_arguments])
- if ('RaisesException' in method.extended_attributes or
+ if 'ImplementedInPrivateScript' in method.extended_attributes:
+ if method.idl_type.name != 'void':
+ cpp_arguments.append('&result')
+ elif ('RaisesException' in method.extended_attributes or
(method.is_constructor and
has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
cpp_arguments.append('exceptionState')
@@ -265,6 +320,8 @@
base_name = 'create'
elif method.name == 'NamedConstructor':
base_name = 'createForJSConstructor'
+ elif 'ImplementedInPrivateScript' in method.extended_attributes:
+ base_name = '%sMethod' % method.name
else:
base_name = v8_utilities.cpp_name(method)
@@ -279,47 +336,54 @@
# Constructors and void methods don't have a return type
return None
+ if ('ImplementedInPrivateScript' in extended_attributes and
+ not idl_type.is_wrapper_type and
+ not idl_type.is_basic_type):
+ raise Exception('Private scripts supports only primitive types and DOM wrappers.')
+
release = False
# [CallWith=ScriptState], [RaisesException]
- if (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or
- 'RaisesException' in extended_attributes or
- idl_type.is_union_type):
- cpp_value = 'result' # use local variable for value
+ if use_local_result(method):
+ if idl_type.is_explicit_nullable:
+ # result is of type Nullable<T>
+ cpp_value = 'result.get()'
+ else:
+ cpp_value = 'result'
release = idl_type.release
script_wrappable = 'impl' if inherits_interface(interface_name, 'Node') else ''
return idl_type.v8_set_return_value(cpp_value, extended_attributes, script_wrappable=script_wrappable, release=release, for_main_world=for_main_world)
-def v8_value_to_local_cpp_variadic_value(argument, index):
+def v8_value_to_local_cpp_variadic_value(argument, index, return_promise):
assert argument.is_variadic
idl_type = argument.idl_type
- macro = 'TONATIVE_VOID_INTERNAL'
+ suffix = ''
+
+ macro = 'TONATIVE_VOID'
macro_args = [
argument.name,
'toNativeArguments<%s>(info, %s)' % (idl_type.cpp_type, index),
]
- return '%s(%s)' % (macro, ', '.join(macro_args))
+ if return_promise:
+ suffix += '_PROMISE'
+ macro_args.append('info')
+
+ suffix += '_INTERNAL'
+
+ return '%s%s(%s)' % (macro, suffix, ', '.join(macro_args))
-def v8_value_to_local_cpp_value(argument, index):
+def v8_value_to_local_cpp_value(argument, index, return_promise=False):
extended_attributes = argument.extended_attributes
idl_type = argument.idl_type
name = argument.name
if argument.is_variadic:
- return v8_value_to_local_cpp_variadic_value(argument, index)
- # FIXME: This special way of handling string arguments with null defaults
- # can go away once we fully support default values.
- if (argument.is_optional and
- idl_type.name in ('String', 'ByteString', 'ScalarValueString') and
- argument.default_value and argument.default_value.is_null):
- v8_value = 'argumentOrNull(info, %s)' % index
- else:
- v8_value = 'info[%s]' % index
- return idl_type.v8_value_to_local_cpp_value(extended_attributes, v8_value,
- name, index=index, declare_variable=False)
+ return v8_value_to_local_cpp_variadic_value(argument, index, return_promise)
+ return idl_type.v8_value_to_local_cpp_value(extended_attributes, 'info[%s]' % index,
+ name, index=index, declare_variable=False, return_promise=return_promise)
################################################################################
@@ -332,18 +396,49 @@
property_attributes_list = []
if 'NotEnumerable' in extended_attributes:
property_attributes_list.append('v8::DontEnum')
- if 'ReadOnly' in extended_attributes:
+ if 'Unforgeable' in extended_attributes:
property_attributes_list.append('v8::ReadOnly')
if property_attributes_list:
property_attributes_list.insert(0, 'v8::DontDelete')
return property_attributes_list
-def union_arguments(idl_type):
- """Return list of ['result0Enabled', 'result0', 'result1Enabled', ...] for union types, for use in setting return value"""
- return [arg
- for i in range(len(idl_type.member_types))
- for arg in ['result%sEnabled' % i, 'result%s' % i]]
+def union_member_argument_context(idl_type, index):
+ """Returns a context of union member for argument."""
+ this_cpp_value = 'result%d' % index
+ this_cpp_type = idl_type.cpp_type
+ cpp_return_value = this_cpp_value
-IdlType.union_arguments = property(lambda self: None)
+ if not idl_type.cpp_type_has_null_value:
+ this_cpp_type = v8_types.cpp_template_type('Nullable', this_cpp_type)
+ cpp_return_value = '%s.get()' % this_cpp_value
+
+ if idl_type.is_string_type:
+ null_check_value = '!%s.isNull()' % this_cpp_value
+ else:
+ null_check_value = this_cpp_value
+
+ return {
+ 'cpp_type': this_cpp_type,
+ 'cpp_value': this_cpp_value,
+ 'null_check_value': null_check_value,
+ 'v8_set_return_value': idl_type.v8_set_return_value(
+ cpp_value=cpp_return_value,
+ release=idl_type.release),
+ }
+
+
+def union_arguments(idl_type):
+ return [union_member_argument_context(member_idl_type, index)
+ for index, member_idl_type
+ in enumerate(idl_type.member_types)]
+
+
+def argument_default_cpp_value(argument):
+ if not argument.default_value:
+ return None
+ return argument.idl_type.literal_cpp_value(argument.default_value)
+
+IdlTypeBase.union_arguments = None
IdlUnionType.union_arguments = property(union_arguments)
+IdlArgument.default_cpp_value = property(argument_default_cpp_value)
diff --git a/bindings/scripts/v8_types.py b/bindings/scripts/v8_types.py
index 50e512b..1ee093a 100644
--- a/bindings/scripts/v8_types.py
+++ b/bindings/scripts/v8_types.py
@@ -39,7 +39,7 @@
import posixpath
-from idl_types import IdlType, IdlUnionType
+from idl_types import IdlTypeBase, IdlType, IdlUnionType, IdlArrayOrSequenceType
import v8_attributes # for IdlType.constructor_type_name
from v8_globals import includes
@@ -72,10 +72,12 @@
'Uint32Array': ('unsigned int', 'v8::kExternalUnsignedIntArray'),
}
-IdlType.is_typed_array_type = property(
+IdlTypeBase.is_typed_array_element_type = False
+IdlType.is_typed_array_element_type = property(
lambda self: self.base_type in TYPED_ARRAYS)
+IdlTypeBase.is_wrapper_type = False
IdlType.is_wrapper_type = property(
lambda self: (self.is_interface_type and
self.base_type not in NON_WRAPPER_TYPES))
@@ -119,7 +121,7 @@
}
-def cpp_type(idl_type, extended_attributes=None, used_as_argument=False, used_as_variadic_argument=False, used_in_cpp_sequence=False):
+def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_type=False, used_as_variadic_argument=False, used_in_cpp_sequence=False):
"""Returns C++ type corresponding to IDL type.
|idl_type| argument is of type IdlType, while return value is a string
@@ -127,31 +129,40 @@
Args:
idl_type:
IdlType
- used_as_argument:
+ raw_type:
bool, True if idl_type's raw/primitive C++ type should be returned.
+ used_as_rvalue_type:
+ bool, True if the C++ type is used as an argument or the return
+ type of a method.
+ used_as_variadic_argument:
+ bool, True if the C++ type is used as a variadic argument of a method.
used_in_cpp_sequence:
- bool, True if the C++ type is used as an element of an array or sequence.
+ bool, True if the C++ type is used as an element of a container.
+ Containers can be an array, a sequence or a dictionary.
"""
def string_mode():
- # FIXME: the Web IDL spec requires 'EmptyString', not 'NullString',
- # but we use NullString for performance.
- if extended_attributes.get('TreatNullAs') != 'NullString':
- return ''
- if extended_attributes.get('TreatUndefinedAs') != 'NullString':
- return 'WithNullCheck'
- return 'WithUndefinedOrNullCheck'
+ if extended_attributes.get('TreatNullAs') == 'EmptyString':
+ return 'TreatNullAsEmptyString'
+ if idl_type.is_nullable or extended_attributes.get('TreatNullAs') == 'NullString':
+ if extended_attributes.get('TreatUndefinedAs') == 'NullString':
+ return 'TreatNullAndUndefinedAsNullString'
+ return 'TreatNullAsNullString'
+ return ''
extended_attributes = extended_attributes or {}
idl_type = idl_type.preprocessed_type
- # Composite types
+ # Array or sequence types
if used_as_variadic_argument:
- array_or_sequence_type = idl_type
+ native_array_element_type = idl_type
else:
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- vector_type = cpp_ptr_type('Vector', 'HeapVector', array_or_sequence_type.gc_type)
- return cpp_template_type(vector_type, array_or_sequence_type.cpp_type_args(used_in_cpp_sequence=True))
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ vector_type = cpp_ptr_type('Vector', 'HeapVector', native_array_element_type.gc_type)
+ vector_template_type = cpp_template_type(vector_type, native_array_element_type.cpp_type_args(used_in_cpp_sequence=True))
+ if used_as_rvalue_type:
+ return 'const %s&' % vector_template_type
+ return vector_template_type
# Simple types
base_idl_type = idl_type.base_type
@@ -166,36 +177,65 @@
return CPP_SPECIAL_CONVERSION_RULES[base_idl_type]
if base_idl_type in NON_WRAPPER_TYPES:
- return 'RefPtr<%s>' % base_idl_type
- if base_idl_type in ('DOMString', 'ByteString', 'ScalarValueString'):
- if not used_as_argument:
+ return ('PassRefPtr<%s>' if used_as_rvalue_type else 'RefPtr<%s>') % base_idl_type
+ if idl_type.is_string_type:
+ if not raw_type:
return 'String'
return 'V8StringResource<%s>' % string_mode()
- if idl_type.is_typed_array_type and used_as_argument:
+ if idl_type.is_typed_array_element_type and raw_type:
return base_idl_type + '*'
if idl_type.is_interface_type:
implemented_as_class = idl_type.implemented_as
- if used_as_argument:
+ if raw_type:
return implemented_as_class + '*'
new_type = 'Member' if used_in_cpp_sequence else 'RawPtr'
- ptr_type = cpp_ptr_type('RefPtr', new_type, idl_type.gc_type)
+ ptr_type = cpp_ptr_type(('PassRefPtr' if used_as_rvalue_type else 'RefPtr'), new_type, idl_type.gc_type)
return cpp_template_type(ptr_type, implemented_as_class)
# Default, assume native type is a pointer with same type name as idl type
return base_idl_type + '*'
-def cpp_type_union(idl_type, extended_attributes=None, used_as_argument=False):
- return (member_type.cpp_type for member_type in idl_type.member_types)
+def cpp_type_initializer(idl_type):
+ """Returns a string containing a C++ initialization statement for the
+ corresponding type.
+
+ |idl_type| argument is of type IdlType.
+ """
+
+ if (idl_type.is_numeric_type):
+ return ' = 0'
+ if idl_type.base_type == 'boolean':
+ return ' = false'
+ if idl_type.base_type == 'Promise':
+ return '(nullptr)'
+ return ''
+
+
+def cpp_type_union(idl_type, extended_attributes=None, raw_type=False):
+ # FIXME: Need to revisit the design of union support.
+ # http://crbug.com/240176
+ return None
+
+
+def cpp_type_initializer_union(idl_type):
+ return (member_type.cpp_type_initializer for member_type in idl_type.member_types)
# Allow access as idl_type.cpp_type if no arguments
-IdlType.cpp_type = property(cpp_type)
+IdlTypeBase.cpp_type = property(cpp_type)
+IdlTypeBase.cpp_type_initializer = property(cpp_type_initializer)
+IdlTypeBase.cpp_type_args = cpp_type
IdlUnionType.cpp_type = property(cpp_type_union)
-IdlType.cpp_type_args = cpp_type
+IdlUnionType.cpp_type_initializer = property(cpp_type_initializer_union)
IdlUnionType.cpp_type_args = cpp_type_union
+IdlTypeBase.native_array_element_type = None
+IdlArrayOrSequenceType.native_array_element_type = property(
+ lambda self: self.element_type)
+
+
def cpp_template_type(template, inner_type):
"""Returns C++ template specialized to type, with space added if needed."""
if inner_type.endswith('>'):
@@ -247,6 +287,7 @@
# [GarbageCollected]
IdlType.garbage_collected_types = set()
+IdlTypeBase.is_garbage_collected = False
IdlType.is_garbage_collected = property(
lambda self: self.base_type in IdlType.garbage_collected_types)
@@ -258,6 +299,7 @@
# [WillBeGarbageCollected]
IdlType.will_be_garbage_collected_types = set()
+IdlTypeBase.is_will_be_garbage_collected = False
IdlType.is_will_be_garbage_collected = property(
lambda self: self.base_type in IdlType.will_be_garbage_collected_types)
@@ -273,7 +315,7 @@
return 'WillBeGarbageCollectedObject'
return 'RefCountedObject'
-IdlType.gc_type = property(gc_type)
+IdlTypeBase.gc_type = property(gc_type)
################################################################################
@@ -287,11 +329,11 @@
INCLUDES_FOR_TYPE = {
'object': set(),
'CompareHow': set(),
- 'Dictionary': set(['bindings/common/Dictionary.h']),
- 'EventHandler': set(['bindings/v8/V8AbstractEventListener.h',
- 'bindings/v8/V8EventListenerList.h']),
+ 'Dictionary': set(['bindings/core/v8/Dictionary.h']),
+ 'EventHandler': set(['bindings/core/v8/V8AbstractEventListener.h',
+ 'bindings/core/v8/V8EventListenerList.h']),
'EventListener': set(['bindings/common/BindingSecurity.h',
- 'bindings/v8/V8EventListenerList.h',
+ 'bindings/core/v8/V8EventListenerList.h',
'core/frame/LocalDOMWindow.h']),
'HTMLCollection': set(['bindings/core/v8/V8HTMLCollection.h',
'core/dom/ClassCollection.h',
@@ -305,8 +347,8 @@
'core/dom/NodeList.h',
'core/dom/StaticNodeList.h',
'core/html/LabelsNodeList.h']),
- 'Promise': set(['bindings/v8/ScriptPromise.h']),
- 'SerializedScriptValue': set(['bindings/v8/SerializedScriptValue.h']),
+ 'Promise': set(['bindings/core/v8/V8ScriptPromise.h']),
+ 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h']),
'ScriptValue': set(['bindings/common/ScriptValue.h']),
}
@@ -314,19 +356,14 @@
def includes_for_type(idl_type):
idl_type = idl_type.preprocessed_type
- # Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- return includes_for_type(array_or_sequence_type)
-
# Simple types
base_idl_type = idl_type.base_type
if base_idl_type in INCLUDES_FOR_TYPE:
return INCLUDES_FOR_TYPE[base_idl_type]
if idl_type.is_basic_type:
return set()
- if idl_type.is_typed_array_type:
- return set(['bindings/v8/custom/V8%sCustom.h' % base_idl_type])
+ if idl_type.is_typed_array_element_type:
+ return set(['bindings/core/v8/custom/V8%sCustom.h' % base_idl_type])
if base_idl_type.endswith('ConstructorConstructor'):
# FIXME: rename to NamedConstructor
# FIXME: replace with a [NamedConstructorAttribute] extended attribute
@@ -337,6 +374,8 @@
if base_idl_type.endswith('Constructor'):
# FIXME: replace with a [ConstructorAttribute] extended attribute
base_idl_type = idl_type.constructor_type_name
+ if base_idl_type not in component_dir:
+ return set()
return set(['bindings/%s/v8/V8%s.h' % (component_dir[base_idl_type],
base_idl_type)])
@@ -344,13 +383,14 @@
IdlUnionType.includes_for_type = property(
lambda self: set.union(*[includes_for_type(member_type)
for member_type in self.member_types]))
+IdlArrayOrSequenceType.includes_for_type = property(
+ lambda self: self.element_type.includes_for_type)
def add_includes_for_type(idl_type):
includes.update(idl_type.includes_for_type)
-IdlType.add_includes_for_type = add_includes_for_type
-IdlUnionType.add_includes_for_type = add_includes_for_type
+IdlTypeBase.add_includes_for_type = add_includes_for_type
def includes_for_interface(interface_name):
@@ -360,11 +400,41 @@
def add_includes_for_interface(interface_name):
includes.update(includes_for_interface(interface_name))
+
+def impl_should_use_nullable_container(idl_type):
+ return not(idl_type.cpp_type_has_null_value)
+
+IdlTypeBase.impl_should_use_nullable_container = property(
+ impl_should_use_nullable_container)
+
+
+def impl_includes_for_type(idl_type, interfaces_info):
+ includes_for_type = set()
+ if idl_type.impl_should_use_nullable_container:
+ includes_for_type.add('bindings/common/Nullable.h')
+
+ idl_type = idl_type.preprocessed_type
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ includes_for_type.update(impl_includes_for_type(
+ native_array_element_type, interfaces_info))
+ includes_for_type.add('wtf/Vector.h')
+
+ if idl_type.is_string_type:
+ includes_for_type.add('wtf/text/WTFString.h')
+ if idl_type.name in interfaces_info:
+ interface_info = interfaces_info[idl_type.name]
+ includes_for_type.add(interface_info['include_path'])
+ return includes_for_type
+
+IdlTypeBase.impl_includes_for_type = impl_includes_for_type
+
+
component_dir = {}
def set_component_dirs(new_component_dirs):
- component_dir.update(new_component_dirs)
+ component_dir.update(new_component_dirs)
################################################################################
@@ -392,23 +462,26 @@
'unsigned long long': 'toUInt64({arguments})',
# Interface types
'CompareHow': 'static_cast<Range::CompareHow>({v8_value}->Int32Value())',
- 'Dictionary': 'Dictionary({v8_value}, info.GetIsolate())',
+ 'Dictionary': 'Dictionary({v8_value}, {isolate})',
'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::Cast({v8_value})) : 0',
- 'MediaQueryListListener': 'MediaQueryListListener::create(V8ScriptState::current(info.GetIsolate()), ScriptValue(V8ScriptState::current(info.GetIsolate()), {v8_value}))',
- 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), V8ScriptState::current(info.GetIsolate()))',
- 'Promise': 'ScriptPromise::cast(V8ScriptState::current(info.GetIsolate()), {v8_value})',
- 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, info.GetIsolate())',
- 'ScriptValue': 'ScriptValue(V8ScriptState::current(info.GetIsolate()), {v8_value})',
- 'Window': 'toDOMWindow({v8_value}, info.GetIsolate())',
- 'XPathNSResolver': 'toXPathNSResolver({v8_value}, info.GetIsolate())',
+ 'MediaQueryListListener': 'MediaQueryListListener::create(V8ScriptState::current({isolate}), ScriptValue(V8ScriptState::current({isolate}), {v8_value}))',
+ 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), V8ScriptState::current({isolate}))',
+ 'Promise': 'V8ScriptPromise::cast(V8ScriptState::current({isolate}), {v8_value})',
+ 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, {isolate})',
+ 'ScriptValue': 'ScriptValue(V8ScriptState::current({isolate}), {v8_value})',
+ 'Window': 'toDOMWindow({v8_value}, {isolate})',
+ 'XPathNSResolver': 'toXPathNSResolver({v8_value}, {isolate})',
}
-def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index):
- # Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- return v8_value_to_cpp_value_array_or_sequence(array_or_sequence_type, v8_value, index)
+def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate):
+ if idl_type.name == 'void':
+ return ''
+
+ # Array or sequence types
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ return v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, index)
# Simple types
idl_type = idl_type.preprocessed_type
@@ -417,66 +490,80 @@
if 'EnforceRange' in extended_attributes:
arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState'])
- elif (idl_type.is_integer_type or # NormalConversion
- idl_type.name in ('ByteString', 'ScalarValueString')):
+ elif idl_type.may_raise_exception_on_conversion:
arguments = ', '.join([v8_value, 'exceptionState'])
else:
arguments = v8_value
if base_idl_type in V8_VALUE_TO_CPP_VALUE:
cpp_expression_format = V8_VALUE_TO_CPP_VALUE[base_idl_type]
- elif idl_type.is_typed_array_type:
+ elif idl_type.is_typed_array_element_type:
cpp_expression_format = (
'{v8_value}->Is{idl_type}() ? '
'V8{idl_type}::toNative(v8::Handle<v8::{idl_type}>::Cast({v8_value})) : 0')
+ elif idl_type.is_dictionary:
+ cpp_expression_format = 'V8{idl_type}::toNative({isolate}, {v8_value})'
else:
cpp_expression_format = (
- 'V8{idl_type}::toNativeWithTypeCheck(info.GetIsolate(), {v8_value})')
+ 'V8{idl_type}::toNativeWithTypeCheck({isolate}, {v8_value})')
- return cpp_expression_format.format(arguments=arguments, idl_type=base_idl_type, v8_value=v8_value)
+ return cpp_expression_format.format(arguments=arguments, idl_type=base_idl_type, v8_value=v8_value, isolate=isolate)
-def v8_value_to_cpp_value_array_or_sequence(array_or_sequence_type, v8_value, index):
+def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, index, isolate='info.GetIsolate()'):
# Index is None for setters, index (starting at 0) for method arguments,
# and is used to provide a human-readable exception message
if index is None:
index = 0 # special case, meaning "setter"
else:
index += 1 # human-readable index
- if (array_or_sequence_type.is_interface_type and
- array_or_sequence_type.name != 'Dictionary'):
+ if (native_array_element_type.is_interface_type and
+ native_array_element_type.name != 'Dictionary'):
this_cpp_type = None
- ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', array_or_sequence_type.gc_type)
- expression_format = '(to{ref_ptr_type}NativeArray<{array_or_sequence_type}, V8{array_or_sequence_type}>({v8_value}, {index}, info.GetIsolate()))'
- add_includes_for_type(array_or_sequence_type)
+ ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', native_array_element_type.gc_type)
+ expression_format = '(to{ref_ptr_type}NativeArray<{native_array_element_type}, V8{native_array_element_type}>({v8_value}, {index}, {isolate}))'
+ add_includes_for_type(native_array_element_type)
else:
ref_ptr_type = None
- this_cpp_type = array_or_sequence_type.cpp_type
- expression_format = 'toNativeArray<{cpp_type}>({v8_value}, {index}, info.GetIsolate())'
- expression = expression_format.format(array_or_sequence_type=array_or_sequence_type.name, cpp_type=this_cpp_type, index=index, ref_ptr_type=ref_ptr_type, v8_value=v8_value)
+ this_cpp_type = native_array_element_type.cpp_type
+ expression_format = 'toNativeArray<{cpp_type}>({v8_value}, {index}, {isolate})'
+ expression = expression_format.format(native_array_element_type=native_array_element_type.name, cpp_type=this_cpp_type, index=index, ref_ptr_type=ref_ptr_type, v8_value=v8_value, isolate=isolate)
return expression
-def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True):
+def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True, isolate='info.GetIsolate()', used_in_private_script=False, return_promise=False):
"""Returns an expression that converts a V8 value to a C++ value and stores it as a local value."""
- this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, used_as_argument=True)
+
+ # FIXME: Support union type.
+ if idl_type.is_union_type:
+ return ''
+
+ this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, raw_type=True)
idl_type = idl_type.preprocessed_type
- cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index)
+ cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate)
args = [variable_name, cpp_value]
- if idl_type.base_type == 'DOMString' and not idl_type.array_or_sequence_type:
- macro = 'TOSTRING_VOID'
- elif (idl_type.is_integer_type or
- idl_type.name in ('ByteString', 'ScalarValueString')):
- macro = 'TONATIVE_VOID_EXCEPTIONSTATE'
+ if idl_type.base_type == 'DOMString':
+ macro = 'TOSTRING_DEFAULT' if used_in_private_script else 'TOSTRING_VOID'
+ elif idl_type.may_raise_exception_on_conversion:
+ macro = 'TONATIVE_DEFAULT_EXCEPTIONSTATE' if used_in_private_script else 'TONATIVE_VOID_EXCEPTIONSTATE'
args.append('exceptionState')
else:
- macro = 'TONATIVE_VOID'
+ macro = 'TONATIVE_DEFAULT' if used_in_private_script else 'TONATIVE_VOID'
+
+ if used_in_private_script:
+ args.append('false')
# Macros come in several variants, to minimize expensive creation of
# v8::TryCatch.
suffix = ''
+ if return_promise:
+ suffix += '_PROMISE'
+ args.append('info')
+ if macro == 'TONATIVE_VOID_EXCEPTIONSTATE':
+ args.append('V8ScriptState::current(%s)' % isolate)
+
if declare_variable:
args.insert(0, this_cpp_type)
else:
@@ -484,9 +571,7 @@
return '%s(%s)' % (macro + suffix, ', '.join(args))
-
-IdlType.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
-IdlUnionType.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
+IdlTypeBase.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
################################################################################
@@ -501,8 +586,7 @@
return IdlType('ScriptValue')
return idl_type
-IdlType.preprocessed_type = property(preprocess_idl_type)
-IdlUnionType.preprocessed_type = property(preprocess_idl_type)
+IdlTypeBase.preprocessed_type = property(preprocess_idl_type)
def preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes):
@@ -523,7 +607,7 @@
idl_type.base_type in ['unsigned long', 'unsigned short']):
cpp_value = cpp_value.replace('getUnsignedIntegralAttribute',
'getIntegralAttribute')
- cpp_value = 'std::max(0, %s)' % cpp_value
+ cpp_value = 'std::max(0, static_cast<int>(%s))' % cpp_value
return idl_type, cpp_value
@@ -536,11 +620,15 @@
"""
extended_attributes = extended_attributes or {}
- # Composite types
- array_or_sequence_type = idl_type.array_or_sequence_type
- if array_or_sequence_type:
- if array_or_sequence_type.is_interface_type:
- add_includes_for_type(array_or_sequence_type)
+ # FIXME: Support union type.
+ if idl_type.is_union_type:
+ return ''
+
+ # Array or sequence types
+ native_array_element_type = idl_type.native_array_element_type
+ if native_array_element_type:
+ if native_array_element_type.is_interface_type:
+ add_includes_for_type(native_array_element_type)
return 'array'
# Simple types
@@ -550,7 +638,9 @@
return 'int'
if base_idl_type in CPP_UNSIGNED_TYPES:
return 'unsigned'
- if base_idl_type in ('DOMString', 'ByteString', 'ScalarValueString'):
+ if idl_type.is_string_type:
+ if idl_type.is_nullable:
+ return 'StringOrNull'
if 'TreatReturnedNullStringAs' not in extended_attributes:
return base_idl_type
treat_returned_null_string_as = extended_attributes['TreatReturnedNullStringAs']
@@ -558,7 +648,7 @@
return 'StringOrNull'
if treat_returned_null_string_as == 'Undefined':
return 'StringOrUndefined'
- raise 'Unrecognized TreatReturnNullStringAs value: "%s"' % treat_returned_null_string_as
+ raise 'Unrecognized TreatReturnedNullStringAs value: "%s"' % treat_returned_null_string_as
if idl_type.is_basic_type or base_idl_type == 'ScriptValue':
return base_idl_type
@@ -570,7 +660,7 @@
# Pointer type
return 'DOMWrapper'
-IdlType.v8_conversion_type = v8_conversion_type
+IdlTypeBase.v8_conversion_type = v8_conversion_type
V8_SET_RETURN_VALUE = {
@@ -580,7 +670,7 @@
'DOMString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
'ByteString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
'ScalarValueString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
- # [TreatNullReturnValueAs]
+ # [TreatReturnedNullStringAs]
'StringOrNull': 'v8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())',
'StringOrUndefined': 'v8SetReturnValueStringOrUndefined(info, {cpp_value}, info.GetIsolate())',
'void': '',
@@ -632,27 +722,19 @@
def v8_set_return_value_union(idl_type, cpp_value, extended_attributes=None, script_wrappable='', release=False, for_main_world=False):
- """
- release: can be either False (False for all member types) or
- a sequence (list or tuple) of booleans (if specified individually).
- """
+ # FIXME: Need to revisit the design of union support.
+ # http://crbug.com/240176
+ return None
- return [
- member_type.v8_set_return_value(cpp_value + str(i),
- extended_attributes,
- script_wrappable,
- release and release[i],
- for_main_world)
- for i, member_type in
- enumerate(idl_type.member_types)]
-IdlType.v8_set_return_value = v8_set_return_value
+IdlTypeBase.v8_set_return_value = v8_set_return_value
IdlUnionType.v8_set_return_value = v8_set_return_value_union
IdlType.release = property(lambda self: self.is_interface_type)
IdlUnionType.release = property(
lambda self: [member_type.is_interface_type
for member_type in self.member_types])
+IdlArrayOrSequenceType.release = False
CPP_VALUE_TO_V8_VALUE = {
@@ -669,6 +751,9 @@
'double': 'v8::Number::New({isolate}, {cpp_value})',
'unrestricted double': 'v8::Number::New({isolate}, {cpp_value})',
'void': 'v8Undefined()',
+ # [TreatReturnedNullStringAs]
+ 'StringOrNull': '{cpp_value}.isNull() ? v8::Handle<v8::Value>(v8::Null({isolate})) : v8String({isolate}, {cpp_value})',
+ 'StringOrUndefined': '{cpp_value}.isNull() ? v8Undefined() : v8String({isolate}, {cpp_value})',
# Special cases
'EventHandler': '{cpp_value} ? v8::Handle<v8::Value>(V8AbstractEventListener::cast({cpp_value})->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null({isolate}))',
'ScriptValue': '{cpp_value}.v8Value()',
@@ -688,4 +773,45 @@
statement = format_string.format(cpp_value=cpp_value, isolate=isolate, creation_context=creation_context)
return statement
-IdlType.cpp_value_to_v8_value = cpp_value_to_v8_value
+IdlTypeBase.cpp_value_to_v8_value = cpp_value_to_v8_value
+
+
+def literal_cpp_value(idl_type, idl_literal):
+ """Converts an expression that is a valid C++ literal for this type."""
+ # FIXME: add validation that idl_type and idl_literal are compatible
+ literal_value = str(idl_literal)
+ if idl_type.base_type in CPP_UNSIGNED_TYPES:
+ return literal_value + 'u'
+ return literal_value
+
+IdlType.literal_cpp_value = literal_cpp_value
+
+
+################################################################################
+# Utility properties for nullable types
+################################################################################
+
+
+def cpp_type_has_null_value(idl_type):
+ # - String types (String/AtomicString) represent null as a null string,
+ # i.e. one for which String::isNull() returns true.
+ # - Wrapper types (raw pointer or RefPtr/PassRefPtr) represent null as
+ # a null pointer.
+ return idl_type.is_string_type or idl_type.is_wrapper_type
+
+IdlTypeBase.cpp_type_has_null_value = property(cpp_type_has_null_value)
+
+
+def is_implicit_nullable(idl_type):
+ # Nullable type where the corresponding C++ type supports a null value.
+ return idl_type.is_nullable and idl_type.cpp_type_has_null_value
+
+
+def is_explicit_nullable(idl_type):
+ # Nullable type that isn't implicit nullable (see above.) For such types,
+ # we use Nullable<T> or similar explicit ways to represent a null value.
+ return idl_type.is_nullable and not idl_type.is_implicit_nullable
+
+IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable)
+IdlUnionType.is_implicit_nullable = False
+IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable)
diff --git a/bindings/scripts/v8_utilities.py b/bindings/scripts/v8_utilities.py
index 8067595..4a2b46a 100644
--- a/bindings/scripts/v8_utilities.py
+++ b/bindings/scripts/v8_utilities.py
@@ -28,14 +28,14 @@
"""Functions shared by various parts of the code generator.
-Extends IdlType and IdlUnion type with |enum_validation_expression| property.
+Extends IdlTypeBase type with |enum_validation_expression| property.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
import re
-from idl_types import IdlType, IdlUnionType
+from idl_types import IdlTypeBase
import idl_types
from v8_globals import includes
import v8_types
@@ -60,7 +60,7 @@
def extended_attribute_value_contains(extended_attribute_value, value):
return (extended_attribute_value and
- value in re.split('[|&]', extended_attribute_value))
+ value in re.split('[|,]', extended_attribute_value))
def has_extended_attribute(definition_or_member, extended_attribute_list):
@@ -74,6 +74,15 @@
extended_attribute_value_contains(extended_attributes[name], value))
+def sorted_extended_attribute_set(definition_or_member, name):
+ extended_attributes = definition_or_member.extended_attributes
+ if name not in extended_attributes:
+ return []
+
+ attribute_values = re.split('[|,]', extended_attributes[name])
+ return sorted(attribute_values)
+
+
################################################################################
# String handling
################################################################################
@@ -113,10 +122,12 @@
return None
return ' || '.join(['string == "%s"' % enum_value
for enum_value in idl_type.enum_values])
-IdlType.enum_validation_expression = property(enum_validation_expression)
+IdlTypeBase.enum_validation_expression = property(enum_validation_expression)
def scoped_name(interface, definition, base_name):
+ if 'ImplementedInPrivateScript' in definition.extended_attributes:
+ return '%s::PrivateScript::%s' % (v8_class_name(interface), base_name)
# partial interfaces are implemented as separate classes, with their members
# implemented as static member functions
partial_interface_implemented_as = definition.extended_attributes.get('PartialInterfaceImplementedAs')
@@ -149,7 +160,7 @@
if log_activity and not log_activity.startswith(access_type):
return set()
- includes.add('bindings/v8/V8DOMActivityLogger.h')
+ includes.add('bindings/core/v8/V8DOMActivityLogger.h')
if 'LogAllWorlds' in extended_attributes:
return set(['', 'ForMainWorld'])
return set(['']) # At minimum, include isolated worlds.
@@ -201,15 +212,21 @@
# [Conditional]
+DELIMITER_TO_OPERATOR = {
+ '|': '||',
+ ',': '&&',
+}
+
+
def conditional_string(definition_or_member):
extended_attributes = definition_or_member.extended_attributes
if 'Conditional' not in extended_attributes:
return None
conditional = extended_attributes['Conditional']
- for operator in '&|':
- if operator in conditional:
- conditions = conditional.split(operator)
- operator_separator = ' %s%s ' % (operator, operator)
+ for delimiter in ',|':
+ if delimiter in conditional:
+ conditions = conditional.split(delimiter)
+ operator_separator = ' %s ' % DELIMITER_TO_OPERATOR[delimiter]
return operator_separator.join('ENABLE(%s)' % expression for expression in sorted(conditions))
return 'ENABLE(%s)' % conditional
@@ -223,6 +240,48 @@
return extended_attributes['DeprecateAs']
+# [Exposed]
+EXPOSED_EXECUTION_CONTEXT_METHOD = {
+ 'DedicatedWorker': 'isDedicatedWorkerGlobalScope',
+ 'ServiceWorker': 'isServiceWorkerGlobalScope',
+ 'SharedWorker': 'isSharedWorkerGlobalScope',
+ 'Window': 'isDocument',
+ 'Worker': 'isWorkerGlobalScope',
+}
+
+
+def exposed(definition_or_member, interface):
+ exposure_set = sorted_extended_attribute_set(definition_or_member, 'Exposed')
+ if not exposure_set:
+ return None
+
+ interface_exposure_set = expanded_exposure_set_for_interface(interface)
+
+ # Methods must not be exposed to a broader scope than their interface.
+ if not set(exposure_set).issubset(interface_exposure_set):
+ raise ValueError('Interface members\' exposure sets must be a subset of the interface\'s.')
+
+ exposure_checks = []
+ for environment in exposure_set:
+ # Methods must be exposed on one of the scopes known to Blink.
+ if environment not in EXPOSED_EXECUTION_CONTEXT_METHOD:
+ raise ValueError('Values for the [Exposed] annotation must reflect to a valid exposure scope.')
+
+ exposure_checks.append('context->%s()' % EXPOSED_EXECUTION_CONTEXT_METHOD[environment])
+
+ return ' || '.join(exposure_checks)
+
+
+def expanded_exposure_set_for_interface(interface):
+ exposure_set = sorted_extended_attribute_set(interface, 'Exposed')
+
+ # "Worker" is an aggregation for the different kinds of workers.
+ if 'Worker' in exposure_set:
+ exposure_set.extend(('DedicatedWorker', 'SharedWorker', 'ServiceWorker'))
+
+ return sorted(set(exposure_set))
+
+
# [GarbageCollected], [WillBeGarbageCollected]
def gc_type(definition):
extended_attributes = definition.extended_attributes
diff --git a/bindings/tests/idls/TestDictionary.idl b/bindings/tests/idls/TestDictionary.idl
new file mode 100644
index 0000000..a05f0b8
--- /dev/null
+++ b/bindings/tests/idls/TestDictionary.idl
@@ -0,0 +1,20 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+[
+ GarbageCollected,
+] dictionary TestDictionary {
+ boolean booleanMember;
+ long longMember = 1;
+ DOMString stringMember;
+ TestInterface testInterfaceMember;
+ double? doubleOrNullMember = null;
+ DOMString? stringOrNullMember = "default string value";
+ TestInterface? testInterfaceOrNullMember;
+ TestInterfaceGarbageCollected testInterfaceGarbageCollectedMember;
+ TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullMember;
+ TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedMember;
+ TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullMember;
+ DOMString[] stringArrayMember;
+ sequence<DOMString> stringSequenceMember;
+};
diff --git a/bindings/tests/idls/TestInterface.idl b/bindings/tests/idls/TestInterface.idl
index 479b016..7dfed9a 100644
--- a/bindings/tests/idls/TestInterface.idl
+++ b/bindings/tests/idls/TestInterface.idl
@@ -39,7 +39,8 @@
ImplementedAs=TestInterfaceImplementation,
RuntimeEnabled=FeatureName,
SetWrapperReferenceTo(TestInterface referencedName),
- TypeChecking=Interface|Nullable|Unrestricted,
+ TypeChecking=Interface|Unrestricted,
+ Exposed=(Worker,Window),
] interface TestInterface : TestInterfaceEmpty {
// members needed to test [ImplementedAs], as this affect attribute
// configuration and method configuration, and [TypeChecking]
@@ -69,6 +70,23 @@
getter DOMString (DOMString name);
setter DOMString (DOMString name, DOMString value);
deleter boolean (DOMString name);
+
+ [NotEnumerable] stringifier;
+
+ // Per-method [Exposed] annotation support.
+ void alwaysExposedMethod();
+ [Exposed=Worker] void workerExposedMethod();
+ [Exposed=Window] void windowExposedMethod();
+
+ static void alwaysExposedStaticMethod();
+ [Exposed=Worker] static void workerExposedStaticMethod();
+ [Exposed=Window] static void windowExposedStaticMethod();
+
+ attribute long alwaysExposedAttribute;
+ [Exposed=Worker] attribute long workerExposedAttribute;
+ [Exposed=Window] attribute long windowExposedAttribute;
+
+ [Exposed=(Window,ServiceWorker)] void windowAndServiceWorkerExposedMethod();
};
TestInterface implements TestImplements;
diff --git a/bindings/tests/idls/TestInterface2.idl b/bindings/tests/idls/TestInterface2.idl
index bf9c112..8027826 100644
--- a/bindings/tests/idls/TestInterface2.idl
+++ b/bindings/tests/idls/TestInterface2.idl
@@ -49,4 +49,6 @@
[RaisesException] getter TestInterfaceEmpty namedItem(DOMString name);
[RaisesException] setter DOMString setNamedItem(DOMString name, DOMString value);
[RaisesException] deleter boolean deleteNamedItem(DOMString name);
+
+ stringifier DOMString stringifierMethod();
};
diff --git a/bindings/tests/idls/TestInterfaceCheckSecurity.idl b/bindings/tests/idls/TestInterfaceCheckSecurity.idl
index 0d20eb9..8fac9b8 100644
--- a/bindings/tests/idls/TestInterfaceCheckSecurity.idl
+++ b/bindings/tests/idls/TestInterfaceCheckSecurity.idl
@@ -40,6 +40,5 @@
[DoNotCheckSecurity] void doNotCheckSecurityVoidMethod();
[DoNotCheckSecurity, DoNotCheckSignature] void doNotCheckSecurityDoNotCheckSignatureVoidMethod();
[DoNotCheckSecurity, PerWorldBindings] void doNotCheckSecurityPerWorldBindingsVoidMethod();
- [DoNotCheckSecurity, ReadOnly] void doNotCheckSecurityReadOnlyVoidMethod();
[DoNotCheckSecurity, Unforgeable] void doNotCheckSecurityUnforgeableVoidMethod();
};
diff --git a/bindings/tests/idls/TestInterfaceConstructor.idl b/bindings/tests/idls/TestInterfaceConstructor.idl
index 102754e..f82e44c 100644
--- a/bindings/tests/idls/TestInterfaceConstructor.idl
+++ b/bindings/tests/idls/TestInterfaceConstructor.idl
@@ -40,7 +40,10 @@
sequence<Dictionary> sequenceDictionaryArg,
optional Dictionary optionalDictionaryArg,
[Default=Undefined] optional TestInterfaceEmpty optionalTestInterfaceEmptyArg),
- ConstructorCallWith=ExecutionContext&Document,
+ Constructor(DOMString arg, optional DOMString optArg),
+ Constructor(DOMString arg, DOMString arg2, DOMString arg3),
+ NamedConstructor=Audio(DOMString arg, optional DOMString optArg),
+ ConstructorCallWith=(ExecutionContext,Document),
MeasureAs=TestFeature,
RaisesException=Constructor,
] interface TestInterfaceConstructor {
diff --git a/bindings/tests/idls/TestInterfaceConstructor4.idl b/bindings/tests/idls/TestInterfaceConstructor4.idl
new file mode 100644
index 0000000..246f551
--- /dev/null
+++ b/bindings/tests/idls/TestInterfaceConstructor4.idl
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test for overload resolution for the string-like ScalarValueString
+// argument.
+[
+ Constructor(TestInterfaceConstructor4 testInterface4Arg),
+ Constructor(ScalarValueString scalarValueStringArg),
+] interface TestInterfaceConstructor4 {
+};
diff --git a/bindings/tests/idls/TestNode.idl b/bindings/tests/idls/TestNode.idl
index 301f7f0..0c767ee 100644
--- a/bindings/tests/idls/TestNode.idl
+++ b/bindings/tests/idls/TestNode.idl
@@ -24,5 +24,6 @@
// These attributes are needed to test [PutForwards] in TestObject.idl.
attribute DOMString href;
[RaisesException=Setter] attribute DOMString hrefThrows;
- [SetterCallWith=ActiveWindow&FirstWindow] attribute DOMString hrefCallWith;
+ [SetterCallWith=(ExecutionContext,ActiveWindow,FirstWindow)] attribute DOMString hrefCallWith;
+ attribute ByteString hrefByteString;
};
diff --git a/bindings/tests/idls/TestObject.idl b/bindings/tests/idls/TestObject.idl
index 8328c86..e76b5b9 100644
--- a/bindings/tests/idls/TestObject.idl
+++ b/bindings/tests/idls/TestObject.idl
@@ -33,16 +33,6 @@
callback VoidCallbackFunction = void ();
callback AnyCallbackFunctionOptionalAnyArg = any (optional any optionalAnyArg);
-dictionary TestDict {
- boolean booleanMember;
- long longMember1 = 1;
-};
-
-dictionary TestDictDerived : TestDict {
- unsigned short unsignedShortMember;
- float floatMember4 = 4.0;
-};
-
// No extended attributes on the interface; those go in TestInterface.idl
interface TestObject {
// Constants
@@ -61,12 +51,21 @@
const unsigned short CONST_VALUE_16 = -010;
const unsigned short CONST_VALUE_16 = -0x1A;
const unsigned short CONST_VALUE_17 = -0X1a;
+ const double CONST_VALUE_18 = 0.123;
+ const double CONST_VALUE_19 = 4e9;
+ const double CONST_VALUE_20 = 3.4e5;
+ const double CONST_VALUE_21 = -1.3;
+ const double CONST_VALUE_22 = -4e-9;
+ const double CONST_VALUE_23 = .123;
+ const double CONST_VALUE_24 = 5E+4;
+ const float CONST_VALUE_25 = 1;
// Extended attributes
[DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1;
[RuntimeEnabled=FeatureName] const short FEATURE_ENABLED_CONST = 1;
[Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1;
+ stringifier attribute DOMString stringifierAttribute;
// Attributes
//
@@ -162,12 +161,13 @@
[LogActivity=SetterOnly, LogAllWorlds] attribute long activityLoggingSetterForAllWorldsLongAttribute;
[CachedAttribute=isValueDirty] attribute any cachedAttributeAnyAttribute;
[CachedAttribute=isArrayDirty] attribute DOMString[] cachedArrayAttribute;
+ [CachedAttribute=isStringDirty] attribute DOMString? cachedStringOrNoneAttribute;
[CallWith=ExecutionContext] attribute any callWithExecutionContextAnyAttribute;
[CallWith=ScriptState] attribute any callWithScriptStateAnyAttribute;
[CallWith=ExecutionContext|ScriptState] attribute any callWithExecutionContextAndScriptStateAnyAttribute;
[CheckSecurity=Node] readonly attribute Document checkSecurityForNodeReadonlyDocumentAttribute; // All uses are read only
[Conditional=CONDITION] attribute long conditionalLongAttribute;
- [Conditional=CONDITION_1&CONDITION_2] attribute long conditionalAndLongAttribute;
+ [Conditional=(CONDITION_1,CONDITION_2)] attribute long conditionalAndLongAttribute;
[Conditional=CONDITION_1|CONDITION_2] attribute long conditionalOrLongAttribute;
// Constructors: FIXME: replace suffix with [ConstructorAttribute]
attribute TestInterfaceEmptyConstructor testInterfaceEmptyConstructorAttribute;
@@ -197,7 +197,9 @@
[PutForwards=href] readonly attribute TestNode location;
[PutForwards=hrefThrows] readonly attribute TestNode locationWithException;
[PutForwards=hrefCallWith] readonly attribute TestNode locationWithCallWith;
+ [PutForwards=hrefByteString] readonly attribute TestNode locationByteString;
[PerWorldBindings, PutForwards=href] readonly attribute TestNode locationWithPerWorldBindings;
+ [TypeChecking=Interface, PutForwards=href] readonly attribute TestNode locationTypeCheckingInterface;
[PutForwards=attr1] readonly attribute TestInterfaceGarbageCollected locationGarbageCollected;
[PutForwards=attr1] readonly attribute TestInterfaceWillBeGarbageCollected locationWillBeGarbageCollected;
[RaisesException] attribute long raisesExceptionLongAttribute;
@@ -234,23 +236,24 @@
[RuntimeEnabled=FeatureName] attribute long runtimeEnabledLongAttribute;
[PerContextEnabled=FeatureName, RuntimeEnabled=FeatureName] attribute long perContextEnabledRuntimeEnabledLongAttribute;
[Conditional=CONDITION, RuntimeEnabled=FeatureName] attribute long conditionalRuntimeEnabledLongAttribute;
- [SetterCallWith=ActiveWindow&FirstWindow] attribute DOMString setterCallWithActiveWindowAndFirstWindowStringAttribute;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString setterCallWithActiveWindowAndFirstWindowStringAttribute;
[SetterCallWith=ExecutionContext] attribute DOMString setterCallWithExecutionContextStringAttribute;
+ [TreatNullAs=EmptyString] attribute DOMString treatNullAsEmptyStringStringAttribute;
[TreatNullAs=NullString] attribute DOMString treatNullAsNullStringStringAttribute;
[TreatReturnedNullStringAs=Null] attribute DOMString treatReturnedNullStringAsNullStringAttribute;
[TreatReturnedNullStringAs=Undefined] attribute DOMString treatReturnedNullStringAsUndefinedStringAttribute;
+ [TreatReturnedNullStringAs=Undefined, CachedAttribute=isStringDirty] attribute DOMString cachedTreatReturnedNullStringAsUndefinedStringAttribute;
[TreatReturnedNullStringAs=Null] attribute ByteString treatReturnedNullStringAsNullByteStringAttribute;
[TreatReturnedNullStringAs=Undefined] attribute ByteString treatReturnedNullStringAsUndefinedByteStringAttribute;
[TreatReturnedNullStringAs=Null] attribute ScalarValueString treatReturnedNullStringAsNullScalarValueStringAttribute;
[TreatReturnedNullStringAs=Undefined] attribute ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringAttribute;
- [TypeChecking=Interface|Nullable] attribute float typeCheckingInterfaceNullableStringFloatAttribute; // nop for non-interface types
+ [TypeChecking=Interface] attribute float typeCheckingInterfaceFloatAttribute; // nop for non-interface types
[TypeChecking=Interface] attribute TestInterface typeCheckingInterfaceTestInterfaceAttribute;
- [TypeChecking=Nullable] attribute TestInterface? typeCheckingNullableTestInterfaceOrNullAttribute;
- [TypeChecking=Interface|Nullable] attribute TestInterface? typeCheckingInterfaceNullableTestInterfaceOrNullAttribute;
+ [TypeChecking=Interface] attribute TestInterface? typeCheckingInterfaceTestInterfaceOrNullAttribute;
[Reflect, URL] attribute DOMString urlStringAttribute;
[Reflect=reflectUrlAttribute, URL] attribute DOMString urlStringAttribute;
[Unforgeable] attribute long unforgeableLongAttribute;
- [LogActivity=SetterOnly, LogPreviousValue] attribute long activityLoggingSetterOnlyLogPreviousValueAttribute;
+ [LogActivity=SetterOnly, LogPreviousValue] attribute DOMString? activityLoggingSetterOnlyLogPreviousValueAttribute;
[LogActivity, LogPreviousValue] attribute TestInterfaceEmpty activityLoggingLogPreviousValueInterfaceAttribute;
@@ -347,6 +350,10 @@
void voidMethodSequenceStringArg(sequence<DOMString> stringSequenceArg);
void voidMethodSequenceTestInterfaceEmptyArg(sequence<TestInterfaceEmpty> testInterfaceEmptySequenceArg);
// Nullable types
+ long? nullableLongMethod();
+ DOMString? nullableStringMethod();
+ TestInterface? nullableTestInterfaceMethod();
+ sequence<long>? nullableLongSequenceMethod();
// Currently only used on interface type arguments
void voidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? nullableTestInterfaceEmptyArg);
// Callback interface types
@@ -359,11 +366,11 @@
// Exceptional types
Dictionary dictionaryMethod();
NodeFilter nodeFilterMethod();
- Promise promiseMethod();
+ Promise promiseMethod(long arg1, Dictionary arg2, DOMString arg3, DOMString... variadic);
+ Promise promiseMethodWithoutExceptionState(Dictionary arg1);
SerializedScriptValue serializedScriptValueMethod();
XPathNSResolver xPathNSResolverMethod();
void voidMethodDictionaryArg(Dictionary dictionaryArg);
- void voidMethodEventListenerArg(EventListener eventListenerArg);
void voidMethodNodeFilterArg(NodeFilter nodeFilterArg);
void voidMethodPromiseArg(Promise promiseArg);
void voidMethodSerializedScriptValueArg(SerializedScriptValue serializedScriptValueArg);
@@ -387,12 +394,15 @@
void voidMethodOptionalDictionaryArg(optional Dictionary optionalDictionaryArg);
// Optional arguments with defaults
+ void voidMethodDefaultByteStringArg(optional ByteString defaultByteStringArg = "foo");
void voidMethodDefaultStringArg(optional DOMString defaultStringArg = "foo");
- void voidMethodDefaultNullStringArg(optional DOMString defaultStringArg = null);
- void voidMethodDefaultLongArg(optional long defaultLongArg = 10);
+ void voidMethodDefaultIntegerArgs(optional long defaultLongArg = 10,
+ optional long long defaultLongLongArg = -10,
+ optional unsigned long defaultUnsignedArg = 0xFFFFFFFF);
void voidMethodDefaultDoubleArg(optional double defaultDoubleArg = 0.5);
void voidMethodDefaultTrueBooleanArg(optional boolean defaultBooleanArg = true);
void voidMethodDefaultFalseBooleanArg(optional boolean defaultBooleanArg = false);
+ void voidMethodDefaultNullableByteStringArg(optional ByteString? defaultStringArg = null);
void voidMethodDefaultNullableStringArg(optional DOMString? defaultStringArg = null);
void voidMethodDefaultNullableTestInterfaceArg(optional TestInterface? defaultTestInterfaceArg = null);
@@ -442,6 +452,7 @@
// [EnforceRange]
void voidMethodEnforceRangeLongArg([EnforceRange] long enforceRangeLongArg);
// [TreatNullAs], [TreatUndefinedAs]
+ void voidMethodTreatNullAsEmptyStringStringArg([TreatNullAs=EmptyString] DOMString treatNullAsEmptyStringStringArg);
void voidMethodTreatNullAsNullStringStringArg([TreatNullAs=NullString] DOMString treatNullAsNullStringStringArg);
void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString treatNullAsNullStringStringArg);
@@ -450,14 +461,14 @@
[CallWith=ExecutionContext] void callWithExecutionContextVoidMethod();
[CallWith=ScriptState] void callWithScriptStateVoidMethod();
[CallWith=ScriptState] long callWithScriptStateLongMethod();
- [CallWith=ScriptState&ExecutionContext] void callWithScriptStateExecutionContextVoidMethod();
- [CallWith=ScriptState&ScriptArguments] void callWithScriptStateScriptArgumentsVoidMethod();
- [CallWith=ScriptState&ScriptArguments] void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(optional boolean optionalBooleanArg);
+ [CallWith=(ScriptState,ExecutionContext)] void callWithScriptStateExecutionContextVoidMethod();
+ [CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethod();
+ [CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(optional boolean optionalBooleanArg);
[CallWith=ActiveWindow] void callWithActiveWindow();
- [CallWith=ActiveWindow&FirstWindow] void callWithActiveWindowScriptWindow();
+ [CallWith=(ActiveWindow,FirstWindow)] void callWithActiveWindowScriptWindow();
[CheckSecurity=Node] void checkSecurityForNodeVoidMethod();
[Conditional=CONDITION] void conditionalConditionVoidMethod();
- [Conditional=CONDITION_1&CONDITION_2] void conditionalCondition1AndCondition2VoidMethod();
+ [Conditional=(CONDITION_1,CONDITION_2)] void conditionalCondition1AndCondition2VoidMethod();
[Conditional=CONDITION] static void conditionalConditionStaticVoidMethod();
[Custom] void customVoidMethod();
[Conditional=CONDITION, Custom] void conditionalConditionCustomVoidMethod();
@@ -493,8 +504,6 @@
[RaisesException] void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optional TestCallbackInterface optionalTestCallbackInterfaceArg);
[RaisesException] TestInterfaceEmpty raisesExceptionTestInterfaceEmptyVoidMethod();
[CallWith=ExecutionContext, RaisesException] void callWithExecutionContextRaisesExceptionVoidMethodLongArg(long longArg);
- [ReadOnly] void readOnlyVoidMethod();
- [NotEnumerable, ReadOnly] void notEnumerableReadOnlyVoidMethod();
[RuntimeEnabled=FeatureName] void runtimeEnabledVoidMethod();
[PerWorldBindings, RuntimeEnabled=FeatureName] void perWorldBindingsRuntimeEnabledVoidMethod();
[RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(DOMString stringArg);
@@ -509,8 +518,7 @@
[TreatReturnedNullStringAs=Null] ScalarValueString treatReturnedNullStringAsNullScalarValueStringMethod();
[TreatReturnedNullStringAs=Undefined] ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringMethod();
[TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
- [TypeChecking=Nullable] void typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? testInterfaceEmptyOrNullArg);
- [TypeChecking=Interface|Nullable] void typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? testInterfaceEmptyOrNullArg);
+ [TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg(TestInterfaceEmpty... testInterfaceEmptyArg);
[TypeChecking=Unrestricted] void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(float floatArg, double doubleArg);
[Unforgeable] void unforgeableVoidMethod();
void voidMethodTestInterfaceGarbageCollectedSequenceArg(sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceArg);
@@ -525,4 +533,20 @@
attribute TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullAttribute; // [GarbageCollected]
attribute TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedAttribute; // [WillBeGarbageCollected]
attribute TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullAttribute; // [WillBeGarbageCollected]
+
+ // Private scripts
+ [ImplementedInPrivateScript] void voidMethodImplementedInPrivateScript();
+ [ImplementedInPrivateScript] short shortMethodImplementedInPrivateScript();
+ [ImplementedInPrivateScript] short shortMethodWithShortArgumentImplementedInPrivateScript(short value);
+ [ImplementedInPrivateScript] DOMString stringMethodWithStringArgumentImplementedInPrivateScript(DOMString value);
+ [ImplementedInPrivateScript] Node nodeMethodWithNodeArgumentImplementedInPrivateScript(Node value);
+ [ImplementedInPrivateScript] Node nodeMethodWithVariousArgumentsImplementedInPrivateScript(Document document, Node node, short value1, double value2, DOMString string);
+ [ImplementedInPrivateScript] readonly attribute short readonlyShortAttribute;
+ [ImplementedInPrivateScript] attribute short shortAttribute;
+ [ImplementedInPrivateScript] attribute DOMString stringAttribute;
+ [ImplementedInPrivateScript] attribute Node nodeAttribute;
+ [OnlyExposedToPrivateScript] short methodImplementedInCPPForPrivateScriptOnly(short value1, short value2);
+ [OnlyExposedToPrivateScript] attribute DOMString attributeImplementedInCPPForPrivateScriptOnly;
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] short methodForPrivateScriptOnly(short value1, short value2);
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString attributeForPrivateScriptOnly;
};
diff --git a/bindings/tests/idls/TestPartialInterface.idl b/bindings/tests/idls/TestPartialInterface.idl
index c8b0ddc..2981f87 100644
--- a/bindings/tests/idls/TestPartialInterface.idl
+++ b/bindings/tests/idls/TestPartialInterface.idl
@@ -53,4 +53,7 @@
attribute PartialEnumType partialPartialEnumTypeAttribute;
void partialVoidMethodPartialCallbackTypeArg(PartialCallbackType partialCallbackTypeArg);
+
+ [ImplementedInPrivateScript] short shortMethodWithShortArgumentImplementedInPrivateScript(short value);
+ [ImplementedInPrivateScript] attribute DOMString stringAttribute;
};
diff --git a/bindings/tests/idls/TestSpecialOperations.idl b/bindings/tests/idls/TestSpecialOperations.idl
index 2e26771..0f3c2de 100644
--- a/bindings/tests/idls/TestSpecialOperations.idl
+++ b/bindings/tests/idls/TestSpecialOperations.idl
@@ -5,8 +5,8 @@
[
OverrideBuiltins,
] interface TestSpecialOperations {
- // [ImplementedAs], [TypeChecking=Interface|Nullable], union return, nullability
+ // [ImplementedAs], [TypeChecking=Interface], union return, nullability
// [OverrideBuiltins] affects named property operations
[ImplementedAs=getItem] getter (Node or NodeList) namedItem(DOMString name);
- [TypeChecking=Interface|Nullable] setter Node (DOMString name, Node? value);
+ [TypeChecking=Interface] setter Node (DOMString name, Node? value);
};
diff --git a/bindings/tests/idls/TestTypedefs.idl b/bindings/tests/idls/TestTypedefs.idl
index 373a875..996f1c1 100644
--- a/bindings/tests/idls/TestTypedefs.idl
+++ b/bindings/tests/idls/TestTypedefs.idl
@@ -41,6 +41,7 @@
typedef TestCallbackInterface TestCallbackInterfaceType;
typedef TestInterfaceConstructor T;
typedef (TestInterface or TestInterfaceEmpty) TestInterfaceOrTestInterfaceEmpty;
+typedef (DOMString or double) DOMStringOrDouble;
[
Constructor(String stringArg),
@@ -55,6 +56,7 @@
ULongLong uLongLongMethodTestInterfaceEmptyTypeSequenceArg(sequence<TestInterfaceEmptyType> testInterfaceEmptyTypeSequenceArg);
TestInterfaceOrTestInterfaceEmpty testInterfaceOrTestInterfaceEmptyMethod();
+ DOMStringOrDouble domStringOrDoubleMethod();
ArrayOfStrings arrayOfStringsMethodArrayOfStringsArg(ArrayOfStrings arrayOfStringsArg);
String[] stringArrayMethodStringArrayArg(String[] stringArrayArg);
diff --git a/core/README b/core/README
index 53c5767..1a601a7 100644
--- a/core/README
+++ b/core/README
@@ -6,4 +6,4 @@
The current version corresponds to:
URL: http://src.chromium.org/blink/branches/dart/dartium
-Current revision: 181823
+Current revision: 182210
diff --git a/core/animation/AnimationPlayer.idl b/core/animation/AnimationPlayer.idl
index 8dc0d41..bc38234 100644
--- a/core/animation/AnimationPlayer.idl
+++ b/core/animation/AnimationPlayer.idl
@@ -37,7 +37,6 @@
[RuntimeEnabled=WebAnimationsAPI] attribute AnimationNode? source;
[RuntimeEnabled=WebAnimationsAPI] attribute double startTime;
[RuntimeEnabled=WebAnimationsAPI] attribute double currentTime;
- [RuntimeEnabled=WebAnimationsAPI] readonly attribute double timeLag;
[RuntimeEnabled=WebAnimationsAPI] attribute double playbackRate;
[RuntimeEnabled=WebAnimationsAPI] readonly attribute boolean paused;
[RuntimeEnabled=WebAnimationsAPI] readonly attribute boolean finished;
diff --git a/core/animation/AnimationTimeline.idl b/core/animation/AnimationTimeline.idl
index b2c627a..31b1648 100644
--- a/core/animation/AnimationTimeline.idl
+++ b/core/animation/AnimationTimeline.idl
@@ -8,4 +8,5 @@
] interface AnimationTimeline {
readonly attribute double? currentTime;
AnimationPlayer play(AnimationNode source);
+ sequence<AnimationPlayer> getAnimationPlayers();
};
diff --git a/core/animation/ElementAnimation.idl b/core/animation/ElementAnimation.idl
index f524939..ccfbca7 100644
--- a/core/animation/ElementAnimation.idl
+++ b/core/animation/ElementAnimation.idl
@@ -36,4 +36,5 @@
// FIXME: needs support for union types http://crbug.com/240176
// AnimationPlayer animate((AnimationEffect or sequence<Dictionary>)? effect, optional (double or Dictionary) timing);
[Custom, RaisesException] AnimationPlayer animate(object effect, optional object timing);
+ [RuntimeEnabled=WebAnimationsAPI] sequence<AnimationPlayer> getAnimationPlayers();
};
diff --git a/core/animation/Timing.idl b/core/animation/Timing.idl
index 49e93e1..1bb3198 100644
--- a/core/animation/Timing.idl
+++ b/core/animation/Timing.idl
@@ -21,7 +21,7 @@
// FIXME: If the user calls animation.specified.duration = "" (empty string) then duration
// gets set to 0 (This is correct behavior for IDL). Correct result is for duration to
// be set to 'auto'.
- [TypeChecking=Interface|Nullable, ImplementedAs=setDuration] setter double (DOMString name, double duration);
+ [TypeChecking=Interface, ImplementedAs=setDuration] setter double (DOMString name, double duration);
attribute double playbackRate;
attribute DOMString direction;
diff --git a/core/clipboard/DataTransfer.idl b/core/clipboard/DataTransfer.idl
index 497bfdf..5448d01 100644
--- a/core/clipboard/DataTransfer.idl
+++ b/core/clipboard/DataTransfer.idl
@@ -27,7 +27,6 @@
*/
[
- ImplementedAs=Clipboard,
WillBeGarbageCollected
] interface DataTransfer {
[TreatReturnedNullStringAs=Undefined] attribute DOMString dropEffect;
@@ -37,7 +36,7 @@
void clearData(optional DOMString type);
DOMString getData(DOMString type);
- boolean setData(DOMString type, DOMString data);
+ void setData(DOMString type, DOMString data);
[RaisesException] void setDragImage(Element image, long x, long y);
readonly attribute DataTransferItemList items;
diff --git a/core/css/CSSImportRule.idl b/core/css/CSSImportRule.idl
index d1d76ab..f56ef9f 100644
--- a/core/css/CSSImportRule.idl
+++ b/core/css/CSSImportRule.idl
@@ -20,7 +20,7 @@
// Introduced in DOM Level 2:
interface CSSImportRule : CSSRule {
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString href;
+ readonly attribute DOMString? href;
readonly attribute MediaList media;
readonly attribute CSSStyleSheet styleSheet;
};
diff --git a/core/css/CSSStyleDeclaration.idl b/core/css/CSSStyleDeclaration.idl
index 1fc7e9c..45127b6 100644
--- a/core/css/CSSStyleDeclaration.idl
+++ b/core/css/CSSStyleDeclaration.idl
@@ -23,19 +23,19 @@
DependentLifetime,
WillBeGarbageCollected
] interface CSSStyleDeclaration {
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter] attribute DOMString cssText;
+ [RaisesException=Setter] attribute DOMString? cssText;
- [TreatReturnedNullStringAs=Null] DOMString getPropertyValue([Default=Undefined] optional DOMString propertyName);
- [TreatReturnedNullStringAs=Null, RaisesException] DOMString removeProperty([Default=Undefined] optional DOMString propertyName);
- [TreatReturnedNullStringAs=Null] DOMString getPropertyPriority([Default=Undefined] optional DOMString propertyName);
- [RaisesException] void setProperty([Default=Undefined] optional DOMString propertyName,
- [TreatNullAs=NullString,Default=Undefined] optional DOMString value,
- [TreatNullAs=NullString] optional DOMString priority = null);
+ DOMString? getPropertyValue([Default=Undefined] optional DOMString propertyName);
+ [RaisesException] DOMString? removeProperty([Default=Undefined] optional DOMString propertyName);
+ DOMString? getPropertyPriority([Default=Undefined] optional DOMString propertyName);
+ [RaisesException] void setProperty([Default=Undefined] optional DOMString propertyName,
+ [Default=Undefined] optional DOMString? value,
+ optional DOMString? priority = null);
readonly attribute unsigned long length;
getter DOMString item([Default=Undefined] optional unsigned long index);
[Custom=PropertyGetter|PropertyEnumerator|PropertyQuery] getter (DOMString or float) (DOMString name);
- [Custom] setter void (DOMString propertyName, [TreatNullAs=NullString] DOMString propertyValue);
+ [Custom] setter void (DOMString propertyName, DOMString? propertyValue);
readonly attribute CSSRule parentRule;
// Deprecated as of 2003: http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html
diff --git a/core/css/CSSValue.idl b/core/css/CSSValue.idl
index 145010b..7218639 100644
--- a/core/css/CSSValue.idl
+++ b/core/css/CSSValue.idl
@@ -30,7 +30,7 @@
const unsigned short CSS_VALUE_LIST = 2;
const unsigned short CSS_CUSTOM = 3;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter] attribute DOMString cssText;
+ [RaisesException=Setter] attribute DOMString? cssText;
readonly attribute unsigned short cssValueType;
diff --git a/core/css/CSSValueList.idl b/core/css/CSSValueList.idl
index b44fcac..04ad96f 100644
--- a/core/css/CSSValueList.idl
+++ b/core/css/CSSValueList.idl
@@ -27,6 +27,6 @@
[
] interface CSSValueList : CSSValue {
readonly attribute unsigned long length;
- getter CSSValue item(unsigned long index);
+ [ImplementedAs=itemWithBoundsCheck] getter CSSValue item(unsigned long index);
};
diff --git a/core/css/FontFace.idl b/core/css/FontFace.idl
index 77d12b2..ef915f0 100644
--- a/core/css/FontFace.idl
+++ b/core/css/FontFace.idl
@@ -43,7 +43,6 @@
Constructor(DOMString family, ArrayBuffer source, optional Dictionary descriptors),
Constructor(DOMString family, ArrayBufferView source, optional Dictionary descriptors),
ConstructorCallWith=ExecutionContext,
- RaisesException=Constructor,
RuntimeEnabled=FontLoadEvents,
WillBeGarbageCollected,
] interface FontFace {
diff --git a/core/css/CSSFontFaceLoadEvent.idl b/core/css/FontFaceSetLoadEvent.idl
similarity index 97%
rename from core/css/CSSFontFaceLoadEvent.idl
rename to core/css/FontFaceSetLoadEvent.idl
index b77706c..455ad6b 100644
--- a/core/css/CSSFontFaceLoadEvent.idl
+++ b/core/css/FontFaceSetLoadEvent.idl
@@ -32,6 +32,6 @@
[
NoInterfaceObject,
RuntimeEnabled=FontLoadEvents,
-] interface CSSFontFaceLoadEvent : Event {
+] interface FontFaceSetLoadEvent : Event {
readonly attribute FontFace[] fontfaces;
};
diff --git a/core/css/MediaList.idl b/core/css/MediaList.idl
index 8db9886..cae0768 100644
--- a/core/css/MediaList.idl
+++ b/core/css/MediaList.idl
@@ -28,7 +28,7 @@
WillBeGarbageCollected
] interface MediaList {
- [TreatNullAs=NullString, TreatReturnedNullStringAs=Null] attribute DOMString mediaText;
+ attribute DOMString? mediaText;
readonly attribute unsigned long length;
[TreatReturnedNullStringAs=Null] getter DOMString item(unsigned long index);
diff --git a/core/css/MediaQueryList.idl b/core/css/MediaQueryList.idl
index c60c692..7b8b77b 100644
--- a/core/css/MediaQueryList.idl
+++ b/core/css/MediaQueryList.idl
@@ -17,6 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
[
+ ActiveDOMObject,
NoInterfaceObject,
WillBeGarbageCollected
] interface MediaQueryList {
diff --git a/core/css/StyleSheet.idl b/core/css/StyleSheet.idl
index ed83f14..c35b9a5 100644
--- a/core/css/StyleSheet.idl
+++ b/core/css/StyleSheet.idl
@@ -24,12 +24,12 @@
SetWrapperReferenceFrom=ownerNode,
WillBeGarbageCollected
] interface StyleSheet {
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString type;
+ readonly attribute DOMString? type;
attribute boolean disabled;
readonly attribute Node ownerNode;
readonly attribute StyleSheet parentStyleSheet;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString href;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString title;
+ readonly attribute DOMString? href;
+ readonly attribute DOMString? title;
readonly attribute MediaList media;
};
diff --git a/core/css/WebKitCSSMatrix.idl b/core/css/WebKitCSSMatrix.idl
index 08ee797..8f2dc55 100644
--- a/core/css/WebKitCSSMatrix.idl
+++ b/core/css/WebKitCSSMatrix.idl
@@ -100,6 +100,6 @@
// Passing a NaN will use a value of 0.
[Immutable] WebKitCSSMatrix skewY([Default=Undefined] optional double angle);
- [NotEnumerable] DOMString toString();
+ [NotEnumerable] stringifier;
};
diff --git a/core/dom/Attr.idl b/core/dom/Attr.idl
index 9c1fb6c..5c22a79 100644
--- a/core/dom/Attr.idl
+++ b/core/dom/Attr.idl
@@ -22,13 +22,13 @@
// DOM Level 1
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString name;
+ readonly attribute DOMString? name;
[MeasureAs=AttributeSpecified] readonly attribute boolean specified;
- [ImplementedAs=valueForBindings, TreatReturnedNullStringAs=Null, TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString value;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, DeprecateAs=AttrNodeValue, ImplementedAs=valueForBindings] attribute DOMString nodeValue;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, DeprecateAs=AttrTextContent, ImplementedAs=valueForBindings] attribute DOMString textContent;
+ [ImplementedAs=valueForBindings, CustomElementCallbacks] attribute DOMString? value;
+ [DeprecateAs=AttrNodeValue, ImplementedAs=valueForBindings] attribute DOMString? nodeValue;
+ [DeprecateAs=AttrTextContent, ImplementedAs=valueForBindings] attribute DOMString? textContent;
// DOM Level 2
@@ -36,8 +36,8 @@
// DOM 4
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString prefix;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString namespaceURI;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString localName;
+ readonly attribute DOMString? prefix;
+ readonly attribute DOMString? namespaceURI;
+ readonly attribute DOMString? localName;
};
diff --git a/core/dom/CharacterData.idl b/core/dom/CharacterData.idl
index 10972ba..7132d6d 100644
--- a/core/dom/CharacterData.idl
+++ b/core/dom/CharacterData.idl
@@ -23,7 +23,7 @@
readonly attribute unsigned long length;
- [TreatReturnedNullStringAs=Null, RaisesException] DOMString substringData(unsigned long offset, unsigned long length);
+ [RaisesException] DOMString? substringData(unsigned long offset, unsigned long length);
void appendData(DOMString data);
[RaisesException] void insertData(unsigned long offset, DOMString data);
diff --git a/core/dom/Comment.idl b/core/dom/Comment.idl
index 3af73b2..e7fff28 100644
--- a/core/dom/Comment.idl
+++ b/core/dom/Comment.idl
@@ -18,7 +18,7 @@
*/
[
- Constructor(optional DOMString data = null),
+ Constructor(optional DOMString data = ""),
ConstructorCallWith=Document,
] interface Comment : CharacterData {
};
diff --git a/core/dom/DOMImplementation.idl b/core/dom/DOMImplementation.idl
index 472d1b0..d210529 100644
--- a/core/dom/DOMImplementation.idl
+++ b/core/dom/DOMImplementation.idl
@@ -26,15 +26,15 @@
// DOM Level 1
[ImplementedAs=hasFeatureForBindings, MeasureAs=DOMImplementationHasFeature]
- boolean hasFeature(DOMString feature, [TreatNullAs=NullString] DOMString version);
+ boolean hasFeature(DOMString feature, DOMString? version);
// DOM Level 2
[RaisesException] DocumentType createDocumentType(DOMString qualifiedName,
DOMString publicId,
DOMString systemId);
- [RaisesException] XMLDocument createDocument([TreatNullAs=NullString] DOMString namespaceURI,
- [TreatNullAs=NullString] DOMString qualifiedName,
+ [RaisesException] XMLDocument createDocument(DOMString? namespaceURI,
+ DOMString? qualifiedName,
[Default=Undefined] optional DocumentType doctype);
// HTMLDOMImplementation interface from DOM Level 2 HTML
diff --git a/core/dom/DOMMatrix.idl b/core/dom/DOMMatrix.idl
new file mode 100644
index 0000000..c6497e5
--- /dev/null
+++ b/core/dom/DOMMatrix.idl
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ Constructor,
+ Constructor(DOMMatrixReadOnly other),
+ // FIXME: Should implement more constructors (See: crbug.com/388780)
+ RuntimeEnabled=GeometryInterfaces,
+] interface DOMMatrix : DOMMatrixReadOnly {
+ // These attributes are simple aliases for certain elements of the 4x4 matrix
+ attribute unrestricted double a;
+ attribute unrestricted double b;
+ attribute unrestricted double c;
+ attribute unrestricted double d;
+ attribute unrestricted double e;
+ attribute unrestricted double f;
+
+ attribute unrestricted double m11;
+ attribute unrestricted double m12;
+ attribute unrestricted double m13;
+ attribute unrestricted double m14;
+ attribute unrestricted double m21;
+ attribute unrestricted double m22;
+ attribute unrestricted double m23;
+ attribute unrestricted double m24;
+ attribute unrestricted double m31;
+ attribute unrestricted double m32;
+ attribute unrestricted double m33;
+ attribute unrestricted double m34;
+ attribute unrestricted double m41;
+ attribute unrestricted double m42;
+ attribute unrestricted double m43;
+ attribute unrestricted double m44;
+
+ // FIXME: Should implement some methods (See: crbug.com/388780)
+};
diff --git a/core/dom/DOMMatrixReadOnly.idl b/core/dom/DOMMatrixReadOnly.idl
new file mode 100644
index 0000000..53cec15
--- /dev/null
+++ b/core/dom/DOMMatrixReadOnly.idl
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ GarbageCollected,
+ RuntimeEnabled=GeometryInterfaces,
+] interface DOMMatrixReadOnly {
+ // These attributes are simple aliases for certain elements of the 4x4 matrix
+ readonly attribute unrestricted double a;
+ readonly attribute unrestricted double b;
+ readonly attribute unrestricted double c;
+ readonly attribute unrestricted double d;
+ readonly attribute unrestricted double e;
+ readonly attribute unrestricted double f;
+
+ readonly attribute unrestricted double m11;
+ readonly attribute unrestricted double m12;
+ readonly attribute unrestricted double m13;
+ readonly attribute unrestricted double m14;
+ readonly attribute unrestricted double m21;
+ readonly attribute unrestricted double m22;
+ readonly attribute unrestricted double m23;
+ readonly attribute unrestricted double m24;
+ readonly attribute unrestricted double m31;
+ readonly attribute unrestricted double m32;
+ readonly attribute unrestricted double m33;
+ readonly attribute unrestricted double m34;
+ readonly attribute unrestricted double m41;
+ readonly attribute unrestricted double m42;
+ readonly attribute unrestricted double m43;
+ readonly attribute unrestricted double m44;
+
+ readonly attribute boolean is2D;
+ readonly attribute boolean isIdentity;
+
+ // FIXME: Should implement some methods (See: crbug.com/388780)
+};
diff --git a/core/dom/DOMPoint.idl b/core/dom/DOMPoint.idl
new file mode 100644
index 0000000..d75c518
--- /dev/null
+++ b/core/dom/DOMPoint.idl
@@ -0,0 +1,24 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// FIXME: Blink doesn't currently support dictionary definitions.
+// For now, we can use Dictionary interface. See http://crbug.com/321462.
+// dictionary DOMPointInit {
+// unrestricted double x = 0;
+// unrestricted double y = 0;
+// unrestricted double z = 0;
+// unrestricted double w = 1;
+// };
+
+[
+ Constructor(optional Dictionary point),
+ Constructor(unrestricted double x, unrestricted double y,
+ optional unrestricted double z = 0, optional unrestricted double w = 1),
+ RuntimeEnabled=GeometryInterfaces,
+] interface DOMPoint : DOMPointReadOnly {
+ attribute unrestricted double x;
+ attribute unrestricted double y;
+ attribute unrestricted double z;
+ attribute unrestricted double w;
+};
diff --git a/core/dom/DOMPointReadOnly.idl b/core/dom/DOMPointReadOnly.idl
new file mode 100644
index 0000000..a02868d
--- /dev/null
+++ b/core/dom/DOMPointReadOnly.idl
@@ -0,0 +1,18 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ Constructor(unrestricted double x, unrestricted double y,
+ unrestricted double z, unrestricted double w),
+ GarbageCollected,
+ RuntimeEnabled=GeometryInterfaces,
+] interface DOMPointReadOnly {
+ readonly attribute unrestricted double x;
+ readonly attribute unrestricted double y;
+ readonly attribute unrestricted double z;
+ readonly attribute unrestricted double w;
+
+ // FIXME: We should implement DOMMatrixReadOnly interface.
+ // DOMPoint matrixTransform(DOMMatrixReadOnly matrix);
+};
diff --git a/core/dom/DOMRect.idl b/core/dom/DOMRect.idl
new file mode 100644
index 0000000..8a05778
--- /dev/null
+++ b/core/dom/DOMRect.idl
@@ -0,0 +1,16 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ Constructor(optional unrestricted double x = 0,
+ optional unrestricted double y = 0,
+ optional unrestricted double width = 0,
+ optional unrestricted double height = 0),
+ RuntimeEnabled=GeometryInterfaces,
+] interface DOMRect : DOMRectReadOnly {
+ attribute unrestricted double x;
+ attribute unrestricted double y;
+ attribute unrestricted double width;
+ attribute unrestricted double height;
+};
diff --git a/core/dom/DOMRectReadOnly.idl b/core/dom/DOMRectReadOnly.idl
new file mode 100644
index 0000000..50e05a5
--- /dev/null
+++ b/core/dom/DOMRectReadOnly.idl
@@ -0,0 +1,19 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ Constructor(unrestricted double x, unrestricted double y,
+ unrestricted double width, unrestricted double height),
+ GarbageCollected,
+ RuntimeEnabled=GeometryInterfaces,
+] interface DOMRectReadOnly {
+ readonly attribute unrestricted double x;
+ readonly attribute unrestricted double y;
+ readonly attribute unrestricted double width;
+ readonly attribute unrestricted double height;
+ readonly attribute unrestricted double top;
+ readonly attribute unrestricted double right;
+ readonly attribute unrestricted double bottom;
+ readonly attribute unrestricted double left;
+};
diff --git a/core/dom/DOMTokenList.idl b/core/dom/DOMTokenList.idl
index 98d51cf..1947640 100644
--- a/core/dom/DOMTokenList.idl
+++ b/core/dom/DOMTokenList.idl
@@ -32,6 +32,7 @@
[RaisesException, CustomElementCallbacks] void add(DOMString... tokens);
[RaisesException, CustomElementCallbacks] void remove(DOMString... tokens);
[RaisesException, CustomElementCallbacks] boolean toggle(DOMString token, optional boolean force);
- [NotEnumerable] DOMString toString();
+
+ [NotEnumerable] stringifier;
};
diff --git a/core/dom/Document.idl b/core/dom/Document.idl
index 64f4ddf..e6cadff 100644
--- a/core/dom/Document.idl
+++ b/core/dom/Document.idl
@@ -31,7 +31,7 @@
readonly attribute DOMImplementation implementation;
readonly attribute Element documentElement;
- [CustomElementCallbacks, PerWorldBindings, LogActivity, RaisesException] Element createElement(DOMString tagName);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString tagName);
DocumentFragment createDocumentFragment();
Text createTextNode(DOMString data);
Comment createComment(DOMString data);
@@ -42,24 +42,24 @@
// Introduced in DOM Level 2:
- [CustomElementCallbacks, LogActivity, RaisesException] Node importNode(Node node, optional boolean deep);
- [CustomElementCallbacks, LogActivity, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName);
- [RaisesException, DeprecateAs=DocumentCreateAttributeNS] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
- [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName); // Removed from DOM4.
- HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
+ [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node importNode(Node node, optional boolean deep = false);
+ [CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
+ [RaisesException, DeprecateAs=DocumentCreateAttributeNS] Attr createAttributeNS([Default=Undefined] optional DOMString? namespaceURI,
+ [Default=Undefined] optional DOMString? qualifiedName); // Removed from DOM4.
+ HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
[PerWorldBindings, DartNoAutoScope] Element getElementById(DOMString elementId);
// DOM Level 3 Core
- [TreatReturnedNullStringAs=Null, MeasureAs=DocumentInputEncoding] readonly attribute DOMString inputEncoding; // Removed from DOM4.
+ [MeasureAs=DocumentInputEncoding] readonly attribute DOMString? inputEncoding; // Removed from DOM4.
- [TreatReturnedNullStringAs=Null, MeasureAs=DocumentXMLEncoding] readonly attribute DOMString xmlEncoding; // Removed from DOM4.
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter, MeasureAs=DocumentXMLVersion] attribute DOMString xmlVersion; // Removed from DOM4.
+ [MeasureAs=DocumentXMLEncoding] readonly attribute DOMString? xmlEncoding; // Removed from DOM4.
+ [RaisesException=Setter, MeasureAs=DocumentXMLVersion] attribute DOMString? xmlVersion; // Removed from DOM4.
[RaisesException=Setter, MeasureAs=DocumentXMLStandalone] attribute boolean xmlStandalone; // Removed from DOM4.
- [RaisesException, CustomElementCallbacks] Node adoptNode(Node node);
+ [RaisesException, CustomElementCallbacks, TypeChecking=Interface] Node adoptNode(Node node);
- [TreatReturnedNullStringAs=Null, ImplementedAs=url] readonly attribute DOMString documentURI;
+ [ImplementedAs=url] readonly attribute DOMString? documentURI;
// DOM Level 2 Events (DocumentEvents interface)
@@ -71,12 +71,12 @@
// DOM Level 2 Traversal and Range (DocumentTraversal interface)
- [RaisesException] NodeIterator createNodeIterator(Node root,
- optional unsigned long whatToShow,
- optional NodeFilter filter);
- [RaisesException] TreeWalker createTreeWalker(Node root,
- optional unsigned long whatToShow,
- optional NodeFilter filter);
+ [RaisesException, TypeChecking=Interface] NodeIterator createNodeIterator(Node root,
+ optional unsigned long whatToShow = 0xFFFFFFFF,
+ optional NodeFilter? filter = null);
+ [RaisesException, TypeChecking=Interface] TreeWalker createTreeWalker(Node root,
+ optional unsigned long whatToShow = 0xFFFFFFFF,
+ optional NodeFilter? filter = null);
// DOM Level 2 Abstract Views (DocumentView interface)
@@ -88,8 +88,8 @@
// DOM Level 2 Style (DocumentCSS interface)
- CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
- [Default=Undefined] optional DOMString pseudoElement);
+ CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
+ [Default=Undefined] optional DOMString pseudoElement);
// DOM 4
readonly attribute DOMString contentType;
@@ -98,7 +98,7 @@
[CustomElementCallbacks]
boolean execCommand([Default=Undefined] optional DOMString command,
[Default=Undefined] optional boolean userInterface,
- [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString value);
+ [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? value);
boolean queryCommandEnabled([Default=Undefined] optional DOMString command);
boolean queryCommandIndeterm([Default=Undefined] optional DOMString command);
@@ -116,7 +116,7 @@
[TreatNullAs=NullString, RaisesException] attribute DOMString cookie;
- [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings, DartNoAutoScope] attribute HTMLElement body;
+ [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings, TypeChecking=Interface, DartNoAutoScope] attribute HTMLElement? body;
readonly attribute HTMLHeadElement head;
readonly attribute HTMLCollection images;
@@ -131,7 +131,7 @@
[PerWorldBindings, DartNoAutoScope] NodeList getElementsByName([Default=Undefined] optional DOMString elementName);
- [LogActivity, PutForwards=href] readonly attribute Location location;
+ [PutForwards=href] readonly attribute Location location;
// IE extensions
[MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
@@ -146,12 +146,12 @@
// Mozilla extensions
Selection getSelection();
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet;
+ readonly attribute DOMString? characterSet;
// WebKit extensions
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet;
+ readonly attribute DOMString? preferredStylesheetSet;
+ attribute DOMString? selectedStylesheetSet;
[MeasureAs=DocumentGetCSSCanvasContext] RenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
@@ -164,8 +164,6 @@
[MeasureAs=DocumentExitPointerLock] void exitPointerLock();
[MeasureAs=DocumentPointerLockElement] readonly attribute Element pointerLockElement;
- [MeasureAs=PrefixedDocumentExitPointerLock, ImplementedAs=exitPointerLock] void webkitExitPointerLock();
- [MeasureAs=PrefixedDocumentPointerLockElement, ImplementedAs=pointerLockElement] readonly attribute Element webkitPointerLockElement;
// Event handler attributes
attribute EventHandler onbeforecopy;
@@ -185,29 +183,24 @@
[RuntimeEnabled=Touch] attribute EventHandler ontouchend;
[RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
[RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
- attribute EventHandler onwebkitfullscreenchange;
- attribute EventHandler onwebkitfullscreenerror;
- attribute EventHandler onwebkitpointerlockchange;
- attribute EventHandler onwebkitpointerlockerror;
- [LogActivity=SetterOnly] attribute EventHandler onwheel;
+ attribute EventHandler onwheel;
[RuntimeEnabled=Touch] Touch createTouch([Default=Undefined] optional Window window,
- [Default=Undefined] optional EventTarget target,
- [Default=Undefined] optional long identifier,
- [Default=Undefined] optional double pageX,
- [Default=Undefined] optional double pageY,
- [Default=Undefined] optional double screenX,
- [Default=Undefined] optional double screenY,
- [Default=Undefined] optional double webkitRadiusX,
- [Default=Undefined] optional double webkitRadiusY,
- [Default=Undefined] optional float webkitRotationAngle,
- [Default=Undefined] optional float webkitForce);
+ [Default=Undefined] optional EventTarget target,
+ [Default=Undefined] optional long identifier,
+ [Default=Undefined] optional double pageX,
+ [Default=Undefined] optional double pageY,
+ [Default=Undefined] optional double screenX,
+ [Default=Undefined] optional double screenY,
+ [Default=Undefined] optional double webkitRadiusX,
+ [Default=Undefined] optional double webkitRadiusY,
+ [Default=Undefined] optional float webkitRotationAngle,
+ [Default=Undefined] optional float webkitForce);
[RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches);
[CallWith=ScriptState, CustomElementCallbacks, RaisesException, MeasureAs=DocumentRegisterElement] CustomElementConstructor registerElement(DOMString name, optional Dictionary options);
- [CustomElementCallbacks, PerWorldBindings, LogActivity, RaisesException, DartCustom] Element createElement(DOMString localName, [TreatNullAs=NullString] DOMString typeExtension);
- [CustomElementCallbacks, LogActivity, RaisesException, DartCustom] Element createElementNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName,
- [TreatNullAs=NullString] DOMString typeExtension);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, DartCustom] Element createElement(DOMString localName, DOMString? typeExtension);
+ [CustomElementCallbacks, RaisesException, DartCustom] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString? typeExtension);
// Page visibility API.
readonly attribute DOMString visibilityState;
diff --git a/core/dom/DocumentFullscreen.idl b/core/dom/DocumentFullscreen.idl
index 65c6f80..43547f7 100644
--- a/core/dom/DocumentFullscreen.idl
+++ b/core/dom/DocumentFullscreen.idl
@@ -20,14 +20,25 @@
*/
partial interface Document {
+ [RuntimeEnabled=FullscreenUnprefixed] readonly attribute boolean fullscreenEnabled;
+ [RuntimeEnabled=FullscreenUnprefixed] readonly attribute Element? fullscreenElement;
+
+ [RuntimeEnabled=FullscreenUnprefixed] void exitFullscreen();
+
+ [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenchange;
+ [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenerror;
+
// Mozilla version
[MeasureAs=PrefixedDocumentIsFullscreen] readonly attribute boolean webkitIsFullScreen;
[MeasureAs=PrefixedDocumentFullScreenKeyboardInputAllowed] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
[MeasureAs=PrefixedDocumentCurrentFullScreenElement] readonly attribute Element webkitCurrentFullScreenElement;
- [MeasureAs=PrefixedDocumentCancelFullScreen] void webkitCancelFullScreen();
+ [MeasureAs=PrefixedDocumentCancelFullScreen, ImplementedAs=exitFullscreen] void webkitCancelFullScreen();
// W3C version
- [MeasureAs=PrefixedDocumentFullscreenEnabled] readonly attribute boolean webkitFullscreenEnabled;
- [MeasureAs=PrefixedDocumentFullscreenElement] readonly attribute Element webkitFullscreenElement;
- [MeasureAs=PrefixedDocumentExitFullscreen] void webkitExitFullscreen();
+ [MeasureAs=PrefixedDocumentFullscreenEnabled, ImplementedAs=fullscreenEnabled] readonly attribute boolean webkitFullscreenEnabled;
+ [MeasureAs=PrefixedDocumentFullscreenElement, ImplementedAs=fullscreenElement] readonly attribute Element webkitFullscreenElement;
+ [MeasureAs=PrefixedDocumentExitFullscreen, ImplementedAs=exitFullscreen] void webkitExitFullscreen();
+
+ attribute EventHandler onwebkitfullscreenchange;
+ attribute EventHandler onwebkitfullscreenerror;
};
diff --git a/core/dom/Element.idl b/core/dom/Element.idl
index 93843ed..89e5e7c 100644
--- a/core/dom/Element.idl
+++ b/core/dom/Element.idl
@@ -24,14 +24,14 @@
// DOM Level 1 Core
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString tagName;
+ readonly attribute DOMString? tagName;
- [TreatReturnedNullStringAs=Null, DartNoAutoScope] DOMString getAttribute(DOMString name);
+ [DartNoAutoScope] DOMString? getAttribute(DOMString name);
[RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttribute(DOMString name, DOMString value);
[CustomElementCallbacks] void removeAttribute(DOMString name);
[MeasureAs=ElementGetAttributeNode] Attr getAttributeNode([Default=Undefined] optional DOMString name); // Removed from DOM4.
- [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr setAttributeNode([Default=Undefined, TypeChecking=Nullable] optional Attr newAttr); // Removed from DOM4.
- [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNode] Attr removeAttributeNode([Default=Undefined, TypeChecking=Nullable] optional Attr oldAttr); // Removed from DOM4.
+ [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr setAttributeNode([Default=Undefined] optional Attr newAttr); // Removed from DOM4.
+ [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNode] Attr removeAttributeNode([Default=Undefined] optional Attr oldAttr); // Removed from DOM4.
HTMLCollection getElementsByTagName(DOMString name);
[PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes;
@@ -39,23 +39,23 @@
// DOM Level 2 Core
- [TreatReturnedNullStringAs=Null, DartNoAutoScope] DOMString getAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
- [RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName, DOMString value);
- [CustomElementCallbacks] void removeAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
- HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
- [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([TreatNullAs=NullString, Default=Undefined] optional DOMString namespaceURI,
+ [DartNoAutoScope] DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
+ [RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttributeNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString value);
+ [CustomElementCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
+ [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([Default=Undefined] optional DOMString? namespaceURI,
[Default=Undefined] optional DOMString localName); // Removed from DOM4.
- [RaisesException, CustomElementCallbacks, DeprecateAs=ElementSetAttributeNodeNS] Attr setAttributeNodeNS([Default=Undefined, TypeChecking=Nullable] optional Attr newAttr); // Removed from DOM4.
+ [RaisesException, CustomElementCallbacks, DeprecateAs=ElementSetAttributeNodeNS] Attr setAttributeNodeNS([Default=Undefined] optional Attr newAttr); // Removed from DOM4.
boolean hasAttribute(DOMString name);
- boolean hasAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
+ boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
[PerWorldBindings] readonly attribute CSSStyleDeclaration style;
// DOM4
[Reflect, DartNoAutoScope] attribute DOMString id;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString namespaceURI;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter] attribute DOMString prefix;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString localName;
+ readonly attribute DOMString? namespaceURI;
+ [RaisesException=Setter] attribute DOMString? prefix;
+ readonly attribute DOMString? localName;
[RaisesException] boolean matches(DOMString selectors);
@@ -87,12 +87,10 @@
// WebKit extensions
[MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
- [MeasureAs=ElementScrollByLines] void scrollByLines([Default=Undefined] optional long lines);
- [MeasureAs=ElementScrollByPages] void scrollByPages([Default=Undefined] optional long pages);
// HTML 5
HTMLCollection getElementsByClassName(DOMString classNames);
- [TreatNullAs=NullString, CustomElementCallbacks, PerWorldBindings, LogActivity=SetterOnly, RaisesException=Setter] attribute DOMString innerHTML;
+ [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerHTML;
[TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString outerHTML;
[RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] Element insertAdjacentElement(DOMString where, Element element);
@@ -116,14 +114,6 @@
ClientRectList getClientRects();
ClientRect getBoundingClientRect();
- // Mozilla version
- const unsigned short ALLOW_KEYBOARD_INPUT = 1;
- [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen] void webkitRequestFullScreen([Default=Undefined] optional unsigned short flags);
-
- // W3C version
- [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen();
-
- [MeasureAs=PrefixedElementRequestPointerLock] void webkitRequestPointerLock();
[MeasureAs=ElementRequestPointerLock] void requestPointerLock();
// Event handler attributes
@@ -139,9 +129,7 @@
[RuntimeEnabled=Touch] attribute EventHandler ontouchend;
[RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
[RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
- attribute EventHandler onwebkitfullscreenchange;
- attribute EventHandler onwebkitfullscreenerror;
- [LogActivity=SetterOnly] attribute EventHandler onwheel;
+ attribute EventHandler onwheel;
};
Element implements ParentNode;
diff --git a/core/dom/ElementFullscreen.idl b/core/dom/ElementFullscreen.idl
new file mode 100644
index 0000000..6f45402
--- /dev/null
+++ b/core/dom/ElementFullscreen.idl
@@ -0,0 +1,17 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+partial interface Element {
+ [RuntimeEnabled=FullscreenUnprefixed] void requestFullscreen();
+
+ // Mozilla version
+ const unsigned short ALLOW_KEYBOARD_INPUT = 1;
+ [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen] void webkitRequestFullScreen([Default=Undefined] optional unsigned short flags);
+
+ // W3C version
+ [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen();
+
+ attribute EventHandler onwebkitfullscreenchange;
+ attribute EventHandler onwebkitfullscreenerror;
+};
diff --git a/core/dom/GlobalEventHandlers.idl b/core/dom/GlobalEventHandlers.idl
index c835461..6a7f1c1 100644
--- a/core/dom/GlobalEventHandlers.idl
+++ b/core/dom/GlobalEventHandlers.idl
@@ -41,41 +41,41 @@
attribute EventHandler oncanplay;
attribute EventHandler oncanplaythrough;
attribute EventHandler onchange;
- [LogActivity=SetterOnly] attribute EventHandler onclick;
+ attribute EventHandler onclick;
attribute EventHandler onclose;
attribute EventHandler oncontextmenu;
attribute EventHandler oncuechange;
- [LogActivity=SetterOnly] attribute EventHandler ondblclick;
- [LogActivity=SetterOnly] attribute EventHandler ondrag;
- [LogActivity=SetterOnly] attribute EventHandler ondragend;
- [LogActivity=SetterOnly] attribute EventHandler ondragenter;
- //[LogActivity=SetterOnly] attribute EventHandler ondragexit;
- [LogActivity=SetterOnly] attribute EventHandler ondragleave;
- [LogActivity=SetterOnly] attribute EventHandler ondragover;
- [LogActivity=SetterOnly] attribute EventHandler ondragstart;
- [LogActivity=SetterOnly] attribute EventHandler ondrop;
+ attribute EventHandler ondblclick;
+ attribute EventHandler ondrag;
+ attribute EventHandler ondragend;
+ attribute EventHandler ondragenter;
+ //attribute EventHandler ondragexit;
+ attribute EventHandler ondragleave;
+ attribute EventHandler ondragover;
+ attribute EventHandler ondragstart;
+ attribute EventHandler ondrop;
attribute EventHandler ondurationchange;
attribute EventHandler onemptied;
attribute EventHandler onended;
attribute EventHandler onerror;
attribute EventHandler onfocus;
- [LogActivity=SetterOnly] attribute EventHandler oninput;
+ attribute EventHandler oninput;
attribute EventHandler oninvalid;
- [LogActivity=SetterOnly] attribute EventHandler onkeydown;
- [LogActivity=SetterOnly] attribute EventHandler onkeypress;
- [LogActivity=SetterOnly] attribute EventHandler onkeyup;
+ attribute EventHandler onkeydown;
+ attribute EventHandler onkeypress;
+ attribute EventHandler onkeyup;
attribute EventHandler onload;
attribute EventHandler onloadeddata;
attribute EventHandler onloadedmetadata;
attribute EventHandler onloadstart;
- [LogActivity=SetterOnly] attribute EventHandler onmousedown;
- [LogActivity=SetterOnly] attribute EventHandler onmouseenter;
- [LogActivity=SetterOnly] attribute EventHandler onmouseleave;
- [LogActivity=SetterOnly] attribute EventHandler onmousemove;
- [LogActivity=SetterOnly] attribute EventHandler onmouseout;
- [LogActivity=SetterOnly] attribute EventHandler onmouseover;
- [LogActivity=SetterOnly] attribute EventHandler onmouseup;
- [LogActivity=SetterOnly] attribute EventHandler onmousewheel;
+ attribute EventHandler onmousedown;
+ attribute EventHandler onmouseenter;
+ attribute EventHandler onmouseleave;
+ attribute EventHandler onmousemove;
+ attribute EventHandler onmouseout;
+ attribute EventHandler onmouseover;
+ attribute EventHandler onmouseup;
+ attribute EventHandler onmousewheel;
attribute EventHandler onpause;
attribute EventHandler onplay;
attribute EventHandler onplaying;
diff --git a/core/dom/MessageChannel.idl b/core/dom/MessageChannel.idl
index 3a1123c..14a4e19 100644
--- a/core/dom/MessageChannel.idl
+++ b/core/dom/MessageChannel.idl
@@ -26,7 +26,7 @@
[
CustomConstructor,
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
WillBeGarbageCollected
] interface MessageChannel {
readonly attribute MessagePort port1;
diff --git a/core/dom/MessagePort.idl b/core/dom/MessagePort.idl
index f834df6..77d8652 100644
--- a/core/dom/MessagePort.idl
+++ b/core/dom/MessagePort.idl
@@ -29,7 +29,7 @@
ActiveDOMObject,
WillBeGarbageCollected
] interface MessagePort : EventTarget {
- [Custom, RaisesException] void postMessage(any message, optional MessagePort[] messagePorts);
+ [Custom, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
void start();
void close();
@@ -37,4 +37,3 @@
// event handler attributes
attribute EventHandler onmessage;
};
-
diff --git a/core/dom/MutationRecord.idl b/core/dom/MutationRecord.idl
index daecf1d..1be9ca9 100644
--- a/core/dom/MutationRecord.idl
+++ b/core/dom/MutationRecord.idl
@@ -39,8 +39,8 @@
readonly attribute Node previousSibling;
readonly attribute Node nextSibling;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString attributeName;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString attributeNamespace;
+ readonly attribute DOMString? attributeName;
+ readonly attribute DOMString? attributeNamespace;
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString oldValue;
+ readonly attribute DOMString? oldValue;
};
diff --git a/core/dom/NamedNodeMap.idl b/core/dom/NamedNodeMap.idl
index 7de6a6f..6294404 100644
--- a/core/dom/NamedNodeMap.idl
+++ b/core/dom/NamedNodeMap.idl
@@ -37,12 +37,12 @@
// Introduced in DOM Level 2:
- [MeasureAs=NamedNodeMapGetNamedItemNS] Node getNamedItemNS([TreatNullAs=NullString, Default=Undefined] optional DOMString namespaceURI,
+ [MeasureAs=NamedNodeMapGetNamedItemNS] Node getNamedItemNS([Default=Undefined] optional DOMString? namespaceURI,
[Default=Undefined] optional DOMString localName);
[RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapSetNamedItemNS] Node setNamedItemNS([Default=Undefined] optional Node node);
- [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItemNS] Node removeNamedItemNS([TreatNullAs=NullString, Default=Undefined] optional DOMString namespaceURI,
+ [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItemNS] Node removeNamedItemNS([Default=Undefined] optional DOMString? namespaceURI,
[Default=Undefined] optional DOMString localName);
};
diff --git a/core/dom/Node.idl b/core/dom/Node.idl
index 329b27f..1a05f53 100644
--- a/core/dom/Node.idl
+++ b/core/dom/Node.idl
@@ -38,7 +38,7 @@
readonly attribute DOMString nodeName;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString nodeValue;
+ [CustomElementCallbacks] attribute DOMString? nodeValue;
[DartNoAutoScope] readonly attribute unsigned short nodeType;
[PerWorldBindings] readonly attribute Node parentNode;
@@ -49,29 +49,29 @@
[PerWorldBindings, DartNoAutoScope] readonly attribute Node nextSibling;
[PerWorldBindings] readonly attribute Document ownerDocument;
- [Custom, CustomElementCallbacks, PerWorldBindings, LogActivity, RaisesException] Node insertBefore(Node newChild, Node refChild);
- [Custom, CustomElementCallbacks, PerWorldBindings, LogActivity, RaisesException] Node replaceChild(Node newChild, Node oldChild);
- [Custom, CustomElementCallbacks, RaisesException] Node removeChild(Node oldChild);
- [Custom, CustomElementCallbacks, PerWorldBindings, LogActivity, RaisesException] Node appendChild(Node newChild);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node insertBefore(Node newChild, Node? refChild);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node replaceChild(Node newChild, Node oldChild);
+ [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node removeChild(Node oldChild);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node appendChild(Node newChild);
[ImplementedAs=hasChildren] boolean hasChildNodes();
[CustomElementCallbacks, DartCustom] Node cloneNode(optional boolean deep);
[CustomElementCallbacks] void normalize();
// Introduced in DOM Level 2:
- [TreatReturnedNullStringAs=Null, MeasureAs=NodeNamespaceURI] readonly attribute DOMString namespaceURI; // Moved to Element and Attr in DOM4.
- [TreatReturnedNullStringAs=Null, MeasureAs=NodeLocalName] readonly attribute DOMString localName; // Moved to Element and Attr in DOM4.
+ [MeasureAs=NodeNamespaceURI] readonly attribute DOMString? namespaceURI; // Moved to Element and Attr in DOM4.
+ [MeasureAs=NodeLocalName] readonly attribute DOMString? localName; // Moved to Element and Attr in DOM4.
// Introduced in DOM Level 3:
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString baseURI;
+ readonly attribute DOMString? baseURI;
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString textContent;
[MeasureAs=NodeIsSameNode] boolean isSameNode([Default=Undefined] optional Node other); // Removed in DOM4.
boolean isEqualNode(Node other);
- [TreatReturnedNullStringAs=Null] DOMString lookupPrefix([TreatNullAs=NullString] DOMString namespaceURI);
- boolean isDefaultNamespace([TreatNullAs=NullString] DOMString namespaceURI);
- [TreatReturnedNullStringAs=Null] DOMString lookupNamespaceURI([TreatNullAs=NullString] DOMString prefix);
+ DOMString? lookupPrefix(DOMString? namespaceURI);
+ boolean isDefaultNamespace(DOMString? namespaceURI);
+ DOMString? lookupNamespaceURI(DOMString? prefix);
// DocumentPosition
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
diff --git a/core/dom/ProcessingInstruction.idl b/core/dom/ProcessingInstruction.idl
index 80aace5..c082c10 100644
--- a/core/dom/ProcessingInstruction.idl
+++ b/core/dom/ProcessingInstruction.idl
@@ -22,7 +22,7 @@
// DOM Level 1
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString target;
+ readonly attribute DOMString? target;
// interface LinkStyle from DOM Level 2 Style Sheets
readonly attribute StyleSheet sheet;
diff --git a/core/dom/Range.idl b/core/dom/Range.idl
index e73f6d3..cb2d8fd 100644
--- a/core/dom/Range.idl
+++ b/core/dom/Range.idl
@@ -38,7 +38,7 @@
[RaisesException] void setStartAfter(Node refNode);
[RaisesException] void setEndBefore(Node refNode);
[RaisesException] void setEndAfter(Node refNode);
- void collapse([Default=Undefined] optional boolean toStart);
+ void collapse(optional boolean toStart = false);
[RaisesException] void selectNode(Node refNode);
[RaisesException] void selectNodeContents(Node refNode);
@@ -48,7 +48,7 @@
const unsigned short END_TO_END = 2;
const unsigned short END_TO_START = 3;
- [RaisesException] short compareBoundaryPoints(CompareHow how, Range sourceRange);
+ [RaisesException, TypeChecking=Interface] short compareBoundaryPoints(CompareHow how, Range sourceRange);
[RaisesException, CustomElementCallbacks] void deleteContents();
[RaisesException, CustomElementCallbacks] DocumentFragment extractContents();
@@ -56,12 +56,13 @@
[RaisesException, CustomElementCallbacks] void insertNode(Node newNode);
[RaisesException, CustomElementCallbacks] void surroundContents(Node newParent);
Range cloneRange();
- DOMString toString();
+
+ stringifier;
[DeprecateAs=RangeDetach] void detach();
[RaisesException] boolean isPointInRange(Node refNode, long offset);
- [RaisesException] short comparePoint(Node refNode, long offset);
+ [RaisesException, TypeChecking=Interface] short comparePoint(Node refNode, long offset);
[RaisesException] boolean intersectsNode(Node refNode);
diff --git a/core/dom/Text.idl b/core/dom/Text.idl
index 2e3f842..afee652 100644
--- a/core/dom/Text.idl
+++ b/core/dom/Text.idl
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
[
- Constructor(optional DOMString data = null),
+ Constructor(optional DOMString data = ""),
ConstructorCallWith=Document,
Custom=Wrap,
] interface Text : CharacterData {
diff --git a/core/dom/Touch.idl b/core/dom/Touch.idl
index 574d684..d7003b6 100644
--- a/core/dom/Touch.idl
+++ b/core/dom/Touch.idl
@@ -34,6 +34,9 @@
readonly attribute double pageY;
readonly attribute EventTarget target;
readonly attribute unsigned long identifier;
+ readonly attribute double radiusX;
+ readonly attribute double radiusY;
+ readonly attribute float force;
[MeasureAs=PrefixedTouchRadiusX] readonly attribute double webkitRadiusX;
[MeasureAs=PrefixedTouchRadiusY] readonly attribute double webkitRadiusY;
[MeasureAs=PrefixedTouchRotationAngle] readonly attribute float webkitRotationAngle;
diff --git a/core/dom/URL.idl b/core/dom/URL.idl
index 37b8051..64f14fb 100644
--- a/core/dom/URL.idl
+++ b/core/dom/URL.idl
@@ -27,10 +27,10 @@
// http://url.spec.whatwg.org/#url
[
- Constructor(DOMString url),
- Constructor(DOMString url, DOMString base),
- Constructor(DOMString url, URL base),
- Exposed=Window&Worker,
+ Constructor(ScalarValueString url),
+ Constructor(ScalarValueString url, ScalarValueString base),
+ Constructor(ScalarValueString url, URL base),
+ Exposed=(Window,Worker),
ImplementedAs=DOMURL,
RaisesException=Constructor,
WillBeGarbageCollected,
@@ -38,7 +38,7 @@
// FIXME: should be in separate URLBlob.idl partial interface definition
// http://dev.w3.org/2006/webapi/FileAPI/#URL-object
// FIXME: should not be nullable
- [RaisesException, CallWith=ExecutionContext, TreatReturnedNullStringAs=Null] static DOMString createObjectURL(Blob? blob);
+ [RaisesException, CallWith=ExecutionContext] static DOMString? createObjectURL(Blob? blob);
[CallWith=ExecutionContext] static void revokeObjectURL(DOMString url);
};
diff --git a/core/dom/URLUtils.idl b/core/dom/URLUtils.idl
index 26ed382..5f0e115 100644
--- a/core/dom/URLUtils.idl
+++ b/core/dom/URLUtils.idl
@@ -29,20 +29,20 @@
NoInterfaceObject, // Always used on target of 'implements'
] interface URLUtils {
// FIXME: should be stringifier: http://crbug.com/306606
- // stringifier attribute DOMString href;
- [PerWorldBindings, LogActivity=SetterOnly, LogPreviousValue] attribute DOMString href;
- [NotEnumerable, ImplementedAs=href] DOMString toString();
- readonly attribute DOMString origin;
+ // stringifier attribute ScalarValueString href;
+ attribute ScalarValueString href;
+ [NotEnumerable, ImplementedAs=href] ScalarValueString toString();
+ readonly attribute ScalarValueString origin;
- attribute DOMString protocol;
- attribute DOMString username;
- attribute DOMString password;
- attribute DOMString host;
- attribute DOMString hostname;
- attribute DOMString port;
- attribute DOMString pathname;
- attribute DOMString search;
+ attribute ScalarValueString protocol;
+ attribute ScalarValueString username;
+ attribute ScalarValueString password;
+ attribute ScalarValueString host;
+ attribute ScalarValueString hostname;
+ attribute ScalarValueString port;
+ attribute ScalarValueString pathname;
+ attribute ScalarValueString search;
// Not yet implemented.
// attribute URLSearchParams searchParams;
- attribute DOMString hash;
+ attribute ScalarValueString hash;
};
diff --git a/core/dom/URLUtilsReadOnly.idl b/core/dom/URLUtilsReadOnly.idl
index ccd26f7..5330196 100644
--- a/core/dom/URLUtilsReadOnly.idl
+++ b/core/dom/URLUtilsReadOnly.idl
@@ -29,17 +29,16 @@
NoInterfaceObject, // Always used on target of 'implements'
] interface URLUtilsReadOnly {
// FIXME: should be stringifier: http://crbug.com/306606
- // stringifier readonly attribute DOMString href;
- readonly attribute DOMString href;
- [NotEnumerable, ImplementedAs=href] DOMString toString();
- // Not yet implemented.
- // readonly attribute DOMString origin;
+ // stringifier readonly attribute ScalarValueString href;
+ readonly attribute ScalarValueString href;
+ [NotEnumerable, ImplementedAs=href] ScalarValueString toString();
+ readonly attribute ScalarValueString origin;
- readonly attribute DOMString protocol;
- readonly attribute DOMString host;
- readonly attribute DOMString hostname;
- readonly attribute DOMString port;
- readonly attribute DOMString pathname;
- readonly attribute DOMString search;
- readonly attribute DOMString hash;
+ readonly attribute ScalarValueString protocol;
+ readonly attribute ScalarValueString host;
+ readonly attribute ScalarValueString hostname;
+ readonly attribute ScalarValueString port;
+ readonly attribute ScalarValueString pathname;
+ readonly attribute ScalarValueString search;
+ readonly attribute ScalarValueString hash;
};
diff --git a/core/dom/shadow/ShadowRoot.idl b/core/dom/shadow/ShadowRoot.idl
index c7d26bb..f884756 100644
--- a/core/dom/shadow/ShadowRoot.idl
+++ b/core/dom/shadow/ShadowRoot.idl
@@ -29,14 +29,14 @@
[ImplementedAs=olderShadowRootForBindings] readonly attribute ShadowRoot olderShadowRoot;
- [TreatNullAs=NullString, CustomElementCallbacks, LogActivity=SetterOnly, RaisesException=Setter] attribute DOMString innerHTML;
+ [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerHTML;
[RaisesException] Node cloneNode([Default=Undefined] optional boolean deep);
Selection getSelection();
Element getElementById([Default=Undefined] optional DOMString elementId);
HTMLCollection getElementsByClassName([Default=Undefined] optional DOMString className);
HTMLCollection getElementsByTagName([Default=Undefined] optional DOMString tagName);
- HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
+ HTMLCollection getElementsByTagNameNS([Default=Undefined] optional DOMString? namespaceURI,
[Default=Undefined] optional DOMString localName);
Element elementFromPoint([Default=Undefined] optional long x,
diff --git a/core/page/Selection.idl b/core/editing/Selection.idl
similarity index 76%
rename from core/page/Selection.idl
rename to core/editing/Selection.idl
index 53b0826..dc27b0d 100644
--- a/core/page/Selection.idl
+++ b/core/editing/Selection.idl
@@ -27,11 +27,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// This is based off of Mozilla's Selection interface
-// https://developer.mozilla.org/En/DOM/Selection
+// This is based on the W3C standard HTML Editing APIs
+// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selection
+//
+// FIXME: Fix discrepancies from the standard, especially
+// * unsigned types where should be unsigned
+// * Nullability
+// * RemoveRange(Range range) method
+// http://crbug.com/391673
[
+ ImplementedAs=DOMSelection,
WillBeGarbageCollected,
- ImplementedAs=DOMSelection
] interface Selection {
readonly attribute Node anchorNode;
readonly attribute long anchorOffset;
@@ -39,26 +45,30 @@
readonly attribute long focusOffset;
readonly attribute boolean isCollapsed;
- readonly attribute long rangeCount;
-
- [RaisesException, TypeChecking=Interface|Nullable] void collapse(Node node,
- optional long offset);
- [RaisesException] void collapseToEnd();
+ [RaisesException, TypeChecking=Interface] void collapse(Node node, optional long offset);
[RaisesException] void collapseToStart();
+ [RaisesException] void collapseToEnd();
- [CustomElementCallbacks] void deleteFromDocument();
- boolean containsNode([Default=Undefined] optional Node node,
- [Default=Undefined] optional boolean allowPartial);
+ // FIXME: should be: optional long offset = 0 http://crbug.com/258153
+ // We mark offset as optional, defaulting to 0; this differs from spec.
+ // http://crbug.com/384966
+ [RaisesException, TypeChecking=Interface] void extend(Node node, optional long offset);
+
[RaisesException] void selectAllChildren([Default=Undefined] optional Node node);
+ [CustomElementCallbacks] void deleteFromDocument();
- [RaisesException] void extend([Default=Undefined] optional Node node,
- [Default=Undefined] optional long offset);
-
+ readonly attribute long rangeCount;
[RaisesException] Range getRangeAt([Default=Undefined] optional long index);
- void removeAllRanges();
void addRange([Default=Undefined] optional Range range);
+ void removeAllRanges();
- [NotEnumerable] DOMString toString();
+ [NotEnumerable] stringifier;
+
+ // Firefox extensions
+ // https://developer.mozilla.org/En/DOM/Selection
+ //
+ // FIXME: Add use counters.
+ boolean containsNode([Default = Undefined] optional Node node, [Default = Undefined] optional boolean allowPartial);
// WebKit extensions
[MeasureAs=SelectionBaseNode] readonly attribute Node baseNode;
@@ -77,11 +87,10 @@
[Default=Undefined] optional long baseOffset,
[Default=Undefined] optional Node extentNode,
[Default=Undefined] optional long extentOffset);
- [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, TypeChecking=Interface|Nullable] void setPosition(Node node,
- optional long offset);
+ [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, TypeChecking=Interface] void setPosition(Node node,
+ optional long offset);
- // IE extentions
+ // IE extensions
// http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
[MeasureAs=SelectionEmpty] void empty();
};
-
diff --git a/core/events/EventTarget.idl b/core/events/EventTarget.idl
index 69a4bc1..c83100d 100644
--- a/core/events/EventTarget.idl
+++ b/core/events/EventTarget.idl
@@ -24,10 +24,10 @@
] interface EventTarget {
// FIXME: first 2 args should be required, but throwing TypeError breaks
// legacy content. http://crbug.com/353484
- void addEventListener([TreatNullAs=NullString] optional DOMString type,
+ void addEventListener(optional DOMString? type,
optional EventListener listener,
optional boolean useCapture);
- void removeEventListener([TreatNullAs=NullString] optional DOMString type,
+ void removeEventListener(optional DOMString? type,
optional EventListener listener,
optional boolean useCapture);
[RaisesException] boolean dispatchEvent(Event event);
diff --git a/core/events/KeyboardEvent.idl b/core/events/KeyboardEvent.idl
index 9a16319..ca68d36 100644
--- a/core/events/KeyboardEvent.idl
+++ b/core/events/KeyboardEvent.idl
@@ -34,7 +34,6 @@
[InitializedByEventConstructor] readonly attribute boolean altKey;
[InitializedByEventConstructor] readonly attribute boolean metaKey;
[InitializedByEventConstructor] readonly attribute boolean repeat;
- readonly attribute boolean altGraphKey;
boolean getModifierState(DOMString keyArgument);
@@ -48,7 +47,6 @@
[Default=Undefined] optional boolean ctrlKey,
[Default=Undefined] optional boolean altKey,
[Default=Undefined] optional boolean shiftKey,
- [Default=Undefined] optional boolean metaKey,
- [Default=Undefined] optional boolean altGraphKey);
+ [Default=Undefined] optional boolean metaKey);
};
diff --git a/core/events/MessageEvent.idl b/core/events/MessageEvent.idl
index b9e155b..3f2fadc 100644
--- a/core/events/MessageEvent.idl
+++ b/core/events/MessageEvent.idl
@@ -27,7 +27,7 @@
[
EventConstructor,
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
RaisesException=Constructor,
Custom=Wrap,
] interface MessageEvent : Event {
diff --git a/core/events/MouseEvent.idl b/core/events/MouseEvent.idl
index f5b03c8..feda914 100644
--- a/core/events/MouseEvent.idl
+++ b/core/events/MouseEvent.idl
@@ -51,14 +51,14 @@
[Default=Undefined] optional unsigned short button,
[Default=Undefined] optional EventTarget relatedTarget);
- // extensions
- readonly attribute long offsetX;
- readonly attribute long offsetY;
- readonly attribute long x;
- readonly attribute long y;
- readonly attribute Node fromElement;
- readonly attribute Node toElement;
+ // Non-standard
+ [MeasureAs=MouseEventOffsetX] readonly attribute long offsetX;
+ [MeasureAs=MouseEventOffsetY] readonly attribute long offsetY;
+ [MeasureAs=MouseEventX] readonly attribute long x;
+ [MeasureAs=MouseEventY] readonly attribute long y;
+ [MeasureAs=MouseEventFromElement] readonly attribute Node fromElement;
+ [MeasureAs=MouseEventToElement] readonly attribute Node toElement;
- readonly attribute DataTransfer dataTransfer;
+ // FIXME: this belongs on the DragEvent interface
+ readonly attribute DataTransfer dataTransfer;
};
-
diff --git a/core/events/RelatedEvent.idl b/core/events/RelatedEvent.idl
new file mode 100644
index 0000000..7c3d25b
--- /dev/null
+++ b/core/events/RelatedEvent.idl
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ EventConstructor,
+ RuntimeEnabled=ContextMenu,
+] interface RelatedEvent : Event {
+ [InitializedByEventConstructor] readonly attribute EventTarget? relatedTarget;
+};
+
diff --git a/core/events/UIEvent.idl b/core/events/UIEvent.idl
index df8ec34..4d025d8 100644
--- a/core/events/UIEvent.idl
+++ b/core/events/UIEvent.idl
@@ -29,13 +29,14 @@
[Default=Undefined] optional Window view,
[Default=Undefined] optional long detail);
- // extensions
- readonly attribute long keyCode;
- readonly attribute long charCode;
- readonly attribute long layerX;
- readonly attribute long layerY;
- readonly attribute long pageX;
- readonly attribute long pageY;
- readonly attribute long which;
-};
+ // Non-standard
+ [MeasureAs=UIEventLayerX] readonly attribute long layerX;
+ [MeasureAs=UIEventLayerY] readonly attribute long layerY;
+ [MeasureAs=UIEventPageX] readonly attribute long pageX;
+ [MeasureAs=UIEventPageY] readonly attribute long pageY;
+ // FIXME: these belong on the KeyboardEvent interface
+ readonly attribute long keyCode;
+ readonly attribute long charCode;
+ readonly attribute long which;
+};
diff --git a/core/events/WheelEvent.idl b/core/events/WheelEvent.idl
index 6c7acff..91fcf88 100644
--- a/core/events/WheelEvent.idl
+++ b/core/events/WheelEvent.idl
@@ -33,25 +33,8 @@
[InitializedByEventConstructor] readonly attribute double deltaZ;
[InitializedByEventConstructor] readonly attribute unsigned long deltaMode;
- // Non standard API.
- [InitializedByEventConstructor] readonly attribute long wheelDeltaX;
- [InitializedByEventConstructor] readonly attribute long wheelDeltaY;
- readonly attribute long wheelDelta;
-
- // WebKit Extension
- [MeasureAs=PrefixedWheelEventDirectionInvertedFromDevice]
- readonly attribute boolean webkitDirectionInvertedFromDevice;
-
- [MeasureAs=PrefixedWheelEventInit]
- void initWebKitWheelEvent([Default=Undefined] optional long wheelDeltaX,
- [Default=Undefined] optional long wheelDeltaY,
- [Default=Undefined] optional Window view,
- [Default=Undefined] optional long screenX,
- [Default=Undefined] optional long screenY,
- [Default=Undefined] optional long clientX,
- [Default=Undefined] optional long clientY,
- [Default=Undefined] optional boolean ctrlKey,
- [Default=Undefined] optional boolean altKey,
- [Default=Undefined] optional boolean shiftKey,
- [Default=Undefined] optional boolean metaKey);
+ // Non-standard API.
+ [InitializedByEventConstructor, MeasureAs=WheelEventWheelDeltaX] readonly attribute long wheelDeltaX;
+ [InitializedByEventConstructor, MeasureAs=WheelEventWheelDeltaY] readonly attribute long wheelDeltaY;
+ [MeasureAs=WheelEventWheelDelta] readonly attribute long wheelDelta;
};
diff --git a/core/fileapi/Blob.idl b/core/fileapi/Blob.idl
index df6662d..5f59e11 100644
--- a/core/fileapi/Blob.idl
+++ b/core/fileapi/Blob.idl
@@ -32,13 +32,13 @@
WillBeGarbageCollected,
CustomConstructor,
CustomConstructor(sequence<any> blobParts, optional BlobPropertyBag options),
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
SpecialWrapFor=File,
] interface Blob {
readonly attribute unsigned long long size;
readonly attribute DOMString type;
- [RaisesException] Blob slice(optional long long start, optional long long end, [TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString contentType);
+ [RaisesException] Blob slice(optional long long start, optional long long end, [TreatUndefinedAs=NullString] optional DOMString? contentType);
[RaisesException, CallWith=ExecutionContext, RuntimeEnabled=FileAPIBlobClose] void close();
};
diff --git a/core/fileapi/File.idl b/core/fileapi/File.idl
index db6c425..c338fa2 100644
--- a/core/fileapi/File.idl
+++ b/core/fileapi/File.idl
@@ -25,10 +25,10 @@
[
CustomConstructor(sequence<any> blobParts, DOMString fileName, optional BlobPropertyBag options),
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
] interface File : Blob {
readonly attribute DOMString name;
- [Custom=Getter, MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
- [Custom=Getter, RuntimeEnabled=FileConstructor] readonly attribute long long lastModified;
+ [MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
+ readonly attribute long long lastModified;
[MeasureAs=PrefixedFileRelativePath] readonly attribute DOMString webkitRelativePath;
};
diff --git a/core/fileapi/FileList.idl b/core/fileapi/FileList.idl
index d822313..e7e296a 100644
--- a/core/fileapi/FileList.idl
+++ b/core/fileapi/FileList.idl
@@ -24,9 +24,9 @@
*/
[
+ Exposed=(Window,Worker),
WillBeGarbageCollected
] interface FileList {
readonly attribute unsigned long length;
getter File item(unsigned long index);
};
-
diff --git a/core/fileapi/FileReader.idl b/core/fileapi/FileReader.idl
index 07bb5a8..d6cd5d0 100644
--- a/core/fileapi/FileReader.idl
+++ b/core/fileapi/FileReader.idl
@@ -34,7 +34,7 @@
ActiveDOMObject,
Constructor,
ConstructorCallWith=ExecutionContext,
- Exposed=Window&Worker
+ Exposed=(Window,Worker)
] interface FileReader : EventTarget {
// ready states
const unsigned short EMPTY = 0;
diff --git a/core/frame/ConsoleBase.idl b/core/frame/ConsoleBase.idl
index 26f9cde..508c5b9 100644
--- a/core/frame/ConsoleBase.idl
+++ b/core/frame/ConsoleBase.idl
@@ -31,21 +31,21 @@
NoInterfaceObject,
WillBeGarbageCollected,
] interface ConsoleBase {
- [CallWith=ScriptArguments&ScriptState] void debug();
- [CallWith=ScriptArguments&ScriptState] void error();
- [CallWith=ScriptArguments&ScriptState] void info();
- [CallWith=ScriptArguments&ScriptState] void log();
- [CallWith=ScriptArguments&ScriptState] void warn();
- [CallWith=ScriptArguments&ScriptState] void dir();
- [CallWith=ScriptArguments&ScriptState] void dirxml();
- [CallWith=ScriptArguments&ScriptState] void table();
- [CallWith=ScriptArguments&ScriptState] void trace();
- [CallWith=ScriptArguments&ScriptState, ImplementedAs=assertCondition, DartName=assertCondition] void assert([Default=Undefined] optional boolean condition);
- [CallWith=ScriptArguments&ScriptState] void count();
+ [CallWith=(ScriptArguments,ScriptState)] void debug();
+ [CallWith=(ScriptArguments,ScriptState)] void error();
+ [CallWith=(ScriptArguments,ScriptState)] void info();
+ [CallWith=(ScriptArguments,ScriptState)] void log();
+ [CallWith=(ScriptArguments,ScriptState)] void warn();
+ [CallWith=(ScriptArguments,ScriptState)] void dir();
+ [CallWith=(ScriptArguments,ScriptState)] void dirxml();
+ [CallWith=(ScriptArguments,ScriptState)] void table();
+ [CallWith=(ScriptArguments,ScriptState)] void trace();
+ [CallWith=(ScriptArguments,ScriptState), ImplementedAs=assertCondition, DartName=assertCondition] void assert([Default=Undefined] optional boolean condition);
+ [CallWith=(ScriptArguments,ScriptState)] void count();
[DeprecateAs=ConsoleMarkTimeline] void markTimeline(optional DOMString title = null);
- [CallWith=ScriptState] void profile(optional DOMString title = null);
- [CallWith=ScriptState] void profileEnd(optional DOMString title = null);
+ void profile(optional DOMString title = null);
+ void profileEnd(optional DOMString title = null);
void time(optional DOMString title = null);
[CallWith=ScriptState] void timeEnd(optional DOMString title = null);
@@ -54,8 +54,8 @@
[CallWith=ScriptState] void timeline(optional DOMString title = null);
[CallWith=ScriptState] void timelineEnd(optional DOMString title = null);
- [CallWith=ScriptArguments&ScriptState] void group();
- [CallWith=ScriptArguments&ScriptState] void groupCollapsed();
+ [CallWith=(ScriptArguments,ScriptState)] void group();
+ [CallWith=(ScriptArguments,ScriptState)] void groupCollapsed();
void groupEnd();
- [CallWith=ScriptArguments&ScriptState] void clear();
+ [CallWith=(ScriptArguments,ScriptState)] void clear();
};
diff --git a/core/frame/Location.idl b/core/frame/Location.idl
index 25a0110..e4e9ff0 100644
--- a/core/frame/Location.idl
+++ b/core/frame/Location.idl
@@ -35,26 +35,26 @@
// property of an *existing* document at a different origin.
// However, *reading* |href|, or accessing any component, is a security
// problem, since that allows tracking navigation.
- [SetterCallWith=ActiveWindow&FirstWindow, DoNotCheckSecurity=Setter, Unforgeable, DartCustom=Setter] attribute DOMString href;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity=Setter, Unforgeable, DartCustom=Setter] attribute DOMString href;
- [CallWith=ActiveWindow&FirstWindow, DoNotCheckSecurity, Unforgeable, ReadOnly, LogActivity, DartCustom] void assign(DOMString url);
- [CallWith=ActiveWindow&FirstWindow, DoNotCheckSecurity, Unforgeable, ReadOnly, LogActivity, DartCustom] void replace(DOMString url);
- [CallWith=ActiveWindow, Unforgeable, ReadOnly, DartCustom] void reload();
+ [CallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity, Unforgeable, DartCustom] void assign(DOMString url);
+ [CallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity, Unforgeable, DartCustom] void replace(DOMString url);
+ [CallWith=ActiveWindow, Unforgeable, DartCustom] void reload();
// URI decomposition attributes
- [SetterCallWith=ActiveWindow&FirstWindow, RaisesException=Setter, DartCustom=Setter] attribute DOMString protocol;
- [SetterCallWith=ActiveWindow&FirstWindow, DartCustom=Setter] attribute DOMString host;
- [SetterCallWith=ActiveWindow&FirstWindow, DartCustom=Setter] attribute DOMString hostname;
- [SetterCallWith=ActiveWindow&FirstWindow, DartCustom=Setter] attribute DOMString port;
- [SetterCallWith=ActiveWindow&FirstWindow, DartCustom=Setter] attribute DOMString pathname;
- [SetterCallWith=ActiveWindow&FirstWindow, DartCustom=Setter] attribute DOMString search;
- [SetterCallWith=ActiveWindow&FirstWindow, DartCustom=Setter] attribute DOMString hash;
+ [SetterCallWith=(ActiveWindow,FirstWindow), RaisesException=Setter, DartCustom=Setter] attribute DOMString protocol;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DartCustom=Setter] attribute DOMString host;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DartCustom=Setter] attribute DOMString hostname;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DartCustom=Setter] attribute DOMString port;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DartCustom=Setter] attribute DOMString pathname;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DartCustom=Setter] attribute DOMString search;
+ [SetterCallWith=(ActiveWindow,FirstWindow), DartCustom=Setter] attribute DOMString hash;
readonly attribute DOMString origin;
readonly attribute DOMStringList ancestorOrigins;
- [NotEnumerable, Unforgeable, ReadOnly, ImplementedAs=href] DOMString toString();
- [NotEnumerable, Custom, Unforgeable, ReadOnly] any valueOf();
+ [NotEnumerable, Unforgeable, ImplementedAs=href] DOMString toString();
+ [NotEnumerable, Custom, Unforgeable] any valueOf();
};
diff --git a/core/frame/WebKitPoint.idl b/core/frame/WebKitPoint.idl
index bddd675..cc11b47 100644
--- a/core/frame/WebKitPoint.idl
+++ b/core/frame/WebKitPoint.idl
@@ -26,7 +26,7 @@
[
CustomConstructor,
CustomConstructor(float x, float y),
- ImplementedAs=DOMPoint,
+ MeasureAs=WebKitPoint,
WillBeGarbageCollected,
] interface WebKitPoint {
attribute float x;
diff --git a/core/frame/Window.idl b/core/frame/Window.idl
index 3e75b0b..f9f7d3e 100644
--- a/core/frame/Window.idl
+++ b/core/frame/Window.idl
@@ -45,7 +45,7 @@
[Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar;
[LogActivity=GetterOnly] readonly attribute Navigator navigator;
[Replaceable] readonly attribute Navigator clientInformation;
- [DoNotCheckSecurity, Unforgeable, Replaceable, LogActivity, PutForwards=href] readonly attribute Location location;
+ [DoNotCheckSecurity, Unforgeable, Replaceable, PutForwards=href] readonly attribute Location location;
[Custom, MeasureAs=WindowEvent, NotEnumerable] attribute Event event;
Selection getSelection();
@@ -69,9 +69,9 @@
void alert();
void alert(DOMString message);
- boolean confirm(optional DOMString message = null);
- [TreatReturnedNullStringAs=Null] DOMString prompt(optional DOMString message = null,
- optional DOMString defaultValue = null);
+ boolean confirm(optional DOMString message = "");
+ DOMString? prompt(optional DOMString message = "",
+ optional DOMString defaultValue = "");
boolean find([Default=Undefined] optional DOMString string,
[Default=Undefined] optional boolean caseSensitive,
@@ -140,19 +140,14 @@
// DOM Level 2 Style Interface
CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element,
- [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString pseudoElement);
+ [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement);
// WebKit extensions
[MeasureAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element,
- [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString pseudoElement);
+ [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement);
[Replaceable] readonly attribute double devicePixelRatio;
- [MeasureAs=PrefixedConvertPointFromPageToNode] WebKitPoint webkitConvertPointFromPageToNode([Default=Undefined] optional Node node,
- [Default=Undefined] optional WebKitPoint p);
- [MeasureAs=PrefixedConvertPointFromNodeToPage] WebKitPoint webkitConvertPointFromNodeToPage([Default=Undefined] optional Node node,
- [Default=Undefined] optional WebKitPoint p);
-
[RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache;
[RuntimeEnabled=SessionStorage, LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage sessionStorage;
@@ -166,7 +161,7 @@
[Replaceable] readonly attribute Console console;
// cross-document messaging
- [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScriptValue message, DOMString targetOrigin, optional MessagePort[] messagePorts);
+ [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScriptValue message, DOMString targetOrigin, optional sequence<Transferable> transfer);
[Replaceable] readonly attribute Performance performance;
@@ -193,7 +188,7 @@
attribute EventHandler onwebkitanimationiteration;
attribute EventHandler onwebkitanimationstart;
attribute EventHandler onwebkittransitionend;
- [LogActivity=SetterOnly] attribute EventHandler onwheel;
+ attribute EventHandler onwheel;
[MeasureAs=WindowCaptureEvents] void captureEvents();
[MeasureAs=WindowReleaseEvents] void releaseEvents();
@@ -205,12 +200,27 @@
[MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver;
// window.toString() requires special handling in V8
- [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
+ [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] stringifier;
[NotEnumerable] getter Window (unsigned long index);
[Custom, NotEnumerable] getter Window (DOMString name);
};
+// http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects
+//
+// Expressing the Transferable typedef in IDL depends on http://crbug.com/240176.
+// The postMessage() methods taking a Transferable array argument have custom
+// binding code that is able to handle the Transferables that we currently
+// recognize. To be able to declare a postMessage() signature that matches
+// the implementation, we provide a Transferable typedef but with an
+// incomplete type.
+//
+// FIXME: make this typedef accurate once enough of http://crbug.com/240176
+// is in place.
+// FIXME: consider putting this typedef in an .idl file containing spec-wide
+// utility type definitions.
+typedef MessagePort Transferable;
+
Window implements GlobalEventHandlers;
Window implements WindowBase64;
Window implements WindowEventHandlers;
diff --git a/core/html/FormData.idl b/core/html/FormData.idl
index 5b51e24..bab02fc 100644
--- a/core/html/FormData.idl
+++ b/core/html/FormData.idl
@@ -32,7 +32,7 @@
[
Constructor(optional HTMLFormElement form),
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
ImplementedAs=DOMFormData,
WillBeGarbageCollected,
] interface FormData {
diff --git a/core/html/HTMLBodyElement.idl b/core/html/HTMLBodyElement.idl
index 6f454c6..9a06a3c 100644
--- a/core/html/HTMLBodyElement.idl
+++ b/core/html/HTMLBodyElement.idl
@@ -19,12 +19,12 @@
*/
interface HTMLBodyElement : HTMLElement {
- [Reflect, TreatNullAs=NullString] attribute DOMString aLink;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString aLink;
[Reflect] attribute DOMString background;
- [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
- [Reflect, TreatNullAs=NullString] attribute DOMString link;
- [Reflect, TreatNullAs=NullString] attribute DOMString text;
- [Reflect, TreatNullAs=NullString] attribute DOMString vLink;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString link;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString text;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString vLink;
[RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
diff --git a/core/html/HTMLButtonElement.idl b/core/html/HTMLButtonElement.idl
index d92dcd1..7845755 100644
--- a/core/html/HTMLButtonElement.idl
+++ b/core/html/HTMLButtonElement.idl
@@ -22,7 +22,7 @@
[Reflect] attribute boolean autofocus;
[Reflect] attribute boolean disabled;
[ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString formAction;
+ [Reflect, URL] attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
[Reflect] attribute boolean formNoValidate;
@@ -35,7 +35,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLCanvasElement.idl b/core/html/HTMLCanvasElement.idl
index 5c851ab..47c796b 100644
--- a/core/html/HTMLCanvasElement.idl
+++ b/core/html/HTMLCanvasElement.idl
@@ -30,11 +30,11 @@
attribute long height;
// FIXMEDART: Upstream: Added the optional quality param that V8 accepts.
- [Custom, RaisesException] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString type, optional float quality);
+ [Custom, RaisesException] DOMString toDataURL([TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? type, optional float quality);
// FIXMEDART:
// - Upstream: Added the optional quality param that V8 accepts.
// - Return RenderingContext.
// The custom binding is needed to handle context creation attributes.
- [Custom, LogActivity] any getContext([Default=Undefined] optional DOMString contextId, optional Dictionary attrs);
+ [Custom] any getContext([Default=Undefined] optional DOMString contextId, optional Dictionary attrs);
};
diff --git a/core/html/HTMLDocument.idl b/core/html/HTMLDocument.idl
index 04ba97f..e166240 100644
--- a/core/html/HTMLDocument.idl
+++ b/core/html/HTMLDocument.idl
@@ -18,18 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-[
- // FIXME: Oilpan: remove this once Node specifies WillBeGarbageCollected.
- WillBeGarbageCollected
-] interface HTMLDocument : Document {
+interface HTMLDocument : Document {
[Custom, CustomElementCallbacks] void open();
[RaisesException] void close();
// We support multiple DOMString arguments to match FF / IE, e.g.:
// document.write("a", "b", "c") --> document.write("abc")
// document.write() --> document.write("")
- [CallWith=ActiveWindow,LogActivity, CustomElementCallbacks, RaisesException] void write(DOMString... text);
- [CallWith=ActiveWindow, LogActivity, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
+ [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void write(DOMString... text);
+ [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
// Extensions
diff --git a/core/html/HTMLElement.idl b/core/html/HTMLElement.idl
index 65e7cb2..a138212 100644
--- a/core/html/HTMLElement.idl
+++ b/core/html/HTMLElement.idl
@@ -28,7 +28,7 @@
[CustomElementCallbacks] attribute long tabIndex;
[CustomElementCallbacks] attribute boolean draggable;
- [Reflect, TreatNullAs=NullString] attribute DOMString webkitdropzone;
+ [Reflect, TreatNullAs=NullString, MeasureAs=PrefixedHTMLElementDropzone] attribute DOMString webkitdropzone;
[Reflect] attribute boolean hidden;
[Reflect] attribute DOMString accessKey;
diff --git a/core/html/HTMLEmbedElement.idl b/core/html/HTMLEmbedElement.idl
index 399417d..b07922d 100644
--- a/core/html/HTMLEmbedElement.idl
+++ b/core/html/HTMLEmbedElement.idl
@@ -24,7 +24,7 @@
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString height;
[Reflect] attribute DOMString name;
- [Reflect, URL, LogActivity=SetterOnly, LogPreviousValue] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString type;
[Reflect] attribute DOMString width;
[Custom, NotEnumerable] getter boolean (unsigned long index);
diff --git a/core/html/HTMLFieldSetElement.idl b/core/html/HTMLFieldSetElement.idl
index 94d9f0f..e8fcd53 100644
--- a/core/html/HTMLFieldSetElement.idl
+++ b/core/html/HTMLFieldSetElement.idl
@@ -30,5 +30,5 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
};
diff --git a/core/html/HTMLFontElement.idl b/core/html/HTMLFontElement.idl
index c0c56d4..cc7b704 100644
--- a/core/html/HTMLFontElement.idl
+++ b/core/html/HTMLFontElement.idl
@@ -18,7 +18,7 @@
*/
interface HTMLFontElement : HTMLElement {
- [Reflect, TreatNullAs=NullString] attribute DOMString color;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString color;
[Reflect] attribute DOMString face;
[Reflect] attribute DOMString size;
};
diff --git a/core/html/HTMLFormElement.idl b/core/html/HTMLFormElement.idl
index 68283fc..6c2f1f9 100644
--- a/core/html/HTMLFormElement.idl
+++ b/core/html/HTMLFormElement.idl
@@ -22,7 +22,7 @@
OverrideBuiltins,
] interface HTMLFormElement : HTMLElement {
[Reflect=accept_charset] attribute DOMString acceptCharset;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString action;
+ [Reflect, URL] attribute DOMString action;
[Reflect, ReflectOnly="on"|"off", ReflectMissing="on", ReflectInvalid="on"] attribute DOMString autocomplete;
[CustomElementCallbacks] attribute DOMString enctype;
[CustomElementCallbacks] attribute DOMString encoding;
@@ -36,7 +36,7 @@
[ImplementedAs=item] getter Element (unsigned long index);
[NotEnumerable] getter (RadioNodeList or Element) (DOMString name);
- [ImplementedAs=submitFromJavaScript, LogActivity] void submit();
+ [ImplementedAs=submitFromJavaScript] void submit();
[CustomElementCallbacks] void reset();
boolean checkValidity();
diff --git a/core/html/HTMLFrameElement.idl b/core/html/HTMLFrameElement.idl
index ed43c3c..13c840c 100644
--- a/core/html/HTMLFrameElement.idl
+++ b/core/html/HTMLFrameElement.idl
@@ -22,12 +22,12 @@
[Reflect] attribute DOMString frameBorder;
[Reflect, URL] attribute DOMString longDesc;
- [Reflect, TreatNullAs=NullString] attribute DOMString marginHeight;
- [Reflect, TreatNullAs=NullString] attribute DOMString marginWidth;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
[Reflect] attribute DOMString name;
[Reflect] attribute boolean noResize;
[Reflect] attribute DOMString scrolling;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
// Introduced in DOM Level 2:
[CheckSecurity=Node] readonly attribute Document contentDocument;
@@ -36,7 +36,4 @@
readonly attribute Window contentWindow;
[CheckSecurity=Node, RaisesException] Document getSVGDocument();
-
- [MeasureAs=HTMLFrameElementWidth] readonly attribute long width;
- [MeasureAs=HTMLFrameElementHeight] readonly attribute long height;
};
diff --git a/core/html/HTMLIFrameElement.idl b/core/html/HTMLIFrameElement.idl
index 90c3a7a..568cd6b 100644
--- a/core/html/HTMLIFrameElement.idl
+++ b/core/html/HTMLIFrameElement.idl
@@ -20,15 +20,16 @@
interface HTMLIFrameElement : HTMLElement {
[Reflect] attribute DOMString align;
+ [Reflect] attribute boolean allowFullscreen;
[Reflect] attribute DOMString frameBorder;
[Reflect] attribute DOMString height;
[Reflect, URL] attribute DOMString longDesc;
- [Reflect, TreatNullAs=NullString] attribute DOMString marginHeight;
- [Reflect, TreatNullAs=NullString] attribute DOMString marginWidth;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
[Reflect] attribute DOMString name;
[Reflect, TreatNullAs=NullString] attribute DOMString sandbox;
[Reflect] attribute DOMString scrolling;
- [Reflect, URL, LogActivity=SetterOnly, LogPreviousValue] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString srcdoc;
[Reflect] attribute DOMString width;
diff --git a/core/html/HTMLImageElement.idl b/core/html/HTMLImageElement.idl
index 1914a5f..bd0808a 100644
--- a/core/html/HTMLImageElement.idl
+++ b/core/html/HTMLImageElement.idl
@@ -26,18 +26,18 @@
] interface HTMLImageElement : HTMLElement {
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString alt;
- [Reflect, TreatNullAs=NullString] attribute DOMString border;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
readonly attribute boolean complete;
[Reflect, ReflectOnly="anonymous"|"use-credentials", ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString crossOrigin;
attribute long height;
[Reflect] attribute long hspace;
[Reflect] attribute boolean isMap;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString longDesc;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString lowsrc;
+ [Reflect, URL] attribute DOMString longDesc;
+ [Reflect, URL] attribute DOMString lowsrc;
[Reflect] attribute DOMString name;
readonly attribute long naturalHeight;
readonly attribute long naturalWidth;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString srcset;
[Reflect, RuntimeEnabled=PictureSizes] attribute DOMString sizes;
[RuntimeEnabled=PictureSizes] readonly attribute DOMString currentSrc;
diff --git a/core/html/HTMLInputElement.idl b/core/html/HTMLInputElement.idl
index 8f44cfb..61a1ff6 100644
--- a/core/html/HTMLInputElement.idl
+++ b/core/html/HTMLInputElement.idl
@@ -35,7 +35,7 @@
// The 'files' attribute is intentionally not readonly.
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22682
attribute FileList files;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString formAction;
+ [Reflect, URL] attribute DOMString formAction;
[CustomElementCallbacks] attribute DOMString formEnctype;
[CustomElementCallbacks] attribute DOMString formMethod;
[Reflect] attribute boolean formNoValidate;
@@ -54,13 +54,13 @@
[Reflect] attribute boolean readOnly;
[Reflect] attribute boolean required;
[RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size; // Changed string -> long -> unsigned long
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString step;
[CustomElementCallbacks] attribute DOMString type; // readonly dropped as part of DOM level 2
- [CustomElementCallbacks] attribute DOMString defaultValue;
+ [Reflect=value, CustomElementCallbacks] attribute DOMString defaultValue;
[Reflect] attribute DOMString useMap;
// See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
- [TreatNullAs=NullString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
+ [TreatNullAs=EmptyString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
[RaisesException=Setter, CustomElementCallbacks] attribute Date? valueAsDate;
[RaisesException=Setter, CustomElementCallbacks] attribute unrestricted double valueAsNumber;
@@ -72,7 +72,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
readonly attribute NodeList labels;
@@ -97,5 +97,5 @@
[Reflect, MeasureAs=IncrementalAttribute] attribute boolean incremental;
// See http://www.w3.org/TR/html-media-capture/
- [Conditional=MEDIA_CAPTURE, Reflect] attribute boolean capture;
+ [RuntimeEnabled=MediaCapture, Reflect] attribute boolean capture;
};
diff --git a/core/html/HTMLKeygenElement.idl b/core/html/HTMLKeygenElement.idl
index 4484e2b..3310c18 100644
--- a/core/html/HTMLKeygenElement.idl
+++ b/core/html/HTMLKeygenElement.idl
@@ -42,7 +42,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLLinkElement.idl b/core/html/HTMLLinkElement.idl
index 3ba1aff..667acdb 100644
--- a/core/html/HTMLLinkElement.idl
+++ b/core/html/HTMLLinkElement.idl
@@ -22,7 +22,7 @@
interface HTMLLinkElement : HTMLElement {
[Reflect] attribute boolean disabled;
[Reflect] attribute DOMString charset;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString href;
+ [Reflect, URL] attribute DOMString href;
[Reflect, ReflectOnly="anonymous"|"use-credentials", ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString crossOrigin;
[Reflect] attribute DOMString hreflang;
[Reflect] attribute DOMString media;
diff --git a/core/html/HTMLMarqueeElement.idl b/core/html/HTMLMarqueeElement.idl
index 0188f6c..19841be 100644
--- a/core/html/HTMLMarqueeElement.idl
+++ b/core/html/HTMLMarqueeElement.idl
@@ -21,17 +21,17 @@
void start();
void stop();
- [Reflect] attribute DOMString behavior;
- [Reflect] attribute DOMString bgColor;
- [Reflect] attribute DOMString direction;
- [Reflect] attribute DOMString height;
- [Reflect] attribute unsigned long hspace;
- [RaisesException=Setter] attribute long loop;
- [RaisesException=Setter] attribute long scrollAmount;
- [RaisesException=Setter] attribute long scrollDelay;
- [Reflect] attribute boolean trueSpeed;
- [Reflect] attribute unsigned long vspace;
- [Reflect] attribute DOMString width;
+ [ImplementedInPrivateScript, Reflect] attribute DOMString behavior;
+ [ImplementedInPrivateScript, Reflect] attribute DOMString bgColor;
+ [ImplementedInPrivateScript, Reflect] attribute DOMString direction;
+ [ImplementedInPrivateScript, Reflect] attribute DOMString height;
+ [ImplementedInPrivateScript, Reflect] attribute unsigned long hspace;
+ [ImplementedInPrivateScript] attribute long loop;
+ [ImplementedInPrivateScript] attribute long scrollAmount;
+ [ImplementedInPrivateScript] attribute long scrollDelay;
+ [ImplementedInPrivateScript, Reflect] attribute boolean trueSpeed;
+ [ImplementedInPrivateScript, Reflect] attribute unsigned long vspace;
+ [ImplementedInPrivateScript, Reflect] attribute DOMString width;
// FIXME: Implement the following event handler attributes
// https://bugs.webkit.org/show_bug.cgi?id=49788
diff --git a/core/html/HTMLMediaElement.idl b/core/html/HTMLMediaElement.idl
index 3d87a59..aa9d040 100644
--- a/core/html/HTMLMediaElement.idl
+++ b/core/html/HTMLMediaElement.idl
@@ -30,11 +30,11 @@
] interface HTMLMediaElement : HTMLElement {
// error state
- [TypeChecking=Interface|Nullable] readonly attribute MediaError? error;
+ readonly attribute MediaError? error;
// network state
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
- [URL, LogActivity=SetterOnly] readonly attribute DOMString currentSrc;
+ [Reflect, URL] attribute DOMString src;
+ [URL] readonly attribute DOMString currentSrc;
[Reflect, ReflectOnly="anonymous"|"use-credentials", ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString crossOrigin;
const unsigned short NETWORK_EMPTY = 0;
@@ -46,7 +46,7 @@
readonly attribute TimeRanges buffered;
void load();
- DOMString canPlayType(DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
+ DOMString canPlayType(DOMString type, [Default=Undefined, TreatUndefinedAs=NullString] optional DOMString? keySystem);
// ready state
const unsigned short HAVE_NOTHING = 0;
@@ -73,10 +73,10 @@
// media controller
[RuntimeEnabled=MediaController, Reflect] attribute DOMString mediaGroup;
- [RuntimeEnabled=MediaController, TypeChecking=Interface|Nullable] attribute MediaController? controller;
+ [RuntimeEnabled=MediaController, TypeChecking=Interface] attribute MediaController? controller;
// controls
- attribute boolean controls;
+ [Reflect] attribute boolean controls;
[RaisesException=Setter] attribute double volume;
attribute boolean muted;
[Reflect=muted] attribute boolean defaultMuted;
diff --git a/core/html/HTMLMenuElement.idl b/core/html/HTMLMenuElement.idl
index ea756fc..42110b5 100644
--- a/core/html/HTMLMenuElement.idl
+++ b/core/html/HTMLMenuElement.idl
@@ -18,6 +18,8 @@
*/
interface HTMLMenuElement : HTMLElement {
+ [RuntimeEnabled=ContextMenu, Reflect] attribute DOMString type;
+ [RuntimeEnabled=ContextMenu, Reflect] attribute DOMString label;
[Reflect] attribute boolean compact;
};
diff --git a/core/html/HTMLMenuItemElement.idl b/core/html/HTMLMenuItemElement.idl
new file mode 100644
index 0000000..cf770ad
--- /dev/null
+++ b/core/html/HTMLMenuItemElement.idl
@@ -0,0 +1,14 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=ContextMenu,
+] interface HTMLMenuItemElement : HTMLElement {
+ [Reflect] attribute DOMString type;
+ [Reflect] attribute DOMString label;
+ [Reflect] attribute boolean disabled;
+ [Reflect] attribute boolean checked;
+ [Reflect] attribute boolean default;
+ // FIXME: icon, radiogroup and command need to be implemented.
+};
diff --git a/core/html/HTMLModElement.idl b/core/html/HTMLModElement.idl
index 3c9bf9f..9b749b2 100644
--- a/core/html/HTMLModElement.idl
+++ b/core/html/HTMLModElement.idl
@@ -18,6 +18,6 @@
*/
interface HTMLModElement : HTMLElement {
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString cite;
+ [Reflect, URL] attribute DOMString cite;
[Reflect] attribute DOMString dateTime;
};
diff --git a/core/html/HTMLObjectElement.idl b/core/html/HTMLObjectElement.idl
index b6c7cce..4eb6f39 100644
--- a/core/html/HTMLObjectElement.idl
+++ b/core/html/HTMLObjectElement.idl
@@ -25,10 +25,10 @@
[Reflect] attribute DOMString code;
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString archive;
- [Reflect, TreatNullAs=NullString] attribute DOMString border;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
[Reflect, URL] attribute DOMString codeBase;
[Reflect] attribute DOMString codeType;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString data;
+ [Reflect, URL] attribute DOMString data;
[Reflect] attribute boolean declare;
[Reflect] attribute DOMString height;
[Reflect] attribute long hspace;
@@ -42,7 +42,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
// Introduced in DOM Level 2:
[CheckSecurity=Node] readonly attribute Document contentDocument;
diff --git a/core/html/HTMLOptionsCollection.idl b/core/html/HTMLOptionsCollection.idl
index 8493d14..01f3e25 100644
--- a/core/html/HTMLOptionsCollection.idl
+++ b/core/html/HTMLOptionsCollection.idl
@@ -26,12 +26,11 @@
attribute long selectedIndex;
[Custom=Setter, RaisesException=Setter] attribute unsigned long length;
[ImplementedAs=item] getter Node (unsigned long index);
- [RaisesException, TypeChecking=Interface|Nullable] setter HTMLOptionElement (unsigned long index, HTMLOptionElement? value);
+ [RaisesException, TypeChecking=Interface] setter HTMLOptionElement (unsigned long index, HTMLOptionElement? value);
// FIXME: The spec and firefox return an Element (the first matching Element).
[ImplementedAs=namedGetter] getter (NodeList or Element) namedItem(DOMString name);
[Custom, RaisesException, DartSuppress] void add([Default=Undefined] optional HTMLOptionElement option, optional unsigned long index);
void remove(unsigned long index);
- [MeasureAs=HTMLOptionsCollectionRemoveElement, DartSuppress] void remove(HTMLOptionElement option); // non-standard
};
diff --git a/core/html/HTMLOutputElement.idl b/core/html/HTMLOutputElement.idl
index ec24c46..c9fe3b2 100644
--- a/core/html/HTMLOutputElement.idl
+++ b/core/html/HTMLOutputElement.idl
@@ -35,7 +35,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLPreElement.idl b/core/html/HTMLPreElement.idl
index 6224bc9..34742c6 100644
--- a/core/html/HTMLPreElement.idl
+++ b/core/html/HTMLPreElement.idl
@@ -20,7 +20,4 @@
interface HTMLPreElement : HTMLElement {
[Reflect] attribute long width;
-
- // Extensions
- [Reflect, MeasureAs=HTMLPreElementWrap] attribute boolean wrap;
};
diff --git a/core/html/HTMLQuoteElement.idl b/core/html/HTMLQuoteElement.idl
index db0ab9d..c53a1a2 100644
--- a/core/html/HTMLQuoteElement.idl
+++ b/core/html/HTMLQuoteElement.idl
@@ -18,5 +18,5 @@
*/
interface HTMLQuoteElement : HTMLElement {
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString cite;
+ [Reflect, URL] attribute DOMString cite;
};
diff --git a/core/html/HTMLScriptElement.idl b/core/html/HTMLScriptElement.idl
index 71b5422..a626770 100644
--- a/core/html/HTMLScriptElement.idl
+++ b/core/html/HTMLScriptElement.idl
@@ -24,7 +24,7 @@
[Reflect] attribute DOMString charset;
attribute boolean async;
[Reflect] attribute boolean defer;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString type;
[Reflect, ReflectOnly="anonymous"|"use-credentials", ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString crossOrigin;
[Reflect, RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute DOMString nonce;
diff --git a/core/html/HTMLSelectElement.idl b/core/html/HTMLSelectElement.idl
index 470d9c2..b4ddd80 100644
--- a/core/html/HTMLSelectElement.idl
+++ b/core/html/HTMLSelectElement.idl
@@ -42,7 +42,7 @@
[ImplementedAs=addBeforeOptionAtIndex, RaisesException, TypeChecking=Interface] void add(HTMLElement element, long before);
[RaisesException, DartSuppress] void remove(); // ChildNode overload
[DartSuppress] void remove(long index);
- [RaisesException, TypeChecking=Interface|Nullable] setter HTMLOptionElement (unsigned long index, HTMLOptionElement? value);
+ [RaisesException, TypeChecking=Interface] setter HTMLOptionElement (unsigned long index, HTMLOptionElement? value);
readonly attribute HTMLCollection selectedOptions;
attribute long selectedIndex;
@@ -52,7 +52,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLSourceElement.idl b/core/html/HTMLSourceElement.idl
index 45f76b9..75cebb1 100644
--- a/core/html/HTMLSourceElement.idl
+++ b/core/html/HTMLSourceElement.idl
@@ -26,7 +26,7 @@
[
RuntimeEnabled=Media
] interface HTMLSourceElement : HTMLElement {
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
attribute DOMString type;
[Reflect, RuntimeEnabled=Picture] attribute DOMString srcset;
diff --git a/core/html/HTMLTableCellElement.idl b/core/html/HTMLTableCellElement.idl
index 8f823e4..b201938 100644
--- a/core/html/HTMLTableCellElement.idl
+++ b/core/html/HTMLTableCellElement.idl
@@ -23,7 +23,7 @@
[Reflect] attribute DOMString abbr;
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString axis;
- [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
[Reflect=char] attribute DOMString ch;
[Reflect=charoff] attribute DOMString chOff;
attribute long colSpan;
diff --git a/core/html/HTMLTableElement.idl b/core/html/HTMLTableElement.idl
index 3072583..e6897fa 100644
--- a/core/html/HTMLTableElement.idl
+++ b/core/html/HTMLTableElement.idl
@@ -26,10 +26,10 @@
readonly attribute HTMLCollection rows;
readonly attribute HTMLCollection tBodies;
[Reflect] attribute DOMString align;
- [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
[Reflect] attribute DOMString border;
- [Reflect, TreatNullAs=NullString] attribute DOMString cellPadding;
- [Reflect, TreatNullAs=NullString] attribute DOMString cellSpacing;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString cellPadding;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString cellSpacing;
[Reflect] attribute DOMString frame;
diff --git a/core/html/HTMLTableRowElement.idl b/core/html/HTMLTableRowElement.idl
index e38f999..aadbc51 100644
--- a/core/html/HTMLTableRowElement.idl
+++ b/core/html/HTMLTableRowElement.idl
@@ -23,7 +23,7 @@
readonly attribute long sectionRowIndex;
readonly attribute HTMLCollection cells;
[Reflect] attribute DOMString align;
- [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
[Reflect=char] attribute DOMString ch;
[Reflect=charoff] attribute DOMString chOff;
[Reflect] attribute DOMString vAlign;
diff --git a/core/html/HTMLTextAreaElement.idl b/core/html/HTMLTextAreaElement.idl
index 937c8c9..be1804d 100644
--- a/core/html/HTMLTextAreaElement.idl
+++ b/core/html/HTMLTextAreaElement.idl
@@ -43,7 +43,7 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+ void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
readonly attribute NodeList labels;
diff --git a/core/html/HTMLTrackElement.idl b/core/html/HTMLTrackElement.idl
index 7ad3e60..16f4cc6 100644
--- a/core/html/HTMLTrackElement.idl
+++ b/core/html/HTMLTrackElement.idl
@@ -25,7 +25,7 @@
interface HTMLTrackElement : HTMLElement {
attribute DOMString kind;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString src;
+ [Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString srclang;
[Reflect] attribute DOMString label;
[Reflect] attribute boolean default;
diff --git a/core/html/HTMLVideoElement.idl b/core/html/HTMLVideoElement.idl
index 30825e5..04f6d1b 100644
--- a/core/html/HTMLVideoElement.idl
+++ b/core/html/HTMLVideoElement.idl
@@ -30,7 +30,7 @@
[Reflect] attribute unsigned long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
- [Reflect, URL, LogActivity=SetterOnly] attribute DOMString poster;
+ [Reflect, URL] attribute DOMString poster;
[RuntimeEnabled=PrefixedVideoFullscreen, DeprecateAs=PrefixedVideoSupportsFullscreen] readonly attribute boolean webkitSupportsFullscreen;
[RuntimeEnabled=PrefixedVideoFullscreen, DeprecateAs=PrefixedVideoDisplayingFullscreen] readonly attribute boolean webkitDisplayingFullscreen;
diff --git a/core/html/ImageData.idl b/core/html/ImageData.idl
index 152822d..107ce0b 100644
--- a/core/html/ImageData.idl
+++ b/core/html/ImageData.idl
@@ -32,7 +32,7 @@
Constructor(unsigned long width, unsigned long height),
Constructor(Uint8ClampedArray data, unsigned long width, [Default=Undefined] optional unsigned long height),
Custom=Wrap,
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
RaisesException=Constructor,
WillBeGarbageCollected,
] interface ImageData {
diff --git a/core/html/MediaKeyError.idl b/core/html/MediaKeyError.idl
index d746c4c..da32f87 100644
--- a/core/html/MediaKeyError.idl
+++ b/core/html/MediaKeyError.idl
@@ -24,7 +24,8 @@
*/
[
- RuntimeEnabled=EncryptedMediaAnyVersion
+ RuntimeEnabled=EncryptedMediaAnyVersion,
+ WillBeGarbageCollected,
] interface MediaKeyError {
const unsigned short MEDIA_KEYERR_UNKNOWN = 1;
const unsigned short MEDIA_KEYERR_CLIENT = 2;
diff --git a/core/html/TextMetrics.idl b/core/html/TextMetrics.idl
index 14f1148..c7d929a 100644
--- a/core/html/TextMetrics.idl
+++ b/core/html/TextMetrics.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
+ WillBeGarbageCollected,
] interface TextMetrics {
// x-direction
readonly attribute float width;
@@ -40,4 +41,3 @@
[RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute float alphabeticBaseline;
[RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute float ideographicBaseline;
};
-
diff --git a/core/html/TimeRanges.idl b/core/html/TimeRanges.idl
index e6e6e95..5c04549 100644
--- a/core/html/TimeRanges.idl
+++ b/core/html/TimeRanges.idl
@@ -24,6 +24,7 @@
*/
[
+ WillBeGarbageCollected,
RuntimeEnabled=Media
] interface TimeRanges {
readonly attribute unsigned long length;
diff --git a/core/html/canvas/ANGLEInstancedArrays.idl b/core/html/canvas/ANGLEInstancedArrays.idl
index 4e63430..06f84e0 100644
--- a/core/html/canvas/ANGLEInstancedArrays.idl
+++ b/core/html/canvas/ANGLEInstancedArrays.idl
@@ -31,7 +31,8 @@
[
DoNotCheckConstants,
NoInterfaceObject,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface ANGLEInstancedArrays {
const unsigned long VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
diff --git a/core/html/canvas/Canvas2DContextAttributes.idl b/core/html/canvas/Canvas2DContextAttributes.idl
index f6017b3..f7dfab1 100644
--- a/core/html/canvas/Canvas2DContextAttributes.idl
+++ b/core/html/canvas/Canvas2DContextAttributes.idl
@@ -25,7 +25,8 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface Canvas2DContextAttributes {
attribute boolean alpha;
[RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString storage;
diff --git a/core/html/canvas/CanvasGradient.idl b/core/html/canvas/CanvasGradient.idl
index 3da025a..c5f5623 100644
--- a/core/html/canvas/CanvasGradient.idl
+++ b/core/html/canvas/CanvasGradient.idl
@@ -25,9 +25,9 @@
*/
[
TypeChecking=Unrestricted,
+ WillBeGarbageCollected,
] interface CanvasGradient {
[RaisesException] void addColorStop(float offset, DOMString color);
};
-
diff --git a/core/html/canvas/CanvasPattern.idl b/core/html/canvas/CanvasPattern.idl
index 1d8e7a0..d8e453d 100644
--- a/core/html/canvas/CanvasPattern.idl
+++ b/core/html/canvas/CanvasPattern.idl
@@ -23,6 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
+ WillBeGarbageCollected,
] interface CanvasPattern {
};
-
diff --git a/core/html/canvas/CanvasRenderingContext2D.idl b/core/html/canvas/CanvasRenderingContext2D.idl
index 22f2c23..aa076cc 100644
--- a/core/html/canvas/CanvasRenderingContext2D.idl
+++ b/core/html/canvas/CanvasRenderingContext2D.idl
@@ -38,7 +38,7 @@
enum CanvasFillRule { "nonzero", "evenodd" };
[
- TypeChecking=Interface|Nullable|Unrestricted,
+ TypeChecking=Interface|Unrestricted,
WillBeGarbageCollected,
] interface CanvasRenderingContext2D {
// back-reference to the canvas
@@ -71,9 +71,9 @@
[Custom] attribute object fillStyle; // (default black)
CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
[RaisesException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
- [RaisesException] CanvasPattern createPattern(HTMLCanvasElement canvas, [TreatNullAs=NullString] DOMString repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLImageElement image, [TreatNullAs=NullString] DOMString repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLVideoElement image, [TreatNullAs=NullString] DOMString repetitionType);
+ [RaisesException] CanvasPattern createPattern(HTMLCanvasElement canvas, DOMString? repetitionType);
+ [RaisesException] CanvasPattern createPattern(HTMLImageElement image, DOMString? repetitionType);
+ [RaisesException] CanvasPattern createPattern(HTMLVideoElement image, DOMString? repetitionType);
// shadows
attribute unrestricted float shadowOffsetX;
@@ -123,6 +123,13 @@
[RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
[RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+ // hit regions
+ // FIXME: Blink does not currently support WebIDL dictionary definitions.
+ // See http://crbug.com/321462
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegion(optional Dictionary options);
+ [RuntimeEnabled=ExperimentalCanvasFeatures] void removeHitRegion(DOMString id);
+ [RuntimeEnabled=ExperimentalCanvasFeatures] void clearHitRegions();
+
// pixel manipulation
[DartName=createImageDataFromImageData] ImageData createImageData(ImageData imagedata);
[RaisesException] ImageData createImageData(float sw, float sh);
diff --git a/core/html/canvas/DataView.idl b/core/html/canvas/DataView.idl
index 4fc8961..9744bda 100644
--- a/core/html/canvas/DataView.idl
+++ b/core/html/canvas/DataView.idl
@@ -26,8 +26,8 @@
[
Custom=Wrap,
CustomConstructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long byteLength),
- Exposed=Window&Worker,
- TypeChecking=Interface|Nullable,
+ Exposed=(Window,Worker),
+ TypeChecking=Interface,
] interface DataView : ArrayBufferView {
// All these methods raise an exception if they would read or write beyond the end of the view.
diff --git a/core/html/canvas/EXTBlendMinMax.idl b/core/html/canvas/EXTBlendMinMax.idl
index 55baea7..fbc69bc 100644
--- a/core/html/canvas/EXTBlendMinMax.idl
+++ b/core/html/canvas/EXTBlendMinMax.idl
@@ -5,7 +5,8 @@
[
DoNotCheckConstants,
NoInterfaceObject,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface EXTBlendMinMax {
const unsigned long MIN_EXT = 0x8007;
const unsigned long MAX_EXT = 0x8008;
diff --git a/core/html/canvas/EXTFragDepth.idl b/core/html/canvas/EXTFragDepth.idl
index 52a6f93..ab71f12 100644
--- a/core/html/canvas/EXTFragDepth.idl
+++ b/core/html/canvas/EXTFragDepth.idl
@@ -24,6 +24,7 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface EXTFragDepth {
};
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/core/html/canvas/EXTShaderTextureLOD.idl
index a2e18b6..975005a 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/core/html/canvas/EXTShaderTextureLOD.idl
@@ -3,6 +3,7 @@
// found in the LICENSE file.
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface EXTShaderTextureLOD {
};
diff --git a/core/html/canvas/EXTTextureFilterAnisotropic.idl b/core/html/canvas/EXTTextureFilterAnisotropic.idl
index 3fd2110..1588e48 100644
--- a/core/html/canvas/EXTTextureFilterAnisotropic.idl
+++ b/core/html/canvas/EXTTextureFilterAnisotropic.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface EXTTextureFilterAnisotropic {
const unsigned long TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
const unsigned long MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
diff --git a/core/html/canvas/MouseEventHitRegion.idl b/core/html/canvas/MouseEventHitRegion.idl
new file mode 100644
index 0000000..e501b4e
--- /dev/null
+++ b/core/html/canvas/MouseEventHitRegion.idl
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#MouseEvent-partial
+
+[
+ RuntimeEnabled=ExperimentalCanvasFeatures
+] partial interface MouseEvent {
+ readonly attribute DOMString? region;
+};
diff --git a/core/html/canvas/OESElementIndexUint.idl b/core/html/canvas/OESElementIndexUint.idl
index ecb5d89..d4d8ea0 100644
--- a/core/html/canvas/OESElementIndexUint.idl
+++ b/core/html/canvas/OESElementIndexUint.idl
@@ -24,6 +24,7 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface OESElementIndexUint {
};
diff --git a/core/html/canvas/OESStandardDerivatives.idl b/core/html/canvas/OESStandardDerivatives.idl
index 222f6ec..a517c7b 100644
--- a/core/html/canvas/OESStandardDerivatives.idl
+++ b/core/html/canvas/OESStandardDerivatives.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface OESStandardDerivatives {
const unsigned long FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
};
diff --git a/core/html/canvas/OESTextureFloat.idl b/core/html/canvas/OESTextureFloat.idl
index f97da85..446d079 100644
--- a/core/html/canvas/OESTextureFloat.idl
+++ b/core/html/canvas/OESTextureFloat.idl
@@ -24,6 +24,7 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface OESTextureFloat {
};
diff --git a/core/html/canvas/OESTextureFloatLinear.idl b/core/html/canvas/OESTextureFloatLinear.idl
index 25523fe..8cb531d 100644
--- a/core/html/canvas/OESTextureFloatLinear.idl
+++ b/core/html/canvas/OESTextureFloatLinear.idl
@@ -24,6 +24,7 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface OESTextureFloatLinear {
};
diff --git a/core/html/canvas/OESTextureHalfFloat.idl b/core/html/canvas/OESTextureHalfFloat.idl
index 9543a89..b050cfa 100644
--- a/core/html/canvas/OESTextureHalfFloat.idl
+++ b/core/html/canvas/OESTextureHalfFloat.idl
@@ -27,7 +27,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface OESTextureHalfFloat {
const GLenum HALF_FLOAT_OES = 0x8D61;
};
diff --git a/core/html/canvas/OESTextureHalfFloatLinear.idl b/core/html/canvas/OESTextureHalfFloatLinear.idl
index 84e192d..201ca4d 100644
--- a/core/html/canvas/OESTextureHalfFloatLinear.idl
+++ b/core/html/canvas/OESTextureHalfFloatLinear.idl
@@ -24,6 +24,7 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface OESTextureHalfFloatLinear {
};
diff --git a/core/html/canvas/OESVertexArrayObject.idl b/core/html/canvas/OESVertexArrayObject.idl
index 5a21f23..eba1db6 100644
--- a/core/html/canvas/OESVertexArrayObject.idl
+++ b/core/html/canvas/OESVertexArrayObject.idl
@@ -26,7 +26,8 @@
[
DoNotCheckConstants,
NoInterfaceObject,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface OESVertexArrayObject {
const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5;
diff --git a/core/html/canvas/Path2D.idl b/core/html/canvas/Path2D.idl
index 2621485..c89979d 100644
--- a/core/html/canvas/Path2D.idl
+++ b/core/html/canvas/Path2D.idl
@@ -33,9 +33,10 @@
Constructor(Path2D path),
Constructor(DOMString text),
RuntimeEnabled=Path2D,
+ WillBeGarbageCollected,
] interface Path2D {
- [RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface|Nullable] void addPath(Path2D path, optional SVGMatrix? transform);
+ [RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface] void addPath(Path2D path, optional SVGMatrix? transform);
};
Path2D implements CanvasPathMethods;
diff --git a/core/html/canvas/WebGLActiveInfo.idl b/core/html/canvas/WebGLActiveInfo.idl
index 8443d8f..f4aa739 100644
--- a/core/html/canvas/WebGLActiveInfo.idl
+++ b/core/html/canvas/WebGLActiveInfo.idl
@@ -23,9 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLActiveInfo {
+[
+ WillBeGarbageCollected,
+] interface WebGLActiveInfo {
readonly attribute long size;
readonly attribute unsigned long type;
readonly attribute DOMString name;
};
-
diff --git a/core/html/canvas/WebGLBuffer.idl b/core/html/canvas/WebGLBuffer.idl
index 5272404..aecd6b0 100644
--- a/core/html/canvas/WebGLBuffer.idl
+++ b/core/html/canvas/WebGLBuffer.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLBuffer {
+[
+ WillBeGarbageCollected,
+] interface WebGLBuffer {
};
diff --git a/core/html/canvas/WebGLCompressedTextureATC.idl b/core/html/canvas/WebGLCompressedTextureATC.idl
index e627f21..a66a329 100644
--- a/core/html/canvas/WebGLCompressedTextureATC.idl
+++ b/core/html/canvas/WebGLCompressedTextureATC.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLCompressedTextureATC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
diff --git a/core/html/canvas/WebGLCompressedTextureETC1.idl b/core/html/canvas/WebGLCompressedTextureETC1.idl
index e37d990..fd8759d 100644
--- a/core/html/canvas/WebGLCompressedTextureETC1.idl
+++ b/core/html/canvas/WebGLCompressedTextureETC1.idl
@@ -4,7 +4,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLCompressedTextureETC1 {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
diff --git a/core/html/canvas/WebGLCompressedTexturePVRTC.idl b/core/html/canvas/WebGLCompressedTexturePVRTC.idl
index 3e25892..9eaa3a9 100644
--- a/core/html/canvas/WebGLCompressedTexturePVRTC.idl
+++ b/core/html/canvas/WebGLCompressedTexturePVRTC.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLCompressedTexturePVRTC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
diff --git a/core/html/canvas/WebGLCompressedTextureS3TC.idl b/core/html/canvas/WebGLCompressedTextureS3TC.idl
index 6f1973d..eef723f 100644
--- a/core/html/canvas/WebGLCompressedTextureS3TC.idl
+++ b/core/html/canvas/WebGLCompressedTextureS3TC.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLCompressedTextureS3TC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
diff --git a/core/html/canvas/WebGLContextAttributes.idl b/core/html/canvas/WebGLContextAttributes.idl
index 0fe4662..ecd211a 100644
--- a/core/html/canvas/WebGLContextAttributes.idl
+++ b/core/html/canvas/WebGLContextAttributes.idl
@@ -25,7 +25,8 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface WebGLContextAttributes {
attribute boolean alpha;
attribute boolean depth;
diff --git a/core/html/canvas/WebGLDebugRendererInfo.idl b/core/html/canvas/WebGLDebugRendererInfo.idl
index f1cf633..bf95c1b 100644
--- a/core/html/canvas/WebGLDebugRendererInfo.idl
+++ b/core/html/canvas/WebGLDebugRendererInfo.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLDebugRendererInfo {
const unsigned long UNMASKED_VENDOR_WEBGL = 0x9245;
const unsigned long UNMASKED_RENDERER_WEBGL = 0x9246;
diff --git a/core/html/canvas/WebGLDebugShaders.idl b/core/html/canvas/WebGLDebugShaders.idl
index 74851c7..92c36be 100644
--- a/core/html/canvas/WebGLDebugShaders.idl
+++ b/core/html/canvas/WebGLDebugShaders.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface WebGLDebugShaders {
- [TreatReturnedNullStringAs=Null] DOMString getTranslatedShaderSource(WebGLShader? shader);
+ DOMString? getTranslatedShaderSource(WebGLShader? shader);
};
diff --git a/core/html/canvas/WebGLDepthTexture.idl b/core/html/canvas/WebGLDepthTexture.idl
index a6eb66a..d6a0874 100644
--- a/core/html/canvas/WebGLDepthTexture.idl
+++ b/core/html/canvas/WebGLDepthTexture.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLDepthTexture {
const unsigned long UNSIGNED_INT_24_8_WEBGL = 0x84FA;
};
diff --git a/core/html/canvas/WebGLDrawBuffers.idl b/core/html/canvas/WebGLDrawBuffers.idl
index d1a0f5f..82fc059 100644
--- a/core/html/canvas/WebGLDrawBuffers.idl
+++ b/core/html/canvas/WebGLDrawBuffers.idl
@@ -27,7 +27,8 @@
[
NoInterfaceObject,
- DoNotCheckConstants
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
] interface WebGLDrawBuffers {
const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1;
diff --git a/core/html/canvas/WebGLFramebuffer.idl b/core/html/canvas/WebGLFramebuffer.idl
index 1fd6dd1..354f82f 100644
--- a/core/html/canvas/WebGLFramebuffer.idl
+++ b/core/html/canvas/WebGLFramebuffer.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLFramebuffer {
+[
+ WillBeGarbageCollected,
+] interface WebGLFramebuffer {
};
diff --git a/core/html/canvas/WebGLLoseContext.idl b/core/html/canvas/WebGLLoseContext.idl
index 117fcf2..c235567 100644
--- a/core/html/canvas/WebGLLoseContext.idl
+++ b/core/html/canvas/WebGLLoseContext.idl
@@ -25,7 +25,8 @@
[
NoInterfaceObject,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface WebGLLoseContext {
void loseContext();
void restoreContext();
diff --git a/core/html/canvas/WebGLProgram.idl b/core/html/canvas/WebGLProgram.idl
index 7cec34a..b637b22 100644
--- a/core/html/canvas/WebGLProgram.idl
+++ b/core/html/canvas/WebGLProgram.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLProgram {
+[
+ WillBeGarbageCollected,
+] interface WebGLProgram {
};
diff --git a/core/html/canvas/WebGLRenderbuffer.idl b/core/html/canvas/WebGLRenderbuffer.idl
index 2ecef6b..2e6792f 100644
--- a/core/html/canvas/WebGLRenderbuffer.idl
+++ b/core/html/canvas/WebGLRenderbuffer.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLRenderbuffer {
+[
+ WillBeGarbageCollected,
+] interface WebGLRenderbuffer {
};
diff --git a/core/html/canvas/WebGLRenderingContext.idl b/core/html/canvas/WebGLRenderingContext.idl
index ce2d483..6c12783 100644
--- a/core/html/canvas/WebGLRenderingContext.idl
+++ b/core/html/canvas/WebGLRenderingContext.idl
@@ -27,7 +27,7 @@
[
DoNotCheckConstants,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
WillBeGarbageCollected,
] interface WebGLRenderingContext { };
WebGLRenderingContext implements WebGLRenderingContextBase;
diff --git a/core/html/canvas/WebGLRenderingContextBase.idl b/core/html/canvas/WebGLRenderingContextBase.idl
index e6b013e..a790556 100644
--- a/core/html/canvas/WebGLRenderingContextBase.idl
+++ b/core/html/canvas/WebGLRenderingContextBase.idl
@@ -41,11 +41,12 @@
typedef unrestricted float GLclampf;
[
- // FIXME: [DoNotCheckConstants] and [TypeChecking=Interface|Nullable] should be applied
+ // FIXME: [DoNotCheckConstants] and [TypeChecking=Interface|Unrestricted] should be applied
// to members and not need to be put on implementing interface
// DoNotCheckConstants, // need to put on implementing interface
NoInterfaceObject, // Always used on target of 'implements'
- // TypeChecking=Interface|Nullable|Unrestricted, // need to put on implementing interface
+ // TypeChecking=Interface|Unrestricted, // need to put on implementing interface
+ WillBeGarbageCollected,
] interface WebGLRenderingContextBase {
readonly attribute HTMLCanvasElement canvas;
@@ -545,7 +546,7 @@
[DartNoAutoScope] WebGLActiveInfo getActiveAttrib(WebGLProgram? program, GLuint index);
[DartNoAutoScope] WebGLActiveInfo getActiveUniform(WebGLProgram? program, GLuint index);
- [Custom, DartNoAutoScope] void getAttachedShaders(WebGLProgram? program);
+ [DartNoAutoScope] sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
[DartNoAutoScope] GLint getAttribLocation(WebGLProgram? program, DOMString name);
@@ -561,21 +562,21 @@
[Custom] any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname);
[Custom] any getParameter(GLenum pname);
[Custom] any getProgramParameter(WebGLProgram? program, GLenum pname);
- [TreatReturnedNullStringAs=Null] DOMString getProgramInfoLog(WebGLProgram? program);
+ DOMString? getProgramInfoLog(WebGLProgram? program);
[Custom] any getRenderbufferParameter(GLenum target, GLenum pname);
[Custom] any getShaderParameter(WebGLShader? shader, GLenum pname);
- [TreatReturnedNullStringAs=Null] DOMString getShaderInfoLog(WebGLShader? shader);
+ DOMString? getShaderInfoLog(WebGLShader? shader);
WebGLShaderPrecisionFormat getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
- [TreatReturnedNullStringAs=Null] DOMString getShaderSource(WebGLShader? shader);
+ DOMString? getShaderSource(WebGLShader? shader);
- [Custom] sequence<DOMString> getSupportedExtensions();
+ sequence<DOMString>? getSupportedExtensions();
[Custom] any getTexParameter(GLenum target, GLenum pname);
- [Custom] any getUniform(WebGLProgram? program, WebGLUniformLocation location);
+ [Custom] any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
WebGLUniformLocation getUniformLocation(WebGLProgram? program, DOMString name);
diff --git a/core/html/canvas/WebGLShader.idl b/core/html/canvas/WebGLShader.idl
index 624d490..1d48fd6 100644
--- a/core/html/canvas/WebGLShader.idl
+++ b/core/html/canvas/WebGLShader.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLShader {
+[
+ WillBeGarbageCollected,
+] interface WebGLShader {
};
diff --git a/core/html/canvas/WebGLShaderPrecisionFormat.idl b/core/html/canvas/WebGLShaderPrecisionFormat.idl
index 021beb6..f9531c5 100644
--- a/core/html/canvas/WebGLShaderPrecisionFormat.idl
+++ b/core/html/canvas/WebGLShaderPrecisionFormat.idl
@@ -24,9 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLShaderPrecisionFormat {
+[
+ WillBeGarbageCollected,
+] interface WebGLShaderPrecisionFormat {
readonly attribute long rangeMin;
readonly attribute long rangeMax;
readonly attribute long precision;
};
-
diff --git a/core/html/canvas/WebGLTexture.idl b/core/html/canvas/WebGLTexture.idl
index caed3ac..7a1583c 100644
--- a/core/html/canvas/WebGLTexture.idl
+++ b/core/html/canvas/WebGLTexture.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLTexture {
+[
+ WillBeGarbageCollected,
+] interface WebGLTexture {
};
diff --git a/core/html/canvas/WebGLUniformLocation.idl b/core/html/canvas/WebGLUniformLocation.idl
index 503804e..bac3601 100644
--- a/core/html/canvas/WebGLUniformLocation.idl
+++ b/core/html/canvas/WebGLUniformLocation.idl
@@ -24,5 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface WebGLUniformLocation {
+[
+ WillBeGarbageCollected,
+] interface WebGLUniformLocation {
};
diff --git a/core/html/canvas/WebGLVertexArrayObjectOES.idl b/core/html/canvas/WebGLVertexArrayObjectOES.idl
index 6c07bd1..2a9e5bc 100644
--- a/core/html/canvas/WebGLVertexArrayObjectOES.idl
+++ b/core/html/canvas/WebGLVertexArrayObjectOES.idl
@@ -24,6 +24,7 @@
*/
[
- NoInterfaceObject
+ NoInterfaceObject,
+ WillBeGarbageCollected,
] interface WebGLVertexArrayObjectOES {
};
diff --git a/core/html/track/TextTrackCue.idl b/core/html/track/TextTrackCue.idl
index d243c43..ba325a1 100644
--- a/core/html/track/TextTrackCue.idl
+++ b/core/html/track/TextTrackCue.idl
@@ -31,7 +31,7 @@
TypeChecking=Unrestricted,
WillBeGarbageCollected,
] interface TextTrackCue : EventTarget {
- readonly attribute TextTrack track; // FIXME: should be nullable
+ readonly attribute TextTrack? track;
attribute DOMString id;
attribute double startTime;
diff --git a/modules/imagebitmap/ImageBitmapFactories.idl b/core/imagebitmap/ImageBitmapFactories.idl
similarity index 98%
rename from modules/imagebitmap/ImageBitmapFactories.idl
rename to core/imagebitmap/ImageBitmapFactories.idl
index f095d8c..1b34ea7 100644
--- a/modules/imagebitmap/ImageBitmapFactories.idl
+++ b/core/imagebitmap/ImageBitmapFactories.idl
@@ -46,7 +46,7 @@
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
RuntimeEnabled=ExperimentalCanvasFeatures,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface ImageBitmapFactories {
[CallWith=ScriptState, RaisesException] Promise createImageBitmap(Blob blob);
[CallWith=ScriptState, RaisesException] Promise createImageBitmap(Blob blob, long sx, long sy, long sw, long sh);
diff --git a/modules/imagebitmap/WindowImageBitmapFactories.idl b/core/imagebitmap/WindowImageBitmapFactories.idl
similarity index 98%
rename from modules/imagebitmap/WindowImageBitmapFactories.idl
rename to core/imagebitmap/WindowImageBitmapFactories.idl
index f7b85df..cf877c5 100644
--- a/modules/imagebitmap/WindowImageBitmapFactories.idl
+++ b/core/imagebitmap/WindowImageBitmapFactories.idl
@@ -31,7 +31,7 @@
[
ImplementedAs=ImageBitmapFactories,
RuntimeEnabled=ExperimentalCanvasFeatures,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] partial interface Window {
[CallWith=ScriptState, RaisesException] Promise createImageBitmap(HTMLImageElement image);
[CallWith=ScriptState, RaisesException] Promise createImageBitmap(HTMLImageElement image, long sx, long sy, long sw, long sh);
diff --git a/core/inspector/CodeGeneratorInspector.py b/core/inspector/CodeGeneratorInspector.py
index ce6dae1..7d4be18 100755
--- a/core/inspector/CodeGeneratorInspector.py
+++ b/core/inspector/CodeGeneratorInspector.py
@@ -156,7 +156,7 @@
ABBREVIATION = frozenset(["XHR", "DOM", "CSS"])
-VALIDATOR_IFDEF_NAME = "ASSERT_ENABLED"
+VALIDATOR_IFDEF_NAME = "ENABLE(ASSERT)"
class DomainNameFixes:
diff --git a/core/inspector/CodeGeneratorInspectorStrings.py b/core/inspector/CodeGeneratorInspectorStrings.py
index f9b8127..83705c5 100644
--- a/core/inspector/CodeGeneratorInspectorStrings.py
+++ b/core/inspector/CodeGeneratorInspectorStrings.py
@@ -102,7 +102,7 @@
#include "wtf/PassRefPtr.h"
#include "wtf/text/WTFString.h"
-namespace WebCore {
+namespace blink {
typedef String ErrorString;
@@ -116,7 +116,7 @@
InspectorFrontendChannel* m_inspectorFrontendChannel;
${fieldDeclarations}};
-} // namespace WebCore
+} // namespace blink
#endif // !defined(InspectorFrontend_h)
""")
@@ -130,7 +130,7 @@
#include "wtf/RefCounted.h"
#include "wtf/text/WTFString.h"
-namespace WebCore {
+namespace blink {
class JSONObject;
class JSONArray;
@@ -198,7 +198,7 @@
static const size_t commandNamesIndex[];
};
-} // namespace WebCore
+} // namespace blink
#endif // !defined(InspectorBackendDispatcher_h)
@@ -216,7 +216,7 @@
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
-namespace WebCore {
+namespace blink {
const char InspectorBackendDispatcher::commandNames[] = {
$methodNameDeclarations
@@ -508,7 +508,7 @@
m_alreadySent = true;
}
-} // namespace WebCore
+} // namespace blink
""")
@@ -523,7 +523,7 @@
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
-namespace WebCore {
+namespace blink {
InspectorFrontend::InspectorFrontend(InspectorFrontendChannel* inspectorFrontendChannel)
: m_inspectorFrontendChannel(inspectorFrontendChannel)
@@ -533,7 +533,7 @@
$methods
-} // namespace WebCore
+} // namespace blink
""")
@@ -546,7 +546,7 @@
#include "wtf/Assertions.h"
#include "wtf/PassRefPtr.h"
-namespace WebCore {
+namespace blink {
namespace TypeBuilder {
@@ -841,7 +841,7 @@
} // namespace TypeBuilder
-} // namespace WebCore
+} // namespace blink
#endif // !defined(InspectorTypeBuilder_h)
@@ -855,7 +855,7 @@
#include "InspectorTypeBuilder.h"
#include "wtf/text/CString.h"
-namespace WebCore {
+namespace blink {
namespace TypeBuilder {
@@ -890,7 +890,7 @@
#endif // $validatorIfdefName
-} // namespace WebCore
+} // namespace blink
""")
diff --git a/core/inspector/CodeGeneratorInstrumentation.py b/core/inspector/CodeGeneratorInstrumentation.py
index c313717..aa0335e 100755
--- a/core/inspector/CodeGeneratorInstrumentation.py
+++ b/core/inspector/CodeGeneratorInstrumentation.py
@@ -39,14 +39,16 @@
${includes}
-namespace WebCore {
+namespace blink {
+
+${forward_declarations}
namespace InspectorInstrumentation {
$methods
} // namespace InspectorInstrumentation
-} // namespace WebCore
+} // namespace blink
#endif // !defined(${file_name}_h)
""")
@@ -82,7 +84,7 @@
${includes}
-namespace WebCore {
+namespace blink {
${extra_definitions}
namespace InspectorInstrumentation {
@@ -90,7 +92,7 @@
} // namespace InspectorInstrumentation
-} // namespace WebCore
+} // namespace blink
""")
template_outofline = string.Template("""
@@ -115,24 +117,26 @@
#ifndef InstrumentingAgentsInl_h
#define InstrumentingAgentsInl_h
+#include "platform/heap/Handle.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
-namespace WebCore {
+namespace blink {
${forward_list}
-class InstrumentingAgents : public RefCounted<InstrumentingAgents> {
+class InstrumentingAgents : public RefCountedWillBeGarbageCollectedFinalized<InstrumentingAgents> {
WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
- WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
- static PassRefPtr<InstrumentingAgents> create()
+ static PassRefPtrWillBeRawPtr<InstrumentingAgents> create()
{
- return adoptRef(new InstrumentingAgents());
+ return adoptRefWillBeNoop(new InstrumentingAgents());
}
~InstrumentingAgents() { }
+ void trace(Visitor*);
void reset();
${accessor_list}
@@ -158,6 +162,11 @@
{
}
+void InstrumentingAgents::trace(Visitor* visitor)
+{
+ $trace_list
+}
+
void InstrumentingAgents::reset()
{
$reset_list
@@ -195,6 +204,7 @@
self.name = name
self.header_name = self.name + "Inl"
self.includes = [include_inspector_header("InspectorInstrumentation")]
+ self.forward_declarations = []
self.declarations = []
for line in map(str.strip, source.split("\n")):
line = re.sub("\s{2,}", " ", line).strip() # Collapse whitespace
@@ -202,9 +212,12 @@
continue
if line[0] == "#":
self.includes.append(line)
+ elif line.startswith("class "):
+ self.forward_declarations.append(line)
else:
self.declarations.append(Method(line))
self.includes.sort()
+ self.forward_declarations.sort()
def generate(self, cpp_lines, used_agents):
header_lines = []
@@ -217,6 +230,7 @@
return template_h.substitute(None,
file_name=self.header_name,
includes="\n".join(self.includes),
+ forward_declarations="\n".join(self.forward_declarations),
methods="\n".join(header_lines))
@@ -247,6 +261,8 @@
if self.return_type == "bool":
self.default_return_value = "false"
+ elif self.return_type == "int":
+ self.default_return_value = "0"
elif self.return_type == "String":
self.default_return_value = "\"\""
else:
@@ -440,6 +456,7 @@
accessor_list = []
member_list = []
init_list = []
+ trace_list = []
reset_list = []
for agent in agents:
@@ -452,14 +469,16 @@
class_name=class_name,
getter_name=getter_name,
member_name=member_name))
- member_list.append(" %s* %s;" % (class_name, member_name))
- init_list.append("%s(0)" % member_name)
- reset_list.append("%s = 0;" % member_name)
+ member_list.append(" RawPtrWillBeMember<%s> %s;" % (class_name, member_name))
+ init_list.append("%s(nullptr)" % member_name)
+ trace_list.append("visitor->trace(%s);" % member_name)
+ reset_list.append("%s = nullptr;" % member_name)
forward_list.sort()
accessor_list.sort()
member_list.sort()
init_list.sort()
+ trace_list.sort()
reset_list.sort()
header_lines = template_instrumenting_agents_h.substitute(
@@ -471,6 +490,7 @@
cpp_lines = template_instrumenting_agents_cpp.substitute(
None,
init_list="\n , ".join(init_list),
+ trace_list="\n ".join(trace_list),
reset_list="\n ".join(reset_list))
return header_lines, cpp_lines
diff --git a/core/inspector/InjectedScriptHost.idl b/core/inspector/InjectedScriptHost.idl
index 5dec0fc..018f9d2 100644
--- a/core/inspector/InjectedScriptHost.idl
+++ b/core/inspector/InjectedScriptHost.idl
@@ -31,25 +31,28 @@
*/
[
+ WillBeGarbageCollected,
NoInterfaceObject
] interface InjectedScriptHost {
- void clearConsoleMessages();
+ [NotEnumerable, Unforgeable] void clearConsoleMessages();
- [Custom] void inspect(any objectId, any hints);
- [Custom] any inspectedObject(long num);
- [Custom] any internalConstructorName(any obj);
- [Custom] boolean isHTMLAllCollection(any obj);
- [Custom] DOMString type(any obj);
- [Custom] any functionDetails(any obj);
- [Custom] any[] getInternalProperties(any obj);
- [Custom] EventListener[] getEventListeners(EventTarget target);
- [Custom] any evaluate(DOMString text);
- [Custom] void debugFunction(any fn);
- [Custom] void undebugFunction(any fn);
- [Custom] void monitorFunction(any fn);
- [Custom] void unmonitorFunction(any fn);
- [Custom] any suppressWarningsAndCall(any receiver, any fn, any param1, any param2);
+ [NotEnumerable, Unforgeable, Custom] void inspect(any objectId, any hints);
+ [NotEnumerable, Unforgeable, Custom] any inspectedObject(long num);
+ [NotEnumerable, Unforgeable, Custom] any internalConstructorName(any obj);
+ [NotEnumerable, Unforgeable, Custom] boolean isHTMLAllCollection(any obj);
+ [NotEnumerable, Unforgeable, Custom] DOMString type(any obj);
+ [NotEnumerable, Unforgeable, Custom] any functionDetails(any obj);
+ [NotEnumerable, Unforgeable, Custom] any[] getInternalProperties(any obj);
+ [NotEnumerable, Unforgeable, Custom] EventListener[] getEventListeners(EventTarget target);
+ [NotEnumerable, Unforgeable, Custom] any eval(DOMString text);
+ [NotEnumerable, Unforgeable, Custom] any evaluateWithExceptionDetails(DOMString text);
+ [NotEnumerable, Unforgeable, Custom] void debugFunction(any fn);
+ [NotEnumerable, Unforgeable, Custom] void undebugFunction(any fn);
+ [NotEnumerable, Unforgeable, Custom] void monitorFunction(any fn);
+ [NotEnumerable, Unforgeable, Custom] void unmonitorFunction(any fn);
+ [NotEnumerable, Unforgeable, Custom] any callFunction(any fn, any receiver, any[] argv);
+ [NotEnumerable, Unforgeable, Custom] any suppressWarningsAndCallFunction(any fn, any receiver, any[] argv);
// Only declarative scope (local, with and catch) is accepted. Returns undefined.
- [Custom] any setFunctionVariableValue(any functionObject, long scopeIndex, DOMString variableName, any newValue);
+ [NotEnumerable, Unforgeable, Custom] any setFunctionVariableValue(any functionObject, long scopeIndex, DOMString variableName, any newValue);
};
diff --git a/core/inspector/InspectorFrontendHost.idl b/core/inspector/InspectorFrontendHost.idl
index 058608a..c655170 100644
--- a/core/inspector/InspectorFrontendHost.idl
+++ b/core/inspector/InspectorFrontendHost.idl
@@ -31,6 +31,7 @@
*/
[
+ WillBeGarbageCollected,
NoInterfaceObject
] interface InspectorFrontendHost {
// FIXME: setZoomFactor is here only for old frontends. Remove in M38.
@@ -43,7 +44,9 @@
[Custom] DOMString platform();
[Custom] DOMString port();
+ // FIXME: showContextMenu is here only for old frontends. Remove in M43.
[Custom] void showContextMenu(MouseEvent event, any items);
+ [Custom] void showContextMenuAtPoint(float x, float y, any items);
void sendMessageToBackend(DOMString message);
void sendMessageToEmbedder(DOMString message);
@@ -54,4 +57,5 @@
DOMString getSelectionForegroundColor();
boolean isUnderTest();
+ boolean isHostedMode();
};
diff --git a/core/inspector/InspectorInstrumentation.idl b/core/inspector/InspectorInstrumentation.idl
index d8d4ec1..d1d5b3b 100644
--- a/core/inspector/InspectorInstrumentation.idl
+++ b/core/inspector/InspectorInstrumentation.idl
@@ -71,6 +71,9 @@
void didClearDocumentOfWindowObject([Keep] LocalFrame*);
[DOMDebugger, Inline=FastReturn]
+ void willCloseWindow(ExecutionContext*);
+
+ [DOMDebugger, Inline=FastReturn]
void willInsertDOMNode([Keep] Node* parent);
[DOM, DOMDebugger, Inline=FastReturn]
@@ -190,6 +193,18 @@
[Debugger, Inline=FastReturn]
void didDeliverMutationRecords(ExecutionContext*);
+ [Debugger, Inline=FastReturn]
+ void didPostExecutionContextTask([Keep] ExecutionContext*, ExecutionContextTask*);
+
+ [Debugger, Inline=FastReturn]
+ void didKillAllExecutionContextTasks([Keep] ExecutionContext*);
+
+ [Debugger, Inline=FastReturn]
+ void willPerformExecutionContextTask([Keep] ExecutionContext*, ExecutionContextTask*);
+
+ [Debugger, Inline=FastReturn]
+ void didPerformExecutionContextTask(ExecutionContext*);
+
[Timeline, Inline=FastReturn]
InspectorInstrumentationCookie willEvaluateScript([Keep] LocalFrame*, const String& url, int lineNumber);
@@ -226,6 +241,9 @@
[Timeline, Inline=FastReturn]
void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
+ [Debugger, Inline=FastReturn]
+ void didDispatchXHRLoadendEvent(ExecutionContext*, XMLHttpRequest*);
+
[Timeline, Inline=FastReturn]
void willScrollLayer([Keep] RenderObject*);
@@ -275,9 +293,6 @@
void continueAfterXFrameOptionsDenied(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
[Inline=Forward]
- void continueWithPolicyDownload(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
-
- [Inline=Forward]
void continueWithPolicyIgnore(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
[Timeline, Resource, Inline=FastReturn]
@@ -439,24 +454,38 @@
[DOMDebugger, Inline=FastReturn]
void willExecuteCustomElementCallback([Keep] Element*);
+
+ [Debugger, Inline=FastReturn]
+ int traceAsyncOperationStarting([Keep] ExecutionContext*, const String& operationName);
+
+ [Debugger, Inline=FastReturn]
+ int traceAsyncOperationStarting([Keep] ExecutionContext*, const String& operationName, int prevOperationId);
+
+ [Debugger, Inline=FastReturn]
+ void traceAsyncOperationCompleted([Keep] ExecutionContext*, int operationId);
+
+ [Debugger, Inline=FastReturn]
+ InspectorInstrumentationCookie traceAsyncOperationCompletedCallbackStarting([Keep] ExecutionContext*, int operationId);
+
+ [Debugger, Inline=FastReturn]
+ InspectorInstrumentationCookie traceAsyncCallbackStarting([Keep] ExecutionContext*, int operationId);
+
+ [Debugger, Inline=FastReturn]
+ void traceAsyncCallbackCompleted(const InspectorInstrumentationCookie&);
}
interface InspectorConsoleInstrumentation {
#include "core/inspector/ScriptArguments.h"
-#include "core/inspector/ScriptCallStack.h"
- // FIXME: Convert to ScriptArguments to match non-worker context.
- // Use the same implementation as above as a similar method dispatched on Page.
- [Console]
- void addMessageToConsole(ExecutionContext* context, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, unsigned long requestIdentifier = 0);
+class ConsoleMessage;
// Use the same implementation as above as a similar method dispatched on Page.
[Console]
- void addMessageToConsole(ExecutionContext* context, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber, ScriptState* state, unsigned long requestIdentifier = 0);
+ void addMessageToConsole(ExecutionContext* context, ConsoleMessage* consoleMessage);
[Console, Debugger]
- void addMessageToConsole(ExecutionContext* context, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptState* state, PassRefPtrWillBeRawPtr<ScriptArguments> arguments, unsigned long requestIdentifier = 0);
+ void addConsoleAPIMessageToConsole(ExecutionContext* context, MessageType type, MessageLevel level, const String& message, ScriptState* state, PassRefPtrWillBeRawPtr<ScriptArguments> arguments, unsigned long requestIdentifier = 0);
[Console]
void consoleCount(ExecutionContext* context, ScriptState* state, PassRefPtrWillBeRawPtr<ScriptArguments> arguments);
@@ -477,10 +506,14 @@
void consoleTimelineEnd([Keep] ExecutionContext* context, const String& title, ScriptState* state);
[Profiler, Inline=FastReturn]
- void consoleProfile(ExecutionContext* context, const String& title, ScriptState* state);
+ void consoleProfile([Keep] ExecutionContext* context, const String& title);
[Profiler, Inline=FastReturn]
- void consoleProfileEnd(ExecutionContext* context, const String& title, ScriptState* state);
+ void consoleProfileEnd(ExecutionContext* context, const String& title);
+
+ //FIXME: remove when we move console message storage from InspectorConsoleAgent to FrameConsole
+ [Console]
+ void adoptWorkerConsoleMessages(ExecutionContext* context, WorkerGlobalScopeProxy* proxy);
}
interface InspectorOverrides {
diff --git a/core/inspector/InspectorOverlayHost.idl b/core/inspector/InspectorOverlayHost.idl
index 2f1978e..8fc701b 100644
--- a/core/inspector/InspectorOverlayHost.idl
+++ b/core/inspector/InspectorOverlayHost.idl
@@ -29,6 +29,7 @@
*/
[
+ WillBeGarbageCollected,
NoInterfaceObject
] interface InspectorOverlayHost {
void resume();
diff --git a/core/inspector/JavaScriptCallFrame.idl b/core/inspector/JavaScriptCallFrame.idl
index e4c4baa..f4482d1 100644
--- a/core/inspector/JavaScriptCallFrame.idl
+++ b/core/inspector/JavaScriptCallFrame.idl
@@ -36,11 +36,11 @@
const unsigned short CLOSURE_SCOPE = 3;
const unsigned short CATCH_SCOPE = 4;
- [Custom] void evaluate(DOMString script);
+ [Custom] void evaluateWithExceptionDetails(DOMString script);
[Custom] any restart();
// Only declarative scope (local, with and catch) is accepted. Returns undefined.
- [CallWith=ScriptState] any setVariableValue([Default=Undefined] optional long scopeIndex, [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString variableName, [Default=Undefined] optional any newValue);
+ [CallWith=ScriptState] any setVariableValue([Default=Undefined] optional long scopeIndex, [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? variableName, [Default=Undefined] optional any newValue);
readonly attribute JavaScriptCallFrame caller;
readonly attribute long sourceID;
diff --git a/core/page/EventSource.idl b/core/page/EventSource.idl
index 932fece..685c569 100644
--- a/core/page/EventSource.idl
+++ b/core/page/EventSource.idl
@@ -34,11 +34,11 @@
ActiveDOMObject,
Constructor(DOMString url, optional Dictionary eventSourceInit),
ConstructorCallWith=ExecutionContext,
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
RaisesException=Constructor,
] interface EventSource : EventTarget {
- [MeasureAs=EventSourceURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+ [DeprecateAs=EventSourceURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
readonly attribute DOMString url;
readonly attribute boolean withCredentials;
diff --git a/core/storage/Storage.idl b/core/storage/Storage.idl
index 288703d..16c7cbd 100644
--- a/core/storage/Storage.idl
+++ b/core/storage/Storage.idl
@@ -35,8 +35,8 @@
[RaisesException] deleter boolean (DOMString name);
[NotEnumerable, RaisesException=Getter] readonly attribute unsigned long length;
- [NotEnumerable, RaisesException, TreatReturnedNullStringAs=Null] DOMString key(unsigned long index);
- [LogActivity, NotEnumerable, RaisesException, TreatReturnedNullStringAs=Null] DOMString getItem(DOMString key);
+ [NotEnumerable, RaisesException] DOMString? key(unsigned long index);
+ [LogActivity, NotEnumerable, RaisesException] DOMString? getItem(DOMString key);
[LogActivity, NotEnumerable, RaisesException] void setItem(DOMString key, DOMString data);
[LogActivity, NotEnumerable, RaisesException] void removeItem(DOMString key);
[LogActivity, NotEnumerable, RaisesException] void clear();
diff --git a/core/storage/StorageEvent.idl b/core/storage/StorageEvent.idl
index effe79f..39801af 100644
--- a/core/storage/StorageEvent.idl
+++ b/core/storage/StorageEvent.idl
@@ -36,8 +36,8 @@
[Default=Undefined] optional boolean canBubbleArg,
[Default=Undefined] optional boolean cancelableArg,
[Default=Undefined] optional DOMString keyArg,
- [Default=Undefined, TreatNullAs=NullString] optional DOMString oldValueArg,
- [Default=Undefined, TreatNullAs=NullString] optional DOMString newValueArg,
+ [Default=Undefined] optional DOMString? oldValueArg,
+ [Default=Undefined] optional DOMString? newValueArg,
[Default=Undefined] optional DOMString urlArg,
[Default=Undefined] optional Storage storageAreaArg);
diff --git a/core/streams/ReadableStream.idl b/core/streams/ReadableStream.idl
new file mode 100644
index 0000000..927fa94
--- /dev/null
+++ b/core/streams/ReadableStream.idl
@@ -0,0 +1,9 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=Stream,
+ GarbageCollected
+] interface ReadableStream {
+};
diff --git a/core/fileapi/Stream.idl b/core/streams/Stream.idl
similarity index 100%
rename from core/fileapi/Stream.idl
rename to core/streams/Stream.idl
diff --git a/core/svg/SVGAngle.idl b/core/svg/SVGAngle.idl
index f4b306a..cc9a8bc 100644
--- a/core/svg/SVGAngle.idl
+++ b/core/svg/SVGAngle.idl
@@ -23,7 +23,7 @@
[
ImplementedAs=SVGAngleTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGAngle {
// Angle Unit Types
const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGAnimatedBoolean.idl b/core/svg/SVGAnimatedBoolean.idl
index f009f6f..daeb710 100644
--- a/core/svg/SVGAnimatedBoolean.idl
+++ b/core/svg/SVGAnimatedBoolean.idl
@@ -25,7 +25,7 @@
[
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGAnimatedBoolean {
[RaisesException=Setter] attribute boolean baseVal;
readonly attribute boolean animVal;
diff --git a/core/svg/SVGAnimatedEnumeration.idl b/core/svg/SVGAnimatedEnumeration.idl
index 25621e7..8a4f2d9 100644
--- a/core/svg/SVGAnimatedEnumeration.idl
+++ b/core/svg/SVGAnimatedEnumeration.idl
@@ -26,7 +26,7 @@
[
ImplementedAs=SVGAnimatedEnumerationBase,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGAnimatedEnumeration {
[RaisesException=Setter] attribute unsigned short baseVal;
readonly attribute unsigned short animVal;
diff --git a/core/svg/SVGAnimatedInteger.idl b/core/svg/SVGAnimatedInteger.idl
index 4585be9..87c2d7f 100644
--- a/core/svg/SVGAnimatedInteger.idl
+++ b/core/svg/SVGAnimatedInteger.idl
@@ -25,7 +25,7 @@
[
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGAnimatedInteger {
[RaisesException=Setter] attribute long baseVal;
readonly attribute long animVal;
diff --git a/core/svg/SVGAnimatedNumber.idl b/core/svg/SVGAnimatedNumber.idl
index ca88082..f941bdf 100644
--- a/core/svg/SVGAnimatedNumber.idl
+++ b/core/svg/SVGAnimatedNumber.idl
@@ -26,7 +26,7 @@
[
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGAnimatedNumber {
[RaisesException=Setter] attribute float baseVal;
readonly attribute float animVal;
diff --git a/core/svg/SVGElement.idl b/core/svg/SVGElement.idl
index d18904f..4ee3be5 100644
--- a/core/svg/SVGElement.idl
+++ b/core/svg/SVGElement.idl
@@ -23,12 +23,12 @@
[
Custom=Wrap,
] interface SVGElement : Element {
- attribute DOMString xmlbase;
- [TypeChecking=Interface|Nullable] readonly attribute SVGSVGElement? ownerSVGElement;
- [TypeChecking=Interface|Nullable] readonly attribute SVGElement? viewportElement;
+ [Reflect] attribute DOMString xmlbase;
+ readonly attribute SVGSVGElement? ownerSVGElement;
+ readonly attribute SVGElement? viewportElement;
- attribute DOMString xmllang;
- attribute DOMString xmlspace;
+ [Reflect] attribute DOMString xmllang;
+ [Reflect] attribute DOMString xmlspace;
[MeasureAs=SVGClassName] readonly attribute SVGAnimatedString className;
diff --git a/core/svg/SVGFEMorphologyElement.idl b/core/svg/SVGFEMorphologyElement.idl
index 831d126..25206f4 100644
--- a/core/svg/SVGFEMorphologyElement.idl
+++ b/core/svg/SVGFEMorphologyElement.idl
@@ -37,9 +37,6 @@
[ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
readonly attribute SVGAnimatedNumber radiusX;
readonly attribute SVGAnimatedNumber radiusY;
-
- [MeasureAs=SVGFEMorphologyElementSetRadius] void setRadius([Default=Undefined] optional float radiusX,
- [Default=Undefined] optional float radiusY); // non-standard
};
SVGFEMorphologyElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFilterElement.idl b/core/svg/SVGFilterElement.idl
index 5aa71f5..0e6cbaf 100644
--- a/core/svg/SVGFilterElement.idl
+++ b/core/svg/SVGFilterElement.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGFilterElement : SVGElement {
readonly attribute SVGAnimatedEnumeration filterUnits;
readonly attribute SVGAnimatedEnumeration primitiveUnits;
diff --git a/core/svg/SVGGeometryElement.idl b/core/svg/SVGGeometryElement.idl
index cd4887c..932b948 100644
--- a/core/svg/SVGGeometryElement.idl
+++ b/core/svg/SVGGeometryElement.idl
@@ -29,7 +29,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGGeometryElement : SVGGraphicsElement {
boolean isPointInFill(SVGPoint point);
boolean isPointInStroke(SVGPoint point);
diff --git a/core/svg/SVGGraphicsElement.idl b/core/svg/SVGGraphicsElement.idl
index 4241020..dc52a52 100644
--- a/core/svg/SVGGraphicsElement.idl
+++ b/core/svg/SVGGraphicsElement.idl
@@ -31,7 +31,7 @@
// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGGraphicsElement
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGGraphicsElement : SVGElement {
readonly attribute SVGAnimatedTransformList transform;
diff --git a/core/svg/SVGLength.idl b/core/svg/SVGLength.idl
index 1774912..48e5a1f 100644
--- a/core/svg/SVGLength.idl
+++ b/core/svg/SVGLength.idl
@@ -23,7 +23,7 @@
[
ImplementedAs=SVGLengthTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGLength {
// Length Unit Types
const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGLengthList.idl b/core/svg/SVGLengthList.idl
index 23c8719..b07416c 100644
--- a/core/svg/SVGLengthList.idl
+++ b/core/svg/SVGLengthList.idl
@@ -27,7 +27,7 @@
[
ImplementedAs=SVGLengthListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGLengthList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/svg/SVGMarkerElement.idl b/core/svg/SVGMarkerElement.idl
index 4527585..ff7cc37 100644
--- a/core/svg/SVGMarkerElement.idl
+++ b/core/svg/SVGMarkerElement.idl
@@ -26,7 +26,7 @@
// http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGMarkerElement : SVGElement {
// Marker Unit Types
diff --git a/core/svg/SVGMatrix.idl b/core/svg/SVGMatrix.idl
index 90d00e4..663c5be 100644
--- a/core/svg/SVGMatrix.idl
+++ b/core/svg/SVGMatrix.idl
@@ -21,7 +21,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
ImplementedAs=SVGMatrixTearOff,
SetWrapperReferenceTo(SVGTransform contextTransform)
] interface SVGMatrix {
diff --git a/core/svg/SVGNumber.idl b/core/svg/SVGNumber.idl
index 63c4b52..adf8dc6 100644
--- a/core/svg/SVGNumber.idl
+++ b/core/svg/SVGNumber.idl
@@ -23,7 +23,7 @@
[
ImplementedAs=SVGNumberTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGNumber {
// FIXMEDART: this attribute probably does not need to be DartCustom
// anymore.
diff --git a/core/svg/SVGNumberList.idl b/core/svg/SVGNumberList.idl
index e5cf2fe..8fdbcf9 100644
--- a/core/svg/SVGNumberList.idl
+++ b/core/svg/SVGNumberList.idl
@@ -27,7 +27,7 @@
[
ImplementedAs=SVGNumberListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGNumberList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/svg/SVGPathElement.idl b/core/svg/SVGPathElement.idl
index 3cc9d2f..df7ac8c 100644
--- a/core/svg/SVGPathElement.idl
+++ b/core/svg/SVGPathElement.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathElement : SVGGeometryElement {
readonly attribute SVGAnimatedNumber pathLength;
diff --git a/core/svg/SVGPathSegArcAbs.idl b/core/svg/SVGPathSegArcAbs.idl
index 9f60267..1695f53 100644
--- a/core/svg/SVGPathSegArcAbs.idl
+++ b/core/svg/SVGPathSegArcAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegArcAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegArcRel.idl b/core/svg/SVGPathSegArcRel.idl
index 405a5c6..febd2bf 100644
--- a/core/svg/SVGPathSegArcRel.idl
+++ b/core/svg/SVGPathSegArcRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegArcRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicAbs.idl b/core/svg/SVGPathSegCurvetoCubicAbs.idl
index 3fb452c..8c666eb 100644
--- a/core/svg/SVGPathSegCurvetoCubicAbs.idl
+++ b/core/svg/SVGPathSegCurvetoCubicAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoCubicAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicRel.idl b/core/svg/SVGPathSegCurvetoCubicRel.idl
index a047127..2353cbb 100644
--- a/core/svg/SVGPathSegCurvetoCubicRel.idl
+++ b/core/svg/SVGPathSegCurvetoCubicRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoCubicRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl b/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl
index c84d239..63a7da2 100644
--- a/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl
+++ b/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoCubicSmoothAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl b/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl
index daa38e3..9253bb3 100644
--- a/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl
+++ b/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoCubicSmoothRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticAbs.idl b/core/svg/SVGPathSegCurvetoQuadraticAbs.idl
index 3014b01..d7bfc66 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticAbs.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoQuadraticAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticRel.idl b/core/svg/SVGPathSegCurvetoQuadraticRel.idl
index a14cbe3..d4da453 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticRel.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoQuadraticRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl b/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl
index aad9a56..8db13c3 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoQuadraticSmoothAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl b/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl
index a1e6aba..cecfb26 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegCurvetoQuadraticSmoothRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegLinetoAbs.idl b/core/svg/SVGPathSegLinetoAbs.idl
index e1c1f5c..23cf3ac 100644
--- a/core/svg/SVGPathSegLinetoAbs.idl
+++ b/core/svg/SVGPathSegLinetoAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegLinetoAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegLinetoHorizontalAbs.idl b/core/svg/SVGPathSegLinetoHorizontalAbs.idl
index 08d774c..655043f 100644
--- a/core/svg/SVGPathSegLinetoHorizontalAbs.idl
+++ b/core/svg/SVGPathSegLinetoHorizontalAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegLinetoHorizontalAbs : SVGPathSeg {
attribute float x;
};
diff --git a/core/svg/SVGPathSegLinetoHorizontalRel.idl b/core/svg/SVGPathSegLinetoHorizontalRel.idl
index 34d378d..681d639 100644
--- a/core/svg/SVGPathSegLinetoHorizontalRel.idl
+++ b/core/svg/SVGPathSegLinetoHorizontalRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegLinetoHorizontalRel : SVGPathSeg {
attribute float x;
};
diff --git a/core/svg/SVGPathSegLinetoRel.idl b/core/svg/SVGPathSegLinetoRel.idl
index f356c17..a73f5d2 100644
--- a/core/svg/SVGPathSegLinetoRel.idl
+++ b/core/svg/SVGPathSegLinetoRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegLinetoRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegLinetoVerticalAbs.idl b/core/svg/SVGPathSegLinetoVerticalAbs.idl
index 9c6aaa9..7371094 100644
--- a/core/svg/SVGPathSegLinetoVerticalAbs.idl
+++ b/core/svg/SVGPathSegLinetoVerticalAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegLinetoVerticalAbs : SVGPathSeg {
attribute float y;
};
diff --git a/core/svg/SVGPathSegLinetoVerticalRel.idl b/core/svg/SVGPathSegLinetoVerticalRel.idl
index 36f44d4..74ccdee 100644
--- a/core/svg/SVGPathSegLinetoVerticalRel.idl
+++ b/core/svg/SVGPathSegLinetoVerticalRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegLinetoVerticalRel : SVGPathSeg {
attribute float y;
};
diff --git a/core/svg/SVGPathSegList.idl b/core/svg/SVGPathSegList.idl
index 5e896e4..9f8381b 100644
--- a/core/svg/SVGPathSegList.idl
+++ b/core/svg/SVGPathSegList.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
SetWrapperReferenceTo(SVGElement contextElement),
ImplementedAs=SVGPathSegListTearOff
] interface SVGPathSegList {
diff --git a/core/svg/SVGPathSegMovetoAbs.idl b/core/svg/SVGPathSegMovetoAbs.idl
index b257339..391b6b7 100644
--- a/core/svg/SVGPathSegMovetoAbs.idl
+++ b/core/svg/SVGPathSegMovetoAbs.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegMovetoAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegMovetoRel.idl b/core/svg/SVGPathSegMovetoRel.idl
index 15891e3..49cfa67 100644
--- a/core/svg/SVGPathSegMovetoRel.idl
+++ b/core/svg/SVGPathSegMovetoRel.idl
@@ -25,7 +25,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPathSegMovetoRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPoint.idl b/core/svg/SVGPoint.idl
index a192380..bb30f3d 100644
--- a/core/svg/SVGPoint.idl
+++ b/core/svg/SVGPoint.idl
@@ -23,7 +23,7 @@
[
ImplementedAs=SVGPointTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPoint {
[RaisesException=Setter] attribute float x;
[RaisesException=Setter] attribute float y;
diff --git a/core/svg/SVGPointList.idl b/core/svg/SVGPointList.idl
index 444570b..7bf20b5 100644
--- a/core/svg/SVGPointList.idl
+++ b/core/svg/SVGPointList.idl
@@ -26,7 +26,7 @@
[
ImplementedAs=SVGPointListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGPointList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/svg/SVGPreserveAspectRatio.idl b/core/svg/SVGPreserveAspectRatio.idl
index 67b7124..9c6d89e 100644
--- a/core/svg/SVGPreserveAspectRatio.idl
+++ b/core/svg/SVGPreserveAspectRatio.idl
@@ -24,7 +24,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
ImplementedAs=SVGPreserveAspectRatioTearOff,
SetWrapperReferenceTo(SVGElement contextElement)
] interface SVGPreserveAspectRatio {
diff --git a/core/svg/SVGRect.idl b/core/svg/SVGRect.idl
index faff038..f602ce1 100644
--- a/core/svg/SVGRect.idl
+++ b/core/svg/SVGRect.idl
@@ -23,7 +23,7 @@
[
ImplementedAs=SVGRectTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGRect {
[RaisesException=Setter] attribute float x;
[RaisesException=Setter] attribute float y;
diff --git a/core/svg/SVGSVGElement.idl b/core/svg/SVGSVGElement.idl
index 093f153..ad7db21 100644
--- a/core/svg/SVGSVGElement.idl
+++ b/core/svg/SVGSVGElement.idl
@@ -25,7 +25,7 @@
// TODO: no css::ViewCSS available!
// TODO: no events::DocumentEvent available!
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGSVGElement : SVGGraphicsElement {
readonly attribute SVGAnimatedLength x;
diff --git a/core/svg/SVGStringList.idl b/core/svg/SVGStringList.idl
index 870ba4c..dbbdf9d 100644
--- a/core/svg/SVGStringList.idl
+++ b/core/svg/SVGStringList.idl
@@ -24,7 +24,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
SetWrapperReferenceTo(SVGElement contextElement),
ImplementedAs=SVGStringListTearOff
] interface SVGStringList {
diff --git a/core/svg/SVGStyleElement.idl b/core/svg/SVGStyleElement.idl
index a80a727..482efa9 100644
--- a/core/svg/SVGStyleElement.idl
+++ b/core/svg/SVGStyleElement.idl
@@ -28,6 +28,9 @@
attribute boolean disabled;
attribute DOMString type;
attribute DOMString media;
- attribute DOMString title;
+ [MeasureAs=SVGStyleElementTitle] attribute DOMString title;
+
+ // DOM Level 2 Style
+ readonly attribute StyleSheet sheet;
};
diff --git a/core/svg/SVGTextContentElement.idl b/core/svg/SVGTextContentElement.idl
index 4f0466b..9d1f4f4 100644
--- a/core/svg/SVGTextContentElement.idl
+++ b/core/svg/SVGTextContentElement.idl
@@ -24,7 +24,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGTextContentElement : SVGGraphicsElement {
// lengthAdjust Types
const unsigned short LENGTHADJUST_UNKNOWN = 0;
diff --git a/core/svg/SVGTransform.idl b/core/svg/SVGTransform.idl
index d810948..cb4c437 100644
--- a/core/svg/SVGTransform.idl
+++ b/core/svg/SVGTransform.idl
@@ -20,7 +20,7 @@
*/
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
ImplementedAs=SVGTransformTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
] interface SVGTransform {
diff --git a/core/svg/SVGTransformList.idl b/core/svg/SVGTransformList.idl
index 9bc5521..95663fc 100644
--- a/core/svg/SVGTransformList.idl
+++ b/core/svg/SVGTransformList.idl
@@ -27,7 +27,7 @@
[
ImplementedAs=SVGTransformListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface SVGTransformList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/testing/GarbageCollectedScriptWrappable.idl b/core/testing/GarbageCollectedScriptWrappable.idl
new file mode 100644
index 0000000..0fd3bde
--- /dev/null
+++ b/core/testing/GarbageCollectedScriptWrappable.idl
@@ -0,0 +1,9 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ GarbageCollected
+] interface GarbageCollectedScriptWrappable {
+ [NotEnumerable] DOMString toString();
+};
diff --git a/core/testing/InternalSettings.idl b/core/testing/InternalSettings.idl
index 4120690..dabbbb4 100644
--- a/core/testing/InternalSettings.idl
+++ b/core/testing/InternalSettings.idl
@@ -29,6 +29,7 @@
// All methods which access Page::settings() can raise an exception
// when the page cannot be accessed. (Such as during page tear-down.)
[RaisesException] void setMockScrollbarsEnabled(boolean enabled);
+ [RaisesException] void setMockGestureTapHighlightsEnabled(boolean enabled);
[RaisesException] void setStandardFontFamily(DOMString family, DOMString script);
[RaisesException] void setSerifFontFamily(DOMString family, DOMString script);
[RaisesException] void setSansSerifFontFamily(DOMString family, DOMString script);
@@ -53,9 +54,9 @@
// cannot be changed after process start. These setters should
// be removed or moved onto internals.runtimeFlags:
void setAuthorShadowDOMForAnyElementEnabled(boolean enabled);
- void setCSSExclusionsEnabled(boolean enabled);
void setLangAttributeAwareFormControlUIEnabled(boolean enabled);
void setOverlayScrollbarsEnabled(boolean enabled);
void setExperimentalContentSecurityPolicyFeaturesEnabled(boolean enabled);
+ void setLaxMixedContentCheckingEnabled(boolean enabled);
void setPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(boolean enabled);
};
diff --git a/core/testing/Internals.idl b/core/testing/Internals.idl
index daec6fd..675dfbc 100644
--- a/core/testing/Internals.idl
+++ b/core/testing/Internals.idl
@@ -32,7 +32,7 @@
GCObservation observeGC(any observed);
- [RaisesException] DOMString elementRenderTreeAsText(Element element);
+ [RaisesException, TypeChecking=Interface] DOMString elementRenderTreeAsText(Element element);
boolean isPreloaded(DOMString url);
boolean isLoadingFromMemoryCache(DOMString url);
@@ -42,45 +42,45 @@
[RaisesException] DOMString styleResolverStatsReport();
[RaisesException] DOMString styleResolverStatsTotalsReport();
- [RaisesException] boolean isSharingStyle(Element element1, Element element2);
+ [TypeChecking=Interface] boolean isSharingStyle(Element element1, Element element2);
- [RaisesException] CSSStyleDeclaration computedStyleIncludingVisitedInfo(Node node);
+ [TypeChecking=Interface] CSSStyleDeclaration computedStyleIncludingVisitedInfo(Node node);
- [RaisesException] ShadowRoot shadowRoot(Element host);
- [RaisesException] ShadowRoot youngestShadowRoot(Element host);
- [RaisesException] ShadowRoot oldestShadowRoot(Element host);
- [RaisesException] ShadowRoot youngerShadowRoot(Node root);
+ [TypeChecking=Interface] ShadowRoot shadowRoot(Element host);
+ [TypeChecking=Interface] ShadowRoot youngestShadowRoot(Element host);
+ [TypeChecking=Interface] ShadowRoot oldestShadowRoot(Element host);
+ [RaisesException, TypeChecking=Interface] ShadowRoot youngerShadowRoot(Node root);
- [RaisesException] DOMString shadowRootType(Node root);
+ [RaisesException, TypeChecking=Interface] DOMString shadowRootType(Node root);
[RaisesException] boolean hasShadowInsertionPoint(Node root);
[RaisesException] boolean hasContentElement(Node root);
- [RaisesException] unsigned long countElementShadow(Node Root);
- [RaisesException] DOMString shadowPseudoId(Element element);
- [RaisesException] void setShadowPseudoId(Element element, DOMString id);
- [RaisesException] boolean isValidContentSelect(Element contentElement);
- [RaisesException] Node treeScopeRootNode(Node node);
- [RaisesException] Node parentTreeScope(Node node);
- [RaisesException] boolean hasSelectorForIdInShadow(Element host, DOMString id);
- [RaisesException] boolean hasSelectorForClassInShadow(Element host, DOMString className);
- [RaisesException] boolean hasSelectorForAttributeInShadow(Element host, DOMString attributeName);
- [RaisesException] boolean hasSelectorForPseudoClassInShadow(Element host, DOMString pseudoClass);
- [RaisesException] unsigned short compareTreeScopePosition(Node treeScope1, Node treeScope2);
+ [RaisesException, TypeChecking=Interface] unsigned long countElementShadow(Node Root);
+ [TypeChecking=Interface] DOMString shadowPseudoId(Element element);
+ [TypeChecking=Interface] void setShadowPseudoId(Element element, DOMString id);
+ [RaisesException, TypeChecking=Interface] boolean isValidContentSelect(Element contentElement);
+ [TypeChecking=Interface] Node treeScopeRootNode(Node node);
+ [TypeChecking=Interface] Node parentTreeScope(Node node);
+ [RaisesException, TypeChecking=Interface] boolean hasSelectorForIdInShadow(Element host, DOMString id);
+ [RaisesException, TypeChecking=Interface] boolean hasSelectorForClassInShadow(Element host, DOMString className);
+ [RaisesException, TypeChecking=Interface] boolean hasSelectorForAttributeInShadow(Element host, DOMString attributeName);
+ [RaisesException, TypeChecking=Interface] boolean hasSelectorForPseudoClassInShadow(Element host, DOMString pseudoClass);
+ [RaisesException, TypeChecking=Interface] unsigned short compareTreeScopePosition(Node treeScope1, Node treeScope2);
[RaisesException] unsigned long updateStyleAndReturnAffectedElementCount();
[RaisesException] unsigned long needsLayoutCount();
+ [RaisesException] unsigned long hitTestCount(Document document);
// CSS Animation and Transition testing.
- unsigned long numberOfActiveAnimations();
[RaisesException] void pauseAnimations(double pauseTime);
- [RaisesException] Node nextSiblingByWalker(Node node);
- [RaisesException] Node firstChildByWalker(Node node);
- [RaisesException] Node lastChildByWalker(Node node);
- [RaisesException] Node nextNodeByWalker(Node node);
- [RaisesException] Node previousNodeByWalker(Node node);
+ [TypeChecking=Interface] Node nextSiblingByWalker(Node node);
+ [TypeChecking=Interface] Node firstChildByWalker(Node node);
+ [TypeChecking=Interface] Node lastChildByWalker(Node node);
+ [TypeChecking=Interface] Node nextNodeByWalker(Node node);
+ [TypeChecking=Interface] Node previousNodeByWalker(Node node);
DOMString visiblePlaceholder(Element element);
- void selectColorInColorChooser(Element element, DOMString colorValue);
+ [TypeChecking=Interface] void selectColorInColorChooser(Element element, DOMString colorValue);
// If the argument is omitted, the top-level document is used.
boolean hasAutofocusRequest(optional Document document);
@@ -93,42 +93,42 @@
[RaisesException] ClientRect absoluteCaretBounds();
- [RaisesException] ClientRect boundingBox(Element element);
+ [TypeChecking=Interface] ClientRect boundingBox(Element element);
- [RaisesException] unsigned long markerCountForNode(Node node, DOMString markerType);
- [RaisesException] unsigned long activeMarkerCountForNode(Node node);
- [RaisesException] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
- [RaisesException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
- void addTextMatchMarker(Range range, boolean isActive);
- [RaisesException] void setMarkersActive(Node node, unsigned long startOffset, unsigned long endOffset, boolean active);
- [RaisesException] void setMarkedTextMatchesAreHighlighted(Document document, boolean highlight);
+ [RaisesException, TypeChecking=Interface] unsigned long markerCountForNode(Node node, DOMString markerType);
+ [TypeChecking=Interface] unsigned long activeMarkerCountForNode(Node node);
+ [RaisesException, TypeChecking=Interface] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
+ [RaisesException, TypeChecking=Interface] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
+ [TypeChecking=Interface] void addTextMatchMarker(Range range, boolean isActive);
+ [TypeChecking=Interface] void setMarkersActive(Node node, unsigned long startOffset, unsigned long endOffset, boolean active);
+ void setMarkedTextMatchesAreHighlighted(Document document, boolean highlight);
- [RaisesException] void setScrollViewPosition(Document document, long x, long y);
+ [RaisesException, TypeChecking=Interface] void setScrollViewPosition(Document document, long x, long y);
- [RaisesException] DOMString viewportAsText(Document document,
- float devicePixelRatio,
- long availableWidth,
- long availableHeight);
+ [RaisesException, TypeChecking=Interface] DOMString viewportAsText(Document document,
+ float devicePixelRatio,
+ long availableWidth,
+ long availableHeight);
- [RaisesException] boolean wasLastChangeUserEdit(Element textField);
- [RaisesException] boolean elementShouldAutoComplete(Element inputElement);
- [RaisesException] DOMString suggestedValue(Element inputElement);
- [RaisesException] void setSuggestedValue(Element inputElement, DOMString value);
- [RaisesException] void setEditingValue(Element inputElement, DOMString value);
- [RaisesException] void setAutofilled(Element inputElement, boolean enabled);
+ [RaisesException, TypeChecking=Interface] boolean wasLastChangeUserEdit(Element textField);
+ [RaisesException, TypeChecking=Interface] boolean elementShouldAutoComplete(Element inputElement);
+ [RaisesException, TypeChecking=Interface] DOMString suggestedValue(Element inputElement);
+ [RaisesException, TypeChecking=Interface] void setSuggestedValue(Element inputElement, DOMString value);
+ [RaisesException, TypeChecking=Interface] void setEditingValue(Element inputElement, DOMString value);
+ [RaisesException, TypeChecking=Interface] void setAutofilled(Element inputElement, boolean enabled);
- [RaisesException] void scrollElementToRect(Element element, long x, long y, long w, long h);
+ [RaisesException, TypeChecking=Interface] void scrollElementToRect(Element element, long x, long y, long w, long h);
- [RaisesException] Range rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
- [RaisesException] unsigned long locationFromRange(Element scope, Range range);
- [RaisesException] unsigned long lengthFromRange(Element scope, Range range);
- [RaisesException] DOMString rangeAsText(Range range);
+ [TypeChecking=Interface] Range rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
+ [TypeChecking=Interface] unsigned long locationFromRange(Element scope, Range range);
+ [TypeChecking=Interface] unsigned long lengthFromRange(Element scope, Range range);
+ [TypeChecking=Interface] DOMString rangeAsText(Range range);
- [RaisesException] WebKitPoint touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
- [RaisesException] Node touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
- [RaisesException] WebKitPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
- [RaisesException] Node touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
- [RaisesException] ClientRect bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document document);
+ [RaisesException, TypeChecking=Interface] WebKitPoint touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
+ [RaisesException, TypeChecking=Interface] Node touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
+ [RaisesException, TypeChecking=Interface] WebKitPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
+ [RaisesException, TypeChecking=Interface] Node touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
+ [RaisesException, TypeChecking=Interface] ClientRect bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document document);
[RaisesException] long lastSpellCheckRequestSequence(Document document);
[RaisesException] long lastSpellCheckProcessedSequence(Document document);
@@ -136,30 +136,30 @@
sequence<DOMString> userPreferredLanguages();
void setUserPreferredLanguages(sequence<DOMString> languages);
- [RaisesException] unsigned long activeDOMObjectCount(Document document);
- [RaisesException] unsigned long wheelEventHandlerCount(Document document);
- [RaisesException] unsigned long scrollEventHandlerCount(Document document);
- [RaisesException] unsigned long touchEventHandlerCount(Document document);
- [RaisesException] LayerRectList touchEventTargetLayerRects(Document document);
+ [TypeChecking=Interface] unsigned long activeDOMObjectCount(Document document);
+ [TypeChecking=Interface] unsigned long wheelEventHandlerCount(Document document);
+ [TypeChecking=Interface] unsigned long scrollEventHandlerCount(Document document);
+ [TypeChecking=Interface] unsigned long touchEventHandlerCount(Document document);
+ [RaisesException, TypeChecking=Interface] LayerRectList touchEventTargetLayerRects(Document document);
- [RaisesException] NodeList nodesFromRect(Document document, long x, long y,
+ [RaisesException, TypeChecking=Interface] NodeList nodesFromRect(Document document, long x, long y,
unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
- boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
+ boolean ignoreClipping, boolean allowChildFrameContent);
void emitInspectorDidBeginFrame(optional long frameId);
void emitInspectorDidCancelFrame();
- [RaisesException] boolean hasSpellingMarker(Document document, long from, long length);
- [RaisesException] boolean hasGrammarMarker(Document document, long from, long length);
- [RaisesException] void setContinuousSpellCheckingEnabled(boolean enabled);
+ [TypeChecking=Interface] boolean hasSpellingMarker(Document document, long from, long length);
+ [TypeChecking=Interface] boolean hasGrammarMarker(Document document, long from, long length);
+ void setContinuousSpellCheckingEnabled(boolean enabled);
- [RaisesException] boolean isOverwriteModeEnabled(Document document);
- [RaisesException] void toggleOverwriteModeEnabled(Document document);
+ [TypeChecking=Interface] boolean isOverwriteModeEnabled(Document document);
+ [TypeChecking=Interface] void toggleOverwriteModeEnabled(Document document);
- [RaisesException] unsigned long numberOfScrollableAreas(Document document);
+ [TypeChecking=Interface] unsigned long numberOfScrollableAreas(Document document);
- [RaisesException] boolean isPageBoxVisible(Document document, long pageNumber);
+ [TypeChecking=Interface] boolean isPageBoxVisible(Document document, long pageNumber);
readonly attribute InternalSettings settings;
readonly attribute InternalProfilers profilers;
@@ -172,24 +172,19 @@
const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 4;
const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER = 8;
const unsigned short LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS = 16;
- [RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags);
- [RaisesException] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
+ [RaisesException, TypeChecking=Interface] DOMString layerTreeAsText(Document document, optional unsigned short flags);
+ [RaisesException, TypeChecking=Interface] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
- [RaisesException] boolean scrollsWithRespectTo(Element element1, Element element2);
- [RaisesException] boolean isUnclippedDescendant(Element element);
+ [RaisesException, TypeChecking=Interface] boolean scrollsWithRespectTo(Element element1, Element element2);
+ [RaisesException, TypeChecking=Interface] boolean isUnclippedDescendant(Element element);
- [RaisesException] DOMString scrollingStateTreeAsText(Document document);
- [RaisesException] DOMString mainThreadScrollingReasons(Document document);
- [RaisesException] ClientRectList nonFastScrollableRects(Document document);
+ [TypeChecking=Interface] DOMString scrollingStateTreeAsText(Document document);
+ [RaisesException, TypeChecking=Interface] DOMString mainThreadScrollingReasons(Document document);
+ [RaisesException, TypeChecking=Interface] ClientRectList nonFastScrollableRects(Document document);
- [RaisesException] DOMString repaintRectsAsText(Document document);
- [RaisesException] ClientRectList repaintRects(Element element);
-
- [RaisesException] void garbageCollectDocumentResources(Document document);
+ [TypeChecking=Interface] void garbageCollectDocumentResources(Document document);
void evictAllResources();
- void allowRoundingHacks();
-
unsigned long numberOfLiveNodes();
unsigned long numberOfLiveDocuments();
DOMString dumpRefCountedInstanceCounts();
@@ -207,69 +202,73 @@
[RaisesException] void setDeviceScaleFactor(float scaleFactor);
- [RaisesException] void setIsCursorVisible(Document document, boolean isVisible);
-
- void webkitWillEnterFullScreenForElement(Document document, Element element);
- void webkitDidEnterFullScreenForElement(Document document, Element element);
- void webkitWillExitFullScreenForElement(Document document, Element element);
- void webkitDidExitFullScreenForElement(Document document, Element element);
+ [RaisesException, TypeChecking=Interface] void setIsCursorVisible(Document document, boolean isVisible);
void mediaPlayerRequestFullscreen(HTMLMediaElement mediaElement);
+ double effectiveMediaVolume(HTMLMediaElement mediaElement);
void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
- MallocStatistics mallocStatistics();
TypeConversions typeConversions();
+ // This is enabled only in Debug builds.
+ // This is because we want to avoid putting the byte stream of testing private scripts
+ // into the binary of Release builds.
+ PrivateScriptTest privateScriptTest();
+
DOMString[] getReferencedFilePaths();
// These functions both reset the tracked repaint rects. They are inteded to be used in the following order:
// startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
- [RaisesException] void startTrackingRepaints(Document document);
- [RaisesException] void stopTrackingRepaints(Document document);
+ [RaisesException, TypeChecking=Interface] void startTrackingRepaints(Document document);
+ [RaisesException, TypeChecking=Interface] void stopTrackingRepaints(Document document);
// |node| should be Document, HTMLIFrameElement, or unspecified.
// If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
// specified without security checks. Unspecified means this document.
[RaisesException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node node);
- [RaisesException] void forceFullRepaint(Document document);
+ [RaisesException, TypeChecking=Interface] void forceFullRepaint(Document document);
// Returns a list of draggable/non-draggable regions in the document.
- [RaisesException] ClientRectList draggableRegions(Document document);
- [RaisesException] ClientRectList nonDraggableRegions(Document document);
+ [RaisesException, TypeChecking=Interface] ClientRectList draggableRegions(Document document);
+ [RaisesException, TypeChecking=Interface] ClientRectList nonDraggableRegions(Document document);
// Returns a string with information about the mouse cursor used at the specified client location.
- [RaisesException] DOMString getCurrentCursorInfo(Document document);
+ [RaisesException, TypeChecking=Interface] DOMString getCurrentCursorInfo(Document document);
- [RaisesException] DOMString markerTextForListItem(Element element);
+ [TypeChecking=Interface] DOMString markerTextForListItem(Element element);
- [RaisesException] DOMString baseURL(Document document);
+ [TypeChecking=Interface] DOMString baseURL(Document document);
SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
ArrayBuffer serializeObject(SerializedScriptValue obj);
void forceReload(boolean endToEnd);
- [RaisesException] DOMString getImageSourceURL(Element element);
+ [TypeChecking=Interface] DOMString getImageSourceURL(Element element);
- boolean isSelectPopupVisible(Node node);
+ [TypeChecking=Interface] boolean isSelectPopupVisible(Node node);
+ boolean selectPopupItemStyleIsRtl(Node select, long itemIndex);
+ long selectPopupItemStyleFontHeight(Node select, long itemIndex);
[RaisesException] ClientRect selectionBounds();
boolean loseSharedGraphicsContext3D();
- [RaisesException] void forceCompositingUpdate(Document document);
+ [RaisesException, TypeChecking=Interface] void forceCompositingUpdate(Document document);
void setZoomFactor(float factor);
- [RaisesException] void setShouldRevealPassword(Element element, boolean reveal);
+ [RaisesException, TypeChecking=Interface] void setShouldRevealPassword(Element element, boolean reveal);
- [CallWith=ScriptState] Promise createPromise();
[CallWith=ScriptState] Promise createResolvedPromise(any value);
[CallWith=ScriptState] Promise createRejectedPromise(any reason);
- [CallWith=ExecutionContext] Promise addOneToPromise(Promise promise);
+ [CallWith=ScriptState] Promise addOneToPromise(Promise promise);
+ [CallWith=ScriptState, RaisesException] Promise promiseCheck(long arg1, boolean arg2, Dictionary arg3, DOMString arg4, DOMString[] arg5);
+ [CallWith=ScriptState] Promise promiseCheckWithoutExceptionState(Dictionary arg1, DOMString arg2, DOMString... variadic);
+ [CallWith=ScriptState] Promise promiseCheckRange([EnforceRange] octet arg1);
void setValueForUser(Element element, DOMString value);
@@ -277,10 +276,16 @@
void setFocused(boolean focused);
- [RaisesException] boolean ignoreLayoutWithPendingStylesheets(Document document);
+ [TypeChecking=Interface] boolean ignoreLayoutWithPendingStylesheets(Document document);
// These functions are for testing NetInfo. You must call setNetworkStateNotifierTestOnly(true)
// before calling setNetworkConnectionInfo.
void setNetworkStateNotifierTestOnly(boolean testOnly);
[RaisesException] void setNetworkConnectionInfo(DOMString type);
+
+ // This function is for testing HitRegions on Canvas2D.
+ unsigned long countHitRegions(CanvasRenderingContext2D context);
+
+ DOMString serializeNavigationMarkup();
+ void hideAllTransitionElements();
};
diff --git a/core/testing/MallocStatistics.idl b/core/testing/MallocStatistics.idl
deleted file mode 100644
index 5e969e9..0000000
--- a/core/testing/MallocStatistics.idl
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2012 SoftAtHome. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- WillBeGarbageCollected,
-] interface MallocStatistics {
- readonly attribute unsigned long reservedVMBytes;
- readonly attribute unsigned long committedVMBytes;
- readonly attribute unsigned long freeListBytes;
-};
diff --git a/core/testing/PartialPrivateScriptTest.idl b/core/testing/PartialPrivateScriptTest.idl
new file mode 100644
index 0000000..b19d17f
--- /dev/null
+++ b/core/testing/PartialPrivateScriptTest.idl
@@ -0,0 +1,9 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+partial interface PrivateScriptTest {
+ [ImplementedInPrivateScript] short addIntegerInPartial(short value1, short value2);
+ [ImplementedInPrivateScript] short addInteger2InPartial(short value1, short value2);
+ [ImplementedInPrivateScript] attribute DOMString stringAttributeInPartial;
+};
diff --git a/core/testing/PrivateScriptTest.idl b/core/testing/PrivateScriptTest.idl
new file mode 100644
index 0000000..20fca89
--- /dev/null
+++ b/core/testing/PrivateScriptTest.idl
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ GarbageCollected
+] interface PrivateScriptTest {
+ [ImplementedInPrivateScript] void doNothing();
+ [ImplementedInPrivateScript] short return123();
+ [ImplementedInPrivateScript] short echoInteger(short value);
+ [ImplementedInPrivateScript] DOMString echoString(DOMString value);
+ [ImplementedInPrivateScript] Node echoNode(Node value);
+ [ImplementedInPrivateScript] short addInteger(short value1, short value2);
+ [ImplementedInPrivateScript] DOMString addString(DOMString value1, DOMString value2);
+ [ImplementedInPrivateScript] void setIntegerToPrototype(short value);
+ [ImplementedInPrivateScript] short getIntegerFromPrototype();
+ [ImplementedInPrivateScript] void setIntegerToDocument(Document document, short value);
+ [ImplementedInPrivateScript] short getIntegerFromDocument(Document document);
+ [ImplementedInPrivateScript] Node createElement(Document document);
+ [ImplementedInPrivateScript] void appendChild(Node node1, Node node2);
+ [ImplementedInPrivateScript] Node firstChild(Node node);
+ [ImplementedInPrivateScript] Node nextSibling(Node node);
+ [ImplementedInPrivateScript] DOMString innerHTML(Node node);
+ [ImplementedInPrivateScript] void setInnerHTML(Node node, DOMString string);
+ [ImplementedInPrivateScript] void addClickListener(Node node);
+ [ImplementedInPrivateScript] void clickNode(Document document, Node node);
+ [ImplementedInPrivateScript] readonly attribute short readonlyShortAttribute;
+ [ImplementedInPrivateScript] attribute short shortAttribute;
+ [ImplementedInPrivateScript] attribute DOMString stringAttribute;
+ [ImplementedInPrivateScript] attribute Node nodeAttribute;
+ [ImplementedInPrivateScript] attribute Node nodeAttributeThrowsIndexSizeError;
+ [ImplementedInPrivateScript] void voidMethodThrowsDOMSyntaxError();
+ [ImplementedInPrivateScript] void voidMethodThrowsError();
+ [ImplementedInPrivateScript] void voidMethodThrowsTypeError();
+ [ImplementedInPrivateScript] void voidMethodThrowsRangeError();
+ [ImplementedInPrivateScript] void voidMethodThrowsSyntaxError();
+ [ImplementedInPrivateScript] void voidMethodThrowsReferenceError();
+ [ImplementedInPrivateScript] void voidMethodWithStackOverflow();
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] short addIntegerForPrivateScriptOnly(short value1, short value2);
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString stringAttributeForPrivateScriptOnly;
+ [ImplementedInPrivateScript] short addIntegerImplementedInCPP(short value1, short value2);
+ [OnlyExposedToPrivateScript] short addIntegerImplementedInCPPForPrivateScriptOnly(short value1, short value2);
+ [ImplementedInPrivateScript] attribute DOMString stringAttributeImplementedInCPP;
+ [OnlyExposedToPrivateScript] attribute DOMString stringAttributeImplementedInCPPForPrivateScriptOnly;
+};
diff --git a/core/testing/RefCountedScriptWrappable.idl b/core/testing/RefCountedScriptWrappable.idl
new file mode 100644
index 0000000..1fc7fe0
--- /dev/null
+++ b/core/testing/RefCountedScriptWrappable.idl
@@ -0,0 +1,8 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+] interface RefCountedScriptWrappable {
+ [NotEnumerable] DOMString toString();
+};
diff --git a/core/testing/TypeConversions.idl b/core/testing/TypeConversions.idl
index 86dc328..ffaa21e 100644
--- a/core/testing/TypeConversions.idl
+++ b/core/testing/TypeConversions.idl
@@ -49,7 +49,7 @@
attribute ByteString testByteString;
[ImplementedAs=testByteString, TreatReturnedNullStringAs=Null] attribute ByteString testByteStringTreatReturnedNullStringAsNullAttribute;
[ImplementedAs=testByteString, TreatReturnedNullStringAs=Undefined] attribute ByteString testByteStringTreatReturnedNullStringAsUndefinedAttribute;
- [ImplementedAs=testByteString, TreatReturnedNullStringAs=Null] ByteString getTestByteStringTreatReturnedNullStringAsNullMethod();
+ [ImplementedAs=testByteString] ByteString? getTestByteStringTreatReturnedNullStringAsNullMethod();
[ImplementedAs=testByteString, TreatReturnedNullStringAs=Undefined] ByteString getTestByteStringTreatReturnedNullStringAsUndefinedMethod();
void setTestByteString(ByteString byteString);
[ImplementedAs=setTestByteString] void setTestByteStringDefaultNull(optional ByteString byteString = null);
@@ -57,7 +57,7 @@
attribute ScalarValueString testScalarValueString;
[ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Null] attribute ScalarValueString testScalarValueStringTreatReturnedNullStringAsNullAttribute;
[ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Undefined] attribute ScalarValueString testScalarValueStringTreatReturnedNullStringAsUndefinedAttribute;
- [ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Null] ScalarValueString getTestScalarValueStringTreatReturnedNullStringAsNullMethod();
+ [ImplementedAs=testScalarValueString] ScalarValueString? getTestScalarValueStringTreatReturnedNullStringAsNullMethod();
[ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Undefined] ScalarValueString getTestScalarValueStringTreatReturnedNullStringAsUndefinedMethod();
void setTestScalarValueString(ScalarValueString scalarValueString);
[ImplementedAs=setTestScalarValueString] void setTestScalarValueStringDefaultNull(optional ScalarValueString scalarValueString = null);
diff --git a/core/workers/AbstractWorker.idl b/core/workers/AbstractWorker.idl
index fc46a14..bfe9347 100644
--- a/core/workers/AbstractWorker.idl
+++ b/core/workers/AbstractWorker.idl
@@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.whatwg.org/specs/web-apps/current-work/#the-abstractworker-abstract-interface
+
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
diff --git a/core/workers/DedicatedWorkerGlobalScope.idl b/core/workers/DedicatedWorkerGlobalScope.idl
index 8c4444d..66bc369 100644
--- a/core/workers/DedicatedWorkerGlobalScope.idl
+++ b/core/workers/DedicatedWorkerGlobalScope.idl
@@ -30,8 +30,8 @@
[
Exposed=DedicatedWorker,
- Global=Worker&DedicatedWorker
+ Global=(Worker,DedicatedWorker)
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
- [Custom, RaisesException] void postMessage(any message, optional MessagePort[] messagePorts);
+ [Custom, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
attribute EventHandler onmessage;
};
diff --git a/core/workers/SharedWorker.idl b/core/workers/SharedWorker.idl
index bd4719c..f839017 100644
--- a/core/workers/SharedWorker.idl
+++ b/core/workers/SharedWorker.idl
@@ -29,6 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.whatwg.org/specs/web-apps/current-work/#shared-workers-and-the-sharedworker-interface
+
[
ActiveDOMObject,
Constructor(DOMString scriptURL, optional DOMString name = null),
diff --git a/core/workers/SharedWorkerGlobalScope.idl b/core/workers/SharedWorkerGlobalScope.idl
index e2a7f55..b6c1f15 100644
--- a/core/workers/SharedWorkerGlobalScope.idl
+++ b/core/workers/SharedWorkerGlobalScope.idl
@@ -30,9 +30,8 @@
[
Exposed=SharedWorker,
- Global=Worker&SharedWorker
+ Global=(Worker,SharedWorker)
] interface SharedWorkerGlobalScope : WorkerGlobalScope {
readonly attribute DOMString name;
attribute EventHandler onconnect;
};
-
diff --git a/core/workers/Worker.idl b/core/workers/Worker.idl
index f494473..a7d148e 100644
--- a/core/workers/Worker.idl
+++ b/core/workers/Worker.idl
@@ -25,6 +25,8 @@
*
*/
+// http://www.whatwg.org/specs/web-apps/current-work/#dedicated-workers-and-the-worker-interface
+
[
ActiveDOMObject,
Constructor(DOMString scriptUrl),
@@ -35,7 +37,7 @@
attribute EventHandler onmessage;
- [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional MessagePort[] messagePorts);
+ [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
void terminate();
};
diff --git a/core/xml/XMLHttpRequest.idl b/core/xml/XMLHttpRequest.idl
index 6eaa71b..6147be4 100644
--- a/core/xml/XMLHttpRequest.idl
+++ b/core/xml/XMLHttpRequest.idl
@@ -33,14 +33,14 @@
"document",
"json",
"text",
- "stream"
+ "legacystream"
};
[
WillBeGarbageCollected,
ActiveDOMObject,
CustomConstructor(optional XMLHttpRequestOptions options),
- Exposed=Window&Worker
+ Exposed=(Window,DedicatedWorker,SharedWorker)
] interface XMLHttpRequest : XMLHttpRequestEventTarget {
// event handler attributes
attribute EventHandler onreadystatechange;
@@ -57,9 +57,9 @@
[RaisesException=Setter] attribute boolean withCredentials;
- [Custom, LogActivity, LogAllWorlds, RaisesException] void open(DOMString method, DOMString url, optional boolean async, optional DOMString user, optional DOMString password);
+ [Custom, RaisesException] void open(DOMString method, DOMString url, optional boolean async, optional DOMString user, optional DOMString password);
- [LogActivity, LogAllWorlds, RaisesException] void setRequestHeader(DOMString header, DOMString value);
+ [RaisesException] void setRequestHeader(DOMString header, DOMString value);
[Custom, RaisesException] void send();
// FIXMEDART: send(ArrayBuffer data) should be eventually deprecated.
@@ -76,8 +76,8 @@
// response
[TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders();
- [TreatReturnedNullStringAs=Null] DOMString getResponseHeader(DOMString header);
- [Custom=Getter, RaisesException=Getter] readonly attribute DOMString responseText; // The custom getter implements TreatReturnedNullStringAs=Null
+ DOMString? getResponseHeader(DOMString header);
+ [Custom=Getter, RaisesException=Getter] readonly attribute DOMString? responseText;
[RaisesException=Getter] readonly attribute Document responseXML;
[RaisesException=Setter] attribute XMLHttpRequestResponseType responseType;
diff --git a/core/xml/XPathNSResolver.idl b/core/xml/XPathNSResolver.idl
index fd16fcc..2985d3a 100644
--- a/core/xml/XPathNSResolver.idl
+++ b/core/xml/XPathNSResolver.idl
@@ -22,6 +22,6 @@
WillBeGarbageCollected,
NoInterfaceObject
] interface XPathNSResolver {
- [TreatReturnedNullStringAs=Null] DOMString lookupNamespaceURI([Default=Undefined] optional DOMString prefix);
+ DOMString? lookupNamespaceURI([Default=Undefined] optional DOMString prefix);
};
diff --git a/modules/README b/modules/README
index 53c5767..1a601a7 100644
--- a/modules/README
+++ b/modules/README
@@ -6,4 +6,4 @@
The current version corresponds to:
URL: http://src.chromium.org/blink/branches/dart/dartium
-Current revision: 181823
+Current revision: 182210
diff --git a/modules/battery/BatteryManager.idl b/modules/battery/BatteryManager.idl
index 01a6ce1..33a059f 100644
--- a/modules/battery/BatteryManager.idl
+++ b/modules/battery/BatteryManager.idl
@@ -6,6 +6,7 @@
[
RuntimeEnabled=BatteryStatus,
TypeChecking=Unrestricted,
+ ActiveDOMObject
] interface BatteryManager : EventTarget {
readonly attribute boolean charging;
readonly attribute unrestricted double chargingTime;
diff --git a/modules/beacon/NavigatorBeacon.idl b/modules/beacon/NavigatorBeacon.idl
index 465c211..7b31421 100644
--- a/modules/beacon/NavigatorBeacon.idl
+++ b/modules/beacon/NavigatorBeacon.idl
@@ -8,8 +8,8 @@
RuntimeEnabled=Beacon,
] partial interface Navigator {
// FIXME: should be union type http://crbug.com/240176
- [CallWith=ExecutionContext, RaisesException] boolean sendBeacon(DOMString url, ArrayBufferView data);
- [CallWith=ExecutionContext, RaisesException] boolean sendBeacon(DOMString url, Blob data);
- [CallWith=ExecutionContext, RaisesException] boolean sendBeacon(DOMString url, FormData data);
- [CallWith=ExecutionContext, RaisesException] boolean sendBeacon(DOMString url, [Default=Undefined] optional DOMString data);
+ [CallWith=ExecutionContext, MeasureAs=SendBeacon, RaisesException] boolean sendBeacon(DOMString url, ArrayBufferView data);
+ [CallWith=ExecutionContext, MeasureAs=SendBeacon, RaisesException] boolean sendBeacon(DOMString url, Blob data);
+ [CallWith=ExecutionContext, MeasureAs=SendBeacon, RaisesException] boolean sendBeacon(DOMString url, FormData data);
+ [CallWith=ExecutionContext, MeasureAs=SendBeacon, RaisesException] boolean sendBeacon(DOMString url, [Default=Undefined] optional DOMString data);
};
diff --git a/modules/credentialmanager/Credential.idl b/modules/credentialmanager/Credential.idl
new file mode 100644
index 0000000..76eab5b
--- /dev/null
+++ b/modules/credentialmanager/Credential.idl
@@ -0,0 +1,12 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=CredentialManager,
+ GarbageCollected
+] interface Credential {
+ readonly attribute DOMString id;
+ readonly attribute DOMString name;
+ readonly attribute DOMString avatarURL;
+};
diff --git a/modules/credentialmanager/CredentialsContainer.idl b/modules/credentialmanager/CredentialsContainer.idl
new file mode 100644
index 0000000..64ecde0
--- /dev/null
+++ b/modules/credentialmanager/CredentialsContainer.idl
@@ -0,0 +1,13 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=CredentialManager,
+ GarbageCollected
+] interface CredentialsContainer {
+ [CallWith=ScriptState] Promise request(optional Dictionary options);
+ [CallWith=ScriptState] Promise notifySignedIn(optional Credential credential);
+ [CallWith=ScriptState] Promise notifyFailedSignIn(optional Credential credential);
+ [CallWith=ScriptState] Promise notifySignedOut();
+};
diff --git a/modules/credentialmanager/FederatedCredential.idl b/modules/credentialmanager/FederatedCredential.idl
new file mode 100644
index 0000000..b596da2
--- /dev/null
+++ b/modules/credentialmanager/FederatedCredential.idl
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=CredentialManager,
+ RaisesException=Constructor,
+ Constructor(DOMString id, DOMString name, DOMString avatarURL, DOMString federation)
+] interface FederatedCredential : Credential {
+ readonly attribute DOMString federation;
+};
diff --git a/modules/credentialmanager/LocalCredential.idl b/modules/credentialmanager/LocalCredential.idl
new file mode 100644
index 0000000..62c4aa6
--- /dev/null
+++ b/modules/credentialmanager/LocalCredential.idl
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=CredentialManager,
+ RaisesException=Constructor,
+ Constructor(DOMString id, DOMString name, DOMString avatarURL, DOMString password)
+] interface LocalCredential : Credential {
+ readonly attribute DOMString password;
+};
diff --git a/modules/credentialmanager/NavigatorCredentials.idl b/modules/credentialmanager/NavigatorCredentials.idl
new file mode 100644
index 0000000..35b163b
--- /dev/null
+++ b/modules/credentialmanager/NavigatorCredentials.idl
@@ -0,0 +1,9 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=CredentialManager,
+] partial interface Navigator {
+ readonly attribute CredentialsContainer credentials;
+};
diff --git a/modules/crypto/AesKeyAlgorithm.idl b/modules/crypto/AesKeyAlgorithm.idl
deleted file mode 100644
index 171650d..0000000
--- a/modules/crypto/AesKeyAlgorithm.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject
-] interface AesKeyAlgorithm : KeyAlgorithm {
- readonly attribute unsigned short length;
-};
diff --git a/modules/crypto/Key.idl b/modules/crypto/CryptoKey.idl
similarity index 95%
rename from modules/crypto/Key.idl
rename to modules/crypto/CryptoKey.idl
index 9bc0305..0ad4ab6 100644
--- a/modules/crypto/Key.idl
+++ b/modules/crypto/CryptoKey.idl
@@ -31,9 +31,9 @@
[
GarbageCollected,
NoInterfaceObject
-] interface Key {
+] interface CryptoKey {
readonly attribute DOMString type;
readonly attribute boolean extractable;
- readonly attribute KeyAlgorithm algorithm;
+ [Custom] readonly attribute object algorithm;
readonly attribute DOMString[] usages;
};
diff --git a/modules/crypto/HmacKeyAlgorithm.idl b/modules/crypto/HmacKeyAlgorithm.idl
deleted file mode 100644
index 89cc843..0000000
--- a/modules/crypto/HmacKeyAlgorithm.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject
-] interface HmacKeyAlgorithm : KeyAlgorithm {
- readonly attribute KeyAlgorithm hash;
- readonly attribute unsigned long length;
-};
diff --git a/modules/crypto/KeyAlgorithm.idl b/modules/crypto/KeyAlgorithm.idl
deleted file mode 100644
index d9e0ea0..0000000
--- a/modules/crypto/KeyAlgorithm.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject,
- SpecialWrapFor=AesKeyAlgorithm|HmacKeyAlgorithm|RsaHashedKeyAlgorithm
-] interface KeyAlgorithm {
- readonly attribute DOMString name;
-};
diff --git a/modules/crypto/RsaHashedKeyAlgorithm.idl b/modules/crypto/RsaHashedKeyAlgorithm.idl
deleted file mode 100644
index 28b765d..0000000
--- a/modules/crypto/RsaHashedKeyAlgorithm.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject
-] interface RsaHashedKeyAlgorithm : RsaKeyAlgorithm {
- readonly attribute KeyAlgorithm hash;
-};
diff --git a/modules/crypto/RsaKeyAlgorithm.idl b/modules/crypto/RsaKeyAlgorithm.idl
deleted file mode 100644
index 8cf43ed..0000000
--- a/modules/crypto/RsaKeyAlgorithm.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject
-] interface RsaKeyAlgorithm : KeyAlgorithm {
- readonly attribute unsigned long modulusLength;
- readonly attribute Uint8Array publicExponent;
-};
diff --git a/modules/crypto/SubtleCrypto.idl b/modules/crypto/SubtleCrypto.idl
index da23af3..e76cac4 100644
--- a/modules/crypto/SubtleCrypto.idl
+++ b/modules/crypto/SubtleCrypto.idl
@@ -31,7 +31,7 @@
// http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface
typedef DOMString KeyFormat;
-typedef DOMString KeyUsage; // from Key interface
+typedef DOMString KeyUsage; // from CryptoKey interface
// FIXME: use below; needs support for union types http://crbug.com/240176
typedef (ArrayBuffer or ArrayBufferView) CryptoOperationData;
@@ -40,17 +40,17 @@
GarbageCollected,
NoInterfaceObject,
] interface SubtleCrypto {
- [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, Key key, ArrayBuffer data);
- [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, Key key, ArrayBufferView data);
+ [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, CryptoKey key, ArrayBuffer data);
+ [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, CryptoKey key, ArrayBufferView data);
- [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, Key key, ArrayBuffer data);
- [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, Key key, ArrayBufferView data);
+ [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, CryptoKey key, ArrayBuffer data);
+ [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, CryptoKey key, ArrayBufferView data);
- [CallWith=ScriptState] Promise sign(Dictionary algorithm, Key key, ArrayBuffer data);
- [CallWith=ScriptState] Promise sign(Dictionary algorithm, Key key, ArrayBufferView data);
+ [CallWith=ScriptState] Promise sign(Dictionary algorithm, CryptoKey key, ArrayBuffer data);
+ [CallWith=ScriptState] Promise sign(Dictionary algorithm, CryptoKey key, ArrayBufferView data);
- // FIXME: should be: Promise verify(Dictionary algorithm, Key key, CryptoOperationData signature, CryptoOperationData data);
- [CallWith=ScriptState, Custom, ImplementedAs=verifySignature] Promise verify(Dictionary algorithm, Key key, object signature, object data);
+ // FIXME: should be: Promise verify(Dictionary algorithm, CryptoKey key, CryptoOperationData signature, CryptoOperationData data);
+ [CallWith=ScriptState, Custom, ImplementedAs=verifySignature] Promise verify(Dictionary algorithm, CryptoKey key, object signature, object data);
[CallWith=ScriptState] Promise digest(Dictionary algorithm, ArrayBuffer data);
[CallWith=ScriptState] Promise digest(Dictionary algorithm, ArrayBufferView data);
@@ -61,10 +61,10 @@
[CallWith=ScriptState] Promise importKey(KeyFormat format, ArrayBufferView keyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages);
[CallWith=ScriptState] Promise importKey(KeyFormat format, Dictionary keyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages);
- [CallWith=ScriptState] Promise exportKey(KeyFormat format, Key key);
+ [CallWith=ScriptState] Promise exportKey(KeyFormat format, CryptoKey key);
- [CallWith=ScriptState] Promise wrapKey(KeyFormat format, Key key, Key wrappingKey, Dictionary wrapAlgorithm);
+ [CallWith=ScriptState] Promise wrapKey(KeyFormat format, CryptoKey key, CryptoKey wrappingKey, Dictionary wrapAlgorithm);
- [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBuffer wrappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlgorithm, boolean extractable, KeyUsage[] keyUsages);
- [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBufferView wrappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlgorithm, boolean extractable, KeyUsage[] keyUsages);
+ [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBuffer wrappedKey, CryptoKey unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlgorithm, boolean extractable, KeyUsage[] keyUsages);
+ [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBufferView wrappedKey, CryptoKey unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlgorithm, boolean extractable, KeyUsage[] keyUsages);
};
diff --git a/modules/donottrack/NavigatorDoNotTrack.idl b/modules/donottrack/NavigatorDoNotTrack.idl
index 1ecea7f..1f1b615 100644
--- a/modules/donottrack/NavigatorDoNotTrack.idl
+++ b/modules/donottrack/NavigatorDoNotTrack.idl
@@ -29,5 +29,5 @@
*/
partial interface Navigator {
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString doNotTrack;
+ readonly attribute DOMString? doNotTrack;
};
diff --git a/modules/encoding/TextDecoder.idl b/modules/encoding/TextDecoder.idl
index f71c7b8..af0ffac 100644
--- a/modules/encoding/TextDecoder.idl
+++ b/modules/encoding/TextDecoder.idl
@@ -30,8 +30,8 @@
[
RuntimeEnabled=EncodingAPI,
- Exposed=Window&Worker,
- Constructor(optional DOMString label = null, optional Dictionary options),
+ Exposed=(Window,Worker),
+ Constructor(optional DOMString label = "utf-8", optional Dictionary options),
RaisesException=Constructor,
GarbageCollected,
MeasureAs=TextDecoderConstructor
diff --git a/modules/encoding/TextEncoder.idl b/modules/encoding/TextEncoder.idl
index dc86fef..7e284d5 100644
--- a/modules/encoding/TextEncoder.idl
+++ b/modules/encoding/TextEncoder.idl
@@ -30,12 +30,12 @@
[
RuntimeEnabled=EncodingAPI,
- Exposed=Window&Worker,
- Constructor(optional DOMString utfLabel = null),
+ Exposed=(Window,Worker),
+ Constructor(optional DOMString utfLabel = "utf-8"),
RaisesException=Constructor,
GarbageCollected,
MeasureAs=TextEncoderConstructor
] interface TextEncoder {
readonly attribute DOMString encoding;
- [MeasureAs=TextEncoderEncode] Uint8Array encode(optional ScalarValueString input = null, optional Dictionary options);
+ [MeasureAs=TextEncoderEncode] Uint8Array encode(optional ScalarValueString input = "");
};
diff --git a/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl b/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
index 52cd222..ed94199 100644
--- a/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
+++ b/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
@@ -3,9 +3,9 @@
// found in the LICENSE file.
partial interface HTMLMediaElement {
- [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, MeasureAs=PrefixedMediaGenerateKeyRequest] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
- [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, MeasureAs=PrefixedMediaAddKey] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, optional DOMString sessionId = null);
- [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, MeasureAs=PrefixedMediaCancelKeyRequest] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional DOMString sessionId = null);
+ [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, MeasureAs=PrefixedMediaGenerateKeyRequest] void webkitGenerateKeyRequest([TreatUndefinedAs=NullString] DOMString? keySystem, optional Uint8Array initData);
+ [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, MeasureAs=PrefixedMediaAddKey] void webkitAddKey([TreatUndefinedAs=NullString] DOMString? keySystem, Uint8Array key, optional Uint8Array initData, optional DOMString sessionId = null);
+ [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, MeasureAs=PrefixedMediaCancelKeyRequest] void webkitCancelKeyRequest([TreatUndefinedAs=NullString] DOMString? keySystem, optional DOMString sessionId = null);
[RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyadded;
[RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyerror;
@@ -13,6 +13,6 @@
[RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitneedkey;
[RuntimeEnabled=EncryptedMedia] readonly attribute MediaKeys mediaKeys;
- [RuntimeEnabled=EncryptedMedia, RaisesException, TypeChecking=Interface|Nullable] void setMediaKeys(MediaKeys? mediaKeys);
+ [RuntimeEnabled=EncryptedMedia, RaisesException, TypeChecking=Interface] void setMediaKeys(MediaKeys? mediaKeys);
[RuntimeEnabled=EncryptedMedia] attribute EventHandler onneedkey;
};
diff --git a/modules/encryptedmedia/MediaKeyMessageEvent.idl b/modules/encryptedmedia/MediaKeyMessageEvent.idl
index 67bc8f4..6cda051 100644
--- a/modules/encryptedmedia/MediaKeyMessageEvent.idl
+++ b/modules/encryptedmedia/MediaKeyMessageEvent.idl
@@ -27,7 +27,7 @@
EventConstructor,
RuntimeEnabled=EncryptedMedia
] interface MediaKeyMessageEvent : Event {
- readonly attribute Uint8Array message;
+ readonly attribute ArrayBuffer message;
[InitializedByEventConstructor] readonly attribute DOMString destinationURL;
};
diff --git a/modules/encryptedmedia/MediaKeySession.idl b/modules/encryptedmedia/MediaKeySession.idl
index a5cf333..9126d3b 100644
--- a/modules/encryptedmedia/MediaKeySession.idl
+++ b/modules/encryptedmedia/MediaKeySession.idl
@@ -27,7 +27,7 @@
ActiveDOMObject,
RuntimeEnabled=EncryptedMedia,
GarbageCollected,
- TypeChecking=Interface|Nullable
+ TypeChecking=Interface
] interface MediaKeySession : EventTarget {
// error state
readonly attribute MediaKeyError error;
@@ -35,8 +35,10 @@
// session properties
readonly attribute DOMString keySystem;
readonly attribute DOMString sessionId;
+ [CallWith=ScriptState] readonly attribute Promise closed;
// session operations
- [RaisesException] void update(Uint8Array response);
- [RaisesException] void release();
+ [CallWith=ScriptState] Promise update(ArrayBuffer response);
+ [CallWith=ScriptState] Promise update(ArrayBufferView response);
+ [CallWith=ScriptState] Promise release();
};
diff --git a/modules/encryptedmedia/MediaKeys.idl b/modules/encryptedmedia/MediaKeys.idl
index a17d8d9..05dded4 100644
--- a/modules/encryptedmedia/MediaKeys.idl
+++ b/modules/encryptedmedia/MediaKeys.idl
@@ -23,17 +23,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+enum SessionType {
+ "temporary",
+ "persistent"
+};
+
[
RuntimeEnabled=EncryptedMedia,
- Constructor(DOMString keySystem),
- ConstructorCallWith=ExecutionContext,
- RaisesException=Constructor,
GarbageCollected,
- TypeChecking=Interface|Nullable
+ TypeChecking=Interface
] interface MediaKeys {
readonly attribute DOMString keySystem;
- [CallWith=ExecutionContext, RaisesException] MediaKeySession createSession(DOMString type, Uint8Array initData);
+ [CallWith=ScriptState] static Promise create(DOMString keySystem);
+ [CallWith=ScriptState] Promise createSession(DOMString initDataType, ArrayBuffer initData, optional SessionType sessionType = "temporary");
+ [CallWith=ScriptState] Promise createSession(DOMString initDataType, ArrayBufferView initData, optional SessionType sessionType = "temporary");
static boolean isTypeSupported(DOMString keySystem, optional DOMString contentType = null);
};
diff --git a/modules/filesystem/DirectoryEntry.idl b/modules/filesystem/DirectoryEntry.idl
index 3e51b11..2a0bc6c 100644
--- a/modules/filesystem/DirectoryEntry.idl
+++ b/modules/filesystem/DirectoryEntry.idl
@@ -32,7 +32,7 @@
NoInterfaceObject
] interface DirectoryEntry : Entry {
DirectoryReader createReader();
- void getFile([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, optional Dictionary options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
- void getDirectory([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, optional Dictionary options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ void getFile([TreatUndefinedAs=NullString] DOMString? path, optional Dictionary options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ void getDirectory([TreatUndefinedAs=NullString] DOMString? path, optional Dictionary options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
void removeRecursively(VoidCallback successCallback, optional ErrorCallback errorCallback);
};
diff --git a/modules/filesystem/DirectoryEntrySync.idl b/modules/filesystem/DirectoryEntrySync.idl
index b1c93b9..871c306 100644
--- a/modules/filesystem/DirectoryEntrySync.idl
+++ b/modules/filesystem/DirectoryEntrySync.idl
@@ -32,7 +32,7 @@
NoInterfaceObject
] interface DirectoryEntrySync : EntrySync {
DirectoryReaderSync createReader();
- [RaisesException] FileEntrySync getFile([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, Dictionary flags);
- [RaisesException] DirectoryEntrySync getDirectory([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, Dictionary flags);
+ [RaisesException] FileEntrySync getFile([TreatUndefinedAs=NullString] DOMString? path, Dictionary flags);
+ [RaisesException] DirectoryEntrySync getDirectory([TreatUndefinedAs=NullString] DOMString? path, Dictionary flags);
[RaisesException] void removeRecursively();
};
diff --git a/modules/filesystem/Entry.idl b/modules/filesystem/Entry.idl
index 5c3fed4..86d338a 100644
--- a/modules/filesystem/Entry.idl
+++ b/modules/filesystem/Entry.idl
@@ -40,8 +40,8 @@
readonly attribute DOMFileSystem filesystem;
void getMetadata(MetadataCallback successCallback, optional ErrorCallback errorCallback);
- void moveTo(DirectoryEntry parent, [TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
- void copyTo(DirectoryEntry parent, [TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ void moveTo(DirectoryEntry parent, [TreatUndefinedAs=NullString] optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ void copyTo(DirectoryEntry parent, [TreatUndefinedAs=NullString] optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
DOMString toURL();
void remove(VoidCallback successCallback, optional ErrorCallback errorCallback);
void getParent(optional EntryCallback successCallback, optional ErrorCallback errorCallback);
diff --git a/modules/filesystem/EntrySync.idl b/modules/filesystem/EntrySync.idl
index b8f6b72..d953977 100644
--- a/modules/filesystem/EntrySync.idl
+++ b/modules/filesystem/EntrySync.idl
@@ -40,8 +40,8 @@
readonly attribute DOMFileSystemSync filesystem;
[RaisesException] Metadata getMetadata();
- [RaisesException] EntrySync moveTo(DirectoryEntrySync parent, [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString name);
- [RaisesException] EntrySync copyTo(DirectoryEntrySync parent, [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString name);
+ [RaisesException] EntrySync moveTo(DirectoryEntrySync parent, [TreatUndefinedAs=NullString] DOMString? name);
+ [RaisesException] EntrySync copyTo(DirectoryEntrySync parent, [TreatUndefinedAs=NullString] DOMString? name);
DOMString toURL();
[RaisesException] void remove();
DirectoryEntrySync getParent();
diff --git a/modules/filesystem/WindowFileSystem.idl b/modules/filesystem/WindowFileSystem.idl
index b35cc8a..4d98026 100644
--- a/modules/filesystem/WindowFileSystem.idl
+++ b/modules/filesystem/WindowFileSystem.idl
@@ -30,7 +30,7 @@
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
- [RuntimeEnabled=FileSystem] void webkitRequestFileSystem(unsigned short type, long long size,
+ [RuntimeEnabled=FileSystem, MeasureAs=RequestFileSystem] void webkitRequestFileSystem(unsigned short type, long long size,
FileSystemCallback successCallback, optional ErrorCallback errorCallback);
[RuntimeEnabled=FileSystem] void webkitResolveLocalFileSystemURL(DOMString url,
EntryCallback successCallback, optional ErrorCallback errorCallback);
diff --git a/modules/filesystem/WorkerGlobalScopeFileSystem.idl b/modules/filesystem/WorkerGlobalScopeFileSystem.idl
index 1e13f7f..f01817a 100644
--- a/modules/filesystem/WorkerGlobalScopeFileSystem.idl
+++ b/modules/filesystem/WorkerGlobalScopeFileSystem.idl
@@ -28,8 +28,8 @@
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
- [RuntimeEnabled=FileSystem] void webkitRequestFileSystem(unsigned short type, long long size, optional FileSystemCallback successCallback, optional ErrorCallback errorCallback);
- [RuntimeEnabled=FileSystem, RaisesException] DOMFileSystemSync webkitRequestFileSystemSync(unsigned short type, long long size);
+ [RuntimeEnabled=FileSystem, MeasureAs=RequestFileSystemWorker] void webkitRequestFileSystem(unsigned short type, long long size, optional FileSystemCallback successCallback, optional ErrorCallback errorCallback);
+ [RuntimeEnabled=FileSystem, RaisesException, MeasureAs=RequestFileSystemSyncWorker] DOMFileSystemSync webkitRequestFileSystemSync(unsigned short type, long long size);
[RuntimeEnabled=FileSystem] void webkitResolveLocalFileSystemURL(DOMString url, EntryCallback successCallback, optional ErrorCallback errorCallback);
[RuntimeEnabled=FileSystem, RaisesException] EntrySync webkitResolveLocalFileSystemSyncURL(DOMString url);
diff --git a/modules/geofencing/CircularRegion.idl b/modules/geofencing/CircularRegion.idl
new file mode 100644
index 0000000..19278fd
--- /dev/null
+++ b/modules/geofencing/CircularRegion.idl
@@ -0,0 +1,17 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=Geofencing,
+ Exposed=(Window,Worker),
+ GarbageCollected,
+ Constructor(Dictionary init)
+] interface CircularRegion : GeofencingRegion {
+ const double MIN_RADIUS = 1.0;
+ const double MAX_RADIUS = 100.0;
+
+ readonly attribute double latitude;
+ readonly attribute double longitude;
+ readonly attribute double radius;
+};
diff --git a/modules/geofencing/Geofencing.idl b/modules/geofencing/Geofencing.idl
new file mode 100644
index 0000000..7b36e70
--- /dev/null
+++ b/modules/geofencing/Geofencing.idl
@@ -0,0 +1,13 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ NoInterfaceObject,
+ RuntimeEnabled=Geofencing,
+ GarbageCollected,
+] interface Geofencing {
+ [CallWith=ScriptState] Promise registerRegion(GeofencingRegion region);
+ [CallWith=ScriptState] Promise unregisterRegion(DOMString regionId);
+ [CallWith=ScriptState] Promise getRegisteredRegions();
+};
diff --git a/modules/geofencing/GeofencingRegion.idl b/modules/geofencing/GeofencingRegion.idl
new file mode 100644
index 0000000..4e22058
--- /dev/null
+++ b/modules/geofencing/GeofencingRegion.idl
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=Geofencing,
+ NoInterfaceObject,
+ GarbageCollected,
+] interface GeofencingRegion {
+ readonly attribute DOMString id;
+};
diff --git a/modules/geofencing/NavigatorGeofencing.idl b/modules/geofencing/NavigatorGeofencing.idl
new file mode 100644
index 0000000..2591b0f
--- /dev/null
+++ b/modules/geofencing/NavigatorGeofencing.idl
@@ -0,0 +1,9 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=Geofencing,
+] partial interface Navigator {
+ readonly attribute Geofencing geofencing;
+};
diff --git a/modules/geolocation/Geolocation.idl b/modules/geolocation/Geolocation.idl
index ca1b5a5..2c9c1f8 100644
--- a/modules/geolocation/Geolocation.idl
+++ b/modules/geolocation/Geolocation.idl
@@ -29,15 +29,14 @@
NoInterfaceObject,
] interface Geolocation {
// FIXME: should be: PositionOptions options: need PositionOptions.idl and dictionary http:/crbug.com/321462
- [Custom, LogActivity] void getCurrentPosition(PositionCallback successCallback,
+ [LogActivity] void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
- optional object options);
+ optional Dictionary options);
// FIXME: should be: PositionOptions options: need PositionOptions.idl and dictionary http:/crbug.com/321462
- [Custom, LogActivity] long watchPosition(PositionCallback successCallback,
+ [LogActivity] long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
- optional object options);
+ optional Dictionary options);
void clearWatch(long watchID);
};
-
diff --git a/modules/indexeddb/IDBCursor.idl b/modules/indexeddb/IDBCursor.idl
index 727f529..b96920b 100644
--- a/modules/indexeddb/IDBCursor.idl
+++ b/modules/indexeddb/IDBCursor.idl
@@ -23,11 +23,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor
+
+enum IDBCursorDirection {
+ "next",
+ "nextunique",
+ "prev",
+ "prevunique"
+};
+
[
GarbageCollected
] interface IDBCursor {
- readonly attribute DOMString direction;
+ readonly attribute IDBCursorDirection direction;
[CallWith=ScriptState, CachedAttribute=isKeyDirty] readonly attribute any key;
[CallWith=ScriptState, CachedAttribute=isPrimaryKeyDirty] readonly attribute any primaryKey;
[CallWith=ScriptState] readonly attribute any source;
diff --git a/modules/indexeddb/IDBDatabase.idl b/modules/indexeddb/IDBDatabase.idl
index 41e8ff0..bb9c038 100644
--- a/modules/indexeddb/IDBDatabase.idl
+++ b/modules/indexeddb/IDBDatabase.idl
@@ -26,6 +26,13 @@
// https://dvcs.w3.org/hg/IndexedDB/raw-file/default/Overview.html#idl-def-IDBDatabase
+// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+enum IDBTransactionMode {
+ "readonly",
+ "readwrite",
+ "versionchange"
+};
+
[
ActiveDOMObject,
GarbageCollected,
@@ -36,9 +43,9 @@
[RaisesException] IDBObjectStore createObjectStore(DOMString name, optional Dictionary options);
[RaisesException] void deleteObjectStore(DOMString name);
// FIXME: should be union type http://crbug.com/240176
- [CallWith=ExecutionContext, RaisesException] IDBTransaction transaction(DOMString storeName, optional DOMString mode = null);
- [CallWith=ExecutionContext, RaisesException] IDBTransaction transaction(sequence<DOMString> storeNames, optional DOMString mode = null);
- [CallWith=ExecutionContext, RaisesException] IDBTransaction transaction(DOMStringList storeNames, optional DOMString mode = null);
+ [CallWith=ExecutionContext, RaisesException] IDBTransaction transaction(DOMString storeName, optional IDBTransactionMode mode = "readonly");
+ [CallWith=ExecutionContext, RaisesException] IDBTransaction transaction(sequence<DOMString> storeNames, optional IDBTransactionMode mode = "readonly");
+ [CallWith=ExecutionContext, RaisesException] IDBTransaction transaction(DOMStringList storeNames, optional IDBTransactionMode mode = "readonly");
void close();
attribute EventHandler onabort;
attribute EventHandler onclose;
diff --git a/modules/indexeddb/IDBIndex.idl b/modules/indexeddb/IDBIndex.idl
index 5087716..c6d6826 100644
--- a/modules/indexeddb/IDBIndex.idl
+++ b/modules/indexeddb/IDBIndex.idl
@@ -23,6 +23,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBIndex
+
+// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+enum IDBCursorDirection {
+ "next",
+ "nextunique",
+ "prev",
+ "prevunique"
+};
+
[
GarbageCollected
] interface IDBIndex {
@@ -32,8 +42,8 @@
readonly attribute boolean unique;
readonly attribute boolean multiEntry;
- [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional DOMString direction = null);
- [CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional DOMString direction = null);
+ [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
+ [CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
[CallWith=ScriptState, RaisesException] IDBRequest get(any key);
[CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
diff --git a/modules/indexeddb/IDBKeyRange.idl b/modules/indexeddb/IDBKeyRange.idl
index 9b0b06b..93654fc 100644
--- a/modules/indexeddb/IDBKeyRange.idl
+++ b/modules/indexeddb/IDBKeyRange.idl
@@ -33,7 +33,7 @@
// FIXMEDART: Define new names for these (see b/4436830).
[CallWith=ExecutionContext, RaisesException, DartName=only_] static IDBKeyRange only(any value);
- [CallWith=ExecutionContext, RaisesException, DartName=lowerBound_] static IDBKeyRange lowerBound(any bound, [Default=Undefined] optional boolean open);
- [CallWith=ExecutionContext, RaisesException, DartName=upperBound_] static IDBKeyRange upperBound(any bound, [Default=Undefined] optional boolean open);
- [CallWith=ExecutionContext, RaisesException, DartName=bound_] static IDBKeyRange bound(any lower, any upper, [Default=Undefined] optional boolean lowerOpen, [Default=Undefined] optional boolean upperOpen);
+ [CallWith=ExecutionContext, RaisesException, DartName=lowerBound_] static IDBKeyRange lowerBound(any bound, optional boolean open = false);
+ [CallWith=ExecutionContext, RaisesException, DartName=upperBound_] static IDBKeyRange upperBound(any bound, optional boolean open = false);
+ [CallWith=ExecutionContext, RaisesException, DartName=bound_] static IDBKeyRange bound(any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
};
diff --git a/modules/indexeddb/IDBObjectStore.idl b/modules/indexeddb/IDBObjectStore.idl
index 14bd1da..a22fc74 100644
--- a/modules/indexeddb/IDBObjectStore.idl
+++ b/modules/indexeddb/IDBObjectStore.idl
@@ -25,10 +25,18 @@
// https://dvcs.w3.org/hg/IndexedDB/raw-file/default/Overview.html#idl-def-IDBObjectStore
+// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+enum IDBCursorDirection {
+ "next",
+ "nextunique",
+ "prev",
+ "prevunique"
+};
+
[
GarbageCollected,
] interface IDBObjectStore {
- [TreatReturnedNullStringAs=Null] readonly attribute DOMString name;
+ readonly attribute DOMString? name;
[CallWith=ScriptState] readonly attribute any keyPath;
readonly attribute DOMStringList indexNames;
readonly attribute IDBTransaction transaction;
@@ -39,8 +47,8 @@
[CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete(any key);
[CallWith=ScriptState, RaisesException] IDBRequest get(any key);
[CallWith=ScriptState, RaisesException] IDBRequest clear();
- [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional DOMString direction = null);
- [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional DOMString direction = null);
+ [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional DOMString direction = "next");
+ [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
// FIXME: should be union type http://crbug.com/240176
[CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, DOMString keyPath, optional Dictionary options);
[CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, sequence<DOMString> keyPath, optional Dictionary options);
diff --git a/modules/indexeddb/IDBRequest.idl b/modules/indexeddb/IDBRequest.idl
index a52b55b..1241cb7 100644
--- a/modules/indexeddb/IDBRequest.idl
+++ b/modules/indexeddb/IDBRequest.idl
@@ -27,6 +27,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+enum IDBRequestReadyState {
+ "pending",
+ "done"
+};
+
[
ActiveDOMObject,
GarbageCollected,
@@ -38,7 +43,7 @@
readonly attribute IDBTransaction transaction;
// States
- readonly attribute DOMString readyState;
+ readonly attribute IDBRequestReadyState readyState;
// Events
attribute EventHandler onsuccess;
diff --git a/modules/indexeddb/IDBTransaction.idl b/modules/indexeddb/IDBTransaction.idl
index f68c86e..8c86f14 100644
--- a/modules/indexeddb/IDBTransaction.idl
+++ b/modules/indexeddb/IDBTransaction.idl
@@ -24,13 +24,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+enum IDBTransactionMode {
+ "readonly",
+ "readwrite",
+ "versionchange"
+};
+
[
ActiveDOMObject,
GarbageCollected
] interface IDBTransaction : EventTarget {
// Properties
- readonly attribute DOMString mode;
+ readonly attribute IDBTransactionMode mode;
readonly attribute IDBDatabase db;
readonly attribute DOMError error;
diff --git a/modules/indexeddb/IDBVersionChangeEvent.idl b/modules/indexeddb/IDBVersionChangeEvent.idl
index 3ee0c58..2f73603 100644
--- a/modules/indexeddb/IDBVersionChangeEvent.idl
+++ b/modules/indexeddb/IDBVersionChangeEvent.idl
@@ -23,6 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEvent
+
+// FIXME: This enum is non-standard, see
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
+enum IDBDataLossAmount {
+ "none",
+ "total"
+};
[
EventConstructor
] interface IDBVersionChangeEvent : Event {
@@ -31,6 +39,6 @@
// FIXME: These are non-standard, see
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
- readonly attribute DOMString dataLoss;
+ [InitializedByEventConstructor] readonly attribute IDBDataLossAmount dataLoss;
readonly attribute DOMString dataLossMessage;
};
diff --git a/modules/indexeddb/WindowIndexedDatabase.idl b/modules/indexeddb/WindowIndexedDatabase.idl
index 5b80cb8..eb08dd1 100644
--- a/modules/indexeddb/WindowIndexedDatabase.idl
+++ b/modules/indexeddb/WindowIndexedDatabase.idl
@@ -27,16 +27,16 @@
[
ImplementedAs=DOMWindowIndexedDatabase,
] partial interface Window {
- [ImplementedAs=indexedDB, MeasureAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
+ [ImplementedAs=indexedDB, DeprecateAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
[MeasureAs=UnprefixedIndexedDB] readonly attribute IDBFactory indexedDB;
- [MeasureAs=PrefixedIDBCursorConstructor] attribute IDBCursorConstructor webkitIDBCursor;
- [MeasureAs=PrefixedIDBDatabaseConstructor] attribute IDBDatabaseConstructor webkitIDBDatabase;
- [MeasureAs=PrefixedIDBFactoryConstructor] attribute IDBFactoryConstructor webkitIDBFactory;
- [MeasureAs=PrefixedIDBIndexConstructor] attribute IDBIndexConstructor webkitIDBIndex;
- [MeasureAs=PrefixedIDBKeyRangeConstructor] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
- [MeasureAs=PrefixedIDBObjectStoreConstructor] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
- [MeasureAs=PrefixedIDBRequestConstructor] attribute IDBRequestConstructor webkitIDBRequest;
- [MeasureAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
+ [DeprecateAs=PrefixedIDBCursorConstructor] attribute IDBCursorConstructor webkitIDBCursor;
+ [DeprecateAs=PrefixedIDBDatabaseConstructor] attribute IDBDatabaseConstructor webkitIDBDatabase;
+ [DeprecateAs=PrefixedIDBFactoryConstructor] attribute IDBFactoryConstructor webkitIDBFactory;
+ [DeprecateAs=PrefixedIDBIndexConstructor] attribute IDBIndexConstructor webkitIDBIndex;
+ [DeprecateAs=PrefixedIDBKeyRangeConstructor] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
+ [DeprecateAs=PrefixedIDBObjectStoreConstructor] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
+ [DeprecateAs=PrefixedIDBRequestConstructor] attribute IDBRequestConstructor webkitIDBRequest;
+ [DeprecateAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
};
diff --git a/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl b/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
index 8ca9e62..a9540b6 100644
--- a/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
+++ b/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
@@ -25,16 +25,16 @@
*/
partial interface WorkerGlobalScope {
- [ImplementedAs=indexedDB] readonly attribute IDBFactory webkitIndexedDB;
+ [ImplementedAs=indexedDB, DeprecateAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
- attribute IDBCursorConstructor webkitIDBCursor;
- attribute IDBDatabaseConstructor webkitIDBDatabase;
- attribute IDBFactoryConstructor webkitIDBFactory;
- attribute IDBIndexConstructor webkitIDBIndex;
- attribute IDBKeyRangeConstructor webkitIDBKeyRange;
- attribute IDBObjectStoreConstructor webkitIDBObjectStore;
- attribute IDBRequestConstructor webkitIDBRequest;
- attribute IDBTransactionConstructor webkitIDBTransaction;
+ [DeprecateAs=PrefixedIDBCursorConstructor] attribute IDBCursorConstructor webkitIDBCursor;
+ [DeprecateAs=PrefixedIDBDatabaseConstructor] attribute IDBDatabaseConstructor webkitIDBDatabase;
+ [DeprecateAs=PrefixedIDBFactoryConstructor] attribute IDBFactoryConstructor webkitIDBFactory;
+ [DeprecateAs=PrefixedIDBIndexConstructor] attribute IDBIndexConstructor webkitIDBIndex;
+ [DeprecateAs=PrefixedIDBKeyRangeConstructor] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
+ [DeprecateAs=PrefixedIDBObjectStoreConstructor] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
+ [DeprecateAs=PrefixedIDBRequestConstructor] attribute IDBRequestConstructor webkitIDBRequest;
+ [DeprecateAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
readonly attribute IDBFactory indexedDB;
diff --git a/modules/mediasource/MediaSource.idl b/modules/mediasource/MediaSource.idl
index a03cde5..0a946ba 100644
--- a/modules/mediasource/MediaSource.idl
+++ b/modules/mediasource/MediaSource.idl
@@ -40,7 +40,7 @@
Constructor,
ConstructorCallWith=ExecutionContext,
RuntimeEnabled=MediaSource,
- TypeChecking=Interface|Nullable|Unrestricted,
+ TypeChecking=Interface|Unrestricted,
] interface MediaSource : EventTarget {
// All the source buffers created by this object.
readonly attribute SourceBufferList sourceBuffers;
diff --git a/modules/mediasource/SourceBuffer.idl b/modules/mediasource/SourceBuffer.idl
index 7827d60..a29f0fa 100644
--- a/modules/mediasource/SourceBuffer.idl
+++ b/modules/mediasource/SourceBuffer.idl
@@ -39,7 +39,7 @@
ActiveDOMObject,
NoInterfaceObject,
RuntimeEnabled=MediaSource,
- TypeChecking=Interface|Nullable|Unrestricted,
+ TypeChecking=Interface|Unrestricted,
] interface SourceBuffer : EventTarget {
// Gets or sets the AppendMode.
@@ -68,8 +68,6 @@
// Abort the current segment append sequence.
[RaisesException] void abort();
- // Pending W3C bug: "Change SourceBuffer.remove() end parameter to 'unrestricted double'",
- // https://www.w3.org/Bugs/Public/show_bug.cgi?id=25518
- [RaisesException] void remove(double start, double end);
+ [RaisesException] void remove(double start, unrestricted double end);
};
diff --git a/modules/mediasource/SourceBufferList.idl b/modules/mediasource/SourceBufferList.idl
index bbac1f0..638ca9e 100644
--- a/modules/mediasource/SourceBufferList.idl
+++ b/modules/mediasource/SourceBufferList.idl
@@ -29,7 +29,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject,
RuntimeEnabled=MediaSource,
] interface SourceBufferList : EventTarget {
diff --git a/modules/mediasource/URLMediaSource.idl b/modules/mediasource/URLMediaSource.idl
index 0d336fd..92c7e37 100644
--- a/modules/mediasource/URLMediaSource.idl
+++ b/modules/mediasource/URLMediaSource.idl
@@ -31,7 +31,7 @@
// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#idl-def-URL
[
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] partial interface URL {
- [CallWith=ExecutionContext, TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaSource source);
+ [CallWith=ExecutionContext] static DOMString? createObjectURL(MediaSource source);
};
diff --git a/modules/mediasource/VideoPlaybackQuality.idl b/modules/mediasource/VideoPlaybackQuality.idl
index 104bcab..063888e 100644
--- a/modules/mediasource/VideoPlaybackQuality.idl
+++ b/modules/mediasource/VideoPlaybackQuality.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
RuntimeEnabled=MediaSourceExperimental,
] interface VideoPlaybackQuality {
readonly attribute double creationTime;
diff --git a/modules/mediastream/MediaDeviceInfo.idl b/modules/mediastream/MediaDeviceInfo.idl
index 1698fc7..4d441f4 100644
--- a/modules/mediastream/MediaDeviceInfo.idl
+++ b/modules/mediastream/MediaDeviceInfo.idl
@@ -30,7 +30,7 @@
};
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface MediaDeviceInfo {
readonly attribute DOMString deviceId;
diff --git a/modules/mediastream/MediaStream.idl b/modules/mediastream/MediaStream.idl
index 60a9712..171b878 100644
--- a/modules/mediastream/MediaStream.idl
+++ b/modules/mediastream/MediaStream.idl
@@ -25,7 +25,7 @@
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-MediaStream
[
- WillBeGarbageCollected,
+ GarbageCollected,
Constructor,
Constructor(MediaStream stream),
Constructor(MediaStreamTrack[] tracks),
@@ -39,6 +39,7 @@
sequence<MediaStreamTrack> getAudioTracks();
sequence<MediaStreamTrack> getVideoTracks();
+ sequence<MediaStreamTrack> getTracks();
[RaisesException] void addTrack(MediaStreamTrack track);
[RaisesException] void removeTrack(MediaStreamTrack track);
diff --git a/modules/mediastream/MediaStreamTrack.idl b/modules/mediastream/MediaStreamTrack.idl
index 7249c0c..b707a46 100644
--- a/modules/mediastream/MediaStreamTrack.idl
+++ b/modules/mediastream/MediaStreamTrack.idl
@@ -23,16 +23,17 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
ActiveDOMObject
] interface MediaStreamTrack : EventTarget {
readonly attribute DOMString kind;
readonly attribute DOMString id;
readonly attribute DOMString label;
attribute boolean enabled;
+ readonly attribute boolean muted;
readonly attribute DOMString readyState;
- [CallWith=ExecutionContext, RaisesException] static void getSources(MediaStreamTrackSourcesCallback callback);
+ [CallWith=ExecutionContext, RaisesException, MeasureAs=MediaStreamTrackGetSources] static void getSources(MediaStreamTrackSourcesCallback callback);
[ImplementedAs=stopTrack, RaisesException] void stop();
[CallWith=ExecutionContext] MediaStreamTrack clone();
diff --git a/modules/mediastream/NavigatorMediaStream.idl b/modules/mediastream/NavigatorMediaStream.idl
index 0783d99..cef019a 100644
--- a/modules/mediastream/NavigatorMediaStream.idl
+++ b/modules/mediastream/NavigatorMediaStream.idl
@@ -23,6 +23,4 @@
[RaisesException] void webkitGetUserMedia(Dictionary options,
NavigatorUserMediaSuccessCallback successCallback,
NavigatorUserMediaErrorCallback errorCallback);
-
- [RaisesException] void getMediaDevices(MediaDeviceInfoCallback resultCallback);
};
diff --git a/modules/mediastream/NavigatorUserMediaError.idl b/modules/mediastream/NavigatorUserMediaError.idl
index e068867..f3b5fbb 100644
--- a/modules/mediastream/NavigatorUserMediaError.idl
+++ b/modules/mediastream/NavigatorUserMediaError.idl
@@ -23,7 +23,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface NavigatorUserMediaError {
readonly attribute DOMString name;
diff --git a/modules/mediastream/RTCDTMFSender.idl b/modules/mediastream/RTCDTMFSender.idl
index 1acdc57..c6f6076 100644
--- a/modules/mediastream/RTCDTMFSender.idl
+++ b/modules/mediastream/RTCDTMFSender.idl
@@ -24,7 +24,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject,
ActiveDOMObject
] interface RTCDTMFSender : EventTarget {
diff --git a/modules/mediastream/RTCDataChannel.idl b/modules/mediastream/RTCDataChannel.idl
index 7827c20..83f0472 100644
--- a/modules/mediastream/RTCDataChannel.idl
+++ b/modules/mediastream/RTCDataChannel.idl
@@ -25,7 +25,7 @@
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannel
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject,
] interface RTCDataChannel : EventTarget {
readonly attribute DOMString label;
diff --git a/modules/mediastream/RTCIceCandidate.idl b/modules/mediastream/RTCIceCandidate.idl
index 74a1c60..b3e2801 100644
--- a/modules/mediastream/RTCIceCandidate.idl
+++ b/modules/mediastream/RTCIceCandidate.idl
@@ -29,7 +29,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
Constructor(Dictionary dictionary),
RaisesException=Constructor
] interface RTCIceCandidate {
diff --git a/modules/mediastream/RTCPeerConnection.idl b/modules/mediastream/RTCPeerConnection.idl
index 4d2459f..6f24471 100644
--- a/modules/mediastream/RTCPeerConnection.idl
+++ b/modules/mediastream/RTCPeerConnection.idl
@@ -29,14 +29,14 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
ActiveDOMObject,
- Constructor(Dictionary rtcIceServers, optional Dictionary mediaConstraints),
+ Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraints),
ConstructorCallWith=ExecutionContext,
NoInterfaceObject,
RaisesException=Constructor,
] interface RTCPeerConnection : EventTarget {
- [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
+ [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary rtcOfferOptions);
[RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
@@ -62,12 +62,12 @@
sequence<MediaStream> getRemoteStreams();
MediaStream getStreamById(DOMString streamId);
- [TypeChecking=Interface|Nullable, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints);
- [TypeChecking=Interface|Nullable, RaisesException] void removeStream(MediaStream? stream);
+ [TypeChecking=Interface, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints);
+ [TypeChecking=Interface, RaisesException] void removeStream(MediaStream? stream);
void getStats(RTCStatsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selector);
- [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString label, optional Dictionary options);
+ [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullString] DOMString? label, optional Dictionary options);
[RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track);
diff --git a/modules/mediastream/RTCSessionDescription.idl b/modules/mediastream/RTCSessionDescription.idl
index 6aaf55e..a083ff3 100644
--- a/modules/mediastream/RTCSessionDescription.idl
+++ b/modules/mediastream/RTCSessionDescription.idl
@@ -29,11 +29,11 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
Constructor(optional Dictionary descriptionInitDict),
RaisesException=Constructor
] interface RTCSessionDescription {
- [RaisesException=Setter, TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString type;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString sdp;
+ [RaisesException=Setter] attribute DOMString? type;
+ attribute DOMString? sdp;
};
diff --git a/modules/mediastream/RTCStatsReport.idl b/modules/mediastream/RTCStatsReport.idl
index 2fdce08..5721d5d 100644
--- a/modules/mediastream/RTCStatsReport.idl
+++ b/modules/mediastream/RTCStatsReport.idl
@@ -23,7 +23,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface RTCStatsReport {
readonly attribute Date timestamp;
diff --git a/modules/mediastream/RTCStatsResponse.idl b/modules/mediastream/RTCStatsResponse.idl
index 5e8a53b..69fd239 100644
--- a/modules/mediastream/RTCStatsResponse.idl
+++ b/modules/mediastream/RTCStatsResponse.idl
@@ -23,7 +23,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface RTCStatsResponse {
sequence<RTCStatsReport> result();
diff --git a/modules/mediastream/SourceInfo.idl b/modules/mediastream/SourceInfo.idl
index 8913dd5..60f2419 100644
--- a/modules/mediastream/SourceInfo.idl
+++ b/modules/mediastream/SourceInfo.idl
@@ -24,7 +24,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface SourceInfo {
readonly attribute DOMString id;
diff --git a/modules/mediastream/URLMediaStream.idl b/modules/mediastream/URLMediaStream.idl
index 0e9b64b..334509f 100644
--- a/modules/mediastream/URLMediaStream.idl
+++ b/modules/mediastream/URLMediaStream.idl
@@ -31,5 +31,5 @@
// http://www.w3.org/TR/mediacapture-streams/#idl-def-URL
partial interface URL {
- [CallWith=ExecutionContext, TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaStream stream);
+ [CallWith=ExecutionContext] static DOMString? createObjectURL(MediaStream stream);
};
diff --git a/modules/navigatorcontentutils/NavigatorContentUtils.idl b/modules/navigatorcontentutils/NavigatorContentUtils.idl
index 66c24de..b5a05db 100644
--- a/modules/navigatorcontentutils/NavigatorContentUtils.idl
+++ b/modules/navigatorcontentutils/NavigatorContentUtils.idl
@@ -22,5 +22,5 @@
partial interface Navigator {
[RuntimeEnabled=NavigatorContentUtils, RaisesException] void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
[RuntimeEnabled=CustomSchemeHandler, RaisesException] DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
- [RuntimeEnabled=CustomSchemeHandler, RaisesException] void unregisterProtocolHandler(DOMString scheme, DOMString url);
+ [RuntimeEnabled=NavigatorContentUtils, RaisesException] void unregisterProtocolHandler(DOMString scheme, DOMString url);
};
diff --git a/modules/netinfo/NetworkInformation.idl b/modules/netinfo/NetworkInformation.idl
index 7a12c36..8a4f848 100644
--- a/modules/netinfo/NetworkInformation.idl
+++ b/modules/netinfo/NetworkInformation.idl
@@ -8,12 +8,13 @@
"ethernet",
"wifi",
"other",
- "none"
+ "none",
+ "unknown"
};
[
RuntimeEnabled=NetworkInformation,
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
WillBeGarbageCollected,
ActiveDOMObject
] interface NetworkInformation : EventTarget {
diff --git a/modules/screen_orientation/ScreenOrientation.idl b/modules/screen_orientation/ScreenOrientation.idl
index c1bf532..057ad37 100644
--- a/modules/screen_orientation/ScreenOrientation.idl
+++ b/modules/screen_orientation/ScreenOrientation.idl
@@ -2,15 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-enum OrientationType {
- "portrait-primary",
- "portrait-secondary",
- "landscape-primary",
- "landscape-secondary"
-};
-
enum OrientationLockType {
"any",
+ "natural",
"landscape",
"portrait",
"portrait-primary",
@@ -19,12 +13,22 @@
"landscape-secondary"
};
+enum OrientationType {
+ "portrait-primary",
+ "portrait-secondary",
+ "landscape-primary",
+ "landscape-secondary"
+};
+
[
+ GarbageCollected,
RuntimeEnabled=ScreenOrientation
-] partial interface Screen {
- readonly attribute OrientationType orientation;
+] interface ScreenOrientation : EventTarget {
+ readonly attribute unsigned short angle;
+ readonly attribute DOMString type;
- [CallWith=ScriptState] Promise lockOrientation(OrientationLockType orientation);
+ [CallWith=ScriptState] Promise lock(OrientationLockType orientation);
+ void unlock();
- void unlockOrientation();
+ attribute EventHandler onchange;
};
diff --git a/modules/screen_orientation/ScreenScreenOrientation.idl b/modules/screen_orientation/ScreenScreenOrientation.idl
new file mode 100644
index 0000000..2905343
--- /dev/null
+++ b/modules/screen_orientation/ScreenScreenOrientation.idl
@@ -0,0 +1,9 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ RuntimeEnabled=ScreenOrientation
+] partial interface Screen {
+ [CallWith=ScriptState] readonly attribute ScreenOrientation orientation;
+};
diff --git a/modules/serviceworkers/Cache.idl b/modules/serviceworkers/Cache.idl
new file mode 100644
index 0000000..5f44e41
--- /dev/null
+++ b/modules/serviceworkers/Cache.idl
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
+
+// FIXME: Blink doesn't support dictionary definitions. For now, we can use the
+// Dictionary interface. See http://crbug.com/321462
+
+// dictionary QueryParams {
+// boolean ignoreSearch;
+// boolean ignoreMethod;
+// boolean ignoreVary;
+// boolean prefixMatch;
+// DOMString cacheName;
+// };
+
+[
+ WillBeGarbageCollected,
+ NoInterfaceObject,
+ Exposed=ServiceWorker,
+ RuntimeEnabled=ServiceWorker,
+] interface Cache {
+ // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
+
+ // [CallWith=ScriptState] Promise match((Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise match(Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise match(ScalarValueString request, optional Dictionary queryParams);
+
+ // [CallWith=ScriptState] Promise matchAll((Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise matchAll(Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise matchAll(ScalarValueString request, optional Dictionary queryParams);
+
+ // [CallWith=ScriptState] Promise add((Request or ScalarValueString) request);
+ [CallWith=ScriptState] Promise add(Request request);
+ [CallWith=ScriptState] Promise add(ScalarValueString request);
+
+ // FIXME: The lack of union type support together with the sequence mean we can't use overrides here, instead
+ // bind a generic type.
+ // [CallWith=ScriptState] Promise addAll(sequence<Request or ScalarValueString> requests);
+ [CallWith=ScriptState] Promise addAll(sequence<any> requests);
+
+ // [CallWith=ScriptState] Promise put((Request or ScalarValueString) request, Response response);
+ [CallWith=ScriptState] Promise put(Request request, Response response);
+ [CallWith=ScriptState] Promise put(ScalarValueString request, Response response);
+
+ // [CallWith=ScriptState] Promise delete((Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(ScalarValueString request, optional Dictionary queryParams);
+
+ // [CallWith=ScriptState] Promise keys(optional (Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise keys(optional Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise keys(ScalarValueString request, optional Dictionary queryParams);
+};
diff --git a/modules/serviceworkers/CacheStorage.idl b/modules/serviceworkers/CacheStorage.idl
new file mode 100644
index 0000000..35b5393
--- /dev/null
+++ b/modules/serviceworkers/CacheStorage.idl
@@ -0,0 +1,19 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ WillBeGarbageCollected,
+ NoInterfaceObject,
+ Exposed=ServiceWorker,
+ RuntimeEnabled=ServiceWorker,
+] interface CacheStorage {
+ [CallWith=ScriptState] Promise get(ScalarValueString cacheName);
+ [CallWith=ScriptState] Promise has(ScalarValueString cacheName);
+ [CallWith=ScriptState, ImplementedAs=createFunction] Promise create(ScalarValueString cacheName);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(ScalarValueString cacheName);
+ [CallWith=ScriptState] Promise keys();
+ // FIXME: From https://github.com/slightlyoff/ServiceWorker/issues/372 and the updated
+ // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-storage ,
+ // we have yet to implement match().
+};
diff --git a/modules/serviceworkers/Client.idl b/modules/serviceworkers/Client.idl
deleted file mode 100644
index e30fd2b..0000000
--- a/modules/serviceworkers/Client.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#client-interface
-[
- Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorker
-] interface Client {
- readonly attribute unsigned long id;
-
- // FIXME: Currently we think targetOrigin's probably not necessary, but
- // re-add it if the ongoing issue [1] concludes the other way.
- // [1] https://github.com/slightlyoff/ServiceWorker/issues/190
- [Custom, RaisesException, CallWith=ExecutionContext] void postMessage(SerializedScriptValue message, optional MessagePort[] messagePorts);
-};
diff --git a/modules/serviceworkers/FetchBodyStream.idl b/modules/serviceworkers/FetchBodyStream.idl
new file mode 100644
index 0000000..7c1c3fb
--- /dev/null
+++ b/modules/serviceworkers/FetchBodyStream.idl
@@ -0,0 +1,21 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// http://fetch.spec.whatwg.org/#fetchbodystream
+[
+ RuntimeEnabled=ServiceWorker,
+ Exposed=ServiceWorker,
+ NoInterfaceObject,
+ ActiveDOMObject,
+ WillBeGarbageCollected,
+] interface FetchBodyStream {
+ [CallWith=ScriptState] Promise asArrayBuffer();
+ [CallWith=ScriptState] Promise asBlob();
+ [CallWith=ScriptState] Promise asJSON();
+ [CallWith=ScriptState] Promise asText();
+
+ // Still to be implemented.
+ // [CallWith=ScriptState] Promise asFormData();
+};
+
diff --git a/modules/serviceworkers/FetchEvent.idl b/modules/serviceworkers/FetchEvent.idl
index acb860f..d425143 100644
--- a/modules/serviceworkers/FetchEvent.idl
+++ b/modules/serviceworkers/FetchEvent.idl
@@ -8,6 +8,7 @@
Exposed=ServiceWorker
] interface FetchEvent : Event {
readonly attribute Request request;
+ readonly attribute boolean isReload;
[CallWith=ScriptState] void respondWith(any value);
};
diff --git a/modules/serviceworkers/HeaderMap.idl b/modules/serviceworkers/HeaderMap.idl
deleted file mode 100644
index 38d198b..0000000
--- a/modules/serviceworkers/HeaderMap.idl
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// http://fetch.spec.whatwg.org/#headers-class
-// FIXME: Fetch spec has renamed this to just 'Headers'
-// FIXME: This should be defined as MapClass(DOMString, DOMString)
-// once binding code supports it (http://crbug.com/347435).
-[
- Constructor,
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker
-] interface HeaderMap {
- readonly attribute unsigned long size;
-
- // FIXME: Define keys, values, entries.
- // FIXME: Some of the method definitions (like set) don't strictly
- // follow the MapClass's ones (http://heycam.github.io/webidl/#MapClass),
- // as this is supposed to be a transient implementation until we have real
- // MapClass.
-
- void clear();
- [ImplementedAs=remove] boolean delete(DOMString key);
- DOMString get(DOMString key);
- boolean has(DOMString key);
- void set(DOMString key, DOMString value);
- void forEach(HeaderMapForEachCallback callback, optional any thisArg);
-};
diff --git a/modules/serviceworkers/HeaderMapForEachCallback.idl b/modules/serviceworkers/HeaderMapForEachCallback.idl
deleted file mode 100644
index d6bbb8d..0000000
--- a/modules/serviceworkers/HeaderMapForEachCallback.idl
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-callback interface HeaderMapForEachCallback {
- [CallWith=ThisValue] boolean handleItem(DOMString value, DOMString key, HeaderMap map);
- boolean handleItem(DOMString value, DOMString key, HeaderMap map);
-};
diff --git a/modules/serviceworkers/Headers.idl b/modules/serviceworkers/Headers.idl
new file mode 100644
index 0000000..efcbc3b
--- /dev/null
+++ b/modules/serviceworkers/Headers.idl
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// http://fetch.spec.whatwg.org/#headers-class
+[
+ Constructor,
+ Constructor(Headers input),
+ Constructor(Dictionary input),
+ RuntimeEnabled=ServiceWorker,
+ Exposed=ServiceWorker,
+ RaisesException=Constructor,
+ WillBeGarbageCollected,
+] interface Headers {
+ [RaisesException] void append(ByteString name, ByteString value);
+ [ImplementedAs=remove, RaisesException] void delete(ByteString key);
+ [RaisesException] ByteString? get(ByteString key);
+ [RaisesException] sequence<ByteString> getAll(ByteString name);
+ [RaisesException] boolean has(ByteString key);
+ [RaisesException] void set(ByteString key, ByteString value);
+
+ // The following are not defined in the spec.
+ // FIXME: We should implement Headers.prototype[Symbol.iterator] instead of
+ // forEach and size.
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26102
+ readonly attribute unsigned long size;
+ void forEach(HeadersForEachCallback callback, optional any thisArg);
+};
diff --git a/modules/serviceworkers/HeadersForEachCallback.idl b/modules/serviceworkers/HeadersForEachCallback.idl
new file mode 100644
index 0000000..d61e83a
--- /dev/null
+++ b/modules/serviceworkers/HeadersForEachCallback.idl
@@ -0,0 +1,10 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This IDL is not spec'd yet.
+// http://fetch.spec.whatwg.org/#headers-class
+callback interface HeadersForEachCallback {
+ [CallWith=ThisValue] boolean handleItem(DOMString value, DOMString key, Headers map);
+ boolean handleItem(DOMString value, DOMString key, Headers map);
+};
diff --git a/modules/serviceworkers/Request.idl b/modules/serviceworkers/Request.idl
index aea4e91..3d1b402 100644
--- a/modules/serviceworkers/Request.idl
+++ b/modules/serviceworkers/Request.idl
@@ -3,24 +3,28 @@
// found in the LICENSE file.
// http://fetch.spec.whatwg.org/#request-class
+
+enum RequestMode { "same-origin", "no-cors", "cors" };
+enum RequestCredentials { "omit", "same-origin", "include" };
+
[
- Constructor(optional Dictionary requestInitDict),
+ Constructor(ScalarValueString input, optional Dictionary requestInitDict),
+ Constructor(Request input, optional Dictionary requestInitDict),
+ ConstructorCallWith=ExecutionContext,
RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker
+ Exposed=ServiceWorker,
+ RaisesException=Constructor,
+ WillBeGarbageCollected,
] interface Request {
- attribute ScalarValueString url;
- attribute ByteString method;
- readonly attribute DOMString origin;
- readonly attribute HeaderMap headers;
+ readonly attribute ByteString method;
+ readonly attribute ScalarValueString url;
+ readonly attribute Headers headers;
+
+ readonly attribute DOMString referrer;
+ readonly attribute RequestMode mode;
+ readonly attribute RequestCredentials credentials;
// FIXME: Implement the following:
- // attribute unsigned long timeout;
- // readonly attribute Mode mode;
- // attribute boolean synchronous;
- // readonly attribute unsigned long redirectCount;
- // attribute boolean forcePreflight;
- // attribute boolean forceSameOrigin;
- // attribute boolean omitCredentials;
- // readonly attribute DOMString referrer;
- // attribute any body;
+ // readonly attribute FetchBodyStream body;
+ // readonly attribute RequestContext context;
};
diff --git a/modules/serviceworkers/Response.idl b/modules/serviceworkers/Response.idl
index fb8ecf3..28df198 100644
--- a/modules/serviceworkers/Response.idl
+++ b/modules/serviceworkers/Response.idl
@@ -3,18 +3,24 @@
// found in the LICENSE file.
// http://fetch.spec.whatwg.org/#response-class
-// FIXME: Split this idl/impl into AbstractResponse and Response.
-[
- // FIXME: Add ctors for String, Stream, and ArrayBuffer/ArrayBufferView response bodies.
- Constructor(Blob body, optional Dictionary responseInitDict),
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker
-] interface Response {
- attribute unsigned short status;
- attribute ByteString statusText;
- readonly attribute HeaderMap headers;
- // FIXME: Implement the following:
- // attribute DOMString url;
- // Promise<Blob> toBlob();
+enum ResponseType { "basic", "cors", "default", "error", "opaque" };
+
+[
+ // FIXME: Add ctors for ArrayBuffer, ArrayBufferView, FormData,
+ // and URLSearchParams response bodies.
+ Constructor(ScalarValueString body, optional Dictionary responseInitDict),
+ Constructor(Blob? body, optional Dictionary responseInitDict),
+ RuntimeEnabled=ServiceWorker,
+ Exposed=ServiceWorker,
+ RaisesException=Constructor,
+ WillBeGarbageCollected,
+] interface Response {
+ // FIXME: Implement redirect().
+ readonly attribute ResponseType type;
+ readonly attribute ScalarValueString url;
+ readonly attribute unsigned short status;
+ readonly attribute ByteString statusText;
+ readonly attribute Headers headers;
+ [CallWith=ExecutionContext] readonly attribute FetchBodyStream body;
};
diff --git a/modules/serviceworkers/ServiceWorker.idl b/modules/serviceworkers/ServiceWorker.idl
index b9a2bdd..69171df 100644
--- a/modules/serviceworkers/ServiceWorker.idl
+++ b/modules/serviceworkers/ServiceWorker.idl
@@ -29,18 +29,27 @@
*/
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-interface
+
+enum ServiceWorkerState {
+ "installing",
+ "installed",
+ "activating",
+ "activated",
+ "redundant"
+};
+
[
ActiveDOMObject,
- RuntimeEnabled=ServiceWorker
+ RuntimeEnabled=ServiceWorker,
+ WillBeGarbageCollected
] interface ServiceWorker : EventTarget {
// FIXME: Should inherit this from Worker.
- [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional MessagePort[] messagePorts);
+ [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
- readonly attribute ScalarValueString scope;
- readonly attribute ScalarValueString url;
- // FIXME: Should be ServiceWorkerState enum, not DOMString.
- readonly attribute DOMString state;
+ readonly attribute ScalarValueString scriptURL;
+ readonly attribute ServiceWorkerState state;
+
attribute EventHandler onstatechange;
};
diff --git a/modules/serviceworkers/ServiceWorkerClient.idl b/modules/serviceworkers/ServiceWorkerClient.idl
new file mode 100644
index 0000000..01a92cf
--- /dev/null
+++ b/modules/serviceworkers/ServiceWorkerClient.idl
@@ -0,0 +1,14 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-client-interface
+[
+ Exposed=ServiceWorker,
+ RuntimeEnabled=ServiceWorker,
+ WillBeGarbageCollected,
+] interface ServiceWorkerClient {
+ readonly attribute unsigned long id;
+
+ [Custom, RaisesException, CallWith=ExecutionContext] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+};
diff --git a/modules/serviceworkers/ServiceWorkerClients.idl b/modules/serviceworkers/ServiceWorkerClients.idl
index 1fc9ad0..a484d6e 100644
--- a/modules/serviceworkers/ServiceWorkerClients.idl
+++ b/modules/serviceworkers/ServiceWorkerClients.idl
@@ -5,7 +5,8 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-clients-interface
[
Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorker
+ RuntimeEnabled=ServiceWorker,
+ WillBeGarbageCollected,
] interface ServiceWorkerClients {
[CallWith=ScriptState] Promise getServiced();
};
diff --git a/modules/serviceworkers/ServiceWorkerContainer.idl b/modules/serviceworkers/ServiceWorkerContainer.idl
index 9f8a3f6..df0017e 100644
--- a/modules/serviceworkers/ServiceWorkerContainer.idl
+++ b/modules/serviceworkers/ServiceWorkerContainer.idl
@@ -30,15 +30,16 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-interface
[
- RuntimeEnabled=ServiceWorker
+ RuntimeEnabled=ServiceWorker,
+ WillBeGarbageCollected
] interface ServiceWorkerContainer {
- [Unforgeable] readonly attribute ServiceWorker active;
- [Unforgeable] readonly attribute ServiceWorker controller;
- [Unforgeable] readonly attribute ServiceWorker installing;
- [Unforgeable] readonly attribute ServiceWorker waiting;
+ [Unforgeable] readonly attribute ServiceWorker? installing;
+ [Unforgeable] readonly attribute ServiceWorker? waiting;
+ [Unforgeable] readonly attribute ServiceWorker? active;
+ [Unforgeable] readonly attribute ServiceWorker? controller;
[CallWith=ScriptState] readonly attribute Promise ready;
[CallWith=ScriptState, ImplementedAs=registerServiceWorker] Promise register(ScalarValueString url, optional Dictionary options);
- [CallWith=ScriptState, ImplementedAs=unregisterServiceWorker] Promise unregister(ScalarValueString scope);
+ [CallWith=ScriptState, ImplementedAs=unregisterServiceWorker] Promise unregister(optional ScalarValueString scope = "/");
};
diff --git a/modules/serviceworkers/ServiceWorkerGlobalScope.idl b/modules/serviceworkers/ServiceWorkerGlobalScope.idl
index 07d2dbf..be99abc 100644
--- a/modules/serviceworkers/ServiceWorkerGlobalScope.idl
+++ b/modules/serviceworkers/ServiceWorkerGlobalScope.idl
@@ -31,15 +31,17 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-interface
[
Exposed=ServiceWorker,
- Global=Worker&ServiceWorker,
+ Global=(Worker,ServiceWorker),
RuntimeEnabled=ServiceWorker,
] interface ServiceWorkerGlobalScope : WorkerGlobalScope {
readonly attribute ServiceWorkerClients clients;
[CallWith=ExecutionContext, Unforgeable] readonly attribute ScalarValueString scope;
+ // FIXME: Rename this once it's ready for testing.
+ [CallWith=ExecutionContext, Unforgeable, ImplementedAs=caches] readonly attribute CacheStorage nativeCaches;
- [CallWith=ScriptState] Promise fetch(ScalarValueString request);
- [CallWith=ScriptState] Promise fetch(Request request);
+ [CallWith=ScriptState] Promise fetch(DOMString request, optional Dictionary requestInitDict);
+ [CallWith=ScriptState] Promise fetch(Request request, optional Dictionary requestInitDict);
attribute EventHandler onactivate;
attribute EventHandler onfetch;
diff --git a/modules/serviceworkers/ServiceWorkerRegistration.idl b/modules/serviceworkers/ServiceWorkerRegistration.idl
new file mode 100644
index 0000000..869808d
--- /dev/null
+++ b/modules/serviceworkers/ServiceWorkerRegistration.idl
@@ -0,0 +1,19 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-obj
+[
+ ActiveDOMObject,
+ RuntimeEnabled=ServiceWorker,
+ WillBeGarbageCollected,
+] interface ServiceWorkerRegistration : EventTarget {
+ [Unforgeable] readonly attribute ServiceWorker? installing;
+ [Unforgeable] readonly attribute ServiceWorker? waiting;
+ [Unforgeable] readonly attribute ServiceWorker? active;
+ readonly attribute ScalarValueString scope;
+
+ [CallWith=ScriptState] Promise unregister();
+
+ attribute EventHandler onupdatefound;
+};
diff --git a/modules/webaudio/AudioBufferSourceNode.idl b/modules/webaudio/AudioBufferSourceNode.idl
index 135f1ce..0f3c252 100644
--- a/modules/webaudio/AudioBufferSourceNode.idl
+++ b/modules/webaudio/AudioBufferSourceNode.idl
@@ -25,7 +25,7 @@
// A cached (non-streamed), memory-resident audio source
[
Conditional=WEB_AUDIO,
- TypeChecking=Interface|Nullable,
+ TypeChecking=Interface,
] interface AudioBufferSourceNode : AudioSourceNode {
[RaisesException=Setter] attribute AudioBuffer buffer;
diff --git a/modules/webaudio/AudioParam.idl b/modules/webaudio/AudioParam.idl
index 95d90e2..e612201 100644
--- a/modules/webaudio/AudioParam.idl
+++ b/modules/webaudio/AudioParam.idl
@@ -31,15 +31,8 @@
Conditional=WEB_AUDIO
] interface AudioParam {
attribute float value;
- readonly attribute float minValue;
- readonly attribute float maxValue;
readonly attribute float defaultValue;
- readonly attribute DOMString name;
-
- // FIXME: Could define units constants here (seconds, decibels, cents, etc.)...
- readonly attribute unsigned short units;
-
// Parameter automation.
void setValueAtTime(float value, double time);
void linearRampToValueAtTime(float value, double time);
diff --git a/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl b/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl
index 49fe6a2..3e6fcfb 100644
--- a/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl
+++ b/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl
@@ -27,7 +27,7 @@
[
RuntimeEnabled=Database,
] partial interface WorkerGlobalScope {
- [RaisesException, MeasureAs=OpenWebDatabaseInWorker] Database openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback creationCallback);
+ [RaisesException, DeprecateAs=OpenWebDatabaseInWorker] Database openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback creationCallback);
- [RaisesException, MeasureAs=OpenWebDatabaseSyncInWorker] DatabaseSync openDatabaseSync(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback creationCallback);
+ [RaisesException, DeprecateAs=OpenWebDatabaseSyncInWorker] DatabaseSync openDatabaseSync(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback creationCallback);
};
diff --git a/modules/webmidi/MIDIPort.idl b/modules/webmidi/MIDIPort.idl
index 3ca858a..902c825 100644
--- a/modules/webmidi/MIDIPort.idl
+++ b/modules/webmidi/MIDIPort.idl
@@ -35,6 +35,7 @@
[
NoInterfaceObject,
+ GarbageCollected
] interface MIDIPort : EventTarget {
readonly attribute DOMString id;
readonly attribute DOMString manufacturer;
diff --git a/modules/webmidi/NavigatorWebMIDI.idl b/modules/webmidi/NavigatorWebMIDI.idl
index 6a275d5..d391e29 100644
--- a/modules/webmidi/NavigatorWebMIDI.idl
+++ b/modules/webmidi/NavigatorWebMIDI.idl
@@ -31,5 +31,6 @@
[
RuntimeEnabled=WebMIDI,
] partial interface Navigator {
- [CallWith=ScriptState] Promise requestMIDIAccess(optional Dictionary options);
+ // FIXMEDART: Remove the DartSuppress once Dart support Blink Promises.
+ [CallWith=ScriptState, DartSuppress] Promise requestMIDIAccess(optional Dictionary options);
};
diff --git a/modules/websockets/WebSocket.idl b/modules/websockets/WebSocket.idl
index eeb8cbd..c2a343c 100644
--- a/modules/websockets/WebSocket.idl
+++ b/modules/websockets/WebSocket.idl
@@ -38,15 +38,15 @@
[
ActiveDOMObject,
// FIXME: should be optional union type http://crbug.com/240176
- Constructor(DOMString url),
- Constructor(DOMString url, DOMString protocol),
+ Constructor(DOMString url, optional DOMString protocol),
Constructor(DOMString url, sequence<DOMString> protocols),
ConstructorCallWith=ExecutionContext,
- Exposed=Window&Worker,
+ Exposed=(Window,Worker),
RaisesException=Constructor,
- WillBeGarbageCollected,
+ GarbageCollected,
+ ImplementedAs=DOMWebSocket,
] interface WebSocket : EventTarget {
- [MeasureAs=WebSocketURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+ [DeprecateAs=WebSocketURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
readonly attribute DOMString url;
// ready state