Updated to Chrome 45
diff --git a/bindings/IDLExtendedAttributes.txt b/bindings/IDLExtendedAttributes.txt
index 73cd6bd..c88d15d 100644
--- a/bindings/IDLExtendedAttributes.txt
+++ b/bindings/IDLExtendedAttributes.txt
@@ -42,8 +42,8 @@
Constructor
# FIXME: remove [ConstructorCallWith=Document], as can instead use
# [ConstructorCallWith=ExecutionContext] + toDocument(executionContext)
-ConstructorCallWith=ExecutionContext|Document
-Custom=|Getter|Setter|LegacyCallAsFunction|ToV8|VisitDOMWrapper|Wrap|PropertyGetter|PropertyEnumerator|PropertyQuery
+ConstructorCallWith=ExecutionContext|ScriptState|Document
+Custom=|Getter|Setter|LegacyCallAsFunction|VisitDOMWrapper|PropertyGetter|PropertyEnumerator|PropertyQuery|CallPrologue|CallEpilogue
CustomConstructor
CustomElementCallbacks
# Dartium specific attributes.
@@ -71,8 +71,8 @@
DoNotCheckConstants
DoNotCheckSecurity=|Setter
DoNotCheckSignature
+DoNotExposeJSAccessors
EnforceRange
-EventConstructor
ExposeJSAccessors
Exposed=*
GarbageCollected
@@ -80,24 +80,25 @@
Immutable
ImplementedAs=*
ImplementedInPrivateScript
-InitializedByEventConstructor
Iterable
+LegacyInterfaceTypeChecking
LegacyTreatAsPartialInterface
+LenientThis
LogActivity=|GetterOnly|SetterOnly
LogAllWorlds
+NewObject
+Measure
MeasureAs=*
NamedConstructor=*
NoImplHeader
NoInterfaceObject
NotEnumerable
-NotScriptWrappable
OnlyExposedToPrivateScript
OverrideBuiltins
PartialInterfaceImplementedAs=*
-# Valid values for [PerContextEnabled] are Context Features, in
-# ContextFeatures::FeatureType in Source/core/dom/ContextFeatures.h
-PerContextEnabled=*
+PermissiveDictionaryConversion
PerWorldBindings
+PostMessage
PrimaryGlobal=|*
PutForwards=*
RaisesException=|Getter|Setter|Constructor
@@ -110,14 +111,15 @@
# Valid values for [RuntimeEnabled] are the Runtime Enabled Features, listed in
# Source/core/page/RuntimeEnabledFeatures.in
RuntimeEnabled=*
+SameObject
SetWrapperReferenceFrom=*
SetWrapperReferenceTo=*
SetterCallWith=ExecutionContext|ScriptArguments|ActiveWindow|FirstWindow
-SpecialWrapFor=*
TreatNullAs=NullString|EmptyString
TreatReturnedNullStringAs=Null|Undefined
TreatUndefinedAs=NullString
-TypeChecking=Interface|Unrestricted
+TypeChecking=Interface
URL
Unforgeable
+Unscopeable
WillBeGarbageCollected
diff --git a/bindings/README b/bindings/README
index 418d1e5..630832e 100644
--- a/bindings/README
+++ b/bindings/README
@@ -5,5 +5,5 @@
using the script: $DART_ROOT/sdk/lib/html/scripts/idlsync.py
The current version corresponds to:
-URL: http://src.chromium.org/blink/branches/dart/dartium
-Current revision: 190578
+URL: https://src.chromium.org/blink/branches/dart/2454_1
+Current revision: 202759
diff --git a/bindings/dart/gyp/scripts/build_dart_snapshot.py b/bindings/dart/gyp/scripts/build_dart_snapshot.py
index 323f38a..4efc717 100755
--- a/bindings/dart/gyp/scripts/build_dart_snapshot.py
+++ b/bindings/dart/gyp/scripts/build_dart_snapshot.py
@@ -68,15 +68,18 @@
# Skip internal libraries - they should be indirectly imported via the public ones.
if not name.startswith('_'):
snapshotScript.write('import \'dart:%(name)s\' as %(name)s;\n' % {'name': name})
+ snapshotScript.write('import \'dart:vmserviceio\';\n')
- binarySnapshotFile = path(outputFilePath, 'DartSnapshot.bin')
+ binaryVmIsolateSnapshotFile = path(outputFilePath, 'DartVmIsolateSnapshot.bin')
+ binaryIsolateSnapshotFile = path(outputFilePath, 'DartIsolateSnapshot.bin')
# Build a command to generate the snapshot bin file.
command = [
'python',
path(dartPath, 'runtime', 'tools', 'create_snapshot_bin.py'),
'--executable=%s' % path(genSnapshotBinPath),
- '--output_bin=%s' % binarySnapshotFile,
+ '--vm_output_bin=%s' % binaryVmIsolateSnapshotFile,
+ '--output_bin=%s' % binaryIsolateSnapshotFile,
'--script=%s' % snapshotScriptName,
]
command.extend(['--url_mapping=dart:%s,%s' % lib for lib in snapshottedLibs])
@@ -93,7 +96,8 @@
'python',
path(dartPath, 'runtime', 'tools', 'create_snapshot_file.py'),
'--input_cc=%s' % dartSnapshotTemplateFile,
- '--input_bin=%s' % binarySnapshotFile,
+ '--vm_input_bin=%s' % binaryVmIsolateSnapshotFile,
+ '--input_bin=%s' % binaryIsolateSnapshotFile,
'--output=%s' % path(outputFilePath, 'DartSnapshot.bytes'),
]
@@ -104,7 +108,7 @@
if (pipe.returncode != 0):
raise Exception('Snapshot file generation failed: %s/%s' % (out, error))
- snapshotSizeInBytes = os.path.getsize(binarySnapshotFile)
+ snapshotSizeInBytes = os.path.getsize(binaryIsolateSnapshotFile)
productDir = os.path.dirname(genSnapshotBinPath)
snapshotSizeOutputPath = os.path.join(productDir, 'snapshot-size.txt')
with file(snapshotSizeOutputPath, 'w') as snapshotSizeFile:
diff --git a/bindings/dart/scripts/__init__.py b/bindings/dart/scripts/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/bindings/dart/scripts/__init__.py
+++ /dev/null
diff --git a/bindings/dart/scripts/code_generator_dart.py b/bindings/dart/scripts/code_generator_dart.py
deleted file mode 100644
index df3818e..0000000
--- a/bindings/dart/scripts/code_generator_dart.py
+++ /dev/null
@@ -1,403 +0,0 @@
-# Copyright (C) 2013 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.
-
-"""Generate Blink C++ bindings (.h and .cpp files) for use by Dart:HTML.
-
-If run itself, caches Jinja templates (and creates dummy file for build,
-since cache filenames are unpredictable and opaque).
-
-This module is *not* concurrency-safe without care: bytecode caching creates
-a race condition on cache *write* (crashes if one process tries to read a
-partially-written cache). However, if you pre-cache the templates (by running
-the module itself), then you can parallelize compiling individual files, since
-cache *reading* is safe.
-
-Input: An object of class IdlDefinitions, containing an IDL interface X
-Output: DartX.h and DartX.cpp
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-import os
-import cPickle as pickle
-import re
-import sys
-
-
-# Path handling for libraries and templates
-# Paths have to be normalized because Jinja uses the exact template path to
-# determine the hash used in the cache filename, and we need a pre-caching step
-# to be concurrency-safe. Use absolute path because __file__ is absolute if
-# module is imported, and relative if executed directly.
-# If paths differ between pre-caching and individual file compilation, the cache
-# is regenerated, which causes a race condition and breaks concurrent build,
-# since some compile processes will try to read the partially written cache.
-module_path, module_filename = os.path.split(os.path.realpath(__file__))
-third_party_dir = os.path.normpath(os.path.join(
- module_path, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir))
-templates_dir = os.path.normpath(os.path.join(module_path, 'templates'))
-
-# Make sure extension is .py, not .pyc or .pyo, so doesn't depend on caching
-module_pyname = os.path.splitext(module_filename)[0] + '.py'
-
-# jinja2 is in chromium's third_party directory.
-# Insert at 1 so at front to override system libraries, and
-# after path[0] == invoking script dir
-sys.path.insert(1, third_party_dir)
-
-# Add the base compiler scripts to the path here as in compiler.py
-dart_script_path = os.path.dirname(os.path.abspath(__file__))
-script_path = os.path.join(os.path.dirname(os.path.dirname(dart_script_path)),
- 'scripts')
-sys.path.extend([script_path])
-
-import jinja2
-
-import idl_types
-from idl_types import IdlType
-import dart_callback_interface
-import dart_interface
-import dart_types
-from dart_utilities import DartUtilities
-from utilities import write_pickle_file, idl_filename_to_interface_name
-import dart_dictionary
-from v8_globals import includes, interfaces
-
-
-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 CodeGeneratorDart(object):
- def __init__(self, interfaces_info, cache_dir):
- interfaces_info = interfaces_info or {}
- self.interfaces_info = interfaces_info
- self.jinja_env = initialize_jinja_env(cache_dir)
-
- # Set global type info
- if 'ancestors' in interfaces_info:
- idl_types.set_ancestors(interfaces_info['ancestors'])
- if 'callback_interfaces' in interfaces_info:
- IdlType.set_callback_interfaces(interfaces_info['callback_interfaces'])
- if 'dictionaries' in interfaces_info:
- IdlType.set_dictionaries(interfaces_info['dictionaries'])
- if 'implemented_as_interfaces' in interfaces_info:
- IdlType.set_implemented_as_interfaces(interfaces_info['implemented_as_interfaces'])
- if 'garbage_collected_interfaces' in interfaces_info:
- IdlType.set_garbage_collected_types(interfaces_info['garbage_collected_interfaces'])
- if 'will_be_garbage_collected_interfaces' in interfaces_info:
- IdlType.set_will_be_garbage_collected_types(interfaces_info['will_be_garbage_collected_interfaces'])
- if 'component_dirs' in interfaces_info:
- dart_types.set_component_dirs(interfaces_info['component_dirs'])
-
- def generate_code(self, definitions, interface_name, idl_pickle_filename,
- only_if_changed):
- """Returns .h/.cpp code as (header_text, cpp_text)."""
-
- IdlType.set_enums((enum.name, enum.values)
- for enum in definitions.enumerations.values())
-
- if interface_name in definitions.interfaces:
- interface = definitions.interfaces[interface_name]
- elif interface_name in definitions.dictionaries:
- output_code_list = self.generate_dictionary_code(
- definitions, interface_name,
- definitions.dictionaries[interface_name])
-
- # Pickle the dictionary information...
- idl_world = self.load_idl_pickle_file(idl_pickle_filename)
- idl_world['dictionary'] = {'name': interface_name}
- write_pickle_file(idl_pickle_filename, idl_world, only_if_changed)
-
- return output_code_list
- else:
- raise ValueError('%s is 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())
-
- # Select appropriate Jinja template and contents function
- if interface.is_callback:
- header_template_filename = 'callback_interface_h.template'
- cpp_template_filename = 'callback_interface_cpp.template'
- generate_contents = dart_callback_interface.generate_callback_interface
- else:
- header_template_filename = 'interface_h.template'
- cpp_template_filename = 'interface_cpp.template'
- generate_contents = dart_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', []))
-
- # Remove includes that are not needed for Dart and trigger fatal
- # compile warnings if included. These IDL files need to be
- # imported by Dart to generate the list of events but the
- # associated header files do not contain any code used by Dart.
- includes.discard('core/dom/GlobalEventHandlers.h')
- includes.discard('core/frame/DOMWindowEventHandlers.h')
-
- # Remove v8 usages not needed.
- includes.discard('core/frame/UseCounter.h')
- includes.discard('bindings/core/v8/V8ScriptState.h')
- includes.discard('bindings/core/v8/V8DOMActivityLogger.h')
- includes.discard('bindings/core/v8/V8DOMConfiguration.h')
- includes.discard('bindings/core/v8/V8ExceptionState.h')
- includes.discard('bindings/core/v8/V8HiddenValue.h')
- includes.discard('bindings/core/v8/V8ObjectConstructor.h')
- includes.discard('core/dom/ContextFeatures.h')
- includes.discard('core/dom/Document.h')
- includes.discard('platform/RuntimeEnabledFeatures.h')
- includes.discard('platform/TraceEvent.h')
-
- template_contents['cpp_includes'] = sorted(includes)
-
- idl_world = self.load_idl_pickle_file(idl_pickle_filename)
-
- if 'interface_name' in template_contents:
- # interfaces no longer remember there component_dir re-compute based
- # on relative_dir (first directory is the component).
- component_dir = split_path(interface_info['relative_dir'])[0]
- interface_global = {'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'],
- 'has_resolver': template_contents['interface_name'],
- 'native_entries': sorted(template_contents['native_entries'], key=lambda(x): x['blink_entry']),
- 'is_node': template_contents['is_node'],
- 'conditional_string': template_contents['conditional_string'],
- 'component_dir': component_dir,
- }
- idl_world['interface'] = interface_global
- else:
- callback_global = {'name': template_contents['cpp_class']}
- idl_world['callback'] = callback_global
-
- write_pickle_file(idl_pickle_filename, idl_world, only_if_changed)
-
- # Render Jinja templates
- header_text = header_template.render(template_contents)
- cpp_text = cpp_template.render(template_contents)
- return header_text, cpp_text
-
- def load_idl_pickle_file(self, idl_pickle_filename):
- # Pickle the dictionary information...
- idl_world = {'interface': None, 'callback': None, 'dictionary': None}
-
- # Load the pickle file for this IDL.
- if os.path.isfile(idl_pickle_filename):
- with open(idl_pickle_filename) as idl_pickle_file:
- idl_global_data = pickle.load(idl_pickle_file)
- idl_pickle_file.close()
- idl_world['interface'] = idl_global_data['interface']
- idl_world['callback'] = idl_global_data['callback']
- idl_world['dictionary'] = idl_global_data['dictionary']
-
- return idl_world
-
- 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_dart_h.template')
- cpp_template = self.jinja_env.get_template('dictionary_dart_cpp.template')
- template_context = dart_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)
- return (header_text, cpp_text)
-
- def generate_dictionary_impl(self, dictionary_name,
- interface_info, dictionary):
- header_template = self.jinja_env.get_template('dictionary_impl_h.template')
- cpp_template = self.jinja_env.get_template('dictionary_impl_cpp.template')
- template_context = dart_dictionary.dictionary_impl_context(
- dictionary, self.interfaces_info)
- header_text, cpp_text = render_template(
- interface_info, header_template, cpp_template, template_context)
- return (header_text, cpp_text)
-
- def load_global_pickles(self, global_entries):
- # List of all interfaces and callbacks for global code generation.
- world = {'interfaces': [], 'callbacks': [], 'dictionary': []}
-
- # Load all pickled data for each interface.
- for (directory, file_list) in global_entries:
- for idl_filename in file_list:
- interface_name = idl_filename_to_interface_name(idl_filename)
- idl_pickle_filename = interface_name + "_globals.pickle"
- idl_pickle_filename = os.path.join(directory, idl_pickle_filename)
- with open(idl_pickle_filename) as idl_pickle_file:
- idl_world = pickle.load(idl_pickle_file)
- if 'interface' in idl_world:
- # FIXME: Why are some of these None?
- if idl_world['interface']:
- world['interfaces'].append(idl_world['interface'])
- if 'callbacks' in idl_world:
- # FIXME: Why are some of these None?
- if idl_world['callbacks']:
- world['callbacks'].append(idl_world['callback'])
- if 'dictionary' in idl_world:
- # It's an IDL dictionary
- if idl_world['dictionary']:
- world['dictionary'].append(idl_world['dictionary'])
- world['interfaces'] = sorted(world['interfaces'], key=lambda (x): x['name'])
- world['callbacks'] = sorted(world['callbacks'], key=lambda (x): x['name'])
- world['dictionary'] = sorted(world['dictionary'], key=lambda (x): x['name'])
- return world
-
- # Generates global file for all interfaces.
- def generate_globals(self, global_entries):
- template_contents = self.load_global_pickles(global_entries)
- template_contents['code_generator'] = module_pyname
-
- header_template_filename = 'global_h.template'
- header_template = self.jinja_env.get_template(header_template_filename)
- header_text = header_template.render(template_contents)
-
- cpp_template_filename = 'global_cpp.template'
- cpp_template = self.jinja_env.get_template(cpp_template_filename)
- cpp_text = cpp_template.render(template_contents)
-
- return header_text, cpp_text
-
- # Generates global dart blink file for all interfaces.
- def generate_dart_blink(self, global_entries):
- template_contents = self.load_global_pickles(global_entries)
- template_contents['code_generator'] = module_pyname
-
- template_filename = 'dart_blink.template'
- template = self.jinja_env.get_template(template_filename)
-
- text = template.render(template_contents)
- return text
-
-
-def initialize_jinja_env(cache_dir):
- jinja_env = jinja2.Environment(
- loader=jinja2.FileSystemLoader(templates_dir),
- # Bytecode cache is not concurrency-safe unless pre-cached:
- # if pre-cached this is read-only, but writing creates a race condition.
- # bytecode_cache=jinja2.FileSystemBytecodeCache(cache_dir),
- keep_trailing_newline=True, # newline-terminate generated files
- lstrip_blocks=True, # so can indent control flow tags
- trim_blocks=True)
- jinja_env.filters.update({
- 'blink_capitalize': DartUtilities.capitalize,
- 'conditional': conditional_if_endif,
- 'runtime_enabled': runtime_enabled_if,
- })
- return jinja_env
-
-
-# [Conditional]
-def conditional_if_endif(code, conditional_string):
- # Jinja2 filter to generate if/endif directive blocks
- if not conditional_string:
- return code
- return ('#if %s\n' % conditional_string +
- code +
- '#endif // %s\n' % conditional_string)
-
-
-# [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' % code)
-
-
-def split_path(path):
- path_list = []
- while os.path.basename(path):
- path_list.append(os.path.basename(path))
- path = os.path.dirname(path)
- path_list.reverse()
- return path_list
-
-
-################################################################################
-
-def main(argv):
- # If file itself executed, cache templates
- try:
- cache_dir = argv[1]
- dummy_filename = argv[2]
- except IndexError as err:
- print 'Usage: %s OUTPUT_DIR DUMMY_FILENAME' % argv[0]
- return 1
-
- # Cache templates
- jinja_env = initialize_jinja_env(cache_dir)
- template_filenames = [filename for filename in os.listdir(templates_dir)
- # Skip .svn, directories, etc.
- if filename.endswith(('.cpp', '.h', '.template'))]
- for template_filename in template_filenames:
- jinja_env.get_template(template_filename)
-
- # Create a dummy file as output for the build system,
- # since filenames of individual cache files are unpredictable and opaque
- # (they are hashes of the template path, which varies based on environment)
- with open(dummy_filename, 'w') as dummy_file:
- pass # |open| creates or touches the file
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/bindings/dart/scripts/compiler.py b/bindings/dart/scripts/compiler.py
deleted file mode 100755
index 6dbe8f2..0000000
--- a/bindings/dart/scripts/compiler.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/python
-# 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.
-
-"""Compile an .idl file to Dart bindings (.h and .cpp files).
-
-Design doc: ??????
-"""
-
-from optparse import OptionParser
-import os
-import sys
-
-dart_script_path = os.path.dirname(os.path.abspath(__file__))
-script_path = os.path.join(os.path.dirname(os.path.dirname(dart_script_path)),
- 'scripts')
-sys.path.extend([script_path])
-
-from dart_compiler import IdlCompiler
-from code_generator_dart import CodeGeneratorDart
-
-
-def parse_options():
- parser = OptionParser()
- parser.add_option('--output-directory')
- parser.add_option('--interfaces-info-file')
- parser.add_option('--write-file-only-if-changed', type='int', default='1')
- parser.add_option('--generate-dart-blink',
- action='append',
- type='string',
- dest='blink_global_entries',
- nargs=3,
- help="Pickle file directory, idl file list, idl dictionaries list")
-
- parser.add_option('--generate-globals',
- action='append',
- type='string',
- dest='global_entries',
- nargs=2,
- help="Pickle file directory and idl file list (global class table)")
-
- # ensure output comes last, so command line easy to parse via regexes
- parser.disable_interspersed_args()
-
- options, args = parser.parse_args()
- if options.output_directory is None:
- parser.error('Must specify output directory using --output-directory.')
- options.write_file_only_if_changed = bool(options.write_file_only_if_changed)
- if bool(options.global_entries) or bool(options.blink_global_entries):
- return options, None
- if len(args) != 1:
- parser.error('Must specify exactly 1 input file as argument, but %d given.' % len(args))
- filename = os.path.realpath(args[0])
- return options, filename
-
-
-def idl_filename_to_interface_name(idl_filename):
- basename = os.path.basename(idl_filename)
- interface_name, _ = os.path.splitext(basename)
- return interface_name
-
-
-class IdlCompilerDart(IdlCompiler):
- def __init__(self, *args, **kwargs):
- IdlCompiler.__init__(self, *args, **kwargs)
-
- interfaces_info = self.interfaces_info
- self.output_directory = self.output_directory
-
- self.code_generator = CodeGeneratorDart(interfaces_info, 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,
- 'Dart%s.h' % interface_name)
- cpp_filename = os.path.join(self.output_directory,
- 'Dart%s.cpp' % interface_name)
- self.compile_and_write(idl_filename, (header_filename, cpp_filename))
-
- def generate_global(self, global_entries):
- expanded_global_entries = []
- for (directory, file_list_file) in global_entries:
- with open(file_list_file) as input_file:
- idl_file_list = sorted([line.rstrip('\n')
- for line in input_file])
- expanded_global_entries.append((directory, idl_file_list))
- global_header_filename = os.path.join(self.output_directory, 'DartWebkitClassIds.h')
- global_cpp_filename = os.path.join(self.output_directory, 'DartWebkitClassIds.cpp')
- self.generate_global_and_write(expanded_global_entries,
- (global_header_filename, global_cpp_filename))
-
- def generate_dart_blink(self, global_entries):
- global_dart_blink_filename = os.path.join(self.output_directory,
- '_blink_dartium.dart')
- expanded_global_entries = []
- for (directory, file_list_file, file_list_dictionary) in global_entries:
- with open(file_list_file) as input_file:
- idl_file_list = sorted([line.rstrip('\n')
- for line in input_file])
- with open(file_list_dictionary) as input_file:
- dictionary_file_list = sorted([line.rstrip('\n')
- for line in input_file])
- expanded_global_entries.append((directory, idl_file_list))
- expanded_global_entries.append((directory, dictionary_file_list))
- self.generate_dart_blink_and_write(expanded_global_entries,
- global_dart_blink_filename)
-
-
-def main():
- options, filename = parse_options()
- idl_compiler = IdlCompilerDart(options.output_directory,
- interfaces_info_filename=options.interfaces_info_file,
- only_if_changed=options.write_file_only_if_changed)
- if bool(options.global_entries):
- idl_compiler.generate_global(options.global_entries)
- elif bool(options.blink_global_entries):
- idl_compiler.generate_dart_blink(options.blink_global_entries)
- else:
- idl_compiler.compile_file(filename)
-
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/bindings/dart/scripts/dart_attributes.py b/bindings/dart/scripts/dart_attributes.py
deleted file mode 100644
index 4559a66..0000000
--- a/bindings/dart/scripts/dart_attributes.py
+++ /dev/null
@@ -1,300 +0,0 @@
-# Copyright (C) 2013 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.
-
-"""Generate template values for attributes.
-
-Extends IdlType with property |constructor_type_name|.
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-import idl_types
-from dart_interface import suppress_getter, suppress_setter
-import dart_types
-from dart_utilities import DartUtilities
-from v8_globals import interfaces
-
-import v8_attributes
-
-
-def attribute_context(interface, attribute):
- # Call v8's implementation.
- context = v8_attributes.attribute_context(interface, attribute)
-
- extended_attributes = attribute.extended_attributes
-
- # Augment's Dart's information to context.
- 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.name
-
- # [Custom]
- has_custom_getter = (('Custom' in extended_attributes and
- extended_attributes['Custom'] in [None, 'Getter']) or
- ('DartCustom' in extended_attributes and
- extended_attributes['DartCustom'] in [None, 'Getter', 'New']))
- has_custom_setter = (not attribute.is_read_only and
- (('Custom' in extended_attributes and
- extended_attributes['Custom'] in [None, 'Setter']) or
- ('DartCustom' in extended_attributes and
- extended_attributes['DartCustom'] in [None, 'Setter', 'New'])))
-
- is_call_with_script_state = DartUtilities.has_extended_attribute_value(attribute, 'CallWith', 'ScriptState')
-
- is_auto_scope = not 'DartNoAutoScope' in extended_attributes
-
- context.update({
- 'activity_logging_world_list_for_getter': DartUtilities.activity_logging_world_list(attribute, 'Getter'), # [ActivityLogging]
- 'activity_logging_world_list_for_setter': DartUtilities.activity_logging_world_list(attribute, 'Setter'), # [ActivityLogging]
- 'deprecate_as': DartUtilities.deprecate_as(attribute), # [DeprecateAs]
- 'has_custom_getter': has_custom_getter,
- 'has_custom_setter': has_custom_setter,
- 'is_auto_scope': is_auto_scope, # Used internally (outside of templates).
- 'is_call_with_script_state': is_call_with_script_state,
- 'auto_scope': DartUtilities.bool_to_cpp(is_auto_scope),
- 'measure_as': DartUtilities.measure_as(attribute), # [MeasureAs]
- 'v8_type': dart_types.v8_type(base_idl_type),
- })
-
- if v8_attributes.is_constructor_attribute(attribute):
- v8_attributes.constructor_getter_context(interface, attribute, context)
- return context
- if not v8_attributes.has_custom_getter(attribute):
- getter_context(interface, attribute, context)
- if (not attribute.is_read_only):
- # FIXME: We did not previously support the PutForwards attribute, so I am
- # disabling it here for now to get things compiling.
- # We may wish to revisit this.
- # if (not has_custom_setter(attribute) and
- # (not attribute.is_read_only or 'PutForwards' in extended_attributes)):
- setter_context(interface, attribute, context)
-
- native_entry_getter = \
- DartUtilities.generate_native_entry(
- interface.name, attribute.name, 'Getter', attribute.is_static, 0)
- native_entry_setter = \
- DartUtilities.generate_native_entry(
- interface.name, attribute.name, 'Setter', attribute.is_static, 1)
- context.update({
- 'native_entry_getter': native_entry_getter,
- 'native_entry_setter': native_entry_setter,
- })
-
- return context
-
-
-################################################################################
-# Getter
-################################################################################
-
-def getter_context(interface, attribute, context):
- v8_attributes.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, 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
- # exceptions), we need to use a local variable.
- # 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
- base_idl_type == 'EventHandler' or
- 'CachedAttribute' in extended_attributes or
- 'ReflectOnly' in extended_attributes or
- context['is_getter_raises_exception']):
- context['cpp_value_original'] = cpp_value
- cpp_value = 'result'
- # EventHandler has special handling
- if base_idl_type != 'EventHandler' and idl_type.is_interface_type:
- release = True
-
- dart_set_return_value = \
- idl_type.dart_set_return_value(cpp_value,
- extended_attributes=extended_attributes,
- script_wrappable='impl',
- release=release,
- for_main_world=False,
- auto_scope=context['is_auto_scope'])
-
- # TODO(terry): Should be able to eliminate suppress_getter as we move from
- # IGNORE_MEMBERS to DartSuppress in the IDL.
- suppress = (suppress_getter(interface.name, attribute.name) or
- DartUtilities.has_extended_attribute_value(attribute, 'DartSuppress', 'Getter'))
-
- context.update({
- 'cpp_value': cpp_value,
- 'dart_set_return_value': dart_set_return_value,
- 'is_getter_suppressed': suppress,
- })
-
-
-def getter_expression(interface, attribute, context):
- v8_attributes.getter_expression(interface, attribute, context)
-
- arguments = []
- this_getter_base_name = v8_attributes.getter_base_name(interface, attribute, arguments)
- getter_name = DartUtilities.scoped_name(interface, attribute, this_getter_base_name)
-
- arguments.extend(DartUtilities.call_with_arguments(
- attribute.extended_attributes.get('CallWith')))
- if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and
- not attribute.is_static):
- # Pass by reference.
- arguments.append('*receiver')
-
- if attribute.idl_type.is_explicit_nullable:
- arguments.append('isNull')
- if context['is_getter_raises_exception']:
- arguments.append('es')
- return '%s(%s)' % (getter_name, ', '.join(arguments))
-
-
-################################################################################
-# Setter
-################################################################################
-
-def setter_context(interface, attribute, context):
- v8_attributes.setter_context(interface, attribute, context)
-
- def target_attribute():
- target_interface_name = attribute.idl_type.base_type
- target_attribute_name = extended_attributes['PutForwards']
- target_interface = interfaces[target_interface_name]
- try:
- return next(attribute
- for attribute in target_interface.attributes
- if attribute.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
-
- if 'PutForwards' in extended_attributes:
- # Use target attribute in place of original attribute
- attribute = target_attribute()
- this_cpp_type = 'DartStringAdapter'
- else:
- this_cpp_type = context['cpp_type']
-
- idl_type = attribute.idl_type
-
- # TODO(terry): Should be able to eliminate suppress_setter as we move from
- # IGNORE_MEMBERS to DartSuppress in the IDL.
- suppress = (suppress_setter(interface.name, attribute.name) or
- DartUtilities.has_extended_attribute_value(attribute, 'DartSuppress', 'Setter'))
- context.update({
- 'has_setter_exception_state': (
- context['is_setter_raises_exception'] or context['has_type_checking_interface'] or
- idl_type.is_integer_type),
- '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, raw_type=True),
- 'dart_value_to_local_cpp_value':
- attribute.idl_type.dart_value_to_local_cpp_value(
- extended_attributes, attribute.name, False,
- context['has_type_checking_interface'], 1,
- context['is_auto_scope']),
- })
-
- # setter_expression() depends on context values we set above.
- context['cpp_setter'] = setter_expression(interface, attribute, context)
-
-
-def setter_expression(interface, attribute, context):
- extended_attributes = attribute.extended_attributes
- arguments = DartUtilities.call_with_arguments(
- extended_attributes.get('SetterCallWith') or
- extended_attributes.get('CallWith'))
-
- this_setter_base_name = v8_attributes.setter_base_name(interface, attribute, arguments)
- setter_name = DartUtilities.scoped_name(interface, attribute, this_setter_base_name)
-
- if ('PartialInterfaceImplementedAs' in extended_attributes and
- not attribute.is_static):
- arguments.append('*receiver')
- idl_type = attribute.idl_type
- if idl_type.base_type == 'EventHandler':
- getter_name = DartUtilities.scoped_name(interface, attribute, DartUtilities.cpp_name(attribute))
- context['event_handler_getter_expression'] = '%s(%s)' % (
- getter_name, ', '.join(arguments))
- # FIXME(vsm): Do we need to support this? If so, what's our analogue of
- # V8EventListenerList?
- arguments.append('nullptr')
- # if (interface.name in ['Window', 'WorkerGlobalScope'] and
- # attribute.name == 'onerror'):
- # includes.add('bindings/core/v8/V8ErrorHandler.h')
- # arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(jsValue, true, info.GetIsolate())')
- # else:
- # arguments.append('V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate)')
- else:
- attribute_name = dart_types.check_reserved_name(attribute.name)
- arguments.append(attribute_name)
- if context['is_setter_raises_exception']:
- arguments.append('es')
-
- return '%s(%s)' % (setter_name, ', '.join(arguments))
-
-
-################################################################################
-# Attribute configuration
-################################################################################
-
-# [Replaceable]
-def setter_callback_name(interface, attribute):
- cpp_class_name = DartUtilities.cpp_name(interface)
- extended_attributes = attribute.extended_attributes
- if (('Replaceable' in extended_attributes and
- 'PutForwards' not in extended_attributes) or
- v8_attributes.is_constructor_attribute(attribute)):
- # FIXME: rename to ForceSetAttributeOnThisCallback, since also used for Constructors
- return '{0}V8Internal::{0}ReplaceableAttributeSetterCallback'.format(cpp_class_name)
- # FIXME:disabling PutForwards for now since we didn't support it before
- # if attribute.is_read_only and 'PutForwards' not in extended_attributes:
- if attribute.is_read_only:
- return '0'
- return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribute.name)
-
-
-################################################################################
-# Constructors
-################################################################################
-
-idl_types.IdlType.constructor_type_name = property(
- # FIXME: replace this with a [ConstructorAttribute] extended attribute
- lambda self: DartUtilities.strip_suffix(self.base_type, 'Constructor'))
diff --git a/bindings/dart/scripts/dart_callback_interface.py b/bindings/dart/scripts/dart_callback_interface.py
deleted file mode 100644
index 266fb31..0000000
--- a/bindings/dart/scripts/dart_callback_interface.py
+++ /dev/null
@@ -1,134 +0,0 @@
-# Copyright (C) 2013 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.
-
-"""Generate template values for a callback interface.
-
-Extends IdlType with property |callback_cpp_type|.
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-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/core/dart/DartCallback.h',
- 'bindings/core/dart/DartDOMWrapper.h',
- 'bindings/core/v8/ActiveDOMCallback.h',
-])
-CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
- 'bindings/core/dart/DartBindingsCommonIncludes.h',
- 'wtf/GetPtr.h',
- 'wtf/RefPtr.h',
-])
-
-def cpp_type(idl_type):
- # FIXME: remove this function by making callback types consistent
- # (always use usual v8_types.cpp_type)
- idl_type_name = idl_type.name
- if idl_type_name == 'String':
- return 'const String&'
- if idl_type_name == 'void':
- return 'void'
- # 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
-
-IdlTypeBase.callback_cpp_type = property(cpp_type)
-
-
-def generate_callback_interface(callback_interface):
- includes.clear()
- includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
- name = callback_interface.name
-
- methods = [generate_method(operation)
- for operation in callback_interface.operations]
- template_contents = {
- 'conditional_string': DartUtilities.conditional_string(callback_interface),
- 'cpp_class': name,
- 'dart_class': dart_types.dart_type(callback_interface.name),
- 'v8_class': DartUtilities.v8_class_name(callback_interface),
- 'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
- 'methods': methods,
- }
- return template_contents
-
-
-def add_includes_for_operation(operation):
- operation.idl_type.add_includes_for_type()
- for argument in operation.arguments:
- argument.idl_type.add_includes_for_type()
-
-
-def generate_method(operation):
- extended_attributes = operation.extended_attributes
- idl_type = operation.idl_type
- idl_type_str = str(idl_type)
- if idl_type_str not in ['boolean', 'void']:
- raise Exception('We only support callbacks that return boolean or void values.')
- is_custom = 'Custom' in extended_attributes
- if not is_custom:
- add_includes_for_operation(operation)
- call_with = extended_attributes.get('CallWith')
- call_with_this_handle = DartUtilities.extended_attribute_value_contains(call_with, 'ThisValue')
- contents = {
- 'call_with_this_handle': call_with_this_handle,
- 'cpp_type': idl_type.callback_cpp_type,
- 'custom': is_custom,
- 'idl_type': idl_type_str,
- 'name': operation.name,
- }
- contents.update(generate_arguments_contents(operation.arguments, call_with_this_handle))
- return contents
-
-
-def generate_arguments_contents(arguments, call_with_this_handle):
- def generate_argument(argument):
- creation_context = ''
- if argument.idl_type.native_array_element_type is not None:
- creation_context = '<Dart%s>' % argument.idl_type.native_array_element_type
- return {
- 'handle': '%sHandle' % argument.name,
- 'cpp_value_to_dart_value': argument.idl_type.cpp_value_to_dart_value(argument.name,
- creation_context=creation_context),
- }
-
- argument_declarations = [
- '%s %s' % (argument.idl_type.callback_cpp_type, argument.name)
- for argument in arguments]
- if call_with_this_handle:
- argument_declarations.insert(0, 'ScriptValue thisValue')
- return {
- 'argument_declarations': argument_declarations,
- 'arguments': [generate_argument(argument) for argument in arguments],
- }
diff --git a/bindings/dart/scripts/dart_compiler.py b/bindings/dart/scripts/dart_compiler.py
deleted file mode 100755
index 84eb655..0000000
--- a/bindings/dart/scripts/dart_compiler.py
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/python
-# Copyright (C) 2013 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.
-
-"""Compile an .idl file to Blink C++ bindings (.h and .cpp files) for Dart:HTML.
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-import abc
-from optparse import OptionParser
-import os
-import cPickle as pickle
-
-from idl_reader import IdlReader
-from utilities import write_file, idl_filename_to_component
-
-
-# TODO(terry): Temporary whitelist of IDL files to skip code generating. e.g.,
-# adding 'Animation.idl' to this list will skip that IDL file.
-SKIP_IDL_FILES = ['']
-
-
-def parse_options():
- parser = OptionParser()
- parser.add_option('--idl-attributes-file',
- help="location of bindings/IDLExtendedAttributes.txt")
- parser.add_option('--output-directory')
- parser.add_option('--interfaces-info-file')
- parser.add_option('--write-file-only-if-changed', type='int')
- # ensure output comes last, so command line easy to parse via regexes
- parser.disable_interspersed_args()
-
- options, args = parser.parse_args()
- if options.output_directory is None:
- parser.error('Must specify output directory using --output-directory.')
- options.write_file_only_if_changed = bool(options.write_file_only_if_changed)
- if len(args) != 1:
- parser.error('Must specify exactly 1 input file as argument, but %d given.' % len(args))
- idl_filename = os.path.realpath(args[0])
- return options, idl_filename
-
-
-def idl_filename_to_interface_name(idl_filename):
- basename = os.path.basename(idl_filename)
- interface_name, _ = os.path.splitext(basename)
- return interface_name
-
-
-class IdlCompiler(object):
- """Abstract Base Class for IDL compilers.
-
- In concrete classes:
- * self.code_generator must be set, implementing generate_code()
- (returning a list of output code), and
- * compile_file() must be implemented (handling output filenames).
- """
- __metaclass__ = abc.ABCMeta
-
- def __init__(self, output_directory, code_generator=None,
- interfaces_info=None, interfaces_info_filename='',
- only_if_changed=False):
- """
- Args:
- interfaces_info:
- interfaces_info dict
- (avoids auxiliary file in run-bindings-tests)
- interfaces_info_file: filename of pickled interfaces_info
- """
- self.code_generator = code_generator
- if interfaces_info_filename:
- with open(interfaces_info_filename) as interfaces_info_file:
- interfaces_info = pickle.load(interfaces_info_file)
- self.interfaces_info = interfaces_info
-
- self.only_if_changed = only_if_changed
- self.output_directory = output_directory
- self.reader = IdlReader(interfaces_info, output_directory)
-
- def compile_and_write(self, idl_filename, output_filenames):
- interface_name = idl_filename_to_interface_name(idl_filename)
- idl_pickle_filename = os.path.join(self.output_directory,
- '%s_globals.pickle' % interface_name)
- definitions = self.reader.read_idl_definitions(idl_filename)
- component = idl_filename_to_component(idl_filename)
-
- output_code_list = self.code_generator.generate_code(definitions[component],
- interface_name,
- idl_pickle_filename,
- self.only_if_changed)
-
- # TODO(terry): Temporary to disable code generating an IDL.
- base_idl_filename = os.path.basename(idl_filename)
- if base_idl_filename in SKIP_IDL_FILES:
- print "----- Skipping %s -----" % base_idl_filename
- else:
- for output_code, output_filename in zip(output_code_list, output_filenames):
- write_file(output_code, output_filename, self.only_if_changed)
-
- def generate_global_and_write(self, global_entries, output_filenames):
- output_code_list = self.code_generator.generate_globals(global_entries)
- for output_code, output_filename in zip(output_code_list, output_filenames):
- write_file(output_code, output_filename, self.only_if_changed)
-
- def generate_dart_blink_and_write(self, global_entries, output_filename):
- output_code = self.code_generator.generate_dart_blink(global_entries)
- write_file(output_code, output_filename, self.only_if_changed)
-
- @abc.abstractmethod
- def compile_file(self, idl_filename):
- pass
diff --git a/bindings/dart/scripts/dart_dictionary.py b/bindings/dart/scripts/dart_dictionary.py
deleted file mode 100644
index 42a21ba..0000000
--- a/bindings/dart/scripts/dart_dictionary.py
+++ /dev/null
@@ -1,149 +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.
-
-"""Generate template contexts of dictionaries for both v8 bindings and
-implementation classes that are used by blink's core/modules.
-"""
-
-import operator
-from v8_globals import includes
-import dart_types
-from dart_utilities import DartUtilities
-
-
-DICTIONARY_H_INCLUDES = frozenset([
- 'bindings/core/v8/V8Binding.h',
- 'platform/heap/Handle.h',
-])
-
-DICTIONARY_CPP_INCLUDES = frozenset([
- 'bindings/common/ExceptionState.h',
- # FIXME: Remove this, http://crbug.com/321462
- 'bindings/core/v8/Dictionary.h',
-])
-
-
-def setter_name_for_dictionary_member(member):
- return 'set%s' % DartUtilities.capitalize(member.name)
-
-
-def has_method_name_for_dictionary_member(member):
- return 'has%s' % DartUtilities.capitalize(member.name)
-
-
-def unwrap_nullable_if_needed(idl_type):
- if idl_type.is_nullable:
- return idl_type.inner_type
- return idl_type
-
-
-# Context for Dart bindings
-
-def dictionary_context(dictionary):
- includes.clear()
- includes.update(DICTIONARY_CPP_INCLUDES)
- return {
- 'cpp_class': DartUtilities.cpp_name(dictionary),
- 'header_includes': set(DICTIONARY_H_INCLUDES),
- 'members': [member_context(member)
- for member in sorted(dictionary.members,
- key=operator.attrgetter('name'))],
- 'dart_class': dart_types.dart_type(dictionary.name),
-
- }
-
-
-def member_context(member):
- idl_type = member.idl_type
- idl_type.add_includes_for_type()
- idl_type = unwrap_nullable_if_needed(idl_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.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, dart_default_value = default_values()
-
- dart_enum_expression = idl_type.enum_validation_expression
- if dart_enum_expression:
- dart_enum_expression = dart_enum_expression.format(param_name='string')
-
- return {
- 'cpp_default_value': cpp_default_value,
- 'cpp_type': idl_type.cpp_type,
- 'cpp_value_to_dart_value': idl_type.cpp_value_to_dart_value(
- cpp_value='impl->%s()' % member.name,
- creation_context='creationContext',
- extended_attributes=member.extended_attributes),
- 'enum_validation_expression': dart_enum_expression,
- 'has_method_name': has_method_name_for_dictionary_member(member),
- 'is_object': idl_type.name == 'Object',
- 'name': member.name,
- 'setter_name': setter_name_for_dictionary_member(member),
- 'dart_default_value': dart_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': DartUtilities.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 = unwrap_nullable_if_needed(member.idl_type)
- is_object = idl_type.name == 'Object'
-
- 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_enum or idl_type.is_string_type:
- return '!m_%s.isNull()' % member.name
- elif is_object:
- return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(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 dart_types.cpp_template_type('Nullable', member_cpp_type)
- return member_cpp_type
-
- cpp_default_value = None
- if member.default_value and not member.default_value.is_null:
- cpp_default_value = str(member.default_value)
-
- header_includes.update(idl_type.impl_includes_for_type(interfaces_info))
- return {
- 'cpp_default_value': cpp_default_value,
- 'getter_expression': getter_expression(),
- 'has_method_expression': has_method_expression(),
- 'has_method_name': has_method_name_for_dictionary_member(member),
- 'is_object': is_object,
- '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/dart/scripts/dart_interface.py b/bindings/dart/scripts/dart_interface.py
deleted file mode 100644
index 1ab889b..0000000
--- a/bindings/dart/scripts/dart_interface.py
+++ /dev/null
@@ -1,1142 +0,0 @@
-# Copyright (C) 2013 Google Inc. All rights reserved.
-# coding=utf-8
-#
-# 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.
-
-"""Generate template values for an interface.
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-from collections import defaultdict
-import itertools
-from operator import itemgetter
-
-import idl_types
-from idl_types import IdlType, inherits_interface, IdlArrayOrSequenceType, IdlArrayType
-import dart_attributes
-import dart_methods
-import dart_types
-from dart_utilities import DartUtilities
-from v8_globals import includes
-import v8_attributes
-import v8_interface
-
-
-INTERFACE_H_INCLUDES = frozenset([
- 'bindings/core/dart/DartDOMWrapper.h',
- 'platform/heap/Handle.h',
-])
-
-INTERFACE_CPP_INCLUDES = frozenset([
-
- 'bindings/core/dart/DartUtilities.h',
- 'wtf/GetPtr.h',
- 'wtf/RefPtr.h',
-])
-
-
-# TODO(terry): Temporary to not generate a method, getter/setter. Format is:
-#
-# interface_name.method_name
-# interface_name.get:attribute_name
-# interface_name.set:attribute_name
-#
-# Ultimate solution add a special attribute flag to IDL to signal
-# don't generate IDL entry in Dart (e.g., DartNoGenerate)?
-IGNORE_MEMBERS = frozenset([
- 'AudioBufferSourceNode.looping', # TODO(vsm): Use deprecated IDL annotation
- 'CSSStyleDeclaration.getPropertyCSSValue',
- 'CanvasRenderingContext2D.clearShadow',
- 'CanvasRenderingContext2D.drawImageFromRect',
- 'CanvasRenderingContext2D.setAlpha',
- 'CanvasRenderingContext2D.setCompositeOperation',
- 'CanvasRenderingContext2D.setFillColor',
- 'CanvasRenderingContext2D.setLineCap',
- 'CanvasRenderingContext2D.setLineJoin',
- 'CanvasRenderingContext2D.setLineWidth',
- 'CanvasRenderingContext2D.setMiterLimit',
- 'CanvasRenderingContext2D.setShadow',
- 'CanvasRenderingContext2D.setStrokeColor',
- 'CharacterData.remove',
- 'Window.call:blur',
- 'Window.call:focus',
- 'Window.clientInformation',
- 'Window.createImageBitmap',
- 'Window.get:frames',
- 'Window.get:length',
- 'Window.on:beforeUnload',
- 'Window.on:webkitTransitionEnd',
- 'Window.pagePopupController',
- 'Window.prompt',
- 'Window.webkitCancelAnimationFrame',
- 'Window.webkitCancelRequestAnimationFrame',
- 'Window.webkitIndexedDB',
- 'Window.webkitRequestAnimationFrame',
- 'Document.alinkColor',
- 'HTMLDocument.all',
- 'Document.applets',
- 'Document.bgColor',
- 'Document.clear',
- 'Document.createAttribute',
- 'Document.createAttributeNS',
- 'Document.createComment',
- 'Document.createExpression',
- 'Document.createNSResolver',
- 'Document.createProcessingInstruction',
- 'Document.designMode',
- 'Document.dir',
- 'Document.evaluate',
- 'Document.fgColor',
- 'Document.get:URL',
- 'Document.get:anchors',
- 'Document.get:characterSet',
- 'Document.get:compatMode',
- 'Document.get:defaultCharset',
- 'Document.get:doctype',
- 'Document.get:documentURI',
- 'Document.get:embeds',
- 'Document.get:forms',
- 'Document.get:inputEncoding',
- 'Document.get:links',
- 'Document.get:plugins',
- 'Document.get:scripts',
- 'Document.get:xmlEncoding',
- 'Document.getElementsByTagNameNS',
- 'Document.getOverrideStyle',
- 'Document.getSelection',
- 'Document.images',
- 'Document.linkColor',
- 'Document.location',
- 'Document.on:wheel',
- 'Document.open',
- 'Document.register',
- 'Document.set:domain',
- 'Document.vlinkColor',
- 'Document.webkitCurrentFullScreenElement',
- 'Document.webkitFullScreenKeyboardInputAllowed',
- 'Document.write',
- 'Document.writeln',
- 'Document.xmlStandalone',
- 'Document.xmlVersion',
- 'DocumentFragment.children',
- 'DocumentType.*',
- 'DOMException.code',
- 'DOMException.ABORT_ERR',
- 'DOMException.DATA_CLONE_ERR',
- 'DOMException.DOMSTRING_SIZE_ERR',
- 'DOMException.HIERARCHY_REQUEST_ERR',
- 'DOMException.INDEX_SIZE_ERR',
- 'DOMException.INUSE_ATTRIBUTE_ERR',
- 'DOMException.INVALID_ACCESS_ERR',
- 'DOMException.INVALID_CHARACTER_ERR',
- 'DOMException.INVALID_MODIFICATION_ERR',
- 'DOMException.INVALID_NODE_TYPE_ERR',
- 'DOMException.INVALID_STATE_ERR',
- 'DOMException.NAMESPACE_ERR',
- 'DOMException.NETWORK_ERR',
- 'DOMException.NOT_FOUND_ERR',
- 'DOMException.NOT_SUPPORTED_ERR',
- 'DOMException.NO_DATA_ALLOWED_ERR',
- 'DOMException.NO_MODIFICATION_ALLOWED_ERR',
- 'DOMException.QUOTA_EXCEEDED_ERR',
- 'DOMException.SECURITY_ERR',
- 'DOMException.SYNTAX_ERR',
- 'DOMException.TIMEOUT_ERR',
- 'DOMException.TYPE_MISMATCH_ERR',
- 'DOMException.URL_MISMATCH_ERR',
- 'DOMException.VALIDATION_ERR',
- 'DOMException.WRONG_DOCUMENT_ERR',
- 'Element.accessKey',
- 'Element.dataset',
- 'Element.get:classList',
- 'Element.getAttributeNode',
- 'Element.getAttributeNodeNS',
- 'Element.getElementsByTagNameNS',
- 'Element.innerText',
- 'Element.on:wheel',
- 'Element.outerText',
- 'Element.removeAttributeNode',
- 'Element.set:outerHTML',
- 'Element.setAttributeNode',
- 'Element.setAttributeNodeNS',
- 'Element.webkitCreateShadowRoot',
- 'Element.webkitMatchesSelector',
- 'Element.webkitPseudo',
- 'Element.webkitShadowRoot',
- '=Event.returnValue', # Only suppress on Event, allow for BeforeUnloadEvent.
- 'Event.srcElement',
- 'EventSource.URL',
- 'FontFace.ready',
- 'FontFaceSet.load',
- 'FontFaceSet.ready',
- 'HTMLAnchorElement.charset',
- 'HTMLAnchorElement.coords',
- 'HTMLAnchorElement.rev',
- 'HTMLAnchorElement.shape',
- 'HTMLAnchorElement.text',
- 'HTMLAppletElement.*',
- 'HTMLAreaElement.noHref',
- 'HTMLBRElement.clear',
- 'HTMLBaseFontElement.*',
- 'HTMLBodyElement.aLink',
- 'HTMLBodyElement.background',
- 'HTMLBodyElement.bgColor',
- 'HTMLBodyElement.link',
- 'HTMLBodyElement.on:beforeUnload',
- 'HTMLBodyElement.text',
- 'HTMLBodyElement.vLink',
- 'HTMLDListElement.compact',
- 'HTMLDirectoryElement.*',
- 'HTMLDivElement.align',
- 'HTMLFontElement.*',
- 'HTMLFormControlsCollection.__getter__',
- 'HTMLFormElement.get:elements',
- 'HTMLFrameElement.*',
- 'HTMLFrameSetElement.*',
- 'HTMLHRElement.align',
- 'HTMLHRElement.noShade',
- 'HTMLHRElement.size',
- 'HTMLHRElement.width',
- 'HTMLHeadElement.profile',
- 'HTMLHeadingElement.align',
- 'HTMLHtmlElement.manifest',
- 'HTMLHtmlElement.version',
- 'HTMLIFrameElement.align',
- 'HTMLIFrameElement.frameBorder',
- 'HTMLIFrameElement.longDesc',
- 'HTMLIFrameElement.marginHeight',
- 'HTMLIFrameElement.marginWidth',
- 'HTMLIFrameElement.scrolling',
- 'HTMLImageElement.align',
- 'HTMLImageElement.hspace',
- 'HTMLImageElement.longDesc',
- 'HTMLImageElement.name',
- 'HTMLImageElement.vspace',
- 'HTMLInputElement.align',
- 'HTMLLegendElement.align',
- 'HTMLLinkElement.charset',
- 'HTMLLinkElement.rev',
- 'HTMLLinkElement.target',
- 'HTMLMarqueeElement.*',
- 'HTMLMenuElement.compact',
- 'HTMLMetaElement.scheme',
- 'HTMLOListElement.compact',
- 'HTMLObjectElement.align',
- 'HTMLObjectElement.archive',
- 'HTMLObjectElement.border',
- 'HTMLObjectElement.codeBase',
- 'HTMLObjectElement.codeType',
- 'HTMLObjectElement.declare',
- 'HTMLObjectElement.hspace',
- 'HTMLObjectElement.standby',
- 'HTMLObjectElement.vspace',
- 'HTMLOptionElement.text',
- 'HTMLOptionsCollection.*',
- 'HTMLParagraphElement.align',
- 'HTMLParamElement.type',
- 'HTMLParamElement.valueType',
- 'HTMLPreElement.width',
- 'HTMLScriptElement.text',
- 'HTMLSelectElement.options',
- 'HTMLSelectElement.selectedOptions',
- 'HTMLTableCaptionElement.align',
- 'HTMLTableCellElement.abbr',
- 'HTMLTableCellElement.align',
- 'HTMLTableCellElement.axis',
- 'HTMLTableCellElement.bgColor',
- 'HTMLTableCellElement.ch',
- 'HTMLTableCellElement.chOff',
- 'HTMLTableCellElement.height',
- 'HTMLTableCellElement.noWrap',
- 'HTMLTableCellElement.scope',
- 'HTMLTableCellElement.vAlign',
- 'HTMLTableCellElement.width',
- 'HTMLTableColElement.align',
- 'HTMLTableColElement.ch',
- 'HTMLTableColElement.chOff',
- 'HTMLTableColElement.vAlign',
- 'HTMLTableColElement.width',
- 'HTMLTableElement.align',
- 'HTMLTableElement.bgColor',
- 'HTMLTableElement.cellPadding',
- 'HTMLTableElement.cellSpacing',
- 'HTMLTableElement.frame',
- 'HTMLTableElement.rules',
- 'HTMLTableElement.summary',
- 'HTMLTableElement.width',
- 'HTMLTableRowElement.align',
- 'HTMLTableRowElement.bgColor',
- 'HTMLTableRowElement.ch',
- 'HTMLTableRowElement.chOff',
- 'HTMLTableRowElement.vAlign',
- 'HTMLTableSectionElement.align',
- 'HTMLTableSectionElement.ch',
- 'HTMLTableSectionElement.chOff',
- 'HTMLTableSectionElement.vAlign',
- 'HTMLTitleElement.text',
- 'HTMLUListElement.compact',
- 'HTMLUListElement.type',
- 'Location.valueOf',
- 'MessageEvent.ports',
- 'MessageEvent.webkitInitMessageEvent',
- 'MouseEvent.x',
- 'MouseEvent.y',
- 'Navigator.registerServiceWorker',
- 'Navigator.unregisterServiceWorker',
- 'Node.compareDocumentPosition',
- 'Node.get:DOCUMENT_POSITION_CONTAINED_BY',
- 'Node.get:DOCUMENT_POSITION_CONTAINS',
- 'Node.get:DOCUMENT_POSITION_DISCONNECTED',
- 'Node.get:DOCUMENT_POSITION_FOLLOWING',
- 'Node.get:DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
- 'Node.get:DOCUMENT_POSITION_PRECEDING',
- 'Node.get:prefix',
- 'Node.hasAttributes',
- 'Node.isDefaultNamespace',
- 'Node.isEqualNode',
- 'Node.isSameNode',
- 'Node.isSupported',
- 'Node.lookupNamespaceURI',
- 'Node.lookupPrefix',
- 'Node.normalize',
- 'Node.set:nodeValue',
- 'NodeFilter.acceptNode',
- 'NodeIterator.expandEntityReferences',
- 'NodeIterator.filter',
- 'Performance.webkitClearMarks',
- 'Performance.webkitClearMeasures',
- 'Performance.webkitGetEntries',
- 'Performance.webkitGetEntriesByName',
- 'Performance.webkitGetEntriesByType',
- 'Performance.webkitMark',
- 'Performance.webkitMeasure',
- 'ShadowRoot.getElementsByTagNameNS',
- 'SVGElement.getPresentationAttribute',
- 'SVGElementInstance.on:wheel',
- 'WheelEvent.wheelDelta',
- 'Window.on:wheel',
- 'WindowEventHandlers.on:beforeUnload',
- 'WorkerGlobalScope.webkitIndexedDB',
-# TODO(jacobr): should these be removed?
- 'Document.close',
- 'Document.hasFocus',
-])
-
-
-def _suppress_method(interface_name, name):
- name_to_find = '%s.%s' % (interface_name, name)
- wildcard_name_to_find = '%s.*' % interface_name
- return name_to_find in IGNORE_MEMBERS or wildcard_name_to_find in IGNORE_MEMBERS
-
-
-# Both getter and setter are to be suppressed then the attribute is completely
-# disappear.
-def _suppress_attribute(interface_name, name):
- return (suppress_getter(interface_name, name) and suppress_setter(interface_name, name))
-
-
-def suppress_getter(interface_name, name):
- name_to_find = '%s.get:%s' % (interface_name, name)
- wildcard_getter_to_find = '%s.get:*' % interface_name
- return (name_to_find in IGNORE_MEMBERS or
- _suppress_method(interface_name, name) or
- wildcard_getter_to_find in IGNORE_MEMBERS)
-
-
-def suppress_setter(interface_name, name):
- name_to_find = '%s.set:%s' % (interface_name, name)
- wildcard_setter_to_find = '%s.set:*' % interface_name
- return (name_to_find in IGNORE_MEMBERS or
- _suppress_method(interface_name, name) or
- wildcard_setter_to_find in IGNORE_MEMBERS)
-
-
-# To suppress an IDL method or attribute with a particular Extended Attribute
-# w/o a value e.g, DartStrictTypeChecking would be an empty set
-# 'DartStrictTypeChecking': frozenset([]),
-IGNORE_EXTENDED_ATTRIBUTES = {
-# 'RuntimeEnabled': frozenset(['ExperimentalCanvasFeatures']),
-}
-
-
-# Return True if the method / attribute should be suppressed.
-def _suppress_extended_attributes(extended_attributes):
- if 'DartSuppress' in extended_attributes and extended_attributes.get('DartSuppress') == None:
- return True
-
- # TODO(terry): Eliminate this using DartSuppress extended attribute in the
- # IDL files instead of the IGNORE_EXTENDED_ATTRIBUTES list.
- for extended_attribute_name in extended_attributes:
- ignore_extended_values = IGNORE_EXTENDED_ATTRIBUTES.get(extended_attribute_name)
- if ignore_extended_values != None:
- extended_attribute_value = extended_attributes.get(extended_attribute_name)
- if ((not ignore_extended_values and extended_attribute_value == None) or
- extended_attribute_value in ignore_extended_values):
- return True
- return False
-
-
-# TODO(terry): Rename genenerate_interface to interface_context.
-def interface_context(interface):
- context = v8_interface.interface_context(interface)
-
- includes.clear()
-
- includes.update(INTERFACE_CPP_INCLUDES)
- header_includes = set(INTERFACE_H_INCLUDES)
-
- parent_interface = interface.parent
- if parent_interface:
- header_includes.update(dart_types.includes_for_interface(parent_interface))
- extended_attributes = interface.extended_attributes
-
- is_document = inherits_interface(interface.name, 'Document')
- if is_document:
- # FIXME(vsm): We probably need bindings/dart/DartController and
- # core/frame/LocalFrame.h here.
- includes.update(['DartDocument.h'])
-
- if inherits_interface(interface.name, 'DataTransferItemList'):
- # FIXME(jacobr): this is a hack.
- includes.update(['core/html/HTMLCollection.h'])
-
-
- if inherits_interface(interface.name, 'EventTarget'):
- includes.update(['bindings/core/dart/DartEventListener.h'])
-
- # [SetWrapperReferenceTo]
- set_wrapper_reference_to_list = [{
- 'name': argument.name,
- # FIXME: properly should be:
- # '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 + '*',
- 'idl_type': argument.idl_type,
- 'v8_type': dart_types.v8_type(argument.idl_type.name),
- } for argument in extended_attributes.get('SetWrapperReferenceTo', [])]
- for set_wrapper_reference_to in set_wrapper_reference_to_list:
- set_wrapper_reference_to['idl_type'].add_includes_for_type()
-
- context.update({
- 'conditional_string': DartUtilities.conditional_string(interface), # [Conditional]
- 'cpp_class': DartUtilities.cpp_name(interface),
- 'header_includes': header_includes,
- 'is_garbage_collected': context['gc_type'] == 'GarbageCollectedObject',
- 'is_will_be_garbage_collected': context['gc_type'] == 'WillBeGarbageCollectedObject',
- 'measure_as': DartUtilities.measure_as(interface), # [MeasureAs]
- 'pass_cpp_type': dart_types.cpp_template_type(
- dart_types.cpp_ptr_type('PassRefPtr', 'RawPtr', context['gc_type']),
- DartUtilities.cpp_name(interface)),
- 'runtime_enabled_function': DartUtilities.runtime_enabled_function_name(interface), # [RuntimeEnabled]
- 'set_wrapper_reference_to_list': set_wrapper_reference_to_list,
- 'dart_class': dart_types.dart_type(interface.name),
- 'v8_class': DartUtilities.v8_class_name(interface),
- })
-
- # Constructors
- 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:
- context.update({'constructor_overloads': overloads_context(constructors)})
-
- # [CustomConstructor]
- custom_constructors = [custom_constructor_context(interface, constructor)
- for constructor in interface.custom_constructors]
-
- # [NamedConstructor]
- named_constructor = generate_named_constructor(interface)
-
- generate_method_native_entries(interface, constructors, 'Constructor')
- generate_method_native_entries(interface, custom_constructors, 'Constructor')
- if named_constructor:
- generate_method_native_entries(interface, [named_constructor],
- 'Constructor')
- event_constructor = None
- if context['has_event_constructor']:
- event_constructor = {
- 'native_entries': [
- DartUtilities.generate_native_entry(
- interface.name, None, 'Constructor', False, 2)],
- }
-
- if (context['constructors'] or custom_constructors or context['has_event_constructor'] or
- named_constructor):
- includes.add('core/frame/LocalDOMWindow.h')
-
- context.update({
- 'constructors': constructors,
- 'custom_constructors': custom_constructors,
- 'event_constructor': event_constructor,
- 'has_custom_constructor': bool(custom_constructors),
- 'interface_length':
- v8_interface.interface_length(interface, constructors + custom_constructors),
- 'is_constructor_call_with_document': DartUtilities.has_extended_attribute_value(
- interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWith=Document]
- 'is_constructor_call_with_execution_context': DartUtilities.has_extended_attribute_value(
- interface, 'ConstructorCallWith', 'ExecutionContext'), # [ConstructorCallWith=ExeuctionContext]
- 'named_constructor': named_constructor,
- })
-
- # Attributes
- attributes = [dart_attributes.attribute_context(interface, attribute)
- for attribute in interface.attributes
- # Skip attributes in the IGNORE_MEMBERS list or if an
- # extended attribute is in the IGNORE_EXTENDED_ATTRIBUTES.
- if (not _suppress_attribute(interface.name, attribute.name) and
- not v8_attributes.is_constructor_attribute(attribute) and
- not _suppress_extended_attributes(attribute.extended_attributes) and
- not ('DartSuppress' in attribute.extended_attributes and
- attribute.extended_attributes.get('DartSuppress') == None))]
- context.update({
- 'attributes': attributes,
- 'has_accessors': any(attribute['is_expose_js_accessors'] 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'])
- 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 = [dart_methods.method_context(interface, method)
- for method in interface.operations
- # Skip anonymous special operations (methods name empty).
- # Skip methods in our IGNORE_MEMBERS list.
- # Skip methods w/ extended attributes in IGNORE_EXTENDED_ATTRIBUTES list.
- if (method.name and
- # detect unnamed getters from v8_interface.
- method.name != 'anonymousNamedGetter' and
- # TODO(terry): Eventual eliminate the IGNORE_MEMBERS in favor of DartSupress.
- not _suppress_method(interface.name, method.name) and
- not _suppress_extended_attributes(method.extended_attributes) and
- not 'DartSuppress' in method.extended_attributes)]
- compute_method_overloads_context(methods)
- for method in methods:
- method['do_generate_method_configuration'] = (
- method['do_not_check_signature'] and
- not method['per_context_enabled_function'] and
- # For overloaded methods, only generate one accessor
- ('overload_index' not in method or method['overload_index'] == 1))
-
- generate_method_native_entries(interface, methods, 'Method')
-
- context.update({
- 'has_origin_safe_method_setter': any(
- method['is_check_security_for_frame'] and not method['is_read_only']
- for method in methods),
- 'has_method_configuration': any(method['do_generate_method_configuration'] for method in methods),
- 'has_per_context_enabled_methods': any(method['per_context_enabled_function'] for method in methods),
- 'methods': methods,
- })
-
- context.update({
- 'indexed_property_getter': indexed_property_getter(interface),
- 'indexed_property_setter': indexed_property_setter(interface),
- 'indexed_property_deleter': v8_interface.indexed_property_deleter(interface),
- 'is_override_builtins': 'OverrideBuiltins' in extended_attributes,
- 'named_property_getter': named_property_getter(interface),
- 'named_property_setter': named_property_setter(interface),
- 'named_property_deleter': v8_interface.named_property_deleter(interface),
- })
-
- generate_native_entries_for_specials(interface, context)
-
- native_entries = generate_interface_native_entries(context)
-
- context.update({
- 'native_entries': native_entries,
- })
-
- return context
-
-
-def generate_interface_native_entries(context):
- entries = {}
-
- def add(ne):
- entries[ne['blink_entry']] = ne
-
- def addAll(nes):
- for ne in nes:
- add(ne)
-
- for constructor in context['constructors']:
- addAll(constructor['native_entries'])
- for constructor in context['custom_constructors']:
- addAll(constructor['native_entries'])
- if context['named_constructor']:
- addAll(context['named_constructor']['native_entries'])
- if context['event_constructor']:
- addAll(context['event_constructor']['native_entries'])
- for method in context['methods']:
- addAll(method['native_entries'])
- for attribute in context['attributes']:
- add(attribute['native_entry_getter'])
- if not attribute['is_read_only'] or attribute['put_forwards']:
- add(attribute['native_entry_setter'])
- if context['indexed_property_getter']:
- addAll(context['indexed_property_getter']['native_entries'])
- if context['indexed_property_setter']:
- addAll(context['indexed_property_setter']['native_entries'])
- if context['indexed_property_deleter']:
- addAll(context['indexed_property_deleter']['native_entries'])
- if context['named_property_getter']:
- addAll(context['named_property_getter']['native_entries'])
- if context['named_property_setter']:
- addAll(context['named_property_setter']['native_entries'])
- if context['named_property_deleter']:
- addAll(context['named_property_deleter']['native_entries'])
- return list(entries.values())
-
-
-def generate_method_native_entry(interface, method, count, kind):
- name = method.get('name')
- is_static = bool(method.get('is_static'))
- native_entry = \
- DartUtilities.generate_native_entry(interface.name, name,
- kind, is_static, count)
- return native_entry
-
-
-def generate_method_native_entries(interface, methods, kind):
- for method in methods:
- native_entries = []
- arg_count = method['number_of_arguments']
- min_arg_count = method['number_of_required_arguments']
- lb = min_arg_count - 2 if min_arg_count > 2 else 0
- for x in range(lb, arg_count + 3):
- native_entry = \
- generate_method_native_entry(interface, method, x, kind)
- native_entries.append(native_entry)
-
- method.update({'native_entries': native_entries})
-
-
-################################################################################
-# Overloads
-################################################################################
-
-def compute_method_overloads_context(methods):
- # Regular methods
- compute_method_overloads_context_by_type([method for method in methods
- if not method['is_static']])
- # Static methods
- compute_method_overloads_context_by_type([method for method in methods
- if method['is_static']])
-
-
-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.
- Modifies |method| in place for |method| in |methods|.
- Doesn't change the |methods| list itself (only the values, i.e. individual
- methods), so ok to treat these separately.
- """
- # Add overload information only to overloaded methods, so template code can
- # easily verify if a function is overloaded
- for name, overloads in v8_interface.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'] = overloads_context(overloads)
- overloads[-1]['overloads']['name'] = name
-
-
-def overloads_context(overloads):
- """Returns |overloads| template values for a single name.
-
- Sets |method.overload_index| in place for |method| in |overloads|
- and returns dict of overall overload template values.
- """
- assert len(overloads) > 1 # only apply to overloaded names
- for index, method in enumerate(overloads, 1):
- method['overload_index'] = index
-
- effective_overloads_by_length = v8_interface.effective_overload_set_by_length(overloads)
- lengths = [length for length, _ in effective_overloads_by_length]
- name = overloads[0].get('name', '<constructor>')
-
- # Check and fail if all overloads with the shortest acceptable arguments
- # list are runtime enabled, since we would otherwise set 'length' on the
- # function object to an incorrect value when none of those overloads were
- # actually enabled at runtime. The exception is if all overloads are
- # controlled by the same runtime enabled feature, in which case there would
- # be no function object at all if it is not enabled.
- shortest_overloads = effective_overloads_by_length[0][1]
- if (all(method.get('runtime_enabled_function')
- for method, _, _ in shortest_overloads) and
- not v8_interface.common_value(overloads, 'runtime_enabled_function')):
- raise ValueError('Function.length of %s depends on runtime enabled features' % name)
-
- return {
- 'deprecate_all_as': v8_interface.common_value(overloads, 'deprecate_as'), # [DeprecateAs]
- 'exposed_test_all': v8_interface.common_value(overloads, 'exposed_test'), # [Exposed]
- 'length_tests_methods': length_tests_methods(effective_overloads_by_length),
- # 1. Let maxarg be the length of the longest type list of the
- # entries in S.
- 'maxarg': lengths[-1],
- 'measure_all_as': v8_interface.common_value(overloads, 'measure_as'), # [MeasureAs]
- 'minarg': lengths[0],
- 'per_context_enabled_function_all': v8_interface.common_value(overloads, 'per_context_enabled_function'), # [PerContextEnabled]
- 'runtime_enabled_function_all': v8_interface.common_value(overloads, 'runtime_enabled_function'), # [RuntimeEnabled]
- 'valid_arities': lengths
- # Only need to report valid arities if there is a gap in the
- # sequence of possible lengths, otherwise invalid length means
- # "not enough arguments".
- if lengths[-1] - lengths[0] != len(lengths) - 1 else None,
- }
-
-
-def length_tests_methods(effective_overloads_by_length):
- """Returns sorted list of resolution tests and associated methods, by length.
-
- This builds the main data structure for the overload resolution loop.
- For a given argument length, bindings test argument at distinguishing
- argument index, in order given by spec: if it is compatible with
- (optionality or) type required by an overloaded method, resolve to that
- method.
-
- Returns:
- [(length, [(test, method)])]
- """
- return [(length, list(resolution_tests_methods(effective_overloads)))
- for length, effective_overloads in effective_overloads_by_length]
-
-
-DART_CHECK_TYPE = {
- 'ArrayBufferView': 'Dart_IsTypedData({cpp_value})',
- 'ArrayBuffer': 'Dart_IsByteBuffer({cpp_value})',
- 'Uint8Array': 'DartUtilities::isUint8Array({cpp_value})',
- 'Uint8ClampedArray': 'DartUtilities::isUint8ClampedArray({cpp_value})',
-}
-
-
-def resolution_tests_methods(effective_overloads):
- """Yields resolution test and associated method, in resolution order, for effective overloads of a given length.
-
- This is the heart of the resolution algorithm.
- http://heycam.github.io/webidl/#dfn-overload-resolution-algorithm
-
- Note that a given method can be listed multiple times, with different tests!
- This is to handle implicit type conversion.
-
- Returns:
- [(test, method)]
- """
- methods = [effective_overload[0]
- for effective_overload in effective_overloads]
- if len(methods) == 1:
- # If only one method with a given length, no test needed
- yield 'true', methods[0]
- return
-
- # 6. If there is more than one entry in S, then set d to be the
- # distinguishing argument index for the entries of S.
- index = v8_interface.distinguishing_argument_index(effective_overloads)
- # (7-9 are for handling |undefined| values for optional arguments before
- # the distinguishing argument (as "missing"), so you can specify only some
- # optional arguments. We don't support this, so we skip these steps.)
- # 10. If i = d, then:
- # (d is the distinguishing argument index)
- # 1. Let V be argi.
- # Note: This is the argument that will be used to resolve which
- # overload is selected.
- cpp_value = 'Dart_GetNativeArgument(args, %s + argOffset)' % index
-
- # Extract argument and IDL type to simplify accessing these in each loop.
- arguments = [method['arguments'][index] for method in methods]
- arguments_methods = zip(arguments, methods)
- idl_types = [argument['idl_type_object'] for argument in arguments]
- idl_types_methods = zip(idl_types, methods)
-
- # We can't do a single loop through all methods or simply sort them, because
- # a method may be listed in multiple steps of the resolution algorithm, and
- # which test to apply differs depending on the step.
- #
- # Instead, we need to go through all methods at each step, either finding
- # first match (if only one test is allowed) or filtering to matches (if
- # multiple tests are allowed), and generating an appropriate tests.
-
- # 2. If V is undefined, and there is an entry in S whose list of
- # optionality values has "optional" at index i, then remove from S all
- # other entries.
- try:
- method = next(method for argument, method in arguments_methods
- if argument['is_optional'])
- test = 'Dart_IsNull(%s)' % cpp_value
- yield test, method
- except StopIteration:
- pass
-
- # 3. Otherwise: if V is null or undefined, and there is an entry in S that
- # has one of the following types at position i of its type list,
- # - a nullable type
- try:
- method = next(method for idl_type, method in idl_types_methods
- if idl_type.is_nullable)
- test = 'Dart_IsNull(%s)' % cpp_value
- yield test, method
- except StopIteration:
- pass
-
- # 4. Otherwise: if V is a platform object - but not a platform array
- # object - and there is an entry in S that has one of the following
- # types at position i of its type list,
- # - an interface type that V implements
- # (Unlike most of these tests, this can return multiple methods, since we
- # test if it implements an interface. Thus we need a for loop, not a next.)
- # (We distinguish wrapper types from built-in interface types.)
- for idl_type, method in ((idl_type, method)
- for idl_type, method in idl_types_methods
- if idl_type.is_wrapper_type):
- fmtstr = 'Dart{idl_type}::hasInstance({cpp_value})'
- if idl_type.base_type in DART_CHECK_TYPE:
- fmtstr = DART_CHECK_TYPE[idl_type.base_type]
- test = fmtstr.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,
- # a native RegExp object, and there is an entry in S that has one of the
- # following types at position i of its type list,
- # - an array type
- # - a sequence type
- # ...
- # - a dictionary
- try:
- # FIXME: IDL dictionary not implemented, so use Blink Dictionary
- # http://crbug.com/321462
- idl_type, method = next((idl_type, method)
- for idl_type, method in idl_types_methods
- if (idl_type.native_array_element_type or
- idl_type.name == 'Dictionary'))
- 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
- test = 'Dart_IsList(%s)' % cpp_value
- else:
- # FIXME: should be '{1}->IsObject() && !{1}->IsDate() && !{1}->IsRegExp()'.format(cpp_value)
- # FIXME: the IsDate and IsRegExp checks can be skipped if we've
- # already generated tests for them.
- test = 'Dart_IsInstance(%s)' % cpp_value
- yield test, method
- except StopIteration:
- pass
-
- # (Check for exact type matches before performing automatic type conversion;
- # 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.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
- # list,
- # - a numeric type
- try:
- method = next(method for idl_type, method in idl_types_methods
- if idl_type.is_numeric_type)
- test = 'Dart_IsNumber(%s)' % cpp_value
- yield test, method
- except StopIteration:
- pass
-
- # (Perform automatic type conversion, in order. If any of these match,
- # that's the end, and no other tests are needed.) To keep this code simple,
- # we rely on the C++ compiler's dead code elimination to deal with the
- # redundancy if both cases below trigger.
-
- # 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
- try:
- method = next(method for idl_type, method in idl_types_methods
- if idl_type.is_string_type or idl_type.is_enum)
- yield 'true', method
- except StopIteration:
- pass
-
- # 12. Otherwise: if there is an entry in S that has one of the following
- # types at position i of its type list,
- # - a numeric type
- try:
- method = next(method for idl_type, method in idl_types_methods
- if idl_type.is_numeric_type)
- yield 'true', method
- except StopIteration:
- pass
-
-
-################################################################################
-# Constructors
-################################################################################
-
-# [Constructor]
-def custom_constructor_context(interface, constructor):
- return {
- 'arguments': [custom_constructor_argument(argument, index)
- for index, argument in enumerate(constructor.arguments)],
- 'auto_scope': 'true',
- 'is_auto_scope': True,
- 'is_call_with_script_arguments': False,
- 'is_custom': True,
- 'number_of_arguments': len(constructor.arguments),
- 'number_of_required_arguments':
- v8_interface.number_of_required_arguments(constructor),
- }
-
-
-# We don't need much from this - just the idl_type_objects and preproceed_type
-# to use in generating the resolver strings.
-def custom_constructor_argument(argument, index):
- return {
- 'idl_type_object': argument.idl_type,
- 'name': argument.name,
- 'preprocessed_type': str(argument.idl_type.preprocessed_type),
- }
-
-
-# [Constructor]
-def constructor_context(interface, constructor):
- return {
- 'arguments': [dart_methods.argument_context(interface, constructor, argument, index)
- for index, argument in enumerate(constructor.arguments)],
- 'auto_scope': 'true',
- 'cpp_value': dart_methods.cpp_value(
- interface, constructor, len(constructor.arguments)),
- 'has_exception_state':
- # [RaisesException=Constructor]
- interface.extended_attributes.get('RaisesException') == 'Constructor' or
- any(argument for argument in constructor.arguments
- if argument.idl_type.name == 'SerializedScriptValue' or
- argument.idl_type.is_integer_type),
- 'is_auto_scope': True,
- 'is_call_with_script_arguments': False,
- 'is_constructor': True,
- 'is_custom': False,
- 'is_variadic': False, # Required for overload resolution
- 'number_of_required_arguments':
- v8_interface.number_of_required_arguments(constructor),
- 'number_of_arguments': len(constructor.arguments),
- }
-
-
-# [NamedConstructor]
-def generate_named_constructor(interface):
- extended_attributes = interface.extended_attributes
- if 'NamedConstructor' not in extended_attributes:
- return None
- # FIXME: parser should return named constructor separately;
- # included in constructors (and only name stored in extended attribute)
- # for Perl compatibility
- idl_constructor = interface.constructors[0]
- constructor = constructor_context(interface, idl_constructor)
- # FIXME(vsm): We drop the name. We don't use this in Dart APIs right now.
- # We probably need to encode this somehow to deal with conflicts.
- # constructor['name'] = extended_attributes['NamedConstructor']
- return constructor
-
-
-################################################################################
-# Special operations (methods)
-# http://heycam.github.io/webidl/#idl-special-operations
-################################################################################
-
-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))
- if idl_type.name == 'String':
- # FIXME(vsm): This looks V8 specific.
- return 'result.isNull()'
- if idl_type.is_interface_type:
- return '!result'
- return ''
-
- context = v8_interface.property_getter(getter, [])
-
- idl_type = getter.idl_type
- extended_attributes = getter.extended_attributes
- is_raises_exception = 'RaisesException' in extended_attributes
-
- # FIXME: make more generic, so can use dart_methods.cpp_value
- cpp_method_name = 'receiver->%s' % DartUtilities.cpp_name(getter)
-
- if is_raises_exception:
- cpp_arguments.append('es')
- union_arguments = idl_type.union_arguments
- if 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))
-
- context.update({
- 'cpp_type': idl_type.cpp_type,
- 'cpp_value': cpp_value,
- 'is_null_expression': is_null_expression(idl_type),
- 'is_raises_exception': is_raises_exception,
- 'name': DartUtilities.cpp_name(getter),
- 'union_arguments': union_arguments,
- 'dart_set_return_value': idl_type.dart_set_return_value('result',
- extended_attributes=extended_attributes,
- script_wrappable='receiver',
- release=idl_type.release)})
- return context
-
-
-def property_setter(setter):
- context = v8_interface.property_setter(setter)
-
- idl_type = setter.arguments[1].idl_type
- extended_attributes = setter.extended_attributes
-
- context.update({
- 'dart_value_to_local_cpp_value': idl_type.dart_value_to_local_cpp_value(
- extended_attributes, 'propertyValue', False,
- context['has_type_checking_interface']),
- })
-
- return context
-
-
-################################################################################
-# Indexed properties
-# http://heycam.github.io/webidl/#idl-indexed-properties
-################################################################################
-
-def indexed_property_getter(interface):
- try:
- # Find indexed property getter, if present; has form:
- # getter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1)
- getter = next(
- method
- for method in interface.operations
- if ('getter' in method.specials and
- len(method.arguments) == 1 and
- str(method.arguments[0].idl_type) == 'unsigned long'))
- except StopIteration:
- return None
-
- getter.name = getter.name or 'anonymousIndexedGetter'
-
- return property_getter(getter, ['index'])
-
-
-def indexed_property_setter(interface):
- try:
- # Find indexed property setter, if present; has form:
- # setter RETURN_TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1, ARG_TYPE ARG2)
- setter = next(
- method
- for method in interface.operations
- if ('setter' in method.specials and
- len(method.arguments) == 2 and
- str(method.arguments[0].idl_type) == 'unsigned long'))
- except StopIteration:
- return None
-
- return property_setter(setter)
-
-
-################################################################################
-# Named properties
-# http://heycam.github.io/webidl/#idl-named-properties
-################################################################################
-
-def named_property_getter(interface):
- try:
- # Find named property getter, if present; has form:
- # getter TYPE [OPTIONAL_IDENTIFIER](DOMString ARG1)
- getter = next(
- method
- for method in interface.operations
- if ('getter' in method.specials and
- len(method.arguments) == 1 and
- str(method.arguments[0].idl_type) == 'DOMString'))
- except StopIteration:
- return None
-
- getter.name = getter.name or 'anonymousNamedGetter'
-
- return property_getter(getter, ['propertyName'])
-
-
-def named_property_setter(interface):
- try:
- # Find named property setter, if present; has form:
- # setter RETURN_TYPE [OPTIONAL_IDENTIFIER](DOMString ARG1, ARG_TYPE ARG2)
- setter = next(
- method
- for method in interface.operations
- if ('setter' in method.specials and
- len(method.arguments) == 2 and
- str(method.arguments[0].idl_type) == 'DOMString'))
- except StopIteration:
- return None
-
- return property_setter(setter)
-
-
-def generate_native_entries_for_specials(interface, context):
- def add(prop, name, arity):
- if context[prop]:
- if 'native_entries' not in context[prop]:
- context[prop].update({'native_entries': []})
- context[prop]['native_entries'].append(
- DartUtilities.generate_native_entry(
- interface.name, name, 'Method', False, arity))
-
- pre = ['indexed_property', 'named_property']
- post = [('setter', '__setter__', 2),
- ('getter', '__getter__', 1),
- ('deleter', '__delete__', 1),
- ]
- props = [(p1 + "_" + p2, name, arity)
- for (p1, (p2, name, arity)) in itertools.product(pre, post)]
- for t in props:
- add(*t)
-
- for (p, name, arity) in props:
- if context[p]:
- if context[p].get('is_custom_property_query'):
- add(p, '__propertyQuery__', 1)
diff --git a/bindings/dart/scripts/dart_methods.py b/bindings/dart/scripts/dart_methods.py
deleted file mode 100644
index b700e89..0000000
--- a/bindings/dart/scripts/dart_methods.py
+++ /dev/null
@@ -1,286 +0,0 @@
-# Copyright (C) 2013 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.
-
-"""Generate template values for methods.
-
-Extends IdlType and IdlUnionType with property |union_arguments|.
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-from idl_types import inherits_interface
-import dart_types
-from dart_utilities import DartUtilities
-from v8_globals import includes
-
-import v8_methods
-
-
-def method_context(interface, method):
- context = v8_methods.method_context(interface, method)
-
- arguments = method.arguments
- extended_attributes = method.extended_attributes
- idl_type = method.idl_type
-
-# idl_type.add_includes_for_type()
- this_cpp_value = cpp_value(interface, method, len(arguments))
-
- if context['is_call_with_script_state']:
- includes.add('bindings/core/dart/DartScriptState.h')
-
- 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
-
- is_auto_scope = not 'DartNoAutoScope' in extended_attributes
-
- arguments_data = [argument_context(interface, method, argument, index)
- for index, argument in enumerate(arguments)]
-
- union_arguments = []
- if idl_type.union_arguments:
- union_arguments.extend([union_arg['cpp_value']
- for union_arg in idl_type.union_arguments])
-
- is_custom = 'Custom' in extended_attributes or 'DartCustom' in extended_attributes
-
- context.update({
- 'activity_logging_world_list': DartUtilities.activity_logging_world_list(method), # [ActivityLogging]
- 'arguments': arguments_data,
- 'cpp_type': this_cpp_type,
- 'cpp_value': this_cpp_value,
- 'dart_name': extended_attributes.get('DartName'),
- 'deprecate_as': DartUtilities.deprecate_as(method), # [DeprecateAs]
- 'do_not_check_signature': not(context['is_static'] or
- DartUtilities.has_extended_attribute(method,
- ['DoNotCheckSecurity', 'DoNotCheckSignature', 'NotEnumerable',
- 'ReadOnly', 'RuntimeEnabled', 'Unforgeable'])),
- 'has_exception_state':
- context['is_raises_exception'] or
- context['is_check_security_for_frame'] or
- any(argument for argument in arguments
- if argument.idl_type.name == 'SerializedScriptValue' or
- argument.idl_type.is_integer_type),
- 'is_auto_scope': is_auto_scope,
- 'auto_scope': DartUtilities.bool_to_cpp(is_auto_scope),
- 'is_custom': is_custom,
- 'is_custom_dart': 'DartCustom' in extended_attributes,
- 'is_custom_dart_new': DartUtilities.has_extended_attribute_value(method, 'DartCustom', 'New'),
- # FIXME(terry): DartStrictTypeChecking no longer supported; TypeChecking is
- # new extended attribute.
- 'is_strict_type_checking':
- 'DartStrictTypeChecking' in extended_attributes or
- 'DartStrictTypeChecking' in interface.extended_attributes,
- 'measure_as': DartUtilities.measure_as(method), # [MeasureAs]
- 'suppressed': (arguments and arguments[-1].is_variadic), # FIXME: implement variadic
- 'union_arguments': union_arguments,
- 'dart_set_return_value': dart_set_return_value(interface.name, method, this_cpp_value),
- })
- return context
-
-def argument_context(interface, method, argument, index):
- context = v8_methods.argument_context(interface, method, argument, index)
-
- extended_attributes = argument.extended_attributes
- idl_type = argument.idl_type
- this_cpp_value = cpp_value(interface, method, index)
- use_heap_vector_type = context['is_variadic_wrapper_type'] and idl_type.is_will_be_garbage_collected
- auto_scope = not 'DartNoAutoScope' in extended_attributes
- arg_index = index + 1 if not (method.is_static or method.is_constructor) else index
- preprocessed_type = str(idl_type.preprocessed_type)
- local_cpp_type = idl_type.cpp_type_args(argument.extended_attributes, raw_type=True)
- default_value = argument.default_cpp_value
- if context['has_default']:
- default_value = (argument.default_cpp_value or
- dart_types.default_cpp_value_for_cpp_type(idl_type))
- # FIXMEDART: handle the drift between preprocessed type names in 1847 and
- # 1985 dartium builds in a more generic way.
- if preprocessed_type == 'unrestricted float':
- preprocessed_type = 'float'
- if preprocessed_type == 'unrestricted double':
- preprocessed_type = 'double'
-
- dart_enum_expression = idl_type.enum_validation_expression
- if dart_enum_expression:
- dart_enum_expression = dart_enum_expression.format(param_name=argument.name)
- context.update({
- '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': local_cpp_type,
- # FIXME: check that the default value's type is compatible with the argument's
- 'default_value': default_value,
- 'enum_validation_expression': dart_enum_expression,
- 'preprocessed_type': preprocessed_type,
- 'is_array_or_sequence_type': not not idl_type.native_array_element_type,
- 'is_strict_type_checking': 'DartStrictTypeChecking' in extended_attributes,
- 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictionary',
- 'vector_type': 'WillBeHeapVector' if use_heap_vector_type else 'Vector',
- 'dart_set_return_value_for_main_world': dart_set_return_value(interface.name, method,
- this_cpp_value, for_main_world=True),
- 'dart_set_return_value': dart_set_return_value(interface.name, method, this_cpp_value),
- 'arg_index': arg_index,
- 'dart_value_dictionary_cpp_value': dart_dictionary_value_argument(argument, arg_index),
- 'dart_value_to_local_cpp_value': dart_value_to_local_cpp_value(interface,
- context['has_type_checking_interface'],
- argument, arg_index, auto_scope),
- })
- return context
-
-
-################################################################################
-# Value handling
-################################################################################
-
-def cpp_value(interface, method, number_of_arguments):
- 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:
- return '%s.get()' % argument_name
-
- if idl_type.name == 'EventListener':
- if (interface.name == 'EventTarget' and
- method.name == 'removeEventListener'):
- # FIXME: remove this special case by moving get() into
- # EventTarget::removeEventListener
- return '%s.get()' % argument_name
- return argument.name
- if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull',
- 'XPathNSResolver', 'XPathNSResolverOrNull']):
- # FIXME: remove this special case
- return '%s.release()' % argument_name
- # Need to de-ref the generated dictionary class for create call.
- if (idl_type.is_dictionary):
- return '*%s' % argument_name
- return argument_name
-
- # Truncate omitted optional arguments
- arguments = method.arguments[:number_of_arguments]
- if method.is_constructor:
- call_with_values = interface.extended_attributes.get('ConstructorCallWith')
- else:
- call_with_values = method.extended_attributes.get('CallWith')
- cpp_arguments = DartUtilities.call_with_arguments(call_with_values)
- if ('PartialInterfaceImplementedAs' in method.extended_attributes and not method.is_static):
- cpp_arguments.append('*receiver')
-
- 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([member_argument['cpp_value']
- for member_argument in this_union_arguments])
-
- if ('RaisesException' in method.extended_attributes or
- (method.is_constructor and
- DartUtilities.has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
- cpp_arguments.append('es')
-
- if method.name == 'Constructor':
- base_name = 'create'
- elif method.name == 'NamedConstructor':
- base_name = 'createForJSConstructor'
- else:
- base_name = DartUtilities.cpp_name(method)
- cpp_method_name = DartUtilities.scoped_name(interface, method, base_name)
- return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
-
-
-# Mapping of IDL type to DartUtilities helper types.
-def dart_arg_type(argument_type):
- if (argument_type.cpp_type == 'String'):
- return 'DartStringAdapter'
-
- return argument_type.cpp_type
-
-
-def dart_set_return_value(interface_name, method, cpp_value, for_main_world=False):
- idl_type = method.idl_type
- extended_attributes = method.extended_attributes
- if not idl_type or idl_type.name == 'void':
- # Constructors and void methods don't have a return type
- return None
-
- release = False
-
- if idl_type.is_union_type:
- release = idl_type.release
-
- # [CallWith=ScriptState], [RaisesException]
-# TODO(terry): Disable ScriptState temporarily need to handle.
-# 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
-# release = idl_type.release
-
- auto_scope = not 'DartNoAutoScope' in extended_attributes
- script_wrappable = 'impl' if inherits_interface(interface_name, 'Node') else ''
- return idl_type.dart_set_return_value(cpp_value, extended_attributes,
- script_wrappable=script_wrappable,
- release=release,
- for_main_world=for_main_world,
- auto_scope=auto_scope)
-
-
-def dart_dictionary_value_argument(argument, index):
- idl_type = argument.idl_type
- return idl_type.dart_dictionary_to_local_cpp_value(index=index)
-
-
-def dart_value_to_local_cpp_value(interface, has_type_checking_interface,
- argument, index, auto_scope=True):
- extended_attributes = argument.extended_attributes
- idl_type = argument.idl_type
- name = argument.name
- # TODO(terry): Variadic arguments are not handled but treated as one argument.
- # if argument.is_variadic:
- # vector_type = 'WillBeHeapVector' if idl_type.is_will_be_garbage_collected else 'Vector'
- # return 'V8TRYCATCH_VOID({vector_type}<{cpp_type}>, {name}, toNativeArguments<{cpp_type}>(info, {index}))'.format(
- # cpp_type=idl_type.cpp_type, name=name, index=index, vector_type=vector_type)
-
- # FIXME: V8 has some special logic around the addEventListener and
- # removeEventListener methods that should be added in somewhere.
- # There is also some logic in systemnative.py to force a null check
- # for the useCapture argument of those same methods that we may need to
- # pull over.
- null_check = ((argument.is_optional and idl_type.is_callback_interface) or
- (idl_type.name == 'Dictionary') or
- (argument.default_value and argument.default_value.is_null))
-
- return idl_type.dart_value_to_local_cpp_value(
- extended_attributes, name, null_check, has_type_checking_interface,
- index=index, auto_scope=auto_scope)
diff --git a/bindings/dart/scripts/dart_tests.py b/bindings/dart/scripts/dart_tests.py
deleted file mode 100644
index f0ad19b..0000000
--- a/bindings/dart/scripts/dart_tests.py
+++ /dev/null
@@ -1,278 +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:
-# 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
-#
-
-import fnmatch
-import os
-import shutil
-import sys
-import tempfile
-
-from webkitpy.common.checkout.scm.detection import detect_scm_system
-from webkitpy.common.system import executive
-from webkitpy.common.system.executive import ScriptError
-
-# Add Source path to PYTHONPATH to support function calls to bindings/scripts
-# for compute_dependencies and idl_compiler
-module_path = os.path.dirname(__file__)
-source_path = os.path.normpath(os.path.join(module_path, os.pardir,
- os.pardir, os.pardir, os.pardir,
- 'Source'))
-sys.path.append(source_path)
-
-from bindings.scripts.compute_interfaces_info import compute_interfaces_info, interfaces_info
-from bindings.scripts.idl_compiler import IdlCompilerV8
-
-
-PASS_MESSAGE = 'All tests PASS!'
-FAIL_MESSAGE = """Some tests FAIL!
-To update the reference files, execute:
- run-bindings-tests --reset-results
-
-If the failures are not due to your changes, test results may be out of sync;
-please rebaseline them in a separate CL, after checking that tests fail in ToT.
-In CL, please set:
-NOTRY=true
-TBR=(someone in Source/bindings/OWNERS or WATCHLISTS:bindings)
-"""
-
-DEPENDENCY_IDL_FILES = set([
- 'SupportTestPartialInterface.idl',
- 'TestImplements.idl',
- 'TestImplements2.idl',
- 'TestImplements3.idl',
- 'TestPartialInterface.idl',
- 'TestPartialInterfacePython.idl',
- 'TestPartialInterfacePython2.idl',
-])
-
-
-EXTENDED_ATTRIBUTES_FILE = 'bindings/IDLExtendedAttributes.txt'
-
-all_input_directory = '.' # Relative to Source/
-test_input_directory = os.path.join('bindings', 'tests', 'idls')
-reference_directory = os.path.join('bindings', 'tests', 'results')
-
-
-class ScopedTempFileProvider(object):
- def __init__(self):
- self.file_handles = []
- self.file_paths = []
- self.dir_paths = []
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, traceback):
- for file_handle in self.file_handles:
- os.close(file_handle)
- for file_path in self.file_paths:
- os.remove(file_path)
- for dir_path in self.dir_paths:
- # Temporary directories are used as output directories, so they
- # contains unknown files (they aren't empty), hence use rmtree
- shutil.rmtree(dir_path)
-
- def new_temp_file(self):
- file_handle, file_path = tempfile.mkstemp()
- self.file_handles.append(file_handle)
- self.file_paths.append(file_path)
- return file_handle, file_path
-
- def new_temp_dir(self):
- dir_path = tempfile.mkdtemp()
- self.dir_paths.append(dir_path)
- return dir_path
-
-
-class DartTests(object):
- def __init__(self, reset_results, verbose, provider):
- self.reset_results = reset_results
- self.verbose = verbose
- self.executive = executive.Executive()
- self.provider = provider
- self.idl_compiler = None
- _, self.interfaces_info_filename = provider.new_temp_file()
- # Generate output into the reference directory if resetting results, or
- # a temp directory if not.
- if reset_results:
- self.output_directory = reference_directory
- else:
- self.output_directory = provider.new_temp_dir()
-
- def run_command(self, cmd):
- output = self.executive.run_command(cmd)
- if output:
- print output
-
- def generate_from_idl(self, idl_file):
- try:
- idl_file_fullpath = os.path.realpath(idl_file)
- self.idl_compiler.compile_file(idl_file_fullpath)
- except ScriptError, e:
- print 'ERROR: idl_compiler.py: ' + os.path.basename(idl_file)
- print e.output
- return e.exit_code
-
- return 0
-
- def generate_interface_dependencies(self):
- def idl_paths(directory):
- return [os.path.join(directory, input_file)
- for input_file in os.listdir(directory)
- if input_file.endswith('.idl')]
-
- def idl_paths_recursive(directory):
- idl_paths = []
- for dirpath, _, files in os.walk(directory):
- idl_paths.extend(os.path.join(dirpath, filename)
- for filename in fnmatch.filter(files, '*.idl'))
- return idl_paths
-
- def write_list_file(idl_paths):
- list_file, list_filename = self.provider.new_temp_file()
- list_contents = ''.join(idl_path + '\n'
- for idl_path in idl_paths)
- os.write(list_file, list_contents)
- return list_filename
-
- # We compute interfaces info for *all* IDL files, not just test IDL
- # files, as code generator output depends on inheritance (both ancestor
- # chain and inherited extended attributes), and some real interfaces
- # are special-cased, such as Node.
- #
- # For example, when testing the behavior of interfaces that inherit
- # from Node, we also need to know that these inherit from EventTarget,
- # since this is also special-cased and Node inherits from EventTarget,
- # but this inheritance information requires computing dependencies for
- # the real Node.idl file.
- try:
- compute_interfaces_info(idl_paths_recursive(all_input_directory))
-
- except ScriptError, e:
- print 'ERROR: compute_interfaces_info.py'
- print e.output
- return e.exit_code
-
- return 0
-
- def delete_cache_files(self):
- # FIXME: Instead of deleting cache files, don't generate them.
- cache_files = [os.path.join(self.output_directory, output_file)
- for output_file in os.listdir(self.output_directory)
- if (output_file in ('lextab.py', # PLY lex
- 'lextab.pyc',
- 'parsetab.pickle') or # PLY yacc
- output_file.endswith('.cache'))] # Jinja
- for cache_file in cache_files:
- os.remove(cache_file)
-
- def identical_file(self, reference_filename, output_filename):
- reference_basename = os.path.basename(reference_filename)
- cmd = ['diff',
- '-u',
- '-N',
- reference_filename,
- output_filename]
- try:
- self.run_command(cmd)
- except ScriptError, e:
- # run_command throws an exception on diff (b/c non-zero exit code)
- print 'FAIL: %s' % reference_basename
- print e.output
- return False
-
- if self.verbose:
- print 'PASS: %s' % reference_basename
- return True
-
- def identical_output_files(self):
- file_pairs = [(os.path.join(reference_directory, output_file),
- os.path.join(self.output_directory, output_file))
- for output_file in os.listdir(self.output_directory)]
- return all([self.identical_file(reference_filename, output_filename)
- for (reference_filename, output_filename) in file_pairs])
-
- def no_excess_files(self):
- generated_files = set(os.listdir(self.output_directory))
- generated_files.add('.svn') # Subversion working copy directory
- excess_files = [output_file
- for output_file in os.listdir(reference_directory)
- if output_file not in generated_files]
- if excess_files:
- print ('Excess reference files! '
- '(probably cruft from renaming or deleting):\n' +
- '\n'.join(excess_files))
- return False
- return True
-
- def run_tests(self):
- # Generate output, immediately dying on failure
- if self.generate_interface_dependencies():
- return False
-
- self.idl_compiler = IdlCompilerV8(self.output_directory,
- EXTENDED_ATTRIBUTES_FILE,
- interfaces_info=interfaces_info,
- only_if_changed=True)
-
- for input_filename in os.listdir(test_input_directory):
- if not input_filename.endswith('.idl'):
- continue
- if input_filename in DEPENDENCY_IDL_FILES:
- # Dependencies aren't built (they are used by the dependent)
- if self.verbose:
- print 'DEPENDENCY: %s' % input_filename
- continue
-
- idl_path = os.path.join(test_input_directory, input_filename)
- if self.generate_from_idl(idl_path):
- return False
- if self.reset_results and self.verbose:
- print 'Reset results: %s' % input_filename
-
- self.delete_cache_files()
-
- # Detect all changes
- passed = self.identical_output_files()
- passed &= self.no_excess_files()
- return passed
-
- def main(self):
- current_scm = detect_scm_system(os.curdir)
- os.chdir(os.path.join(current_scm.checkout_root, 'Source'))
-
- all_tests_passed = self.run_tests()
- if all_tests_passed:
- if self.verbose:
- print
- print PASS_MESSAGE
- return 0
- print
- print FAIL_MESSAGE
- return -1
-
-
-def run_dart_tests(reset_results, verbose):
- with ScopedTempFileProvider() as provider:
- return DartTests(reset_results, verbose, provider).main()
diff --git a/bindings/dart/scripts/dart_types.py b/bindings/dart/scripts/dart_types.py
deleted file mode 100644
index 7ae64fc..0000000
--- a/bindings/dart/scripts/dart_types.py
+++ /dev/null
@@ -1,931 +0,0 @@
-# Copyright (C) 2013 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.
-
-"""Functions for type handling and type conversion (Blink/C++ <-> Dart:HTML).
-
-Extends IdlType and IdlUnionType with C++-specific properties, methods, and
-class methods.
-
-Spec:
-http://www.w3.org/TR/WebIDL/#es-type-mapping
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-import posixpath
-from idl_types import IdlTypeBase, IdlType, IdlUnionType, TYPE_NAMES, IdlArrayOrSequenceType, IdlSequenceType
-
-import dart_attributes
-from dart_utilities import DartUtilities
-from v8_globals import includes
-
-
-################################################################################
-# CPP -specific handling of IDL types for Dart:Blink
-################################################################################
-
-NON_WRAPPER_TYPES = frozenset([
- 'Dictionary',
- 'EventHandler',
- 'EventListener',
- 'NodeFilter',
- 'SerializedScriptValue',
-])
-TYPED_ARRAYS = {
- # (cpp_type, dart_type), used by constructor templates
- 'ArrayBuffer': (None, 'ByteBuffer'),
- 'ArrayBufferView': (None, 'ByteData'),
- 'Float32Array': ('float', 'Float32List'),
- 'Float64Array': ('double', 'Float64List'),
- 'Int8Array': ('signed char', 'Int8List'),
- 'Int16Array': ('short', 'Int16List'),
- 'Int32Array': ('int', 'Int32List'),
- 'Uint8Array': ('unsigned char', 'Uint8List'),
- 'Uint8ClampedArray': ('unsigned char', 'Uint8ClampedList'),
- 'Uint16Array': ('unsigned short', 'Uint16List'),
- 'Uint32Array': ('unsigned int', 'Uint32List'),
-}
-
-
-IdlTypeBase.is_typed_array_type = property(
- lambda self: self.base_type in TYPED_ARRAYS)
-
-
-IdlType.is_wrapper_type = property(
- lambda self: (self.is_interface_type and
- self.base_type not in NON_WRAPPER_TYPES))
-
-
-################################################################################
-# C++ types
-################################################################################
-
-CPP_TYPE_SAME_AS_IDL_TYPE = set([
- 'double',
- 'float',
- 'long long',
- 'unsigned long long',
-])
-CPP_INT_TYPES = set([
- 'byte',
- 'long',
- 'short',
-])
-CPP_UNSIGNED_TYPES = set([
- 'octet',
- 'unsigned int',
- 'unsigned long',
- 'unsigned short',
-])
-CPP_SPECIAL_CONVERSION_RULES = {
- 'Date': 'double',
- 'Dictionary': 'Dictionary',
- 'EventHandler': 'EventListener*',
- 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>',
- 'Promise': 'ScriptPromise',
- 'ScriptValue': 'ScriptValue',
- # FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345529
- 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>',
- 'boolean': 'bool',
- 'unrestricted double': 'double',
- 'unrestricted float': 'float',
-}
-
-
-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
-
- Args:
- idl_type:
- IdlType
- 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 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
- 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
-
- if base_idl_type in CPP_TYPE_SAME_AS_IDL_TYPE:
- return base_idl_type
- if base_idl_type in CPP_INT_TYPES:
- return 'int'
- if base_idl_type in CPP_UNSIGNED_TYPES:
- return 'unsigned'
- if base_idl_type in CPP_SPECIAL_CONVERSION_RULES:
- return CPP_SPECIAL_CONVERSION_RULES[base_idl_type]
-
- if base_idl_type in NON_WRAPPER_TYPES:
- return ('PassRefPtr<%s>' if used_as_rvalue_type else 'RefPtr<%s>') % base_idl_type
- if base_idl_type in ('DOMString', 'ByteString', 'ScalarValueString'):
- if not raw_type:
- return 'String'
- return 'DartStringAdapter'
-
- if idl_type.is_typed_array_type and raw_type:
- return 'RefPtr<%s>' % base_idl_type
- if idl_type.is_interface_type:
- implemented_as_class = idl_type.implemented_as
- if raw_type:
- return implemented_as_class + '*'
- new_type = 'Member' if used_in_cpp_sequence else 'RawPtr'
- 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
-
- # FIXME: How to handle sequence<WebGLShader>?
- if base_idl_type is None:
- base_idl_type = idl_type.inner_type.element_type.base_type
-
- return base_idl_type + '*'
-
-
-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
-IdlTypeBase.cpp_type = property(cpp_type)
-IdlTypeBase.cpp_type_args = cpp_type
-IdlUnionType.cpp_type = property(cpp_type_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)
-
-IdlTypeBase.enum_validation_expression = property(DartUtilities.enum_validation_expression)
-
-
-def cpp_template_type(template, inner_type):
- """Returns C++ template specialized to type, with space added if needed."""
- if inner_type.endswith('>'):
- format_string = '{template}<{inner_type} >'
- else:
- format_string = '{template}<{inner_type}>'
- return format_string.format(template=template, inner_type=inner_type)
-
-
-def cpp_ptr_type(old_type, new_type, gc_type):
- if gc_type == 'GarbageCollectedObject':
- return new_type
- if gc_type == 'WillBeGarbageCollectedObject':
- if old_type == 'Vector':
- return 'WillBe' + new_type
- return old_type + 'WillBe' + new_type
- return old_type
-
-
-def v8_type(interface_name):
- return 'V8' + interface_name
-
-
-def dart_type(interface_name):
- return 'Dart' + str(interface_name)
-
-
-# [ImplementedAs]
-# This handles [ImplementedAs] on interface types, not [ImplementedAs] in the
-# interface being generated. e.g., given:
-# Foo.idl: interface Foo {attribute Bar bar};
-# Bar.idl: [ImplementedAs=Zork] interface Bar {};
-# when generating bindings for Foo, the [ImplementedAs] on Bar is needed.
-# This data is external to Foo.idl, and hence computed as global information in
-# compute_interfaces_info.py to avoid having to parse IDLs of all used interfaces.
-IdlType.implemented_as_interfaces = {}
-
-
-def implemented_as(idl_type):
- base_idl_type = idl_type.base_type
- if base_idl_type in IdlType.implemented_as_interfaces:
- return IdlType.implemented_as_interfaces[base_idl_type]
- return base_idl_type
-
-
-IdlType.implemented_as = property(implemented_as)
-
-IdlType.set_implemented_as_interfaces = classmethod(
- 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)
-
-IdlType.set_garbage_collected_types = classmethod(
- lambda cls, new_garbage_collected_types:
- cls.garbage_collected_types.update(new_garbage_collected_types))
-
-
-# [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)
-
-IdlType.set_will_be_garbage_collected_types = classmethod(
- lambda cls, new_will_be_garbage_collected_types:
- cls.will_be_garbage_collected_types.update(new_will_be_garbage_collected_types))
-
-
-def gc_type(idl_type):
- if idl_type.is_garbage_collected:
- return 'GarbageCollectedObject'
- if idl_type.is_will_be_garbage_collected:
- return 'WillBeGarbageCollectedObject'
- return 'RefCountedObject'
-
-IdlTypeBase.gc_type = property(gc_type)
-
-
-################################################################################
-# Includes
-################################################################################
-
-def includes_for_cpp_class(class_name, relative_dir_posix):
- return set([posixpath.join('bindings', relative_dir_posix, class_name + '.h')])
-
-# TODO(terry): Will we need this group header for dart:blink?
-INCLUDES_FOR_TYPE = {
- 'object': set(),
- 'Dictionary': set(['bindings/core/v8/Dictionary.h']),
- 'EventHandler': set(),
- 'EventListener': set(),
- 'HTMLCollection': set(['bindings/core/dart/DartHTMLCollection.h',
- 'core/dom/ClassCollection.h',
- 'core/dom/TagCollection.h',
- 'core/html/HTMLCollection.h',
- 'core/html/HTMLDataListOptionsCollection.h',
- 'core/html/HTMLFormControlsCollection.h',
- 'core/html/HTMLTableRowsCollection.h']),
- 'NodeList': set(['bindings/core/dart/DartNodeList.h',
- 'core/dom/NameNodeList.h',
- 'core/dom/NodeList.h',
- 'core/dom/StaticNodeList.h',
- 'core/html/LabelsNodeList.h']),
- 'Promise': set(['bindings/core/dart/DartScriptPromise.h']),
- 'SerializedScriptValue': set(),
- 'ScriptValue': set(['bindings/core/dart/DartScriptValue.h']),
-}
-
-
-def includes_for_type(idl_type):
- idl_type = idl_type.preprocessed_type
-
- # Composite types
- if idl_type.native_array_element_type:
- return includes_for_type(idl_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:
- # Typed array factory methods are already provided by DartUtilities.h.
- return set([])
- if base_idl_type.endswith('ConstructorConstructor'):
- # FIXME: rename to NamedConstructor
- # FIXME: replace with a [NamedConstructorAttribute] extended attribute
- # Ending with 'ConstructorConstructor' indicates a named constructor,
- # and these do not have header files, as they are part of the generated
- # bindings for the interface
- return set()
- 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/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(
- lambda self: set.union(*[includes_for_type(member_type)
- for member_type in self.member_types]))
-
-
-def add_includes_for_type(idl_type):
- includes.update(idl_type.includes_for_type)
-
-IdlTypeBase.add_includes_for_type = add_includes_for_type
-IdlUnionType.add_includes_for_type = add_includes_for_type
-
-
-def includes_for_interface(interface_name):
- return IdlType(interface_name).includes_for_type
-
-
-def add_includes_for_interface(interface_name):
- includes.update(includes_for_interface(interface_name))
-
-
-component_dir = {}
-
-
-def set_component_dirs(new_component_dirs):
- component_dir.update(new_component_dirs)
-
-
-################################################################################
-# Dart -> C++
-################################################################################
-
-# TODO(terry): Need to fix to handle getter/setters for onEvent.
-DART_FIX_ME = 'DART_UNIMPLEMENTED(/* Conversion unimplemented*/);'
-
-# For a given IDL type, the DartHandle to C++ conversion.
-DART_TO_CPP_VALUE = {
- # Basic
- 'Date': 'DartUtilities::dartToDate(args, {index}, exception)',
- 'DOMString': 'DartUtilities::dartToString{null_check}(args, {index}, exception, {auto_scope})',
- 'ByteString': 'DartUtilities::dartToByteString{null_check}(args, {index}, exception, {auto_scope})',
- 'ScalarValueString': 'DartUtilities::dartToScalarValueString{null_check}(args, {index}, exception, {auto_scope})',
- 'boolean': 'DartUtilities::dartToBool{null_check}(args, {index}, exception)',
- 'float': 'static_cast<float>(DartUtilities::dartToDouble(args, {index}, exception))',
- 'unrestricted float': 'static_cast<float>(DartUtilities::dartToDouble(args, {index}, exception))',
- 'double': 'DartUtilities::dartToDouble(args, {index}, exception)',
- 'unrestricted double': 'DartUtilities::dartToDouble(args, {index}, exception)',
- # FIXME(vsm): Inconsistent with V8.
- 'byte': 'DartUtilities::dartToUnsigned(args, {index}, exception)',
- 'octet': 'DartUtilities::dartToUnsigned(args, {index}, exception)',
- 'short': 'DartUtilities::dartToInt(args, {index}, exception)',
- 'unsigned short': 'DartUtilities::dartToUnsigned(args, {index}, exception)',
- 'long': 'DartUtilities::dartToInt(args, {index}, exception)',
- 'unsigned long': 'DartUtilities::dartToUnsignedLongLong(args, {index}, exception)',
- 'long long': 'DartUtilities::dartToLongLong(args, {index}, exception)',
- 'unsigned long long': 'DartUtilities::dartToUnsignedLongLong(args, {index}, exception)',
- # Interface types
- 'Dictionary': 'DartUtilities::dartToDictionary{null_check}(args, {index}, exception)',
- 'EventTarget': '0 /* FIXME, DART_TO_CPP_VALUE[EventTarget] */',
- 'NodeFilter': 'nullptr /* FIXME, DART_TO_CPP_VALUE[NodeFilter] */',
- 'Promise': 'DartUtilities::dartToScriptPromise{null_check}(args, {index})',
- 'SerializedScriptValue': 'nullptr /* FIXME, DART_TO_CPP_VALUE[SerializedScriptValue] */',
- 'ScriptValue': 'DartUtilities::dartToScriptValue{null_check}(args, {index})',
- # FIXME(vsm): Why don't we have an entry for Window? V8 does.
- # I think I removed this as the Window object is more special in V8 - it's the
- # global context as well. Do we need to special case it?
- 'XPathNSResolver': 'nullptr /* FIXME, DART_TO_CPP_VALUE[XPathNSResolver] */',
- # FIXME(vsm): This is an enum type (defined in StorageQuota.idl).
- # We should handle it automatically, but map to a String for now.
- 'StorageType': 'DartUtilities::dartToString(args, {index}, exception, {auto_scope})',
-}
-
-
-def dart_dictionary_value_argument(idl_type, index):
- if idl_type.is_dictionary:
- argument_expression_format = 'DartUtilities::dartToDictionaryWithNullCheck(args, {index}, exception)'
- return argument_expression_format.format(index=index)
-
- return None
-
-
-def dart_dictionary_to_local_cpp_value(idl_type, index=None):
- """Returns an expression that converts a Dictionary value as a local value."""
- idl_type = idl_type.preprocessed_type
-
- cpp_value = dart_dictionary_value_argument(idl_type, index)
-
- return cpp_value
-
-IdlTypeBase.dart_dictionary_to_local_cpp_value = dart_dictionary_to_local_cpp_value
-
-
-def dart_value_to_cpp_value(idl_type, extended_attributes, variable_name,
- null_check, has_type_checking_interface,
- index, auto_scope=True):
- # Composite types
- 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
- add_includes_for_type(idl_type)
- base_idl_type = idl_type.base_type
-
- if 'EnforceRange' in extended_attributes:
- arguments = ', '.join([variable_name, 'EnforceRange', 'exceptionState'])
- elif idl_type.is_integer_type: # NormalConversion
- arguments = ', '.join([variable_name, 'es'])
- else:
- arguments = variable_name
-
- if base_idl_type in DART_TO_CPP_VALUE:
- cpp_expression_format = DART_TO_CPP_VALUE[base_idl_type]
- elif idl_type.is_typed_array_type:
- # FIXME(vsm): V8 generates a type check here as well. Do we need one?
- # FIXME(vsm): When do we call the externalized version? E.g., see
- # bindings/dart/custom/DartWaveShaperNodeCustom.cpp - it calls
- # DartUtilities::dartToExternalizedArrayBufferView instead.
- # V8 always converts null here
- cpp_expression_format = ('DartUtilities::dartTo{idl_type}WithNullCheck(args, {index}, exception)')
- elif idl_type.is_callback_interface:
- cpp_expression_format = ('Dart{idl_type}::create{null_check}(args, {index}, exception)')
- elif idl_type.is_dictionary:
- # Value of dictionary is defined in method dart_dictionary_value_argument.
- cpp_expression_format = 'Dart{idl_type}::toImpl(dictionary, es)'
- else:
- cpp_expression_format = ('Dart{idl_type}::toNative{null_check}(args, {index}, exception)')
-
- # We allow the calling context to force a null check to handle
- # some cases that require calling context info. V8 handles all
- # of this differently, and we may wish to reconsider this approach
- check_string = ''
- if null_check or allow_null(idl_type, extended_attributes,
- has_type_checking_interface):
- check_string = 'WithNullCheck'
- elif allow_empty(idl_type, extended_attributes):
- check_string = 'WithEmptyCheck'
- return cpp_expression_format.format(null_check=check_string,
- arguments=arguments,
- index=index,
- idl_type=base_idl_type,
- auto_scope=DartUtilities.bool_to_cpp(auto_scope))
-
-
-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 (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<{native_array_element_type} >(args, {index}, {variable_name}, exception)'
- add_includes_for_type(native_array_element_type)
- else:
- ref_ptr_type = None
- this_cpp_type = native_array_element_type.cpp_type
- expression_format = 'DartUtilities::toNativeVector<{cpp_type}>(args, {index}, {variable_name}, exception)'
-
- 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, extended_attributes, variable_name,
- null_check, has_type_checking_interface,
- index=None, auto_scope=True):
- """Returns an expression that converts a Dart value to a C++ value as a local value."""
- idl_type = idl_type.preprocessed_type
-
- cpp_value = dart_value_to_cpp_value(
- idl_type, extended_attributes, variable_name,
- null_check, has_type_checking_interface,
- index, auto_scope)
-
- return 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.
-def check_reserved_name(name):
- return 'default_value' if (name == 'default') else name
-
-
-################################################################################
-# C++ -> V8
-################################################################################
-
-def preprocess_idl_type(idl_type):
- if idl_type.is_enum:
- # Enumerations are internally DOMStrings
- return IdlType('DOMString')
- if (idl_type.name == 'Any' or idl_type.is_callback_function):
- return IdlType('ScriptValue')
- return idl_type
-
-IdlTypeBase.preprocessed_type = property(preprocess_idl_type)
-IdlUnionType.preprocessed_type = property(preprocess_idl_type)
-
-
-def preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes):
- """Returns IDL type and value, with preliminary type conversions applied."""
- idl_type = idl_type.preprocessed_type
- if idl_type.name == 'Promise':
- idl_type = IdlType('ScriptPromise')
-
- # FIXME(vsm): V8 maps 'long long' and 'unsigned long long' to double
- # as they are not representable in ECMAScript. Should we do the same?
-
- # HTML5 says that unsigned reflected attributes should be in the range
- # [0, 2^31). When a value isn't in this range, a default value (or 0)
- # should be returned instead.
- extended_attributes = extended_attributes or {}
- if ('Reflect' in extended_attributes and
- idl_type.base_type in ['unsigned long', 'unsigned short']):
- cpp_value = cpp_value.replace('getUnsignedIntegralAttribute',
- 'getIntegralAttribute')
- cpp_value = 'std::max(0, %s)' % cpp_value
- return idl_type, cpp_value
-
-
-def dart_conversion_type(idl_type, extended_attributes):
- """Returns Dart conversion type, adding any additional includes.
-
- The Dart conversion type is used to select the C++ -> Dart conversion function
- or setDart*ReturnValue function; it can be an idl_type, a cpp_type, or a
- separate name for the type of conversion (e.g., 'DOMWrapper').
- """
- extended_attributes = extended_attributes or {}
-
- # Composite types
- native_array_element_type = idl_type.native_array_element_type
-
- # FIXME: Work around sequence behaving like an array.
- if (not native_array_element_type) and type(idl_type.inner_type) is IdlSequenceType:
- native_array_element_type = idl_type.inner_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
- base_idl_type = idl_type.base_type
- # Basic types, without additional includes
- if base_idl_type in CPP_INT_TYPES or base_idl_type == 'long long':
- return 'int'
- if base_idl_type in CPP_UNSIGNED_TYPES or base_idl_type == 'unsigned long long':
- return 'unsigned'
- if idl_type.is_string_type:
- if idl_type.is_nullable:
- return 'StringOrNull'
- if 'TreatReturnedNullStringAs' not in extended_attributes:
- return 'DOMString'
- treat_returned_null_string_as = extended_attributes['TreatReturnedNullStringAs']
- if treat_returned_null_string_as == 'Null':
- return 'StringOrNull'
- if treat_returned_null_string_as == 'Undefined':
- return 'StringOrUndefined'
- raise 'Unrecognized TreatReturnNullStringAs value: "%s"' % treat_returned_null_string_as
- if idl_type.is_basic_type or base_idl_type == 'ScriptValue':
- return base_idl_type
-
- # Data type with potential additional includes
- add_includes_for_type(idl_type)
- if base_idl_type in DART_SET_RETURN_VALUE: # Special dartSetReturnValue treatment
- return base_idl_type
-
- # Typed arrays don't have special Dart* classes for Dart.
- if idl_type.is_typed_array_type:
- if base_idl_type == 'ArrayBuffer':
- return 'ArrayBuffer'
- else:
- return 'TypedList'
-
- # Pointer type
- return 'DOMWrapper'
-
-IdlTypeBase.dart_conversion_type = dart_conversion_type
-
-
-DART_SET_RETURN_VALUE = {
- 'boolean': 'Dart_SetBooleanReturnValue(args, {cpp_value})',
- 'int': 'DartUtilities::setDartIntegerReturnValue(args, {cpp_value})',
- 'unsigned': 'DartUtilities::setDartUnsignedLongLongReturnValue(args, {cpp_value})',
- 'DOMString': 'DartUtilities::setDartStringReturnValue(args, {cpp_value}, {auto_scope})',
- # FIXME(terry): Need to handle checking to byte values > 255 throwing exception.
- 'ByteString': 'DartUtilities::setDartByteStringReturnValue(args, {cpp_value}, {auto_scope})',
- # FIXME(terry): Need to make valid unicode; match UTF-16 to U+FFFD REPLACEMENT CHARACTER.
- 'ScalarValueString': 'DartUtilities::setDartScalarValueStringReturnValue(args, {cpp_value}, {auto_scope})',
- # [TreatNullReturnValueAs]
- 'StringOrNull': 'DartUtilities::setDartStringReturnValueWithNullCheck(args, {cpp_value}, {auto_scope})',
- # FIXME(vsm): How should we handle undefined?
- 'StringOrUndefined': 'DartUtilities::setDartStringReturnValue(args, {cpp_value}, {auto_scope})',
- 'void': '',
- # We specialize these as well in Dart.
- 'float': 'Dart_SetDoubleReturnValue(args, {cpp_value})',
- 'unrestricted float': 'Dart_SetDoubleReturnValue(args, {cpp_value})',
- 'double': 'Dart_SetDoubleReturnValue(args, {cpp_value})',
- 'unrestricted double': 'Dart_SetDoubleReturnValue(args, {cpp_value})',
- # No special function, but instead convert value to Dart_Handle
- # and then use general Dart_SetReturnValue.
- 'array': 'Dart_SetReturnValue(args, {cpp_value})',
- 'Date': 'Dart_SetReturnValue(args, {cpp_value})',
- 'EventHandler': DART_FIX_ME,
- 'ScriptPromise': 'Dart_SetReturnValue(args, {cpp_value})',
- 'ScriptValue': 'Dart_SetReturnValue(args, {cpp_value})',
- 'SerializedScriptValue': DART_FIX_ME,
- # DOMWrapper
- # TODO(terry): Remove ForMainWorld stuff.
- 'DOMWrapperForMainWorld': DART_FIX_ME,
- # FIXME(vsm): V8 has a fast path. Do we?
- 'DOMWrapperFast': 'Dart{type_name}::returnToDart(args, WTF::getPtr({cpp_value}), {auto_scope})',
- 'DOMWrapperDefault': 'Dart{type_name}::returnToDart(args, {cpp_value}, {auto_scope})',
- # Typed arrays don't have special Dart* classes for Dart.
- 'ArrayBuffer': 'Dart_SetReturnValue(args, DartUtilities::arrayBufferToDart({cpp_value}))',
- 'TypedList': 'Dart_SetReturnValue(args, DartUtilities::arrayBufferViewToDart({cpp_value}))',
- 'Dictionary': DART_FIX_ME,
-}
-
-
-def dart_set_return_value(idl_type, cpp_value,
- extended_attributes=None, script_wrappable='',
- release=False, for_main_world=False,
- auto_scope=True):
- """Returns a statement that converts a C++ value to a Dart value and sets it as a return value.
-
- """
- def dom_wrapper_conversion_type():
- if not script_wrappable:
- return 'DOMWrapperDefault'
- if for_main_world:
- return 'DOMWrapperForMainWorld'
- return 'DOMWrapperFast'
-
- idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes)
- this_dart_conversion_type = idl_type.dart_conversion_type(extended_attributes)
- # SetReturn-specific overrides
- if this_dart_conversion_type in ['Date', 'EventHandler', 'ScriptPromise', 'ScriptValue', 'SerializedScriptValue', 'array']:
- # Convert value to Dart and then use general Dart_SetReturnValue
- # FIXME(vsm): Why do we differ from V8 here? It doesn't have a
- # creation_context.
- creation_context = ''
- 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?
- 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)
- if this_dart_conversion_type == 'DOMWrapper':
- this_dart_conversion_type = dom_wrapper_conversion_type()
-
- format_string = DART_SET_RETURN_VALUE[this_dart_conversion_type]
-
- if release:
- cpp_value = '%s.release()' % cpp_value
- statement = format_string.format(cpp_value=cpp_value,
- type_name=idl_type.name,
- script_wrappable=script_wrappable,
- auto_scope=DartUtilities.bool_to_cpp(auto_scope))
- return statement
-
-
-def dart_set_return_value_union(idl_type, cpp_value, extended_attributes=None,
- script_wrappable='', release=False, for_main_world=False,
- auto_scope=True):
- """
- release: can be either False (False for all member types) or
- a sequence (list or tuple) of booleans (if specified individually).
- """
- return [
- # FIXME(vsm): Why do we use 'result' instead of cpp_value as V8?
- member_type.dart_set_return_value('result' + str(i),
- extended_attributes,
- script_wrappable,
- release and release[i],
- for_main_world,
- auto_scope)
- for i, member_type in
- enumerate(idl_type.member_types)]
-
-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)
-IdlUnionType.release = property(
- lambda self: [member_type.is_interface_type
- for member_type in self.member_types])
-
-
-CPP_VALUE_TO_DART_VALUE = {
- # Built-in types
- # FIXME(vsm): V8 uses DateOrNull - do we need a null check?
- 'Date': 'DartUtilities::dateToDart({cpp_value})',
- 'DOMString': 'DartUtilities::stringToDartString({cpp_value})',
- 'boolean': 'DartUtilities::boolToDart({cpp_value})',
- 'int': 'DartUtilities::intToDart({cpp_value})',
- 'unsigned': 'DartUtilities::unsignedLongLongToDart({cpp_value})',
- 'float': 'DartUtilities::doubleToDart({cpp_value})',
- 'unrestricted float': 'DartUtilities::doubleToDart({cpp_value})',
- 'double': 'DartUtilities::doubleToDart({cpp_value})',
- 'unrestricted double': 'DartUtilities::doubleToDart({cpp_value})',
- # FIXME(vsm): Dart_Null?
- 'void': '',
- # Special cases
- 'EventHandler': '-----OOPS TO DART-EVENT---',
- # We need to generate the NullCheck version in some cases.
- 'ScriptPromise': 'DartUtilities::scriptPromiseToDart({cpp_value})',
- 'ScriptValue': 'DartUtilities::scriptValueToDart({cpp_value})',
- 'SerializedScriptValue': 'DartUtilities::serializedScriptValueToDart({cpp_value})',
- # General
- 'array': 'DartDOMWrapper::vectorToDart{creation_context}({cpp_value})',
- 'DOMWrapper': 'Dart{idl_type}::toDart({cpp_value})',
-}
-
-
-def cpp_value_to_dart_value(idl_type, cpp_value, creation_context='', extended_attributes=None):
- """Returns an expression that converts a C++ value to a Dart value."""
- # the isolate parameter is needed for callback interfaces
- idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes)
- this_dart_conversion_type = idl_type.dart_conversion_type(extended_attributes)
- format_string = CPP_VALUE_TO_DART_VALUE[this_dart_conversion_type]
- statement = format_string.format(
- cpp_value=cpp_value, creation_context=creation_context,
- idl_type=idl_type.base_type)
- return statement
-
-IdlTypeBase.cpp_value_to_dart_value = cpp_value_to_dart_value
-
-# FIXME(leafp) This is horrible, we should do better, but currently this is hard to do
-# in a nice way. Best solution might be to extend DartStringAdapter to accomodate
-# initialization from constant strings, but better to do that once we're stable
-# on the bots so we can track any performance regression
-CPP_LITERAL_TO_DART_VALUE = {
- 'DOMString': {'nullptr': 'DartStringAdapter(DartStringPeer::nullString())',
- 'String("")': 'DartStringAdapter(DartStringPeer::emptyString())',
- '*': 'DartUtilities::dartToString(DartUtilities::stringToDart({cpp_literal}), exception)'},
- 'ScalarValueString': {'nullptr': 'DartStringAdapter(DartStringPeer::nullString())',
- 'String("")': 'DartStringAdapter(DartStringPeer::emptyString())',
- '*': 'DartUtilities::dartToScalarValueString(DartUtilities::stringToDart({cpp_literal}), exception)'},
-}
-
-
-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)
- base_type = idl_type.preprocessed_type.base_type
- if base_type in CPP_UNSIGNED_TYPES:
- return literal_value + 'u'
- if base_type in CPP_LITERAL_TO_DART_VALUE:
- if literal_value in CPP_LITERAL_TO_DART_VALUE[base_type]:
- format_string = CPP_LITERAL_TO_DART_VALUE[base_type][literal_value]
- else:
- format_string = CPP_LITERAL_TO_DART_VALUE[base_type]['*']
- return format_string.format(cpp_literal=literal_value)
- return literal_value
-
-IdlType.literal_cpp_value = literal_cpp_value
-
-
-CPP_DEFAULT_VALUE_FOR_CPP_TYPE = {
- 'DOMString': 'DartStringAdapter(DartStringPeer::emptyString())',
- 'ByteString': 'DartStringAdapter(DartStringPeer::emptyString())',
- 'ScalarValueString': 'DartStringAdapter(DartStringPeer::emptyString())',
- 'boolean': 'false',
- 'float': '0.0f',
- 'unrestricted float': '0.0f',
- 'double': '0.0',
- 'unrestricted double': '0.0',
- 'byte': '0',
- 'octet': '0',
- 'short': '0',
- 'unsigned short': '0',
- 'long': '0',
- 'unsigned long': '0',
- 'long long': '0',
- 'unsigned long long': '0',
- 'Dictionary': 'Dictionary()',
- 'ScriptValue': 'DartUtilities::dartToScriptValueWithNullCheck(Dart_Null())',
- 'MediaQueryListListener': 'nullptr',
- 'NodeFilter': 'nullptr',
- 'SerializedScriptValue': 'nullptr',
- 'XPathNSResolver': 'nullptr',
-}
-
-
-def default_cpp_value_for_cpp_type(idl_type):
- idl_type = idl_type.preprocessed_type
- add_includes_for_type(idl_type)
- base_idl_type = idl_type.base_type
- if base_idl_type in CPP_DEFAULT_VALUE_FOR_CPP_TYPE:
- return CPP_DEFAULT_VALUE_FOR_CPP_TYPE[base_idl_type]
- if base_idl_type in NON_WRAPPER_TYPES:
- return 'nullptr'
- format_str = 'Dart{idl_type}::toNativeWithNullCheck(Dart_Null(), exception)'
- return format_str.format(idl_type=idl_type)
-
-
-# Override idl_type.name to not suffix orNull to the name, in Dart we always
-# test for null e.g.,
-#
-# bool isNull = false;
-# TYPE* result = receiver->GETTER(isNull);
-# if (isNull)
-# return;
-#
-def dart_name(idl_type):
- """Return type name.
-
- http://heycam.github.io/webidl/#dfn-type-name
- """
- base_type = idl_type.base_type
- base_type_name = TYPE_NAMES.get(base_type, base_type)
- if idl_type.native_array_element_type:
- return idl_type.inner_name()
- return base_type_name
-
-IdlType.name = property(dart_name)
-IdlUnionType.name = property(dart_name)
-
-
-# If True use the WithNullCheck version when converting.
-def allow_null(idl_type, extended_attributes, has_type_checking_interface):
- if idl_type.base_type in ('DOMString', 'ByteString', 'ScalarValueString'):
- # This logic is in cpp_types in v8_types.py, since they handle
- # this using the V8StringResource type. We handle it here
- if (extended_attributes.get('TreatNullAs') == 'NullString' or
- extended_attributes.get('TreatUndefinedAs') == 'NullString'):
- return True
-
- if extended_attributes.get('Default') == 'NullString':
- return True
-
- if extended_attributes.get('Default') == 'Undefined':
- return True
-
- if idl_type.is_nullable:
- return True
-
- return False
- else:
- # This logic is implemented in the methods.cpp template in V8
- if (idl_type.is_nullable or not has_type_checking_interface):
- return True
-
- if extended_attributes.get('Default') == 'Undefined':
- return True
-
- return False
-
-
-# If True use the WithEmptyCheck version when converting.
-def allow_empty(idl_type, extended_attributes):
- if idl_type.base_type in ('DOMString', 'ByteString', 'ScalarValueString'):
- # This logic is in cpp_types in v8_types.py, since they handle
- # this using the V8StringResource type. We handle it here
- if (extended_attributes.get('TreatNullAs') == 'EmptyString' or
- extended_attributes.get('TreatUndefinedAs') == 'EmptyString'):
- return True
-
- if extended_attributes.get('Default') == 'EmptyString':
- return True
-
- return False
diff --git a/bindings/dart/scripts/dart_utilities.py b/bindings/dart/scripts/dart_utilities.py
deleted file mode 100644
index c9f4fa5..0000000
--- a/bindings/dart/scripts/dart_utilities.py
+++ /dev/null
@@ -1,206 +0,0 @@
-# Copyright (C) 2013 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.
-
-"""Functions shared by various parts of the code generator.
-
-Extends IdlType and IdlUnion type with |enum_validation_expression| property.
-
-Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
-"""
-
-
-################################################################################
-# Utility function exposed for Dart CodeGenerator. Only 6 methods are special
-# to Dart the rest delegate to the v8_utilities functions.
-################################################################################
-
-
-import v8_types # Required
-import v8_utilities
-
-
-def _enum_validation_expression(idl_type):
- # FIXME: Add IdlEnumType, move property to derived type, and remove this check
- if not idl_type.is_enum:
- return None
- return ' || '.join(['((String){param_name}) == "%s"' % enum_value
- for enum_value in idl_type.enum_values])
-
-
-def _scoped_name(interface, definition, 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')
- if partial_interface_implemented_as:
- return '%s::%s' % (partial_interface_implemented_as, base_name)
- if (definition.is_static or
- definition.name in ('Constructor', 'NamedConstructor')):
- return '%s::%s' % (v8_utilities.cpp_name(interface), base_name)
- return 'receiver->%s' % base_name
-
-
-def _bool_to_cpp(tf):
- return "true" if tf else "false"
-
-
-# [ActivityLogging]
-def _activity_logging_world_list(member, access_type=None):
- """Returns a set of world suffixes for which a definition member has activity logging, for specified access type.
-
- access_type can be 'Getter' or 'Setter' if only checking getting or setting.
- """
- if 'ActivityLogging' not in member.extended_attributes:
- return set()
- activity_logging = member.extended_attributes['ActivityLogging']
- # [ActivityLogging=For*] (no prefix, starts with the worlds suffix) means
- # "log for all use (method)/access (attribute)", otherwise check that value
- # agrees with specified access_type (Getter/Setter).
- has_logging = (activity_logging.startswith('For') or
- (access_type and activity_logging.startswith(access_type)))
- if not has_logging:
- return set()
-# TODO(terry): Remove Me?
-# includes.add('bindings/core/v8/V8DOMActivityLogger.h')
- if activity_logging.endswith('ForIsolatedWorlds'):
- return set([''])
- return set(['', 'ForMainWorld']) # endswith('ForAllWorlds')
-
-
-# [CallWith]
-_CALL_WITH_ARGUMENTS = {
- 'ScriptState': 'state',
- 'ExecutionContext': 'context',
- 'ScriptArguments': 'scriptArguments.release()',
- 'ActiveWindow': 'DartUtilities::callingDomWindowForCurrentIsolate()',
- 'FirstWindow': 'DartUtilities::enteredDomWindowForCurrentIsolate()',
- 'Document': 'document',
-}
-
-# List because key order matters, as we want arguments in deterministic order
-_CALL_WITH_VALUES = [
- 'ScriptState',
- 'ExecutionContext',
- 'ScriptArguments',
- 'ActiveWindow',
- 'FirstWindow',
- 'Document',
-]
-
-
-def _call_with_arguments(call_with_values):
- if not call_with_values:
- return []
- return [_CALL_WITH_ARGUMENTS[value]
- for value in _CALL_WITH_VALUES
- if v8_utilities.extended_attribute_value_contains(call_with_values, value)]
-
-
-# [DeprecateAs]
-def _deprecate_as(member):
- extended_attributes = member.extended_attributes
- if 'DeprecateAs' not in extended_attributes:
- return None
-# TODO(terry): Remove me?
-# includes.add('core/frame/UseCounter.h')
- return extended_attributes['DeprecateAs']
-
-
-# [MeasureAs]
-def _measure_as(definition_or_member):
- extended_attributes = definition_or_member.extended_attributes
- if 'MeasureAs' not in extended_attributes:
- return None
-# TODO(terry): Remove Me?
-# includes.add('core/frame/UseCounter.h')
- return extended_attributes['MeasureAs']
-
-
-def _generate_native_entry(interface_name, name, kind, is_static, arity):
-
- def mkPublic(s):
- if s.startswith("_") or s.startswith("$"):
- return "$" + s
- return s
-
- arity_str = ""
- if kind == 'Getter':
- suffix = "_Getter"
- elif kind == 'Setter':
- suffix = "_Setter"
- elif kind == 'Constructor':
- name = "constructor"
- suffix = "Callback"
- arity_str = "_" + str(arity)
- elif kind == 'Method':
- suffix = "_Callback"
- arity_str = "_" + str(arity)
-
- tag = "%s%s" % (name, suffix)
- blink_entry = mkPublic(tag + arity_str)
- native_entry = "_".join([interface_name, tag])
-
- argument_names = ['__arg_%d' % i for i in range(0, arity)]
- if not is_static and kind != 'Constructor':
- argument_names.insert(0, "mthis")
-
- return {'blink_entry': blink_entry,
- 'argument_names': argument_names,
- 'resolver_string': native_entry}
-
-################################################################################
-# This is the monkey patched methods most delegate to v8_utilities but some are
-# overridden in dart_utilities.
-################################################################################
-
-
-class dart_utilities_monkey():
- def __init__(self):
- self.base_class_name = 'dart_utilities'
-
-DartUtilities = dart_utilities_monkey()
-
-DartUtilities.activity_logging_world_list = _activity_logging_world_list
-DartUtilities.bool_to_cpp = _bool_to_cpp
-DartUtilities.call_with_arguments = _call_with_arguments
-DartUtilities.capitalize = v8_utilities.capitalize
-DartUtilities.conditional_string = v8_utilities.conditional_string
-DartUtilities.cpp_name = v8_utilities.cpp_name
-DartUtilities.deprecate_as = _deprecate_as
-DartUtilities.extended_attribute_value_contains = v8_utilities.extended_attribute_value_contains
-DartUtilities.enum_validation_expression = _enum_validation_expression
-DartUtilities.gc_type = v8_utilities.gc_type
-DartUtilities.generate_native_entry = _generate_native_entry
-DartUtilities.has_extended_attribute = v8_utilities.has_extended_attribute
-DartUtilities.has_extended_attribute_value = v8_utilities.has_extended_attribute_value
-DartUtilities.measure_as = _measure_as
-DartUtilities.per_context_enabled_function_name = v8_utilities.per_context_enabled_function_name
-DartUtilities.runtime_enabled_function_name = v8_utilities.runtime_enabled_function_name
-DartUtilities.scoped_name = _scoped_name
-DartUtilities.strip_suffix = v8_utilities.strip_suffix
-DartUtilities.uncapitalize = v8_utilities.uncapitalize
-DartUtilities.v8_class_name = v8_utilities.v8_class_name
diff --git a/bindings/dart/scripts/idl_files.py b/bindings/dart/scripts/idl_files.py
deleted file mode 100644
index cbb4157..0000000
--- a/bindings/dart/scripts/idl_files.py
+++ /dev/null
@@ -1,800 +0,0 @@
-# Testing file for use to debug IDL parsing and code gen in Eclipse.
-# Update list of IDL files from Source/core/core.gypi and
-# Source/modules/modules.gypi
-
-import os
-
-
-def full_path(paths, files):
- full_paths = []
- for relative_file in files:
- correct_relative_path = os.path.join(paths[0], paths[1], relative_file)
- full_paths.append(os.path.realpath(correct_relative_path))
- return full_paths
-
-
-# This list is copied from Source/core/core.gypi 'core_idl_files'
-# Core IDL files bindings (.dart, .cpp and .h files) will be generated
-core_idl_files = [
- 'animation/Animation.idl',
- 'animation/AnimationEffect.idl',
- 'animation/AnimationPlayer.idl',
- 'animation/AnimationNode.idl',
- 'animation/AnimationTimeline.idl',
- 'animation/Timing.idl',
- 'clipboard/DataTransfer.idl',
- 'clipboard/DataTransferItem.idl',
- 'clipboard/DataTransferItemList.idl',
- 'css/CSS.idl',
- 'css/CSSCharsetRule.idl',
- 'css/CSSFontFaceRule.idl',
- 'css/CSSImportRule.idl',
- 'css/CSSKeyframeRule.idl',
- 'css/CSSKeyframesRule.idl',
- 'css/CSSMediaRule.idl',
- 'css/CSSPageRule.idl',
- 'css/CSSPrimitiveValue.idl',
- 'css/CSSRule.idl',
- 'css/CSSRuleList.idl',
- 'css/CSSStyleDeclaration.idl',
- 'css/CSSStyleRule.idl',
- 'css/CSSStyleSheet.idl',
- 'css/CSSSupportsRule.idl',
- 'css/CSSUnknownRule.idl',
- 'css/CSSValue.idl',
- 'css/CSSValueList.idl',
- 'css/CSSViewportRule.idl',
- 'css/Counter.idl',
- 'css/FontFace.idl',
- 'css/FontFaceSet.idl',
- 'css/FontFaceSetForEachCallback.idl',
- 'css/FontFaceSetLoadEvent.idl',
- 'css/MediaList.idl',
- 'css/MediaQueryList.idl',
- 'css/MediaQueryListEvent.idl',
- 'css/RGBColor.idl',
- 'css/Rect.idl',
- 'css/StyleMedia.idl',
- 'css/StyleSheet.idl',
- 'css/StyleSheetList.idl',
- 'css/WebKitCSSFilterRule.idl',
- 'css/WebKitCSSFilterValue.idl',
- 'css/WebKitCSSMatrix.idl',
- 'css/WebKitCSSTransformValue.idl',
- 'dom/Attr.idl',
- 'dom/CDATASection.idl',
- 'dom/CharacterData.idl',
- 'dom/ClientRect.idl',
- 'dom/ClientRectList.idl',
- 'dom/Comment.idl',
- 'dom/DOMError.idl',
- 'dom/DOMException.idl',
- 'dom/DOMImplementation.idl',
- 'dom/DOMMatrix.idl',
- 'dom/DOMMatrixReadOnly.idl',
- 'dom/DOMPoint.idl',
- 'dom/DOMPointReadOnly.idl',
- 'dom/DOMRect.idl',
- 'dom/DOMRectReadOnly.idl',
- 'dom/DOMSettableTokenList.idl',
- 'dom/DOMStringList.idl',
- 'dom/DOMStringMap.idl',
- 'dom/DOMTokenList.idl',
- 'dom/Document.idl',
- 'dom/DocumentFragment.idl',
- 'dom/DocumentType.idl',
- 'dom/Element.idl',
- 'dom/Iterator.idl',
- 'dom/MessageChannel.idl',
- 'dom/MessagePort.idl',
- 'dom/MutationObserver.idl',
- 'dom/MutationRecord.idl',
- 'dom/NamedNodeMap.idl',
- 'dom/Node.idl',
- 'dom/NodeFilter.idl',
- 'dom/NodeIterator.idl',
- 'dom/NodeList.idl',
- 'dom/ProcessingInstruction.idl',
- 'dom/Range.idl',
- 'dom/RequestAnimationFrameCallback.idl',
- 'dom/StringCallback.idl',
- 'dom/Text.idl',
- 'dom/Touch.idl',
- 'dom/TouchList.idl',
- 'dom/TreeWalker.idl',
- 'dom/URL.idl',
- 'dom/XMLDocument.idl',
- 'dom/shadow/ShadowRoot.idl',
- 'editing/Selection.idl',
- 'events/AnimationPlayerEvent.idl',
- 'events/ApplicationCacheErrorEvent.idl',
- 'events/AutocompleteErrorEvent.idl',
- 'events/BeforeUnloadEvent.idl',
- 'events/CompositionEvent.idl',
- 'events/CustomEvent.idl',
- 'events/ErrorEvent.idl',
- 'events/Event.idl',
- 'events/EventTarget.idl',
- 'events/FocusEvent.idl',
- 'events/HashChangeEvent.idl',
- 'events/KeyboardEvent.idl',
- 'events/MessageEvent.idl',
- 'events/MouseEvent.idl',
- 'events/MutationEvent.idl',
- 'events/OverflowEvent.idl',
- 'events/PageTransitionEvent.idl',
- 'events/PopStateEvent.idl',
- 'events/ProgressEvent.idl',
- 'events/RelatedEvent.idl',
- 'events/ResourceProgressEvent.idl',
- 'events/SecurityPolicyViolationEvent.idl',
- 'events/TextEvent.idl',
- 'events/TouchEvent.idl',
- 'events/TransitionEvent.idl',
- 'events/UIEvent.idl',
- 'events/WebKitAnimationEvent.idl',
- 'events/WheelEvent.idl',
- 'fileapi/Blob.idl',
- 'fileapi/File.idl',
- 'fileapi/FileError.idl',
- 'fileapi/FileList.idl',
- 'fileapi/FileReader.idl',
- 'fileapi/FileReaderSync.idl',
- 'frame/BarProp.idl',
- 'frame/Console.idl',
- 'frame/ConsoleBase.idl',
- 'frame/History.idl',
- 'frame/ImageBitmap.idl',
- 'frame/Location.idl',
- 'frame/Navigator.idl',
- 'frame/Screen.idl',
- 'frame/Window.idl',
- 'html/FormData.idl',
- 'html/HTMLAllCollection.idl',
- 'html/HTMLAnchorElement.idl',
- 'html/HTMLAppletElement.idl',
- 'html/HTMLAreaElement.idl',
- 'html/HTMLAudioElement.idl',
- 'html/HTMLBRElement.idl',
- 'html/HTMLBaseElement.idl',
- 'html/HTMLBodyElement.idl',
- 'html/HTMLButtonElement.idl',
- 'html/HTMLCanvasElement.idl',
- 'html/HTMLCollection.idl',
- 'html/HTMLContentElement.idl',
- 'html/HTMLDListElement.idl',
- 'html/HTMLDataListElement.idl',
- 'html/HTMLDetailsElement.idl',
- 'html/HTMLDialogElement.idl',
- 'html/HTMLDirectoryElement.idl',
- 'html/HTMLDivElement.idl',
- 'html/HTMLDocument.idl',
- 'html/HTMLElement.idl',
- 'html/HTMLEmbedElement.idl',
- 'html/HTMLFieldSetElement.idl',
- 'html/HTMLFontElement.idl',
- 'html/HTMLFormControlsCollection.idl',
- 'html/HTMLFormElement.idl',
- 'html/HTMLFrameElement.idl',
- 'html/HTMLFrameSetElement.idl',
- 'html/HTMLHRElement.idl',
- 'html/HTMLHeadElement.idl',
- 'html/HTMLHeadingElement.idl',
- 'html/HTMLHtmlElement.idl',
- 'html/HTMLIFrameElement.idl',
- 'html/HTMLImageElement.idl',
- 'html/HTMLInputElement.idl',
- 'html/HTMLKeygenElement.idl',
- 'html/HTMLLIElement.idl',
- 'html/HTMLLabelElement.idl',
- 'html/HTMLLegendElement.idl',
- 'html/HTMLLinkElement.idl',
- 'html/HTMLMapElement.idl',
- 'html/HTMLMarqueeElement.idl',
- 'html/HTMLMediaElement.idl',
- 'html/HTMLMenuElement.idl',
- 'html/HTMLMenuItemElement.idl',
- 'html/HTMLMetaElement.idl',
- 'html/HTMLMeterElement.idl',
- 'html/HTMLModElement.idl',
- 'html/HTMLOListElement.idl',
- 'html/HTMLObjectElement.idl',
- 'html/HTMLOptGroupElement.idl',
- 'html/HTMLOptionElement.idl',
- 'html/HTMLOptionsCollection.idl',
- 'html/HTMLOutputElement.idl',
- 'html/HTMLParagraphElement.idl',
- 'html/HTMLParamElement.idl',
- 'html/HTMLPictureElement.idl',
- 'html/HTMLPreElement.idl',
- 'html/HTMLProgressElement.idl',
- 'html/HTMLQuoteElement.idl',
- 'html/HTMLScriptElement.idl',
- 'html/HTMLSelectElement.idl',
- 'html/HTMLShadowElement.idl',
- 'html/HTMLSourceElement.idl',
- 'html/HTMLSpanElement.idl',
- 'html/HTMLStyleElement.idl',
- 'html/HTMLTableCaptionElement.idl',
- 'html/HTMLTableCellElement.idl',
- 'html/HTMLTableColElement.idl',
- 'html/HTMLTableElement.idl',
- 'html/HTMLTableRowElement.idl',
- 'html/HTMLTableSectionElement.idl',
- 'html/HTMLTemplateElement.idl',
- 'html/HTMLTextAreaElement.idl',
- 'html/HTMLTitleElement.idl',
- 'html/HTMLTrackElement.idl',
- 'html/HTMLUListElement.idl',
- 'html/HTMLUnknownElement.idl',
- 'html/HTMLVideoElement.idl',
- 'html/ImageData.idl',
- 'html/MediaController.idl',
- 'html/MediaError.idl',
- 'html/MediaKeyError.idl',
- 'html/MediaKeyEvent.idl',
- 'html/RadioNodeList.idl',
- 'html/TextMetrics.idl',
- 'html/TimeRanges.idl',
- 'html/ValidityState.idl',
- 'html/VoidCallback.idl',
- 'html/canvas/ANGLEInstancedArrays.idl',
- 'html/canvas/Canvas2DContextAttributes.idl',
- 'html/canvas/CanvasGradient.idl',
- 'html/canvas/CanvasPattern.idl',
- 'html/canvas/CanvasRenderingContext2D.idl',
- 'html/canvas/EXTBlendMinMax.idl',
- 'html/canvas/EXTFragDepth.idl',
- 'html/canvas/EXTShaderTextureLOD.idl',
- 'html/canvas/EXTTextureFilterAnisotropic.idl',
- 'html/canvas/OESElementIndexUint.idl',
- 'html/canvas/OESStandardDerivatives.idl',
- 'html/canvas/OESTextureFloat.idl',
- 'html/canvas/OESTextureFloatLinear.idl',
- 'html/canvas/OESTextureHalfFloat.idl',
- 'html/canvas/OESTextureHalfFloatLinear.idl',
- 'html/canvas/OESVertexArrayObject.idl',
- 'html/canvas/Path2D.idl',
- 'html/canvas/WebGLActiveInfo.idl',
- 'html/canvas/WebGLBuffer.idl',
- 'html/canvas/WebGLCompressedTextureATC.idl',
- 'html/canvas/WebGLCompressedTextureETC1.idl',
- 'html/canvas/WebGLCompressedTexturePVRTC.idl',
- 'html/canvas/WebGLCompressedTextureS3TC.idl',
- 'html/canvas/WebGLContextAttributes.idl',
- 'html/canvas/WebGLContextEvent.idl',
- 'html/canvas/WebGLDebugRendererInfo.idl',
- 'html/canvas/WebGLDebugShaders.idl',
- 'html/canvas/WebGLDepthTexture.idl',
- 'html/canvas/WebGLDrawBuffers.idl',
- 'html/canvas/WebGLFramebuffer.idl',
- 'html/canvas/WebGLLoseContext.idl',
- 'html/canvas/WebGLProgram.idl',
- 'html/canvas/WebGLRenderbuffer.idl',
- 'html/canvas/WebGLRenderingContext.idl',
- 'html/canvas/WebGLShader.idl',
- 'html/canvas/WebGLShaderPrecisionFormat.idl',
- 'html/canvas/WebGLTexture.idl',
- 'html/canvas/WebGLUniformLocation.idl',
- 'html/canvas/WebGLVertexArrayObjectOES.idl',
- 'html/ime/InputMethodContext.idl',
- 'html/shadow/PluginPlaceholderElement.idl',
- 'html/track/AudioTrack.idl',
- 'html/track/AudioTrackList.idl',
- 'html/track/TextTrack.idl',
- 'html/track/TextTrackCue.idl',
- 'html/track/TextTrackCueList.idl',
- 'html/track/TextTrackList.idl',
- 'html/track/TrackEvent.idl',
- 'html/track/VideoTrack.idl',
- 'html/track/VideoTrackList.idl',
- 'html/track/vtt/VTTCue.idl',
- 'html/track/vtt/VTTRegion.idl',
- 'html/track/vtt/VTTRegionList.idl',
- 'inspector/InjectedScriptHost.idl',
- 'inspector/InspectorFrontendHost.idl',
- 'inspector/InspectorOverlayHost.idl',
- 'inspector/JavaScriptCallFrame.idl',
- 'loader/appcache/ApplicationCache.idl',
- 'page/EventSource.idl',
- 'page/PagePopupController.idl',
- 'plugins/MimeType.idl',
- 'plugins/MimeTypeArray.idl',
- 'plugins/Plugin.idl',
- 'plugins/PluginArray.idl',
- 'storage/Storage.idl',
- 'storage/StorageEvent.idl',
- 'streams/ReadableStream.idl',
- 'streams/Stream.idl',
- 'svg/SVGAElement.idl',
- 'svg/SVGAltGlyphDefElement.idl',
- 'svg/SVGAltGlyphElement.idl',
- 'svg/SVGAltGlyphItemElement.idl',
- 'svg/SVGAngle.idl',
- 'svg/SVGAnimateElement.idl',
- 'svg/SVGAnimateMotionElement.idl',
- 'svg/SVGAnimateTransformElement.idl',
- 'svg/SVGAnimatedAngle.idl',
- 'svg/SVGAnimatedBoolean.idl',
- 'svg/SVGAnimatedEnumeration.idl',
- 'svg/SVGAnimatedInteger.idl',
- 'svg/SVGAnimatedLength.idl',
- 'svg/SVGAnimatedLengthList.idl',
- 'svg/SVGAnimatedNumber.idl',
- 'svg/SVGAnimatedNumberList.idl',
- 'svg/SVGAnimatedPreserveAspectRatio.idl',
- 'svg/SVGAnimatedRect.idl',
- 'svg/SVGAnimatedString.idl',
- 'svg/SVGAnimatedTransformList.idl',
- 'svg/SVGAnimationElement.idl',
- 'svg/SVGCircleElement.idl',
- 'svg/SVGClipPathElement.idl',
- 'svg/SVGComponentTransferFunctionElement.idl',
- 'svg/SVGCursorElement.idl',
- 'svg/SVGDefsElement.idl',
- 'svg/SVGDescElement.idl',
- 'svg/SVGDiscardElement.idl',
- 'svg/SVGElement.idl',
- 'svg/SVGEllipseElement.idl',
- 'svg/SVGFEBlendElement.idl',
- 'svg/SVGFEColorMatrixElement.idl',
- 'svg/SVGFEComponentTransferElement.idl',
- 'svg/SVGFECompositeElement.idl',
- 'svg/SVGFEConvolveMatrixElement.idl',
- 'svg/SVGFEDiffuseLightingElement.idl',
- 'svg/SVGFEDisplacementMapElement.idl',
- 'svg/SVGFEDistantLightElement.idl',
- 'svg/SVGFEDropShadowElement.idl',
- 'svg/SVGFEFloodElement.idl',
- 'svg/SVGFEFuncAElement.idl',
- 'svg/SVGFEFuncBElement.idl',
- 'svg/SVGFEFuncGElement.idl',
- 'svg/SVGFEFuncRElement.idl',
- 'svg/SVGFEGaussianBlurElement.idl',
- 'svg/SVGFEImageElement.idl',
- 'svg/SVGFEMergeElement.idl',
- 'svg/SVGFEMergeNodeElement.idl',
- 'svg/SVGFEMorphologyElement.idl',
- 'svg/SVGFEOffsetElement.idl',
- 'svg/SVGFEPointLightElement.idl',
- 'svg/SVGFESpecularLightingElement.idl',
- 'svg/SVGFESpotLightElement.idl',
- 'svg/SVGFETileElement.idl',
- 'svg/SVGFETurbulenceElement.idl',
- 'svg/SVGFilterElement.idl',
- 'svg/SVGFontElement.idl',
- 'svg/SVGFontFaceElement.idl',
- 'svg/SVGFontFaceFormatElement.idl',
- 'svg/SVGFontFaceNameElement.idl',
- 'svg/SVGFontFaceSrcElement.idl',
- 'svg/SVGFontFaceUriElement.idl',
- 'svg/SVGForeignObjectElement.idl',
- 'svg/SVGGElement.idl',
- 'svg/SVGGeometryElement.idl',
- 'svg/SVGGlyphElement.idl',
- 'svg/SVGGlyphRefElement.idl',
- 'svg/SVGGradientElement.idl',
- 'svg/SVGGraphicsElement.idl',
- 'svg/SVGHKernElement.idl',
- 'svg/SVGImageElement.idl',
- 'svg/SVGLength.idl',
- 'svg/SVGLengthList.idl',
- 'svg/SVGLineElement.idl',
- 'svg/SVGLinearGradientElement.idl',
- 'svg/SVGMPathElement.idl',
- 'svg/SVGMarkerElement.idl',
- 'svg/SVGMaskElement.idl',
- 'svg/SVGMatrix.idl',
- 'svg/SVGMetadataElement.idl',
- 'svg/SVGMissingGlyphElement.idl',
- 'svg/SVGNumber.idl',
- 'svg/SVGNumberList.idl',
- 'svg/SVGPathElement.idl',
- 'svg/SVGPathSeg.idl',
- 'svg/SVGPathSegArcAbs.idl',
- 'svg/SVGPathSegArcRel.idl',
- 'svg/SVGPathSegClosePath.idl',
- 'svg/SVGPathSegCurvetoCubicAbs.idl',
- 'svg/SVGPathSegCurvetoCubicRel.idl',
- 'svg/SVGPathSegCurvetoCubicSmoothAbs.idl',
- 'svg/SVGPathSegCurvetoCubicSmoothRel.idl',
- 'svg/SVGPathSegCurvetoQuadraticAbs.idl',
- 'svg/SVGPathSegCurvetoQuadraticRel.idl',
- 'svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl',
- 'svg/SVGPathSegCurvetoQuadraticSmoothRel.idl',
- 'svg/SVGPathSegLinetoAbs.idl',
- 'svg/SVGPathSegLinetoHorizontalAbs.idl',
- 'svg/SVGPathSegLinetoHorizontalRel.idl',
- 'svg/SVGPathSegLinetoRel.idl',
- 'svg/SVGPathSegLinetoVerticalAbs.idl',
- 'svg/SVGPathSegLinetoVerticalRel.idl',
- 'svg/SVGPathSegList.idl',
- 'svg/SVGPathSegMovetoAbs.idl',
- 'svg/SVGPathSegMovetoRel.idl',
- 'svg/SVGPatternElement.idl',
- 'svg/SVGPoint.idl',
- 'svg/SVGPointList.idl',
- 'svg/SVGPolygonElement.idl',
- 'svg/SVGPolylineElement.idl',
- 'svg/SVGPreserveAspectRatio.idl',
- 'svg/SVGRadialGradientElement.idl',
- 'svg/SVGRect.idl',
- 'svg/SVGRectElement.idl',
- 'svg/SVGRenderingIntent.idl',
- 'svg/SVGSVGElement.idl',
- 'svg/SVGScriptElement.idl',
- 'svg/SVGSetElement.idl',
- 'svg/SVGStopElement.idl',
- 'svg/SVGStringList.idl',
- 'svg/SVGStyleElement.idl',
- 'svg/SVGSwitchElement.idl',
- 'svg/SVGSymbolElement.idl',
- 'svg/SVGTSpanElement.idl',
- 'svg/SVGTextContentElement.idl',
- 'svg/SVGTextElement.idl',
- 'svg/SVGTextPathElement.idl',
- 'svg/SVGTextPositioningElement.idl',
- 'svg/SVGTitleElement.idl',
- 'svg/SVGTransform.idl',
- 'svg/SVGTransformList.idl',
- 'svg/SVGUnitTypes.idl',
- 'svg/SVGUseElement.idl',
- 'svg/SVGVKernElement.idl',
- 'svg/SVGViewElement.idl',
- 'svg/SVGViewSpec.idl',
- 'svg/SVGZoomEvent.idl',
- 'timing/MemoryInfo.idl',
- 'timing/Performance.idl',
- 'timing/PerformanceEntry.idl',
- 'timing/PerformanceMark.idl',
- 'timing/PerformanceMeasure.idl',
- 'timing/PerformanceNavigation.idl',
- 'timing/PerformanceResourceTiming.idl',
- 'timing/PerformanceTiming.idl',
- 'workers/DedicatedWorkerGlobalScope.idl',
- 'workers/SharedWorker.idl',
- 'workers/SharedWorkerGlobalScope.idl',
- 'workers/Worker.idl',
- 'workers/WorkerConsole.idl',
- 'workers/WorkerGlobalScope.idl',
- 'workers/WorkerLocation.idl',
- 'workers/WorkerNavigator.idl',
- 'xml/DOMParser.idl',
- 'xml/XMLHttpRequest.idl',
- 'xml/XMLHttpRequestEventTarget.idl',
- 'xml/XMLHttpRequestProgressEvent.idl',
- 'xml/XMLHttpRequestUpload.idl',
- 'xml/XMLSerializer.idl',
- 'xml/XPathEvaluator.idl',
- 'xml/XPathExpression.idl',
- 'xml/XPathNSResolver.idl',
- 'xml/XPathResult.idl',
- 'xml/XSLTProcessor.idl',
-]
-
-
-def full_path_core_idl_files():
- return full_path(['Source', 'core'], core_idl_files)
-
-
-# This list is copied from Source/core/core.gypi 'core_dependency_idl_files'
-# 'partial interface' or target (right side of) 'implements'
-core_dependency_idl_files = [
- 'animation/DocumentAnimation.idl',
- 'animation/ElementAnimation.idl',
- 'css/DocumentFontFaceSet.idl',
- 'dom/ChildNode.idl',
- 'dom/DocumentFullscreen.idl',
- 'dom/ElementFullscreen.idl',
- 'dom/GlobalEventHandlers.idl',
- 'dom/ParentNode.idl',
- 'dom/URLUtils.idl',
- 'dom/URLUtilsReadOnly.idl',
- 'events/EventListener.idl',
- 'events/NavigatorEvents.idl',
- 'frame/NavigatorCPU.idl',
- 'frame/NavigatorID.idl',
- 'frame/NavigatorLanguage.idl',
- 'frame/NavigatorOnLine.idl',
- 'frame/WindowBase64.idl',
- 'frame/WindowEventHandlers.idl',
- 'frame/WindowTimers.idl',
- 'html/canvas/CanvasPathMethods.idl',
- 'html/canvas/MouseEventHitRegion.idl',
- 'html/canvas/WebGLRenderingContextBase.idl',
- 'imagebitmap/ImageBitmapFactories.idl',
- 'imagebitmap/WindowImageBitmapFactories.idl',
- 'page/WindowPagePopup.idl',
- 'svg/SVGDocument.idl',
- 'svg/SVGFilterPrimitiveStandardAttributes.idl',
- 'svg/SVGFitToViewBox.idl',
- 'svg/SVGTests.idl',
- 'svg/SVGURIReference.idl',
- 'svg/SVGZoomAndPan.idl',
- 'workers/AbstractWorker.idl',
- 'xml/DocumentXMLTreeViewer.idl',
- 'xml/DocumentXPathEvaluator.idl',
-]
-
-
-def full_path_core_dependency_idl_files():
- return full_path(['Source', 'core'], core_dependency_idl_files)
-
-
-# This list is copied from Source/modules/modules.gypi 'modules_idl_files'
-# Modules IDL files bindings (.dart, .cpp and .h files) will be generated
-modules_idl_files = [
- 'battery/BatteryManager.idl',
- 'credentialmanager/Credential.idl',
- 'credentialmanager/CredentialsContainer.idl',
- 'credentialmanager/FederatedCredential.idl',
- 'credentialmanager/LocalCredential.idl',
- 'crypto/Crypto.idl',
- 'crypto/CryptoKey.idl',
- 'crypto/SubtleCrypto.idl',
- 'device_light/DeviceLightEvent.idl',
- 'device_orientation/DeviceAcceleration.idl',
- 'device_orientation/DeviceMotionEvent.idl',
- 'device_orientation/DeviceOrientationEvent.idl',
- 'device_orientation/DeviceRotationRate.idl',
- 'encoding/TextDecoder.idl',
- 'encoding/TextEncoder.idl',
- 'encryptedmedia/MediaKeyMessageEvent.idl',
- 'encryptedmedia/MediaKeyNeededEvent.idl',
- 'encryptedmedia/MediaKeySession.idl',
- 'encryptedmedia/MediaKeys.idl',
- 'filesystem/DOMFileSystem.idl',
- 'filesystem/DOMFileSystemSync.idl',
- 'filesystem/DirectoryEntry.idl',
- 'filesystem/DirectoryEntrySync.idl',
- 'filesystem/DirectoryReader.idl',
- 'filesystem/DirectoryReaderSync.idl',
- 'filesystem/EntriesCallback.idl',
- 'filesystem/Entry.idl',
- 'filesystem/EntryCallback.idl',
- 'filesystem/EntrySync.idl',
- 'filesystem/ErrorCallback.idl',
- 'filesystem/FileCallback.idl',
- 'filesystem/FileEntry.idl',
- 'filesystem/FileEntrySync.idl',
- 'filesystem/FileSystemCallback.idl',
- 'filesystem/FileWriter.idl',
- 'filesystem/FileWriterCallback.idl',
- 'filesystem/FileWriterSync.idl',
- 'filesystem/Metadata.idl',
- 'filesystem/MetadataCallback.idl',
- 'gamepad/Gamepad.idl',
- 'gamepad/GamepadButton.idl',
- 'gamepad/GamepadEvent.idl',
- 'gamepad/GamepadList.idl',
- 'gamepad/WebKitGamepad.idl',
- 'gamepad/WebKitGamepadList.idl',
- 'geofencing/CircularGeofencingRegion.idl',
- 'geofencing/Geofencing.idl',
- 'geofencing/GeofencingRegion.idl',
- 'geolocation/Coordinates.idl',
- 'geolocation/Geolocation.idl',
- 'geolocation/Geoposition.idl',
- 'geolocation/PositionCallback.idl',
- 'geolocation/PositionError.idl',
- 'geolocation/PositionErrorCallback.idl',
- 'indexeddb/IDBCursor.idl',
- 'indexeddb/IDBCursorWithValue.idl',
- 'indexeddb/IDBDatabase.idl',
- 'indexeddb/IDBFactory.idl',
- 'indexeddb/IDBIndex.idl',
- 'indexeddb/IDBKeyRange.idl',
- 'indexeddb/IDBObjectStore.idl',
- 'indexeddb/IDBOpenDBRequest.idl',
- 'indexeddb/IDBRequest.idl',
- 'indexeddb/IDBTransaction.idl',
- 'indexeddb/IDBVersionChangeEvent.idl',
- 'mediasource/MediaSource.idl',
- 'mediasource/SourceBuffer.idl',
- 'mediasource/SourceBufferList.idl',
- 'mediasource/VideoPlaybackQuality.idl',
- 'mediastream/MediaDeviceInfo.idl',
- 'mediastream/MediaDeviceInfoCallback.idl',
- 'mediastream/MediaStream.idl',
- 'mediastream/MediaStreamEvent.idl',
- 'mediastream/MediaStreamTrack.idl',
- 'mediastream/MediaStreamTrackEvent.idl',
- 'mediastream/MediaStreamTrackSourcesCallback.idl',
- 'mediastream/NavigatorUserMediaError.idl',
- 'mediastream/NavigatorUserMediaErrorCallback.idl',
- 'mediastream/NavigatorUserMediaSuccessCallback.idl',
- 'mediastream/RTCDTMFSender.idl',
- 'mediastream/RTCDTMFToneChangeEvent.idl',
- 'mediastream/RTCDataChannel.idl',
- 'mediastream/RTCDataChannelEvent.idl',
- 'mediastream/RTCErrorCallback.idl',
- 'mediastream/RTCIceCandidate.idl',
- 'mediastream/RTCIceCandidateEvent.idl',
- 'mediastream/RTCPeerConnection.idl',
- 'mediastream/RTCSessionDescription.idl',
- 'mediastream/RTCSessionDescriptionCallback.idl',
- 'mediastream/RTCStatsCallback.idl',
- 'mediastream/RTCStatsReport.idl',
- 'mediastream/RTCStatsResponse.idl',
- 'mediastream/SourceInfo.idl',
- 'netinfo/NetworkInformation.idl',
- 'notifications/Notification.idl',
- 'notifications/NotificationPermissionCallback.idl',
- 'performance/WorkerPerformance.idl',
- 'presentation/Presentation.idl',
- 'push_messaging/PushEvent.idl',
- 'push_messaging/PushManager.idl',
- 'push_messaging/PushRegistration.idl',
- 'quota/DeprecatedStorageInfo.idl',
- 'quota/DeprecatedStorageQuota.idl',
- 'quota/StorageErrorCallback.idl',
- 'quota/StorageInfo.idl',
- 'quota/StorageQuota.idl',
- 'quota/StorageQuotaCallback.idl',
- 'quota/StorageUsageCallback.idl',
- 'screen_orientation/ScreenOrientation.idl',
- 'serviceworkers/Body.idl',
- 'serviceworkers/Cache.idl',
- 'serviceworkers/CacheStorage.idl',
- 'serviceworkers/ExtendableEvent.idl',
- 'serviceworkers/FetchEvent.idl',
- 'serviceworkers/Headers.idl',
- 'serviceworkers/HeadersForEachCallback.idl',
- 'serviceworkers/InstallEvent.idl',
- 'serviceworkers/Request.idl',
- 'serviceworkers/Response.idl',
- 'serviceworkers/ServiceWorker.idl',
- 'serviceworkers/ServiceWorkerClient.idl',
- 'serviceworkers/ServiceWorkerClients.idl',
- 'serviceworkers/ServiceWorkerContainer.idl',
- 'serviceworkers/ServiceWorkerGlobalScope.idl',
- 'serviceworkers/ServiceWorkerRegistration.idl',
- 'speech/SpeechGrammar.idl',
- 'speech/SpeechGrammarList.idl',
- 'speech/SpeechRecognition.idl',
- 'speech/SpeechRecognitionAlternative.idl',
- 'speech/SpeechRecognitionError.idl',
- 'speech/SpeechRecognitionEvent.idl',
- 'speech/SpeechRecognitionResult.idl',
- 'speech/SpeechRecognitionResultList.idl',
- 'speech/SpeechSynthesis.idl',
- 'speech/SpeechSynthesisEvent.idl',
- 'speech/SpeechSynthesisUtterance.idl',
- 'speech/SpeechSynthesisVoice.idl',
- 'webaudio/AnalyserNode.idl',
- 'webaudio/AudioBuffer.idl',
- 'webaudio/AudioBufferCallback.idl',
- 'webaudio/AudioBufferSourceNode.idl',
- 'webaudio/AudioContext.idl',
- 'webaudio/AudioDestinationNode.idl',
- 'webaudio/AudioListener.idl',
- 'webaudio/AudioNode.idl',
- 'webaudio/AudioParam.idl',
- 'webaudio/AudioProcessingEvent.idl',
- 'webaudio/AudioSourceNode.idl',
- 'webaudio/BiquadFilterNode.idl',
- 'webaudio/ChannelMergerNode.idl',
- 'webaudio/ChannelSplitterNode.idl',
- 'webaudio/ConvolverNode.idl',
- 'webaudio/DelayNode.idl',
- 'webaudio/DynamicsCompressorNode.idl',
- 'webaudio/GainNode.idl',
- 'webaudio/MediaElementAudioSourceNode.idl',
- 'webaudio/MediaStreamAudioDestinationNode.idl',
- 'webaudio/MediaStreamAudioSourceNode.idl',
- 'webaudio/OfflineAudioCompletionEvent.idl',
- 'webaudio/OfflineAudioContext.idl',
- 'webaudio/OscillatorNode.idl',
- 'webaudio/PannerNode.idl',
- 'webaudio/PeriodicWave.idl',
- 'webaudio/ScriptProcessorNode.idl',
- 'webaudio/WaveShaperNode.idl',
- 'webdatabase/Database.idl',
- 'webdatabase/DatabaseCallback.idl',
- 'webdatabase/SQLError.idl',
- 'webdatabase/SQLResultSet.idl',
- 'webdatabase/SQLResultSetRowList.idl',
- 'webdatabase/SQLStatementCallback.idl',
- 'webdatabase/SQLStatementErrorCallback.idl',
- 'webdatabase/SQLTransaction.idl',
- 'webdatabase/SQLTransactionCallback.idl',
- 'webdatabase/SQLTransactionErrorCallback.idl',
- 'webmidi/MIDIAccess.idl',
- 'webmidi/MIDIConnectionEvent.idl',
- 'webmidi/MIDIErrorCallback.idl',
- 'webmidi/MIDIInput.idl',
- 'webmidi/MIDIInputMap.idl',
- 'webmidi/MIDIMessageEvent.idl',
- 'webmidi/MIDIOutput.idl',
- 'webmidi/MIDIOutputMap.idl',
- 'webmidi/MIDIPort.idl',
- 'webmidi/MIDISuccessCallback.idl',
- 'websockets/CloseEvent.idl',
- 'websockets/WebSocket.idl',
-]
-
-
-def full_path_modules_idl_files():
- return full_path(['Source', 'modules'], modules_idl_files)
-
-
-# This list is copied from Source/modules/modules.gypi
-# 'modules_dependency_idl_files'.
-# 'partial interface' or target (right side of) 'implements'
-modules_dependency_idl_files = [
- 'battery/NavigatorBattery.idl',
- 'beacon/NavigatorBeacon.idl',
- 'credentialmanager/NavigatorCredentials.idl',
- 'crypto/WindowCrypto.idl',
- 'crypto/WorkerGlobalScopeCrypto.idl',
- 'device_light/WindowDeviceLight.idl',
- 'device_orientation/WindowDeviceMotion.idl',
- 'device_orientation/WindowDeviceOrientation.idl',
- 'donottrack/NavigatorDoNotTrack.idl',
- 'encryptedmedia/HTMLMediaElementEncryptedMedia.idl',
- 'filesystem/DataTransferItemFileSystem.idl',
- 'filesystem/HTMLInputElementFileSystem.idl',
- 'filesystem/InspectorFrontendHostFileSystem.idl',
- 'filesystem/WindowFileSystem.idl',
- 'filesystem/WorkerGlobalScopeFileSystem.idl',
- 'gamepad/NavigatorGamepad.idl',
- 'geofencing/NavigatorGeofencing.idl',
- 'geofencing/WorkerNavigatorGeofencing.idl',
- 'geolocation/NavigatorGeolocation.idl',
- 'indexeddb/WindowIndexedDatabase.idl',
- 'indexeddb/WorkerGlobalScopeIndexedDatabase.idl',
- 'mediasource/HTMLVideoElementMediaSource.idl',
- 'mediasource/URLMediaSource.idl',
- 'mediastream/NavigatorMediaStream.idl',
- 'mediastream/URLMediaStream.idl',
- 'mediastream/WindowMediaStream.idl',
- 'navigatorcontentutils/NavigatorContentUtils.idl',
- 'netinfo/NavigatorNetworkInformation.idl',
- 'netinfo/WorkerNavigatorNetworkInformation.idl',
- 'performance/SharedWorkerPerformance.idl',
- 'performance/WorkerGlobalScopePerformance.idl',
- 'presentation/NavigatorPresentation.idl',
- 'push_messaging/NavigatorPushManager.idl',
- 'push_messaging/ServiceWorkerGlobalScopePush.idl',
- 'quota/NavigatorStorageQuota.idl',
- 'quota/WindowQuota.idl',
- 'quota/WorkerNavigatorStorageQuota.idl',
- 'screen_orientation/ScreenScreenOrientation.idl',
- 'serviceworkers/NavigatorServiceWorker.idl',
- 'speech/WindowSpeech.idl',
- 'speech/WindowSpeechSynthesis.idl',
- 'vibration/NavigatorVibration.idl',
- 'webaudio/WindowWebAudio.idl',
- 'webdatabase/WindowWebDatabase.idl',
- 'webmidi/NavigatorWebMIDI.idl',
-]
-
-def full_path_modules_dependency_idl_files():
- return full_path(['Source', 'modules'], modules_dependency_idl_files)
-
-
-core_dictionary_idl_files = [
- 'css/FontFaceDescriptors.idl',
- 'dom/DOMPointInit.idl',
- 'dom/MutationObserverInit.idl',
- 'frame/ScrollOptions.idl',
- 'html/canvas/HitRegionOptions.idl',
- 'page/EventSourceInit.idl',
-]
-def full_path_core_dictionary_idl_files():
- return full_path(['Source', 'core'], core_dictionary_idl_files)
-
-
-modules_dictionary_idl_files = [
- 'encoding/TextDecodeOptions.idl',
- 'encoding/TextDecoderOptions.idl',
- 'indexeddb/IDBIndexParameters.idl',
- 'notifications/NotificationOptions.idl',
- 'serviceworkers/QueryParams.idl',
- 'serviceworkers/RegistrationOptionList.idl',
- 'serviceworkers/ServiceWorkerClientQueryParams.idl',
- 'webmidi/MIDIOptions.idl',
-]
-
-def full_path_modules_dictionary_idl_files():
- return full_path(['Source', 'modules'], modules_dictionary_idl_files)
diff --git a/bindings/dart/scripts/test/__init__.py b/bindings/dart/scripts/test/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/bindings/dart/scripts/test/__init__.py
+++ /dev/null
diff --git a/bindings/dart/scripts/test/main.py b/bindings/dart/scripts/test/main.py
deleted file mode 100755
index 659fd86..0000000
--- a/bindings/dart/scripts/test/main.py
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/usr/bin/python
-# Copyright (C) 2010 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:
-# 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
-#
-
-import traceback
-
-import fnmatch
-from optparse import OptionParser
-import os
-import shutil
-import sys
-import tempfile
-
-import compute_interfaces_info_individual
-from compute_interfaces_info_individual import compute_info_individual, info_individual
-import compute_interfaces_info_overall
-from compute_interfaces_info_overall import compute_interfaces_info_overall, interfaces_info
-from compiler import IdlCompilerDart
-
-# TODO(terry): Temporary solution list of IDLs to parse and IDL as dependencies.
-from idl_files import full_path_core_idl_files,\
- full_path_core_dependency_idl_files,\
- full_path_modules_idl_files,\
- full_path_modules_dependency_idl_files,\
- full_path_core_dictionary_idl_files,\
- full_path_modules_dictionary_idl_files
-
-#from dart_tests import run_dart_tests
-
-
-EXTENDED_ATTRIBUTES_FILE = 'bindings/IDLExtendedAttributes.txt'
-
-idl_compiler = None
-
-
-def parse_options():
- parser = OptionParser()
-
- parser.add_option("--output-directory",
- action="store",
- type="string",
- dest="output_directory",
- help="Generate output to a known directory")
- parser.add_option("-v", "--verbose",
- action="store_true",
- dest="verbose",
- default=False,
- help="Show all information messages")
- parser.add_option("-k", "--keep",
- action="store_true",
- dest="keep",
- default=False,
- help="Don't delete the temporary directory on exit")
- parser.add_option("--compute-idls", type='int', help="Compile IDLs interfaces and dependencies (GYP)")
- parser.add_option('--globals-only', type='int', help="Generate the globals")
-
- options, args = parser.parse_args()
-
- options.compute_idls = bool(options.compute_idls)
- options.globals_only = bool(options.globals_only)
-
- return options
-
-
-class ScopedTempFileProvider(object):
- def __init__(self, keep=False):
- self.keep = keep
- self.dir_paths = []
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, traceback):
- if not self.keep:
- for dir_path in self.dir_paths:
- # Temporary directories are used as output directories, so they
- # contains unknown files (they aren't empty), hence use rmtree
- shutil.rmtree(dir_path)
-
- def new_temp_dir(self):
- dir_path = tempfile.mkdtemp()
- self.dir_paths.append(dir_path)
- return dir_path
-
-
-class DirectoryProvider(object):
- def __init__(self, path=""):
- self.dir_path = path
-
- def __enter__(self):
- return self
-
- def new_temp_dir(self):
- return self.dir_path
-
-
-def idl_paths_recursive(directory):
- idl_paths = []
- for dirpath, _, files in os.walk(directory):
- idl_paths.extend(os.path.join(dirpath, filename)
- for filename in fnmatch.filter(files, '*.idl'))
- return idl_paths
-
-
-class Build():
- def __init__(self, provider):
- self.output_directory = provider.new_temp_dir()
-
- attrib_file = os.path.join('Source', EXTENDED_ATTRIBUTES_FILE)
- # Create compiler.
- self.idl_compiler = IdlCompilerDart(self.output_directory,
- attrib_file,
- interfaces_info=interfaces_info,
- only_if_changed=True)
-
- def format_exception(self, e):
- exception_list = traceback.format_stack()
- exception_list = exception_list[:-2]
- exception_list.extend(traceback.format_tb(sys.exc_info()[2]))
- exception_list.extend(traceback.format_exception_only(sys.exc_info()[0], sys.exc_info()[1]))
-
- exception_str = "Traceback (most recent call last):\n"
- exception_str += "".join(exception_list)
- # Removing the last \n
- exception_str = exception_str[:-1]
-
- return exception_str
-
- def generate_from_idl(self, idl_file):
- try:
- idl_file_fullpath = os.path.realpath(idl_file)
- self.idl_compiler.compile_file(idl_file_fullpath)
- except Exception as err:
- print 'ERROR: idl_compiler.py: ' + os.path.basename(idl_file)
- print err
- print
- print 'Stack Dump:'
- print self.format_exception(err)
-
- return 1
-
- def generate_global(self):
- try:
- self.idl_compiler.generate_global()
- except Exception as err:
- print 'ERROR: idl_compiler.py generate global'
- print err
- print
- print 'Stack Dump:'
- print self.format_exception(err)
-
- return 1
-
- return 0
-
-
-def main(argv):
- '''
- Runs Dart IDL code generator; IDL files. IDL files same as GYP files in
- Source/bindings/core/core.gypi and Source/bindings/modules/modules.gypi (see
- idl_files.py on list of files).
-
- To run the PYTHONPATH should have the directories:
-
- Source/bindings/scripts
- Source/bindings/scripts/dart
- '''
-
- options = parse_options()
-
- if options.compute_idls:
- # TODO(terry): Assumes CWD is third_party/WebKit so any call to
- # full_path_NNNN is prefixing 'Source/core' to path.
- core_idls = full_path_core_idl_files()
- core_dependency_idls = full_path_core_dependency_idl_files()
- modules_idls = full_path_modules_idl_files()
- modules_dependency_idls = full_path_modules_dependency_idl_files()
- core_dictionary_idls = full_path_core_dictionary_idl_files()
- modules_dictionary_idls = full_path_modules_dictionary_idl_files()
-
- all_interfaces = core_idls + modules_idls
- all_dependencies = core_dependency_idls + modules_dependency_idls
- all_dictionaries = core_dictionary_idls + modules_dictionary_idls
- all_files = all_interfaces + all_dependencies + all_dictionaries
-
- # 2-stage computation: individual, then overall
- for idl_filename in all_files:
- compute_info_individual(idl_filename)
- info_individuals = [info_individual()]
- compute_interfaces_info_overall(info_individuals)
-
- # Compile just IDLs with interfaces (no dependencies).
- if (options.output_directory == None):
- with ScopedTempFileProvider(keep=options.keep) as provider:
- build = Build(provider)
- else:
- provider = DirectoryProvider(path=options.output_directory)
- build = Build(provider)
-
- if options.verbose and options.keep:
- print 'Output directory %s created' % build.output_directory
-
- # Compile IDLs
- for filename in (all_dictionaries + all_interfaces):
- if not filename.endswith('.idl'):
- continue
- if build.generate_from_idl(filename):
- return False
-
- if options.verbose:
- print '%s IDLs with interfaces processed' % len(all_interfaces)
-
- if options.verbose and not options.keep:
- print 'Output directory %s deleted' % build.output_directory
-
- if options.globals_only:
- if (options.output_directory == None):
- with ScopedTempFileProvider(keep=options.keep) as provider:
- build = Build(provider)
- else:
- provider = DirectoryProvider(path=options.output_directory)
- build = Build(provider)
-
- if options.verbose:
- print 'Generating global...'
-
- build.generate_global()
-
- if options.verbose:
- print 'Created DartWebkitClassIds .h/.cpp'
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/bindings/scripts/aggregate_generated_bindings.py b/bindings/scripts/aggregate_generated_bindings.py
index 050c93a..05e9ffd 100755
--- a/bindings/scripts/aggregate_generated_bindings.py
+++ b/bindings/scripts/aggregate_generated_bindings.py
@@ -53,7 +53,7 @@
import re
import sys
-from utilities import idl_filename_to_interface_name, read_idl_files_list_from_file
+from utilities import should_generate_impl_file_from_idl, get_file_contents, idl_filename_to_component, idl_filename_to_interface_name, read_idl_files_list_from_file
# A regexp for finding Conditional attributes in interface definitions.
CONDITIONAL_PATTERN = re.compile(
@@ -100,10 +100,8 @@
"""
-def extract_conditional(idl_file_path):
+def extract_conditional(idl_contents):
"""Find [Conditional] interface extended attribute."""
- with open(idl_file_path) as idl_file:
- idl_contents = idl_file.read()
match = CONDITIONAL_PATTERN.search(idl_contents)
if not match:
@@ -123,11 +121,15 @@
print 'WARNING: file not found: "%s"' % file_path
continue
+ idl_file_contents = get_file_contents(file_path)
+ if not should_generate_impl_file_from_idl(idl_file_contents):
+ continue
+
# Extract interface name from file name
interface_name = idl_filename_to_interface_name(file_path)
meta_data = {
- 'conditional': extract_conditional(file_path),
+ 'conditional': extract_conditional(idl_file_contents),
'name': interface_name,
}
meta_data_list.append(meta_data)
@@ -135,7 +137,7 @@
return meta_data_list
-def generate_content(component_dir, files_meta_data_this_partition, prefix):
+def generate_content(component_dir, aggregate_partial_interfaces, files_meta_data_this_partition):
# Add fixed content.
output = [COPYRIGHT_TEMPLATE,
'#define NO_IMPLICIT_ATOMICSTRING\n\n']
@@ -152,8 +154,13 @@
output.append('\n#if ENABLE(%s)\n' % conditional)
prev_conditional = conditional
- output.append('#include "bindings/%s/%s/%s%s.cpp"\n' %
- (component_dir, prefix.lower(), prefix, meta_data['name']))
+ if aggregate_partial_interfaces:
+ cpp_filename = 'V8%sPartial.cpp' % meta_data['name']
+ else:
+ cpp_filename = 'V8%s.cpp' % meta_data['name']
+
+ output.append('#include "bindings/%s/v8/%s"\n' %
+ (component_dir, cpp_filename))
if prev_conditional:
output.append('#endif\n')
@@ -173,18 +180,18 @@
def main(args):
if len(args) <= 4:
raise Exception('Expected at least 5 arguments.')
- if (args[1] == '--dart'):
- component_dir = args[2]
- input_file_name = args[3]
- prefix = 'Dart'
- else:
- component_dir = args[1]
- input_file_name = args[2]
- prefix = 'V8'
+ component_dir = args[1]
+ input_file_name = args[2]
in_out_break_index = args.index('--')
output_file_names = args[in_out_break_index + 1:]
idl_file_names = read_idl_files_list_from_file(input_file_name)
+ components = set([idl_filename_to_component(filename)
+ for filename in idl_file_names])
+ if len(components) != 1:
+ raise Exception('Cannot aggregate generated codes in different components')
+ aggregate_partial_interfaces = component_dir not in components
+
files_meta_data = extract_meta_data(idl_file_names)
total_partitions = len(output_file_names)
for partition, file_name in enumerate(output_file_names):
@@ -192,8 +199,8 @@
meta_data for meta_data in files_meta_data
if hash(meta_data['name']) % total_partitions == partition]
file_contents = generate_content(component_dir,
- files_meta_data_this_partition,
- prefix)
+ aggregate_partial_interfaces,
+ files_meta_data_this_partition)
write_content(file_contents, file_name)
diff --git a/bindings/scripts/blink_idl_lexer.py b/bindings/scripts/blink_idl_lexer.py
index ba68c6c..31a71ff 100644
--- a/bindings/scripts/blink_idl_lexer.py
+++ b/bindings/scripts/blink_idl_lexer.py
@@ -110,6 +110,10 @@
except OSError:
pass
+ lextab = LEXTAB
+ else:
+ lextab = None
+
IDLLexer.__init__(self)
# Overrides to parent class
self._RemoveTokens(REMOVE_TOKENS)
@@ -120,7 +124,7 @@
self._lexobj = lex.lex(object=self,
debug=debug,
optimize=optimize,
- lextab=LEXTAB,
+ lextab=lextab,
outputdir=outputdir)
diff --git a/bindings/scripts/blink_idl_parser.py b/bindings/scripts/blink_idl_parser.py
index 592bf91..55c3e5f 100644
--- a/bindings/scripts/blink_idl_parser.py
+++ b/bindings/scripts/blink_idl_parser.py
@@ -254,7 +254,13 @@
# ExceptionFields, and Attribute removed from this rule.
p[0] = p[1]
- # [b47.1]
+ # [b47.1] FIXME: rename to ExceptionAttribute
+ def p_Attribute(self, p):
+ """Attribute : ReadOnly ATTRIBUTE Type identifier ';'"""
+ p[0] = self.BuildNamed('Attribute', p, 4,
+ ListFromConcat(p[1], p[3]))
+
+ # [b47.2]
def p_ExceptionOperation(self, p):
"""ExceptionOperation : Type identifier '(' ')' ';'"""
# Needed to handle one case in DOMException.idl:
@@ -275,6 +281,12 @@
items = ListFromConcat(p[2], p[3])
p[0] = self.BuildProduction('ExtAttributes', p, 1, items)
+ # Error handling for ExtendedAttributeList.
+ # We can't upstream this because we override ExtendedAttributeList.
+ def p_ExtendedAttributeListError(self, p):
+ """ExtendedAttributeList : '[' ExtendedAttribute ',' error"""
+ p[0] = self.BuildError(p, "ExtendedAttributeList")
+
# [b50] Allow optional trailing comma
# Blink-only, marked as WONTFIX in Web IDL spec:
# https://www.w3.org/Bugs/Public/show_bug.cgi?id=22156
diff --git a/bindings/scripts/code_generator_v8.py b/bindings/scripts/code_generator_v8.py
index 065873d..4169c23 100644
--- a/bindings/scripts/code_generator_v8.py
+++ b/bindings/scripts/code_generator_v8.py
@@ -70,6 +70,7 @@
sys.path.insert(1, third_party_dir)
import jinja2
+from idl_definitions import Visitor
import idl_types
from idl_types import IdlType
import v8_callback_interface
@@ -77,18 +78,25 @@
from v8_globals import includes, interfaces
import v8_interface
import v8_types
+import v8_union
from v8_utilities import capitalize, cpp_name, conditional_string, v8_class_name
-from utilities import KNOWN_COMPONENTS
+from utilities import KNOWN_COMPONENTS, idl_filename_to_component, is_valid_component_dependency, is_testing_target
-def render_template(interface_info, header_template, cpp_template,
- template_context):
+def render_template(include_paths, header_template, cpp_template,
+ template_context, component=None):
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', []))
+
+ for include_path in include_paths:
+ if component:
+ dependency = idl_filename_to_component(include_path)
+ assert is_valid_component_dependency(component, dependency)
+ includes.add(include_path)
+
template_context['cpp_includes'] = sorted(includes)
header_text = header_template.render(template_context)
@@ -96,30 +104,93 @@
return header_text, cpp_text
+def set_global_type_info(info_provider):
+ interfaces_info = info_provider.interfaces_info
+ idl_types.set_ancestors(interfaces_info['ancestors'])
+ IdlType.set_callback_interfaces(interfaces_info['callback_interfaces'])
+ IdlType.set_dictionaries(interfaces_info['dictionaries'])
+ IdlType.set_enums(info_provider.enumerations)
+ IdlType.set_implemented_as_interfaces(interfaces_info['implemented_as_interfaces'])
+ IdlType.set_garbage_collected_types(interfaces_info['garbage_collected_interfaces'])
+ IdlType.set_will_be_garbage_collected_types(interfaces_info['will_be_garbage_collected_interfaces'])
+ v8_types.set_component_dirs(interfaces_info['component_dirs'])
+
+
+def should_generate_code(definitions):
+ return definitions.interfaces or definitions.dictionaries
+
+
+def depends_on_union_types(idl_type):
+ """Returns true when a given idl_type depends on union containers
+ directly.
+ """
+ if idl_type.is_union_type:
+ return True
+ if idl_type.is_array_or_sequence_type:
+ return idl_type.element_type.is_union_type
+ return False
+
+
+class TypedefResolver(Visitor):
+ def __init__(self, info_provider):
+ self.info_provider = info_provider
+
+ def resolve(self, definitions, definition_name):
+ """Traverse definitions and resolves typedefs with the actual types."""
+ self.typedefs = {}
+ for name, typedef in self.info_provider.typedefs.iteritems():
+ self.typedefs[name] = typedef.idl_type
+ self.additional_includes = set()
+ definitions.accept(self)
+ self._update_dependencies_include_paths(definition_name)
+
+ def _update_dependencies_include_paths(self, definition_name):
+ interface_info = self.info_provider.interfaces_info[definition_name]
+ dependencies_include_paths = interface_info['dependencies_include_paths']
+ for include_path in self.additional_includes:
+ if include_path not in dependencies_include_paths:
+ dependencies_include_paths.append(include_path)
+
+ def _resolve_typedefs(self, typed_object):
+ """Resolve typedefs to actual types in the object."""
+ for attribute_name in typed_object.idl_type_attributes:
+ try:
+ idl_type = getattr(typed_object, attribute_name)
+ except AttributeError:
+ continue
+ if not idl_type:
+ continue
+ resolved_idl_type = idl_type.resolve_typedefs(self.typedefs)
+ if depends_on_union_types(resolved_idl_type):
+ self.additional_includes.add(
+ self.info_provider.include_path_for_union_types)
+ # Need to re-assign the attribute, not just mutate idl_type, since
+ # type(idl_type) may change.
+ setattr(typed_object, attribute_name, resolved_idl_type)
+
+ def visit_typed_object(self, typed_object):
+ self._resolve_typedefs(typed_object)
+
+
class CodeGeneratorBase(object):
"""Base class for v8 bindings generator and IDL dictionary impl generator"""
- def __init__(self, interfaces_info, cache_dir, output_dir):
- interfaces_info = interfaces_info or {}
- self.interfaces_info = interfaces_info
+ def __init__(self, info_provider, cache_dir, output_dir):
+ self.info_provider = info_provider
self.jinja_env = initialize_jinja_env(cache_dir)
self.output_dir = output_dir
-
- # Set global type info
- idl_types.set_ancestors(interfaces_info['ancestors'])
- IdlType.set_callback_interfaces(interfaces_info['callback_interfaces'])
- IdlType.set_dictionaries(interfaces_info['dictionaries'])
- IdlType.set_implemented_as_interfaces(interfaces_info['implemented_as_interfaces'])
- IdlType.set_garbage_collected_types(interfaces_info['garbage_collected_interfaces'])
- IdlType.set_will_be_garbage_collected_types(interfaces_info['will_be_garbage_collected_interfaces'])
- v8_types.set_component_dirs(interfaces_info['component_dirs'])
+ self.typedef_resolver = TypedefResolver(info_provider)
+ set_global_type_info(info_provider)
def generate_code(self, definitions, definition_name):
"""Returns .h/.cpp code as ((path, content)...)."""
# Set local type info
+ if not should_generate_code(definitions):
+ return set()
+
IdlType.set_callback_functions(definitions.callback_functions.keys())
- IdlType.set_enums((enum.name, enum.values)
- for enum in definitions.enumerations.values())
+ # Resolve typedefs
+ self.typedef_resolver.resolve(definitions, definition_name)
return self.generate_code_internal(definitions, definition_name)
def generate_code_internal(self, definitions, definition_name):
@@ -128,8 +199,8 @@
class CodeGeneratorV8(CodeGeneratorBase):
- def __init__(self, interfaces_info, cache_dir, output_dir):
- CodeGeneratorBase.__init__(self, interfaces_info, cache_dir, output_dir)
+ def __init__(self, info_provider, cache_dir, output_dir):
+ CodeGeneratorBase.__init__(self, info_provider, cache_dir, output_dir)
def output_paths(self, definition_name):
header_path = posixpath.join(self.output_dir,
@@ -152,11 +223,24 @@
# Store other interfaces for introspection
interfaces.update(definitions.interfaces)
+ interface_info = self.info_provider.interfaces_info[interface_name]
+ full_path = interface_info.get('full_path')
+ component = idl_filename_to_component(full_path)
+ include_paths = interface_info.get('dependencies_include_paths')
+
# Select appropriate Jinja template and contents function
if interface.is_callback:
header_template_filename = 'callback_interface.h'
cpp_template_filename = 'callback_interface.cpp'
interface_context = v8_callback_interface.callback_interface_context
+ elif interface.is_partial:
+ interface_context = v8_interface.interface_context
+ header_template_filename = 'partial_interface.h'
+ cpp_template_filename = 'partial_interface.cpp'
+ interface_name += 'Partial'
+ assert component == 'core'
+ component = 'modules'
+ include_paths = interface_info.get('dependencies_other_component_include_paths')
else:
header_template_filename = 'interface.h'
cpp_template_filename = 'interface.cpp'
@@ -164,13 +248,18 @@
header_template = self.jinja_env.get_template(header_template_filename)
cpp_template = self.jinja_env.get_template(cpp_template_filename)
- interface_info = self.interfaces_info[interface_name]
-
template_context = interface_context(interface)
+ if not interface.is_partial and not is_testing_target(full_path):
+ template_context['header_includes'].add(self.info_provider.include_path_for_export)
+ template_context['exported'] = self.info_provider.specifier_for_export
# Add the include for interface itself
- template_context['header_includes'].add(interface_info['include_path'])
+ if IdlType(interface_name).is_typed_array:
+ template_context['header_includes'].add('core/dom/DOMTypedArray.h')
+ elif interface_info['include_path']:
+ template_context['header_includes'].add(interface_info['include_path'])
header_text, cpp_text = render_template(
- interface_info, header_template, cpp_template, template_context)
+ include_paths, header_template, cpp_template, template_context,
+ component)
header_path, cpp_path = self.output_paths(interface_name)
return (
(header_path, header_text),
@@ -179,14 +268,21 @@
def generate_dictionary_code(self, definitions, dictionary_name,
dictionary):
+ interfaces_info = self.info_provider.interfaces_info
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)
- interface_info = self.interfaces_info[dictionary_name]
+ interface_info = interfaces_info[dictionary_name]
+ template_context = v8_dictionary.dictionary_context(
+ dictionary, interfaces_info)
+ include_paths = interface_info.get('dependencies_include_paths')
# Add the include for interface itself
- template_context['header_includes'].add(interface_info['include_path'])
+ if interface_info['include_path']:
+ template_context['header_includes'].add(interface_info['include_path'])
+ if not is_testing_target(interface_info.get('full_path')):
+ template_context['header_includes'].add(self.info_provider.include_path_for_export)
+ template_context['exported'] = self.info_provider.specifier_for_export
header_text, cpp_text = render_template(
- interface_info, header_template, cpp_template, template_context)
+ include_paths, header_template, cpp_template, template_context)
header_path, cpp_path = self.output_paths(dictionary_name)
return (
(header_path, header_text),
@@ -195,8 +291,8 @@
class CodeGeneratorDictionaryImpl(CodeGeneratorBase):
- def __init__(self, interfaces_info, cache_dir, output_dir):
- CodeGeneratorBase.__init__(self, interfaces_info, cache_dir, output_dir)
+ def __init__(self, info_provider, cache_dir, output_dir):
+ CodeGeneratorBase.__init__(self, info_provider, cache_dir, output_dir)
def output_paths(self, definition_name, interface_info):
output_dir = posixpath.join(self.output_dir,
@@ -208,16 +304,81 @@
def generate_code_internal(self, definitions, definition_name):
if not definition_name in definitions.dictionaries:
raise ValueError('%s is not an IDL dictionary')
+ interfaces_info = self.info_provider.interfaces_info
dictionary = definitions.dictionaries[definition_name]
- interface_info = self.interfaces_info[definition_name]
+ interface_info = interfaces_info[definition_name]
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)
+ dictionary, interfaces_info)
+ include_paths = interface_info.get('dependencies_include_paths')
+ # Add union containers header file to header_includes rather than
+ # cpp file so that union containers can be used in dictionary headers.
+ union_container_headers = [header for header in include_paths
+ if header.find('UnionTypes') > 0]
+ include_paths = [header for header in include_paths
+ if header not in union_container_headers]
+ template_context['header_includes'].update(union_container_headers)
+ if not is_testing_target(interface_info.get('full_path')):
+ template_context['exported'] = self.info_provider.specifier_for_export
+ template_context['header_includes'].add(self.info_provider.include_path_for_export)
header_text, cpp_text = render_template(
- interface_info, header_template, cpp_template, template_context)
+ include_paths, header_template, cpp_template, template_context)
header_path, cpp_path = self.output_paths(
- definition_name, interface_info)
+ cpp_name(dictionary), interface_info)
+ return (
+ (header_path, header_text),
+ (cpp_path, cpp_text),
+ )
+
+
+class CodeGeneratorUnionType(object):
+ """Generates union type container classes.
+ This generator is different from CodeGeneratorV8 and
+ CodeGeneratorDictionaryImpl. It assumes that all union types are already
+ collected. It doesn't process idl files directly.
+ """
+ def __init__(self, info_provider, cache_dir, output_dir, target_component):
+ self.info_provider = info_provider
+ self.jinja_env = initialize_jinja_env(cache_dir)
+ self.output_dir = output_dir
+ self.target_component = target_component
+ set_global_type_info(info_provider)
+
+ def generate_code(self):
+ union_types = self.info_provider.union_types
+ if not union_types:
+ return ()
+ header_template = self.jinja_env.get_template('union.h')
+ cpp_template = self.jinja_env.get_template('union.cpp')
+ template_context = v8_union.union_context(
+ union_types, self.info_provider.interfaces_info)
+ template_context['code_generator'] = module_pyname
+ capitalized_component = self.target_component.capitalize()
+ template_context['exported'] = self.info_provider.specifier_for_export
+ template_context['header_filename'] = 'bindings/%s/v8/UnionTypes%s.h' % (
+ self.target_component, capitalized_component)
+ template_context['macro_guard'] = 'UnionType%s_h' % capitalized_component
+ additional_header_includes = [self.info_provider.include_path_for_export]
+
+ # Add UnionTypesCore.h as a dependency when we generate modules union types
+ # because we only generate union type containers which are used by both
+ # core and modules in UnionTypesCore.h.
+ # FIXME: This is an ad hoc workaround and we need a general way to
+ # handle core <-> modules dependency.
+ if self.target_component == 'modules':
+ additional_header_includes.append(
+ 'bindings/core/v8/UnionTypesCore.h')
+
+ template_context['header_includes'] = sorted(
+ template_context['header_includes'] + additional_header_includes)
+
+ header_text = header_template.render(template_context)
+ cpp_text = cpp_template.render(template_context)
+ header_path = posixpath.join(self.output_dir,
+ 'UnionTypes%s.h' % capitalized_component)
+ cpp_path = posixpath.join(self.output_dir,
+ 'UnionTypes%s.cpp' % capitalized_component)
return (
(header_path, header_text),
(cpp_path, cpp_text),
@@ -237,7 +398,6 @@
'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
@@ -268,13 +428,6 @@
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:
diff --git a/bindings/scripts/compute_interfaces_info_individual.py b/bindings/scripts/compute_interfaces_info_individual.py
index 58f6790..b052e14 100755
--- a/bindings/scripts/compute_interfaces_info_individual.py
+++ b/bindings/scripts/compute_interfaces_info_individual.py
@@ -47,24 +47,26 @@
import posixpath
import sys
-from utilities import get_file_contents, read_file_to_list, idl_filename_to_interface_name, idl_filename_to_component, 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
+from idl_definitions import Visitor
+from idl_reader import IdlReader
+from utilities import get_file_contents, read_file_to_list, idl_filename_to_interface_name, idl_filename_to_component, write_pickle_file, get_interface_extended_attributes_from_idl, is_callback_interface_from_idl
module_path = os.path.dirname(__file__)
source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
-# Global variables (filled in and exported)
-interfaces_info = {}
-partial_interface_files = defaultdict(lambda: {
- 'full_paths': [],
- 'include_paths': [],
-})
+
+class IdlBadFilenameError(Exception):
+ """Raised if an IDL filename disagrees with the interface name in the file."""
+ pass
def parse_options():
usage = 'Usage: %prog [options] [generated1.idl]...'
parser = optparse.OptionParser(usage=usage)
+ parser.add_option('--cache-directory', help='cache directory')
parser.add_option('--idl-files-list', help='file listing IDL files')
- parser.add_option('--interfaces-info-file', help='output pickle file')
+ parser.add_option('--interfaces-info-file', help='interface info pickle file')
+ parser.add_option('--component-info-file', help='component wide info pickle file')
parser.add_option('--write-file-only-if-changed', type='int', help='if true, do not write an output file if it would be identical to the existing one, which avoids unnecessary rebuilds in ninja')
options, args = parser.parse_args()
@@ -104,68 +106,165 @@
return posixpath.join(relative_dir, cpp_class_name + '.h')
-def add_paths_to_partials_dict(partial_interface_name, full_path, this_include_path=None):
- paths_dict = partial_interface_files[partial_interface_name]
- paths_dict['full_paths'].append(full_path)
- if this_include_path:
- paths_dict['include_paths'].append(this_include_path)
+def get_implements_from_definitions(definitions, definition_name):
+ left_interfaces = []
+ right_interfaces = []
+ for implement in definitions.implements:
+ if definition_name == implement.left_interface:
+ right_interfaces.append(implement.right_interface)
+ elif definition_name == implement.right_interface:
+ left_interfaces.append(implement.left_interface)
+ else:
+ raise IdlBadFilenameError(
+ 'implements statement found in unrelated IDL file.\n'
+ 'Statement is:\n'
+ ' %s implements %s;\n'
+ 'but filename is unrelated "%s.idl"' %
+ (implement.left_interface, implement.right_interface, definition_name))
+ return left_interfaces, right_interfaces
-def compute_info_individual(idl_filename):
- full_path = os.path.realpath(idl_filename)
- idl_file_contents = get_file_contents(full_path)
-
- extended_attributes = get_interface_extended_attributes_from_idl(idl_file_contents)
- implemented_as = extended_attributes.get('ImplementedAs')
- relative_dir = relative_dir_posix(idl_filename)
- this_include_path = None if 'NoImplHeader' in extended_attributes else include_path(idl_filename, implemented_as)
-
- # Handle partial interfaces
- partial_interface_name = get_partial_interface_name_from_idl(idl_file_contents)
- if partial_interface_name:
- add_paths_to_partials_dict(partial_interface_name, full_path, this_include_path)
- return
-
- # If not a partial interface, the basename is the interface name
- interface_name = idl_filename_to_interface_name(idl_filename)
-
- # 'implements' statements can be included in either the file for the
- # implement*ing* interface (lhs of 'implements') or implement*ed* interface
- # (rhs of 'implements'). Store both for now, then merge to implement*ing*
- # interface later.
- left_interfaces, right_interfaces = get_implements_from_idl(idl_file_contents, interface_name)
-
- interfaces_info[interface_name] = {
- 'extended_attributes': extended_attributes,
- 'full_path': full_path,
- 'implemented_as': implemented_as,
- '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,
- '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],
- # is_callback_interface, ancestors, and inherited extended attributes):
- # deep dependencies.
- # These cause rebuilds of referrers, due to the dependency, so these
- # should be minimized; currently only targets of [PutForwards].
- 'referenced_interfaces': get_put_forward_interfaces_from_idl(idl_file_contents),
- 'relative_dir': relative_dir,
- }
+def get_put_forward_interfaces_from_definition(definition):
+ return sorted(set(attribute.idl_type.base_type
+ for attribute in definition.attributes
+ if 'PutForwards' in attribute.extended_attributes))
-def info_individual():
- """Returns info packaged as a dict."""
- return {
- 'interfaces_info': interfaces_info,
- # Can't pickle defaultdict, convert to dict
- 'partial_interface_files': dict(partial_interface_files),
- }
+def collect_union_types_from_definitions(definitions):
+ """Traverse definitions and collect all union types."""
+ class UnionTypeCollector(Visitor):
+ def collect(self, definitions):
+ self._union_types = set()
+ definitions.accept(self)
+ return self._union_types
+
+ def visit_typed_object(self, typed_object):
+ for attribute_name in typed_object.idl_type_attributes:
+ attribute = getattr(typed_object, attribute_name, None)
+ if not attribute:
+ continue
+ for idl_type in attribute.idl_types():
+ if idl_type.is_union_type:
+ self._union_types.add(idl_type)
+
+ return UnionTypeCollector().collect(definitions)
+
+
+class InterfaceInfoCollector(object):
+ """A class that collects interface information from idl files."""
+ def __init__(self, cache_directory=None):
+ self.reader = IdlReader(interfaces_info=None, outputdir=cache_directory)
+ self.interfaces_info = {}
+ self.partial_interface_files = defaultdict(lambda: {
+ 'full_paths': [],
+ 'include_paths': [],
+ })
+ self.enumerations = set()
+ self.union_types = set()
+ self.typedefs = {}
+
+ def add_paths_to_partials_dict(self, partial_interface_name, full_path,
+ include_paths):
+ paths_dict = self.partial_interface_files[partial_interface_name]
+ paths_dict['full_paths'].append(full_path)
+ paths_dict['include_paths'].extend(include_paths)
+
+ def collect_info(self, idl_filename):
+ """Reads an idl file and collects information which is required by the
+ binding code generation."""
+ definitions = self.reader.read_idl_file(idl_filename)
+
+ this_union_types = collect_union_types_from_definitions(definitions)
+ self.union_types.update(this_union_types)
+ self.typedefs.update(definitions.typedefs)
+ # Check enum duplication.
+ for enum_name in definitions.enumerations.keys():
+ for defined_enum in self.enumerations:
+ if defined_enum.name == enum_name:
+ raise Exception('Enumeration %s has multiple definitions' % enum_name)
+ self.enumerations.update(definitions.enumerations.values())
+
+ if definitions.interfaces:
+ definition = next(definitions.interfaces.itervalues())
+ interface_info = {
+ 'is_callback_interface': definition.is_callback,
+ 'is_dictionary': False,
+ # Interfaces that are referenced (used as types) and that we
+ # introspect during code generation (beyond interface-level
+ # data ([ImplementedAs], is_callback_interface, ancestors, and
+ # inherited extended attributes): deep dependencies.
+ # These cause rebuilds of referrers, due to the dependency,
+ # so these should be minimized; currently only targets of
+ # [PutForwards].
+ 'referenced_interfaces': get_put_forward_interfaces_from_definition(definition),
+ }
+ elif definitions.dictionaries:
+ definition = next(definitions.dictionaries.itervalues())
+ interface_info = {
+ 'is_callback_interface': False,
+ 'is_dictionary': True,
+ 'referenced_interfaces': None,
+ }
+ else:
+ return
+
+ extended_attributes = definition.extended_attributes
+ implemented_as = extended_attributes.get('ImplementedAs')
+ full_path = os.path.realpath(idl_filename)
+ this_include_path = None if 'NoImplHeader' in extended_attributes else include_path(idl_filename, implemented_as)
+ if definition.is_partial:
+ # We don't create interface_info for partial interfaces, but
+ # adds paths to another dict.
+ partial_include_paths = []
+ if this_include_path:
+ partial_include_paths.append(this_include_path)
+ if this_union_types:
+ component = idl_filename_to_component(idl_filename)
+ partial_include_paths.append(
+ 'bindings/%s/v8/UnionTypes%s.h' % (component, component.capitalize()))
+ self.add_paths_to_partials_dict(definition.name, full_path, partial_include_paths)
+ return
+
+ # 'implements' statements can be included in either the file for the
+ # implement*ing* interface (lhs of 'implements') or implement*ed* interface
+ # (rhs of 'implements'). Store both for now, then merge to implement*ing*
+ # interface later.
+ left_interfaces, right_interfaces = get_implements_from_definitions(
+ definitions, definition.name)
+
+ interface_info.update({
+ 'extended_attributes': extended_attributes,
+ 'full_path': full_path,
+ 'has_union_types': bool(this_union_types),
+ 'implemented_as': implemented_as,
+ 'implemented_by_interfaces': left_interfaces,
+ 'implements_interfaces': right_interfaces,
+ 'include_path': this_include_path,
+ # FIXME: temporary private field, while removing old treatement of
+ # 'implements': http://crbug.com/360435
+ 'is_legacy_treat_as_partial_interface': 'LegacyTreatAsPartialInterface' in extended_attributes,
+ 'parent': definition.parent,
+ 'relative_dir': relative_dir_posix(idl_filename),
+ })
+ self.interfaces_info[definition.name] = interface_info
+
+ def get_info_as_dict(self):
+ """Returns info packaged as a dict."""
+ return {
+ 'interfaces_info': self.interfaces_info,
+ # Can't pickle defaultdict, convert to dict
+ # FIXME: this should be included in get_component_info.
+ 'partial_interface_files': dict(self.partial_interface_files),
+ }
+
+ def get_component_info_as_dict(self):
+ """Returns component wide information as a dict."""
+ return {
+ 'enumerations': dict((enum.name, enum.values)
+ for enum in self.enumerations),
+ 'typedefs': self.typedefs,
+ 'union_types': self.union_types,
+ }
################################################################################
@@ -184,13 +283,16 @@
# Compute information for individual files
# Information is stored in global variables interfaces_info and
# partial_interface_files.
+ info_collector = InterfaceInfoCollector(options.cache_directory)
for idl_filename in idl_files:
- compute_info_individual(idl_filename)
+ info_collector.collect_info(idl_filename)
write_pickle_file(options.interfaces_info_file,
- info_individual(),
+ info_collector.get_info_as_dict(),
options.write_file_only_if_changed)
-
+ write_pickle_file(options.component_info_file,
+ info_collector.get_component_info_as_dict(),
+ options.write_file_only_if_changed)
if __name__ == '__main__':
sys.exit(main())
diff --git a/bindings/scripts/compute_interfaces_info_overall.py b/bindings/scripts/compute_interfaces_info_overall.py
index 6e31121..928a911 100755
--- a/bindings/scripts/compute_interfaces_info_overall.py
+++ b/bindings/scripts/compute_interfaces_info_overall.py
@@ -68,6 +68,11 @@
'include_path': path for use in C++ #include directives
'dependencies_full_paths': paths to dependencies (for merging into main)
'dependencies_include_paths': paths for use in C++ #include directives
+ 'dependencies_other_component_full_paths':
+ paths to dependencies (cannot merge because of other component)
+ 'dependencies_other_component_include_paths':
+ paths for use in C++ #include directives because of dependencies in
+ other component
Note that all of these are stable information, unlikely to change without
moving or deleting files (hence requiring a full rebuild anyway) or significant
@@ -86,8 +91,9 @@
INHERITED_EXTENDED_ATTRIBUTES = set([
'ActiveDOMObject',
'DependentLifetime',
+ 'DoNotExposeJSAccessors',
+ 'ExposeJSAccessors',
'GarbageCollected',
- 'NotScriptWrappable',
'WillBeGarbageCollected',
])
@@ -268,18 +274,46 @@
for implemented_interface_info in implemented_interfaces_info:
if (implemented_interface_info['is_legacy_treat_as_partial_interface'] and
implemented_interface_info['include_path']):
- implemented_interfaces_include_paths.append(implemented_interface_info['include_path'])
+ implemented_interfaces_include_paths.append(
+ implemented_interface_info['include_path'])
+
+ dependencies_full_paths = implemented_interfaces_full_paths
+ dependencies_include_paths = implemented_interfaces_include_paths
+ dependencies_other_component_full_paths = []
+ dependencies_other_component_include_paths = []
+
+ component = idl_filename_to_component(interface_info['full_path'])
+ for full_path in partial_interfaces_full_paths:
+ partial_interface_component = idl_filename_to_component(full_path)
+ if component == partial_interface_component:
+ dependencies_full_paths.append(full_path)
+ else:
+ dependencies_other_component_full_paths.append(full_path)
+
+ for include_path in partial_interfaces_include_paths:
+ partial_interface_component = idl_filename_to_component(include_path)
+ if component == partial_interface_component:
+ dependencies_include_paths.append(include_path)
+ else:
+ dependencies_other_component_include_paths.append(include_path)
+
+ if interface_info['has_union_types']:
+ dependencies_include_paths.append(
+ 'bindings/%s/v8/UnionTypes%s.h' % (component, component.capitalize()))
interface_info.update({
- 'dependencies_full_paths': (partial_interfaces_full_paths +
- implemented_interfaces_full_paths),
- 'dependencies_include_paths': (partial_interfaces_include_paths +
- implemented_interfaces_include_paths),
+ 'dependencies_full_paths': dependencies_full_paths,
+ 'dependencies_include_paths': dependencies_include_paths,
+ 'dependencies_other_component_full_paths':
+ dependencies_other_component_full_paths,
+ 'dependencies_other_component_include_paths':
+ dependencies_other_component_include_paths,
})
# Clean up temporary private information
for interface_info in interfaces_info.itervalues():
del interface_info['extended_attributes']
+ del interface_info['has_union_types']
del interface_info['is_legacy_treat_as_partial_interface']
del interface_info['parent']
diff --git a/bindings/scripts/generate_event_interfaces.py b/bindings/scripts/generate_event_interfaces.py
index b222cb4..e6ed37e 100755
--- a/bindings/scripts/generate_event_interfaces.py
+++ b/bindings/scripts/generate_event_interfaces.py
@@ -99,6 +99,9 @@
lines = ['namespace="Event"\n']
if suffix:
lines.append('suffix="' + suffix + '"\n')
+ lines.append('export=%s_EXPORT\n' % suffix.upper())
+ else:
+ lines.append('export=CORE_EXPORT\n')
lines.append('\n')
interface_lines = [interface_line(event_idl_file)
for event_idl_file in event_idl_files]
diff --git a/bindings/scripts/generate_global_constructors.py b/bindings/scripts/generate_global_constructors.py
index 1be2ac3..5ad7ff6 100755
--- a/bindings/scripts/generate_global_constructors.py
+++ b/bindings/scripts/generate_global_constructors.py
@@ -24,8 +24,10 @@
import re
import sys
+from v8_utilities import EXPOSED_EXECUTION_CONTEXT_METHOD
+
from collections import defaultdict
-from utilities import get_file_contents, idl_filename_to_interface_name, read_file_to_list, write_file, get_interface_extended_attributes_from_idl, is_callback_interface_from_idl
+from utilities import should_generate_impl_file_from_idl, get_file_contents, idl_filename_to_interface_name, read_file_to_list, write_file, get_interface_extended_attributes_from_idl, get_interface_exposed_arguments, is_callback_interface_from_idl
interface_name_to_global_names = {}
global_name_to_constructors = defaultdict(list)
@@ -77,25 +79,33 @@
# Callback interfaces with constants also have interface properties,
# but there are none of these in Blink.
# http://heycam.github.io/webidl/#es-interfaces
- if (is_callback_interface_from_idl(idl_file_contents) or
+ if ((not should_generate_impl_file_from_idl(idl_file_contents)) or
+ is_callback_interface_from_idl(idl_file_contents) or
'NoInterfaceObject' in extended_attributes):
return
- # The [Exposed] extended attribute MUST take an identifier list. Each
- # identifier in the list MUST be a global name. An interface or interface
- # 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.
- 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)
+ exposed_arguments = get_interface_exposed_arguments(idl_file_contents)
+ if exposed_arguments:
+ # Exposed(Arguments) case
+ for argument in exposed_arguments:
+ if 'RuntimeEnabled' in extended_attributes:
+ raise ValueError('RuntimeEnabled should not be used with Exposed(Arguments)')
+ attributes = extended_attributes.copy()
+ attributes['RuntimeEnabled'] = argument['runtime_enabled']
+ new_constructors_list = generate_global_constructors_list(interface_name, attributes)
+ global_name_to_constructors[argument['exposed']].extend(new_constructors_list)
+ else:
+ # Exposed=env or Exposed=(env1,...) case
+ exposed_global_names = extended_attributes.get('Exposed', 'Window').strip('()').split(',')
+ new_constructors_list = generate_global_constructors_list(interface_name, extended_attributes)
+ for name in exposed_global_names:
+ global_name_to_constructors[name].extend(new_constructors_list)
def generate_global_constructors_list(interface_name, extended_attributes):
extended_attributes_list = [
name + '=' + extended_attributes[name]
- for name in 'Conditional', 'PerContextEnabled', 'RuntimeEnabled'
+ for name in 'Conditional', 'RuntimeEnabled'
if name in extended_attributes]
if extended_attributes_list:
extended_string = '[%s] ' % ', '.join(extended_attributes_list)
@@ -158,7 +168,7 @@
record_global_constructors(idl_filename)
# Check for [Exposed] / [Global] mismatch.
- known_global_names = frozenset(itertools.chain.from_iterable(interface_name_to_global_names.values()))
+ known_global_names = EXPOSED_EXECUTION_CONTEXT_METHOD.keys()
exposed_global_names = frozenset(global_name_to_constructors)
if not exposed_global_names.issubset(known_global_names):
unknown_global_names = exposed_global_names.difference(known_global_names)
diff --git a/bindings/scripts/generate_init_partial_interfaces.py b/bindings/scripts/generate_init_partial_interfaces.py
new file mode 100755
index 0000000..25a97f8
--- /dev/null
+++ b/bindings/scripts/generate_init_partial_interfaces.py
@@ -0,0 +1,84 @@
+#!/usr/bin/python
+# 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 initPartialInterfacesInModules(), which registers partial interfaces in modules to core interfaces."""
+
+import cPickle as pickle
+from optparse import OptionParser
+import os
+import posixpath
+import sys
+from utilities import write_file
+
+from aggregate_generated_bindings import extract_meta_data
+from utilities import read_idl_files_list_from_file
+
+
+_COPYRIGHT = """// 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.
+
+"""
+
+_INIT_PARTIAL_INTERFACE = """%s
+#include "config.h"
+
+%s
+
+namespace blink {
+
+void initPartialInterfacesInModules()
+{
+%s
+}
+
+} // namespace blink
+"""
+
+
+def parse_options():
+ usage = 'Usage: %prog [options]'
+ parser = OptionParser(usage=usage)
+ parser.add_option('--idl-files-list', help="a text file containing the IDL file paths, so the command line doesn't exceed OS length limits.")
+ parser.add_option('--write-file-only-if-changed', type='int', help='if true, do not write an output file if it would be identical to the existing one, which avoids unnecessary rebuilds in ninja')
+ parser.add_option('--output')
+
+ options, args = parser.parse_args()
+ if options.output is None:
+ parser.error('Must specify output file using --output.')
+ if options.idl_files_list is None:
+ parser.error('Must specify a list of IDL files using --idl-files-list.')
+ if options.write_file_only_if_changed is None:
+ parser.error('Must specify whether file is only written if changed using --write-file-only-if-changed.')
+ options.write_file_only_if_changed = bool(options.write_file_only_if_changed)
+ return options
+
+
+def main():
+ options = parse_options()
+
+ idl_file_names = read_idl_files_list_from_file(options.idl_files_list)
+
+ meta_data_list = extract_meta_data(idl_file_names)
+ interface_names = ['V8%sPartial' % meta_data['name']
+ for meta_data in meta_data_list]
+ interface_names.sort()
+
+ includes = ['#include "bindings/modules/v8/%s.h"' % interface_name
+ for interface_name in interface_names]
+ initialize_calls = [' %s::initialize();' % interface_name
+ for interface_name in interface_names]
+
+ content = _INIT_PARTIAL_INTERFACE % (
+ _COPYRIGHT,
+ '\n'.join(includes),
+ '\n'.join(initialize_calls))
+
+ write_file(content, options.output,
+ only_if_changed=options.write_file_only_if_changed)
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/bindings/scripts/idl_compiler.py b/bindings/scripts/idl_compiler.py
index 3721e12..7734def 100755
--- a/bindings/scripts/idl_compiler.py
+++ b/bindings/scripts/idl_compiler.py
@@ -38,20 +38,26 @@
import cPickle as pickle
import sys
-from code_generator_v8 import CodeGeneratorDictionaryImpl, CodeGeneratorV8
+from code_generator_v8 import CodeGeneratorDictionaryImpl, CodeGeneratorV8, CodeGeneratorUnionType
from idl_reader import IdlReader
-from utilities import read_idl_files_list_from_file, write_file, idl_filename_to_component
+from utilities import create_component_info_provider, read_idl_files_list_from_file, write_file, idl_filename_to_component
def parse_options():
parser = OptionParser()
parser.add_option('--cache-directory',
help='cache directory, defaults to output directory')
- parser.add_option('--generate-dictionary-impl',
+ parser.add_option('--generate-impl',
action="store_true", default=False)
parser.add_option('--output-directory')
- parser.add_option('--interfaces-info-file')
+ parser.add_option('--impl-output-directory')
+ parser.add_option('--info-dir')
parser.add_option('--write-file-only-if-changed', type='int')
+ # FIXME: We should always explicitly specify --target-component and
+ # remove the default behavior.
+ parser.add_option('--target-component',
+ help='target component to generate code, defaults to '
+ 'component of input idl file')
# ensure output comes last, so command line easy to parse via regexes
parser.disable_interspersed_args()
@@ -81,33 +87,34 @@
"""
__metaclass__ = abc.ABCMeta
- def __init__(self, output_directory, cache_directory='',
- code_generator=None, interfaces_info=None,
- interfaces_info_filename='', only_if_changed=False):
+ def __init__(self, output_directory, cache_directory=None,
+ code_generator=None, info_provider=None,
+ only_if_changed=False, target_component=None):
"""
Args:
- interfaces_info:
- interfaces_info dict
- (avoids auxiliary file in run-bindings-tests)
- interfaces_info_file: filename of pickled interfaces_info
+ output_directory: directory to put output files.
+ cache_directory: directory which contains PLY caches.
+ code_generator: code generator to be used.
+ info_provider: component-specific information provider.
+ only_if_changed: True when the compiler should only write output files
+ when the contents are changed.
+ target_component: component to be processed.
"""
- cache_directory = cache_directory or output_directory
self.cache_directory = cache_directory
self.code_generator = code_generator
- if interfaces_info_filename:
- with open(interfaces_info_filename) as interfaces_info_file:
- interfaces_info = pickle.load(interfaces_info_file)
- self.interfaces_info = interfaces_info
+ self.info_provider = info_provider
self.only_if_changed = only_if_changed
self.output_directory = output_directory
- self.reader = IdlReader(interfaces_info, cache_directory)
+ self.target_component = target_component
+ self.reader = IdlReader(info_provider.interfaces_info, cache_directory)
def compile_and_write(self, idl_filename):
interface_name = idl_filename_to_interface_name(idl_filename)
- component = idl_filename_to_component(idl_filename)
definitions = self.reader.read_idl_definitions(idl_filename)
+ target_component = self.target_component or idl_filename_to_component(idl_filename)
+ target_definitions = definitions[target_component]
output_code_list = self.code_generator.generate_code(
- definitions[component], interface_name)
+ target_definitions, interface_name)
for output_path, output_code in output_code_list:
write_file(output_code, output_path, self.only_if_changed)
@@ -119,7 +126,7 @@
class IdlCompilerV8(IdlCompiler):
def __init__(self, *args, **kwargs):
IdlCompiler.__init__(self, *args, **kwargs)
- self.code_generator = CodeGeneratorV8(self.interfaces_info,
+ self.code_generator = CodeGeneratorV8(self.info_provider,
self.cache_directory,
self.output_directory)
@@ -131,26 +138,31 @@
def __init__(self, *args, **kwargs):
IdlCompiler.__init__(self, *args, **kwargs)
self.code_generator = CodeGeneratorDictionaryImpl(
- self.interfaces_info, self.cache_directory, self.output_directory)
+ self.info_provider, self.cache_directory, self.output_directory)
def compile_file(self, idl_filename):
self.compile_and_write(idl_filename)
def generate_bindings(options, input_filename):
+ info_provider = create_component_info_provider(
+ options.info_dir, options.target_component)
idl_compiler = IdlCompilerV8(
options.output_directory,
cache_directory=options.cache_directory,
- interfaces_info_filename=options.interfaces_info_file,
- only_if_changed=options.write_file_only_if_changed)
+ info_provider=info_provider,
+ only_if_changed=options.write_file_only_if_changed,
+ target_component=options.target_component)
idl_compiler.compile_file(input_filename)
def generate_dictionary_impl(options, input_filename):
+ info_provider = create_component_info_provider(
+ options.info_dir, options.target_component)
idl_compiler = IdlCompilerDictionaryImpl(
- options.output_directory,
+ options.impl_output_directory,
cache_directory=options.cache_directory,
- interfaces_info_filename=options.interfaces_info_file,
+ info_provider=info_provider,
only_if_changed=options.write_file_only_if_changed)
idl_filenames = read_idl_files_list_from_file(input_filename)
@@ -158,12 +170,29 @@
idl_compiler.compile_file(idl_filename)
+def generate_union_type_containers(options):
+ info_provider = create_component_info_provider(
+ options.info_dir, options.target_component)
+ if not info_provider.interfaces_info:
+ raise Exception('Interfaces info is required to generate '
+ 'union types containers')
+ generator = CodeGeneratorUnionType(
+ info_provider,
+ options.cache_directory,
+ options.output_directory,
+ options.target_component)
+ output_code_list = generator.generate_code()
+ for output_path, output_code in output_code_list:
+ write_file(output_code, output_path, options.write_file_only_if_changed)
+
+
def main():
options, input_filename = parse_options()
- if options.generate_dictionary_impl:
+ if options.generate_impl:
# |input_filename| should be a file which contains a list of IDL
# dictionary paths.
generate_dictionary_impl(options, input_filename)
+ generate_union_type_containers(options)
else:
# |input_filename| should be a path of an IDL file.
generate_bindings(options, input_filename)
diff --git a/bindings/scripts/idl_definitions.py b/bindings/scripts/idl_definitions.py
index ee7158a..59c0475 100644
--- a/bindings/scripts/idl_definitions.py
+++ b/bindings/scripts/idl_definitions.py
@@ -31,14 +31,10 @@
Classes are primarily constructors, which build an IdlDefinitions object
(and various contained objects) from an AST (produced by blink_idl_parser).
-This is in two steps:
-* Constructors walk the AST, creating objects.
-* Typedef resolution.
-
-Typedefs are all resolved here, and not stored in IR.
+IR stores typedefs and they are resolved by the code generator.
Typedef resolution uses some auxiliary classes and OOP techniques to make this
-a generic call, via the resolve_typedefs() method.
+a generic call. See TypedefResolver class in code_generator_v8.py.
Class hierarchy (mostly containment, '<' for inheritance):
@@ -51,11 +47,17 @@
IdlLiteral
IdlOperation < TypedObject
IdlArgument < TypedObject
+ IdlSerializer
IdlStringifier
+ IdlIterable < IdlIterableOrMaplikeOrSetlike
+ IdlMaplike < IdlIterableOrMaplikeOrSetlike
+ IdlSetlike < IdlIterableOrMaplikeOrSetlike
IdlException < IdlInterface
(same contents as IdlInterface)
-TypedObject :: mixin for typedef resolution
+TypedObject :: Object with one or more attributes that is a type.
+
+IdlArgument is 'picklable', as it is stored in interfaces_info.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
@@ -65,34 +67,20 @@
from idl_types import IdlType, IdlUnionType, IdlArrayType, IdlSequenceType, IdlNullableType
SPECIAL_KEYWORD_LIST = ['GETTER', 'SETTER', 'DELETER']
-STANDARD_TYPEDEFS = {
- # http://www.w3.org/TR/WebIDL/#common-DOMTimeStamp
- 'DOMTimeStamp': 'unsigned long long',
-}
################################################################################
-# TypedObject (mixin for typedef resolution)
+# TypedObject
################################################################################
class TypedObject(object):
"""Object with a type, such as an Attribute or Operation (return value).
The type can be an actual type, or can be a typedef, which must be resolved
- before passing data to the code generator.
+ by the TypedefResolver before passing data to the code generator.
"""
__metaclass__ = abc.ABCMeta
- idl_type = None
-
- def resolve_typedefs(self, typedefs):
- """Resolve typedefs to actual types in the object."""
- # Constructors don't have their own return type, because it's the
- # interface itself.
- if not self.idl_type:
- return
- # Need to re-assign self.idl_type, not just mutate idl_type,
- # since type(idl_type) may change.
- self.idl_type = self.idl_type.resolve_typedefs(typedefs)
+ idl_type_attributes = ('idl_type',)
################################################################################
@@ -105,17 +93,15 @@
self.callback_functions = {}
self.dictionaries = {}
self.enumerations = {}
+ self.implements = []
self.interfaces = {}
self.idl_name = idl_name
+ self.typedefs = {}
node_class = node.GetClass()
if node_class != 'File':
raise ValueError('Unrecognized node class: %s' % node_class)
- typedefs = dict((typedef_name, IdlType(type_name))
- for typedef_name, type_name in
- STANDARD_TYPEDEFS.iteritems())
-
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
@@ -127,8 +113,8 @@
# 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)
+ typedef = IdlTypedef(child)
+ self.typedefs[typedef.name] = typedef
elif child_class == 'Enum':
enumeration = IdlEnum(idl_name, child)
self.enumerations[enumeration.name] = enumeration
@@ -136,24 +122,23 @@
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
+ self.implements.append(IdlImplement(child))
elif child_class == 'Dictionary':
dictionary = IdlDictionary(idl_name, child)
self.dictionaries[dictionary.name] = dictionary
else:
raise ValueError('Unrecognized node class: %s' % child_class)
- # Typedefs are not stored in IR:
- # Resolve typedefs with the actual types and then discard the Typedefs.
- # http://www.w3.org/TR/WebIDL/#idl-typedefs
- self.resolve_typedefs(typedefs)
-
- def resolve_typedefs(self, typedefs):
- for callback_function in self.callback_functions.itervalues():
- callback_function.resolve_typedefs(typedefs)
+ def accept(self, visitor):
+ visitor.visit_definitions(self)
for interface in self.interfaces.itervalues():
- interface.resolve_typedefs(typedefs)
+ interface.accept(visitor)
+ for callback_function in self.callback_functions.itervalues():
+ callback_function.accept(visitor)
+ for dictionary in self.dictionaries.itervalues():
+ dictionary.accept(visitor)
+ for typedef in self.typedefs.itervalues():
+ typedef.accept(visitor)
def update(self, other):
"""Update with additional IdlDefinitions."""
@@ -196,10 +181,10 @@
self.idl_type = type_node_to_type(type_node)
self.arguments = arguments_node_to_arguments(idl_name, arguments_node)
- def resolve_typedefs(self, typedefs):
- TypedObject.resolve_typedefs(self, typedefs)
+ def accept(self, visitor):
+ visitor.visit_callback_function(self)
for argument in self.arguments:
- argument.resolve_typedefs(typedefs)
+ argument.accept(visitor)
################################################################################
@@ -209,7 +194,7 @@
class IdlDictionary(object):
def __init__(self, idl_name, node):
self.extended_attributes = {}
- self.is_partial = node.GetProperty('Partial') or False
+ self.is_partial = bool(node.GetProperty('Partial'))
self.idl_name = idl_name
self.name = node.GetName()
self.members = []
@@ -226,13 +211,19 @@
else:
raise ValueError('Unrecognized node class: %s' % child_class)
+ def accept(self, visitor):
+ visitor.visit_dictionary(self)
+ for member in self.members:
+ member.accept(visitor)
-class IdlDictionaryMember(object):
+
+class IdlDictionaryMember(TypedObject):
def __init__(self, idl_name, node):
self.default_value = None
self.extended_attributes = {}
self.idl_type = None
self.idl_name = idl_name
+ self.is_required = bool(node.GetProperty('REQUIRED'))
self.name = node.GetName()
for child in node.GetChildren():
child_class = child.GetClass()
@@ -246,6 +237,9 @@
else:
raise ValueError('Unrecognized node class: %s' % child_class)
+ def accept(self, visitor):
+ visitor.visit_dictionary_member(self)
+
################################################################################
# Enumerations
@@ -262,6 +256,21 @@
################################################################################
+# Typedefs
+################################################################################
+
+class IdlTypedef(object):
+ idl_type_attributes = ('idl_type',)
+
+ def __init__(self, node):
+ self.name = node.GetName()
+ self.idl_type = typedef_node_to_type(node)
+
+ def accept(self, visitor):
+ visitor.visit_typedef(self)
+
+
+################################################################################
# Interfaces and Exceptions
################################################################################
@@ -274,16 +283,23 @@
self.extended_attributes = {}
self.operations = []
self.parent = None
+ self.serializer = None
self.stringifier = None
+ self.iterable = None
+ self.maplike = None
+ self.setlike = None
+ self.original_interface = None
+ self.partial_interfaces = []
if not node: # Early exit for IdlException.__init__
return
- self.is_callback = node.GetProperty('CALLBACK') or False
+ self.is_callback = bool(node.GetProperty('CALLBACK'))
self.is_exception = False
# FIXME: uppercase 'Partial' => 'PARTIAL' in base IDL parser
- self.is_partial = node.GetProperty('Partial') or False
+ self.is_partial = bool(node.GetProperty('Partial'))
self.idl_name = idl_name
self.name = node.GetName()
+ self.idl_type = IdlType(self.name)
children = node.GetChildren()
for child in children:
@@ -302,23 +318,48 @@
self.operations.append(IdlOperation(idl_name, child))
elif child_class == 'Inherit':
self.parent = child.GetName()
+ elif child_class == 'Serializer':
+ self.serializer = IdlSerializer(idl_name, child)
+ self.process_serializer()
elif child_class == 'Stringifier':
self.stringifier = IdlStringifier(idl_name, child)
self.process_stringifier()
+ elif child_class == 'Iterable':
+ self.iterable = IdlIterable(idl_name, child)
+ elif child_class == 'Maplike':
+ self.maplike = IdlMaplike(idl_name, child)
+ elif child_class == 'Setlike':
+ self.setlike = IdlSetlike(idl_name, child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
- def resolve_typedefs(self, typedefs):
+ if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1:
+ raise ValueError('Interface can only have one of iterable<>, maplike<> and setlike<>.')
+
+ def accept(self, visitor):
+ visitor.visit_interface(self)
for attribute in self.attributes:
- attribute.resolve_typedefs(typedefs)
+ attribute.accept(visitor)
for constant in self.constants:
- constant.resolve_typedefs(typedefs)
+ constant.accept(visitor)
for constructor in self.constructors:
- constructor.resolve_typedefs(typedefs)
+ constructor.accept(visitor)
for custom_constructor in self.custom_constructors:
- custom_constructor.resolve_typedefs(typedefs)
+ custom_constructor.accept(visitor)
for operation in self.operations:
- operation.resolve_typedefs(typedefs)
+ operation.accept(visitor)
+ if self.iterable:
+ self.iterable.accept(visitor)
+ elif self.maplike:
+ self.maplike.accept(visitor)
+ elif self.setlike:
+ self.setlike.accept(visitor)
+
+ def process_serializer(self):
+ """Add the serializer's named operation child, if it has one, as a regular
+ operation of this interface."""
+ if self.serializer.operation:
+ self.operations.append(self.serializer.operation)
def process_stringifier(self):
"""Add the stringifier's attribute or named operation child, if it has
@@ -350,6 +391,7 @@
self.is_partial = False
self.idl_name = idl_name
self.name = node.GetName()
+ self.idl_type = IdlType(self.name)
children = node.GetChildren()
for child in children:
@@ -373,8 +415,8 @@
class IdlAttribute(TypedObject):
def __init__(self, idl_name, node):
- self.is_read_only = node.GetProperty('READONLY') or False
- self.is_static = node.GetProperty('STATIC') or False
+ self.is_read_only = bool(node.GetProperty('READONLY'))
+ self.is_static = bool(node.GetProperty('STATIC'))
self.idl_name = idl_name
self.name = node.GetName()
# Defaults, overridden below
@@ -391,6 +433,9 @@
else:
raise ValueError('Unrecognized node class: %s' % child_class)
+ def accept(self, visitor):
+ visitor.visit_attribute(self)
+
################################################################################
# Constants
@@ -427,6 +472,9 @@
else:
self.extended_attributes = {}
+ def accept(self, visitor):
+ visitor.visit_constant(self)
+
################################################################################
# Literals
@@ -474,7 +522,7 @@
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':
+ if idl_type in ['boolean', 'sequence']:
return IdlLiteral(idl_type, node.GetProperty('VALUE'))
if idl_type == 'NULL':
return IdlLiteralNull()
@@ -491,23 +539,24 @@
self.extended_attributes = {}
self.specials = []
self.is_constructor = False
+ self.idl_name = idl_name
+ self.idl_type = None
+ self.is_static = False
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_':
self.name = ''
- self.is_static = node.GetProperty('STATIC') or False
+ self.is_static = bool(node.GetProperty('STATIC'))
property_dictionary = node.GetProperties()
for special_keyword in SPECIAL_KEYWORD_LIST:
if special_keyword in property_dictionary:
self.specials.append(special_keyword.lower())
- self.idl_type = None
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
@@ -549,10 +598,10 @@
constructor.is_constructor = True
return constructor
- def resolve_typedefs(self, typedefs):
- TypedObject.resolve_typedefs(self, typedefs)
+ def accept(self, visitor):
+ visitor.visit_operation(self)
for argument in self.arguments:
- argument.resolve_typedefs(typedefs)
+ argument.accept(visitor)
################################################################################
@@ -560,15 +609,20 @@
################################################################################
class IdlArgument(TypedObject):
- def __init__(self, idl_name, node):
+ def __init__(self, idl_name, node=None):
self.extended_attributes = {}
self.idl_type = None
- self.is_optional = node.GetProperty('OPTIONAL') # syntax: (optional T)
+ self.is_optional = False # syntax: (optional T)
self.is_variadic = False # syntax: (T...)
self.idl_name = idl_name
- self.name = node.GetName()
self.default_value = None
+ if not node:
+ return
+
+ self.is_optional = node.GetProperty('OPTIONAL')
+ self.name = node.GetName()
+
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
@@ -580,12 +634,23 @@
child_name = child.GetName()
if child_name != '...':
raise ValueError('Unrecognized Argument node; expected "...", got "%s"' % child_name)
- self.is_variadic = child.GetProperty('ELLIPSIS') or False
+ self.is_variadic = bool(child.GetProperty('ELLIPSIS'))
elif child_class == 'Default':
self.default_value = default_node_to_idl_literal(child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
+ def __getstate__(self):
+ # FIXME: Return a picklable object which has enough information to
+ # unpickle.
+ return {}
+
+ def __setstate__(self, state):
+ pass
+
+ def accept(self, visitor):
+ visitor.visit_argument(self)
+
def arguments_node_to_arguments(idl_name, node):
# [Constructor] and [CustomConstructor] without arguments (the bare form)
@@ -599,6 +664,43 @@
################################################################################
+# Serializers
+################################################################################
+
+class IdlSerializer(object):
+ def __init__(self, idl_name, node):
+ self.attribute_name = node.GetProperty('ATTRIBUTE')
+ self.attribute_names = None
+ self.operation = None
+ self.extended_attributes = {}
+ self.is_attribute = False
+ self.is_getter = False
+ self.is_inherit = False
+ self.is_list = False
+ self.is_map = False
+ self.idl_name = idl_name
+
+ for child in node.GetChildren():
+ child_class = child.GetClass()
+ if child_class == 'Operation':
+ self.operation = IdlOperation(idl_name, child)
+ elif child_class == 'List':
+ self.is_list = True
+ self.is_getter = bool(child.GetProperty('GETTER'))
+ self.attributes = child.GetProperty('ATTRIBUTES')
+ elif child_class == 'Map':
+ self.is_map = True
+ self.is_attribute = bool(child.GetProperty('ATTRIBUTE'))
+ self.is_getter = bool(child.GetProperty('GETTER'))
+ self.is_inherit = bool(child.GetProperty('INHERIT'))
+ self.attributes = child.GetProperty('ATTRIBUTES')
+ 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)
+
+
+################################################################################
# Stringifiers
################################################################################
@@ -630,9 +732,106 @@
################################################################################
+# Iterable, Maplike, Setlike
+################################################################################
+
+class IdlIterableOrMaplikeOrSetlike(TypedObject):
+ def __init__(self, idl_name, node):
+ self.extended_attributes = {}
+ self.type_children = []
+
+ for child in node.GetChildren():
+ child_class = child.GetClass()
+ if child_class == 'ExtAttributes':
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
+ elif child_class == 'Type':
+ self.type_children.append(child)
+ else:
+ raise ValueError('Unrecognized node class: %s' % child_class)
+
+
+class IdlIterable(IdlIterableOrMaplikeOrSetlike):
+ idl_type_attributes = ('key_type', 'value_type')
+
+ def __init__(self, idl_name, node):
+ super(IdlIterable, self).__init__(idl_name, node)
+
+ if len(self.type_children) == 1:
+ self.key_type = None
+ self.value_type = type_node_to_type(self.type_children[0])
+ elif len(self.type_children) == 2:
+ self.key_type = type_node_to_type(self.type_children[0])
+ self.value_type = type_node_to_type(self.type_children[1])
+ else:
+ raise ValueError('Unexpected number of type children: %d' % len(self.type_children))
+ del self.type_children
+
+ def accept(self, visitor):
+ visitor.visit_iterable(self)
+
+
+class IdlMaplike(IdlIterableOrMaplikeOrSetlike):
+ idl_type_attributes = ('key_type', 'value_type')
+
+ def __init__(self, idl_name, node):
+ super(IdlMaplike, self).__init__(idl_name, node)
+
+ self.is_read_only = bool(node.GetProperty('READONLY'))
+
+ if len(self.type_children) == 2:
+ self.key_type = type_node_to_type(self.type_children[0])
+ self.value_type = type_node_to_type(self.type_children[1])
+ else:
+ raise ValueError('Unexpected number of children: %d' % len(self.type_children))
+ del self.type_children
+
+ def accept(self, visitor):
+ visitor.visit_maplike(self)
+
+
+class IdlSetlike(IdlIterableOrMaplikeOrSetlike):
+ idl_type_attributes = ('value_type',)
+
+ def __init__(self, idl_name, node):
+ super(IdlSetlike, self).__init__(idl_name, node)
+
+ self.is_read_only = bool(node.GetProperty('READONLY'))
+
+ if len(self.type_children) == 1:
+ self.value_type = type_node_to_type(self.type_children[0])
+ else:
+ raise ValueError('Unexpected number of children: %d' % len(self.type_children))
+ del self.type_children
+
+ def accept(self, visitor):
+ visitor.visit_setlike(self)
+
+
+################################################################################
+# Implement statements
+################################################################################
+
+class IdlImplement(object):
+ def __init__(self, node):
+ self.left_interface = node.GetName()
+ self.right_interface = node.GetProperty('REFERENCE')
+
+
+################################################################################
# Extended attributes
################################################################################
+class Exposure:
+ """An Exposure holds one Exposed or RuntimeEnabled condition.
+ Each exposure has two properties: exposed and runtime_enabled.
+ Exposure(e, r) corresponds to [Exposed(e r)]. Exposure(e) corresponds to
+ [Exposed=e].
+ """
+ def __init__(self, exposed, runtime_enabled=None):
+ self.exposed = exposed
+ self.runtime_enabled = runtime_enabled
+
+
def ext_attributes_node_to_extended_attributes(idl_name, node):
"""
Returns:
@@ -686,9 +885,27 @@
elif name == 'SetWrapperReferenceTo':
if not child:
raise ValueError('[SetWrapperReferenceTo] requires a child, but has none.')
+ children = child.GetChildren()
+ if len(children) != 1:
+ raise ValueError('[SetWrapperReferenceTo] supports only one child.')
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(idl_name, child)
+ extended_attributes[name] = IdlArgument(idl_name, children[0])
+ elif name == 'Exposed':
+ if child_class and child_class != 'Arguments':
+ raise ValueError('[Exposed] only supports Arguments as child, but has child of class: %s' % child_class)
+ exposures = []
+ if child_class == 'Arguments':
+ exposures = [Exposure(exposed=str(arg.idl_type),
+ runtime_enabled=arg.name)
+ for arg in arguments_node_to_arguments('*', child)]
+ else:
+ value = extended_attribute_node.GetProperty('VALUE')
+ if type(value) is str:
+ exposures = [Exposure(exposed=value)]
+ else:
+ exposures = [Exposure(exposed=v) for v in value]
+ extended_attributes[name] = exposures
elif child:
raise ValueError('ExtAttributes node with unexpected children: %s' % name)
else:
@@ -781,7 +998,7 @@
# interface type. We do not distinguish these, and just use the type name.
if node_class in ['PrimitiveType', 'Typeref']:
# unrestricted syntax: unrestricted double | unrestricted float
- is_unrestricted = node.GetProperty('UNRESTRICTED') or False
+ is_unrestricted = bool(node.GetProperty('UNRESTRICTED'))
return IdlType(node.GetName(), is_unrestricted=is_unrestricted)
elif node_class == 'Any':
return IdlType('any')
@@ -789,6 +1006,8 @@
return sequence_node_to_type(node)
elif node_class == 'UnionType':
return union_type_node_to_idl_union_type(node)
+ elif node_class == 'Promise':
+ return IdlType('Promise')
raise ValueError('Unrecognized node class: %s' % node_class)
@@ -822,3 +1041,53 @@
member_types = [type_node_to_type(member_type_node)
for member_type_node in node.GetChildren()]
return IdlUnionType(member_types)
+
+
+################################################################################
+# Visitor
+################################################################################
+
+class Visitor(object):
+ """Abstract visitor class for IDL definitions traverse."""
+
+ def visit_definitions(self, definitions):
+ pass
+
+ def visit_typed_object(self, typed_object):
+ pass
+
+ def visit_callback_function(self, callback_function):
+ self.visit_typed_object(callback_function)
+
+ def visit_dictionary(self, dictionary):
+ pass
+
+ def visit_dictionary_member(self, member):
+ self.visit_typed_object(member)
+
+ def visit_interface(self, interface):
+ pass
+
+ def visit_typedef(self, typedef):
+ self.visit_typed_object(typedef)
+
+ def visit_attribute(self, attribute):
+ self.visit_typed_object(attribute)
+
+ def visit_constant(self, constant):
+ self.visit_typed_object(constant)
+
+ def visit_operation(self, operation):
+ self.visit_typed_object(operation)
+
+ def visit_argument(self, argument):
+ self.visit_typed_object(argument)
+
+ def visit_iterable(self, iterable):
+ self.visit_typed_object(iterable)
+
+ def visit_maplike(self, maplike):
+ self.visit_typed_object(maplike)
+
+ def visit_setlike(self, setlike):
+ self.visit_typed_object(setlike)
diff --git a/bindings/scripts/idl_reader.py b/bindings/scripts/idl_reader.py
index 7c7f5e5..f0952f0 100644
--- a/bindings/scripts/idl_reader.py
+++ b/bindings/scripts/idl_reader.py
@@ -42,6 +42,38 @@
from utilities import idl_filename_to_component
+def validate_blink_idl_definitions(idl_filename, idl_file_basename,
+ definitions):
+ """Validate file contents with filename convention.
+
+ The Blink IDL conventions are:
+ - If an IDL file defines an interface, a dictionary, or an exception,
+ the IDL file must contain exactly one definition. 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).
+ - An IDL file can contain typedefs and enums without having other
+ definitions. There is no filename convention in this case.
+ - Otherwise, an IDL file is invalid.
+ """
+ targets = (definitions.interfaces.values() +
+ definitions.dictionaries.values())
+ number_of_targets = len(targets)
+ if number_of_targets > 1:
+ raise Exception(
+ 'Expected exactly 1 definition in file {0}, but found {1}'
+ .format(idl_filename, number_of_targets))
+ if number_of_targets == 0:
+ if not (definitions.enumerations or definitions.typedefs):
+ raise Exception(
+ 'No definition found in %s' % idl_filename)
+ return
+ target = targets[0]
+ if not target.is_partial and target.name != idl_file_basename:
+ raise Exception(
+ 'Definition name "{0}" disagrees with IDL file basename "{1}".'
+ .format(target.name, idl_file_basename))
+
+
class IdlReader(object):
def __init__(self, interfaces_info=None, outputdir='', multi_interface=False):
self.multi_interface = multi_interface
@@ -83,24 +115,7 @@
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
- # <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).
- targets = (definitions.interfaces.values() +
- definitions.dictionaries.values())
- number_of_targets = len(targets)
- if number_of_targets != 1:
- raise Exception(
- '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(
- 'Definition name "{0}" disagrees with IDL file basename "{1}".'
- .format(target.name, idl_file_basename))
+ validate_blink_idl_definitions(idl_filename, idl_file_basename, definitions)
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 7be4b7d..5d776a7 100644
--- a/bindings/scripts/idl_types.py
+++ b/bindings/scripts/idl_types.py
@@ -11,6 +11,8 @@
IdlArrayType
IdlSequenceType
IdlNullableType
+
+IdlTypes are picklable because we store them in interfaces_info.
"""
from collections import defaultdict
@@ -46,11 +48,10 @@
# http://heycam.github.io/webidl/#idl-types
'DOMString',
'ByteString',
+ 'USVString',
'Date',
- # http://heycam.github.io/webidl/#es-type-mapping
+ # http://heycam.github.io/webidl/#idl-types
'void',
- # http://encoding.spec.whatwg.org/#type-scalarvaluestring
- 'ScalarValueString',
]))
TYPE_NAMES = {
# http://heycam.github.io/webidl/#dfn-type-name
@@ -70,7 +71,7 @@
'unrestricted double': 'UnrestrictedDouble',
'DOMString': 'String',
'ByteString': 'ByteString',
- 'ScalarValueString': 'ScalarValueString',
+ 'USVString': 'USVString',
'object': 'Object',
'Date': 'Date',
}
@@ -80,7 +81,14 @@
# (Interface object [[Call]] method's string types.)
'String',
'ByteString',
- 'ScalarValueString',
+ 'USVString',
+])
+
+STANDARD_CALLBACK_FUNCTIONS = frozenset([
+ # http://heycam.github.io/webidl/#common-Function
+ 'Function',
+ # http://heycam.github.io/webidl/#common-VoidFunction
+ 'VoidFunction',
])
@@ -116,6 +124,11 @@
raise NotImplementedError(
'resolve_typedefs should be defined in subclasses')
+ def idl_types(self):
+ """A generator which yields IdlTypes which are referenced from |self|,
+ including itself."""
+ yield self
+
################################################################################
# IdlType
@@ -125,7 +138,7 @@
# FIXME: incorporate Nullable, etc.
# to support types like short?[] vs. short[]?, instead of treating these
# as orthogonal properties (via flags).
- callback_functions = set()
+ callback_functions = set(STANDARD_CALLBACK_FUNCTIONS)
callback_interfaces = set()
dictionaries = set()
enums = {} # name -> values
@@ -140,6 +153,14 @@
def __str__(self):
return self.base_type
+ def __getstate__(self):
+ return {
+ 'base_type': self.base_type,
+ }
+
+ def __setstate__(self, state):
+ self.base_type = state['base_type']
+
@property
def is_basic_type(self):
return self.base_type in BASIC_TYPES
@@ -164,7 +185,11 @@
@property
def enum_values(self):
- return IdlType.enums[self.name]
+ return IdlType.enums.get(self.name)
+
+ @property
+ def enum_type(self):
+ return self.name if self.is_enum else None
@property
def is_integer_type(self):
@@ -197,10 +222,6 @@
return self.name in STRING_TYPES
@property
- def is_union_type(self):
- return isinstance(self, IdlUnionType)
-
- @property
def name(self):
"""Return type name
@@ -237,14 +258,60 @@
class IdlUnionType(IdlTypeBase):
# http://heycam.github.io/webidl/#idl-union
+ # IdlUnionType has __hash__() and __eq__() methods because they are stored
+ # in sets.
def __init__(self, member_types):
super(IdlUnionType, self).__init__()
self.member_types = member_types
+ def __str__(self):
+ return '(' + ' or '.join(str(member_type) for member_type in self.member_types) + ')'
+
+ def __hash__(self):
+ return hash(self.name)
+
+ def __eq__(self, rhs):
+ return self.name == rhs.name
+
+ def __getstate__(self):
+ return {
+ 'member_types': self.member_types,
+ }
+
+ def __setstate__(self, state):
+ self.member_types = state['member_types']
+
@property
def is_union_type(self):
return True
+ def single_matching_member_type(self, predicate):
+ matching_types = filter(predicate, self.member_types)
+ if len(matching_types) > 1:
+ raise "%s is ambigious." % self.name
+ return matching_types[0] if matching_types else None
+
+ @property
+ def string_member_type(self):
+ return self.single_matching_member_type(
+ lambda member_type: (member_type.is_string_type or
+ member_type.is_enum))
+
+ @property
+ def numeric_member_type(self):
+ return self.single_matching_member_type(
+ lambda member_type: member_type.is_numeric_type)
+
+ @property
+ def boolean_member_type(self):
+ return self.single_matching_member_type(
+ lambda member_type: member_type.base_type == 'boolean')
+
+ @property
+ def as_union_type(self):
+ # Note: Use this to "look through" a possible IdlNullableType wrapper.
+ return self
+
@property
def name(self):
"""Return type name (or inner type name if nullable)
@@ -259,6 +326,12 @@
for member_type in self.member_types]
return self
+ def idl_types(self):
+ yield self
+ for member_type in self.member_types:
+ for idl_type in member_type.idl_types():
+ yield idl_type
+
################################################################################
# IdlArrayOrSequenceType, IdlArrayType, IdlSequenceType
@@ -271,10 +344,35 @@
super(IdlArrayOrSequenceType, self).__init__()
self.element_type = element_type
+ def __getstate__(self):
+ return {
+ 'element_type': self.element_type,
+ }
+
+ def __setstate__(self, state):
+ self.element_type = state['element_type']
+
def resolve_typedefs(self, typedefs):
self.element_type = self.element_type.resolve_typedefs(typedefs)
return self
+ @property
+ def is_array_or_sequence_type(self):
+ return True
+
+ @property
+ def enum_values(self):
+ return self.element_type.enum_values
+
+ @property
+ def enum_type(self):
+ return self.element_type.enum_type
+
+ def idl_types(self):
+ yield self
+ for idl_type in self.element_type.idl_types():
+ yield idl_type
+
class IdlArrayType(IdlArrayOrSequenceType):
def __init__(self, element_type):
@@ -320,17 +418,27 @@
def __getattr__(self, name):
return getattr(self.inner_type, name)
+ def __getstate__(self):
+ return {
+ 'inner_type': self.inner_type,
+ }
+
+ def __setstate__(self, state):
+ self.inner_type = state['inner_type']
+
@property
def is_nullable(self):
return True
@property
def name(self):
- # DartFix: Don't handle OrNull all classes generated are same regardless
- # of nullable type.
- # return self.inner_type.name + 'OrNull'
- return self.inner_type.name
+ return self.inner_type.name + 'OrNull'
def resolve_typedefs(self, typedefs):
self.inner_type = self.inner_type.resolve_typedefs(typedefs)
return self
+
+ def idl_types(self):
+ yield self
+ for idl_type in self.inner_type.idl_types():
+ yield idl_type
diff --git a/bindings/scripts/interface_dependency_resolver.py b/bindings/scripts/interface_dependency_resolver.py
index 7bf3b05..79b28ea 100644
--- a/bindings/scripts/interface_dependency_resolver.py
+++ b/bindings/scripts/interface_dependency_resolver.py
@@ -37,16 +37,17 @@
"""
import os.path
+from utilities import idl_filename_to_component, is_valid_component_dependency
# The following extended attributes can be applied to a dependency interface,
# and are then applied to the individual members when merging.
# Note that this moves the extended attribute from the interface to the member,
# which changes the semantics and yields different code than the same extended
# attribute on the main interface.
-DEPENDENCY_EXTENDED_ATTRIBUTES = set([
+DEPENDENCY_EXTENDED_ATTRIBUTES = frozenset([
'Conditional',
- 'PerContextEnabled',
'RuntimeEnabled',
+ 'TypeChecking',
])
@@ -114,52 +115,134 @@
definitions,
component,
target_interface,
- interface_info['dependencies_full_paths'],
+ interface_info['dependencies_full_paths'] +
+ interface_info['dependencies_other_component_full_paths'],
self.reader)
for referenced_interface_name in interface_info['referenced_interfaces']:
referenced_definitions = self.reader.read_idl_definitions(
self.interfaces_info[referenced_interface_name]['full_path'])
- if component not in referenced_definitions:
- raise Exception('This definitions: %s is defined in %s '
- 'but reference interface:%s is not defined '
- 'in %s' % (definitions.idl_name,
- component,
- referenced_interface_name,
- component))
+ for referenced_component in referenced_definitions:
+ if not is_valid_component_dependency(component, referenced_component):
+ raise Exception('This definitions: %s is defined in %s '
+ 'but reference interface:%s is defined '
+ 'in %s' % (definitions.idl_name,
+ component,
+ referenced_interface_name,
+ referenced_component))
- resolved_definitions[component].update(referenced_definitions[component])
+ resolved_definitions[component].update(referenced_definitions[component])
+
return resolved_definitions
def merge_interface_dependencies(definitions, component, target_interface, dependency_idl_filenames, reader):
"""Merge dependencies ('partial interface' and 'implements') in dependency_idl_filenames into target_interface.
- No return: modifies target_interface in place.
+ Args:
+ definitions: IdlDefinitions object, modified in place
+ component:
+ string, describing where the above definitions are defined,
+ 'core' or 'modules'. See KNOWN_COMPONENTS in utilities.py
+ target_interface: IdlInterface object, modified in place
+ dependency_idl_filenames:
+ Idl filenames which depend on the above definitions.
+ reader: IdlReader object.
+ Returns:
+ A dictionary whose key is component and value is IdlDefinitions
+ object whose dependency is resolved.
"""
+ resolved_definitions = {component: definitions}
# Sort so order consistent, so can compare output from run to run.
for dependency_idl_filename in sorted(dependency_idl_filenames):
dependency_definitions = reader.read_idl_file(dependency_idl_filename)
- # FIXME(crbug.com/358074): should not merge core definitions with
- # modules definitions.
+ dependency_component = idl_filename_to_component(dependency_idl_filename)
+
dependency_interface = next(dependency_definitions.interfaces.itervalues())
dependency_interface_basename, _ = os.path.splitext(os.path.basename(dependency_idl_filename))
transfer_extended_attributes(dependency_interface,
dependency_interface_basename)
- definitions.update(dependency_definitions) # merges partial interfaces
- if not dependency_interface.is_partial:
+
+ # We need to use different checkdeps here for partial interface and
+ # inheritance.
+ if dependency_interface.is_partial:
+ # Case: dependency_interface is a partial interface of
+ # target_interface.
+ # So,
+ # - A partial interface defined in modules can update
+ # the original interface defined in core.
+ # However,
+ # - A partial interface defined in core cannot update
+ # the original interface defined in modules.
+ if not is_valid_component_dependency(dependency_component, component):
+ raise Exception('The partial interface:%s in %s cannot update '
+ 'the original interface:%s in %s' % (dependency_interface.name,
+ dependency_component,
+ target_interface.name,
+ component))
+
+ if dependency_component in resolved_definitions:
+ # When merging a new partial interfaces, should not overwrite
+ # ImpelemntedAs extended attributes in merged partial
+ # interface.
+ # See also the below "if 'ImplementedAs' not in ... " line's
+ # comment.
+ dependency_interface.extended_attributes.pop('ImplementedAs', None)
+ resolved_definitions[dependency_component].update(dependency_definitions)
+ continue
+
+ dependency_interface.extended_attributes.update(target_interface.extended_attributes)
+ assert target_interface == definitions.interfaces[dependency_interface.name]
+ # A partial interface should use its original interface's
+ # ImplementedAs. If the original interface doesn't have,
+ # remove ImplementedAs defined in the partial interface.
+ # Because partial interface needs the original interface's
+ # cpp class to obtain partial interface's cpp class.
+ # e.g.. V8WindowPartial.cpp:
+ # DOMWindow* impl = V8Window::toImpl(holder);
+ # RawPtr<...> cppValue(DOMWindowQuota::webkitStorageInfo(impl));
+ # TODO(tasak): remove ImplementedAs extended attributes
+ # from all partial interfaces. Instead, rename all cpp/header
+ # files correctly. ImplementedAs should not be allowed in
+ # partial interfaces.
+ if 'ImplementedAs' not in target_interface.extended_attributes:
+ dependency_interface.extended_attributes.pop('ImplementedAs', None)
+ dependency_interface.original_interface = target_interface
+ target_interface.partial_interfaces.append(dependency_interface)
+ resolved_definitions[dependency_component] = dependency_definitions
+ else:
+ # Case: target_interface implements dependency_interface.
+ # So,
+ # - An interface defined in modules can implement some interface
+ # defined in core.
+ # In this case, we need "NoInterfaceObject" extended attribute.
+ # However,
+ # - An interface defined in core cannot implement any interface
+ # defined in modules.
+ if not is_valid_component_dependency(component, dependency_component):
+ raise Exception('The interface:%s in %s cannot implement '
+ 'the interface:%s in %s.' % (dependency_interface.name,
+ dependency_component,
+ target_interface.name,
+ component))
+
+ if component != dependency_component and 'NoInterfaceObject' not in dependency_interface.extended_attributes:
+ raise Exception('The interface:%s in %s cannot implement '
+ 'the interface:%s in %s because of '
+ 'missing NoInterfaceObject.' % (dependency_interface.name,
+ dependency_component,
+ target_interface.name,
+ component))
+
+ resolved_definitions[component].update(dependency_definitions) # merges partial interfaces
# Implemented interfaces (non-partial dependencies) are also merged
# into the target interface, so Code Generator can just iterate
# over one list (and not need to handle 'implements' itself).
target_interface.merge(dependency_interface)
- # FIXME: Currently, this function just returns one IdlDefinitions
- # instance. However, for partial interface modularization, we need to
- # make this function return multiple definitions, i.e.
- # { 'core': ..., 'modules': ... }.
- return {component: definitions}
+ return resolved_definitions
def transfer_extended_attributes(dependency_interface, dependency_interface_basename):
@@ -211,9 +294,14 @@
dependency_interface.extended_attributes.get(
'ImplementedAs', dependency_interface_basename))
+ def update_attributes(attributes, extras):
+ for key, value in extras.items():
+ if key not in attributes:
+ attributes[key] = value
+
for attribute in dependency_interface.attributes:
- attribute.extended_attributes.update(merged_extended_attributes)
+ update_attributes(attribute.extended_attributes, merged_extended_attributes)
for constant in dependency_interface.constants:
- constant.extended_attributes.update(merged_extended_attributes)
+ update_attributes(constant.extended_attributes, merged_extended_attributes)
for operation in dependency_interface.operations:
- operation.extended_attributes.update(merged_extended_attributes)
+ update_attributes(operation.extended_attributes, merged_extended_attributes)
diff --git a/bindings/scripts/utilities.py b/bindings/scripts/utilities.py
index 4d80ca7..8bd8555 100644
--- a/bindings/scripts/utilities.py
+++ b/bindings/scripts/utilities.py
@@ -15,11 +15,7 @@
KNOWN_COMPONENTS = frozenset(['core', 'modules'])
-
-
-class IdlBadFilenameError(Exception):
- """Raised if an IDL filename disagrees with the interface name in the file."""
- pass
+KNOWN_COMPONENTS_WITH_TESTING = frozenset(['core', 'modules', 'testing'])
def idl_filename_to_interface_name(idl_filename):
@@ -27,14 +23,189 @@
return os.path.splitext(os.path.basename(idl_filename))[0]
-def idl_filename_to_component(idl_filename):
+def idl_filename_to_component_with_known_components(idl_filename, known_components):
path = os.path.dirname(os.path.realpath(idl_filename))
while path:
dirname, basename = os.path.split(path)
- if basename.lower() in KNOWN_COMPONENTS:
+ if not basename:
+ break
+ if basename.lower() in known_components:
return basename.lower()
path = dirname
- raise 'Unknown component type for %s' % idl_filename
+ raise Exception('Unknown component type for %s' % idl_filename)
+
+
+def idl_filename_to_component(idl_filename):
+ return idl_filename_to_component_with_known_components(idl_filename, KNOWN_COMPONENTS)
+
+
+def is_testing_target(idl_filename):
+ component = idl_filename_to_component_with_known_components(idl_filename, KNOWN_COMPONENTS_WITH_TESTING)
+ return component == 'testing'
+
+
+# See whether "component" can depend on "dependency" or not:
+# Suppose that we have interface X and Y:
+# - if X is a partial interface and Y is the original interface,
+# use is_valid_component_dependency(X, Y).
+# - if X implements Y, use is_valid_component_dependency(X, Y)
+# Suppose that X is a cpp file and Y is a header file:
+# - if X includes Y, use is_valid_component_dependency(X, Y)
+def is_valid_component_dependency(component, dependency):
+ assert component in KNOWN_COMPONENTS
+ assert dependency in KNOWN_COMPONENTS
+ if component == 'core' and dependency == 'modules':
+ return False
+ return True
+
+
+class ComponentInfoProvider(object):
+ """Base class of information provider which provides component-specific
+ information.
+ """
+ def __init__(self):
+ pass
+
+ @property
+ def interfaces_info(self):
+ return {}
+
+ @property
+ def component_info(self):
+ return {}
+
+ @property
+ def enumerations(self):
+ return {}
+
+ @property
+ def typedefs(self):
+ return {}
+
+ @property
+ def union_types(self):
+ return set()
+
+ @property
+ def include_path_for_union_types(self):
+ return None
+
+
+class ComponentInfoProviderCore(ComponentInfoProvider):
+ def __init__(self, interfaces_info, component_info):
+ super(ComponentInfoProviderCore, self).__init__()
+ self._interfaces_info = interfaces_info
+ self._component_info = component_info
+
+ @property
+ def interfaces_info(self):
+ return self._interfaces_info
+
+ @property
+ def component_info(self):
+ return self._component_info
+
+ @property
+ def enumerations(self):
+ return self._component_info['enumerations']
+
+ @property
+ def typedefs(self):
+ return self._component_info['typedefs']
+
+ @property
+ def union_types(self):
+ return self._component_info['union_types']
+
+ @property
+ def include_path_for_union_types(self):
+ return 'bindings/core/v8/UnionTypesCore.h'
+
+ @property
+ def specifier_for_export(self):
+ return 'CORE_EXPORT '
+
+ @property
+ def include_path_for_export(self):
+ return 'core/CoreExport.h'
+
+
+class ComponentInfoProviderModules(ComponentInfoProvider):
+ def __init__(self, interfaces_info, component_info_core,
+ component_info_modules):
+ super(ComponentInfoProviderModules, self).__init__()
+ self._interfaces_info = interfaces_info
+ self._component_info_core = component_info_core
+ self._component_info_modules = component_info_modules
+
+ @property
+ def interfaces_info(self):
+ return self._interfaces_info
+
+ @property
+ def component_info(self):
+ return self._component_info_modules
+
+ @property
+ def enumerations(self):
+ enums = self._component_info_core['enumerations'].copy()
+ enums.update(self._component_info_modules['enumerations'])
+ return enums
+
+ @property
+ def typedefs(self):
+ typedefs = self._component_info_core['typedefs'].copy()
+ typedefs.update(self._component_info_modules['typedefs'])
+ return typedefs
+
+ @property
+ def union_types(self):
+ # Remove duplicate union types from component_info_modules to avoid
+ # generating multiple container generation.
+ return self._component_info_modules['union_types'] - self._component_info_core['union_types']
+
+ @property
+ def include_path_for_union_types(self):
+ return 'bindings/modules/v8/UnionTypesModules.h'
+
+ @property
+ def specifier_for_export(self):
+ return 'MODULES_EXPORT '
+
+ @property
+ def include_path_for_export(self):
+ return 'modules/ModulesExport.h'
+
+
+def load_interfaces_info_overall_pickle(info_dir):
+ with open(os.path.join(info_dir, 'modules', 'InterfacesInfoOverall.pickle')) as interface_info_file:
+ return pickle.load(interface_info_file)
+
+
+def create_component_info_provider_core(info_dir):
+ interfaces_info = load_interfaces_info_overall_pickle(info_dir)
+ with open(os.path.join(info_dir, 'core', 'ComponentInfoCore.pickle')) as component_info_file:
+ component_info = pickle.load(component_info_file)
+ return ComponentInfoProviderCore(interfaces_info, component_info)
+
+
+def create_component_info_provider_modules(info_dir):
+ interfaces_info = load_interfaces_info_overall_pickle(info_dir)
+ with open(os.path.join(info_dir, 'core', 'ComponentInfoCore.pickle')) as component_info_file:
+ component_info_core = pickle.load(component_info_file)
+ with open(os.path.join(info_dir, 'modules', 'ComponentInfoModules.pickle')) as component_info_file:
+ component_info_modules = pickle.load(component_info_file)
+ return ComponentInfoProviderModules(
+ interfaces_info, component_info_core, component_info_modules)
+
+
+def create_component_info_provider(info_dir, component):
+ if component == 'core':
+ return create_component_info_provider_core(info_dir)
+ elif component == 'modules':
+ return create_component_info_provider_modules(info_dir)
+ else:
+ return ComponentInfoProvider()
################################################################################
@@ -104,7 +275,7 @@
try:
if pickle.load(pickle_file) == data:
return
- except (EOFError, pickle.UnpicklingError):
+ except Exception:
# If trouble unpickling, overwrite
pass
with open(pickle_filename, 'w') as pickle_file:
@@ -119,66 +290,20 @@
# Leading and trailing context (e.g. following '{') used to avoid false matches.
################################################################################
-def get_partial_interface_name_from_idl(file_contents):
- match = re.search(r'partial\s+interface\s+(\w+)\s*{', file_contents)
- return match and match.group(1)
-
-
-def get_implements_from_idl(file_contents, interface_name):
- """Returns lists of implementing and implemented interfaces.
-
- Rule is: identifier-A implements identifier-B;
- i.e., implement*ing* implements implement*ed*;
- http://www.w3.org/TR/WebIDL/#idl-implements-statements
-
- Returns two lists of interfaces: identifier-As and identifier-Bs.
- An 'implements' statements can be present in the IDL file for either the
- implementing or the implemented interface, but not other files.
- """
- implements_re = (r'^\s*'
- r'(\w+)\s+'
- r'implements\s+'
- r'(\w+)\s*'
- r';')
- implements_matches = re.finditer(implements_re, file_contents, re.MULTILINE)
- implements_pairs = [match.groups() for match in implements_matches]
-
- foreign_implements = [pair for pair in implements_pairs
- if interface_name not in pair]
- if foreign_implements:
- left, right = foreign_implements.pop()
- raise IdlBadFilenameError(
- 'implements statement found in unrelated IDL file.\n'
- 'Statement is:\n'
- ' %s implements %s;\n'
- 'but filename is unrelated "%s.idl"' %
- (left, right, interface_name))
-
- return (
- [left for left, right in implements_pairs if right == interface_name],
- [right for left, right in implements_pairs if left == interface_name])
-
-
def is_callback_interface_from_idl(file_contents):
match = re.search(r'callback\s+interface\s+\w+\s*{', file_contents)
return bool(match)
-def is_dictionary_from_idl(file_contents):
- match = re.search(r'dictionary\s+\w+\s*{', file_contents)
+def should_generate_impl_file_from_idl(file_contents):
+ """True when a given IDL file contents could generate .h/.cpp files."""
+ # FIXME: This would be error-prone and we should use AST rather than
+ # improving the regexp pattern.
+ match = re.search(r'(interface|dictionary|exception)\s+\w+', file_contents)
return bool(match)
-def get_parent_interface(file_contents):
- match = re.search(r'interface\s+'
- r'\w+\s*'
- r':\s*(\w+)\s*'
- r'{',
- file_contents)
- return match and match.group(1)
-
-
-def get_interface_extended_attributes_from_idl(file_contents):
+def match_interface_extended_attributes_from_idl(file_contents):
# Strip comments
# re.compile needed b/c Python 2.6 doesn't support flags in re.sub
single_line_comment_re = re.compile(r'//.*$', flags=re.MULTILINE)
@@ -193,6 +318,11 @@
r'(:\s*\w+\s*)?'
r'{',
file_contents, flags=re.DOTALL)
+ return match
+
+
+def get_interface_extended_attributes_from_idl(file_contents):
+ match = match_interface_extended_attributes_from_idl(file_contents)
if not match:
return {}
@@ -210,12 +340,18 @@
return extended_attributes
-def get_put_forward_interfaces_from_idl(file_contents):
- put_forwards_pattern = (r'\[[^\]]*PutForwards=[^\]]*\]\s+'
- r'readonly\s+'
- r'attribute\s+'
- r'(\w+)')
- return sorted(set(match.group(1)
- for match in re.finditer(put_forwards_pattern,
- file_contents,
- flags=re.DOTALL)))
+def get_interface_exposed_arguments(file_contents):
+ match = match_interface_extended_attributes_from_idl(file_contents)
+ if not match:
+ return None
+
+ extended_attributes_string = match.group(1)
+ match = re.search(r'[^=]\bExposed\(([^)]*)\)', file_contents)
+ if not match:
+ return None
+ arguments = []
+ for argument in map(string.strip, match.group(1).split(',')):
+ exposed, runtime_enabled = argument.split()
+ arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled})
+
+ return arguments
diff --git a/bindings/scripts/v8_attributes.py b/bindings/scripts/v8_attributes.py
index 2a09c88..b1f72a0 100644
--- a/bindings/scripts/v8_attributes.py
+++ b/bindings/scripts/v8_attributes.py
@@ -38,9 +38,10 @@
from v8_globals import includes, interfaces
import v8_types
import v8_utilities
-from v8_utilities import (capitalize, cpp_name, has_extended_attribute,
+from v8_utilities import (cpp_name_or_partial, capitalize, cpp_name, has_extended_attribute,
has_extended_attribute_value, scoped_name, strip_suffix,
- uncapitalize, extended_attribute_value_as_list)
+ uncapitalize, extended_attribute_value_as_list, is_unforgeable,
+ is_legacy_interface_type_checking)
def attribute_context(interface, attribute):
@@ -48,47 +49,56 @@
base_idl_type = idl_type.base_type
extended_attributes = attribute.extended_attributes
- idl_type.add_includes_for_type()
+ idl_type.add_includes_for_type(extended_attributes)
+ if idl_type.enum_values:
+ includes.add('core/inspector/ConsoleMessage.h')
# [CheckSecurity]
- is_check_security_for_node = 'CheckSecurity' in extended_attributes
- if is_check_security_for_node:
- includes.add('bindings/common/BindingSecurity.h')
+ is_do_not_check_security = 'DoNotCheckSecurity' in extended_attributes
+ is_check_security_for_frame = (
+ has_extended_attribute_value(interface, 'CheckSecurity', 'Frame') and
+ not is_do_not_check_security)
+ is_check_security_for_node = (
+ has_extended_attribute_value(attribute, 'CheckSecurity', 'Node'))
+ is_check_security_for_window = (
+ has_extended_attribute_value(interface, 'CheckSecurity', 'Window') and
+ not is_do_not_check_security)
+ if is_check_security_for_frame or is_check_security_for_node or is_check_security_for_window:
+ includes.add('bindings/core/v8/BindingSecurity.h')
# [CustomElementCallbacks], [Reflect]
is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attributes
is_reflect = 'Reflect' in extended_attributes
if is_custom_element_callbacks or is_reflect:
includes.add('core/dom/custom/CustomElementProcessingStack.h')
- # [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)
- # [TypeChecking]
- 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
+ # [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)
if (base_idl_type == 'EventHandler' and
interface.name in ['Window', 'WorkerGlobalScope'] and
attribute.name == 'onerror'):
includes.add('bindings/core/v8/V8ErrorHandler.h')
+ cached_attribute_validation_method = extended_attributes.get('CachedAttribute')
+ keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute)
+ if cached_attribute_validation_method or keep_alive_for_gc:
+ includes.add('bindings/core/v8/V8HiddenValue.h')
+
context = {
- 'access_control_list': access_control_list(attribute),
+ 'access_control_list': access_control_list(interface, 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_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'),
+ 'cached_attribute_validation_method': cached_attribute_validation_method,
'conditional_string': v8_utilities.conditional_string(attribute),
'constructor_type': idl_type.constructor_type_name
if is_constructor_attribute(attribute) else None,
@@ -96,49 +106,53 @@
'cpp_type': idl_type.cpp_type,
'cpp_type_initializer': idl_type.cpp_type_initializer,
'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs]
- 'enum_validation_expression': idl_type.enum_validation_expression,
+ 'enum_type': idl_type.enum_type,
+ 'enum_values': idl_type.enum_values,
'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,
+ 'has_setter': has_setter(attribute),
'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'),
- 'is_call_with_script_state': v8_utilities.has_extended_attribute_value(attribute, 'CallWith', 'ScriptState'),
+ 'is_call_with_execution_context': has_extended_attribute_value(attribute, 'CallWith', 'ExecutionContext'),
+ 'is_call_with_script_state': has_extended_attribute_value(attribute, 'CallWith', 'ScriptState'),
+ 'is_check_security_for_frame': is_check_security_for_frame,
'is_check_security_for_node': is_check_security_for_node,
+ 'is_check_security_for_window': is_check_security_for_window,
'is_custom_element_callbacks': is_custom_element_callbacks,
- 'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes,
+ 'is_expose_js_accessors': is_expose_js_accessors(interface, attribute),
'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_keep_alive_for_gc': keep_alive_for_gc,
+ 'is_lenient_this': 'LenientThis' in extended_attributes,
'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_put_forwards': 'PutForwards' in extended_attributes,
'is_read_only': attribute.is_read_only,
'is_reflect': is_reflect,
'is_replaceable': 'Replaceable' in attribute.extended_attributes,
'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]
+ 'is_unforgeable': is_unforgeable(interface, attribute),
+ 'on_instance': v8_utilities.on_instance(interface, attribute),
+ 'on_interface': v8_utilities.on_interface(interface, attribute),
+ 'on_prototype': v8_utilities.on_prototype(interface, attribute),
+ 'use_output_parameter_for_result': idl_type.use_output_parameter_for_result,
+ 'measure_as': v8_utilities.measure_as(attribute, interface), # [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,
+ extended_attributes, 'v8Value', 'cppValue', bailout_return_value='false', isolate='scriptState->isolate()'),
+ 'property_attributes': property_attributes(interface, attribute),
'reflect_empty': extended_attributes.get('ReflectEmpty'),
'reflect_invalid': extended_attributes.get('ReflectInvalid', ''),
'reflect_missing': extended_attributes.get('ReflectMissing'),
'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly'),
'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
@@ -146,12 +160,10 @@
}
if is_constructor_attribute(attribute):
- constructor_getter_context(interface, attribute, context)
- return context
+ update_constructor_attribute_context(interface, attribute, 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)):
+ if not has_custom_setter(attribute) and has_setter(attribute):
setter_context(interface, attribute, context)
return context
@@ -198,27 +210,28 @@
release = idl_type.release
def v8_set_return_value_statement(for_main_world=False):
- 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)
+ if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attributes:
+ return 'v8SetReturnValue(info, v8Value)'
+ return idl_type.v8_set_return_value(
+ cpp_value, extended_attributes=extended_attributes, script_wrappable='impl',
+ release=release, for_main_world=for_main_world, is_static=attribute.is_static)
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=cpp_value, creation_context='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, 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('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
arguments.append('impl')
arguments.append('&result')
arguments.extend(v8_utilities.call_with_arguments(
@@ -234,6 +247,8 @@
arguments.append('isNull')
if context['is_getter_raises_exception']:
arguments.append('exceptionState')
+ if attribute.idl_type.use_output_parameter_for_result:
+ arguments.append('result')
return '%s(%s)' % (getter_name, ', '.join(arguments))
@@ -310,6 +325,11 @@
'Attribute "%s" is not present in interface "%s"' %
(target_attribute_name, target_interface_name))
+ if ('Replaceable' in attribute.extended_attributes or
+ is_constructor_attribute(attribute)):
+ context['cpp_setter'] = '%sCreateDataProperty(propertyName, v8Value, info)' % cpp_name(interface)
+ return
+
extended_attributes = attribute.extended_attributes
idl_type = attribute.idl_type
@@ -317,19 +337,17 @@
is_setter_raises_exception = (
'RaisesException' in extended_attributes and
extended_attributes['RaisesException'] in [None, 'Setter'])
- # [TypeChecking=Interface]
+ # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking]
has_type_checking_interface = (
- (has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
- has_extended_attribute_value(attribute, 'TypeChecking', 'Interface')) and
+ not is_legacy_interface_type_checking(interface, attribute) and
idl_type.is_wrapper_type)
context.update({
'has_setter_exception_state':
is_setter_raises_exception or has_type_checking_interface or
- context['has_type_checking_unrestricted'] or
idl_type.v8_conversion_needs_exception_state,
'has_type_checking_interface': has_type_checking_interface,
- 'is_setter_call_with_execution_context': v8_utilities.has_extended_attribute_value(
+ 'is_setter_call_with_execution_context': 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(
@@ -361,7 +379,7 @@
arguments.append('*impl')
idl_type = attribute.idl_type
if 'ImplementedInPrivateScript' in extended_attributes:
- arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())')
+ arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
arguments.append('impl')
arguments.append('cppValue')
elif idl_type.base_type == 'EventHandler':
@@ -371,9 +389,9 @@
if (interface.name in ['Window', 'WorkerGlobalScope'] and
attribute.name == 'onerror'):
includes.add('bindings/core/v8/V8ErrorHandler.h')
- arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(v8Value, true, V8ScriptState::current(info.GetIsolate()))')
+ arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(v8Value, true, ScriptState::current(info.GetIsolate()))')
else:
- arguments.append('V8EventListenerList::getEventListener(V8ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)')
+ arguments.append('V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)')
elif idl_type.is_interface_type:
# FIXME: should be able to eliminate WTF::getPtr in most or all cases
arguments.append('WTF::getPtr(cppValue)')
@@ -409,13 +427,7 @@
def scoped_content_attribute_name(interface, attribute):
content_attribute_name = attribute.extended_attributes['Reflect'] or attribute.name.lower()
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'
+ namespace = 'SVGNames'
else:
namespace = 'HTMLNames'
includes.add('core/%s.h' % namespace)
@@ -426,21 +438,15 @@
# Attribute configuration
################################################################################
-# [Replaceable]
-def setter_callback_name(interface, attribute):
- cpp_class_name = cpp_name(interface)
- extended_attributes = attribute.extended_attributes
- if (('Replaceable' in extended_attributes and
- 'PutForwards' not in extended_attributes) or
- is_constructor_attribute(attribute)):
- 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)
+# [PutForwards], [Replaceable]
+def has_setter(attribute):
+ return (not attribute.is_read_only or
+ 'PutForwards' in attribute.extended_attributes or
+ 'Replaceable' in attribute.extended_attributes)
# [DoNotCheckSecurity], [Unforgeable]
-def access_control_list(attribute):
+def access_control_list(interface, attribute):
extended_attributes = attribute.extended_attributes
access_control = []
if 'DoNotCheckSecurity' in extended_attributes:
@@ -449,22 +455,21 @@
access_control.append('v8::ALL_CAN_WRITE')
else:
access_control.append('v8::ALL_CAN_READ')
- if (not attribute.is_read_only or
- 'Replaceable' in extended_attributes):
+ if has_setter(attribute):
access_control.append('v8::ALL_CAN_WRITE')
- if 'Unforgeable' in extended_attributes:
+ if is_unforgeable(interface, attribute):
access_control.append('v8::PROHIBITS_OVERWRITING')
return access_control or ['v8::DEFAULT']
# [NotEnumerable], [Unforgeable]
-def property_attributes(attribute):
+def property_attributes(interface, attribute):
extended_attributes = attribute.extended_attributes
property_attributes_list = []
if ('NotEnumerable' in extended_attributes or
is_constructor_attribute(attribute)):
property_attributes_list.append('v8::DontEnum')
- if 'Unforgeable' in extended_attributes:
+ if is_unforgeable(interface, attribute):
property_attributes_list.append('v8::DontDelete')
return property_attributes_list or ['v8::None']
@@ -484,6 +489,43 @@
extended_attributes['Custom'] in [None, 'Setter'])
+# [ExposeJSAccessors]
+def is_expose_js_accessors(interface, attribute):
+ # Default behavior
+ is_accessor = True
+
+ if ('ExposeJSAccessors' in interface.extended_attributes and
+ 'DoNotExposeJSAccessors' in interface.extended_attributes):
+ raise Exception('Both of ExposeJSAccessors and DoNotExposeJSAccessors are specified at a time in an interface: ' + interface.name)
+ if 'ExposeJSAccessors' in interface.extended_attributes:
+ is_accessor = True
+ if 'DoNotExposeJSAccessors' in interface.extended_attributes:
+ is_accessor = False
+
+ # Note that ExposeJSAccessors and DoNotExposeJSAccessors are more powerful
+ # than 'static', [Unforgeable] and [OverrideBuiltins].
+ if ('ExposeJSAccessors' in attribute.extended_attributes and
+ 'DoNotExposeJSAccessors' in attribute.extended_attributes):
+ raise Exception('Both of ExposeJSAccessors and DoNotExposeJSAccessors are specified at a time on an attribute: ' + attribute.name + ' in an interface: ' + interface.name)
+ if 'ExposeJSAccessors' in attribute.extended_attributes:
+ return True
+ if 'DoNotExposeJSAccessors' in attribute.extended_attributes:
+ return False
+
+ # These attributes must not be accessors on prototype chains.
+ if (is_constructor_attribute(attribute) or
+ attribute.is_static or
+ is_unforgeable(interface, attribute) or
+ 'OverrideBuiltins' in interface.extended_attributes):
+ return False
+
+ # The members of Window interface must be placed on the instance object.
+ if interface.name == 'Window':
+ return False
+
+ return is_accessor
+
+
################################################################################
# Constructors
################################################################################
@@ -498,5 +540,10 @@
return attribute.idl_type.name.endswith('Constructor')
-def constructor_getter_context(interface, attribute, context):
+def update_constructor_attribute_context(interface, attribute, context):
context['needs_constructor_getter_callback'] = context['measure_as'] or context['deprecate_as']
+ # When the attribute name is the same as the interface name, do not generate
+ # callback functions for each attribute and use
+ # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate
+ # a callback function in order to hard-code the attribute name.
+ context['needs_constructor_setter_callback'] = context['name'] != context['constructor_type']
diff --git a/bindings/scripts/v8_callback_interface.py b/bindings/scripts/v8_callback_interface.py
index eafdba8..8ceeb9a 100644
--- a/bindings/scripts/v8_callback_interface.py
+++ b/bindings/scripts/v8_callback_interface.py
@@ -79,8 +79,7 @@
'v8_class': v8_utilities.v8_class_name(callback_interface),
'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
'methods': [method_context(operation)
- for operation in callback_interface.operations
- if not v8_utilities.dart_custom_method(operation.extended_attributes)],
+ for operation in callback_interface.operations],
}
diff --git a/bindings/scripts/v8_dictionary.py b/bindings/scripts/v8_dictionary.py
index a5be6c8..36129b5 100644
--- a/bindings/scripts/v8_dictionary.py
+++ b/bindings/scripts/v8_dictionary.py
@@ -7,29 +7,39 @@
"""
import operator
+from idl_types import IdlType
from v8_globals import includes
import v8_types
import v8_utilities
+from v8_utilities import has_extended_attribute_value
DICTIONARY_H_INCLUDES = frozenset([
+ 'bindings/core/v8/ToV8.h',
'bindings/core/v8/V8Binding.h',
'platform/heap/Handle.h',
])
DICTIONARY_CPP_INCLUDES = frozenset([
- 'bindings/common/ExceptionState.h',
- # FIXME: Remove this, http://crbug.com/321462
- 'bindings/core/v8/Dictionary.h',
+ 'bindings/core/v8/ExceptionState.h',
])
def setter_name_for_dictionary_member(member):
- return 'set%s' % v8_utilities.capitalize(member.name)
+ name = v8_utilities.cpp_name(member)
+ return 'set%s' % v8_utilities.capitalize(name)
+
+
+def null_setter_name_for_dictionary_member(member):
+ if member.idl_type.is_nullable:
+ name = v8_utilities.cpp_name(member)
+ return 'set%sToNull' % v8_utilities.capitalize(name)
+ return None
def has_method_name_for_dictionary_member(member):
- return 'has%s' % v8_utilities.capitalize(member.name)
+ name = v8_utilities.cpp_name(member)
+ return 'has%s' % v8_utilities.capitalize(name)
def unwrap_nullable_if_needed(idl_type):
@@ -40,83 +50,135 @@
# Context for V8 bindings
-def dictionary_context(dictionary):
+def dictionary_context(dictionary, interfaces_info):
includes.clear()
includes.update(DICTIONARY_CPP_INCLUDES)
- return {
- 'cpp_class': v8_utilities.cpp_name(dictionary),
+ cpp_class = v8_utilities.cpp_name(dictionary)
+ context = {
+ 'cpp_class': cpp_class,
'header_includes': set(DICTIONARY_H_INCLUDES),
- 'members': [member_context(member)
+ 'members': [member_context(dictionary, member)
for member in sorted(dictionary.members,
key=operator.attrgetter('name'))],
- 'v8_class': v8_utilities.v8_class_name(dictionary),
+ 'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in dictionary.extended_attributes,
+ 'v8_class': v8_types.v8_type(cpp_class),
+ 'v8_original_class': v8_types.v8_type(dictionary.name),
}
+ if dictionary.parent:
+ IdlType(dictionary.parent).add_includes_for_type()
+ parent_cpp_class = v8_utilities.cpp_name_from_interfaces_info(
+ dictionary.parent, interfaces_info)
+ context.update({
+ 'parent_cpp_class': parent_cpp_class,
+ 'parent_v8_class': v8_types.v8_type(parent_cpp_class),
+ })
+ return context
-def member_context(member):
+def member_context(dictionary, member):
+ extended_attributes = member.extended_attributes
idl_type = member.idl_type
- idl_type.add_includes_for_type()
- idl_type = unwrap_nullable_if_needed(idl_type)
+ idl_type.add_includes_for_type(extended_attributes)
+ unwrapped_idl_type = unwrap_nullable_if_needed(idl_type)
+
+ if member.is_required and member.default_value:
+ raise Exception(
+ 'Required member %s must not have a default value.' % member.name)
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.cpp_value_to_v8_value(
+ cpp_default_value = unwrapped_idl_type.literal_cpp_value(
+ member.default_value)
+ v8_default_value = unwrapped_idl_type.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()
+ cpp_name = v8_utilities.cpp_name(member)
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',
+ 'cpp_name': cpp_name,
+ 'cpp_type': unwrapped_idl_type.cpp_type,
+ 'cpp_value_to_v8_value': unwrapped_idl_type.cpp_value_to_v8_value(
+ cpp_value='impl.%s()' % cpp_name, isolate='isolate',
creation_context='creationContext',
- extended_attributes=member.extended_attributes),
- 'enum_validation_expression': idl_type.enum_validation_expression,
+ extended_attributes=extended_attributes),
+ 'deprecate_as': v8_utilities.deprecate_as(member),
+ 'enum_type': idl_type.enum_type,
+ 'enum_values': unwrapped_idl_type.enum_values,
'has_method_name': has_method_name_for_dictionary_member(member),
- 'is_object': idl_type.name == 'Object',
+ 'idl_type': idl_type.base_type,
+ 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dictionary,
+ 'is_nullable': idl_type.is_nullable,
+ 'is_object': unwrapped_idl_type.name == 'Object',
+ 'is_required': member.is_required,
'name': member.name,
'setter_name': setter_name_for_dictionary_member(member),
+ 'null_setter_name': null_setter_name_for_dictionary_member(member),
'v8_default_value': v8_default_value,
+ 'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_value(
+ extended_attributes, member.name + 'Value',
+ member.name, isolate='isolate', use_exception_state=True),
}
# Context for implementation classes
def dictionary_impl_context(dictionary, interfaces_info):
+ def remove_duplicate_members(members):
+ # When [ImplementedAs] is used, cpp_name can conflict. For example,
+ # dictionary D { long foo; [ImplementedAs=foo, DeprecateAs=Foo] long oldFoo; };
+ # This function removes such duplications, checking they have the same type.
+ members_dict = {}
+ for member in members:
+ cpp_name = member['cpp_name']
+ duplicated_member = members_dict.get(cpp_name)
+ if duplicated_member and duplicated_member != member:
+ raise Exception('Member name conflict: %s' % cpp_name)
+ members_dict[cpp_name] = member
+ return sorted(members_dict.values(), key=lambda member: member['cpp_name'])
+
includes.clear()
header_includes = set(['platform/heap/Handle.h'])
- return {
+ members = [member_impl_context(member, interfaces_info, header_includes)
+ for member in dictionary.members]
+ members = remove_duplicate_members(members)
+ context = {
'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],
+ 'members': members,
}
+ if dictionary.parent:
+ context['parent_cpp_class'] = v8_utilities.cpp_name_from_interfaces_info(
+ dictionary.parent, interfaces_info)
+ parent_interface_info = interfaces_info.get(dictionary.parent)
+ if parent_interface_info:
+ context['header_includes'].add(
+ parent_interface_info['include_path'])
+ return context
def member_impl_context(member, interfaces_info, header_includes):
idl_type = unwrap_nullable_if_needed(member.idl_type)
- is_object = idl_type.name == 'Object'
+ cpp_name = v8_utilities.cpp_name(member)
def getter_expression():
if idl_type.impl_should_use_nullable_container:
- return 'm_%s.get()' % member.name
- return 'm_%s' % member.name
+ return 'm_%s.get()' % cpp_name
+ return 'm_%s' % cpp_name
def has_method_expression():
- if idl_type.impl_should_use_nullable_container or idl_type.is_enum or idl_type.is_string_type:
- return '!m_%s.isNull()' % member.name
- elif is_object:
- return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(member.name)
+ if idl_type.impl_should_use_nullable_container or idl_type.is_enum or idl_type.is_string_type or idl_type.is_union_type:
+ return '!m_%s.isNull()' % cpp_name
+ elif idl_type.name in ['Any', 'Object']:
+ return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(cpp_name)
else:
- return 'm_%s' % member.name
+ return 'm_%s' % cpp_name
def member_cpp_type():
member_cpp_type = idl_type.cpp_type_args(used_in_cpp_sequence=True)
@@ -126,19 +188,19 @@
cpp_default_value = None
if member.default_value and not member.default_value.is_null:
- cpp_default_value = str(member.default_value)
+ cpp_default_value = idl_type.literal_cpp_value(member.default_value)
header_includes.update(idl_type.impl_includes_for_type(interfaces_info))
return {
'cpp_default_value': cpp_default_value,
+ 'cpp_name': cpp_name,
'getter_expression': getter_expression(),
'has_method_expression': has_method_expression(),
'has_method_name': has_method_name_for_dictionary_member(member),
- 'is_object': is_object,
- 'is_traceable': (idl_type.is_garbage_collected or
- idl_type.is_will_be_garbage_collected),
+ 'is_nullable': idl_type.is_nullable,
+ 'is_traceable': idl_type.is_traceable,
'member_cpp_type': member_cpp_type(),
- 'name': member.name,
+ 'null_setter_name': null_setter_name_for_dictionary_member(member),
'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 bf63e61..406fee3 100644
--- a/bindings/scripts/v8_interface.py
+++ b/bindings/scripts/v8_interface.py
@@ -37,7 +37,7 @@
from operator import itemgetter
import idl_definitions
-from idl_definitions import IdlOperation
+from idl_definitions import IdlOperation, IdlArgument
import idl_types
from idl_types import IdlType, inherits_interface
import v8_attributes
@@ -46,22 +46,22 @@
import v8_types
from v8_types import cpp_ptr_type, cpp_template_type
import v8_utilities
-from v8_utilities import (capitalize, conditional_string, cpp_name, gc_type,
+from v8_utilities import (cpp_name_or_partial, capitalize, conditional_string, cpp_name, gc_type,
has_extended_attribute_value, runtime_enabled_function_name,
- extended_attribute_value_as_list)
+ extended_attribute_value_as_list, is_legacy_interface_type_checking)
INTERFACE_H_INCLUDES = frozenset([
- 'bindings/common/ScriptWrappable.h',
+ 'bindings/core/v8/ScriptWrappable.h',
+ 'bindings/core/v8/ToV8.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/core/v8/V8ExceptionState.h',
+ 'bindings/core/v8/ExceptionState.h',
'bindings/core/v8/V8DOMConfiguration.h',
- 'bindings/core/v8/V8HiddenValue.h',
'bindings/core/v8/V8ObjectConstructor.h',
'core/dom/ContextFeatures.h',
'core/dom/Document.h',
@@ -77,20 +77,38 @@
includes.update(INTERFACE_CPP_INCLUDES)
header_includes = set(INTERFACE_H_INCLUDES)
- parent_interface = interface.parent
- if parent_interface:
- header_includes.update(v8_types.includes_for_interface(parent_interface))
+ if interface.is_partial:
+ # A partial interface definition cannot specify that the interface
+ # inherits from another interface. Inheritance must be specified on
+ # the original interface definition.
+ parent_interface = None
+ is_event_target = False
+ # partial interface needs the definition of its original interface.
+ includes.add('bindings/core/v8/V8%s.h' % interface.name)
+ else:
+ parent_interface = interface.parent
+ if parent_interface:
+ header_includes.update(v8_types.includes_for_interface(parent_interface))
+ is_event_target = inherits_interface(interface.name, 'EventTarget')
+
extended_attributes = interface.extended_attributes
- is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer')
- if is_audio_buffer:
- includes.add('modules/webaudio/AudioBuffer.h')
-
- is_document = inherits_interface(interface.name, 'Document')
- if is_document:
- includes.update(['bindings/core/v8/ScriptController.h',
- 'bindings/core/v8/WindowProxy.h',
- 'core/frame/LocalFrame.h'])
+ is_array_buffer_or_view = interface.idl_type.is_array_buffer_or_view
+ is_typed_array_type = interface.idl_type.is_typed_array
+ if is_array_buffer_or_view:
+ includes.add('bindings/core/v8/V8ArrayBuffer.h')
+ if interface.name == 'ArrayBufferView':
+ includes.update((
+ 'bindings/core/v8/V8Int8Array.h',
+ 'bindings/core/v8/V8Int16Array.h',
+ 'bindings/core/v8/V8Int32Array.h',
+ 'bindings/core/v8/V8Uint8Array.h',
+ 'bindings/core/v8/V8Uint8ClampedArray.h',
+ 'bindings/core/v8/V8Uint16Array.h',
+ 'bindings/core/v8/V8Uint32Array.h',
+ 'bindings/core/v8/V8Float32Array.h',
+ 'bindings/core/v8/V8Float64Array.h',
+ 'bindings/core/v8/V8DataView.h'))
# [ActiveDOMObject]
is_active_dom_object = 'ActiveDOMObject' in extended_attributes
@@ -98,107 +116,90 @@
# [CheckSecurity]
is_check_security = 'CheckSecurity' in extended_attributes
if is_check_security:
- includes.add('bindings/common/BindingSecurity.h')
+ includes.add('bindings/core/v8/BindingSecurity.h')
# [DependentLifetime]
is_dependent_lifetime = 'DependentLifetime' in extended_attributes
- # [Iterable]
- iterator_method = None
- if 'Iterable' in extended_attributes:
- iterator_operation = IdlOperation(interface.idl_name)
- iterator_operation.name = 'iterator'
- iterator_operation.idl_type = IdlType('Iterator')
- iterator_operation.extended_attributes['RaisesException'] = None
- iterator_operation.extended_attributes['CallWith'] = 'ScriptState'
- iterator_method = v8_methods.method_context(interface,
- iterator_operation)
-
# [MeasureAs]
is_measure_as = 'MeasureAs' in extended_attributes
if is_measure_as:
includes.add('core/frame/UseCounter.h')
# [SetWrapperReferenceFrom]
- reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
- if reachable_node_function:
+ set_wrapper_reference_from = extended_attributes.get('SetWrapperReferenceFrom')
+ if set_wrapper_reference_from:
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(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 + '*',
- 'idl_type': argument.idl_type,
- 'v8_type': v8_types.v8_type(argument.idl_type.name),
- } for argument in extended_attributes.get('SetWrapperReferenceTo', [])]
- for set_wrapper_reference_to in set_wrapper_reference_to_list:
+ set_wrapper_reference_to_argument = extended_attributes.get('SetWrapperReferenceTo')
+ set_wrapper_reference_to = None
+ if set_wrapper_reference_to_argument:
+ set_wrapper_reference_to = {
+ 'name': set_wrapper_reference_to_argument.name,
+ # FIXME: properly should be:
+ # 'cpp_type': set_wrapper_reference_to_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': set_wrapper_reference_to_argument.idl_type.implemented_as + '*',
+ 'idl_type': set_wrapper_reference_to_argument.idl_type,
+ 'v8_type': v8_types.v8_type(set_wrapper_reference_to_argument.idl_type.name),
+ }
set_wrapper_reference_to['idl_type'].add_includes_for_type()
- # [NotScriptWrappable]
- is_script_wrappable = 'NotScriptWrappable' not in extended_attributes
-
- # [SpecialWrapFor]
- if 'SpecialWrapFor' in extended_attributes:
- special_wrap_for = extended_attribute_value_as_list(interface, 'SpecialWrapFor')
- else:
- special_wrap_for = []
- for special_wrap_interface in special_wrap_for:
- v8_types.add_includes_for_interface(special_wrap_interface)
-
- # [Custom=Wrap], [SetWrapperReferenceFrom]
+ # [SetWrapperReferenceFrom]
has_visit_dom_wrapper = (
has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
- reachable_node_function or
- set_wrapper_reference_to_list)
+ set_wrapper_reference_from or set_wrapper_reference_to)
this_gc_type = gc_type(interface)
wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Node') else 'ObjectClassId')
+ v8_class_name = v8_utilities.v8_class_name(interface)
+ cpp_class_name = cpp_name(interface)
+ cpp_class_name_or_partial = cpp_name_or_partial(interface)
+ v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface)
+
context = {
'conditional_string': conditional_string(interface), # [Conditional]
- 'cpp_class': cpp_name(interface),
+ 'cpp_class': cpp_class_name,
+ 'cpp_class_or_partial': cpp_class_name_or_partial,
+ 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target else 'NotInheritFromEventTarget',
'gc_type': this_gc_type,
# FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699
'has_access_check_callbacks': (is_check_security and
interface.name != 'Window' and
interface.name != 'EventTarget'),
'has_custom_legacy_call_as_function': has_extended_attribute_value(interface, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction]
- 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'ToV8'), # [Custom=ToV8]
- 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wrap'), # [Custom=Wrap]
+ 'has_partial_interface': len(interface.partial_interfaces) > 0,
'has_visit_dom_wrapper': has_visit_dom_wrapper,
'header_includes': header_includes,
'interface_name': interface.name,
'is_active_dom_object': is_active_dom_object,
- 'is_audio_buffer': is_audio_buffer,
+ 'is_array_buffer_or_view': is_array_buffer_or_view,
'is_check_security': is_check_security,
- 'is_dependent_lifetime': is_dependent_lifetime,
- 'is_document': is_document,
- 'is_event_target': inherits_interface(interface.name, 'EventTarget'),
+ 'is_event_target': is_event_target,
'is_exception': interface.is_exception,
'is_node': inherits_interface(interface.name, 'Node'),
- 'is_script_wrappable': is_script_wrappable,
- 'iterator_method': iterator_method,
+ 'is_partial': interface.is_partial,
+ 'is_typed_array_type': is_typed_array_type,
'lifetime': 'Dependent'
if (has_visit_dom_wrapper or
is_active_dom_object or
is_dependent_lifetime)
else 'Independent',
- 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs]
+ 'measure_as': v8_utilities.measure_as(interface, None), # [MeasureAs]
'parent_interface': parent_interface,
'pass_cpp_type': cpp_template_type(
cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type),
cpp_name(interface)),
- 'reachable_node_function': reachable_node_function,
'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled]
- 'set_wrapper_reference_to_list': set_wrapper_reference_to_list,
- 'special_wrap_for': special_wrap_for,
- 'v8_class': v8_utilities.v8_class_name(interface),
+ 'set_wrapper_reference_from': set_wrapper_reference_from,
+ 'set_wrapper_reference_to': set_wrapper_reference_to,
+ 'v8_class': v8_class_name,
+ 'v8_class_or_partial': v8_class_name_or_partial,
'wrapper_class_id': wrapper_class_id,
}
@@ -210,7 +211,7 @@
# Handle named constructors separately
if constructor.name == 'Constructor']
if len(constructors) > 1:
- context['constructor_overloads'] = overloads_context(constructors)
+ context['constructor_overloads'] = overloads_context(interface, constructors)
# [CustomConstructor]
custom_constructors = [{ # Only needed for computing interface length
@@ -218,35 +219,38 @@
number_of_required_arguments(constructor),
} for constructor in interface.custom_constructors]
- # [EventConstructor]
- has_event_constructor = 'EventConstructor' in extended_attributes
- any_type_attributes = [attribute for attribute in interface.attributes
- if attribute.idl_type.name == 'Any']
- if has_event_constructor:
- includes.add('bindings/core/v8/Dictionary.h')
- if any_type_attributes:
- includes.add('bindings/core/v8/SerializedScriptValue.h')
-
# [NamedConstructor]
named_constructor = named_constructor_context(interface)
- if (constructors or custom_constructors or has_event_constructor or
- named_constructor):
+ if constructors or custom_constructors or named_constructor:
+ if interface.is_partial:
+ raise Exception('[Constructor] and [NamedConstructor] MUST NOT be'
+ ' specified on partial interface definitions:'
+ '%s' % interface.name)
+
includes.add('bindings/core/v8/V8ObjectConstructor.h')
includes.add('core/frame/LocalDOMWindow.h')
+ # [Unscopeable] attributes and methods
+ unscopeables = []
+ for attribute in interface.attributes:
+ if 'Unscopeable' in attribute.extended_attributes:
+ unscopeables.append((attribute.name, v8_utilities.runtime_enabled_function_name(attribute)))
+ for method in interface.operations:
+ if 'Unscopeable' in method.extended_attributes:
+ unscopeables.append((method.name, v8_utilities.runtime_enabled_function_name(method)))
+
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_raises_exception': extended_attributes.get('RaisesException') == 'Constructor', # [RaisesException=Constructor]
'named_constructor': named_constructor,
+ 'unscopeables': sorted(unscopeables),
})
- constants = [constant_context(constant) for constant in interface.constants]
+ constants = [constant_context(constant, interface) for constant in interface.constants]
special_getter_constants = []
runtime_enabled_constants = []
@@ -275,42 +279,219 @@
# Attributes
attributes = [v8_attributes.attribute_context(interface, attribute)
- for attribute in interface.attributes
- if not v8_utilities.dart_custom_method(attribute.extended_attributes)]
+ for attribute in interface.attributes]
+
+ has_conditional_attributes = any(attribute['exposed_test'] for attribute in attributes)
+ if has_conditional_attributes and interface.is_partial:
+ raise Exception('Conditional attributes between partial interfaces in modules and the original interfaces(%s) in core are not allowed.' % interface.name)
+
context.update({
'attributes': attributes,
- 'has_accessors': any(attribute['is_expose_js_accessors'] and attribute['should_be_exposed_to_script'] for attribute in attributes),
+ 'has_accessor_configuration': any(
+ attribute['is_expose_js_accessors'] and
+ not (attribute['is_static'] or
+ attribute['runtime_enabled_function']) 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'])
+ attribute['runtime_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_replaceable_attributes': any(attribute['is_replaceable'] for attribute in attributes),
})
# Methods
- 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))]
- compute_method_overloads_context(methods)
+ methods = []
+ if interface.original_interface:
+ methods.extend([v8_methods.method_context(interface, operation, is_visible=False)
+ for operation in interface.original_interface.operations
+ if operation.name])
+ methods.extend([v8_methods.method_context(interface, method)
+ for method in interface.operations
+ if method.name]) # Skip anonymous special operations (methods)
+ if interface.partial_interfaces:
+ assert len(interface.partial_interfaces) == len(set(interface.partial_interfaces))
+ for partial_interface in interface.partial_interfaces:
+ methods.extend([v8_methods.method_context(interface, operation, is_visible=False)
+ for operation in partial_interface.operations
+ if operation.name])
+ compute_method_overloads_context(interface, methods)
+
+ def generated_method(return_type, name, arguments=None, extended_attributes=None, implemented_as=None):
+ operation = IdlOperation(interface.idl_name)
+ operation.idl_type = return_type
+ operation.name = name
+ if arguments:
+ operation.arguments = arguments
+ if extended_attributes:
+ operation.extended_attributes.update(extended_attributes)
+ if implemented_as is None:
+ implemented_as = name + 'ForBinding'
+ operation.extended_attributes['ImplementedAs'] = implemented_as
+ return v8_methods.method_context(interface, operation)
+
+ def generated_argument(idl_type, name, is_optional=False, extended_attributes=None):
+ argument = IdlArgument(interface.idl_name)
+ argument.idl_type = idl_type
+ argument.name = name
+ argument.is_optional = is_optional
+ if extended_attributes:
+ argument.extended_attributes.update(extended_attributes)
+ return argument
+
+ # [Iterable], iterable<>, maplike<> and setlike<>
+ iterator_method = None
+ # FIXME: support Iterable in partial interfaces. However, we don't
+ # need to support iterator overloads between interface and
+ # partial interface definitions.
+ # http://heycam.github.io/webidl/#idl-overloading
+ if (not interface.is_partial
+ and (interface.iterable or interface.maplike or interface.setlike
+ or 'Iterable' in extended_attributes)):
+
+ used_extended_attributes = {}
+
+ if interface.iterable:
+ used_extended_attributes.update(interface.iterable.extended_attributes)
+ elif interface.maplike:
+ used_extended_attributes.update(interface.maplike.extended_attributes)
+ elif interface.setlike:
+ used_extended_attributes.update(interface.setlike.extended_attributes)
+
+ if 'RaisesException' in used_extended_attributes:
+ raise ValueError('[RaisesException] is implied for iterable<>/maplike<>/setlike<>')
+ if 'CallWith' in used_extended_attributes:
+ raise ValueError('[CallWith=ScriptState] is implied for iterable<>/maplike<>/setlike<>')
+
+ used_extended_attributes.update({
+ 'RaisesException': None,
+ 'CallWith': 'ScriptState',
+ })
+
+ forEach_extended_attributes = used_extended_attributes.copy()
+ forEach_extended_attributes.update({
+ 'CallWith': ['ScriptState', 'ThisValue'],
+ })
+
+ def generated_iterator_method(name, implemented_as=None):
+ return generated_method(
+ return_type=IdlType('Iterator'),
+ name=name,
+ extended_attributes=used_extended_attributes,
+ implemented_as=implemented_as)
+
+ iterator_method = generated_iterator_method('iterator', implemented_as='iterator')
+
+ if interface.iterable or interface.maplike or interface.setlike:
+ implicit_methods = [
+ generated_iterator_method('keys'),
+ generated_iterator_method('values'),
+ generated_iterator_method('entries'),
+
+ # void forEach(Function callback, [Default=Undefined] optional any thisArg)
+ generated_method(IdlType('void'), 'forEach',
+ arguments=[generated_argument(IdlType('Function'), 'callback'),
+ generated_argument(IdlType('any'), 'thisArg',
+ is_optional=True,
+ extended_attributes={'Default': 'Undefined'})],
+ extended_attributes=forEach_extended_attributes),
+ ]
+
+ if interface.maplike:
+ key_argument = generated_argument(interface.maplike.key_type, 'key')
+ value_argument = generated_argument(interface.maplike.value_type, 'value')
+
+ implicit_methods.extend([
+ generated_method(IdlType('boolean'), 'has',
+ arguments=[key_argument],
+ extended_attributes=used_extended_attributes),
+ generated_method(IdlType('any'), 'get',
+ arguments=[key_argument],
+ extended_attributes=used_extended_attributes),
+ ])
+
+ if not interface.maplike.is_read_only:
+ implicit_methods.extend([
+ generated_method(IdlType('void'), 'clear',
+ extended_attributes=used_extended_attributes),
+ generated_method(IdlType('boolean'), 'delete',
+ arguments=[key_argument],
+ extended_attributes=used_extended_attributes),
+ generated_method(IdlType(interface.name), 'set',
+ arguments=[key_argument, value_argument],
+ extended_attributes=used_extended_attributes),
+ ])
+
+ if interface.setlike:
+ value_argument = generated_argument(interface.setlike.value_type, 'value')
+
+ implicit_methods.extend([
+ generated_method(IdlType('boolean'), 'has',
+ arguments=[value_argument],
+ extended_attributes=used_extended_attributes),
+ ])
+
+ if not interface.setlike.is_read_only:
+ implicit_methods.extend([
+ generated_method(IdlType(interface.name), 'add',
+ arguments=[value_argument],
+ extended_attributes=used_extended_attributes),
+ generated_method(IdlType('void'), 'clear',
+ extended_attributes=used_extended_attributes),
+ generated_method(IdlType('boolean'), 'delete',
+ arguments=[value_argument],
+ extended_attributes=used_extended_attributes),
+ ])
+
+ methods_by_name = {}
+ for method in methods:
+ methods_by_name.setdefault(method['name'], []).append(method)
+
+ for implicit_method in implicit_methods:
+ if implicit_method['name'] in methods_by_name:
+ # FIXME: Check that the existing method is compatible.
+ continue
+ methods.append(implicit_method)
+
+ # FIXME: maplike<> and setlike<> should also imply the presence of a
+ # 'size' attribute.
+
+ # Serializer
+ if interface.serializer:
+ serializer = interface.serializer
+ serializer_ext_attrs = serializer.extended_attributes.copy()
+ if serializer.operation:
+ return_type = serializer.operation.idl_type
+ implemented_as = serializer.operation.name
+ else:
+ return_type = IdlType('any')
+ implemented_as = None
+ if 'CallWith' not in serializer_ext_attrs:
+ serializer_ext_attrs['CallWith'] = 'ScriptState'
+ methods.append(generated_method(
+ return_type=return_type,
+ name='toJSON',
+ extended_attributes=serializer_ext_attrs,
+ implemented_as=implemented_as))
# 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)
+ stringifier_ext_attrs = stringifier.extended_attributes.copy()
if stringifier.attribute:
- method.extended_attributes['ImplementedAs'] = stringifier.attribute.name
+ implemented_as = stringifier.attribute.name
elif stringifier.operation:
- method.extended_attributes['ImplementedAs'] = stringifier.operation.name
- methods.append(v8_methods.method_context(interface, method))
+ implemented_as = stringifier.operation.name
+ else:
+ implemented_as = 'toString'
+ methods.append(generated_method(
+ return_type=IdlType('DOMString'),
+ name='toString',
+ extended_attributes=stringifier_ext_attrs,
+ implemented_as=implemented_as))
conditionally_enabled_methods = []
custom_registration_methods = []
@@ -323,20 +504,29 @@
if 'overloads' in method:
overloads = method['overloads']
- per_context_enabled_function = overloads['per_context_enabled_function_all']
+ if not overloads['visible']:
+ continue
+ # original interface will register instead of partial interface.
+ if overloads['has_partial_overloads'] and interface.is_partial:
+ continue
conditionally_exposed_function = overloads['exposed_test_all']
runtime_enabled_function = overloads['runtime_enabled_function_all']
- has_custom_registration = overloads['has_custom_registration_all']
+ has_custom_registration = (overloads['has_custom_registration_all'] or
+ overloads['runtime_determined_lengths'])
else:
- per_context_enabled_function = method['per_context_enabled_function']
+ if not method['visible']:
+ continue
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 or conditionally_exposed_function:
+ if has_custom_registration:
+ custom_registration_methods.append(method)
+ continue
+ if conditionally_exposed_function:
conditionally_enabled_methods.append(method)
continue
- if runtime_enabled_function or has_custom_registration:
+ if runtime_enabled_function:
custom_registration_methods.append(method)
continue
if method['should_be_exposed_to_script']:
@@ -354,7 +544,7 @@
# enabled overloads are actually enabled, so length may be incorrect.
# E.g., [RuntimeEnabled=Foo] void f(); void f(long x);
# should have length 1 if Foo is not enabled, but length 0 if it is.
- method['length'] = (method['overloads']['minarg'] if 'overloads' in method else
+ method['length'] = (method['overloads']['length'] if 'overloads' in method else
method['number_of_required_arguments'])
context.update({
@@ -365,31 +555,46 @@
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),
+ 'iterator_method': iterator_method,
'method_configuration_methods': method_configuration_methods,
'methods': methods,
})
+ # Conditionally enabled members
+ has_conditional_attributes_on_instance = any(
+ attribute['exposed_test'] and attribute['on_instance']
+ for attribute in attributes)
+ has_conditional_attributes_on_prototype = any(
+ attribute['exposed_test'] and attribute['on_prototype']
+ for attribute in attributes)
context.update({
- 'indexed_property_getter': indexed_property_getter(interface),
- 'indexed_property_setter': indexed_property_setter(interface),
- 'indexed_property_deleter': indexed_property_deleter(interface),
+ 'has_conditional_attributes_on_instance':
+ has_conditional_attributes_on_instance,
+ 'has_conditional_attributes_on_prototype':
+ has_conditional_attributes_on_prototype,
+ })
+
+ context.update({
+ 'indexed_property_getter': property_getter(interface.indexed_property_getter, ['index']),
+ 'indexed_property_setter': property_setter(interface.indexed_property_setter, interface),
+ 'indexed_property_deleter': property_deleter(interface.indexed_property_deleter),
'is_override_builtins': 'OverrideBuiltins' in extended_attributes,
- 'named_property_getter': named_property_getter(interface),
- 'named_property_setter': named_property_setter(interface),
- 'named_property_deleter': named_property_deleter(interface),
+ 'named_property_getter': property_getter(interface.named_property_getter, ['propertyName']),
+ 'named_property_setter': property_setter(interface.named_property_setter, interface),
+ 'named_property_deleter': property_deleter(interface.named_property_deleter),
})
return context
# [DeprecateAs], [Reflect], [RuntimeEnabled]
-def constant_context(constant):
+def constant_context(constant, interface):
extended_attributes = constant.extended_attributes
return {
'cpp_class': extended_attributes.get('PartialInterfaceImplementedAs'),
'deprecate_as': v8_utilities.deprecate_as(constant), # [DeprecateAs]
'idl_type': constant.idl_type.name,
- 'measure_as': v8_utilities.measure_as(constant), # [MeasureAs]
+ 'measure_as': v8_utilities.measure_as(constant, interface), # [MeasureAs]
'name': constant.name,
# FIXME: use 'reflected_name' as correct 'name'
'reflected_name': extended_attributes.get('Reflect', constant.name),
@@ -402,16 +607,16 @@
# Overloads
################################################################################
-def compute_method_overloads_context(methods):
+def compute_method_overloads_context(interface, methods):
# Regular methods
- compute_method_overloads_context_by_type([method for method in methods
- if not method['is_static']])
+ compute_method_overloads_context_by_type(
+ interface, [method for method in methods if not method['is_static']])
# Static methods
- compute_method_overloads_context_by_type([method for method in methods
- if method['is_static']])
+ compute_method_overloads_context_by_type(
+ interface, [method for method in methods if method['is_static']])
-def compute_method_overloads_context_by_type(methods):
+def compute_method_overloads_context_by_type(interface, methods):
"""Computes |method.overload*| template values.
Called separately for static and non-static (regular) methods,
@@ -425,7 +630,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'] = overloads_context(overloads)
+ overloads[-1]['overloads'] = overloads_context(interface, overloads)
overloads[-1]['overloads']['name'] = name
@@ -443,7 +648,7 @@
return sort_and_groupby(overloaded_methods, itemgetter('name'))
-def overloads_context(overloads):
+def overloads_context(interface, overloads):
"""Returns |overloads| template values for a single name.
Sets |method.overload_index| in place for |method| in |overloads|
@@ -457,17 +662,58 @@
lengths = [length for length, _ in effective_overloads_by_length]
name = overloads[0].get('name', '<constructor>')
- # Check and fail if all overloads with the shortest acceptable arguments
- # list are runtime enabled, since we would otherwise set 'length' on the
- # function object to an incorrect value when none of those overloads were
- # actually enabled at runtime. The exception is if all overloads are
- # controlled by the same runtime enabled feature, in which case there would
- # be no function object at all if it is not enabled.
- shortest_overloads = effective_overloads_by_length[0][1]
- if (all(method.get('runtime_enabled_function')
- for method, _, _ in shortest_overloads) and
- not common_value(overloads, 'runtime_enabled_function')):
- raise ValueError('Function.length of %s depends on runtime enabled features' % name)
+ runtime_determined_lengths = None
+ function_length = lengths[0]
+ runtime_determined_maxargs = None
+ maxarg = lengths[-1]
+
+ # The special case handling below is not needed if all overloads are
+ # runtime enabled by the same feature.
+ if not common_value(overloads, 'runtime_enabled_function'):
+ # Check if all overloads with the shortest acceptable arguments list are
+ # runtime enabled, in which case we need to have a runtime determined
+ # Function.length.
+ shortest_overloads = effective_overloads_by_length[0][1]
+ if (all(method.get('runtime_enabled_function')
+ for method, _, _ in shortest_overloads)):
+ # Generate a list of (length, runtime_enabled_functions) tuples.
+ runtime_determined_lengths = []
+ for length, effective_overloads in effective_overloads_by_length:
+ runtime_enabled_functions = set(
+ method['runtime_enabled_function']
+ for method, _, _ in effective_overloads
+ if method.get('runtime_enabled_function'))
+ if not runtime_enabled_functions:
+ # This "length" is unconditionally enabled, so stop here.
+ runtime_determined_lengths.append((length, [None]))
+ break
+ runtime_determined_lengths.append(
+ (length, sorted(runtime_enabled_functions)))
+ function_length = ('%sV8Internal::%sMethodLength()'
+ % (cpp_name_or_partial(interface), name))
+
+ # Check if all overloads with the longest required arguments list are
+ # runtime enabled, in which case we need to have a runtime determined
+ # maximum distinguishing argument index.
+ longest_overloads = effective_overloads_by_length[-1][1]
+ if (not common_value(overloads, 'runtime_enabled_function') and
+ all(method.get('runtime_enabled_function')
+ for method, _, _ in longest_overloads)):
+ # Generate a list of (length, runtime_enabled_functions) tuples.
+ runtime_determined_maxargs = []
+ for length, effective_overloads in reversed(effective_overloads_by_length):
+ runtime_enabled_functions = set(
+ method['runtime_enabled_function']
+ for method, _, _ in effective_overloads
+ if method.get('runtime_enabled_function'))
+ if not runtime_enabled_functions:
+ # This "length" is unconditionally enabled, so stop here.
+ runtime_determined_maxargs.append((length, [None]))
+ break
+ runtime_determined_maxargs.append(
+ (length, sorted(runtime_enabled_functions)))
+ maxarg = ('%sV8Internal::%sMethodMaxArg()'
+ % (cpp_name_or_partial(interface), name))
# Check and fail if overloads disagree on any of the extended attributes
# that affect how the method should be registered.
@@ -484,28 +730,46 @@
# Check and fail if overloads disagree about whether the return type
# is a Promise or not.
- promise_overload_count = sum(1 for method in overloads if method.get('idl_type') == 'Promise')
+ promise_overload_count = sum(1 for method in overloads if method.get('returns_promise'))
if promise_overload_count not in (0, len(overloads)):
raise ValueError('Overloads of %s have conflicting Promise/non-Promise types'
% (name))
+ has_overload_visible = False
+ has_overload_not_visible = False
+ for overload in overloads:
+ if overload.get('visible', True):
+ # If there exists an overload which is visible, need to generate
+ # overload_resolution, i.e. overlods_visible should be True.
+ has_overload_visible = True
+ else:
+ has_overload_not_visible = True
+
+ # If some overloads are not visible and others are visible,
+ # the method is overloaded between core and modules.
+ has_partial_overloads = has_overload_visible and has_overload_not_visible
+
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': function_length,
'length_tests_methods': length_tests_methods(effective_overloads_by_length),
# 1. Let maxarg be the length of the longest type list of the
# entries in S.
- 'maxarg': lengths[-1],
+ 'maxarg': maxarg,
'measure_all_as': common_value(overloads, 'measure_as'), # [MeasureAs]
- 'minarg': lengths[0],
- 'per_context_enabled_function_all': common_value(overloads, 'per_context_enabled_function'), # [PerContextEnabled]
+ 'returns_promise_all': promise_overload_count > 0,
+ 'runtime_determined_lengths': runtime_determined_lengths,
+ 'runtime_determined_maxargs': runtime_determined_maxargs,
'runtime_enabled_function_all': common_value(overloads, 'runtime_enabled_function'), # [RuntimeEnabled]
'valid_arities': lengths
# Only need to report valid arities if there is a gap in the
# sequence of possible lengths, otherwise invalid length means
# "not enough arguments".
if lengths[-1] - lengths[0] != len(lengths) - 1 else None,
+ 'visible': has_overload_visible,
+ 'has_partial_overloads': has_partial_overloads,
}
@@ -570,8 +834,9 @@
# if X’s argument at index i is a final, variadic argument, “optional”
# if the argument is optional, and “required” otherwise.
# (“optionality list”)
- # (We’re just using a boolean for optional vs. required.)
- o = tuple(argument['is_optional'] for argument in arguments)
+ # (We’re just using a boolean for optional/variadic vs. required.)
+ o = tuple(argument['is_optional'] or argument['is_variadic']
+ for argument in arguments)
# 4. Add to S the tuple <X, t0..n−1, o0..n−1>.
S.append((X, t, o))
# 5. If X is declared to be variadic, then:
@@ -776,11 +1041,32 @@
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,
+ # 13. Otherwise: if IsCallable(V) is true, and there is an entry in S that
+ # has one of the following types at position i of its type list,
+ # • a callback function type
+ # ...
+ #
+ # FIXME:
+ # We test for functions rather than callability, which isn't strictly the
+ # same thing.
+ try:
+ method = next(method for idl_type, method in idl_types_methods
+ if idl_type.is_callback_function)
+ test = '%s->IsFunction()' % cpp_value
+ yield test, method
+ except StopIteration:
+ pass
+
+ # 14. Otherwise: if V is any kind of object except for a native Date object,
+ # a native RegExp object, and there is an entry in S that has one of the
+ # following types at position i of its type list,
+ # • a sequence type
+ # ...
+ #
+ # 15. Otherwise: if V is any kind of object except for a native Date object,
# a native RegExp object, and there is an entry in S that has one of the
# following types at position i of its type list,
# • an array type
- # • a sequence type
# ...
# • a dictionary
#
@@ -831,7 +1117,7 @@
# types at position i of its type list,
# • DOMString
# • ByteString
- # • ScalarValueString [a DOMString typedef, per definition.]
+ # • USVString
# • an enumeration type
try:
method = next(method for idl_type, method in idl_types_methods
@@ -930,6 +1216,10 @@
# [ConstructorCallWith=ExecutionContext]
has_extended_attribute_value(interface,
'ConstructorCallWith', 'ExecutionContext'),
+ 'is_call_with_script_state':
+ # [ConstructorCallWith=ScriptState]
+ has_extended_attribute_value(
+ interface, 'ConstructorCallWith', 'ScriptState'),
'is_constructor': True,
'is_named_constructor': False,
'is_raises_exception': is_constructor_raises_exception,
@@ -963,8 +1253,6 @@
def interface_length(interface, constructors):
# Docs: http://heycam.github.io/webidl/#es-interface-call
- if 'EventConstructor' in interface.extended_attributes:
- return 1
if not constructors:
return 0
return min(constructor['number_of_required_arguments']
@@ -977,37 +1265,44 @@
################################################################################
def property_getter(getter, cpp_arguments):
+ if not getter:
+ return None
+
def is_null_expression(idl_type):
- if idl_type.is_union_type:
- notnull = ' || '.join([
- member_argument['null_check_value']
- for member_argument in idl_type.union_arguments])
- return '!(%s)' % notnull
- if idl_type.name == 'String':
+ if idl_type.use_output_parameter_for_result:
+ return 'result.isNull()'
+ if idl_type.is_string_type:
return 'result.isNull()'
if idl_type.is_interface_type:
return '!result'
+ if idl_type.base_type in ('any', 'object'):
+ return 'result.isEmpty()'
return ''
- idl_type = getter.idl_type
extended_attributes = getter.extended_attributes
+ idl_type = getter.idl_type
+ idl_type.add_includes_for_type(extended_attributes)
+ is_call_with_script_state = v8_utilities.has_extended_attribute_value(getter, 'CallWith', 'ScriptState')
is_raises_exception = 'RaisesException' in extended_attributes
+ use_output_parameter_for_result = idl_type.use_output_parameter_for_result
# FIXME: make more generic, so can use v8_methods.cpp_value
cpp_method_name = 'impl->%s' % cpp_name(getter)
+ if is_call_with_script_state:
+ cpp_arguments.insert(0, 'scriptState')
if is_raises_exception:
cpp_arguments.append('exceptionState')
- union_arguments = idl_type.union_arguments
- if union_arguments:
- cpp_arguments.extend([member_argument['cpp_value']
- for member_argument in union_arguments])
+ if use_output_parameter_for_result:
+ cpp_arguments.append('result')
cpp_value = '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
return {
'cpp_type': idl_type.cpp_type,
'cpp_value': cpp_value,
+ 'do_not_check_security': 'DoNotCheckSecurity' in extended_attributes,
+ 'is_call_with_script_state': is_call_with_script_state,
'is_custom':
'Custom' in extended_attributes and
(not extended_attributes['Custom'] or
@@ -1020,23 +1315,34 @@
'is_null_expression': is_null_expression(idl_type),
'is_raises_exception': is_raises_exception,
'name': cpp_name(getter),
- 'union_arguments': union_arguments,
+ 'use_output_parameter_for_result': use_output_parameter_for_result,
'v8_set_return_value': idl_type.v8_set_return_value('result', extended_attributes=extended_attributes, script_wrappable='impl', release=idl_type.release),
}
-def property_setter(setter):
- idl_type = setter.arguments[1].idl_type
+def property_setter(setter, interface):
+ if not setter:
+ return None
+
extended_attributes = setter.extended_attributes
+ idl_type = setter.arguments[1].idl_type
+ idl_type.add_includes_for_type(extended_attributes)
+ is_call_with_script_state = v8_utilities.has_extended_attribute_value(setter, 'CallWith', 'ScriptState')
is_raises_exception = 'RaisesException' in extended_attributes
+
+ # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking]
+ has_type_checking_interface = (
+ not is_legacy_interface_type_checking(interface, setter) and
+ idl_type.is_wrapper_type)
+
return {
- 'has_type_checking_interface':
- has_extended_attribute_value(setter, 'TypeChecking', 'Interface') and
- idl_type.is_wrapper_type,
- 'idl_type': idl_type.base_type,
- 'is_custom': 'Custom' in extended_attributes,
'has_exception_state': (is_raises_exception or
idl_type.v8_conversion_needs_exception_state),
+ 'has_type_checking_interface': has_type_checking_interface,
+ 'idl_type': idl_type.base_type,
+ 'is_call_with_script_state': is_call_with_script_state,
+ 'is_custom': 'Custom' in extended_attributes,
+ 'is_nullable': idl_type.is_nullable,
'is_raises_exception': is_raises_exception,
'name': cpp_name(setter),
'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
@@ -1045,121 +1351,15 @@
def property_deleter(deleter):
- idl_type = deleter.idl_type
- if str(idl_type) != 'boolean':
- raise Exception(
- 'Only deleters with boolean type are allowed, but type is "%s"' %
- idl_type)
+ if not deleter:
+ return None
+
extended_attributes = deleter.extended_attributes
+ idl_type = deleter.idl_type
+ is_call_with_script_state = v8_utilities.has_extended_attribute_value(deleter, 'CallWith', 'ScriptState')
return {
+ 'is_call_with_script_state': is_call_with_script_state,
'is_custom': 'Custom' in extended_attributes,
'is_raises_exception': 'RaisesException' in extended_attributes,
'name': cpp_name(deleter),
}
-
-
-################################################################################
-# Indexed properties
-# http://heycam.github.io/webidl/#idl-indexed-properties
-################################################################################
-
-def indexed_property_getter(interface):
- try:
- # Find indexed property getter, if present; has form:
- # getter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1)
- getter = next(
- method
- for method in interface.operations
- if ('getter' in method.specials and
- len(method.arguments) == 1 and
- str(method.arguments[0].idl_type) == 'unsigned long'))
- except StopIteration:
- return None
-
- return property_getter(getter, ['index'])
-
-
-def indexed_property_setter(interface):
- try:
- # Find indexed property setter, if present; has form:
- # setter RETURN_TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1, ARG_TYPE ARG2)
- setter = next(
- method
- for method in interface.operations
- if ('setter' in method.specials and
- len(method.arguments) == 2 and
- str(method.arguments[0].idl_type) == 'unsigned long'))
- except StopIteration:
- return None
-
- return property_setter(setter)
-
-
-def indexed_property_deleter(interface):
- try:
- # Find indexed property deleter, if present; has form:
- # deleter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG)
- deleter = next(
- method
- for method in interface.operations
- if ('deleter' in method.specials and
- len(method.arguments) == 1 and
- str(method.arguments[0].idl_type) == 'unsigned long'))
- except StopIteration:
- return None
-
- return property_deleter(deleter)
-
-
-################################################################################
-# Named properties
-# http://heycam.github.io/webidl/#idl-named-properties
-################################################################################
-
-def named_property_getter(interface):
- try:
- # Find named property getter, if present; has form:
- # getter TYPE [OPTIONAL_IDENTIFIER](DOMString ARG1)
- getter = next(
- method
- for method in interface.operations
- if ('getter' in method.specials and
- len(method.arguments) == 1 and
- str(method.arguments[0].idl_type) == 'DOMString'))
- except StopIteration:
- return None
-
- getter.name = getter.name or 'anonymousNamedGetter'
- return property_getter(getter, ['propertyName'])
-
-
-def named_property_setter(interface):
- try:
- # Find named property setter, if present; has form:
- # setter RETURN_TYPE [OPTIONAL_IDENTIFIER](DOMString ARG1, ARG_TYPE ARG2)
- setter = next(
- method
- for method in interface.operations
- if ('setter' in method.specials and
- len(method.arguments) == 2 and
- str(method.arguments[0].idl_type) == 'DOMString'))
- except StopIteration:
- return None
-
- return property_setter(setter)
-
-
-def named_property_deleter(interface):
- try:
- # Find named property deleter, if present; has form:
- # deleter TYPE [OPTIONAL_IDENTIFIER](DOMString ARG)
- deleter = next(
- method
- for method in interface.operations
- if ('deleter' in method.specials and
- len(method.arguments) == 1 and
- str(method.arguments[0].idl_type) == 'DOMString'))
- except StopIteration:
- return None
-
- return property_deleter(deleter)
diff --git a/bindings/scripts/v8_methods.py b/bindings/scripts/v8_methods.py
index d330712..7db6e4e 100644
--- a/bindings/scripts/v8_methods.py
+++ b/bindings/scripts/v8_methods.py
@@ -39,7 +39,8 @@
from v8_globals import includes
import v8_types
import v8_utilities
-from v8_utilities import has_extended_attribute_value
+from v8_utilities import (has_extended_attribute_value, is_unforgeable,
+ is_legacy_interface_type_checking)
# Methods with any of these require custom method registration code in the
@@ -62,20 +63,22 @@
idl_type.is_explicit_nullable)
-def method_context(interface, method):
+def method_context(interface, method, is_visible=True):
arguments = method.arguments
extended_attributes = method.extended_attributes
idl_type = method.idl_type
is_static = method.is_static
name = method.name
- idl_type.add_includes_for_type()
+ if is_visible:
+ idl_type.add_includes_for_type(extended_attributes)
+
this_cpp_value = cpp_value(interface, method, len(arguments))
def function_template():
if is_static:
return 'functionTemplate'
- if 'Unforgeable' in extended_attributes:
+ if is_unforgeable(interface, method):
return 'instanceTemplate'
return 'prototypeTemplate'
@@ -93,11 +96,12 @@
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/core/v8/V8ScriptState.h')
+ is_call_with_this_value = has_extended_attribute_value(method, 'CallWith', 'ThisValue')
+ if is_call_with_script_state or is_call_with_this_value:
+ includes.add('bindings/core/v8/ScriptState.h')
is_check_security_for_node = 'CheckSecurity' in extended_attributes
if is_check_security_for_node:
- includes.add('bindings/common/BindingSecurity.h')
+ includes.add('bindings/core/v8/BindingSecurity.h')
is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attributes
if is_custom_element_callbacks:
includes.add('core/dom/custom/CustomElementProcessingStack.h')
@@ -113,10 +117,20 @@
not is_do_not_check_security)
is_raises_exception = 'RaisesException' in extended_attributes
+ is_custom_call_prologue = has_extended_attribute_value(method, 'Custom', 'CallPrologue')
+ is_custom_call_epilogue = has_extended_attribute_value(method, 'Custom', 'CallEpilogue')
+ is_post_message = 'PostMessage' in extended_attributes
+ if is_post_message:
+ includes.add('bindings/core/v8/SerializedScriptValueFactory.h')
+ includes.add('core/dom/DOMArrayBuffer.h')
+ includes.add('core/dom/MessagePort.h')
+
+ if 'LenientThis' in extended_attributes:
+ raise Exception('[LenientThis] is not supported for operations.')
return {
'activity_logging_world_list': v8_utilities.activity_logging_world_list(method), # [ActivityLogging]
- 'arguments': [argument_context(interface, method, argument, index)
+ 'arguments': [argument_context(interface, method, argument, index, is_visible=is_visible)
for index, argument in enumerate(arguments)],
'argument_declarations_for_private_script':
argument_declarations_for_private_script(interface, method),
@@ -131,7 +145,9 @@
'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
+ 'has_custom_registration':
+ is_static or
+ is_unforgeable(interface, method) or
v8_utilities.has_extended_attribute(
method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES),
'has_exception_state':
@@ -145,10 +161,14 @@
'is_call_with_execution_context': has_extended_attribute_value(method, 'CallWith', 'ExecutionContext'),
'is_call_with_script_arguments': is_call_with_script_arguments,
'is_call_with_script_state': is_call_with_script_state,
+ 'is_call_with_this_value': is_call_with_this_value,
'is_check_security_for_frame': is_check_security_for_frame,
'is_check_security_for_node': is_check_security_for_node,
'is_check_security_for_window': is_check_security_for_window,
- 'is_custom': 'Custom' in extended_attributes,
+ 'is_custom': 'Custom' in extended_attributes and
+ not (is_custom_call_prologue or is_custom_call_epilogue),
+ 'is_custom_call_prologue': is_custom_call_prologue,
+ 'is_custom_call_epilogue': is_custom_call_epilogue,
'is_custom_element_callbacks': is_custom_element_callbacks,
'is_do_not_check_security': is_do_not_check_security,
'is_do_not_check_signature': 'DoNotCheckSignature' in extended_attributes,
@@ -157,11 +177,12 @@
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
+ 'is_post_message': is_post_message,
'is_raises_exception': is_raises_exception,
- 'is_read_only': 'Unforgeable' in extended_attributes,
+ 'is_read_only': is_unforgeable(interface, method),
'is_static': is_static,
'is_variadic': arguments and arguments[-1].is_variadic,
- 'measure_as': v8_utilities.measure_as(method), # [MeasureAs]
+ 'measure_as': v8_utilities.measure_as(method, interface), # [MeasureAs]
'name': name,
'number_of_arguments': len(arguments),
'number_of_required_arguments': len([
@@ -170,72 +191,84 @@
'number_of_required_or_variadic_arguments': len([
argument for argument in arguments
if not argument.is_optional]),
+ 'on_instance': v8_utilities.on_instance(interface, method),
+ 'on_interface': v8_utilities.on_interface(interface, method),
+ 'on_prototype': v8_utilities.on_prototype(interface, method),
'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),
+ extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->isolate()', bailout_return_value='false'),
+ 'property_attributes': property_attributes(interface, method),
+ 'returns_promise': method.returns_promise,
'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,
+ 'use_output_parameter_for_result': idl_type.use_output_parameter_for_result,
'use_local_result': use_local_result(method),
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
+ 'visible': is_visible,
'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended_attributes else [''], # [PerWorldBindings],
}
-def argument_context(interface, method, argument, index):
+def argument_context(interface, method, argument, index, is_visible=True):
extended_attributes = argument.extended_attributes
idl_type = argument.idl_type
+ if is_visible:
+ idl_type.add_includes_for_type(extended_attributes)
this_cpp_value = cpp_value(interface, method, index)
is_variadic_wrapper_type = argument.is_variadic and idl_type.is_wrapper_type
+ # [TypeChecking=Interface] / [LegacyInterfaceTypeChecking]
+ has_type_checking_interface = (
+ not is_legacy_interface_type_checking(interface, method) and
+ idl_type.is_wrapper_type)
+
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.')
- default_cpp_value = argument.default_cpp_value
- return {
- 'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attributes,
+ set_default_value = argument.set_default_value
+ this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes,
raw_type=True,
- used_as_variadic_argument=argument.is_variadic),
+ used_as_variadic_argument=argument.is_variadic)
+ return {
+ 'cpp_type': (
+ v8_types.cpp_template_type('Nullable', this_cpp_type)
+ if idl_type.is_explicit_nullable and not argument.is_variadic
+ else this_cpp_type),
'cpp_value': this_cpp_value,
# FIXME: check that the default value's type is compatible with the argument's
- 'default_value': default_cpp_value,
- 'enum_validation_expression': idl_type.enum_validation_expression,
+ 'set_default_value': set_default_value,
+ 'enum_type': idl_type.enum_type,
+ 'enum_values': idl_type.enum_values,
'handle': '%sHandle' % argument.name,
# FIXME: remove once [Default] removed and just use argument.default_value
- 'has_default': 'Default' in extended_attributes or default_cpp_value,
- 'has_type_checking_interface':
- (has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
- has_extended_attribute_value(method, 'TypeChecking', 'Interface')) and
- idl_type.is_wrapper_type,
- 'has_type_checking_unrestricted':
- (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or
- has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted')) and
- idl_type.name in ('Float', 'Double'),
+ 'has_default': 'Default' in extended_attributes or set_default_value,
+ 'has_type_checking_interface': has_type_checking_interface,
# Dictionary is special-cased, but arrays and sequences shouldn't be
'idl_type': idl_type.base_type,
'idl_type_object': idl_type,
'index': index,
+ 'is_callback_function': idl_type.is_callback_function,
'is_callback_interface': idl_type.is_callback_interface,
# FIXME: Remove generic 'Dictionary' special-casing
'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictionary',
+ 'is_explicit_nullable': idl_type.is_explicit_nullable,
'is_nullable': idl_type.is_nullable,
'is_optional': argument.is_optional,
+ 'is_variadic': argument.is_variadic,
'is_variadic_wrapper_type': is_variadic_wrapper_type,
'is_wrapper_type': idl_type.is_wrapper_type,
'name': argument.name,
'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
argument.name, isolate='scriptState->isolate()',
creation_context='scriptState->context()->Global()'),
+ 'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in extended_attributes,
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
'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=method.returns_promise),
- 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc_type),
+ 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(method, argument, index),
}
@@ -258,8 +291,6 @@
idl_type = argument.idl_type
if idl_type.name == 'EventListener':
return argument.name
- if idl_type.is_dictionary:
- return '*%s' % argument.name
if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull',
'XPathNSResolver', 'XPathNSResolverOrNull']):
# FIXME: remove this special case
@@ -270,7 +301,7 @@
arguments = method.arguments[:number_of_arguments]
cpp_arguments = []
if 'ImplementedInPrivateScript' in method.extended_attributes:
- cpp_arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())')
+ cpp_arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
cpp_arguments.append('impl')
if method.is_constructor:
@@ -288,11 +319,6 @@
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([member_argument['cpp_value']
- for member_argument in this_union_arguments])
-
if 'ImplementedInPrivateScript' in method.extended_attributes:
if method.idl_type.name != 'void':
cpp_arguments.append('&result')
@@ -301,6 +327,12 @@
has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
cpp_arguments.append('exceptionState')
+ # If a method returns an IDL dictionary or union type, the return value is
+ # passed as an argument to impl classes.
+ idl_type = method.idl_type
+ if idl_type and idl_type.use_output_parameter_for_result:
+ cpp_arguments.append('result')
+
if method.name == 'Constructor':
base_name = 'create'
elif method.name == 'NamedConstructor':
@@ -337,39 +369,43 @@
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)
+ return idl_type.v8_set_return_value(cpp_value, extended_attributes, script_wrappable=script_wrappable, release=release, for_main_world=for_main_world, is_static=method.is_static)
-def v8_value_to_local_cpp_variadic_value(argument, index, return_promise):
+def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise):
assert argument.is_variadic
idl_type = argument.idl_type
+ this_cpp_type = idl_type.cpp_type
- suffix = ''
+ if method.returns_promise:
+ check_expression = 'exceptionState.hadException()'
+ else:
+ check_expression = 'exceptionState.throwIfNeeded()'
- macro = 'TONATIVE_VOID_EXCEPTIONSTATE'
- macro_args = [
- argument.name,
- 'toImplArguments<%s>(info, %s, exceptionState)' % (idl_type.cpp_type, index),
- 'exceptionState',
- ]
+ if idl_type.is_dictionary or idl_type.is_union_type:
+ vector_type = 'HeapVector'
+ else:
+ vector_type = 'Vector'
- if return_promise:
- suffix += '_PROMISE'
- macro_args.extend(['info', 'V8ScriptState::current(info.GetIsolate())'])
-
- suffix += '_INTERNAL'
-
- return '%s%s(%s)' % (macro, suffix, ', '.join(macro_args))
+ return {
+ 'assign_expression': 'toImplArguments<%s<%s>>(info, %s, exceptionState)' % (vector_type, this_cpp_type, index),
+ 'check_expression': check_expression,
+ 'cpp_type': this_cpp_type,
+ 'cpp_name': argument.name,
+ 'declare_variable': False,
+ }
-def v8_value_to_local_cpp_value(argument, index, return_promise=False):
+def v8_value_to_local_cpp_value(method, argument, index, return_promise=False, restricted_float=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, return_promise)
+ return v8_value_to_local_cpp_variadic_value(method, 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)
+ name, index=index, declare_variable=False,
+ use_exception_state=method.returns_promise,
+ restricted_float=restricted_float)
################################################################################
@@ -377,63 +413,61 @@
################################################################################
# [NotEnumerable]
-def property_attributes(method):
+def property_attributes(interface, method):
extended_attributes = method.extended_attributes
property_attributes_list = []
if 'NotEnumerable' in extended_attributes:
property_attributes_list.append('v8::DontEnum')
- if 'Unforgeable' in extended_attributes:
+ if is_unforgeable(interface, method):
property_attributes_list.append('v8::ReadOnly')
if property_attributes_list:
property_attributes_list.insert(0, 'v8::DontDelete')
return property_attributes_list
-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
- this_cpp_type_initializer = idl_type.cpp_type_initializer
- cpp_return_value = this_cpp_value
-
- if not idl_type.cpp_type_has_null_value:
- this_cpp_type = v8_types.cpp_template_type('Nullable', this_cpp_type)
- this_cpp_type_initializer = ''
- 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_type_initializer': this_cpp_type_initializer,
- '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 argument.idl_type.is_dictionary:
- # We always create impl objects for IDL dictionaries.
- return '%s::create()' % argument.idl_type.base_type
- if not argument.default_value:
+def argument_set_default_value(argument):
+ idl_type = argument.idl_type
+ default_value = argument.default_value
+ if not default_value:
return None
- return argument.idl_type.literal_cpp_value(argument.default_value)
+ if idl_type.is_dictionary:
+ if not argument.default_value.is_null:
+ raise Exception('invalid default value for dictionary type')
+ return None
+ if idl_type.is_array_or_sequence_type:
+ if default_value.value != '[]':
+ raise Exception('invalid default value for sequence type: %s' % default_value.value)
+ # Nothing to do when we set an empty sequence as default value, but we
+ # need to return non-empty value so that we don't generate method calls
+ # without this argument.
+ return '/* Nothing to do */'
+ if idl_type.is_union_type:
+ if argument.default_value.is_null:
+ if not idl_type.includes_nullable_type:
+ raise Exception('invalid default value for union type: null for %s'
+ % idl_type.name)
+ # Union container objects are "null" initially.
+ return '/* null default value */'
+ if isinstance(default_value.value, basestring):
+ member_type = idl_type.string_member_type
+ elif isinstance(default_value.value, (int, float)):
+ member_type = idl_type.numeric_member_type
+ elif isinstance(default_value.value, bool):
+ member_type = idl_type.boolean_member_type
+ else:
+ member_type = None
+ if member_type is None:
+ raise Exception('invalid default value for union type: %r for %s'
+ % (default_value.value, idl_type.name))
+ member_type_name = (member_type.inner_type.name
+ if member_type.is_nullable else
+ member_type.name)
+ return '%s.set%s(%s)' % (argument.name, member_type_name,
+ member_type.literal_cpp_value(default_value))
+ return '%s = %s' % (argument.name,
+ idl_type.literal_cpp_value(default_value))
-IdlTypeBase.union_arguments = None
-IdlUnionType.union_arguments = property(union_arguments)
-IdlArgument.default_cpp_value = property(argument_default_cpp_value)
+IdlArgument.set_default_value = property(argument_set_default_value)
def method_returns_promise(method):
@@ -446,5 +480,4 @@
idl_type = argument.idl_type
return (idl_type.v8_conversion_needs_exception_state or
argument.is_variadic or
- (method.returns_promise and (idl_type.is_string_type or
- idl_type.is_enum)))
+ (method.returns_promise and idl_type.is_string_type))
diff --git a/bindings/scripts/v8_types.py b/bindings/scripts/v8_types.py
index a332f4a..f5c92bc 100644
--- a/bindings/scripts/v8_types.py
+++ b/bindings/scripts/v8_types.py
@@ -55,26 +55,32 @@
'NodeFilter',
'SerializedScriptValue',
])
-TYPED_ARRAYS = {
- # (cpp_type, v8_type), used by constructor templates
- 'ArrayBuffer': None,
- 'ArrayBufferView': None,
- 'Float32Array': ('float', 'v8::kExternalFloatArray'),
- 'Float64Array': ('double', 'v8::kExternalDoubleArray'),
- 'Int8Array': ('signed char', 'v8::kExternalByteArray'),
- 'Int16Array': ('short', 'v8::kExternalShortArray'),
- 'Int32Array': ('int', 'v8::kExternalIntArray'),
- 'Uint8Array': ('unsigned char', 'v8::kExternalUnsignedByteArray'),
- 'Uint8ClampedArray': ('unsigned char', 'v8::kExternalPixelArray'),
- 'Uint16Array': ('unsigned short', 'v8::kExternalUnsignedShortArray'),
- 'Uint32Array': ('unsigned int', 'v8::kExternalUnsignedIntArray'),
-}
+TYPED_ARRAY_TYPES = frozenset([
+ 'Float32Array',
+ 'Float64Array',
+ 'Int8Array',
+ 'Int16Array',
+ 'Int32Array',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'Uint16Array',
+ 'Uint32Array',
+])
+ARRAY_BUFFER_AND_VIEW_TYPES = TYPED_ARRAY_TYPES.union(frozenset([
+ 'ArrayBuffer',
+ 'ArrayBufferView',
+ 'DataView',
+]))
-IdlType.is_typed_array_element_type = property(
- lambda self: self.base_type in TYPED_ARRAYS)
+IdlType.is_array_buffer_or_view = property(
+ lambda self: self.base_type in ARRAY_BUFFER_AND_VIEW_TYPES)
+
+IdlType.is_typed_array = property(
+ lambda self: self.base_type in TYPED_ARRAY_TYPES)
IdlType.is_wrapper_type = property(
lambda self: (self.is_interface_type and
+ not self.is_callback_interface and
self.base_type not in NON_WRAPPER_TYPES))
@@ -107,7 +113,7 @@
'Promise': 'ScriptPromise',
'ScriptValue': 'ScriptValue',
# FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345529
- 'XPathNSResolver': 'RefPtrWillBeRawPtr<XPathNSResolver>',
+ 'XPathNSResolver': 'RawPtr<XPathNSResolver>',
'boolean': 'bool',
'unrestricted double': 'double',
'unrestricted float': 'float',
@@ -176,15 +182,28 @@
return 'String'
return 'V8StringResource<%s>' % string_mode()
- if idl_type.is_typed_array_element_type and raw_type:
- return base_idl_type + '*'
+ if idl_type.is_array_buffer_or_view and raw_type:
+ return idl_type.implemented_as + '*'
if idl_type.is_interface_type:
implemented_as_class = idl_type.implemented_as
- if raw_type:
+ if raw_type or (used_as_rvalue_type and idl_type.is_garbage_collected):
return implemented_as_class + '*'
new_type = 'Member' if used_in_cpp_sequence else 'RawPtr'
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)
+ if idl_type.is_dictionary:
+ return base_idl_type
+ if idl_type.is_union_type:
+ # Avoid "AOrNullOrB" for cpp type of (A? or B) because we generate
+ # V8AOrBOrNull to handle nulle for (A? or B), (A or B?) and (A or B)?
+ def member_cpp_name(idl_type):
+ if idl_type.is_nullable:
+ return idl_type.inner_type.name
+ return idl_type.name
+ idl_type_name = "Or".join(member_cpp_name(member)
+ for member in idl_type.member_types)
+ return 'const %s&' % idl_type_name if used_as_rvalue_type else idl_type_name
+
# Default, assume native type is a pointer with same type name as idl type
return base_idl_type + '*'
@@ -204,9 +223,6 @@
return ' = 0'
if base_idl_type == 'boolean':
return ' = false'
- if idl_type.base_type == 'Promise':
- return '(nullptr)'
-
if (base_idl_type in NON_WRAPPER_TYPES or
base_idl_type in CPP_SPECIAL_CONVERSION_RULES or
base_idl_type == 'any' or
@@ -216,23 +232,11 @@
return ' = nullptr'
-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
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)
-IdlUnionType.cpp_type_initializer = property(cpp_type_initializer_union)
-IdlUnionType.cpp_type_args = cpp_type_union
+IdlUnionType.cpp_type_initializer = ''
IdlArrayOrSequenceType.native_array_element_type = property(
@@ -240,11 +244,8 @@
def cpp_template_type(template, inner_type):
- """Returns C++ template specialized to type, with space added if needed."""
- if inner_type.endswith('>'):
- format_string = '{template}<{inner_type} >'
- else:
- format_string = '{template}<{inner_type}>'
+ """Returns C++ template specialized to type."""
+ format_string = '{template}<{inner_type}>'
return format_string.format(template=template, inner_type=inner_type)
@@ -310,7 +311,7 @@
def gc_type(idl_type):
- if idl_type.is_garbage_collected:
+ if idl_type.is_garbage_collected or idl_type.is_dictionary or idl_type.is_union_type:
return 'GarbageCollectedObject'
if idl_type.is_will_be_garbage_collected:
return 'WillBeGarbageCollectedObject'
@@ -319,6 +320,17 @@
IdlTypeBase.gc_type = property(gc_type)
+def is_traceable(idl_type):
+ return (idl_type.is_garbage_collected
+ or idl_type.is_will_be_garbage_collected
+ or idl_type.is_dictionary)
+
+IdlTypeBase.is_traceable = property(is_traceable)
+IdlUnionType.is_traceable = property(lambda self: True)
+IdlArrayOrSequenceType.is_traceable = property(
+ lambda self: self.element_type.is_traceable)
+
+
################################################################################
# Includes
################################################################################
@@ -332,7 +344,7 @@
'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',
+ 'EventListener': set(['bindings/core/v8/BindingSecurity.h',
'bindings/core/v8/V8EventListenerList.h',
'core/frame/LocalDOMWindow.h']),
'HTMLCollection': set(['bindings/core/v8/V8HTMLCollection.h',
@@ -347,14 +359,16 @@
'core/dom/NodeList.h',
'core/dom/StaticNodeList.h',
'core/html/LabelsNodeList.h']),
- 'Promise': set(['bindings/core/v8/V8ScriptPromise.h']),
- 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h']),
- 'ScriptValue': set(['bindings/common/ScriptValue.h']),
+ 'Promise': set(['bindings/core/v8/ScriptPromise.h']),
+ 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h',
+ 'bindings/core/v8/SerializedScriptValueFactory.h']),
+ 'ScriptValue': set(['bindings/core/v8/ScriptValue.h']),
}
-def includes_for_type(idl_type):
+def includes_for_type(idl_type, extended_attributes=None):
idl_type = idl_type.preprocessed_type
+ extended_attributes = extended_attributes or {}
# Simple types
base_idl_type = idl_type.base_type
@@ -362,8 +376,6 @@
return INCLUDES_FOR_TYPE[base_idl_type]
if idl_type.is_basic_type:
return set()
- 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
@@ -379,22 +391,30 @@
return set(['bindings/%s/v8/V8%s.h' % (component_dir[base_idl_type],
base_idl_type)])
-IdlType.includes_for_type = property(includes_for_type)
-IdlUnionType.includes_for_type = property(
- lambda self: set.union(*[member_type.includes_for_type
- for member_type in self.member_types]))
-IdlArrayOrSequenceType.includes_for_type = property(
- lambda self: self.element_type.includes_for_type)
+IdlType.includes_for_type = includes_for_type
-def add_includes_for_type(idl_type):
- includes.update(idl_type.includes_for_type)
+def includes_for_union_type(idl_type, extended_attributes=None):
+ return set.union(*[member_type.includes_for_type(extended_attributes)
+ for member_type in idl_type.member_types])
+
+IdlUnionType.includes_for_type = includes_for_union_type
+
+
+def includes_for_array_or_sequence_type(idl_type, extended_attributes=None):
+ return idl_type.element_type.includes_for_type(extended_attributes)
+
+IdlArrayOrSequenceType.includes_for_type = includes_for_array_or_sequence_type
+
+
+def add_includes_for_type(idl_type, extended_attributes=None):
+ includes.update(idl_type.includes_for_type(extended_attributes))
IdlTypeBase.add_includes_for_type = add_includes_for_type
def includes_for_interface(interface_name):
- return IdlType(interface_name).includes_for_type
+ return IdlType(interface_name).includes_for_type()
def add_includes_for_interface(interface_name):
@@ -411,7 +431,7 @@
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')
+ includes_for_type.add('bindings/core/v8/Nullable.h')
idl_type = idl_type.preprocessed_type
native_array_element_type = idl_type.native_array_element_type
@@ -425,12 +445,23 @@
includes_for_type.add('wtf/text/WTFString.h')
if base_idl_type in interfaces_info:
interface_info = interfaces_info[idl_type.base_type]
- includes_for_type.add(interface_info['include_path'])
+ if interface_info['include_path']:
+ includes_for_type.add(interface_info['include_path'])
if base_idl_type in INCLUDES_FOR_TYPE:
includes_for_type.update(INCLUDES_FOR_TYPE[base_idl_type])
+ if idl_type.is_typed_array:
+ return set(['core/dom/DOMTypedArray.h'])
+ return includes_for_type
+
+
+def impl_includes_for_type_union(idl_type, interfaces_info):
+ includes_for_type = set()
+ for member_type in idl_type.member_types:
+ includes_for_type.update(member_type.impl_includes_for_type(interfaces_info))
return includes_for_type
IdlTypeBase.impl_includes_for_type = impl_includes_for_type
+IdlUnionType.impl_includes_for_type = impl_includes_for_type_union
component_dir = {}
@@ -446,42 +477,44 @@
V8_VALUE_TO_CPP_VALUE = {
# Basic
- 'Date': 'toCoreDate({v8_value})',
+ 'Date': 'toCoreDate({isolate}, {v8_value})',
'DOMString': '{v8_value}',
- 'ByteString': 'toByteString({arguments})',
- 'ScalarValueString': 'toScalarValueString({arguments})',
- 'boolean': '{v8_value}->BooleanValue()',
- 'float': 'toFloat({arguments})',
- 'unrestricted float': 'toFloat({arguments})',
- 'double': 'toDouble({arguments})',
- 'unrestricted double': 'toDouble({arguments})',
- 'byte': 'toInt8({arguments})',
- 'octet': 'toUInt8({arguments})',
- 'short': 'toInt16({arguments})',
- 'unsigned short': 'toUInt16({arguments})',
- 'long': 'toInt32({arguments})',
- 'unsigned long': 'toUInt32({arguments})',
- 'long long': 'toInt64({arguments})',
- 'unsigned long long': 'toUInt64({arguments})',
+ 'ByteString': 'toByteString({isolate}, {arguments})',
+ 'USVString': 'toUSVString({isolate}, {arguments})',
+ 'boolean': 'toBoolean({isolate}, {arguments})',
+ 'float': 'toRestrictedFloat({isolate}, {arguments})',
+ 'unrestricted float': 'toFloat({isolate}, {arguments})',
+ 'double': 'toRestrictedDouble({isolate}, {arguments})',
+ 'unrestricted double': 'toDouble({isolate}, {arguments})',
+ 'byte': 'toInt8({isolate}, {arguments})',
+ 'octet': 'toUInt8({isolate}, {arguments})',
+ 'short': 'toInt16({isolate}, {arguments})',
+ 'unsigned short': 'toUInt16({isolate}, {arguments})',
+ 'long': 'toInt32({isolate}, {arguments})',
+ 'unsigned long': 'toUInt32({isolate}, {arguments})',
+ 'long long': 'toInt64({isolate}, {arguments})',
+ 'unsigned long long': 'toUInt64({isolate}, {arguments})',
# Interface types
- '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',
- 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), V8ScriptState::current({isolate}))',
- 'Promise': 'V8ScriptPromise::cast(V8ScriptState::current({isolate}), {v8_value})',
- 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, 0, 0, exceptionState, {isolate})',
- 'ScriptValue': 'ScriptValue(V8ScriptState::current({isolate}), {v8_value})',
- 'Window': 'toDOMWindow({v8_value}, {isolate})',
- 'XPathNSResolver': 'toXPathNSResolver({v8_value}, {isolate})',
+ 'Dictionary': 'Dictionary({v8_value}, {isolate}, exceptionState)',
+ 'EventTarget': 'toEventTarget({isolate}, {v8_value})',
+ 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current({isolate}))',
+ 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})',
+ 'SerializedScriptValue': 'SerializedScriptValueFactory::instance().create({isolate}, {v8_value}, 0, 0, exceptionState)',
+ 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})',
+ 'Window': 'toDOMWindow({isolate}, {v8_value})',
+ 'XPathNSResolver': 'toXPathNSResolver(ScriptState::current({isolate}), {v8_value})',
}
def v8_conversion_needs_exception_state(idl_type):
return (idl_type.is_numeric_type or
+ idl_type.is_enum or
idl_type.is_dictionary or
- idl_type.name in ('ByteString', 'ScalarValueString', 'SerializedScriptValue'))
+ idl_type.name in ('Boolean', 'ByteString', 'Dictionary', 'USVString', 'SerializedScriptValue'))
IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state)
IdlArrayOrSequenceType.v8_conversion_needs_exception_state = True
+IdlUnionType.v8_conversion_needs_exception_state = True
TRIVIAL_CONVERSIONS = frozenset([
@@ -504,42 +537,45 @@
IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial)
-def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate):
+def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index, isolate, restricted_float=False):
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)
+ return v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, index, isolate)
# Simple types
idl_type = idl_type.preprocessed_type
- add_includes_for_type(idl_type)
- base_idl_type = idl_type.base_type
+ base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else idl_type.base_type
- if 'EnforceRange' in extended_attributes:
- arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState'])
- elif 'Clamp' in extended_attributes:
- arguments = ', '.join([v8_value, 'Clamp', 'exceptionState'])
+ if idl_type.is_integer_type:
+ configuration = 'NormalConversion'
+ if 'EnforceRange' in extended_attributes:
+ configuration = 'EnforceRange'
+ elif 'Clamp' in extended_attributes:
+ configuration = 'Clamp'
+ arguments = ', '.join([v8_value, configuration, 'exceptionState'])
elif idl_type.v8_conversion_needs_exception_state:
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_element_type:
+ elif idl_type.is_array_buffer_or_view:
cpp_expression_format = (
'{v8_value}->Is{idl_type}() ? '
- 'V8{idl_type}::toImpl(v8::Handle<v8::{idl_type}>::Cast({v8_value})) : 0')
- elif idl_type.is_dictionary:
- cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, exceptionState)'
+ 'V8{idl_type}::toImpl(v8::Local<v8::{idl_type}>::Cast({v8_value})) : 0')
+ elif idl_type.use_output_parameter_for_result:
+ if idl_type.includes_nullable_type:
+ base_idl_type = idl_type.cpp_type + 'OrNull'
+ cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, {variable_name}, exceptionState)'
else:
cpp_expression_format = (
'V8{idl_type}::toImplWithTypeCheck({isolate}, {v8_value})')
- return cpp_expression_format.format(arguments=arguments, idl_type=base_idl_type, v8_value=v8_value, isolate=isolate)
+ return cpp_expression_format.format(arguments=arguments, idl_type=base_idl_type, v8_value=v8_value, variable_name=variable_name, isolate=isolate)
def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, index, isolate='info.GetIsolate()'):
@@ -554,87 +590,102 @@
this_cpp_type = None
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}, exceptionState))'
- add_includes_for_type(native_array_element_type)
else:
ref_ptr_type = None
this_cpp_type = native_array_element_type.cpp_type
- expression_format = 'toImplArray<{cpp_type}>({v8_value}, {index}, {isolate}, exceptionState)'
+ if native_array_element_type.is_dictionary or native_array_element_type.is_union_type:
+ vector_type = 'HeapVector'
+ else:
+ vector_type = 'Vector'
+ expression_format = 'toImplArray<%s<{cpp_type}>>({v8_value}, {index}, {isolate}, exceptionState)' % vector_type
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, isolate='info.GetIsolate()', used_in_private_script=False, return_promise=False):
+# FIXME: this function should be refactored, as this takes too many flags.
+def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True, isolate='info.GetIsolate()', bailout_return_value=None, use_exception_state=False, restricted_float=False):
"""Returns an expression that converts a V8 value to a C++ value and stores it as a local value."""
- # FIXME: Support union type.
- if idl_type.is_union_type:
- return '/* no V8 -> C++ conversion for IDL union type: %s */' % idl_type.name
-
this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, raw_type=True)
idl_type = idl_type.preprocessed_type
- if idl_type.base_type in ('void', 'object', 'EventHandler', 'EventListener'):
- return '/* no V8 -> C++ conversion for IDL type: %s */' % idl_type.name
+ cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index, isolate, restricted_float=restricted_float)
- cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate)
+ # Optional expression that returns a value to be assigned to the local variable.
+ assign_expression = None
+ # Optional void expression executed unconditionally.
+ set_expression = None
+ # Optional expression that returns true if the conversion fails.
+ check_expression = None
+ # Optional expression used as the return value when returning. Only
+ # meaningful if 'check_expression' is not None.
+ return_expression = bailout_return_value
+
if idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state:
- # Types that need error handling and use one of a group of (C++) macros
- # to take care of this.
+ # Types for which conversion can fail and that need error handling.
- args = [variable_name, cpp_value]
-
- if idl_type.v8_conversion_needs_exception_state:
- macro = 'TONATIVE_DEFAULT_EXCEPTIONSTATE' if used_in_private_script else 'TONATIVE_VOID_EXCEPTIONSTATE'
- elif return_promise:
- macro = 'TOSTRING_VOID_EXCEPTIONSTATE'
+ if use_exception_state:
+ check_expression = 'exceptionState.hadException()'
else:
- macro = 'TOSTRING_DEFAULT' if used_in_private_script else 'TOSTRING_VOID'
+ check_expression = 'exceptionState.throwIfNeeded()'
- if macro.endswith('_EXCEPTIONSTATE'):
- args.append('exceptionState')
-
- if used_in_private_script:
- args.append('false')
-
- suffix = ''
-
- if return_promise:
- suffix += '_PROMISE'
- args.append('info')
- if macro.endswith('_EXCEPTIONSTATE'):
- args.append('V8ScriptState::current(%s)' % isolate)
-
- if declare_variable:
- args.insert(0, this_cpp_type)
+ if idl_type.is_dictionary or idl_type.is_union_type:
+ set_expression = cpp_value
else:
- suffix += '_INTERNAL'
-
- return '%s(%s)' % (macro + suffix, ', '.join(args))
+ assign_expression = cpp_value
+ # Note: 'not idl_type.v8_conversion_needs_exception_state' implies
+ # 'idl_type.is_string_type', but there are types for which both are
+ # true (ByteString and USVString), so using idl_type.is_string_type
+ # as the condition here would be wrong.
+ if not idl_type.v8_conversion_needs_exception_state:
+ if use_exception_state:
+ check_expression = '!%s.prepare(exceptionState)' % variable_name
+ else:
+ check_expression = '!%s.prepare()' % variable_name
+ elif not idl_type.v8_conversion_is_trivial:
+ return {
+ 'error_message': 'no V8 -> C++ conversion for IDL type: %s' % idl_type.name
+ }
+ else:
+ assign_expression = cpp_value
# Types that don't need error handling, and simply assign a value to the
# local variable.
- if not idl_type.v8_conversion_is_trivial:
- raise Exception('unclassified V8 -> C++ conversion for IDL type: %s' % idl_type.name)
-
- assignment = '%s = %s' % (variable_name, cpp_value)
- if declare_variable:
- return '%s %s' % (this_cpp_type, assignment)
- return assignment
+ return {
+ 'assign_expression': assign_expression,
+ 'check_expression': check_expression,
+ 'cpp_type': this_cpp_type,
+ 'cpp_name': variable_name,
+ 'declare_variable': declare_variable,
+ 'return_expression': bailout_return_value,
+ 'set_expression': set_expression,
+ }
IdlTypeBase.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
+def use_output_parameter_for_result(idl_type):
+ """True when methods/getters which return the given idl_type should
+ take the output argument.
+ """
+ return idl_type.is_dictionary or idl_type.is_union_type
+
+IdlTypeBase.use_output_parameter_for_result = property(use_output_parameter_for_result)
+
+
################################################################################
# C++ -> V8
################################################################################
def preprocess_idl_type(idl_type):
+ if idl_type.is_nullable:
+ return IdlNullableType(idl_type.inner_type.preprocessed_type)
if idl_type.is_enum:
# Enumerations are internally DOMStrings
return IdlType('DOMString')
- if (idl_type.name in ['Any', 'Object'] or idl_type.is_callback_function):
+ if idl_type.base_type in ['any', 'object'] or idl_type.is_callback_function:
return IdlType('ScriptValue')
return idl_type
@@ -675,15 +726,17 @@
"""
extended_attributes = extended_attributes or {}
- # FIXME: Support union type.
- if idl_type.is_union_type:
- return ''
+ # Nullable dictionaries need to be handled differently than either
+ # non-nullable dictionaries or unions.
+ if idl_type.is_dictionary and idl_type.is_nullable:
+ return 'NullableDictionary'
+
+ if idl_type.is_dictionary or idl_type.is_union_type:
+ return 'DictionaryOrUnion'
# 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
@@ -706,9 +759,11 @@
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
+ # Generic dictionary type
+ if base_idl_type == 'Dictionary':
+ return 'Dictionary'
# Data type with potential additional includes
- add_includes_for_type(idl_type)
if base_idl_type in V8_SET_RETURN_VALUE: # Special v8SetReturnValue treatment
return base_idl_type
@@ -724,7 +779,7 @@
'unsigned': 'v8SetReturnValueUnsigned(info, {cpp_value})',
'DOMString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
'ByteString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
- 'ScalarValueString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
+ 'USVString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
# [TreatReturnedNullStringAs]
'StringOrNull': 'v8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())',
'StringOrUndefined': 'v8SetReturnValueStringOrUndefined(info, {cpp_value}, info.GetIsolate())',
@@ -745,14 +800,30 @@
'DOMWrapperForMainWorld': 'v8SetReturnValueForMainWorld(info, WTF::getPtr({cpp_value}))',
'DOMWrapperFast': 'v8SetReturnValueFast(info, WTF::getPtr({cpp_value}), {script_wrappable})',
'DOMWrapperDefault': 'v8SetReturnValue(info, {cpp_value})',
+ # Note that static attributes and operations do not check whether |this| is
+ # an instance of the interface nor |this|'s creation context is the same as
+ # the current context. So we must always use the current context as the
+ # creation context of the DOM wrapper for the return value.
+ 'DOMWrapperStatic': 'v8SetReturnValue(info, {cpp_value}, info.GetIsolate()->GetCurrentContext()->Global())',
+ # Generic dictionary type
+ 'Dictionary': 'v8SetReturnValue(info, {cpp_value})',
+ 'DictionaryStatic': '#error not implemented yet',
+ # Nullable dictionaries
+ 'NullableDictionary': 'v8SetReturnValue(info, result.get())',
+ 'NullableDictionaryStatic': '#error not implemented yet',
+ # Union types or dictionaries
+ 'DictionaryOrUnion': 'v8SetReturnValue(info, result)',
+ 'DictionaryOrUnionStatic': '#error not implemented yet',
}
-def v8_set_return_value(idl_type, cpp_value, extended_attributes=None, script_wrappable='', release=False, for_main_world=False):
+def v8_set_return_value(idl_type, cpp_value, extended_attributes=None, script_wrappable='', release=False, for_main_world=False, is_static=False):
"""Returns a statement that converts a C++ value to a V8 value and sets it as a return value.
"""
def dom_wrapper_conversion_type():
+ if is_static:
+ return 'DOMWrapperStatic'
if not script_wrappable:
return 'DOMWrapperDefault'
if for_main_world:
@@ -767,6 +838,8 @@
cpp_value = idl_type.cpp_value_to_v8_value(cpp_value, extended_attributes=extended_attributes)
if this_v8_conversion_type == 'DOMWrapper':
this_v8_conversion_type = dom_wrapper_conversion_type()
+ if is_static and this_v8_conversion_type in ('Dictionary', 'NullableDictionary', 'DictionaryOrUnion'):
+ this_v8_conversion_type += 'Static'
format_string = V8_SET_RETURN_VALUE[this_v8_conversion_type]
# FIXME: oilpan: Remove .release() once we remove all RefPtrs from generated code.
@@ -776,27 +849,18 @@
return statement
-def v8_set_return_value_union(idl_type, cpp_value, extended_attributes=None, script_wrappable='', release=False, for_main_world=False):
- # FIXME: Need to revisit the design of union support.
- # http://crbug.com/240176
- return None
-
-
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])
+IdlUnionType.release = False
CPP_VALUE_TO_V8_VALUE = {
# Built-in types
- 'Date': 'v8DateOrNaN({cpp_value}, {isolate})',
+ 'Date': 'v8DateOrNaN({isolate}, {cpp_value})',
'DOMString': 'v8String({isolate}, {cpp_value})',
'ByteString': 'v8String({isolate}, {cpp_value})',
- 'ScalarValueString': 'v8String({isolate}, {cpp_value})',
+ 'USVString': 'v8String({isolate}, {cpp_value})',
'boolean': 'v8Boolean({cpp_value}, {isolate})',
'int': 'v8::Integer::New({isolate}, {cpp_value})',
'unsigned': 'v8::Integer::NewFromUnsigned({isolate}, {cpp_value})',
@@ -806,15 +870,27 @@
'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})',
+ 'StringOrNull': '{cpp_value}.isNull() ? v8::Local<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}))',
+ 'Dictionary': '{cpp_value}.v8Value()',
+ 'EventHandler': '{cpp_value} ? v8::Local<v8::Value>(V8AbstractEventListener::cast({cpp_value})->getListenerObject(impl->executionContext())) : v8::Local<v8::Value>(v8::Null({isolate}))',
'ScriptValue': '{cpp_value}.v8Value()',
- 'SerializedScriptValue': '{cpp_value} ? {cpp_value}->deserialize() : v8::Handle<v8::Value>(v8::Null({isolate}))',
+ 'SerializedScriptValue': '{cpp_value} ? {cpp_value}->deserialize() : v8::Local<v8::Value>(v8::Null({isolate}))',
# General
- 'array': 'v8Array({cpp_value}, {creation_context}, {isolate})',
+ 'array': 'toV8({cpp_value}, {creation_context}, {isolate})',
'DOMWrapper': 'toV8({cpp_value}, {creation_context}, {isolate})',
+ # Passing nullable dictionaries isn't a pattern currently used
+ # anywhere in the web platform, and more work would be needed in
+ # the code generator to distinguish between passing null, and
+ # passing an object which happened to not contain any of the
+ # dictionary's defined attributes. For now, don't define
+ # NullableDictionary here, which will cause an exception to be
+ # thrown during code generation if an argument to a method is a
+ # nullable dictionary type.
+ #
+ # Union types or dictionaries
+ 'DictionaryOrUnion': 'toV8({cpp_value}, {creation_context}, {isolate})',
}
@@ -833,12 +909,40 @@
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
+ if idl_type.base_type in ('any', 'object') and idl_literal.is_null:
+ return 'ScriptValue()'
literal_value = str(idl_literal)
if idl_type.base_type in CPP_UNSIGNED_TYPES:
return literal_value + 'u'
return literal_value
+
+def union_literal_cpp_value(idl_type, idl_literal):
+ if idl_literal.is_null:
+ return idl_type.name + '()'
+ elif idl_literal.idl_type == 'DOMString':
+ member_type = idl_type.string_member_type
+ elif idl_literal.idl_type in ('integer', 'float'):
+ member_type = idl_type.numeric_member_type
+ elif idl_literal.idl_type == 'boolean':
+ member_type = idl_type.boolean_member_type
+ else:
+ raise ValueError('Unsupported literal type: ' + idl_literal.idl_type)
+
+ return '%s::from%s(%s)' % (idl_type.name, member_type.name,
+ member_type.literal_cpp_value(idl_literal))
+
+
+def array_or_sequence_literal_cpp_value(idl_type, idl_literal):
+ # Only support empty arrays.
+ if idl_literal.value == '[]':
+ return cpp_type(idl_type) + '()'
+ raise ValueError('Unsupported literal type: ' + idl_literal.idl_type)
+
+
IdlType.literal_cpp_value = literal_cpp_value
+IdlUnionType.literal_cpp_value = union_literal_cpp_value
+IdlArrayOrSequenceType.literal_cpp_value = array_or_sequence_literal_cpp_value
################################################################################
@@ -850,13 +954,14 @@
# - String types (String/AtomicString) represent null as a null string,
# i.e. one for which String::isNull() returns true.
# - Enum types, as they are implemented as Strings.
- # - Wrapper types (raw pointer or RefPtr/PassRefPtr) represent null as
+ # - Interface types (raw pointer or RefPtr/PassRefPtr) represent null as
# a null pointer.
- # - Dictionary types represent null as a null pointer. They are garbage
- # collected so their type is raw pointer.
- # - 'Object' type. We use ScriptValue for object type.
- return (idl_type.is_string_type or idl_type.is_wrapper_type or
- idl_type.is_enum or idl_type.is_dictionary or idl_type.base_type == 'object')
+ # - Union types, as thier container classes can represent null value.
+ # - 'Object' and 'any' type. We use ScriptValue for object type.
+ return (idl_type.is_string_type or idl_type.is_interface_type or
+ idl_type.is_enum or idl_type.is_union_type
+ or idl_type.base_type == 'object' or idl_type.base_type == 'any'
+ or idl_type.is_callback_function or idl_type.is_callback_interface)
IdlTypeBase.cpp_type_has_null_value = property(cpp_type_has_null_value)
@@ -874,3 +979,27 @@
IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable)
IdlUnionType.is_implicit_nullable = False
IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable)
+
+
+def number_of_nullable_member_types_union(idl_type):
+ # http://heycam.github.io/webidl/#dfn-number-of-nullable-member-types
+ count = 0
+ for member in idl_type.member_types:
+ if member.is_nullable:
+ count += 1
+ member = member.inner_type
+ if member.is_union_type:
+ count += number_of_nullable_member_types_union(member)
+ return count
+
+IdlUnionType.number_of_nullable_member_types = property(
+ number_of_nullable_member_types_union)
+
+
+def includes_nullable_type_union(idl_type):
+ # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type
+ return idl_type.number_of_nullable_member_types == 1
+
+IdlTypeBase.includes_nullable_type = False
+IdlNullableType.includes_nullable_type = True
+IdlUnionType.includes_nullable_type = property(includes_nullable_type_union)
diff --git a/bindings/scripts/v8_union.py b/bindings/scripts/v8_union.py
new file mode 100644
index 0000000..1b94261
--- /dev/null
+++ b/bindings/scripts/v8_union.py
@@ -0,0 +1,153 @@
+# 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.
+
+import v8_utilities
+
+
+UNION_H_INCLUDES = frozenset([
+ 'bindings/core/v8/Dictionary.h',
+ 'bindings/core/v8/ExceptionState.h',
+ 'bindings/core/v8/V8Binding.h',
+ 'platform/heap/Handle.h',
+])
+
+UNION_CPP_INCLUDES_BLACKLIST = frozenset([
+ # This header defines static functions needed to implement event handler
+ # attributes in interfaces that implement GlobalEventHandlers. They are not
+ # needed or used by UnionTypes*.cpp, so including the header causes
+ # compilation errors.
+ # FIXME: We should solve this problem in a way that doesn't involve special-
+ # casing a header like this.
+ 'core/dom/GlobalEventHandlers.h',
+])
+
+
+cpp_includes = set()
+header_forward_decls = set()
+
+
+def union_context(union_types, interfaces_info):
+ cpp_includes.clear()
+ header_forward_decls.clear()
+
+ # For container classes we strip nullable wrappers. For example,
+ # both (A or B)? and (A? or B) will become AOrB. This should be OK
+ # because container classes can handle null and it seems that
+ # distinguishing (A or B)? and (A? or B) doesn't make sense.
+ container_cpp_types = set()
+ union_types_for_containers = set()
+ nullable_cpp_types = set()
+ for union_type in union_types:
+ cpp_type = union_type.cpp_type
+ if cpp_type not in container_cpp_types:
+ union_types_for_containers.add(union_type)
+ container_cpp_types.add(cpp_type)
+ if union_type.includes_nullable_type:
+ nullable_cpp_types.add(cpp_type)
+
+ union_types_for_containers = sorted(union_types_for_containers,
+ key=lambda union_type: union_type.cpp_type)
+ nullable_cpp_types = sorted(nullable_cpp_types)
+
+ return {
+ 'containers': [container_context(union_type, interfaces_info)
+ for union_type in union_types_for_containers],
+ 'cpp_includes': sorted(cpp_includes - UNION_CPP_INCLUDES_BLACKLIST),
+ 'header_forward_decls': sorted(header_forward_decls),
+ 'header_includes': sorted(UNION_H_INCLUDES),
+ 'nullable_cpp_types': nullable_cpp_types,
+ }
+
+
+def container_context(union_type, interfaces_info):
+ members = []
+
+ # These variables refer to member contexts if the given union type has
+ # corresponding types. They are used for V8 -> impl conversion.
+ array_buffer_type = None
+ array_buffer_view_type = None
+ array_or_sequence_type = None
+ boolean_type = None
+ dictionary_type = None
+ interface_types = []
+ numeric_type = None
+ string_type = None
+ for member in union_type.member_types:
+ context = member_context(member, interfaces_info)
+ members.append(context)
+ if member.base_type == 'ArrayBuffer':
+ if array_buffer_type:
+ raise Exception('%s is ambiguous.' % union_type.name)
+ array_buffer_type = context
+ elif member.base_type == 'ArrayBufferView':
+ if array_buffer_view_type:
+ raise Exception('%s is ambiguous.' % union_type.name)
+ array_buffer_view_type = context
+ # FIXME: Remove generic Dictionary special casing.
+ elif member.is_dictionary or member.base_type == 'Dictionary':
+ if dictionary_type:
+ raise Exception('%s is ambiguous.' % union_type.name)
+ dictionary_type = context
+ elif member.is_array_or_sequence_type:
+ if array_or_sequence_type:
+ raise Exception('%s is ambiguous.' % union_type.name)
+ array_or_sequence_type = context
+ elif member.is_interface_type:
+ interface_types.append(context)
+ elif member is union_type.boolean_member_type:
+ boolean_type = context
+ elif member is union_type.numeric_member_type:
+ numeric_type = context
+ elif member is union_type.string_member_type:
+ string_type = context
+ else:
+ raise Exception('%s is not supported as an union member.' % member.name)
+
+ # Nullable restriction checks
+ nullable_members = union_type.number_of_nullable_member_types
+ if nullable_members > 1:
+ raise Exception('%s contains more than one nullable members' % union_type.name)
+ if dictionary_type and nullable_members == 1:
+ raise Exception('%s has a dictionary and a nullable member' % union_type.name)
+
+ return {
+ 'array_buffer_type': array_buffer_type,
+ 'array_buffer_view_type': array_buffer_view_type,
+ 'array_or_sequence_type': array_or_sequence_type,
+ 'boolean_type': boolean_type,
+ 'cpp_class': union_type.cpp_type,
+ 'dictionary_type': dictionary_type,
+ 'includes_nullable_type': union_type.includes_nullable_type,
+ 'interface_types': interface_types,
+ 'members': members,
+ 'numeric_type': numeric_type,
+ 'string_type': string_type,
+ 'type_string': str(union_type),
+ }
+
+
+def member_context(member, interfaces_info):
+ cpp_includes.update(member.includes_for_type())
+ interface_info = interfaces_info.get(member.name, None)
+ if interface_info:
+ cpp_includes.update(interface_info.get('dependencies_include_paths', []))
+ header_forward_decls.add(member.implemented_as)
+ if member.is_nullable:
+ member = member.inner_type
+ return {
+ 'cpp_name': v8_utilities.uncapitalize(member.name),
+ 'cpp_type': member.cpp_type_args(used_in_cpp_sequence=True),
+ 'cpp_local_type': member.cpp_type,
+ 'cpp_value_to_v8_value': member.cpp_value_to_v8_value(
+ cpp_value='impl.getAs%s()' % member.name, isolate='isolate',
+ creation_context='creationContext'),
+ 'enum_values': member.enum_values,
+ 'is_traceable': member.is_traceable,
+ 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True),
+ 'specific_type_enum': 'SpecificType' + member.name,
+ 'type_name': member.name,
+ 'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value(
+ {}, 'v8Value', 'cppValue', isolate='isolate',
+ use_exception_state=True, restricted_float=True),
+ }
diff --git a/bindings/scripts/v8_utilities.py b/bindings/scripts/v8_utilities.py
index e6ee9c9..1cd44ab 100644
--- a/bindings/scripts/v8_utilities.py
+++ b/bindings/scripts/v8_utilities.py
@@ -28,8 +28,6 @@
"""Functions shared by various parts of the code generator.
-Extends IdlTypeBase type with |enum_validation_expression| property.
-
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
@@ -37,8 +35,8 @@
from idl_types import IdlTypeBase
import idl_types
+from idl_definitions import Exposure, IdlInterface
from v8_globals import includes
-import v8_types
ACRONYMS = [
'CSSOM', # must come *before* CSS to match full acronym
@@ -118,15 +116,6 @@
# C++
################################################################################
-def enum_validation_expression(idl_type):
- # FIXME: Add IdlEnumType, move property to derived type, and remove this check
- if not idl_type.is_enum:
- return None
- return ' || '.join(['string == "%s"' % enum_value
- for enum_value in idl_type.enum_values])
-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)
@@ -142,7 +131,14 @@
def v8_class_name(interface):
- return v8_types.v8_type(interface.name)
+ return 'V8' + interface.name
+
+
+def v8_class_name_or_partial(interface):
+ class_name = v8_class_name(interface)
+ if interface.is_partial:
+ return ''.join([class_name, 'Partial'])
+ return class_name
################################################################################
@@ -193,6 +189,7 @@
'ActiveWindow': 'callingDOMWindow(info.GetIsolate())',
'FirstWindow': 'enteredDOMWindow(info.GetIsolate())',
'Document': 'document',
+ 'ThisValue': 'ScriptValue(scriptState, info.This())',
}
# List because key order matters, as we want arguments in deterministic order
CALL_WITH_VALUES = [
@@ -202,6 +199,7 @@
'ActiveWindow',
'FirstWindow',
'Document',
+ 'ThisValue',
]
@@ -227,6 +225,12 @@
return 'ENABLE(%s)' % extended_attributes['Conditional']
+# [Constructor], [NamedConstructor]
+def is_constructor_attribute(member):
+ # TODO(yukishiino): replace this with [Constructor] and [NamedConstructor] extended attribute
+ return member.idl_type.name.endswith('Constructor')
+
+
# [DeprecateAs]
def deprecate_as(member):
extended_attributes = member.extended_attributes
@@ -238,6 +242,7 @@
# [Exposed]
EXPOSED_EXECUTION_CONTEXT_METHOD = {
+ 'CompositorWorker': 'isCompositorWorkerGlobalScope',
'DedicatedWorker': 'isDedicatedWorkerGlobalScope',
'ServiceWorker': 'isServiceWorkerGlobalScope',
'SharedWorker': 'isSharedWorkerGlobalScope',
@@ -246,36 +251,88 @@
}
-def exposed(definition_or_member, interface):
- exposure_set = extended_attribute_value_as_list(definition_or_member, 'Exposed')
- if not exposure_set:
- return None
+EXPOSED_WORKERS = set([
+ 'CompositorWorker',
+ 'DedicatedWorker',
+ 'SharedWorker',
+ 'ServiceWorker',
+])
- interface_exposure_set = expanded_exposure_set_for_interface(interface)
+
+class ExposureSet:
+ """An ExposureSet is a collection of Exposure instructions."""
+ def __init__(self, exposures=None):
+ self.exposures = set(exposures) if exposures else set()
+
+ def issubset(self, other):
+ """Returns true if |self|'s exposure set is a subset of
+ |other|'s exposure set. This function doesn't care about
+ RuntimeEnabled."""
+ self_set = self._extended(set(e.exposed for e in self.exposures))
+ other_set = self._extended(set(e.exposed for e in other.exposures))
+ return self_set.issubset(other_set)
+
+ @staticmethod
+ def _extended(target):
+ if EXPOSED_WORKERS.issubset(target):
+ return target | set(['Worker'])
+ elif 'Worker' in target:
+ return target | EXPOSED_WORKERS
+ return target
+
+ def add(self, exposure):
+ self.exposures.add(exposure)
+
+ def __len__(self):
+ return len(self.exposures)
+
+ def __iter__(self):
+ return self.exposures.__iter__()
+
+ @staticmethod
+ def _code(exposure):
+ exposed = ('context->%s()' %
+ EXPOSED_EXECUTION_CONTEXT_METHOD[exposure.exposed])
+ if exposure.runtime_enabled is not None:
+ runtime_enabled = ('RuntimeEnabledFeatures::%sEnabled()' %
+ uncapitalize(exposure.runtime_enabled))
+ return '({0} && {1})'.format(exposed, runtime_enabled)
+ return exposed
+
+ def code(self):
+ if len(self.exposures) == 0:
+ return None
+ # We use sorted here to deflake output.
+ return ' || '.join(sorted(self._code(e) for e in self.exposures))
+
+
+def exposed(member, interface):
+ """Returns a C++ code that checks if a method/attribute/etc is exposed.
+
+ When the Exposed attribute contains RuntimeEnabledFeatures (i.e.
+ Exposed(Arguments) form is given), the code contains check for them as
+ well.
+
+ EXAMPLE: [Exposed=Window, RuntimeEnabledFeature=Feature1]
+ => context->isDocument()
+
+ EXAMPLE: [Exposed(Window Feature1, Window Feature2)]
+ => context->isDocument() && RuntimeEnabledFeatures::feature1Enabled() ||
+ context->isDocument() && RuntimeEnabledFeatures::feature2Enabled()
+ """
+ exposure_set = ExposureSet(
+ extended_attribute_value_as_list(member, 'Exposed'))
+ interface_exposure_set = ExposureSet(
+ extended_attribute_value_as_list(interface, 'Exposed'))
+ for e in exposure_set:
+ if e.exposed not in EXPOSED_EXECUTION_CONTEXT_METHOD:
+ raise ValueError('Invalid execution context: %s' % e.exposed)
# Methods must not be exposed to a broader scope than their interface.
- if not set(exposure_set).issubset(interface_exposure_set):
+ if not 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 = extended_attribute_value_as_list(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))
+ return exposure_set.code()
# [GarbageCollected], [WillBeGarbageCollected]
@@ -296,22 +353,30 @@
return extended_attributes['ImplementedAs']
+def cpp_name_from_interfaces_info(name, interfaces_info):
+ return interfaces_info.get(name, {}).get('implemented_as') or name
+
+
+def cpp_name_or_partial(interface):
+ cpp_class_name = cpp_name(interface)
+ if interface.is_partial:
+ return ''.join([cpp_class_name, 'Partial'])
+ return cpp_class_name
+
+
# [MeasureAs]
-def measure_as(definition_or_member):
+def measure_as(definition_or_member, interface):
extended_attributes = definition_or_member.extended_attributes
- if 'MeasureAs' not in extended_attributes:
- return None
- includes.add('core/frame/UseCounter.h')
- return extended_attributes['MeasureAs']
-
-
-# [PerContextEnabled]
-def per_context_enabled_function_name(definition_or_member):
- extended_attributes = definition_or_member.extended_attributes
- if 'PerContextEnabled' not in extended_attributes:
- return None
- feature_name = extended_attributes['PerContextEnabled']
- return 'ContextFeatures::%sEnabled' % uncapitalize(feature_name)
+ if 'MeasureAs' in extended_attributes:
+ includes.add('core/frame/UseCounter.h')
+ return lambda suffix: extended_attributes['MeasureAs']
+ if 'Measure' in extended_attributes:
+ includes.add('core/frame/UseCounter.h')
+ measure_as_name = capitalize(definition_or_member.name)
+ if interface is not None:
+ measure_as_name = '%s_%s' % (capitalize(interface.name), measure_as_name)
+ return lambda suffix: 'V8%s_%s' % (measure_as_name, suffix)
+ return None
# [RuntimeEnabled]
@@ -329,9 +394,200 @@
return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
+# [Unforgeable]
+def is_unforgeable(interface, member):
+ return (('Unforgeable' in interface.extended_attributes or
+ 'Unforgeable' in member.extended_attributes) and
+ not member.is_static)
+
+
+# [TypeChecking=Interface] / [LegacyInterfaceTypeChecking]
+def is_legacy_interface_type_checking(interface, member):
+ if not ('TypeChecking' in interface.extended_attributes or
+ 'TypeChecking' in member.extended_attributes):
+ return True
+ if 'LegacyInterfaceTypeChecking' in member.extended_attributes:
+ return True
+ return False
+
+
+# [Unforgeable], [Global], [PrimaryGlobal] and [DoNotExposeJSAccessors]
+def on_instance(interface, member):
+ """Returns True if the interface's member needs to be defined on every
+ instance object.
+
+ The following members must be defiend on an instance object.
+ - [Unforgeable] members
+ - regular members of [Global] or [PrimaryGlobal] interfaces
+ - members on which [DoNotExposeJSAccessors] is specified
+ """
+ # TODO(yukishiino): Implement this function following the spec.
+ return not on_prototype(interface, member)
+
+
+# [ExposeJSAccessors]
+def on_prototype(interface, member):
+ """Returns True if the interface's member needs to be defined on the
+ prototype object.
+
+ Most members are defined on the prototype object. Exceptions are as
+ follows.
+ - constant members
+ - static members (optional)
+ - [Unforgeable] members
+ - members of [Global] or [PrimaryGlobal] interfaces
+ - named properties of [Global] or [PrimaryGlobal] interfaces
+ However, if [ExposeJSAccessors] is specified, the member is defined on the
+ prototype object.
+ """
+ # TODO(yukishiino): Implement this function following the spec.
+
+ if ('ExposeJSAccessors' in interface.extended_attributes and
+ 'DoNotExposeJSAccessors' in interface.extended_attributes):
+ raise Exception('Both of ExposeJSAccessors and DoNotExposeJSAccessors are specified at a time in an interface: ' + interface.name)
+ if ('ExposeJSAccessors' in member.extended_attributes and
+ 'DoNotExposeJSAccessors' in member.extended_attributes):
+ raise Exception('Both of ExposeJSAccessors and DoNotExposeJSAccessors are specified at a time on a member: ' + member.name + ' in an interface: ' + interface.name)
+
+ # Note that ExposeJSAccessors and DoNotExposeJSAccessors are more powerful
+ # than 'static', [Unforgeable] and [OverrideBuiltins].
+ if 'ExposeJSAccessors' in member.extended_attributes:
+ return True
+ if 'DoNotExposeJSAccessors' in member.extended_attributes:
+ return False
+
+ # These members must not be placed on prototype chains.
+ if (is_constructor_attribute(member) or
+ member.is_static or
+ is_unforgeable(interface, member) or
+ 'OverrideBuiltins' in interface.extended_attributes):
+ return False
+
+ # TODO(yukishiino): We should handle [Global] and [PrimaryGlobal] instead of
+ # Window.
+ if (interface.name == 'Window'):
+ return member.idl_type.name == 'EventHandler'
+
+ if 'ExposeJSAccessors' in interface.extended_attributes:
+ return True
+ if 'DoNotExposeJSAccessors' in interface.extended_attributes:
+ return False
+
+ return True
+
+
+# static, const
+def on_interface(interface, member):
+ """Returns True if the interface's member needs to be defined on the
+ interface object.
+
+ The following members must be defiend on an interface object.
+ - constant members
+ - static members
+ """
+ # TODO(yukishiino): Implement this function following the spec.
+ return False
+
+
################################################################################
-# Dart Specific extended attributes
+# Indexed properties
+# http://heycam.github.io/webidl/#idl-indexed-properties
################################################################################
-def dart_custom_method(extended_attributes):
- return ('DartCustom' in extended_attributes and
- extended_attribute_value_contains(extended_attributes['DartCustom'], 'New'))
+
+def indexed_property_getter(interface):
+ try:
+ # Find indexed property getter, if present; has form:
+ # getter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1)
+ return next(
+ method
+ for method in interface.operations
+ if ('getter' in method.specials and
+ len(method.arguments) == 1 and
+ str(method.arguments[0].idl_type) == 'unsigned long'))
+ except StopIteration:
+ return None
+
+
+def indexed_property_setter(interface):
+ try:
+ # Find indexed property setter, if present; has form:
+ # setter RETURN_TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1, ARG_TYPE ARG2)
+ return next(
+ method
+ for method in interface.operations
+ if ('setter' in method.specials and
+ len(method.arguments) == 2 and
+ str(method.arguments[0].idl_type) == 'unsigned long'))
+ except StopIteration:
+ return None
+
+
+def indexed_property_deleter(interface):
+ try:
+ # Find indexed property deleter, if present; has form:
+ # deleter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG)
+ return next(
+ method
+ for method in interface.operations
+ if ('deleter' in method.specials and
+ len(method.arguments) == 1 and
+ str(method.arguments[0].idl_type) == 'unsigned long'))
+ except StopIteration:
+ return None
+
+
+################################################################################
+# Named properties
+# http://heycam.github.io/webidl/#idl-named-properties
+################################################################################
+
+def named_property_getter(interface):
+ try:
+ # Find named property getter, if present; has form:
+ # getter TYPE [OPTIONAL_IDENTIFIER](DOMString ARG1)
+ getter = next(
+ method
+ for method in interface.operations
+ if ('getter' in method.specials and
+ len(method.arguments) == 1 and
+ str(method.arguments[0].idl_type) == 'DOMString'))
+ getter.name = getter.name or 'anonymousNamedGetter'
+ return getter
+ except StopIteration:
+ return None
+
+
+def named_property_setter(interface):
+ try:
+ # Find named property setter, if present; has form:
+ # setter RETURN_TYPE [OPTIONAL_IDENTIFIER](DOMString ARG1, ARG_TYPE ARG2)
+ return next(
+ method
+ for method in interface.operations
+ if ('setter' in method.specials and
+ len(method.arguments) == 2 and
+ str(method.arguments[0].idl_type) == 'DOMString'))
+ except StopIteration:
+ return None
+
+
+def named_property_deleter(interface):
+ try:
+ # Find named property deleter, if present; has form:
+ # deleter TYPE [OPTIONAL_IDENTIFIER](DOMString ARG)
+ return next(
+ method
+ for method in interface.operations
+ if ('deleter' in method.specials and
+ len(method.arguments) == 1 and
+ str(method.arguments[0].idl_type) == 'DOMString'))
+ except StopIteration:
+ return None
+
+
+IdlInterface.indexed_property_getter = property(indexed_property_getter)
+IdlInterface.indexed_property_setter = property(indexed_property_setter)
+IdlInterface.indexed_property_deleter = property(indexed_property_deleter)
+IdlInterface.named_property_getter = property(named_property_getter)
+IdlInterface.named_property_setter = property(named_property_setter)
+IdlInterface.named_property_deleter = property(named_property_deleter)
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/bindings/templates/copyright_block.txt
similarity index 64%
copy from core/html/canvas/EXTShaderTextureLOD.idl
copy to bindings/templates/copyright_block.txt
index 975005a..4c2c944 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/bindings/templates/copyright_block.txt
@@ -2,8 +2,5 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
-] interface EXTShaderTextureLOD {
-};
+// This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
+
diff --git a/bindings/tests/idls/core/ArrayBuffer.idl b/bindings/tests/idls/core/ArrayBuffer.idl
new file mode 100644
index 0000000..7878c57
--- /dev/null
+++ b/bindings/tests/idls/core/ArrayBuffer.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFER
+
+[
+ ImplementedAs=TestArrayBuffer,
+] interface ArrayBuffer {
+ readonly attribute unsigned long byteLength;
+};
diff --git a/bindings/tests/idls/core/ArrayBufferView.idl b/bindings/tests/idls/core/ArrayBufferView.idl
new file mode 100644
index 0000000..e6e9262
--- /dev/null
+++ b/bindings/tests/idls/core/ArrayBufferView.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFERVIEW
+
+[
+ ImplementedAs=TestArrayBufferView,
+] interface ArrayBufferView {
+ readonly attribute ArrayBuffer buffer;
+ readonly attribute unsigned long byteOffset;
+ readonly attribute unsigned long byteLength;
+};
diff --git a/bindings/tests/idls/core/DataView.idl b/bindings/tests/idls/core/DataView.idl
new file mode 100644
index 0000000..e26468d
--- /dev/null
+++ b/bindings/tests/idls/core/DataView.idl
@@ -0,0 +1,15 @@
+// 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://www.khronos.org/registry/typedarray/specs/latest/#DATAVIEW
+
+[
+ ImplementedAs=TestDataView,
+] interface DataView : ArrayBufferView {
+ [RaisesException] octet getUint8(unsigned long byteOffset);
+ [RaisesException] double getFloat64(unsigned long byteOffset, optional boolean littleEndian);
+
+ [RaisesException] void setUint8(unsigned long byteOffset, octet value);
+ [RaisesException] void setFloat64(unsigned long byteOffset, double value, optional boolean littleEndian);
+};
diff --git a/bindings/tests/idls/core/TestDictionary.idl b/bindings/tests/idls/core/TestDictionary.idl
index 7bd1ac0..d135101 100644
--- a/bindings/tests/idls/core/TestDictionary.idl
+++ b/bindings/tests/idls/core/TestDictionary.idl
@@ -2,16 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-enum TestEnum { "foo", "bar", "baz" };
-
-[
- GarbageCollected,
-] dictionary TestDictionary {
+dictionary TestDictionary {
boolean booleanMember;
long longMember = 1;
DOMString stringMember;
TestInterface testInterfaceMember;
double? doubleOrNullMember = null;
+ double restrictedDoubleMember = 3.14;
+ unrestricted double unrestrictedDoubleMember = 3.14;
DOMString? stringOrNullMember = "default string value";
TestInterface? testInterfaceOrNullMember;
TestInterfaceGarbageCollected testInterfaceGarbageCollectedMember;
@@ -19,9 +17,23 @@
TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedMember;
TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullMember;
DOMString[] stringArrayMember;
- sequence<DOMString> stringSequenceMember;
+ sequence<DOMString> stringSequenceMember = [];
+ sequence<TestInterface> testInterfaceSequenceMember = [];
+ sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceMember = [];
+ sequence<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeGarbageCollectedSequenceMember = [];
TestEnum enumMember = "foo";
+ sequence<TestEnum> enumSequenceMember;
Element? elementOrNullMember;
object objectMember;
object? objectOrNullMember;
+ [ImplementedAs=createMember] boolean create;
+ [DeprecateAs=CreateMember, ImplementedAs=createMember] boolean deprecatedCreateMember;
+ (double or DOMString) doubleOrStringMember = 3.14;
+ sequence<(double or DOMString)> doubleOrStringSequenceMember;
+ (double or DOMString) otherDoubleOrStringMember = "default string value";
+ (TestInterface2 or Uint8Array) testInterface2OrUint8ArrayMember;
+ sequence<InternalDictionary> internalDictionarySequenceMember;
+ Uint8Array uint8ArrayMember;
+ EventTarget eventTargetMember;
+ any anyMember = null;
};
diff --git a/bindings/tests/idls/core/TestDictionaryDerived.idl b/bindings/tests/idls/core/TestDictionaryDerived.idl
new file mode 100644
index 0000000..51817ef
--- /dev/null
+++ b/bindings/tests/idls/core/TestDictionaryDerived.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.
+
+[
+ ImplementedAs=TestDictionaryDerivedImplementedAs,
+] dictionary TestDictionaryDerived : TestDictionary {
+ DOMString derivedStringMember;
+ DOMString derivedStringMemberWithDefault = "default string value";
+ required long requiredLongMember;
+ sequence<DOMStringOrDouble> stringOrDoubleSequenceMember;
+};
diff --git a/bindings/tests/idls/core/TestImplements.idl b/bindings/tests/idls/core/TestImplements.idl
index e6e55db..ffe8372 100644
--- a/bindings/tests/idls/core/TestImplements.idl
+++ b/bindings/tests/idls/core/TestImplements.idl
@@ -45,5 +45,4 @@
[Reflect=IMPLEMENTS_REFLECT_CONSTANT] const unsigned short IMPLEMENTS_CONSTANT_2 = 2;
[RuntimeEnabled=ImplementsFeatureName] attribute Node implementsRuntimeEnabledNodeAttribute;
- [PerContextEnabled=ImplementsContextName] attribute Node implementsPerContextEnabledNodeAttribute;
};
diff --git a/bindings/tests/idls/core/TestInterface.idl b/bindings/tests/idls/core/TestInterface.idl
index 135c6f8..69a51cd 100644
--- a/bindings/tests/idls/core/TestInterface.idl
+++ b/bindings/tests/idls/core/TestInterface.idl
@@ -34,13 +34,14 @@
[
ActiveDOMObject,
Conditional=CONDITION,
- Custom=(LegacyCallAsFunction,ToV8),
+ Custom=LegacyCallAsFunction,
DoNotCheckConstants,
ImplementedAs=TestInterfaceImplementation,
Iterable,
+ Measure,
RuntimeEnabled=FeatureName,
SetWrapperReferenceTo(TestInterface referencedName),
- TypeChecking=(Interface,Unrestricted),
+ TypeChecking=Interface,
Exposed=(Worker,Window),
] interface TestInterface : TestInterfaceEmpty {
// members needed to test [ImplementedAs], as this affect attribute
@@ -49,30 +50,38 @@
const unsigned long UNSIGNED_LONG = 0;
[Reflect=CONST_CPP] const short CONST_JAVASCRIPT = 1;
- attribute TestInterface testInterfaceAttribute; // Self-referential interface type with [ImplementedAs]
+ [Measure] attribute TestInterface testInterfaceAttribute; // Self-referential interface type with [ImplementedAs]
attribute TestInterfaceConstructor testInterfaceConstructorAttribute;
+ attribute TestInterfaceConstructor TestInterface;
+ attribute TestInterface2Constructor TestInterface2;
attribute double doubleAttribute;
attribute float floatAttribute;
attribute unrestricted double unrestrictedDoubleAttribute;
attribute unrestricted float unrestrictedFloatAttribute;
+ attribute TestEnum testEnumAttribute;
+ attribute DOMStringOrDouble stringOrDoubleAttribute;
static attribute DOMString staticStringAttribute;
+ static attribute TestInterface staticReturnDOMWrapperAttribute;
+ [LegacyInterfaceTypeChecking] attribute TestInterfaceEmpty legacyInterfaceTypeCheckingAttribute;
void voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
void voidMethodDoubleArgFloatArg(double doubleArg, float floatArg);
void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestricted double unrestrictedDoubleArg, unrestricted float unrestrictedFloatArg);
+ void voidMethodTestEnumArg(TestEnum testEnumArg);
[PerWorldBindings] void voidMethod();
// Anonymous indexed property operations
- getter DOMString (unsigned long index);
+ [DoNotCheckSecurity] getter DOMString (unsigned long index);
setter DOMString (unsigned long index, DOMString value);
deleter boolean (unsigned long index);
// Anonymous named property operations
- getter DOMString (DOMString name);
+ [DoNotCheckSecurity] getter DOMString (DOMString name);
setter DOMString (DOMString name, DOMString value);
deleter boolean (DOMString name);
[NotEnumerable] stringifier;
+ [NotEnumerable, RaisesException] serializer;
// Per-method [Exposed] annotation support.
void alwaysExposedMethod();
@@ -82,15 +91,32 @@
static void alwaysExposedStaticMethod();
[Exposed=Worker] static void workerExposedStaticMethod();
[Exposed=Window] static void windowExposedStaticMethod();
+ static TestInterface staticReturnDOMWrapperMethod();
attribute long alwaysExposedAttribute;
[Exposed=Worker] attribute long workerExposedAttribute;
[Exposed=Window] attribute long windowExposedAttribute;
+ [Exposed=Window, RuntimeEnabled=FeatureName] void methodWithExposedAndRuntimeEnabledFlag();
+ [Exposed=Window] void overloadMethodWithExposedAndRuntimeEnabledFlag(long longArg);
+ [Exposed=Window, RuntimeEnabled=FeatureName] void overloadMethodWithExposedAndRuntimeEnabledFlag(DOMString string);
+ [Exposed=Window, RuntimeEnabled=FeatureName2] void overloadMethodWithExposedAndRuntimeEnabledFlag(Window window);
+
+ [Exposed(Window FeatureName, Worker FeatureName2)] void methodWithExposedHavingRuntimeEnabldFlag();
+
[Exposed=(Window,ServiceWorker)] void windowAndServiceWorkerExposedMethod();
- void voidMethodPartailOverload();
- static void voidMethodPartailOverload();
+ void voidMethodPartialOverload();
+ void voidMethodPartialOverload(double doubleArg);
+ static void staticVoidMethodPartialOverload();
+
+ Promise promiseMethodPartialOverload();
+ Promise promiseMethodPartialOverload(Window window);
+ static Promise staticPromiseMethodPartialOverload();
+
+ [LenientThis] attribute any lenientThisAttribute;
+
+ [LegacyInterfaceTypeChecking] void legacyInterfaceTypeCheckingMethod(TestInterfaceEmpty testInterfaceEmptyArg);
};
TestInterface implements TestImplements;
diff --git a/bindings/tests/idls/core/TestInterface2.idl b/bindings/tests/idls/core/TestInterface2.idl
index 8bb30a6..02de68e 100644
--- a/bindings/tests/idls/core/TestInterface2.idl
+++ b/bindings/tests/idls/core/TestInterface2.idl
@@ -34,24 +34,27 @@
// The more *minor* extended attribute should be put in this file.
[
- Constructor, // Test interaction with [Custom=Wrap]
- Custom=Wrap, // Conflicts with and [Custom=ToV8], respectively
+ Constructor,
DependentLifetime, // Covered by [ActiveDOMObject]
SetWrapperReferenceFrom=ownerNode, // Conflicts with [SetWrapperReferenceTo]
- SpecialWrapFor=(TestInterface,TestInterfaceEmpty), // Conflicts with [Custom=ToV8]
+ // Note that Exposed(Arguments) has no effect on bindings-tests. It is
+ // processed in generate_global_constructors.py.
+ Exposed(Window FeatureName), // Conflicts with Exposed=(Window,Worker)
] interface TestInterface2 {
// This interface has only runtime enabled constants.
[RuntimeEnabled=FeatureName] const unsigned short CONST_VALUE_1 = 1;
// Indexed property operations with an identifier
[RaisesException] getter TestInterfaceEmpty item(unsigned long index);
- [RaisesException] setter DOMString setItem(unsigned long index, DOMString value);
+ [RaisesException, TypeChecking=Interface] setter TestInterfaceEmpty setItem(unsigned long index, TestInterfaceEmpty value);
[RaisesException] deleter boolean deleteItem(unsigned long index);
// Named property operations with an identifier
[RaisesException] getter TestInterfaceEmpty namedItem(DOMString name);
- [RaisesException] setter DOMString setNamedItem(DOMString name, DOMString value);
+ [RaisesException, TypeChecking=Interface] setter TestInterfaceEmpty setNamedItem(DOMString name, TestInterfaceEmpty? value);
[RaisesException] deleter boolean deleteNamedItem(DOMString name);
stringifier DOMString stringifierMethod();
+
+ readonly setlike<TestInterfaceEmpty>;
};
diff --git a/bindings/tests/idls/core/TestInterface3.idl b/bindings/tests/idls/core/TestInterface3.idl
index 2e20986..4470f7c 100644
--- a/bindings/tests/idls/core/TestInterface3.idl
+++ b/bindings/tests/idls/core/TestInterface3.idl
@@ -35,6 +35,7 @@
[
Custom=VisitDOMWrapper, // Conflict with [SetWrapperReferenceTo] and [SetWrapperReferenceFrom]
+ NoImplHeader,
] interface TestInterface3 {
[Custom] getter boolean (unsigned long index);
[Custom] setter boolean (unsigned long index, Node value);
@@ -43,4 +44,9 @@
[Custom=(PropertyGetter,PropertyEnumerator,PropertyQuery)] getter Node (DOMString name);
[Custom] setter Node (DOMString name, Node value);
[Custom] deleter boolean (DOMString name);
+
+ void voidMethodDocument(Document document);
+
+ [RuntimeEnabled=FeatureName] iterable<any>;
+ [RuntimeEnabled=FeatureName, CallWith=ScriptState, RaisesException, ImplementedAs=iterableKeys] Iterator keys();
};
diff --git a/bindings/tests/idls/core/TestInterfaceAccessors.idl b/bindings/tests/idls/core/TestInterfaceAccessors.idl
new file mode 100644
index 0000000..e6c4636
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfaceAccessors.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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.
+
+// An interface for testing (DoNot)ExposeJSAccessors extended attributes.
+
+[
+ ExposeJSAccessors,
+] interface TestInterfaceAccessors : TestInterfaceEmpty {
+ attribute long noExposeJSAccessorAttribute;
+ [ExposeJSAccessors] attribute long exposeJSAccessorAttribute;
+ [DoNotExposeJSAccessors] attribute long doNotExposeJSAccessorAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl b/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl
index 8fac9b8..56ead63 100644
--- a/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl
+++ b/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl
@@ -29,13 +29,15 @@
[
CheckSecurity=Frame,
] interface TestInterfaceCheckSecurity {
- readonly attribute long longAttribute;
+ readonly attribute long readonlyLongAttribute;
+ attribute long longAttribute;
void voidMethod();
[DoNotCheckSecurity] attribute long doNotCheckSecurityLongAttribute;
[DoNotCheckSecurity] readonly attribute long doNotCheckSecurityReadonlyLongAttribute; // Separate read only attribute to check attribute configuration
[DoNotCheckSecurity=Setter] attribute long doNotCheckSecurityOnSetterLongAttribute;
[DoNotCheckSecurity, Replaceable] readonly attribute long doNotCheckSecurityReplaceableReadonlyLongAttribute;
+ [DoNotCheckSecurity, Replaceable, ExposeJSAccessors] readonly attribute long doNotCheckSecurityReplaceableReadonlyLongAccessor;
[DoNotCheckSecurity] void doNotCheckSecurityVoidMethod();
[DoNotCheckSecurity, DoNotCheckSignature] void doNotCheckSecurityDoNotCheckSignatureVoidMethod();
diff --git a/bindings/tests/idls/core/TestInterfaceConstructor.idl b/bindings/tests/idls/core/TestInterfaceConstructor.idl
index f82e44c..29878ae 100644
--- a/bindings/tests/idls/core/TestInterfaceConstructor.idl
+++ b/bindings/tests/idls/core/TestInterfaceConstructor.idl
@@ -38,12 +38,13 @@
Dictionary dictionaryArg,
sequence<DOMString> sequenceStringArg,
sequence<Dictionary> sequenceDictionaryArg,
+ sequence<(long or TestDictionary)> sequenceLongOrTestDictionaryArg,
optional Dictionary optionalDictionaryArg,
[Default=Undefined] optional TestInterfaceEmpty optionalTestInterfaceEmptyArg),
Constructor(DOMString arg, optional DOMString optArg),
Constructor(DOMString arg, DOMString arg2, DOMString arg3),
NamedConstructor=Audio(DOMString arg, optional DOMString optArg),
- ConstructorCallWith=(ExecutionContext,Document),
+ ConstructorCallWith=(ScriptState,ExecutionContext,Document),
MeasureAs=TestFeature,
RaisesException=Constructor,
] interface TestInterfaceConstructor {
diff --git a/bindings/tests/idls/core/TestInterfaceConstructor4.idl b/bindings/tests/idls/core/TestInterfaceConstructor4.idl
index 246f551..2153167 100644
--- a/bindings/tests/idls/core/TestInterfaceConstructor4.idl
+++ b/bindings/tests/idls/core/TestInterfaceConstructor4.idl
@@ -2,10 +2,10 @@
// 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
+// Test for overload resolution for the string-like USVString
// argument.
[
Constructor(TestInterfaceConstructor4 testInterface4Arg),
- Constructor(ScalarValueString scalarValueStringArg),
+ Constructor(USVString usvStringArg),
] interface TestInterfaceConstructor4 {
};
diff --git a/bindings/tests/idls/core/TestInterfaceEventConstructor.idl b/bindings/tests/idls/core/TestInterfaceEventConstructor.idl
deleted file mode 100644
index e193a0d..0000000
--- a/bindings/tests/idls/core/TestInterfaceEventConstructor.idl
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 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:
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 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.
- */
-
-[
- EventConstructor,
- RaisesException=Constructor,
-] interface TestInterfaceEventConstructor : Event {
- readonly attribute DOMString readonlyStringAttribute;
-
- [InitializedByEventConstructor] readonly attribute DOMString initializedByEventConstructorReadonlyStringAttribute;
- [InitializedByEventConstructor] readonly attribute any initializedByEventConstructorReadonlyAnyAttribute;
- [InitializedByEventConstructor] readonly attribute boolean initializedByEventConstructorReadonlyBooleanAttribute;
- [InitializedByEventConstructor] readonly attribute long initializedByEventConstructorReadonlyLongAttribute;
- [InitializedByEventConstructor] readonly attribute Uint8Array initializedByEventConstructorReadonlyUint8ArrayAttribute;
- [InitializedByEventConstructor] readonly attribute TestInterfaceEmpty initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute;
- [InitializedByEventConstructor] readonly attribute TestInterfaceEmpty[] initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute;
- [InitializedByEventConstructor] readonly attribute TestInterfaceEmpty? initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute;
-
- [DeprecateAs=initializedByEventConstructorReadonlyStringAttribute, InitializedByEventConstructor] readonly attribute DOMString deprecatedInitializedByEventConstructorReadonlyStringAttribute;
- [ImplementedAs=implementedAsName, InitializedByEventConstructor] readonly attribute DOMString implementedAsInitializedByEventConstructorReadonlyStringAttribute;
- [DeprecateAs=initializedByEventConstructorReadonlyStringAttribute, ImplementedAs=deprecatedImplementedAsName, InitializedByEventConstructor] readonly attribute DOMString deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute;
-};
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/bindings/tests/idls/core/TestInterfaceEventInit.idl
similarity index 65%
copy from core/html/canvas/EXTShaderTextureLOD.idl
copy to bindings/tests/idls/core/TestInterfaceEventInit.idl
index 975005a..4fad512 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/bindings/tests/idls/core/TestInterfaceEventInit.idl
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
-] interface EXTShaderTextureLOD {
+dictionary TestInterfaceEventInit : EventInit {
+ DOMString stringMember;
};
diff --git a/bindings/tests/idls/core/TestInterfaceEventInitConstructor.idl b/bindings/tests/idls/core/TestInterfaceEventInitConstructor.idl
new file mode 100644
index 0000000..2fa3746
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfaceEventInitConstructor.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.
+
+[
+ Constructor(DOMString type, TestInterfaceEventInit testInterfaceEventInit),
+] interface TestInterfaceEventInitConstructor : Event {
+ readonly attribute DOMString readonlyStringAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl b/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl
index 55739a3..216cbed 100644
--- a/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl
+++ b/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl
@@ -8,4 +8,6 @@
] interface TestInterfaceGarbageCollected : EventTarget { // Inherit from EventTarget to test order of internal fields
attribute TestInterfaceGarbageCollected attr1;
void func(TestInterfaceGarbageCollected arg);
+
+ setlike<DOMString>;
};
diff --git a/bindings/tests/idls/core/TestInterfaceNode.idl b/bindings/tests/idls/core/TestInterfaceNode.idl
index 25c62a5..a4ff40d 100644
--- a/bindings/tests/idls/core/TestInterfaceNode.idl
+++ b/bindings/tests/idls/core/TestInterfaceNode.idl
@@ -29,6 +29,8 @@
*/
interface TestInterfaceNode : Node {
+ inherit attribute DOMString nodeName;
+
attribute DOMString stringAttribute;
readonly attribute TestInterfaceEmpty readonlyTestInterfaceEmptyAttribute;
attribute EventHandler eventHandlerAttribute;
diff --git a/bindings/tests/idls/core/TestInterfaceNotScriptWrappable.idl b/bindings/tests/idls/core/TestInterfaceNotScriptWrappable.idl
deleted file mode 100644
index aa8192d..0000000
--- a/bindings/tests/idls/core/TestInterfaceNotScriptWrappable.idl
+++ /dev/null
@@ -1,10 +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.
-
-[
- NotScriptWrappable,
-] interface TestInterfaceNotScriptWrappable {
- attribute TestInterfaceNotScriptWrappable attr1;
- void func(TestInterfaceNotScriptWrappable arg);
-};
diff --git a/bindings/tests/idls/core/TestInterfaceOwnProperties.idl b/bindings/tests/idls/core/TestInterfaceOwnProperties.idl
new file mode 100644
index 0000000..940024a
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfaceOwnProperties.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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.
+
+// An interface for testing (DoNot)ExposeJSAccessors extended attributes.
+
+[
+ DoNotExposeJSAccessors,
+] interface TestInterfaceOwnProperties : TestInterfaceEmpty {
+ attribute long noExposeJSAccessorAttribute;
+ [ExposeJSAccessors] attribute long exposeJSAccessorAttribute;
+ [DoNotExposeJSAccessors] attribute long doNotExposeJSAccessorAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfaceOwnPropertiesDerived.idl b/bindings/tests/idls/core/TestInterfaceOwnPropertiesDerived.idl
new file mode 100644
index 0000000..86f47b6
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfaceOwnPropertiesDerived.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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.
+
+// An interface for testing (DoNot)ExposeJSAccessors extended attributes.
+
+interface TestInterfaceOwnPropertiesDerived : TestInterfaceOwnProperties {
+ attribute long noExposeJSAccessorAttribute;
+ [ExposeJSAccessors] attribute long exposeJSAccessorAttribute;
+ [DoNotExposeJSAccessors] attribute long doNotExposeJSAccessorAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl b/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl
index be955b0..8515a03 100644
--- a/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl
+++ b/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl
@@ -32,6 +32,7 @@
Constructor(DOMString str),
NamedConstructor=TestInterface(DOMString str),
WillBeGarbageCollected,
+ Unforgeable,
] interface TestInterfaceWillBeGarbageCollected : EventTarget { // Inherit from EventTarget to test order of internal fields
attribute TestInterfaceWillBeGarbageCollected attr1;
void func(TestInterfaceWillBeGarbageCollected arg);
diff --git a/bindings/tests/idls/core/TestObject.idl b/bindings/tests/idls/core/TestObject.idl
index 44d9cae..97a9ab9 100644
--- a/bindings/tests/idls/core/TestObject.idl
+++ b/bindings/tests/idls/core/TestObject.idl
@@ -88,7 +88,7 @@
attribute Date dateAttribute;
attribute DOMString stringAttribute;
attribute ByteString byteStringAttribute;
- attribute ScalarValueString scalarValueStringAttribute;
+ attribute USVString usvStringAttribute;
attribute DOMTimeStamp domTimeStampAttribute;
attribute boolean booleanAttribute;
attribute byte byteAttribute;
@@ -150,11 +150,19 @@
attribute TestInterface? testInterfaceOrNullAttribute;
// Enumerations
attribute TestEnum testEnumAttribute;
+ attribute TestEnum? testEnumOrNullAttribute;
// Static attributes
static attribute DOMString staticStringAttribute;
static attribute long staticLongAttribute;
// Exceptional type
attribute EventHandler eventHandlerAttribute;
+ // Union types
+ attribute (double or DOMString) doubleOrStringAttribute;
+ attribute (double or DOMString)? doubleOrStringOrNullAttribute;
+ attribute (double? or DOMString) doubleOrNullStringAttribute;
+ attribute (DOMString or sequence<DOMString>) stringOrStringSequenceAttribute;
+ attribute (TestEnum or double) testEnumOrDoubleAttribute;
+ attribute (unrestricted double or DOMString) unrestrictedDoubleOrStringAttribute;
// Extended attributes
[LogActivity, LogAllWorlds] attribute long activityLoggingAccessForAllWorldsLongAttribute;
@@ -187,7 +195,6 @@
[Custom=Setter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customSetterImplementedAsLongAttribute;
[MeasureAs=TestFeature] attribute long measureAsLongAttribute;
[NotEnumerable] attribute long notEnumerableLongAttribute;
- [PerContextEnabled=FeatureName] attribute long perContextEnabledLongAttribute;
[PerWorldBindings] readonly attribute TestInterfaceEmpty perWorldBindingsReadonlyTestInterfaceEmptyAttribute;
[LogActivity, LogAllWorlds, PerWorldBindings] attribute long activityLoggingAccessPerWorldBindingsLongAttribute;
[LogActivity, PerWorldBindings] attribute long activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute;
@@ -231,9 +238,9 @@
[Reflect, ReflectOnly=("empty","missing","invalid","a-normal"), ReflectEmpty="empty", ReflectMissing="missing", ReflectInvalid="invalid"] readonly attribute DOMString limitedWithEmptyMissingInvalidAttribute;
[Replaceable] readonly attribute long replaceableReadonlyLongAttribute;
- [Replaceable, PutForwards=href] readonly attribute TestNode locationReplaceable;
+ [Replaceable, ExposeJSAccessors] readonly attribute long replaceableReadonlyLongAccessor;
+ [PutForwards=href] readonly attribute TestNode locationPutForwards;
[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=ExecutionContext] attribute DOMString setterCallWithExecutionContextStringAttribute;
@@ -244,14 +251,20 @@
[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;
+ [TreatReturnedNullStringAs=Null] attribute USVString treatReturnedNullStringAsNullUSVStringAttribute;
+ [TreatReturnedNullStringAs=Undefined] attribute USVString treatReturnedNullStringAsUndefinedUSVStringAttribute;
[TypeChecking=Interface] attribute float typeCheckingInterfaceFloatAttribute; // nop for non-interface types
[TypeChecking=Interface] attribute TestInterface typeCheckingInterfaceTestInterfaceAttribute;
[TypeChecking=Interface] attribute TestInterface? typeCheckingInterfaceTestInterfaceOrNullAttribute;
[Reflect, URL] attribute DOMString urlStringAttribute;
[Reflect=reflectUrlAttribute, URL] attribute DOMString urlStringAttribute;
[Unforgeable] attribute long unforgeableLongAttribute;
+ [Measure] attribute long measuredLongAttribute;
+ [SameObject] attribute TestInterface sameObjectAttribute;
+ [Unscopeable] attribute long unscopeableLongAttribute;
+ [Unscopeable, RuntimeEnabled=FeatureName] attribute long unscopeableRuntimeEnabledLongAttribute;
+ [Unscopeable] void unscopeableVoidMethod();
+ [Unscopeable, RuntimeEnabled=FeatureName] void unscopeableRuntimeEnabledVoidMethod();
// Methods
@@ -268,7 +281,7 @@
Date dateMethod();
DOMString stringMethod();
ByteString byteStringMethod();
- ScalarValueString scalarValueStringMethod();
+ USVString usvStringMethod();
DOMTimeStamp readonlyDOMTimeStampMethod();
boolean booleanMethod();
byte byteMethod();
@@ -285,7 +298,7 @@
void voidMethodDateArg(Date dateArg);
void voidMethodStringArg(DOMString stringArg);
void voidMethodByteStringArg(ByteString stringArg);
- void voidMethodScalarValueStringArg(ScalarValueString scalarValueStringArg);
+ void voidMethodUSVStringArg(USVString usvStringArg);
void voidMethodDOMTimeStampArg(DOMTimeStamp domTimeStampArg);
void voidMethodBooleanArg(boolean booleanArg);
void voidMethodByteArg(byte byteArg);
@@ -306,6 +319,8 @@
VoidCallbackFunction voidCallbackFunctionMethod();
AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgMethod();
void voidMethodVoidCallbackFunctionArg(VoidCallbackFunction voidCallbackFunctionArg);
+ void voidMethodOptionalVoidCallbackFunctionArg(optional VoidCallbackFunction voidCallbackFunctionArg);
+ void voidMethodNullableVoidCallbackFunctionArg(VoidCallbackFunction? voidCallbackFunctionArg);
void voidMethodAnyCallbackFunctionOptionalAnyArg(AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgArg);
// Custom type conversions
any anyMethod();
@@ -336,6 +351,7 @@
void voidMethodArrayLongArg(long[] arrayLongArg);
void voidMethodArrayStringArg(DOMString[] arrayStringArg);
void voidMethodArrayTestInterfaceEmptyArg(TestInterfaceEmpty[] arrayTestInterfaceEmptyArg);
+ void voidMethodNullableArrayLongArg(long[]? arrayLongArg);
// Sequences
sequence<long> longSequenceMethod();
sequence<DOMString> stringSequenceMethod();
@@ -344,6 +360,7 @@
void voidMethodSequenceStringArg(sequence<DOMString> stringSequenceArg);
void voidMethodSequenceTestInterfaceEmptyArg(sequence<TestInterfaceEmpty> testInterfaceEmptySequenceArg);
void voidMethodSequenceSequenceDOMStringArg(sequence<sequence<DOMString>> stringSequenceSequenceArg);
+ void voidMethodNullableSequenceLongArg(sequence<long>? longSequenceArg);
// Nullable types
long? nullableLongMethod();
DOMString? nullableStringMethod();
@@ -352,7 +369,15 @@
// Union types
(TestInterfaceGarbageCollected or DOMString) testInterfaceGarbageCollectedOrDOMStringMethod();
(TestInterfaceWillBeGarbageCollected or TestDictionary) testInterfaceWillBeGarbageCollectedOrTestDictionaryMethod();
- (sequence<long> or DOMString[] or unrestricted double) longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethod();
+ (boolean or DOMString or unrestricted double) booleanOrDOMStringOrUnrestrictedDoubleMethod();
+ (TestInterface or long) testInterfaceOrLongMethod();
+ void voidMethodDoubleOrDOMStringArg((double or DOMString) arg);
+ void voidMethodDoubleOrDOMStringOrNullArg((double or DOMString)? arg);
+ void voidMethodDoubleOrNullOrDOMStringArg((double? or DOMString) arg);
+ void voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg((DOMString or ArrayBuffer or ArrayBufferView) arg);
+ void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg((ArrayBuffer or ArrayBufferView or Dictionary) arg);
+ // Array of Union types
+ void voidMethodArrayOfDoubleOrDOMStringArg((double or DOMString)... arg);
// Currently only used on interface type arguments
void voidMethodTestInterfaceEmptyOrNullArg(TestInterfaceEmpty? nullableTestInterfaceEmptyArg);
// Callback interface types
@@ -364,8 +389,11 @@
void voidMethodTestEnumArg(TestEnum testEnumTypeArg);
// Exceptional types
Dictionary dictionaryMethod();
+ TestDictionary testDictionaryMethod();
+ TestDictionary? nullableTestDictionaryMethod();
+ void passPermissiveDictionaryMethod([PermissiveDictionaryConversion] optional TestDictionary arg);
NodeFilter nodeFilterMethod();
- Promise promiseMethod(long arg1, Dictionary arg2, DOMString arg3, DOMString... variadic);
+ Promise<void> promiseMethod(long arg1, Dictionary arg2, DOMString arg3, DOMString... variadic);
Promise promiseMethodWithoutExceptionState(Dictionary arg1);
SerializedScriptValue serializedScriptValueMethod();
XPathNSResolver xPathNSResolverMethod();
@@ -375,8 +403,6 @@
void voidMethodSerializedScriptValueArg(SerializedScriptValue serializedScriptValueArg);
void voidMethodXPathNSResolverArg(XPathNSResolver xPathNSResolverArg);
void voidMethodDictionarySequenceArg(sequence<Dictionary> dictionarySequenceArg);
- Promise overloadedPromiseMethod(long arg);
- Promise overloadedPromiseMethod(DOMString arg);
// Arguments
void voidMethodStringArgLongArg(DOMString stringArg, long longArg);
@@ -406,6 +432,10 @@
void voidMethodDefaultNullableByteStringArg(optional ByteString? defaultStringArg = null);
void voidMethodDefaultNullableStringArg(optional DOMString? defaultStringArg = null);
void voidMethodDefaultNullableTestInterfaceArg(optional TestInterface? defaultTestInterfaceArg = null);
+ void voidMethodDefaultDoubleOrStringArgs(optional (double or DOMString) defaultLongArg = 10.0,
+ optional (double or DOMString?) defaultStringArg = "foo",
+ optional (double or DOMString)? defaultNullArg = null);
+ void voidMethodDefaultStringSequenceArg(optional sequence<DOMString> defaultStringSequenceArg = []);
// Variadic operations
void voidMethodVariadicStringArg(DOMString... variadicStringArgs);
@@ -436,7 +466,14 @@
void overloadedMethodI(double doubleArg);
void overloadedMethodJ(DOMString stringArg);
void overloadedMethodJ(TestDictionary testDictionaryArg);
+ void overloadedMethodK(Function functionArg);
+ void overloadedMethodK(DOMString stringArg);
+ void overloadedMethodL(long longArg, any... restArgs);
+ void overloadedMethodL(DOMString stringArg, any... restArgs);
+ Promise promiseOverloadMethod();
+ Promise promiseOverloadMethod(Window arg1, double arg2);
+ Promise promiseOverloadMethod(Document arg1, double arg2);
[PerWorldBindings] void overloadedPerWorldBindingsMethod();
[PerWorldBindings] void overloadedPerWorldBindingsMethod(long longArg);
@@ -444,6 +481,14 @@
static void overloadedStaticMethod(long longArg);
static void overloadedStaticMethod(long longArg1, long longArg2);
+ // Special operations
+ [CallWith=ScriptState] getter any item(unsigned long index);
+ [CallWith=ScriptState] getter object(DOMString name);
+ [CallWith=ScriptState] setter DOMString setItem(unsigned long index, DOMString value);
+ [CallWith=ScriptState] setter DOMString(DOMString name, DOMString value);
+ [RaisesException, CallWith=ScriptState] deleter boolean(unsigned long index);
+ [CallWith=ScriptState] deleter boolean(DOMString name);
+
// Extended attributes for arguments
// [Clamp]
void voidMethodClampUnsignedShortArg([Clamp] unsigned short clampUnsignedShortArg);
@@ -469,16 +514,22 @@
[CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(optional boolean optionalBooleanArg);
[CallWith=ActiveWindow] void callWithActiveWindow();
[CallWith=(ActiveWindow,FirstWindow)] void callWithActiveWindowScriptWindow();
+ [CallWith=ThisValue] void callWithThisValue();
[CheckSecurity=Node] void checkSecurityForNodeVoidMethod();
[Conditional=CONDITION] void conditionalConditionVoidMethod();
[Conditional=CONDITION] static void conditionalConditionStaticVoidMethod();
[Custom] void customVoidMethod();
+ [Custom=CallPrologue] void customCallPrologueVoidMethod();
+ [Custom=CallEpilogue] void customCallEpilogueVoidMethod();
[Conditional=CONDITION, Custom] void conditionalConditionCustomVoidMethod();
[CustomElementCallbacks] void customElementCallbacksVoidMethod();
[DeprecateAs=voidMethod] void deprecatedVoidMethod();
[DoNotCheckSignature] void doNotCheckSignatureVoidMethod();
[ImplementedAs=implementedAsMethodName] void implementedAsVoidMethod();
[MeasureAs=TestFeature] void measureAsVoidMethod();
+ [Measure] void measureMethod();
+ [Measure] void measureOverloadedMethod();
+ [Measure] void measureOverloadedMethod(long arg);
[DeprecateAs=TestFeatureA] void DeprecateAsOverloadedMethod();
[DeprecateAs=TestFeatureB] void DeprecateAsOverloadedMethod(long arg);
[DeprecateAs=TestFeature] void DeprecateAsSameValueOverloadedMethod();
@@ -494,9 +545,9 @@
[DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod();
[DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod(long arg);
[NotEnumerable] void notEnumerableVoidMethod();
- [PerContextEnabled=FeatureName] void perContextEnabledVoidMethod();
[PerWorldBindings] void perWorldBindingsVoidMethod();
[PerWorldBindings] void perWorldBindingsVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
+ [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
[LogActivity, LogAllWorlds, PerWorldBindings] void activityLoggingForAllWorldsPerWorldBindingsVoidMethod();
[LogActivity, PerWorldBindings] void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod();
[RaisesException] void raisesExceptionVoidMethod();
@@ -505,28 +556,37 @@
[RaisesException] void raisesExceptionVoidMethodTestCallbackInterfaceArg(TestCallbackInterface testCallbackInterfaceArg);
[RaisesException] void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optional TestCallbackInterface optionalTestCallbackInterfaceArg);
[RaisesException] TestInterfaceEmpty raisesExceptionTestInterfaceEmptyVoidMethod();
+ [RaisesException] XPathNSResolver raisesExceptionXPathNSResolverVoidMethod();
[CallWith=ExecutionContext, RaisesException] void callWithExecutionContextRaisesExceptionVoidMethodLongArg(long longArg);
[RuntimeEnabled=FeatureName] void runtimeEnabledVoidMethod();
[PerWorldBindings, RuntimeEnabled=FeatureName] void perWorldBindingsRuntimeEnabledVoidMethod();
[RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(DOMString stringArg);
[RuntimeEnabled=FeatureName] void runtimeEnabledOverloadedVoidMethod(long longArg);
[RuntimeEnabled=FeatureName1] void partiallyRuntimeEnabledOverloadedVoidMethod(DOMString stringArg);
- [RuntimeEnabled=FeatureName2] void partiallyRuntimeEnabledOverloadedVoidMethod(TestInterface testInterface);
- void partiallyRuntimeEnabledOverloadedVoidMethod(long longArg);
+ [RuntimeEnabled=FeatureName2] void partiallyRuntimeEnabledOverloadedVoidMethod(TestInterface testInterfaceArg);
+ void partiallyRuntimeEnabledOverloadedVoidMethod(long longArg, DOMString stringArg);
+ [RuntimeEnabled=FeatureName3] void partiallyRuntimeEnabledOverloadedVoidMethod(long longArg, DOMString stringArg, TestInterface testInterfaceArg);
[TreatReturnedNullStringAs=Null] DOMString treatReturnedNullStringAsNullStringMethod();
[TreatReturnedNullStringAs=Undefined] DOMString treatReturnedNullStringAsUndefinedStringMethod();
[TreatReturnedNullStringAs=Null] ByteString treatReturnedNullStringAsNullByteStringMethod();
[TreatReturnedNullStringAs=Undefined] ByteString treatReturnedNullStringAsUndefinedByteStringMethod();
- [TreatReturnedNullStringAs=Null] ScalarValueString treatReturnedNullStringAsNullScalarValueStringMethod();
- [TreatReturnedNullStringAs=Undefined] ScalarValueString treatReturnedNullStringAsUndefinedScalarValueStringMethod();
+ [TreatReturnedNullStringAs=Null] USVString treatReturnedNullStringAsNullUSVStringMethod();
+ [TreatReturnedNullStringAs=Undefined] USVString treatReturnedNullStringAsUndefinedUSVStringMethod();
[TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
[TypeChecking=Interface] void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg(TestInterfaceEmpty... testInterfaceEmptyArg);
- [TypeChecking=Unrestricted] void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(float floatArg, double doubleArg);
+ // Avoid redundant type checking
+ [TypeChecking=Interface] void useToImpl4ArgumentsCheckingIfPossibleWithOptionalArg(Node node1, optional Node node2);
+ [TypeChecking=Interface] void useToImpl4ArgumentsCheckingIfPossibleWithNullableArg(Node node1, Node? node2);
+ [TypeChecking=Interface] void useToImpl4ArgumentsCheckingIfPossibleWithUndefinedArg(Node node1, [Default=Undefined] optional Node node2);
+ void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(float floatArg, double doubleArg);
[Unforgeable] void unforgeableVoidMethod();
void voidMethodTestInterfaceGarbageCollectedSequenceArg(sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceArg);
void voidMethodTestInterfaceGarbageCollectedArrayArg(TestInterfaceGarbageCollected[] testInterfaceGarbageCollectedArrayArg);
void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(sequence<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeGarbageCollectedSequenceArg);
void voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] testInterfaceWillBeGarbageCollectedArrayArg);
+ [NewObject] TestInterface newObjectTestInterfaceMethod();
+
+ serializer DOMString serializerMethod();
// Extended attributes on referenced interfaces
// (not self; self-reference tests at interface themselves)
@@ -552,4 +612,6 @@
[ImplementedInPrivateScript, OnlyExposedToPrivateScript] short methodForPrivateScriptOnly(short value1, short value2);
[ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString attributeForPrivateScriptOnly;
[ImplementedInPrivateScript] attribute TestEnum enumForPrivateScript;
+
+ maplike<long, DOMStringOrDouble>;
};
diff --git a/bindings/tests/idls/core/TestPartialInterface2.idl b/bindings/tests/idls/core/TestPartialInterface2.idl
index 43abced..4bb8686 100644
--- a/bindings/tests/idls/core/TestPartialInterface2.idl
+++ b/bindings/tests/idls/core/TestPartialInterface2.idl
@@ -30,7 +30,6 @@
[
ImplementedAs=TestPartialInterfaceImplementation, // Conflicts with default partial interface class name
- PerContextEnabled=PartialContextName, // Conflicts with [RuntimeEnabled]
] partial interface TestInterface {
const unsigned short PARTIAL2_UNSIGNED_SHORT = 0;
diff --git a/bindings/tests/idls/core/TestPartialInterface4.idl b/bindings/tests/idls/core/TestPartialInterface4.idl
new file mode 100644
index 0000000..fcdbd80
--- /dev/null
+++ b/bindings/tests/idls/core/TestPartialInterface4.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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.
+
+[
+ Conditional=FOO,
+ TypeChecking=Interface,
+] partial interface TestInterface3 {
+ [Conditional=BAR] static void voidMethodDocument(Document document, double d);
+};
diff --git a/bindings/tests/idls/core/TestPermissiveDictionary.idl b/bindings/tests/idls/core/TestPermissiveDictionary.idl
new file mode 100644
index 0000000..c4a1f50
--- /dev/null
+++ b/bindings/tests/idls/core/TestPermissiveDictionary.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.
+
+// This dictionary only exists to test the "permissive" dictionary
+// conversion code path. In this code path, if a non-object type is
+// seen as input while converting to the dictionary type, it is
+// treated similarly to undefined or null, instead of throwing a
+// TypeError.
+
+[PermissiveDictionaryConversion]
+dictionary TestPermissiveDictionary {
+ boolean booleanMember;
+};
diff --git a/bindings/tests/idls/core/Uint8ClampedArray.idl b/bindings/tests/idls/core/Uint8ClampedArray.idl
new file mode 100644
index 0000000..13f411c
--- /dev/null
+++ b/bindings/tests/idls/core/Uint8ClampedArray.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=TestUint8ClampedArray,
+] interface Uint8ClampedArray : ArrayBufferView {
+};
diff --git a/bindings/tests/idls/modules/TestInterface5.idl b/bindings/tests/idls/modules/TestInterface5.idl
index 72e8535..d08b7cb 100644
--- a/bindings/tests/idls/modules/TestInterface5.idl
+++ b/bindings/tests/idls/modules/TestInterface5.idl
@@ -31,16 +31,17 @@
// Test for interface extended attributes and special operations.
// Also used as a target by TestObject
+enum TestEnumModules { "EnumModulesValue1", "EnumModulesValue2" };
+
[
ActiveDOMObject,
Conditional=CONDITION,
- Custom=(LegacyCallAsFunction,ToV8),
+ Custom=LegacyCallAsFunction,
DoNotCheckConstants,
ImplementedAs=TestInterface5Implementation,
- Iterable,
RuntimeEnabled=FeatureName,
SetWrapperReferenceTo(TestInterface5 referencedName),
- TypeChecking=(Interface,Unrestricted),
+ TypeChecking=Interface,
Exposed=(Worker,Window),
] interface TestInterface5 : TestInterfaceEmpty {
// members needed to test [ImplementedAs], as this affect attribute
@@ -88,5 +89,11 @@
[Exposed=Window] attribute long windowExposedAttribute;
[Exposed=(Window,ServiceWorker)] void windowAndServiceWorkerExposedMethod();
+
+ // Union types
+ void voidMethodBooleanOrDOMStringArg((boolean or DOMString) arg);
+ void voidMethodDoubleOrDOMStringArg((double or DOMString) arg);
+
+ iterable<any>;
};
diff --git a/bindings/tests/idls/modules/TestPartialInterface3.idl b/bindings/tests/idls/modules/TestPartialInterface3.idl
index d09f7bd..353454e 100644
--- a/bindings/tests/idls/modules/TestPartialInterface3.idl
+++ b/bindings/tests/idls/modules/TestPartialInterface3.idl
@@ -30,16 +30,19 @@
[
ImplementedAs=TestPartialInterfaceImplementation3,
- PerContextEnabled=PartialContextName3,
] partial interface TestInterface {
const unsigned short PARTIAL3_UNSIGNED_SHORT = 0;
- attribute long partial3LongAttribute;
- static attribute long partial3StaticLongAttribute;
-
void voidMethodPartialOverload(DOMString value);
- static void voidMethodPartialOverload(DOMString value);
+ static void staticVoidMethodPartialOverload(DOMString value);
+
+ Promise promiseMethodPartialOverload(Document document);
+ static Promise staticPromiseMethodPartialOverload(DOMString value);
void partial2VoidMethod(DOMString value);
+ void partial2VoidMethod(Node node);
+ void partialVoidTestEnumModulesArgMethod(TestEnumModules arg);
static void partial2StaticVoidMethod(DOMString value);
+
+ [Unscopeable] void unscopeableVoidMethod();
};
diff --git a/core/README b/core/README
index 418d1e5..630832e 100644
--- a/core/README
+++ b/core/README
@@ -5,5 +5,5 @@
using the script: $DART_ROOT/sdk/lib/html/scripts/idlsync.py
The current version corresponds to:
-URL: http://src.chromium.org/blink/branches/dart/dartium
-Current revision: 190578
+URL: https://src.chromium.org/blink/branches/dart/2454_1
+Current revision: 202759
diff --git a/core/animation/Animation.idl b/core/animation/Animation.idl
index 02b98bf..76ef6bb 100644
--- a/core/animation/Animation.idl
+++ b/core/animation/Animation.idl
@@ -28,14 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/fxtf/web-animations/#idl-def-Animation
+// https://w3c.github.io/web-animations/#animation
+
+enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
[
- // FIXME: should be optional union type http://crbug.com/240176
- Constructor(Element? target, sequence<Dictionary> keyframes),
- Constructor(Element? target, sequence<Dictionary> keyframes, double timingInput),
- Constructor(Element? target, sequence<Dictionary> keyframes, Dictionary timingInput),
- RaisesException=Constructor,
- RuntimeEnabled=WebAnimationsAPI,
-] interface Animation : AnimationNode {
+ ActiveDOMObject,
+ NoInterfaceObject,
+] interface Animation : EventTarget {
+ // TODO(dstockwell): Add timeline property.
+ [RuntimeEnabled=WebAnimationsAPI] attribute AnimationEffectReadOnly? effect;
+ [Measure] attribute double? startTime;
+ [Measure] attribute double? currentTime;
+ [Measure] attribute double playbackRate;
+ [Measure] readonly attribute AnimationPlayState playState;
+ [Measure, RaisesException] void finish();
+ [Measure] void play();
+ [Measure] void pause();
+ [Measure] void reverse();
+ [RuntimeEnabled=WebAnimationsAPI] attribute double startClip;
+ [RuntimeEnabled=WebAnimationsAPI] attribute double endClip;
+
+ [Measure] void cancel();
+ [Measure] attribute EventHandler onfinish;
+ [RuntimeEnabled=WebAnimationsAPI, CallWith=ScriptState] readonly attribute Promise<Animation> finished;
+ [RuntimeEnabled=WebAnimationsAPI, CallWith=ScriptState] readonly attribute Promise<Animation> ready;
};
diff --git a/modules/performance/WorkerGlobalScopePerformance.idl b/core/animation/AnimationEffectReadOnly.idl
similarity index 81%
copy from modules/performance/WorkerGlobalScopePerformance.idl
copy to core/animation/AnimationEffectReadOnly.idl
index 559003a..06540d1 100644
--- a/modules/performance/WorkerGlobalScopePerformance.idl
+++ b/core/animation/AnimationEffectReadOnly.idl
@@ -28,6 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface WorkerGlobalScope {
- readonly attribute WorkerPerformance performance;
+// https://w3c.github.io/web-animations/#the-animationeffectreadonly-interface
+
+[
+ RuntimeEnabled=WebAnimationsAPI,
+ WillBeGarbageCollected,
+ ImplementedAs=AnimationEffect,
+] interface AnimationEffectReadOnly {
+ readonly attribute AnimationEffectTiming timing;
+ readonly attribute ComputedTimingProperties computedTiming;
};
diff --git a/core/animation/AnimationEffectTiming.idl b/core/animation/AnimationEffectTiming.idl
new file mode 100644
index 0000000..59a395e
--- /dev/null
+++ b/core/animation/AnimationEffectTiming.idl
@@ -0,0 +1,22 @@
+// 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://w3c.github.io/web-animations/#the-animationeffecttiming-interface
+// TODO(dstockwell): Should extend AnimationEffectTimingReadOnly
+
+[
+ RuntimeEnabled=WebAnimationsAPI,
+ WillBeGarbageCollected,
+] interface AnimationEffectTiming {
+ attribute double delay;
+ attribute double endDelay;
+ attribute DOMString fill;
+ attribute double iterationStart;
+ attribute unrestricted double iterations;
+ attribute (unrestricted double or DOMString) duration;
+ // TODO(dstockwell): playbackRate has been removed from level 1.
+ attribute double playbackRate;
+ attribute DOMString direction;
+ attribute DOMString easing;
+};
diff --git a/core/animation/AnimationPlayer.idl b/core/animation/AnimationPlayer.idl
deleted file mode 100644
index 45720a4..0000000
--- a/core/animation/AnimationPlayer.idl
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
-
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
- ActiveDOMObject,
-] interface AnimationPlayer : EventTarget {
- [RuntimeEnabled=WebAnimationsAPI] attribute AnimationNode? source;
- [RuntimeEnabled=WebAnimationsPlaybackControl] attribute double? startTime;
- [RuntimeEnabled=WebAnimationsPlaybackControl] attribute double? currentTime;
- [RuntimeEnabled=WebAnimationsPlaybackControl] attribute double playbackRate;
- [RuntimeEnabled=WebAnimationsPlaybackControl, MeasureAs=AnimationPlayerGetPlayState] readonly attribute AnimationPlayState playState;
- [RuntimeEnabled=WebAnimationsPlaybackControl, MeasureAs=AnimationPlayerFinish, RaisesException] void finish();
- [RuntimeEnabled=WebAnimationsPlaybackControl, MeasureAs=AnimationPlayerPlay] void play();
- [RuntimeEnabled=WebAnimationsPlaybackControl, MeasureAs=AnimationPlayerPause] void pause();
- [RuntimeEnabled=WebAnimationsPlaybackControl, MeasureAs=AnimationPlayerReverse] void reverse();
-
- void cancel();
- [MeasureAs=AnimationPlayerFinishEvent] attribute EventHandler onfinish;
-};
diff --git a/core/animation/AnimationTimeline.idl b/core/animation/AnimationTimeline.idl
index 31b1648..81f4238 100644
--- a/core/animation/AnimationTimeline.idl
+++ b/core/animation/AnimationTimeline.idl
@@ -2,11 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://www.w3.org/TR/web-animations/#the-animationtimeline-interface
+
+// TODO(dstockwell): This interface has several changes in the latest spec:
+// https://w3c.github.io/web-animations/#the-animationtimeline-interface
+
[
RuntimeEnabled=WebAnimationsAPI,
WillBeGarbageCollected,
] interface AnimationTimeline {
- readonly attribute double? currentTime;
- AnimationPlayer play(AnimationNode source);
- sequence<AnimationPlayer> getAnimationPlayers();
+ attribute double? currentTime;
+ attribute double playbackRate;
+ Animation play(AnimationEffectReadOnly source);
+ sequence<Animation> getAnimations();
};
diff --git a/core/animation/ComputedTimingProperties.idl b/core/animation/ComputedTimingProperties.idl
new file mode 100644
index 0000000..71e0530
--- /dev/null
+++ b/core/animation/ComputedTimingProperties.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.
+
+// https://w3c.github.io/web-animations/#the-computedtimingproperties-dictionary
+
+dictionary ComputedTimingProperties : KeyframeEffectOptions {
+ // TODO(dstockwell): There is no startTime member in the spec.
+ double startTime;
+ unrestricted double endTime;
+ unrestricted double activeDuration;
+ double? localTime;
+ // TODO(dstockwell): The timeFraction and currentIteration members should
+ // both be of type unrestricted double? (nullable).
+ unrestricted double timeFraction;
+ unsigned long? currentIteration;
+};
diff --git a/core/animation/DocumentAnimation.idl b/core/animation/DocumentAnimation.idl
index d2c2861..7e02888 100644
--- a/core/animation/DocumentAnimation.idl
+++ b/core/animation/DocumentAnimation.idl
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://w3c.github.io/web-animations/#extensions-to-the-document-interface
+
[
RuntimeEnabled=WebAnimationsAPI,
] partial interface Document {
+ // TODO(dstockwell): This should be a DocumentTimeline.
readonly attribute AnimationTimeline timeline;
};
diff --git a/core/animation/EffectModel.idl b/core/animation/EffectModel.idl
new file mode 100644
index 0000000..38c7185
--- /dev/null
+++ b/core/animation/EffectModel.idl
@@ -0,0 +1,15 @@
+// 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.w3.org/TR/web-animations/#the-animationeffect-interface
+
+// TODO(dstockwell): This interface has been removed in the latest spec:
+// https://w3c.github.io/web-animations/
+
+[
+ RuntimeEnabled=WebAnimationsAPI,
+ NoInterfaceObject,
+ WillBeGarbageCollected
+] interface EffectModel {
+};
diff --git a/core/animation/ElementAnimation.idl b/core/animation/ElementAnimation.idl
index ccfbca7..7129e4d 100644
--- a/core/animation/ElementAnimation.idl
+++ b/core/animation/ElementAnimation.idl
@@ -28,13 +28,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/web-animations/#idl-def-Element
-// FIXME: move to Animatable
-// http://dev.w3.org/fxtf/web-animations/#idl-def-Animatable
+// http://www.w3.org/TR/web-animations/#the-animatable-interface
+// http://www.w3.org/TR/web-animations/#extensions-to-the-element-interface
+
+// TODO(dstockwell): This should be an Animatable interface, where Element
+// implements Animatable. The interface also has several changes:
+// https://w3c.github.io/web-animations/#the-animatable-interface
partial interface Element {
- // 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();
+ // FIXME: Union types with dictionary type members doesn't work (yet).
+ // Animation animate((EffectModel or sequence<Dictionary>)? effect, optional (double or KeyframeEffectOptions) timing);
+ [Measure, RaisesException] Animation animate((EffectModel or sequence<Dictionary>)? effect, optional double timing);
+ [Measure, RaisesException] Animation animate((EffectModel or sequence<Dictionary>)? effect, KeyframeEffectOptions timing);
+ [RuntimeEnabled=WebAnimationsAPI] sequence<Animation> getAnimations();
};
diff --git a/core/animation/AnimationNode.idl b/core/animation/KeyframeEffect.idl
similarity index 75%
rename from core/animation/AnimationNode.idl
rename to core/animation/KeyframeEffect.idl
index c04ede6..0235507 100644
--- a/core/animation/AnimationNode.idl
+++ b/core/animation/KeyframeEffect.idl
@@ -28,20 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/web-animations/#the-keyframeeffect-interfaces
+
[
+ // TODO(dstockwell): the third argument should be "optional (unrestricted double or KeyframeEffectOptions) timing".
+ Constructor(Element? target, sequence<Dictionary> keyframes, optional unrestricted double timing),
+ Constructor(Element? target, sequence<Dictionary> keyframes, KeyframeEffectOptions timing),
+ RaisesException=Constructor,
RuntimeEnabled=WebAnimationsAPI,
- WillBeGarbageCollected,
-] interface AnimationNode {
- // Playback state
- readonly attribute double? localTime;
- readonly attribute unsigned long? currentIteration;
-
- // Calculated timing
- readonly attribute double startTime;
- readonly attribute double duration;
- readonly attribute double activeDuration;
- readonly attribute double endTime;
-
- readonly attribute Timing timing;
- readonly attribute AnimationPlayer? player;
+ TypeChecking=Interface,
+] interface KeyframeEffect : AnimationEffectReadOnly {
};
diff --git a/core/animation/KeyframeEffectOptions.idl b/core/animation/KeyframeEffectOptions.idl
new file mode 100644
index 0000000..9585948
--- /dev/null
+++ b/core/animation/KeyframeEffectOptions.idl
@@ -0,0 +1,21 @@
+// Copyright 2015 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://w3c.github.io/web-animations/#the-animationeffecttimingproperties-dictionary
+
+// TODO(dstockwell): Rename this to AnimationEffectTimingProperties.
+dictionary KeyframeEffectOptions {
+ double delay = 0;
+ double endDelay = 0;
+ // TODO(dstockwell): The fill type should be FillMode.
+ DOMString fill = "auto";
+ double iterationStart = 0.0;
+ unrestricted double iterations = 1.0;
+ (unrestricted double or DOMString) duration = "auto";
+ // TODO(dstockwell): There is no playbackRate member in the spec.
+ double playbackRate = 1.0;
+ // TODO(dstockwell): The direction type should be PlaybackDirection.
+ DOMString direction = "normal";
+ DOMString easing = "linear";
+};
diff --git a/core/animation/Timing.idl b/core/animation/Timing.idl
deleted file mode 100644
index 1bb3198..0000000
--- a/core/animation/Timing.idl
+++ /dev/null
@@ -1,29 +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.
-
-[
- RuntimeEnabled=WebAnimationsAPI,
- ImplementedAs=AnimationNodeTiming,
- WillBeGarbageCollected,
-] interface Timing {
- attribute double delay;
- attribute double endDelay;
- attribute DOMString fill;
- attribute double iterationStart;
- attribute double iterations;
-
- // FIXME: This uses a NamedPropertyGetter to implement the 'duration' attribute
- // because duration has a union type (which is tricky to do with an attribute).
- // Fix will be in a follow-up patch if there is a better solution.
- [NotEnumerable, ImplementedAs=getDuration] getter (double or DOMString) (DOMString name);
-
- // 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, ImplementedAs=setDuration] setter double (DOMString name, double duration);
-
- attribute double playbackRate;
- attribute DOMString direction;
- attribute DOMString easing;
-};
diff --git a/core/clipboard/DataTransfer.idl b/core/clipboard/DataTransfer.idl
index 5448d01..3b5e1b4 100644
--- a/core/clipboard/DataTransfer.idl
+++ b/core/clipboard/DataTransfer.idl
@@ -26,19 +26,22 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- WillBeGarbageCollected
-] interface DataTransfer {
- [TreatReturnedNullStringAs=Undefined] attribute DOMString dropEffect;
- [TreatReturnedNullStringAs=Undefined] attribute DOMString effectAllowed;
- readonly attribute DOMString[] types;
- readonly attribute FileList files;
+// https://html.spec.whatwg.org/#the-datatransfer-interface
- void clearData(optional DOMString type);
- DOMString getData(DOMString type);
- void setData(DOMString type, DOMString data);
+[
+ GarbageCollected
+] interface DataTransfer {
+ attribute DOMString dropEffect;
+ attribute DOMString effectAllowed;
+
+ [SameObject] readonly attribute DataTransferItemList items;
+
[RaisesException] void setDragImage(Element image, long x, long y);
- readonly attribute DataTransferItemList items;
+ /* old interface */
+ [SameObject] readonly attribute DOMString[] types;
+ DOMString getData(DOMString format);
+ void setData(DOMString format, DOMString data);
+ void clearData(optional DOMString format);
+ [SameObject] readonly attribute FileList files;
};
-
diff --git a/core/clipboard/DataTransferItem.idl b/core/clipboard/DataTransferItem.idl
index 32e6904..1328c6e 100644
--- a/core/clipboard/DataTransferItem.idl
+++ b/core/clipboard/DataTransferItem.idl
@@ -28,14 +28,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-datatransferitem-interface
+
[
- WillBeGarbageCollected,
- NoInterfaceObject
+ GarbageCollected,
] interface DataTransferItem {
readonly attribute DOMString kind;
readonly attribute DOMString type;
-
+ // TODO(philipj): The callback argument should be a FunctionStringCallback.
[CallWith=ExecutionContext] void getAsString(StringCallback? callback);
- Blob getAsFile();
+ // TODO(philipj): getAsFile() should return a File object. crbug.com/361145
+ Blob? getAsFile();
};
-
diff --git a/core/clipboard/DataTransferItemList.idl b/core/clipboard/DataTransferItemList.idl
index 7bdf22c..4349174 100644
--- a/core/clipboard/DataTransferItemList.idl
+++ b/core/clipboard/DataTransferItemList.idl
@@ -28,17 +28,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#datatransferitemlist
+// https://html.spec.whatwg.org/#the-datatransferitemlist-interface
[
TypeChecking=Interface,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface DataTransferItemList {
- readonly attribute long length;
+ readonly attribute unsigned long length;
[ImplementedAs=item] getter DataTransferItem (unsigned long index);
-
- [RaisesException] DataTransferItem add(DOMString data, DOMString type);
- DataTransferItem add(File? file);
+ [RaisesException] DataTransferItem? add(DOMString data, DOMString type);
+ // TODO(philipj): The file argument should not be nullable.
+ DataTransferItem? add(File? file);
[RaisesException, ImplementedAs=deleteItem] void remove(unsigned long index);
void clear();
};
diff --git a/core/css/CSS.idl b/core/css/CSS.idl
index 36fe6da..7e5e2e0 100644
--- a/core/css/CSS.idl
+++ b/core/css/CSS.idl
@@ -27,11 +27,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/csswg/css-conditional/#the-css-interface
+
[
- NoInterfaceObject,
ImplementedAs=DOMWindowCSS,
WillBeGarbageCollected
] interface CSS {
- boolean supports(DOMString property, DOMString value);
- boolean supports(DOMString conditionText);
+ static boolean supports(DOMString property, DOMString value);
+ static boolean supports(DOMString conditionText);
};
diff --git a/core/css/CSSCharsetRule.idl b/core/css/CSSCharsetRule.idl
deleted file mode 100644
index 1635a71..0000000
--- a/core/css/CSSCharsetRule.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-interface CSSCharsetRule : CSSRule {
- [MeasureAs=CSSCharsetRuleEncoding] attribute DOMString encoding;
-};
diff --git a/core/css/CSSFontFaceRule.idl b/core/css/CSSFontFaceRule.idl
index f13497c..6d2ece7 100644
--- a/core/css/CSSFontFaceRule.idl
+++ b/core/css/CSSFontFaceRule.idl
@@ -18,8 +18,14 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// The CSSFontFaceRule interface was introduced in DOM Level 2 Style, but has
+// been replaced by an entirely different interface in CSS Fonts:
+// http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSFontFaceRule
+// http://dev.w3.org/csswg/css-fonts/#om-fontface
+//
+// The interface from DOM Level 2 Style is implemented here.
+// TODO(philipj): Implement the interface from CSS Fonts.
+
interface CSSFontFaceRule : CSSRule {
readonly attribute CSSStyleDeclaration style;
};
-
diff --git a/core/css/CSSGroupingRule.idl b/core/css/CSSGroupingRule.idl
new file mode 100644
index 0000000..c6dbf4e
--- /dev/null
+++ b/core/css/CSSGroupingRule.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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://dev.w3.org/csswg/cssom/#the-cssgroupingrule-interface
+
+interface CSSGroupingRule : CSSRule {
+ [SameObject] readonly attribute CSSRuleList cssRules;
+ [RaisesException] unsigned long insertRule(DOMString rule, unsigned long index);
+ [RaisesException] void deleteRule(unsigned long index);
+};
diff --git a/core/css/CSSImportRule.idl b/core/css/CSSImportRule.idl
index f56ef9f..e845ca2 100644
--- a/core/css/CSSImportRule.idl
+++ b/core/css/CSSImportRule.idl
@@ -18,10 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
-interface CSSImportRule : CSSRule {
- readonly attribute DOMString? href;
- readonly attribute MediaList media;
- readonly attribute CSSStyleSheet styleSheet;
-};
+// http://dev.w3.org/csswg/cssom/#the-cssimportrule-interface
+interface CSSImportRule : CSSRule {
+ readonly attribute DOMString href;
+ // TODO(philipj): media should have [PutForwards=mediaText].
+ [SameObject] readonly attribute MediaList media;
+ [SameObject] readonly attribute CSSStyleSheet styleSheet;
+};
diff --git a/core/css/CSSKeyframeRule.idl b/core/css/CSSKeyframeRule.idl
index 671d243..739a2e1 100644
--- a/core/css/CSSKeyframeRule.idl
+++ b/core/css/CSSKeyframeRule.idl
@@ -26,11 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Introduced in DOM Level ?:
+// http://dev.w3.org/csswg/css-animations/#interface-csskeyframerule
+
interface CSSKeyframeRule : CSSRule {
-
- attribute DOMString keyText;
+ [RaisesException=Setter] attribute DOMString keyText;
readonly attribute CSSStyleDeclaration style;
-
};
-
diff --git a/core/css/CSSKeyframesRule.idl b/core/css/CSSKeyframesRule.idl
index d85f8d1..709f133 100644
--- a/core/css/CSSKeyframesRule.idl
+++ b/core/css/CSSKeyframesRule.idl
@@ -26,13 +26,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Introduced in DOM Level ?:
+// http://dev.w3.org/csswg/css-animations/#interface-csskeyframesrule
+
interface CSSKeyframesRule : CSSRule {
attribute DOMString name;
readonly attribute CSSRuleList cssRules;
- [ImplementedAs=item, NotEnumerable] getter CSSKeyframeRule (unsigned long index);
- void insertRule([Default=Undefined] optional DOMString rule);
- void deleteRule([Default=Undefined] optional DOMString key);
- CSSKeyframeRule findRule([Default=Undefined] optional DOMString key);
+ void appendRule(DOMString rule);
+ void deleteRule(DOMString select);
+ CSSKeyframeRule? findRule(DOMString select);
+
+ // Non-standard APIs
+ [NotEnumerable] getter CSSKeyframeRule (unsigned long index);
};
diff --git a/core/css/CSSMediaRule.idl b/core/css/CSSMediaRule.idl
index 0f1d76d..1e6c85a 100644
--- a/core/css/CSSMediaRule.idl
+++ b/core/css/CSSMediaRule.idl
@@ -18,12 +18,9 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
-interface CSSMediaRule : CSSRule {
- readonly attribute MediaList media;
- readonly attribute CSSRuleList cssRules;
+// http://dev.w3.org/csswg/cssom/#the-cssmediarule-interface
- [RaisesException] unsigned long insertRule(DOMString rule, unsigned long index);
- [RaisesException] void deleteRule(unsigned long index);
+interface CSSMediaRule : CSSGroupingRule {
+ // TODO(philipj): media should have [PutForwards=mediaText].
+ [SameObject] readonly attribute MediaList media;
};
-
diff --git a/core/css/CSSPageRule.idl b/core/css/CSSPageRule.idl
index 3c64d3b..5e04b6c 100644
--- a/core/css/CSSPageRule.idl
+++ b/core/css/CSSPageRule.idl
@@ -18,8 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-csspagerule-interface
+
+// TODO(philipj): CSSPageRule should inherit from CSSGroupingRule.
+// crbug.com/496381. To internally implement this as grouping rule,
+// margin at-rules should be implemented crbug.com/320370, since the
+// spec http://dev.w3.org/csswg/css-page/#at-page-rule allows only
+// margin at-rules inside @page.
interface CSSPageRule : CSSRule {
attribute DOMString selectorText;
- readonly attribute CSSStyleDeclaration style;
+ // TODO(philipj): style should have [PutForwards=cssText].
+ [SameObject] readonly attribute CSSStyleDeclaration style;
};
diff --git a/core/css/CSSPrimitiveValue.idl b/core/css/CSSPrimitiveValue.idl
deleted file mode 100644
index 06904da..0000000
--- a/core/css/CSSPrimitiveValue.idl
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
-] interface CSSPrimitiveValue : CSSValue {
-
- // UnitTypes
- const unsigned short CSS_UNKNOWN = 0;
- const unsigned short CSS_NUMBER = 1;
- const unsigned short CSS_PERCENTAGE = 2;
- const unsigned short CSS_EMS = 3;
- const unsigned short CSS_EXS = 4;
- const unsigned short CSS_PX = 5;
- const unsigned short CSS_CM = 6;
- const unsigned short CSS_MM = 7;
- const unsigned short CSS_IN = 8;
- const unsigned short CSS_PT = 9;
- const unsigned short CSS_PC = 10;
- const unsigned short CSS_DEG = 11;
- const unsigned short CSS_RAD = 12;
- const unsigned short CSS_GRAD = 13;
- const unsigned short CSS_MS = 14;
- const unsigned short CSS_S = 15;
- const unsigned short CSS_HZ = 16;
- const unsigned short CSS_KHZ = 17;
- const unsigned short CSS_DIMENSION = 18;
- const unsigned short CSS_STRING = 19;
- const unsigned short CSS_URI = 20;
- const unsigned short CSS_IDENT = 21;
- const unsigned short CSS_ATTR = 22;
- const unsigned short CSS_COUNTER = 23;
- const unsigned short CSS_RECT = 24;
- const unsigned short CSS_RGBCOLOR = 25;
- const unsigned short CSS_VW = 26;
- const unsigned short CSS_VH = 27;
- const unsigned short CSS_VMIN = 28;
- const unsigned short CSS_VMAX = 29;
-
- readonly attribute unsigned short primitiveType;
-
- [RaisesException] void setFloatValue([Default=Undefined] optional unsigned short unitType,
- [Default=Undefined] optional float floatValue);
- [RaisesException] float getFloatValue([Default=Undefined] optional unsigned short unitType);
- [RaisesException] void setStringValue([Default=Undefined] optional unsigned short stringType,
- [Default=Undefined] optional DOMString stringValue);
- [RaisesException] DOMString getStringValue();
- [RaisesException] Counter getCounterValue();
- [RaisesException] Rect getRectValue();
- [RaisesException] RGBColor getRGBColorValue();
-};
-
diff --git a/core/css/CSSRule.idl b/core/css/CSSRule.idl
index a708af4..894ef34 100644
--- a/core/css/CSSRule.idl
+++ b/core/css/CSSRule.idl
@@ -18,35 +18,41 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-cssrule-interface
+
[
- Custom=Wrap,
DependentLifetime,
- NotScriptWrappable,
WillBeGarbageCollected,
] interface CSSRule {
-
- // RuleType
- const unsigned short UNKNOWN_RULE = 0;
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;
const unsigned short IMPORT_RULE = 3;
const unsigned short MEDIA_RULE = 4;
const unsigned short FONT_FACE_RULE = 5;
const unsigned short PAGE_RULE = 6;
+ // TODO(philipj): Implement CSSMarginRule.
+ // const unsigned short MARGIN_RULE = 9;
+ // TODO(philipj): Implement CSSNamespaceRule. crbug.com/389549
+ // const unsigned short NAMESPACE_RULE = 10;
+ readonly attribute unsigned short type;
+ attribute DOMString cssText;
+ readonly attribute CSSRule? parentRule;
+ readonly attribute CSSStyleSheet? parentStyleSheet;
+
+ // CSS Animations
+ // http://dev.w3.org/csswg/css-animations/#interface-cssrule
const unsigned short KEYFRAMES_RULE = 7;
- const unsigned short WEBKIT_KEYFRAMES_RULE = 7;
const unsigned short KEYFRAME_RULE = 8;
- const unsigned short WEBKIT_KEYFRAME_RULE = 8;
+
+ // CSS Conditional Rules
+ // http://dev.w3.org/csswg/css-conditional/#extentions-to-cssrule-interface
const unsigned short SUPPORTS_RULE = 12;
+
+ // CSS Device Adaptation
+ // http://dev.w3.org/csswg/css-device-adapt/#css-rule-interface
[RuntimeEnabled=CSSViewport] const unsigned short VIEWPORT_RULE = 15;
- const unsigned short WEBKIT_FILTER_RULE = 17;
- readonly attribute unsigned short type;
-
- attribute DOMString cssText;
-
- readonly attribute CSSStyleSheet parentStyleSheet;
- readonly attribute CSSRule parentRule;
-
+ // Non-standard APIs
+ const unsigned short WEBKIT_KEYFRAMES_RULE = 7;
+ const unsigned short WEBKIT_KEYFRAME_RULE = 8;
};
diff --git a/core/css/CSSRuleList.idl b/core/css/CSSRuleList.idl
index 35fb400..ffb548c 100644
--- a/core/css/CSSRuleList.idl
+++ b/core/css/CSSRuleList.idl
@@ -23,12 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-cssrulelist-interface
+
+// TODO(philipj): CSSRuleList should be an [ArrayClass].
[
DependentLifetime,
WillBeGarbageCollected,
] interface CSSRuleList {
- readonly attribute unsigned long length;
- getter CSSRule item(unsigned long index);
+ [Measure] getter CSSRule? item(unsigned long index);
+ readonly attribute unsigned long length;
};
-
diff --git a/core/css/CSSStyleDeclaration.idl b/core/css/CSSStyleDeclaration.idl
index 1e7803a..24fdfbb 100644
--- a/core/css/CSSStyleDeclaration.idl
+++ b/core/css/CSSStyleDeclaration.idl
@@ -18,29 +18,32 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
+
[
DependentLifetime,
WillBeGarbageCollected
] interface CSSStyleDeclaration {
- [RaisesException=Setter] attribute DOMString? cssText;
+ // TODO(philipj): cssText should not be nullable.
+ [RaisesException=Setter] attribute DOMString? cssText;
+ readonly attribute unsigned long length;
+ getter DOMString item(unsigned long index);
+ // TODO(philipj): All DOMString? return types in this interface should be
+ // just DOMString (not nullable).
+ DOMString? getPropertyValue(DOMString property);
+ DOMString? getPropertyPriority(DOMString property);
+ // TODO(philipj): The value and priority arguments should have
+ // [TreatNullAs=EmptyString] and should not be nullable.
+ [RaisesException] void setProperty(DOMString property, DOMString? value, optional DOMString? priority = null);
+ // void setPropertyValue(DOMString property, [TreatNullAs=EmptyString] DOMString value);
+ // void setPropertyPriority(DOMString property, [TreatNullAs=EmptyString] DOMString priority);
+ [RaisesException] DOMString? removeProperty(DOMString property);
+ readonly attribute CSSRule? parentRule;
+ // [TreatNullAs=EmptyString] attribute DOMString cssFloat;
- 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);
+ // The camel-cased and dashed attribute getters have custom bindings.
+ // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-camel-cased-attribute
+ // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-dashed-attribute
[Custom=(PropertyGetter,PropertyEnumerator,PropertyQuery)] getter (DOMString or float) (DOMString name);
- [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
- // FIXME: This should be DeprecateAs=, but currently too many LayoutTests use
- // this function and would need CONSOLE: message rebaselines!
- [MeasureAs=CSSStyleDeclarationGetPropertyCSSValue] CSSValue getPropertyCSSValue([Default=Undefined] optional DOMString propertyName);
+ [Custom] setter void (DOMString property, DOMString? propertyValue);
};
-
diff --git a/core/css/CSSStyleRule.idl b/core/css/CSSStyleRule.idl
index b5c890f..c1b2908 100644
--- a/core/css/CSSStyleRule.idl
+++ b/core/css/CSSStyleRule.idl
@@ -18,8 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-cssstylerule-interface
+
interface CSSStyleRule : CSSRule {
attribute DOMString selectorText;
- readonly attribute CSSStyleDeclaration style;
+ // TODO(philipj): style should have [PutForwards=cssText].
+ [SameObject] readonly attribute CSSStyleDeclaration style;
};
diff --git a/core/css/CSSStyleSheet.idl b/core/css/CSSStyleSheet.idl
index 71619f3..0f9254a 100644
--- a/core/css/CSSStyleSheet.idl
+++ b/core/css/CSSStyleSheet.idl
@@ -18,21 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-cssstylesheet-interface
+
[
SetWrapperReferenceFrom=ownerNode,
] interface CSSStyleSheet : StyleSheet {
- readonly attribute CSSRule ownerRule;
- readonly attribute CSSRuleList cssRules;
-
+ readonly attribute CSSRule? ownerRule;
+ [SameObject] readonly attribute CSSRuleList cssRules;
+ // TODO(philipj): The index argument should not be optional. crbug.com/319695
[RaisesException] unsigned long insertRule(DOMString rule, optional unsigned long index);
[RaisesException] void deleteRule(unsigned long index);
- // IE Extensions
+ // Non-standard APIs
[MeasureAs=CSSStyleSheetRules] readonly attribute CSSRuleList rules;
-
- [RaisesException, MeasureAs=CSSStyleSheetAddRule] long addRule([Default=Undefined] optional DOMString selector,
- [Default=Undefined] optional DOMString style,
- optional unsigned long index);
- [RaisesException, MeasureAs=CSSStyleSheetRemoveRule] void removeRule([Default=Undefined] optional unsigned long index);
+ [MeasureAs=CSSStyleSheetAddRule, RaisesException] long addRule([Default=Undefined] optional DOMString selector, [Default=Undefined] optional DOMString style, optional unsigned long index);
+ [MeasureAs=CSSStyleSheetRemoveRule, RaisesException] void removeRule([Default=Undefined] optional unsigned long index);
};
diff --git a/core/css/CSSSupportsRule.idl b/core/css/CSSSupportsRule.idl
index b2aa0cc..d06a779 100644
--- a/core/css/CSSSupportsRule.idl
+++ b/core/css/CSSSupportsRule.idl
@@ -26,13 +26,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- NoInterfaceObject
-] interface CSSSupportsRule : CSSRule {
- readonly attribute CSSRuleList cssRules;
- readonly attribute DOMString conditionText;
+// http://dev.w3.org/csswg/css-conditional/#the-csssupportsrule-interface
- [RaisesException] unsigned long insertRule([Default=Undefined] optional DOMString rule,
- [Default=Undefined] optional unsigned long index);
- [RaisesException] void deleteRule([Default=Undefined] optional unsigned long index);
+// TODO(philipj): CSSSupportsRule should inherit from CSSConditionRule and
+// inherit all members.
+interface CSSSupportsRule : CSSRule {
+ // http://dev.w3.org/csswg/css-conditional/#the-cssconditionrule-interface
+ readonly attribute DOMString conditionText;
+ // http://dev.w3.org/csswg/cssom/#the-cssgroupingrule-interface
+ [SameObject] readonly attribute CSSRuleList cssRules;
+ [RaisesException] unsigned long insertRule(DOMString rule, unsigned long index);
+ [RaisesException] void deleteRule(unsigned long index);
};
diff --git a/core/css/CSSUnknownRule.idl b/core/css/CSSUnknownRule.idl
deleted file mode 100644
index c06bfed..0000000
--- a/core/css/CSSUnknownRule.idl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-// Introduced in DOM Level 2:
-[
-] interface CSSUnknownRule : CSSRule {
-};
-
diff --git a/core/css/CSSValue.idl b/core/css/CSSValue.idl
deleted file mode 100644
index 3f33813..0000000
--- a/core/css/CSSValue.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
- Custom=Wrap,
- DependentLifetime,
- NotScriptWrappable,
- WillBeGarbageCollected,
-] interface CSSValue {
-
- // UnitTypes
- const unsigned short CSS_INHERIT = 0;
- const unsigned short CSS_PRIMITIVE_VALUE = 1;
- const unsigned short CSS_VALUE_LIST = 2;
- const unsigned short CSS_CUSTOM = 3;
-
- [RaisesException=Setter] attribute DOMString? cssText;
-
- readonly attribute unsigned short cssValueType;
-
-};
-
diff --git a/core/css/CSSValueList.idl b/core/css/CSSValueList.idl
deleted file mode 100644
index 4d808f9..0000000
--- a/core/css/CSSValueList.idl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple 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:
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
- */
-
-// Introduced in DOM Level 2:
-interface CSSValueList : CSSValue {
- readonly attribute unsigned long length;
- [ImplementedAs=itemWithBoundsCheck] getter CSSValue item(unsigned long index);
-};
-
diff --git a/core/css/CSSViewportRule.idl b/core/css/CSSViewportRule.idl
index 5dbb2e4..640d484 100644
--- a/core/css/CSSViewportRule.idl
+++ b/core/css/CSSViewportRule.idl
@@ -27,6 +27,8 @@
* SUCH DAMAGE.
*/
+// http://dev.w3.org/csswg/css-device-adapt/#css-viewport-rule-interface
+
interface CSSViewportRule : CSSRule {
readonly attribute CSSStyleDeclaration style;
};
diff --git a/core/css/Counter.idl b/core/css/Counter.idl
deleted file mode 100644
index 886436e..0000000
--- a/core/css/Counter.idl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-// Introduced in DOM Level 2:
-[
- WillBeGarbageCollected
-] interface Counter {
- readonly attribute DOMString identifier;
- readonly attribute DOMString listStyle;
- readonly attribute DOMString separator;
-};
-
diff --git a/core/css/DocumentFontFaceSet.idl b/core/css/DocumentFontFaceSet.idl
index 04de8b7..b1f217e 100644
--- a/core/css/DocumentFontFaceSet.idl
+++ b/core/css/DocumentFontFaceSet.idl
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/csswg/css-font-loading/#font-face-source
+
+// TODO(philipj): This should be a FontFaceSource interface implemented by
+// Document and WorkerGlobalScope.
partial interface Document {
[MeasureAs=DocumentFonts] readonly attribute FontFaceSet fonts;
};
diff --git a/core/css/FontFace.idl b/core/css/FontFace.idl
index d83c666..37e45c4 100644
--- a/core/css/FontFace.idl
+++ b/core/css/FontFace.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-font-loading/#dom-fontface
+// http://dev.w3.org/csswg/css-font-loading/#fontface-interface
enum FontFaceLoadStatus {
"unloaded",
@@ -37,16 +37,14 @@
"error"
};
+// TODO(philipj): This interface should be [Exposed=Window,Worker].
[
ActiveDOMObject,
- // FIXME: should be union type http://crbug.com/240176
- Constructor(DOMString family, DOMString source, optional FontFaceDescriptors descriptors),
- Constructor(DOMString family, ArrayBuffer source, optional FontFaceDescriptors descriptors),
- Constructor(DOMString family, ArrayBufferView source, optional FontFaceDescriptors descriptors),
+ // FIXME: This should be (DOMString or BinaryData), where BinaryData is typedef of (ArrayBuffer or ArrayBufferView)
+ Constructor(DOMString family, (DOMString or ArrayBuffer or ArrayBufferView) source, optional FontFaceDescriptors descriptors),
ConstructorCallWith=ExecutionContext,
WillBeGarbageCollected,
] interface FontFace {
-
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString family;
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString style;
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString weight;
@@ -56,7 +54,7 @@
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString featureSettings;
readonly attribute FontFaceLoadStatus status;
- [CallWith=ScriptState] readonly attribute Promise loaded;
- [CallWith=ScriptState] Promise load();
+ [CallWith=ScriptState] Promise<FontFace> load();
+ [CallWith=ScriptState] readonly attribute Promise<FontFace> loaded;
};
diff --git a/core/css/FontFaceDescriptors.idl b/core/css/FontFaceDescriptors.idl
index 1ba9ef1..c53b7b9 100644
--- a/core/css/FontFaceDescriptors.idl
+++ b/core/css/FontFaceDescriptors.idl
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- GarbageCollected
-] dictionary FontFaceDescriptors {
+// http://dev.w3.org/csswg/css-font-loading/#dictdef-fontfacedescriptors
+
+dictionary FontFaceDescriptors {
DOMString style = "normal";
DOMString weight = "normal";
DOMString stretch = "normal";
diff --git a/core/css/FontFaceSet.idl b/core/css/FontFaceSet.idl
index 31ae4fc..50525e5 100644
--- a/core/css/FontFaceSet.idl
+++ b/core/css/FontFaceSet.idl
@@ -28,28 +28,43 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
+
enum FontFaceSetLoadStatus { "loading", "loaded" };
+// TODO(philipj): This interface should be [Exposed=Window,Worker] and should
+// have a constructor, and thus not have [NoInterfaceObject].
[
ActiveDOMObject,
SetWrapperReferenceFrom=document,
NoInterfaceObject,
] interface FontFaceSet : EventTarget {
+ // TODO(ksakamoto): Make FontFaceSet Set-like. crbug.com/392075
+ // setlike<FontFace>;
+ void forEach(FontFaceSetForEachCallback callback, optional any thisArg);
+ [RaisesException] boolean has(FontFace fontFace);
+ readonly attribute unsigned long size;
+ // TODO(philipj): add() should return the FontFaceSet.
+ [RaisesException] void add(FontFace fontFace);
+ [RaisesException, ImplementedAs=remove] boolean delete(FontFace fontFace);
+ void clear();
+ // events for when loading state changes
attribute EventHandler onloading;
attribute EventHandler onloadingdone;
attribute EventHandler onloadingerror;
+ // check and start loads if appropriate
+ // and fulfill promise when all loads complete
+ [CallWith=ScriptState] Promise<sequence<FontFace>> load(DOMString font, optional DOMString text = " ");
+
+ // return whether all fonts in the fontlist are loaded
+ // (does not initiate load if not available)
[RaisesException] boolean check(DOMString font, optional DOMString text = " ");
- [CallWith=ScriptState] Promise load(DOMString font, optional DOMString text = " ");
- [MeasureAs=FontFaceSetReady, CallWith=ScriptState] Promise ready();
- [RaisesException] void add(FontFace fontFace);
- void clear();
- [RaisesException, ImplementedAs=remove] boolean delete(FontFace fontFace);
- void forEach(FontFaceSetForEachCallback callback, optional any thisArg);
- [RaisesException] boolean has(FontFace fontFace);
+ // async notification that font loading and layout operations are done
+ [CallWith=ScriptState] readonly attribute Promise<FontFaceSet> ready;
- readonly attribute unsigned long size;
+ // loading state, "loading" while one or more fonts loading, "loaded" otherwise
readonly attribute FontFaceSetLoadStatus status;
};
diff --git a/core/css/FontFaceSetForEachCallback.idl b/core/css/FontFaceSetForEachCallback.idl
index 6b9fdab..ac6c771 100644
--- a/core/css/FontFaceSetForEachCallback.idl
+++ b/core/css/FontFaceSetForEachCallback.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(ksakamoto): Remove this interface when FontFaceSet is made Set-like.
+// crbug.com/392075
callback interface FontFaceSetForEachCallback {
[CallWith=ThisValue] boolean handleItem(FontFace fontFace, FontFace fontFaceAgain, FontFaceSet set);
boolean handleItem(FontFace fontFace, FontFace fontFaceAgain, FontFaceSet set);
diff --git a/core/css/FontFaceSetLoadEvent.idl b/core/css/FontFaceSetLoadEvent.idl
index 10530b4..303c3c8 100644
--- a/core/css/FontFaceSetLoadEvent.idl
+++ b/core/css/FontFaceSetLoadEvent.idl
@@ -28,9 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// FIXME: Make this constructable from Javascript
+// http://dev.w3.org/csswg/css-font-loading/#fontfacesetloadevent
+
+// TODO(philipj): This interface should have a constructor and
+// [Exposed=Window,Worker], and thus not [NoInterfaceObject].
[
NoInterfaceObject,
] interface FontFaceSetLoadEvent : Event {
- readonly attribute FontFace[] fontfaces;
+ readonly attribute sequence<FontFace> fontfaces;
};
diff --git a/core/css/FontFaceSetLoadEventInit.idl b/core/css/FontFaceSetLoadEventInit.idl
new file mode 100644
index 0000000..e058d33
--- /dev/null
+++ b/core/css/FontFaceSetLoadEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://dev.w3.org/csswg/css-font-loading/#fontfacesetloadevent
+
+dictionary FontFaceSetLoadEventInit : EventInit {
+ sequence<FontFace> fontfaces = [];
+};
diff --git a/core/css/MediaList.idl b/core/css/MediaList.idl
index cae0768..ff714af 100644
--- a/core/css/MediaList.idl
+++ b/core/css/MediaList.idl
@@ -23,17 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-medialist-interface
+
+// TODO(philipj): MediaList should be an [ArrayClass].
[
WillBeGarbageCollected
] interface MediaList {
-
- attribute DOMString? mediaText;
+ // TODO(philipj): [TreatNullAs=EmptyString] stringifier attribute DOMString mediaText;
+ attribute DOMString? mediaText;
readonly attribute unsigned long length;
-
- [TreatReturnedNullStringAs=Null] getter DOMString item(unsigned long index);
- [RaisesException] void deleteMedium(DOMString oldMedium);
- [RaisesException] void appendMedium(DOMString newMedium);
-
+ [Measure] getter DOMString? item(unsigned long index);
+ // TODO(philipj): appendMedium() and deleteMedium() should never throw.
+ [RaisesException] void appendMedium(DOMString medium);
+ [RaisesException] void deleteMedium(DOMString medium);
};
-
diff --git a/core/css/MediaQueryList.idl b/core/css/MediaQueryList.idl
index cb93f6f..7c1a4af 100644
--- a/core/css/MediaQueryList.idl
+++ b/core/css/MediaQueryList.idl
@@ -17,21 +17,18 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom-view/#mediaquerylist
+// http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface
+
[
ActiveDOMObject,
- NoInterfaceObject,
- WillBeGarbageCollected
] interface MediaQueryList : EventTarget {
readonly attribute DOMString media;
readonly attribute boolean matches;
-
// Even though this interface is now an event target, these functions
// exist as aliases for addEventListener for backwards compatibility
// with older versions of this interface. See the note at
// http://dev.w3.org/csswg/cssom-view/#dom-mediaquerylist-removelistener
- [ImplementedAs=addDeprecatedListener] void addListener([Default=Undefined] optional EventListener listener);
- [ImplementedAs=removeDeprecatedListener]void removeListener([Default=Undefined] optional EventListener listener);
-
+ [ImplementedAs=addDeprecatedListener, Custom=CallEpilogue] void addListener(EventListener? listener);
+ [ImplementedAs=removeDeprecatedListener, Custom=CallEpilogue]void removeListener(EventListener? listener);
attribute EventHandler onchange;
};
diff --git a/core/css/MediaQueryListEvent.idl b/core/css/MediaQueryListEvent.idl
index 2376a4f..f229e79 100644
--- a/core/css/MediaQueryListEvent.idl
+++ b/core/css/MediaQueryListEvent.idl
@@ -4,9 +4,10 @@
// http://dev.w3.org/csswg/cssom-view/#mediaquerylistevent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict)
] interface MediaQueryListEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString media;
- [InitializedByEventConstructor] readonly attribute boolean matches;
+ readonly attribute DOMString media;
+ readonly attribute boolean matches;
};
diff --git a/core/css/MediaQueryListEventInit.idl b/core/css/MediaQueryListEventInit.idl
new file mode 100644
index 0000000..69972f5
--- /dev/null
+++ b/core/css/MediaQueryListEventInit.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.
+
+// http://dev.w3.org/csswg/cssom-view/#mediaquerylistevent
+
+dictionary MediaQueryListEventInit : EventInit {
+ DOMString media = "";
+ boolean matches = false;
+};
diff --git a/core/css/RGBColor.idl b/core/css/RGBColor.idl
deleted file mode 100644
index 81ae393..0000000
--- a/core/css/RGBColor.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
- NotScriptWrappable,
- WillBeGarbageCollected
-] interface RGBColor {
- readonly attribute CSSPrimitiveValue red;
- readonly attribute CSSPrimitiveValue green;
- readonly attribute CSSPrimitiveValue blue;
-};
-
diff --git a/core/css/Rect.idl b/core/css/Rect.idl
deleted file mode 100644
index dbf1b36..0000000
--- a/core/css/Rect.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
- NotScriptWrappable,
- WillBeGarbageCollected
-] interface Rect {
- readonly attribute CSSPrimitiveValue top;
- readonly attribute CSSPrimitiveValue right;
- readonly attribute CSSPrimitiveValue bottom;
- readonly attribute CSSPrimitiveValue left;
-};
-
diff --git a/core/css/StyleMedia.idl b/core/css/StyleMedia.idl
index b897eb0..38f4326 100644
--- a/core/css/StyleMedia.idl
+++ b/core/css/StyleMedia.idl
@@ -24,10 +24,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// This interface was originally named Media, and was removed from the spec
+// shortly after it was renamed to StyleMedia:
+// http://www.w3.org/TR/2009/WD-cssom-view-20090804/#the-media-interface
+// http://web.archive.org/web/20100206142043/http://dev.w3.org/csswg/cssom-view#the-stylemedia-interface
+//
+// TODO(philipj): Remove this interface.
+
[
NoInterfaceObject,
WillBeGarbageCollected
] interface StyleMedia {
- readonly attribute DOMString type;
- boolean matchMedium([Default=Undefined] optional DOMString mediaquery);
+ [MeasureAs=StyleMediaType] readonly attribute DOMString type;
+ [MeasureAs=StyleMediaMatchMedium] boolean matchMedium([Default=Undefined] optional DOMString mediaquery);
};
diff --git a/core/css/StyleSheet.idl b/core/css/StyleSheet.idl
index c35b9a5..09a1be3 100644
--- a/core/css/StyleSheet.idl
+++ b/core/css/StyleSheet.idl
@@ -18,18 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-stylesheet-interface
+
[
- Custom=Wrap,
SetWrapperReferenceFrom=ownerNode,
WillBeGarbageCollected
] interface StyleSheet {
- readonly attribute DOMString? type;
- attribute boolean disabled;
- readonly attribute Node ownerNode;
- readonly attribute StyleSheet parentStyleSheet;
- readonly attribute DOMString? href;
- readonly attribute DOMString? title;
- readonly attribute MediaList media;
+ readonly attribute DOMString type;
+ readonly attribute DOMString? href;
+ // TODO(philipj): ownerNode should be (Element or ProcessingInstruction).
+ readonly attribute Node? ownerNode;
+ readonly attribute StyleSheet? parentStyleSheet;
+ readonly attribute DOMString? title;
+ // TODO(philipj): media should have [PutForwards=mediaText].
+ [SameObject] readonly attribute MediaList media;
+ attribute boolean disabled;
};
-
diff --git a/core/css/StyleSheetList.idl b/core/css/StyleSheetList.idl
index 3da2d91..ce31d3b 100644
--- a/core/css/StyleSheetList.idl
+++ b/core/css/StyleSheetList.idl
@@ -18,12 +18,16 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// http://dev.w3.org/csswg/cssom/#the-stylesheetlist-interface
+
+// TODO(philipj): StyleSheetList should be an [ArrayClass].
[
SetWrapperReferenceFrom=document,
WillBeGarbageCollected
] interface StyleSheetList {
+ [Measure] getter StyleSheet? item(unsigned long index);
readonly attribute unsigned long length;
- getter StyleSheet item(unsigned long index);
+
+ // Non-standard APIs
[NotEnumerable] getter CSSStyleSheet (DOMString name);
};
diff --git a/core/css/WebKitCSSFilterRule.idl b/core/css/WebKitCSSFilterRule.idl
deleted file mode 100644
index 09a3176..0000000
--- a/core/css/WebKitCSSFilterRule.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 HOLDER 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.
- */
-
-[
- ImplementedAs=CSSFilterRule
-] interface WebKitCSSFilterRule : CSSRule {
- readonly attribute CSSStyleDeclaration style;
-
- // FIXME: We should expose the filter name once the CSSOM for the @filter rule is specified.
-};
diff --git a/core/css/WebKitCSSFilterValue.idl b/core/css/WebKitCSSFilterValue.idl
deleted file mode 100644
index 8c346d2..0000000
--- a/core/css/WebKitCSSFilterValue.idl
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 Apple 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:
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
- */
-
-[
- DoNotCheckConstants,
- ImplementedAs=CSSFilterValue,
-] interface WebKitCSSFilterValue : CSSValueList {
-
- // OperationTypes
-
- const unsigned short CSS_FILTER_REFERENCE = 1;
- const unsigned short CSS_FILTER_GRAYSCALE = 2;
- const unsigned short CSS_FILTER_SEPIA = 3;
- const unsigned short CSS_FILTER_SATURATE = 4;
- const unsigned short CSS_FILTER_HUE_ROTATE = 5;
- const unsigned short CSS_FILTER_INVERT = 6;
- const unsigned short CSS_FILTER_OPACITY = 7;
- const unsigned short CSS_FILTER_BRIGHTNESS = 8;
- const unsigned short CSS_FILTER_CONTRAST = 9;
- const unsigned short CSS_FILTER_BLUR = 10;
- const unsigned short CSS_FILTER_DROP_SHADOW = 11;
-
- readonly attribute unsigned short operationType;
- [ImplementedAs=item] getter CSSValue (unsigned long index);
-};
diff --git a/core/css/WebKitCSSMatrix.idl b/core/css/WebKitCSSMatrix.idl
index 8f2dc55..b224c07 100644
--- a/core/css/WebKitCSSMatrix.idl
+++ b/core/css/WebKitCSSMatrix.idl
@@ -26,35 +26,36 @@
// Introduced in DOM Level ?:
[
Constructor(optional DOMString cssValue = null),
+ ConstructorCallWith=ExecutionContext,
ImplementedAs=CSSMatrix,
RaisesException=Constructor,
WillBeGarbageCollected
] interface WebKitCSSMatrix {
// These attributes are simple aliases for certain elements of the 4x4 matrix
- attribute double a; // alias for m11
- attribute double b; // alias for m12
- attribute double c; // alias for m21
- attribute double d; // alias for m22
- attribute double e; // alias for m41
- attribute double f; // alias for m42
+ attribute unrestricted double a; // alias for m11
+ attribute unrestricted double b; // alias for m12
+ attribute unrestricted double c; // alias for m21
+ attribute unrestricted double d; // alias for m22
+ attribute unrestricted double e; // alias for m41
+ attribute unrestricted double f; // alias for m42
- attribute double m11;
- attribute double m12;
- attribute double m13;
- attribute double m14;
- attribute double m21;
- attribute double m22;
- attribute double m23;
- attribute double m24;
- attribute double m31;
- attribute double m32;
- attribute double m33;
- attribute double m34;
- attribute double m41;
- attribute double m42;
- attribute double m43;
- attribute double m44;
+ 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;
[RaisesException] void setMatrixValue([Default=Undefined] optional DOMString string);
@@ -66,39 +67,39 @@
// Return this matrix translated by the passed values.
// Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations
- [Immutable] WebKitCSSMatrix translate([Default=Undefined] optional double x,
- [Default=Undefined] optional double y,
- [Default=Undefined] optional double z);
+ [Immutable] WebKitCSSMatrix translate([Default=Undefined] optional unrestricted double x,
+ [Default=Undefined] optional unrestricted double y,
+ [Default=Undefined] optional unrestricted double z);
// Returns this matrix scaled by the passed values.
// Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN
// makes it the same as scaleX. This allows the 3D form to used for 2D operations
- [Immutable] WebKitCSSMatrix scale([Default=Undefined] optional double scaleX,
- [Default=Undefined] optional double scaleY,
- [Default=Undefined] optional double scaleZ);
+ [Immutable] WebKitCSSMatrix scale([Default=Undefined] optional unrestricted double scaleX,
+ [Default=Undefined] optional unrestricted double scaleY,
+ [Default=Undefined] optional unrestricted double scaleZ);
// Returns this matrix rotated by the passed values.
// If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX).
// Otherwise use a rotation value of 0 for any passed NaN.
- [Immutable] WebKitCSSMatrix rotate([Default=Undefined] optional double rotX,
- [Default=Undefined] optional double rotY,
- [Default=Undefined] optional double rotZ);
+ [Immutable] WebKitCSSMatrix rotate([Default=Undefined] optional unrestricted double rotX,
+ [Default=Undefined] optional unrestricted double rotY,
+ [Default=Undefined] optional unrestricted double rotZ);
// Returns this matrix rotated about the passed axis by the passed angle.
// Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value
// of (0,0,1).
- [Immutable] WebKitCSSMatrix rotateAxisAngle([Default=Undefined] optional double x,
- [Default=Undefined] optional double y,
- [Default=Undefined] optional double z,
- [Default=Undefined] optional double angle);
+ [Immutable] WebKitCSSMatrix rotateAxisAngle([Default=Undefined] optional unrestricted double x,
+ [Default=Undefined] optional unrestricted double y,
+ [Default=Undefined] optional unrestricted double z,
+ [Default=Undefined] optional unrestricted double angle);
// Returns this matrix skewed along the X axis by the passed values.
// Passing a NaN will use a value of 0.
- [Immutable] WebKitCSSMatrix skewX([Default=Undefined] optional double angle);
+ [Immutable] WebKitCSSMatrix skewX([Default=Undefined] optional unrestricted double angle);
// Returns this matrix skewed along the Y axis by the passed values.
// Passing a NaN will use a value of 0.
- [Immutable] WebKitCSSMatrix skewY([Default=Undefined] optional double angle);
+ [Immutable] WebKitCSSMatrix skewY([Default=Undefined] optional unrestricted double angle);
[NotEnumerable] stringifier;
};
diff --git a/core/css/WebKitCSSTransformValue.idl b/core/css/WebKitCSSTransformValue.idl
deleted file mode 100644
index 05258f9..0000000
--- a/core/css/WebKitCSSTransformValue.idl
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2008 Apple 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:
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 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.
- */
-
-[
- DoNotCheckConstants,
- ImplementedAs=CSSTransformValue,
-] interface WebKitCSSTransformValue : CSSValueList {
- // OperationTypes
- const unsigned short CSS_TRANSLATE = 1;
- const unsigned short CSS_TRANSLATEX = 2;
- const unsigned short CSS_TRANSLATEY = 3;
- const unsigned short CSS_ROTATE = 4;
- const unsigned short CSS_SCALE = 5;
- const unsigned short CSS_SCALEX = 6;
- const unsigned short CSS_SCALEY = 7;
- const unsigned short CSS_SKEW = 8;
- const unsigned short CSS_SKEWX = 9;
- const unsigned short CSS_SKEWY = 10;
- const unsigned short CSS_MATRIX = 11;
- const unsigned short CSS_TRANSLATEZ = 12;
- const unsigned short CSS_TRANSLATE3D = 13;
- const unsigned short CSS_ROTATEX = 14;
- const unsigned short CSS_ROTATEY = 15;
- const unsigned short CSS_ROTATEZ = 16;
- const unsigned short CSS_ROTATE3D = 17;
- const unsigned short CSS_SCALEZ = 18;
- const unsigned short CSS_SCALE3D = 19;
- const unsigned short CSS_PERSPECTIVE = 20;
- const unsigned short CSS_MATRIX3D = 21;
-
- readonly attribute unsigned short operationType;
- [ImplementedAs=item] getter CSSValue (unsigned long index);
-};
-
diff --git a/core/dom/ArrayBuffer.idl b/core/dom/ArrayBuffer.idl
new file mode 100644
index 0000000..12c506b
--- /dev/null
+++ b/core/dom/ArrayBuffer.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFER
+
+[
+ ImplementedAs=DOMArrayBuffer,
+ NoInterfaceObject,
+] interface ArrayBuffer {
+ readonly attribute unsigned long byteLength;
+};
diff --git a/core/dom/ArrayBufferView.idl b/core/dom/ArrayBufferView.idl
new file mode 100644
index 0000000..d300904
--- /dev/null
+++ b/core/dom/ArrayBufferView.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://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFERVIEW
+
+[
+ ImplementedAs=DOMArrayBufferView,
+ NoInterfaceObject,
+] interface ArrayBufferView {
+ readonly attribute ArrayBuffer buffer;
+ readonly attribute unsigned long byteOffset;
+ readonly attribute unsigned long byteLength;
+};
diff --git a/core/dom/Attr.idl b/core/dom/Attr.idl
index 5c22a79..54540ba 100644
--- a/core/dom/Attr.idl
+++ b/core/dom/Attr.idl
@@ -18,26 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-attr
+
+// FIXME: Attr should not inherit from Node. crbug.com/305105
interface Attr : Node {
-
- // DOM Level 1
-
- readonly attribute DOMString? name;
-
- [MeasureAs=AttributeSpecified] readonly attribute boolean specified;
-
- [ImplementedAs=valueForBindings, CustomElementCallbacks] attribute DOMString? value;
- [DeprecateAs=AttrNodeValue, ImplementedAs=valueForBindings] attribute DOMString? nodeValue;
- [DeprecateAs=AttrTextContent, ImplementedAs=valueForBindings] attribute DOMString? textContent;
-
- // DOM Level 2
-
- [DeprecateAs=AttributeOwnerElement] readonly attribute Element ownerElement;
-
- // DOM 4
-
- readonly attribute DOMString? prefix;
readonly attribute DOMString? namespaceURI;
- readonly attribute DOMString? localName;
-};
+ readonly attribute DOMString? prefix;
+ readonly attribute DOMString localName;
+ readonly attribute DOMString name;
+ [ImplementedAs=valueForBindings, CustomElementCallbacks] attribute DOMString value;
+ [TreatNullAs=EmptyString, ImplementedAs=valueForBindings, MeasureAs=AttrNodeValue] attribute DOMString nodeValue; // legacy alias of .value
+ [TreatNullAs=EmptyString, ImplementedAs=valueForBindings, MeasureAs=AttrTextContent] attribute DOMString textContent; // legacy alias of .value
+ [MeasureAs=AttributeOwnerElement] readonly attribute Element? ownerElement;
+
+ [MeasureAs=AttributeSpecified] readonly attribute boolean specified; // useless; always returns true
+};
diff --git a/core/dom/CDATASection.idl b/core/dom/CDATASection.idl
index 939fe27..d672cce 100644
--- a/core/dom/CDATASection.idl
+++ b/core/dom/CDATASection.idl
@@ -17,6 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#cdatasection
+
+// FIXME: CDATASection has been removed from the spec. crbug.com/437205
interface CDATASection : Text {
};
diff --git a/core/dom/CharacterData.idl b/core/dom/CharacterData.idl
index 7132d6d..5be7888 100644
--- a/core/dom/CharacterData.idl
+++ b/core/dom/CharacterData.idl
@@ -17,19 +17,17 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-characterdata
+
interface CharacterData : Node {
-
[TreatNullAs=NullString] attribute DOMString data;
-
readonly attribute unsigned long length;
-
- [RaisesException] DOMString? substringData(unsigned long offset, unsigned long length);
-
+ [RaisesException] DOMString substringData(unsigned long offset, unsigned long count);
void appendData(DOMString data);
[RaisesException] void insertData(unsigned long offset, DOMString data);
- [RaisesException] void deleteData(unsigned long offset, unsigned long length);
- [RaisesException] void replaceData(unsigned long offset, unsigned long length, DOMString data);
+ [RaisesException] void deleteData(unsigned long offset, unsigned long count);
+ [RaisesException] void replaceData(unsigned long offset, unsigned long count, DOMString data);
};
CharacterData implements ChildNode;
-
+CharacterData implements NonDocumentTypeChildNode;
diff --git a/core/dom/ChildNode.idl b/core/dom/ChildNode.idl
index 38ccf66..0b0168e 100644
--- a/core/dom/ChildNode.idl
+++ b/core/dom/ChildNode.idl
@@ -20,13 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dom.spec.whatwg.org/#interface-childnode
+// https://dom.spec.whatwg.org/#interface-childnode
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
] interface ChildNode {
- [PerWorldBindings] readonly attribute Element previousElementSibling;
- [PerWorldBindings] readonly attribute Element nextElementSibling;
- [RaisesException, CustomElementCallbacks] void remove();
+ [Unscopeable, RaisesException, CustomElementCallbacks, RuntimeEnabled=DOMConvenienceAPI] void before((Node or DOMString) ... nodes);
+ [Unscopeable, RaisesException, CustomElementCallbacks, RuntimeEnabled=DOMConvenienceAPI] void after((Node or DOMString)... nodes);
+ [Unscopeable, RaisesException, CustomElementCallbacks, RuntimeEnabled=DOMConvenienceAPI] void replaceWith((Node or DOMString)... nodes);
+ [Unscopeable, RaisesException, CustomElementCallbacks] void remove();
};
diff --git a/core/dom/ClientRect.idl b/core/dom/ClientRect.idl
index 4fae5d7..5d68b87 100644
--- a/core/dom/ClientRect.idl
+++ b/core/dom/ClientRect.idl
@@ -24,8 +24,16 @@
*
*/
+// An old version of CSSOM View Module defines the ClientRect interface:
+// http://www.w3.org/TR/2011/WD-cssom-view-20110804/#the-clientrect-interface
+
+// It has since been replaced by DOMRect in CSSOM View Module and
+// Geometry Interfaces Module:
+// http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface
+// http://dev.w3.org/fxtf/geometry/#DOMRect
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
] interface ClientRect {
readonly attribute float top;
readonly attribute float right;
@@ -34,4 +42,3 @@
readonly attribute float width;
readonly attribute float height;
};
-
diff --git a/core/dom/ClientRectList.idl b/core/dom/ClientRectList.idl
index bf14542..38eb2a6 100644
--- a/core/dom/ClientRectList.idl
+++ b/core/dom/ClientRectList.idl
@@ -24,11 +24,25 @@
*
*/
+// An old version of CSSOM View Module defines the ClientRectList interface:
+// http://www.w3.org/TR/2011/WD-cssom-view-20110804/#the-clientrectlist-interface
+
+// It has since been replace by DOMRectList in CSSOM View Module and
+// Geometry Interfaces Module:
+// http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface
+// http://dev.w3.org/fxtf/geometry/#DOMRectList
+
+// CSSOM View Module also says: "The DOMRectList interface is at-risk.
+// The authors of this specification await feedback from implementers
+// if the item() function of DOMRectList is currently in use on legacy
+// interfaces. If there is no/not enough content to justify
+// DOMRectList, legacy interfaces must use sequences instead and
+// DOMRectList will be removed from this specification."
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
] interface ClientRectList {
readonly attribute unsigned long length;
- getter ClientRect item(unsigned long index);
- // FIXME: Fix list behavior to allow custom exceptions to be thrown.
+ [MeasureAs=ClientRectListItem] ClientRect item(unsigned long index);
+ getter ClientRect (unsigned long index);
};
-
diff --git a/core/dom/Comment.idl b/core/dom/Comment.idl
index e7fff28..6ecf8f0 100644
--- a/core/dom/Comment.idl
+++ b/core/dom/Comment.idl
@@ -17,9 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-comment
+
[
Constructor(optional DOMString data = ""),
ConstructorCallWith=Document,
] interface Comment : CharacterData {
};
-
diff --git a/core/dom/CommonDefinitions.idl b/core/dom/CommonDefinitions.idl
new file mode 100644
index 0000000..30bb95f
--- /dev/null
+++ b/core/dom/CommonDefinitions.idl
@@ -0,0 +1,8 @@
+// Copyright 2015 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://heycam.github.io/webidl/#common
+
+typedef (ArrayBuffer or ArrayBufferView) BufferSource;
+typedef unsigned long long DOMTimeStamp;
diff --git a/core/dom/CompositorProxy.idl b/core/dom/CompositorProxy.idl
new file mode 100644
index 0000000..53de14b
--- /dev/null
+++ b/core/dom/CompositorProxy.idl
@@ -0,0 +1,20 @@
+// Copyright 2015 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(Element element, DOMString[] attributeArray),
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,CompositorWorker),
+ GarbageCollected,
+ RaisesException=Constructor,
+ RuntimeEnabled=CompositorWorker,
+] interface CompositorProxy {
+ [RaisesException] attribute double opacity;
+ [RaisesException] attribute double scrollLeft;
+ [RaisesException] attribute double scrollTop;
+ [RaisesException] attribute DOMMatrix transform;
+
+ boolean supports(DOMString attribute);
+ void disconnect();
+};
diff --git a/core/dom/DOMError.idl b/core/dom/DOMError.idl
index aba4e7a..d0c9544 100644
--- a/core/dom/DOMError.idl
+++ b/core/dom/DOMError.idl
@@ -25,11 +25,15 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+// https://dom.spec.whatwg.org/#domerror
+
+// FIXME: DOMError has been removed from the spec. crbug.com/460725
[
Constructor(DOMString name, optional DOMString message = null),
- WillBeGarbageCollected
+ GarbageCollected,
+ Measure,
] interface DOMError {
- readonly attribute DOMString name;
- readonly attribute DOMString message;
- };
-
+ [Measure] readonly attribute DOMString name;
+ [Measure] readonly attribute DOMString message;
+};
diff --git a/core/dom/DOMException.idl b/core/dom/DOMException.idl
index 4442350..c4e8919 100644
--- a/core/dom/DOMException.idl
+++ b/core/dom/DOMException.idl
@@ -27,8 +27,9 @@
*/
[
+ Exposed=(Window,Worker),
DoNotCheckConstants,
- WillBeGarbageCollected,
+ GarbageCollected,
] exception DOMException {
readonly attribute unsigned short code;
diff --git a/core/dom/DOMImplementation.idl b/core/dom/DOMImplementation.idl
index d210529..6ed29bb 100644
--- a/core/dom/DOMImplementation.idl
+++ b/core/dom/DOMImplementation.idl
@@ -18,26 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-domimplementation
+
[
SetWrapperReferenceFrom=document,
+ TypeChecking=Interface,
WillBeGarbageCollected,
] interface DOMImplementation {
+ [NewObject, RaisesException] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
+ [NewObject, RaisesException] XMLDocument createDocument(DOMString? namespaceURI, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
+ // FIXME: createHTMLDocument should return a Document. crbug.com/238368
+ // FIXME: The title argument should not have a default value. crbug.com/335871
+ [NewObject] HTMLDocument createHTMLDocument(optional DOMString title = null);
- // DOM Level 1
-
- [ImplementedAs=hasFeatureForBindings, MeasureAs=DOMImplementationHasFeature]
- boolean hasFeature(DOMString feature, DOMString? version);
-
- // DOM Level 2
-
- [RaisesException] DocumentType createDocumentType(DOMString qualifiedName,
- DOMString publicId,
- DOMString systemId);
- [RaisesException] XMLDocument createDocument(DOMString? namespaceURI,
- DOMString? qualifiedName,
- [Default=Undefined] optional DocumentType doctype);
-
- // HTMLDOMImplementation interface from DOM Level 2 HTML
-
- HTMLDocument createHTMLDocument(optional DOMString title = null);
+ // useless; always returns true
+ boolean hasFeature();
};
diff --git a/core/dom/DOMMatrix.idl b/core/dom/DOMMatrix.idl
index 33d40dd..ee0290d 100644
--- a/core/dom/DOMMatrix.idl
+++ b/core/dom/DOMMatrix.idl
@@ -2,36 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://dev.w3.org/fxtf/geometry/#DOMMatrix
+
[
Constructor,
Constructor(DOMMatrixReadOnly other),
// FIXME: Should implement more constructors (See: crbug.com/388780)
+ // FIXME: Exposed=(Window,Worker)
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;
+ inherit attribute unrestricted double a;
+ inherit attribute unrestricted double b;
+ inherit attribute unrestricted double c;
+ inherit attribute unrestricted double d;
+ inherit attribute unrestricted double e;
+ inherit 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;
+ inherit attribute unrestricted double m11;
+ inherit attribute unrestricted double m12;
+ inherit attribute unrestricted double m13;
+ inherit attribute unrestricted double m14;
+ inherit attribute unrestricted double m21;
+ inherit attribute unrestricted double m22;
+ inherit attribute unrestricted double m23;
+ inherit attribute unrestricted double m24;
+ inherit attribute unrestricted double m31;
+ inherit attribute unrestricted double m32;
+ inherit attribute unrestricted double m33;
+ inherit attribute unrestricted double m34;
+ inherit attribute unrestricted double m41;
+ inherit attribute unrestricted double m42;
+ inherit attribute unrestricted double m43;
+ inherit attribute unrestricted double m44;
// FIXME: Should implement some methods (See: crbug.com/388780)
// Mutable transform methods
@@ -41,16 +44,16 @@
unrestricted double ty,
optional unrestricted double tz = 0);
DOMMatrix scaleSelf(unrestricted double scale,
- optional unrestricted double ox = 0,
- optional unrestricted double oy = 0);
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0);
DOMMatrix scale3dSelf(unrestricted double scale,
- optional unrestricted double ox = 0,
- optional unrestricted double oy = 0,
- optional unrestricted double oz = 0);
- DOMMatrix scaleNonUniformSelf(unrestricted double sx,
- optional unrestricted double sy = 1,
- optional unrestricted double sz = 1,
- optional unrestricted double ox = 0,
- optional unrestricted double oy = 0,
- optional unrestricted double oz = 0);
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix scaleNonUniformSelf(unrestricted double scaleX,
+ optional unrestricted double scaleY = 1,
+ optional unrestricted double scaleZ = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
};
diff --git a/core/dom/DOMMatrixReadOnly.idl b/core/dom/DOMMatrixReadOnly.idl
index f049f7b..f0cd565 100644
--- a/core/dom/DOMMatrixReadOnly.idl
+++ b/core/dom/DOMMatrixReadOnly.idl
@@ -2,9 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://dev.w3.org/fxtf/geometry/#DOMMatrix
+
[
+ // FIXME: Constructor(sequence<unrestricted double> numberSequence)
+ // FIXME: Exposed=(Window,Worker)
GarbageCollected,
- NotScriptWrappable,
RuntimeEnabled=GeometryInterfaces,
] interface DOMMatrixReadOnly {
// These attributes are simple aliases for certain elements of the 4x4 matrix
@@ -37,23 +40,24 @@
// FIXME: Should implement some methods (See: crbug.com/388780)
// Immutable transform methods
- DOMMatrix multiply(DOMMatrix other);
DOMMatrix translate(unrestricted double tx,
unrestricted double ty,
optional unrestricted double tz = 0);
DOMMatrix scale(unrestricted double scale,
- optional unrestricted double ox = 0,
- optional unrestricted double oy = 0);
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0);
DOMMatrix scale3d(unrestricted double scale,
- optional unrestricted double ox = 0,
- optional unrestricted double oy = 0,
- optional unrestricted double oz = 0);
- DOMMatrix scaleNonUniform(unrestricted double sx,
- optional unrestricted double sy = 1,
- optional unrestricted double sz = 1,
- optional unrestricted double ox = 0,
- optional unrestricted double oy = 0,
- optional unrestricted double oz = 0);
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix scaleNonUniform(unrestricted double scaleX,
+ optional unrestricted double scaleY = 1,
+ optional unrestricted double scaleZn = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix multiply(DOMMatrix other);
+
Float32Array toFloat32Array();
Float64Array toFloat64Array();
};
diff --git a/core/dom/DOMPoint.idl b/core/dom/DOMPoint.idl
index e202163..8c99323 100644
--- a/core/dom/DOMPoint.idl
+++ b/core/dom/DOMPoint.idl
@@ -2,14 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://dev.w3.org/fxtf/geometry/#DOMPoint
+
[
- Constructor(optional DOMPointInit point),
- Constructor(unrestricted double x, unrestricted double y,
+ // FIXME: The point argument is optional in the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28108
+ Constructor(DOMPointInit point),
+ Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
optional unrestricted double z = 0, optional unrestricted double w = 1),
+ // FIXME: Exposed=(Window,Worker)
RuntimeEnabled=GeometryInterfaces,
] interface DOMPoint : DOMPointReadOnly {
- attribute unrestricted double x;
- attribute unrestricted double y;
- attribute unrestricted double z;
- attribute unrestricted double w;
+ inherit attribute unrestricted double x;
+ inherit attribute unrestricted double y;
+ inherit attribute unrestricted double z;
+ inherit attribute unrestricted double w;
};
diff --git a/core/dom/DOMPointInit.idl b/core/dom/DOMPointInit.idl
index b1d7090..136627f 100644
--- a/core/dom/DOMPointInit.idl
+++ b/core/dom/DOMPointInit.idl
@@ -2,11 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Spec: http://dev.w3.org/fxtf/geometry/#DOMPoint
+// http://dev.w3.org/fxtf/geometry/#DOMPoint
-[
- GarbageCollected
-] dictionary DOMPointInit {
+dictionary DOMPointInit {
unrestricted double x = 0;
unrestricted double y = 0;
unrestricted double z = 0;
diff --git a/core/dom/DOMPointReadOnly.idl b/core/dom/DOMPointReadOnly.idl
index 6fa6110..e33d4f2 100644
--- a/core/dom/DOMPointReadOnly.idl
+++ b/core/dom/DOMPointReadOnly.idl
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://dev.w3.org/fxtf/geometry/#DOMPoint
+
[
Constructor(unrestricted double x, unrestricted double y,
unrestricted double z, unrestricted double w),
+ // FIXME: Exposed=(Window,Worker)
GarbageCollected,
- NotScriptWrappable,
RuntimeEnabled=GeometryInterfaces,
] interface DOMPointReadOnly {
readonly attribute unrestricted double x;
@@ -14,6 +16,6 @@
readonly attribute unrestricted double z;
readonly attribute unrestricted double w;
- // FIXME: We should implement DOMMatrixReadOnly interface.
+ // FIXME: Implement matrixTransform.
// DOMPoint matrixTransform(DOMMatrixReadOnly matrix);
};
diff --git a/core/dom/DOMRect.idl b/core/dom/DOMRect.idl
index 8a05778..185d3ff 100644
--- a/core/dom/DOMRect.idl
+++ b/core/dom/DOMRect.idl
@@ -2,15 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://dev.w3.org/fxtf/geometry/#DOMRect
+
[
Constructor(optional unrestricted double x = 0,
optional unrestricted double y = 0,
optional unrestricted double width = 0,
optional unrestricted double height = 0),
+ // FIXME: Exposed=(Window,Worker)
RuntimeEnabled=GeometryInterfaces,
] interface DOMRect : DOMRectReadOnly {
- attribute unrestricted double x;
- attribute unrestricted double y;
- attribute unrestricted double width;
- attribute unrestricted double height;
+ inherit attribute unrestricted double x;
+ inherit attribute unrestricted double y;
+ inherit attribute unrestricted double width;
+ inherit attribute unrestricted double height;
};
diff --git a/core/dom/DOMRectReadOnly.idl b/core/dom/DOMRectReadOnly.idl
index 87b80da..ca8532a 100644
--- a/core/dom/DOMRectReadOnly.idl
+++ b/core/dom/DOMRectReadOnly.idl
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://dev.w3.org/fxtf/geometry/#DOMRect
+
[
Constructor(unrestricted double x, unrestricted double y,
unrestricted double width, unrestricted double height),
+ // FIXME: Exposed=(Window,Worker)
GarbageCollected,
- NotScriptWrappable,
RuntimeEnabled=GeometryInterfaces,
] interface DOMRectReadOnly {
readonly attribute unrestricted double x;
diff --git a/core/dom/DOMSettableTokenList.idl b/core/dom/DOMSettableTokenList.idl
index e02dd69..b62d903 100644
--- a/core/dom/DOMSettableTokenList.idl
+++ b/core/dom/DOMSettableTokenList.idl
@@ -22,8 +22,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface DOMSettableTokenList : DOMTokenList {
- [TreatReturnedNullStringAs=Null, ImplementedAs=item] getter DOMString (unsigned long index);
- attribute DOMString value;
-};
+// https://dom.spec.whatwg.org/#interface-domsettabletokenlist
+interface DOMSettableTokenList : DOMTokenList {
+ attribute DOMString value;
+
+ // FIXME: This getter is not in the spec.
+ [ImplementedAs=item] getter DOMString? (unsigned long index);
+};
diff --git a/core/dom/DOMStringList.idl b/core/dom/DOMStringList.idl
index 8a57087..3821bd8 100644
--- a/core/dom/DOMStringList.idl
+++ b/core/dom/DOMStringList.idl
@@ -23,10 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dom.spec.whatwg.org/#domstringlist
+
+// FIXME: DOMStringList has been removed from the spec. crbug.com/460726
[
WillBeGarbageCollected,
] interface DOMStringList {
readonly attribute unsigned long length;
- [TreatReturnedNullStringAs=Null] getter DOMString item([Default=Undefined] optional unsigned long index);
- [MeasureAs=DOMStringListContains] boolean contains([Default=Undefined] optional DOMString string);
+ getter DOMString? (unsigned long index);
+
+ [CallWith=ExecutionContext] DOMString? item(unsigned long index);
+ [CallWith=ExecutionContext,MeasureAs=DOMStringListContains] boolean contains(DOMString string);
};
diff --git a/core/dom/DOMStringMap.idl b/core/dom/DOMStringMap.idl
index c8c7d15..2034eac 100644
--- a/core/dom/DOMStringMap.idl
+++ b/core/dom/DOMStringMap.idl
@@ -23,16 +23,20 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-domstringmap-interface
+
[
OverrideBuiltins,
SetWrapperReferenceFrom=element,
WillBeGarbageCollected,
] interface DOMStringMap {
- [NotEnumerable] getter DOMString (unsigned long index);
- [RaisesException] setter DOMString (unsigned long index, DOMString value);
- deleter boolean (unsigned long index);
-
[ImplementedAs=item] getter DOMString (DOMString name);
- [RaisesException] setter DOMString (DOMString name, DOMString value);
- deleter boolean (DOMString name);
+ [RaisesException] setter void (DOMString name, DOMString value);
+ deleter void (DOMString name);
+
+ // FIXME: The indexed getter, setter and deleter are not in the
+ // spec and simply converts the index to a string.
+ [NotEnumerable] getter DOMString (unsigned long index);
+ [RaisesException] setter void (unsigned long index, DOMString value);
+ deleter void (unsigned long index);
};
diff --git a/core/dom/DOMTokenList.idl b/core/dom/DOMTokenList.idl
index 1947640..1293203 100644
--- a/core/dom/DOMTokenList.idl
+++ b/core/dom/DOMTokenList.idl
@@ -22,17 +22,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dom.spec.whatwg.org/#interface-domtokenlist
+
[
SetWrapperReferenceFrom=element,
WillBeGarbageCollected,
] interface DOMTokenList {
readonly attribute unsigned long length;
- [TreatReturnedNullStringAs=Null] getter DOMString item(unsigned long index);
+ getter DOMString? item(unsigned long index);
[RaisesException] boolean contains(DOMString token);
[RaisesException, CustomElementCallbacks] void add(DOMString... tokens);
[RaisesException, CustomElementCallbacks] void remove(DOMString... tokens);
[RaisesException, CustomElementCallbacks] boolean toggle(DOMString token, optional boolean force);
-
+ // FIXME: stringifier should be enumerable.
[NotEnumerable] stringifier;
+ iterable<DOMString>;
};
-
diff --git a/core/html/canvas/WebGLLoseContext.idl b/core/dom/DataView.idl
similarity index 89%
copy from core/html/canvas/WebGLLoseContext.idl
copy to core/dom/DataView.idl
index c235567..3e957df 100644
--- a/core/html/canvas/WebGLLoseContext.idl
+++ b/core/dom/DataView.idl
@@ -23,11 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/typedarray/specs/latest/#DATAVIEW
+
[
- NoInterfaceObject,
+ ImplementedAs=DOMDataView,
TypeChecking=Interface,
- WillBeGarbageCollected,
-] interface WebGLLoseContext {
- void loseContext();
- void restoreContext();
+] interface DataView : ArrayBufferView {
};
diff --git a/core/dom/Document.idl b/core/dom/Document.idl
index 09e5837..5b4d664 100644
--- a/core/dom/Document.idl
+++ b/core/dom/Document.idl
@@ -20,150 +20,192 @@
callback CustomElementConstructor = Element ();
-typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
+// https://html.spec.whatwg.org/#the-document-object
+enum DocumentReadyState { "loading", "interactive", "complete" };
-[
- SpecialWrapFor=(HTMLDocument,XMLDocument)
-] interface Document : Node {
+// http://www.w3.org/TR/page-visibility/#VisibilityState
+enum VisibilityState { "hidden", "visible", "prerender", "unloaded" };
- // DOM Level 1 Core
- readonly attribute DocumentType doctype;
- readonly attribute DOMImplementation implementation;
- readonly attribute Element documentElement;
+// https://dom.spec.whatwg.org/#interface-document
- [CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString tagName);
- DocumentFragment createDocumentFragment();
- Text createTextNode(DOMString data);
- Comment createComment(DOMString data);
- [RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createCDATASection([Default=Undefined] optional DOMString data); // Removed from DOM4.
- [RaisesException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
- [RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute([Default=Undefined] optional DOMString name); // Removed from DOM4.
- [DartNoAutoScope] HTMLCollection getElementsByTagName(DOMString localName);
-
- // Introduced in DOM Level 2:
-
- [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
-
- [MeasureAs=DocumentInputEncoding] readonly attribute DOMString? inputEncoding; // 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, TypeChecking=Interface] Node adoptNode(Node node);
-
- [ImplementedAs=url] readonly attribute DOMString? documentURI;
-
- // DOM Level 2 Events (DocumentEvents interface)
-
- [RaisesException] Event createEvent(DOMString eventType);
-
- // DOM Level 2 Traversal and Range (DocumentRange interface)
-
- Range createRange();
-
- // DOM Level 2 Traversal and Range (DocumentTraversal interface)
-
- [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)
-
- [ImplementedAs=domWindow] readonly attribute Window defaultView;
-
- // DOM Level 2 Style (DocumentStyle interface)
-
- readonly attribute StyleSheetList styleSheets;
-
- // DOM Level 2 Style (DocumentCSS interface)
-
- CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
- [Default=Undefined] optional DOMString pseudoElement);
-
- // DOM 4
- readonly attribute DOMString contentType;
-
- // Common extensions
- [CustomElementCallbacks]
- boolean execCommand([Default=Undefined] optional DOMString command,
- [Default=Undefined] optional boolean userInterface,
- [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? value);
-
- boolean queryCommandEnabled([Default=Undefined] optional DOMString command);
- boolean queryCommandIndeterm([Default=Undefined] optional DOMString command);
- boolean queryCommandState([Default=Undefined] optional DOMString command);
- boolean queryCommandSupported([Default=Undefined] optional DOMString command);
- DOMString queryCommandValue([Default=Undefined] optional DOMString command);
-
- // Moved down from HTMLDocument
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString dir;
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString designMode;
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString title;
- readonly attribute DOMString referrer;
- [TreatNullAs=NullString, RaisesException=Setter] attribute DOMString domain;
+// FIXME: Document should have a constructor. crbug.com/238234
+interface Document : Node {
+ [SameObject] readonly attribute DOMImplementation implementation;
readonly attribute DOMString URL;
-
- [TreatNullAs=NullString, RaisesException] attribute DOMString cookie;
-
- [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings, TypeChecking=Interface, DartNoAutoScope] attribute HTMLElement? body;
-
- readonly attribute HTMLHeadElement head;
- readonly attribute HTMLCollection images;
- readonly attribute HTMLCollection applets;
- readonly attribute HTMLCollection embeds;
- [ImplementedAs=embeds] readonly attribute HTMLCollection plugins;
- readonly attribute HTMLCollection links;
- readonly attribute HTMLCollection forms;
- readonly attribute HTMLCollection scripts;
- readonly attribute HTMLCollection anchors;
- readonly attribute DOMString lastModified;
-
- [PerWorldBindings, DartNoAutoScope] NodeList getElementsByName([Default=Undefined] optional DOMString elementName);
-
- [PutForwards=href] readonly attribute Location location;
-
- // IE extensions
- [MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
- [MeasureAs=DocumentDefaultCharset, TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
- [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;
-
- Element elementFromPoint([Default=Undefined] optional long x,
- [Default=Undefined] optional long y);
- [MeasureAs=DocumentCaretRangeFromPoint]
- Range caretRangeFromPoint([Default=Undefined] optional long x,
- [Default=Undefined] optional long y);
-
- // Mozilla extensions
- Selection getSelection();
- readonly attribute DOMString? characterSet;
-
- // WebKit extensions
-
- readonly attribute DOMString? preferredStylesheetSet;
- attribute DOMString? selectedStylesheetSet;
-
- [MeasureAs=DocumentGetCSSCanvasContext] RenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
-
- // HTML 5
- HTMLCollection getElementsByClassName(DOMString classNames);
- readonly attribute Element activeElement;
- boolean hasFocus();
-
+ // FIXME: documentURI should not be nullable.
+ [ImplementedAs=url] readonly attribute DOMString? documentURI;
+ readonly attribute DOMString origin;
readonly attribute DOMString compatMode;
+ readonly attribute DOMString characterSet;
+ [MeasureAs=DocumentInputEncoding, ImplementedAs=characterSet] readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
+ readonly attribute DOMString contentType;
+
+ readonly attribute DocumentType? doctype;
+ readonly attribute Element? documentElement;
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString classNames);
+
+ [NewObject, CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName);
+ [NewObject, CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
+ [NewObject] DocumentFragment createDocumentFragment();
+ [NewObject] Text createTextNode(DOMString data);
+ [NewObject] Comment createComment(DOMString data);
+ [NewObject, RaisesException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
+
+ [NewObject, CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node importNode(Node node, optional boolean deep = false);
+ [RaisesException, CustomElementCallbacks, TypeChecking=Interface] Node adoptNode(Node node);
+
+ [NewObject, RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute(DOMString localName);
+ [NewObject, RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName);
+
+ [NewObject, RaisesException] Event createEvent(DOMString eventType);
+
+ [NewObject] Range createRange();
+
+ // NodeFilter.SHOW_ALL = 0xFFFFFFFF
+ [NewObject, RaisesException, TypeChecking=Interface] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+ [NewObject, RaisesException, TypeChecking=Interface] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+
+ // FIXME: CDATASection has been removed from the spec. crbug.com/437205
+ [RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createCDATASection(DOMString data);
+
+ // FIXME: xmlEncoding/xmlVersion/xmlStandalone have been removed from the spec.
+ [MeasureAs=DocumentXMLEncoding] readonly attribute DOMString? xmlEncoding;
+ [RaisesException=Setter, MeasureAs=DocumentXMLVersion] attribute DOMString? xmlVersion;
+ [RaisesException=Setter, MeasureAs=DocumentXMLStandalone] attribute boolean xmlStandalone;
+
+ // HTML
+ // https://html.spec.whatwg.org/#the-document-object
+
+ // resource metadata management
+ [PutForwards=href, Unforgeable] readonly attribute Location? location;
+ [RaisesException=Setter] attribute DOMString domain;
+ readonly attribute DOMString referrer;
+ // FIXME: cookie should not have [TreatNullAs=NullString].
+ [TreatNullAs=NullString, RaisesException] attribute DOMString cookie;
+ readonly attribute DOMString lastModified;
+ readonly attribute DocumentReadyState readyState;
+
+ // DOM tree accessors
+ // FIXME: title and dir should not have [TreatNullAs=NullString].
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString title;
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString dir;
+ [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings, TypeChecking=Interface] attribute HTMLElement? body;
+ readonly attribute HTMLHeadElement? head;
+ [SameObject] readonly attribute HTMLCollection images;
+ [SameObject] readonly attribute HTMLCollection embeds;
+ [SameObject, ImplementedAs=embeds] readonly attribute HTMLCollection plugins;
+ [SameObject] readonly attribute HTMLCollection links;
+ [SameObject] readonly attribute HTMLCollection forms;
+ [SameObject] readonly attribute HTMLCollection scripts;
+ [PerWorldBindings] NodeList getElementsByName(DOMString elementName);
+ readonly attribute HTMLScriptElement? currentScript;
+
+ // dynamic markup insertion
+ // FIXME: There are two open() methods in the spec.
+ [Custom, CustomElementCallbacks, RaisesException] void open();
+ [RaisesException] void close();
+ [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void write(DOMString... text);
+ [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
+
+ // user interaction
+ [ImplementedAs=domWindow] readonly attribute Window? defaultView;
+ readonly attribute Element? activeElement;
+ boolean hasFocus();
+ // FIXME: designMode should not have [TreatNullAs=NullString].
+ [TreatNullAs=NullString, CustomElementCallbacks, MeasureAs=DocumentDesignMode] attribute DOMString designMode;
+ [CustomElementCallbacks, RaisesException] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
+ [RaisesException] boolean queryCommandEnabled(DOMString commandId);
+ [RaisesException] boolean queryCommandIndeterm(DOMString commandId);
+ [RaisesException] boolean queryCommandState(DOMString commandId);
+ [RaisesException] boolean queryCommandSupported(DOMString commandId);
+ [RaisesException] DOMString queryCommandValue(DOMString commandId);
+
+ [LenientThis] attribute EventHandler onreadystatechange;
+
+ // HTML obsolete features
+ // https://html.spec.whatwg.org/#Document-partial
+
+ // FIXME: *Color are on HTMLDocument.
+
+ readonly attribute HTMLCollection anchors;
+ readonly attribute HTMLCollection applets;
+
+ // FIXME: clear(), captureEvents(), releaseEvents() and all are on HTMLDocument.
+
+ // CSS Object Model (CSSOM)
+ // http://dev.w3.org/csswg/cssom/#extensions-to-the-document-interface
+ [SameObject] readonly attribute StyleSheetList styleSheets;
+ attribute DOMString? selectedStylesheetSet;
+ readonly attribute DOMString? preferredStylesheetSet;
+
+ // CSSOM View Module
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
+ // FIXME: The x and y arguments should be of type double.
+ Element? elementFromPoint(long x, long y);
+ sequence<Element> elementsFromPoint(long x, long y);
+ readonly attribute Element? scrollingElement;
+
+ // Selection API
+ // http://w3c.github.io/selection-api/#extensions-to-document-interface
+ Selection? getSelection();
+
+ // Pointer Lock
+ // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-document-interface
+ attribute EventHandler onpointerlockchange;
+ attribute EventHandler onpointerlockerror;
+ [MeasureAs=DocumentPointerLockElement] readonly attribute Element? pointerLockElement;
[MeasureAs=DocumentExitPointerLock] void exitPointerLock();
- [MeasureAs=DocumentPointerLockElement] readonly attribute Element pointerLockElement;
+
+ // Touch Events
+ // http://rawgit.com/w3c/touch-events/v1-errata/touchevents.html#extensions-to-the-document-interface
+ // FIXME: The arguments should not be optional.
+ [RuntimeEnabled=Touch, Measure] Touch createTouch([Default=Undefined] optional Window window,
+ [Default=Undefined] optional EventTarget target,
+ [Default=Undefined] optional long identifier,
+ [Default=Undefined] optional unrestricted double pageX,
+ [Default=Undefined] optional unrestricted double pageY,
+ [Default=Undefined] optional unrestricted double screenX,
+ [Default=Undefined] optional unrestricted double screenY,
+ [Default=Undefined] optional unrestricted double radiusX,
+ [Default=Undefined] optional unrestricted double radiusY,
+ [Default=Undefined] optional unrestricted float rotationAngle,
+ [Default=Undefined] optional unrestricted float force);
+ [RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches);
+
+ // FIXME: The spec doesn't define these event handler attributes.
+ [RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
+ [RuntimeEnabled=Touch] attribute EventHandler ontouchend;
+ [RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
+ [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel;
+
+ // Custom Elements
+ // http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register
+ // FIXME: The registerElement return type should be Function.
+ [CallWith=ScriptState, CustomElementCallbacks, RaisesException, MeasureAs=DocumentRegisterElement] CustomElementConstructor registerElement(DOMString type, optional ElementRegistrationOptions options);
+ // http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate
+ // FIXME: The typeExtension arguments should not be nullable.
+ [CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName, DOMString? typeExtension);
+ [CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString? typeExtension);
+
+ // Page Visibility
+ // http://www.w3.org/TR/page-visibility/#sec-document-interface
+ readonly attribute boolean hidden;
+ readonly attribute VisibilityState visibilityState;
+
+ // Non-standard APIs
+ [MeasureAs=DocumentCharset] readonly attribute DOMString charset;
+ [MeasureAs=DocumentDefaultCharset, TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
+ [MeasureAs=DocumentCaretRangeFromPoint] Range caretRangeFromPoint([Default=Undefined] optional long x, [Default=Undefined] optional long y);
+ [CallWith=ScriptState, DeprecateAs=DocumentGetCSSCanvasContext] any getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
+
+ // Deprecated prefixed page visibility API.
+ // TODO(davidben): This is a property so attaching a deprecation warning results in false positives when outputting
+ // document in the console. It's possible http://crbug.com/43394 will resolve this.
+ [MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityState] readonly attribute DOMString webkitVisibilityState;
+ [MeasureAs=PrefixedPageVisibility, ImplementedAs=hidden] readonly attribute boolean webkitHidden;
// Event handler attributes
attribute EventHandler onbeforecopy;
@@ -172,48 +214,13 @@
attribute EventHandler oncopy;
attribute EventHandler oncut;
attribute EventHandler onpaste;
- attribute EventHandler onpointerlockchange;
- attribute EventHandler onpointerlockerror;
- attribute EventHandler onreadystatechange;
attribute EventHandler onsearch;
[RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute EventHandler onsecuritypolicyviolation;
attribute EventHandler onselectionchange;
attribute EventHandler onselectstart;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchend;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
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);
- [RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches);
-
- [CallWith=ScriptState, CustomElementCallbacks, RaisesException, MeasureAs=DocumentRegisterElement] CustomElementConstructor registerElement(DOMString name, optional Dictionary options);
- [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;
- readonly attribute boolean hidden;
-
- // Deprecated prefixed page visibility API.
- // TODO(davidben): This is a property so attaching a deprecation warning results in false positives when outputting
- // document in the console. It's possible http://crbug.com/43394 will resolve this.
- [MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityState] readonly attribute DOMString webkitVisibilityState;
- [MeasureAs=PrefixedPageVisibility, ImplementedAs=hidden] readonly attribute boolean webkitHidden;
-
- readonly attribute HTMLScriptElement currentScript;
};
Document implements GlobalEventHandlers;
Document implements ParentNode;
+Document implements NonElementParentNode;
diff --git a/core/dom/DocumentFragment.idl b/core/dom/DocumentFragment.idl
index 005032a..e4df24a 100644
--- a/core/dom/DocumentFragment.idl
+++ b/core/dom/DocumentFragment.idl
@@ -17,12 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-documentfragment
+
[
Constructor,
ConstructorCallWith=Document,
] interface DocumentFragment : Node {
- // NonElementParentNode API.
- Element getElementById(DOMString elementId);
};
DocumentFragment implements ParentNode;
+DocumentFragment implements NonElementParentNode;
diff --git a/core/dom/DocumentFullscreen.idl b/core/dom/DocumentFullscreen.idl
index ca9d85a..808ac15 100644
--- a/core/dom/DocumentFullscreen.idl
+++ b/core/dom/DocumentFullscreen.idl
@@ -19,6 +19,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://fullscreen.spec.whatwg.org/#api
+
partial interface Document {
[RuntimeEnabled=FullscreenUnprefixed] readonly attribute boolean fullscreenEnabled;
[RuntimeEnabled=FullscreenUnprefixed] readonly attribute Element? fullscreenElement;
@@ -30,7 +32,6 @@
// Mozilla version
[MeasureAs=PrefixedDocumentIsFullscreen, ImplementedAs=webkitCurrentFullScreenElement] readonly attribute boolean webkitIsFullScreen;
- [MeasureAs=PrefixedDocumentFullScreenKeyboardInputAllowed] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
[MeasureAs=PrefixedDocumentCurrentFullScreenElement] readonly attribute Element webkitCurrentFullScreenElement;
[MeasureAs=PrefixedDocumentCancelFullScreen, ImplementedAs=exitFullscreen] void webkitCancelFullScreen();
diff --git a/core/dom/DocumentType.idl b/core/dom/DocumentType.idl
index 680352b..1b7f411 100644
--- a/core/dom/DocumentType.idl
+++ b/core/dom/DocumentType.idl
@@ -17,14 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-documenttype
+
interface DocumentType : Node {
-
- // DOM Level 1
-
readonly attribute DOMString name;
-
- // DOM Level 2
-
readonly attribute DOMString publicId;
readonly attribute DOMString systemId;
};
diff --git a/core/dom/Element.idl b/core/dom/Element.idl
index 688db84..2d0574c 100644
--- a/core/dom/Element.idl
+++ b/core/dom/Element.idl
@@ -18,103 +18,101 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-element
+
[
- SpecialWrapFor=(HTMLElement,SVGElement),
+ TypeChecking=Interface,
] interface Element : Node {
+ readonly attribute DOMString? namespaceURI;
+ readonly attribute DOMString? prefix;
+ readonly attribute DOMString localName;
+ readonly attribute DOMString tagName;
- // DOM Level 1 Core
+ [Reflect] attribute DOMString id;
+ [Reflect=class] attribute DOMString className;
+ [SameObject, PerWorldBindings] readonly attribute DOMTokenList classList;
- readonly attribute DOMString? tagName;
-
- [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] 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;
[MeasureAs=HasAttributes] boolean hasAttributes();
-
- // DOM Level 2 Core
-
- [DartNoAutoScope] DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
- [RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttributeNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString value);
+ [SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes;
+ DOMString? getAttribute(DOMString name);
+ DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
+ [RaisesException, CustomElementCallbacks] void setAttribute(DOMString name, DOMString value);
+ [RaisesException, CustomElementCallbacks] void setAttributeNS(DOMString? namespaceURI, DOMString name, DOMString value);
+ [CustomElementCallbacks] void removeAttribute(DOMString name);
[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] optional Attr newAttr); // Removed from DOM4.
boolean hasAttribute(DOMString name);
boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
- [PerWorldBindings] readonly attribute CSSStyleDeclaration style;
+ [MeasureAs=ElementGetAttributeNode] Attr? getAttributeNode(DOMString name);
+ [MeasureAs=ElementGetAttributeNodeNS] Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
+ [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr? setAttributeNode(Attr attr);
+ [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNodeNS] Attr? setAttributeNodeNS(Attr attr);
+ [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNode] Attr removeAttributeNode(Attr attr);
- // DOM4
- [Reflect, DartNoAutoScope] attribute DOMString id;
- readonly attribute DOMString? namespaceURI;
- [RaisesException=Setter] attribute DOMString? prefix;
- [DartCustom] readonly attribute DOMString? localName;
-
+ [RaisesException] Element? closest(DOMString selectors);
[RaisesException] boolean matches(DOMString selectors);
- // Common extensions
-
- readonly attribute long offsetLeft;
- readonly attribute long offsetTop;
- readonly attribute long offsetWidth;
- readonly attribute long offsetHeight;
- [ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute Element offsetParent;
- readonly attribute long clientLeft;
- readonly attribute long clientTop;
- readonly attribute long clientWidth;
- readonly attribute long clientHeight;
-
- // FIXME: should be:
- // attribute (Dictionary or double) scrollLeft;
- // attribute (Dictionary or double) scrollTop;
- // http://crbug.com/240176
- [Custom=Setter] attribute double scrollLeft;
- [Custom=Setter] attribute double scrollTop;
- readonly attribute long scrollWidth;
- readonly attribute long scrollHeight;
-
- void focus();
- void blur();
- void scrollIntoView(optional boolean alignWithTop);
-
- // WebKit extensions
-
- [MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
-
- // HTML 5
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
+
+ // DOM Parsing and Serialization
+ // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-the-element-interface
[TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerHTML;
[TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString outerHTML;
+ [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void insertAdjacentHTML(DOMString position, DOMString text);
- [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] Element insertAdjacentElement(DOMString where, Element element);
- [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMString where, DOMString text);
- [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void insertAdjacentHTML(DOMString where, DOMString html);
-
- [Reflect=class] attribute DOMString className;
- [PerWorldBindings] readonly attribute DOMTokenList classList;
-
- [PerWorldBindings] readonly attribute DOMStringMap dataset;
-
- // WebKit extension
- [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors);
-
- // Shadow DOM API
- [RaisesException, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot();
- [PerWorldBindings] readonly attribute ShadowRoot shadowRoot;
+ // Shadow DOM
+ // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
+ [RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot();
+ [RuntimeEnabled=CreateShadowRootWithParameter, RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot(ShadowRootInit shadowRootInitDict);
NodeList getDestinationInsertionPoints();
+ [PerWorldBindings] readonly attribute ShadowRoot? shadowRoot;
- // CSSOM View Module API
+ // Pointer Lock
+ // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-element-interface
+ [MeasureAs=ElementRequestPointerLock] void requestPointerLock();
+
+ // CSSOM View Module
+ // http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface
+ // FIXME: getClientRect() and getBoundingClientRect() should
+ // return DOMRectList and DOMRect respectively.
ClientRectList getClientRects();
ClientRect getBoundingClientRect();
+ // FIXME: scrollIntoView() should have a ScrollIntoViewOptions dictionary argument.
+ void scrollIntoView(optional boolean alignWithTop);
+ [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(optional ScrollToOptions options);
+ [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(unrestricted double x, unrestricted double y);
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions options);
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(unrestricted double x, unrestricted double y);
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions options);
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(unrestricted double x, unrestricted double y);
+ attribute unrestricted double scrollTop;
+ attribute unrestricted double scrollLeft;
+ readonly attribute long scrollWidth;
+ readonly attribute long scrollHeight;
+ readonly attribute long clientTop;
+ readonly attribute long clientLeft;
+ readonly attribute long clientWidth;
+ readonly attribute long clientHeight;
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface
+ // FIXME: offset* should only be on HTMLElement.
+ [MeasureAs=ElementOffsetParent, PerWorldBindings] readonly attribute Element? offsetParent;
+ [MeasureAs=ElementOffsetTop] readonly attribute long offsetTop;
+ [MeasureAs=ElementOffsetLeft] readonly attribute long offsetLeft;
+ [MeasureAs=ElementOffsetWidth] readonly attribute long offsetWidth;
+ [MeasureAs=ElementOffsetHeight] readonly attribute long offsetHeight;
- [MeasureAs=ElementRequestPointerLock] void requestPointerLock();
+ // Non-standard APIs
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19962
+ [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] Element insertAdjacentElement(DOMString where, Element element);
+ [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMString where, DOMString text);
+ [MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
+ [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors);
+
+ // Experimental accessibility API
+ [RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedRole;
+ [RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedName;
// Event handler attributes
attribute EventHandler onbeforecopy;
@@ -134,3 +132,4 @@
Element implements ParentNode;
Element implements ChildNode;
+Element implements NonDocumentTypeChildNode;
diff --git a/core/dom/ElementFullscreen.idl b/core/dom/ElementFullscreen.idl
index 6f45402..e27ee3d 100644
--- a/core/dom/ElementFullscreen.idl
+++ b/core/dom/ElementFullscreen.idl
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://fullscreen.spec.whatwg.org/#api
+
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);
+ [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen();
// W3C version
[LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen();
diff --git a/core/dom/ElementRegistrationOptions.idl b/core/dom/ElementRegistrationOptions.idl
new file mode 100644
index 0000000..cbda61d
--- /dev/null
+++ b/core/dom/ElementRegistrationOptions.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.
+
+// Spec: http://w3c.github.io/webcomponents/spec/custom/#api-element-registration-options
+
+dictionary ElementRegistrationOptions {
+ object? prototype = null;
+ DOMString? extends = null;
+};
diff --git a/core/dom/Float32Array.idl b/core/dom/Float32Array.idl
new file mode 100644
index 0000000..a0f1e1a
--- /dev/null
+++ b/core/dom/Float32Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMFloat32Array,
+ NoInterfaceObject,
+] interface Float32Array : ArrayBufferView {
+};
diff --git a/core/dom/Float64Array.idl b/core/dom/Float64Array.idl
new file mode 100644
index 0000000..f384340
--- /dev/null
+++ b/core/dom/Float64Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMFloat64Array,
+ NoInterfaceObject,
+] interface Float64Array : ArrayBufferView {
+};
diff --git a/core/dom/RequestAnimationFrameCallback.idl b/core/dom/FrameRequestCallback.idl
similarity index 96%
rename from core/dom/RequestAnimationFrameCallback.idl
rename to core/dom/FrameRequestCallback.idl
index cb0ec66..b65b637 100644
--- a/core/dom/RequestAnimationFrameCallback.idl
+++ b/core/dom/FrameRequestCallback.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-callback interface RequestAnimationFrameCallback{
+callback interface FrameRequestCallback {
// highResTime is passed as high resolution timestamp, see
// http://www.w3.org/TR/hr-time/ for details.
void handleEvent(double highResTime);
diff --git a/core/dom/GlobalEventHandlers.idl b/core/dom/GlobalEventHandlers.idl
index 6a7f1c1..685f349 100644
--- a/core/dom/GlobalEventHandlers.idl
+++ b/core/dom/GlobalEventHandlers.idl
@@ -27,7 +27,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#globaleventhandlers
+// https://html.spec.whatwg.org/#globaleventhandlers
[
LegacyTreatAsPartialInterface,
@@ -57,6 +57,7 @@
attribute EventHandler ondurationchange;
attribute EventHandler onemptied;
attribute EventHandler onended;
+ // FIXME: onerror should be an OnErrorEventHandler.
attribute EventHandler onerror;
attribute EventHandler onfocus;
attribute EventHandler oninput;
@@ -69,8 +70,8 @@
attribute EventHandler onloadedmetadata;
attribute EventHandler onloadstart;
attribute EventHandler onmousedown;
- attribute EventHandler onmouseenter;
- attribute EventHandler onmouseleave;
+ [LenientThis] attribute EventHandler onmouseenter;
+ [LenientThis] attribute EventHandler onmouseleave;
attribute EventHandler onmousemove;
attribute EventHandler onmouseout;
attribute EventHandler onmouseover;
@@ -79,6 +80,14 @@
attribute EventHandler onpause;
attribute EventHandler onplay;
attribute EventHandler onplaying;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointercancel;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerdown;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerenter;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerleave;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointermove;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerout;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerover;
+ [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerup;
attribute EventHandler onprogress;
attribute EventHandler onratechange;
attribute EventHandler onreset;
diff --git a/core/dom/Int16Array.idl b/core/dom/Int16Array.idl
new file mode 100644
index 0000000..19edc3c
--- /dev/null
+++ b/core/dom/Int16Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMInt16Array,
+ NoInterfaceObject,
+] interface Int16Array : ArrayBufferView {
+};
diff --git a/core/dom/Int32Array.idl b/core/dom/Int32Array.idl
new file mode 100644
index 0000000..76a42f6
--- /dev/null
+++ b/core/dom/Int32Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMInt32Array,
+ NoInterfaceObject,
+] interface Int32Array : ArrayBufferView {
+};
diff --git a/core/dom/Int8Array.idl b/core/dom/Int8Array.idl
new file mode 100644
index 0000000..a56cf6d
--- /dev/null
+++ b/core/dom/Int8Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMInt8Array,
+ NoInterfaceObject,
+] interface Int8Array : ArrayBufferView {
+};
diff --git a/core/dom/Iterator.idl b/core/dom/Iterator.idl
index 87027c5..4a13fe5 100644
--- a/core/dom/Iterator.idl
+++ b/core/dom/Iterator.idl
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-iterator-interface
+
[
Iterable,
GarbageCollected,
diff --git a/core/dom/MessageChannel.idl b/core/dom/MessageChannel.idl
index 14a4e19..35aa1c0 100644
--- a/core/dom/MessageChannel.idl
+++ b/core/dom/MessageChannel.idl
@@ -24,12 +24,14 @@
*
*/
+// https://html.spec.whatwg.org/#message-channels
+
[
CustomConstructor,
Exposed=(Window,Worker),
- WillBeGarbageCollected
+ GarbageCollected,
+ Measure,
] interface MessageChannel {
readonly attribute MessagePort port1;
readonly attribute MessagePort port2;
};
-
diff --git a/core/dom/MessagePort.idl b/core/dom/MessagePort.idl
index 77d8652..3c21c03 100644
--- a/core/dom/MessagePort.idl
+++ b/core/dom/MessagePort.idl
@@ -25,15 +25,17 @@
*
*/
+// https://html.spec.whatwg.org/#message-ports
+
[
ActiveDOMObject,
- WillBeGarbageCollected
+ Exposed=(Window,Worker),
+ GarbageCollected,
] interface MessagePort : EventTarget {
- [Custom, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException, Measure] void postMessage(any message, optional sequence<Transferable> transfer);
+ [Measure] void start();
+ [Measure] void close();
- void start();
- void close();
-
- // event handler attributes
+ // event handlers
attribute EventHandler onmessage;
};
diff --git a/core/dom/MutationObserver.idl b/core/dom/MutationObserver.idl
index e024d4a..467b454 100644
--- a/core/dom/MutationObserver.idl
+++ b/core/dom/MutationObserver.idl
@@ -28,12 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dom.spec.whatwg.org/#interface-mutationobserver
+
[
CustomConstructor(MutationCallback callback),
Custom=VisitDOMWrapper,
WillBeGarbageCollected,
] interface MutationObserver {
[RaisesException] void observe(Node target, MutationObserverInit options);
- sequence<MutationRecord> takeRecords();
void disconnect();
+ sequence<MutationRecord> takeRecords();
};
diff --git a/core/dom/MutationObserverInit.idl b/core/dom/MutationObserverInit.idl
index e44a484..a9f9724 100644
--- a/core/dom/MutationObserverInit.idl
+++ b/core/dom/MutationObserverInit.idl
@@ -4,9 +4,7 @@
// Spec: http://dom.spec.whatwg.org/#interface-mutationobserver
-[
- GarbageCollected
-] dictionary MutationObserverInit {
+dictionary MutationObserverInit {
boolean childList = false;
boolean attributes;
boolean characterData;
diff --git a/core/dom/MutationRecord.idl b/core/dom/MutationRecord.idl
index 1be9ca9..0ca53dc 100644
--- a/core/dom/MutationRecord.idl
+++ b/core/dom/MutationRecord.idl
@@ -28,19 +28,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dom.spec.whatwg.org/#interface-mutationrecord
+
[
WillBeGarbageCollected,
] interface MutationRecord {
readonly attribute DOMString type;
readonly attribute Node target;
-
- readonly attribute NodeList addedNodes;
- readonly attribute NodeList removedNodes;
- readonly attribute Node previousSibling;
- readonly attribute Node nextSibling;
-
+ [SameObject] readonly attribute NodeList addedNodes;
+ [SameObject] readonly attribute NodeList removedNodes;
+ readonly attribute Node? previousSibling;
+ readonly attribute Node? nextSibling;
readonly attribute DOMString? attributeName;
readonly attribute DOMString? attributeNamespace;
-
readonly attribute DOMString? oldValue;
};
diff --git a/core/dom/NamedNodeMap.idl b/core/dom/NamedNodeMap.idl
index 6294404..65a1cf3 100644
--- a/core/dom/NamedNodeMap.idl
+++ b/core/dom/NamedNodeMap.idl
@@ -18,32 +18,21 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-namednodemap
+
[
SetWrapperReferenceFrom=element,
+ TypeChecking=Interface,
WillBeGarbageCollected,
] interface NamedNodeMap {
-
- [MeasureAs=NamedNodeMapGetNamedItem] Node getNamedItem([Default=Undefined] optional DOMString name);
- [NotEnumerable, ImplementedAs=getNamedItem] getter Node ([Default=Undefined] optional DOMString name);
-
- [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapSetNamedItem] Node setNamedItem([Default=Undefined] optional Node node);
-
- [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItem] Node removeNamedItem([Default=Undefined] optional DOMString name);
-
- [MeasureAs=NamedNodeMapItem] getter Node item([Default=Undefined] optional unsigned long index);
-
readonly attribute unsigned long length;
-
-
- // Introduced in DOM Level 2:
-
- [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([Default=Undefined] optional DOMString? namespaceURI,
- [Default=Undefined] optional DOMString localName);
-
+ [MeasureAs=NamedNodeMapItem] getter Attr? item(unsigned long index);
+ // FIXME: getNamedItem should be an enumerable getter.
+ [MeasureAs=NamedNodeMapGetNamedItem] Attr? getNamedItem(DOMString name);
+ [NotEnumerable, ImplementedAs=getNamedItem] getter Attr? (DOMString name);
+ [MeasureAs=NamedNodeMapGetNamedItemNS] Attr? getNamedItemNS(DOMString? namespaceURI, DOMString localName);
+ [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapSetNamedItem] Attr? setNamedItem(Attr attr);
+ [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapSetNamedItemNS] Attr? setNamedItemNS(Attr attr);
+ [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItem] Attr removeNamedItem(DOMString name);
+ [RaisesException, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItemNS] Attr removeNamedItemNS(DOMString? namespaceURI, DOMString localName);
};
-
diff --git a/core/dom/Node.idl b/core/dom/Node.idl
index 1a05f53..9c3e3a5 100644
--- a/core/dom/Node.idl
+++ b/core/dom/Node.idl
@@ -18,74 +18,73 @@
* Boston, MA 02110-1301, USA.
*/
-[
- Custom=Wrap,
- DependentLifetime,
-] interface Node : EventTarget {
- // NodeType
- const unsigned short ELEMENT_NODE = 1;
- const unsigned short ATTRIBUTE_NODE = 2;
- const unsigned short TEXT_NODE = 3;
- const unsigned short CDATA_SECTION_NODE = 4;
- const unsigned short ENTITY_REFERENCE_NODE = 5; // EntityReference nodes are impossible to create in WebKit.
- const unsigned short ENTITY_NODE = 6;
- const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
- const unsigned short COMMENT_NODE = 8;
- const unsigned short DOCUMENT_NODE = 9;
- const unsigned short DOCUMENT_TYPE_NODE = 10;
- const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
- const unsigned short NOTATION_NODE = 12;
+// https://dom.spec.whatwg.org/#interface-node
+[
+ DependentLifetime,
+ TypeChecking=Interface,
+] interface Node : EventTarget {
+ const unsigned short ELEMENT_NODE = 1;
+ // FIXME: Attr should not inherit from Node. crbug.com/305105
+ const unsigned short ATTRIBUTE_NODE = 2;
+ const unsigned short TEXT_NODE = 3;
+ // FIXME: CDATASection has been removed from the spec. crbug.com/437205
+ const unsigned short CDATA_SECTION_NODE = 4;
+ const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
+ const unsigned short ENTITY_NODE = 6; // historical
+ const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
+ const unsigned short COMMENT_NODE = 8;
+ const unsigned short DOCUMENT_NODE = 9;
+ const unsigned short DOCUMENT_TYPE_NODE = 10;
+ const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
+ const unsigned short NOTATION_NODE = 12; // historical
+ readonly attribute unsigned short nodeType;
readonly attribute DOMString nodeName;
- [CustomElementCallbacks] attribute DOMString? nodeValue;
-
- [DartNoAutoScope] readonly attribute unsigned short nodeType;
- [PerWorldBindings] readonly attribute Node parentNode;
- [PerWorldBindings, DartNoAutoScope] readonly attribute NodeList childNodes;
- [PerWorldBindings, DartNoAutoScope] readonly attribute Node firstChild;
- [PerWorldBindings, DartNoAutoScope] readonly attribute Node lastChild;
- [PerWorldBindings, DartNoAutoScope] readonly attribute Node previousSibling;
- [PerWorldBindings, DartNoAutoScope] readonly attribute Node nextSibling;
- [PerWorldBindings] readonly attribute Document ownerDocument;
-
- [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:
- [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:
readonly attribute DOMString? baseURI;
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString textContent;
+ [PerWorldBindings] readonly attribute Document? ownerDocument;
+ [PerWorldBindings] readonly attribute Node? parentNode;
+ [PerWorldBindings] readonly attribute Element? parentElement;
+ [ImplementedAs=hasChildren] boolean hasChildNodes();
+ [SameObject, PerWorldBindings] readonly attribute NodeList childNodes;
+ [PerWorldBindings] readonly attribute Node? firstChild;
+ [PerWorldBindings] readonly attribute Node? lastChild;
+ [PerWorldBindings] readonly attribute Node? previousSibling;
+ [PerWorldBindings] readonly attribute Node? nextSibling;
- [MeasureAs=NodeIsSameNode] boolean isSameNode([Default=Undefined] optional Node other); // Removed in DOM4.
- boolean isEqualNode(Node other);
- DOMString? lookupPrefix(DOMString? namespaceURI);
- boolean isDefaultNamespace(DOMString? namespaceURI);
- DOMString? lookupNamespaceURI(DOMString? prefix);
+ [CustomElementCallbacks] attribute DOMString? nodeValue;
+ // FIXME: textContent should not have [TreatUndefinedAs=NullString].
+ [TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString? textContent;
+ [CustomElementCallbacks] void normalize();
- // DocumentPosition
- const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
- const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
- const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
- const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
- const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
- const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
+ // FIXME: The deep argument should have a default value false.
+ [NewObject, CustomElementCallbacks] Node cloneNode(optional boolean deep);
+ boolean isEqualNode(Node? node);
+ const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
+ const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
+ const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
+ const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
+ const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+ const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
unsigned short compareDocumentPosition(Node other);
+ boolean contains(Node? other);
- // Introduced in DOM4
- boolean contains(Node other);
+ DOMString? lookupPrefix(DOMString? namespaceURI);
+ DOMString? lookupNamespaceURI(DOMString? prefix);
+ boolean isDefaultNamespace(DOMString? namespaceURI);
- // IE extensions
- [PerWorldBindings] readonly attribute Element parentElement;
+ [CustomElementCallbacks, PerWorldBindings, RaisesException] Node insertBefore(Node node, Node? child);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException] Node appendChild(Node node);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException] Node replaceChild(Node node, Node child);
+ [CustomElementCallbacks, RaisesException] Node removeChild(Node child);
+
+ // FIXME: namespaceURI and localName have been moved to Element and Attr.
+ [MeasureAs=NodeNamespaceURI] readonly attribute DOMString? namespaceURI;
+ [MeasureAs=NodeLocalName] readonly attribute DOMString? localName;
+
+ // FIXME: isSameNode has been removed from the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27424
+ [MeasureAs=NodeIsSameNode] boolean isSameNode(Node? other);
};
diff --git a/core/dom/NodeFilter.idl b/core/dom/NodeFilter.idl
index 7d52e40..3fe66ea 100644
--- a/core/dom/NodeFilter.idl
+++ b/core/dom/NodeFilter.idl
@@ -18,30 +18,33 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-nodefilter
+
+// FIXME: NodeFilter should be a callback interface. crbug.com/462946
[
DependentLifetime,
WillBeGarbageCollected,
] interface NodeFilter {
- // Constants returned by acceptNode
- const short FILTER_ACCEPT = 1;
- const short FILTER_REJECT = 2;
- const short FILTER_SKIP = 3;
+ // Constants for acceptNode()
+ const unsigned short FILTER_ACCEPT = 1;
+ const unsigned short FILTER_REJECT = 2;
+ const unsigned short FILTER_SKIP = 3;
// Constants for whatToShow
- const unsigned long SHOW_ALL = 0xFFFFFFFF;
- const unsigned long SHOW_ELEMENT = 0x00000001;
- const unsigned long SHOW_ATTRIBUTE = 0x00000002;
- const unsigned long SHOW_TEXT = 0x00000004;
- const unsigned long SHOW_CDATA_SECTION = 0x00000008;
- const unsigned long SHOW_ENTITY_REFERENCE = 0x00000010;
- const unsigned long SHOW_ENTITY = 0x00000020;
- const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x00000040;
- const unsigned long SHOW_COMMENT = 0x00000080;
- const unsigned long SHOW_DOCUMENT = 0x00000100;
- const unsigned long SHOW_DOCUMENT_TYPE = 0x00000200;
- const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x00000400;
- const unsigned long SHOW_NOTATION = 0x00000800;
+ const unsigned long SHOW_ALL = 0xFFFFFFFF;
+ const unsigned long SHOW_ELEMENT = 0x1;
+ const unsigned long SHOW_ATTRIBUTE = 0x2; // historical
+ const unsigned long SHOW_TEXT = 0x4;
+ const unsigned long SHOW_CDATA_SECTION = 0x8; // historical
+ const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical
+ const unsigned long SHOW_ENTITY = 0x20; // historical
+ const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40;
+ const unsigned long SHOW_COMMENT = 0x80;
+ const unsigned long SHOW_DOCUMENT = 0x100;
+ const unsigned long SHOW_DOCUMENT_TYPE = 0x200;
+ const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400;
+ const unsigned long SHOW_NOTATION = 0x800; // historical
- [RaisesException] short acceptNode([Default=Undefined] optional Node n);
-
+ // FIXME: The node argument should not be optional.
+ [RaisesException] unsigned short acceptNode([Default=Undefined] optional Node node);
};
diff --git a/core/dom/NodeIterator.idl b/core/dom/NodeIterator.idl
index ef46701..e7e60da 100644
--- a/core/dom/NodeIterator.idl
+++ b/core/dom/NodeIterator.idl
@@ -18,19 +18,20 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2
+// https://dom.spec.whatwg.org/#interface-nodeiterator
+
[
SetWrapperReferenceTo(NodeFilter filter),
WillBeGarbageCollected,
] interface NodeIterator {
- readonly attribute Node root;
- readonly attribute unsigned long whatToShow;
- readonly attribute NodeFilter filter;
- [DeprecateAs=NodeIteratorExpandEntityReferences] readonly attribute boolean expandEntityReferences;
+ [SameObject] readonly attribute Node root;
readonly attribute Node referenceNode;
readonly attribute boolean pointerBeforeReferenceNode;
+ readonly attribute unsigned long whatToShow;
+ readonly attribute NodeFilter? filter;
- [RaisesException] Node nextNode();
- [RaisesException] Node previousNode();
+ [RaisesException] Node? nextNode();
+ [RaisesException] Node? previousNode();
+
[DeprecateAs=NodeIteratorDetach] void detach();
};
diff --git a/core/dom/NodeList.idl b/core/dom/NodeList.idl
index 85a7be8..5e549ca 100644
--- a/core/dom/NodeList.idl
+++ b/core/dom/NodeList.idl
@@ -18,11 +18,14 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-nodelist
+
[
DependentLifetime,
SetWrapperReferenceFrom=virtualOwnerNode,
WillBeGarbageCollected,
] interface NodeList {
- [DartNoAutoScope] getter Node item(unsigned long index);
- [DartNoAutoScope] readonly attribute unsigned long length;
+ getter Node? item(unsigned long index);
+ readonly attribute unsigned long length;
+ // FIXME: iterable<Node>;
};
diff --git a/core/dom/NonDocumentTypeChildNode.idl b/core/dom/NonDocumentTypeChildNode.idl
new file mode 100644
index 0000000..b2883c4
--- /dev/null
+++ b/core/dom/NonDocumentTypeChildNode.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.
+
+// https://dom.spec.whatwg.org/#interface-nondocumenttypechildnode
+
+[
+ LegacyTreatAsPartialInterface,
+ NoInterfaceObject, // Always used on target of 'implements'
+] interface NonDocumentTypeChildNode {
+ [PerWorldBindings] readonly attribute Element previousElementSibling;
+ [PerWorldBindings] readonly attribute Element nextElementSibling;
+};
diff --git a/core/dom/NonElementParentNode.idl b/core/dom/NonElementParentNode.idl
new file mode 100644
index 0000000..3f4ef6e
--- /dev/null
+++ b/core/dom/NonElementParentNode.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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://dom.spec.whatwg.org/#interface-nonelementparentnode
+
+[
+ LegacyTreatAsPartialInterface,
+ NoInterfaceObject, // Always used on target of 'implements'
+] interface NonElementParentNode {
+ [PerWorldBindings] Element? getElementById(DOMString elementId);
+};
diff --git a/core/dom/ParentNode.idl b/core/dom/ParentNode.idl
index dea4bfd..0f722e8 100644
--- a/core/dom/ParentNode.idl
+++ b/core/dom/ParentNode.idl
@@ -28,16 +28,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dom.spec.whatwg.org/#interface-parentnode
+
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
] interface ParentNode {
- [PerWorldBindings] readonly attribute HTMLCollection children;
- [PerWorldBindings] readonly attribute Element firstElementChild;
- [PerWorldBindings] readonly attribute Element lastElementChild;
+ [SameObject, PerWorldBindings] readonly attribute HTMLCollection children;
+ [PerWorldBindings] readonly attribute Element? firstElementChild;
+ [PerWorldBindings] readonly attribute Element? lastElementChild;
readonly attribute unsigned long childElementCount;
- // NodeSelector - Selector API
- [RaisesException] Element querySelector(DOMString selectors);
- [RaisesException] NodeList querySelectorAll(DOMString selectors);
+ [Unscopeable, RaisesException, CustomElementCallbacks, RuntimeEnabled=DOMConvenienceAPI] void prepend((Node or DOMString)... nodes);
+ [Unscopeable, RaisesException, CustomElementCallbacks, RuntimeEnabled=DOMConvenienceAPI] void append((Node or DOMString)... nodes);
+
+ // [Unscopeable] Element? query(DOMString relativeSelectors);
+ // [NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
+ [RaisesException] Element? querySelector(DOMString selectors);
+ [NewObject, RaisesException] NodeList querySelectorAll(DOMString selectors);
};
diff --git a/core/dom/ProcessingInstruction.idl b/core/dom/ProcessingInstruction.idl
index c082c10..650e74c 100644
--- a/core/dom/ProcessingInstruction.idl
+++ b/core/dom/ProcessingInstruction.idl
@@ -18,13 +18,12 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-processinginstruction
+
interface ProcessingInstruction : CharacterData {
+ readonly attribute DOMString target;
- // DOM Level 1
-
- readonly attribute DOMString? target;
-
- // interface LinkStyle from DOM Level 2 Style Sheets
+ // ProcessingInstruction implements LinkStyle
+ // http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction
readonly attribute StyleSheet sheet;
};
-
diff --git a/core/dom/Range.idl b/core/dom/Range.idl
index 51a9da4..5452b45 100644
--- a/core/dom/Range.idl
+++ b/core/dom/Range.idl
@@ -18,13 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// https://dom.spec.whatwg.org/#interface-range
+
+// FIXME: All long types in this interface should be unsigned long.
[
Constructor,
ConstructorCallWith=Document,
WillBeGarbageCollected,
+ TypeChecking=Interface,
] interface Range {
-
readonly attribute Node startContainer;
readonly attribute long startOffset;
readonly attribute Node endContainer;
@@ -32,58 +34,49 @@
readonly attribute boolean collapsed;
readonly attribute Node commonAncestorContainer;
- [RaisesException] void setStart(Node refNode, long offset);
- [RaisesException] void setEnd(Node refNode, long offset);
- [RaisesException] void setStartBefore(Node refNode);
- [RaisesException] void setStartAfter(Node refNode);
- [RaisesException] void setEndBefore(Node refNode);
- [RaisesException] void setEndAfter(Node refNode);
+ [RaisesException] void setStart(Node node, long offset);
+ [RaisesException] void setEnd(Node node, long offset);
+ [RaisesException] void setStartBefore(Node node);
+ [RaisesException] void setStartAfter(Node node);
+ [RaisesException] void setEndBefore(Node node);
+ [RaisesException] void setEndAfter(Node node);
void collapse(optional boolean toStart = false);
- [RaisesException] void selectNode(Node refNode);
- [RaisesException] void selectNodeContents(Node refNode);
+ [RaisesException] void selectNode(Node node);
+ [RaisesException] void selectNodeContents(Node node);
- // CompareHow
const unsigned short START_TO_START = 0;
- const unsigned short START_TO_END = 1;
- const unsigned short END_TO_END = 2;
- const unsigned short END_TO_START = 3;
-
- [RaisesException, TypeChecking=Interface] short compareBoundaryPoints(unsigned short how, Range sourceRange);
+ const unsigned short START_TO_END = 1;
+ const unsigned short END_TO_END = 2;
+ const unsigned short END_TO_START = 3;
+ [RaisesException] short compareBoundaryPoints(unsigned short how, Range sourceRange);
[RaisesException, CustomElementCallbacks] void deleteContents();
- [RaisesException, CustomElementCallbacks] DocumentFragment extractContents();
- [RaisesException, CustomElementCallbacks] DocumentFragment cloneContents();
- [RaisesException, CustomElementCallbacks] void insertNode(Node newNode);
+ [NewObject, RaisesException, CustomElementCallbacks] DocumentFragment extractContents();
+ [NewObject, RaisesException, CustomElementCallbacks] DocumentFragment cloneContents();
+ [RaisesException, CustomElementCallbacks] void insertNode(Node node);
[RaisesException, CustomElementCallbacks] void surroundContents(Node newParent);
- Range cloneRange();
+
+ [NewObject] Range cloneRange();
+ [DeprecateAs=RangeDetach] void detach();
+
+ [RaisesException] boolean isPointInRange(Node node, long offset);
+ [RaisesException] short comparePoint(Node node, long offset);
+
+ [RaisesException] boolean intersectsNode(Node node);
stringifier;
- [DeprecateAs=RangeDetach] void detach();
-
- [RaisesException] boolean isPointInRange(Node refNode, long offset);
- [RaisesException, TypeChecking=Interface] short comparePoint(Node refNode, long offset);
-
- [RaisesException] boolean intersectsNode(Node refNode);
-
- // CSSOM View Module API extensions
-
+ // CSSOM View Module
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-range-interface
+ // FIXME: getClientRect() and getBoundingClientRect() should
+ // return DOMRectList and DOMRect respectively.
ClientRectList getClientRects();
ClientRect getBoundingClientRect();
// DOM Parsing and Serialization
+ // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-the-range-interface
+ [NewObject, RaisesException, CustomElementCallbacks] DocumentFragment createContextualFragment(DOMString fragment);
- [RaisesException, CustomElementCallbacks] DocumentFragment createContextualFragment(DOMString html);
-
- // WebKit extensions
-
- // CompareResults
- const unsigned short NODE_BEFORE = 0;
- const unsigned short NODE_AFTER = 1;
- const unsigned short NODE_BEFORE_AND_AFTER = 2;
- const unsigned short NODE_INSIDE = 3;
-
- [RaisesException, MeasureAs=RangeCompareNode] short compareNode([Default=Undefined] optional Node refNode);
-
- [RaisesException, MeasureAs=RangeExpand] void expand([Default=Undefined] optional DOMString unit);
+ // Non-standard API
+ [RaisesException, DeprecateAs=RangeExpand] void expand([Default=Undefined] optional DOMString unit);
};
diff --git a/core/dom/SharedArrayBuffer.idl b/core/dom/SharedArrayBuffer.idl
new file mode 100644
index 0000000..21bb64b
--- /dev/null
+++ b/core/dom/SharedArrayBuffer.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.
+
+// Draft spec:
+// https://docs.google.com/document/d/1NDGA_gZJ7M7w1Bh8S0AoDyEqwDdRh4uSoTPSNn77PFk
+
+[
+ ImplementedAs=DOMSharedArrayBuffer,
+ NoInterfaceObject,
+ RuntimeEnabled=SharedArrayBuffer,
+] interface SharedArrayBuffer {
+ readonly attribute unsigned long byteLength;
+};
diff --git a/core/dom/Text.idl b/core/dom/Text.idl
index afee652..1d733b9 100644
--- a/core/dom/Text.idl
+++ b/core/dom/Text.idl
@@ -16,19 +16,17 @@
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
+
+// https://dom.spec.whatwg.org/#interface-text
+
[
Constructor(optional DOMString data = ""),
ConstructorCallWith=Document,
- Custom=Wrap,
] interface Text : CharacterData {
+ [NewObject, RaisesException] Text splitText(unsigned long offset);
+ [MeasureAs=TextWholeText] readonly attribute DOMString wholeText;
- // DOM Level 1
- [RaisesException] Text splitText(unsigned long offset);
-
- // Introduced in DOM Level 3:
- readonly attribute DOMString wholeText;
- [MeasureAs=TextReplaceWholeText] Text replaceWholeText(DOMString content); // Removed from DOM4.
-
- // Shadow DOM API
+ // Shadow DOM
+ // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-text-interface
NodeList getDestinationInsertionPoints();
};
diff --git a/core/dom/Touch.idl b/core/dom/Touch.idl
index d7003b6..72bc53c 100644
--- a/core/dom/Touch.idl
+++ b/core/dom/Touch.idl
@@ -23,22 +23,30 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://rawgit.com/w3c/touch-events/v1-errata/touchevents.html#touch-interface
+
[
WillBeGarbageCollected,
] interface Touch {
- readonly attribute double clientX;
- readonly attribute double clientY;
- readonly attribute double screenX;
- readonly attribute double screenY;
- readonly attribute double pageX;
- 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;
- [MeasureAs=PrefixedTouchForce] readonly attribute float webkitForce;
+ readonly attribute long identifier;
+ readonly attribute EventTarget target;
+ readonly attribute double screenX;
+ readonly attribute double screenY;
+ readonly attribute double clientX;
+ readonly attribute double clientY;
+ readonly attribute double pageX;
+ readonly attribute double pageY;
+
+ // Touch Events Extensions
+ // http://rawgit.com/w3c/touch-events/master/touchevents.html#touch-interface
+ readonly attribute float radiusX;
+ readonly attribute float radiusY;
+ readonly attribute float rotationAngle;
+ readonly attribute float force;
+
+ // Non-standard APIs
+ [DeprecateAs=PrefixedTouchRadiusX, ImplementedAs=radiusX] readonly attribute float webkitRadiusX;
+ [DeprecateAs=PrefixedTouchRadiusY, ImplementedAs=radiusY] readonly attribute float webkitRadiusY;
+ [DeprecateAs=PrefixedTouchRotationAngle, ImplementedAs=rotationAngle] readonly attribute float webkitRotationAngle;
+ [DeprecateAs=PrefixedTouchForce, ImplementedAs=force] readonly attribute float webkitForce;
};
diff --git a/core/dom/TouchList.idl b/core/dom/TouchList.idl
index 516946d..a0bd263 100644
--- a/core/dom/TouchList.idl
+++ b/core/dom/TouchList.idl
@@ -23,10 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/touch-events/#touchlist-interface
+
[
WillBeGarbageCollected,
] interface TouchList {
readonly attribute unsigned long length;
-
- getter Touch item(unsigned long index);
+ getter Touch? item(unsigned long index);
};
diff --git a/core/dom/TreeWalker.idl b/core/dom/TreeWalker.idl
index 2fb6eb5..6cfa8a3 100644
--- a/core/dom/TreeWalker.idl
+++ b/core/dom/TreeWalker.idl
@@ -18,22 +18,22 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2
+// https://dom.spec.whatwg.org/#interface-treewalker
+
[
SetWrapperReferenceTo(NodeFilter filter),
WillBeGarbageCollected,
] interface TreeWalker {
- readonly attribute Node root;
+ [SameObject] readonly attribute Node root;
readonly attribute unsigned long whatToShow;
- readonly attribute NodeFilter filter;
- [DeprecateAs=TreeWalkerExpandEntityReferences] readonly attribute boolean expandEntityReferences;
- [RaisesException=Setter] attribute Node currentNode;
+ readonly attribute NodeFilter? filter;
+ [RaisesException=Setter] attribute Node currentNode;
- [RaisesException] Node parentNode();
- [RaisesException] Node firstChild();
- [RaisesException] Node lastChild();
- [RaisesException] Node previousSibling();
- [RaisesException] Node nextSibling();
- [RaisesException] Node previousNode();
- [RaisesException] Node nextNode();
+ [RaisesException] Node? parentNode();
+ [RaisesException] Node? firstChild();
+ [RaisesException] Node? lastChild();
+ [RaisesException] Node? previousSibling();
+ [RaisesException] Node? nextSibling();
+ [RaisesException] Node? previousNode();
+ [RaisesException] Node? nextNode();
};
diff --git a/core/dom/URL.idl b/core/dom/URL.idl
index 64f14fb..8bd9527 100644
--- a/core/dom/URL.idl
+++ b/core/dom/URL.idl
@@ -24,20 +24,28 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://url.spec.whatwg.org/#url
+// https://url.spec.whatwg.org/#url
[
- Constructor(ScalarValueString url),
- Constructor(ScalarValueString url, ScalarValueString base),
- Constructor(ScalarValueString url, URL base),
+ // TODO(philipj): There should only be one constructor:
+ // Constructor(USVString url, optional USVString base)
+ Constructor(USVString url),
+ Constructor(USVString url, USVString base),
+ Constructor(USVString url, URL base),
Exposed=(Window,Worker),
ImplementedAs=DOMURL,
RaisesException=Constructor,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface URL {
- // FIXME: should be in separate URLBlob.idl partial interface definition
- // http://dev.w3.org/2006/webapi/FileAPI/#URL-object
- // FIXME: should not be nullable
+ // TODO(philipj): Implement domainToASCII() and domainToUnicode().
+ // crbug.com/493908
+ // static USVString domainToASCII(USVString domain);
+ // static USVString domainToUnicode(USVString domain);
+
+ // TODO(philipj): This should be in a partial interface definition:
+ // File API
+ // https://w3c.github.io/FileAPI/#creating-revoking
+ // TODO(philipj): Neither the return value nor the argument should be nullable.
[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 5f0e115..8826e11 100644
--- a/core/dom/URLUtils.idl
+++ b/core/dom/URLUtils.idl
@@ -23,26 +23,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://url.spec.whatwg.org/#urlutils
+// https://url.spec.whatwg.org/#urlutils
[
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
] interface URLUtils {
// FIXME: should be stringifier: http://crbug.com/306606
- // stringifier attribute ScalarValueString href;
- attribute ScalarValueString href;
- [NotEnumerable, ImplementedAs=href] ScalarValueString toString();
- readonly attribute ScalarValueString origin;
+ // stringifier attribute USVString href;
+ attribute USVString href;
+ [NotEnumerable, ImplementedAs=href] USVString toString();
+ readonly attribute USVString origin;
- attribute ScalarValueString protocol;
- attribute ScalarValueString username;
- attribute ScalarValueString password;
- attribute ScalarValueString host;
- attribute ScalarValueString hostname;
- attribute ScalarValueString port;
- attribute ScalarValueString pathname;
- attribute ScalarValueString search;
+ attribute USVString protocol;
+ attribute USVString username;
+ attribute USVString password;
+ attribute USVString host;
+ attribute USVString hostname;
+ attribute USVString port;
+ attribute USVString pathname;
+ attribute USVString search;
// Not yet implemented.
// attribute URLSearchParams searchParams;
- attribute ScalarValueString hash;
+ attribute USVString hash;
};
diff --git a/core/dom/URLUtilsReadOnly.idl b/core/dom/URLUtilsReadOnly.idl
index 5330196..9f5aac0 100644
--- a/core/dom/URLUtilsReadOnly.idl
+++ b/core/dom/URLUtilsReadOnly.idl
@@ -23,22 +23,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://url.spec.whatwg.org/#urlutilsreadonly
+// https://url.spec.whatwg.org/#urlutilsreadonly
[
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
] interface URLUtilsReadOnly {
// FIXME: should be stringifier: http://crbug.com/306606
- // stringifier readonly attribute ScalarValueString href;
- readonly attribute ScalarValueString href;
- [NotEnumerable, ImplementedAs=href] ScalarValueString toString();
- readonly attribute ScalarValueString origin;
+ // stringifier readonly attribute USVString href;
+ readonly attribute USVString href;
+ [NotEnumerable, ImplementedAs=href] USVString toString();
+ readonly attribute USVString origin;
- 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;
+ readonly attribute USVString protocol;
+ readonly attribute USVString host;
+ readonly attribute USVString hostname;
+ readonly attribute USVString port;
+ readonly attribute USVString pathname;
+ readonly attribute USVString search;
+ readonly attribute USVString hash;
};
diff --git a/core/dom/Uint16Array.idl b/core/dom/Uint16Array.idl
new file mode 100644
index 0000000..c494d06
--- /dev/null
+++ b/core/dom/Uint16Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMUint16Array,
+ NoInterfaceObject,
+] interface Uint16Array : ArrayBufferView {
+};
diff --git a/core/dom/Uint32Array.idl b/core/dom/Uint32Array.idl
new file mode 100644
index 0000000..c68b421
--- /dev/null
+++ b/core/dom/Uint32Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMUint32Array,
+ NoInterfaceObject,
+] interface Uint32Array : ArrayBufferView {
+};
diff --git a/core/dom/Uint8Array.idl b/core/dom/Uint8Array.idl
new file mode 100644
index 0000000..5070342
--- /dev/null
+++ b/core/dom/Uint8Array.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMUint8Array,
+ NoInterfaceObject,
+] interface Uint8Array : ArrayBufferView {
+};
diff --git a/core/dom/Uint8ClampedArray.idl b/core/dom/Uint8ClampedArray.idl
new file mode 100644
index 0000000..0b74baf
--- /dev/null
+++ b/core/dom/Uint8ClampedArray.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.
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
+
+[
+ ImplementedAs=DOMUint8ClampedArray,
+ NoInterfaceObject,
+] interface Uint8ClampedArray : ArrayBufferView {
+};
diff --git a/core/dom/XMLDocument.idl b/core/dom/XMLDocument.idl
index a41fb18..df60667 100644
--- a/core/dom/XMLDocument.idl
+++ b/core/dom/XMLDocument.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dom.spec.whatwg.org/#xmldocument
+
interface XMLDocument : Document {
};
diff --git a/core/dom/shadow/ShadowRoot.idl b/core/dom/shadow/ShadowRoot.idl
index f884756..cfb06f2 100644
--- a/core/dom/shadow/ShadowRoot.idl
+++ b/core/dom/shadow/ShadowRoot.idl
@@ -24,24 +24,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface
+
interface ShadowRoot : DocumentFragment {
- readonly attribute Element activeElement;
-
- [ImplementedAs=olderShadowRootForBindings] readonly attribute ShadowRoot olderShadowRoot;
-
- [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([Default=Undefined] optional DOMString? namespaceURI,
- [Default=Undefined] optional DOMString localName);
-
- Element elementFromPoint([Default=Undefined] optional long x,
- [Default=Undefined] optional long y);
-
- readonly attribute StyleSheetList styleSheets;
+ Selection? getSelection();
+ // TODO(philipj): The x and y arguments should be of type double.
+ Element? elementFromPoint(long x, long y);
+ sequence<Element> elementsFromPoint(long x, long y);
+ readonly attribute Element? activeElement;
readonly attribute Element host;
+ [ImplementedAs=olderShadowRootForBindings] readonly attribute ShadowRoot? olderShadowRoot;
+ [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerHTML;
+ readonly attribute StyleSheetList styleSheets;
+ [RuntimeEnabled=ShadowRootDelegatesFocus] readonly attribute boolean delegatesFocus;
+
+ // TODO(philipj): The spec does not override cloneNode() on the ShadowRoot
+ // interface. Here, it's used to implement "Invoking the cloneNode() method
+ // on a ShadowRoot instance must always throw a DATA_CLONE_ERR exception" as
+ // Node.cloneNode() does not have [RaisesException].
+ [RaisesException] Node cloneNode([Default=Undefined] optional boolean deep);
};
diff --git a/core/dom/shadow/ShadowRootInit.idl b/core/dom/shadow/ShadowRootInit.idl
new file mode 100644
index 0000000..a2a97dc
--- /dev/null
+++ b/core/dom/shadow/ShadowRootInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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.
+
+// Spec: https://w3c.github.io/webcomponents/spec/shadow/#shadowrootinit-dictionary
+
+enum ShadowRootMode { "open", "closed" };
+
+dictionary ShadowRootInit {
+ ShadowRootMode mode;
+ [RuntimeEnabled=ShadowRootDelegatesFocus] boolean delegatesFocus;
+};
diff --git a/core/editing/Selection.idl b/core/editing/Selection.idl
index 263a3c2..a7ad07b 100644
--- a/core/editing/Selection.idl
+++ b/core/editing/Selection.idl
@@ -27,67 +27,65 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// 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
+// http://w3c.github.io/selection-api/#idl-def-Selection
+
+// TODO(yoichio): All long types should be unsigned long. crbug.com/391673
[
ImplementedAs=DOMSelection,
WillBeGarbageCollected,
] interface Selection {
- readonly attribute Node anchorNode;
+ readonly attribute Node? anchorNode;
readonly attribute long anchorOffset;
- readonly attribute Node focusNode;
+ readonly attribute Node? focusNode;
readonly attribute long focusOffset;
-
readonly attribute boolean isCollapsed;
+ readonly attribute long rangeCount;
+ [RaisesException] Range getRangeAt(long index);
+ void addRange(Range range);
+ // TODO(yoichio): Implement removeRange. crbug.com/391673
+ //void removeRange(Range range);
+ void removeAllRanges();
+ // TODO(yoichio): The node argument should not be nullable. crbug.com/391673
+ // TODO(philipj): The offset argument should not have a default value.
[RaisesException] void collapse(Node? node, optional long offset = 0);
[RaisesException] void collapseToStart();
[RaisesException] void collapseToEnd();
-
- // We mark offset as optional, defaulting to 0; this differs from spec.
- // http://crbug.com/384966
+ // TODO(philipj): The offset argument should not have a default value.
[RaisesException, TypeChecking=Interface] void extend(Node node, optional long offset = 0);
-
- [RaisesException] void selectAllChildren([Default=Undefined] optional Node node);
- [CustomElementCallbacks] void deleteFromDocument();
-
- readonly attribute long rangeCount;
- [RaisesException] Range getRangeAt([Default=Undefined] optional long index);
- void addRange([Default=Undefined] optional Range range);
- void removeAllRanges();
-
- [NotEnumerable] stringifier;
-
- // Firefox extensions
- // https://developer.mozilla.org/En/DOM/Selection
- //
- [MeasureAs=SelectionContainsNode] boolean containsNode([Default = Undefined] optional Node node, [Default = Undefined] optional boolean allowPartial);
-
- // WebKit extensions
- [MeasureAs=SelectionBaseNode] readonly attribute Node baseNode;
- [MeasureAs=SelectionBaseOffset] readonly attribute long baseOffset;
- [MeasureAs=SelectionExtentNode] readonly attribute Node extentNode;
- [MeasureAs=SelectionExtentOffset] readonly attribute long extentOffset;
-
- // WebKit's "type" accessor returns "None", "Range" and "Caret"
- // IE's type accessor returns "none", "text" and "control"
- [MeasureAs=SelectionType] readonly attribute DOMString type;
-
- [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMString alter,
- [Default=Undefined] optional DOMString direction,
- [Default=Undefined] optional DOMString granularity);
+ // TODO(philipj): The arguments should be anchorNode, anchorOffset,
+ // focusNode and focusOffset, and none of them should be optional.
[MeasureAs=SelectionSetBaseAndExtent, RaisesException] void setBaseAndExtent([Default=Undefined] optional Node baseNode,
[Default=Undefined] optional long baseOffset,
[Default=Undefined] optional Node extentNode,
[Default=Undefined] optional long extentOffset);
- [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException] void setPosition(Node? node, optional long offset = 0);
+ [RaisesException, TypeChecking=Interface] void selectAllChildren(Node node);
+ [CustomElementCallbacks] void deleteFromDocument();
+ // TODO(philipj): The arguments should not be optional.
+ [MeasureAs=SelectionContainsNode] boolean containsNode([Default=Undefined] optional Node node, [Default=Undefined] optional boolean allowPartialContainment);
+ // TODO(philipj): The spec does not use [NotEnumerable]. See also:
+ // https://codereview.chromium.org/345983004/
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26179
+ [NotEnumerable] stringifier DOMString ();
- // IE extensions
- // http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
+ // Non-standard APIs
+
+ // https://github.com/w3c/selection-api/issues/34
+ [MeasureAs=SelectionBaseNode] readonly attribute Node? baseNode;
+ [MeasureAs=SelectionBaseOffset] readonly attribute long baseOffset;
+ [MeasureAs=SelectionExtentNode] readonly attribute Node? extentNode;
+ [MeasureAs=SelectionExtentOffset] readonly attribute long extentOffset;
+
+ // https://github.com/w3c/selection-api/issues/14
+ [MeasureAs=SelectionType] readonly attribute DOMString type;
+
+ // https://github.com/w3c/selection-api/issues/36
[MeasureAs=SelectionEmpty] void empty();
+
+ // https://github.com/w3c/selection-api/issues/37
+ [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMString alter,
+ [Default=Undefined] optional DOMString direction,
+ [Default=Undefined] optional DOMString granularity);
+
+ // https://github.com/w3c/selection-api/issues/38
+ [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException] void setPosition(Node? node, optional long offset = 0);
};
diff --git a/core/events/WebKitAnimationEvent.idl b/core/events/AnimationEvent.idl
similarity index 77%
rename from core/events/WebKitAnimationEvent.idl
rename to core/events/AnimationEvent.idl
index 44f3266..8b0b794 100644
--- a/core/events/WebKitAnimationEvent.idl
+++ b/core/events/AnimationEvent.idl
@@ -23,10 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface WebKitAnimationEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString animationName;
- [InitializedByEventConstructor] readonly attribute double elapsedTime;
-};
+// http://dev.w3.org/csswg/css-animations/#interface-animationevent
+[
+ Constructor(DOMString type, optional AnimationEventInit eventInitDict),
+] interface AnimationEvent : Event {
+ readonly attribute DOMString animationName;
+ // TODO(philipj): elapsedTime should be float.
+ readonly attribute double elapsedTime;
+ // TODO(philipj): readonly attribute DOMString pseudoElement;
+};
diff --git a/core/events/AnimationEventInit.idl b/core/events/AnimationEventInit.idl
new file mode 100644
index 0000000..ae6c9b9
--- /dev/null
+++ b/core/events/AnimationEventInit.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.
+
+// http://dev.w3.org/csswg/css-animations/#interface-animationevent
+
+dictionary AnimationEventInit : EventInit {
+ DOMString animationName = "";
+ // TODO(philipj): elapsedTime should be float.
+ double elapsedTime = 0.0;
+ // TODO(philipj): DOMString pseudoElement = "";
+};
diff --git a/core/events/AnimationPlayerEvent.idl b/core/events/AnimationPlayerEvent.idl
index a719ec7..bfd724a 100644
--- a/core/events/AnimationPlayerEvent.idl
+++ b/core/events/AnimationPlayerEvent.idl
@@ -2,11 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://www.w3.org/TR/web-animations/#the-animationplayerevent-interface
+
+// TODO(dstockwell): This interface has been removed in the latest spec:
+// https://w3c.github.io/web-animations/
+
[
- EventConstructor,
+ Constructor(DOMString type, optional AnimationPlayerEventInit eventInitDict),
RuntimeEnabled=WebAnimationsAPI,
] interface AnimationPlayerEvent : Event {
- [InitializedByEventConstructor] readonly attribute double currentTime;
- [InitializedByEventConstructor] readonly attribute double timelineTime;
+ readonly attribute double currentTime;
+ readonly attribute double timelineTime;
};
-
diff --git a/core/events/AnimationPlayerEventInit.idl b/core/events/AnimationPlayerEventInit.idl
new file mode 100644
index 0000000..f77620d
--- /dev/null
+++ b/core/events/AnimationPlayerEventInit.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.
+
+// http://www.w3.org/TR/web-animations/#the-animationplayerevent-interface
+
+// TODO(dstockwell): This dictionary has been removed in the latest spec:
+// https://w3c.github.io/web-animations/
+
+dictionary AnimationPlayerEventInit : EventInit {
+ double? currentTime = null;
+ double? timelineTime = null;
+};
diff --git a/core/events/ApplicationCacheErrorEvent.idl b/core/events/ApplicationCacheErrorEvent.idl
index c69c3f7..debc4a0 100644
--- a/core/events/ApplicationCacheErrorEvent.idl
+++ b/core/events/ApplicationCacheErrorEvent.idl
@@ -2,11 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// ApplicationCache Error Detail Proposal:
+// https://docs.google.com/document/d/1nlk7WgRD3d0ZcfK1xrwBFVZ3DI_e44j7QoMd5gAJC4E/edit
+
+// TODO(philipj): Update the spec link once this is in the HTML spec:
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22702
+
[
- EventConstructor,
+ Constructor(DOMString type, optional ApplicationCacheErrorEventInit eventInitDict),
] interface ApplicationCacheErrorEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString reason;
- [InitializedByEventConstructor] readonly attribute DOMString url;
- [InitializedByEventConstructor] readonly attribute unsigned short status;
- [InitializedByEventConstructor] readonly attribute DOMString message;
+ readonly attribute DOMString reason;
+ readonly attribute DOMString url;
+ readonly attribute unsigned short status;
+ readonly attribute DOMString message;
};
diff --git a/core/events/ApplicationCacheErrorEventInit.idl b/core/events/ApplicationCacheErrorEventInit.idl
new file mode 100644
index 0000000..8a82332
--- /dev/null
+++ b/core/events/ApplicationCacheErrorEventInit.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.
+
+dictionary ApplicationCacheErrorEventInit : EventInit {
+ DOMString reason;
+ DOMString url;
+ unsigned short status;
+ DOMString message;
+};
diff --git a/core/events/AutocompleteErrorEvent.idl b/core/events/AutocompleteErrorEvent.idl
index 865d62e..a65f1ee 100644
--- a/core/events/AutocompleteErrorEvent.idl
+++ b/core/events/AutocompleteErrorEvent.idl
@@ -22,9 +22,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface AutocompleteErrorEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString reason;
-};
+// https://html.spec.whatwg.org/multipage/forms.html#the-autocompleteerrorevent-interface
+enum AutocompleteErrorReason { "" /* empty string */, "cancel", "disabled", "invalid" };
+
+[
+ Constructor(DOMString type, optional AutocompleteErrorEventInit eventInitDict),
+] interface AutocompleteErrorEvent : Event {
+ readonly attribute AutocompleteErrorReason reason;
+};
diff --git a/core/events/AutocompleteErrorEventInit.idl b/core/events/AutocompleteErrorEventInit.idl
new file mode 100644
index 0000000..840ce04
--- /dev/null
+++ b/core/events/AutocompleteErrorEventInit.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.
+
+// https://html.spec.whatwg.org/multipage/forms.html#the-autocompleteerrorevent-interface
+
+dictionary AutocompleteErrorEventInit : EventInit {
+ AutocompleteErrorReason reason;
+};
diff --git a/core/events/BeforeUnloadEvent.idl b/core/events/BeforeUnloadEvent.idl
index 618d558..cf47d45 100644
--- a/core/events/BeforeUnloadEvent.idl
+++ b/core/events/BeforeUnloadEvent.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-beforeunloadevent-interface
+
interface BeforeUnloadEvent : Event {
attribute DOMString returnValue;
};
diff --git a/core/events/ClipboardEvent.idl b/core/events/ClipboardEvent.idl
new file mode 100644
index 0000000..0b10b27
--- /dev/null
+++ b/core/events/ClipboardEvent.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.
+
+// https://w3c.github.io/clipboard-apis/#clipboard-event-interfaces
+
+// TODO(philipj): There should be a constructor which takes a ClipboardEventInit
+// dictionary. crbug.com/496394
+interface ClipboardEvent : Event {
+ readonly attribute DataTransfer clipboardData;
+};
diff --git a/core/events/CompositionEvent.idl b/core/events/CompositionEvent.idl
index 8b1d740..3d2a209 100644
--- a/core/events/CompositionEvent.idl
+++ b/core/events/CompositionEvent.idl
@@ -23,20 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/uievents/#interface-CompositionEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional CompositionEventInit eventInitDict),
] interface CompositionEvent : UIEvent {
+ readonly attribute DOMString data;
- [InitializedByEventConstructor] readonly attribute DOMString data;
-
- [RuntimeEnabled=IMEAPI] readonly attribute long activeSegmentStart;
- [RuntimeEnabled=IMEAPI] readonly attribute long activeSegmentEnd;
- [RuntimeEnabled=IMEAPI] sequence<unsigned long> getSegments();
-
- void initCompositionEvent([Default=Undefined] optional DOMString typeArg,
- [Default=Undefined] optional boolean canBubbleArg,
- [Default=Undefined] optional boolean cancelableArg,
- [Default=Undefined] optional Window viewArg,
- [Default=Undefined] optional DOMString dataArg);
-
+ // https://w3c.github.io/uievents/#idl-interface-CompositionEvent-initializers
+ // TODO(philipj): None of the initCompositionEvent() arguments should be
+ // optional, and the spec has a locale argument after data.
+ [Measure] void initCompositionEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional Window? view,
+ [Default=Undefined] optional DOMString data);
};
diff --git a/core/events/CompositionEventInit.idl b/core/events/CompositionEventInit.idl
new file mode 100644
index 0000000..fcf09de
--- /dev/null
+++ b/core/events/CompositionEventInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-CompositionEventInit
+
+dictionary CompositionEventInit : UIEventInit {
+ DOMString data = "";
+};
diff --git a/core/events/CustomEvent.idl b/core/events/CustomEvent.idl
index 4ad348b..4d4cb08 100644
--- a/core/events/CustomEvent.idl
+++ b/core/events/CustomEvent.idl
@@ -23,13 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface CustomEvent : Event {
- [Custom=Getter, InitializedByEventConstructor] readonly attribute any detail;
+// https://dom.spec.whatwg.org/#interface-customevent
- [Custom] void initCustomEvent([Default=Undefined] optional DOMString typeArg,
- [Default=Undefined] optional boolean canBubbleArg,
- [Default=Undefined] optional boolean cancelableArg,
- [Default=Undefined] optional any detailArg);
+[
+ Constructor(DOMString type, optional CustomEventInit eventInitDict),
+ Exposed=(Window,Worker),
+] interface CustomEvent : Event {
+ [Custom=Getter] readonly attribute any detail;
+
+ // FIXME: initCustomEvent()'s arguments should not be optional.
+ [Custom, Measure] void initCustomEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional any detail);
};
diff --git a/core/events/CustomEventInit.idl b/core/events/CustomEventInit.idl
new file mode 100644
index 0000000..0c02acd
--- /dev/null
+++ b/core/events/CustomEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://dom.spec.whatwg.org/#interface-customevent
+
+dictionary CustomEventInit : EventInit {
+ any detail = null;
+};
diff --git a/core/events/ErrorEvent.idl b/core/events/ErrorEvent.idl
index ad12285..a26bac6 100644
--- a/core/events/ErrorEvent.idl
+++ b/core/events/ErrorEvent.idl
@@ -28,13 +28,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface ErrorEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString message;
- [InitializedByEventConstructor] readonly attribute DOMString filename;
- [InitializedByEventConstructor] readonly attribute unsigned long lineno;
- [InitializedByEventConstructor] readonly attribute unsigned long colno;
- [Custom=Getter, InitializedByEventConstructor] readonly attribute any error;
-};
+// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
+[
+ Constructor(DOMString type, optional ErrorEventInit eventInitDict),
+ // TODO(philipj): Exposed=(Window,Worker)
+] interface ErrorEvent : Event {
+ readonly attribute DOMString message;
+ readonly attribute DOMString filename;
+ readonly attribute unsigned long lineno;
+ readonly attribute unsigned long colno;
+ [Custom=Getter] readonly attribute any error;
+};
diff --git a/core/events/ErrorEventInit.idl b/core/events/ErrorEventInit.idl
new file mode 100644
index 0000000..8a48d18
--- /dev/null
+++ b/core/events/ErrorEventInit.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
+
+dictionary ErrorEventInit : EventInit {
+ DOMString message;
+ DOMString filename;
+ unsigned long lineno;
+ unsigned long colno;
+ any error;
+};
diff --git a/core/events/Event.idl b/core/events/Event.idl
index 58a832a..0a40ba6 100644
--- a/core/events/Event.idl
+++ b/core/events/Event.idl
@@ -18,59 +18,62 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
+// https://dom.spec.whatwg.org/#interface-event
+
[
+ Constructor(DOMString type, optional EventInit eventInitDict),
+ Exposed=(Window,Worker),
WillBeGarbageCollected,
- Custom=Wrap,
- EventConstructor,
] interface Event {
+ readonly attribute DOMString type;
+ readonly attribute EventTarget? target;
+ readonly attribute EventTarget? currentTarget;
- // DOM PhaseType
- const unsigned short NONE = 0;
- const unsigned short CAPTURING_PHASE = 1;
- const unsigned short AT_TARGET = 2;
- const unsigned short BUBBLING_PHASE = 3;
+ const unsigned short NONE = 0;
+ const unsigned short CAPTURING_PHASE = 1;
+ const unsigned short AT_TARGET = 2;
+ const unsigned short BUBBLING_PHASE = 3;
+ readonly attribute unsigned short eventPhase;
- // Reverse-engineered from Netscape
- const unsigned short MOUSEDOWN = 1;
- const unsigned short MOUSEUP = 2;
- const unsigned short MOUSEOVER = 4;
- const unsigned short MOUSEOUT = 8;
- const unsigned short MOUSEMOVE = 16;
- const unsigned short MOUSEDRAG = 32;
- const unsigned short CLICK = 64;
- const unsigned short DBLCLICK = 128;
- const unsigned short KEYDOWN = 256;
- const unsigned short KEYUP = 512;
- const unsigned short KEYPRESS = 1024;
- const unsigned short DRAGDROP = 2048;
- const unsigned short FOCUS = 4096;
- const unsigned short BLUR = 8192;
- const unsigned short SELECT = 16384;
- const unsigned short CHANGE = 32768;
-
- readonly attribute DOMString type;
- readonly attribute EventTarget target;
- readonly attribute EventTarget currentTarget;
- readonly attribute unsigned short eventPhase;
- [InitializedByEventConstructor] readonly attribute boolean bubbles;
- [InitializedByEventConstructor] readonly attribute boolean cancelable;
- readonly attribute DOMTimeStamp timeStamp;
-
- void stopPropagation();
- void preventDefault();
- void initEvent([Default=Undefined] optional DOMString eventTypeArg,
- [Default=Undefined] optional boolean canBubbleArg,
- [Default=Undefined] optional boolean cancelableArg);
-
- // DOM Level 3 Additions.
- readonly attribute boolean defaultPrevented;
+ void stopPropagation();
void stopImmediatePropagation();
- // IE Extensions
+ readonly attribute boolean bubbles;
+ readonly attribute boolean cancelable;
+ void preventDefault();
+ readonly attribute boolean defaultPrevented;
+
+ // FIXME: Implement the isTrusted attribute. crbug.com/334015
+ // [Unforgeable] readonly attribute boolean isTrusted;
+ readonly attribute DOMTimeStamp timeStamp;
+
+ // FIXME: initEvent()'s arguments should not be optional.
+ [Measure] void initEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable);
+
+ // Shadow DOM
+ // https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface
+ [MeasureAs=EventPath, CallWith=ScriptState] readonly attribute EventTarget[] path;
+
+ // Non-standard APIs
+ const unsigned short MOUSEDOWN = 1;
+ const unsigned short MOUSEUP = 2;
+ const unsigned short MOUSEOVER = 4;
+ const unsigned short MOUSEOUT = 8;
+ const unsigned short MOUSEMOVE = 16;
+ const unsigned short MOUSEDRAG = 32;
+ const unsigned short CLICK = 64;
+ const unsigned short DBLCLICK = 128;
+ const unsigned short KEYDOWN = 256;
+ const unsigned short KEYUP = 512;
+ const unsigned short KEYPRESS = 1024;
+ const unsigned short DRAGDROP = 2048;
+ const unsigned short FOCUS = 4096;
+ const unsigned short BLUR = 8192;
+ const unsigned short SELECT = 16384;
+ const unsigned short CHANGE = 32768;
[MeasureAs=EventSrcElement] readonly attribute EventTarget srcElement;
- [CallWith=ExecutionContext, ImplementedAs=legacyReturnValue, MeasureAs=EventReturnValue] attribute boolean returnValue;
+ [MeasureAs=EventReturnValue, CallWith=ExecutionContext, ImplementedAs=legacyReturnValue] attribute boolean returnValue;
[MeasureAs=EventCancelBubble] attribute boolean cancelBubble;
- [MeasureAs=EventPath] readonly attribute NodeList path;
- [Custom=Getter, MeasureAs=EventClipboardData] readonly attribute DataTransfer clipboardData;
};
diff --git a/core/events/EventInit.idl b/core/events/EventInit.idl
new file mode 100644
index 0000000..f94cf4e
--- /dev/null
+++ b/core/events/EventInit.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.
+
+// https://dom.spec.whatwg.org/#interface-event
+
+dictionary EventInit {
+ boolean bubbles = false;
+ boolean cancelable = false;
+};
diff --git a/core/events/EventListener.idl b/core/events/EventListener.idl
index fc4b8bc..3f601bd 100644
--- a/core/events/EventListener.idl
+++ b/core/events/EventListener.idl
@@ -18,7 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#callbackdef-eventlistener
+
callback interface EventListener {
void handleEvent(Event event);
};
-
diff --git a/core/events/EventModifierInit.idl b/core/events/EventModifierInit.idl
new file mode 100644
index 0000000..7c28e78
--- /dev/null
+++ b/core/events/EventModifierInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-EventModifierInit
+
+dictionary EventModifierInit : UIEventInit {
+ boolean ctrlKey = false;
+ boolean shiftKey = false;
+ boolean altKey = false;
+ boolean metaKey = false;
+ // FIXME: Add modifierXXX members when needed.
+};
diff --git a/core/events/EventTarget.idl b/core/events/EventTarget.idl
index eacdc4e..3a37d19 100644
--- a/core/events/EventTarget.idl
+++ b/core/events/EventTarget.idl
@@ -18,18 +18,17 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-eventtarget
+
[
CheckSecurity=Window,
- Custom=ToV8,
WillBeGarbageCollected,
+ Exposed=(Window,Worker)
] interface EventTarget {
// FIXME: first 2 args should be required, but throwing TypeError breaks
// legacy content. http://crbug.com/353484
- void addEventListener(optional DOMString? type,
- optional EventListener listener,
- optional boolean useCapture);
- void removeEventListener(optional DOMString? type,
- optional EventListener listener,
- optional boolean useCapture);
+ // FIXME: type should not be nullable.
+ [Custom=(CallPrologue,CallEpilogue)] void addEventListener(optional DOMString? type = null, optional EventListener? listener = null, optional boolean capture = false);
+ [Custom=(CallPrologue,CallEpilogue)] void removeEventListener(optional DOMString? type = null, optional EventListener? listener = null, optional boolean capture = false);
[RaisesException] boolean dispatchEvent(Event event);
};
diff --git a/core/events/FocusEvent.idl b/core/events/FocusEvent.idl
index 0a189d3..2f95287 100644
--- a/core/events/FocusEvent.idl
+++ b/core/events/FocusEvent.idl
@@ -23,8 +23,10 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/uievents/#interface-FocusEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional FocusEventInit eventInitDict),
] interface FocusEvent : UIEvent {
- [InitializedByEventConstructor] readonly attribute EventTarget? relatedTarget;
+ readonly attribute EventTarget? relatedTarget;
};
diff --git a/core/events/FocusEventInit.idl b/core/events/FocusEventInit.idl
new file mode 100644
index 0000000..43518f6
--- /dev/null
+++ b/core/events/FocusEventInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-FocusEventInit
+
+dictionary FocusEventInit : UIEventInit {
+ EventTarget? relatedTarget = null;
+};
diff --git a/core/events/HashChangeEvent.idl b/core/events/HashChangeEvent.idl
index e5101b8..663fd57 100644
--- a/core/events/HashChangeEvent.idl
+++ b/core/events/HashChangeEvent.idl
@@ -17,16 +17,20 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in http://www.whatwg.org/specs/web-apps/current-work/multiframe/History.html#event-hashchange
-[
- EventConstructor,
-] interface HashChangeEvent : Event {
- void initHashChangeEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean canBubble,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional DOMString oldURL,
- [Default=Undefined] optional DOMString newURL);
- [InitializedByEventConstructor] readonly attribute DOMString oldURL;
- [InitializedByEventConstructor] readonly attribute DOMString newURL;
-};
+// https://html.spec.whatwg.org/multipage/browsers.html#the-hashchangeevent-interface
+[
+ Constructor(DOMString type, optional HashChangeEventInit eventInitDict),
+ // TODO(philipj): Exposed=(Window,Worker)
+] interface HashChangeEvent : Event {
+ readonly attribute DOMString oldURL;
+ readonly attribute DOMString newURL;
+
+ // TODO(philipj): initHashChangeEvent() has been removed from the spec:
+ // https://html5.org/r/6551
+ [Measure] void initHashChangeEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean canBubble,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional DOMString oldURL,
+ [Default=Undefined] optional DOMString newURL);
+};
diff --git a/core/events/HashChangeEventInit.idl b/core/events/HashChangeEventInit.idl
new file mode 100644
index 0000000..495ba59
--- /dev/null
+++ b/core/events/HashChangeEventInit.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.
+
+// https://html.spec.whatwg.org/multipage/browsers.html#hashchangeevent
+
+dictionary HashChangeEventInit : EventInit {
+ DOMString oldURL;
+ DOMString newURL;
+};
diff --git a/core/events/KeyboardEvent.idl b/core/events/KeyboardEvent.idl
index ca68d36..a83b365 100644
--- a/core/events/KeyboardEvent.idl
+++ b/core/events/KeyboardEvent.idl
@@ -18,35 +18,47 @@
* Boston, MA 02110-1301, USA.
*/
+// https://w3c.github.io/uievents/#interface-KeyboardEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional KeyboardEventInit eventInitDict),
+ ConstructorCallWith=ScriptState,
] interface KeyboardEvent : UIEvent {
+ // KeyLocationCode
const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
+ [RuntimeEnabled=KeyboardEventKey] readonly attribute DOMString key;
+ [RuntimeEnabled=KeyboardEventCode] readonly attribute DOMString code;
+ readonly attribute unsigned long location;
+ readonly attribute boolean ctrlKey;
+ readonly attribute boolean shiftKey;
+ readonly attribute boolean altKey;
+ readonly attribute boolean metaKey;
+ readonly attribute boolean repeat;
+ // TODO(philipj): readonly attribute boolean isComposing;
+ boolean getModifierState(DOMString keyArg);
- [InitializedByEventConstructor] readonly attribute DOMString keyIdentifier;
- [InitializedByEventConstructor] readonly attribute unsigned long location;
- [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation, InitializedByEventConstructor] readonly attribute unsigned long keyLocation; // Deprecated.
- [InitializedByEventConstructor] readonly attribute boolean ctrlKey;
- [InitializedByEventConstructor] readonly attribute boolean shiftKey;
- [InitializedByEventConstructor] readonly attribute boolean altKey;
- [InitializedByEventConstructor] readonly attribute boolean metaKey;
- [InitializedByEventConstructor] readonly attribute boolean repeat;
+ // https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers
+ // FIXME: this does not match the version in the spec.
+ [CallWith=ScriptState, Measure] void initKeyboardEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional Window view,
+ [Default=Undefined] optional DOMString keyIdentifier,
+ [Default=Undefined] optional unsigned long location,
+ [Default=Undefined] optional boolean ctrlKey,
+ [Default=Undefined] optional boolean altKey,
+ [Default=Undefined] optional boolean shiftKey,
+ [Default=Undefined] optional boolean metaKey);
- boolean getModifierState(DOMString keyArgument);
+ // https://w3c.github.io/uievents/#KeyboardEvent-supplemental-interface
+ readonly attribute long charCode;
+ readonly attribute long keyCode;
+ readonly attribute long which;
- // FIXME: this does not match the version in the DOM spec.
- void initKeyboardEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean canBubble,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional Window view,
- [Default=Undefined] optional DOMString keyIdentifier,
- [Default=Undefined] optional unsigned long location,
- [Default=Undefined] optional boolean ctrlKey,
- [Default=Undefined] optional boolean altKey,
- [Default=Undefined] optional boolean shiftKey,
- [Default=Undefined] optional boolean metaKey);
+ // Non-standard APIs
+ [Measure] readonly attribute DOMString keyIdentifier;
+ [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation] readonly attribute unsigned long keyLocation;
};
-
diff --git a/core/events/KeyboardEventInit.idl b/core/events/KeyboardEventInit.idl
new file mode 100644
index 0000000..80a6007
--- /dev/null
+++ b/core/events/KeyboardEventInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-KeyboardEventInit
+
+dictionary KeyboardEventInit : EventModifierInit {
+ // TODO(philipj): DOMString key = "";
+ // TODO(philipj): DOMString code = "";
+ unsigned long location = 0;
+ boolean repeat = false;
+ // TODO(philipj): boolean isComposing = false;
+
+ // Non-standard APIs
+ DOMString keyIdentifier = "";
+ [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation] unsigned long keyLocation = 0;
+};
diff --git a/core/events/MessageEvent.idl b/core/events/MessageEvent.idl
index 3f2fadc..588a939 100644
--- a/core/events/MessageEvent.idl
+++ b/core/events/MessageEvent.idl
@@ -25,17 +25,22 @@
*
*/
+// https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces
+
[
- EventConstructor,
+ Constructor(DOMString type, optional MessageEventInit eventInitDict),
Exposed=(Window,Worker),
RaisesException=Constructor,
- Custom=Wrap,
] interface MessageEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString origin;
- [InitializedByEventConstructor] readonly attribute DOMString lastEventId;
- [InitializedByEventConstructor] readonly attribute EventTarget? source; // May be a Window or a MessagePort
- [InitializedByEventConstructor, Custom=Getter] readonly attribute any data;
- [InitializedByEventConstructor] readonly attribute MessagePort[] ports;
+ [Custom=Getter] readonly attribute any data;
+ readonly attribute DOMString origin;
+ readonly attribute DOMString lastEventId;
+ // TODO(bashi): |source| should be (WindowProxy or MessagePort)?
+ readonly attribute EventTarget? source;
+ readonly attribute MessagePort[]? ports;
+
+ // TODO(philipj): None of the initMessageEvent() arguments should be
+ // optional, and |sourceArg| and |portsArg| are of the wrong type.
[Custom, MeasureAs=InitMessageEvent] void initMessageEvent([Default=Undefined] optional DOMString typeArg,
[Default=Undefined] optional boolean canBubbleArg,
[Default=Undefined] optional boolean cancelableArg,
@@ -43,5 +48,5 @@
[Default=Undefined] optional DOMString originArg,
[Default=Undefined] optional DOMString lastEventIdArg,
[Default=Undefined] optional Window sourceArg,
- [Default=Undefined] optional MessagePort[] messagePorts);
+ [Default=Undefined] optional MessagePort[] portsArg);
};
diff --git a/core/events/MessageEventInit.idl b/core/events/MessageEventInit.idl
new file mode 100644
index 0000000..d252965
--- /dev/null
+++ b/core/events/MessageEventInit.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces
+
+dictionary MessageEventInit : EventInit {
+ any data;
+ DOMString origin;
+ DOMString lastEventId;
+ // TODO(bashi): |source| should be (WindowProxy or MessagePort)?
+ EventTarget source;
+ // Per spec, |ports| isn't nullable, but it seems it should be.
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23176
+ sequence<MessagePort>? ports;
+};
diff --git a/core/events/MouseEvent.idl b/core/events/MouseEvent.idl
index feda914..fbdeaa3 100644
--- a/core/events/MouseEvent.idl
+++ b/core/events/MouseEvent.idl
@@ -17,48 +17,68 @@
* Boston, MA 02110-1301, USA.
*/
+// https://w3c.github.io/uievents/#interface-MouseEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional MouseEventInit eventInitDict),
+ ConstructorCallWith=ScriptState,
] interface MouseEvent : UIEvent {
- [InitializedByEventConstructor] readonly attribute long screenX;
- [InitializedByEventConstructor] readonly attribute long screenY;
- [InitializedByEventConstructor] readonly attribute long clientX;
- [InitializedByEventConstructor] readonly attribute long clientY;
- [InitializedByEventConstructor] readonly attribute boolean ctrlKey;
- [InitializedByEventConstructor] readonly attribute boolean shiftKey;
- [InitializedByEventConstructor] readonly attribute boolean altKey;
- [InitializedByEventConstructor] readonly attribute boolean metaKey;
- [InitializedByEventConstructor] readonly attribute unsigned short button;
- [InitializedByEventConstructor] readonly attribute EventTarget? relatedTarget;
- [MeasureAs=MouseEventMovementX] readonly attribute long movementX;
- [MeasureAs=MouseEventMovementY] readonly attribute long movementY;
- [MeasureAs=PrefixedMouseEventMovementX, ImplementedAs=movementX] readonly attribute long webkitMovementX;
- [MeasureAs=PrefixedMouseEventMovementY, ImplementedAs=movementY] readonly attribute long webkitMovementY;
+ readonly attribute long screenX;
+ readonly attribute long screenY;
+ readonly attribute long clientX;
+ readonly attribute long clientY;
+ readonly attribute boolean ctrlKey;
+ readonly attribute boolean shiftKey;
+ readonly attribute boolean altKey;
+ readonly attribute boolean metaKey;
+ readonly attribute short button;
+ readonly attribute unsigned short buttons;
+ readonly attribute EventTarget? relatedTarget;
+ // TODO(philipj): boolean getModifierState(DOMString keyArg);
- void initMouseEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean canBubble,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional Window view,
- [Default=Undefined] optional long detail,
- [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,
- [Default=Undefined] optional unsigned short button,
- [Default=Undefined] optional EventTarget relatedTarget);
+ // https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers
+ // TODO(philipj): None of the initMouseEvent() arguments should be optional.
+ [CallWith=ScriptState, Measure] void initMouseEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional Window? view,
+ [Default=Undefined] optional long detail,
+ [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,
+ [Default=Undefined] optional unsigned short button,
+ [Default=Undefined] optional EventTarget? relatedTarget);
- // Non-standard
- [MeasureAs=MouseEventOffsetX] readonly attribute long offsetX;
- [MeasureAs=MouseEventOffsetY] readonly attribute long offsetY;
+ // CSSOM View Module
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-mouseevent-interface
+ // TODO(philipj): These attributes should be of type double, and the spec
+ // also redefines screenX/Y and clientX/Y as double.
+ readonly attribute long pageX;
+ readonly attribute long pageY;
[MeasureAs=MouseEventX] readonly attribute long x;
[MeasureAs=MouseEventY] readonly attribute long y;
+ [MeasureAs=MouseEventOffsetX] readonly attribute long offsetX;
+ [MeasureAs=MouseEventOffsetY] readonly attribute long offsetY;
+
+ // Pointer Lock
+ // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-mouseevent-interface
+ [MeasureAs=MouseEventMovementX] readonly attribute long movementX;
+ [MeasureAs=MouseEventMovementY] readonly attribute long movementY;
+
+ // Non-standard
[MeasureAs=MouseEventFromElement] readonly attribute Node fromElement;
[MeasureAs=MouseEventToElement] readonly attribute Node toElement;
+ [MeasureAs=MouseEventWhich] readonly attribute long which;
+ [DeprecateAs=PrefixedMouseEventMovementX, ImplementedAs=movementX] readonly attribute long webkitMovementX;
+ [DeprecateAs=PrefixedMouseEventMovementY, ImplementedAs=movementY] readonly attribute long webkitMovementY;
+ [Measure] readonly attribute long layerX;
+ [Measure] readonly attribute long layerY;
- // FIXME: this belongs on the DragEvent interface
+ // FIXME: dataTransfer belongs on the DragEvent interface. crbug.com/498504
readonly attribute DataTransfer dataTransfer;
};
diff --git a/core/events/MouseEventInit.idl b/core/events/MouseEventInit.idl
new file mode 100644
index 0000000..cbb4d7d
--- /dev/null
+++ b/core/events/MouseEventInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-MouseEventInit
+
+dictionary MouseEventInit : EventModifierInit {
+ long screenX = 0;
+ long screenY = 0;
+ long clientX = 0;
+ long clientY = 0;
+ short button = 0;
+ unsigned short buttons = 0;
+ EventTarget? relatedTarget = null;
+
+ // Pointer Lock
+ // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-mouseeventinit-dictionary
+ long movementX = 0;
+ long movementY = 0;
+};
diff --git a/core/events/MutationEvent.idl b/core/events/MutationEvent.idl
index 0aae4e3..03ef830 100644
--- a/core/events/MutationEvent.idl
+++ b/core/events/MutationEvent.idl
@@ -17,28 +17,26 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 2:
-interface MutationEvent : Event {
+// https://w3c.github.io/uievents/#interface-MutationEvent
+interface MutationEvent : Event {
// attrChangeType
const unsigned short MODIFICATION = 1;
const unsigned short ADDITION = 2;
const unsigned short REMOVAL = 3;
- readonly attribute Node relatedNode;
+ readonly attribute Node? relatedNode;
readonly attribute DOMString prevValue;
readonly attribute DOMString newValue;
readonly attribute DOMString attrName;
readonly attribute unsigned short attrChange;
-
- void initMutationEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean canBubble,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional Node relatedNode,
- [Default=Undefined] optional DOMString prevValue,
- [Default=Undefined] optional DOMString newValue,
- [Default=Undefined] optional DOMString attrName,
- [Default=Undefined] optional unsigned short attrChange);
-
+ // TODO(philipj): None of the initMutationEvent() arguments should be optional.
+ [Measure] void initMutationEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional Node relatedNode,
+ [Default=Undefined] optional DOMString prevValue,
+ [Default=Undefined] optional DOMString newValue,
+ [Default=Undefined] optional DOMString attrName,
+ [Default=Undefined] optional unsigned short attrChange);
};
-
diff --git a/core/events/NavigatorEvents.idl b/core/events/NavigatorEvents.idl
index ed3d206..433a944 100644
--- a/core/events/NavigatorEvents.idl
+++ b/core/events/NavigatorEvents.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/pointerevents/#extensions-to-the-navigator-interface
+
partial interface Navigator {
readonly attribute long maxTouchPoints;
};
diff --git a/core/events/OverflowEvent.idl b/core/events/OverflowEvent.idl
deleted file mode 100644
index be779e4..0000000
--- a/core/events/OverflowEvent.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple 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:
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
- */
-
-[
- EventConstructor,
-] interface OverflowEvent : Event {
- const unsigned short HORIZONTAL = 0;
- const unsigned short VERTICAL = 1;
- const unsigned short BOTH = 2;
-
- [InitializedByEventConstructor] readonly attribute unsigned short orient;
- [InitializedByEventConstructor] readonly attribute boolean horizontalOverflow;
- [InitializedByEventConstructor] readonly attribute boolean verticalOverflow;
-};
-
diff --git a/core/events/PageTransitionEvent.idl b/core/events/PageTransitionEvent.idl
index 679d51e..7dc109e 100644
--- a/core/events/PageTransitionEvent.idl
+++ b/core/events/PageTransitionEvent.idl
@@ -23,9 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface PageTransitionEvent : Event {
- [InitializedByEventConstructor] readonly attribute boolean persisted;
-};
+// https://html.spec.whatwg.org/multipage/browsers.html#the-pagetransitionevent-interface
+[
+ Constructor(DOMString type, optional PageTransitionEventInit eventInitDict),
+ // TODO(philipj): Exposed=(Window,Worker)
+] interface PageTransitionEvent : Event {
+ readonly attribute boolean persisted;
+};
diff --git a/core/events/PageTransitionEventInit.idl b/core/events/PageTransitionEventInit.idl
new file mode 100644
index 0000000..2571f08
--- /dev/null
+++ b/core/events/PageTransitionEventInit.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.
+
+// https://html.spec.whatwg.org/multipage/browsers.html#the-pagetransitionevent-interface
+
+dictionary PageTransitionEventInit : EventInit {
+ boolean persisted;
+};
diff --git a/core/events/PointerEvent.idl b/core/events/PointerEvent.idl
new file mode 100644
index 0000000..cecf01e
--- /dev/null
+++ b/core/events/PointerEvent.idl
@@ -0,0 +1,19 @@
+// Copyright 2015 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://w3c.github.io/pointerevents/#pointerevent-interface
+
+[
+ Constructor(DOMString type, optional PointerEventInit eventInitDict),
+ RuntimeEnabled=PointerEvent,
+] interface PointerEvent : MouseEvent {
+ readonly attribute long pointerId;
+ readonly attribute double width;
+ readonly attribute double height;
+ readonly attribute float pressure;
+ readonly attribute long tiltX;
+ readonly attribute long tiltY;
+ readonly attribute DOMString pointerType;
+ readonly attribute boolean isPrimary;
+};
diff --git a/core/events/PointerEventInit.idl b/core/events/PointerEventInit.idl
new file mode 100644
index 0000000..d474bcd
--- /dev/null
+++ b/core/events/PointerEventInit.idl
@@ -0,0 +1,18 @@
+// Copyright 2015 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://w3c.github.io/pointerevents/#pointerevent-interface
+
+[
+ RuntimeEnabled=PointerEvent,
+] dictionary PointerEventInit : MouseEventInit {
+ long pointerId = 0;
+ double width = 0;
+ double height = 0;
+ float pressure = 0;
+ long tiltX = 0;
+ long tiltY = 0;
+ DOMString pointerType = "";
+ boolean isPrimary = false;
+};
diff --git a/core/events/PopStateEvent.idl b/core/events/PopStateEvent.idl
index a1ccf16..5d05163 100644
--- a/core/events/PopStateEvent.idl
+++ b/core/events/PopStateEvent.idl
@@ -24,8 +24,11 @@
*
*/
+// https://html.spec.whatwg.org/multipage/browsers.html#the-popstateevent-interface
+
[
- EventConstructor,
+ Constructor(DOMString type, optional PopStateEventInit eventInitDict),
+ // TODO(philipj): Exposed=(Window,Worker)
] interface PopStateEvent : Event {
- [InitializedByEventConstructor, Custom=Getter] readonly attribute any state;
+ [Custom=Getter] readonly attribute any state;
};
diff --git a/core/events/PopStateEventInit.idl b/core/events/PopStateEventInit.idl
new file mode 100644
index 0000000..ce7ae0f
--- /dev/null
+++ b/core/events/PopStateEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://html.spec.whatwg.org/multipage/browsers.html#the-popstateevent-interface
+
+dictionary PopStateEventInit : EventInit {
+ any state;
+};
diff --git a/core/events/ProgressEvent.idl b/core/events/ProgressEvent.idl
index 8e49d70..5ff7270 100644
--- a/core/events/ProgressEvent.idl
+++ b/core/events/ProgressEvent.idl
@@ -23,11 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface ProgressEvent : Event {
- [InitializedByEventConstructor] readonly attribute boolean lengthComputable;
- [InitializedByEventConstructor] readonly attribute unsigned long long loaded;
- [InitializedByEventConstructor] readonly attribute unsigned long long total;
-};
+// https://xhr.spec.whatwg.org/#interface-progressevent
+// TODO(philipj): The spec has Exposed=(Window,Worker)
+// https://github.com/whatwg/xhr/issues/19
+[
+ Constructor(DOMString type, optional ProgressEventInit eventInitDict),
+] interface ProgressEvent : Event {
+ readonly attribute boolean lengthComputable;
+ readonly attribute unsigned long long loaded;
+ readonly attribute unsigned long long total;
+};
diff --git a/core/events/ProgressEventInit.idl b/core/events/ProgressEventInit.idl
new file mode 100644
index 0000000..a7813e7
--- /dev/null
+++ b/core/events/ProgressEventInit.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.
+
+// https://xhr.spec.whatwg.org/#interface-progressevent
+
+dictionary ProgressEventInit : EventInit {
+ boolean lengthComputable = false;
+ unsigned long long loaded = 0;
+ unsigned long long total = 0;
+};
diff --git a/core/events/PromiseRejectionEvent.idl b/core/events/PromiseRejectionEvent.idl
new file mode 100644
index 0000000..85ebeec
--- /dev/null
+++ b/core/events/PromiseRejectionEvent.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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://github.com/domenic/unhandled-rejections-browser-spec
+
+[
+ RuntimeEnabled=PromiseRejectionEvent,
+ Custom=VisitDOMWrapper,
+ Constructor(DOMString type, optional PromiseRejectionEventInit eventInitDict),
+ ConstructorCallWith=ScriptState,
+ Exposed=(Window,Worker,ServiceWorker),
+] interface PromiseRejectionEvent : Event {
+ [Custom=Getter] readonly attribute Promise<any>? promise;
+ [CallWith=ScriptState] readonly attribute any reason;
+};
diff --git a/core/events/PromiseRejectionEventInit.idl b/core/events/PromiseRejectionEventInit.idl
new file mode 100644
index 0000000..cf6b3ba
--- /dev/null
+++ b/core/events/PromiseRejectionEventInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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://github.com/domenic/unhandled-rejections-browser-spec
+
+[
+ RuntimeEnabled=PromiseRejectionEvent,
+] dictionary PromiseRejectionEventInit : EventInit {
+ Promise<any> promise;
+ any reason;
+};
diff --git a/core/events/RelatedEvent.idl b/core/events/RelatedEvent.idl
index 7c3d25b..142bf29 100644
--- a/core/events/RelatedEvent.idl
+++ b/core/events/RelatedEvent.idl
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#the-relatedevent-interfaces
+
[
- EventConstructor,
+ Constructor(DOMString type, optional RelatedEventInit eventInitDict),
RuntimeEnabled=ContextMenu,
] interface RelatedEvent : Event {
- [InitializedByEventConstructor] readonly attribute EventTarget? relatedTarget;
+ readonly attribute EventTarget? relatedTarget;
};
-
diff --git a/core/events/RelatedEventInit.idl b/core/events/RelatedEventInit.idl
new file mode 100644
index 0000000..3322b55
--- /dev/null
+++ b/core/events/RelatedEventInit.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.
+
+// https://html.spec.whatwg.org/#the-relatedevent-interfaces
+
+dictionary RelatedEventInit : EventInit {
+ EventTarget? relatedTarget;
+};
diff --git a/core/events/SecurityPolicyViolationEvent.idl b/core/events/SecurityPolicyViolationEvent.idl
index 5ac10f2..f3984a5 100644
--- a/core/events/SecurityPolicyViolationEvent.idl
+++ b/core/events/SecurityPolicyViolationEvent.idl
@@ -22,18 +22,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://w3c.github.io/webappsec/specs/content-security-policy/#securitypolicyviolationevent-interface
+
[
- EventConstructor,
- RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures,
+ Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict),
] interface SecurityPolicyViolationEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString documentURI;
- [InitializedByEventConstructor] readonly attribute DOMString referrer;
- [InitializedByEventConstructor] readonly attribute DOMString blockedURI;
- [InitializedByEventConstructor] readonly attribute DOMString violatedDirective;
- [InitializedByEventConstructor] readonly attribute DOMString effectiveDirective;
- [InitializedByEventConstructor] readonly attribute DOMString originalPolicy;
- [InitializedByEventConstructor] readonly attribute DOMString sourceFile;
- [InitializedByEventConstructor] readonly attribute long lineNumber;
- [InitializedByEventConstructor] readonly attribute long columnNumber;
- [InitializedByEventConstructor] readonly attribute long statusCode;
+ // TODO(philipj): The spec says "documentURL".
+ [Measure] readonly attribute DOMString documentURI;
+ readonly attribute DOMString referrer;
+ // TODO(philipj): The spec says "blockedURL".
+ [Measure] readonly attribute DOMString blockedURI;
+ readonly attribute DOMString violatedDirective;
+ readonly attribute DOMString effectiveDirective;
+ readonly attribute DOMString originalPolicy;
+ readonly attribute DOMString sourceFile;
+ // FIXME: The spec says "statusCode" is a DOMString.
+ [Measure] readonly attribute long statusCode;
+ readonly attribute long lineNumber;
+ readonly attribute long columnNumber;
};
diff --git a/core/events/SecurityPolicyViolationEventInit.idl b/core/events/SecurityPolicyViolationEventInit.idl
new file mode 100644
index 0000000..32ce1ba
--- /dev/null
+++ b/core/events/SecurityPolicyViolationEventInit.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://w3c.github.io/webappsec/specs/content-security-policy/#securitypolicyviolationevent-interface
+
+dictionary SecurityPolicyViolationEventInit : EventInit {
+ // TODO(philipj): The spec says "documentURL".
+ DOMString documentURI;
+ DOMString referrer;
+ // TODO(philipj): The spec says "blockedURL".
+ DOMString blockedURI;
+ DOMString violatedDirective;
+ DOMString effectiveDirective;
+ DOMString originalPolicy;
+ DOMString sourceFile;
+ // FIXME: The spec says "statusCode" is a DOMString.
+ long statusCode;
+ long lineNumber;
+ long columnNumber;
+};
diff --git a/core/events/TextEvent.idl b/core/events/TextEvent.idl
index 3d03594e..96ffbce 100644
--- a/core/events/TextEvent.idl
+++ b/core/events/TextEvent.idl
@@ -23,16 +23,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Introduced in DOM Level 3:
+// http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/#webidl-events-TextEvent
+
+// TODO(philipj): Remove the textinput event and the TextEvent interface. They
+// were removed from the spec in 2012:
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=12958
+// https://github.com/w3c/uievents/commit/1a2aa02b474fd4feaf43fdced06e6fd7214196a4
+
interface TextEvent : UIEvent {
- readonly attribute DOMString data;
+ [Measure] readonly attribute DOMString data;
- void initTextEvent([Default=Undefined] optional DOMString typeArg,
- [Default=Undefined] optional boolean canBubbleArg,
- [Default=Undefined] optional boolean cancelableArg,
- [Default=Undefined] optional Window viewArg,
- [Default=Undefined] optional DOMString dataArg);
+ [Measure] void initTextEvent([Default=Undefined] optional DOMString typeArg,
+ [Default=Undefined] optional boolean canBubbleArg,
+ [Default=Undefined] optional boolean cancelableArg,
+ [Default=Undefined] optional Window viewArg,
+ [Default=Undefined] optional DOMString dataArg);
};
-
diff --git a/core/events/TouchEvent.idl b/core/events/TouchEvent.idl
index 36f0ac5..d4c3b2c 100644
--- a/core/events/TouchEvent.idl
+++ b/core/events/TouchEvent.idl
@@ -22,26 +22,30 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+// http://www.w3.org/TR/touch-events/#touchevent-interface
+
interface TouchEvent : UIEvent {
readonly attribute TouchList touches;
readonly attribute TouchList targetTouches;
readonly attribute TouchList changedTouches;
- readonly attribute boolean ctrlKey;
- readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
+ readonly attribute boolean ctrlKey;
+ readonly attribute boolean shiftKey;
- void initTouchEvent([Default=Undefined] optional TouchList touches,
- [Default=Undefined] optional TouchList targetTouches,
- [Default=Undefined] optional TouchList changedTouches,
- [Default=Undefined] optional DOMString type,
- [Default=Undefined] optional Window view,
- [Default=Undefined] optional long unused1,
- [Default=Undefined] optional long unused2,
- [Default=Undefined] optional long unused3,
- [Default=Undefined] optional long unused4,
- [Default=Undefined] optional boolean ctrlKey,
- [Default=Undefined] optional boolean altKey,
- [Default=Undefined] optional boolean shiftKey,
- [Default=Undefined] optional boolean metaKey);
+ // FIXME: initTouch() is not yet standardized.
+ [CallWith=ScriptState, Measure] void initTouchEvent([Default=Undefined] optional TouchList touches,
+ [Default=Undefined] optional TouchList targetTouches,
+ [Default=Undefined] optional TouchList changedTouches,
+ [Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional Window view,
+ [Default=Undefined] optional long unused1,
+ [Default=Undefined] optional long unused2,
+ [Default=Undefined] optional long unused3,
+ [Default=Undefined] optional long unused4,
+ [Default=Undefined] optional boolean ctrlKey,
+ [Default=Undefined] optional boolean altKey,
+ [Default=Undefined] optional boolean shiftKey,
+ [Default=Undefined] optional boolean metaKey);
};
diff --git a/core/events/TransitionEvent.idl b/core/events/TransitionEvent.idl
index 94ee353..2cf9480 100644
--- a/core/events/TransitionEvent.idl
+++ b/core/events/TransitionEvent.idl
@@ -24,11 +24,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface TransitionEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString propertyName;
- [InitializedByEventConstructor] readonly attribute double elapsedTime;
- [InitializedByEventConstructor] readonly attribute DOMString pseudoElement;
-};
+// http://dev.w3.org/csswg/css-transitions/#transition-events
+[
+ Constructor(DOMString type, optional TransitionEventInit eventInitDict),
+] interface TransitionEvent : Event {
+ readonly attribute DOMString propertyName;
+ // TODO(philipj): elapsedTime should be float.
+ readonly attribute double elapsedTime;
+ readonly attribute DOMString pseudoElement;
+};
diff --git a/core/events/TransitionEventInit.idl b/core/events/TransitionEventInit.idl
new file mode 100644
index 0000000..8a0f8ea
--- /dev/null
+++ b/core/events/TransitionEventInit.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://dev.w3.org/csswg/css-transitions/#transition-events
+
+dictionary TransitionEventInit : EventInit {
+ DOMString propertyName = "";
+ double elapsedTime = 0.0;
+ DOMString pseudoElement = "";
+};
diff --git a/core/events/UIEvent.idl b/core/events/UIEvent.idl
index 4d025d8..7cb51a8 100644
--- a/core/events/UIEvent.idl
+++ b/core/events/UIEvent.idl
@@ -17,26 +17,25 @@
* Boston, MA 02110-1301, USA.
*/
+// https://w3c.github.io/uievents/#interface-UIEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional UIEventInit eventInitDict)
] interface UIEvent : Event {
- [InitializedByEventConstructor] readonly attribute Window? view;
- [InitializedByEventConstructor] readonly attribute long detail;
+ readonly attribute Window? view;
+ readonly attribute long detail;
+ [RuntimeEnabled=InputDevice] readonly attribute InputDevice? sourceDevice;
- void initUIEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean canBubble,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional Window view,
- [Default=Undefined] optional long detail);
-
- // 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;
+ // https://w3c.github.io/uievents/#idl-interface-UIEvent-initializers
+ // TODO(philipj): None of the initUIEvent() arguments should be optional.
+ [Measure] void initUIEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional Window? view,
+ [Default=Undefined] optional long detail);
// FIXME: these belong on the KeyboardEvent interface
- readonly attribute long keyCode;
- readonly attribute long charCode;
- readonly attribute long which;
+ [MeasureAs=UIEventCharCode] readonly attribute long charCode;
+ [MeasureAs=UIEventKeyCode] readonly attribute long keyCode;
+ [MeasureAs=UIEventWhich] readonly attribute long which;
};
diff --git a/core/events/UIEventInit.idl b/core/events/UIEventInit.idl
new file mode 100644
index 0000000..522b008
--- /dev/null
+++ b/core/events/UIEventInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-UIEventInit
+
+dictionary UIEventInit : EventInit {
+ Window? view = null;
+ long detail = 0;
+ [RuntimeEnabled=InputDevice] InputDevice? sourceDevice = null;
+};
diff --git a/core/events/WheelEvent.idl b/core/events/WheelEvent.idl
index 91fcf88..cf556e4 100644
--- a/core/events/WheelEvent.idl
+++ b/core/events/WheelEvent.idl
@@ -19,22 +19,22 @@
* Boston, MA 02110-1301, USA.
*/
-// Introduced in DOM Level 3:
+// https://w3c.github.io/uievents/#interface-WheelEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional WheelEventInit eventInitDict),
] interface WheelEvent : MouseEvent {
// DeltaModeCode
- const unsigned long DOM_DELTA_PIXEL = 0x00;
- const unsigned long DOM_DELTA_LINE = 0x01;
- const unsigned long DOM_DELTA_PAGE = 0x02;
+ const unsigned long DOM_DELTA_PIXEL = 0x00;
+ const unsigned long DOM_DELTA_LINE = 0x01;
+ const unsigned long DOM_DELTA_PAGE = 0x02;
+ readonly attribute double deltaX;
+ readonly attribute double deltaY;
+ readonly attribute double deltaZ;
+ readonly attribute unsigned long deltaMode;
- [InitializedByEventConstructor] readonly attribute double deltaX;
- [InitializedByEventConstructor] readonly attribute double deltaY;
- [InitializedByEventConstructor] readonly attribute double deltaZ;
- [InitializedByEventConstructor] readonly attribute unsigned long deltaMode;
-
- // Non-standard API.
- [InitializedByEventConstructor, MeasureAs=WheelEventWheelDeltaX] readonly attribute long wheelDeltaX;
- [InitializedByEventConstructor, MeasureAs=WheelEventWheelDeltaY] readonly attribute long wheelDeltaY;
+ // Non-standard APIs
+ [MeasureAs=WheelEventWheelDeltaX] readonly attribute long wheelDeltaX;
+ [MeasureAs=WheelEventWheelDeltaY] readonly attribute long wheelDeltaY;
[MeasureAs=WheelEventWheelDelta] readonly attribute long wheelDelta;
};
diff --git a/core/events/WheelEventInit.idl b/core/events/WheelEventInit.idl
new file mode 100644
index 0000000..ce18fad
--- /dev/null
+++ b/core/events/WheelEventInit.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.
+
+// https://w3c.github.io/uievents/#idl-def-WheelEventInit
+
+dictionary WheelEventInit : MouseEventInit {
+ double deltaX = 0.0;
+ double deltaY = 0.0;
+ double deltaZ = 0.0;
+ unsigned long deltaMode = 0;
+
+ // Non-standard APIs
+ long wheelDeltaX = 0;
+ long wheelDeltaY = 0;
+};
diff --git a/core/fileapi/Blob.idl b/core/fileapi/Blob.idl
index 5f59e11..4abe9ed 100644
--- a/core/fileapi/Blob.idl
+++ b/core/fileapi/Blob.idl
@@ -28,17 +28,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/FileAPI/#blob
+
[
- WillBeGarbageCollected,
- CustomConstructor,
- CustomConstructor(sequence<any> blobParts, optional BlobPropertyBag options),
+ GarbageCollected,
+ Constructor,
+ Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options),
+ RaisesException=Constructor,
Exposed=(Window,Worker),
- SpecialWrapFor=File,
] interface Blob {
readonly attribute unsigned long long size;
readonly attribute DOMString type;
+ // TODO(jsbell): Implement:
+ // readonly attribute boolean isClosed;
+ // TODO(jsbell): start and end arguments should be [Clamp]
+ // TODO(philipj): contentType should not be optional or nullable.
[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/BlobPropertyBag.idl b/core/fileapi/BlobPropertyBag.idl
new file mode 100644
index 0000000..3c76693
--- /dev/null
+++ b/core/fileapi/BlobPropertyBag.idl
@@ -0,0 +1,17 @@
+// Copyright 2015 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://w3c.github.io/FileAPI/#blob
+
+// TODO(jsbell): This enum is non-standard.
+// https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
+enum NormalizeLineEndings { "transparent", "native" };
+
+dictionary BlobPropertyBag {
+ DOMString type = "";
+
+ // TODO(jsbell): This member is non-standard.
+ // https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
+ NormalizeLineEndings endings = "transparent";
+};
diff --git a/core/fileapi/File.idl b/core/fileapi/File.idl
index c338fa2..666b073 100644
--- a/core/fileapi/File.idl
+++ b/core/fileapi/File.idl
@@ -23,12 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/FileAPI/#file
+
[
- CustomConstructor(sequence<any> blobParts, DOMString fileName, optional BlobPropertyBag options),
+ // TODO(jsbell): fileName parameter has [EnsureUTF16] in the spec; use
+ // USVString? https://github.com/w3c/FileAPI/issues/9
+ Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fileBits, DOMString fileName, optional FilePropertyBag options),
+ RaisesException=Constructor,
Exposed=(Window,Worker),
] interface File : Blob {
readonly attribute DOMString name;
- [MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
readonly attribute long long lastModified;
+
+ // Non-standard APIs
+ [MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
[MeasureAs=PrefixedFileRelativePath] readonly attribute DOMString webkitRelativePath;
};
diff --git a/core/fileapi/FileError.idl b/core/fileapi/FileError.idl
index 4f40dc8..2507a7e 100644
--- a/core/fileapi/FileError.idl
+++ b/core/fileapi/FileError.idl
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
-] interface FileError : DOMError {
+// TODO(philipj): Remove the FileError interface. crbug.com/496901
+interface FileError : DOMError {
const unsigned short NOT_FOUND_ERR = 1;
const unsigned short SECURITY_ERR = 2;
const unsigned short ABORT_ERR = 3;
diff --git a/core/fileapi/FileList.idl b/core/fileapi/FileList.idl
index e7e296a..9bbd8a5 100644
--- a/core/fileapi/FileList.idl
+++ b/core/fileapi/FileList.idl
@@ -23,10 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/FileAPI/#filelist-section
+
[
Exposed=(Window,Worker),
- WillBeGarbageCollected
+ GarbageCollected
] interface FileList {
+ getter File? item(unsigned long index);
readonly attribute unsigned long length;
- getter File item(unsigned long index);
};
diff --git a/core/fileapi/FilePropertyBag.idl b/core/fileapi/FilePropertyBag.idl
new file mode 100644
index 0000000..950fc84
--- /dev/null
+++ b/core/fileapi/FilePropertyBag.idl
@@ -0,0 +1,14 @@
+// Copyright 2015 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://w3c.github.io/FileAPI/#file
+
+dictionary FilePropertyBag {
+ DOMString type = "";
+ long long lastModified;
+
+ // TODO(jsbell): This member is non-standard.
+ // https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
+ NormalizeLineEndings endings = "transparent";
+};
diff --git a/core/fileapi/FileReader.idl b/core/fileapi/FileReader.idl
index 1d10d87..1a032a9 100644
--- a/core/fileapi/FileReader.idl
+++ b/core/fileapi/FileReader.idl
@@ -29,33 +29,40 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/FileAPI/#APIASynch
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
ActiveDOMObject,
Constructor,
ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker),
TypeChecking=Interface
] interface FileReader : EventTarget {
- // ready states
- const unsigned short EMPTY = 0;
- const unsigned short LOADING = 1;
- const unsigned short DONE = 2;
- readonly attribute unsigned short readyState;
-
// async read methods
[RaisesException] void readAsArrayBuffer(Blob blob);
- [RaisesException] void readAsBinaryString(Blob blob);
- [RaisesException] void readAsText(Blob blob, optional DOMString encoding);
+ // TODO(philipj): readAsBinaryString() was removed from the spec in 2012:
+ // https://github.com/w3c/FileAPI/commit/8cce54559dc27bf8b8244f3f0ca9fb3e4d96efdb
+ [RaisesException, Measure] void readAsBinaryString(Blob blob);
+ [RaisesException] void readAsText(Blob blob, optional DOMString label);
[RaisesException] void readAsDataURL(Blob blob);
void abort();
- // file data
- [Custom=Getter] readonly attribute object result;
+ // states
+ const unsigned short EMPTY = 0;
+ const unsigned short LOADING = 1;
+ const unsigned short DONE = 2;
- readonly attribute FileError error;
+ readonly attribute unsigned short readyState;
+ // File or Blob data
+ readonly attribute (DOMString or ArrayBuffer)? result;
+
+ // TODO(philipj): error should be DOMError. crbug.com/496901
+ [Measure] readonly attribute FileError? error;
+
+ // event handler attributes
attribute EventHandler onloadstart;
attribute EventHandler onprogress;
attribute EventHandler onload;
diff --git a/core/fileapi/FileReaderSync.idl b/core/fileapi/FileReaderSync.idl
index 8a15084..642d8e2 100644
--- a/core/fileapi/FileReaderSync.idl
+++ b/core/fileapi/FileReaderSync.idl
@@ -28,13 +28,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/FileAPI/#FileReaderSync
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
Exposed=Worker,
Constructor
] interface FileReaderSync {
[CallWith=ExecutionContext, RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob);
- [CallWith=ExecutionContext, RaisesException] DOMString readAsBinaryString(Blob blob);
- [CallWith=ExecutionContext, RaisesException] DOMString readAsText(Blob blob, optional DOMString encoding);
+ // TODO(philipj): readAsBinaryString() was removed from the spec in 2012:
+ // https://github.com/w3c/FileAPI/commit/8cce54559dc27bf8b8244f3f0ca9fb3e4d96efdb
+ [CallWith=ExecutionContext, RaisesException, Measure] DOMString readAsBinaryString(Blob blob);
+ [CallWith=ExecutionContext, RaisesException] DOMString readAsText(Blob blob, optional DOMString label);
[CallWith=ExecutionContext, RaisesException] DOMString readAsDataURL(Blob blob);
};
diff --git a/core/frame/BarProp.idl b/core/frame/BarProp.idl
index a7be530..90a8e1e 100644
--- a/core/frame/BarProp.idl
+++ b/core/frame/BarProp.idl
@@ -26,9 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#barprop
+
[
WillBeGarbageCollected,
] interface BarProp {
+ // TODO(philipj): Remove readonly or have it added to the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28697
readonly attribute boolean visible;
};
-
diff --git a/core/frame/Console.idl b/core/frame/Console.idl
index de3bc19..66e8ec3 100644
--- a/core/frame/Console.idl
+++ b/core/frame/Console.idl
@@ -27,8 +27,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// Console API (non-standard but widely implemented in some form)
+// https://developer.chrome.com/devtools/docs/console-api
+
+// TODO(philipj): Both Firefox and IE expose the Console interface object, and
+// that interface does not inherit from a ConsoleBase or similar interface.
+
[
NoInterfaceObject
] interface Console : ConsoleBase {
- readonly attribute MemoryInfo memory;
};
diff --git a/core/frame/ConsoleBase.idl b/core/frame/ConsoleBase.idl
index 533d293..057aca9 100644
--- a/core/frame/ConsoleBase.idl
+++ b/core/frame/ConsoleBase.idl
@@ -27,9 +27,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// Console API (non-standard but widely implemented in some form)
+// https://developer.chrome.com/devtools/docs/console-api
+
[
NoInterfaceObject,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface ConsoleBase {
[CallWith=(ScriptArguments,ScriptState)] void debug();
[CallWith=(ScriptArguments,ScriptState)] void error();
@@ -40,7 +43,7 @@
[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), ImplementedAs=assertCondition] void assert([Default=Undefined] optional boolean condition);
[CallWith=(ScriptArguments,ScriptState)] void count();
[DeprecateAs=ConsoleMarkTimeline] void markTimeline(optional DOMString title = null);
diff --git a/core/frame/History.idl b/core/frame/History.idl
index 4060604..5462033 100644
--- a/core/frame/History.idl
+++ b/core/frame/History.idl
@@ -23,16 +23,28 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- WillBeGarbageCollected,
-] interface History {
- readonly attribute unsigned long length;
- [Custom=Getter] readonly attribute SerializedScriptValue state;
+// https://html.spec.whatwg.org/#the-history-interface
+[
+ GarbageCollected,
+] interface History {
+ // TODO(philipj): length is long in the spec, use that or change the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28789
+ readonly attribute unsigned long length;
+ // TODO(philipj): The SerializedScriptValue type should be any.
+ [CachedAttribute=stateChanged] readonly attribute SerializedScriptValue state;
+ // TODO(philipj): delta does not have a default value in the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28790
+ [CallWith=ExecutionContext] void go(optional long delta = 0);
[CallWith=ExecutionContext] void back();
[CallWith=ExecutionContext] void forward();
- [CallWith=ExecutionContext] void go([Default=Undefined] optional long distance);
+ // TODO(philipj): The SerializedScriptValue types should be any.
+ // TODO(philipj): The title arguments should simply be 'DOMString title'.
+ // Note: The options arguments are part of the Scroll Restoration API.
+ [RaisesException] void pushState(SerializedScriptValue data, [TreatUndefinedAs=NullString] DOMString? title, optional DOMString? url = null, optional StateOptions options);
+ [RaisesException] void replaceState(SerializedScriptValue data, [TreatUndefinedAs=NullString] DOMString? title, optional DOMString? url = null, optional StateOptions options);
- [Custom, PerContextEnabled=PushState, RaisesException] void pushState(any data, DOMString title, optional DOMString url);
- [Custom, PerContextEnabled=PushState, RaisesException] void replaceState(any data, DOMString title, optional DOMString url);
+ // Experimental Scroll Restoration API
+ // https://www.chromestatus.com/features/5657284784947200
+ [RuntimeEnabled=ScrollRestoration] readonly attribute StateOptions options;
};
diff --git a/core/frame/ImageBitmap.idl b/core/frame/ImageBitmap.idl
index b211d6e..5cb21c8 100644
--- a/core/frame/ImageBitmap.idl
+++ b/core/frame/ImageBitmap.idl
@@ -2,9 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#images
+
[
+ // TODO(philipj): Exposed=(Window,Worker)
WillBeGarbageCollected,
] interface ImageBitmap {
+ // TODO(philipj): width/height should be unsigned long.
readonly attribute long width;
readonly attribute long height;
};
diff --git a/core/frame/Location.idl b/core/frame/Location.idl
index e4e9ff0..d68eaf7 100644
--- a/core/frame/Location.idl
+++ b/core/frame/Location.idl
@@ -26,8 +26,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-location-interface
+
[
CheckSecurity=Frame,
+ Unforgeable,
WillBeGarbageCollected,
] interface Location {
// |assign|, |replace|, and *writing* |href| do not require a security
@@ -35,26 +38,30 @@
// 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;
+ [CallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity] void assign(DOMString url);
+ [CallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity] void replace(DOMString url);
+ [CallWith=ActiveWindow] 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();
+ // TODO(philipj): ancestorOrigins should have [SameObject] and be of type
+ // DOMString[], i.e. it should return the same array every time.
+ [Measure] readonly attribute DOMStringList ancestorOrigins;
- // 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;
-
+ // TODO(philipj): Per spec, Location implements URLUtils. The below is
+ // mostly like the URLUtils interface, but with some members missing and
+ // using DOMString instead of USVString.
+ [SetterCallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity=Setter] attribute DOMString href;
+ [NotEnumerable, ImplementedAs=href] DOMString toString();
readonly attribute DOMString origin;
- readonly attribute DOMStringList ancestorOrigins;
+ [SetterCallWith=(ActiveWindow,FirstWindow), RaisesException=Setter] attribute DOMString protocol;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString host;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString hostname;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString port;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString pathname;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString search;
+ [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString hash;
- [NotEnumerable, Unforgeable, ImplementedAs=href] DOMString toString();
- [NotEnumerable, Custom, Unforgeable] any valueOf();
+ // TODO(philipj): Location does not have a valueOf() override in the spec.
+ // See the comment in Location.h for the purpose of this.
+ [NotEnumerable, CallWith=ThisValue] any valueOf();
};
-
diff --git a/core/frame/Navigator.idl b/core/frame/Navigator.idl
index 07fb6a2..d9665b0 100644
--- a/core/frame/Navigator.idl
+++ b/core/frame/Navigator.idl
@@ -17,26 +17,25 @@
Boston, MA 02110-1301, USA.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#navigator
+// https://html.spec.whatwg.org/#the-navigator-object
[
- WillBeGarbageCollected,
+ GarbageCollected,
] interface Navigator {
- // FIXME: move these 3 to NavigatorPlugins
- readonly attribute PluginArray plugins;
- readonly attribute MimeTypeArray mimeTypes;
- boolean javaEnabled();
- readonly attribute boolean cookieEnabled; // FIXME: move to NavigatorStorageUtils
+ // objects implementing this interface also implement the interfaces given below
- void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
-
- // Non-standard.
- [MeasureAs=NavigatorProductSub] readonly attribute DOMString productSub;
- [MeasureAs=NavigatorVendor] readonly attribute DOMString vendor;
+ // TODO(philipj): vendorSub should be on NavigatorID.
[MeasureAs=NavigatorVendorSub] readonly attribute DOMString vendorSub;
+
+ // TODO(philipj): productSub and vendor are not yet in the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27954
+ [MeasureAs=NavigatorProductSub] readonly attribute DOMString productSub;
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27786
+ [MeasureAs=NavigatorVendor] readonly attribute DOMString vendor;
};
Navigator implements NavigatorCPU;
Navigator implements NavigatorID;
Navigator implements NavigatorLanguage;
Navigator implements NavigatorOnLine;
+Navigator implements NavigatorStorageUtils;
diff --git a/core/frame/NavigatorCPU.idl b/core/frame/NavigatorCPU.idl
index 8ec502c..a951a1d 100644
--- a/core/frame/NavigatorCPU.idl
+++ b/core/frame/NavigatorCPU.idl
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://wiki.whatwg.org/wiki/Navigator_HW_Concurrency
+
[
NoInterfaceObject,
+ Exposed=(Window,Worker),
] interface NavigatorCPU {
readonly attribute unsigned long hardwareConcurrency;
};
diff --git a/core/frame/NavigatorID.idl b/core/frame/NavigatorID.idl
index 0cbd745..406863e 100644
--- a/core/frame/NavigatorID.idl
+++ b/core/frame/NavigatorID.idl
@@ -28,16 +28,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#navigatorid
+// https://html.spec.whatwg.org/#client-identification
[
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
] interface NavigatorID {
readonly attribute DOMString appCodeName; // constant "Mozilla"
readonly attribute DOMString appName;
readonly attribute DOMString appVersion;
readonly attribute DOMString platform;
readonly attribute DOMString product; // constant "Gecko"
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22555
+ // boolean taintEnabled(); // constant false
readonly attribute DOMString userAgent;
readonly attribute boolean dartEnabled;
diff --git a/core/frame/NavigatorLanguage.idl b/core/frame/NavigatorLanguage.idl
index fe689f6..d36183d 100644
--- a/core/frame/NavigatorLanguage.idl
+++ b/core/frame/NavigatorLanguage.idl
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#language-preferences
+
[
NoInterfaceObject,
+ Exposed=(Window,Worker),
] interface NavigatorLanguage {
readonly attribute DOMString? language;
[CachedAttribute=hasLanguagesChanged] readonly attribute DOMString[] languages;
diff --git a/core/frame/NavigatorOnLine.idl b/core/frame/NavigatorOnLine.idl
index 9268e63..94468aa 100644
--- a/core/frame/NavigatorOnLine.idl
+++ b/core/frame/NavigatorOnLine.idl
@@ -28,10 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#navigatoronline
+// https://html.spec.whatwg.org/#navigator.online
[
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
] interface NavigatorOnLine {
readonly attribute boolean onLine;
};
diff --git a/core/frame/NavigatorStorageUtils.idl b/core/frame/NavigatorStorageUtils.idl
new file mode 100644
index 0000000..e41b602
--- /dev/null
+++ b/core/frame/NavigatorStorageUtils.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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://html.spec.whatwg.org/#manually-releasing-the-storage-mutex
+
+[
+ NoInterfaceObject, // Always used on target of 'implements'
+] interface NavigatorStorageUtils {
+ readonly attribute boolean cookieEnabled;
+ // TODO(philipj): This is called yieldForStorageUpdates() in the spec.
+ [Measure] void getStorageUpdates();
+};
diff --git a/core/frame/Screen.idl b/core/frame/Screen.idl
index a0b6385..33d9afc 100644
--- a/core/frame/Screen.idl
+++ b/core/frame/Screen.idl
@@ -26,17 +26,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/csswg/cssom-view/#the-screen-interface
[
- WillBeGarbageCollected,
+ GarbageCollected,
] interface Screen {
- readonly attribute unsigned long height;
- readonly attribute unsigned long width;
+ readonly attribute long availWidth;
+ readonly attribute long availHeight;
+ readonly attribute long width;
+ readonly attribute long height;
readonly attribute unsigned long colorDepth;
readonly attribute unsigned long pixelDepth;
- readonly attribute long availLeft;
- readonly attribute long availTop;
- readonly attribute unsigned long availHeight;
- readonly attribute unsigned long availWidth;
-};
+ // Non-standard
+ [Measure] readonly attribute long availLeft;
+ [Measure] readonly attribute long availTop;
+};
diff --git a/core/frame/ScrollOptions.idl b/core/frame/ScrollOptions.idl
index 8a2af31..b09ded9 100644
--- a/core/frame/ScrollOptions.idl
+++ b/core/frame/ScrollOptions.idl
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Spec: Non-standard
+// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
-[
- GarbageCollected
-] dictionary ScrollOptions {
- DOMString behavior;
+enum ScrollBehavior { "auto", "instant", "smooth" };
+
+dictionary ScrollOptions {
+ ScrollBehavior behavior = "auto";
};
diff --git a/core/frame/ScrollToOptions.idl b/core/frame/ScrollToOptions.idl
new file mode 100644
index 0000000..b324e7a
--- /dev/null
+++ b/core/frame/ScrollToOptions.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.
+
+// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
+
+dictionary ScrollToOptions : ScrollOptions {
+ unrestricted double left;
+ unrestricted double top;
+};
diff --git a/core/frame/StateOptions.idl b/core/frame/StateOptions.idl
new file mode 100644
index 0000000..cd6a9bd
--- /dev/null
+++ b/core/frame/StateOptions.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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.
+
+// Experimental Scroll Restoration API
+// https://www.chromestatus.com/features/5657284784947200
+
+enum ScrollRestoration {"auto", "manual"};
+
+dictionary StateOptions {
+ ScrollRestoration scrollRestoration = "auto";
+};
diff --git a/core/frame/Window.idl b/core/frame/Window.idl
index 4ef969a..679fd07 100644
--- a/core/frame/Window.idl
+++ b/core/frame/Window.idl
@@ -24,18 +24,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// HTML 5 draft spec:
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#window
+// https://html.spec.whatwg.org/#the-window-object
+
// FIXME: explain all uses of [DoNotCheckSecurity]
[
CheckSecurity=Frame,
- Custom=ToV8,
- ImplementedAs=LocalDOMWindow,
+ ImplementedAs=DOMWindow,
PrimaryGlobal,
- WillBeGarbageCollected,
] interface Window : EventTarget {
- // DOM Level 0
- readonly attribute Screen screen;
+ // the current browsing context
+ // FIXME: The spec uses the WindowProxy type for this and many other attributes.
+ [Unforgeable, DoNotCheckSecurity] readonly attribute Window window;
+ [Replaceable, DoNotCheckSecurity] readonly attribute Window self;
+ [Unforgeable] readonly attribute Document document;
+ attribute DOMString name;
+ [PutForwards=href, Unforgeable, DoNotCheckSecurity] readonly attribute Location location;
readonly attribute History history;
[Replaceable, MeasureAs=BarPropLocationbar] readonly attribute BarProp locationbar;
[Replaceable, MeasureAs=BarPropMenubar] readonly attribute BarProp menubar;
@@ -43,140 +46,131 @@
[Replaceable, MeasureAs=BarPropScrollbars] readonly attribute BarProp scrollbars;
[Replaceable, MeasureAs=BarPropStatusbar] readonly attribute BarProp statusbar;
[Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar;
- [LogActivity=GetterOnly] readonly attribute Navigator navigator;
- [Replaceable] readonly attribute Navigator clientInformation;
- [DoNotCheckSecurity, Unforgeable, Replaceable, PutForwards=href] readonly attribute Location location;
- [Custom, MeasureAs=WindowEvent, NotEnumerable] attribute Event event;
-
- Selection getSelection();
-
- [CheckSecurity=Node, Custom=Getter] readonly attribute Element frameElement;
-
+ attribute DOMString status;
+ [DoNotCheckSecurity, CallWith=ExecutionContext] void close();
+ [DoNotCheckSecurity] readonly attribute boolean closed;
+ void stop();
[DoNotCheckSecurity, CallWith=ExecutionContext] void focus();
[DoNotCheckSecurity] void blur();
- [DoNotCheckSecurity, CallWith=ExecutionContext] void close();
- void print();
- void stop();
+ // other browsing contexts
+ [Replaceable, DoNotCheckSecurity] readonly attribute Window frames;
+ [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length;
+ [Unforgeable, DoNotCheckSecurity] readonly attribute Window top;
+ // FIXME: opener should be of type any.
+ [DoNotCheckSecurity, Custom=Setter] attribute Window opener;
+ [Replaceable, DoNotCheckSecurity] readonly attribute Window parent;
+ [CheckSecurity=Node, Custom=Getter] readonly attribute Element? frameElement;
+ // FIXME: open() should have 4 optional arguments with defaults.
+ [Custom] Window open(DOMString url, DOMString target, optional DOMString features);
+ // FIXME: These getters should not have [NotEnumerable].
+ [NotEnumerable, DoNotCheckSecurity] getter Window (unsigned long index);
+ [Custom, NotEnumerable, DoNotCheckSecurity] getter object (DOMString name);
- [Custom] Window open(DOMString url,
- DOMString name,
- optional DOMString options);
+ // the user agent
+ [LogActivity=GetterOnly] readonly attribute Navigator navigator;
+ [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache;
- [RuntimeEnabled=ShowModalDialog, Custom] any showModalDialog(DOMString url,
- optional any dialogArgs,
- optional DOMString featureArgs);
-
+ // user prompts
void alert();
void alert(DOMString message);
boolean confirm(optional DOMString message = "");
- DOMString? prompt(optional DOMString message = "",
- optional DOMString defaultValue = "");
+ DOMString? prompt(optional DOMString message = "", optional DOMString defaultValue = "");
+ void print();
- boolean find([Default=Undefined] optional DOMString string,
- [Default=Undefined] optional boolean caseSensitive,
- [Default=Undefined] optional boolean backwards,
- [Default=Undefined] optional boolean wrap,
- [Default=Undefined] optional boolean wholeWord,
- [Default=Undefined] optional boolean searchInFrames,
- [Default=Undefined] optional boolean showDialog);
+ // FIXME: requestAnimationFrame should take a FrameRequestCallback:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28152
+ [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(FrameRequestCallback callback);
+ void cancelAnimationFrame(long handle);
- [Replaceable, MeasureAs=WindowOffscreenBuffering] readonly attribute boolean offscreenBuffering;
+ [DoNotCheckSecurity, Custom, RaisesException] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
- [Replaceable] readonly attribute long outerHeight;
- [Replaceable] readonly attribute long outerWidth;
- [Replaceable] readonly attribute long innerHeight;
- [Replaceable] readonly attribute long innerWidth;
- [Replaceable] readonly attribute long screenX;
- [Replaceable] readonly attribute long screenY;
- [Replaceable] readonly attribute long screenLeft;
- [Replaceable] readonly attribute long screenTop;
- [Replaceable] readonly attribute double scrollX;
- [Replaceable] readonly attribute double scrollY;
- readonly attribute double pageXOffset;
- readonly attribute double pageYOffset;
+ // HTML obsolete features
+ // https://html.spec.whatwg.org/#Window-partial
+ [MeasureAs=WindowCaptureEvents] void captureEvents();
+ [MeasureAs=WindowReleaseEvents] void releaseEvents();
- // Overloading can be replaced by optional if RuntimeEnabled is removed, by
- // changing the third argument to *optional* Dictionary scrollOptions
- void scrollBy(double x, double y);
- [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollBy(double x, double y, ScrollOptions scrollOptions);
- void scrollTo(double x, double y);
- [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scrollTo(double x, double y, ScrollOptions scrollOptions);
- void scroll(double x, double y);
- [RuntimeEnabled=CSSOMSmoothScroll, RaisesException] void scroll(double x, double y, ScrollOptions scrollOptions);
- void moveBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats.
- void moveTo([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats.
- void resizeBy([Default=Undefined] optional float x, [Default=Undefined] optional float y); // FIXME: this should take longs not floats.
- void resizeTo([Default=Undefined] optional float width, [Default=Undefined] optional float height); // FIXME: this should take longs not floats.
-
- [DoNotCheckSecurity] readonly attribute boolean closed;
-
- [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length;
-
- attribute DOMString name;
-
- attribute DOMString status;
- [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus;
- // This attribute is an alias of defaultStatus and is necessary for legacy uses.
- [ImplementedAs=defaultStatus, MeasureAs=WindowDefaultstatus] attribute DOMString defaultstatus;
-
- // Self referential attributes
- [Replaceable, DoNotCheckSecurity] readonly attribute Window self;
- [DoNotCheckSecurity, Unforgeable] readonly attribute Window window;
- [Replaceable, DoNotCheckSecurity] readonly attribute Window frames;
-
- [DoNotCheckSecurity, Custom=Setter] attribute Window opener;
- [Replaceable, DoNotCheckSecurity] readonly attribute Window parent;
- [DoNotCheckSecurity, Unforgeable] readonly attribute Window top;
-
- // DOM Level 2 AbstractView Interface
- readonly attribute Document document;
+ // CSS Object Model (CSSOM)
+ // http://dev.w3.org/csswg/cssom/#extensions-to-the-window-interface
+ // FIXME: The optional pseudoElt argument should have no default.
+ [NewObject, TypeChecking=Interface] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString? pseudoElt = null);
// CSSOM View Module
- MediaQueryList matchMedia(DOMString query);
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
+ [NewObject] MediaQueryList matchMedia(DOMString query);
+ [SameObject, Replaceable] readonly attribute Screen screen;
- // styleMedia has been removed from the CSSOM View specification.
- readonly attribute StyleMedia styleMedia;
+ // browsing context
+ void moveTo(long x, long y);
+ void moveBy(long x, long y);
+ void resizeTo(long x, long y);
+ void resizeBy(long x, long y);
- // DOM Level 2 Style Interface
- CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element,
- [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement);
+ // viewport
+ [Replaceable] readonly attribute long innerWidth;
+ [Replaceable] readonly attribute long innerHeight;
- // WebKit extensions
- [MeasureAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element,
- [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement);
+ // viewport scrolling
+ [Replaceable] readonly attribute double scrollX;
+ [Replaceable] readonly attribute double pageXOffset;
+ [Replaceable] readonly attribute double scrollY;
+ [Replaceable] readonly attribute double pageYOffset;
+ [RuntimeEnabled=CSSOMSmoothScroll] void scroll(optional ScrollToOptions options);
+ void scroll(unrestricted double x, unrestricted double y);
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions options);
+ void scrollTo(unrestricted double x, unrestricted double y);
+ [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions options);
+ void scrollBy(unrestricted double x, unrestricted double y);
+ // client
+ [Replaceable] readonly attribute long screenX;
+ [Replaceable] readonly attribute long screenY;
+ [Replaceable] readonly attribute long outerWidth;
+ [Replaceable] readonly attribute long outerHeight;
[Replaceable] readonly attribute double devicePixelRatio;
- [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache;
+ // Selection API
+ // http://w3c.github.io/selection-api/#extensions-to-window-interface
+ Selection? getSelection();
- [RuntimeEnabled=SessionStorage, LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage sessionStorage;
- [RuntimeEnabled=LocalStorage, LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage localStorage;
+ // Console API (non-standard but widely implemented in some form)
+ // https://developer.chrome.com/devtools/docs/console-api
+ [Replaceable] readonly attribute Console console;
+ // Non-standard APIs
+ [MeasureAs=WindowClientInformation, Replaceable] readonly attribute Navigator clientInformation;
+ [MeasureAs=WindowEvent, Custom, NotEnumerable] attribute Event event;
+ [MeasureAs=WindowFind] boolean find([Default=Undefined] optional DOMString string,
+ [Default=Undefined] optional boolean caseSensitive,
+ [Default=Undefined] optional boolean backwards,
+ [Default=Undefined] optional boolean wrap,
+ [Default=Undefined] optional boolean wholeWord,
+ [Default=Undefined] optional boolean searchInFrames,
+ [Default=Undefined] optional boolean showDialog);
+ [MeasureAs=WindowOffscreenBuffering, Replaceable, NotEnumerable] readonly attribute boolean offscreenBuffering;
+ [MeasureAs=WindowScreenLeft, Replaceable] readonly attribute long screenLeft;
+ [MeasureAs=WindowScreenTop, Replaceable] readonly attribute long screenTop;
+ [MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus;
+ [MeasureAs=WindowDefaultstatus, ImplementedAs=defaultStatus] attribute DOMString defaultstatus;
+ [MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia;
+ [DeprecateAs=GetMatchedCSSRules] CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element,
+ [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? pseudoElement);
// This is the interface orientation in degrees. Some examples are:
// 0 is straight up; -90 is when the device is rotated 90 clockwise;
// 90 is when rotated counter clockwise.
- [RuntimeEnabled=OrientationEvent, MeasureAs=WindowOrientation] readonly attribute long orientation;
-
- [Replaceable] readonly attribute Console console;
-
- // cross-document messaging
- [DoNotCheckSecurity, Custom, RaisesException] void postMessage(SerializedScriptValue message, DOMString targetOrigin, optional sequence<Transferable> transfer);
-
- [Replaceable] readonly attribute Performance performance;
-
- [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(RequestAnimationFrameCallback callback);
- void cancelAnimationFrame(long id);
- [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(RequestAnimationFrameCallback callback);
+ [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attribute long orientation;
+ [DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(FrameRequestCallback callback);
[DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(long id);
[DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(long id);
-
- [Replaceable] readonly attribute CSS CSS;
+ [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventConstructor WebKitTransitionEvent;
+ [Measure] attribute AnimationEventConstructor WebKitAnimationEvent;
+ [DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL;
+ [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver;
// Event handler attributes
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationend;
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationiteration;
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationstart;
+ attribute EventHandler onanimationend;
+ attribute EventHandler onanimationiteration;
+ attribute EventHandler onanimationstart;
[RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
attribute EventHandler onsearch;
[RuntimeEnabled=Touch] attribute EventHandler ontouchcancel;
@@ -190,20 +184,8 @@
attribute EventHandler onwebkittransitionend;
attribute EventHandler onwheel;
- [MeasureAs=WindowCaptureEvents] void captureEvents();
- [MeasureAs=WindowReleaseEvents] void releaseEvents();
-
- // Additional constructors.
- [MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventConstructor WebKitTransitionEvent;
- [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstructor AnimationEvent;
- [MeasureAs=PrefixedWindowURL] attribute URLConstructor webkitURL; // FIXME: deprecate this.
- [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver;
-
// window.toString() requires special handling in V8
[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
diff --git a/core/frame/WindowBase64.idl b/core/frame/WindowBase64.idl
index c5ed3a6..fe2fe8a 100644
--- a/core/frame/WindowBase64.idl
+++ b/core/frame/WindowBase64.idl
@@ -25,11 +25,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#windowbase64
+// https://html.spec.whatwg.org/#atob
[
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
] interface WindowBase64 {
- [RaisesException] DOMString btoa(DOMString string);
- [RaisesException] DOMString atob(DOMString string);
+ [RaisesException] DOMString btoa(DOMString btoa);
+ [RaisesException] DOMString atob(DOMString atob);
};
diff --git a/core/frame/WindowEventHandlers.idl b/core/frame/WindowEventHandlers.idl
index 95de525..9b76672 100644
--- a/core/frame/WindowEventHandlers.idl
+++ b/core/frame/WindowEventHandlers.idl
@@ -27,7 +27,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#windoweventhandlers
+// https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers
[
ImplementedAs=DOMWindowEventHandlers,
@@ -36,6 +36,7 @@
] interface WindowEventHandlers {
//attribute EventHandler onafterprint;
//attribute EventHandler onbeforeprint;
+ // FIXME: onbeforeunload should be an OnBeforeUnloadEventHandler.
attribute EventHandler onbeforeunload;
attribute EventHandler onhashchange;
attribute EventHandler onlanguagechange;
@@ -47,4 +48,9 @@
attribute EventHandler onpopstate;
attribute EventHandler onstorage;
attribute EventHandler onunload;
+
+ // Unhandled Promise Rejection Events
+ // https://github.com/domenic/unhandled-rejections-browser-spec
+ [RuntimeEnabled=PromiseRejectionEvent] attribute EventHandler onrejectionhandled;
+ [RuntimeEnabled=PromiseRejectionEvent] attribute EventHandler onunhandledrejection;
};
diff --git a/core/frame/WindowTimers.idl b/core/frame/WindowTimers.idl
index 47f394f..0840392 100644
--- a/core/frame/WindowTimers.idl
+++ b/core/frame/WindowTimers.idl
@@ -25,21 +25,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#windowtimers
+// https://html.spec.whatwg.org/#timers
[
ImplementedAs=DOMWindowTimers,
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
] interface WindowTimers {
- // FIXME: currently using [Custom] and |any| because overload algorithm
- // can't handle Function/DOMString overload properly
- // http://crbug.com/293561
// FIXME: would be clearer as a union type, like:
// typedef (Function or DOMString) Handler
// Needs spec update and better union support: http://crbug.com/240176
- [Custom] long setTimeout(any handler, [Default=Undefined] optional long timeout);
- void clearTimeout([Default=Undefined] optional long handle);
- [Custom] long setInterval(any handler, [Default=Undefined] optional long timeout);
- void clearInterval([Default=Undefined] optional long handle);
+ [CallWith=ScriptState] long setTimeout(Function handler, optional long timeout = 0, any... arguments);
+ [CallWith=ScriptState] long setTimeout(DOMString handler, optional long timeout = 0, any... arguments);
+ void clearTimeout(optional long handle = 0);
+ [CallWith=ScriptState] long setInterval(Function handler, optional long timeout = 0, any... arguments);
+ [CallWith=ScriptState] long setInterval(DOMString handler, optional long timeout = 0, any... arguments);
+ void clearInterval(optional long handle = 0);
};
diff --git a/core/html/FormData.idl b/core/html/FormData.idl
index bab02fc..dccbd43 100644
--- a/core/html/FormData.idl
+++ b/core/html/FormData.idl
@@ -28,14 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#formdata
+// https://xhr.spec.whatwg.org/#interface-formdata
+
+// TODO(philipj): The FormDataEntryValue typedef should use Blob, not File.
+typedef (File or USVString) FormDataEntryValue;
[
Constructor(optional HTMLFormElement form),
Exposed=(Window,Worker),
+ GarbageCollected,
ImplementedAs=DOMFormData,
- WillBeGarbageCollected,
] interface FormData {
- [DartCustom] void append(DOMString name, Blob value, optional DOMString filename);
- [DartCustom] void append(DOMString name, DOMString value);
+ // TODO(philipj): The value argument should be FormDataEntryValue and there
+ // should be no optional filename argument. crbug.com/498790
+ [CallWith=ExecutionContext] void append(USVString name, Blob value, optional USVString filename);
+ void append(USVString name, USVString value);
+
+ [RuntimeEnabled=FormDataNewMethods, ImplementedAs=deleteEntry] void delete(USVString name);
+ [RuntimeEnabled=FormDataNewMethods] FormDataEntryValue? get(USVString name);
+ [RuntimeEnabled=FormDataNewMethods] sequence<FormDataEntryValue> getAll(USVString name);
+ [RuntimeEnabled=FormDataNewMethods, ImplementedAs=hasEntry] boolean has(USVString name);
+ // TODO(philipj): The value argument should be FormDataEntryValue and there
+ // should be no optional filename argument.
+ [RuntimeEnabled=FormDataNewMethods] void set(USVString name, Blob value, optional USVString filename);
+ [RuntimeEnabled=FormDataNewMethods] void set(USVString name, USVString value);
+ [RuntimeEnabled=FormDataNewMethods] iterable<USVString, FormDataEntryValue>;
};
diff --git a/core/html/HTMLAllCollection.idl b/core/html/HTMLAllCollection.idl
index d56b8b6..40c7fc4 100644
--- a/core/html/HTMLAllCollection.idl
+++ b/core/html/HTMLAllCollection.idl
@@ -24,6 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-htmlallcollection-interface
+
// FIXME: This interface should inherit HTMLCollection.
[
Custom=LegacyCallAsFunction,
@@ -31,9 +33,14 @@
SetWrapperReferenceFrom=ownerNode,
WillBeGarbageCollected,
] interface HTMLAllCollection {
+ // FIXME: length and 'getter' should be inherited from HTMLCollection.
readonly attribute unsigned long length;
[ImplementedAs=item] getter Element (unsigned long index);
- [Custom] Element item([Default=Undefined] optional unsigned long index);
- // FIXME: This should return an (HTMLCollection or Element) union.
- [ImplementedAs=namedGetter] getter (NodeList or Element) namedItem(DOMString name);
+ // FIXME: The custom item() implementation may return a NodeList, but the
+ // spec has a (HTMLCollection or Element)? item(DOMString name) method.
+ [Custom] Element? item([Default=Undefined] optional unsigned long index);
+ // FIXME:
+ // FIXME: namedItem() should be a legacycaller. crbug.com/465009
+ // FIXME: namedItem() should return an (HTMLCollection or Element)? union.
+ [ImplementedAs=namedGetter] getter (NodeList or Element)? namedItem(DOMString name);
};
diff --git a/core/html/HTMLAnchorElement.idl b/core/html/HTMLAnchorElement.idl
index 63775c2..a91eb23 100644
--- a/core/html/HTMLAnchorElement.idl
+++ b/core/html/HTMLAnchorElement.idl
@@ -18,22 +18,27 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-a-element
+
interface HTMLAnchorElement : HTMLElement {
- [Reflect] attribute DOMString charset;
- [Reflect] attribute DOMString coords;
+ [Reflect] attribute DOMString target;
[Reflect] attribute DOMString download;
- [Reflect] attribute DOMString hreflang;
- [Reflect] attribute DOMString name;
+ // FIXME: ping should be a DOMSettableTokenList.
[Reflect] attribute DOMString ping;
[Reflect] attribute DOMString rel;
- [Reflect] attribute DOMString rev;
- [Reflect] attribute DOMString shape;
- [Reflect] attribute DOMString target;
+ // FIXME: readonly attribute DOMTokenList relList;
+ [Reflect] attribute DOMString hreflang;
[Reflect] attribute DOMString type;
[ImplementedAs=textContent] attribute DOMString text;
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLAnchorElement-partial
+ [Reflect] attribute DOMString coords;
+ [Reflect] attribute DOMString charset;
+ [Reflect] attribute DOMString name;
+ [Reflect] attribute DOMString rev;
+ [Reflect] attribute DOMString shape;
};
HTMLAnchorElement implements URLUtils;
diff --git a/core/html/HTMLAppletElement.idl b/core/html/HTMLAppletElement.idl
index 283e205..d337bfb 100644
--- a/core/html/HTMLAppletElement.idl
+++ b/core/html/HTMLAppletElement.idl
@@ -18,8 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-applet-element
+
+// TODO(yukishiino): HTMLAppletElement should not have [OverrideBuiltins].
[
- Custom=LegacyCallAsFunction,
+ OverrideBuiltins,
] interface HTMLAppletElement : HTMLElement {
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString alt;
@@ -29,9 +32,11 @@
[Reflect] attribute DOMString height;
[Reflect] attribute unsigned long hspace;
[Reflect] attribute DOMString name;
- [Reflect, URL] attribute DOMString _object; // "object" is a reserved word
+ [Reflect, URL] attribute DOMString _object; // the underscore is not part of the identifier
[Reflect] attribute unsigned long vspace;
[Reflect] attribute DOMString width;
+
+ // FIXME: These getters and setters are not in the spec.
[Custom, NotEnumerable] getter boolean (unsigned long index);
[Custom] setter boolean (unsigned long index, Node value);
[Custom, NotEnumerable] getter Node (DOMString name);
diff --git a/core/html/HTMLAreaElement.idl b/core/html/HTMLAreaElement.idl
index 471e583..89a51c4 100644
--- a/core/html/HTMLAreaElement.idl
+++ b/core/html/HTMLAreaElement.idl
@@ -18,13 +18,20 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-area-element
+
interface HTMLAreaElement : HTMLElement {
[Reflect] attribute DOMString alt;
[Reflect] attribute DOMString coords;
- [Reflect] attribute boolean noHref;
- [Reflect] attribute DOMString ping;
[Reflect] attribute DOMString shape;
[Reflect] attribute DOMString target;
+ // FIXME: ping should be a DOMSettableTokenList.
+ [Reflect] attribute DOMString ping;
+ // FIXME: download, rel, relList, hreflang and type are missing.
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLAreaElement-partial
+ [Reflect] attribute boolean noHref;
};
HTMLAreaElement implements URLUtils;
diff --git a/core/html/HTMLAudioElement.idl b/core/html/HTMLAudioElement.idl
index f1e3629..5e1076b 100644
--- a/core/html/HTMLAudioElement.idl
+++ b/core/html/HTMLAudioElement.idl
@@ -23,8 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-audio-element
+
[
RuntimeEnabled=Media,
+ // FIXME: The src argument should have no default value.
NamedConstructor=Audio(optional DOMString src = null),
ConstructorCallWith=Document
] interface HTMLAudioElement : HTMLMediaElement {
diff --git a/core/html/HTMLBRElement.idl b/core/html/HTMLBRElement.idl
index c909dc1..0f10d28 100644
--- a/core/html/HTMLBRElement.idl
+++ b/core/html/HTMLBRElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-br-element
+
interface HTMLBRElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLBRElement-partial
[Reflect] attribute DOMString clear;
};
-
diff --git a/core/html/HTMLBaseElement.idl b/core/html/HTMLBaseElement.idl
index 87e614f..4a6273d 100644
--- a/core/html/HTMLBaseElement.idl
+++ b/core/html/HTMLBaseElement.idl
@@ -17,6 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-base-element
+
interface HTMLBaseElement : HTMLElement {
attribute DOMString href;
[Reflect] attribute DOMString target;
diff --git a/core/html/HTMLBodyElement.idl b/core/html/HTMLBodyElement.idl
index 9a06a3c..51f0308 100644
--- a/core/html/HTMLBodyElement.idl
+++ b/core/html/HTMLBodyElement.idl
@@ -18,23 +18,30 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-body-element
+
interface HTMLBodyElement : HTMLElement {
- [Reflect, TreatNullAs=EmptyString] attribute DOMString aLink;
- [Reflect] attribute DOMString background;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString link;
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLBodyElement-partial
[Reflect, TreatNullAs=EmptyString] attribute DOMString text;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString link;
[Reflect, TreatNullAs=EmptyString] attribute DOMString vLink;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString aLink;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [Reflect] attribute DOMString background;
- [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
-
- // Overrides of GlobalEventHandler attributes
+ // TODO(philipj): These event handler attributes should be inherited from
+ // HTMLElement (which implements GlobalEventHandlers), but have different
+ // behavior. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28166
attribute EventHandler onblur;
attribute EventHandler onerror;
attribute EventHandler onfocus;
attribute EventHandler onload;
attribute EventHandler onresize;
attribute EventHandler onscroll;
+
+ // Non-standard APIs
+ [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
};
HTMLBodyElement implements WindowEventHandlers;
diff --git a/core/html/HTMLButtonElement.idl b/core/html/HTMLButtonElement.idl
index 7845755..6ab20ee 100644
--- a/core/html/HTMLButtonElement.idl
+++ b/core/html/HTMLButtonElement.idl
@@ -18,10 +18,12 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-button-element
+
interface HTMLButtonElement : HTMLElement {
[Reflect] attribute boolean autofocus;
[Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
[Reflect, URL] attribute DOMString formAction;
attribute DOMString formEnctype;
attribute DOMString formMethod;
@@ -30,12 +32,14 @@
[Reflect] attribute DOMString name;
attribute DOMString type;
[Reflect] attribute DOMString value;
+ // FIXME: attribute HTMLMenuElement? menu;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLCanvasElement.idl b/core/html/HTMLCanvasElement.idl
index 47c796b..458e8ab 100644
--- a/core/html/HTMLCanvasElement.idl
+++ b/core/html/HTMLCanvasElement.idl
@@ -24,17 +24,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface HTMLCanvasElement : HTMLElement {
+// https://html.spec.whatwg.org/#the-canvas-element
+interface HTMLCanvasElement : HTMLElement {
+ // FIXME: width and height should be unsigned long.
attribute long width;
attribute long height;
- // FIXMEDART: Upstream: Added the optional quality param that V8 accepts.
- [Custom, RaisesException] DOMString toDataURL([TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? type, optional float quality);
+ // Note: this differs deliberately from the specified Web IDL for this function:
+ // RenderingContext? getContext(DOMString contextId, any... arguments);
+ // in order to eliminate the custom binding. It is functionally equivalent.
+ //
+ // The PermissiveDictionaryConversion extended attribute is needed to allow the
+ // autogenerated code to match the behavior of the custom binding. Web IDL
+ // requires throwing TypeError if the incoming argument is not an object type
+ // (and is not undefined or null). The binding must ignore this.
+ //
+ // Also note: the only reason this must return type "any" is to allow the
+ // InspectorInstrumentation wrappers to be called for canvases. If that could be
+ // handled differently the return type could be changed to "RenderingContext?"
+ // and the [CallWith=ScriptState] extended attribute removed.
+ //
+ // FIXME: The contextId argument should not be optional.
+ [CallWith=ScriptState] any getContext([Default=Undefined] optional DOMString contextId, [PermissiveDictionaryConversion] optional CanvasContextCreationAttributes attributes);
- // FIXMEDART:
- // - Upstream: Added the optional quality param that V8 accepts.
- // - Return RenderingContext.
- // The custom binding is needed to handle context creation attributes.
- [Custom] any getContext([Default=Undefined] optional DOMString contextId, optional Dictionary attrs);
+ // Note: The arguments argument is variadic in the spec, but not here as
+ // only one extra argument is actually used.
+ // FIXME: type should not be nullable or have a default value.
+ [RaisesException] DOMString toDataURL(optional DOMString? type = null, optional any arguments);
};
diff --git a/core/html/HTMLCollection.idl b/core/html/HTMLCollection.idl
index cab83cd..85c2d5a 100644
--- a/core/html/HTMLCollection.idl
+++ b/core/html/HTMLCollection.idl
@@ -19,14 +19,15 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-htmlcollection
+
[
- Custom=Wrap,
DependentLifetime,
SetWrapperReferenceFrom=ownerNode,
WillBeGarbageCollected,
] interface HTMLCollection {
readonly attribute unsigned long length;
- getter Element item([Default=Undefined] optional unsigned long index);
- getter Element namedItem(DOMString name);
+ // FIXME: The index argument should not be optional.
+ getter Element? item([Default=Undefined] optional unsigned long index);
+ getter Element? namedItem(DOMString name);
};
-
diff --git a/core/html/HTMLContentElement.idl b/core/html/HTMLContentElement.idl
index 15d63d6..d03ee3d 100644
--- a/core/html/HTMLContentElement.idl
+++ b/core/html/HTMLContentElement.idl
@@ -24,8 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
-] interface HTMLContentElement : HTMLElement {
+// http://w3c.github.io/webcomponents/spec/shadow/#the-content-element
+
+interface HTMLContentElement : HTMLElement {
+ // FIXME: select should not have [TreatNullAs=NullString].
[Reflect, TreatNullAs=NullString] attribute DOMString select;
NodeList getDistributedNodes();
};
diff --git a/core/html/HTMLDListElement.idl b/core/html/HTMLDListElement.idl
index 95a97ff..9813b53 100644
--- a/core/html/HTMLDListElement.idl
+++ b/core/html/HTMLDListElement.idl
@@ -17,7 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-dl-element
+
interface HTMLDListElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLDListElement-partial
[Reflect] attribute boolean compact;
};
-
diff --git a/core/html/HTMLDataListElement.idl b/core/html/HTMLDataListElement.idl
index 4dd3654..deff02e 100644
--- a/core/html/HTMLDataListElement.idl
+++ b/core/html/HTMLDataListElement.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-datalist-element
+
interface HTMLDataListElement : HTMLElement {
readonly attribute HTMLCollection options;
};
diff --git a/core/html/HTMLDetailsElement.idl b/core/html/HTMLDetailsElement.idl
index 363785a..e3711bc 100644
--- a/core/html/HTMLDetailsElement.idl
+++ b/core/html/HTMLDetailsElement.idl
@@ -17,9 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-[
- NoInterfaceObject
-] interface HTMLDetailsElement : HTMLElement {
+// https://html.spec.whatwg.org/#the-details-element
+
+interface HTMLDetailsElement : HTMLElement {
[Reflect] attribute boolean open;
};
-
diff --git a/core/html/HTMLDialogElement.idl b/core/html/HTMLDialogElement.idl
index 702653d..b6d8711 100644
--- a/core/html/HTMLDialogElement.idl
+++ b/core/html/HTMLDialogElement.idl
@@ -23,11 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-dialog-element
+
interface HTMLDialogElement : HTMLElement {
[Reflect] attribute boolean open;
attribute DOMString returnValue;
- [RaisesException] void close(optional DOMString returnValue = null);
+ // FIXME: show() and showModal() should take an anchor argument.
void show();
[RaisesException] void showModal();
+ // FIXME: The returnValue argument should have no default value.
+ [RaisesException] void close(optional DOMString returnValue = null);
};
-
diff --git a/core/html/HTMLDirectoryElement.idl b/core/html/HTMLDirectoryElement.idl
index 541ae00..ea9d1a5 100644
--- a/core/html/HTMLDirectoryElement.idl
+++ b/core/html/HTMLDirectoryElement.idl
@@ -17,7 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#htmldirectoryelement
+
interface HTMLDirectoryElement : HTMLElement {
[Reflect] attribute boolean compact;
};
-
diff --git a/core/html/HTMLDivElement.idl b/core/html/HTMLDivElement.idl
index f8ab122..9ee666d 100644
--- a/core/html/HTMLDivElement.idl
+++ b/core/html/HTMLDivElement.idl
@@ -17,6 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-div-element
+
interface HTMLDivElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLDivElement-partial
[Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLDocument.idl b/core/html/HTMLDocument.idl
index e166240..1b73bc8 100644
--- a/core/html/HTMLDocument.idl
+++ b/core/html/HTMLDocument.idl
@@ -18,32 +18,25 @@
* Boston, MA 02110-1301, USA.
*/
+// FIXME: "For historical reasons, Window objects must also have a
+// writable, configurable, non-enumerable property named HTMLDocument
+// whose value is the Document interface object."
+// https://html.spec.whatwg.org/#the-window-object
+
interface HTMLDocument : Document {
- [Custom, CustomElementCallbacks] void open();
- [RaisesException] void close();
+ // https://html.spec.whatwg.org/#Document-partial
- // 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, CustomElementCallbacks, RaisesException] void write(DOMString... text);
- [CallWith=ActiveWindow, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
-
- // Extensions
-
- [Replaceable, ImplementedAs=allForBinding] readonly attribute HTMLAllCollection all;
+ // FIXME: *Color should have [TreatNullAs=EmptyString].
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString fgColor;
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString linkColor;
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString vlinkColor;
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString alinkColor;
+ [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString bgColor;
[MeasureAs=DocumentClear] void clear();
-
[MeasureAs=DocumentCaptureEvents] void captureEvents();
[MeasureAs=DocumentReleaseEvents] void releaseEvents();
- readonly attribute DOMString compatMode;
-
- // Deprecated attributes
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString bgColor;
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString fgColor;
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString alinkColor;
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString linkColor;
- [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString vlinkColor;
+ // FIXME: all should not be [Replaceable].
+ [Replaceable, ImplementedAs=allForBinding] readonly attribute HTMLAllCollection all;
};
-
diff --git a/core/html/HTMLElement.idl b/core/html/HTMLElement.idl
index e606b15..7a849e9 100644
--- a/core/html/HTMLElement.idl
+++ b/core/html/HTMLElement.idl
@@ -18,34 +18,49 @@
* Boston, MA 02110-1301, USA.
*/
-[
- Custom=Wrap,
-] interface HTMLElement : Element {
+// https://html.spec.whatwg.org/#htmlelement
+
+interface HTMLElement : Element {
+ // metadata attributes
[Reflect] attribute DOMString title;
[Reflect] attribute DOMString lang;
attribute boolean translate;
attribute DOMString dir;
+ [SameObject, PerWorldBindings] readonly attribute DOMStringMap dataset;
- [CustomElementCallbacks] attribute long tabIndex;
- [CustomElementCallbacks] attribute boolean draggable;
- [Reflect, TreatNullAs=NullString, MeasureAs=PrefixedHTMLElementDropzone] attribute DOMString webkitdropzone;
+ // user interaction
[Reflect] attribute boolean hidden;
+ void click();
+ [CustomElementCallbacks] attribute long tabIndex;
+ void focus();
+ void blur();
[Reflect] attribute DOMString accessKey;
+ [CustomElementCallbacks] attribute boolean draggable;
+ [RuntimeEnabled=ContextMenu] attribute HTMLMenuElement? contextMenu;
+ attribute boolean spellcheck;
- // Extensions
- [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementInnerText] attribute DOMString innerText;
- [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementOuterText] attribute DOMString outerText;
-
- [RuntimeEnabled=IMEAPI] readonly attribute InputMethodContext inputMethodContext;
-
+ // HTMLElement implements ElementContentEditable
+ // https://html.spec.whatwg.org/#contenteditable
[CustomElementCallbacks, RaisesException=Setter] attribute DOMString contentEditable;
readonly attribute boolean isContentEditable;
- [RuntimeEnabled=ContextMenu] attribute HTMLMenuElement? contextMenu;
- attribute boolean spellcheck;
+ // CSSOM View Module
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface
+ [PerWorldBindings] readonly attribute Element? offsetParent;
+ readonly attribute long offsetTop;
+ readonly attribute long offsetLeft;
+ readonly attribute long offsetWidth;
+ readonly attribute long offsetHeight;
- void click();
+ // CSS Object Model (CSSOM)
+ // http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface
+ // FIXME: style should have [PutForwards=cssText].
+ [SameObject, PerWorldBindings] readonly attribute CSSStyleDeclaration style;
+
+ // Non-standard APIs
+ [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementInnerText] attribute DOMString innerText;
+ [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementOuterText] attribute DOMString outerText;
+ [Reflect, TreatNullAs=NullString, MeasureAs=PrefixedHTMLElementDropzone] attribute DOMString webkitdropzone;
};
HTMLElement implements GlobalEventHandlers;
-
diff --git a/core/html/HTMLEmbedElement.idl b/core/html/HTMLEmbedElement.idl
index b07922d..5759506 100644
--- a/core/html/HTMLEmbedElement.idl
+++ b/core/html/HTMLEmbedElement.idl
@@ -18,21 +18,28 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-embed-element
+
+// TODO(yukishiino): HTMLEmbedElement should not have [OverrideBuiltins].
[
Custom=LegacyCallAsFunction,
+ OverrideBuiltins,
] interface HTMLEmbedElement : HTMLElement {
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString height;
- [Reflect] attribute DOMString name;
[Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString type;
[Reflect] attribute DOMString width;
+ [Reflect] attribute DOMString height;
+ [CheckSecurity=Node, RaisesException] Document? getSVGDocument();
+ // FIXME: The spec has a legacycaller any (any... arguments); crbug.com/465009
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLEmbedElement-partial
+ [Reflect] attribute DOMString align;
+ [Reflect] attribute DOMString name;
+
+ // FIXME: None of these getters and setters are in the spec.
[Custom, NotEnumerable] getter boolean (unsigned long index);
[Custom] setter boolean (unsigned long index, Node value);
[Custom, NotEnumerable] getter Node (DOMString name);
[Custom] setter Node (DOMString name, Node value);
-
- [CheckSecurity=Node, RaisesException] Document getSVGDocument();
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
};
diff --git a/core/html/HTMLFieldSetElement.idl b/core/html/HTMLFieldSetElement.idl
index e8fcd53..58dc295 100644
--- a/core/html/HTMLFieldSetElement.idl
+++ b/core/html/HTMLFieldSetElement.idl
@@ -17,18 +17,21 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-fieldset-element
+
interface HTMLFieldSetElement : HTMLElement {
[Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
[Reflect] attribute DOMString name;
readonly attribute DOMString type;
- readonly attribute HTMLCollection elements;
+ readonly attribute HTMLFormControlsCollection elements;
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ readonly attribute boolean willValidate;
+ [SameObject] readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
};
diff --git a/core/html/HTMLFontElement.idl b/core/html/HTMLFontElement.idl
index cc7b704..c6ec865 100644
--- a/core/html/HTMLFontElement.idl
+++ b/core/html/HTMLFontElement.idl
@@ -17,6 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#htmlfontelement
+
interface HTMLFontElement : HTMLElement {
[Reflect, TreatNullAs=EmptyString] attribute DOMString color;
[Reflect] attribute DOMString face;
diff --git a/core/html/HTMLFormControlsCollection.idl b/core/html/HTMLFormControlsCollection.idl
index 5ed779f..90ca091 100644
--- a/core/html/HTMLFormControlsCollection.idl
+++ b/core/html/HTMLFormControlsCollection.idl
@@ -19,10 +19,15 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-htmlformcontrolscollection-interface
+
[
DependentLifetime,
SetWrapperReferenceFrom=ownerNode,
] interface HTMLFormControlsCollection : HTMLCollection {
+ // inherits length and item()
+ // FIXME: namedItem() should be a legacycaller. crbug.com/465009
+ [ImplementedAs=namedGetter] getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
+ // FIXME: This getter is not in the spec.
[ImplementedAs=item] getter Node (unsigned long index);
- [ImplementedAs=namedGetter] getter (RadioNodeList or Element) namedItem(DOMString name); // shadows inherited namedItem()
};
diff --git a/core/html/HTMLFormElement.idl b/core/html/HTMLFormElement.idl
index 36db8c9..cbd2500 100644
--- a/core/html/HTMLFormElement.idl
+++ b/core/html/HTMLFormElement.idl
@@ -18,6 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-form-element
+
[
OverrideBuiltins,
] interface HTMLFormElement : HTMLElement {
@@ -31,14 +33,16 @@
[Reflect] attribute boolean noValidate;
[Reflect] attribute DOMString target;
- readonly attribute HTMLCollection elements;
+ readonly attribute HTMLFormControlsCollection elements;
readonly attribute long length;
[ImplementedAs=item] getter Element (unsigned long index);
+ // FIXME: This getter should not have [NotEnumerable].
[NotEnumerable] getter (RadioNodeList or Element) (DOMString name);
[ImplementedAs=submitFromJavaScript] void submit();
[CustomElementCallbacks] void reset();
boolean checkValidity();
+ boolean reportValidity();
[RuntimeEnabled=RequestAutocomplete] void requestAutocomplete();
};
diff --git a/core/html/HTMLFrameElement.idl b/core/html/HTMLFrameElement.idl
index 13c840c..819bc6c 100644
--- a/core/html/HTMLFrameElement.idl
+++ b/core/html/HTMLFrameElement.idl
@@ -18,22 +18,22 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLFrameElement : HTMLElement {
+// https://html.spec.whatwg.org/#htmlframeelement
- [Reflect] attribute DOMString frameBorder;
- [Reflect, URL] attribute DOMString longDesc;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
+interface HTMLFrameElement : HTMLElement {
[Reflect] attribute DOMString name;
- [Reflect] attribute boolean noResize;
[Reflect] attribute DOMString scrolling;
[Reflect, URL] attribute DOMString src;
+ [Reflect] attribute DOMString frameBorder;
+ [Reflect, URL] attribute DOMString longDesc;
+ [Reflect] attribute boolean noResize;
+ [CheckSecurity=Node] readonly attribute Document? contentDocument;
+ readonly attribute Window? contentWindow;
- // Introduced in DOM Level 2:
- [CheckSecurity=Node] readonly attribute Document contentDocument;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
- // Extensions
- readonly attribute Window contentWindow;
-
- [CheckSecurity=Node, RaisesException] Document getSVGDocument();
+ // FIXME: The spec defines getSVGDocument() for HTMLIFrameElement,
+ // HTMLEmbedElement and HTMLObjectElement, but not here.
+ [Measure, CheckSecurity=Node, RaisesException] Document? getSVGDocument();
};
diff --git a/core/html/HTMLFrameSetElement.idl b/core/html/HTMLFrameSetElement.idl
index e7c6a24..21caf79 100644
--- a/core/html/HTMLFrameSetElement.idl
+++ b/core/html/HTMLFrameSetElement.idl
@@ -18,22 +18,28 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#htmlframesetelement
+
+// FIXME: HTMLFrameSetElement should not have [OverrideBuiltins].
[
OverrideBuiltins,
] interface HTMLFrameSetElement : HTMLElement {
- [NotEnumerable] getter Window (DOMString name);
[Reflect] attribute DOMString cols;
[Reflect] attribute DOMString rows;
- [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
-
- // Overrides of GlobalEventHandler attributes
+ // TODO(philipj): These event handler attributes should be inherited from
+ // HTMLElement (which implements GlobalEventHandlers), but have different
+ // behavior. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28166
attribute EventHandler onblur;
attribute EventHandler onerror;
attribute EventHandler onfocus;
attribute EventHandler onload;
attribute EventHandler onresize;
attribute EventHandler onscroll;
+
+ // Non-standard APIs
+ [NotEnumerable] getter Window (DOMString name);
+ [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
};
HTMLFrameSetElement implements WindowEventHandlers;
diff --git a/core/html/HTMLHRElement.idl b/core/html/HTMLHRElement.idl
index 95950eb..1023126 100644
--- a/core/html/HTMLHRElement.idl
+++ b/core/html/HTMLHRElement.idl
@@ -17,7 +17,12 @@
* Boston, MA 02110-1301, USA.
*/
+
+// https://html.spec.whatwg.org/#the-hr-element
+
interface HTMLHRElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLHRElement-partial
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString color;
[Reflect] attribute boolean noShade;
diff --git a/core/html/HTMLHeadElement.idl b/core/html/HTMLHeadElement.idl
index fb54cb5..dc5d2e5 100644
--- a/core/html/HTMLHeadElement.idl
+++ b/core/html/HTMLHeadElement.idl
@@ -17,6 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-head-element
+
interface HTMLHeadElement : HTMLElement {
- [Reflect, TreatNullAs=NullString, DeprecateAs=HTMLHeadElementProfile] attribute DOMString profile;
};
diff --git a/core/html/HTMLHeadingElement.idl b/core/html/HTMLHeadingElement.idl
index fe558d2..4ce52c9 100644
--- a/core/html/HTMLHeadingElement.idl
+++ b/core/html/HTMLHeadingElement.idl
@@ -17,6 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
+
interface HTMLHeadingElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLHeadingElement-partial
[Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLHtmlElement.idl b/core/html/HTMLHtmlElement.idl
index 3099de6..c302e46 100644
--- a/core/html/HTMLHtmlElement.idl
+++ b/core/html/HTMLHtmlElement.idl
@@ -17,6 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-html-element
+
interface HTMLHtmlElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLHtmlElement-partial
[Reflect] attribute DOMString version;
};
diff --git a/core/html/HTMLIFrameElement.idl b/core/html/HTMLIFrameElement.idl
index 568cd6b..d3f8e3f 100644
--- a/core/html/HTMLIFrameElement.idl
+++ b/core/html/HTMLIFrameElement.idl
@@ -18,28 +18,28 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-iframe-element
+
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=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] attribute DOMString src;
[Reflect] attribute DOMString srcdoc;
+ [Reflect] attribute DOMString name;
+ [PutForwards=value] readonly attribute DOMSettableTokenList sandbox;
+ // Note: The seamless attribute was once supported, but was removed.
+ [Reflect] attribute boolean allowFullscreen;
[Reflect] attribute DOMString width;
+ [Reflect] attribute DOMString height;
+ [CheckSecurity=Node] readonly attribute Document? contentDocument;
+ readonly attribute Window? contentWindow;
+ [CheckSecurity=Node, RaisesException] Document? getSVGDocument();
- // Introduced in DOM Level 2:
- [CheckSecurity=Node] readonly attribute Document contentDocument;
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLIFrameElement-partial
+ [Reflect] attribute DOMString align;
+ [Reflect] attribute DOMString scrolling;
+ [Reflect] attribute DOMString frameBorder;
+ [Reflect, URL] attribute DOMString longDesc;
- // Extensions
- readonly attribute Window contentWindow;
-
- [CheckSecurity=Node, RaisesException] Document getSVGDocument();
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
};
diff --git a/core/html/HTMLImageElement.idl b/core/html/HTMLImageElement.idl
index cde8092..976e52f 100644
--- a/core/html/HTMLImageElement.idl
+++ b/core/html/HTMLImageElement.idl
@@ -18,36 +18,40 @@
* Boston, MA 02110-1301, USA.
*/
-// FIXME: NamedConstructor does not support optional without Default. Fortunately using Undefined makes
-// us use 0 which happens to be the default width and height anyway.
+// https://html.spec.whatwg.org/#the-img-element
+
+// TODO(philipj): All long types in this interfaces should be unsigned long.
[
- NamedConstructor=Image([Default=Undefined] optional long width, [Default=Undefined] optional long height),
+ NamedConstructor=Image(optional long width, optional long height),
ConstructorCallWith=Document
] interface HTMLImageElement : HTMLElement {
- [Reflect] attribute DOMString align;
[Reflect] attribute DOMString alt;
- [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] attribute DOMString longDesc;
- [Reflect, URL] attribute DOMString lowsrc;
- [Reflect] attribute DOMString name;
- readonly attribute long naturalHeight;
- readonly attribute long naturalWidth;
[Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString srcset;
- [Reflect, RuntimeEnabled=PictureSizes] attribute DOMString sizes;
- [RuntimeEnabled=PictureSizes] readonly attribute DOMString currentSrc;
+ [Reflect] attribute DOMString sizes;
+ [Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
[Reflect] attribute DOMString useMap;
- [Reflect] attribute long vspace;
+ [Reflect] attribute boolean isMap;
attribute long width;
+ attribute long height;
+ readonly attribute long naturalWidth;
+ readonly attribute long naturalHeight;
+ readonly attribute boolean complete;
+ readonly attribute DOMString currentSrc;
- // Extensions
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLImageElement-partial
+ [Reflect] attribute DOMString name;
+ [Reflect, URL] attribute DOMString lowsrc;
+ [Reflect] attribute DOMString align;
+ [Reflect] attribute long hspace;
+ [Reflect] attribute long vspace;
+ [Reflect, URL] attribute DOMString longDesc;
+
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
+
+ // CSSOM View Module
+ // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlimageelement-interface
[MeasureAs=HTMLImageElementX] readonly attribute long x;
[MeasureAs=HTMLImageElementY] readonly attribute long y;
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
};
diff --git a/core/html/HTMLInputElement.idl b/core/html/HTMLInputElement.idl
index d53dd5b..95719d0 100644
--- a/core/html/HTMLInputElement.idl
+++ b/core/html/HTMLInputElement.idl
@@ -19,11 +19,10 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#htmlinputelement
+// https://html.spec.whatwg.org/#the-input-element
interface HTMLInputElement : HTMLElement {
[Reflect] attribute DOMString accept;
- [Reflect] attribute DOMString align;
[Reflect] attribute DOMString alt;
[Reflect] attribute DOMString autocomplete;
[Reflect] attribute boolean autofocus;
@@ -31,10 +30,10 @@
attribute boolean checked;
[Reflect] attribute DOMString dirName;
[Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
// The 'files' attribute is intentionally not readonly.
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22682
- attribute FileList files;
+ attribute FileList? files;
[Reflect, URL] attribute DOMString formAction;
[CustomElementCallbacks] attribute DOMString formEnctype;
[CustomElementCallbacks] attribute DOMString formMethod;
@@ -43,59 +42,72 @@
[CustomElementCallbacks] attribute unsigned long height;
attribute boolean indeterminate;
[RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
- readonly attribute HTMLElement list;
+ readonly attribute HTMLElement? list;
[Reflect] attribute DOMString max;
[RaisesException=Setter, CustomElementCallbacks] attribute long maxLength;
[Reflect] attribute DOMString min;
+ [RaisesException=Setter, CustomElementCallbacks] attribute long minLength;
[Reflect] attribute boolean multiple;
[Reflect] attribute DOMString name;
[Reflect] attribute DOMString pattern;
[Reflect] attribute DOMString placeholder;
[Reflect] attribute boolean readOnly;
[Reflect] attribute boolean required;
- [RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size; // Changed string -> long -> unsigned long
+ [RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size;
[Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString step;
- [CustomElementCallbacks] attribute DOMString type; // readonly dropped as part of DOM level 2
+ [CustomElementCallbacks] attribute DOMString type;
[Reflect=value, CustomElementCallbacks] attribute DOMString defaultValue;
- [Reflect] attribute DOMString useMap;
- // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
[TreatNullAs=EmptyString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
[RaisesException=Setter, CustomElementCallbacks] attribute Date? valueAsDate;
[RaisesException=Setter, CustomElementCallbacks] attribute unrestricted double valueAsNumber;
+ // Note: The spec has valueLow and valueHigh for two-valued range controls.
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=13154
+ [CustomElementCallbacks] attribute unsigned long width;
[RaisesException, CustomElementCallbacks] void stepUp(optional long n = 1);
[RaisesException, CustomElementCallbacks] void stepDown(optional long n = 1);
- [CustomElementCallbacks] attribute unsigned long width;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
readonly attribute NodeList labels;
void select();
+ // FIXME: selectionStart and selectionEnd should be unsigned long.
[RaisesException, ImplementedAs=selectionStartForBinding] attribute long selectionStart;
[RaisesException, ImplementedAs=selectionEndForBinding] attribute long selectionEnd;
[RaisesException, ImplementedAs=selectionDirectionForBinding] attribute DOMString selectionDirection;
-
[RaisesException] void setRangeText(DOMString replacement);
+ // FIXME: The selectionMode argument should be a SelectionMode enum.
[RaisesException] void setRangeText(DOMString replacement,
- unsigned long start,
- unsigned long end,
- optional DOMString selectionMode = "preserve");
-
+ unsigned long start,
+ unsigned long end,
+ optional DOMString selectionMode = "preserve");
+ // FIXME: The start and end arguments should be unsigned long and should not have [Default=Undefined].
[RaisesException, ImplementedAs=setSelectionRangeForBinding]
void setSelectionRange([Default=Undefined] optional long start,
[Default=Undefined] optional long end,
optional DOMString direction);
- // Non-standard attributes
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLInputElement-partial
+ [Reflect] attribute DOMString align;
+ [Reflect] attribute DOMString useMap;
+
+ // HTML autocapitalize proposal
+ // https://github.com/mounirlamouri/html-autocapitalize/blob/master/proposal.md
+ [Measure] attribute DOMString autocapitalize;
+
+ // HTML Media Capture
+ // http://www.w3.org/TR/html-media-capture/
+ [RuntimeEnabled=MediaCapture, Reflect] attribute boolean capture;
+
+ // Non-standard APIs
[Reflect, MeasureAs=PrefixedDirectoryAttribute] attribute boolean webkitdirectory;
[Reflect, MeasureAs=IncrementalAttribute] attribute boolean incremental;
-
- // See http://www.w3.org/TR/html-media-capture/
- [RuntimeEnabled=MediaCapture, Reflect] attribute boolean capture;
};
diff --git a/core/html/HTMLKeygenElement.idl b/core/html/HTMLKeygenElement.idl
index 3310c18..011687d 100644
--- a/core/html/HTMLKeygenElement.idl
+++ b/core/html/HTMLKeygenElement.idl
@@ -28,11 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-keygen-element
+
interface HTMLKeygenElement : HTMLElement {
[Reflect] attribute boolean autofocus;
[Reflect] attribute DOMString challenge;
[Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
[Reflect, ReflectOnly="rsa", ReflectMissing="rsa"] attribute DOMString keytype;
[Reflect] attribute DOMString name;
@@ -42,7 +44,8 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLLIElement.idl b/core/html/HTMLLIElement.idl
index 43b242f..b80c489 100644
--- a/core/html/HTMLLIElement.idl
+++ b/core/html/HTMLLIElement.idl
@@ -17,7 +17,12 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-li-element
+
interface HTMLLIElement : HTMLElement {
- [Reflect] attribute DOMString type;
[Reflect] attribute long value;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLLIElement-partial
+ [Reflect] attribute DOMString type;
};
diff --git a/core/html/HTMLLabelElement.idl b/core/html/HTMLLabelElement.idl
index 0f73764..3d17ad9 100644
--- a/core/html/HTMLLabelElement.idl
+++ b/core/html/HTMLLabelElement.idl
@@ -18,8 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-label-element
+
interface HTMLLabelElement : HTMLElement {
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
[Reflect=for] attribute DOMString htmlFor;
- readonly attribute HTMLElement control;
+ readonly attribute HTMLElement? control;
};
diff --git a/core/html/HTMLLegendElement.idl b/core/html/HTMLLegendElement.idl
index d510706..452bcfe 100644
--- a/core/html/HTMLLegendElement.idl
+++ b/core/html/HTMLLegendElement.idl
@@ -18,7 +18,12 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-legend-element
+
interface HTMLLegendElement : HTMLElement {
- readonly attribute HTMLFormElement form;
+ readonly attribute HTMLFormElement? form;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLLegendElement-partial
[Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLLinkElement.idl b/core/html/HTMLLinkElement.idl
index a31a5ef..91c040e 100644
--- a/core/html/HTMLLinkElement.idl
+++ b/core/html/HTMLLinkElement.idl
@@ -19,23 +19,36 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-link-element
+
interface HTMLLinkElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- [Reflect] attribute DOMString charset;
+ // FIXME: The disabled attribute has been removed from the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
+ [Reflect, Measure] attribute boolean disabled;
[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;
[Reflect] attribute DOMString rel;
- [Reflect] attribute DOMString rev;
- [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
- [Reflect] attribute DOMString target;
+ // FIXME: readonly attribute DOMTokenList relList;
+ [Reflect] attribute DOMString media;
+ [Reflect] attribute DOMString hreflang;
[Reflect] attribute DOMString type;
+ [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
- // DOM Level 2 Style
- readonly attribute StyleSheet sheet;
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLLinkElement-partial
+ [Reflect] attribute DOMString charset;
+ [Reflect] attribute DOMString rev;
+ [Reflect] attribute DOMString target;
- readonly attribute Document import;
+ // HTMLLinkElement implements LinkStyle
+ // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
+ readonly attribute StyleSheet? sheet;
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
+ // HTML Imports
+ // https://w3c.github.io/webcomponents/spec/imports/#interface-import
+ readonly attribute Document? import;
+
+ // Subresource Integrity
+ // http://w3c.github.io/webappsec/specs/subresourceintegrity/#htmllinkelement-1
+ [Reflect] attribute DOMString integrity;
};
diff --git a/core/html/HTMLMapElement.idl b/core/html/HTMLMapElement.idl
index 6616bed..21b7b20 100644
--- a/core/html/HTMLMapElement.idl
+++ b/core/html/HTMLMapElement.idl
@@ -18,7 +18,9 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-map-element
+
interface HTMLMapElement : HTMLElement {
- readonly attribute HTMLCollection areas;
[Reflect] attribute DOMString name;
+ readonly attribute HTMLCollection areas;
};
diff --git a/core/html/HTMLMarqueeElement.idl b/core/html/HTMLMarqueeElement.idl
index 19841be..4103315 100644
--- a/core/html/HTMLMarqueeElement.idl
+++ b/core/html/HTMLMarqueeElement.idl
@@ -17,16 +17,16 @@
* Boston, MA 02110-1301, USA.
*/
-interface HTMLMarqueeElement : HTMLElement {
- void start();
- void stop();
+// https://html.spec.whatwg.org/#htmlmarqueeelement
+interface HTMLMarqueeElement : HTMLElement {
[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;
+ // FIXME: scrollAmount and scrollDelay should be unsigned long.
[ImplementedInPrivateScript] attribute long scrollAmount;
[ImplementedInPrivateScript] attribute long scrollDelay;
[ImplementedInPrivateScript, Reflect] attribute boolean trueSpeed;
@@ -38,4 +38,13 @@
// attribute EventHandler onbounce;
// attribute EventHandler onfinish;
// attribute EventHandler onstart;
+
+ [ImplementedInPrivateScript] void start();
+ [ImplementedInPrivateScript] void stop();
+
+ // Private script APIs
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] void createdCallback();
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] void attachedCallback();
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] void detachedCallback();
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] void attributeChangedCallback(DOMString name, DOMString oldValue, DOMString newValue);
};
diff --git a/core/html/HTMLMediaElement.idl b/core/html/HTMLMediaElement.idl
index 7990f6b..0ced5dc 100644
--- a/core/html/HTMLMediaElement.idl
+++ b/core/html/HTMLMediaElement.idl
@@ -23,11 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#media-elements
+
+enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
[
ActiveDOMObject,
RuntimeEnabled=Media,
- SpecialWrapFor=(HTMLAudioElement,HTMLVideoElement),
- TypeChecking=Unrestricted,
] interface HTMLMediaElement : HTMLElement {
// error state
@@ -35,19 +36,18 @@
// network state
[Reflect, URL] attribute DOMString src;
- [URL] readonly attribute DOMString currentSrc;
+ // FIXME: attribute MediaProvider? srcObject; crbug.com/387740
+ readonly attribute DOMString currentSrc;
[Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
-
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
const unsigned short NETWORK_NO_SOURCE = 3;
readonly attribute unsigned short networkState;
attribute DOMString preload;
-
readonly attribute TimeRanges buffered;
void load();
- DOMString canPlayType(DOMString type, [Default=Undefined, TreatUndefinedAs=NullString] optional DOMString? keySystem);
+ CanPlayTypeResult canPlayType(DOMString type);
// ready state
const unsigned short HAVE_NOTHING = 0;
@@ -60,7 +60,9 @@
// playback state
[RaisesException=Setter] attribute double currentTime;
+ // FIXME: void fastSeek(double time);
readonly attribute unrestricted double duration;
+ // FIXME: Date getStartDate(); crbug.com/312699
readonly attribute boolean paused;
attribute double defaultPlaybackRate;
attribute double playbackRate;
@@ -83,16 +85,14 @@
[Reflect=muted] attribute boolean defaultMuted;
// tracks
- [RuntimeEnabled=AudioVideoTracks] readonly attribute AudioTrackList audioTracks;
- [RuntimeEnabled=AudioVideoTracks] readonly attribute VideoTrackList videoTracks;
- readonly attribute TextTrackList textTracks;
- [RaisesException] TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
+ [SameObject, RuntimeEnabled=AudioVideoTracks] readonly attribute AudioTrackList audioTracks;
+ [SameObject, RuntimeEnabled=AudioVideoTracks] readonly attribute VideoTrackList videoTracks;
+ [SameObject] readonly attribute TextTrackList textTracks;
+ [RaisesException] TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
- // WebKit extensions
-
+ // Non-standard APIs
+ [RuntimeEnabled=PrefixedEncryptedMedia, DeprecateAs=CanPlayTypeKeySystem] DOMString canPlayType(DOMString type, [TreatUndefinedAs=NullString] DOMString? keySystem);
// The number of bytes consumed by the media decoder.
[MeasureAs=PrefixedAudioDecodedByteCount] readonly attribute unsigned long webkitAudioDecodedByteCount;
[MeasureAs=PrefixedVideoDecodedByteCount] readonly attribute unsigned long webkitVideoDecodedByteCount;
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
};
diff --git a/core/html/HTMLMenuElement.idl b/core/html/HTMLMenuElement.idl
index 42110b5..9d54c09 100644
--- a/core/html/HTMLMenuElement.idl
+++ b/core/html/HTMLMenuElement.idl
@@ -17,9 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-menu-element
+
interface HTMLMenuElement : HTMLElement {
[RuntimeEnabled=ContextMenu, Reflect] attribute DOMString type;
[RuntimeEnabled=ContextMenu, Reflect] attribute DOMString label;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLMenuElement-partial
[Reflect] attribute boolean compact;
};
-
diff --git a/core/html/HTMLMenuItemElement.idl b/core/html/HTMLMenuItemElement.idl
index cf770ad..99cd880 100644
--- a/core/html/HTMLMenuItemElement.idl
+++ b/core/html/HTMLMenuItemElement.idl
@@ -2,13 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#the-menuitem-element
+
[
RuntimeEnabled=ContextMenu,
] interface HTMLMenuItemElement : HTMLElement {
[Reflect] attribute DOMString type;
[Reflect] attribute DOMString label;
+ [Reflect] attribute DOMString icon;
[Reflect] attribute boolean disabled;
[Reflect] attribute boolean checked;
+ [Reflect] attribute DOMString radiogroup;
[Reflect] attribute boolean default;
- // FIXME: icon, radiogroup and command need to be implemented.
+ // FIXME: readonly attribute HTMLElement? command;
};
diff --git a/core/html/HTMLMetaElement.idl b/core/html/HTMLMetaElement.idl
index 41d369e..c575e03 100644
--- a/core/html/HTMLMetaElement.idl
+++ b/core/html/HTMLMetaElement.idl
@@ -17,9 +17,14 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-meta-element
+
interface HTMLMetaElement : HTMLElement {
- [Reflect] attribute DOMString content;
- [Reflect=http_equiv] attribute DOMString httpEquiv;
[Reflect] attribute DOMString name;
+ [Reflect=http_equiv] attribute DOMString httpEquiv;
+ [Reflect] attribute DOMString content;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLMetaElement-partial
[Reflect] attribute DOMString scheme;
};
diff --git a/core/html/HTMLMeterElement.idl b/core/html/HTMLMeterElement.idl
index 144f83e..bb457ee 100644
--- a/core/html/HTMLMeterElement.idl
+++ b/core/html/HTMLMeterElement.idl
@@ -17,16 +17,14 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#htmlmeterelement
+// https://html.spec.whatwg.org/#the-meter-element
-[
- TypeChecking=Unrestricted,
-] interface HTMLMeterElement : HTMLElement {
- attribute double value;
- attribute double min;
- attribute double max;
- attribute double low;
- attribute double high;
- attribute double optimum;
+interface HTMLMeterElement : HTMLElement {
+ attribute double value;
+ attribute double min;
+ attribute double max;
+ attribute double low;
+ attribute double high;
+ attribute double optimum;
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLModElement.idl b/core/html/HTMLModElement.idl
index 9b749b2..cde233c 100644
--- a/core/html/HTMLModElement.idl
+++ b/core/html/HTMLModElement.idl
@@ -17,6 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-ins-element
+// https://html.spec.whatwg.org/#the-del-element
+
interface HTMLModElement : HTMLElement {
[Reflect, URL] attribute DOMString cite;
[Reflect] attribute DOMString dateTime;
diff --git a/core/html/HTMLOListElement.idl b/core/html/HTMLOListElement.idl
index 01cbabd..52294de 100644
--- a/core/html/HTMLOListElement.idl
+++ b/core/html/HTMLOListElement.idl
@@ -17,9 +17,14 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-ol-element
+
interface HTMLOListElement : HTMLElement {
- [Reflect] attribute boolean compact;
- attribute long start;
[Reflect] attribute boolean reversed;
+ attribute long start;
[Reflect] attribute DOMString type;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLOListElement-partial
+ [Reflect] attribute boolean compact;
};
diff --git a/core/html/HTMLObjectElement.idl b/core/html/HTMLObjectElement.idl
index 4eb6f39..a936771 100644
--- a/core/html/HTMLObjectElement.idl
+++ b/core/html/HTMLObjectElement.idl
@@ -18,40 +18,52 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-object-element
+
+// TODO(yukishiino): HTMLObjectElement should not have [OverrideBuiltins].
[
Custom=LegacyCallAsFunction,
+ OverrideBuiltins,
] interface HTMLObjectElement : HTMLElement {
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
- [Reflect] attribute DOMString code;
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString archive;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
- [Reflect, URL] attribute DOMString codeBase;
- [Reflect] attribute DOMString codeType;
[Reflect, URL] attribute DOMString data;
- [Reflect] attribute boolean declare;
- [Reflect] attribute DOMString height;
- [Reflect] attribute long hspace;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString standby;
[Reflect] attribute DOMString type;
+ // TODO(philipj): attribute boolean typeMustMatch;
+ [Reflect] attribute DOMString name;
[Reflect] attribute DOMString useMap;
- [Reflect] attribute long vspace;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
[Reflect] attribute DOMString width;
+ [Reflect] attribute DOMString height;
+ [CheckSecurity=Node] readonly attribute Document? contentDocument;
+ // TODO(philipj): readonly attribute WindowProxy? contentWindow;
+ [CheckSecurity=Node, RaisesException] Document? getSVGDocument();
+
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
- // Introduced in DOM Level 2:
- [CheckSecurity=Node] readonly attribute Document contentDocument;
+ // TODO(philipj): legacycaller any (any... arguments); crbug.com/465009
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLObjectElement-partial
+ [Reflect] attribute DOMString align;
+ [Reflect] attribute DOMString archive;
+ [Reflect] attribute DOMString code;
+ [Reflect] attribute boolean declare;
+ // TODO(philipj): hspace and vspace should be unsigned long.
+ [Reflect] attribute long hspace;
+ [Reflect] attribute DOMString standby;
+ [Reflect] attribute long vspace;
+ [Reflect, URL] attribute DOMString codeBase;
+ [Reflect] attribute DOMString codeType;
+
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
+
+ // TODO(philipj): These getters and setters are not in the spec.
[Custom, NotEnumerable] getter boolean (unsigned long index);
[Custom] setter boolean (unsigned long index, Node value);
[Custom, NotEnumerable] getter Node (DOMString name);
[Custom] setter Node (DOMString name, Node value);
-
- [CheckSecurity=Node, RaisesException] Document getSVGDocument();
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
};
diff --git a/core/html/HTMLOptGroupElement.idl b/core/html/HTMLOptGroupElement.idl
index c06ee82..8820449 100644
--- a/core/html/HTMLOptGroupElement.idl
+++ b/core/html/HTMLOptGroupElement.idl
@@ -17,6 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-optgroup-element
+
interface HTMLOptGroupElement : HTMLElement {
[Reflect] attribute boolean disabled;
[Reflect] attribute DOMString label;
diff --git a/core/html/HTMLOptionElement.idl b/core/html/HTMLOptionElement.idl
index d57d72a..bcbeed3 100644
--- a/core/html/HTMLOptionElement.idl
+++ b/core/html/HTMLOptionElement.idl
@@ -18,21 +18,24 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-option-element
+
[
NamedConstructor=Option(optional DOMString data = null,
optional DOMString value = null,
- [Default=Undefined] optional boolean defaultSelected,
- [Default=Undefined] optional boolean selected),
+ optional boolean defaultSelected = false,
+ optional boolean selected = false),
ConstructorCallWith=Document,
RaisesException=Constructor
] interface HTMLOptionElement : HTMLElement {
[Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement form;
+ readonly attribute HTMLFormElement? form;
attribute DOMString label;
[Reflect=selected] attribute boolean defaultSelected;
attribute boolean selected;
attribute DOMString value;
+ // TODO(philipj): The text setter should never throw.
[RaisesException=Setter] attribute DOMString text;
readonly attribute long index;
};
diff --git a/core/html/HTMLOptionsCollection.idl b/core/html/HTMLOptionsCollection.idl
index 01f3e25..7a9fabf 100644
--- a/core/html/HTMLOptionsCollection.idl
+++ b/core/html/HTMLOptionsCollection.idl
@@ -19,18 +19,21 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-htmloptionscollection-interface
+
[
DependentLifetime,
SetWrapperReferenceFrom=ownerNode,
] interface HTMLOptionsCollection : HTMLCollection {
+ // inherits item()
+ [Custom=Setter, RaisesException=Setter] attribute unsigned long length; // shadows inherited length
+ // FIXME: The spec has a legacycaller HTMLOptionElement? (DOMString name);
+ [RaisesException, TypeChecking=Interface] setter void (unsigned long index, HTMLOptionElement? option);
+ [RaisesException, TypeChecking=Interface] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+ void remove(long index);
attribute long selectedIndex;
- [Custom=Setter, RaisesException=Setter] attribute unsigned long length;
+ // FIXME: Neither of these getters are in the spec, and the
+ // getters inherited from HTMLCollection always return an Element.
[ImplementedAs=item] getter Node (unsigned long index);
- [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);
+ [ImplementedAs=namedGetter] getter (NodeList or Element)? namedItem(DOMString name);
};
diff --git a/core/html/HTMLOutputElement.idl b/core/html/HTMLOutputElement.idl
index c9fe3b2..957a9aa 100644
--- a/core/html/HTMLOutputElement.idl
+++ b/core/html/HTMLOutputElement.idl
@@ -22,9 +22,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-output-element
+
interface HTMLOutputElement : HTMLElement {
[PutForwards=value] readonly attribute DOMSettableTokenList htmlFor;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
[Reflect] attribute DOMString name;
readonly attribute DOMString type;
@@ -35,7 +37,8 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLParagraphElement.idl b/core/html/HTMLParagraphElement.idl
index 83242a1..840231e 100644
--- a/core/html/HTMLParagraphElement.idl
+++ b/core/html/HTMLParagraphElement.idl
@@ -17,6 +17,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-p-element
+
interface HTMLParagraphElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLParagraphElement-partial
[Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLParamElement.idl b/core/html/HTMLParamElement.idl
index d832e2c..cd4cb67 100644
--- a/core/html/HTMLParamElement.idl
+++ b/core/html/HTMLParamElement.idl
@@ -17,9 +17,14 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-param-element
+
interface HTMLParamElement : HTMLElement {
[Reflect] attribute DOMString name;
- [Reflect] attribute DOMString type;
[Reflect] attribute DOMString value;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLParamElement-partial
+ [Reflect] attribute DOMString type;
[Reflect] attribute DOMString valueType;
};
diff --git a/core/html/HTMLPictureElement.idl b/core/html/HTMLPictureElement.idl
index 649316c..33e13e9 100644
--- a/core/html/HTMLPictureElement.idl
+++ b/core/html/HTMLPictureElement.idl
@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://picture.responsiveimages.org
-[
- RuntimeEnabled=Picture
-] interface HTMLPictureElement : HTMLElement {
-};
+// https://html.spec.whatwg.org/#the-picture-element
+interface HTMLPictureElement : HTMLElement {
+};
diff --git a/core/html/HTMLPreElement.idl b/core/html/HTMLPreElement.idl
index 34742c6..2da036d 100644
--- a/core/html/HTMLPreElement.idl
+++ b/core/html/HTMLPreElement.idl
@@ -18,6 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-pre-element
+
interface HTMLPreElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLPreElement-partial
[Reflect] attribute long width;
};
diff --git a/core/html/HTMLProgressElement.idl b/core/html/HTMLProgressElement.idl
index a3da90a..ffe0d51 100644
--- a/core/html/HTMLProgressElement.idl
+++ b/core/html/HTMLProgressElement.idl
@@ -17,13 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#htmlprogresselement
+// https://html.spec.whatwg.org/#the-progress-element
-[
- TypeChecking=Unrestricted,
-] interface HTMLProgressElement : HTMLElement {
- attribute double value;
- attribute double max;
+interface HTMLProgressElement : HTMLElement {
+ attribute double value;
+ attribute double max;
readonly attribute double position;
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLQuoteElement.idl b/core/html/HTMLQuoteElement.idl
index c53a1a2..d559397 100644
--- a/core/html/HTMLQuoteElement.idl
+++ b/core/html/HTMLQuoteElement.idl
@@ -17,6 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-blockquote-element
+// https://html.spec.whatwg.org/#the-q-element
+
interface HTMLQuoteElement : HTMLElement {
[Reflect, URL] attribute DOMString cite;
};
diff --git a/core/html/HTMLScriptElement.idl b/core/html/HTMLScriptElement.idl
index c96ec40..064e63a 100644
--- a/core/html/HTMLScriptElement.idl
+++ b/core/html/HTMLScriptElement.idl
@@ -17,17 +17,29 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-script-element
+
interface HTMLScriptElement : HTMLElement {
- attribute DOMString text;
- [Reflect=for] attribute DOMString htmlFor;
- [Reflect] attribute DOMString event;
+ [Reflect, URL] attribute DOMString src;
+ [Reflect] attribute DOMString type;
[Reflect] attribute DOMString charset;
attribute boolean async;
[Reflect] attribute boolean defer;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString type;
[Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
+ attribute DOMString text;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLScriptElement-partial
+ // TODO(philipj): The event and htmlFor attributes should return the empty
+ // string on getting, and do nothing on setting.
+ [Reflect] attribute DOMString event;
+ [Reflect=for] attribute DOMString htmlFor;
+
+ // Content Security Policy
+ // https://w3c.github.io/webappsec/specs/content-security-policy/#script-src-the-nonce-attribute
[Reflect, RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute DOMString nonce;
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
+ // Subresource Integrity
+ // https://w3c.github.io/webappsec/specs/subresourceintegrity/#htmlscriptelement-1
+ [Reflect] attribute DOMString integrity;
};
diff --git a/core/html/HTMLSelectElement.idl b/core/html/HTMLSelectElement.idl
index b4ddd80..718cec1 100644
--- a/core/html/HTMLSelectElement.idl
+++ b/core/html/HTMLSelectElement.idl
@@ -19,40 +19,42 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#htmlselectelement
+// https://html.spec.whatwg.org/#the-select-element
interface HTMLSelectElement : HTMLElement {
+ // TODO(philipj): attribute DOMString autocomplete;
[Reflect] attribute boolean autofocus;
[Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
attribute boolean multiple;
[Reflect] attribute DOMString name;
[Reflect] attribute boolean required;
- attribute long size;
+ attribute unsigned long size;
readonly attribute DOMString type;
readonly attribute HTMLOptionsCollection options;
+ // TODO(philipj): The length setter should never throw.
[RaisesException=Setter] attribute unsigned long length;
-
- getter Element item(unsigned long index);
- Element namedItem([Default=Undefined] optional DOMString name);
- // FIXME: should be union type http://crbug.com/240176
- [RaisesException, TypeChecking=Interface, DartSuppress] void add(HTMLElement element, optional HTMLElement? before = null);
- [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] setter HTMLOptionElement (unsigned long index, HTMLOptionElement? value);
+ getter Element? item(unsigned long index);
+ // TODO(philipj): The name argument should not be optional.
+ HTMLOptionElement? namedItem([Default=Undefined] optional DOMString name);
+ [RaisesException, TypeChecking=Interface] void add((HTMLOptionElement or HTMLOptGroupElement) element,
+ optional (HTMLElement or long)? before = null);
+ [RaisesException] void remove(); // ChildNode overload
+ void remove(long index);
+ [RaisesException, TypeChecking=Interface] setter void (unsigned long index, HTMLOptionElement? option);
readonly attribute HTMLCollection selectedOptions;
- attribute long selectedIndex;
- attribute DOMString value;
+ attribute long selectedIndex;
+ attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLShadowElement.idl b/core/html/HTMLShadowElement.idl
index 86532b1..035492c 100644
--- a/core/html/HTMLShadowElement.idl
+++ b/core/html/HTMLShadowElement.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/webcomponents/spec/shadow/#the-shadow-element
+
interface HTMLShadowElement : HTMLElement {
NodeList getDistributedNodes();
};
diff --git a/core/html/HTMLSourceElement.idl b/core/html/HTMLSourceElement.idl
index 75cebb1..50efebd 100644
--- a/core/html/HTMLSourceElement.idl
+++ b/core/html/HTMLSourceElement.idl
@@ -23,15 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-source-element
+
[
RuntimeEnabled=Media
] interface HTMLSourceElement : HTMLElement {
[Reflect, URL] attribute DOMString src;
attribute DOMString type;
- [Reflect, RuntimeEnabled=Picture] attribute DOMString srcset;
- [Reflect, RuntimeEnabled=Picture] attribute DOMString sizes;
- [Reflect, RuntimeEnabled=Picture] attribute DOMString media;
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
+ // https://html.spec.whatwg.org/#the-source-element-when-used-with-the-picture-element
+ [Reflect] attribute DOMString srcset;
+ [Reflect] attribute DOMString sizes;
+ [Reflect] attribute DOMString media;
};
diff --git a/core/html/HTMLSpanElement.idl b/core/html/HTMLSpanElement.idl
index e4f5013..d565f49 100644
--- a/core/html/HTMLSpanElement.idl
+++ b/core/html/HTMLSpanElement.idl
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#htmlspanelement
-[
-] interface HTMLSpanElement : HTMLElement {
-};
+// https://html.spec.whatwg.org/#the-span-element
+interface HTMLSpanElement : HTMLElement {
+};
diff --git a/core/html/HTMLStyleElement.idl b/core/html/HTMLStyleElement.idl
index ecc6b2b..8c035ff 100644
--- a/core/html/HTMLStyleElement.idl
+++ b/core/html/HTMLStyleElement.idl
@@ -18,11 +18,16 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-style-element
+
interface HTMLStyleElement : HTMLElement {
- attribute boolean disabled;
+ // TODO(philipj): The disabled attribute has been removed from the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
+ [Measure] attribute boolean disabled;
[Reflect] attribute DOMString media;
[Reflect] attribute DOMString type;
- // DOM Level 2 Style
- readonly attribute StyleSheet sheet;
+ // HTMLStyleElement implements LinkStyle
+ // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
+ readonly attribute StyleSheet? sheet;
};
diff --git a/core/html/HTMLTableCaptionElement.idl b/core/html/HTMLTableCaptionElement.idl
index cd20259..9f9b728 100644
--- a/core/html/HTMLTableCaptionElement.idl
+++ b/core/html/HTMLTableCaptionElement.idl
@@ -18,6 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-caption-element
+
interface HTMLTableCaptionElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLTableCaptionElement-partial
[Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLTableCellElement.idl b/core/html/HTMLTableCellElement.idl
index b201938..7a9a8d8 100644
--- a/core/html/HTMLTableCellElement.idl
+++ b/core/html/HTMLTableCellElement.idl
@@ -18,20 +18,34 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#attributes-common-to-td-and-th-elements
+
interface HTMLTableCellElement : HTMLElement {
+ attribute unsigned long colSpan;
+ attribute unsigned long rowSpan;
+ // TODO(philipj): headers should be a [PutForwards=value] readonly attribute
+ // DOMSettableTokenList.
+ [Reflect, TreatNullAs=NullString] attribute DOMString headers;
readonly attribute long cellIndex;
- [Reflect] attribute DOMString abbr;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLTableCellElement-partial
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString axis;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [Reflect] attribute DOMString height;
+ [Reflect] attribute DOMString width;
+
[Reflect=char] attribute DOMString ch;
[Reflect=charoff] attribute DOMString chOff;
- attribute long colSpan;
- [Reflect, TreatNullAs=NullString] attribute DOMString headers;
- [Reflect] attribute DOMString height;
[Reflect] attribute boolean noWrap;
- attribute long rowSpan;
- [Reflect] attribute DOMString scope;
[Reflect] attribute DOMString vAlign;
- [Reflect] attribute DOMString width;
+
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+
+ // TODO(philipj): The spec has HTMLTableHeaderCellElement and
+ // HTMLTableDataCellElement interfaces for the th and td elements
+ // respectively. HTMLTableHeaderCellElement has the abbr and scope
+ // attributes, while HTMLTableDataCellElement has only abbr.
+ [Reflect] attribute DOMString abbr;
+ [Reflect] attribute DOMString scope;
};
diff --git a/core/html/HTMLTableColElement.idl b/core/html/HTMLTableColElement.idl
index 577b7e5..8ad6945 100644
--- a/core/html/HTMLTableColElement.idl
+++ b/core/html/HTMLTableColElement.idl
@@ -18,11 +18,17 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-colgroup-element
+// https://html.spec.whatwg.org/#the-col-element
+
interface HTMLTableColElement : HTMLElement {
+ attribute unsigned long span;
+
+ // obsolete attributes
+ // https://html.spec.whatwg.org/#HTMLTableColElement-partial
[Reflect] attribute DOMString align;
[Reflect=char] attribute DOMString ch;
[Reflect=charoff] attribute DOMString chOff;
- attribute long span;
[Reflect] attribute DOMString vAlign;
[Reflect] attribute DOMString width;
};
diff --git a/core/html/HTMLTableElement.idl b/core/html/HTMLTableElement.idl
index 69d364f..acf2684 100644
--- a/core/html/HTMLTableElement.idl
+++ b/core/html/HTMLTableElement.idl
@@ -18,33 +18,37 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-table-element
+
interface HTMLTableElement : HTMLElement {
- [RaisesException=Setter] attribute HTMLTableCaptionElement caption;
- [RaisesException=Setter] attribute HTMLTableSectionElement tHead;
- [RaisesException=Setter] attribute HTMLTableSectionElement tFoot;
-
- readonly attribute HTMLCollection rows;
+ // TODO(philipj): The caption, tHead and tFoot setters should never throw.
+ [RaisesException=Setter] attribute HTMLTableCaptionElement? caption;
+ HTMLElement createCaption();
+ void deleteCaption();
+ [RaisesException=Setter] attribute HTMLTableSectionElement? tHead;
+ HTMLElement createTHead();
+ void deleteTHead();
+ [RaisesException=Setter] attribute HTMLTableSectionElement? tFoot;
+ HTMLElement createTFoot();
+ void deleteTFoot();
readonly attribute HTMLCollection tBodies;
+ HTMLElement createTBody();
+ readonly attribute HTMLCollection rows;
+ [RaisesException] HTMLElement insertRow(optional long index = -1);
+ [RaisesException] void deleteRow(long index);
+ // attribute boolean sortable;
+ // void stopSorting();
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLTableElement-partial
[Reflect] attribute DOMString align;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
[Reflect] attribute DOMString border;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString cellPadding;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString cellSpacing;
-
[Reflect] attribute DOMString frame;
-
[Reflect] attribute DOMString rules;
[Reflect] attribute DOMString summary;
[Reflect] attribute DOMString width;
- HTMLElement createTHead();
- void deleteTHead();
- HTMLElement createTFoot();
- void deleteTFoot();
- HTMLElement createTBody();
- HTMLElement createCaption();
- void deleteCaption();
-
- [RaisesException] HTMLElement insertRow(optional long index = -1);
- [RaisesException] void deleteRow([Default=Undefined] optional long index);
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString cellPadding;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString cellSpacing;
};
diff --git a/core/html/HTMLTableRowElement.idl b/core/html/HTMLTableRowElement.idl
index 1f06529..bba0de5 100644
--- a/core/html/HTMLTableRowElement.idl
+++ b/core/html/HTMLTableRowElement.idl
@@ -18,15 +18,21 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-tr-element
+
interface HTMLTableRowElement : HTMLElement {
readonly attribute long rowIndex;
readonly attribute long sectionRowIndex;
readonly attribute HTMLCollection cells;
+ [RaisesException] HTMLElement insertCell(optional long index = -1);
+ [RaisesException] void deleteCell(long index);
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLTableRowElement-partial
[Reflect] attribute DOMString align;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
[Reflect=char] attribute DOMString ch;
[Reflect=charoff] attribute DOMString chOff;
[Reflect] attribute DOMString vAlign;
- [RaisesException] HTMLElement insertCell(optional long index = -1);
- [RaisesException] void deleteCell([Default=Undefined] optional long index);
+
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
};
diff --git a/core/html/HTMLTableSectionElement.idl b/core/html/HTMLTableSectionElement.idl
index 8816676..f0f19cf 100644
--- a/core/html/HTMLTableSectionElement.idl
+++ b/core/html/HTMLTableSectionElement.idl
@@ -18,12 +18,19 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-tbody-element
+// https://html.spec.whatwg.org/#the-thead-element
+// https://html.spec.whatwg.org/#the-tfoot-element
+
interface HTMLTableSectionElement : HTMLElement {
+ readonly attribute HTMLCollection rows;
+ [RaisesException] HTMLElement insertRow(optional long index = -1);
+ [RaisesException] void deleteRow(long index);
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLTableSectionElement-partial
[Reflect] attribute DOMString align;
[Reflect=char] attribute DOMString ch;
[Reflect=charoff] attribute DOMString chOff;
[Reflect] attribute DOMString vAlign;
- readonly attribute HTMLCollection rows;
- [RaisesException] HTMLElement insertRow(optional long index = -1);
- [RaisesException] void deleteRow([Default=Undefined] optional long index);
};
diff --git a/core/html/HTMLTemplateElement.idl b/core/html/HTMLTemplateElement.idl
index e950fce..d1c42c3 100644
--- a/core/html/HTMLTemplateElement.idl
+++ b/core/html/HTMLTemplateElement.idl
@@ -28,7 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-template-element
+
interface HTMLTemplateElement : HTMLElement {
readonly attribute DocumentFragment content;
};
-
diff --git a/core/html/HTMLTextAreaElement.idl b/core/html/HTMLTextAreaElement.idl
index be1804d..a937807 100644
--- a/core/html/HTMLTextAreaElement.idl
+++ b/core/html/HTMLTextAreaElement.idl
@@ -19,20 +19,24 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-textarea-element
+
interface HTMLTextAreaElement : HTMLElement {
+ // attribute DOMString autocomplete;
[Reflect] attribute boolean autofocus;
- attribute long cols;
+ attribute unsigned long cols;
[Reflect] attribute DOMString dirName;
[Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
+ [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
[RaisesException=Setter] attribute long maxLength;
+ [RaisesException=Setter] attribute long minLength;
[Reflect] attribute DOMString name;
[Reflect] attribute DOMString placeholder;
[Reflect] attribute boolean readOnly;
[Reflect] attribute boolean required;
- attribute long rows;
+ attribute unsigned long rows;
[Reflect] attribute DOMString wrap;
- [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
readonly attribute DOMString type;
attribute DOMString defaultValue;
@@ -43,22 +47,29 @@
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
- void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
readonly attribute NodeList labels;
void select();
+ // TODO(philipj): selectionStart and selectionEnd should be unsigned long.
attribute long selectionStart;
attribute long selectionEnd;
attribute DOMString selectionDirection;
-
[RaisesException] void setRangeText(DOMString replacement);
+ // TODO(philipj): The selectionMode argument should be a SelectionMode enum.
[RaisesException] void setRangeText(DOMString replacement,
- unsigned long start,
- unsigned long end,
- optional DOMString selectionMode = null);
-
+ unsigned long start,
+ unsigned long end,
+ optional DOMString selectionMode = null);
+ // TODO(philipj): The start and end arguments should be unsigned long and
+ // should not be optional.
void setSelectionRange([Default=Undefined] optional long start,
[Default=Undefined] optional long end,
optional DOMString direction);
+
+ // HTML autocapitalize proposal
+ // https://github.com/mounirlamouri/html-autocapitalize/blob/master/proposal.md
+ [Measure] attribute DOMString autocapitalize;
};
diff --git a/core/html/HTMLTitleElement.idl b/core/html/HTMLTitleElement.idl
index 291318f..f775f8c 100644
--- a/core/html/HTMLTitleElement.idl
+++ b/core/html/HTMLTitleElement.idl
@@ -17,6 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-title-element
+
interface HTMLTitleElement : HTMLElement {
attribute DOMString text;
};
diff --git a/core/html/HTMLTrackElement.idl b/core/html/HTMLTrackElement.idl
index 16f4cc6..8a9b38e 100644
--- a/core/html/HTMLTrackElement.idl
+++ b/core/html/HTMLTrackElement.idl
@@ -23,6 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-track-element
+
interface HTMLTrackElement : HTMLElement {
attribute DOMString kind;
[Reflect, URL] attribute DOMString src;
@@ -38,6 +40,4 @@
readonly attribute unsigned short readyState;
readonly attribute TextTrack track;
-
- [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
};
diff --git a/core/html/HTMLUListElement.idl b/core/html/HTMLUListElement.idl
index d7d123a..43c6f43 100644
--- a/core/html/HTMLUListElement.idl
+++ b/core/html/HTMLUListElement.idl
@@ -17,7 +17,11 @@
* Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/#the-ul-element
+
interface HTMLUListElement : HTMLElement {
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLUListElement-partial
[Reflect] attribute boolean compact;
[Reflect] attribute DOMString type;
};
diff --git a/core/html/HTMLUnknownElement.idl b/core/html/HTMLUnknownElement.idl
index 0149113..21b616d 100644
--- a/core/html/HTMLUnknownElement.idl
+++ b/core/html/HTMLUnknownElement.idl
@@ -26,7 +26,8 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
-] interface HTMLUnknownElement : HTMLElement {
-};
+// https://html.spec.whatwg.org/#elements-in-the-dom
+
+interface HTMLUnknownElement : HTMLElement {
+};
diff --git a/core/html/HTMLVideoElement.idl b/core/html/HTMLVideoElement.idl
index 04f6d1b..5989128 100644
--- a/core/html/HTMLVideoElement.idl
+++ b/core/html/HTMLVideoElement.idl
@@ -23,6 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#the-video-element
+
[
RuntimeEnabled=Media
] interface HTMLVideoElement : HTMLMediaElement {
@@ -32,6 +34,7 @@
readonly attribute unsigned long videoHeight;
[Reflect, URL] attribute DOMString poster;
+ // Non-standard APIs
[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 107ce0b..f6274b4 100644
--- a/core/html/ImageData.idl
+++ b/core/html/ImageData.idl
@@ -26,18 +26,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#imagedata
+// https://html.spec.whatwg.org/#dom-imagedata
[
- Constructor(unsigned long width, unsigned long height),
- Constructor(Uint8ClampedArray data, unsigned long width, [Default=Undefined] optional unsigned long height),
- Custom=Wrap,
+ TypeChecking=Interface,
+ Constructor(unsigned long sw, unsigned long sh),
+ Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
Exposed=(Window,Worker),
RaisesException=Constructor,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface ImageData {
+ // TODO(philipj): width/height should be unsigned long.
readonly attribute long width;
readonly attribute long height;
-
- [DartCustom=New] readonly attribute Uint8ClampedArray data;
+ // TODO(philipj): Expose data.
+ // readonly attribute Uint8ClampedArray data;
};
diff --git a/core/html/MediaController.idl b/core/html/MediaController.idl
index 0a61cb6..ca1dad4 100644
--- a/core/html/MediaController.idl
+++ b/core/html/MediaController.idl
@@ -23,30 +23,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#mediacontroller
+// https://html.spec.whatwg.org/#media-controllers
+
+enum MediaControllerPlaybackState { "waiting", "playing", "ended" };
[
Constructor,
ConstructorCallWith=ExecutionContext,
RuntimeEnabled=MediaController,
- TypeChecking=Unrestricted,
] interface MediaController : EventTarget {
+ // TODO(philipj): Expose readyState.
+ // readonly attribute unsigned short readyState; // uses HTMLMediaElement.readyState's values
+
readonly attribute TimeRanges buffered;
readonly attribute TimeRanges seekable;
-
readonly attribute unrestricted double duration;
attribute double currentTime;
readonly attribute boolean paused;
+ readonly attribute MediaControllerPlaybackState playbackState;
readonly attribute TimeRanges played;
- readonly attribute DOMString playbackState;
- void play();
void pause();
void unpause();
+ void play(); // calls play() on all media elements as well
attribute double defaultPlaybackRate;
attribute double playbackRate;
[RaisesException=Setter] attribute double volume;
attribute boolean muted;
+
+ // TODO(philipj): Expose the on* event handler attributes.
};
diff --git a/core/html/MediaError.idl b/core/html/MediaError.idl
index aaffbc2..0d8b100 100644
--- a/core/html/MediaError.idl
+++ b/core/html/MediaError.idl
@@ -23,6 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#error-codes
+
[
RuntimeEnabled=Media,
WillBeGarbageCollected,
@@ -31,6 +33,5 @@
const unsigned short MEDIA_ERR_NETWORK = 2;
const unsigned short MEDIA_ERR_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
- [RuntimeEnabled=EncryptedMediaAnyVersion, DeprecateAs=MediaErrorEncrypted] const unsigned short MEDIA_ERR_ENCRYPTED = 5;
readonly attribute unsigned short code;
};
diff --git a/core/html/MediaKeyError.idl b/core/html/MediaKeyError.idl
index da32f87..2a80de0 100644
--- a/core/html/MediaKeyError.idl
+++ b/core/html/MediaKeyError.idl
@@ -24,7 +24,7 @@
*/
[
- RuntimeEnabled=EncryptedMediaAnyVersion,
+ RuntimeEnabled=PrefixedEncryptedMedia,
WillBeGarbageCollected,
] interface MediaKeyError {
const unsigned short MEDIA_KEYERR_UNKNOWN = 1;
diff --git a/core/html/MediaKeyEvent.idl b/core/html/MediaKeyEvent.idl
index ec80808..1159db0 100644
--- a/core/html/MediaKeyEvent.idl
+++ b/core/html/MediaKeyEvent.idl
@@ -24,15 +24,15 @@
*/
[
- EventConstructor,
+ Constructor(DOMString type, optional MediaKeyEventInit eventInitDict),
RuntimeEnabled=PrefixedEncryptedMedia,
] interface MediaKeyEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString keySystem;
- [InitializedByEventConstructor] readonly attribute DOMString sessionId;
- [InitializedByEventConstructor] readonly attribute Uint8Array initData;
- [InitializedByEventConstructor] readonly attribute Uint8Array message;
- [InitializedByEventConstructor] readonly attribute DOMString defaultURL;
- [InitializedByEventConstructor] readonly attribute MediaKeyError? errorCode;
- [InitializedByEventConstructor] readonly attribute unsigned short systemCode;
+ readonly attribute DOMString keySystem;
+ readonly attribute DOMString sessionId;
+ readonly attribute Uint8Array initData;
+ readonly attribute Uint8Array message;
+ readonly attribute DOMString defaultURL;
+ readonly attribute MediaKeyError? errorCode;
+ readonly attribute unsigned short systemCode;
};
diff --git a/core/html/MediaKeyEventInit.idl b/core/html/MediaKeyEventInit.idl
new file mode 100644
index 0000000..b8eb75a
--- /dev/null
+++ b/core/html/MediaKeyEventInit.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.
+
+dictionary MediaKeyEventInit : EventInit {
+ DOMString keySystem;
+ DOMString sessionId;
+ Uint8Array initData;
+ Uint8Array message;
+ DOMString defaultURL;
+ MediaKeyError? errorCode;
+ unsigned short systemCode;
+};
diff --git a/core/html/RadioNodeList.idl b/core/html/RadioNodeList.idl
index 057ad06..d1be414 100644
--- a/core/html/RadioNodeList.idl
+++ b/core/html/RadioNodeList.idl
@@ -23,9 +23,11 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- NoInterfaceObject,
-] interface RadioNodeList : NodeList {
+// https://html.spec.whatwg.org/#radionodelist
+
+interface RadioNodeList : NodeList {
attribute DOMString value;
- [ImplementedAs=item] getter Node (unsigned long index);
+
+ // TODO(philipj): This should be inherited from NodeList.
+ [ImplementedAs=item] getter Node? (unsigned long index);
};
diff --git a/core/html/TextMetrics.idl b/core/html/TextMetrics.idl
index c7d929a..b9bdf06 100644
--- a/core/html/TextMetrics.idl
+++ b/core/html/TextMetrics.idl
@@ -22,11 +22,16 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+// https://html.spec.whatwg.org/#textmetrics
+
+// TODO(philipj): All float types in this interface should be double.
[
+ // TODO(philipj): Exposed=(Window,Worker)
WillBeGarbageCollected,
] interface TextMetrics {
// x-direction
- readonly attribute float width;
+ readonly attribute float width; // advance width
[RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute float actualBoundingBoxLeft;
[RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute float actualBoundingBoxRight;
diff --git a/core/html/TimeRanges.idl b/core/html/TimeRanges.idl
index 5c04549..edd9cfc 100644
--- a/core/html/TimeRanges.idl
+++ b/core/html/TimeRanges.idl
@@ -23,6 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#time-ranges
+
[
WillBeGarbageCollected,
RuntimeEnabled=Media
@@ -31,4 +33,3 @@
[RaisesException] double start(unsigned long index);
[RaisesException] double end(unsigned long index);
};
-
diff --git a/core/html/ValidityState.idl b/core/html/ValidityState.idl
index d4f7253..5883d83 100644
--- a/core/html/ValidityState.idl
+++ b/core/html/ValidityState.idl
@@ -20,17 +20,20 @@
*
*/
+// https://html.spec.whatwg.org/#validitystate
+
[
WillBeGarbageCollected
] interface ValidityState {
- readonly attribute boolean valueMissing;
- readonly attribute boolean typeMismatch;
- readonly attribute boolean patternMismatch;
- readonly attribute boolean tooLong;
- readonly attribute boolean rangeUnderflow;
- readonly attribute boolean rangeOverflow;
- readonly attribute boolean stepMismatch;
- readonly attribute boolean badInput;
- readonly attribute boolean customError;
- readonly attribute boolean valid;
+ readonly attribute boolean valueMissing;
+ readonly attribute boolean typeMismatch;
+ readonly attribute boolean patternMismatch;
+ readonly attribute boolean tooLong;
+ readonly attribute boolean tooShort;
+ readonly attribute boolean rangeUnderflow;
+ readonly attribute boolean rangeOverflow;
+ readonly attribute boolean stepMismatch;
+ readonly attribute boolean badInput;
+ readonly attribute boolean customError;
+ readonly attribute boolean valid;
};
diff --git a/core/html/VoidCallback.idl b/core/html/VoidCallback.idl
index 970113b..daf58ab 100644
--- a/core/html/VoidCallback.idl
+++ b/core/html/VoidCallback.idl
@@ -23,6 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(philipj): This callback interface was added for HTMLMediaElement's
+// addCuePoint() and removeCuePoint(), which briefly existed in 2007. It is no
+// longer used in HTML and should be moved to where it is used.
+
callback interface VoidCallback {
void handleEvent();
};
diff --git a/core/html/canvas/ArrayBufferView.idl b/core/html/canvas/ArrayBufferView.idl
deleted file mode 100644
index 478bf25..0000000
--- a/core/html/canvas/ArrayBufferView.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2009 Apple 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:
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
- */
-
-[
- Custom=Wrap,
- NoInterfaceObject,
-] interface ArrayBufferView {
- readonly attribute ArrayBuffer buffer;
- readonly attribute unsigned long byteOffset;
- readonly attribute unsigned long byteLength;
-};
diff --git a/core/html/canvas/CanvasContextCreationAttributes.idl b/core/html/canvas/CanvasContextCreationAttributes.idl
new file mode 100644
index 0000000..3d5a8f2
--- /dev/null
+++ b/core/html/canvas/CanvasContextCreationAttributes.idl
@@ -0,0 +1,36 @@
+// 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.
+
+// The spec for HTMLCanvasElement.getContext() defines the context
+// creation attributes as type "any". In order to eliminate custom
+// bindings for getContext(), we define a dictionary that contains the
+// union of all of the context types' attributes. Note that it is not
+// possible to use a union type for this purpose because two dictionary
+// types are not distinguishable.
+//
+// Fortunately, there aren't any context creation attributes which are
+// defined with different default values in different context
+// specifications. (The "alpha" value, in particular, has a default
+// value of true for both the Canvas2D and WebGL specifications.)
+//
+// The PermissiveDictionaryConversion extended attribute ignores
+// non-object types (like 'true' and 'false') passed to getContext() for
+// the attributes instead of raising TypeError, following the behavior
+// of the previous custom binding.
+//
+// N.B.: Web IDL doesn't support multiple inheritance of dictionaries.
+
+[PermissiveDictionaryConversion]
+dictionary CanvasContextCreationAttributes {
+ // Canvas 2D attributes
+ boolean alpha = true; // Also used for WebGL.
+
+ // WebGL attributes
+ boolean depth = true;
+ boolean stencil = false;
+ boolean antialias = true;
+ boolean premultipliedAlpha = true;
+ boolean preserveDrawingBuffer = false;
+ boolean failIfMajorPerformanceCaveat = false;
+};
diff --git a/core/html/canvas/CanvasRenderingContext2D.idl b/core/html/canvas/CanvasRenderingContext2D.idl
deleted file mode 100644
index b1eb216..0000000
--- a/core/html/canvas/CanvasRenderingContext2D.idl
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, 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:
- * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
- */
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasrenderingcontext2d
-
-// FIXME: float => double throughout
-// FIXME: Use union type in drawImage and createPattern once supported:
-// http://crbug.com/372891
-typedef (HTMLImageElement or
- HTMLVideoElement or
- HTMLCanvasElement // or
- // CanvasRenderingContext2D or
- // ImageBitmap
- ) CanvasImageSource;
-
-enum CanvasFillRule { "nonzero", "evenodd" };
-
-[
- TypeChecking=(Interface,Unrestricted),
- WillBeGarbageCollected,
-] interface CanvasRenderingContext2D {
- // back-reference to the canvas
- readonly attribute HTMLCanvasElement canvas;
-
- // state
- void save(); // push state on state stack
- void restore(); // pop state stack and restore state
-
- // transformations (default transform is the identity matrix)
- [RuntimeEnabled=ExperimentalCanvasFeatures] attribute SVGMatrix currentTransform;
- void scale(unrestricted float x, unrestricted float y);
- void rotate(unrestricted float angle);
- void translate(unrestricted float x, unrestricted float y);
- void transform(unrestricted float a, unrestricted float b, unrestricted float c, unrestricted float d, unrestricted float e, unrestricted float f);
- void setTransform(unrestricted float a, unrestricted float b, unrestricted float c, unrestricted float d, unrestricted float e, unrestricted float f);
- void resetTransform();
-
- // compositing
- attribute unrestricted float globalAlpha; // (default 1.0)
- [TreatNullAs=NullString] attribute DOMString globalCompositeOperation; // (default source-over)
-
- // image smoothing
- [ImplementedAs=imageSmoothingEnabled, MeasureAs=PrefixedImageSmoothingEnabled, DartSuppress] attribute boolean webkitImageSmoothingEnabled;
- [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothingEnabled;
-
- // colors and styles (see also the CanvasDrawingStyles interface)
- // FIXME: Use union types when supported: http://crbug.com/372891
- [Custom] attribute object strokeStyle; // (default black)
- [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, DOMString? repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLImageElement image, DOMString? repetitionType);
- [RaisesException] CanvasPattern createPattern(HTMLVideoElement image, DOMString? repetitionType);
-
- // shadows
- attribute unrestricted float shadowOffsetX;
- attribute unrestricted float shadowOffsetY;
- attribute unrestricted float shadowBlur;
- [TreatNullAs=NullString] attribute DOMString shadowColor;
-
- // rects
- void clearRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- void fillRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- void strokeRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
-
- // path API (see also CanvasPathMethods)
- void beginPath();
- void fill(optional CanvasFillRule winding);
- void fill(Path2D path, optional CanvasFillRule winding);
- void stroke();
- void stroke(Path2D path);
- // Focus rings
- void drawFocusIfNeeded(Element element);
- void drawFocusIfNeeded(Path2D path, Element element);
-
- [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(optional Path2D path);
- void clip(optional CanvasFillRule winding);
- void clip(Path2D path, optional CanvasFillRule winding);
- boolean isPointInPath(unrestricted float x, unrestricted float y, optional CanvasFillRule winding);
- boolean isPointInPath(Path2D path, unrestricted float x, unrestricted float y, optional CanvasFillRule winding);
- boolean isPointInStroke(unrestricted float x, unrestricted float y);
- boolean isPointInStroke(Path2D path, unrestricted float x, unrestricted float y);
-
- // text (see also the CanvasDrawingStyles interface)
- void fillText(DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth);
- void strokeText(DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth);
- TextMetrics measureText(DOMString text);
-
- // drawing images
- [RaisesException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y);
- [RaisesException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void drawImage(HTMLImageElement image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
- [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y);
- [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
- [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y);
- [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
- [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y);
- [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
- [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegion(optional HitRegionOptions 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);
- [RaisesException] ImageData getImageData(float sx, float sy, float sw, float sh);
- void putImageData(ImageData imagedata, float dx, float dy);
- void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
-
- // Context state
- // Should be merged with WebGL counterpart in CanvasRenderingContext, once no-longer experimental
- [RuntimeEnabled=ExperimentalCanvasFeatures] boolean isContextLost();
-
- Canvas2DContextAttributes getContextAttributes();
-
- // FIXME: factor out to CanvasDrawingStyles
- // line caps/joins
- attribute unrestricted float lineWidth; // (default 1)
- [TreatNullAs=NullString] attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
- [TreatNullAs=NullString] attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
- attribute unrestricted float miterLimit; // (default 10)
-
- // dashed lines
- void setLineDash(sequence<unrestricted float> dash);
- sequence<unrestricted float> getLineDash();
- attribute unrestricted float lineDashOffset;
-
- // text
- attribute DOMString font; // (default 10px sans-serif)
- attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
- attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
- [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString direction; // "inherit", "rtl", "ltr" (default: "inherit")
-
- // Non-standard APIs. Candidates for deprecation
- // https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D
- [MeasureAs=CanvasRenderingContext2DSetAlpha] void setAlpha(unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetCompositeOperation] void setCompositeOperation(DOMString compositeOperation);
- [MeasureAs=CanvasRenderingContext2DSetLineWidth] void setLineWidth(unrestricted float width);
- [MeasureAs=CanvasRenderingContext2DSetLineCap] void setLineCap(DOMString cap);
- [MeasureAs=CanvasRenderingContext2DSetLineJoin] void setLineJoin(DOMString join);
- [MeasureAs=CanvasRenderingContext2DSetMiterLimit] void setMiterLimit(unrestricted float limit);
- [MeasureAs=CanvasRenderingContext2DClearShadow] void clearShadow();
- [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(DOMString color, optional unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(unrestricted float grayLevel, optional unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a);
- [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a);
- [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(DOMString color, optional unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestricted float grayLevel, optional unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a);
- [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a);
- [MeasureAs=CanvasRenderingContext2DDrawImageFromRect] void drawImageFromRect(
- HTMLImageElement? image, optional unrestricted float sx, optional unrestricted float sy, optional unrestricted float sw, optional unrestricted float sh,
- optional unrestricted float dx, optional unrestricted float dy, optional unrestricted float dw, optional unrestricted float dh, optional DOMString compositeOperation);
- [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur, optional DOMString color, optional unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur, unrestricted float grayLevel, optional unrestricted float alpha);
- [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur, unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a);
- [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur, unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a);
-};
-
-CanvasRenderingContext2D implements CanvasPathMethods;
diff --git a/core/html/canvas/DataView.idl b/core/html/canvas/DataView.idl
deleted file mode 100644
index 9744bda..0000000
--- a/core/html/canvas/DataView.idl
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2010 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:
- *
- * 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.
- */
-
-[
- Custom=Wrap,
- CustomConstructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long byteLength),
- 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.
-
- [RaisesException] byte getInt8(unsigned long byteOffset);
- [RaisesException] octet getUint8(unsigned long byteOffset);
-
- [RaisesException] short getInt16(unsigned long byteOffset, optional boolean littleEndian);
- [RaisesException] unsigned short getUint16(unsigned long byteOffset, optional boolean littleEndian);
- [RaisesException] long getInt32(unsigned long byteOffset, optional boolean littleEndian);
- [RaisesException] unsigned long getUint32(unsigned long byteOffset, optional boolean littleEndian);
-
- // Use custom code to handle NaN case for JSC.
- [RaisesException] float getFloat32(unsigned long byteOffset, optional boolean littleEndian);
- [RaisesException] double getFloat64(unsigned long byteOffset, optional boolean littleEndian);
-
- [RaisesException] void setInt8(unsigned long byteOffset, byte value);
- [RaisesException] void setUint8(unsigned long byteOffset, octet value);
-
- [RaisesException] void setInt16(unsigned long byteOffset, short value, optional boolean littleEndian);
- [RaisesException] void setUint16(unsigned long byteOffset, unsigned short value, optional boolean littleEndian);
- [RaisesException] void setInt32(unsigned long byteOffset, long value, optional boolean littleEndian);
- [RaisesException] void setUint32(unsigned long byteOffset, unsigned long value, optional boolean littleEndian);
- [RaisesException] void setFloat32(unsigned long byteOffset, float value, optional boolean littleEndian);
- [RaisesException] void setFloat64(unsigned long byteOffset, double value, optional boolean littleEndian);
-};
diff --git a/core/html/ime/InputMethodContext.idl b/core/html/ime/InputMethodContext.idl
deleted file mode 100644
index 043feed..0000000
--- a/core/html/ime/InputMethodContext.idl
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-// http://www.w3.org/TR/ime-api/
-interface InputMethodContext : EventTarget {
- readonly attribute DOMString locale;
- readonly attribute HTMLElement target;
- readonly attribute unsigned long compositionStartOffset;
- readonly attribute unsigned long compositionEndOffset;
-
- void confirmComposition();
-
- attribute EventHandler oncandidatewindowshow;
- attribute EventHandler oncandidatewindowupdate;
- attribute EventHandler oncandidatewindowhide;
-};
diff --git a/core/html/shadow/PluginPlaceholderElement.idl b/core/html/shadow/PluginPlaceholderElement.idl
index 54b5e49..a873f0a 100644
--- a/core/html/shadow/PluginPlaceholderElement.idl
+++ b/core/html/shadow/PluginPlaceholderElement.idl
@@ -6,5 +6,7 @@
NoInterfaceObject
] interface PluginPlaceholderElement : HTMLDivElement {
[ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString message;
+ [ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute boolean closeable;
+
[ImplementedInPrivateScript, OnlyExposedToPrivateScript] void createdCallback();
};
diff --git a/core/html/track/AudioTrack.idl b/core/html/track/AudioTrack.idl
index d5e0449..28c294e 100644
--- a/core/html/track/AudioTrack.idl
+++ b/core/html/track/AudioTrack.idl
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#audiotrack
+
[
RuntimeEnabled=AudioVideoTracks,
SetWrapperReferenceFrom=owner,
diff --git a/core/html/track/AudioTrackList.idl b/core/html/track/AudioTrackList.idl
index 6bcd473..43a321e 100644
--- a/core/html/track/AudioTrackList.idl
+++ b/core/html/track/AudioTrackList.idl
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#audiotracklist
+
[
RuntimeEnabled=AudioVideoTracks,
SetWrapperReferenceFrom=owner,
diff --git a/core/html/track/TextTrack.idl b/core/html/track/TextTrack.idl
index 9a75f4b..9fc8a39 100644
--- a/core/html/track/TextTrack.idl
+++ b/core/html/track/TextTrack.idl
@@ -23,29 +23,34 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#texttrack
+
enum TextTrackMode { "disabled", "hidden", "showing" };
enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" };
[
SetWrapperReferenceFrom=owner,
- WillBeGarbageCollected,
+ TypeChecking=Interface,
] interface TextTrack : EventTarget {
readonly attribute TextTrackKind kind;
readonly attribute DOMString label;
readonly attribute DOMString language;
readonly attribute DOMString id;
+ // readonly attribute DOMString inBandMetadataTrackDispatchType;
- attribute TextTrackMode mode;
+ attribute TextTrackMode mode;
- readonly attribute TextTrackCueList cues;
- readonly attribute TextTrackCueList activeCues;
+ readonly attribute TextTrackCueList? cues;
+ readonly attribute TextTrackCueList? activeCues;
void addCue(TextTrackCue cue);
[RaisesException] void removeCue(TextTrackCue cue);
- attribute EventHandler oncuechange;
+ attribute EventHandler oncuechange;
+ // TODO(philipj): These WebVTT extensions have been removed from the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
[RuntimeEnabled=WebVTTRegions] readonly attribute VTTRegionList regions;
[RuntimeEnabled=WebVTTRegions] void addRegion(VTTRegion region);
[RaisesException, RuntimeEnabled=WebVTTRegions] void removeRegion(VTTRegion region);
diff --git a/core/html/track/TextTrackCue.idl b/core/html/track/TextTrackCue.idl
index ba325a1..d10834b 100644
--- a/core/html/track/TextTrackCue.idl
+++ b/core/html/track/TextTrackCue.idl
@@ -23,21 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue
+// https://html.spec.whatwg.org/#texttrackcue
[
- Custom=ToV8,
SetWrapperReferenceFrom=owner,
- TypeChecking=Unrestricted,
- WillBeGarbageCollected,
] interface TextTrackCue : EventTarget {
readonly attribute TextTrack? track;
- attribute DOMString id;
- attribute double startTime;
- attribute double endTime;
- attribute boolean pauseOnExit;
+ attribute DOMString id;
+ attribute double startTime;
+ attribute double endTime;
+ attribute boolean pauseOnExit;
- attribute EventHandler onenter;
- attribute EventHandler onexit;
+ attribute EventHandler onenter;
+ attribute EventHandler onexit;
};
diff --git a/core/html/track/TextTrackCueList.idl b/core/html/track/TextTrackCueList.idl
index 6ea59a6..a65101b 100644
--- a/core/html/track/TextTrackCueList.idl
+++ b/core/html/track/TextTrackCueList.idl
@@ -23,11 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#texttrackcuelist
+
[
WillBeGarbageCollected,
] interface TextTrackCueList {
readonly attribute unsigned long length;
- getter TextTrackCue item(unsigned long index);
- TextTrackCue getCueById(DOMString id);
+ // TODO(philipj): This getter should be anonymous.
+ [Measure] getter TextTrackCue item(unsigned long index);
+ TextTrackCue? getCueById(DOMString id);
};
-
diff --git a/core/html/track/TextTrackList.idl b/core/html/track/TextTrackList.idl
index 8fbc775..4f3168f 100644
--- a/core/html/track/TextTrackList.idl
+++ b/core/html/track/TextTrackList.idl
@@ -23,14 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#texttracklist
+
[
SetWrapperReferenceFrom=owner,
] interface TextTrackList : EventTarget {
readonly attribute unsigned long length;
- getter TextTrack item(unsigned long index);
+ // TODO(philipj): This getter should be anonymous.
+ [Measure] getter TextTrack item(unsigned long index);
TextTrack? getTrackById(DOMString id);
- attribute EventHandler onaddtrack;
attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
};
diff --git a/core/html/track/TrackEvent.idl b/core/html/track/TrackEvent.idl
index 38ad03d..29066ef 100644
--- a/core/html/track/TrackEvent.idl
+++ b/core/html/track/TrackEvent.idl
@@ -23,8 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/multipage/embedded-content.html#the-trackevent-interface
+
[
- EventConstructor,
+ Constructor(DOMString type, optional TrackEventInit eventInitDict),
] interface TrackEvent : Event {
- [InitializedByEventConstructor, Custom=Getter] readonly attribute object track;
-};
\ No newline at end of file
+ readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
+};
diff --git a/core/html/track/TrackEventInit.idl b/core/html/track/TrackEventInit.idl
new file mode 100644
index 0000000..f37955a
--- /dev/null
+++ b/core/html/track/TrackEventInit.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.
+
+// https://html.spec.whatwg.org/multipage/embedded-content.html#the-trackevent-interface
+
+dictionary TrackEventInit : EventInit {
+ (VideoTrack or AudioTrack or TextTrack)? track;
+};
diff --git a/core/html/track/VideoTrack.idl b/core/html/track/VideoTrack.idl
index cc4efee..bc0073e 100644
--- a/core/html/track/VideoTrack.idl
+++ b/core/html/track/VideoTrack.idl
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#videotrack
+
[
RuntimeEnabled=AudioVideoTracks,
SetWrapperReferenceFrom=owner,
diff --git a/core/html/track/VideoTrackList.idl b/core/html/track/VideoTrackList.idl
index f766335..0651763 100644
--- a/core/html/track/VideoTrackList.idl
+++ b/core/html/track/VideoTrackList.idl
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://html.spec.whatwg.org/#videotracklist
+
[
RuntimeEnabled=AudioVideoTracks,
SetWrapperReferenceFrom=owner,
diff --git a/core/html/track/vtt/VTTCue.idl b/core/html/track/vtt/VTTCue.idl
index 3ca0307..93c903b 100644
--- a/core/html/track/vtt/VTTCue.idl
+++ b/core/html/track/vtt/VTTCue.idl
@@ -27,7 +27,12 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/html5/webvtt/#the-vttcue-interface
+
+enum AutoKeyword { "auto" };
enum DirectionSetting { "" /* horizontal */, "rl", "lr" };
+// enum LineAlignSetting { "start", "middle", "end" };
+// enum PositionAlignSetting { "start", "middle", "end", "auto" };
enum AlignSetting { "start", "middle", "end", "left", "right" };
[
@@ -35,12 +40,15 @@
ConstructorCallWith=Document,
SetWrapperReferenceFrom=owner,
] interface VTTCue : TextTrackCue {
+ // TODO(philipj): regionId has been replaced by a region attribute.
[RuntimeEnabled=WebVTTRegions] attribute DOMString regionId;
attribute DirectionSetting vertical;
attribute boolean snapToLines;
- [RaisesException=Setter] attribute long line;
- [RaisesException=Setter] attribute long position;
- [RaisesException=Setter] attribute long size;
+ attribute (double or AutoKeyword) line;
+ // attribute LineAlignSetting lineAlign;
+ [RaisesException=Setter] attribute (double or AutoKeyword) position;
+ // attribute PositionAlignSetting positionAlign;
+ [RaisesException=Setter] attribute double size;
attribute AlignSetting align;
attribute DOMString text;
DocumentFragment getCueAsHTML();
diff --git a/core/html/track/vtt/VTTRegion.idl b/core/html/track/vtt/VTTRegion.idl
index 1a28e70..3f18b15 100644
--- a/core/html/track/vtt/VTTRegion.idl
+++ b/core/html/track/vtt/VTTRegion.idl
@@ -23,20 +23,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/html5/webvtt/#the-vttregion-interface
+
[
Constructor,
RuntimeEnabled=WebVTTRegions,
- TypeChecking=Unrestricted,
WillBeGarbageCollected,
] interface VTTRegion {
- readonly attribute TextTrack track;
-
- attribute DOMString id;
[RaisesException=Setter] attribute double width;
+ // TODO(philipj): height should be called lines.
[RaisesException=Setter] attribute long height;
[RaisesException=Setter] attribute double regionAnchorX;
[RaisesException=Setter] attribute double regionAnchorY;
[RaisesException=Setter] attribute double viewportAnchorX;
[RaisesException=Setter] attribute double viewportAnchorY;
+ // TODO(philip): scroll should be of type ScrollSetting.
[RaisesException=Setter] attribute DOMString scroll;
+
+ // TODO(philipj): The track/id attributes are gone from the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
+ readonly attribute TextTrack track;
+ attribute DOMString id;
};
diff --git a/core/html/track/vtt/VTTRegionList.idl b/core/html/track/vtt/VTTRegionList.idl
index cdd3d4d..080b103 100644
--- a/core/html/track/vtt/VTTRegionList.idl
+++ b/core/html/track/vtt/VTTRegionList.idl
@@ -23,6 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(philipj): The VTTRegionList interface has been removed from the spec:
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
+
[
RuntimeEnabled=WebVTTRegions,
WillBeGarbageCollected,
@@ -31,4 +34,3 @@
getter VTTRegion item(unsigned long index);
VTTRegion getRegionById(DOMString id);
};
-
diff --git a/core/imagebitmap/ImageBitmapFactories.idl b/core/imagebitmap/ImageBitmapFactories.idl
index 1b34ea7..376fafa 100644
--- a/core/imagebitmap/ImageBitmapFactories.idl
+++ b/core/imagebitmap/ImageBitmapFactories.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#imagebitmapfactories
+// https://html.spec.whatwg.org/#imagebitmapfactories
// FIXME: should use typedef instead, but
// requires better union type support: http://crbug.com/240176
@@ -45,6 +45,7 @@
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
RuntimeEnabled=ExperimentalCanvasFeatures,
TypeChecking=Interface,
] interface ImageBitmapFactories {
@@ -58,4 +59,3 @@
Window implements ImageBitmapFactories;
WorkerGlobalScope implements ImageBitmapFactories;
-
diff --git a/core/input/InputDevice.idl b/core/input/InputDevice.idl
new file mode 100644
index 0000000..83e345f
--- /dev/null
+++ b/core/input/InputDevice.idl
@@ -0,0 +1,21 @@
+// Copyright 2015 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.
+
+// Represents an input device (or group of related devices).
+// To ease implementation, developers cannot rely on comparing two InputDevice
+// instances for equality. Now we only have two InputDevice instances: one
+// represents all the devices which send touch events, the other one covers all
+// other devices which do not send touch events, because currently all we care
+// about is if the input device fires touch events or not.
+[
+ Constructor(optional InputDeviceInit deviceInitDict),
+ RuntimeEnabled=InputDevice,
+ GarbageCollected,
+] interface InputDevice {
+
+ // Whether this device dispatches touch events for movement. This is used to detect
+ // mouse events which represent only an action that has already been handled by
+ // touch event handlers.
+ readonly attribute boolean firesTouchEvents;
+};
diff --git a/core/input/InputDeviceInit.idl b/core/input/InputDeviceInit.idl
new file mode 100644
index 0000000..cad1069
--- /dev/null
+++ b/core/input/InputDeviceInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=InputDevice,
+] dictionary InputDeviceInit {
+ boolean firesTouchEvents = false;
+};
diff --git a/core/inspector/CodeGeneratorInspector.py b/core/inspector/CodeGeneratorInspector.py
index 5d02acf..dccfdc0 100755
--- a/core/inspector/CodeGeneratorInspector.py
+++ b/core/inspector/CodeGeneratorInspector.py
@@ -48,8 +48,7 @@
TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor", "Runtime.InternalPropertyDescriptor",
- "Debugger.FunctionDetails", "Debugger.CollectionEntry", "Debugger.CallFrame", "Debugger.Location",
- "Canvas.TraceLog", "Canvas.ResourceState"])
+ "Debugger.FunctionDetails", "Debugger.GeneratorObjectDetails", "Debugger.CollectionEntry", "Debugger.CallFrame", "Debugger.Location"])
TYPES_WITH_OPEN_FIELD_LIST_SET = frozenset([
# InspectorStyleSheet not only creates this property but wants to read it and modify it.
@@ -1006,7 +1005,7 @@
pos += 1
writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_3
- % (class_name, class_name, class_name, class_name, class_name))
+ % (class_name, class_name, class_name, class_name, class_name, class_name))
writer.newline(" /*\n")
writer.newline(" * Synthetic constructor:\n")
@@ -1055,7 +1054,7 @@
writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
writer.newline(" assertCorrectValue(object.get());\n")
writer.append("#endif // %s\n" % VALIDATOR_IFDEF_NAME)
- writer.newline(" COMPILE_ASSERT(sizeof(%s) == sizeof(JSONObjectBase), type_cast_problem);\n" % class_name)
+ writer.newline(" static_assert(sizeof(%s) == sizeof(JSONObjectBase), \"%s should be the same size as JSONObjectBase\");\n" % (class_name, class_name))
writer.newline(" return static_cast<%s*>(static_cast<JSONObjectBase*>(object.get()));\n" % class_name)
writer.newline(" }\n")
writer.append("\n")
@@ -1648,7 +1647,7 @@
frontendDomainMethodDeclarations="".join(flatten_list(frontend_method_declaration_lines))))
agent_interface_name = Capitalizer.lower_camel_case_to_upper(domain_name) + "CommandHandler"
- Generator.backend_agent_interface_list.append(" class %s {\n" % agent_interface_name)
+ Generator.backend_agent_interface_list.append(" class CORE_EXPORT %s {\n" % agent_interface_name)
Generator.backend_agent_interface_list.append(" public:\n")
if "commands" in json_domain:
for json_command in json_domain["commands"]:
@@ -1706,7 +1705,7 @@
Generator.method_name_enum_list.append(" %s," % cmd_enum_name)
Generator.method_handler_list.append(" &InspectorBackendDispatcherImpl::%s_%s," % (domain_name, json_command_name))
- Generator.backend_method_declaration_list.append(" void %s_%s(long callId, JSONObject* requestMessageObject, JSONArray* protocolErrors);" % (domain_name, json_command_name))
+ Generator.backend_method_declaration_list.append(" void %s_%s(int callId, JSONObject* requestMessageObject, JSONArray* protocolErrors);" % (domain_name, json_command_name))
backend_agent_interface_list = [] if "redirect" in json_command else Generator.backend_agent_interface_list
@@ -1788,7 +1787,7 @@
callback_writer.newline("class " + callback_name + " : public CallbackBase {\n")
callback_writer.newline("public:\n")
callback_writer.newline(" " + callback_name + "(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl>, int id);\n")
- callback_writer.newline(" void sendSuccess(" + ", ".join(decl_parameter_list) + ");\n")
+ callback_writer.newline(" CORE_EXPORT void sendSuccess(" + ", ".join(decl_parameter_list) + ");\n")
error_part_writer = callback_writer.insert_writer("")
callback_writer.newline("};\n")
@@ -1882,6 +1881,7 @@
commandNameIndex=cmd_enum_name))
declaration_command_name = "%s.%s\\0" % (domain_name, json_command_name)
Generator.backend_method_name_declaration_list.append(" \"%s\"" % declaration_command_name)
+ assert Generator.backend_method_name_declaration_current_index < 2 ** 16, "Number too large for unsigned short."
Generator.backend_method_name_declaration_index_list.append(" %d," % Generator.backend_method_name_declaration_current_index)
Generator.backend_method_name_declaration_current_index += len(declaration_command_name) - 1
diff --git a/core/inspector/CodeGeneratorInspectorStrings.py b/core/inspector/CodeGeneratorInspectorStrings.py
index 0591782..e20c806 100644
--- a/core/inspector/CodeGeneratorInspectorStrings.py
+++ b/core/inspector/CodeGeneratorInspectorStrings.py
@@ -30,8 +30,9 @@
# Its syntax is a Python syntax subset, suitable for manual parsing.
frontend_domain_class = (
-""" class $domainClassName {
+""" class CORE_EXPORT $domainClassName {
public:
+ static $domainClassName* from(InspectorFrontend* frontend) { return &(frontend->m_$domainFieldName) ;}
$domainClassName(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
${frontendDomainMethodDeclarations}
void flush() { m_inspectorFrontendChannel->flush(); }
@@ -39,18 +40,16 @@
InspectorFrontendChannel* m_inspectorFrontendChannel;
};
- $domainClassName* $domainFieldName() { return &m_$domainFieldName; }
-
""")
backend_method = (
-"""void InspectorBackendDispatcherImpl::${domainName}_$methodName(long callId, JSONObject*$requestMessageObject, JSONArray* protocolErrors)
+"""void InspectorBackendDispatcherImpl::${domainName}_$methodName(int callId, JSONObject*$requestMessageObject, JSONArray* protocolErrors)
{
if (!$agentField)
protocolErrors->pushString("${domainName} handler is not available.");
$methodCode
if (protocolErrors->length()) {
- reportProtocolError(&callId, InvalidParams, String::format(InvalidParamsFormatString, commandName($commandNameIndex)), protocolErrors);
+ reportProtocolError(callId, InvalidParams, String::format(InvalidParamsFormatString, commandName($commandNameIndex)), protocolErrors);
return;
}
$agentCallParamsDeclaration
@@ -65,7 +64,7 @@
RefPtr<JSONObject> jsonMessage = JSONObject::create();
jsonMessage->setString("method", "$domainName.$eventName");
$code if (m_inspectorFrontendChannel)
- m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage.release());
+ m_inspectorFrontendChannel->sendProtocolNotification(jsonMessage.release());
}
""")
@@ -97,6 +96,7 @@
#define InspectorFrontend_h
#include "InspectorTypeBuilder.h"
+#include "core/CoreExport.h"
#include "core/inspector/InspectorFrontendChannel.h"
#include "platform/JSONValues.h"
#include "wtf/PassRefPtr.h"
@@ -106,7 +106,7 @@
typedef String ErrorString;
-class InspectorFrontend {
+class CORE_EXPORT InspectorFrontend {
public:
InspectorFrontend(InspectorFrontendChannel*);
InspectorFrontendChannel* channel() { return m_inspectorFrontendChannel; }
@@ -126,6 +126,7 @@
#include "InspectorTypeBuilder.h"
+#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -141,17 +142,17 @@
class InspectorBackendDispatcherImpl;
-class InspectorBackendDispatcher: public RefCountedWillBeGarbageCollectedFinalized<InspectorBackendDispatcher> {
+class CORE_EXPORT InspectorBackendDispatcher: public RefCountedWillBeGarbageCollectedFinalized<InspectorBackendDispatcher> {
public:
static PassRefPtrWillBeRawPtr<InspectorBackendDispatcher> create(InspectorFrontendChannel* inspectorFrontendChannel);
virtual ~InspectorBackendDispatcher() { }
- virtual void trace(Visitor*) { }
+ DEFINE_INLINE_VIRTUAL_TRACE() { }
- class CallbackBase: public RefCountedWillBeGarbageCollectedFinalized<CallbackBase> {
+ class CORE_EXPORT CallbackBase: public RefCountedWillBeGarbageCollectedFinalized<CallbackBase> {
public:
CallbackBase(PassRefPtrWillBeRawPtr<InspectorBackendDispatcherImpl> backendImpl, int id);
virtual ~CallbackBase();
- virtual void trace(Visitor*);
+ DECLARE_VIRTUAL_TRACE();
void sendFailure(const ErrorString&);
bool isActive();
@@ -183,8 +184,8 @@
LastEntry,
};
- void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage) const;
- virtual void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const = 0;
+ void reportProtocolError(int callId, CommonErrorCode, const String& errorMessage) const;
+ virtual void reportProtocolError(int callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const = 0;
virtual void dispatch(const String& message) = 0;
static bool getCommandName(const String& message, String* result);
@@ -198,7 +199,7 @@
private:
static const char commandNames[];
- static const size_t commandNamesIndex[];
+ static const unsigned short commandNamesIndex[];
};
} // namespace blink
@@ -225,12 +226,12 @@
$methodNameDeclarations
};
-const size_t InspectorBackendDispatcher::commandNamesIndex[] = {
+const unsigned short InspectorBackendDispatcher::commandNamesIndex[] = {
$methodNameDeclarationsIndex
};
const char* InspectorBackendDispatcher::commandName(MethodNames index) {
- COMPILE_ASSERT(static_cast<int>(kMethodNamesEnumSize) == WTF_ARRAY_LENGTH(commandNamesIndex), command_name_array_problem);
+ static_assert(static_cast<int>(kMethodNamesEnumSize) == WTF_ARRAY_LENGTH(commandNamesIndex), "MethodNames enum should have the same number of elements as commandNamesIndex");
return commandNames + commandNamesIndex[index];
}
@@ -239,18 +240,36 @@
InspectorBackendDispatcherImpl(InspectorFrontendChannel* inspectorFrontendChannel)
: m_inspectorFrontendChannel(inspectorFrontendChannel)
$constructorInit
- { }
+ {
+ // Initialize dispatch map.
+ const CallHandler handlers[] = {
+ $messageHandlers
+ };
+ for (size_t i = 0; i < kMethodNamesEnumSize; ++i)
+ m_dispatchMap.add(commandName(static_cast<MethodNames>(i)), handlers[i]);
+
+ // Initialize common errors.
+ m_commonErrors.insert(ParseError, -32700);
+ m_commonErrors.insert(InvalidRequest, -32600);
+ m_commonErrors.insert(MethodNotFound, -32601);
+ m_commonErrors.insert(InvalidParams, -32602);
+ m_commonErrors.insert(InternalError, -32603);
+ m_commonErrors.insert(ServerError, -32000);
+ }
virtual void clearFrontend() { m_inspectorFrontendChannel = 0; }
virtual void dispatch(const String& message);
- virtual void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const;
+ virtual void reportProtocolError(int callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const;
using InspectorBackendDispatcher::reportProtocolError;
- void sendResponse(long callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result);
+ void sendResponse(int callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result);
bool isActive() { return m_inspectorFrontendChannel; }
$setters
private:
+ using CallHandler = void (InspectorBackendDispatcherImpl::*)(int callId, JSONObject* messageObject, JSONArray* protocolErrors);
+ using DispatchMap = HashMap<String, CallHandler>;
+
$methodDeclarations
InspectorFrontendChannel* m_inspectorFrontendChannel;
@@ -266,15 +285,18 @@
static PassRefPtr<JSONObject> getObject(JSONObject* object, const char* name, bool* valueFound, JSONArray* protocolErrors);
static PassRefPtr<JSONArray> getArray(JSONObject* object, const char* name, bool* valueFound, JSONArray* protocolErrors);
- void sendResponse(long callId, ErrorString invocationError, PassRefPtr<JSONObject> result)
+ void sendResponse(int callId, ErrorString invocationError, PassRefPtr<JSONObject> result)
{
sendResponse(callId, invocationError, RefPtr<JSONValue>(), result);
}
- void sendResponse(long callId, ErrorString invocationError)
+ void sendResponse(int callId, ErrorString invocationError)
{
sendResponse(callId, invocationError, RefPtr<JSONValue>(), JSONObject::create());
}
static const char InvalidParamsFormatString[];
+
+ DispatchMap m_dispatchMap;
+ Vector<int> m_commonErrors;
};
const char InspectorBackendDispatcherImpl::InvalidParamsFormatString[] = "Some arguments of method '%s' can't be processed";
@@ -290,57 +312,24 @@
void InspectorBackendDispatcherImpl::dispatch(const String& message)
{
RefPtrWillBeRawPtr<InspectorBackendDispatcher> protect(this);
- typedef void (InspectorBackendDispatcherImpl::*CallHandler)(long callId, JSONObject* messageObject, JSONArray* protocolErrors);
- typedef HashMap<String, CallHandler> DispatchMap;
- DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, );
- long callId = 0;
-
- if (dispatchMap.isEmpty()) {
- static const CallHandler handlers[] = {
-$messageHandlers
- };
- for (size_t i = 0; i < kMethodNamesEnumSize; ++i)
- dispatchMap.add(commandName(static_cast<MethodNames>(i)), handlers[i]);
- }
-
+ int callId = 0;
RefPtr<JSONValue> parsedMessage = parseJSON(message);
- if (!parsedMessage) {
- reportProtocolError(0, ParseError, "Message must be in JSON format");
- return;
- }
-
+ ASSERT(parsedMessage);
RefPtr<JSONObject> messageObject = parsedMessage->asObject();
- if (!messageObject) {
- reportProtocolError(0, InvalidRequest, "Message must be a JSONified object");
- return;
- }
+ ASSERT(messageObject);
RefPtr<JSONValue> callIdValue = messageObject->get("id");
- if (!callIdValue) {
- reportProtocolError(0, InvalidRequest, "'id' property was not found");
- return;
- }
-
- if (!callIdValue->asNumber(&callId)) {
- reportProtocolError(0, InvalidRequest, "The type of 'id' property must be number");
- return;
- }
+ bool success = callIdValue->asNumber(&callId);
+ ASSERT_UNUSED(success, success);
RefPtr<JSONValue> methodValue = messageObject->get("method");
- if (!methodValue) {
- reportProtocolError(&callId, InvalidRequest, "'method' property wasn't found");
- return;
- }
-
String method;
- if (!methodValue->asString(&method)) {
- reportProtocolError(&callId, InvalidRequest, "The type of 'method' property must be string");
- return;
- }
+ success = methodValue && methodValue->asString(&method);
+ ASSERT_UNUSED(success, success);
- HashMap<String, CallHandler>::iterator it = dispatchMap.find(method);
- if (it == dispatchMap.end()) {
- reportProtocolError(&callId, MethodNotFound, "'" + method + "' wasn't found");
+ HashMap<String, CallHandler>::iterator it = m_dispatchMap.find(method);
+ if (it == m_dispatchMap.end()) {
+ reportProtocolError(callId, MethodNotFound, "'" + method + "' wasn't found");
return;
}
@@ -348,10 +337,10 @@
((*this).*it->value)(callId, messageObject.get(), protocolErrors.get());
}
-void InspectorBackendDispatcherImpl::sendResponse(long callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result)
+void InspectorBackendDispatcherImpl::sendResponse(int callId, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData, PassRefPtr<JSONObject> result)
{
if (invocationError.length()) {
- reportProtocolError(&callId, ServerError, invocationError, errorData);
+ reportProtocolError(callId, ServerError, invocationError, errorData);
return;
}
@@ -359,42 +348,30 @@
responseMessage->setNumber("id", callId);
responseMessage->setObject("result", result);
if (m_inspectorFrontendChannel)
- m_inspectorFrontendChannel->sendMessageToFrontend(responseMessage.release());
+ m_inspectorFrontendChannel->sendProtocolResponse(callId, responseMessage.release());
}
-void InspectorBackendDispatcher::reportProtocolError(const long* const callId, CommonErrorCode code, const String& errorMessage) const
+void InspectorBackendDispatcher::reportProtocolError(int callId, CommonErrorCode code, const String& errorMessage) const
{
reportProtocolError(callId, code, errorMessage, PassRefPtr<JSONValue>());
}
-void InspectorBackendDispatcherImpl::reportProtocolError(const long* const callId, CommonErrorCode code, const String& errorMessage, PassRefPtr<JSONValue> data) const
+void InspectorBackendDispatcherImpl::reportProtocolError(int callId, CommonErrorCode code, const String& errorMessage, PassRefPtr<JSONValue> data) const
{
- DEFINE_STATIC_LOCAL(Vector<int>,s_commonErrors,);
- if (!s_commonErrors.size()) {
- s_commonErrors.insert(ParseError, -32700);
- s_commonErrors.insert(InvalidRequest, -32600);
- s_commonErrors.insert(MethodNotFound, -32601);
- s_commonErrors.insert(InvalidParams, -32602);
- s_commonErrors.insert(InternalError, -32603);
- s_commonErrors.insert(ServerError, -32000);
- }
ASSERT(code >=0);
- ASSERT((unsigned)code < s_commonErrors.size());
- ASSERT(s_commonErrors[code]);
+ ASSERT((unsigned)code < m_commonErrors.size());
+ ASSERT(m_commonErrors[code]);
RefPtr<JSONObject> error = JSONObject::create();
- error->setNumber("code", s_commonErrors[code]);
+ error->setNumber("code", m_commonErrors[code]);
error->setString("message", errorMessage);
ASSERT(error);
if (data)
error->setValue("data", data);
RefPtr<JSONObject> message = JSONObject::create();
message->setObject("error", error);
- if (callId)
- message->setNumber("id", *callId);
- else
- message->setValue("id", JSONValue::null());
+ message->setNumber("id", callId);
if (m_inspectorFrontendChannel)
- m_inspectorFrontendChannel->sendMessageToFrontend(message.release());
+ m_inspectorFrontendChannel->sendProtocolResponse(callId, message.release());
}
template<typename R, typename V, typename V0>
@@ -492,7 +469,7 @@
InspectorBackendDispatcher::CallbackBase::~CallbackBase() {}
-void InspectorBackendDispatcher::CallbackBase::trace(Visitor* visitor)
+DEFINE_TRACE(InspectorBackendDispatcher::CallbackBase)
{
visitor->trace(m_backendImpl);
}
@@ -550,6 +527,7 @@
#ifndef InspectorTypeBuilder_h
#define InspectorTypeBuilder_h
+#include "core/CoreExport.h"
#include "platform/JSONValues.h"
#include "wtf/Assertions.h"
#include "wtf/PassRefPtr.h"
@@ -611,7 +589,7 @@
Array() { }
JSONArray* openAccessors() {
- COMPILE_ASSERT(sizeof(JSONArray) == sizeof(Array<T>), cannot_cast);
+ static_assert(sizeof(JSONArray) == sizeof(Array<T>), "JSONArray should be the same size as Array<T>");
return static_cast<JSONArray*>(static_cast<JSONArrayBase*>(this));
}
@@ -639,7 +617,7 @@
#if $validatorIfdefName
assertCorrectValue(array.get());
#endif // $validatorIfdefName
- COMPILE_ASSERT(sizeof(Array<T>) == sizeof(JSONArray), type_cast_problem);
+ static_assert(sizeof(Array<T>) == sizeof(JSONArray), "Array<T> should be the same size as JSONArray");
return static_cast<Array<T>*>(static_cast<JSONArrayBase*>(array.get()));
}
@@ -819,7 +797,7 @@
${forwards}
-String getEnumConstantValue(int code);
+CORE_EXPORT String getEnumConstantValue(int code);
${typeBuilders}
} // namespace TypeBuilder
@@ -899,7 +877,7 @@
Builder(PassRefPtr</*%s*/JSONObject> ptr)
{
- COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+ static_assert(STATE == NoFieldsSet, "builder should not be created in non-init state");
m_result = ptr;
}
friend class %s;
@@ -909,7 +887,7 @@
class_binding_builder_part_2 = ("""
Builder<STATE | %s>& set%s(%s value)
{
- COMPILE_ASSERT(!(STATE & %s), property_%s_already_set);
+ static_assert(!(STATE & %s), "property %s should not be set yet");
m_result->set%s("%s", %s);
return castState<%s>();
}
@@ -918,8 +896,8 @@
class_binding_builder_part_3 = ("""
operator RefPtr<%s>& ()
{
- COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
- COMPILE_ASSERT(sizeof(%s) == sizeof(JSONObject), cannot_cast);
+ static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
+ static_assert(sizeof(%s) == sizeof(JSONObject), "%s should be the same size as JSONObject");
return *reinterpret_cast<RefPtr<%s>*>(&m_result);
}
diff --git a/core/inspector/CodeGeneratorInstrumentation.py b/core/inspector/CodeGeneratorInstrumentation.py
index 54e5ce8..595812e 100755
--- a/core/inspector/CodeGeneratorInstrumentation.py
+++ b/core/inspector/CodeGeneratorInstrumentation.py
@@ -104,19 +104,12 @@
if (${agent_class}* agent = ${agent_fetch})
${maybe_return}agent->${name}(${params_agent});""")
-template_agent_call_timeline_returns_cookie = string.Template("""
- int timelineAgentId = 0;
- if (InspectorTimelineAgent* agent = agents->inspectorTimelineAgent()) {
- if (agent->${name}(${params_agent}))
- timelineAgentId = agent->id();
- }""")
-
-
template_instrumenting_agents_h = string.Template("""// Code generated from InspectorInstrumentation.idl
#ifndef InstrumentingAgentsInl_h
#define InstrumentingAgentsInl_h
+#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Noncopyable.h"
@@ -127,16 +120,16 @@
${forward_list}
-class InstrumentingAgents : public RefCountedWillBeGarbageCollectedFinalized<InstrumentingAgents> {
+class CORE_EXPORT InstrumentingAgents : public RefCountedWillBeGarbageCollectedFinalized<InstrumentingAgents> {
WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InstrumentingAgents);
public:
static PassRefPtrWillBeRawPtr<InstrumentingAgents> create()
{
return adoptRefWillBeNoop(new InstrumentingAgents());
}
~InstrumentingAgents() { }
- void trace(Visitor*);
+ DECLARE_TRACE();
void reset();
${accessor_list}
@@ -162,7 +155,7 @@
{
}
-void InstrumentingAgents::trace(Visitor* visitor)
+DEFINE_TRACE(InstrumentingAgents)
{
$trace_list
}
@@ -284,7 +277,7 @@
if "Inline=Custom" in self.options:
return
- header_lines.append("%s %sImpl(%s);" % (
+ header_lines.append("CORE_EXPORT %s %sImpl(%s);" % (
self.return_type, self.name, ", ".join(map(Parameter.to_str_class, self.params_impl))))
if "Inline=FastReturn" in self.options or "Inline=Forward" in self.options:
@@ -328,20 +321,18 @@
body_lines += map(self.generate_agent_call, self.agents)
if self.returns_cookie:
- if "Timeline" in self.agents:
- timeline_agent_id = "timelineAgentId"
- else:
- timeline_agent_id = "0"
- body_lines.append("\n return InspectorInstrumentationCookie(agents, %s);" % timeline_agent_id)
+ body_lines.append("\n return InspectorInstrumentationCookie(agents);")
elif self.returns_value:
body_lines.append("\n return %s;" % self.default_return_value)
- cpp_lines.append(template_outofline.substitute(
+ generated_outofline = template_outofline.substitute(
None,
return_type=self.return_type,
name=self.name,
params_impl=", ".join(map(Parameter.to_str_class_and_name, self.params_impl)),
- impl_lines="".join(body_lines)))
+ impl_lines="".join(body_lines))
+ if generated_outofline not in cpp_lines:
+ cpp_lines.append(generated_outofline)
def generate_agent_call(self, agent):
agent_class, agent_getter = agent_getter_signature(agent)
@@ -349,15 +340,10 @@
leading_param_name = self.params_impl[0].name
if not self.accepts_cookie:
agent_fetch = "%s->%s()" % (leading_param_name, agent_getter)
- elif agent == "Timeline":
- agent_fetch = "retrieveTimelineAgent(%s)" % leading_param_name
else:
agent_fetch = "%s.instrumentingAgents()->%s()" % (leading_param_name, agent_getter)
- if agent == "Timeline" and self.returns_cookie:
- template = template_agent_call_timeline_returns_cookie
- else:
- template = template_agent_call
+ template = template_agent_call
if not self.returns_value or self.returns_cookie:
maybe_return = ""
@@ -440,9 +426,11 @@
def agent_class_name(agent):
- custom_agent_names = ["PageDebugger", "PageRuntime", "WorkerRuntime"]
+ custom_agent_names = ["PageDebugger", "PageRuntime", "WorkerRuntime", "PageConsole"]
if agent in custom_agent_names:
return "%sAgent" % agent
+ if agent == "AsyncCallTracker":
+ return agent
return "Inspector%sAgent" % agent
@@ -524,6 +512,7 @@
for agent in used_agents:
cpp_includes.append(include_inspector_header(agent_class_name(agent)))
cpp_includes.append(include_header("InstrumentingAgentsInl"))
+ cpp_includes.append(include_header("core/CoreExport"))
cpp_includes.sort()
instrumenting_agents_header, instrumenting_agents_cpp = generate_instrumenting_agents(used_agents)
diff --git a/core/inspector/InspectorFrontendHost.idl b/core/inspector/DevToolsHost.idl
similarity index 87%
rename from core/inspector/InspectorFrontendHost.idl
rename to core/inspector/DevToolsHost.idl
index c655170..d20abb5 100644
--- a/core/inspector/InspectorFrontendHost.idl
+++ b/core/inspector/DevToolsHost.idl
@@ -32,10 +32,8 @@
[
WillBeGarbageCollected,
- NoInterfaceObject
-] interface InspectorFrontendHost {
- // FIXME: setZoomFactor is here only for old frontends. Remove in M38.
- void setZoomFactor(float zoom);
+ NoInterfaceObject,
+] interface DevToolsHost {
float zoomFactor();
void setInjectedScriptForOrigin(DOMString origin, DOMString script);
@@ -43,16 +41,12 @@
void copyText(DOMString text);
[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);
+ [Custom] void showContextMenuAtPoint(float x, float y, any items, optional Document document);
void sendMessageToBackend(DOMString message);
void sendMessageToEmbedder(DOMString message);
- [Custom] void recordActionTaken(unsigned long actionCode);
- [Custom] void recordPanelShown(unsigned long panelCode);
-
DOMString getSelectionBackgroundColor();
DOMString getSelectionForegroundColor();
diff --git a/core/inspector/InjectedScriptHost.idl b/core/inspector/InjectedScriptHost.idl
deleted file mode 100644
index 56f1e4d..0000000
--- a/core/inspector/InjectedScriptHost.idl
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2010 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.
- */
-
-[
- WillBeGarbageCollected,
- NoInterfaceObject
-] interface InjectedScriptHost {
- [NotEnumerable, Unforgeable] void clearConsoleMessages();
-
- [NotEnumerable, Unforgeable, Custom] void inspect(any objectId, object hints);
- [NotEnumerable, Unforgeable, Custom] any inspectedObject(long num);
- [NotEnumerable, Unforgeable, Custom] DOMString internalConstructorName(any obj);
- [NotEnumerable, Unforgeable, Custom] boolean isHTMLAllCollection(any obj);
- [NotEnumerable, Unforgeable, Custom] DOMString subtype(any obj);
- [NotEnumerable, Unforgeable, Custom] any functionDetails(Function obj);
- [NotEnumerable, Unforgeable, Custom] any[]? collectionEntries(object obj);
- [NotEnumerable, Unforgeable, Custom] any[] getInternalProperties(any obj);
- [NotEnumerable, Unforgeable, Custom] any[] 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(Function fn, any receiver, optional any[] argv);
- [NotEnumerable, Unforgeable, Custom] any suppressWarningsAndCallFunction(Function fn, any receiver, optional any[] argv);
- [NotEnumerable, Unforgeable, Custom] void setNonEnumProperty(object obj, DOMString key, any value);
-
- // Only declarative scope (local, with and catch) is accepted. Returns undefined.
- [NotEnumerable, Unforgeable, Custom] any setFunctionVariableValue(Function functionObject, long scopeIndex, DOMString variableName, any newValue);
-};
diff --git a/core/inspector/InspectorInstrumentation.idl b/core/inspector/InspectorInstrumentation.idl
index 1970ed8..b070934 100644
--- a/core/inspector/InspectorInstrumentation.idl
+++ b/core/inspector/InspectorInstrumentation.idl
@@ -67,7 +67,8 @@
#include "core/dom/PseudoElement.h"
- [Page, Inspector, PageDebugger, PageRuntime]
+ // We should call PageDebuggerAgent method first otherwise this method resets script cache and removes scripts executed by other agents.
+ [PageDebugger, Page, PageRuntime, Animation]
void didClearDocumentOfWindowObject([Keep] LocalFrame*);
[DOMDebugger, Inline=FastReturn]
@@ -86,10 +87,10 @@
void willModifyDOMAttr([Keep] Element*, const AtomicString& oldValue, const AtomicString& newValue);
[DOM, Inline=FastReturn]
- void didModifyDOMAttr([Keep] Element*, const AtomicString& name, const AtomicString& value);
+ void didModifyDOMAttr([Keep] Element*, const QualifiedName& name, const AtomicString& value);
[DOM, Inline=FastReturn]
- void didRemoveDOMAttr([Keep] Element*, const AtomicString& name);
+ void didRemoveDOMAttr([Keep] Element*, const QualifiedName& name);
[DOM, Inline=FastReturn]
void characterDataModified([Keep] CharacterData*);
@@ -97,27 +98,15 @@
[DOM, DOMDebugger, Inline=FastReturn]
void didInvalidateStyleAttr([Keep] Node*);
+ [DOM, Inline=FastReturn]
+ void didPerformElementShadowDistribution([Keep] Element*);
+
[CSS]
void documentDetached([Keep] Document*);
[CSS, Inline=FastReturn]
- void willMutateRules(CSSStyleSheet*);
-
- [CSS, Inline=FastReturn]
- void didMutateRules([Keep] CSSStyleSheet*);
-
- [CSS, Inline=FastReturn]
- void willMutateStyle(CSSStyleDeclaration*);
-
- [CSS, Inline=FastReturn]
- void didMutateStyle([Keep] CSSStyleDeclaration*, bool);
-
- [CSS, Inline=FastReturn]
void activeStyleSheetsUpdated([Keep] Document*);
- [Console, PageRuntime]
- void frameWindowDiscarded(LocalFrame*, LocalDOMWindow* domWindow);
-
[CSS, Inline=FastReturn]
void mediaQueryResultChanged(Document*);
@@ -127,6 +116,9 @@
[DOM, Inline=FastReturn]
void willPopShadowRoot([Keep] Element* host, ShadowRoot*);
+ [DOMDebugger]
+ void willSetInnerHTML(Element* element);
+
[DOMDebugger, Inline=FastReturn]
void willSendXMLHttpRequest(ExecutionContext*, const String& url);
@@ -139,154 +131,106 @@
[DOMDebugger, Inline=FastReturn]
void didFireWebGLErrorOrWarning(Element*, const String& message);
- [DOMDebugger, Debugger, Timeline, Inline=FastReturn]
+ [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
void didInstallTimer([Keep] ExecutionContext*, int timerId, int timeout, bool singleShot);
- [DOMDebugger, Debugger, Timeline, Inline=FastReturn]
+ [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
void didRemoveTimer([Keep] ExecutionContext*, int timerId);
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willCallFunction([Keep] ExecutionContext*, int scriptId, const String& scriptName, int scriptLine);
+ [Debugger, Inline=FastReturn]
+ InspectorInstrumentationCookie willCallFunction([Keep] ExecutionContext*, const DevToolsFunctionInfo&);
- [Timeline, Inline=FastReturn]
+ [Debugger, Inline=FastReturn]
void didCallFunction(const InspectorInstrumentationCookie&);
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent([Keep] ExecutionContext*, XMLHttpRequest*);
-
- [Timeline, Inline=FastReturn]
- void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
-
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willDispatchEvent([Keep] Document*, const Event&, LocalDOMWindow*, Node*, const EventPath&);
-
- [Timeline, Inline=FastReturn]
- void didDispatchEvent(const InspectorInstrumentationCookie&);
-
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didEnqueueEvent([Keep] EventTarget*, Event*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didRemoveEvent([Keep] EventTarget*, Event*);
- [Debugger, DOMDebugger, Inline=FastReturn]
+ [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
InspectorInstrumentationCookie willHandleEvent([Keep] EventTarget*, Event*, EventListener* listener, bool useCapture);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Debugger, Inline=FastReturn]
void didHandleEvent(const InspectorInstrumentationCookie&);
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willDispatchEventOnWindow(LocalFrame*, const Event&, LocalDOMWindow*);
-
- [Timeline, Inline=FastReturn]
- void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
-
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didEnqueueMutationRecord([Keep] ExecutionContext*, MutationObserver*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didClearAllMutationRecords([Keep] ExecutionContext*, MutationObserver*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void willDeliverMutationRecords([Keep] ExecutionContext*, MutationObserver*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didDeliverMutationRecords(ExecutionContext*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didPostExecutionContextTask([Keep] ExecutionContext*, ExecutionContextTask*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didKillAllExecutionContextTasks([Keep] ExecutionContext*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void willPerformExecutionContextTask([Keep] ExecutionContext*, ExecutionContextTask*);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didPerformExecutionContextTask(ExecutionContext*);
- [Timeline, Inline=FastReturn]
+ [Debugger, DOMDebugger, Inline=FastReturn]
InspectorInstrumentationCookie willEvaluateScript([Keep] LocalFrame*, const String& url, int lineNumber);
- [Timeline, Inline=FastReturn]
+ [Debugger, Inline=FastReturn]
void didEvaluateScript(const InspectorInstrumentationCookie&);
- [PageRuntime, Inline=FastReturn]
- void didCreateIsolatedContext([Keep] LocalFrame*, ScriptState*, SecurityOrigin*);
+ [PageRuntime]
+ void didCreateScriptContext([Keep] LocalFrame*, ScriptState*, SecurityOrigin*, int worldId);
- [DOMDebugger, Debugger, Timeline, Inline=FastReturn]
+ [PageRuntime, Inline=FastReturn]
+ void willReleaseScriptContext([Keep] LocalFrame*, ScriptState*);
+
+ [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
InspectorInstrumentationCookie willFireTimer([Keep] ExecutionContext*, int timerId);
- [Debugger, Timeline, Inline=FastReturn]
+ [AsyncCallTracker, Debugger, Inline=FastReturn]
void didFireTimer(const InspectorInstrumentationCookie&);
- [Timeline, Inline=FastReturn]
- void didInvalidateLayout([Keep] LocalFrame*);
-
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willLayout([Keep] LocalFrame*);
-
- [Timeline, Page, Inline=FastReturn]
- void didLayout(const InspectorInstrumentationCookie&, RenderObject* root);
+ [Page, Inline=FastReturn]
+ void didLayout(LocalFrame*);
[Page, Inline=FastReturn]
- void didScroll(Page*);
+ void didScroll(LocalFrame*);
[Page, Inline=FastReturn]
- void didResizeMainFrame(Page*);
+ void didResizeMainFrame(LocalFrame*);
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willDispatchXHRLoadEvent([Keep] ExecutionContext*, XMLHttpRequest*);
-
- [Timeline, Inline=FastReturn]
- void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
-
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didDispatchXHRLoadendEvent(ExecutionContext*, XMLHttpRequest*);
- [Timeline, Inline=FastReturn]
- void willScrollLayer([Keep] RenderObject*);
+ [LayerTree, Inline=FastReturn]
+ void didPaint([Keep] LayoutObject*, const GraphicsLayer*, GraphicsContext*, const LayoutRect&);
- [Timeline, Inline=FastReturn]
- void didScrollLayer(RenderObject*);
-
- [Timeline, Inline=FastReturn]
- void willPaint([Keep] RenderObject*, const GraphicsLayer*);
-
- [Timeline, Page, LayerTree, Inline=FastReturn]
- void didPaint([Keep] RenderObject*, const GraphicsLayer*, GraphicsContext*, const LayoutRect&);
-
- [Timeline, Inline=FastReturn]
- void willPaintImage([Keep] RenderImage*);
-
- [Timeline, Inline=FastReturn]
- void didPaintImage(RenderImage*);
-
- [Resource, Timeline, Inline=FastReturn]
+ [Resource, Inline=FastReturn]
InspectorInstrumentationCookie willRecalculateStyle([Keep] Document*);
- [Timeline, Resource, Page, Inline=FastReturn]
+ [Resource, Inline=FastReturn]
void didRecalculateStyle(const InspectorInstrumentationCookie&, int elementCount);
- [Timeline, Resource, Inline=FastReturn]
+ [Resource, Inline=FastReturn]
void didScheduleStyleRecalculation([Keep] Document*);
[Resource, Inline=FastReturn]
void applyUserAgentOverride(LocalFrame*, String* userAgent);
- [Page, Inline=FastReturn]
- bool applyViewportStyleOverride(Document*, StyleResolver*);
-
- [Page, Inline=FastReturn]
- void applyEmulatedMedia(LocalFrame*, String* media);
-
- [Timeline, Resource]
+ [Resource]
void willSendRequest(LocalFrame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&);
[Resource]
- void markResourceAsCached(Page*, unsigned long identifier);
+ void markResourceAsCached(LocalFrame*, unsigned long identifier);
- [Timeline, Resource]
+ [Resource]
void didReceiveResourceResponse([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
[Inline=Forward]
@@ -295,29 +239,38 @@
[Inline=Forward]
void continueWithPolicyIgnore(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
- [Timeline, Resource, Inline=FastReturn]
+ [Resource, Inline=FastReturn]
void didReceiveData([Keep] LocalFrame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
- [Timeline, Resource]
- void didFinishLoading(LocalFrame* frame, unsigned long identifier, DocumentLoader*, double finishTime, int64_t encodedDataLength);
+ [Resource]
+ void didFinishLoading(LocalFrame* frame, unsigned long identifier, double finishTime, int64_t encodedDataLength);
[Resource]
void didReceiveCORSRedirectResponse([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
- [Timeline, Resource, Console] // Console should come AFTER Resource notification, front-end relies on this.
+ [Resource]
void didFailLoading(LocalFrame* frame, unsigned long identifier, const ResourceError&);
[Resource]
void documentThreadableLoaderStartedLoadingForClient(ExecutionContext*, unsigned long identifier, ThreadableLoaderClient* client);
- [Debugger, Resource]
+ [Resource]
+ void willSendEventSourceRequest(ExecutionContext*, ThreadableLoaderClient* eventSource);
+
+ [Resource]
+ void willDispachEventSourceEvent(ExecutionContext*, ThreadableLoaderClient* eventSource, const AtomicString& eventName, const AtomicString& eventId, const Vector<UChar>& data);
+
+ [Resource]
+ void didFinishEventSourceRequest(ExecutionContext*, ThreadableLoaderClient* eventSource);
+
+ [AsyncCallTracker, Resource]
void willLoadXHR(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const KURL& url, bool async, PassRefPtr<FormData>, const HTTPHeaderMap& headers, bool includeCredentials);
[Resource]
- void didFailXHRLoading(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client);
+ void didFailXHRLoading([Keep] ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const String& url);
- [Console, Resource]
- void didFinishXHRLoading(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const AtomicString& method, const String& url, const String& sendURL, unsigned sendLineNumber);
+ [Resource]
+ void didFinishXHRLoading([Keep] ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const String& url);
[Resource]
void scriptImported(ExecutionContext*, unsigned long identifier, const String& sourceString);
@@ -328,28 +281,28 @@
[Resource]
void didReceiveScriptResponse(ExecutionContext*, unsigned long identifier);
- [Timeline, Inspector, DOM, Page]
+ [PageDebugger]
+ void didStartProvisionalLoad([Keep] LocalFrame*);
+
+ [DOM, Page]
void domContentLoadedEventFired([Keep] LocalFrame*);
- [Timeline, Page]
+ [Page]
void loadEventFired([Keep] LocalFrame*);
[Page]
void frameAttachedToParent([Keep] LocalFrame*);
- [Canvas, Page]
+ [Page]
void frameDetachedFromParent([Keep] LocalFrame*);
- [Resource, DOM, Canvas, Page, PageDebugger]
+ [Resource, DOM, Page]
void didCommitLoad([Keep] LocalFrame*, DocumentLoader*);
[DOM, Inline=FastReturn]
void frameDocumentUpdated([Keep] LocalFrame*);
[Page]
- void loaderDetachedFromFrame(LocalFrame*, DocumentLoader*);
-
- [Page]
void frameStartedLoading([Keep] LocalFrame*);
[Page]
@@ -362,48 +315,36 @@
void frameClearedScheduledNavigation([Keep] LocalFrame*);
[Page, Inline=FastReturn]
- InspectorInstrumentationCookie willRunJavaScriptDialog(Page*, const String& message);
+ InspectorInstrumentationCookie willRunJavaScriptDialog(LocalFrame*, const String& message, ChromeClient::DialogType dialogType);
[Page, Inline=FastReturn]
- void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
+ void didRunJavaScriptDialog(const InspectorInstrumentationCookie&, bool result);
[Inline=Forward]
void willDestroyResource(Resource* cachedResource);
- [Timeline, Inline=FastReturn]
- InspectorInstrumentationCookie willWriteHTML([Keep] Document*, unsigned startLine);
+ [AsyncCallTracker, DOMDebugger]
+ void didRequestAnimationFrame([Keep] ExecutionContext*, int callbackId);
- [Timeline, Inline=FastReturn]
- void didWriteHTML(const InspectorInstrumentationCookie&, unsigned endLine);
+ [AsyncCallTracker, DOMDebugger]
+ void didCancelAnimationFrame([Keep] ExecutionContext*, int callbackId);
- [DOMDebugger, Debugger, Timeline]
- void didRequestAnimationFrame([Keep] Document*, int callbackId);
+ [AsyncCallTracker, DOMDebugger]
+ InspectorInstrumentationCookie willFireAnimationFrame([Keep] ExecutionContext*, int callbackId);
- [DOMDebugger, Debugger, Timeline]
- void didCancelAnimationFrame([Keep] Document*, int callbackId);
-
- [DOMDebugger, Debugger, Timeline]
- InspectorInstrumentationCookie willFireAnimationFrame([Keep] Document*, int callbackId);
-
- [Timeline, Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void didFireAnimationFrame(const InspectorInstrumentationCookie&);
- [DOMStorage, Inline=FastReturn]
- void didDispatchDOMStorageEvent(Page* page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin);
-
[Worker]
void didStartWorker(ExecutionContext*, WorkerInspectorProxy* proxy, const KURL& url);
- [Worker]
+ [Worker, PageConsole]
void workerTerminated(ExecutionContext*, WorkerInspectorProxy* proxy);
- [WorkerRuntime]
- void willEvaluateWorkerScript([Keep] WorkerGlobalScope* context, int workerThreadStartMode);
-
- [Profiler, Timeline]
+ [Profiler]
void willProcessTask(WorkerGlobalScope* context);
- [Profiler, Timeline]
+ [Profiler]
void didProcessTask(WorkerGlobalScope* context);
[Profiler]
@@ -412,16 +353,16 @@
[Profiler]
void didLeaveNestedRunLoop(WorkerGlobalScope* context);
- [Resource, Timeline]
+ [Resource]
void didCreateWebSocket([Keep] Document*, unsigned long identifier, const KURL& requestURL, const String& protocol);
- [Resource, Timeline]
+ [Resource]
void willSendWebSocketHandshakeRequest([Keep] Document*, unsigned long identifier, const WebSocketHandshakeRequest* request);
- [Resource, Timeline]
+ [Resource]
void didReceiveWebSocketHandshakeResponse([Keep] Document*, unsigned long identifier, const WebSocketHandshakeRequest* request, const WebSocketHandshakeResponse* response);
- [Resource, Timeline]
+ [Resource]
void didCloseWebSocket([Keep] Document*, unsigned long identifier);
[Resource]
@@ -434,17 +375,13 @@
void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
[ApplicationCache, Inline=FastReturn]
- void networkStateChanged(Page*, bool online);
+ void networkStateChanged([Keep] LocalFrame*, bool online);
[ApplicationCache, Inline=FastReturn]
void updateApplicationCacheStatus([Keep] LocalFrame*);
- [Timeline, Inline=FastReturn]
- void willUpdateLayerTree(LocalFrame*);
- [Timeline, LayerTree, Inline=FastReturn]
+ [LayerTree, Inline=FastReturn]
void layerTreeDidChange(LocalFrame*);
- [Timeline, Inline=FastReturn]
- void didUpdateLayerTree(LocalFrame*);
[DOM, Inline=FastReturn]
void pseudoElementCreated([Keep] PseudoElement*);
@@ -452,26 +389,29 @@
[DOM, Inline=FastReturn]
void pseudoElementDestroyed([Keep] PseudoElement*);
- [DOMDebugger, Inline=FastReturn]
- void willExecuteCustomElementCallback([Keep] Element*);
-
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
int traceAsyncOperationStarting([Keep] ExecutionContext*, const String& operationName);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
int traceAsyncOperationStarting([Keep] ExecutionContext*, const String& operationName, int prevOperationId);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void traceAsyncOperationCompleted([Keep] ExecutionContext*, int operationId);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
InspectorInstrumentationCookie traceAsyncOperationCompletedCallbackStarting([Keep] ExecutionContext*, int operationId);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
InspectorInstrumentationCookie traceAsyncCallbackStarting([Keep] ExecutionContext*, int operationId);
- [Debugger, Inline=FastReturn]
+ [AsyncCallTracker, Inline=FastReturn]
void traceAsyncCallbackCompleted(const InspectorInstrumentationCookie&);
+
+ [Animation, Inline=FastReturn]
+ void didCreateAnimation(Document*, Animation* player);
+
+ [Animation, Inline=FastReturn]
+ void didCancelAnimation(Document*, Animation* player);
}
interface InspectorConsoleInstrumentation {
@@ -480,24 +420,9 @@
class ConsoleMessage;
- [Console, Debugger]
+ [Console]
void addMessageToConsole(ExecutionContext* context, ConsoleMessage* consoleMessage);
- [Timeline]
- void consoleTime([Keep] ExecutionContext* context, const String& title);
-
- [Timeline]
- void consoleTimeEnd([Keep] ExecutionContext* context, const String& title, ScriptState* state);
-
- [Timeline, Inline=FastReturn]
- void consoleTimeStamp([Keep] ExecutionContext* context, const String& title);
-
- [Console, Inline=FastReturn]
- void consoleTimeline([Keep] ExecutionContext* context, const String& title, ScriptState* state);
-
- [Console, Inline=FastReturn]
- void consoleTimelineEnd([Keep] ExecutionContext* context, const String& title, ScriptState* state);
-
[Profiler, Inline=FastReturn]
void consoleProfile([Keep] ExecutionContext* context, const String& title);
@@ -518,15 +443,3 @@
[Resource, Inline=FastReturn]
bool shouldForceCORSPreflight(Document*);
}
-
-
-interface InspectorCanvasInstrumentation {
-
-#include "bindings/common/ScriptValue.h"
-
- [Canvas]
- ScriptValue wrapCanvas2DRenderingContextForInstrumentation(Document*, const ScriptValue&);
-
- [Canvas]
- ScriptValue wrapWebGLRenderingContextForInstrumentation(Document*, const ScriptValue&);
-}
diff --git a/core/inspector/InspectorOverlayHost.idl b/core/inspector/InspectorOverlayHost.idl
index 8fc701b..1d31eba 100644
--- a/core/inspector/InspectorOverlayHost.idl
+++ b/core/inspector/InspectorOverlayHost.idl
@@ -34,4 +34,7 @@
] interface InspectorOverlayHost {
void resume();
void stepOver();
+ void startPropertyChange(DOMString propertyName);
+ void changeProperty(float cssDelta);
+ void endPropertyChange();
};
diff --git a/core/inspector/JavaScriptCallFrame.idl b/core/inspector/JavaScriptCallFrame.idl
deleted file mode 100644
index f4482d1..0000000
--- a/core/inspector/JavaScriptCallFrame.idl
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2008 Apple 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:
- * 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 INC. ``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 INC. 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.
- */
-
-[
- WillBeGarbageCollected,
- NoInterfaceObject,
- DoNotCheckConstants
-] interface JavaScriptCallFrame {
-
- // Scope type
- const unsigned short GLOBAL_SCOPE = 0;
- const unsigned short LOCAL_SCOPE = 1;
- const unsigned short WITH_SCOPE = 2;
- const unsigned short CLOSURE_SCOPE = 3;
- const unsigned short CATCH_SCOPE = 4;
-
- [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, [TreatUndefinedAs=NullString, Default=Undefined] optional DOMString? variableName, [Default=Undefined] optional any newValue);
-
- readonly attribute JavaScriptCallFrame caller;
- readonly attribute long sourceID;
- readonly attribute long line;
- readonly attribute long column;
- [Custom=Getter] readonly attribute object scopeChain;
- [Custom] unsigned short scopeType(long scopeIndex);
- [Custom=Getter] readonly attribute object thisObject;
- readonly attribute DOMString stepInPositions;
- readonly attribute DOMString functionName;
- [Custom=Getter] readonly attribute DOMString type;
- readonly attribute boolean isAtReturn;
- [Custom=Getter] readonly attribute any returnValue;
-};
diff --git a/core/inspector/inline-javascript-imports.py b/core/inspector/inline-javascript-imports.py
deleted file mode 100755
index e0a194f..0000000
--- a/core/inspector/inline-javascript-imports.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011 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.
-#
-
-# This script replaces calls to importScripts with script sources
-# in input script file and dumps result into output script file.
-
-from cStringIO import StringIO
-
-import os.path
-import re
-import sys
-
-
-def main(argv):
-
- if len(argv) < 3:
- print('usage: %s inputFile importsDir outputFile' % argv[0])
- return 1
-
- inputFileName = argv[1]
- importsDir = argv[2]
- outputFileName = argv[3]
-
- inputFile = open(inputFileName, 'r')
- inputScript = inputFile.read()
- inputFile.close()
-
- def replace(match):
- importFileName = match.group(1)
- fullPath = os.path.join(importsDir, importFileName)
- if not os.access(fullPath, os.F_OK):
- raise Exception('File %s referenced in %s not found on any source paths, '
- 'check source tree for consistency' %
- (importFileName, inputFileName))
- importFile = open(fullPath, 'r')
- importScript = importFile.read()
- importFile.close()
- return importScript
-
- outputScript = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, inputScript)
-
- outputFile = open(outputFileName, 'w')
- outputFile.write(outputScript)
- outputFile.close()
-
- # Touch output file directory to make sure that Xcode will copy
- # modified resource files.
- if sys.platform == 'darwin':
- outputDirName = os.path.dirname(outputFileName)
- os.utime(outputDirName, None)
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/core/loader/appcache/ApplicationCache.idl b/core/loader/appcache/ApplicationCache.idl
index 7f8e07c..de2ca5f 100644
--- a/core/loader/appcache/ApplicationCache.idl
+++ b/core/loader/appcache/ApplicationCache.idl
@@ -23,9 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#application-cache-api
+
[
DoNotCheckConstants,
- WillBeGarbageCollected,
+ GarbageCollected,
+ // TODO(philipj): Exposed=(Window,SharedWorker)
] interface ApplicationCache : EventTarget {
// update status
const unsigned short UNCACHED = 0;
@@ -36,9 +39,10 @@
const unsigned short OBSOLETE = 5;
readonly attribute unsigned short status;
+ // updates
[RaisesException] void update();
- [RaisesException] void swapCache();
void abort();
+ [RaisesException] void swapCache();
// events
attribute EventHandler onchecking;
@@ -50,4 +54,3 @@
attribute EventHandler oncached;
attribute EventHandler onobsolete;
};
-
diff --git a/core/page/EventSource.idl b/core/page/EventSource.idl
index d96ca6d..cabfc5c 100644
--- a/core/page/EventSource.idl
+++ b/core/page/EventSource.idl
@@ -29,16 +29,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface
+
[
- WillBeGarbageCollected,
ActiveDOMObject,
- Constructor(DOMString url, optional EventSourceInit eventSourceInit),
+ Constructor(DOMString url, optional EventSourceInit eventSourceInitDict),
ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker),
+ GarbageCollected,
RaisesException=Constructor,
] interface EventSource : EventTarget {
-
- [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/page/EventSourceInit.idl b/core/page/EventSourceInit.idl
index 39c9157..f4594e8 100644
--- a/core/page/EventSourceInit.idl
+++ b/core/page/EventSourceInit.idl
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- GarbageCollected
-] dictionary EventSourceInit {
+// https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface
+
+dictionary EventSourceInit {
boolean withCredentials = false;
};
diff --git a/core/page/PagePopupController.idl b/core/page/PagePopupController.idl
index 6d36d2b..28051d0 100644
--- a/core/page/PagePopupController.idl
+++ b/core/page/PagePopupController.idl
@@ -36,9 +36,14 @@
void setValueAndClosePopup(long numberValue, DOMString stringValue);
void setValue(DOMString value);
void closePopup();
+ void selectFontsFromOwnerDocument(Document targetDocument);
DOMString localizeNumberString(DOMString numberString);
DOMString formatMonth(long year, long zeroBaseMonth);
DOMString formatShortMonth(long year, long zeroBaseMonth);
DOMString formatWeek(long year, long weekNumber, DOMString localizedStartDate);
void histogramEnumeration(DOMString name, long sample, long boundaryValue);
+ // window.resizeTo/moveTo are not suitable because LocalDOMWindow adjusts
+ // rectangle to fit in the current screen. Popups sometimes need to be
+ // positioned on other screens.
+ void setWindowRect(long x, long y,long width, long height);
};
diff --git a/core/page/WindowPagePopup.idl b/core/page/WindowPagePopup.idl
deleted file mode 100644
index 0b81785..0000000
--- a/core/page/WindowPagePopup.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- */
-
-[
- ImplementedAs=DOMWindowPagePopup,
- PerContextEnabled=PagePopup,
- RuntimeEnabled=PagePopup,
-] partial interface Window {
- readonly attribute PagePopupController pagePopupController;
-};
diff --git a/core/page/scrolling/ScrollState.idl b/core/page/scrolling/ScrollState.idl
new file mode 100644
index 0000000..2c7dcba
--- /dev/null
+++ b/core/page/scrolling/ScrollState.idl
@@ -0,0 +1,32 @@
+// Copyright 2015 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://dev.w3.org/houdini/css-scroll-api/
+
+[
+ Constructor(optional double deltaX = 0,
+ optional double deltaY = 0,
+ optional double deltaGranularity = 0,
+ optional double velocityX = 0,
+ optional double velocityY = 0,
+ optional boolean inInertialPhase = false,
+ optional boolean isBeginning = false,
+ optional boolean isEnding = false),
+ WillBeGarbageCollected,
+ RuntimeEnabled=ScrollCustomization
+] interface ScrollState {
+ readonly attribute double deltaX;
+ readonly attribute double deltaY;
+ readonly attribute double deltaGranularity;
+ readonly attribute double velocityX;
+ readonly attribute double velocityY;
+ readonly attribute boolean inInertialPhase;
+ readonly attribute boolean isEnding;
+ readonly attribute boolean isBeginning;
+ readonly attribute boolean fromUserInput;
+ readonly attribute boolean shouldPropagate;
+
+ [RaisesException] void consumeDelta(double x, double y);
+ // FIXME: implement distributeToScrollChainDescendent.
+};
diff --git a/core/streams/ReadableByteStream.idl b/core/streams/ReadableByteStream.idl
new file mode 100644
index 0000000..d881c27
--- /dev/null
+++ b/core/streams/ReadableByteStream.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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,
+ Exposed=(Window,Worker),
+] interface ReadableByteStream {
+ [CallWith=ExecutionContext, RaisesException, ImplementedAs=getBytesReader] ReadableByteStreamReader getReader();
+ [CallWith=ScriptState] Promise<void> cancel(optional any reason);
+};
diff --git a/core/streams/ReadableByteStreamReader.idl b/core/streams/ReadableByteStreamReader.idl
new file mode 100644
index 0000000..c7c1996
--- /dev/null
+++ b/core/streams/ReadableByteStreamReader.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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,
+ // We don't expose the interface now, because the name is not stable
+ // enough. We will expose it in the future.
+ NoInterfaceObject,
+] interface ReadableByteStreamReader {
+ [CallWith=ScriptState] readonly attribute Promise<void> closed;
+ [CallWith=ScriptState] Promise<any> read();
+
+ [CallWith=ScriptState] Promise<void> cancel(optional any reason);
+ [RaisesException] void releaseLock();
+};
diff --git a/core/streams/ReadableStream.idl b/core/streams/ReadableStream.idl
index 9d299d2..33fbddc 100644
--- a/core/streams/ReadableStream.idl
+++ b/core/streams/ReadableStream.idl
@@ -2,22 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-enum ReadableStreamState {
- "readable",
- "waiting",
- "closed",
- "errored"
-};
-
[
- RuntimeEnabled=Stream,
- GarbageCollected
+ GarbageCollected,
+ Exposed=(Window,Worker),
] interface ReadableStream {
- [CallWith=ScriptState, RaisesException] any read();
- [CallWith=ScriptState] Promise wait();
- [ImplementedAs=stateString] readonly attribute ReadableStreamState state;
-
- [CallWith=ScriptState] Promise cancel(any reason);
-
- [CallWith=ScriptState] readonly attribute Promise closed;
+ [CallWith=ExecutionContext, RaisesException] ReadableStreamReader getReader();
+ [CallWith=ScriptState] Promise<void> cancel(optional any reason);
};
diff --git a/core/streams/ReadableStreamReader.idl b/core/streams/ReadableStreamReader.idl
new file mode 100644
index 0000000..6603a3f
--- /dev/null
+++ b/core/streams/ReadableStreamReader.idl
@@ -0,0 +1,18 @@
+// Copyright 2015 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,
+ ActiveDOMObject,
+ Exposed=(Window,Worker),
+ NoInterfaceObject,
+] interface ReadableStreamReader {
+ // FIXME: Add constructor.
+
+ [CallWith=ScriptState] readonly attribute Promise<void> closed;
+ [CallWith=ScriptState] Promise<any> read();
+
+ [CallWith=ScriptState] Promise<void> cancel(optional any reason);
+ [RaisesException] void releaseLock();
+};
diff --git a/core/streams/Stream.idl b/core/streams/Stream.idl
index 11f03fd..875d17f 100644
--- a/core/streams/Stream.idl
+++ b/core/streams/Stream.idl
@@ -37,9 +37,9 @@
// FIXME: Make the Blob a subclass of the Stream.
[
- RuntimeEnabled=Stream,
+ RuntimeEnabled=ExperimentalStream,
ActiveDOMObject,
- WillBeGarbageCollected
+ GarbageCollected
] interface Stream {
readonly attribute DOMString type;
};
diff --git a/core/svg/SVGAElement.idl b/core/svg/SVGAElement.idl
index 8f0288e..2b678ad 100644
--- a/core/svg/SVGAElement.idl
+++ b/core/svg/SVGAElement.idl
@@ -23,9 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/linking.html#InterfaceSVGAElement
+
interface SVGAElement : SVGGraphicsElement {
- [ImplementedAs=svgTarget] readonly attribute SVGAnimatedString target;
+ [ImplementedAs=svgTarget, RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString target;
};
SVGAElement implements SVGURIReference;
-
diff --git a/core/svg/SVGAltGlyphDefElement.idl b/core/svg/SVGAltGlyphDefElement.idl
deleted file mode 100644
index 72721fa..0000000
--- a/core/svg/SVGAltGlyphDefElement.idl
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2011 Leo Yang <leoyang@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[Conditional=SVG_FONTS] interface SVGAltGlyphDefElement : SVGElement {
-};
-
diff --git a/core/svg/SVGAltGlyphElement.idl b/core/svg/SVGAltGlyphElement.idl
deleted file mode 100644
index e3f9915..0000000
--- a/core/svg/SVGAltGlyphElement.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2008 Apple 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:
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGAltGlyphElement : SVGTextPositioningElement {
- [RaisesException=Setter] attribute DOMString glyphRef;
- [RaisesException=Setter] attribute DOMString format;
-};
-
-SVGAltGlyphElement implements SVGURIReference;
-
diff --git a/core/svg/SVGAltGlyphItemElement.idl b/core/svg/SVGAltGlyphItemElement.idl
deleted file mode 100644
index 2b62708..0000000
--- a/core/svg/SVGAltGlyphItemElement.idl
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2011 Leo Yang <leoyang@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[Conditional=SVG_FONTS] interface SVGAltGlyphItemElement : SVGElement {
-};
-
diff --git a/core/svg/SVGAngle.idl b/core/svg/SVGAngle.idl
index cc9a8bc..4c02f71 100644
--- a/core/svg/SVGAngle.idl
+++ b/core/svg/SVGAngle.idl
@@ -20,10 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAngle
+
+// TODO(philipj): SVGAngle should have constructors. crbug.com/366541
[
ImplementedAs=SVGAngleTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGAngle {
// Angle Unit Types
const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
@@ -35,11 +39,9 @@
readonly attribute unsigned short unitType;
[RaisesException=Setter] attribute float value;
[RaisesException=Setter] attribute float valueInSpecifiedUnits;
-
+ // TODO(philipj): valueAsString should not have [TreatNullAs=NullString].
[TreatNullAs=NullString, RaisesException=Setter] attribute DOMString valueAsString;
[RaisesException] void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
-
[RaisesException] void convertToSpecifiedUnits(unsigned short unitType);
};
-
diff --git a/core/svg/SVGAnimateElement.idl b/core/svg/SVGAnimateElement.idl
index 9ee19c8..01eea93 100644
--- a/core/svg/SVGAnimateElement.idl
+++ b/core/svg/SVGAnimateElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimateElement
+
interface SVGAnimateElement : SVGAnimationElement {
};
-
diff --git a/core/svg/SVGAnimateMotionElement.idl b/core/svg/SVGAnimateMotionElement.idl
index f153f19..bba3d50 100644
--- a/core/svg/SVGAnimateMotionElement.idl
+++ b/core/svg/SVGAnimateMotionElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimateMotionElement
+
interface SVGAnimateMotionElement : SVGAnimationElement {
};
-
diff --git a/core/svg/SVGAnimateTransformElement.idl b/core/svg/SVGAnimateTransformElement.idl
index a7364e9..0d98368 100644
--- a/core/svg/SVGAnimateTransformElement.idl
+++ b/core/svg/SVGAnimateTransformElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimateTransformElement
+
interface SVGAnimateTransformElement : SVGAnimationElement {
};
-
diff --git a/core/svg/SVGAnimatedAngle.idl b/core/svg/SVGAnimatedAngle.idl
index ae8022d..2f17812 100644
--- a/core/svg/SVGAnimatedAngle.idl
+++ b/core/svg/SVGAnimatedAngle.idl
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedAngle
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedAngle {
readonly attribute SVGAngle baseVal;
readonly attribute SVGAngle animVal;
diff --git a/core/svg/SVGAnimatedBoolean.idl b/core/svg/SVGAnimatedBoolean.idl
index 453172a..3134c8d 100644
--- a/core/svg/SVGAnimatedBoolean.idl
+++ b/core/svg/SVGAnimatedBoolean.idl
@@ -23,10 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedBoolean
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedBoolean {
[RaisesException=Setter] attribute boolean baseVal;
readonly attribute boolean animVal;
diff --git a/core/svg/SVGAnimatedEnumeration.idl b/core/svg/SVGAnimatedEnumeration.idl
index f67a59f..e610e6d 100644
--- a/core/svg/SVGAnimatedEnumeration.idl
+++ b/core/svg/SVGAnimatedEnumeration.idl
@@ -23,11 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedEnumeration
+
[
ImplementedAs=SVGAnimatedEnumerationBase,
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] 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 143c8e3..1f8dfc8 100644
--- a/core/svg/SVGAnimatedInteger.idl
+++ b/core/svg/SVGAnimatedInteger.idl
@@ -23,10 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedInteger
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedInteger {
[RaisesException=Setter] attribute long baseVal;
readonly attribute long animVal;
diff --git a/core/svg/SVGAnimatedLength.idl b/core/svg/SVGAnimatedLength.idl
index 76117af..b46026e 100644
--- a/core/svg/SVGAnimatedLength.idl
+++ b/core/svg/SVGAnimatedLength.idl
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedLength
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedLength {
readonly attribute SVGLength baseVal;
readonly attribute SVGLength animVal;
diff --git a/core/svg/SVGAnimatedLengthList.idl b/core/svg/SVGAnimatedLengthList.idl
index b7ed587..d96c3ec 100644
--- a/core/svg/SVGAnimatedLengthList.idl
+++ b/core/svg/SVGAnimatedLengthList.idl
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedLengthList
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedLengthList {
readonly attribute SVGLengthList baseVal;
readonly attribute SVGLengthList animVal;
diff --git a/core/svg/SVGAnimatedNumber.idl b/core/svg/SVGAnimatedNumber.idl
index 2468fac..87fd762 100644
--- a/core/svg/SVGAnimatedNumber.idl
+++ b/core/svg/SVGAnimatedNumber.idl
@@ -24,10 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedNumber
+
[
- NotScriptWrappable,
+ MeasureAs=SVG1DOM,
+ RuntimeEnabled=SVG1DOM,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGAnimatedNumber {
[RaisesException=Setter] attribute float baseVal;
readonly attribute float animVal;
diff --git a/core/svg/SVGAnimatedNumberList.idl b/core/svg/SVGAnimatedNumberList.idl
index cb3210a..5e73f09 100644
--- a/core/svg/SVGAnimatedNumberList.idl
+++ b/core/svg/SVGAnimatedNumberList.idl
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedNumberList
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedNumberList {
readonly attribute SVGNumberList baseVal;
readonly attribute SVGNumberList animVal;
diff --git a/core/svg/SVGAnimatedPreserveAspectRatio.idl b/core/svg/SVGAnimatedPreserveAspectRatio.idl
index c2eb443..3f1528c 100644
--- a/core/svg/SVGAnimatedPreserveAspectRatio.idl
+++ b/core/svg/SVGAnimatedPreserveAspectRatio.idl
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGAnimatedPreserveAspectRatio
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedPreserveAspectRatio {
readonly attribute SVGPreserveAspectRatio baseVal;
readonly attribute SVGPreserveAspectRatio animVal;
diff --git a/core/svg/SVGAnimatedRect.idl b/core/svg/SVGAnimatedRect.idl
index 4802de5..aa1a597 100644
--- a/core/svg/SVGAnimatedRect.idl
+++ b/core/svg/SVGAnimatedRect.idl
@@ -23,10 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedRect
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedRect {
+ // TODO(philipj): SVGRect should be DOMRectReadOnly.
readonly attribute SVGRect baseVal;
readonly attribute SVGRect animVal;
};
diff --git a/core/svg/SVGAnimatedString.idl b/core/svg/SVGAnimatedString.idl
index b4e6361..5f4a067 100644
--- a/core/svg/SVGAnimatedString.idl
+++ b/core/svg/SVGAnimatedString.idl
@@ -23,9 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedString
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedString {
[RaisesException=Setter] attribute DOMString baseVal;
readonly attribute DOMString animVal;
diff --git a/core/svg/SVGAnimatedTransformList.idl b/core/svg/SVGAnimatedTransformList.idl
index 024a4fc..54937fa 100644
--- a/core/svg/SVGAnimatedTransformList.idl
+++ b/core/svg/SVGAnimatedTransformList.idl
@@ -23,10 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGAnimatedTransformList
+
[
- NotScriptWrappable,
SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGAnimatedTransformList {
- readonly attribute SVGTransformList baseVal;
+ [MeasureAs=SVGAnimatedTransformListBaseVal] readonly attribute SVGTransformList baseVal;
readonly attribute SVGTransformList animVal;
};
diff --git a/core/svg/SVGAnimationElement.idl b/core/svg/SVGAnimationElement.idl
index deb09d7..c77cbfb 100644
--- a/core/svg/SVGAnimationElement.idl
+++ b/core/svg/SVGAnimationElement.idl
@@ -33,15 +33,14 @@
attribute EventHandler onend;
attribute EventHandler onrepeat;
- float getStartTime();
+ [RaisesException] float getStartTime();
float getCurrentTime();
- float getSimpleDuration();
+ [RaisesException] float getSimpleDuration();
void beginElement();
void beginElementAt(float offset);
void endElement();
void endElementAt(float offset);
-
};
SVGAnimationElement implements SVGTests;
diff --git a/core/svg/SVGCircleElement.idl b/core/svg/SVGCircleElement.idl
index 19630dd..0479e26 100644
--- a/core/svg/SVGCircleElement.idl
+++ b/core/svg/SVGCircleElement.idl
@@ -24,9 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGCircleElement : SVGGeometryElement {
- readonly attribute SVGAnimatedLength cx;
- readonly attribute SVGAnimatedLength cy;
- readonly attribute SVGAnimatedLength r;
-};
+// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGCircleElement
+interface SVGCircleElement : SVGGeometryElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength cx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength cy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength r;
+};
diff --git a/core/svg/SVGClipPathElement.idl b/core/svg/SVGClipPathElement.idl
index 4bb7cf1..7afeec1 100644
--- a/core/svg/SVGClipPathElement.idl
+++ b/core/svg/SVGClipPathElement.idl
@@ -24,6 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/css-masking/#InterfaceSVGClipPathElement
+
+// TODO(philipj): SVGClipPathElement should inherit from SVGElement and
+// implement SVGUnitTypes. The transform attribute (which is on
+// SVGGraphicsElement) should also be on SVGClipPathElement.
interface SVGClipPathElement : SVGGraphicsElement {
- readonly attribute SVGAnimatedEnumeration clipPathUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration clipPathUnits;
};
diff --git a/core/svg/SVGComponentTransferFunctionElement.idl b/core/svg/SVGComponentTransferFunctionElement.idl
index 1e42835..d4a34b8 100644
--- a/core/svg/SVGComponentTransferFunctionElement.idl
+++ b/core/svg/SVGComponentTransferFunctionElement.idl
@@ -23,23 +23,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGComponentTransferFunctionElement
+
[
DoNotCheckConstants
] interface SVGComponentTransferFunctionElement : SVGElement {
// Component Transfer Types
- const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
- const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
- const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
- const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
- const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
- const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
- readonly attribute SVGAnimatedEnumeration type;
- readonly attribute SVGAnimatedNumberList tableValues;
- readonly attribute SVGAnimatedNumber slope;
- readonly attribute SVGAnimatedNumber intercept;
- readonly attribute SVGAnimatedNumber amplitude;
- readonly attribute SVGAnimatedNumber exponent;
- readonly attribute SVGAnimatedNumber offset;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration type;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumberList tableValues;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber slope;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber intercept;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber amplitude;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber exponent;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber offset;
};
-
diff --git a/core/svg/SVGCursorElement.idl b/core/svg/SVGCursorElement.idl
index 627bf19..56a83ec 100644
--- a/core/svg/SVGCursorElement.idl
+++ b/core/svg/SVGCursorElement.idl
@@ -23,13 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG11/interact.html#InterfaceSVGCursorElement
// http://www.w3.org/TR/SVG2/interact.html#InterfaceSVGCursorElement
interface SVGCursorElement : SVGElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
};
SVGCursorElement implements SVGURIReference;
-SVGCursorElement implements SVGTests; // in SVG 1.1 but not SVG 2
+
+// TODO(philipj): The following was part of SVG 1.1:
+// http://www.w3.org/TR/SVG11/interact.html#InterfaceSVGCursorElement
+SVGCursorElement implements SVGTests;
diff --git a/core/svg/SVGDefsElement.idl b/core/svg/SVGDefsElement.idl
index 807db63..43fe927 100644
--- a/core/svg/SVGDefsElement.idl
+++ b/core/svg/SVGDefsElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGDefsElement
+
interface SVGDefsElement : SVGGraphicsElement {
};
-
diff --git a/core/svg/SVGDescElement.idl b/core/svg/SVGDescElement.idl
index 701fbe3..6ee5bed 100644
--- a/core/svg/SVGDescElement.idl
+++ b/core/svg/SVGDescElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGDescElement
+
interface SVGDescElement : SVGElement {
};
-
diff --git a/core/svg/SVGDiscardElement.idl b/core/svg/SVGDiscardElement.idl
index 54ee14a..2b51023 100644
--- a/core/svg/SVGDiscardElement.idl
+++ b/core/svg/SVGDiscardElement.idl
@@ -28,5 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(philipj): The SVGDiscardElement interface does not exist in the spec
+// yet: http://www.w3.org/Graphics/SVG/WG/track/actions/3727
+
interface SVGDiscardElement : SVGElement {
};
diff --git a/core/svg/SVGDocument.idl b/core/svg/SVGDocument.idl
index a57cb2e..8ba643a 100644
--- a/core/svg/SVGDocument.idl
+++ b/core/svg/SVGDocument.idl
@@ -19,9 +19,10 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGDocument
+
[
ImplementedAs=SVGDocumentExtensions
] partial interface Document {
- [MeasureAs=SVGDocumentRootElement] readonly attribute SVGSVGElement rootElement;
+ [MeasureAs=SVGDocumentRootElement] readonly attribute SVGSVGElement rootElement;
};
-
diff --git a/core/svg/SVGElement.idl b/core/svg/SVGElement.idl
index 4ee3be5..1e4ac18 100644
--- a/core/svg/SVGElement.idl
+++ b/core/svg/SVGElement.idl
@@ -20,22 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
-[
- Custom=Wrap,
-] interface SVGElement : Element {
- [Reflect] attribute DOMString xmlbase;
- readonly attribute SVGSVGElement? ownerSVGElement;
- readonly attribute SVGElement? viewportElement;
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement
- [Reflect] attribute DOMString xmllang;
- [Reflect] attribute DOMString xmlspace;
-
- [MeasureAs=SVGClassName] readonly attribute SVGAnimatedString className;
-
+interface SVGElement : Element {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGClassName] readonly attribute SVGAnimatedString className;
readonly attribute CSSStyleDeclaration style;
+ readonly attribute SVGSVGElement? ownerSVGElement;
+ readonly attribute SVGElement? viewportElement;
[CustomElementCallbacks] attribute long tabIndex;
+ void focus();
+ void blur();
};
SVGElement implements GlobalEventHandlers;
-
diff --git a/core/svg/SVGEllipseElement.idl b/core/svg/SVGEllipseElement.idl
index 141ac2e..3b431db 100644
--- a/core/svg/SVGEllipseElement.idl
+++ b/core/svg/SVGEllipseElement.idl
@@ -23,10 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGEllipseElement : SVGGeometryElement {
- readonly attribute SVGAnimatedLength cx;
- readonly attribute SVGAnimatedLength cy;
- readonly attribute SVGAnimatedLength rx;
- readonly attribute SVGAnimatedLength ry;
-};
+// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGEllipseElement
+interface SVGEllipseElement : SVGGeometryElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength cx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength cy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength rx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength ry;
+};
diff --git a/core/svg/SVGFEBlendElement.idl b/core/svg/SVGFEBlendElement.idl
index 05cde55..9de8f38 100644
--- a/core/svg/SVGFEBlendElement.idl
+++ b/core/svg/SVGFEBlendElement.idl
@@ -30,16 +30,16 @@
] interface SVGFEBlendElement : SVGElement {
// Blend Mode Types
- const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
- const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
- const unsigned short SVG_FEBLEND_MODE_MULTIPLY = 2;
- const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
- const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
- const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FEBLEND_MODE_MULTIPLY = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedString in2;
- readonly attribute SVGAnimatedEnumeration mode;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration mode;
};
SVGFEBlendElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEColorMatrixElement.idl b/core/svg/SVGFEColorMatrixElement.idl
index fa9c032..bb13640 100644
--- a/core/svg/SVGFEColorMatrixElement.idl
+++ b/core/svg/SVGFEColorMatrixElement.idl
@@ -29,15 +29,15 @@
DoNotCheckConstants,
] interface SVGFEColorMatrixElement : SVGElement {
// Color Matrix Types
- const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
- const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
- const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
- const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
- const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedEnumeration type;
- readonly attribute SVGAnimatedNumberList values;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration type;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumberList values;
};
SVGFEColorMatrixElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEComponentTransferElement.idl b/core/svg/SVGFEComponentTransferElement.idl
index e8cc53e..482571e 100644
--- a/core/svg/SVGFEComponentTransferElement.idl
+++ b/core/svg/SVGFEComponentTransferElement.idl
@@ -26,7 +26,7 @@
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEComponentTransferElement
interface SVGFEComponentTransferElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
};
SVGFEComponentTransferElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFECompositeElement.idl b/core/svg/SVGFECompositeElement.idl
index 9735ce9..66ba771 100644
--- a/core/svg/SVGFECompositeElement.idl
+++ b/core/svg/SVGFECompositeElement.idl
@@ -29,21 +29,21 @@
DoNotCheckConstants,
] interface SVGFECompositeElement : SVGElement {
// Composite Operators
- const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
- const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1;
- const unsigned short SVG_FECOMPOSITE_OPERATOR_IN = 2;
- const unsigned short SVG_FECOMPOSITE_OPERATOR_OUT = 3;
- const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
- const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
- const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_IN = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_OUT = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedString in2;
- [ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
- readonly attribute SVGAnimatedNumber k1;
- readonly attribute SVGAnimatedNumber k2;
- readonly attribute SVGAnimatedNumber k3;
- readonly attribute SVGAnimatedNumber k4;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM,ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber k1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber k2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber k3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber k4;
};
SVGFECompositeElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEConvolveMatrixElement.idl b/core/svg/SVGFEConvolveMatrixElement.idl
index ea35c38..a1db16d 100644
--- a/core/svg/SVGFEConvolveMatrixElement.idl
+++ b/core/svg/SVGFEConvolveMatrixElement.idl
@@ -23,30 +23,33 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFEConvolveMatrixElement
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEConvolveMatrixElement
[
DoNotCheckConstants,
] interface SVGFEConvolveMatrixElement : SVGElement {
// Edge Mode Values
- const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
- const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
- const unsigned short SVG_EDGEMODE_WRAP = 2;
- const unsigned short SVG_EDGEMODE_NONE = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_EDGEMODE_WRAP = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_EDGEMODE_NONE = 3;
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedInteger orderX;
- readonly attribute SVGAnimatedInteger orderY;
- readonly attribute SVGAnimatedNumberList kernelMatrix;
- readonly attribute SVGAnimatedNumber divisor;
- readonly attribute SVGAnimatedNumber bias;
- readonly attribute SVGAnimatedInteger targetX;
- readonly attribute SVGAnimatedInteger targetY;
- readonly attribute SVGAnimatedEnumeration edgeMode;
- readonly attribute SVGAnimatedNumber kernelUnitLengthX;
- readonly attribute SVGAnimatedNumber kernelUnitLengthY;
- readonly attribute SVGAnimatedBoolean preserveAlpha; // in SVG 1.1, removed in SVG 2
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedInteger orderX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedInteger orderY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumberList kernelMatrix;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber divisor;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber bias;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedInteger targetX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedInteger targetY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration edgeMode;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
+
+ // TODO(philipj): The following was part of SVG 1.1:
+ // http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFEConvolveMatrixElement
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28703
+ [RuntimeEnabled=SVG1DOM, Measure] readonly attribute SVGAnimatedBoolean preserveAlpha;
};
SVGFEConvolveMatrixElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEDiffuseLightingElement.idl b/core/svg/SVGFEDiffuseLightingElement.idl
index f0e42d2..b9b35cf 100644
--- a/core/svg/SVGFEDiffuseLightingElement.idl
+++ b/core/svg/SVGFEDiffuseLightingElement.idl
@@ -26,11 +26,11 @@
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDiffuseLightingElement
interface SVGFEDiffuseLightingElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedNumber surfaceScale;
- readonly attribute SVGAnimatedNumber diffuseConstant;
- readonly attribute SVGAnimatedNumber kernelUnitLengthX;
- readonly attribute SVGAnimatedNumber kernelUnitLengthY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber surfaceScale;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber diffuseConstant;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
};
SVGFEDiffuseLightingElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEDisplacementMapElement.idl b/core/svg/SVGFEDisplacementMapElement.idl
index 25d13cc..43a50ae 100644
--- a/core/svg/SVGFEDisplacementMapElement.idl
+++ b/core/svg/SVGFEDisplacementMapElement.idl
@@ -29,17 +29,17 @@
DoNotCheckConstants,
] interface SVGFEDisplacementMapElement : SVGElement {
// Channel Selectors
- const unsigned short SVG_CHANNEL_UNKNOWN = 0;
- const unsigned short SVG_CHANNEL_R = 1;
- const unsigned short SVG_CHANNEL_G = 2;
- const unsigned short SVG_CHANNEL_B = 3;
- const unsigned short SVG_CHANNEL_A = 4;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_CHANNEL_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_CHANNEL_R = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_CHANNEL_G = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_CHANNEL_B = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_CHANNEL_A = 4;
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedString in2;
- readonly attribute SVGAnimatedNumber scale;
- readonly attribute SVGAnimatedEnumeration xChannelSelector;
- readonly attribute SVGAnimatedEnumeration yChannelSelector;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber scale;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration xChannelSelector;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration yChannelSelector;
};
SVGFEDisplacementMapElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEDistantLightElement.idl b/core/svg/SVGFEDistantLightElement.idl
index 85624d9..5ac5083 100644
--- a/core/svg/SVGFEDistantLightElement.idl
+++ b/core/svg/SVGFEDistantLightElement.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDistantLightElement
+
interface SVGFEDistantLightElement : SVGElement {
readonly attribute SVGAnimatedNumber azimuth;
readonly attribute SVGAnimatedNumber elevation;
};
-
diff --git a/core/svg/SVGFEDropShadowElement.idl b/core/svg/SVGFEDropShadowElement.idl
index 556fdaa..ea44f41 100644
--- a/core/svg/SVGFEDropShadowElement.idl
+++ b/core/svg/SVGFEDropShadowElement.idl
@@ -20,13 +20,13 @@
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDropShadowElement
interface SVGFEDropShadowElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedNumber dx;
- readonly attribute SVGAnimatedNumber dy;
- readonly attribute SVGAnimatedNumber stdDeviationX;
- readonly attribute SVGAnimatedNumber stdDeviationY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber dx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber dy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber stdDeviationX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber stdDeviationY;
- void setStdDeviation(float stdDeviationX, float stdDeviationY);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] void setStdDeviation(float stdDeviationX, float stdDeviationY);
};
SVGFEDropShadowElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEFuncAElement.idl b/core/svg/SVGFEFuncAElement.idl
index c777ee4..2a886fd 100644
--- a/core/svg/SVGFEFuncAElement.idl
+++ b/core/svg/SVGFEFuncAElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncAElement
+
interface SVGFEFuncAElement : SVGComponentTransferFunctionElement {
};
-
diff --git a/core/svg/SVGFEFuncBElement.idl b/core/svg/SVGFEFuncBElement.idl
index 0546256..0ac1240 100644
--- a/core/svg/SVGFEFuncBElement.idl
+++ b/core/svg/SVGFEFuncBElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncBElement
+
interface SVGFEFuncBElement : SVGComponentTransferFunctionElement {
};
-
diff --git a/core/svg/SVGFEFuncGElement.idl b/core/svg/SVGFEFuncGElement.idl
index d752849..7d21395 100644
--- a/core/svg/SVGFEFuncGElement.idl
+++ b/core/svg/SVGFEFuncGElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncGElement
+
interface SVGFEFuncGElement : SVGComponentTransferFunctionElement {
};
-
diff --git a/core/svg/SVGFEFuncRElement.idl b/core/svg/SVGFEFuncRElement.idl
index 4ac443a..3073190 100644
--- a/core/svg/SVGFEFuncRElement.idl
+++ b/core/svg/SVGFEFuncRElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncRElement
+
interface SVGFEFuncRElement : SVGComponentTransferFunctionElement {
};
-
diff --git a/core/svg/SVGFEGaussianBlurElement.idl b/core/svg/SVGFEGaussianBlurElement.idl
index f3a32d6..238d344 100644
--- a/core/svg/SVGFEGaussianBlurElement.idl
+++ b/core/svg/SVGFEGaussianBlurElement.idl
@@ -28,11 +28,11 @@
// Currently SVG 1.1 (SVG 2 members not implemented)
interface SVGFEGaussianBlurElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedNumber stdDeviationX;
- readonly attribute SVGAnimatedNumber stdDeviationY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber stdDeviationX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber stdDeviationY;
- void setStdDeviation(float stdDeviationX, float stdDeviationY);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] void setStdDeviation(float stdDeviationX, float stdDeviationY);
};
SVGFEGaussianBlurElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEImageElement.idl b/core/svg/SVGFEImageElement.idl
index 9f2ca38..2c4a272 100644
--- a/core/svg/SVGFEImageElement.idl
+++ b/core/svg/SVGFEImageElement.idl
@@ -28,9 +28,8 @@
// Currently SVG 1.1, SVG 2 members not implemented
interface SVGFEImageElement : SVGElement {
- readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
};
SVGFEImageElement implements SVGFilterPrimitiveStandardAttributes;
SVGFEImageElement implements SVGURIReference;
-
diff --git a/core/svg/SVGFEMergeNodeElement.idl b/core/svg/SVGFEMergeNodeElement.idl
index f01f908..9936f8d 100644
--- a/core/svg/SVGFEMergeNodeElement.idl
+++ b/core/svg/SVGFEMergeNodeElement.idl
@@ -23,7 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGFEMergeNodeElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
-};
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEMergeNodeElement
+interface SVGFEMergeNodeElement : SVGElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+};
diff --git a/core/svg/SVGFEMorphologyElement.idl b/core/svg/SVGFEMorphologyElement.idl
index 25206f4..eee1596 100644
--- a/core/svg/SVGFEMorphologyElement.idl
+++ b/core/svg/SVGFEMorphologyElement.idl
@@ -29,14 +29,14 @@
DoNotCheckConstants,
] interface SVGFEMorphologyElement : SVGElement {
// Morphology Operators
- const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
- const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
- const unsigned short SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
- readonly attribute SVGAnimatedString in1;
- [ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
- readonly attribute SVGAnimatedNumber radiusX;
- readonly attribute SVGAnimatedNumber radiusY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM,ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber radiusX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber radiusY;
};
SVGFEMorphologyElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEOffsetElement.idl b/core/svg/SVGFEOffsetElement.idl
index 38eb9c4..bf73868 100644
--- a/core/svg/SVGFEOffsetElement.idl
+++ b/core/svg/SVGFEOffsetElement.idl
@@ -26,9 +26,9 @@
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEOffsetElement
interface SVGFEOffsetElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedNumber dx;
- readonly attribute SVGAnimatedNumber dy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber dx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber dy;
};
SVGFEOffsetElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFEPointLightElement.idl b/core/svg/SVGFEPointLightElement.idl
index b85cf1d..fc732b7 100644
--- a/core/svg/SVGFEPointLightElement.idl
+++ b/core/svg/SVGFEPointLightElement.idl
@@ -23,9 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGFEPointLightElement : SVGElement {
- readonly attribute SVGAnimatedNumber x;
- readonly attribute SVGAnimatedNumber y;
- readonly attribute SVGAnimatedNumber z;
-};
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEPointLightElement
+interface SVGFEPointLightElement : SVGElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber z;
+};
diff --git a/core/svg/SVGFESpecularLightingElement.idl b/core/svg/SVGFESpecularLightingElement.idl
index 66d506e..36ec866 100644
--- a/core/svg/SVGFESpecularLightingElement.idl
+++ b/core/svg/SVGFESpecularLightingElement.idl
@@ -26,10 +26,12 @@
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFESpecularLightingElement
interface SVGFESpecularLightingElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedNumber surfaceScale;
- readonly attribute SVGAnimatedNumber specularConstant;
- readonly attribute SVGAnimatedNumber specularExponent;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber surfaceScale;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber specularConstant;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber specularExponent;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
};
SVGFESpecularLightingElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFESpotLightElement.idl b/core/svg/SVGFESpotLightElement.idl
index 0b4156e..8ebca0e 100644
--- a/core/svg/SVGFESpotLightElement.idl
+++ b/core/svg/SVGFESpotLightElement.idl
@@ -23,14 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGFESpotLightElement : SVGElement {
- readonly attribute SVGAnimatedNumber x;
- readonly attribute SVGAnimatedNumber y;
- readonly attribute SVGAnimatedNumber z;
- readonly attribute SVGAnimatedNumber pointsAtX;
- readonly attribute SVGAnimatedNumber pointsAtY;
- readonly attribute SVGAnimatedNumber pointsAtZ;
- readonly attribute SVGAnimatedNumber specularExponent;
- readonly attribute SVGAnimatedNumber limitingConeAngle;
-};
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFESpotLightElement
+interface SVGFESpotLightElement : SVGElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber z;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber pointsAtX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber pointsAtY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber pointsAtZ;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber specularExponent;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber limitingConeAngle;
+};
diff --git a/core/svg/SVGFETileElement.idl b/core/svg/SVGFETileElement.idl
index 4395de5..b6cb618 100644
--- a/core/svg/SVGFETileElement.idl
+++ b/core/svg/SVGFETileElement.idl
@@ -26,7 +26,7 @@
// http://www.w3.org/TR/filter-effects/#InterfaceSVGFETileElement
interface SVGFETileElement : SVGElement {
- readonly attribute SVGAnimatedString in1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString in1;
};
SVGFETileElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFETurbulenceElement.idl b/core/svg/SVGFETurbulenceElement.idl
index 0fceef9..bb35e24 100644
--- a/core/svg/SVGFETurbulenceElement.idl
+++ b/core/svg/SVGFETurbulenceElement.idl
@@ -29,21 +29,21 @@
DoNotCheckConstants,
] interface SVGFETurbulenceElement : SVGElement {
// Turbulence Types
- const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0;
- const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
- const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE = 2;
// Stitch Options
- const unsigned short SVG_STITCHTYPE_UNKNOWN = 0;
- const unsigned short SVG_STITCHTYPE_STITCH = 1;
- const unsigned short SVG_STITCHTYPE_NOSTITCH = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_STITCHTYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_STITCHTYPE_STITCH = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_STITCHTYPE_NOSTITCH = 2;
- readonly attribute SVGAnimatedNumber baseFrequencyX;
- readonly attribute SVGAnimatedNumber baseFrequencyY;
- readonly attribute SVGAnimatedInteger numOctaves;
- readonly attribute SVGAnimatedNumber seed;
- readonly attribute SVGAnimatedEnumeration stitchTiles;
- readonly attribute SVGAnimatedEnumeration type;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber baseFrequencyX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber baseFrequencyY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedInteger numOctaves;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber seed;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration stitchTiles;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration type;
};
SVGFETurbulenceElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/core/svg/SVGFilterElement.idl b/core/svg/SVGFilterElement.idl
index 0e6cbaf..3c990a7 100644
--- a/core/svg/SVGFilterElement.idl
+++ b/core/svg/SVGFilterElement.idl
@@ -24,21 +24,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/filter-effects/#InterfaceSVGFilterElement
+
[
TypeChecking=Interface,
] interface SVGFilterElement : SVGElement {
- readonly attribute SVGAnimatedEnumeration filterUnits;
- readonly attribute SVGAnimatedEnumeration primitiveUnits;
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
- readonly attribute SVGAnimatedInteger filterResX;
- readonly attribute SVGAnimatedInteger filterResY;
-
- void setFilterRes(unsigned long filterResX,
- unsigned long filterResY);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration filterUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration primitiveUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
};
SVGFilterElement implements SVGURIReference;
-
+// SVGFilterElement implements SVGUnitTypes;
diff --git a/core/svg/SVGFilterPrimitiveStandardAttributes.idl b/core/svg/SVGFilterPrimitiveStandardAttributes.idl
index aba43fc..c12ffd5 100644
--- a/core/svg/SVGFilterPrimitiveStandardAttributes.idl
+++ b/core/svg/SVGFilterPrimitiveStandardAttributes.idl
@@ -29,9 +29,9 @@
[
NoInterfaceObject, // Always used on target of 'implements'
] interface SVGFilterPrimitiveStandardAttributes {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
- readonly attribute SVGAnimatedString result;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString result;
};
diff --git a/core/svg/SVGFitToViewBox.idl b/core/svg/SVGFitToViewBox.idl
index f61e5ea..cab50c5 100644
--- a/core/svg/SVGFitToViewBox.idl
+++ b/core/svg/SVGFitToViewBox.idl
@@ -29,6 +29,6 @@
[
NoInterfaceObject, // Always used on target of 'implements'
] interface SVGFitToViewBox {
- readonly attribute SVGAnimatedRect viewBox;
- readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedRect viewBox;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
};
diff --git a/core/svg/SVGFontElement.idl b/core/svg/SVGFontElement.idl
deleted file mode 100644
index 1d7b8aa..0000000
--- a/core/svg/SVGFontElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGFontElement : SVGElement {
-};
-
diff --git a/core/svg/SVGFontFaceElement.idl b/core/svg/SVGFontFaceElement.idl
deleted file mode 100644
index 3cb7b69..0000000
--- a/core/svg/SVGFontFaceElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGFontFaceElement : SVGElement {
-};
-
diff --git a/core/svg/SVGFontFaceFormatElement.idl b/core/svg/SVGFontFaceFormatElement.idl
deleted file mode 100644
index f2165be..0000000
--- a/core/svg/SVGFontFaceFormatElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGFontFaceFormatElement : SVGElement {
-};
-
diff --git a/core/svg/SVGFontFaceNameElement.idl b/core/svg/SVGFontFaceNameElement.idl
deleted file mode 100644
index 3729f2a..0000000
--- a/core/svg/SVGFontFaceNameElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGFontFaceNameElement : SVGElement {
-};
-
diff --git a/core/svg/SVGFontFaceSrcElement.idl b/core/svg/SVGFontFaceSrcElement.idl
deleted file mode 100644
index 154473f..0000000
--- a/core/svg/SVGFontFaceSrcElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGFontFaceSrcElement : SVGElement {
-};
-
diff --git a/core/svg/SVGFontFaceUriElement.idl b/core/svg/SVGFontFaceUriElement.idl
deleted file mode 100644
index bcbcb43..0000000
--- a/core/svg/SVGFontFaceUriElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGFontFaceUriElement : SVGElement {
-};
-
diff --git a/core/svg/SVGForeignObjectElement.idl b/core/svg/SVGForeignObjectElement.idl
index 3d348ff..bedb3bc 100644
--- a/core/svg/SVGForeignObjectElement.idl
+++ b/core/svg/SVGForeignObjectElement.idl
@@ -23,10 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGForeignObjectElement : SVGGraphicsElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
-};
+// http://www.w3.org/TR/SVG2/extend.html#InterfaceSVGForeignObjectElement
+interface SVGForeignObjectElement : SVGGraphicsElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
+};
diff --git a/core/svg/SVGGElement.idl b/core/svg/SVGGElement.idl
index 38a1146..97bb0a5 100644
--- a/core/svg/SVGGElement.idl
+++ b/core/svg/SVGGElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGGElement
+
interface SVGGElement : SVGGraphicsElement {
};
-
diff --git a/core/svg/SVGGeometryElement.idl b/core/svg/SVGGeometryElement.idl
index 932b948..50bc507 100644
--- a/core/svg/SVGGeometryElement.idl
+++ b/core/svg/SVGGeometryElement.idl
@@ -28,9 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGGeometryElement
+
[
TypeChecking=Interface,
] interface SVGGeometryElement : SVGGraphicsElement {
+ // TODO(philipj): SVGPoint should be DOMPoint.
boolean isPointInFill(SVGPoint point);
boolean isPointInStroke(SVGPoint point);
};
diff --git a/core/svg/SVGGlyphElement.idl b/core/svg/SVGGlyphElement.idl
deleted file mode 100644
index 1501130..0000000
--- a/core/svg/SVGGlyphElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGGlyphElement : SVGElement {
-};
-
diff --git a/core/svg/SVGGlyphRefElement.idl b/core/svg/SVGGlyphRefElement.idl
deleted file mode 100644
index 76a4e4a..0000000
--- a/core/svg/SVGGlyphRefElement.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011 Leo Yang <leoyang@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGGlyphRefElement : SVGElement {
- // FIXME: Use [Reflect] after https://bugs.webkit.org/show_bug.cgi?id=64843 is fixed.
- attribute DOMString glyphRef;
- [Reflect, TreatNullAs=NullString] attribute DOMString format;
- attribute float x;
- attribute float y;
- attribute float dx;
- attribute float dy;
-};
-
-SVGGlyphRefElement implements SVGURIReference;
-
diff --git a/core/svg/SVGGradientElement.idl b/core/svg/SVGGradientElement.idl
index ff2e048..1010481 100644
--- a/core/svg/SVGGradientElement.idl
+++ b/core/svg/SVGGradientElement.idl
@@ -23,19 +23,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGGradientElement
+
[
DoNotCheckConstants
] interface SVGGradientElement : SVGElement {
// Spread Method Types
- const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
- const unsigned short SVG_SPREADMETHOD_PAD = 1;
- const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
- const unsigned short SVG_SPREADMETHOD_REPEAT = 3;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_SPREADMETHOD_PAD = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_SPREADMETHOD_REPEAT = 3;
- readonly attribute SVGAnimatedEnumeration gradientUnits;
- readonly attribute SVGAnimatedTransformList gradientTransform;
- readonly attribute SVGAnimatedEnumeration spreadMethod;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration gradientUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedTransformList gradientTransform;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration spreadMethod;
};
SVGGradientElement implements SVGURIReference;
-
+// SVGGradientElement implements SVGUnitTypes;
diff --git a/core/svg/SVGGraphicsElement.idl b/core/svg/SVGGraphicsElement.idl
index dc52a52..7af9e22 100644
--- a/core/svg/SVGGraphicsElement.idl
+++ b/core/svg/SVGGraphicsElement.idl
@@ -33,7 +33,7 @@
[
TypeChecking=Interface,
] interface SVGGraphicsElement : SVGElement {
- readonly attribute SVGAnimatedTransformList transform;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedTransformList transform;
[MeasureAs=SVGLocatableNearestViewportElement] readonly attribute SVGElement nearestViewportElement;
[MeasureAs=SVGLocatableFarthestViewportElement] readonly attribute SVGElement farthestViewportElement;
@@ -41,7 +41,7 @@
[ImplementedAs=getBBoxFromJavascript] SVGRect getBBox();
[ImplementedAs=getCTMFromJavascript] SVGMatrix getCTM();
[ImplementedAs=getScreenCTMFromJavascript] SVGMatrix getScreenCTM();
- [RaisesException] SVGMatrix getTransformToElement(SVGElement element);
+ [RaisesException, MeasureAs=SVGGraphicsElementGetTransformToElement] SVGMatrix getTransformToElement(SVGElement element);
};
SVGGraphicsElement implements SVGTests;
diff --git a/core/svg/SVGHKernElement.idl b/core/svg/SVGHKernElement.idl
deleted file mode 100644
index 20fee21..0000000
--- a/core/svg/SVGHKernElement.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGHKernElement : SVGElement {
-};
-
diff --git a/core/svg/SVGImageElement.idl b/core/svg/SVGImageElement.idl
index a659e29..8830ac6 100644
--- a/core/svg/SVGImageElement.idl
+++ b/core/svg/SVGImageElement.idl
@@ -23,13 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/embedded.html#InterfaceSVGImageElement
+
interface SVGImageElement : SVGGraphicsElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
- readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
};
SVGImageElement implements SVGURIReference;
-
diff --git a/core/svg/SVGLength.idl b/core/svg/SVGLength.idl
index 48e5a1f..52e2daa 100644
--- a/core/svg/SVGLength.idl
+++ b/core/svg/SVGLength.idl
@@ -20,10 +20,16 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGLength
+
+// TODO(philipj): SVGLength should have constructors. crbug.com/366541
[
ImplementedAs=SVGLengthTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ MeasureAs=SVG1DOM,
+ RuntimeEnabled=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGLength {
// Length Unit Types
const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
@@ -40,12 +46,10 @@
readonly attribute unsigned short unitType;
[RaisesException] attribute float value;
-
[RaisesException=Setter] attribute float valueInSpecifiedUnits;
+ // TODO(philipj): valueAsString should not have [TreatNullAs=NullString].
[TreatNullAs=NullString, RaisesException=Setter] attribute DOMString valueAsString;
[RaisesException] void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
-
[RaisesException] void convertToSpecifiedUnits(unsigned short unitType);
};
-
diff --git a/core/svg/SVGLengthList.idl b/core/svg/SVGLengthList.idl
index b07416c..e587ed2 100644
--- a/core/svg/SVGLengthList.idl
+++ b/core/svg/SVGLengthList.idl
@@ -24,21 +24,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGLengthList
+
[
ImplementedAs=SVGLengthListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGLengthList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
[RaisesException] void clear();
- [RaisesException] SVGLength initialize(SVGLength item);
+ [RaisesException] SVGLength initialize(SVGLength newItem);
[RaisesException] getter SVGLength getItem(unsigned long index);
- [RaisesException] setter SVGLength (unsigned long index, SVGLength value);
- [RaisesException] SVGLength insertItemBefore(SVGLength item, unsigned long index);
- [RaisesException] SVGLength replaceItem(SVGLength item, unsigned long index);
+ [RaisesException] SVGLength insertItemBefore(SVGLength newItem, unsigned long index);
+ [RaisesException] SVGLength replaceItem(SVGLength newItem, unsigned long index);
[RaisesException] SVGLength removeItem(unsigned long index);
- [RaisesException] SVGLength appendItem(SVGLength item);
+ [RaisesException] SVGLength appendItem(SVGLength newItem);
+ [RaisesException] setter void (unsigned long index, SVGLength newItem);
};
-
diff --git a/core/svg/SVGLineElement.idl b/core/svg/SVGLineElement.idl
index 5adea6f..db52f16 100644
--- a/core/svg/SVGLineElement.idl
+++ b/core/svg/SVGLineElement.idl
@@ -23,10 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGLineElement : SVGGeometryElement {
- readonly attribute SVGAnimatedLength x1;
- readonly attribute SVGAnimatedLength y1;
- readonly attribute SVGAnimatedLength x2;
- readonly attribute SVGAnimatedLength y2;
-};
+// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGLineElement
+interface SVGLineElement : SVGGeometryElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y2;
+};
diff --git a/core/svg/SVGLinearGradientElement.idl b/core/svg/SVGLinearGradientElement.idl
index 9ce3ee6..95e1d5c 100644
--- a/core/svg/SVGLinearGradientElement.idl
+++ b/core/svg/SVGLinearGradientElement.idl
@@ -23,10 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGLinearGradientElement : SVGGradientElement {
- readonly attribute SVGAnimatedLength x1;
- readonly attribute SVGAnimatedLength y1;
- readonly attribute SVGAnimatedLength x2;
- readonly attribute SVGAnimatedLength y2;
-};
+// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGLinearGradientElement
+interface SVGLinearGradientElement : SVGGradientElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y2;
+};
diff --git a/core/svg/SVGMPathElement.idl b/core/svg/SVGMPathElement.idl
index bb8aaf6..beaf744 100644
--- a/core/svg/SVGMPathElement.idl
+++ b/core/svg/SVGMPathElement.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGMPathElement
+
interface SVGMPathElement : SVGElement {
};
SVGMPathElement implements SVGURIReference;
-
diff --git a/core/svg/SVGMarkerElement.idl b/core/svg/SVGMarkerElement.idl
index ff7cc37..1083406 100644
--- a/core/svg/SVGMarkerElement.idl
+++ b/core/svg/SVGMarkerElement.idl
@@ -30,25 +30,26 @@
] interface SVGMarkerElement : SVGElement {
// Marker Unit Types
- const unsigned short SVG_MARKERUNITS_UNKNOWN = 0;
- const unsigned short SVG_MARKERUNITS_USERSPACEONUSE = 1;
- const unsigned short SVG_MARKERUNITS_STROKEWIDTH = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MARKERUNITS_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MARKERUNITS_USERSPACEONUSE = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MARKERUNITS_STROKEWIDTH = 2;
// Marker Orientation Types
- const unsigned short SVG_MARKER_ORIENT_UNKNOWN = 0;
- const unsigned short SVG_MARKER_ORIENT_AUTO = 1;
- const unsigned short SVG_MARKER_ORIENT_ANGLE = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MARKER_ORIENT_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MARKER_ORIENT_AUTO = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_MARKER_ORIENT_ANGLE = 2;
- readonly attribute SVGAnimatedLength refX;
- readonly attribute SVGAnimatedLength refY;
- readonly attribute SVGAnimatedEnumeration markerUnits;
- readonly attribute SVGAnimatedLength markerWidth;
- readonly attribute SVGAnimatedLength markerHeight;
- readonly attribute SVGAnimatedEnumeration orientType;
- readonly attribute SVGAnimatedAngle orientAngle;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength refX;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength refY;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration markerUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength markerWidth;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength markerHeight;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration orientType;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedAngle orientAngle;
+ // attribute DOMString orient;
- void setOrientToAuto();
- void setOrientToAngle(SVGAngle angle);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] void setOrientToAuto();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] void setOrientToAngle(SVGAngle angle);
};
SVGMarkerElement implements SVGFitToViewBox;
diff --git a/core/svg/SVGMaskElement.idl b/core/svg/SVGMaskElement.idl
index 06ced40..db24b72 100644
--- a/core/svg/SVGMaskElement.idl
+++ b/core/svg/SVGMaskElement.idl
@@ -26,12 +26,15 @@
// http://www.w3.org/TR/css-masking/#InterfaceSVGMaskElement
interface SVGMaskElement : SVGElement {
- readonly attribute SVGAnimatedEnumeration maskUnits;
- readonly attribute SVGAnimatedEnumeration maskContentUnits;
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration maskUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration maskContentUnits;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
};
+// SVGMaskElement implements SVGUnitTypes;
+
+// TODO(philipj): The following is not part of any spec:
SVGMaskElement implements SVGTests;
diff --git a/core/svg/SVGMatrix.idl b/core/svg/SVGMatrix.idl
index 663c5be..a613da6 100644
--- a/core/svg/SVGMatrix.idl
+++ b/core/svg/SVGMatrix.idl
@@ -20,30 +20,33 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix
+
+// TODO(philipj): SVGMatrix is gone from SVG 2, replaced by DOMMatrix.
[
- TypeChecking=Interface,
ImplementedAs=SVGMatrixTearOff,
- SetWrapperReferenceTo(SVGTransform contextTransform)
+ SetWrapperReferenceTo(SVGTransform contextTransform),
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGMatrix {
// FIXME: these attributes should all be floats but since we implement
// AffineTransform with doubles setting these as doubles makes more sense.
- [RaisesException=Setter] attribute double a;
- [RaisesException=Setter] attribute double b;
- [RaisesException=Setter] attribute double c;
- [RaisesException=Setter] attribute double d;
- [RaisesException=Setter] attribute double e;
- [RaisesException=Setter] attribute double f;
+ [RaisesException=Setter] attribute unrestricted double a;
+ [RaisesException=Setter] attribute unrestricted double b;
+ [RaisesException=Setter] attribute unrestricted double c;
+ [RaisesException=Setter] attribute unrestricted double d;
+ [RaisesException=Setter] attribute unrestricted double e;
+ [RaisesException=Setter] attribute unrestricted double f;
SVGMatrix multiply(SVGMatrix secondMatrix);
[RaisesException] SVGMatrix inverse();
- SVGMatrix translate(float x, float y);
- SVGMatrix scale(float scaleFactor);
- SVGMatrix scaleNonUniform(float scaleFactorX, float scaleFactorY);
- SVGMatrix rotate(float angle);
- [RaisesException] SVGMatrix rotateFromVector(float x, float y);
+ SVGMatrix translate(unrestricted float x, unrestricted float y);
+ SVGMatrix scale(unrestricted float scaleFactor);
+ SVGMatrix scaleNonUniform(unrestricted float scaleFactorX, unrestricted float scaleFactorY);
+ SVGMatrix rotate(unrestricted float angle);
+ [RaisesException] SVGMatrix rotateFromVector(unrestricted float x, unrestricted float y);
SVGMatrix flipX();
SVGMatrix flipY();
- SVGMatrix skewX(float angle);
- SVGMatrix skewY(float angle);
+ SVGMatrix skewX(unrestricted float angle);
+ SVGMatrix skewY(unrestricted float angle);
};
-
diff --git a/core/svg/SVGMetadataElement.idl b/core/svg/SVGMetadataElement.idl
index fc1500a..5f336ab 100644
--- a/core/svg/SVGMetadataElement.idl
+++ b/core/svg/SVGMetadataElement.idl
@@ -19,6 +19,7 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGMetadataElement
+
interface SVGMetadataElement : SVGElement {
};
-
diff --git a/core/svg/SVGMissingGlyphElement.idl b/core/svg/SVGMissingGlyphElement.idl
deleted file mode 100644
index c0a7974..0000000
--- a/core/svg/SVGMissingGlyphElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- *
- * 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 INC. ``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 INC. 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.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGMissingGlyphElement : SVGElement {
-};
-
diff --git a/core/svg/SVGNumber.idl b/core/svg/SVGNumber.idl
index adf8dc6..aa7ce79 100644
--- a/core/svg/SVGNumber.idl
+++ b/core/svg/SVGNumber.idl
@@ -20,13 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumber
+
+// TODO(philipj): SVGNumber should have constructors. crbug.com/366541
[
ImplementedAs=SVGNumberTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGNumber {
- // FIXMEDART: this attribute probably does not need to be DartCustom
- // anymore.
- [RaisesException=Setter, DartCustom] attribute float value;
+ [RaisesException=Setter] attribute float value;
};
-
diff --git a/core/svg/SVGNumberList.idl b/core/svg/SVGNumberList.idl
index 8fdbcf9..6c9bea9 100644
--- a/core/svg/SVGNumberList.idl
+++ b/core/svg/SVGNumberList.idl
@@ -24,21 +24,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumberList
+
[
ImplementedAs=SVGNumberListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGNumberList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
[RaisesException] void clear();
- [RaisesException] SVGNumber initialize(SVGNumber item);
+ [RaisesException] SVGNumber initialize(SVGNumber newItem);
[RaisesException] getter SVGNumber getItem(unsigned long index);
- [RaisesException] setter SVGNumber (unsigned long index, SVGNumber value);
- [RaisesException] SVGNumber insertItemBefore(SVGNumber item, unsigned long index);
- [RaisesException] SVGNumber replaceItem(SVGNumber item, unsigned long index);
+ [RaisesException] SVGNumber insertItemBefore(SVGNumber newItem, unsigned long index);
+ [RaisesException] SVGNumber replaceItem(SVGNumber newItem, unsigned long index);
[RaisesException] SVGNumber removeItem(unsigned long index);
- [RaisesException] SVGNumber appendItem(SVGNumber item);
+ [RaisesException] SVGNumber appendItem(SVGNumber newItem);
+ [RaisesException] setter void (unsigned long index, SVGNumber newItem);
};
-
diff --git a/core/svg/SVGPathElement.idl b/core/svg/SVGPathElement.idl
index df7ac8c..80c852f 100644
--- a/core/svg/SVGPathElement.idl
+++ b/core/svg/SVGPathElement.idl
@@ -24,56 +24,65 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathElement
+
[
TypeChecking=Interface,
] interface SVGPathElement : SVGGeometryElement {
- readonly attribute SVGAnimatedNumber pathLength;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber pathLength;
float getTotalLength();
+ // TODO(philipj): SVGPoint should be DOMPoint.
SVGPoint getPointAtLength(float distance);
unsigned long getPathSegAtLength(float distance);
- SVGPathSegClosePath createSVGPathSegClosePath();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegClosePath createSVGPathSegClosePath();
- SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(float x, float y);
- SVGPathSegMovetoRel createSVGPathSegMovetoRel(float x, float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(float x, float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegMovetoRel createSVGPathSegMovetoRel(float x, float y);
- SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(float x, float y);
- SVGPathSegLinetoRel createSVGPathSegLinetoRel(float x, float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(float x, float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegLinetoRel createSVGPathSegLinetoRel(float x, float y);
- SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(
float x, float y, float x1, float y1, float x2, float y2);
- SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(
float x, float y, float x1, float y1, float x2, float y2);
- SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(
float x, float y, float x1, float y1);
- SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(
float x, float y, float x1, float y1);
- SVGPathSegArcAbs createSVGPathSegArcAbs(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegArcAbs createSVGPathSegArcAbs(
float x, float y, float r1, float r2,
float angle, boolean largeArcFlag, boolean sweepFlag);
- SVGPathSegArcRel createSVGPathSegArcRel(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegArcRel createSVGPathSegArcRel(
float x, float y, float r1, float r2,
float angle, boolean largeArcFlag, boolean sweepFlag);
- SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(float x);
- SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(float x);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(float x);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(float x);
- SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(float y);
- SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(float y);
- SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(
float x, float y, float x2, float y2);
- SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(
float x, float y, float x2, float y2);
- SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
- SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
- readonly attribute SVGPathSegList pathSegList;
- readonly attribute SVGPathSegList normalizedPathSegList;
- readonly attribute SVGPathSegList animatedPathSegList;
- readonly attribute SVGPathSegList animatedNormalizedPathSegList;
+ // TODO(philipj): pathSegList and animatedPathSegList should be on the
+ // SVGAnimatedPathData interface which SVGPathElement should implement:
+ // http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGAnimatedPathData
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] readonly attribute SVGPathSegList pathSegList;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] readonly attribute SVGPathSegList animatedPathSegList;
+
+ // TODO(philipj): The following was part of SVG 1.1:
+ // http://www.w3.org/TR/SVG11/paths.html#InterfaceSVGAnimatedPathData
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] readonly attribute SVGPathSegList normalizedPathSegList;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVGPathSegDOM] readonly attribute SVGPathSegList animatedNormalizedPathSegList;
};
diff --git a/core/svg/SVGPathSeg.idl b/core/svg/SVGPathSeg.idl
index 4b9ce79..b28dd7e 100644
--- a/core/svg/SVGPathSeg.idl
+++ b/core/svg/SVGPathSeg.idl
@@ -24,9 +24,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSeg
+
[
- Custom=Wrap,
DependentLifetime,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
+ WillBeGarbageCollected,
] interface SVGPathSeg {
// Path Segment Types
const unsigned short PATHSEG_UNKNOWN = 0;
diff --git a/core/svg/SVGPathSegArcAbs.idl b/core/svg/SVGPathSegArcAbs.idl
index 1695f53..d530ba5 100644
--- a/core/svg/SVGPathSegArcAbs.idl
+++ b/core/svg/SVGPathSegArcAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegArcAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegArcAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegArcRel.idl b/core/svg/SVGPathSegArcRel.idl
index febd2bf..aa75b5d 100644
--- a/core/svg/SVGPathSegArcRel.idl
+++ b/core/svg/SVGPathSegArcRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegArcRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegArcRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegClosePath.idl b/core/svg/SVGPathSegClosePath.idl
index bb47b28..a76a85b 100644
--- a/core/svg/SVGPathSegClosePath.idl
+++ b/core/svg/SVGPathSegClosePath.idl
@@ -24,5 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGPathSegClosePath : SVGPathSeg {
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegClosePath
+
+[
+ RuntimeEnabled=SVG1DOM
+] interface SVGPathSegClosePath : SVGPathSeg {
};
diff --git a/core/svg/SVGPathSegCurvetoCubicAbs.idl b/core/svg/SVGPathSegCurvetoCubicAbs.idl
index 8c666eb..272dbba 100644
--- a/core/svg/SVGPathSegCurvetoCubicAbs.idl
+++ b/core/svg/SVGPathSegCurvetoCubicAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoCubicAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoCubicAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicRel.idl b/core/svg/SVGPathSegCurvetoCubicRel.idl
index 2353cbb..c690d85 100644
--- a/core/svg/SVGPathSegCurvetoCubicRel.idl
+++ b/core/svg/SVGPathSegCurvetoCubicRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoCubicRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoCubicRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl b/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl
index 63a7da2..a7085c1 100644
--- a/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl
+++ b/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoCubicSmoothAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoCubicSmoothAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl b/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl
index 9253bb3..b3a5329 100644
--- a/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl
+++ b/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoCubicSmoothRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoCubicSmoothRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticAbs.idl b/core/svg/SVGPathSegCurvetoQuadraticAbs.idl
index d7bfc66..812f2c6 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticAbs.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoQuadraticAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoQuadraticAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticRel.idl b/core/svg/SVGPathSegCurvetoQuadraticRel.idl
index d4da453..8348889 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticRel.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoQuadraticRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoQuadraticRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl b/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl
index 8db13c3..b264f8c 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoQuadraticSmoothAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoQuadraticSmoothAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl b/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl
index cecfb26..a9ad774 100644
--- a/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl
+++ b/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegCurvetoQuadraticSmoothRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegCurvetoQuadraticSmoothRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegLinetoAbs.idl b/core/svg/SVGPathSegLinetoAbs.idl
index 23cf3ac..0a69c50 100644
--- a/core/svg/SVGPathSegLinetoAbs.idl
+++ b/core/svg/SVGPathSegLinetoAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegLinetoAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegLinetoAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegLinetoHorizontalAbs.idl b/core/svg/SVGPathSegLinetoHorizontalAbs.idl
index 655043f..479b068 100644
--- a/core/svg/SVGPathSegLinetoHorizontalAbs.idl
+++ b/core/svg/SVGPathSegLinetoHorizontalAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegLinetoHorizontalAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegLinetoHorizontalAbs : SVGPathSeg {
attribute float x;
};
diff --git a/core/svg/SVGPathSegLinetoHorizontalRel.idl b/core/svg/SVGPathSegLinetoHorizontalRel.idl
index 681d639..c9ececf 100644
--- a/core/svg/SVGPathSegLinetoHorizontalRel.idl
+++ b/core/svg/SVGPathSegLinetoHorizontalRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegLinetoHorizontalRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegLinetoHorizontalRel : SVGPathSeg {
attribute float x;
};
diff --git a/core/svg/SVGPathSegLinetoRel.idl b/core/svg/SVGPathSegLinetoRel.idl
index a73f5d2..684dfe5 100644
--- a/core/svg/SVGPathSegLinetoRel.idl
+++ b/core/svg/SVGPathSegLinetoRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegLinetoRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegLinetoRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegLinetoVerticalAbs.idl b/core/svg/SVGPathSegLinetoVerticalAbs.idl
index 7371094..1411120 100644
--- a/core/svg/SVGPathSegLinetoVerticalAbs.idl
+++ b/core/svg/SVGPathSegLinetoVerticalAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegLinetoVerticalAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegLinetoVerticalAbs : SVGPathSeg {
attribute float y;
};
diff --git a/core/svg/SVGPathSegLinetoVerticalRel.idl b/core/svg/SVGPathSegLinetoVerticalRel.idl
index 74ccdee..f7acc5e 100644
--- a/core/svg/SVGPathSegLinetoVerticalRel.idl
+++ b/core/svg/SVGPathSegLinetoVerticalRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegLinetoVerticalRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegLinetoVerticalRel : SVGPathSeg {
attribute float y;
};
diff --git a/core/svg/SVGPathSegList.idl b/core/svg/SVGPathSegList.idl
index 9f8381b..20afb09 100644
--- a/core/svg/SVGPathSegList.idl
+++ b/core/svg/SVGPathSegList.idl
@@ -24,10 +24,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegList
+
[
TypeChecking=Interface,
SetWrapperReferenceTo(SVGElement contextElement),
- ImplementedAs=SVGPathSegListTearOff
+ ImplementedAs=SVGPathSegListTearOff,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
+ WillBeGarbageCollected,
] interface SVGPathSegList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
@@ -35,9 +40,9 @@
[RaisesException] void clear();
[RaisesException] SVGPathSeg initialize(SVGPathSeg newItem);
[RaisesException] getter SVGPathSeg getItem(unsigned long index);
- [RaisesException] setter SVGPathSeg (unsigned long index, SVGPathSeg value);
[RaisesException] SVGPathSeg insertItemBefore(SVGPathSeg newItem, unsigned long index);
[RaisesException] SVGPathSeg replaceItem(SVGPathSeg newItem, unsigned long index);
[RaisesException] SVGPathSeg removeItem(unsigned long index);
[RaisesException] SVGPathSeg appendItem(SVGPathSeg newItem);
+ [RaisesException] setter void (unsigned long index, SVGPathSeg newItem);
};
diff --git a/core/svg/SVGPathSegMovetoAbs.idl b/core/svg/SVGPathSegMovetoAbs.idl
index 391b6b7..5b90445 100644
--- a/core/svg/SVGPathSegMovetoAbs.idl
+++ b/core/svg/SVGPathSegMovetoAbs.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegMovetoAbs
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegMovetoAbs : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPathSegMovetoRel.idl b/core/svg/SVGPathSegMovetoRel.idl
index 49cfa67..a45f987 100644
--- a/core/svg/SVGPathSegMovetoRel.idl
+++ b/core/svg/SVGPathSegMovetoRel.idl
@@ -24,8 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathSegMovetoRel
+
[
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVGPathSegDOM,
] interface SVGPathSegMovetoRel : SVGPathSeg {
attribute float x;
attribute float y;
diff --git a/core/svg/SVGPatternElement.idl b/core/svg/SVGPatternElement.idl
index 04a1e00..45edd46 100644
--- a/core/svg/SVGPatternElement.idl
+++ b/core/svg/SVGPatternElement.idl
@@ -23,7 +23,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG11/pservers.html#InterfaceSVGPatternElement
// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGPatternElement
interface SVGPatternElement : SVGElement {
@@ -37,5 +36,9 @@
};
SVGPatternElement implements SVGFitToViewBox;
-SVGPatternElement implements SVGTests; // in SVG 1.1 but not SVG 2
SVGPatternElement implements SVGURIReference;
+// SVGPatternElement implements SVGUnitTypes;
+
+// TODO(philipj): The following was part of SVG 1.1:
+// http://www.w3.org/TR/SVG11/pservers.html#InterfaceSVGPatternElement
+SVGPatternElement implements SVGTests;
diff --git a/core/svg/SVGPoint.idl b/core/svg/SVGPoint.idl
index bb30f3d..7097dc8 100644
--- a/core/svg/SVGPoint.idl
+++ b/core/svg/SVGPoint.idl
@@ -20,13 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGPoint
+
+// TODO(philipj): SVGPoint is gone from SVG 2, replaced by DOMPoint.
[
ImplementedAs=SVGPointTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGPoint {
- [RaisesException=Setter] attribute float x;
- [RaisesException=Setter] attribute float y;
+ [RaisesException=Setter] attribute unrestricted float x;
+ [RaisesException=Setter] attribute unrestricted float y;
[MeasureAs=SVGPointMatrixTransform] SVGPoint matrixTransform(SVGMatrix matrix);
};
diff --git a/core/svg/SVGPointList.idl b/core/svg/SVGPointList.idl
index 7bf20b5..e2dbb15 100644
--- a/core/svg/SVGPointList.idl
+++ b/core/svg/SVGPointList.idl
@@ -23,20 +23,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGPointList
+
[
ImplementedAs=SVGPointListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGPointList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
[RaisesException] void clear();
- [RaisesException] SVGPoint initialize(SVGPoint item);
+ // TODO(philipj): SVGPoint should be DOMPoint.
+ [RaisesException] SVGPoint initialize(SVGPoint newItem);
[RaisesException] getter SVGPoint getItem(unsigned long index);
- [RaisesException] setter SVGPoint (unsigned long index, SVGPoint value);
- [RaisesException] SVGPoint insertItemBefore(SVGPoint item, unsigned long index);
- [RaisesException] SVGPoint replaceItem(SVGPoint item, unsigned long index);
+ [RaisesException] SVGPoint insertItemBefore(SVGPoint newItem, unsigned long index);
+ [RaisesException] SVGPoint replaceItem(SVGPoint newItem, unsigned long index);
[RaisesException] SVGPoint removeItem(unsigned long index);
- [RaisesException] SVGPoint appendItem(SVGPoint item);
+ [RaisesException] SVGPoint appendItem(SVGPoint newItem);
+ [RaisesException] setter void (unsigned long index, SVGPoint newItem);
};
diff --git a/core/svg/SVGPolygonElement.idl b/core/svg/SVGPolygonElement.idl
index defe168..21458ae 100644
--- a/core/svg/SVGPolygonElement.idl
+++ b/core/svg/SVGPolygonElement.idl
@@ -23,7 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGPolygonElement
+
interface SVGPolygonElement : SVGGeometryElement {
- [ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
- readonly attribute SVGPointList animatedPoints;
+ // TODO(philipj): points and animatedPoints be on the SVGAnimatedPoints
+ // interface which SVGPolygonElement should implement:
+ // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGAnimatedPoints
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM, ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGPointList animatedPoints;
};
diff --git a/core/svg/SVGPolylineElement.idl b/core/svg/SVGPolylineElement.idl
index 4d148d1..6937733 100644
--- a/core/svg/SVGPolylineElement.idl
+++ b/core/svg/SVGPolylineElement.idl
@@ -23,8 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGPolylineElement : SVGGeometryElement {
- [ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
- readonly attribute SVGPointList animatedPoints;
-};
+// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGPolylineElement
+interface SVGPolylineElement : SVGGeometryElement {
+ // TODO(philipj): points and animatedPoints should be on the
+ // SVGAnimatedPoints interface which SVGPolylineElement should implement:
+ // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGAnimatedPoints
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM, ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGPointList animatedPoints;
+};
diff --git a/core/svg/SVGPreserveAspectRatio.idl b/core/svg/SVGPreserveAspectRatio.idl
index 9c6d89e..dc9ba05 100644
--- a/core/svg/SVGPreserveAspectRatio.idl
+++ b/core/svg/SVGPreserveAspectRatio.idl
@@ -23,10 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGPreserveAspectRatio
+
[
TypeChecking=Interface,
ImplementedAs=SVGPreserveAspectRatioTearOff,
- SetWrapperReferenceTo(SVGElement contextElement)
+ SetWrapperReferenceTo(SVGElement contextElement),
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGPreserveAspectRatio {
// Alignment types
const unsigned short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0;
@@ -47,6 +52,5 @@
const unsigned short SVG_MEETORSLICE_SLICE = 2;
[RaisesException=Setter] attribute unsigned short align;
-
[RaisesException=Setter] attribute unsigned short meetOrSlice;
};
diff --git a/core/svg/SVGRadialGradientElement.idl b/core/svg/SVGRadialGradientElement.idl
index dfae5fd..71bd0bd 100644
--- a/core/svg/SVGRadialGradientElement.idl
+++ b/core/svg/SVGRadialGradientElement.idl
@@ -23,12 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGRadialGradientElement : SVGGradientElement {
- readonly attribute SVGAnimatedLength cx;
- readonly attribute SVGAnimatedLength cy;
- readonly attribute SVGAnimatedLength r;
- readonly attribute SVGAnimatedLength fx;
- readonly attribute SVGAnimatedLength fy;
- readonly attribute SVGAnimatedLength fr;
-};
+// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGRadialGradientElement
+interface SVGRadialGradientElement : SVGGradientElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength cx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength cy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength r;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength fx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength fy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength fr;
+};
diff --git a/core/svg/SVGRect.idl b/core/svg/SVGRect.idl
index f602ce1..3ab6c6a 100644
--- a/core/svg/SVGRect.idl
+++ b/core/svg/SVGRect.idl
@@ -20,13 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG11/types.html#InterfaceSVGRect
+
+// TODO(philipj): SVGRect is gone from SVG 2, replaced by DOMRect.
[
ImplementedAs=SVGRectTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGRect {
- [RaisesException=Setter] attribute float x;
- [RaisesException=Setter] attribute float y;
- [RaisesException=Setter] attribute float width;
- [RaisesException=Setter] attribute float height;
+ [RaisesException=Setter] attribute unrestricted float x;
+ [RaisesException=Setter] attribute unrestricted float y;
+ [RaisesException=Setter] attribute unrestricted float width;
+ [RaisesException=Setter] attribute unrestricted float height;
};
diff --git a/core/svg/SVGRectElement.idl b/core/svg/SVGRectElement.idl
index 3bbe39a..a23a007 100644
--- a/core/svg/SVGRectElement.idl
+++ b/core/svg/SVGRectElement.idl
@@ -24,12 +24,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGRectElement : SVGGeometryElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
- readonly attribute SVGAnimatedLength rx;
- readonly attribute SVGAnimatedLength ry;
-};
+// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGRectElement
+interface SVGRectElement : SVGGeometryElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength rx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength ry;
+};
diff --git a/core/svg/SVGRenderingIntent.idl b/core/svg/SVGRenderingIntent.idl
deleted file mode 100644
index 1c47a29..0000000
--- a/core/svg/SVGRenderingIntent.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2006 Apple 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:
- * 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 INC. ``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 INC. 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.
- */
-
-[
- DependentLifetime,
- WillBeGarbageCollected
-] interface SVGRenderingIntent {
- // Rendering Intent Types
- const unsigned short RENDERING_INTENT_UNKNOWN = 0;
- const unsigned short RENDERING_INTENT_AUTO = 1;
- const unsigned short RENDERING_INTENT_PERCEPTUAL = 2;
- const unsigned short RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3;
- const unsigned short RENDERING_INTENT_SATURATION = 4;
- const unsigned short RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5;
-};
diff --git a/core/svg/SVGSVGElement.idl b/core/svg/SVGSVGElement.idl
index ad7db21..0ad5d7a 100644
--- a/core/svg/SVGSVGElement.idl
+++ b/core/svg/SVGSVGElement.idl
@@ -22,50 +22,56 @@
// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
-// TODO: no css::ViewCSS available!
-// TODO: no events::DocumentEvent available!
[
TypeChecking=Interface,
] interface SVGSVGElement : SVGGraphicsElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
+ // TODO(philipj): viewport should be a DOMRectReadOnly.
readonly attribute SVGRect viewport;
- readonly attribute float pixelUnitToMillimeterX;
- readonly attribute float pixelUnitToMillimeterY;
- readonly attribute float screenPixelToMillimeterX;
- readonly attribute float screenPixelToMillimeterY;
- readonly attribute boolean useCurrentView;
- readonly attribute SVGViewSpec currentView;
+ // TODO(philipj): useCurrentView and currentView have been removed:
+ // https://github.com/w3c/svgwg/commit/4c26fd36937a65192024208d85c144a21071b057
+ [Measure] readonly attribute boolean useCurrentView;
+ [Measure] readonly attribute SVGViewSpec currentView;
attribute float currentScale;
+ // TODO(philipj): currentTranslate should be a DOMPointReadOnly.
[ImplementedAs=currentTranslateFromJavascript] readonly attribute SVGPoint currentTranslate;
- unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
- void unsuspendRedraw(unsigned long suspendHandleId);
- void unsuspendRedrawAll();
- void forceRedraw();
+ [RuntimeEnabled=SVG1DOM, DeprecateAs=SVGSVGElementSuspendRedraw] unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
+ [RuntimeEnabled=SVG1DOM, DeprecateAs=SVGSVGElementUnsuspendRedraw] void unsuspendRedraw(unsigned long suspendHandleId);
+ [RuntimeEnabled=SVG1DOM, DeprecateAs=SVGSVGElementUnsuspendRedrawAll] void unsuspendRedrawAll();
+ [RuntimeEnabled=SVG1DOM, DeprecateAs=SVGSVGElementForceRedraw] void forceRedraw();
void pauseAnimations();
void unpauseAnimations();
boolean animationsPaused();
float getCurrentTime();
void setCurrentTime(float seconds);
+ // TODO(philipj): The rect arguments should be DOMRectReadOnly.
NodeList getIntersectionList(SVGRect rect, SVGElement? referenceElement);
NodeList getEnclosureList(SVGRect rect, SVGElement? referenceElement);
boolean checkIntersection(SVGElement element, SVGRect rect);
boolean checkEnclosure(SVGElement element, SVGRect rect);
void deselectAll();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGNumber createSVGNumber();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGLength createSVGLength();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGAngle createSVGAngle();
+ // TODO(philipj): SVGPoint/Matrix/Rect should be DOMPoint/Matrix/Rect.
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGPoint createSVGPoint();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGMatrix createSVGMatrix();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGRect createSVGRect();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGTransform createSVGTransform();
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
- SVGNumber createSVGNumber();
- SVGLength createSVGLength();
- SVGAngle createSVGAngle();
- SVGPoint createSVGPoint();
- SVGMatrix createSVGMatrix();
- SVGRect createSVGRect();
- SVGTransform createSVGTransform();
- SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
- Element getElementById(DOMString elementId);
+ // TODO(philipj): The following was part of SVG 1.1:
+ // http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement
+ [Measure] readonly attribute float pixelUnitToMillimeterX;
+ [Measure] readonly attribute float pixelUnitToMillimeterY;
+ [Measure] readonly attribute float screenPixelToMillimeterX;
+ [Measure] readonly attribute float screenPixelToMillimeterY;
+ [Measure] Element getElementById(DOMString elementId);
};
SVGSVGElement implements SVGFitToViewBox;
diff --git a/core/svg/SVGScriptElement.idl b/core/svg/SVGScriptElement.idl
index 08c871f..f3e4ace 100644
--- a/core/svg/SVGScriptElement.idl
+++ b/core/svg/SVGScriptElement.idl
@@ -23,6 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/script.html#InterfaceSVGScriptElement
+
interface SVGScriptElement : SVGElement {
[Reflect] attribute DOMString type;
};
diff --git a/core/svg/SVGSetElement.idl b/core/svg/SVGSetElement.idl
index 5bf7adb..f3f025f 100644
--- a/core/svg/SVGSetElement.idl
+++ b/core/svg/SVGSetElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGSetElement
+
interface SVGSetElement : SVGAnimationElement {
};
-
diff --git a/core/svg/SVGStopElement.idl b/core/svg/SVGStopElement.idl
index 44da1f9..ed21e23 100644
--- a/core/svg/SVGStopElement.idl
+++ b/core/svg/SVGStopElement.idl
@@ -23,7 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGStopElement : SVGElement {
- readonly attribute SVGAnimatedNumber offset;
-};
+// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGStopElement
+interface SVGStopElement : SVGElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumber offset;
+};
diff --git a/core/svg/SVGStringList.idl b/core/svg/SVGStringList.idl
index dbbdf9d..d4f5b7b 100644
--- a/core/svg/SVGStringList.idl
+++ b/core/svg/SVGStringList.idl
@@ -23,21 +23,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGStringList
+
[
TypeChecking=Interface,
SetWrapperReferenceTo(SVGElement contextElement),
- ImplementedAs=SVGStringListTearOff
+ ImplementedAs=SVGStringListTearOff,
+ RuntimeEnabled=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGStringList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
[RaisesException] void clear();
- [RaisesException] DOMString initialize(DOMString item);
+ [RaisesException] DOMString initialize(DOMString newItem);
[RaisesException] getter DOMString getItem(unsigned long index);
- [RaisesException] setter DOMString (unsigned long index, DOMString value);
[RaisesException] DOMString insertItemBefore(DOMString item, unsigned long index);
- [RaisesException] DOMString replaceItem(DOMString item, unsigned long index);
+ [RaisesException] DOMString replaceItem(DOMString newItem, unsigned long index);
[RaisesException] DOMString removeItem(unsigned long index);
- [RaisesException] DOMString appendItem(DOMString item);
+ [RaisesException] DOMString appendItem(DOMString newItem);
+ [RaisesException] setter void (unsigned long index, DOMString newItem);
};
-
diff --git a/core/svg/SVGStyleElement.idl b/core/svg/SVGStyleElement.idl
index 482efa9..afd2a33 100644
--- a/core/svg/SVGStyleElement.idl
+++ b/core/svg/SVGStyleElement.idl
@@ -24,13 +24,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/styling.html#InterfaceSVGStyleElement
+
interface SVGStyleElement : SVGElement {
- attribute boolean disabled;
attribute DOMString type;
attribute DOMString media;
[MeasureAs=SVGStyleElementTitle] attribute DOMString title;
- // DOM Level 2 Style
- readonly attribute StyleSheet sheet;
-};
+ // SVGStyleElement implements LinkStyle
+ // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
+ readonly attribute StyleSheet? sheet;
+ // TODO(philipj): The disabled attribute was not in SVG 1.1 and has been
+ // removed from HTMLLinkElement and HTMLStyleElement in the HTML spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
+ [Measure] attribute boolean disabled;
+};
diff --git a/core/svg/SVGSwitchElement.idl b/core/svg/SVGSwitchElement.idl
index 28d43b6..0370c7f 100644
--- a/core/svg/SVGSwitchElement.idl
+++ b/core/svg/SVGSwitchElement.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSwitchElement
+
interface SVGSwitchElement : SVGGraphicsElement {
};
diff --git a/core/svg/SVGTSpanElement.idl b/core/svg/SVGTSpanElement.idl
index e8d4232..db5be69 100644
--- a/core/svg/SVGTSpanElement.idl
+++ b/core/svg/SVGTSpanElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTSpanElement
+
interface SVGTSpanElement : SVGTextPositioningElement {
};
-
diff --git a/core/svg/SVGTests.idl b/core/svg/SVGTests.idl
index 9e0f5a1..c9f8ce6 100644
--- a/core/svg/SVGTests.idl
+++ b/core/svg/SVGTests.idl
@@ -30,9 +30,11 @@
NoInterfaceObject, // Always used on target of 'implements'
] interface SVGTests {
- readonly attribute SVGStringList requiredFeatures;
- readonly attribute SVGStringList requiredExtensions;
- readonly attribute SVGStringList systemLanguage;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGStringList requiredFeatures;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGStringList requiredExtensions;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGStringList systemLanguage;
- boolean hasExtension(DOMString extension);
+ // TODO(philipj): The following was part of SVG 1.1:
+ // http://www.w3.org/TR/SVG11/types.html#InterfaceSVGTests
+ [Measure] boolean hasExtension(DOMString extension);
};
diff --git a/core/svg/SVGTextContentElement.idl b/core/svg/SVGTextContentElement.idl
index 9d1f4f4..c2a284f 100644
--- a/core/svg/SVGTextContentElement.idl
+++ b/core/svg/SVGTextContentElement.idl
@@ -23,25 +23,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextContentElement
+
[
TypeChecking=Interface,
] interface SVGTextContentElement : SVGGraphicsElement {
// lengthAdjust Types
- const unsigned short LENGTHADJUST_UNKNOWN = 0;
- const unsigned short LENGTHADJUST_SPACING = 1;
- const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short LENGTHADJUST_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short LENGTHADJUST_SPACING = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2;
- readonly attribute SVGAnimatedLength textLength;
- readonly attribute SVGAnimatedEnumeration lengthAdjust;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength textLength;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration lengthAdjust;
long getNumberOfChars();
float getComputedTextLength();
- [RaisesException] float getSubStringLength(unsigned long offset, unsigned long length);
- [RaisesException] SVGPoint getStartPositionOfChar(unsigned long offset);
- [RaisesException] SVGPoint getEndPositionOfChar(unsigned long offset);
- [RaisesException] SVGRect getExtentOfChar(unsigned long offset);
- [RaisesException] float getRotationOfChar(unsigned long offset);
+ [RaisesException] float getSubStringLength(unsigned long charnum, unsigned long nchars);
+ // TODO(philipj): SVGPoint/SVGRect should be DOMPoint/DOMRect.
+ [RaisesException] SVGPoint getStartPositionOfChar(unsigned long charnum);
+ [RaisesException] SVGPoint getEndPositionOfChar(unsigned long charnum);
+ [RaisesException] SVGRect getExtentOfChar(unsigned long charnum);
+ [RaisesException] float getRotationOfChar(unsigned long charnum);
[RaisesException] long getCharNumAtPosition(SVGPoint point);
- [RaisesException] void selectSubString(unsigned long offset, unsigned long length);
+ [RaisesException] void selectSubString(unsigned long charnum, unsigned long nchars);
};
-
diff --git a/core/svg/SVGTextElement.idl b/core/svg/SVGTextElement.idl
index 618aa35..0c9fa35 100644
--- a/core/svg/SVGTextElement.idl
+++ b/core/svg/SVGTextElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextElement
+
interface SVGTextElement : SVGTextPositioningElement {
};
-
diff --git a/core/svg/SVGTextPathElement.idl b/core/svg/SVGTextPathElement.idl
index 028c069..93bb43c 100644
--- a/core/svg/SVGTextPathElement.idl
+++ b/core/svg/SVGTextPathElement.idl
@@ -23,21 +23,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextPathElement
+
interface SVGTextPathElement : SVGTextContentElement {
// textPath Method Types
- const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0;
- const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1;
- const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2;
// textPath Spacing Types
- const unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN = 0;
- const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1;
- const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2;
- readonly attribute SVGAnimatedLength startOffset;
- readonly attribute SVGAnimatedEnumeration method;
- readonly attribute SVGAnimatedEnumeration spacing;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength startOffset;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration method;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedEnumeration spacing;
};
SVGTextPathElement implements SVGURIReference;
-
+//SVGTextPathElement implements SVGAnimatedPathData;
diff --git a/core/svg/SVGTextPositioningElement.idl b/core/svg/SVGTextPositioningElement.idl
index b55a93c..07640e3 100644
--- a/core/svg/SVGTextPositioningElement.idl
+++ b/core/svg/SVGTextPositioningElement.idl
@@ -23,11 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SVGTextPositioningElement : SVGTextContentElement {
- readonly attribute SVGAnimatedLengthList x;
- readonly attribute SVGAnimatedLengthList y;
- readonly attribute SVGAnimatedLengthList dx;
- readonly attribute SVGAnimatedLengthList dy;
- readonly attribute SVGAnimatedNumberList rotate;
-};
+// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextPositioningElement
+interface SVGTextPositioningElement : SVGTextContentElement {
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLengthList x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLengthList y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLengthList dx;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLengthList dy;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedNumberList rotate;
+};
diff --git a/core/svg/SVGTitleElement.idl b/core/svg/SVGTitleElement.idl
index 4894221..a217a61 100644
--- a/core/svg/SVGTitleElement.idl
+++ b/core/svg/SVGTitleElement.idl
@@ -23,6 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGTitleElement
+
interface SVGTitleElement : SVGElement {
};
-
diff --git a/core/svg/SVGTransform.idl b/core/svg/SVGTransform.idl
index cb4c437..4a6ce72 100644
--- a/core/svg/SVGTransform.idl
+++ b/core/svg/SVGTransform.idl
@@ -19,10 +19,16 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGTransform
+
+// TODO(philipj): SVGTransform should have constructors. crbug.com/366541
[
- TypeChecking=Interface,
ImplementedAs=SVGTransformTearOff,
+ MeasureAs=SVG1DOM,
+ RuntimeEnabled=SVG1DOM,
SetWrapperReferenceTo(SVGElement contextElement),
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
] interface SVGTransform {
// Transform Types
const unsigned short SVG_TRANSFORM_UNKNOWN = 0;
@@ -34,6 +40,7 @@
const unsigned short SVG_TRANSFORM_SKEWY = 6;
[ImplementedAs=transformType] readonly attribute unsigned short type;
+ // TODO(philipj): SVGMatrix should be DOMMatrixReadOnly.
readonly attribute SVGMatrix matrix;
readonly attribute float angle;
@@ -44,4 +51,3 @@
[RaisesException] void setSkewX(float angle);
[RaisesException] void setSkewY(float angle);
};
-
diff --git a/core/svg/SVGTransformList.idl b/core/svg/SVGTransformList.idl
index 95663fc..6f6451e 100644
--- a/core/svg/SVGTransformList.idl
+++ b/core/svg/SVGTransformList.idl
@@ -24,24 +24,28 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGTransformList
+
[
ImplementedAs=SVGTransformListTearOff,
SetWrapperReferenceTo(SVGElement contextElement),
TypeChecking=Interface,
+ RuntimeEnabled=SVG1DOM,
+ MeasureAs=SVG1DOM,
+ WillBeGarbageCollected,
] interface SVGTransformList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
[RaisesException] void clear();
- [RaisesException] SVGTransform initialize(SVGTransform item);
+ [RaisesException] SVGTransform initialize(SVGTransform newItem);
[RaisesException] getter SVGTransform getItem(unsigned long index);
- [RaisesException] setter SVGTransform (unsigned long index, SVGTransform value);
- [RaisesException] SVGTransform insertItemBefore(SVGTransform item, unsigned long index);
- [RaisesException] SVGTransform replaceItem(SVGTransform item, unsigned long index);
+ [RaisesException] SVGTransform insertItemBefore(SVGTransform newItem, unsigned long index);
+ [RaisesException] SVGTransform replaceItem(SVGTransform newItem, unsigned long index);
[RaisesException] SVGTransform removeItem(unsigned long index);
- [RaisesException] SVGTransform appendItem(SVGTransform item);
-
+ [RaisesException] SVGTransform appendItem(SVGTransform newItem);
+ // TODO(philipj): SVGMatrix should be DOMMatrix.
SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
-
- [RaisesException] SVGTransform consolidate();
+ [RaisesException, MeasureAs=SVGTransformListConsolidate] SVGTransform? consolidate();
+ [RaisesException] setter void (unsigned long index, SVGTransform newItem);
};
diff --git a/core/svg/SVGURIReference.idl b/core/svg/SVGURIReference.idl
index 8a3f713..3f9e860 100644
--- a/core/svg/SVGURIReference.idl
+++ b/core/svg/SVGURIReference.idl
@@ -29,5 +29,5 @@
[
NoInterfaceObject, // Always used on target of 'implements'
] interface SVGURIReference {
- readonly attribute SVGAnimatedString href;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedString href;
};
diff --git a/core/svg/SVGUnitTypes.idl b/core/svg/SVGUnitTypes.idl
index 651d740..5e497de 100644
--- a/core/svg/SVGUnitTypes.idl
+++ b/core/svg/SVGUnitTypes.idl
@@ -23,12 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGUnitTypes
+
[
DependentLifetime,
WillBeGarbageCollected
] interface SVGUnitTypes {
// Unit Types
- const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0;
- const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE = 1;
- const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
};
diff --git a/core/svg/SVGUseElement.idl b/core/svg/SVGUseElement.idl
index ffbd341..03065a4 100644
--- a/core/svg/SVGUseElement.idl
+++ b/core/svg/SVGUseElement.idl
@@ -23,14 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement
// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGUseElement
interface SVGUseElement : SVGGraphicsElement {
- readonly attribute SVGAnimatedLength x;
- readonly attribute SVGAnimatedLength y;
- readonly attribute SVGAnimatedLength width;
- readonly attribute SVGAnimatedLength height;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength x;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength y;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength width;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGAnimatedLength height;
};
SVGUseElement implements SVGURIReference;
diff --git a/core/svg/SVGVKernElement.idl b/core/svg/SVGVKernElement.idl
deleted file mode 100644
index 7b3bd39..0000000
--- a/core/svg/SVGVKernElement.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
- Conditional=SVG_FONTS
-] interface SVGVKernElement : SVGElement {
-};
-
diff --git a/core/svg/SVGViewElement.idl b/core/svg/SVGViewElement.idl
index fb860f5..45ae255 100644
--- a/core/svg/SVGViewElement.idl
+++ b/core/svg/SVGViewElement.idl
@@ -26,7 +26,7 @@
// http://www.w3.org/TR/SVG2/linking.html#InterfaceSVGViewElement
interface SVGViewElement : SVGElement {
- readonly attribute SVGStringList viewTarget;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] readonly attribute SVGStringList viewTarget;
};
SVGViewElement implements SVGFitToViewBox;
diff --git a/core/svg/SVGZoomAndPan.idl b/core/svg/SVGZoomAndPan.idl
index 2eeedfd..7fa9063 100644
--- a/core/svg/SVGZoomAndPan.idl
+++ b/core/svg/SVGZoomAndPan.idl
@@ -31,9 +31,9 @@
] interface SVGZoomAndPan {
// Zoom and Pan Types
- const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0;
- const unsigned short SVG_ZOOMANDPAN_DISABLE = 1;
- const unsigned short SVG_ZOOMANDPAN_MAGNIFY = 2;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_ZOOMANDPAN_DISABLE = 1;
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM] const unsigned short SVG_ZOOMANDPAN_MAGNIFY = 2;
- [RaisesException=Setter] attribute unsigned short zoomAndPan; // readonly in SVGViewSpec, hence raises exception on setter there
+ [RuntimeEnabled=SVG1DOM, MeasureAs=SVG1DOM, RaisesException=Setter] attribute unsigned short zoomAndPan;
};
diff --git a/core/svg/SVGZoomEvent.idl b/core/svg/SVGZoomEvent.idl
index 719739b..ca6ee41 100644
--- a/core/svg/SVGZoomEvent.idl
+++ b/core/svg/SVGZoomEvent.idl
@@ -23,9 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/SVG2/script.html#InterfaceSVGZoomEvent
+
[
DependentLifetime,
] interface SVGZoomEvent : UIEvent {
+ // TODO(philipj): SVGRect/SVGPoint should be DOMRectReadOnly/DOMPointReadOnly.
readonly attribute SVGRect zoomRectScreen;
readonly attribute float previousScale;
readonly attribute SVGPoint previousTranslate;
diff --git a/core/testing/DictionaryTest.idl b/core/testing/DictionaryTest.idl
index d347e99..d03a78d 100644
--- a/core/testing/DictionaryTest.idl
+++ b/core/testing/DictionaryTest.idl
@@ -7,4 +7,7 @@
] interface DictionaryTest {
void set(optional InternalDictionary testingDictionary);
InternalDictionary get();
+
+ void setDerived(InternalDictionaryDerived derived);
+ InternalDictionaryDerived getDerived();
};
diff --git a/core/testing/InternalDictionary.idl b/core/testing/InternalDictionary.idl
index d0c4e60..b35e9a5 100644
--- a/core/testing/InternalDictionary.idl
+++ b/core/testing/InternalDictionary.idl
@@ -4,24 +4,34 @@
enum InternalEnum { "foo", "bar", "baz" };
-[
- GarbageCollected
-] dictionary InternalDictionary {
+dictionary InternalDictionary {
long longMember;
+ [Clamp] long longMemberWithClamp;
+ [EnforceRange] long longMemberWithEnforceRange;
+ // We don't want to add a UseCounter feature for testing, so using KeyboardEventKeyLocation.
+ [DeprecateAs=KeyboardEventKeyLocation, ImplementedAs=longMember] long deprecateLongMember;
long longMemberWithDefault = 42;
long? longOrNullMember;
long? longOrNullMemberWithDefault = null;
boolean booleanMember;
double doubleMember;
+ unrestricted double unrestrictedDoubleMember;
DOMString stringMember;
DOMString stringMemberWithDefault = "defaultStringValue";
+ ByteString byteStringMember;
+ USVString usvStringMember;
sequence<DOMString> stringSequenceMember;
+ sequence<DOMString> stringSequenceMemberWithDefault = [];
sequence<DOMString>? stringSequenceOrNullMember;
InternalEnum enumMember;
InternalEnum enumMemberWithDefault = "foo";
InternalEnum? enumOrNullMember;
+ InternalEnum[] enumArrayMember;
Element elementMember;
Element? elementOrNullMember;
object objectMember;
object? objectOrNullMemberWithDefault = null;
+ (double or DOMString) doubleOrStringMember;
+ sequence<(double or DOMString)> doubleOrStringSequenceMember;
+ EventTarget? eventTargetOrNullMember = null;
};
diff --git a/core/testing/InternalDictionaryDerived.idl b/core/testing/InternalDictionaryDerived.idl
new file mode 100644
index 0000000..63ec5fd
--- /dev/null
+++ b/core/testing/InternalDictionaryDerived.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.
+
+dictionary InternalDictionaryDerived : InternalDictionary {
+ DOMString derivedStringMember;
+ DOMString derivedStringMemberWithDefault = "derivedDefaultStringValue";
+ required boolean requiredBooleanMember;
+};
diff --git a/core/testing/InternalSettings.idl b/core/testing/InternalSettings.idl
index b04e925..c95af21 100644
--- a/core/testing/InternalSettings.idl
+++ b/core/testing/InternalSettings.idl
@@ -39,20 +39,20 @@
[RaisesException] void setPictographFontFamily(DOMString family, DOMString script);
[RaisesException] void setTextAutosizingEnabled(boolean enabled);
[RaisesException] void setTextAutosizingWindowSizeOverride(long width, long height);
+ [RaisesException] void setTextTrackKindUserPreference(DOMString preference);
[RaisesException] void setAccessibilityFontScaleFactor(float fontScaleFactor);
[RaisesException] void setMediaTypeOverride(DOMString mediaTypeOverride);
+ [RaisesException] void setDisplayModeOverride(DOMString displayModeOverride);
[RaisesException] void setEditingBehavior(DOMString behavior);
[RaisesException] void setImagesEnabled(boolean enabled);
[RaisesException] void setDefaultVideoPosterURL(DOMString poster);
[RaisesException] void setViewportEnabled(boolean enabled);
+ [RaisesException] void setViewportMetaEnabled(boolean enabled);
[RaisesException] void setAvailablePointerTypes(DOMString pointers);
[RaisesException] void setPrimaryPointerType(DOMString pointer);
[RaisesException] void setAvailableHoverTypes(DOMString types);
[RaisesException] void setPrimaryHoverType(DOMString type);
-
- // FIXME: This is a temporary flag and should be removed once squashing is
- // ready (crbug.com/261605).
- [RaisesException] void setLayerSquashingEnabled(boolean enabled);
+ [RaisesException] void setImageAnimationPolicy(DOMString policy);
// FIXME: The following are RuntimeEnabledFeatures and likely
// cannot be changed after process start. These setters should
@@ -61,6 +61,7 @@
void setLangAttributeAwareFormControlUIEnabled(boolean enabled);
void setOverlayScrollbarsEnabled(boolean enabled);
void setExperimentalContentSecurityPolicyFeaturesEnabled(boolean enabled);
- void setLaxMixedContentCheckingEnabled(boolean enabled);
- void setPseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled(boolean enabled);
+ void setImageColorProfilesEnabled(boolean enabled);
+ void setScrollTopLeftInteropEnabled(boolean enabled);
+ void setLinkHeaderEnabled(boolean enabled);
};
diff --git a/core/testing/Internals.idl b/core/testing/Internals.idl
index 1535447..23c3d70 100644
--- a/core/testing/Internals.idl
+++ b/core/testing/Internals.idl
@@ -27,20 +27,24 @@
[
DoNotCheckConstants,
GarbageCollected,
- Iterable,
+ TypeChecking=Interface,
+ ConstructorCallWith=ScriptState,
] interface Internals {
DOMString address(Node node);
GCObservation observeGC(any observed);
- [RaisesException, TypeChecking=Interface] DOMString elementRenderTreeAsText(Element element);
+ [RaisesException, TypeChecking=Interface] DOMString elementLayoutTreeAsText(Element element);
boolean isPreloaded(DOMString url);
+ boolean isPreloadedBy(DOMString url, Document document);
boolean isLoadingFromMemoryCache(DOMString url);
[TypeChecking=Interface] boolean isSharingStyle(Element element1, Element element2);
[TypeChecking=Interface] CSSStyleDeclaration computedStyleIncludingVisitedInfo(Node node);
+ [TypeChecking=Interface] ShadowRoot createUserAgentShadowRoot(Element host);
+
[TypeChecking=Interface] ShadowRoot shadowRoot(Element host);
[TypeChecking=Interface] ShadowRoot youngestShadowRoot(Element host);
[TypeChecking=Interface] ShadowRoot oldestShadowRoot(Element host);
@@ -57,20 +61,27 @@
[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);
+ [RaisesException] unsigned long hitTestCacheHits(Document document);
+ [RaisesException] Element? elementFromPoint(Document document, double x, double y, boolean ignoreClipping, boolean allowChildFrameContent);
+ [RaisesException] void clearHitTestCache(Document document);
- // CSS Animation and Transition testing.
+ // Animation testing.
[RaisesException] void pauseAnimations(double pauseTime);
+ bool isCompositedAnimation(Animation animation);
- [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);
+ // Modifies m_desiredFrameStartTime in BitmapImage to advance the next frame time
+ // for testing whether animated images work properly.
+ [RaisesException] void advanceTimeForImage(Element image, double deltaTimeInSeconds);
+
+ [RaisesException, TypeChecking=Interface] Node nextSiblingInComposedTree(Node node);
+ [RaisesException, TypeChecking=Interface] Node firstChildInComposedTree(Node node);
+ [RaisesException, TypeChecking=Interface] Node lastChildInComposedTree(Node node);
+ [RaisesException, TypeChecking=Interface] Node nextInComposedTree(Node node);
+ [RaisesException, TypeChecking=Interface] Node previousInComposedTree(Node node);
DOMString visiblePlaceholder(Element element);
@@ -81,8 +92,7 @@
boolean hasAutofocusRequest(optional Document document);
[RaisesException] DOMString[] formControlStateOfHistoryItem();
[RaisesException] void setFormControlStateOfHistoryItem(sequence<DOMString> values);
- [RaisesException] void setEnableMockPagePopup(boolean enabled);
- readonly attribute PagePopupController pagePopupController;
+ readonly attribute Window pagePopupWindow;
[RaisesException] ClientRect absoluteCaretBounds();
@@ -96,7 +106,7 @@
[TypeChecking=Interface] void setMarkersActive(Node node, unsigned long startOffset, unsigned long endOffset, boolean active);
void setMarkedTextMatchesAreHighlighted(Document document, boolean highlight);
- [RaisesException, TypeChecking=Interface] void setScrollViewPosition(Document document, long x, long y);
+ [RaisesException, TypeChecking=Interface] void setFrameViewPosition(Document document, long x, long y);
[RaisesException, TypeChecking=Interface] DOMString viewportAsText(Document document,
float devicePixelRatio,
@@ -135,6 +145,12 @@
[TypeChecking=Interface] unsigned long touchEventHandlerCount(Document document);
[RaisesException, TypeChecking=Interface] LayerRectList touchEventTargetLayerRects(Document document);
+ [RaisesException, TypeChecking=Interface] boolean executeCommand(Document document, DOMString name, DOMString value);
+
+ DOMString htmlNamespace();
+ sequence<DOMString> htmlTags();
+ DOMString svgNamespace();
+ sequence<DOMString> svgTags();
[RaisesException, TypeChecking=Interface] NodeList nodesFromRect(Document document, long x, long y,
unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
@@ -152,7 +168,6 @@
[TypeChecking=Interface] boolean isPageBoxVisible(Document document, long pageNumber);
readonly attribute InternalSettings settings;
- readonly attribute InternalProfilers profilers;
readonly attribute InternalRuntimeFlags runtimeFlags;
readonly attribute unsigned long workerThreadCount;
@@ -162,11 +177,13 @@
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;
+ const unsigned short LAYER_TREE_INCLUDES_SCROLL_BLOCKS_ON = 32;
+ const unsigned short LAYER_TREE_INCLUDES_PAINT_INVALIDATION_OBJECTS = 64;
+ const unsigned short LAYER_TREE_INCLUDES_COMPOSITING_REASONS = 128;
[RaisesException, TypeChecking=Interface] DOMString layerTreeAsText(Document document, optional unsigned short flags);
[RaisesException, TypeChecking=Interface] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
[RaisesException, TypeChecking=Interface] boolean scrollsWithRespectTo(Element element1, Element element2);
- [RaisesException, TypeChecking=Interface] boolean isUnclippedDescendant(Element element);
[TypeChecking=Interface] DOMString scrollingStateTreeAsText(Document document);
[RaisesException, TypeChecking=Interface] DOMString mainThreadScrollingReasons(Document document);
@@ -180,7 +197,6 @@
DOMString dumpRefCountedInstanceCounts();
sequence<DOMString> consoleMessageArgumentCounts(Document document);
unsigned long[] setMemoryCacheCapacities(unsigned long minDeadBytes, unsigned long maxDeadBytes, unsigned long totalBytes);
- [RaisesException] void setInspectorResourcesDataSizeLimits(long maximumResourcesContentSize, long maximumSingleResourceContentSize);
DOMString counterValue(Element element);
long pageNumber(Element element, optional float pageWidth, optional float pageHeight);
@@ -191,14 +207,17 @@
[RaisesException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
[RaisesException] void setDeviceScaleFactor(float scaleFactor);
+ [RaisesException] void setPageScaleFactor(float scaleFactor);
+ [RaisesException] void setPageScaleFactorLimits(float minScaleFactor, float maxScaleFactor);
[RaisesException, TypeChecking=Interface] void setIsCursorVisible(Document document, boolean isVisible);
- void mediaPlayerRequestFullscreen(HTMLMediaElement mediaElement);
- double effectiveMediaVolume(HTMLMediaElement mediaElement);
- void mediaPlayerRemoteRouteAvailabilityChanged(HTMLMediaElement mediaElement, boolean available);
+ [TypeChecking=Interface] double effectiveMediaVolume(HTMLMediaElement mediaElement);
+ [TypeChecking=Interface] void mediaPlayerRemoteRouteAvailabilityChanged(HTMLMediaElement mediaElement, boolean available);
+ [TypeChecking=Interface] void mediaPlayerPlayingRemotelyChanged(HTMLMediaElement mediaElement, boolean remote);
void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
+ void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme, sequence<DOMString> policyAreas);
void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
TypeConversions typeConversions();
@@ -218,7 +237,7 @@
// |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 updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
[RaisesException, TypeChecking=Interface] void forceFullRepaint(Document document);
@@ -227,7 +246,9 @@
[RaisesException, TypeChecking=Interface] ClientRectList nonDraggableRegions(Document document);
// Returns a string with information about the mouse cursor used at the specified client location.
- [RaisesException, TypeChecking=Interface] DOMString getCurrentCursorInfo(Document document);
+ [TypeChecking=Interface] DOMString getCurrentCursorInfo();
+
+ readonly attribute boolean cursorUpdatePending;
[TypeChecking=Interface] DOMString markerTextForListItem(Element element);
@@ -238,6 +259,7 @@
[TypeChecking=Interface] DOMString getImageSourceURL(Element element);
+ [TypeChecking=Interface] DOMString selectMenuListText(HTMLSelectElement select);
[TypeChecking=Interface] boolean isSelectPopupVisible(Node node);
boolean selectPopupItemStyleIsRtl(Node select, long itemIndex);
long selectPopupItemStyleFontHeight(Node select, long itemIndex);
@@ -258,12 +280,16 @@
[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);
+ [CallWith=ScriptState] Promise promiseCheckOverload(Location arg1);
+ [CallWith=ScriptState] Promise promiseCheckOverload(Document arg1);
+ [CallWith=ScriptState] Promise promiseCheckOverload(Location arg1, long arg2, long arg3);
void setValueForUser(Element element, DOMString value);
DOMString textSurroundingNode(Node node, long x, long y, unsigned long maxLength);
void setFocused(boolean focused);
+ void setInitialFocus(boolean reverse);
[TypeChecking=Interface] boolean ignoreLayoutWithPendingStylesheets(Document document);
@@ -275,11 +301,31 @@
// This function is for testing HitRegions on Canvas2D.
unsigned long countHitRegions(CanvasRenderingContext2D context);
- DOMString serializeNavigationMarkup();
- void hideAllTransitionElements();
+ [TypeChecking=Interface] boolean isInCanvasFontCache(Document document, DOMString fontString);
+ [TypeChecking=Interface] unsigned long canvasFontCacheMaxFonts();
- [RaisesException, TypeChecking=Interface] void forcePluginPlaceholder(HTMLElement plugin, DOMString htmlSource);
- [RaisesException, TypeChecking=Interface] void forcePluginPlaceholder(HTMLElement plugin, Dictionary options);
+ [TypeChecking=Interface] ClientRect boundsInViewportSpace(Element element);
+
+ [RaisesException, TypeChecking=Interface] void forcePluginPlaceholder(HTMLElement plugin, DocumentFragment fragment);
+ [RaisesException, TypeChecking=Interface] void forcePluginPlaceholder(HTMLElement plugin, PluginPlaceholderOptions options);
DictionaryTest dictionaryTest();
+ UnionTypesTest unionTypesTest();
+
+ void forceBlinkGCWithoutV8GC();
+
+ DOMString selectedHTMLForClipboard();
+ DOMString selectedTextForClipboard();
+
+ void setVisualViewportOffset(long x, long y);
+
+ boolean isUseCounted(Document document, long useCounterId);
+
+ iterable<long>;
+
+ [Unscopeable] readonly attribute DOMString unscopeableAttribute;
+ [Unscopeable] DOMString unscopeableMethod();
+
+ ClientRectList focusRingRects(Element element);
+ void setCapsLockState(boolean enabled);
};
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/core/testing/PluginPlaceholderOptions.idl
similarity index 65%
copy from core/html/canvas/EXTShaderTextureLOD.idl
copy to core/testing/PluginPlaceholderOptions.idl
index 975005a..c478c29 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/core/testing/PluginPlaceholderOptions.idl
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
-] interface EXTShaderTextureLOD {
+dictionary PluginPlaceholderOptions {
+ DOMString message;
+ boolean closeable;
};
diff --git a/core/testing/PrivateScriptTest.idl b/core/testing/PrivateScriptTest.idl
index 769aa5f..f2dd041 100644
--- a/core/testing/PrivateScriptTest.idl
+++ b/core/testing/PrivateScriptTest.idl
@@ -3,7 +3,8 @@
// found in the LICENSE file.
[
- GarbageCollected
+ GarbageCollected,
+ TypeChecking=Interface,
] interface PrivateScriptTest {
[ImplementedInPrivateScript] void doNothing();
[ImplementedInPrivateScript] short return123();
@@ -28,7 +29,7 @@
[ImplementedInPrivateScript] attribute short shortAttribute;
[ImplementedInPrivateScript] attribute DOMString stringAttribute;
[ImplementedInPrivateScript] attribute Node nodeAttribute;
- [ImplementedInPrivateScript] attribute Node nodeAttributeThrowsIndexSizeError;
+ [ImplementedInPrivateScript] attribute Node? nodeAttributeThrowsIndexSizeError;
[ImplementedInPrivateScript] void voidMethodThrowsDOMSyntaxError();
[ImplementedInPrivateScript] void voidMethodThrowsError();
[ImplementedInPrivateScript] void voidMethodThrowsTypeError();
diff --git a/core/testing/TypeConversions.idl b/core/testing/TypeConversions.idl
index ba3e99a..fbe1673 100644
--- a/core/testing/TypeConversions.idl
+++ b/core/testing/TypeConversions.idl
@@ -54,11 +54,11 @@
void setTestByteString(ByteString byteString);
[ImplementedAs=setTestByteString] void setTestByteStringDefaultNull(optional ByteString byteString = null);
- attribute ScalarValueString testScalarValueString;
- [ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Null] attribute ScalarValueString testScalarValueStringTreatReturnedNullStringAsNullAttribute;
- [ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Undefined] attribute ScalarValueString testScalarValueStringTreatReturnedNullStringAsUndefinedAttribute;
- [ImplementedAs=testScalarValueString] ScalarValueString? getTestScalarValueStringTreatReturnedNullStringAsNullMethod();
- [ImplementedAs=testScalarValueString, TreatReturnedNullStringAs=Undefined] ScalarValueString getTestScalarValueStringTreatReturnedNullStringAsUndefinedMethod();
- void setTestScalarValueString(ScalarValueString scalarValueString);
- [ImplementedAs=setTestScalarValueString] void setTestScalarValueStringDefaultNull(optional ScalarValueString scalarValueString = null);
+ attribute USVString testUSVString;
+ [ImplementedAs=testUSVString, TreatReturnedNullStringAs=Null] attribute USVString testUSVStringTreatReturnedNullStringAsNullAttribute;
+ [ImplementedAs=testUSVString, TreatReturnedNullStringAs=Undefined] attribute USVString testUSVStringTreatReturnedNullStringAsUndefinedAttribute;
+ [ImplementedAs=testUSVString] USVString? getTestUSVStringTreatReturnedNullStringAsNullMethod();
+ [ImplementedAs=testUSVString, TreatReturnedNullStringAs=Undefined] USVString getTestUSVStringTreatReturnedNullStringAsUndefinedMethod();
+ void setTestUSVString(USVString usvString);
+ [ImplementedAs=setTestUSVString] void setTestUSVStringDefaultNull(optional USVString usvString = null);
};
diff --git a/core/testing/UnionTypesTest.idl b/core/testing/UnionTypesTest.idl
new file mode 100644
index 0000000..d6cef15
--- /dev/null
+++ b/core/testing/UnionTypesTest.idl
@@ -0,0 +1,27 @@
+// 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 UnionTypesTest {
+ attribute (double or DOMString or DOMString[]) doubleOrStringOrStringArrayAttribute;
+
+ DOMString doubleOrStringArg((double or DOMString) arg);
+ DOMString doubleOrInternalEnumArg((double or InternalEnum) arg);
+
+ [ImplementedAs=doubleOrStringArg] DOMString doubleOrStringDefaultDoubleArg(optional (double or DOMString) arg = 3.14);
+ [ImplementedAs=doubleOrStringArg] DOMString doubleOrStringDefaultStringArg(optional (double or DOMString) arg = "foo");
+ [ImplementedAs=doubleOrStringArg] DOMString doubleOrStringDefaultNullArg(optional (double or DOMString)? arg = null);
+
+ DOMString doubleOrStringArrayArg((double or DOMString)[] arg);
+ DOMString doubleOrStringSequenceArg(sequence<(double or DOMString)> arg);
+
+ DOMString nodeListOrElementArg((NodeList or Element) arg);
+ DOMString nodeListOrElementOrNullArg((NodeList or Element)? arg);
+
+ DOMString doubleOrStringOrStringArrayArg((double or DOMString or DOMString[]) arg);
+ DOMString doubleOrStringOrStringSequenceArg((double or DOMString or sequence<DOMString>) arg);
+ [ImplementedAs=doubleOrStringOrStringArrayArg] DOMString doubleOrStringOrStringArrayNullableArg((double or DOMString or DOMString[])? arg);
+ [ImplementedAs=doubleOrStringOrStringSequenceArg] DOMString doubleOrStringOrStringSequenceNullableArg((double or DOMString or sequence<DOMString>)? arg);
+};
diff --git a/core/timing/ConsoleMemory.idl b/core/timing/ConsoleMemory.idl
new file mode 100644
index 0000000..2cf01b6
--- /dev/null
+++ b/core/timing/ConsoleMemory.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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.
+
+// TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+// https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
+
+partial interface Console {
+ // We can't make the attribute readonly as it breaks existing code that relies on being able to assign to console.memory in strict mode. Instead, the setter just ignores the passed value. http://crbug.com/468611
+ [Measure] attribute MemoryInfo memory;
+};
diff --git a/core/timing/DOMHighResTimeStamp.idl b/core/timing/DOMHighResTimeStamp.idl
new file mode 100644
index 0000000..e41c93a
--- /dev/null
+++ b/core/timing/DOMHighResTimeStamp.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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://w3c.github.io/hr-time/#sec-DOMHighResTimeStamp
+
+typedef double DOMHighResTimeStamp;
diff --git a/core/timing/MemoryInfo.idl b/core/timing/MemoryInfo.idl
index 552f175..325406d 100644
--- a/core/timing/MemoryInfo.idl
+++ b/core/timing/MemoryInfo.idl
@@ -28,14 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+// https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface MemoryInfo {
-
- readonly attribute unsigned long totalJSHeapSize;
- readonly attribute unsigned long usedJSHeapSize;
- readonly attribute unsigned long jsHeapSizeLimit;
-
+ [Measure] readonly attribute unsigned long totalJSHeapSize;
+ [Measure] readonly attribute unsigned long usedJSHeapSize;
+ [Measure] readonly attribute unsigned long jsHeapSizeLimit;
};
-
diff --git a/core/timing/Performance.idl b/core/timing/Performance.idl
index 50e62a8..6a8fab6 100644
--- a/core/timing/Performance.idl
+++ b/core/timing/Performance.idl
@@ -29,31 +29,53 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// See: http://www.w3.org/TR/navigation-timing/
-[
- WillBeGarbageCollected
-] interface Performance : EventTarget {
- readonly attribute PerformanceNavigation navigation;
- readonly attribute PerformanceTiming timing;
- readonly attribute MemoryInfo memory;
+// https://w3c.github.io/hr-time/#the-performance-interface
- [MeasureAs=UnprefixedPerformanceTimeline] sequence<PerformanceEntry> getEntries();
- [MeasureAs=UnprefixedPerformanceTimeline] sequence<PerformanceEntry> getEntriesByType(DOMString entryType);
- [MeasureAs=UnprefixedPerformanceTimeline] sequence<PerformanceEntry> getEntriesByName(DOMString name, optional DOMString entryType = null);
+// TODO(philipj): This interface should be [Exposed=(Window,Worker)]. Doing that
+// would allow the WorkerPerformance interface to be merged into this.
+// TODO(philipj): None of the optional DOMString arguments in this interface
+// should have a default value.
+interface Performance : EventTarget {
+ DOMHighResTimeStamp now();
+ // Performance Timeline
+ // https://w3c.github.io/performance-timeline/#the-performance-interface
+ // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+ [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntries();
+ [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByType(DOMString entryType);
+ [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType = null);
+
+ // Resource Timing
+ // https://w3c.github.io/resource-timing/#extensions-performance-interface
+ // TODO(philipj): Unprefix these APIs.
[MeasureAs=PrefixedPerformanceClearResourceTimings] void webkitClearResourceTimings();
[MeasureAs=PrefixedPerformanceSetResourceTimingBufferSize] void webkitSetResourceTimingBufferSize(unsigned long maxSize);
-
attribute EventHandler onwebkitresourcetimingbufferfull;
- // See http://www.w3.org/TR/2012/CR-user-timing-20120726/
- [RaisesException,MeasureAs=UnprefixedUserTiming] void mark(DOMString markName);
+ // Navigation Timing
+ // http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute
+ // TODO(philipj): The Navigation Timing Rec. defines the (not partial)
+ // Performance interface, while https://w3c.github.io/navigation-timing/ has
+ // changed the interface in an incompatible way:
+ // https://github.com/w3c/navigation-timing/issues/22
+ [Measure] readonly attribute PerformanceTiming timing;
+ [Measure] readonly attribute PerformanceNavigation navigation;
+
+ // User Timing
+ // https://w3c.github.io/user-timing/#extensions-performance-interface
+ [MeasureAs=UnprefixedUserTiming, RaisesException] void mark(DOMString markName);
[MeasureAs=UnprefixedUserTiming] void clearMarks(optional DOMString markName = null);
- [RaisesException,MeasureAs=UnprefixedUserTiming] void measure(DOMString measureName, optional DOMString startMark = null, optional DOMString endMark = null);
+ [MeasureAs=UnprefixedUserTiming, RaisesException] void measure(DOMString measureName, optional DOMString startMark = null, optional DOMString endMark = null);
[MeasureAs=UnprefixedUserTiming] void clearMeasures(optional DOMString measureName = null);
- // See http://www.w3.org/TR/hr-time/ for details.
- double now();
-};
+ // Frame Timing
+ // https://w3c.github.io/frame-timing/#extensions-performance-interface
+ [RuntimeEnabled=FrameTimingSupport, MeasureAs=PerformanceFrameTiming] void clearFrameTimings();
+ [RuntimeEnabled=FrameTimingSupport, MeasureAs=PerformanceFrameTiming] void setFrameTimingBufferSize(unsigned long maxSize);
+ [RuntimeEnabled=FrameTimingSupport] attribute EventHandler onframetimingbufferfull;
+ // TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+ // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
+ [Measure] readonly attribute MemoryInfo memory;
+};
diff --git a/modules/performance/WorkerGlobalScopePerformance.idl b/core/timing/PerformanceCompositeTiming.idl
similarity index 77%
copy from modules/performance/WorkerGlobalScopePerformance.idl
copy to core/timing/PerformanceCompositeTiming.idl
index 559003a..60eb075 100644
--- a/modules/performance/WorkerGlobalScopePerformance.idl
+++ b/core/timing/PerformanceCompositeTiming.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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
@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface WorkerGlobalScope {
- readonly attribute WorkerPerformance performance;
+// https://w3c.github.io/frame-timing/#performancecompositetiming
+
+[
+ RuntimeEnabled=FrameTimingSupport // Experimental flag
+] interface PerformanceCompositeTiming : PerformanceEntry {
+ // TODO(philipj): This is named |sourceFrameNumber| in the spec.
+ readonly attribute unsigned long sourceFrame;
+ // TODO(philipj): serializer = {inherit, attribute};
};
diff --git a/core/timing/PerformanceEntry.idl b/core/timing/PerformanceEntry.idl
index 8e382cd..b18ac79 100644
--- a/core/timing/PerformanceEntry.idl
+++ b/core/timing/PerformanceEntry.idl
@@ -28,12 +28,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
+// https://w3c.github.io/performance-timeline/#the-performanceentry-interface
+
[
- WillBeGarbageCollected,
+ // TODO(philipj): Exposed=(Window,Worker)
+ GarbageCollected,
] interface PerformanceEntry {
readonly attribute DOMString name;
readonly attribute DOMString entryType;
- readonly attribute double startTime;
- readonly attribute double duration;
+ readonly attribute DOMHighResTimeStamp startTime;
+ readonly attribute DOMHighResTimeStamp duration;
+ serializer = {attribute};
};
diff --git a/core/timing/PerformanceEntryList.idl b/core/timing/PerformanceEntryList.idl
new file mode 100644
index 0000000..7dea2f2
--- /dev/null
+++ b/core/timing/PerformanceEntryList.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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://w3c.github.io/performance-timeline/#idl-def-PerformanceEntryList
+
+typedef sequence<PerformanceEntry> PerformanceEntryList;
diff --git a/core/timing/PerformanceMark.idl b/core/timing/PerformanceMark.idl
index 6bae83e..9dc44ab 100644
--- a/core/timing/PerformanceMark.idl
+++ b/core/timing/PerformanceMark.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/user-timing/#performancemark
+
interface PerformanceMark : PerformanceEntry {
};
diff --git a/core/timing/PerformanceMeasure.idl b/core/timing/PerformanceMeasure.idl
index ee032b7..8b5f042 100644
--- a/core/timing/PerformanceMeasure.idl
+++ b/core/timing/PerformanceMeasure.idl
@@ -23,5 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/user-timing/#performancemeasure
+
interface PerformanceMeasure : PerformanceEntry {
};
diff --git a/core/timing/PerformanceNavigation.idl b/core/timing/PerformanceNavigation.idl
index ea485ab..4ed6c06 100644
--- a/core/timing/PerformanceNavigation.idl
+++ b/core/timing/PerformanceNavigation.idl
@@ -28,16 +28,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// See: http://www.w3.org/TR/navigation-timing/
+// http://www.w3.org/TR/navigation-timing/#sec-navigation-info-interface
+
+// TODO(philipj): This interface been morphed into PerformanceNavigationTiming
+// in the latest spec:
+// https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming
+
[
- WillBeGarbageCollected
+ GarbageCollected
] interface PerformanceNavigation {
const unsigned short TYPE_NAVIGATE = 0;
const unsigned short TYPE_RELOAD = 1;
const unsigned short TYPE_BACK_FORWARD = 2;
const unsigned short TYPE_RESERVED = 255;
readonly attribute unsigned short type;
-
readonly attribute unsigned short redirectCount;
};
-
diff --git a/core/testing/InternalProfilers.idl b/core/timing/PerformanceRenderTiming.idl
similarity index 78%
rename from core/testing/InternalProfilers.idl
rename to core/timing/PerformanceRenderTiming.idl
index 8387baf..eafd490 100644
--- a/core/testing/InternalProfilers.idl
+++ b/core/timing/PerformanceRenderTiming.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2015 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
@@ -28,11 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/frame-timing/#performancerendertiming
+
[
- GarbageCollected,
-] interface InternalProfilers {
- void startHeapProfiling(DOMString prefix);
- void stopHeapProfiling();
- void dumpHeapProfiling(DOMString reason);
- DOMString getHeapProfile();
+ RuntimeEnabled=FrameTimingSupport // Experimental flag
+] interface PerformanceRenderTiming : PerformanceEntry {
+ // TODO(philipj): This is named |sourceFrameNumber| in the spec.
+ readonly attribute unsigned long sourceFrame;
+ // TODO(philipj): serializer = {inherit, attribute};
};
diff --git a/core/timing/PerformanceResourceTiming.idl b/core/timing/PerformanceResourceTiming.idl
index 860c91d..d9a7cce 100644
--- a/core/timing/PerformanceResourceTiming.idl
+++ b/core/timing/PerformanceResourceTiming.idl
@@ -28,19 +28,28 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html
+// https://w3c.github.io/resource-timing/#performanceresourcetiming
+
+// TODO(philipj): This interface should be [Exposed=(Window,Worker)].
interface PerformanceResourceTiming : PerformanceEntry {
readonly attribute DOMString initiatorType;
-
- readonly attribute double redirectStart;
- readonly attribute double redirectEnd;
- readonly attribute double fetchStart;
- readonly attribute double domainLookupStart;
- readonly attribute double domainLookupEnd;
- readonly attribute double connectStart;
- readonly attribute double connectEnd;
- readonly attribute double secureConnectionStart;
- readonly attribute double requestStart;
- readonly attribute double responseStart;
- readonly attribute double responseEnd;
+ // TODO(philipj): readonly attribute DOMString nextHopProtocol;
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] readonly attribute DOMHighResTimeStamp workerStart;
+ readonly attribute DOMHighResTimeStamp redirectStart;
+ readonly attribute DOMHighResTimeStamp redirectEnd;
+ readonly attribute DOMHighResTimeStamp fetchStart;
+ readonly attribute DOMHighResTimeStamp domainLookupStart;
+ readonly attribute DOMHighResTimeStamp domainLookupEnd;
+ readonly attribute DOMHighResTimeStamp connectStart;
+ readonly attribute DOMHighResTimeStamp connectEnd;
+ readonly attribute DOMHighResTimeStamp secureConnectionStart;
+ readonly attribute DOMHighResTimeStamp requestStart;
+ readonly attribute DOMHighResTimeStamp responseStart;
+ readonly attribute DOMHighResTimeStamp responseEnd;
+ // TODO(philipj): The spec has tranferSize/encodedBodySize/decodedBodySize
+ // and a serializer:
+ // readonly attribute unsigned short transferSize;
+ // readonly attribute unsigned short encodedBodySize;
+ // readonly attribute unsigned short decodedBodySize;
+ // serializer = {inherit, attribute};
};
diff --git a/core/timing/PerformanceTiming.idl b/core/timing/PerformanceTiming.idl
index 3178e42..10fc224 100644
--- a/core/timing/PerformanceTiming.idl
+++ b/core/timing/PerformanceTiming.idl
@@ -28,9 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// See: http://dev.w3.org/2006/webapi/WebTiming/
+// http://www.w3.org/TR/navigation-timing/#sec-navigation-timing-interface
+
+// TODO(philipj): This interface been morphed into PerformanceNavigationTiming
+// in the latest spec:
+// https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming
+
[
- WillBeGarbageCollected
+ GarbageCollected
] interface PerformanceTiming {
readonly attribute unsigned long long navigationStart;
readonly attribute unsigned long long unloadEventStart;
@@ -53,5 +58,7 @@
readonly attribute unsigned long long domComplete;
readonly attribute unsigned long long loadEventStart;
readonly attribute unsigned long long loadEventEnd;
-};
+ // TODO(philipj): This serializer is not defined in the spec.
+ serializer = {attribute};
+};
diff --git a/modules/performance/SharedWorkerPerformance.idl b/core/timing/SharedWorkerPerformance.idl
similarity index 83%
rename from modules/performance/SharedWorkerPerformance.idl
rename to core/timing/SharedWorkerPerformance.idl
index cef9493..8010681 100644
--- a/modules/performance/SharedWorkerPerformance.idl
+++ b/core/timing/SharedWorkerPerformance.idl
@@ -27,7 +27,10 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(philipj): SharedWorker.workerStart was in the High Resolution Time spec,
+// but was removed in favor of Performance.translateTime():
+// https://github.com/w3c/hr-time/commit/39aaf81e1ea206fdf0fde4f49604ddd64d4f5b13
+
partial interface SharedWorker {
- // See https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime2/Overview.html for details.
- [CallWith=ExecutionContext] readonly attribute double workerStart;
+ [CallWith=ExecutionContext, Measure] readonly attribute DOMHighResTimeStamp workerStart;
};
diff --git a/core/timing/WindowPerformance.idl b/core/timing/WindowPerformance.idl
new file mode 100644
index 0000000..9418d5d
--- /dev/null
+++ b/core/timing/WindowPerformance.idl
@@ -0,0 +1,14 @@
+// Copyright 2015 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.w3.org/TR/navigation-timing/#sec-window.performance-attribute
+
+// TODO(philipj): Window.performance should be in High Resolution Time:
+// https://github.com/w3c/hr-time/issues/9
+
+[
+ ImplementedAs=DOMWindowPerformance,
+] partial interface Window {
+ [Replaceable] readonly attribute Performance performance;
+};
diff --git a/modules/performance/WorkerGlobalScopePerformance.idl b/core/timing/WorkerGlobalScopePerformance.idl
similarity index 93%
rename from modules/performance/WorkerGlobalScopePerformance.idl
rename to core/timing/WorkerGlobalScopePerformance.idl
index 559003a..1682a6e 100644
--- a/modules/performance/WorkerGlobalScopePerformance.idl
+++ b/core/timing/WorkerGlobalScopePerformance.idl
@@ -28,6 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// TODO(philipj): There is no spec for WorkerGlobalScope.performance:
+// https://github.com/w3c/hr-time/issues/10
+
partial interface WorkerGlobalScope {
readonly attribute WorkerPerformance performance;
};
diff --git a/core/timing/WorkerPerformance.idl b/core/timing/WorkerPerformance.idl
new file mode 100644
index 0000000..07c17c4
--- /dev/null
+++ b/core/timing/WorkerPerformance.idl
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+// https://w3c.github.io/hr-time/#the-performance-interface
+
+// TODO(philipj): This interface should be merged into Performance.
+// TODO(philipj): None of the optional DOMString arguments in this interface
+// should have a default value.
+[
+ GarbageCollected,
+ NoInterfaceObject
+] interface WorkerPerformance : EventTarget {
+ DOMHighResTimeStamp now();
+
+ // Performance Timeline
+ // https://w3c.github.io/performance-timeline/#the-performance-interface
+ // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] PerformanceEntryList getEntries();
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] PerformanceEntryList getEntriesByType(DOMString entryType);
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType = null);
+
+ // Resource Timing
+ // https://w3c.github.io/resource-timing/#extensions-performance-interface
+ // TODO(philipj): Unprefix these APIs.
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline, MeasureAs=PrefixedPerformanceClearResourceTimings] void webkitClearResourceTimings();
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline, MeasureAs=PrefixedPerformanceSetResourceTimingBufferSize] void webkitSetResourceTimingBufferSize(unsigned long maxSize);
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] attribute EventHandler onwebkitresourcetimingbufferfull;
+
+ // User Timing
+ // https://w3c.github.io/user-timing/#extensions-performance-interface
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline, RaisesException] void mark(DOMString markName);
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] void clearMarks(optional DOMString markName = null);
+
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline, RaisesException] void measure(DOMString measureName, optional DOMString startMark = null, optional DOMString endMark = null);
+ [RuntimeEnabled=ServiceWorkerPerformanceTimeline] void clearMeasures(optional DOMString measureName = null);
+
+ // TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+ // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
+ [RuntimeEnabled=MemoryInfoInWorkers] readonly attribute MemoryInfo memory;
+};
diff --git a/core/workers/AbstractWorker.idl b/core/workers/AbstractWorker.idl
index bfe9347..ee524ab 100644
--- a/core/workers/AbstractWorker.idl
+++ b/core/workers/AbstractWorker.idl
@@ -29,11 +29,12 @@
* 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
+// https://html.spec.whatwg.org/#the-abstractworker-abstract-interface
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
WillBeGarbageCollected,
] interface AbstractWorker {
attribute EventHandler onerror;
diff --git a/core/workers/DedicatedWorkerGlobalScope.idl b/core/workers/DedicatedWorkerGlobalScope.idl
index 66bc369..1fe2730 100644
--- a/core/workers/DedicatedWorkerGlobalScope.idl
+++ b/core/workers/DedicatedWorkerGlobalScope.idl
@@ -28,10 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
+
[
+ Global=(Worker,DedicatedWorker),
Exposed=DedicatedWorker,
- Global=(Worker,DedicatedWorker)
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
- [Custom, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
+ [PostMessage, 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 f839017..3e94cab 100644
--- a/core/workers/SharedWorker.idl
+++ b/core/workers/SharedWorker.idl
@@ -29,15 +29,16 @@
* 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
+// https://html.spec.whatwg.org/#shared-workers-and-the-sharedworker-interface
[
ActiveDOMObject,
+ // TODO(philipj): The name argument should not have a default null value.
Constructor(DOMString scriptURL, optional DOMString name = null),
ConstructorCallWith=ExecutionContext,
+ // TODO(philipj): Exposed=(Window,Worker),
RaisesException=Constructor,
RuntimeEnabled=SharedWorker,
- WillBeGarbageCollected,
] interface SharedWorker : EventTarget {
readonly attribute MessagePort port;
};
diff --git a/core/workers/SharedWorkerGlobalScope.idl b/core/workers/SharedWorkerGlobalScope.idl
index b6c1f15..abc4aaf 100644
--- a/core/workers/SharedWorkerGlobalScope.idl
+++ b/core/workers/SharedWorkerGlobalScope.idl
@@ -28,10 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#shared-workers-and-the-sharedworkerglobalscope-interface
+
[
+ Global=(Worker,SharedWorker),
Exposed=SharedWorker,
- Global=(Worker,SharedWorker)
] interface SharedWorkerGlobalScope : WorkerGlobalScope {
readonly attribute DOMString name;
- attribute EventHandler onconnect;
+ // TODO(philipj): readonly attribute ApplicationCache applicationCache;
+ attribute EventHandler onconnect;
};
diff --git a/core/workers/Worker.idl b/core/workers/Worker.idl
index a7d148e..cd657ab 100644
--- a/core/workers/Worker.idl
+++ b/core/workers/Worker.idl
@@ -25,20 +25,20 @@
*
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#dedicated-workers-and-the-worker-interface
+// https://html.spec.whatwg.org/#dedicated-workers-and-the-worker-interface
[
ActiveDOMObject,
Constructor(DOMString scriptUrl),
ConstructorCallWith=ExecutionContext,
+ // TODO(philipj): Exposed=(Window,Worker),
RaisesException=Constructor,
- WillBeGarbageCollected,
] interface Worker : EventTarget {
-
- attribute EventHandler onmessage;
-
- [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
void terminate();
+
+ // TODO(philipj): The SerializedScriptValue type should be any.
+ [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ attribute EventHandler onmessage;
};
Worker implements AbstractWorker;
diff --git a/core/workers/WorkerConsole.idl b/core/workers/WorkerConsole.idl
index 84e181b..79d4f8b 100644
--- a/core/workers/WorkerConsole.idl
+++ b/core/workers/WorkerConsole.idl
@@ -26,6 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// Console API (non-standard but widely implemented in some form)
+// https://developer.chrome.com/devtools/docs/console-api
+
+// TODO(philipj): Both Firefox and IE use the Console interface in workers and
+// on the main thread alike, with no WorkerConsole or similar interface.
+
[
NoInterfaceObject
] interface WorkerConsole : ConsoleBase {
diff --git a/core/workers/WorkerGlobalScope.idl b/core/workers/WorkerGlobalScope.idl
index ced2f23..1d3f4d5 100644
--- a/core/workers/WorkerGlobalScope.idl
+++ b/core/workers/WorkerGlobalScope.idl
@@ -24,26 +24,33 @@
*
*/
-[
- Custom=ToV8,
- Exposed=Worker,
- WillBeGarbageCollected
-] interface WorkerGlobalScope : EventTarget {
+// https://html.spec.whatwg.org/#the-workerglobalscope-common-interface
- // WorkerGlobalScope
- [Replaceable] readonly attribute WorkerGlobalScope self;
- [Replaceable] readonly attribute WorkerLocation location;
+[
+ Exposed=Worker,
+] interface WorkerGlobalScope : EventTarget {
+ readonly attribute WorkerGlobalScope self;
+ readonly attribute WorkerLocation location;
+
void close();
+ // TODO(philipj): onerror should be an OnErrorEventHandler.
attribute EventHandler onerror;
+ // attribute EventHandler onlanguagechange;
+ // attribute EventHandler onoffline;
+ // attribute EventHandler ononline;
+
+ // https://html.spec.whatwg.org/#apis-available-to-workers
+ [RaisesException] void importScripts(DOMString... urls);
+ readonly attribute WorkerNavigator navigator;
+
+ // Console API (non-standard but widely implemented in some form)
+ // https://developer.chrome.com/devtools/docs/console-api
[Replaceable] readonly attribute WorkerConsole console;
-
- // WorkerUtils
- [RaisesException] void importScripts(DOMString... urls);
- [Replaceable] readonly attribute WorkerNavigator navigator;
-
- // Additional constructors
- [MeasureAs=PrefixedWorkerURL] attribute URLConstructor webkitURL; // FIXME: deprecate this.
+ // Unhandled Promise Rejection Events
+ // https://github.com/domenic/unhandled-rejections-browser-spec
+ [RuntimeEnabled=PromiseRejectionEvent] attribute EventHandler onrejectionhandled;
+ [RuntimeEnabled=PromiseRejectionEvent] attribute EventHandler onunhandledrejection;
};
WorkerGlobalScope implements WindowBase64;
diff --git a/core/workers/WorkerLocation.idl b/core/workers/WorkerLocation.idl
index 252f3a7..dd60b70 100644
--- a/core/workers/WorkerLocation.idl
+++ b/core/workers/WorkerLocation.idl
@@ -26,12 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/workers/#workerlocation
+// https://html.spec.whatwg.org/#worker-locations
+
[
Exposed=Worker,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface WorkerLocation {
};
-// https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation
WorkerLocation implements URLUtilsReadOnly;
diff --git a/core/workers/WorkerNavigator.idl b/core/workers/WorkerNavigator.idl
index 1e82b03..a910af5 100644
--- a/core/workers/WorkerNavigator.idl
+++ b/core/workers/WorkerNavigator.idl
@@ -26,14 +26,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workernavigator-object
+// https://html.spec.whatwg.org/#the-workernavigator-object
[
Exposed=Worker,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface WorkerNavigator {
};
WorkerNavigator implements NavigatorCPU;
WorkerNavigator implements NavigatorID;
+// TODO(philipj): WorkerNavigator implements NavigatorLanguage;
WorkerNavigator implements NavigatorOnLine;
diff --git a/core/xml/DOMParser.idl b/core/xml/DOMParser.idl
index aa390c5..f817255 100644
--- a/core/xml/DOMParser.idl
+++ b/core/xml/DOMParser.idl
@@ -17,10 +17,20 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#the-domparser-interface
+
+enum SupportedType {
+ "text/html",
+ "text/xml",
+ "application/xml",
+ "application/xhtml+xml",
+ "image/svg+xml"
+};
+
[
- WillBeGarbageCollected,
- Constructor
+ Constructor,
+ ConstructorCallWith=Document,
+ GarbageCollected,
] interface DOMParser {
- [RaisesException] Document parseFromString([Default=Undefined] optional DOMString str,
- [Default=Undefined] optional DOMString contentType);
+ [NewObject] Document parseFromString(DOMString str, SupportedType type);
};
diff --git a/core/xml/DocumentXPathEvaluator.idl b/core/xml/DocumentXPathEvaluator.idl
index 8380ad0..12c03ff 100644
--- a/core/xml/DocumentXPathEvaluator.idl
+++ b/core/xml/DocumentXPathEvaluator.idl
@@ -17,14 +17,14 @@
* Boston, MA 02110-1301, USA.
*/
-partial interface Document {
- // DOM Level 3 XPath (XPathEvaluator interface)
- [MeasureAs=DocumentXPathCreateExpression, RaisesException] XPathExpression createExpression([Default=Undefined] optional DOMString expression,
- [Default=Undefined] optional XPathNSResolver resolver);
- [MeasureAs=DocumentXPathCreateNSResolver] XPathNSResolver createNSResolver(Node nodeResolver);
- [Custom, MeasureAs=DocumentXPathEvaluate, RaisesException] XPathResult evaluate([Default=Undefined] optional DOMString expression,
- [Default=Undefined] optional Node contextNode,
- [Default=Undefined] optional XPathNSResolver resolver,
- [Default=Undefined] optional unsigned short type,
- [Default=Undefined] optional XPathResult inResult);
+// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
+
+[
+ TypeChecking=Interface,
+] partial interface Document {
+ [MeasureAs=DocumentXPathCreateExpression, RaisesException] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null);
+
+ [MeasureAs=DocumentXPathCreateNSResolver] XPathNSResolver createNSResolver(Node nodeResolver);
+
+ [MeasureAs=DocumentXPathEvaluate, RaisesException] XPathResult evaluate(DOMString expression, Node contextNode, optional XPathNSResolver? resolver = null, optional unsigned short type = 0, optional object? inResult = null);
};
diff --git a/core/xml/XMLSerializer.idl b/core/xml/XMLSerializer.idl
index 1a7b627..ee2e83c 100644
--- a/core/xml/XMLSerializer.idl
+++ b/core/xml/XMLSerializer.idl
@@ -18,10 +18,12 @@
* Boston, MA 02110-1301, USA.
*/
-[
- WillBeGarbageCollected,
- Constructor
-] interface XMLSerializer {
- [RaisesException] DOMString serializeToString([Default=Undefined] optional Node node);
-};
+// https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#the-xmlserializer-interface
+[
+ Constructor,
+ GarbageCollected,
+ TypeChecking=Interface,
+] interface XMLSerializer {
+ DOMString serializeToString(Node root);
+};
diff --git a/core/xml/XPathEvaluator.idl b/core/xml/XPathEvaluator.idl
index d11018a..70f258f 100644
--- a/core/xml/XPathEvaluator.idl
+++ b/core/xml/XPathEvaluator.idl
@@ -17,18 +17,23 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
+
+// Note: The spec says "the XPathEvaluator interface will be implemented on the
+// same object which implements the Document interface" and does not define a
+// constructor or other means to create an XPathEvaluator object. Nonetheless,
+// Blink, Gecko, Presto, WebKit and all have these APIs on both Document and the
+// constructable XPathEvaluator interface.
+
[
- WillBeGarbageCollected,
- Constructor
+ Constructor,
+ GarbageCollected,
+ Measure,
+ TypeChecking=Interface,
] interface XPathEvaluator {
- [RaisesException] XPathExpression createExpression([Default=Undefined] optional DOMString expression,
- [Default=Undefined] optional XPathNSResolver resolver);
+ [Measure, RaisesException] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null);
- XPathNSResolver createNSResolver([Default=Undefined] optional Node nodeResolver);
+ [Measure] XPathNSResolver createNSResolver(Node nodeResolver);
- [RaisesException] XPathResult evaluate([Default=Undefined] optional DOMString expression,
- [Default=Undefined] optional Node contextNode,
- [Default=Undefined] optional XPathNSResolver resolver,
- [Default=Undefined] optional unsigned short type,
- [Default=Undefined] optional XPathResult inResult);
+ [Measure, RaisesException] XPathResult evaluate(DOMString expression, Node contextNode, optional XPathNSResolver? resolver = null, optional unsigned short type = 0, optional object? inResult = null);
};
diff --git a/core/xml/XPathExpression.idl b/core/xml/XPathExpression.idl
index 35ab908..397fb25 100644
--- a/core/xml/XPathExpression.idl
+++ b/core/xml/XPathExpression.idl
@@ -18,11 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-[
- WillBeGarbageCollected
-] interface XPathExpression {
- [RaisesException] XPathResult evaluate([Default=Undefined] optional Node contextNode,
- [Default=Undefined] optional unsigned short type,
- [Default=Undefined] optional XPathResult inResult);
-};
+// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
+[
+ GarbageCollected,
+ TypeChecking=Interface,
+] interface XPathExpression {
+ [RaisesException] XPathResult evaluate(Node contextNode, optional unsigned short type = 0, optional object? inResult = null);
+};
diff --git a/core/xml/XPathNSResolver.idl b/core/xml/XPathNSResolver.idl
index 2985d3a..e5888ee 100644
--- a/core/xml/XPathNSResolver.idl
+++ b/core/xml/XPathNSResolver.idl
@@ -18,10 +18,16 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
+
+// TODO(philipj): XPathNSResolver should be a callback interface. The spec
+// doesn't say so, but doing so would allow the custom bindings to be removed.
+// createNSResolver(Node nodeResolver) could simply return its argument, which
+// is what Gecko does. crbug.com/345529
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface XPathNSResolver {
DOMString? lookupNamespaceURI([Default=Undefined] optional DOMString prefix);
};
-
diff --git a/core/xml/XPathResult.idl b/core/xml/XPathResult.idl
index f60a5ea..319b719 100644
--- a/core/xml/XPathResult.idl
+++ b/core/xml/XPathResult.idl
@@ -17,9 +17,12 @@
* Boston, MA 02110-1301, USA.
*/
+// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
+
[
- WillBeGarbageCollected
+ GarbageCollected
] interface XPathResult {
+ // XPathResultType
const unsigned short ANY_TYPE = 0;
const unsigned short NUMBER_TYPE = 1;
const unsigned short STRING_TYPE = 2;
@@ -43,7 +46,6 @@
readonly attribute boolean invalidIteratorState;
[RaisesException=Getter] readonly attribute unsigned long snapshotLength;
- [RaisesException] Node iterateNext();
- [RaisesException] Node snapshotItem([Default=Undefined] optional unsigned long index);
+ [RaisesException] Node? iterateNext();
+ [RaisesException] Node? snapshotItem(unsigned long index);
};
-
diff --git a/core/xml/XSLTProcessor.idl b/core/xml/XSLTProcessor.idl
index f8d3b1d..221628f 100644
--- a/core/xml/XSLTProcessor.idl
+++ b/core/xml/XSLTProcessor.idl
@@ -26,28 +26,32 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// Eventually we should implement XSLTException:
-// http://lxr.mozilla.org/seamonkey/source/content/xsl/public/nsIXSLTException.idl
-// http://bugs.webkit.org/show_bug.cgi?id=5446
+// There is no spec for XSLTProcessor. It was first implemented in Gecko and
+// their interface definition remains the closest thing to a spec:
+// https://hg.mozilla.org/mozilla-central/file/012853bd80b7/dom/webidl/XSLTProcessor.webidl
[
- WillBeGarbageCollected,
+ GarbageCollected,
Constructor,
ConstructorCallWith=Document,
RuntimeEnabled=XSLT,
- MeasureAs=XSLTProcessor
+ MeasureAs=XSLTProcessor,
+ TypeChecking=Interface,
] interface XSLTProcessor {
- void importStylesheet([Default=Undefined] optional Node stylesheet);
- [CustomElementCallbacks] DocumentFragment transformToFragment([Default=Undefined] optional Node source, [Default=Undefined] optional Document docVal);
- [CustomElementCallbacks] Document transformToDocument([Default=Undefined] optional Node source);
+ void importStylesheet(Node style);
+ // TODO(philipj): In Gecko, the transformTo*() methods throw an exception in
+ // case of error instead of returning null.
+ [CustomElementCallbacks] DocumentFragment? transformToFragment(Node source, Document output);
+ [CustomElementCallbacks] Document? transformToDocument(Node source);
- [Custom] void setParameter(DOMString namespaceURI, DOMString localName, DOMString value);
- [Custom, TreatReturnedNullStringAs=Undefined] DOMString getParameter(DOMString namespaceURI, DOMString localName);
- [Custom] void removeParameter(DOMString namespaceURI, DOMString localName);
+ // TODO(philipj): In Gecko, it's possible to set and get back any parameter
+ // value, not just DOMString.
+ void setParameter(DOMString? namespaceURI, DOMString localName, DOMString value);
+ DOMString? getParameter(DOMString? namespaceURI, DOMString localName);
+ void removeParameter(DOMString? namespaceURI, DOMString localName);
void clearParameters();
void reset();
};
-
diff --git a/core/xml/XMLHttpRequest.idl b/core/xmlhttprequest/XMLHttpRequest.idl
similarity index 67%
rename from core/xml/XMLHttpRequest.idl
rename to core/xmlhttprequest/XMLHttpRequest.idl
index 4facb56..da14664 100644
--- a/core/xml/XMLHttpRequest.idl
+++ b/core/xmlhttprequest/XMLHttpRequest.idl
@@ -26,6 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://xhr.spec.whatwg.org/#interface-xmlhttprequest
+
enum XMLHttpRequestResponseType {
"",
"arraybuffer",
@@ -34,60 +36,51 @@
"json",
"text",
"legacystream",
- "stream"
};
+// TODO(philipj): Most DOMString types in the XMLHttpRequest interface should be
+// either ByteString or USVString.
[
- WillBeGarbageCollected,
ActiveDOMObject,
- CustomConstructor(optional XMLHttpRequestOptions options),
+ Constructor,
+ ConstructorCallWith=ScriptState,
+ // TODO(philipj): The spec has Exposed=(Window,Worker)
+ // https://github.com/whatwg/xhr/issues/19
Exposed=(Window,DedicatedWorker,SharedWorker)
] interface XMLHttpRequest : XMLHttpRequestEventTarget {
- // event handler attributes
+ // event handler
attribute EventHandler onreadystatechange;
- // state
+ // states
const unsigned short UNSENT = 0;
const unsigned short OPENED = 1;
const unsigned short HEADERS_RECEIVED = 2;
const unsigned short LOADING = 3;
const unsigned short DONE = 4;
-
- [RaisesException=Setter] attribute unsigned long timeout;
readonly attribute unsigned short readyState;
+ // request
+ [RaisesException] void open(DOMString method, DOMString url);
+ [RaisesException] void open(DOMString method, DOMString url, boolean async, optional DOMString? username = null, optional DOMString? password = null);
+ [RaisesException] void setRequestHeader(DOMString name, DOMString value);
+ [RaisesException=Setter] attribute unsigned long timeout;
[RaisesException=Setter] attribute boolean withCredentials;
-
- [Custom, RaisesException] void open(DOMString method, DOMString url, optional boolean async, optional DOMString user, optional DOMString password);
-
- [RaisesException] void setRequestHeader(DOMString header, DOMString value);
-
- [Custom, RaisesException] void send();
- // FIXMEDART: send(ArrayBuffer data) should be eventually deprecated.
- [DartCustom=New] void send(ArrayBuffer data);
- [DartCustom=New] void send(ArrayBufferView data);
- [DartCustom=New] void send(Blob data);
- [DartCustom=New] void send(Document data);
- [DartCustom=New] void send(DOMString data);
- [DartCustom=New] void send(FormData data);
-
+ readonly attribute XMLHttpRequestUpload upload;
+ // TODO(philipj): The data argument should be of type
+ // (Document or BodyInit)?
+ [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob or Document or DOMString or FormData)? body = null);
void abort();
- readonly attribute XMLHttpRequestUpload upload;
-
// response
- [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders();
- DOMString? getResponseHeader(DOMString header);
- [Custom=Getter, RaisesException=Getter] readonly attribute DOMString? responseText;
- [RaisesException=Getter] readonly attribute Document responseXML;
-
- [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType;
- [Custom=Getter, RaisesException=Getter] readonly attribute object response;
readonly attribute DOMString responseURL;
-
readonly attribute unsigned short status;
readonly attribute DOMString statusText;
-
- // Extension
- [RaisesException] void overrideMimeType(DOMString override);
+ DOMString? getResponseHeader(DOMString name);
+ DOMString getAllResponseHeaders();
+ [RaisesException] void overrideMimeType(DOMString mime);
+ [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType;
+ [Custom=Getter, RaisesException=Getter] readonly attribute any response;
+ [Custom=Getter, RaisesException=Getter] readonly attribute DOMString responseText;
+ // TODO(philipj): responseXML should be [Exposed=Window].
+ [RaisesException=Getter] readonly attribute Document? responseXML;
};
diff --git a/core/xml/XMLHttpRequestEventTarget.idl b/core/xmlhttprequest/XMLHttpRequestEventTarget.idl
similarity index 86%
rename from core/xml/XMLHttpRequestEventTarget.idl
rename to core/xmlhttprequest/XMLHttpRequestEventTarget.idl
index 7ec93d9..6854477 100644
--- a/core/xml/XMLHttpRequestEventTarget.idl
+++ b/core/xmlhttprequest/XMLHttpRequestEventTarget.idl
@@ -24,14 +24,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://xhr.spec.whatwg.org/#xmlhttprequesteventtarget
+
[
- NoInterfaceObject
+ GarbageCollected,
+ // TODO(philipj): The spec has Exposed=(Window,Worker)
+ // https://github.com/whatwg/xhr/issues/19
+ Exposed=(Window,DedicatedWorker,SharedWorker)
] interface XMLHttpRequestEventTarget : EventTarget {
+ // event handlers
+ attribute EventHandler onloadstart;
+ attribute EventHandler onprogress;
attribute EventHandler onabort;
attribute EventHandler onerror;
attribute EventHandler onload;
- attribute EventHandler onloadend;
- attribute EventHandler onloadstart;
- attribute EventHandler onprogress;
attribute EventHandler ontimeout;
+ attribute EventHandler onloadend;
};
diff --git a/core/xml/XMLHttpRequestProgressEvent.idl b/core/xmlhttprequest/XMLHttpRequestProgressEvent.idl
similarity index 95%
rename from core/xml/XMLHttpRequestProgressEvent.idl
rename to core/xmlhttprequest/XMLHttpRequestProgressEvent.idl
index 41bed63..950a854 100644
--- a/core/xml/XMLHttpRequestProgressEvent.idl
+++ b/core/xmlhttprequest/XMLHttpRequestProgressEvent.idl
@@ -23,9 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// We should also inherit from LSProgressEvent when the idl is added.
+// TODO(philipj): Remove this interface together with position/totalSize.
interface XMLHttpRequestProgressEvent : ProgressEvent {
[DeprecateAs=XHRProgressEventPosition] readonly attribute unsigned long long position;
[DeprecateAs=XHRProgressEventTotalSize] readonly attribute unsigned long long totalSize;
};
-
diff --git a/core/xml/XMLHttpRequestUpload.idl b/core/xmlhttprequest/XMLHttpRequestUpload.idl
similarity index 91%
rename from core/xml/XMLHttpRequestUpload.idl
rename to core/xmlhttprequest/XMLHttpRequestUpload.idl
index ae66d38..a5ac933 100644
--- a/core/xml/XMLHttpRequestUpload.idl
+++ b/core/xmlhttprequest/XMLHttpRequestUpload.idl
@@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://xhr.spec.whatwg.org/#xmlhttprequestupload
+
+// TODO(philipj): The spec has Exposed=(Window,Worker)
+// https://github.com/whatwg/xhr/issues/19
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget {
};
-
diff --git a/modules/README b/modules/README
index 418d1e5..630832e 100644
--- a/modules/README
+++ b/modules/README
@@ -5,5 +5,5 @@
using the script: $DART_ROOT/sdk/lib/html/scripts/idlsync.py
The current version corresponds to:
-URL: http://src.chromium.org/blink/branches/dart/dartium
-Current revision: 190578
+URL: https://src.chromium.org/blink/branches/dart/2454_1
+Current revision: 202759
diff --git a/modules/accessibility/testing/InternalsAccessibility.idl b/modules/accessibility/testing/InternalsAccessibility.idl
new file mode 100644
index 0000000..90c1c8a
--- /dev/null
+++ b/modules/accessibility/testing/InternalsAccessibility.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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 Internals {
+ unsigned long numberOfLiveAXObjects();
+};
diff --git a/modules/app_banner/AppBannerPromptResult.idl b/modules/app_banner/AppBannerPromptResult.idl
new file mode 100644
index 0000000..6ac8395
--- /dev/null
+++ b/modules/app_banner/AppBannerPromptResult.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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.
+
+enum AppBannerPromptOutcome { "accepted", "dismissed" };
+
+[
+ GarbageCollected,
+ RuntimeEnabled=AppBanner,
+] interface AppBannerPromptResult {
+ readonly attribute DOMString platform;
+ readonly attribute AppBannerPromptOutcome outcome;
+};
diff --git a/modules/app_banner/BeforeInstallPromptEvent.idl b/modules/app_banner/BeforeInstallPromptEvent.idl
new file mode 100644
index 0000000..691aa0c
--- /dev/null
+++ b/modules/app_banner/BeforeInstallPromptEvent.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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(DOMString type, optional BeforeInstallPromptEventInit eventInitDict),
+ RuntimeEnabled=AppBanner,
+] interface BeforeInstallPromptEvent : Event {
+ readonly attribute sequence<DOMString> platforms;
+ [CallWith=ScriptState] readonly attribute Promise<DOMString> userChoice;
+ [CallWith=ScriptState] Promise<void> prompt();
+};
diff --git a/modules/app_banner/BeforeInstallPromptEventInit.idl b/modules/app_banner/BeforeInstallPromptEventInit.idl
new file mode 100644
index 0000000..fc66cc8
--- /dev/null
+++ b/modules/app_banner/BeforeInstallPromptEventInit.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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.
+
+dictionary BeforeInstallPromptEventInit : EventInit {
+ sequence<DOMString> platforms;
+};
diff --git a/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl b/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl
new file mode 100644
index 0000000..a530d62
--- /dev/null
+++ b/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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://w3c.github.io/mediacapture-output/#htmlmediaelement-extensions
+
+partial interface HTMLMediaElement {
+ [RuntimeEnabled=AudioOutputDevices] readonly attribute DOMString sinkId;
+ [RuntimeEnabled=AudioOutputDevices, TypeChecking=Interface, CallWith=ScriptState] Promise<void> setSinkId(DOMString sinkId);
+};
+
diff --git a/modules/background_sync/PeriodicSyncEvent.idl b/modules/background_sync/PeriodicSyncEvent.idl
new file mode 100644
index 0000000..826fb6c
--- /dev/null
+++ b/modules/background_sync/PeriodicSyncEvent.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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(DOMString type, PeriodicSyncEventInit init),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundSync,
+] interface PeriodicSyncEvent : ExtendableEvent {
+ readonly attribute PeriodicSyncRegistration registration;
+};
diff --git a/modules/background_sync/PeriodicSyncEventInit.idl b/modules/background_sync/PeriodicSyncEventInit.idl
new file mode 100644
index 0000000..60d2b72
--- /dev/null
+++ b/modules/background_sync/PeriodicSyncEventInit.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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.
+
+dictionary PeriodicSyncEventInit : ExtendableEventInit {
+ required PeriodicSyncRegistration registration;
+};
diff --git a/modules/background_sync/PeriodicSyncManager.idl b/modules/background_sync/PeriodicSyncManager.idl
new file mode 100644
index 0000000..44c3f76
--- /dev/null
+++ b/modules/background_sync/PeriodicSyncManager.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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.
+
+[
+ Exposed=(Window,ServiceWorker),
+ GarbageCollected,
+ RuntimeEnabled=BackgroundSync,
+ TypeChecking=Interface,
+] interface PeriodicSyncManager {
+ [CallWith=ScriptState,ImplementedAs=registerFunction] Promise<PeriodicSyncRegistration> register([RuntimeEnabled=BackgroundSyncV2] optional PeriodicSyncRegistrationOptions options);
+ [RuntimeEnabled=BackgroundSyncV2, CallWith=ScriptState] Promise<PeriodicSyncRegistration> getRegistration(DOMString tag);
+ [RuntimeEnabled=BackgroundSyncV2, CallWith=ScriptState] Promise<sequence<PeriodicSyncRegistration>> getRegistrations();
+ [RuntimeEnabled=BackgroundSyncV2, CallWith=ScriptState] Promise<SyncPermissionState> permissionState();
+ [RuntimeEnabled=BackgroundSyncV2] readonly attribute unsigned long minPossiblePeriod;
+};
diff --git a/modules/background_sync/PeriodicSyncRegistration.idl b/modules/background_sync/PeriodicSyncRegistration.idl
new file mode 100644
index 0000000..4cc19f6
--- /dev/null
+++ b/modules/background_sync/PeriodicSyncRegistration.idl
@@ -0,0 +1,26 @@
+// Copyright 2015 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.
+
+enum SyncNetworkState {
+ "any",
+ "avoid-cellular",
+ "online"
+};
+
+enum SyncPowerState {
+ "auto",
+ "avoid-draining"
+};
+
+[
+ Exposed=(Window,ServiceWorker),
+ GarbageCollected,
+ RuntimeEnabled=BackgroundSync,
+] interface PeriodicSyncRegistration {
+ [RuntimeEnabled=BackgroundSyncV2] readonly attribute DOMString tag;
+ [RuntimeEnabled=BackgroundSyncV2] readonly attribute unsigned long minPeriod;
+ [RuntimeEnabled=BackgroundSyncV2] readonly attribute SyncNetworkState networkState;
+ [RuntimeEnabled=BackgroundSyncV2] readonly attribute SyncPowerState powerState;
+ [CallWith=ScriptState] Promise<boolean> unregister();
+};
diff --git a/modules/background_sync/PeriodicSyncRegistrationOptions.idl b/modules/background_sync/PeriodicSyncRegistrationOptions.idl
new file mode 100644
index 0000000..97c0a82
--- /dev/null
+++ b/modules/background_sync/PeriodicSyncRegistrationOptions.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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=BackgroundSync,
+] dictionary PeriodicSyncRegistrationOptions {
+ DOMString tag;
+ unsigned long minPeriod = 0;
+ SyncNetworkState networkState = "network-online";
+ SyncPowerState powerState = "auto";
+};
diff --git a/modules/background_sync/ServiceWorkerGlobalScopeSync.idl b/modules/background_sync/ServiceWorkerGlobalScopeSync.idl
new file mode 100644
index 0000000..f8a766a
--- /dev/null
+++ b/modules/background_sync/ServiceWorkerGlobalScopeSync.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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=BackgroundSync,
+] partial interface ServiceWorkerGlobalScope {
+ attribute EventHandler onsync;
+ attribute EventHandler onperiodicsync;
+};
diff --git a/modules/background_sync/ServiceWorkerRegistrationSync.idl b/modules/background_sync/ServiceWorkerRegistrationSync.idl
new file mode 100644
index 0000000..ee4ad72
--- /dev/null
+++ b/modules/background_sync/ServiceWorkerRegistrationSync.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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.
+
+[
+ Exposed=(Window, ServiceWorker),
+ RuntimeEnabled=BackgroundSync,
+] partial interface ServiceWorkerRegistration {
+ [MeasureAs=BackgroundSync] readonly attribute SyncManager sync;
+ [MeasureAs=BackgroundSync] readonly attribute PeriodicSyncManager periodicSync;
+};
diff --git a/modules/background_sync/SyncEvent.idl b/modules/background_sync/SyncEvent.idl
new file mode 100644
index 0000000..ae8a874
--- /dev/null
+++ b/modules/background_sync/SyncEvent.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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(DOMString type, SyncEventInit init),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundSync,
+] interface SyncEvent : ExtendableEvent {
+ readonly attribute SyncRegistration registration;
+};
diff --git a/modules/background_sync/SyncEventInit.idl b/modules/background_sync/SyncEventInit.idl
new file mode 100644
index 0000000..a7d2f51
--- /dev/null
+++ b/modules/background_sync/SyncEventInit.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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.
+
+dictionary SyncEventInit : ExtendableEventInit {
+ required SyncRegistration registration;
+};
diff --git a/modules/background_sync/SyncManager.idl b/modules/background_sync/SyncManager.idl
new file mode 100644
index 0000000..a8a9962
--- /dev/null
+++ b/modules/background_sync/SyncManager.idl
@@ -0,0 +1,21 @@
+// Copyright 2015 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.
+
+enum SyncPermissionState {
+ "default",
+ "denied",
+ "granted"
+};
+
+[
+ Exposed=(Window,ServiceWorker),
+ GarbageCollected,
+ RuntimeEnabled=BackgroundSync,
+ TypeChecking=Interface,
+] interface SyncManager {
+ [CallWith=ScriptState,ImplementedAs=registerFunction] Promise<SyncRegistration> register([RuntimeEnabled=BackgroundSyncV2] optional SyncRegistrationOptions options);
+ [RuntimeEnabled=BackgroundSyncV2, CallWith=ScriptState] Promise<SyncRegistration> getRegistration(DOMString tag);
+ [RuntimeEnabled=BackgroundSyncV2, CallWith=ScriptState] Promise<sequence<SyncRegistration>> getRegistrations();
+ [RuntimeEnabled=BackgroundSyncV2, CallWith=ScriptState] Promise<SyncPermissionState> permissionState();
+};
diff --git a/modules/background_sync/SyncRegistration.idl b/modules/background_sync/SyncRegistration.idl
new file mode 100644
index 0000000..171e3e4
--- /dev/null
+++ b/modules/background_sync/SyncRegistration.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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.
+
+[
+ Exposed=(Window,ServiceWorker),
+ GarbageCollected,
+ RuntimeEnabled=BackgroundSync,
+] interface SyncRegistration {
+ [RuntimeEnabled=BackgroundSyncV2] readonly attribute DOMString tag;
+ [CallWith=ScriptState] Promise<boolean> unregister();
+};
diff --git a/modules/background_sync/SyncRegistrationOptions.idl b/modules/background_sync/SyncRegistrationOptions.idl
new file mode 100644
index 0000000..6e1abbc
--- /dev/null
+++ b/modules/background_sync/SyncRegistrationOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=BackgroundSyncV2,
+] dictionary SyncRegistrationOptions {
+ DOMString tag;
+};
diff --git a/modules/battery/BatteryManager.idl b/modules/battery/BatteryManager.idl
index 33a059f..1237a51 100644
--- a/modules/battery/BatteryManager.idl
+++ b/modules/battery/BatteryManager.idl
@@ -4,8 +4,6 @@
// https://dvcs.w3.org/hg/dap/raw-file/tip/battery/Overview.html#batterymanager-interface
[
- RuntimeEnabled=BatteryStatus,
- TypeChecking=Unrestricted,
ActiveDOMObject
] interface BatteryManager : EventTarget {
readonly attribute boolean charging;
diff --git a/modules/battery/NavigatorBattery.idl b/modules/battery/NavigatorBattery.idl
index c5bff09..e3950a6 100644
--- a/modules/battery/NavigatorBattery.idl
+++ b/modules/battery/NavigatorBattery.idl
@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- RuntimeEnabled=BatteryStatus,
-] partial interface Navigator {
+partial interface Navigator {
[CallWith=ScriptState] Promise getBattery();
};
diff --git a/modules/beacon/NavigatorBeacon.idl b/modules/beacon/NavigatorBeacon.idl
index 7b31421..34f7323 100644
--- a/modules/beacon/NavigatorBeacon.idl
+++ b/modules/beacon/NavigatorBeacon.idl
@@ -4,12 +4,6 @@
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/Beacon/Overview.html#Navigator
-[
- RuntimeEnabled=Beacon,
-] partial interface Navigator {
- // FIXME: should be union type http://crbug.com/240176
- [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);
+partial interface Navigator {
+ [CallWith=ExecutionContext, MeasureAs=SendBeacon, RaisesException] boolean sendBeacon(DOMString url, optional (ArrayBufferView or Blob or DOMString or FormData)? data = null);
};
diff --git a/modules/bluetooth/Bluetooth.idl b/modules/bluetooth/Bluetooth.idl
new file mode 100644
index 0000000..28cf361
--- /dev/null
+++ b/modules/bluetooth/Bluetooth.idl
@@ -0,0 +1,15 @@
+// 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetooth
+
+[
+ GarbageCollected,
+ NoInterfaceObject,
+ RuntimeEnabled=WebBluetooth,
+] interface Bluetooth {
+ [CallWith=ScriptState, RaisesException] Promise<BluetoothDevice> requestDevice (
+ RequestDeviceOptions options
+ );
+};
diff --git a/modules/bluetooth/BluetoothDevice.idl b/modules/bluetooth/BluetoothDevice.idl
new file mode 100644
index 0000000..70ba6f8
--- /dev/null
+++ b/modules/bluetooth/BluetoothDevice.idl
@@ -0,0 +1,34 @@
+// 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothdevice
+
+// Implement BluetoothDevice interface: http://crbug.com/421668
+
+enum VendorIDSource {
+ "bluetooth",
+ "usb"
+};
+
+[
+ GarbageCollected,
+ RuntimeEnabled=WebBluetooth,
+] interface BluetoothDevice
+// Implement ServiceEventHandlers interface: http://crbug.com/421670
+// : ServiceEventHandlers
+{
+// Implement BluetoothDevice interface: http://crbug.com/421668
+ readonly attribute DOMString instanceID;
+ readonly attribute DOMString? name;
+// readonly attribute BluetoothAdvertisingData adData;
+ readonly attribute unsigned long? deviceClass;
+ readonly attribute VendorIDSource? vendorIDSource;
+ readonly attribute unsigned long? vendorID;
+ readonly attribute unsigned long? productID;
+ readonly attribute unsigned long? productVersion;
+ readonly attribute boolean paired;
+// readonly attribute BluetoothGATTRemoteServer? gattServer;
+ readonly attribute UUID[] uuids;
+ [CallWith=ScriptState] Promise<BluetoothGATTRemoteServer> connectGATT ();
+};
diff --git a/modules/bluetooth/BluetoothGATTCharacteristic.idl b/modules/bluetooth/BluetoothGATTCharacteristic.idl
new file mode 100644
index 0000000..c3e0eea
--- /dev/null
+++ b/modules/bluetooth/BluetoothGATTCharacteristic.idl
@@ -0,0 +1,25 @@
+// Copyright 2015 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattcharacteristic
+
+// Implement BluetoothGATTCharacteristic interface: https://crbug.com/483344
+
+[
+ GarbageCollected,
+ RuntimeEnabled=WebBluetooth,
+] interface BluetoothGATTCharacteristic {//: CharacteristicEventHandlers {
+ // TODO(ortuno): Add test to make sure service matches the service
+ // used to call getCharacteristic.
+ // readonly attribute BluetoothGATTService service;
+ readonly attribute UUID uuid;
+ // readonly attribute CharacteristicProperties properties;
+ // readonly attribute ArrayBuffer? value;
+ // Promise<BluetoothGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor);
+ // Promise<sequence<BluetoothGATTDescriptor>> getDescriptors(optional BluetoothDescriptorUUID descriptor);
+ [CallWith=ScriptState] Promise<ArrayBuffer> readValue();
+ [CallWith=ScriptState] Promise<void> writeValue(BufferSource value);
+ // Promise<void> startNotifications();
+ // Promise<void> stopNotifications();
+};
diff --git a/modules/bluetooth/BluetoothGATTRemoteServer.idl b/modules/bluetooth/BluetoothGATTRemoteServer.idl
new file mode 100644
index 0000000..9f94604
--- /dev/null
+++ b/modules/bluetooth/BluetoothGATTRemoteServer.idl
@@ -0,0 +1,21 @@
+// Copyright 2015 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattremoteserver
+
+// Implement BluetoothGATTRemoteServer interface: https://crbug.com/476735
+
+[
+ GarbageCollected,
+ RuntimeEnabled=WebBluetooth,
+] interface BluetoothGATTRemoteServer
+// Implement ServiceEventHandlers interface: http://crbug.com/421670
+// : ServiceEventHandlers
+{
+ // readonly attribute BluetoothDevice device;
+ readonly attribute boolean connected;
+ // void disconnect ();
+ [CallWith=ScriptState, RaisesException] Promise<BluetoothGATTService> getPrimaryService (BluetoothServiceUUID service);
+ // Promise<sequence<BluetoothGATTService>> getPrimaryServices (optional BluetoothServiceUUID service);
+};
diff --git a/modules/bluetooth/BluetoothGATTService.idl b/modules/bluetooth/BluetoothGATTService.idl
new file mode 100644
index 0000000..b6cef73
--- /dev/null
+++ b/modules/bluetooth/BluetoothGATTService.idl
@@ -0,0 +1,22 @@
+// Copyright 2015 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattservice
+
+// Implement BluetoothGATTService interface: https://crbug.com/483342
+
+[
+ GarbageCollected,
+ RuntimeEnabled=WebBluetooth,
+] interface BluetoothGATTService { // : ServiceEventHandlers {
+ readonly attribute UUID uuid;
+ readonly attribute boolean isPrimary;
+ // TODO(ortuno): Once device is implemented test that it matches
+ // the original device.
+ // readonly attribute BluetoothDevice device;
+ [RaisesException, CallWith=ScriptState] Promise<BluetoothGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic);
+ // Promise<sequence<BluetoothGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic);
+ // Promise<BluetoothGATTService> getIncludedService(BluetoothServiceUUID service);
+ // Promise<sequence<BluetoothGATTService>> getIncludedServices(optional BluetoothServiceUUID service);
+};
diff --git a/modules/bluetooth/BluetoothScanFilter.idl b/modules/bluetooth/BluetoothScanFilter.idl
new file mode 100644
index 0000000..7ab4f9e
--- /dev/null
+++ b/modules/bluetooth/BluetoothScanFilter.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothscanfilter
+
+dictionary BluetoothScanFilter {
+ sequence<BluetoothServiceUUID> services;
+};
diff --git a/modules/bluetooth/BluetoothUUID.idl b/modules/bluetooth/BluetoothUUID.idl
new file mode 100644
index 0000000..456dd8e
--- /dev/null
+++ b/modules/bluetooth/BluetoothUUID.idl
@@ -0,0 +1,27 @@
+// Copyright 2015 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://webbluetoothcg.github.io/web-bluetooth/#idl-def-bluetoothuuid
+
+// Implement BluetoothUUID: http://crbug.com/491441
+// Significant TODOs remain in BluetoothUUID.cpp.
+
+[
+ GarbageCollected,
+ RuntimeEnabled=WebBluetooth,
+] interface BluetoothUUID {
+ [RaisesException] static UUID getService((DOMString or unsigned long) name);
+ [RaisesException] static UUID getCharacteristic((DOMString or unsigned long) name);
+ [RaisesException] static UUID getDescriptor((DOMString or unsigned long) name);
+
+ static UUID canonicalUUID([EnforceRange] unsigned long alias);
+};
+
+typedef DOMString UUID;
+
+typedef (DOMString or unsigned long) BluetoothServiceUUID;
+
+typedef (DOMString or unsigned long) BluetoothCharacteristicUUID;
+
+typedef (DOMString or unsigned long) BluetoothDescriptorUUID;
diff --git a/modules/bluetooth/NavigatorBluetooth.idl b/modules/bluetooth/NavigatorBluetooth.idl
new file mode 100644
index 0000000..671f652
--- /dev/null
+++ b/modules/bluetooth/NavigatorBluetooth.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.
+
+// https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-navigatorbluetooth
+
+[
+ RuntimeEnabled=WebBluetooth,
+] partial interface Navigator {
+ readonly attribute Bluetooth bluetooth;
+};
diff --git a/modules/bluetooth/RequestDeviceOptions.idl b/modules/bluetooth/RequestDeviceOptions.idl
new file mode 100644
index 0000000..89d5ea9
--- /dev/null
+++ b/modules/bluetooth/RequestDeviceOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://webbluetoothchrome.github.io/web-bluetooth/#idl-def-requestdeviceoptions
+
+dictionary RequestDeviceOptions {
+ required sequence<BluetoothScanFilter> filters;
+ sequence<BluetoothServiceUUID> optionalServices = [];
+};
diff --git a/modules/cachestorage/Cache.idl b/modules/cachestorage/Cache.idl
new file mode 100644
index 0000000..8446938
--- /dev/null
+++ b/modules/cachestorage/Cache.idl
@@ -0,0 +1,23 @@
+// 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
+
+[
+ GarbageCollected,
+ Exposed=(Window,Worker),
+ TypeChecking=Interface,
+] interface Cache {
+ [CallWith=ScriptState, RaisesException] Promise<Response> match(RequestInfo request, optional CacheQueryOptions options);
+
+ // FIXME: Implement matchAll(): http://crbug.com/428363
+ // FIXME: First argument of matchAll() should be optional: http://crbug.com/425459
+ // [CallWith=ScriptState, RaisesException] Promise<sequence<Response>> matchAll(RequestInfo request, optional CacheQueryOptions options);
+
+ [CallWith=ScriptState, RaisesException] Promise<void> add(RequestInfo request);
+ [RuntimeEnabled=ServiceWorkerCacheAddAll, CallWith=ScriptState, RaisesException] Promise<void> addAll(sequence<RequestInfo> requests);
+ [CallWith=ScriptState, RaisesException] Promise<void> put(RequestInfo request, Response response);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options);
+ [CallWith=ScriptState, RaisesException] Promise<sequence<Response>> keys(optional RequestInfo request, optional CacheQueryOptions options);
+};
diff --git a/modules/cachestorage/CacheQueryOptions.idl b/modules/cachestorage/CacheQueryOptions.idl
new file mode 100644
index 0000000..c867090
--- /dev/null
+++ b/modules/cachestorage/CacheQueryOptions.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.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
+dictionary CacheQueryOptions {
+ boolean ignoreSearch = false;
+ boolean ignoreMethod = false;
+ boolean ignoreVary = false;
+ DOMString cacheName;
+};
diff --git a/modules/cachestorage/CacheStorage.idl b/modules/cachestorage/CacheStorage.idl
new file mode 100644
index 0000000..d0924ad
--- /dev/null
+++ b/modules/cachestorage/CacheStorage.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.
+
+// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-storage
+[
+ GarbageCollected,
+ Exposed=(Window,Worker),
+ TypeChecking=Interface,
+] interface CacheStorage {
+ [CallWith=ScriptState] Promise<boolean> has(DOMString cacheName);
+ [CallWith=ScriptState] Promise<Cache> open(DOMString cacheName);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise<boolean> delete(DOMString cacheName);
+ [CallWith=ScriptState] Promise<sequence<DOMString>> keys();
+ [CallWith=ScriptState, RaisesException] Promise<Response> match(RequestInfo request, optional CacheQueryOptions options);
+};
diff --git a/modules/cachestorage/WindowCacheStorage.idl b/modules/cachestorage/WindowCacheStorage.idl
new file mode 100644
index 0000000..7aadd81
--- /dev/null
+++ b/modules/cachestorage/WindowCacheStorage.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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/#self-caches
+[
+ RuntimeEnabled=GlobalCacheStorage,
+ ImplementedAs=GlobalCacheStorage,
+] partial interface Window {
+ [Unforgeable, MeasureAs=GlobalCacheStorage, RuntimeEnabled=GlobalCacheStorage, RaisesException] readonly attribute CacheStorage caches;
+};
diff --git a/modules/cachestorage/WorkerCacheStorage.idl b/modules/cachestorage/WorkerCacheStorage.idl
new file mode 100644
index 0000000..483f399
--- /dev/null
+++ b/modules/cachestorage/WorkerCacheStorage.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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/#self-caches
+[
+ RuntimeEnabled=GlobalCacheStorage,
+ ImplementedAs=GlobalCacheStorage,
+] partial interface WorkerGlobalScope {
+ [Unforgeable, MeasureAs=GlobalCacheStorage, RuntimeEnabled=GlobalCacheStorage, RaisesException] readonly attribute CacheStorage caches;
+};
diff --git a/core/html/canvas/Canvas2DContextAttributes.idl b/modules/canvas2d/Canvas2DContextAttributes.idl
similarity index 86%
rename from core/html/canvas/Canvas2DContextAttributes.idl
rename to modules/canvas2d/Canvas2DContextAttributes.idl
index f7dfab1..41f8b80 100644
--- a/core/html/canvas/Canvas2DContextAttributes.idl
+++ b/modules/canvas2d/Canvas2DContextAttributes.idl
@@ -24,10 +24,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
-] interface Canvas2DContextAttributes {
- attribute boolean alpha;
- [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString storage;
+dictionary Canvas2DContextAttributes {
+ boolean alpha = true;
};
diff --git a/core/html/canvas/CanvasGradient.idl b/modules/canvas2d/CanvasGradient.idl
similarity index 95%
rename from core/html/canvas/CanvasGradient.idl
rename to modules/canvas2d/CanvasGradient.idl
index c5f5623..8b7d542 100644
--- a/core/html/canvas/CanvasGradient.idl
+++ b/modules/canvas2d/CanvasGradient.idl
@@ -24,8 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
- TypeChecking=Unrestricted,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface CanvasGradient {
[RaisesException] void addColorStop(float offset, DOMString color);
diff --git a/core/html/canvas/CanvasPathMethods.idl b/modules/canvas2d/CanvasPathMethods.idl
similarity index 100%
rename from core/html/canvas/CanvasPathMethods.idl
rename to modules/canvas2d/CanvasPathMethods.idl
diff --git a/core/html/canvas/CanvasPattern.idl b/modules/canvas2d/CanvasPattern.idl
similarity index 97%
rename from core/html/canvas/CanvasPattern.idl
rename to modules/canvas2d/CanvasPattern.idl
index 7bc553c..d0804d7 100644
--- a/core/html/canvas/CanvasPattern.idl
+++ b/modules/canvas2d/CanvasPattern.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
] interface CanvasPattern {
[RuntimeEnabled=ExperimentalCanvasFeatures] void setTransform(SVGMatrix transform);
diff --git a/modules/canvas2d/CanvasRenderingContext2D.idl b/modules/canvas2d/CanvasRenderingContext2D.idl
new file mode 100644
index 0000000..d366967
--- /dev/null
+++ b/modules/canvas2d/CanvasRenderingContext2D.idl
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2006 Apple Computer, 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:
+ * 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 COMPUTER, INC. ``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 COMPUTER, INC. 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.
+ */
+
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasrenderingcontext2d
+
+// FIXME: float => double throughout
+typedef (HTMLImageElement or
+ HTMLVideoElement or
+ HTMLCanvasElement or
+ // CanvasRenderingContext2D or
+ ImageBitmap) CanvasImageSource;
+
+enum CanvasFillRule { "nonzero", "evenodd" };
+
+[
+ SetWrapperReferenceFrom=canvas,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
+] interface CanvasRenderingContext2D {
+ // back-reference to the canvas
+ readonly attribute HTMLCanvasElement canvas;
+
+ // state
+ void save(); // push state on state stack
+ void restore(); // pop state stack and restore state
+
+ // transformations (default transform is the identity matrix)
+ [RuntimeEnabled=ExperimentalCanvasFeatures] attribute SVGMatrix currentTransform;
+ void scale(unrestricted float x, unrestricted float y);
+ void rotate(unrestricted float angle);
+ void translate(unrestricted float x, unrestricted float y);
+ void transform(unrestricted float a, unrestricted float b, unrestricted float c, unrestricted float d, unrestricted float e, unrestricted float f);
+ void setTransform(unrestricted float a, unrestricted float b, unrestricted float c, unrestricted float d, unrestricted float e, unrestricted float f);
+ void resetTransform();
+
+ // compositing
+ attribute unrestricted float globalAlpha; // (default 1.0)
+ [TreatNullAs=NullString] attribute DOMString globalCompositeOperation; // (default source-over)
+ [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString filter; // (default 'none')
+
+ // image smoothing
+ [ImplementedAs=imageSmoothingEnabled, DeprecateAs=PrefixedImageSmoothingEnabled] attribute boolean webkitImageSmoothingEnabled;
+ [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothingEnabled;
+
+ // colors and styles (see also the CanvasDrawingStyles interface)
+ attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
+ attribute (DOMString or CanvasGradient or CanvasPattern) 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(CanvasImageSource image, DOMString? repetitionType);
+
+ // shadows
+ attribute unrestricted float shadowOffsetX;
+ attribute unrestricted float shadowOffsetY;
+ attribute unrestricted float shadowBlur;
+ [TreatNullAs=NullString] attribute DOMString shadowColor;
+
+ // rects
+ void clearRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+ void fillRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+ void strokeRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+
+ // path API (see also CanvasPathMethods)
+ void beginPath();
+ void fill(optional CanvasFillRule winding);
+ void fill(Path2D path, optional CanvasFillRule winding);
+ void stroke();
+ void stroke(Path2D path);
+ // Focus rings
+ void drawFocusIfNeeded(Element element);
+ void drawFocusIfNeeded(Path2D path, Element element);
+
+ [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(optional Path2D path);
+ void clip(optional CanvasFillRule winding);
+ void clip(Path2D path, optional CanvasFillRule winding);
+ boolean isPointInPath(unrestricted float x, unrestricted float y, optional CanvasFillRule winding);
+ boolean isPointInPath(Path2D path, unrestricted float x, unrestricted float y, optional CanvasFillRule winding);
+ boolean isPointInStroke(unrestricted float x, unrestricted float y);
+ boolean isPointInStroke(Path2D path, unrestricted float x, unrestricted float y);
+
+ // text (see also the CanvasDrawingStyles interface)
+ void fillText(DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth);
+ void strokeText(DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth);
+ TextMetrics measureText(DOMString text);
+
+ // drawing images
+ [RaisesException] void drawImage(CanvasImageSource image, unrestricted float x, unrestricted float y);
+ [RaisesException] void drawImage(CanvasImageSource image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+ [RaisesException] void drawImage(CanvasImageSource image, 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
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegion(optional HitRegionOptions options);
+ [RuntimeEnabled=ExperimentalCanvasFeatures] void removeHitRegion(DOMString id);
+ [RuntimeEnabled=ExperimentalCanvasFeatures] void clearHitRegions();
+
+ // pixel manipulation
+ ImageData createImageData(ImageData imagedata);
+ [RaisesException] ImageData createImageData(float sw, float sh);
+ [RaisesException] ImageData getImageData(float sx, float sy, float sw, float sh);
+ void putImageData(ImageData imagedata, float dx, float dy);
+ void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
+
+ // Context state
+ // Should be merged with WebGL counterpart in CanvasRenderingContext, once no-longer experimental
+ [RuntimeEnabled=ExperimentalCanvasFeatures] boolean isContextLost();
+
+ Canvas2DContextAttributes getContextAttributes();
+
+ // FIXME: factor out to CanvasDrawingStyles
+ // line caps/joins
+ attribute unrestricted float lineWidth; // (default 1)
+ [TreatNullAs=NullString] attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
+ [TreatNullAs=NullString] attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
+ attribute unrestricted float miterLimit; // (default 10)
+
+ // dashed lines
+ void setLineDash(sequence<unrestricted float> dash);
+ sequence<unrestricted float> getLineDash();
+ attribute unrestricted float lineDashOffset;
+
+ // text
+ attribute DOMString font; // (default 10px sans-serif)
+ attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
+ attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
+ [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString direction; // "inherit", "rtl", "ltr" (default: "inherit")
+
+};
+
+CanvasRenderingContext2D implements CanvasPathMethods;
diff --git a/core/html/canvas/HitRegionOptions.idl b/modules/canvas2d/HitRegionOptions.idl
similarity index 80%
rename from core/html/canvas/HitRegionOptions.idl
rename to modules/canvas2d/HitRegionOptions.idl
index 33380b8..6146304 100644
--- a/core/html/canvas/HitRegionOptions.idl
+++ b/modules/canvas2d/HitRegionOptions.idl
@@ -4,11 +4,7 @@
// Spec: https://html.spec.whatwg.org/multipage/scripting.html#hitregionoptions
-enum CanvasFillRule { "nonzero", "evenodd" };
-
-[
- GarbageCollected
-] dictionary HitRegionOptions {
+dictionary HitRegionOptions {
Path2D? path = null;
CanvasFillRule fillRule = "nonzero";
DOMString id = "";
diff --git a/core/html/canvas/MouseEventHitRegion.idl b/modules/canvas2d/MouseEventHitRegion.idl
similarity index 100%
rename from core/html/canvas/MouseEventHitRegion.idl
rename to modules/canvas2d/MouseEventHitRegion.idl
diff --git a/core/html/canvas/Path2D.idl b/modules/canvas2d/Path2D.idl
similarity index 97%
rename from core/html/canvas/Path2D.idl
rename to modules/canvas2d/Path2D.idl
index 9210737..f77f06d 100644
--- a/core/html/canvas/Path2D.idl
+++ b/modules/canvas2d/Path2D.idl
@@ -32,7 +32,7 @@
Constructor,
Constructor(Path2D path),
Constructor(DOMString text),
- WillBeGarbageCollected,
+ GarbageCollected,
] interface Path2D {
[RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface] void addPath(Path2D path, optional SVGMatrix? transform);
diff --git a/modules/compositorworker/CompositorWorker.idl b/modules/compositorworker/CompositorWorker.idl
new file mode 100644
index 0000000..e6f67c4
--- /dev/null
+++ b/modules/compositorworker/CompositorWorker.idl
@@ -0,0 +1,18 @@
+// Copyright 2015 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.
+
+[
+ ActiveDOMObject,
+ Constructor(DOMString scriptUrl),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ RuntimeEnabled=CompositorWorker,
+ WillBeGarbageCollected,
+] interface CompositorWorker : EventTarget {
+ attribute EventHandler onmessage;
+ [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ void terminate();
+};
+
+CompositorWorker implements AbstractWorker;
diff --git a/modules/compositorworker/CompositorWorkerGlobalScope.idl b/modules/compositorworker/CompositorWorkerGlobalScope.idl
new file mode 100644
index 0000000..217c4b8
--- /dev/null
+++ b/modules/compositorworker/CompositorWorkerGlobalScope.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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.
+
+[
+ Exposed=CompositorWorker,
+ Global=CompositorWorker,
+ RuntimeEnabled=CompositorWorker,
+ TypeChecking=Interface,
+] interface CompositorWorkerGlobalScope : WorkerGlobalScope {
+ [PostMessage, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
+ attribute EventHandler onmessage;
+
+ long requestAnimationFrame(FrameRequestCallback callback);
+ void cancelAnimationFrame(long handle);
+};
diff --git a/modules/credentialmanager/Credential.idl b/modules/credentialmanager/Credential.idl
index 76eab5b..960a16b 100644
--- a/modules/credentialmanager/Credential.idl
+++ b/modules/credentialmanager/Credential.idl
@@ -2,11 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://w3c.github.io/webappsec/specs/credentialmanagement/#credential
+
[
RuntimeEnabled=CredentialManager,
GarbageCollected
] interface Credential {
readonly attribute DOMString id;
+ readonly attribute DOMString type;
+
+ // TODO(mkwst): These should be on LocallyStoredCredential.
readonly attribute DOMString name;
- readonly attribute DOMString avatarURL;
+ readonly attribute DOMString iconURL;
};
diff --git a/modules/credentialmanager/CredentialData.idl b/modules/credentialmanager/CredentialData.idl
new file mode 100644
index 0000000..68d5363
--- /dev/null
+++ b/modules/credentialmanager/CredentialData.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-credentialdata
+
+dictionary CredentialData {
+ DOMString id;
+};
diff --git a/modules/credentialmanager/CredentialRequestOptions.idl b/modules/credentialmanager/CredentialRequestOptions.idl
new file mode 100644
index 0000000..2a70c7f
--- /dev/null
+++ b/modules/credentialmanager/CredentialRequestOptions.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-credentialrequestoptions
+
+dictionary CredentialRequestOptions {
+ FederatedCredentialRequestOptions federated;
+
+ boolean password = false;
+ boolean suppressUI = false;
+};
diff --git a/modules/credentialmanager/CredentialsContainer.idl b/modules/credentialmanager/CredentialsContainer.idl
index 43497bc..da5846d 100644
--- a/modules/credentialmanager/CredentialsContainer.idl
+++ b/modules/credentialmanager/CredentialsContainer.idl
@@ -6,8 +6,8 @@
RuntimeEnabled=CredentialManager,
GarbageCollected
] interface CredentialsContainer {
- [CallWith=ScriptState] Promise request(optional Dictionary options);
- [CallWith=ScriptState] Promise notifySignedIn(Credential credential);
- [CallWith=ScriptState] Promise notifyFailedSignIn(Credential credential);
- [CallWith=ScriptState] Promise notifySignedOut();
+ [CallWith=ScriptState] Promise request(optional CredentialRequestOptions options);
+ [CallWith=ScriptState, TypeChecking=Interface] Promise notifySignedIn(Credential credential);
+ [CallWith=ScriptState] Promise requireUserMediation();
};
+
diff --git a/modules/credentialmanager/FederatedCredential.idl b/modules/credentialmanager/FederatedCredential.idl
index b596da2..848ed8d 100644
--- a/modules/credentialmanager/FederatedCredential.idl
+++ b/modules/credentialmanager/FederatedCredential.idl
@@ -2,10 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://w3c.github.io/webappsec/specs/credentialmanagement/#federatedcredential
+
[
RuntimeEnabled=CredentialManager,
RaisesException=Constructor,
- Constructor(DOMString id, DOMString name, DOMString avatarURL, DOMString federation)
+ Constructor(FederatedCredentialData data)
] interface FederatedCredential : Credential {
- readonly attribute DOMString federation;
+ readonly attribute USVString provider;
+
+ // TODO(mkwst): We don't really support this yet; it always returns ''.
+ readonly attribute DOMString? protocol;
};
diff --git a/modules/credentialmanager/FederatedCredentialData.idl b/modules/credentialmanager/FederatedCredentialData.idl
new file mode 100644
index 0000000..e9c92cb
--- /dev/null
+++ b/modules/credentialmanager/FederatedCredentialData.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-federatedcredentialdata
+
+dictionary FederatedCredentialData : LocallyStoredCredentialData {
+ USVString provider;
+};
diff --git a/modules/credentialmanager/FederatedCredentialRequestOptions.idl b/modules/credentialmanager/FederatedCredentialRequestOptions.idl
new file mode 100644
index 0000000..1039962
--- /dev/null
+++ b/modules/credentialmanager/FederatedCredentialRequestOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-federatedcredentialrequestoptions
+
+dictionary FederatedCredentialRequestOptions {
+ sequence<USVString> providers;
+ sequence<DOMString> protocols;
+};
diff --git a/modules/credentialmanager/LocallyStoredCredentialData.idl b/modules/credentialmanager/LocallyStoredCredentialData.idl
new file mode 100644
index 0000000..2d127f9
--- /dev/null
+++ b/modules/credentialmanager/LocallyStoredCredentialData.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-locallystoredcredentialdata
+
+dictionary LocallyStoredCredentialData : CredentialData {
+ DOMString name;
+ DOMString iconURL;
+};
diff --git a/modules/credentialmanager/LocalCredential.idl b/modules/credentialmanager/PasswordCredential.idl
similarity index 60%
rename from modules/credentialmanager/LocalCredential.idl
rename to modules/credentialmanager/PasswordCredential.idl
index 62c4aa6..929aed3 100644
--- a/modules/credentialmanager/LocalCredential.idl
+++ b/modules/credentialmanager/PasswordCredential.idl
@@ -5,7 +5,8 @@
[
RuntimeEnabled=CredentialManager,
RaisesException=Constructor,
- Constructor(DOMString id, DOMString name, DOMString avatarURL, DOMString password)
-] interface LocalCredential : Credential {
+ Constructor(DOMString id, DOMString password, optional DOMString name, optional DOMString iconURL)
+] interface PasswordCredential : Credential {
readonly attribute DOMString password;
+ readonly attribute FormData formData;
};
diff --git a/modules/credentialmanager/PasswordCredentialData.idl b/modules/credentialmanager/PasswordCredentialData.idl
new file mode 100644
index 0000000..8739fe6
--- /dev/null
+++ b/modules/credentialmanager/PasswordCredentialData.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-passwordcredentialdata
+
+dictionary PasswordCredentialData : LocallyStoredCredentialData {
+ DOMString password;
+};
diff --git a/modules/crypto/Crypto.idl b/modules/crypto/Crypto.idl
index 2348d77..27182ef 100644
--- a/modules/crypto/Crypto.idl
+++ b/modules/crypto/Crypto.idl
@@ -28,15 +28,10 @@
[
GarbageCollected,
- NoInterfaceObject
+ Exposed=(Window,Worker)
] interface Crypto {
- // Note that getRandomValues() is available even when the "Crypto"
- // runtime feature is disabled.
- //
- // This is for compatibility sake, since getRandomValues() predates the full
- // Web Crypto API spec.
- [Custom, RaisesException] ArrayBufferView getRandomValues(ArrayBufferView array);
+ [RaisesException, MeasureAs=CryptoGetRandomValues] ArrayBufferView getRandomValues(ArrayBufferView array);
- [RuntimeEnabled=Crypto] readonly attribute SubtleCrypto subtle;
+ readonly attribute SubtleCrypto subtle;
};
diff --git a/modules/crypto/CryptoKey.idl b/modules/crypto/CryptoKey.idl
index 0ad4ab6..3fcabf1 100644
--- a/modules/crypto/CryptoKey.idl
+++ b/modules/crypto/CryptoKey.idl
@@ -30,10 +30,10 @@
[
GarbageCollected,
- NoInterfaceObject
+ Exposed=(Window,Worker)
] interface CryptoKey {
readonly attribute DOMString type;
readonly attribute boolean extractable;
- [Custom] readonly attribute object algorithm;
+ [CallWith=ScriptState] readonly attribute object algorithm;
readonly attribute DOMString[] usages;
};
diff --git a/modules/crypto/SubtleCrypto.idl b/modules/crypto/SubtleCrypto.idl
index e76cac4..007f368 100644
--- a/modules/crypto/SubtleCrypto.idl
+++ b/modules/crypto/SubtleCrypto.idl
@@ -31,40 +31,24 @@
// http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface
typedef DOMString KeyFormat;
-typedef DOMString KeyUsage; // from CryptoKey interface
-
-// FIXME: use below; needs support for union types http://crbug.com/240176
-typedef (ArrayBuffer or ArrayBufferView) CryptoOperationData;
+typedef DOMString KeyUsage;
+typedef (Dictionary or DOMString) AlgorithmIdentifier;
[
GarbageCollected,
- NoInterfaceObject,
+ Exposed=(Window,Worker),
+ TypeChecking=Interface,
] interface SubtleCrypto {
- [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, CryptoKey key, ArrayBuffer data);
- [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, CryptoKey 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, 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);
-
- [CallWith=ScriptState] Promise generateKey(Dictionary algorithm, boolean extractable, DOMString[] keyUsages);
-
- [CallWith=ScriptState] Promise importKey(KeyFormat format, ArrayBuffer keyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages);
- [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, CryptoKey key);
-
- [CallWith=ScriptState] Promise wrapKey(KeyFormat format, CryptoKey key, CryptoKey wrappingKey, Dictionary wrapAlgorithm);
-
- [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);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoEncrypt] Promise encrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoDecrypt] Promise decrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoSign] Promise sign(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data);
+ [CallWith=ScriptState, ImplementedAs=verifySignature, MeasureAs=SubtleCryptoVerify] Promise verify(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource signature, BufferSource data);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoDigest] Promise digest(AlgorithmIdentifier algorithm, BufferSource data);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoGenerateKey] Promise generateKey(AlgorithmIdentifier algorithm, boolean extractable, sequence<KeyUsage> keyUsages);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoImportKey] Promise importKey(KeyFormat format, (ArrayBuffer or ArrayBufferView or Dictionary) keyData, AlgorithmIdentifier algorithm, boolean extractable, sequence<KeyUsage> keyUsages);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoExportKey] Promise exportKey(KeyFormat format, CryptoKey key);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoDeriveBits] Promise deriveBits(AlgorithmIdentifier algorithm, CryptoKey baseKey, unsigned long length);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoDeriveKey] Promise deriveKey(AlgorithmIdentifier algorithm, CryptoKey baseKey, AlgorithmIdentifier derivedKeyType, boolean extractable, sequence<KeyUsage> keyUsages);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoWrapKey] Promise wrapKey(KeyFormat format, CryptoKey key, CryptoKey wrappingKey, AlgorithmIdentifier wrapAlgorithm);
+ [CallWith=ScriptState, MeasureAs=SubtleCryptoUnwrapKey] Promise unwrapKey(KeyFormat format, BufferSource wrappedKey, CryptoKey unwrappingKey, AlgorithmIdentifier unwrapAlgorithm, AlgorithmIdentifier unwrappedKeyAlgorithm, boolean extractable, sequence<KeyUsage> keyUsages);
};
diff --git a/modules/crypto/WorkerGlobalScopeCrypto.idl b/modules/crypto/WorkerGlobalScopeCrypto.idl
index 2def760..86786bf 100644
--- a/modules/crypto/WorkerGlobalScopeCrypto.idl
+++ b/modules/crypto/WorkerGlobalScopeCrypto.idl
@@ -28,8 +28,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- RuntimeEnabled=Crypto,
-] partial interface WorkerGlobalScope {
+partial interface WorkerGlobalScope {
readonly attribute Crypto crypto;
};
diff --git a/modules/device_light/DeviceLightEvent.idl b/modules/device_light/DeviceLightEvent.idl
index 6d3d3b9..6a1f13f 100644
--- a/modules/device_light/DeviceLightEvent.idl
+++ b/modules/device_light/DeviceLightEvent.idl
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// http://w3c.github.io/ambient-light/#idl-def-DeviceLightEvent
+
[
RuntimeEnabled=DeviceLight,
- EventConstructor
+ Constructor(DOMString type, optional DeviceLightEventInit eventInitDict),
] interface DeviceLightEvent : Event {
- [InitializedByEventConstructor] readonly attribute unrestricted double value;
+ readonly attribute unrestricted double value;
};
diff --git a/modules/device_light/DeviceLightEventInit.idl b/modules/device_light/DeviceLightEventInit.idl
new file mode 100644
index 0000000..c7245e6
--- /dev/null
+++ b/modules/device_light/DeviceLightEventInit.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.
+
+// http://w3c.github.io/ambient-light/#idl-def-DeviceLightEvent
+
+dictionary DeviceLightEventInit : EventInit {
+ unrestricted double value;
+};
diff --git a/modules/device_orientation/DeviceMotionEvent.idl b/modules/device_orientation/DeviceMotionEvent.idl
index 5e70a83..c75497a 100644
--- a/modules/device_orientation/DeviceMotionEvent.idl
+++ b/modules/device_orientation/DeviceMotionEvent.idl
@@ -28,11 +28,11 @@
readonly attribute DeviceAcceleration accelerationIncludingGravity;
readonly attribute DeviceRotationRate rotationRate;
readonly attribute double? interval;
- [Custom] void initDeviceMotionEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean bubbles,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional DeviceAcceleration acceleration,
- [Default=Undefined] optional DeviceAcceleration accelerationIncludingGravity,
- [Default=Undefined] optional DeviceRotationRate rotationRate,
- [Default=Undefined] optional double interval);
+ [Custom, Measure] void initDeviceMotionEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional DeviceAcceleration acceleration,
+ [Default=Undefined] optional DeviceAcceleration accelerationIncludingGravity,
+ [Default=Undefined] optional DeviceRotationRate rotationRate,
+ [Default=Undefined] optional double interval);
};
diff --git a/modules/device_orientation/DeviceOrientationEvent.idl b/modules/device_orientation/DeviceOrientationEvent.idl
index 00e9d04..ab9840d 100644
--- a/modules/device_orientation/DeviceOrientationEvent.idl
+++ b/modules/device_orientation/DeviceOrientationEvent.idl
@@ -28,11 +28,11 @@
readonly attribute double? beta;
readonly attribute double? gamma;
readonly attribute boolean? absolute;
- [Custom] void initDeviceOrientationEvent([Default=Undefined] optional DOMString type,
- [Default=Undefined] optional boolean bubbles,
- [Default=Undefined] optional boolean cancelable,
- [Default=Undefined] optional double alpha,
- [Default=Undefined] optional double beta,
- [Default=Undefined] optional double gamma,
- [Default=Undefined] optional boolean absolute);
+ [Measure] void initDeviceOrientationEvent([Default=Undefined] optional DOMString type,
+ [Default=Undefined] optional boolean bubbles,
+ [Default=Undefined] optional boolean cancelable,
+ [Default=Undefined] optional double? alpha,
+ [Default=Undefined] optional double? beta,
+ [Default=Undefined] optional double? gamma,
+ [Default=Undefined] optional boolean? absolute);
};
diff --git a/modules/encoding/TextDecodeOptions.idl b/modules/encoding/TextDecodeOptions.idl
index a4e0974..da115c4 100644
--- a/modules/encoding/TextDecodeOptions.idl
+++ b/modules/encoding/TextDecodeOptions.idl
@@ -4,8 +4,6 @@
// http://encoding.spec.whatwg.org/#textdecoder
-[
- GarbageCollected
-] dictionary TextDecodeOptions {
+dictionary TextDecodeOptions {
boolean stream = false;
};
diff --git a/modules/encoding/TextDecoder.idl b/modules/encoding/TextDecoder.idl
index 977a865..6127555 100644
--- a/modules/encoding/TextDecoder.idl
+++ b/modules/encoding/TextDecoder.idl
@@ -29,7 +29,6 @@
*/
[
- RuntimeEnabled=EncodingAPI,
Exposed=(Window,Worker),
Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
RaisesException=Constructor,
@@ -39,5 +38,5 @@
readonly attribute DOMString encoding;
readonly attribute boolean fatal;
readonly attribute boolean ignoreBOM;
- [RaisesException, MeasureAs=TextDecoderDecode] DOMString decode(optional ArrayBufferView input, optional TextDecodeOptions options);
+ [RaisesException, MeasureAs=TextDecoderDecode] DOMString decode(optional BufferSource input, optional TextDecodeOptions options);
};
diff --git a/modules/encoding/TextEncoder.idl b/modules/encoding/TextEncoder.idl
index 7e284d5..8812f04 100644
--- a/modules/encoding/TextEncoder.idl
+++ b/modules/encoding/TextEncoder.idl
@@ -29,7 +29,6 @@
*/
[
- RuntimeEnabled=EncodingAPI,
Exposed=(Window,Worker),
Constructor(optional DOMString utfLabel = "utf-8"),
RaisesException=Constructor,
@@ -37,5 +36,5 @@
MeasureAs=TextEncoderConstructor
] interface TextEncoder {
readonly attribute DOMString encoding;
- [MeasureAs=TextEncoderEncode] Uint8Array encode(optional ScalarValueString input = "");
+ [MeasureAs=TextEncoderEncode] Uint8Array encode(optional USVString input = "");
};
diff --git a/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl b/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
index b275832..e79fe27 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([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, RaisesException, DeprecateAs=PrefixedMediaGenerateKeyRequest] void webkitGenerateKeyRequest([TreatUndefinedAs=NullString] DOMString? keySystem, optional Uint8Array initData);
+ [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, DeprecateAs=PrefixedMediaAddKey] void webkitAddKey([TreatUndefinedAs=NullString] DOMString? keySystem, Uint8Array key, optional Uint8Array initData, optional DOMString sessionId = null);
+ [RuntimeEnabled=PrefixedEncryptedMedia, RaisesException, DeprecateAs=PrefixedMediaCancelKeyRequest] void webkitCancelKeyRequest([TreatUndefinedAs=NullString] DOMString? keySystem, optional DOMString sessionId = null);
[RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyadded;
[RuntimeEnabled=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyerror;
@@ -14,5 +14,5 @@
[RuntimeEnabled=EncryptedMedia] readonly attribute MediaKeys mediaKeys;
[RuntimeEnabled=EncryptedMedia, TypeChecking=Interface, CallWith=ScriptState] Promise setMediaKeys(MediaKeys? mediaKeys);
- [RuntimeEnabled=EncryptedMedia] attribute EventHandler onneedkey;
+ [RuntimeEnabled=EncryptedMedia] attribute EventHandler onencrypted;
};
diff --git a/modules/encryptedmedia/MediaKeyNeededEvent.idl b/modules/encryptedmedia/MediaEncryptedEvent.idl
similarity index 81%
rename from modules/encryptedmedia/MediaKeyNeededEvent.idl
rename to modules/encryptedmedia/MediaEncryptedEvent.idl
index c99a180..ec07de9 100644
--- a/modules/encryptedmedia/MediaKeyNeededEvent.idl
+++ b/modules/encryptedmedia/MediaEncryptedEvent.idl
@@ -23,11 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/encrypted-media/#mediaencryptedevent
+
[
- EventConstructor,
- RuntimeEnabled=EncryptedMedia
-] interface MediaKeyNeededEvent : Event {
- readonly attribute DOMString contentType;
- readonly attribute Uint8Array initData;
+ Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict),
+ RuntimeEnabled=EncryptedMedia,
+] interface MediaEncryptedEvent : Event {
+ readonly attribute DOMString initDataType;
+ readonly attribute ArrayBuffer? initData;
};
diff --git a/modules/encryptedmedia/MediaEncryptedEventInit.idl b/modules/encryptedmedia/MediaEncryptedEventInit.idl
new file mode 100644
index 0000000..5fbe1eb
--- /dev/null
+++ b/modules/encryptedmedia/MediaEncryptedEventInit.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.
+
+// https://w3c.github.io/encrypted-media/#mediaencryptedevent
+
+dictionary MediaEncryptedEventInit : EventInit {
+ DOMString initDataType = "";
+ ArrayBuffer? initData = null;
+};
diff --git a/modules/encryptedmedia/MediaKeyMessageEvent.idl b/modules/encryptedmedia/MediaKeyMessageEvent.idl
index 6cda051..1d9dbdb 100644
--- a/modules/encryptedmedia/MediaKeyMessageEvent.idl
+++ b/modules/encryptedmedia/MediaKeyMessageEvent.idl
@@ -23,11 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/encrypted-media/#mediakeymessageevent
+
+enum MediaKeyMessageType {
+ "license-request",
+ "license-renewal",
+ "license-release"
+};
+
[
- EventConstructor,
+ Constructor(DOMString type, optional MediaKeyMessageEventInit eventInitDict),
RuntimeEnabled=EncryptedMedia
] interface MediaKeyMessageEvent : Event {
+ readonly attribute MediaKeyMessageType messageType;
readonly attribute ArrayBuffer message;
- [InitializedByEventConstructor] readonly attribute DOMString destinationURL;
};
diff --git a/modules/encryptedmedia/MediaKeyMessageEventInit.idl b/modules/encryptedmedia/MediaKeyMessageEventInit.idl
new file mode 100644
index 0000000..a5e355d
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeyMessageEventInit.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.
+
+// https://w3c.github.io/encrypted-media/#mediakeymessageevent
+
+dictionary MediaKeyMessageEventInit : EventInit {
+ MediaKeyMessageType messageType = "license-request";
+ ArrayBuffer message;
+};
diff --git a/modules/encryptedmedia/MediaKeySession.idl b/modules/encryptedmedia/MediaKeySession.idl
index acf3177..3af0cea 100644
--- a/modules/encryptedmedia/MediaKeySession.idl
+++ b/modules/encryptedmedia/MediaKeySession.idl
@@ -29,20 +29,18 @@
GarbageCollected,
TypeChecking=Interface
] interface MediaKeySession : EventTarget {
- // error state
- readonly attribute MediaKeyError error;
-
// session properties
- readonly attribute DOMString keySystem;
readonly attribute DOMString sessionId;
+ readonly attribute unrestricted double expiration;
[CallWith=ScriptState] readonly attribute Promise closed;
+ readonly attribute MediaKeyStatusMap keyStatuses;
// session initialization
- [CallWith=ScriptState] Promise generateRequest(DOMString initDataType, ArrayBuffer initData);
- [CallWith=ScriptState] Promise generateRequest(DOMString initDataType, ArrayBufferView initData);
+ [CallWith=ScriptState] Promise<void> generateRequest(DOMString initDataType, BufferSource initData);
+ [CallWith=ScriptState] Promise<boolean> load(DOMString sessionId);
// session operations
- [CallWith=ScriptState] Promise update(ArrayBuffer response);
- [CallWith=ScriptState] Promise update(ArrayBufferView response);
- [CallWith=ScriptState] Promise release();
+ [CallWith=ScriptState] Promise<void> update(BufferSource response);
+ [CallWith=ScriptState] Promise<void> close();
+ [CallWith=ScriptState] Promise<void> remove();
};
diff --git a/modules/encryptedmedia/MediaKeyStatusMap.idl b/modules/encryptedmedia/MediaKeyStatusMap.idl
new file mode 100644
index 0000000..41e9853
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeyStatusMap.idl
@@ -0,0 +1,21 @@
+// Copyright 2015 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://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatusMap
+
+enum MediaKeyStatus {
+ "usable",
+ "expired",
+ "output-downscaled",
+ "output-not-allowed",
+ "status-pending",
+ "internal-error"
+};
+
+[
+ GarbageCollected,
+] interface MediaKeyStatusMap {
+ readonly attribute unsigned long size;
+ readonly maplike <BufferSource, MediaKeyStatus>;
+};
diff --git a/modules/encryptedmedia/MediaKeySystemAccess.idl b/modules/encryptedmedia/MediaKeySystemAccess.idl
new file mode 100644
index 0000000..48c2d2c
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeySystemAccess.idl
@@ -0,0 +1,15 @@
+// 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://w3c.github.io/encrypted-media/#mediakeysystemaccess-interface
+
+[
+ RuntimeEnabled=EncryptedMedia,
+ GarbageCollected,
+ TypeChecking=Interface
+] interface MediaKeySystemAccess {
+ readonly attribute DOMString keySystem;
+ MediaKeySystemConfiguration getConfiguration();
+ [CallWith=ScriptState] Promise<MediaKeys> createMediaKeys();
+};
diff --git a/modules/encryptedmedia/MediaKeySystemConfiguration.idl b/modules/encryptedmedia/MediaKeySystemConfiguration.idl
new file mode 100644
index 0000000..2db1454
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeySystemConfiguration.idl
@@ -0,0 +1,23 @@
+// 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://w3c.github.io/encrypted-media/#idl-def-MediaKeySystemConfiguration
+
+enum MediaKeysRequirement {
+ "required",
+ "optional",
+ "not-allowed"
+};
+
+[
+ RuntimeEnabled=EncryptedMedia
+] dictionary MediaKeySystemConfiguration {
+ sequence<DOMString> initDataTypes;
+ sequence<MediaKeySystemMediaCapability> audioCapabilities;
+ sequence<MediaKeySystemMediaCapability> videoCapabilities;
+ MediaKeysRequirement distinctiveIdentifier = "optional";
+ MediaKeysRequirement persistentState = "optional";
+ sequence<DOMString> sessionTypes;
+ DOMString label;
+};
diff --git a/modules/encryptedmedia/MediaKeySystemMediaCapability.idl b/modules/encryptedmedia/MediaKeySystemMediaCapability.idl
new file mode 100644
index 0000000..4f06468
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeySystemMediaCapability.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.
+
+// https://w3c.github.io/encrypted-media/#idl-def-MediaKeySystemMediaCapability
+
+[
+ RuntimeEnabled=EncryptedMedia
+] dictionary MediaKeySystemMediaCapability {
+ DOMString contentType = "";
+ DOMString robustness = "";
+};
diff --git a/modules/encryptedmedia/MediaKeys.idl b/modules/encryptedmedia/MediaKeys.idl
index 14a542d..7913a47 100644
--- a/modules/encryptedmedia/MediaKeys.idl
+++ b/modules/encryptedmedia/MediaKeys.idl
@@ -23,21 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-enum SessionType {
+enum MediaKeySessionType {
"temporary",
- "persistent"
+ "persistent-license",
};
[
+ ActiveDOMObject,
RuntimeEnabled=EncryptedMedia,
GarbageCollected,
TypeChecking=Interface
] interface MediaKeys {
- readonly attribute DOMString keySystem;
+ [CallWith=ScriptState, RaisesException] MediaKeySession createSession(optional MediaKeySessionType sessionType = "temporary");
- [CallWith=ScriptState] MediaKeySession createSession(optional SessionType sessionType = "temporary");
-
- [CallWith=ScriptState] static Promise create(DOMString keySystem);
-
- static boolean isTypeSupported(DOMString keySystem, optional DOMString contentType = null);
+ [CallWith=ScriptState] Promise<void> setServerCertificate(BufferSource serverCertificate);
};
diff --git a/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.idl b/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.idl
new file mode 100644
index 0000000..e04f29a
--- /dev/null
+++ b/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.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.
+
+// https://w3c.github.io/encrypted-media/#navigator-extension-requestmediakeysystemaccess
+
+[
+ RuntimeEnabled=EncryptedMedia
+] partial interface Navigator {
+ [CallWith=ScriptState] Promise<MediaKeySystemAccess> requestMediaKeySystemAccess(DOMString keySystem, sequence<MediaKeySystemConfiguration> supportedConfigurations);
+};
diff --git a/modules/fetch/Body.idl b/modules/fetch/Body.idl
new file mode 100644
index 0000000..25cca48
--- /dev/null
+++ b/modules/fetch/Body.idl
@@ -0,0 +1,26 @@
+// 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/#body
+typedef object JSON;
+[
+ Exposed=ServiceWorker,
+ NoInterfaceObject,
+ ActiveDOMObject,
+ GarbageCollected,
+ TypeChecking=Interface,
+] interface Body {
+ readonly attribute boolean bodyUsed;
+ [CallWith=ScriptState] Promise<ArrayBuffer> arrayBuffer();
+ [CallWith=ScriptState] Promise<Blob> blob();
+ [CallWith=ScriptState] Promise<JSON> json();
+ [CallWith=ScriptState] Promise<USVString> text();
+
+ // body attribute is defined in sub-interfaces, because the IDL processor
+ // cannot deal with attribute inheritance with runtime enabled flag.
+ // [RuntimeEnabled=ExperimentalStream] readonly attribute ReadableByteStream body;
+
+ // Still to be implemented.
+ // [CallWith=ScriptState] Promise<FormData> formData();
+};
diff --git a/modules/serviceworkers/Headers.idl b/modules/fetch/Headers.idl
similarity index 67%
rename from modules/serviceworkers/Headers.idl
rename to modules/fetch/Headers.idl
index 1b29e74..e17dba9 100644
--- a/modules/serviceworkers/Headers.idl
+++ b/modules/fetch/Headers.idl
@@ -8,10 +8,11 @@
Constructor,
Constructor(Headers input),
Constructor(OpenEndedDictionary input),
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker,
+ Constructor(sequence<sequence<ByteString>> input),
+ Exposed=(Window,Worker),
RaisesException=Constructor,
GarbageCollected,
+ TypeChecking=Interface,
] interface Headers {
[RaisesException] void append(ByteString name, ByteString value);
[ImplementedAs=remove, RaisesException] void delete(ByteString key);
@@ -19,11 +20,5 @@
[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);
+ iterable<ByteString, ByteString>;
};
diff --git a/modules/fetch/Request.idl b/modules/fetch/Request.idl
new file mode 100644
index 0000000..f545af9
--- /dev/null
+++ b/modules/fetch/Request.idl
@@ -0,0 +1,39 @@
+// 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/#request-class
+
+typedef (Request or USVString) RequestInfo;
+
+enum RequestContext {
+ "", "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon",
+ "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import",
+ "internal", "location", "manifest", "metarefresh", "object", "ping", "plugin",
+ "prefetch", "script", "serviceworker", "sharedworker",
+ "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt"
+};
+enum RequestMode { "same-origin", "no-cors", "cors" };
+enum RequestCredentials { "omit", "same-origin", "include" };
+
+[
+ Constructor(RequestInfo input, optional Dictionary requestInitDict),
+ ConstructorCallWith=ScriptState,
+ Exposed=(Window,Worker),
+ RaisesException=Constructor,
+ ActiveDOMObject,
+ GarbageCollected,
+ TypeChecking=Interface,
+] interface Request {
+ readonly attribute ByteString method;
+ readonly attribute USVString url;
+ readonly attribute Headers headers;
+ [DeprecateAs=FetchAPIRequestContext] readonly attribute RequestContext context;
+ readonly attribute DOMString referrer;
+ readonly attribute RequestMode mode;
+ readonly attribute RequestCredentials credentials;
+
+ [RaisesException] Request clone();
+};
+
+Request implements Body;
diff --git a/modules/fetch/Response.idl b/modules/fetch/Response.idl
new file mode 100644
index 0000000..5deaa68
--- /dev/null
+++ b/modules/fetch/Response.idl
@@ -0,0 +1,35 @@
+// 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/#response-class
+
+enum ResponseType { "basic", "cors", "default", "error", "opaque" };
+
+// FIXME: Add union type: URLSearchParams
+typedef (Blob or ArrayBuffer or ArrayBufferView or FormData or USVString) BodyInit;
+
+[
+ Constructor(optional BodyInit body, optional Dictionary responseInitDict),
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ RaisesException=Constructor,
+ ActiveDOMObject,
+ GarbageCollected,
+ TypeChecking=Interface,
+] interface Response {
+ [CallWith=ExecutionContext] static Response error();
+ [CallWith=ExecutionContext, RaisesException] static Response redirect(USVString url, optional unsigned short status = 302);
+ readonly attribute ResponseType type;
+ readonly attribute USVString url;
+ readonly attribute unsigned short status;
+ readonly attribute boolean ok;
+ readonly attribute ByteString statusText;
+ readonly attribute Headers headers;
+
+ [RaisesException] Response clone();
+
+ readonly attribute ReadableByteStream body;
+};
+
+Response implements Body;
diff --git a/modules/fetch/WindowFetch.idl b/modules/fetch/WindowFetch.idl
new file mode 100644
index 0000000..d2b48ad
--- /dev/null
+++ b/modules/fetch/WindowFetch.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.
+
+[
+ ImplementedAs=GlobalFetch,
+] partial interface Window {
+ [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
+};
diff --git a/modules/fetch/WorkerFetch.idl b/modules/fetch/WorkerFetch.idl
new file mode 100644
index 0000000..8c2c87e
--- /dev/null
+++ b/modules/fetch/WorkerFetch.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.
+
+[
+ ImplementedAs=GlobalFetch,
+] partial interface WorkerGlobalScope {
+ [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
+};
diff --git a/modules/filesystem/InspectorFrontendHostFileSystem.idl b/modules/filesystem/DevToolsHostFileSystem.idl
similarity index 89%
rename from modules/filesystem/InspectorFrontendHostFileSystem.idl
rename to modules/filesystem/DevToolsHostFileSystem.idl
index d871fab..c0a283a 100644
--- a/modules/filesystem/InspectorFrontendHostFileSystem.idl
+++ b/modules/filesystem/DevToolsHostFileSystem.idl
@@ -4,7 +4,7 @@
[
RuntimeEnabled=FileSystem,
-] partial interface InspectorFrontendHost {
+] partial interface DevToolsHost {
DOMFileSystem isolatedFileSystem(DOMString fileSystemId, DOMString registeredName);
void upgradeDraggedFileSystemPermissions(DOMFileSystem domFileSystem);
};
diff --git a/modules/filesystem/DirectoryEntry.idl b/modules/filesystem/DirectoryEntry.idl
index 2a0bc6c..854a088 100644
--- a/modules/filesystem/DirectoryEntry.idl
+++ b/modules/filesystem/DirectoryEntry.idl
@@ -32,7 +32,7 @@
NoInterfaceObject
] interface DirectoryEntry : Entry {
DirectoryReader createReader();
- 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 getFile([TreatUndefinedAs=NullString] DOMString? path, optional FileSystemFlags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ void getDirectory([TreatUndefinedAs=NullString] DOMString? path, optional FileSystemFlags 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 871c306..07de469 100644
--- a/modules/filesystem/DirectoryEntrySync.idl
+++ b/modules/filesystem/DirectoryEntrySync.idl
@@ -32,7 +32,7 @@
NoInterfaceObject
] interface DirectoryEntrySync : EntrySync {
DirectoryReaderSync createReader();
- [RaisesException] FileEntrySync getFile([TreatUndefinedAs=NullString] DOMString? path, Dictionary flags);
- [RaisesException] DirectoryEntrySync getDirectory([TreatUndefinedAs=NullString] DOMString? path, Dictionary flags);
+ [RaisesException] FileEntrySync getFile([TreatUndefinedAs=NullString] DOMString? path, FileSystemFlags flags);
+ [RaisesException] DirectoryEntrySync getDirectory([TreatUndefinedAs=NullString] DOMString? path, FileSystemFlags flags);
[RaisesException] void removeRecursively();
};
diff --git a/modules/filesystem/Entry.idl b/modules/filesystem/Entry.idl
index 86d338a..d7162ef 100644
--- a/modules/filesystem/Entry.idl
+++ b/modules/filesystem/Entry.idl
@@ -29,7 +29,6 @@
*/
[
- Custom=Wrap,
NoInterfaceObject,
GarbageCollected,
] interface Entry {
diff --git a/modules/filesystem/EntrySync.idl b/modules/filesystem/EntrySync.idl
index d953977..e574cbc 100644
--- a/modules/filesystem/EntrySync.idl
+++ b/modules/filesystem/EntrySync.idl
@@ -29,7 +29,6 @@
*/
[
- Custom=Wrap,
NoInterfaceObject,
GarbageCollected,
] interface EntrySync {
diff --git a/modules/filesystem/FileSystemFlags.idl b/modules/filesystem/FileSystemFlags.idl
new file mode 100644
index 0000000..84707ae
--- /dev/null
+++ b/modules/filesystem/FileSystemFlags.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.
+
+// http://www.w3.org/TR/2012/WD-file-system-api-20120417/
+// In the spec, the flags don't have default values, but Blink assumes
+// that they are false when not specified.
+
+dictionary FileSystemFlags {
+ // [ImplementedAs] is used to workaround a name conflict; our IDL
+ // compiler generates create() static method which creates an impl instance.
+ [ImplementedAs=createFlag] boolean create = false;
+ boolean exclusive = false;
+};
diff --git a/modules/gamepad/Gamepad.idl b/modules/gamepad/Gamepad.idl
index 9ec0905..9459de1 100644
--- a/modules/gamepad/Gamepad.idl
+++ b/modules/gamepad/Gamepad.idl
@@ -32,7 +32,5 @@
readonly attribute unsigned long long timestamp;
readonly attribute DOMString mapping;
readonly attribute double[] axes;
-// FIXMEDART: enable buttons for dart once we handle HeapVector propertly on
-// the Dart side of the bindings.
- [DartSuppress] readonly attribute GamepadButton[] buttons;
+ readonly attribute GamepadButton[] buttons;
};
diff --git a/modules/gamepad/GamepadButton.idl b/modules/gamepad/GamepadButton.idl
index 19d88ce..1a4a8cb 100644
--- a/modules/gamepad/GamepadButton.idl
+++ b/modules/gamepad/GamepadButton.idl
@@ -3,7 +3,6 @@
// found in the LICENSE file.
[
- NoInterfaceObject,
GarbageCollected,
] interface GamepadButton {
readonly attribute boolean pressed;
diff --git a/modules/gamepad/GamepadEvent.idl b/modules/gamepad/GamepadEvent.idl
index 718226e..86c0b2a 100644
--- a/modules/gamepad/GamepadEvent.idl
+++ b/modules/gamepad/GamepadEvent.idl
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepadevent-interface
+
[
- EventConstructor,
+ Constructor(DOMString type, optional GamepadEventInit eventInitDict),
] interface GamepadEvent : Event {
- [InitializedByEventConstructor] readonly attribute Gamepad gamepad;
+ readonly attribute Gamepad gamepad;
};
diff --git a/modules/gamepad/GamepadEventInit.idl b/modules/gamepad/GamepadEventInit.idl
new file mode 100644
index 0000000..4291a7e
--- /dev/null
+++ b/modules/gamepad/GamepadEventInit.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.
+
+// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepadevent-interface
+
+dictionary GamepadEventInit : EventInit {
+ Gamepad gamepad;
+};
diff --git a/modules/gamepad/NavigatorGamepad.idl b/modules/gamepad/NavigatorGamepad.idl
index 81b1f29..a854d79 100644
--- a/modules/gamepad/NavigatorGamepad.idl
+++ b/modules/gamepad/NavigatorGamepad.idl
@@ -17,9 +17,6 @@
* Boston, MA 02110-1301, USA.
*/
-[
- RuntimeEnabled=Gamepad,
-] partial interface Navigator {
- [DeprecateAs=PrefixedGamepad] WebKitGamepadList webkitGetGamepads();
+partial interface Navigator {
GamepadList getGamepads();
};
diff --git a/modules/gamepad/WebKitGamepad.idl b/modules/gamepad/WebKitGamepad.idl
deleted file mode 100644
index d8d2cb2..0000000
--- a/modules/gamepad/WebKitGamepad.idl
+++ /dev/null
@@ -1,15 +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.
-
-[
- GarbageCollected,
-] interface WebKitGamepad {
- readonly attribute DOMString id;
- readonly attribute unsigned long index;
- readonly attribute boolean connected;
- readonly attribute unsigned long long timestamp;
- readonly attribute DOMString mapping;
- readonly attribute float[] axes;
- readonly attribute float[] buttons;
-};
diff --git a/modules/gamepad/WebKitGamepadList.idl b/modules/gamepad/WebKitGamepadList.idl
deleted file mode 100644
index 2b35c56..0000000
--- a/modules/gamepad/WebKitGamepadList.idl
+++ /dev/null
@@ -1,11 +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.
-
-[
- NoInterfaceObject,
- GarbageCollected,
-] interface WebKitGamepadList {
- readonly attribute unsigned long length;
- getter WebKitGamepad item([Default=Undefined] optional unsigned long index);
-};
diff --git a/modules/geofencing/CircularGeofencingRegion.idl b/modules/geofencing/CircularGeofencingRegion.idl
index 1ddf454..6cac262 100644
--- a/modules/geofencing/CircularGeofencingRegion.idl
+++ b/modules/geofencing/CircularGeofencingRegion.idl
@@ -6,7 +6,7 @@
RuntimeEnabled=Geofencing,
Exposed=(Window,Worker),
GarbageCollected,
- Constructor(Dictionary init)
+ Constructor(CircularGeofencingRegionInit init)
] interface CircularGeofencingRegion : GeofencingRegion {
const double MIN_RADIUS = 1.0;
const double MAX_RADIUS = 100.0;
diff --git a/modules/geofencing/CircularGeofencingRegionInit.idl b/modules/geofencing/CircularGeofencingRegionInit.idl
new file mode 100644
index 0000000..4abc486
--- /dev/null
+++ b/modules/geofencing/CircularGeofencingRegionInit.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.
+
+// FIXME: Add the spec URL.
+
+dictionary CircularGeofencingRegionInit {
+ DOMString? id = null;
+ double latitude;
+ double longitude;
+ double radius;
+};
diff --git a/modules/geofencing/GeofencingEvent.idl b/modules/geofencing/GeofencingEvent.idl
new file mode 100644
index 0000000..47b3cc9
--- /dev/null
+++ b/modules/geofencing/GeofencingEvent.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,
+ Exposed=ServiceWorker
+] interface GeofencingEvent : Event {
+ readonly attribute DOMString id;
+ readonly attribute GeofencingRegion region;
+};
diff --git a/modules/geofencing/GeofencingRegion.idl b/modules/geofencing/GeofencingRegion.idl
index 32d3d3c..4e22058 100644
--- a/modules/geofencing/GeofencingRegion.idl
+++ b/modules/geofencing/GeofencingRegion.idl
@@ -4,7 +4,6 @@
[
RuntimeEnabled=Geofencing,
- SpecialWrapFor=CircularGeofencingRegion,
NoInterfaceObject,
GarbageCollected,
] interface GeofencingRegion {
diff --git a/modules/geofencing/NavigatorGeofencing.idl b/modules/geofencing/ServiceWorkerGlobalScopeGeofencing.idl
similarity index 60%
copy from modules/geofencing/NavigatorGeofencing.idl
copy to modules/geofencing/ServiceWorkerGlobalScopeGeofencing.idl
index 2591b0f..418f02e 100644
--- a/modules/geofencing/NavigatorGeofencing.idl
+++ b/modules/geofencing/ServiceWorkerGlobalScopeGeofencing.idl
@@ -4,6 +4,7 @@
[
RuntimeEnabled=Geofencing,
-] partial interface Navigator {
- readonly attribute Geofencing geofencing;
+] partial interface ServiceWorkerGlobalScope {
+ attribute EventHandler ongeofenceenter;
+ attribute EventHandler ongeofenceleave;
};
diff --git a/modules/geofencing/NavigatorGeofencing.idl b/modules/geofencing/ServiceWorkerRegistrationGeofencing.idl
similarity index 83%
rename from modules/geofencing/NavigatorGeofencing.idl
rename to modules/geofencing/ServiceWorkerRegistrationGeofencing.idl
index 2591b0f..1d0df55 100644
--- a/modules/geofencing/NavigatorGeofencing.idl
+++ b/modules/geofencing/ServiceWorkerRegistrationGeofencing.idl
@@ -4,6 +4,6 @@
[
RuntimeEnabled=Geofencing,
-] partial interface Navigator {
+] partial interface ServiceWorkerRegistration {
readonly attribute Geofencing geofencing;
};
diff --git a/modules/geofencing/WorkerNavigatorGeofencing.idl b/modules/geofencing/WorkerNavigatorGeofencing.idl
index bfcbe18..6af4e01 100644
--- a/modules/geofencing/WorkerNavigatorGeofencing.idl
+++ b/modules/geofencing/WorkerNavigatorGeofencing.idl
@@ -6,5 +6,6 @@
RuntimeEnabled=Geofencing,
Exposed=Worker,
] partial interface WorkerNavigator {
+ // FIXME: Delete this class once ServiceWorkerRegistration is exposed in service workers.
readonly attribute Geofencing geofencing;
};
diff --git a/modules/geolocation/Geolocation.idl b/modules/geolocation/Geolocation.idl
index 2c9c1f8..1961845 100644
--- a/modules/geolocation/Geolocation.idl
+++ b/modules/geolocation/Geolocation.idl
@@ -28,15 +28,13 @@
GarbageCollected,
NoInterfaceObject,
] interface Geolocation {
- // FIXME: should be: PositionOptions options: need PositionOptions.idl and dictionary http:/crbug.com/321462
[LogActivity] void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
- optional Dictionary options);
+ optional PositionOptions options);
- // FIXME: should be: PositionOptions options: need PositionOptions.idl and dictionary http:/crbug.com/321462
[LogActivity] long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
- optional Dictionary options);
+ optional PositionOptions options);
void clearWatch(long watchID);
};
diff --git a/modules/geolocation/PositionOptions.idl b/modules/geolocation/PositionOptions.idl
new file mode 100644
index 0000000..693a2df
--- /dev/null
+++ b/modules/geolocation/PositionOptions.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.
+
+dictionary PositionOptions {
+ boolean enableHighAccuracy = false;
+ [Clamp] unsigned long timeout = 0xFFFFFFFF;
+ [Clamp] unsigned long maximumAge = 0;
+};
diff --git a/modules/geolocation/testing/InternalsGeolocation.idl b/modules/geolocation/testing/InternalsGeolocation.idl
index ac6b2d3..1619c21 100644
--- a/modules/geolocation/testing/InternalsGeolocation.idl
+++ b/modules/geolocation/testing/InternalsGeolocation.idl
@@ -28,7 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface Internals {
+[
+ TypeChecking=Interface
+] partial interface Internals {
void setGeolocationClientMock(Document document);
void setGeolocationPosition(Document document, double latitude, double longitude, double accuracy);
void setGeolocationPositionUnavailableError(Document document, DOMString message);
diff --git a/core/imagebitmap/WindowImageBitmapFactories.idl b/modules/imagebitmap/WindowImageBitmapFactories.idl
similarity index 94%
rename from core/imagebitmap/WindowImageBitmapFactories.idl
rename to modules/imagebitmap/WindowImageBitmapFactories.idl
index cf877c5..b265a6d 100644
--- a/core/imagebitmap/WindowImageBitmapFactories.idl
+++ b/modules/imagebitmap/WindowImageBitmapFactories.idl
@@ -28,8 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#imagebitmapfactories
+
+// TODO(philipj): This should be part of the ImageBitmapFactories interface.
[
- ImplementedAs=ImageBitmapFactories,
RuntimeEnabled=ExperimentalCanvasFeatures,
TypeChecking=Interface,
] partial interface Window {
diff --git a/modules/indexeddb/IDBCursor.idl b/modules/indexeddb/IDBCursor.idl
index b96920b..a0a25f3 100644
--- a/modules/indexeddb/IDBCursor.idl
+++ b/modules/indexeddb/IDBCursor.idl
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor
+// https://w3c.github.io/IndexedDB/#idl-def-IDBCursorDirection
enum IDBCursorDirection {
"next",
@@ -32,19 +32,21 @@
"prevunique"
};
+// https://w3c.github.io/IndexedDB/#idl-def-IDBCursor
+
[
+ Exposed=(Window,Worker),
GarbageCollected
] interface IDBCursor {
-
+ [CallWith=ScriptState] readonly attribute any source;
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;
[CallWith=ScriptState, RaisesException] IDBRequest update(any value);
[RaisesException] void advance([EnforceRange] unsigned long count);
- // FIXMEDART: Define new names for these (see b/4436830).
[CallWith=ScriptState, ImplementedAs=continueFunction, RaisesException] void continue([Default=Undefined] optional any key);
+ // TODO(jsbell): Proposal: https://github.com/w3c/IndexedDB/issues/14
[CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] void continuePrimaryKey(any key, any primaryKey);
[CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete();
};
diff --git a/modules/indexeddb/IDBCursorWithValue.idl b/modules/indexeddb/IDBCursorWithValue.idl
index 719aa1e..b9887cd 100644
--- a/modules/indexeddb/IDBCursorWithValue.idl
+++ b/modules/indexeddb/IDBCursorWithValue.idl
@@ -23,7 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursorWithValue
+
[
+ Exposed=(Window,Worker)
] interface IDBCursorWithValue : IDBCursor {
[CallWith=ScriptState, CachedAttribute=isValueDirty] readonly attribute any value;
};
diff --git a/modules/indexeddb/IDBDatabase.idl b/modules/indexeddb/IDBDatabase.idl
index 36ab560..1df577e 100644
--- a/modules/indexeddb/IDBDatabase.idl
+++ b/modules/indexeddb/IDBDatabase.idl
@@ -24,29 +24,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// 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"
-};
+// https://w3c.github.io/IndexedDB/#idl-def-IDBDatabase
[
+ Exposed=(Window,Worker),
ActiveDOMObject,
GarbageCollected,
] interface IDBDatabase : EventTarget {
readonly attribute DOMString name;
- [CallWith=ScriptState] readonly attribute any version;
- readonly attribute DOMStringList objectStoreNames;
- [RaisesException] IDBObjectStore createObjectStore(DOMString name, optional Dictionary options);
+ // TODO(jsbell): DOMString version is non-standard, to support databases created with old API.
+ readonly attribute (unsigned long long or DOMString) version;
+ [Measure] readonly attribute DOMStringList objectStoreNames;
+
+ [RaisesException] IDBObjectStore createObjectStore(DOMString name, optional IDBObjectStoreParameters options);
[RaisesException] void deleteObjectStore(DOMString name);
- // FIXME: should be union type http://crbug.com/240176
- [CallWith=ScriptState, RaisesException] IDBTransaction transaction(DOMString storeName, optional IDBTransactionMode mode = "readonly");
- [CallWith=ScriptState, RaisesException] IDBTransaction transaction(sequence<DOMString> storeNames, optional IDBTransactionMode mode = "readonly");
- [CallWith=ScriptState, RaisesException] IDBTransaction transaction(DOMStringList storeNames, optional IDBTransactionMode mode = "readonly");
+ [CallWith=ScriptState, RaisesException] IDBTransaction transaction((DOMString or sequence<DOMString> or DOMStringList) storeNames, optional IDBTransactionMode mode = "readonly");
void close();
+
attribute EventHandler onabort;
attribute EventHandler onclose;
attribute EventHandler onerror;
diff --git a/modules/indexeddb/IDBFactory.idl b/modules/indexeddb/IDBFactory.idl
index 7e91862..4e57591 100644
--- a/modules/indexeddb/IDBFactory.idl
+++ b/modules/indexeddb/IDBFactory.idl
@@ -23,7 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory
+
[
+ Exposed=(Window,Worker),
GarbageCollected
] interface IDBFactory {
[CallWith=ScriptState, ImplementedAs=getDatabaseNames, RaisesException] IDBRequest webkitGetDatabaseNames();
diff --git a/modules/indexeddb/IDBIndex.idl b/modules/indexeddb/IDBIndex.idl
index c6d6826..ac023ed 100644
--- a/modules/indexeddb/IDBIndex.idl
+++ b/modules/indexeddb/IDBIndex.idl
@@ -23,29 +23,26 @@
* 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"
-};
+// https://w3c.github.io/IndexedDB/#idl-def-IDBIndex
[
+ Exposed=(Window,Worker),
GarbageCollected
] interface IDBIndex {
readonly attribute DOMString name;
readonly attribute IDBObjectStore objectStore;
[CallWith=ScriptState] readonly attribute any keyPath;
- readonly attribute boolean unique;
readonly attribute boolean multiEntry;
-
- [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");
+ readonly attribute boolean unique;
[CallWith=ScriptState, RaisesException] IDBRequest get(any key);
[CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
+ // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
+ [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAll([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
+ // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
+ [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAllKeys([Default=Undefined] optional any range, [EnforceRange] optional unsigned long maxCount = 0xFFFFFFFF);
[CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
+ [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");
+
};
diff --git a/modules/indexeddb/IDBIndexParameters.idl b/modules/indexeddb/IDBIndexParameters.idl
index 199d45c..c6f07ba 100644
--- a/modules/indexeddb/IDBIndexParameters.idl
+++ b/modules/indexeddb/IDBIndexParameters.idl
@@ -2,11 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#options-object-concept
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBIndexParameters
-[
- GarbageCollected
-] dictionary IDBIndexParameters {
+dictionary IDBIndexParameters {
boolean unique = false;
boolean multiEntry = false;
};
diff --git a/modules/indexeddb/IDBKeyRange.idl b/modules/indexeddb/IDBKeyRange.idl
index 93654fc..a55200e 100644
--- a/modules/indexeddb/IDBKeyRange.idl
+++ b/modules/indexeddb/IDBKeyRange.idl
@@ -23,7 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
+
[
+ Exposed=(Window,Worker),
GarbageCollected
] interface IDBKeyRange {
[ImplementedAs=lowerValue, CallWith=ScriptState] readonly attribute any lower;
@@ -31,9 +34,8 @@
readonly attribute boolean lowerOpen;
readonly attribute boolean upperOpen;
- // 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, 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);
+ [CallWith=ExecutionContext, RaisesException] static IDBKeyRange only(any value);
+ [CallWith=ExecutionContext, RaisesException] static IDBKeyRange lowerBound(any bound, optional boolean open = false);
+ [CallWith=ExecutionContext, RaisesException] static IDBKeyRange upperBound(any bound, optional boolean open = false);
+ [CallWith=ExecutionContext, RaisesException] 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 2afdfe4..ae4fc4f 100644
--- a/modules/indexeddb/IDBObjectStore.idl
+++ b/modules/indexeddb/IDBObjectStore.idl
@@ -23,36 +23,33 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// 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"
-};
+// https://w3c.github.io/IndexedDB/#idl-def-IDBObjectStore
[
+ Exposed=(Window,Worker),
GarbageCollected,
] interface IDBObjectStore {
- readonly attribute DOMString? name;
+ readonly attribute DOMString name;
[CallWith=ScriptState] readonly attribute any keyPath;
- readonly attribute DOMStringList indexNames;
+ [Measure] readonly attribute DOMStringList indexNames;
readonly attribute IDBTransaction transaction;
readonly attribute boolean autoIncrement;
[CallWith=ScriptState, RaisesException] IDBRequest put(any value, [Default=Undefined] optional any key);
[CallWith=ScriptState, RaisesException] IDBRequest add(any value, [Default=Undefined] optional any key);
[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 = "next");
+ [CallWith=ScriptState, RaisesException] IDBRequest get(any key);
+ // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
+ [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAll([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
+ // TODO(cmumford): Standardize or eventually remove. More info at:
+ // https://w3c.github.io/IndexedDB/#widl-IDBObjectStore-getAllKeys-IDBRequest-any-query-unsigned-long-count
+ // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
+ [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAllKeys([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
+ [CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
+ [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional IDBCursorDirection 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 IDBIndexParameters options);
- [CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters options);
+ [CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters options);
[RaisesException] IDBIndex index(DOMString name);
[RaisesException] void deleteIndex(DOMString name);
- [CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
};
diff --git a/modules/indexeddb/IDBObjectStoreParameters.idl b/modules/indexeddb/IDBObjectStoreParameters.idl
new file mode 100644
index 0000000..cd49459
--- /dev/null
+++ b/modules/indexeddb/IDBObjectStoreParameters.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.
+
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
+
+dictionary IDBObjectStoreParameters {
+ (DOMString or sequence<DOMString>)? keyPath = null;
+ boolean autoIncrement = false;
+};
diff --git a/modules/indexeddb/IDBOpenDBRequest.idl b/modules/indexeddb/IDBOpenDBRequest.idl
index a77f28f..dbb2313 100644
--- a/modules/indexeddb/IDBOpenDBRequest.idl
+++ b/modules/indexeddb/IDBOpenDBRequest.idl
@@ -23,7 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface IDBOpenDBRequest : IDBRequest {
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBOpenDBRequest
+
+[
+ Exposed=(Window,Worker)
+] interface IDBOpenDBRequest : IDBRequest {
attribute EventHandler onblocked;
attribute EventHandler onupgradeneeded;
};
diff --git a/modules/indexeddb/IDBRequest.idl b/modules/indexeddb/IDBRequest.idl
index 1241cb7..42694a9 100644
--- a/modules/indexeddb/IDBRequest.idl
+++ b/modules/indexeddb/IDBRequest.idl
@@ -27,17 +27,22 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequestReadyState
+
enum IDBRequestReadyState {
"pending",
"done"
};
+// http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
+
[
+ Exposed=(Window,Worker),
ActiveDOMObject,
GarbageCollected,
] interface IDBRequest : EventTarget {
[RaisesException=Getter, CachedAttribute=isResultDirty] readonly attribute any result;
- [RaisesException=Getter] readonly attribute DOMError error;
+ [RaisesException=Getter, Measure] readonly attribute DOMError error;
readonly attribute any source;
readonly attribute IDBTransaction transaction;
diff --git a/modules/indexeddb/IDBTransaction.idl b/modules/indexeddb/IDBTransaction.idl
index 8c86f14..7f56759 100644
--- a/modules/indexeddb/IDBTransaction.idl
+++ b/modules/indexeddb/IDBTransaction.idl
@@ -24,22 +24,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+// https://w3c.github.io/IndexedDB/#idl-def-IDBTransactionMode
+
enum IDBTransactionMode {
"readonly",
"readwrite",
"versionchange"
};
+// https://w3c.github.io/IndexedDB/#idl-def-IDBTransaction
+
[
+ Exposed=(Window,Worker),
ActiveDOMObject,
GarbageCollected
] interface IDBTransaction : EventTarget {
// Properties
+ [RuntimeEnabled=IndexedDBExperimental, Measure] readonly attribute DOMStringList objectStoreNames;
readonly attribute IDBTransactionMode mode;
readonly attribute IDBDatabase db;
- readonly attribute DOMError error;
+ [Measure] readonly attribute DOMError error;
// Methods
[RaisesException] IDBObjectStore objectStore (DOMString name);
diff --git a/modules/indexeddb/IDBVersionChangeEvent.idl b/modules/indexeddb/IDBVersionChangeEvent.idl
index 2f73603..b6656a7 100644
--- a/modules/indexeddb/IDBVersionChangeEvent.idl
+++ b/modules/indexeddb/IDBVersionChangeEvent.idl
@@ -27,18 +27,16 @@
// FIXME: This enum is non-standard, see
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
-enum IDBDataLossAmount {
- "none",
- "total"
-};
+enum IDBDataLossAmount { "none", "total" };
[
- EventConstructor
+ Exposed=(Window,Worker),
+ Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)
] interface IDBVersionChangeEvent : Event {
- [InitializedByEventConstructor] readonly attribute unsigned long long oldVersion;
- [InitializedByEventConstructor] readonly attribute unsigned long long? newVersion;
+ readonly attribute unsigned long long oldVersion;
+ readonly attribute unsigned long long? newVersion;
// FIXME: These are non-standard, see
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
- [InitializedByEventConstructor] readonly attribute IDBDataLossAmount dataLoss;
+ readonly attribute IDBDataLossAmount dataLoss;
readonly attribute DOMString dataLossMessage;
};
diff --git a/modules/indexeddb/IDBVersionChangeEventInit.idl b/modules/indexeddb/IDBVersionChangeEventInit.idl
new file mode 100644
index 0000000..1ee4c85
--- /dev/null
+++ b/modules/indexeddb/IDBVersionChangeEventInit.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.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEventInit
+
+dictionary IDBVersionChangeEventInit : EventInit {
+ unsigned long long oldVersion = 0;
+ unsigned long long? newVersion = null;
+ IDBDataLossAmount dataLoss = "none";
+};
diff --git a/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl b/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
index a9540b6..796cd5d 100644
--- a/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
+++ b/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
@@ -37,16 +37,4 @@
[DeprecateAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
readonly attribute IDBFactory indexedDB;
-
- attribute IDBCursorConstructor IDBCursor;
- attribute IDBCursorWithValueConstructor IDBCursorWithValue;
- attribute IDBDatabaseConstructor IDBDatabase;
- attribute IDBFactoryConstructor IDBFactory;
- attribute IDBIndexConstructor IDBIndex;
- attribute IDBKeyRangeConstructor IDBKeyRange;
- attribute IDBObjectStoreConstructor IDBObjectStore;
- attribute IDBOpenDBRequestConstructor IDBOpenDBRequest;
- attribute IDBRequestConstructor IDBRequest;
- attribute IDBTransactionConstructor IDBTransaction;
- attribute IDBVersionChangeEventConstructor IDBVersionChangeEvent;
};
diff --git a/modules/mediasession/HTMLMediaElementMediaSession.idl b/modules/mediasession/HTMLMediaElementMediaSession.idl
new file mode 100644
index 0000000..14b2fe5
--- /dev/null
+++ b/modules/mediasession/HTMLMediaElementMediaSession.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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://mediasession.spec.whatwg.org/#extensions-to-the-htmlmediaelement-interface
+
+[
+ TypeChecking=Interface,
+ RuntimeEnabled=MediaSession,
+] partial interface HTMLMediaElement {
+ attribute MediaSession? session;
+};
diff --git a/modules/mediasession/MediaSession.idl b/modules/mediasession/MediaSession.idl
new file mode 100644
index 0000000..235604b
--- /dev/null
+++ b/modules/mediasession/MediaSession.idl
@@ -0,0 +1,14 @@
+// Copyright 2015 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://mediasession.spec.whatwg.org/#the-mediasession-interface
+
+[
+ Constructor(),
+ GarbageCollected,
+ RuntimeEnabled=MediaSession,
+] interface MediaSession {
+ void activate();
+ void deactivate();
+};
diff --git a/modules/mediasource/MediaSource.idl b/modules/mediasource/MediaSource.idl
index 1863acb..244160b 100644
--- a/modules/mediasource/MediaSource.idl
+++ b/modules/mediasource/MediaSource.idl
@@ -40,7 +40,7 @@
Constructor,
ConstructorCallWith=ExecutionContext,
RuntimeEnabled=MediaSource,
- TypeChecking=(Interface,Unrestricted),
+ TypeChecking=Interface,
] 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 321daf7..6329078 100644
--- a/modules/mediasource/SourceBuffer.idl
+++ b/modules/mediasource/SourceBuffer.idl
@@ -39,7 +39,7 @@
ActiveDOMObject,
NoInterfaceObject,
RuntimeEnabled=MediaSource,
- TypeChecking=(Interface,Unrestricted),
+ TypeChecking=Interface,
] interface SourceBuffer : EventTarget {
// Gets or sets the AppendMode.
@@ -64,10 +64,14 @@
[RaisesException] void appendBuffer(ArrayBuffer data);
[RaisesException] void appendBuffer(ArrayBufferView data);
- [RaisesException, RuntimeEnabled=Stream] void appendStream(Stream stream, optional unsigned long long maxSize);
+ [RaisesException, RuntimeEnabled=ExperimentalStream] void appendStream(Stream stream, optional unsigned long long maxSize);
// Abort the current segment append sequence.
[RaisesException] void abort();
[RaisesException] void remove(double start, unrestricted double end);
+
+ // Gets or sets the TrackDefaultList this SourceBuffer may consult during
+ // the initialization segment algorithm.
+ [RaisesException=Setter, RuntimeEnabled=MediaSourceExperimental] attribute TrackDefaultList trackDefaults;
};
diff --git a/modules/mediasource/SourceBufferList.idl b/modules/mediasource/SourceBufferList.idl
index 638ca9e..eb4db73 100644
--- a/modules/mediasource/SourceBufferList.idl
+++ b/modules/mediasource/SourceBufferList.idl
@@ -34,6 +34,6 @@
RuntimeEnabled=MediaSource,
] interface SourceBufferList : EventTarget {
readonly attribute unsigned long length;
- getter SourceBuffer item(unsigned long index);
+ [ImplementedAs=item] getter SourceBuffer (unsigned long index);
};
diff --git a/modules/mediasource/TrackDefault.idl b/modules/mediasource/TrackDefault.idl
new file mode 100644
index 0000000..5c8687f
--- /dev/null
+++ b/modules/mediasource/TrackDefault.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.
+
+// Per 11 Nov 2014 Editor's Draft
+// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#idl-def-TrackDefault
+
+enum TrackDefaultType { "audio", "video", "text" };
+
+[
+ Constructor(TrackDefaultType type, DOMString language, DOMString label, sequence<DOMString> kinds, optional DOMString byteStreamTrackID = ""),
+ RaisesException=Constructor,
+ GarbageCollected,
+ RuntimeEnabled=MediaSourceExperimental,
+] interface TrackDefault {
+ readonly attribute TrackDefaultType type;
+ readonly attribute DOMString byteStreamTrackID;
+ readonly attribute DOMString language;
+ readonly attribute DOMString label;
+ readonly attribute DOMString[] kinds;
+};
diff --git a/modules/mediasource/TrackDefaultList.idl b/modules/mediasource/TrackDefaultList.idl
new file mode 100644
index 0000000..2b962fc
--- /dev/null
+++ b/modules/mediasource/TrackDefaultList.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.
+
+// Per 09 Jan 2015 Editor's Draft
+// https://w3c.github.io/media-source/#trackdefaultlist
+
+[
+ Constructor(optional sequence<TrackDefault> trackDefaults = []),
+ RaisesException=Constructor,
+ GarbageCollected,
+ RuntimeEnabled=MediaSourceExperimental,
+] interface TrackDefaultList {
+ readonly attribute unsigned long length;
+ [ImplementedAs=item] getter TrackDefault (unsigned long index);
+};
diff --git a/modules/mediastream/MediaDeviceInfoCallback.idl b/modules/mediastream/MediaDeviceInfoCallback.idl
deleted file mode 100644
index f6792c9..0000000
--- a/modules/mediastream/MediaDeviceInfoCallback.idl
+++ /dev/null
@@ -1,29 +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:
- * 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 GOOGLE INC. ``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 GOOGLE INC. 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.
- */
-
-callback interface MediaDeviceInfoCallback {
- void handleEvent(sequence<MediaDeviceInfo> devices);
-};
-
diff --git a/modules/mediastream/MediaDevices.idl b/modules/mediastream/MediaDevices.idl
new file mode 100644
index 0000000..38c43de
--- /dev/null
+++ b/modules/mediastream/MediaDevices.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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.
+
+// The spec for MediaDevices is in two parts:
+// http://w3c.github.io/mediacapture-main/#mediadevices
+// http://w3c.github.io/mediacapture-main/#mediadevices-interface-extensions
+
+[
+ GarbageCollected,
+ RuntimeEnabled=EnumerateDevices
+]
+interface MediaDevices {
+ [RuntimeEnabled=EnumerateDevices, TypeChecking=Interface, CallWith=ScriptState] Promise<sequence<MediaDeviceInfo>> enumerateDevices();
+ [CallWith=ScriptState, RaisesException] Promise<MediaStream> getUserMedia(Dictionary options);
+};
diff --git a/modules/mediastream/MediaStream.idl b/modules/mediastream/MediaStream.idl
index 14cf0f5..1a042b7 100644
--- a/modules/mediastream/MediaStream.idl
+++ b/modules/mediastream/MediaStream.idl
@@ -33,7 +33,7 @@
NoInterfaceObject,
] interface MediaStream : EventTarget {
// DEPRECATED
- [MeasureAs=MediaStreamLabel] readonly attribute DOMString label;
+ [DeprecateAs=MediaStreamLabel] readonly attribute DOMString label;
readonly attribute DOMString id;
@@ -46,12 +46,18 @@
MediaStreamTrack getTrackById(DOMString trackId);
[CallWith=ExecutionContext] MediaStream clone();
// DEPRECATED
- [MeasureAs=MediaStreamEnded] readonly attribute boolean ended;
+ [DeprecateAs=MediaStreamEnded] readonly attribute boolean ended;
+
+ readonly attribute boolean active;
// DEPRECATED
- [MeasureAs=MediaStreamStop] void stop();
+ [DeprecateAs=MediaStreamStop] void stop();
+ attribute EventHandler onactive;
+ attribute EventHandler oninactive;
+ // DEPRECATED
attribute EventHandler onended;
+
attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
};
diff --git a/modules/mediastream/MediaStreamEvent.idl b/modules/mediastream/MediaStreamEvent.idl
index 701309c..f088583 100644
--- a/modules/mediastream/MediaStreamEvent.idl
+++ b/modules/mediastream/MediaStreamEvent.idl
@@ -22,9 +22,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface MediaStreamEvent : Event {
- [InitializedByEventConstructor] readonly attribute MediaStream? stream;
-};
+// http://www.w3.org/TR/webrtc/#mediastreamevent
+[
+ Constructor(DOMString type, optional MediaStreamEventInit eventInitDict),
+] interface MediaStreamEvent : Event {
+ readonly attribute MediaStream? stream;
+};
diff --git a/modules/mediastream/MediaStreamEventInit.idl b/modules/mediastream/MediaStreamEventInit.idl
new file mode 100644
index 0000000..f7ba224
--- /dev/null
+++ b/modules/mediastream/MediaStreamEventInit.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.
+
+// http://www.w3.org/TR/webrtc/#mediastreamevent
+
+dictionary MediaStreamEventInit : EventInit {
+ MediaStream stream;
+};
diff --git a/modules/mediastream/NavigatorMediaStream.idl b/modules/mediastream/NavigatorMediaStream.idl
index cef019a..f8c0199 100644
--- a/modules/mediastream/NavigatorMediaStream.idl
+++ b/modules/mediastream/NavigatorMediaStream.idl
@@ -17,9 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-[
- RuntimeEnabled=MediaStream,
-] partial interface Navigator {
+partial interface Navigator {
[RaisesException] void webkitGetUserMedia(Dictionary options,
NavigatorUserMediaSuccessCallback successCallback,
NavigatorUserMediaErrorCallback errorCallback);
diff --git a/modules/mediastream/NavigatorUserMedia.idl b/modules/mediastream/NavigatorUserMedia.idl
new file mode 100644
index 0000000..8c38ca1
--- /dev/null
+++ b/modules/mediastream/NavigatorUserMedia.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://w3c.github.io/mediacapture-main/#navigatorusermedia
+
+partial interface Navigator {
+ [RuntimeEnabled=EnumerateDevices] readonly attribute MediaDevices mediaDevices;
+};
+
diff --git a/modules/mediastream/RTCDTMFToneChangeEvent.idl b/modules/mediastream/RTCDTMFToneChangeEvent.idl
index 2bbd9cd..15b64ac 100644
--- a/modules/mediastream/RTCDTMFToneChangeEvent.idl
+++ b/modules/mediastream/RTCDTMFToneChangeEvent.idl
@@ -23,9 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/webrtc/#rtcdtmftonechangeevent
+
[
- EventConstructor,
NoInterfaceObject,
+ Constructor(DOMString type, RTCDTMFToneChangeEventInit eventInitDict),
] interface RTCDTMFToneChangeEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString tone;
+ readonly attribute DOMString tone;
};
diff --git a/modules/mediastream/RTCDTMFToneChangeEventInit.idl b/modules/mediastream/RTCDTMFToneChangeEventInit.idl
new file mode 100644
index 0000000..a070229
--- /dev/null
+++ b/modules/mediastream/RTCDTMFToneChangeEventInit.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.
+
+// http://www.w3.org/TR/webrtc/#rtcdtmftonechangeevent
+
+dictionary RTCDTMFToneChangeEventInit : EventInit {
+ DOMString tone;
+};
diff --git a/modules/mediastream/RTCIceCandidate.idl b/modules/mediastream/RTCIceCandidate.idl
index b3e2801..d6ce94d 100644
--- a/modules/mediastream/RTCIceCandidate.idl
+++ b/modules/mediastream/RTCIceCandidate.idl
@@ -30,11 +30,12 @@
[
GarbageCollected,
- Constructor(Dictionary dictionary),
+ Constructor(RTCIceCandidateInit candidateInitDict),
RaisesException=Constructor
] interface RTCIceCandidate {
[TreatNullAs=NullString] attribute DOMString candidate;
[TreatNullAs=NullString] attribute DOMString sdpMid;
attribute unsigned short sdpMLineIndex;
+ serializer = {attribute};
};
diff --git a/modules/mediastream/RTCIceCandidateInit.idl b/modules/mediastream/RTCIceCandidateInit.idl
new file mode 100644
index 0000000..e5a883e
--- /dev/null
+++ b/modules/mediastream/RTCIceCandidateInit.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.w3.org/TR/webrtc/#idl-def-RTCIceCandidateInit
+
+dictionary RTCIceCandidateInit {
+ DOMString candidate;
+ DOMString sdpMid;
+ unsigned short sdpMLineIndex;
+};
diff --git a/modules/mediastream/RTCPeerConnection.idl b/modules/mediastream/RTCPeerConnection.idl
index 6f24471..fa54946 100644
--- a/modules/mediastream/RTCPeerConnection.idl
+++ b/modules/mediastream/RTCPeerConnection.idl
@@ -51,7 +51,7 @@
[RaisesException] void updateIce(optional Dictionary configuration, optional Dictionary mediaConstraints);
// DEPRECATED
- [RaisesException, DartSuppress] void addIceCandidate(RTCIceCandidate candidate);
+ [RaisesException] void addIceCandidate(RTCIceCandidate candidate);
[RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCErrorCallback failureCallback);
diff --git a/modules/mediastream/RTCSessionDescription.idl b/modules/mediastream/RTCSessionDescription.idl
index a083ff3..6c9f668 100644
--- a/modules/mediastream/RTCSessionDescription.idl
+++ b/modules/mediastream/RTCSessionDescription.idl
@@ -28,12 +28,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/webrtc/#idl-def-RTCSessionDescription
+
+enum RTCSdpType {
+ "offer",
+ "pranswer",
+ "answer"
+};
+
[
GarbageCollected,
- Constructor(optional Dictionary descriptionInitDict),
- RaisesException=Constructor
+ Constructor(optional RTCSessionDescriptionInit descriptionInitDict)
] interface RTCSessionDescription {
- [RaisesException=Setter] attribute DOMString? type;
+ attribute RTCSdpType? type;
attribute DOMString? sdp;
+ serializer = {attribute};
};
diff --git a/modules/mediastream/RTCSessionDescriptionInit.idl b/modules/mediastream/RTCSessionDescriptionInit.idl
new file mode 100644
index 0000000..ed958e7
--- /dev/null
+++ b/modules/mediastream/RTCSessionDescriptionInit.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.
+
+// http://www.w3.org/TR/webrtc/#idl-def-RTCSessionDescription
+
+dictionary RTCSessionDescriptionInit {
+ RTCSdpType type;
+ DOMString sdp;
+};
diff --git a/modules/mediastream/RTCStatsReport.idl b/modules/mediastream/RTCStatsReport.idl
index 5721d5d..a00ebaa 100644
--- a/modules/mediastream/RTCStatsReport.idl
+++ b/modules/mediastream/RTCStatsReport.idl
@@ -31,7 +31,4 @@
readonly attribute DOMString type;
DOMString stat(DOMString name);
sequence<DOMString> names();
- // DEPRECATED - fake for old RTCStatsElement object.
- readonly attribute RTCStatsReport local;
- readonly attribute RTCStatsReport remote;
};
diff --git a/modules/mediastream/WindowMediaStream.idl b/modules/mediastream/WindowMediaStream.idl
index f5b14fc..fb06a6a 100644
--- a/modules/mediastream/WindowMediaStream.idl
+++ b/modules/mediastream/WindowMediaStream.idl
@@ -5,7 +5,7 @@
[
ImplementedAs=DOMWindowMediaStream,
] partial interface Window {
- [RuntimeEnabled=MediaStream] attribute MediaStreamConstructor webkitMediaStream;
+ attribute MediaStreamConstructor webkitMediaStream;
- [RuntimeEnabled=PeerConnection] attribute RTCPeerConnectionConstructor webkitRTCPeerConnection;
+ attribute RTCPeerConnectionConstructor webkitRTCPeerConnection;
};
diff --git a/modules/navigatorconnect/CrossOriginConnectEvent.idl b/modules/navigatorconnect/CrossOriginConnectEvent.idl
new file mode 100644
index 0000000..88823e3
--- /dev/null
+++ b/modules/navigatorconnect/CrossOriginConnectEvent.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.
+
+// http://mkruisselbrink.github.io/navigator-connect/#idl-def-CrossOriginConnectEvent
+[
+ Exposed=ServiceWorker,
+ RuntimeEnabled=NavigatorConnect,
+ TypeChecking=Interface
+] interface CrossOriginConnectEvent : Event {
+ readonly attribute CrossOriginServiceWorkerClient client;
+
+ [CallWith=ScriptState, RaisesException] void acceptConnection(Promise<boolean> shouldAccept);
+};
diff --git a/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl b/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl
new file mode 100644
index 0000000..cc868af
--- /dev/null
+++ b/modules/navigatorconnect/CrossOriginServiceWorkerClient.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.
+
+// http://mkruisselbrink.github.io/navigator-connect/#idl-def-CrossOriginServiceWorkerClient
+[
+ RuntimeEnabled=NavigatorConnect,
+ Exposed=ServiceWorker,
+ GarbageCollected
+] interface CrossOriginServiceWorkerClient : EventTarget {
+ readonly attribute DOMString origin;
+ readonly attribute DOMString targetUrl;
+
+ [PostMessage, RaisesException, CallWith=ExecutionContext]
+ void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+};
diff --git a/modules/navigatorconnect/NavigatorServices.idl b/modules/navigatorconnect/NavigatorServices.idl
new file mode 100644
index 0000000..99f52f8
--- /dev/null
+++ b/modules/navigatorconnect/NavigatorServices.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-NavigatorServices
+[
+ RuntimeEnabled=NavigatorConnect,
+] partial interface Navigator {
+ [CallWith=ExecutionContext] readonly attribute ServicePortCollection services;
+};
diff --git a/modules/navigatorconnect/ServicePort.idl b/modules/navigatorconnect/ServicePort.idl
new file mode 100644
index 0000000..8cbfeee
--- /dev/null
+++ b/modules/navigatorconnect/ServicePort.idl
@@ -0,0 +1,17 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePort
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=NavigatorConnect,
+ GarbageCollected,
+] interface ServicePort {
+ readonly attribute DOMString targetURL;
+ readonly attribute DOMString name;
+ [CallWith=ScriptState] readonly attribute any data;
+ [PostMessage, RaisesException, CallWith=ExecutionContext]
+ void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ void close();
+};
diff --git a/modules/navigatorconnect/ServicePortCollection.idl b/modules/navigatorconnect/ServicePortCollection.idl
new file mode 100644
index 0000000..31372cf
--- /dev/null
+++ b/modules/navigatorconnect/ServicePortCollection.idl
@@ -0,0 +1,19 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortCollection
+[
+ Exposed=(Window,Worker),
+ GarbageCollected,
+ TypeChecking=Interface,
+ RuntimeEnabled=NavigatorConnect,
+ TypeChecking=Interface,
+] interface ServicePortCollection : EventTarget {
+ [CallWith=ScriptState, RaisesException] Promise<ServicePort> connect(DOMString url, optional ServicePortConnectOptions options);
+ [CallWith=ScriptState] Promise<ServicePort> match(ServicePortMatchOptions options);
+ [CallWith=ScriptState] Promise<sequence<ServicePort>> matchAll(optional ServicePortMatchOptions options);
+ [Exposed=ServiceWorker] attribute EventHandler onconnect;
+ attribute EventHandler onmessage;
+ attribute EventHandler onclose;
+};
diff --git a/modules/navigatorconnect/ServicePortConnectEvent.idl b/modules/navigatorconnect/ServicePortConnectEvent.idl
new file mode 100644
index 0000000..799c4bb
--- /dev/null
+++ b/modules/navigatorconnect/ServicePortConnectEvent.idl
@@ -0,0 +1,15 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectEvent
+[
+ Exposed=ServiceWorker,
+ RuntimeEnabled=NavigatorConnect,
+ TypeChecking=Interface,
+ Constructor(DOMString type, optional ServicePortConnectEventInit eventInitDict),
+] interface ServicePortConnectEvent : ExtendableEvent {
+ readonly attribute DOMString targetURL;
+ readonly attribute DOMString origin;
+ [CallWith=ScriptState, RaisesException] Promise<ServicePort> respondWith(Promise<ServicePortConnectResponse> response);
+};
diff --git a/modules/navigatorconnect/ServicePortConnectEventInit.idl b/modules/navigatorconnect/ServicePortConnectEventInit.idl
new file mode 100644
index 0000000..1afd760
--- /dev/null
+++ b/modules/navigatorconnect/ServicePortConnectEventInit.idl
@@ -0,0 +1,11 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectEventInit
+
+dictionary ServicePortConnectEventInit : ExtendableEventInit {
+ DOMString targetURL;
+ DOMString origin;
+};
+
diff --git a/modules/navigatorconnect/ServicePortConnectOptions.idl b/modules/navigatorconnect/ServicePortConnectOptions.idl
new file mode 100644
index 0000000..4268cb1
--- /dev/null
+++ b/modules/navigatorconnect/ServicePortConnectOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectOptions
+
+dictionary ServicePortConnectOptions {
+ DOMString name;
+ any data;
+};
diff --git a/modules/navigatorconnect/ServicePortConnectResponse.idl b/modules/navigatorconnect/ServicePortConnectResponse.idl
new file mode 100644
index 0000000..ea7e097
--- /dev/null
+++ b/modules/navigatorconnect/ServicePortConnectResponse.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortConnectResponse
+
+dictionary ServicePortConnectResponse {
+ boolean accept;
+ DOMString name;
+ any data;
+};
+
diff --git a/modules/navigatorconnect/ServicePortMatchOptions.idl b/modules/navigatorconnect/ServicePortMatchOptions.idl
new file mode 100644
index 0000000..b596995
--- /dev/null
+++ b/modules/navigatorconnect/ServicePortMatchOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-ServicePortMatchOptions
+
+dictionary ServicePortMatchOptions {
+ DOMString name;
+ DOMString targetURL;
+};
diff --git a/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.idl b/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.idl
new file mode 100644
index 0000000..c9dc163
--- /dev/null
+++ b/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.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.
+
+// http://mkruisselbrink.github.io/navigator-connect/#idl-def-ServiceWorkerGlobalScope
+
+[
+ RuntimeEnabled=NavigatorConnect,
+] partial interface ServiceWorkerGlobalScope {
+ attribute EventHandler oncrossoriginconnect;
+ attribute EventHandler oncrossoriginmessage;
+};
diff --git a/modules/navigatorconnect/WorkerNavigatorServices.idl b/modules/navigatorconnect/WorkerNavigatorServices.idl
new file mode 100644
index 0000000..e5e87bd
--- /dev/null
+++ b/modules/navigatorconnect/WorkerNavigatorServices.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://mkruisselbrink.github.io/navigator-connect/#idl-def-NavigatorServices
+[
+ RuntimeEnabled=NavigatorConnect,
+] partial interface WorkerNavigator {
+ [CallWith=ExecutionContext] readonly attribute ServicePortCollection services;
+};
diff --git a/modules/netinfo/NavigatorNetworkInformation.idl b/modules/netinfo/NavigatorNetworkInformation.idl
index c3ee9e7..7d41395 100644
--- a/modules/netinfo/NavigatorNetworkInformation.idl
+++ b/modules/netinfo/NavigatorNetworkInformation.idl
@@ -5,5 +5,5 @@
[
RuntimeEnabled=NetworkInformation
] partial interface Navigator {
- readonly attribute NetworkInformation connection;
+ [MeasureAs=NetInfo] readonly attribute NetworkInformation connection;
};
diff --git a/modules/netinfo/WorkerNavigatorNetworkInformation.idl b/modules/netinfo/WorkerNavigatorNetworkInformation.idl
index a2126fa..b47c770 100644
--- a/modules/netinfo/WorkerNavigatorNetworkInformation.idl
+++ b/modules/netinfo/WorkerNavigatorNetworkInformation.idl
@@ -6,5 +6,5 @@
RuntimeEnabled=NetworkInformation,
Exposed=Worker
] partial interface WorkerNavigator {
- [CallWith=ExecutionContext] readonly attribute NetworkInformation connection;
+ [CallWith=ExecutionContext, MeasureAs=NetInfo] readonly attribute NetworkInformation connection;
};
diff --git a/modules/notifications/GetNotificationOptions.idl b/modules/notifications/GetNotificationOptions.idl
new file mode 100644
index 0000000..7ed11aa
--- /dev/null
+++ b/modules/notifications/GetNotificationOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://notifications.spec.whatwg.org/#service-worker-api
+
+dictionary GetNotificationOptions {
+ DOMString tag = "";
+};
diff --git a/modules/notifications/Notification.idl b/modules/notifications/Notification.idl
index ebf279d..0ad1096 100644
--- a/modules/notifications/Notification.idl
+++ b/modules/notifications/Notification.idl
@@ -34,7 +34,9 @@
ActiveDOMObject,
Constructor(DOMString title, optional NotificationOptions options),
ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
MeasureAs=NotificationCreated,
+ RaisesException=Constructor,
RuntimeEnabled=Notifications,
] interface Notification : EventTarget {
[CallWith=ExecutionContext, MeasureAs=NotificationPermission] static readonly attribute DOMString permission;
@@ -43,9 +45,9 @@
// FIXME: Implement the Notification.get() method.
attribute EventHandler onclick;
- attribute EventHandler onshow;
+ [MeasureAs=NotificationShowEvent] attribute EventHandler onshow;
attribute EventHandler onerror;
- attribute EventHandler onclose;
+ [MeasureAs=NotificationCloseEvent] attribute EventHandler onclose;
readonly attribute DOMString title;
readonly attribute DOMString dir;
@@ -54,5 +56,9 @@
readonly attribute DOMString tag;
readonly attribute DOMString icon;
+ [RuntimeEnabled=NotificationExperimental] readonly attribute sequence<unsigned long>? vibrate;
+ readonly attribute boolean silent;
+ [CallWith=ScriptState] readonly attribute any data;
+
[MeasureAs=NotificationClosed] void close();
};
diff --git a/modules/notifications/NotificationEvent.idl b/modules/notifications/NotificationEvent.idl
new file mode 100644
index 0000000..89bc93f
--- /dev/null
+++ b/modules/notifications/NotificationEvent.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://notifications.spec.whatwg.org/#service-worker-api
+
+[
+ Constructor(DOMString type, optional NotificationEventInit eventInitDict),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=ServiceWorkerNotifications,
+ TypeChecking=Interface,
+] interface NotificationEvent : ExtendableEvent {
+ readonly attribute Notification notification;
+};
diff --git a/modules/notifications/NotificationEventInit.idl b/modules/notifications/NotificationEventInit.idl
new file mode 100644
index 0000000..47ce14a
--- /dev/null
+++ b/modules/notifications/NotificationEventInit.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.
+
+// https://notifications.spec.whatwg.org/#notificationevent
+
+dictionary NotificationEventInit : ExtendableEventInit {
+ Notification notification;
+};
diff --git a/modules/notifications/NotificationOptions.idl b/modules/notifications/NotificationOptions.idl
index 8230322..364907e 100644
--- a/modules/notifications/NotificationOptions.idl
+++ b/modules/notifications/NotificationOptions.idl
@@ -10,12 +10,14 @@
"rtl"
};
-[
- GarbageCollected
-] dictionary NotificationOptions {
+dictionary NotificationOptions {
NotificationDirection dir = "auto";
DOMString lang = "";
DOMString body = "";
DOMString tag = "";
DOMString icon;
+ // TODO(sh919.park): vibrate should be ([Clamp] unsigned long or sequence<unsigned long>)
+ (unsigned long or sequence<unsigned long>) vibrate;
+ boolean silent = false;
+ any data = null;
};
diff --git a/modules/notifications/ServiceWorkerGlobalScopeNotifications.idl b/modules/notifications/ServiceWorkerGlobalScopeNotifications.idl
new file mode 100644
index 0000000..b2a61e5
--- /dev/null
+++ b/modules/notifications/ServiceWorkerGlobalScopeNotifications.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.
+
+// https://notifications.spec.whatwg.org/#service-worker-api
+
+[
+ RuntimeEnabled=ServiceWorkerNotifications,
+] partial interface ServiceWorkerGlobalScope {
+ attribute EventHandler onnotificationclick;
+ attribute EventHandler onnotificationerror;
+};
diff --git a/modules/notifications/ServiceWorkerRegistrationNotifications.idl b/modules/notifications/ServiceWorkerRegistrationNotifications.idl
new file mode 100644
index 0000000..fed85c5
--- /dev/null
+++ b/modules/notifications/ServiceWorkerRegistrationNotifications.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.
+
+// https://notifications.spec.whatwg.org/#service-worker-api
+
+[
+ Exposed=(Window, ServiceWorker),
+ RuntimeEnabled=ServiceWorkerNotifications
+] partial interface ServiceWorkerRegistration {
+ [CallWith=ScriptState, RaisesException] Promise showNotification(DOMString title, optional NotificationOptions options);
+ [CallWith=ScriptState] Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter);
+};
diff --git a/modules/performance/WorkerPerformance.idl b/modules/performance/WorkerPerformance.idl
deleted file mode 100644
index df38289..0000000
--- a/modules/performance/WorkerPerformance.idl
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2013 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
-] interface WorkerPerformance {
- // See https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime2/Overview.html for details.
- [CallWith=ExecutionContext] double now();
-
- [RuntimeEnabled=MemoryInfoInWorkers] readonly attribute MemoryInfo memory;
-};
-
diff --git a/modules/permissions/MidiPermissionDescriptor.idl b/modules/permissions/MidiPermissionDescriptor.idl
new file mode 100644
index 0000000..3cffc1c
--- /dev/null
+++ b/modules/permissions/MidiPermissionDescriptor.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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.
+
+dictionary MidiPermissionDescriptor : PermissionDescriptor {
+ boolean sysex = false;
+};
diff --git a/modules/permissions/NavigatorPermissions.idl b/modules/permissions/NavigatorPermissions.idl
new file mode 100644
index 0000000..1735096
--- /dev/null
+++ b/modules/permissions/NavigatorPermissions.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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.
+
+// Specification at:
+// https://w3c.github.io/permissions/
+
+[
+ Exposed=(Window),
+ RuntimeEnabled=Permissions
+] partial interface Navigator {
+ readonly attribute Permissions permissions;
+};
diff --git a/modules/permissions/PermissionDescriptor.idl b/modules/permissions/PermissionDescriptor.idl
new file mode 100644
index 0000000..22e1725
--- /dev/null
+++ b/modules/permissions/PermissionDescriptor.idl
@@ -0,0 +1,17 @@
+// Copyright 2015 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.
+
+enum PermissionName {
+ "geolocation",
+ "midi",
+ "notifications",
+ "push"
+};
+
+// The PermissionDescriptor dictionary is a base to describe permissions. Some
+// permissions will extend it. The methods reading it will re-parse it depending
+// on the name.
+dictionary PermissionDescriptor {
+ required PermissionName name;
+};
diff --git a/modules/permissions/PermissionStatus.idl b/modules/permissions/PermissionStatus.idl
new file mode 100644
index 0000000..61354cb
--- /dev/null
+++ b/modules/permissions/PermissionStatus.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.
+
+// Specification at:
+// https://w3c.github.io/permissions/
+
+enum PermissionState {
+ "granted",
+ "denied",
+ "prompt"
+};
+
+[
+ ActiveDOMObject,
+ GarbageCollected,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=Permissions,
+] interface PermissionStatus : EventTarget {
+ [DeprecateAs=PermissionStatusStatus, ImplementedAs=state] readonly attribute PermissionState status;
+
+ readonly attribute PermissionState state;
+ attribute EventHandler onchange;
+};
diff --git a/modules/permissions/Permissions.idl b/modules/permissions/Permissions.idl
new file mode 100644
index 0000000..ccf21eb
--- /dev/null
+++ b/modules/permissions/Permissions.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.
+
+// Specification at:
+// https://w3c.github.io/permissions/
+
+[
+ Exposed=(Window,Worker),
+ GarbageCollected,
+ RuntimeEnabled=Permissions
+] interface Permissions {
+ [CallWith=ScriptState, Measure] Promise<PermissionStatus> query(object permission);
+};
diff --git a/modules/permissions/PushPermissionDescriptor.idl b/modules/permissions/PushPermissionDescriptor.idl
new file mode 100644
index 0000000..952743d
--- /dev/null
+++ b/modules/permissions/PushPermissionDescriptor.idl
@@ -0,0 +1,8 @@
+// Copyright 2015 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.
+
+dictionary PushPermissionDescriptor : PermissionDescriptor {
+ // See https://w3c.github.io/push-api/.
+ boolean userVisibleOnly = false;
+};
diff --git a/modules/permissions/WorkerNavigatorPermissions.idl b/modules/permissions/WorkerNavigatorPermissions.idl
new file mode 100644
index 0000000..917433a
--- /dev/null
+++ b/modules/permissions/WorkerNavigatorPermissions.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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.
+
+// Specification at:
+// https://w3c.github.io/permissions/
+
+[
+ Exposed=(Worker),
+ RuntimeEnabled=Permissions
+] partial interface WorkerNavigator {
+ readonly attribute Permissions permissions;
+};
diff --git a/core/plugins/MimeType.idl b/modules/plugins/MimeType.idl
similarity index 97%
rename from core/plugins/MimeType.idl
rename to modules/plugins/MimeType.idl
index 26c6cc4..e70959e 100644
--- a/core/plugins/MimeType.idl
+++ b/modules/plugins/MimeType.idl
@@ -19,7 +19,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
ImplementedAs=DOMMimeType
] interface MimeType {
readonly attribute DOMString type;
diff --git a/core/plugins/MimeTypeArray.idl b/modules/plugins/MimeTypeArray.idl
similarity index 97%
rename from core/plugins/MimeTypeArray.idl
rename to modules/plugins/MimeTypeArray.idl
index 0a33ada..9e583c7 100644
--- a/core/plugins/MimeTypeArray.idl
+++ b/modules/plugins/MimeTypeArray.idl
@@ -19,7 +19,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
ImplementedAs=DOMMimeTypeArray
] interface MimeTypeArray {
readonly attribute unsigned long length;
diff --git a/modules/plugins/NavigatorPlugins.idl b/modules/plugins/NavigatorPlugins.idl
new file mode 100644
index 0000000..97b209a
--- /dev/null
+++ b/modules/plugins/NavigatorPlugins.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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://html.spec.whatwg.org/multipage/webappapis.html#navigatorplugins
+partial interface Navigator {
+ readonly attribute PluginArray plugins;
+ readonly attribute MimeTypeArray mimeTypes;
+ boolean javaEnabled();
+};
diff --git a/core/plugins/Plugin.idl b/modules/plugins/Plugin.idl
similarity index 97%
rename from core/plugins/Plugin.idl
rename to modules/plugins/Plugin.idl
index 689df50..94a9a88 100644
--- a/core/plugins/Plugin.idl
+++ b/modules/plugins/Plugin.idl
@@ -19,7 +19,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
ImplementedAs=DOMPlugin
] interface Plugin {
readonly attribute DOMString name;
diff --git a/core/plugins/PluginArray.idl b/modules/plugins/PluginArray.idl
similarity index 97%
rename from core/plugins/PluginArray.idl
rename to modules/plugins/PluginArray.idl
index dc2ab1d..c0a5abb 100644
--- a/core/plugins/PluginArray.idl
+++ b/modules/plugins/PluginArray.idl
@@ -19,7 +19,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
ImplementedAs=DOMPluginArray
] interface PluginArray {
readonly attribute unsigned long length;
diff --git a/modules/presentation/DefaultSessionStartEvent.idl b/modules/presentation/DefaultSessionStartEvent.idl
new file mode 100644
index 0000000..70bdf7e
--- /dev/null
+++ b/modules/presentation/DefaultSessionStartEvent.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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://w3c.github.io/presentation-api/#interface-defaultsessionstartevent
+
+[
+ Constructor(DOMString type, optional DefaultSessionStartEventInit eventInitDict),
+ RuntimeEnabled=Presentation
+] interface DefaultSessionStartEvent : Event {
+ [SameObject] readonly attribute PresentationSession session;
+};
diff --git a/modules/presentation/DefaultSessionStartEventInit.idl b/modules/presentation/DefaultSessionStartEventInit.idl
new file mode 100644
index 0000000..90f9db3
--- /dev/null
+++ b/modules/presentation/DefaultSessionStartEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://w3c.github.io/presentation-api/#interface-defaultsessionstartevent
+
+dictionary DefaultSessionStartEventInit : EventInit {
+ PresentationSession session;
+};
diff --git a/modules/presentation/NavigatorPresentation.idl b/modules/presentation/NavigatorPresentation.idl
index 4cf7e1e..2056380 100644
--- a/modules/presentation/NavigatorPresentation.idl
+++ b/modules/presentation/NavigatorPresentation.idl
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://webscreens.github.io/presentation-api/#presentation-extension-to-navigator
+// https://w3c.github.io/presentation-api/#interface-navigatorpresentation
[
RuntimeEnabled=Presentation
] partial interface Navigator {
- readonly attribute Presentation presentation;
+ [SameObject] readonly attribute Presentation presentation;
};
diff --git a/modules/presentation/Presentation.idl b/modules/presentation/Presentation.idl
index 1546a1d..2ec7725 100644
--- a/modules/presentation/Presentation.idl
+++ b/modules/presentation/Presentation.idl
@@ -2,11 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://webscreens.github.io/presentation-api/#presentation-interface
+// https://w3c.github.io/presentation-api/#interface-presentation
[
GarbageCollected,
RuntimeEnabled=Presentation
] interface Presentation : EventTarget {
- attribute EventHandler onavailablechange;
+ // This API used by controlling browsing context.
+ [CallWith=ScriptState] Promise<PresentationSession> startSession(DOMString url);
+ // TODO(avayvod): The |presentationId| argument should not be optional.
+ [CallWith=ScriptState] Promise<PresentationSession> joinSession(DOMString url, [Default=Undefined] optional DOMString presentationId);
+ [CallWith=ScriptState] Promise<PresentationAvailability> getAvailability(DOMString url);
+ attribute EventHandler ondefaultsessionstart;
+
+ // This API used by presenting browsing context.
+ // TODO(avayvod): The spec has |getSession()| and |getSessions()| instead.
+ readonly attribute PresentationSession? session;
+ // TODO(avayvod): attribute EventHandler onsessionavailable;
};
diff --git a/modules/presentation/PresentationAvailability.idl b/modules/presentation/PresentationAvailability.idl
new file mode 100644
index 0000000..4afd903
--- /dev/null
+++ b/modules/presentation/PresentationAvailability.idl
@@ -0,0 +1,14 @@
+// Copyright 2015 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://w3c.github.io/presentation-api/#interface-presentationavailability
+
+[
+ ActiveDOMObject,
+ GarbageCollected,
+ RuntimeEnabled=Presentation,
+] interface PresentationAvailability : EventTarget {
+ readonly attribute boolean value;
+ attribute EventHandler onchange;
+};
diff --git a/modules/presentation/PresentationSession.idl b/modules/presentation/PresentationSession.idl
new file mode 100644
index 0000000..493f8ca
--- /dev/null
+++ b/modules/presentation/PresentationSession.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.
+
+// https://w3c.github.io/presentation-api/#interface-presentationsession
+
+enum PresentationSessionState {
+ "connected",
+ "disconnected"
+};
+
+[
+ GarbageCollected,
+ RuntimeEnabled=Presentation
+] interface PresentationSession : EventTarget {
+ readonly attribute DOMString? id;
+ readonly attribute PresentationSessionState state;
+ void close();
+ attribute EventHandler onstatechange;
+
+ // Communication
+ attribute BinaryType binaryType;
+ attribute EventHandler onmessage;
+ [RaisesException] void send(DOMString message);
+ [RaisesException] void send(Blob data);
+ [RaisesException] void send(ArrayBuffer data);
+ [RaisesException] void send(ArrayBufferView data);
+};
diff --git a/modules/push_messaging/NavigatorPushManager.idl b/modules/push_messaging/NavigatorPushManager.idl
deleted file mode 100644
index 26db0dd..0000000
--- a/modules/push_messaging/NavigatorPushManager.idl
+++ /dev/null
@@ -1,9 +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.
-
-[
- RuntimeEnabled=PushMessaging,
-] partial interface Navigator {
- readonly attribute PushManager push;
-};
diff --git a/modules/push_messaging/PushEvent.idl b/modules/push_messaging/PushEvent.idl
index a6a03ff..aa6d116 100644
--- a/modules/push_messaging/PushEvent.idl
+++ b/modules/push_messaging/PushEvent.idl
@@ -2,9 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://w3c.github.io/push-api/#idl-def-PushEvent
+
[
- EventConstructor,
+ Constructor(DOMString type, optional PushEventInit eventInitDict),
+ Exposed=ServiceWorker,
RuntimeEnabled=PushMessaging,
-] interface PushEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString data;
+] interface PushEvent : ExtendableEvent {
+ [RuntimeEnabled=PushMessagingData] readonly attribute PushMessageData data;
};
diff --git a/modules/push_messaging/PushEventInit.idl b/modules/push_messaging/PushEventInit.idl
new file mode 100644
index 0000000..aa921f4
--- /dev/null
+++ b/modules/push_messaging/PushEventInit.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.
+
+// https://w3c.github.io/push-api/#idl-def-PushEvent
+
+dictionary PushEventInit : ExtendableEventInit {
+ PushMessageData data;
+};
diff --git a/modules/push_messaging/PushManager.idl b/modules/push_messaging/PushManager.idl
index 4346304..ddb6139 100644
--- a/modules/push_messaging/PushManager.idl
+++ b/modules/push_messaging/PushManager.idl
@@ -2,10 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://w3c.github.io/push-api/#pushmanager-interface
+
[
- NoInterfaceObject,
- RuntimeEnabled=PushMessaging,
+ Exposed=(Window,ServiceWorker),
GarbageCollected,
+ RuntimeEnabled=PushMessaging,
] interface PushManager {
- [CallWith=ScriptState, ImplementedAs=registerPushMessaging] Promise register(DOMString senderId);
+ [CallWith=ScriptState] Promise<PushSubscription> subscribe(optional PushSubscriptionOptions options);
+ [CallWith=ScriptState] Promise<PushSubscription?> getSubscription();
+ [CallWith=ScriptState] Promise permissionState(optional PushSubscriptionOptions options);
};
diff --git a/modules/push_messaging/PushMessageData.idl b/modules/push_messaging/PushMessageData.idl
new file mode 100644
index 0000000..fab3d5a
--- /dev/null
+++ b/modules/push_messaging/PushMessageData.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.
+
+// http://w3c.github.io/push-api/#pushmessagedata-interface
+
+typedef object JSON;
+
+[
+ Constructor(USVString message),
+ Exposed=ServiceWorker,
+ GarbageCollected,
+ RuntimeEnabled=PushMessagingData,
+] interface PushMessageData {
+ ArrayBuffer arrayBuffer();
+ Blob blob();
+ [CallWith=ScriptState, RaisesException] JSON json();
+ USVString text();
+};
diff --git a/modules/push_messaging/PushRegistration.idl b/modules/push_messaging/PushRegistration.idl
deleted file mode 100644
index 9ff2d6d..0000000
--- a/modules/push_messaging/PushRegistration.idl
+++ /dev/null
@@ -1,11 +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.
-
-[
- NoInterfaceObject,
- GarbageCollected,
-] interface PushRegistration {
- readonly attribute DOMString pushEndpoint;
- readonly attribute DOMString pushRegistrationId;
-};
diff --git a/modules/push_messaging/PushSubscription.idl b/modules/push_messaging/PushSubscription.idl
new file mode 100644
index 0000000..0575d1f
--- /dev/null
+++ b/modules/push_messaging/PushSubscription.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.
+
+// https://w3c.github.io/push-api/#pushsubscription-interface
+
+[
+ Exposed=(Window,ServiceWorker),
+ GarbageCollected,
+ RuntimeEnabled=PushMessaging,
+] interface PushSubscription {
+ readonly attribute USVString endpoint;
+ [CallWith=ScriptState] Promise<boolean> unsubscribe();
+
+ serializer = { attribute };
+};
diff --git a/modules/push_messaging/PushSubscriptionOptions.idl b/modules/push_messaging/PushSubscriptionOptions.idl
new file mode 100644
index 0000000..f034242
--- /dev/null
+++ b/modules/push_messaging/PushSubscriptionOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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://w3c.github.io/push-api/#idl-def-PushSubscriptionOptions
+
+dictionary PushSubscriptionOptions {
+ boolean userVisibleOnly = false;
+};
diff --git a/modules/push_messaging/ServiceWorkerRegistrationPush.idl b/modules/push_messaging/ServiceWorkerRegistrationPush.idl
new file mode 100644
index 0000000..06e1cfd
--- /dev/null
+++ b/modules/push_messaging/ServiceWorkerRegistrationPush.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.
+
+// https://w3c.github.io/push-api/#extensions-to-the-serviceworkerregistration-interface
+
+[
+ Exposed=(Window, ServiceWorker),
+ RuntimeEnabled=PushMessaging,
+] partial interface ServiceWorkerRegistration {
+ readonly attribute PushManager pushManager;
+};
diff --git a/modules/screen_orientation/ScreenOrientation.idl b/modules/screen_orientation/ScreenOrientation.idl
index 057ad37..8569fbd 100644
--- a/modules/screen_orientation/ScreenOrientation.idl
+++ b/modules/screen_orientation/ScreenOrientation.idl
@@ -24,11 +24,11 @@
GarbageCollected,
RuntimeEnabled=ScreenOrientation
] interface ScreenOrientation : EventTarget {
- readonly attribute unsigned short angle;
- readonly attribute DOMString type;
+ [MeasureAs=ScreenOrientationAngle] readonly attribute unsigned short angle;
+ [MeasureAs=ScreenOrientationType] readonly attribute DOMString type;
- [CallWith=ScriptState] Promise lock(OrientationLockType orientation);
- void unlock();
+ [CallWith=ScriptState, MeasureAs=ScreenOrientationLock] Promise lock(OrientationLockType orientation);
+ [MeasureAs=ScreenOrientationUnlock] void unlock();
attribute EventHandler onchange;
};
diff --git a/modules/serviceworkers/Body.idl b/modules/serviceworkers/Body.idl
deleted file mode 100644
index bb06579..0000000
--- a/modules/serviceworkers/Body.idl
+++ /dev/null
@@ -1,21 +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/#body
-[
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker,
- NoInterfaceObject,
- ActiveDOMObject,
- GarbageCollected,
-] interface Body {
- readonly attribute boolean bodyUsed;
- [CallWith=ScriptState] Promise arrayBuffer();
- [CallWith=ScriptState] Promise blob();
- [CallWith=ScriptState] Promise json();
- [CallWith=ScriptState] Promise text();
-
- // Still to be implemented.
- // [CallWith=ScriptState] Promise formData();
-};
diff --git a/modules/serviceworkers/Cache.idl b/modules/serviceworkers/Cache.idl
deleted file mode 100644
index 6da74e9..0000000
--- a/modules/serviceworkers/Cache.idl
+++ /dev/null
@@ -1,42 +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.
-
-// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
-
-[
- GarbageCollected,
- Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorkerOnFetch,
-] 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 QueryParams queryParams);
- [CallWith=ScriptState] Promise match(Request request, optional QueryParams queryParams);
- [CallWith=ScriptState] Promise match(ScalarValueString request, optional QueryParams queryParams);
-
- // [CallWith=ScriptState] Promise matchAll((Request or ScalarValueString) request, optional QueryParams queryParams);
- [CallWith=ScriptState] Promise matchAll(Request request, optional QueryParams queryParams);
- [CallWith=ScriptState] Promise matchAll(ScalarValueString request, optional QueryParams 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 QueryParams queryParams);
- [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request request, optional QueryParams queryParams);
- [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(ScalarValueString request, optional QueryParams queryParams);
-
- // [CallWith=ScriptState] Promise keys(optional (Request or ScalarValueString) request, optional QueryParams queryParams);
- [CallWith=ScriptState] Promise keys(optional Request request, optional QueryParams queryParams);
- [CallWith=ScriptState] Promise keys(ScalarValueString request, optional QueryParams queryParams);
-};
diff --git a/modules/serviceworkers/CacheStorage.idl b/modules/serviceworkers/CacheStorage.idl
deleted file mode 100644
index c36ce34..0000000
--- a/modules/serviceworkers/CacheStorage.idl
+++ /dev/null
@@ -1,19 +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.
-
-// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-storage
-[
- GarbageCollected,
- Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorkerOnFetch,
-] 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
new file mode 100644
index 0000000..134e68a
--- /dev/null
+++ b/modules/serviceworkers/Client.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.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-client-interface
+[
+ Exposed=ServiceWorker,
+ GarbageCollected,
+ TypeChecking=Interface,
+ ImplementedAs=ServiceWorkerClient,
+] interface Client {
+ [RuntimeEnabled=ServiceWorkerClientAttributes] readonly attribute USVString url;
+ [RuntimeEnabled=ServiceWorkerClientAttributes] readonly attribute ContextFrameType frameType;
+ [RuntimeEnabled=ServiceWorkerClientAttributes] readonly attribute DOMString id;
+ [PostMessage, RaisesException, CallWith=ExecutionContext] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+};
diff --git a/modules/serviceworkers/ClientQueryOptions.idl b/modules/serviceworkers/ClientQueryOptions.idl
new file mode 100644
index 0000000..0d1437a
--- /dev/null
+++ b/modules/serviceworkers/ClientQueryOptions.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.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client-type-enum
+enum ClientType {
+ "window",
+ "worker",
+ "sharedworker",
+ "all"
+};
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#serviceworker-client-query-options-dictionary
+dictionary ClientQueryOptions {
+ boolean includeUncontrolled = false;
+ ClientType type = "window";
+};
diff --git a/modules/serviceworkers/Clients.idl b/modules/serviceworkers/Clients.idl
new file mode 100644
index 0000000..bf85fb3
--- /dev/null
+++ b/modules/serviceworkers/Clients.idl
@@ -0,0 +1,15 @@
+// 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/#clients-interface
+[
+ Exposed=ServiceWorker,
+ GarbageCollected,
+ TypeChecking=Interface,
+ ImplementedAs=ServiceWorkerClients,
+] interface Clients {
+ [CallWith=ScriptState] Promise<sequence<Client>> matchAll(optional ClientQueryOptions options);
+ [RuntimeEnabled=ServiceWorkerClientAttributes, CallWith=ScriptState] Promise<WindowClient?> openWindow(USVString url);
+ [CallWith=ScriptState] Promise<void> claim();
+};
diff --git a/modules/serviceworkers/ExtendableEvent.idl b/modules/serviceworkers/ExtendableEvent.idl
index c6a2b5f..df1bc88 100644
--- a/modules/serviceworkers/ExtendableEvent.idl
+++ b/modules/serviceworkers/ExtendableEvent.idl
@@ -30,8 +30,9 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#extendable-event-interface
[
- RuntimeEnabled=ServiceWorker,
+ Constructor(DOMString type, optional ExtendableEventInit eventInitDict),
Exposed=ServiceWorker,
+ TypeChecking=Interface,
] interface ExtendableEvent : Event {
- [CallWith=ScriptState] void waitUntil(any value);
+ [CallWith=ScriptState, RaisesException] void waitUntil(any value);
};
diff --git a/modules/serviceworkers/ExtendableEventInit.idl b/modules/serviceworkers/ExtendableEventInit.idl
new file mode 100644
index 0000000..81d8afa
--- /dev/null
+++ b/modules/serviceworkers/ExtendableEventInit.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.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#extendable-event-interface
+
+dictionary ExtendableEventInit : EventInit {
+ // Defined for the forward compatibility across the derived events
+};
diff --git a/modules/serviceworkers/FetchEvent.idl b/modules/serviceworkers/FetchEvent.idl
index 88bf9e1..ffa53ec 100644
--- a/modules/serviceworkers/FetchEvent.idl
+++ b/modules/serviceworkers/FetchEvent.idl
@@ -4,9 +4,10 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#fetch-event-interface
[
- RuntimeEnabled=ServiceWorkerOnFetch,
- Exposed=ServiceWorker
-] interface FetchEvent : Event {
+ Constructor(DOMString type, optional FetchEventInit eventInitDict),
+ Exposed=ServiceWorker,
+ TypeChecking=Interface,
+] interface FetchEvent : ExtendableEvent {
readonly attribute Request request;
readonly attribute boolean isReload;
diff --git a/modules/serviceworkers/FetchEventInit.idl b/modules/serviceworkers/FetchEventInit.idl
new file mode 100644
index 0000000..cac8bbe
--- /dev/null
+++ b/modules/serviceworkers/FetchEventInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2015 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#fetch-event-interface
+
+dictionary FetchEventInit : ExtendableEventInit {
+ Request request;
+ boolean isReload = false;
+};
diff --git a/modules/serviceworkers/HeadersForEachCallback.idl b/modules/serviceworkers/HeadersForEachCallback.idl
deleted file mode 100644
index d61e83a..0000000
--- a/modules/serviceworkers/HeadersForEachCallback.idl
+++ /dev/null
@@ -1,10 +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.
-
-// 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/InstallEvent.idl b/modules/serviceworkers/InstallEvent.idl
deleted file mode 100644
index bdc33db..0000000
--- a/modules/serviceworkers/InstallEvent.idl
+++ /dev/null
@@ -1,38 +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.
- */
-
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#install-event-interface
-[
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker,
-] interface InstallEvent : ExtendableEvent {
- void replace();
- [CallWith=ScriptState] Promise reloadAll();
-};
diff --git a/modules/serviceworkers/NavigatorServiceWorker.idl b/modules/serviceworkers/NavigatorServiceWorker.idl
index 6ed88f0..b7c95b3 100644
--- a/modules/serviceworkers/NavigatorServiceWorker.idl
+++ b/modules/serviceworkers/NavigatorServiceWorker.idl
@@ -3,8 +3,6 @@
// found in the LICENSE file.
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#navigator-service-worker
-[
- RuntimeEnabled=ServiceWorker,
-] partial interface Navigator {
- readonly attribute ServiceWorkerContainer serviceWorker;
+partial interface Navigator {
+ [RaisesException] readonly attribute ServiceWorkerContainer serviceWorker;
};
diff --git a/modules/serviceworkers/QueryParams.idl b/modules/serviceworkers/QueryParams.idl
deleted file mode 100644
index 817aa4b..0000000
--- a/modules/serviceworkers/QueryParams.idl
+++ /dev/null
@@ -1,15 +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#cache
-[
- GarbageCollected
-] dictionary QueryParams {
- // FIXME: Specify defaults. https://github.com/slightlyoff/ServiceWorker/issues/466
- boolean ignoreSearch;
- boolean ignoreMethod;
- boolean ignoreVary;
- boolean prefixMatch;
- DOMString cacheName;
-};
diff --git a/modules/serviceworkers/RegistrationOptionList.idl b/modules/serviceworkers/RegistrationOptions.idl
similarity index 74%
rename from modules/serviceworkers/RegistrationOptionList.idl
rename to modules/serviceworkers/RegistrationOptions.idl
index 07d8216..17f2d20 100644
--- a/modules/serviceworkers/RegistrationOptionList.idl
+++ b/modules/serviceworkers/RegistrationOptions.idl
@@ -3,8 +3,6 @@
// found in the LICENSE file.
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#registration-option-list-dictionary
-[
- GarbageCollected
-] dictionary RegistrationOptionList {
- ScalarValueString scope = "/";
+dictionary RegistrationOptions {
+ USVString scope;
};
diff --git a/modules/serviceworkers/Request.idl b/modules/serviceworkers/Request.idl
deleted file mode 100644
index 3716a5e..0000000
--- a/modules/serviceworkers/Request.idl
+++ /dev/null
@@ -1,33 +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/#request-class
-
-enum RequestMode { "same-origin", "no-cors", "cors" };
-enum RequestCredentials { "omit", "same-origin", "include" };
-
-[
- Constructor(ScalarValueString input, optional Dictionary requestInitDict),
- Constructor(Request input, optional Dictionary requestInitDict),
- ConstructorCallWith=ExecutionContext,
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker,
- RaisesException=Constructor,
- GarbageCollected,
-] interface Request {
- readonly attribute ByteString method;
- readonly attribute ScalarValueString url;
- readonly attribute Headers headers;
-
- readonly attribute DOMString referrer;
- readonly attribute RequestMode mode;
- readonly attribute RequestCredentials credentials;
-
- Request clone();
-
- // FIXME: Implement the following:
- // readonly attribute RequestContext context;
-};
-
-Request implements Body;
diff --git a/modules/serviceworkers/Response.idl b/modules/serviceworkers/Response.idl
deleted file mode 100644
index d3cd258..0000000
--- a/modules/serviceworkers/Response.idl
+++ /dev/null
@@ -1,31 +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/#response-class
-
-enum ResponseType { "basic", "cors", "default", "error", "opaque" };
-
-[
- // FIXME: Add ctors for FormData and URLSearchParams response bodies.
- Constructor(ScalarValueString body, optional Dictionary responseInitDict),
- Constructor(Blob? body, optional Dictionary responseInitDict),
- Constructor(ArrayBuffer input, optional Dictionary requestInitDict),
- Constructor(ArrayBufferView input, optional Dictionary requestInitDict),
- ConstructorCallWith=ExecutionContext,
- RuntimeEnabled=ServiceWorker,
- Exposed=ServiceWorker,
- RaisesException=Constructor,
- GarbageCollected,
-] 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;
-
- Response clone();
-};
-
-Response implements Body;
diff --git a/modules/serviceworkers/ServiceWorker.idl b/modules/serviceworkers/ServiceWorker.idl
index ec8d558..4efa439 100644
--- a/modules/serviceworkers/ServiceWorker.idl
+++ b/modules/serviceworkers/ServiceWorker.idl
@@ -40,16 +40,12 @@
[
ActiveDOMObject,
- RuntimeEnabled=ServiceWorker,
- WillBeGarbageCollected
+ TypeChecking=Interface,
] interface ServiceWorker : EventTarget {
- // FIXME: Should inherit this from Worker.
- [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
- [RaisesException] void terminate();
-
- readonly attribute ScalarValueString scriptURL;
+ readonly attribute USVString scriptURL;
readonly attribute ServiceWorkerState state;
attribute EventHandler onstatechange;
diff --git a/modules/serviceworkers/ServiceWorkerClient.idl b/modules/serviceworkers/ServiceWorkerClient.idl
deleted file mode 100644
index a0439a7..0000000
--- a/modules/serviceworkers/ServiceWorkerClient.idl
+++ /dev/null
@@ -1,14 +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#service-worker-client-interface
-[
- Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorker,
- GarbageCollected,
-] interface ServiceWorkerClient {
- readonly attribute unsigned long id;
-
- [Custom, RaisesException, CallWith=ExecutionContext] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
-};
diff --git a/modules/serviceworkers/ServiceWorkerClientQueryParams.idl b/modules/serviceworkers/ServiceWorkerClientQueryParams.idl
deleted file mode 100644
index a37df36..0000000
--- a/modules/serviceworkers/ServiceWorkerClientQueryParams.idl
+++ /dev/null
@@ -1,11 +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#serviceworker-client-query-params-dictionary
-[
- GarbageCollected
-] dictionary ServiceWorkerClientQueryParams {
- // FIXME: Specify defaults. https://github.com/slightlyoff/ServiceWorker/issues/466
- boolean includeUncontrolled;
-};
diff --git a/modules/serviceworkers/ServiceWorkerClients.idl b/modules/serviceworkers/ServiceWorkerClients.idl
deleted file mode 100644
index e7b555b..0000000
--- a/modules/serviceworkers/ServiceWorkerClients.idl
+++ /dev/null
@@ -1,12 +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#service-worker-clients-interface
-[
- Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorker,
- GarbageCollected,
-] interface ServiceWorkerClients {
- [CallWith=ScriptState] Promise getAll(optional ServiceWorkerClientQueryParams options);
-};
diff --git a/modules/serviceworkers/ServiceWorkerContainer.idl b/modules/serviceworkers/ServiceWorkerContainer.idl
index 2dc7f45..7f1322d 100644
--- a/modules/serviceworkers/ServiceWorkerContainer.idl
+++ b/modules/serviceworkers/ServiceWorkerContainer.idl
@@ -30,12 +30,16 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-interface
[
- RuntimeEnabled=ServiceWorker,
- GarbageCollected
-] interface ServiceWorkerContainer {
+ GarbageCollected,
+ TypeChecking=Interface,
+] interface ServiceWorkerContainer : EventTarget {
[Unforgeable] readonly attribute ServiceWorker? controller;
- [CallWith=ScriptState] readonly attribute Promise ready;
+ [CallWith=ScriptState] readonly attribute Promise<ServiceWorkerRegistration> ready;
- [CallWith=ScriptState, ImplementedAs=registerServiceWorker] Promise register(ScalarValueString url, optional RegistrationOptionList options);
- [CallWith=ScriptState] Promise getRegistration(optional ScalarValueString documentURL = "");
+ [CallWith=ScriptState, ImplementedAs=registerServiceWorker] Promise<ServiceWorkerRegistration> register(USVString url, optional RegistrationOptions options);
+ [CallWith=ScriptState] Promise<ServiceWorkerRegistration> getRegistration(optional USVString documentURL = "");
+ [CallWith=ScriptState] Promise<sequence<ServiceWorkerRegistration>> getRegistrations();
+
+ attribute EventHandler oncontrollerchange;
+ attribute EventHandler onmessage;
};
diff --git a/modules/serviceworkers/ServiceWorkerGlobalScope.idl b/modules/serviceworkers/ServiceWorkerGlobalScope.idl
index 10d9a9b..2319e5b 100644
--- a/modules/serviceworkers/ServiceWorkerGlobalScope.idl
+++ b/modules/serviceworkers/ServiceWorkerGlobalScope.idl
@@ -29,24 +29,28 @@
*/
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-interface
+
[
Exposed=ServiceWorker,
Global=(Worker,ServiceWorker),
- RuntimeEnabled=ServiceWorker,
+ TypeChecking=Interface,
] interface ServiceWorkerGlobalScope : WorkerGlobalScope {
- readonly attribute ServiceWorkerClients clients;
- [CallWith=ExecutionContext, Unforgeable] readonly attribute ScalarValueString scope;
- [CallWith=ExecutionContext, Unforgeable, RuntimeEnabled=ServiceWorkerOnFetch] readonly attribute CacheStorage caches;
+ readonly attribute Clients clients;
+ readonly attribute ServiceWorkerRegistration registration;
- [CallWith=ScriptState] Promise fetch(DOMString request, optional Dictionary requestInitDict);
- [CallWith=ScriptState] Promise fetch(Request request, optional Dictionary requestInitDict);
+ // https://github.com/mkruisselbrink/navigator-connect/blob/gh-pages/docs/api-idea.md#persisted-messageports
+ // TODO(mek): Link to actual spec when this is added there, and decide if this is the right place for this.
+ [RuntimeEnabled=NavigatorConnect] readonly attribute StashedPortCollection ports;
+
+ [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
[RaisesException] void close();
+ [CallWith=ScriptState] Promise<void> skipWaiting();
+
attribute EventHandler onactivate;
- [RuntimeEnabled=ServiceWorkerOnFetch] attribute EventHandler onfetch;
+ attribute EventHandler onfetch;
attribute EventHandler oninstall;
attribute EventHandler onmessage;
- [RuntimeEnabled=BackgroundSync] attribute EventHandler onsync;
};
diff --git a/modules/serviceworkers/ServiceWorkerMessageEvent.idl b/modules/serviceworkers/ServiceWorkerMessageEvent.idl
new file mode 100644
index 0000000..711f643
--- /dev/null
+++ b/modules/serviceworkers/ServiceWorkerMessageEvent.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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/#serviceworkermessage-event-interface
+
+[
+ Constructor(DOMString type, optional ServiceWorkerMessageEventInit eventInitDict),
+ Exposed=(Window, Worker),
+] interface ServiceWorkerMessageEvent : Event {
+ [Custom=Getter] readonly attribute any data;
+ readonly attribute DOMString origin;
+ readonly attribute DOMString lastEventId;
+ readonly attribute (ServiceWorker or MessagePort)? source;
+ readonly attribute MessagePort[]? ports;
+};
diff --git a/modules/serviceworkers/ServiceWorkerMessageEventInit.idl b/modules/serviceworkers/ServiceWorkerMessageEventInit.idl
new file mode 100644
index 0000000..9c134ec
--- /dev/null
+++ b/modules/serviceworkers/ServiceWorkerMessageEventInit.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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/#serviceworkermessage-event-init-dictionary
+
+dictionary ServiceWorkerMessageEventInit : EventInit {
+ any data;
+ DOMString origin;
+ DOMString lastEventId;
+ (ServiceWorker or MessagePort)? source;
+ sequence<MessagePort> ports;
+};
diff --git a/modules/serviceworkers/ServiceWorkerRegistration.idl b/modules/serviceworkers/ServiceWorkerRegistration.idl
index 13ace48..c88cb42 100644
--- a/modules/serviceworkers/ServiceWorkerRegistration.idl
+++ b/modules/serviceworkers/ServiceWorkerRegistration.idl
@@ -4,16 +4,19 @@
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-obj
[
+ Exposed=(Window,Worker),
ActiveDOMObject,
- RuntimeEnabled=ServiceWorker,
GarbageCollected,
+ TypeChecking=Interface,
] 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();
+ readonly attribute USVString scope;
+
+ [CallWith=ScriptState, RaisesException] void update();
+ [CallWith=ScriptState] Promise<boolean> unregister();
attribute EventHandler onupdatefound;
};
diff --git a/modules/serviceworkers/StashedMessagePort.idl b/modules/serviceworkers/StashedMessagePort.idl
new file mode 100644
index 0000000..beab9cb
--- /dev/null
+++ b/modules/serviceworkers/StashedMessagePort.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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://github.com/mkruisselbrink/navigator-connect/blob/gh-pages/docs/api-idea.md#persisted-messageports
+// TODO(mek): Link to actual spec when this is added there.
+[
+ Exposed=ServiceWorker,
+ RuntimeEnabled=NavigatorConnect,
+ GarbageCollected,
+] interface StashedMessagePort : MessagePort {
+ readonly attribute DOMString name;
+};
diff --git a/modules/serviceworkers/StashedPortCollection.idl b/modules/serviceworkers/StashedPortCollection.idl
new file mode 100644
index 0000000..08ffeb0
--- /dev/null
+++ b/modules/serviceworkers/StashedPortCollection.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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://github.com/mkruisselbrink/navigator-connect/blob/gh-pages/docs/api-idea.md#persisted-messageports
+// TODO(mek): Link to actual spec when this is added there.
+[
+ Exposed=ServiceWorker,
+ GarbageCollected,
+ RuntimeEnabled=NavigatorConnect,
+ TypeChecking=Interface,
+] interface StashedPortCollection : EventTarget {
+ [CallWith=ScriptState] StashedMessagePort add(USVString name, MessagePort port);
+ // Promise<sequence<StashedMessagePort>> match(UVString name);
+ attribute EventHandler onmessage;
+};
diff --git a/modules/serviceworkers/WindowClient.idl b/modules/serviceworkers/WindowClient.idl
new file mode 100644
index 0000000..3af859b
--- /dev/null
+++ b/modules/serviceworkers/WindowClient.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.
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#context-frame-type-enum
+enum ContextFrameType {
+ "top-level",
+ "nested",
+ "auxiliary",
+ "none"
+};
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#window-client-interface
+[
+ Exposed=ServiceWorker,
+ RuntimeEnabled=ServiceWorkerClientAttributes,
+ GarbageCollected,
+ TypeChecking=Interface,
+ ImplementedAs=ServiceWorkerWindowClient,
+] interface WindowClient : Client {
+ readonly attribute VisibilityState visibilityState;
+ readonly attribute boolean focused;
+ [CallWith=ScriptState] Promise<WindowClient> focus();
+};
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/modules/serviceworkers/testing/InternalsServiceWorker.idl
similarity index 65%
copy from core/html/canvas/EXTShaderTextureLOD.idl
copy to modules/serviceworkers/testing/InternalsServiceWorker.idl
index 975005a..f20eecb 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/modules/serviceworkers/testing/InternalsServiceWorker.idl
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
-] interface EXTShaderTextureLOD {
+partial interface Internals {
+ void terminateServiceWorker(ServiceWorker worker);
};
diff --git a/modules/speech/SpeechGrammar.idl b/modules/speech/SpeechGrammar.idl
index 7b186bf..1e3a346 100644
--- a/modules/speech/SpeechGrammar.idl
+++ b/modules/speech/SpeechGrammar.idl
@@ -24,9 +24,9 @@
*/
[
+ Constructor,
GarbageCollected,
NoInterfaceObject,
- Constructor
] interface SpeechGrammar {
[URL,CallWith=ExecutionContext] attribute DOMString src;
attribute float weight;
diff --git a/modules/speech/SpeechGrammarList.idl b/modules/speech/SpeechGrammarList.idl
index a0dde22..48f78b8 100644
--- a/modules/speech/SpeechGrammarList.idl
+++ b/modules/speech/SpeechGrammarList.idl
@@ -24,9 +24,9 @@
*/
[
+ Constructor,
GarbageCollected,
NoInterfaceObject,
- Constructor
] interface SpeechGrammarList {
readonly attribute unsigned long length;
getter SpeechGrammar item(unsigned long index);
diff --git a/modules/speech/SpeechRecognition.idl b/modules/speech/SpeechRecognition.idl
index 712bac6..71854f7 100644
--- a/modules/speech/SpeechRecognition.idl
+++ b/modules/speech/SpeechRecognition.idl
@@ -32,9 +32,11 @@
] interface SpeechRecognition : EventTarget {
attribute SpeechGrammarList grammars;
attribute DOMString lang;
+ attribute DOMString serviceURI;
attribute boolean continuous;
attribute boolean interimResults;
attribute unsigned long maxAlternatives;
+ [RuntimeEnabled=MediaStreamSpeech] attribute MediaStreamTrack audioTrack;
[RaisesException] void start();
[ImplementedAs=stopFunction] void stop();
diff --git a/modules/speech/SpeechRecognitionError.idl b/modules/speech/SpeechRecognitionError.idl
index 0150174..5267e53 100644
--- a/modules/speech/SpeechRecognitionError.idl
+++ b/modules/speech/SpeechRecognitionError.idl
@@ -25,8 +25,8 @@
[
NoInterfaceObject,
- EventConstructor,
+ Constructor(DOMString type, optional SpeechRecognitionErrorInit initDict),
] interface SpeechRecognitionError : Event {
- [InitializedByEventConstructor] readonly attribute DOMString error;
- [InitializedByEventConstructor] readonly attribute DOMString message;
+ readonly attribute DOMString error;
+ readonly attribute DOMString message;
};
diff --git a/modules/speech/SpeechRecognitionErrorInit.idl b/modules/speech/SpeechRecognitionErrorInit.idl
new file mode 100644
index 0000000..c258ab6
--- /dev/null
+++ b/modules/speech/SpeechRecognitionErrorInit.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.
+
+// FIXME: Add spec URL.
+
+dictionary SpeechRecognitionErrorInit : EventInit {
+ DOMString error;
+ DOMString message;
+};
diff --git a/modules/speech/SpeechRecognitionEvent.idl b/modules/speech/SpeechRecognitionEvent.idl
index c925f80..289b103 100644
--- a/modules/speech/SpeechRecognitionEvent.idl
+++ b/modules/speech/SpeechRecognitionEvent.idl
@@ -24,11 +24,11 @@
*/
[
- EventConstructor,
NoInterfaceObject,
+ Constructor(DOMString type, optional SpeechRecognitionEventInit initDict),
] interface SpeechRecognitionEvent : Event {
- [InitializedByEventConstructor] readonly attribute unsigned long resultIndex;
- [InitializedByEventConstructor] readonly attribute SpeechRecognitionResultList results;
+ readonly attribute unsigned long resultIndex;
+ readonly attribute SpeechRecognitionResultList results;
readonly attribute Document interpretation;
readonly attribute Document emma;
diff --git a/modules/speech/SpeechRecognitionEventInit.idl b/modules/speech/SpeechRecognitionEventInit.idl
new file mode 100644
index 0000000..4f55ebb
--- /dev/null
+++ b/modules/speech/SpeechRecognitionEventInit.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.
+
+// FIXME: Add spec URL.
+
+dictionary SpeechRecognitionEventInit : EventInit {
+ unsigned long resultIndex;
+ SpeechRecognitionResultList results;
+};
diff --git a/modules/speech/SpeechSynthesisEvent.idl b/modules/speech/SpeechSynthesisEvent.idl
index d0456ed..cec1e47 100644
--- a/modules/speech/SpeechSynthesisEvent.idl
+++ b/modules/speech/SpeechSynthesisEvent.idl
@@ -23,7 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-interface SpeechSynthesisEvent : Event {
+[
+ RuntimeEnabled=ScriptedSpeech
+] interface SpeechSynthesisEvent : Event {
+ readonly attribute SpeechSynthesisUtterance utterance;
readonly attribute unsigned long charIndex;
readonly attribute float elapsedTime;
readonly attribute DOMString name;
diff --git a/modules/speech/SpeechSynthesisUtterance.idl b/modules/speech/SpeechSynthesisUtterance.idl
index b4a36ed..7278056 100644
--- a/modules/speech/SpeechSynthesisUtterance.idl
+++ b/modules/speech/SpeechSynthesisUtterance.idl
@@ -24,9 +24,10 @@
*/
[
- GarbageCollected,
Constructor(optional DOMString text = null),
- ConstructorCallWith=ExecutionContext
+ ConstructorCallWith=ExecutionContext,
+ RuntimeEnabled=ScriptedSpeech,
+ GarbageCollected,
] interface SpeechSynthesisUtterance : EventTarget {
attribute DOMString text;
attribute DOMString lang;
diff --git a/modules/speech/WindowSpeechSynthesis.idl b/modules/speech/WindowSpeechSynthesis.idl
index a22453a..85f5b49 100644
--- a/modules/speech/WindowSpeechSynthesis.idl
+++ b/modules/speech/WindowSpeechSynthesis.idl
@@ -25,6 +25,7 @@
[
ImplementedAs=DOMWindowSpeechSynthesis,
+ RuntimeEnabled=ScriptedSpeech,
] partial interface Window {
readonly attribute SpeechSynthesis speechSynthesis;
};
diff --git a/core/storage/Storage.idl b/modules/storage/Storage.idl
similarity index 98%
rename from core/storage/Storage.idl
rename to modules/storage/Storage.idl
index 16c7cbd..63f4d5a 100644
--- a/core/storage/Storage.idl
+++ b/modules/storage/Storage.idl
@@ -24,7 +24,7 @@
*/
[
- WillBeGarbageCollected
+ GarbageCollected
] interface Storage {
[NotEnumerable, RaisesException] getter DOMString (unsigned long index);
[RaisesException] setter DOMString (unsigned long index, DOMString value);
diff --git a/core/storage/StorageEvent.idl b/modules/storage/StorageEvent.idl
similarity index 60%
rename from core/storage/StorageEvent.idl
rename to modules/storage/StorageEvent.idl
index 39801af..af603e4 100644
--- a/core/storage/StorageEvent.idl
+++ b/modules/storage/StorageEvent.idl
@@ -23,25 +23,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface StorageEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString key;
- [InitializedByEventConstructor, TreatReturnedNullStringAs=Null] readonly attribute DOMString oldValue;
- [InitializedByEventConstructor, TreatReturnedNullStringAs=Null] readonly attribute DOMString newValue;
- [InitializedByEventConstructor] readonly attribute DOMString url;
- [InitializedByEventConstructor] readonly attribute Storage? storageArea;
+// http://dev.w3.org/html5/webstorage/#the-storage-event
- void initStorageEvent([Default=Undefined] optional DOMString typeArg,
- [Default=Undefined] optional boolean canBubbleArg,
- [Default=Undefined] optional boolean cancelableArg,
- [Default=Undefined] optional DOMString keyArg,
- [Default=Undefined] optional DOMString? oldValueArg,
- [Default=Undefined] optional DOMString? newValueArg,
- [Default=Undefined] optional DOMString urlArg,
- [Default=Undefined] optional Storage storageAreaArg);
+[
+ Constructor(DOMString type, optional StorageEventInit eventInitDict),
+] interface StorageEvent : Event {
+ readonly attribute DOMString? key;
+ readonly attribute DOMString? oldValue;
+ readonly attribute DOMString? newValue;
+ readonly attribute DOMString url;
+ readonly attribute Storage? storageArea;
+
+ [Measure] void initStorageEvent([Default=Undefined] optional DOMString typeArg,
+ [Default=Undefined] optional boolean canBubbleArg,
+ [Default=Undefined] optional boolean cancelableArg,
+ [Default=Undefined] optional DOMString keyArg,
+ [Default=Undefined] optional DOMString? oldValueArg,
+ [Default=Undefined] optional DOMString? newValueArg,
+ [Default=Undefined] optional DOMString urlArg,
+ [Default=Undefined] optional Storage storageAreaArg);
// Needed once we support init<blank>EventNS
// void initStorageEventNS(DOMString namespaceURI, DOMString typeArg, boolean canBubbleArg, boolean cancelableArg, DOMString keyArg, DOMString oldValueArg, DOMString newValueArg, DOMString urlArg, Storage storageAreaArg);
};
-
diff --git a/modules/storage/StorageEventInit.idl b/modules/storage/StorageEventInit.idl
new file mode 100644
index 0000000..72f18be
--- /dev/null
+++ b/modules/storage/StorageEventInit.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.
+
+// http://dev.w3.org/html5/webstorage/#the-storage-event
+
+dictionary StorageEventInit : EventInit {
+ DOMString? key;
+ DOMString? oldValue;
+ DOMString? newValue;
+ DOMString url;
+ Storage? storageArea;
+};
diff --git a/modules/storage/WindowStorage.idl b/modules/storage/WindowStorage.idl
new file mode 100644
index 0000000..5ddd617
--- /dev/null
+++ b/modules/storage/WindowStorage.idl
@@ -0,0 +1,12 @@
+// Copyright 2015 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.
+
+[
+ ImplementedAs=DOMWindowStorage,
+] partial interface Window {
+ // https://html.spec.whatwg.org/#the-sessionstorage-attribute
+ [LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage sessionStorage;
+ // https://html.spec.whatwg.org/#the-localstorage-attribute
+ [LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage localStorage;
+};
diff --git a/modules/vr/HMDVRDevice.idl b/modules/vr/HMDVRDevice.idl
new file mode 100644
index 0000000..99d6858
--- /dev/null
+++ b/modules/vr/HMDVRDevice.idl
@@ -0,0 +1,20 @@
+// Copyright 2015 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.
+
+enum VREye {
+ "left",
+ "right"
+};
+
+// An HMDVRDevice represents a Head Mounted Display. The interface provides all
+// the information necessary to correctly render a stereo 3D scene for a given
+// headset.
+// http://mozvr.github.io/webvr-spec/webvr.html#hmdvrdevice
+[
+ RuntimeEnabled=WebVR,
+ TypeChecking=Interface
+] interface HMDVRDevice : VRDevice {
+ VREyeParameters getEyeParameters(VREye whichEye);
+ void setFieldOfView(optional VRFieldOfView leftFov, optional VRFieldOfView rightFov);
+};
diff --git a/modules/vr/NavigatorVRDevice.idl b/modules/vr/NavigatorVRDevice.idl
new file mode 100644
index 0000000..89c4c82
--- /dev/null
+++ b/modules/vr/NavigatorVRDevice.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=WebVR,
+] partial interface Navigator {
+ [CallWith=ScriptState] Promise getVRDevices();
+};
diff --git a/modules/vr/PositionSensorVRDevice.idl b/modules/vr/PositionSensorVRDevice.idl
new file mode 100644
index 0000000..ecd70d3
--- /dev/null
+++ b/modules/vr/PositionSensorVRDevice.idl
@@ -0,0 +1,16 @@
+// Copyright 2015 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.
+
+// An PositionSensorVRDevice represents a user interface that provides an
+// orientation and position in space. This may be a Head Mounted Display or
+// any number of other six-degree-of-freedom devices that provide, for example,
+// hand tracking.
+// http://mozvr.github.io/webvr-spec/webvr.html#positionsensorvrdevice
+[
+ RuntimeEnabled=WebVR,
+] interface PositionSensorVRDevice : VRDevice {
+ VRPositionState getState();
+ VRPositionState getImmediateState();
+ void resetSensor();
+};
diff --git a/modules/vr/VRDevice.idl b/modules/vr/VRDevice.idl
new file mode 100644
index 0000000..9bb4610
--- /dev/null
+++ b/modules/vr/VRDevice.idl
@@ -0,0 +1,22 @@
+// Copyright 2015 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://mozvr.github.io/webvr-spec/webvr.html#vrdevice
+[
+ RuntimeEnabled=WebVR,
+ GarbageCollected,
+] interface VRDevice {
+ // An identifier for the distinct hardware unit that this
+ // VR Device is a part of. All VRDevice/Sensors that come
+ // from the same hardware will have the same hardwareId.
+ readonly attribute DOMString hardwareUnitId;
+
+ // An identifier for this distinct sensor/device on a physical
+ // hardware device. This shouldn't change across browser
+ // restrats, allowing configuration data to be saved based on it.
+ readonly attribute DOMString deviceId;
+
+ // A user-readable name identifying the device.
+ readonly attribute DOMString deviceName;
+};
diff --git a/modules/vr/VREyeParameters.idl b/modules/vr/VREyeParameters.idl
new file mode 100644
index 0000000..5a83da5
--- /dev/null
+++ b/modules/vr/VREyeParameters.idl
@@ -0,0 +1,19 @@
+// Copyright 2015 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://mozvr.github.io/webvr-spec/webvr.html#eyeparameters
+[
+ RuntimeEnabled=WebVR,
+ GarbageCollected
+] interface VREyeParameters {
+ /* These values are expected to be static per-device/per-user */
+ readonly attribute VRFieldOfView minimumFieldOfView;
+ readonly attribute VRFieldOfView maximumFieldOfView;
+ readonly attribute VRFieldOfView recommendedFieldOfView;
+ readonly attribute DOMPoint eyeTranslation;
+
+ /* These values will vary after a FOV has been set */
+ readonly attribute VRFieldOfView currentFieldOfView;
+ readonly attribute DOMRect renderRect;
+};
\ No newline at end of file
diff --git a/modules/vr/VRFieldOfView.idl b/modules/vr/VRFieldOfView.idl
new file mode 100644
index 0000000..ba5e102
--- /dev/null
+++ b/modules/vr/VRFieldOfView.idl
@@ -0,0 +1,17 @@
+// Copyright 2015 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://mozvr.github.io/webvr-spec/webvr.html#vrfieldofview
+[
+ RuntimeEnabled=WebVR,
+ GarbageCollected,
+ TypeChecking=Interface,
+ Constructor(optional VRFieldOfViewInit fov),
+] interface VRFieldOfView {
+ attribute double upDegrees;
+ attribute double downDegrees;
+ attribute double leftDegrees;
+ attribute double rightDegrees;
+};
+
diff --git a/modules/vr/VRFieldOfViewInit.idl b/modules/vr/VRFieldOfViewInit.idl
new file mode 100644
index 0000000..75cac9e
--- /dev/null
+++ b/modules/vr/VRFieldOfViewInit.idl
@@ -0,0 +1,14 @@
+// Copyright 2015 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://mozvr.github.io/webvr-spec/webvr.html#vrfieldofview
+[
+ RuntimeEnabled=WebVR,
+ GarbageCollected
+] dictionary VRFieldOfViewInit {
+ double upDegrees = 0.0;
+ double rightDegrees = 0.0;
+ double downDegrees = 0.0;
+ double leftDegrees = 0.0;
+};
diff --git a/modules/vr/VRPositionState.idl b/modules/vr/VRPositionState.idl
new file mode 100644
index 0000000..4a22a02
--- /dev/null
+++ b/modules/vr/VRPositionState.idl
@@ -0,0 +1,17 @@
+// Copyright 2015 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://mozvr.github.io/webvr-spec/webvr.html#vrpositionstate
+[
+ RuntimeEnabled=WebVR,
+ GarbageCollected,
+] interface VRPositionState {
+ readonly attribute double timeStamp;
+ readonly attribute DOMPoint? position;
+ readonly attribute DOMPoint? linearVelocity;
+ readonly attribute DOMPoint? linearAcceleration;
+ readonly attribute DOMPoint? orientation;
+ readonly attribute DOMPoint? angularVelocity;
+ readonly attribute DOMPoint? angularAcceleration;
+};
diff --git a/modules/webaudio/AnalyserNode.idl b/modules/webaudio/AnalyserNode.idl
index 4de5f29..f066b8c 100644
--- a/modules/webaudio/AnalyserNode.idl
+++ b/modules/webaudio/AnalyserNode.idl
@@ -23,7 +23,7 @@
*/
[
- Conditional=WEB_AUDIO
+ Conditional=WEB_AUDIO,
] interface AnalyserNode : AudioNode {
[RaisesException=Setter] attribute unsigned long fftSize;
readonly attribute unsigned long frequencyBinCount;
diff --git a/modules/webaudio/AudioBuffer.idl b/modules/webaudio/AudioBuffer.idl
index d94eaf8..3999ff6 100644
--- a/modules/webaudio/AudioBuffer.idl
+++ b/modules/webaudio/AudioBuffer.idl
@@ -37,4 +37,6 @@
// Channel access
readonly attribute unsigned long numberOfChannels;
[RaisesException] Float32Array getChannelData(unsigned long channelIndex);
+ [RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
+ [RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
};
diff --git a/modules/webaudio/AudioBufferSourceNode.idl b/modules/webaudio/AudioBufferSourceNode.idl
index 0f3c252..de711d4 100644
--- a/modules/webaudio/AudioBufferSourceNode.idl
+++ b/modules/webaudio/AudioBufferSourceNode.idl
@@ -30,6 +30,7 @@
[RaisesException=Setter] attribute AudioBuffer buffer;
readonly attribute AudioParam playbackRate;
+ readonly attribute AudioParam detune;
attribute boolean loop;
attribute double loopStart;
diff --git a/modules/webaudio/AudioContext.idl b/modules/webaudio/AudioContext.idl
index cc74984..63617aa 100644
--- a/modules/webaudio/AudioContext.idl
+++ b/modules/webaudio/AudioContext.idl
@@ -23,6 +23,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+enum AudioContextState {
+ "suspended",
+ "running",
+ "closed"
+};
+
[
GarbageCollected,
ActiveDOMObject,
@@ -32,7 +38,6 @@
NoInterfaceObject,
RaisesException=Constructor,
] interface AudioContext : EventTarget {
-
// All rendered audio ultimately connects to destination, which represents the audio hardware.
readonly attribute AudioDestinationNode destination;
@@ -45,40 +50,46 @@
// All panning is relative to this listener.
readonly attribute AudioListener listener;
+ // Current state of the AudioContext
+ readonly attribute AudioContextState state;
+
[RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate);
// Asynchronous audio file data decoding.
- // FIXMEDART(ager): Auto-generate this custom method when the info about
- // retaining typed arrays is in the IDL.
- [RaisesException, DartCustom] void decodeAudioData(ArrayBuffer audioData, AudioBufferCallback successCallback, optional AudioBufferCallback errorCallback);
+ [RaisesException, MeasureAs=AudioContextDecodeAudioData] void decodeAudioData(ArrayBuffer audioData, AudioBufferCallback successCallback, optional AudioBufferCallback errorCallback);
// Sources
- AudioBufferSourceNode createBufferSource();
+ [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourceNode createBufferSource();
- [RaisesException] MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
+ [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
- [RaisesException] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
- MediaStreamAudioDestinationNode createMediaStreamDestination();
+ [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource, RaisesException] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
+ [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaStreamAudioDestinationNode createMediaStreamDestination();
// Processing nodes
- GainNode createGain();
- [RaisesException] DelayNode createDelay(optional double maxDelayTime);
- BiquadFilterNode createBiquadFilter();
- WaveShaperNode createWaveShaper();
- PannerNode createPanner();
- ConvolverNode createConvolver();
- DynamicsCompressorNode createDynamicsCompressor();
- AnalyserNode createAnalyser();
- [RaisesException] ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize, optional unsigned long numberOfInputChannels, optional unsigned long numberOfOutputChannels);
- OscillatorNode createOscillator();
- [RaisesException] PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
+ [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain();
+ [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(optional double maxDelayTime);
+ [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode createBiquadFilter();
+ [RaisesException, MeasureAs=AudioContextCreateWaveShaper] WaveShaperNode createWaveShaper();
+ [RaisesException, MeasureAs=AudioContextCreatePanner] PannerNode createPanner();
+ [RaisesException, MeasureAs=AudioContextCreateConvolver] ConvolverNode createConvolver();
+ [RaisesException, MeasureAs=AudioContextCreateDynamicsCompressor] DynamicsCompressorNode createDynamicsCompressor();
+ [RaisesException, MeasureAs=AudioContextCreateAnalyser] AnalyserNode createAnalyser();
+ [RaisesException, MeasureAs=AudioContextCreateScriptProcessor, RaisesException] ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize, optional unsigned long numberOfInputChannels, optional unsigned long numberOfOutputChannels);
+ [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode createStereoPanner();
+ [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode createOscillator();
+ [RaisesException, MeasureAs=AudioContextCreatePeriodicWave, RaisesException] PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
// Channel splitting and merging
- [RaisesException] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs);
- [RaisesException] ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs);
+ [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs);
+ [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs);
- // Offline rendering
- // void prepareOfflineBufferRendering(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate);
- attribute EventHandler oncomplete;
- void startRendering();
+ // Close
+ [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeContext] Promise<void> close();
+
+ // Pause/resume
+ [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendContext] Promise<void> suspend();
+ [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeContext] Promise<void> resume();
+
+ attribute EventHandler onstatechange;
};
diff --git a/modules/webaudio/AudioListener.idl b/modules/webaudio/AudioListener.idl
index 6f4645c..4783450 100644
--- a/modules/webaudio/AudioListener.idl
+++ b/modules/webaudio/AudioListener.idl
@@ -28,12 +28,12 @@
[
GarbageCollected,
- Conditional=WEB_AUDIO
+ Conditional=WEB_AUDIO,
] interface AudioListener {
- attribute float dopplerFactor; // same as OpenAL (default 1.0)
- attribute float speedOfSound; // in meters / second (default 343.3)
+ [DeprecateAs=AudioListenerDopplerFactor] attribute float dopplerFactor; // same as OpenAL (default 1.0)
+ [DeprecateAs=AudioListenerSpeedOfSound] attribute float speedOfSound; // in meters / second (default 343.3)
void setPosition(float x, float y, float z);
void setOrientation(float x, float y, float z, float xUp, float yUp, float zUp);
- void setVelocity(float x, float y, float z);
+ [DeprecateAs=AudioListenerSetVelocity] void setVelocity(float x, float y, float z);
};
diff --git a/modules/webaudio/AudioNode.idl b/modules/webaudio/AudioNode.idl
index 41396a3..56c3425 100644
--- a/modules/webaudio/AudioNode.idl
+++ b/modules/webaudio/AudioNode.idl
@@ -37,13 +37,18 @@
[
Conditional=WEB_AUDIO,
- Custom=Wrap,
GarbageCollected,
+ TypeChecking=Interface
] interface AudioNode : EventTarget {
- // FIXME: AudioNode argument should not be nullable
- [RaisesException] void connect(AudioNode? destination, [Default=Undefined] optional unsigned long output, [Default=Undefined] optional unsigned long input);
- [RaisesException] void connect(AudioParam destination, [Default=Undefined] optional unsigned long output);
- [RaisesException] void disconnect([Default=Undefined] optional unsigned long output);
+ [RaisesException] void connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
+ [RaisesException] void connect(AudioParam destination, optional unsigned long output = 0);
+ void disconnect();
+ [RaisesException] void disconnect(unsigned long output);
+ [RaisesException] void disconnect(AudioNode destination);
+ [RaisesException] void disconnect(AudioNode destination, unsigned long output);
+ [RaisesException] void disconnect(AudioNode destination, unsigned long output, unsigned long input);
+ [RaisesException] void disconnect(AudioParam destination);
+ [RaisesException] void disconnect(AudioParam destination, unsigned long output);
readonly attribute AudioContext context;
readonly attribute unsigned long numberOfInputs;
readonly attribute unsigned long numberOfOutputs;
diff --git a/modules/webaudio/AudioParam.idl b/modules/webaudio/AudioParam.idl
index ce6ec86..7b499f4 100644
--- a/modules/webaudio/AudioParam.idl
+++ b/modules/webaudio/AudioParam.idl
@@ -28,7 +28,7 @@
[
GarbageCollected,
- Conditional=WEB_AUDIO
+ Conditional=WEB_AUDIO,
] interface AudioParam {
attribute float value;
readonly attribute float defaultValue;
@@ -43,9 +43,7 @@
// Sets an array of arbitrary parameter values starting at time for the given duration.
// The number of values will be scaled to fit into the desired duration.
- // FIXMEDART(ager): Auto-generate this custom method when the info about
- // retaining typed arrays is in the IDL.
- [RaisesException, DartCustom] void setValueCurveAtTime(Float32Array values, double time, double duration);
+ [RaisesException] void setValueCurveAtTime(Float32Array values, double time, double duration);
// Cancels all scheduled parameter changes with times greater than or equal to startTime.
[RaisesException] void cancelScheduledValues(double startTime);
diff --git a/modules/webaudio/OfflineAudioContext.idl b/modules/webaudio/OfflineAudioContext.idl
index 5f5f8ac..4c225d9 100644
--- a/modules/webaudio/OfflineAudioContext.idl
+++ b/modules/webaudio/OfflineAudioContext.idl
@@ -29,5 +29,7 @@
RaisesException=Constructor,
NoInterfaceObject,
] interface OfflineAudioContext : AudioContext {
-
+ // Offline rendering
+ attribute EventHandler oncomplete;
+ [CallWith=ScriptState,ImplementedAs=startOfflineRendering] Promise<AudioBuffer> startRendering();
};
diff --git a/modules/webaudio/OscillatorNode.idl b/modules/webaudio/OscillatorNode.idl
index 823d20e..203abfe 100644
--- a/modules/webaudio/OscillatorNode.idl
+++ b/modules/webaudio/OscillatorNode.idl
@@ -29,13 +29,13 @@
"triangle",
"custom"
};
-
+
// OscillatorNode is an audio generator of periodic waveforms.
[
- Conditional=WEB_AUDIO
+ Conditional=WEB_AUDIO,
] interface OscillatorNode : AudioSourceNode {
- attribute OscillatorType type;
+ [RaisesException=Setter] attribute OscillatorType type;
readonly attribute AudioParam frequency; // in Hertz
readonly attribute AudioParam detune; // in Cents
@@ -43,9 +43,6 @@
[RaisesException] void start(optional double when);
[RaisesException] void stop(optional double when);
- [RaisesException, ImplementedAs=start] void noteOn(double when);
- [RaisesException, ImplementedAs=stop] void noteOff(double when);
-
void setPeriodicWave(PeriodicWave periodicWave);
attribute EventHandler onended;
diff --git a/modules/webaudio/PannerNode.idl b/modules/webaudio/PannerNode.idl
index cbd1fc8..4cb9ae5 100644
--- a/modules/webaudio/PannerNode.idl
+++ b/modules/webaudio/PannerNode.idl
@@ -35,9 +35,9 @@
[
NoInterfaceObject,
- Conditional=WEB_AUDIO
+ Conditional=WEB_AUDIO,
] interface PannerNode : AudioNode {
- // Default model for stereo is HRTF
+ // Default model for stereo is equalpower.
attribute PanningModelType panningModel;
// Uses a 3D cartesian coordinate system
diff --git a/modules/webaudio/ScriptProcessorNode.idl b/modules/webaudio/ScriptProcessorNode.idl
index 666d273..bc000b9 100644
--- a/modules/webaudio/ScriptProcessorNode.idl
+++ b/modules/webaudio/ScriptProcessorNode.idl
@@ -30,6 +30,4 @@
attribute EventHandler onaudioprocess;
readonly attribute long bufferSize;
-
- [DartCustom=New] void _setEventListener(EventListener eventListener);
};
diff --git a/core/animation/AnimationEffect.idl b/modules/webaudio/StereoPannerNode.idl
similarity index 63%
rename from core/animation/AnimationEffect.idl
rename to modules/webaudio/StereoPannerNode.idl
index f5dc6ce..74f2354 100644
--- a/core/animation/AnimationEffect.idl
+++ b/modules/webaudio/StereoPannerNode.idl
@@ -3,8 +3,10 @@
// found in the LICENSE file.
[
- RuntimeEnabled=WebAnimationsAPI,
NoInterfaceObject,
- WillBeGarbageCollected
-] interface AnimationEffect {
-};
+ Conditional=WEB_AUDIO
+] interface StereoPannerNode : AudioNode {
+
+ readonly attribute AudioParam pan;
+
+};
\ No newline at end of file
diff --git a/modules/webaudio/WaveShaperNode.idl b/modules/webaudio/WaveShaperNode.idl
index 834b39e..5028567 100644
--- a/modules/webaudio/WaveShaperNode.idl
+++ b/modules/webaudio/WaveShaperNode.idl
@@ -31,8 +31,6 @@
[
Conditional=WEB_AUDIO
] interface WaveShaperNode : AudioNode {
- // FIXMEDART(ager): Auto-generate this custom method when the info about
- // retaining typed arrays is in the IDL.
- [DartCustom=Setter] attribute Float32Array curve;
- [RaisesException=Setter] attribute OverSampleType oversample;
+ [RaisesException=Setter] attribute Float32Array curve;
+ attribute OverSampleType oversample;
};
diff --git a/modules/webaudio/WindowWebAudio.idl b/modules/webaudio/WindowWebAudio.idl
index 75788e1..01e4618 100644
--- a/modules/webaudio/WindowWebAudio.idl
+++ b/modules/webaudio/WindowWebAudio.idl
@@ -5,8 +5,8 @@
[
ImplementedAs=DOMWindowWebAudio,
] partial interface Window {
- [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute AudioContextConstructor AudioContext;
- [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute OfflineAudioContextConstructor OfflineAudioContext;
- [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute AudioContextConstructor webkitAudioContext;
- [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute OfflineAudioContextConstructor webkitOfflineAudioContext;
+ [MeasureAs=AudioContext, Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute AudioContextConstructor AudioContext;
+ [MeasureAs=OfflineAudioContext, Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute OfflineAudioContextConstructor OfflineAudioContext;
+ [DeprecateAs=PrefixedAudioContext, Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute AudioContextConstructor webkitAudioContext;
+ [DeprecateAs=PrefixedOfflineAudioContext, Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute OfflineAudioContextConstructor webkitOfflineAudioContext;
};
diff --git a/modules/webaudio/testing/InternalsWebAudio.idl b/modules/webaudio/testing/InternalsWebAudio.idl
new file mode 100644
index 0000000..fb3b231
--- /dev/null
+++ b/modules/webaudio/testing/InternalsWebAudio.idl
@@ -0,0 +1,7 @@
+// Copyright 2015 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 Internals {
+ unsigned long audioHandlerCount();
+};
diff --git a/modules/webdatabase/Database.idl b/modules/webdatabase/Database.idl
index e809806..6062830 100644
--- a/modules/webdatabase/Database.idl
+++ b/modules/webdatabase/Database.idl
@@ -27,7 +27,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface Database {
readonly attribute DOMString version;
diff --git a/modules/webdatabase/SQLError.idl b/modules/webdatabase/SQLError.idl
index b084c97..f946d55 100644
--- a/modules/webdatabase/SQLError.idl
+++ b/modules/webdatabase/SQLError.idl
@@ -27,7 +27,7 @@
*/
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject
] interface SQLError {
readonly attribute unsigned long code;
diff --git a/modules/webdatabase/SQLResultSet.idl b/modules/webdatabase/SQLResultSet.idl
index 8b61f24..24c04c2 100644
--- a/modules/webdatabase/SQLResultSet.idl
+++ b/modules/webdatabase/SQLResultSet.idl
@@ -28,7 +28,7 @@
[
NoInterfaceObject,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface SQLResultSet {
readonly attribute SQLResultSetRowList rows;
diff --git a/modules/webdatabase/SQLResultSetRowList.idl b/modules/webdatabase/SQLResultSetRowList.idl
index b99f377..21f2304 100644
--- a/modules/webdatabase/SQLResultSetRowList.idl
+++ b/modules/webdatabase/SQLResultSetRowList.idl
@@ -28,12 +28,8 @@
[
NoInterfaceObject,
- WillBeGarbageCollected,
+ GarbageCollected,
] interface SQLResultSetRowList {
readonly attribute unsigned long length;
- // FIXMEDART: Upstream this?
- // - [Custom, DartSuppress] object item(unsigned long index);
- // - Changed the return type to Dictionary so that rows are exposed in the Dart
- // API as a Maps, with the appropriate conversion in JavaScript.
- [Custom] Dictionary item(unsigned long index);
+ [RaisesException, CallWith=ScriptState] getter any item(unsigned long index);
};
diff --git a/modules/webdatabase/SQLTransaction.idl b/modules/webdatabase/SQLTransaction.idl
index cc8b2bb..d1e50fe 100644
--- a/modules/webdatabase/SQLTransaction.idl
+++ b/modules/webdatabase/SQLTransaction.idl
@@ -26,13 +26,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://www.w3.org/TR/webdatabase/#sqltransaction
+
+typedef sequence<any> ObjectArray;
+
[
- WillBeGarbageCollected,
+ GarbageCollected,
NoInterfaceObject,
] interface SQLTransaction {
- [Custom] void executeSql(DOMString sqlStatement,
- object[] arguments,
- optional SQLStatementCallback callback,
- optional SQLStatementErrorCallback errorCallback);
+ // The spec defines |arguments| to be an "optional ObjectArray" though it defines the
+ // behavior when null is being passed.
+ [RaisesException, CallWith=ScriptState] void executeSql(DOMString sqlStatement,
+ optional ObjectArray? arguments,
+ optional SQLStatementCallback callback,
+ optional SQLStatementErrorCallback errorCallback);
};
diff --git a/core/html/canvas/ANGLEInstancedArrays.idl b/modules/webgl/ANGLEInstancedArrays.idl
similarity index 97%
rename from core/html/canvas/ANGLEInstancedArrays.idl
rename to modules/webgl/ANGLEInstancedArrays.idl
index 06f84e0..217396c 100644
--- a/core/html/canvas/ANGLEInstancedArrays.idl
+++ b/modules/webgl/ANGLEInstancedArrays.idl
@@ -33,6 +33,7 @@
NoInterfaceObject,
TypeChecking=Interface,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface ANGLEInstancedArrays {
const unsigned long VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
diff --git a/modules/webgl/CHROMIUMSubscribeUniform.idl b/modules/webgl/CHROMIUMSubscribeUniform.idl
new file mode 100644
index 0000000..3ae4f0e
--- /dev/null
+++ b/modules/webgl/CHROMIUMSubscribeUniform.idl
@@ -0,0 +1,26 @@
+// 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.
+
+typedef unsigned long GLenum;
+
+[
+ DoNotCheckConstants,
+ NoInterfaceObject,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
+] interface CHROMIUMSubscribeUniform {
+ const GLenum SUBSCRIBED_VALUES_BUFFER_CHROMIUM = 0x924B;
+
+ const GLenum MOUSE_POSITION_CHROMIUM = 0x924C;
+
+ CHROMIUMValuebuffer createValuebufferCHROMIUM();
+ void deleteValuebufferCHROMIUM(CHROMIUMValuebuffer? buffer);
+ boolean isValuebufferCHROMIUM(CHROMIUMValuebuffer? buffer);
+ void bindValuebufferCHROMIUM(GLenum target, CHROMIUMValuebuffer? buffer);
+
+ void subscribeValueCHROMIUM(GLenum target, GLenum subscriptions);
+ void populateSubscribedValuesCHROMIUM(GLenum target);
+ void uniformValuebufferCHROMIUM(WebGLUniformLocation? location, GLenum target, GLenum subscription);
+};
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/modules/webgl/CHROMIUMValuebuffer.idl
similarity index 85%
copy from core/html/canvas/EXTShaderTextureLOD.idl
copy to modules/webgl/CHROMIUMValuebuffer.idl
index 975005a..82b4003 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/modules/webgl/CHROMIUMValuebuffer.idl
@@ -5,5 +5,5 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
-] interface EXTShaderTextureLOD {
+] interface CHROMIUMValuebuffer {
};
diff --git a/core/html/canvas/EXTBlendMinMax.idl b/modules/webgl/EXTBlendMinMax.idl
similarity index 91%
rename from core/html/canvas/EXTBlendMinMax.idl
rename to modules/webgl/EXTBlendMinMax.idl
index fbc69bc..fbf002c 100644
--- a/core/html/canvas/EXTBlendMinMax.idl
+++ b/modules/webgl/EXTBlendMinMax.idl
@@ -7,6 +7,7 @@
NoInterfaceObject,
TypeChecking=Interface,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface EXTBlendMinMax {
const unsigned long MIN_EXT = 0x8007;
const unsigned long MAX_EXT = 0x8008;
diff --git a/core/html/canvas/EXTFragDepth.idl b/modules/webgl/EXTFragDepth.idl
similarity index 97%
rename from core/html/canvas/EXTFragDepth.idl
rename to modules/webgl/EXTFragDepth.idl
index ab71f12..a91c7ab 100644
--- a/core/html/canvas/EXTFragDepth.idl
+++ b/modules/webgl/EXTFragDepth.idl
@@ -26,5 +26,6 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface EXTFragDepth {
};
diff --git a/core/html/canvas/EXTShaderTextureLOD.idl b/modules/webgl/EXTShaderTextureLOD.idl
similarity index 87%
rename from core/html/canvas/EXTShaderTextureLOD.idl
rename to modules/webgl/EXTShaderTextureLOD.idl
index 975005a..a8103b0 100644
--- a/core/html/canvas/EXTShaderTextureLOD.idl
+++ b/modules/webgl/EXTShaderTextureLOD.idl
@@ -5,5 +5,6 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface EXTShaderTextureLOD {
};
diff --git a/core/html/canvas/EXTTextureFilterAnisotropic.idl b/modules/webgl/EXTTextureFilterAnisotropic.idl
similarity index 97%
rename from core/html/canvas/EXTTextureFilterAnisotropic.idl
rename to modules/webgl/EXTTextureFilterAnisotropic.idl
index 1588e48..33ab206 100644
--- a/core/html/canvas/EXTTextureFilterAnisotropic.idl
+++ b/modules/webgl/EXTTextureFilterAnisotropic.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface EXTTextureFilterAnisotropic {
const unsigned long TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
const unsigned long MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
diff --git a/modules/webgl/EXTsRGB.idl b/modules/webgl/EXTsRGB.idl
new file mode 100644
index 0000000..e4545e5
--- /dev/null
+++ b/modules/webgl/EXTsRGB.idl
@@ -0,0 +1,15 @@
+// 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,
+ DoNotCheckConstants,
+ WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
+] interface EXTsRGB {
+ const unsigned long SRGB_EXT = 0x8C40;
+ const unsigned long SRGB_ALPHA_EXT = 0x8C42;
+ const unsigned long SRGB8_ALPHA8_EXT = 0x8C43;
+ const unsigned long FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
+};
diff --git a/core/html/canvas/OESElementIndexUint.idl b/modules/webgl/OESElementIndexUint.idl
similarity index 97%
rename from core/html/canvas/OESElementIndexUint.idl
rename to modules/webgl/OESElementIndexUint.idl
index d4d8ea0..2fda077 100644
--- a/core/html/canvas/OESElementIndexUint.idl
+++ b/modules/webgl/OESElementIndexUint.idl
@@ -26,5 +26,6 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESElementIndexUint {
};
diff --git a/core/html/canvas/OESStandardDerivatives.idl b/modules/webgl/OESStandardDerivatives.idl
similarity index 97%
rename from core/html/canvas/OESStandardDerivatives.idl
rename to modules/webgl/OESStandardDerivatives.idl
index a517c7b..19e9367 100644
--- a/core/html/canvas/OESStandardDerivatives.idl
+++ b/modules/webgl/OESStandardDerivatives.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESStandardDerivatives {
const unsigned long FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
};
diff --git a/core/html/canvas/OESTextureFloat.idl b/modules/webgl/OESTextureFloat.idl
similarity index 97%
rename from core/html/canvas/OESTextureFloat.idl
rename to modules/webgl/OESTextureFloat.idl
index 446d079..5ccdca0 100644
--- a/core/html/canvas/OESTextureFloat.idl
+++ b/modules/webgl/OESTextureFloat.idl
@@ -26,5 +26,6 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESTextureFloat {
};
diff --git a/core/html/canvas/OESTextureFloatLinear.idl b/modules/webgl/OESTextureFloatLinear.idl
similarity index 97%
rename from core/html/canvas/OESTextureFloatLinear.idl
rename to modules/webgl/OESTextureFloatLinear.idl
index 8cb531d..bb39e3d 100644
--- a/core/html/canvas/OESTextureFloatLinear.idl
+++ b/modules/webgl/OESTextureFloatLinear.idl
@@ -26,5 +26,6 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESTextureFloatLinear {
};
diff --git a/core/html/canvas/OESTextureHalfFloat.idl b/modules/webgl/OESTextureHalfFloat.idl
similarity index 97%
rename from core/html/canvas/OESTextureHalfFloat.idl
rename to modules/webgl/OESTextureHalfFloat.idl
index b050cfa..062b1ca 100644
--- a/core/html/canvas/OESTextureHalfFloat.idl
+++ b/modules/webgl/OESTextureHalfFloat.idl
@@ -29,6 +29,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESTextureHalfFloat {
const GLenum HALF_FLOAT_OES = 0x8D61;
};
diff --git a/core/html/canvas/OESTextureHalfFloatLinear.idl b/modules/webgl/OESTextureHalfFloatLinear.idl
similarity index 97%
rename from core/html/canvas/OESTextureHalfFloatLinear.idl
rename to modules/webgl/OESTextureHalfFloatLinear.idl
index 201ca4d..7e78d0e 100644
--- a/core/html/canvas/OESTextureHalfFloatLinear.idl
+++ b/modules/webgl/OESTextureHalfFloatLinear.idl
@@ -26,5 +26,6 @@
[
NoInterfaceObject,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESTextureHalfFloatLinear {
};
diff --git a/core/html/canvas/OESVertexArrayObject.idl b/modules/webgl/OESVertexArrayObject.idl
similarity index 97%
rename from core/html/canvas/OESVertexArrayObject.idl
rename to modules/webgl/OESVertexArrayObject.idl
index eba1db6..e2751cd 100644
--- a/core/html/canvas/OESVertexArrayObject.idl
+++ b/modules/webgl/OESVertexArrayObject.idl
@@ -28,6 +28,7 @@
NoInterfaceObject,
TypeChecking=Interface,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface OESVertexArrayObject {
const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5;
diff --git a/modules/webgl/WebGL2RenderingContext.idl b/modules/webgl/WebGL2RenderingContext.idl
new file mode 100644
index 0000000..164b8b7
--- /dev/null
+++ b/modules/webgl/WebGL2RenderingContext.idl
@@ -0,0 +1,13 @@
+// Copyright 2015 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=UnsafeES3APIs,
+ DoNotCheckConstants,
+ SetWrapperReferenceFrom=canvas,
+ TypeChecking=Interface,
+ WillBeGarbageCollected,
+] interface WebGL2RenderingContext { };
+WebGL2RenderingContext implements WebGLRenderingContextBase;
+WebGL2RenderingContext implements WebGL2RenderingContextBase;
diff --git a/modules/webgl/WebGL2RenderingContextBase.idl b/modules/webgl/WebGL2RenderingContextBase.idl
new file mode 100644
index 0000000..928b3a3
--- /dev/null
+++ b/modules/webgl/WebGL2RenderingContextBase.idl
@@ -0,0 +1,438 @@
+// Copyright 2015 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.
+
+typedef unsigned long GLenum;
+typedef boolean GLboolean;
+typedef unsigned long GLbitfield;
+typedef byte GLbyte; // 'byte' should be a signed 8 bit type.
+typedef short GLshort;
+typedef long GLint;
+typedef long GLsizei;
+typedef long long GLintptr;
+typedef long long GLsizeiptr;
+typedef octet GLubyte; // 'octet' should be an unsigned 8 bit type.
+typedef unsigned short GLushort;
+typedef unsigned long GLuint;
+typedef unrestricted float GLfloat;
+typedef unrestricted float GLclampf;
+typedef long long GLint64;
+
+[
+ RuntimeEnabled=UnsafeES3APIs,
+ NoInterfaceObject,
+ WillBeGarbageCollected,
+] interface WebGL2RenderingContextBase {
+ const GLenum READ_BUFFER = 0x0C02;
+ const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
+ const GLenum UNPACK_SKIP_ROWS = 0x0CF3;
+ const GLenum UNPACK_SKIP_PIXELS = 0x0CF4;
+ const GLenum PACK_ROW_LENGTH = 0x0D02;
+ const GLenum PACK_SKIP_ROWS = 0x0D03;
+ const GLenum PACK_SKIP_PIXELS = 0x0D04;
+ const GLenum COLOR = 0x1800;
+ const GLenum DEPTH = 0x1801;
+ const GLenum STENCIL = 0x1802;
+ const GLenum RED = 0x1903;
+ const GLenum RGB8 = 0x8051;
+ const GLenum RGBA8 = 0x8058;
+ const GLenum RGB10_A2 = 0x8059;
+ const GLenum TEXTURE_BINDING_3D = 0x806A;
+ const GLenum UNPACK_SKIP_IMAGES = 0x806D;
+ const GLenum UNPACK_IMAGE_HEIGHT = 0x806E;
+ const GLenum TEXTURE_3D = 0x806F;
+ const GLenum TEXTURE_WRAP_R = 0x8072;
+ const GLenum MAX_3D_TEXTURE_SIZE = 0x8073;
+ const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368;
+ const GLenum MAX_ELEMENTS_VERTICES = 0x80E8;
+ const GLenum MAX_ELEMENTS_INDICES = 0x80E9;
+ const GLenum TEXTURE_MIN_LOD = 0x813A;
+ const GLenum TEXTURE_MAX_LOD = 0x813B;
+ const GLenum TEXTURE_BASE_LEVEL = 0x813C;
+ const GLenum TEXTURE_MAX_LEVEL = 0x813D;
+ const GLenum MIN = 0x8007;
+ const GLenum MAX = 0x8008;
+ const GLenum DEPTH_COMPONENT24 = 0x81A6;
+ const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD;
+ const GLenum TEXTURE_COMPARE_MODE = 0x884C;
+ const GLenum TEXTURE_COMPARE_FUNC = 0x884D;
+ const GLenum CURRENT_QUERY = 0x8865;
+ const GLenum QUERY_RESULT = 0x8866;
+ const GLenum QUERY_RESULT_AVAILABLE = 0x8867;
+ const GLenum STREAM_READ = 0x88E1;
+ const GLenum STREAM_COPY = 0x88E2;
+ const GLenum STATIC_READ = 0x88E5;
+ const GLenum STATIC_COPY = 0x88E6;
+ const GLenum DYNAMIC_READ = 0x88E9;
+ const GLenum DYNAMIC_COPY = 0x88EA;
+ const GLenum MAX_DRAW_BUFFERS = 0x8824;
+ const GLenum DRAW_BUFFER0 = 0x8825;
+ const GLenum DRAW_BUFFER1 = 0x8826;
+ const GLenum DRAW_BUFFER2 = 0x8827;
+ const GLenum DRAW_BUFFER3 = 0x8828;
+ const GLenum DRAW_BUFFER4 = 0x8829;
+ const GLenum DRAW_BUFFER5 = 0x882A;
+ const GLenum DRAW_BUFFER6 = 0x882B;
+ const GLenum DRAW_BUFFER7 = 0x882C;
+ const GLenum DRAW_BUFFER8 = 0x882D;
+ const GLenum DRAW_BUFFER9 = 0x882E;
+ const GLenum DRAW_BUFFER10 = 0x882F;
+ const GLenum DRAW_BUFFER11 = 0x8830;
+ const GLenum DRAW_BUFFER12 = 0x8831;
+ const GLenum DRAW_BUFFER13 = 0x8832;
+ const GLenum DRAW_BUFFER14 = 0x8833;
+ const GLenum DRAW_BUFFER15 = 0x8834;
+ const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
+ const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
+ const GLenum SAMPLER_3D = 0x8B5F;
+ const GLenum SAMPLER_2D_SHADOW = 0x8B62;
+ const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
+ const GLenum PIXEL_PACK_BUFFER = 0x88EB;
+ const GLenum PIXEL_UNPACK_BUFFER = 0x88EC;
+ const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED;
+ const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
+ const GLenum FLOAT_MAT2x3 = 0x8B65;
+ const GLenum FLOAT_MAT2x4 = 0x8B66;
+ const GLenum FLOAT_MAT3x2 = 0x8B67;
+ const GLenum FLOAT_MAT3x4 = 0x8B68;
+ const GLenum FLOAT_MAT4x2 = 0x8B69;
+ const GLenum FLOAT_MAT4x3 = 0x8B6A;
+ const GLenum SRGB = 0x8C40;
+ const GLenum SRGB8 = 0x8C41;
+ const GLenum SRGB8_ALPHA8 = 0x8C43;
+ const GLenum COMPARE_REF_TO_TEXTURE = 0x884E;
+ const GLenum RGBA32F = 0x8814;
+ const GLenum RGB32F = 0x8815;
+ const GLenum RGBA16F = 0x881A;
+ const GLenum RGB16F = 0x881B;
+ const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
+ const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
+ const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
+ const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
+ const GLenum MAX_VARYING_COMPONENTS = 0x8B4B;
+ const GLenum TEXTURE_2D_ARRAY = 0x8C1A;
+ const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
+ const GLenum R11F_G11F_B10F = 0x8C3A;
+ const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
+ const GLenum RGB9_E5 = 0x8C3D;
+ const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
+ const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
+ const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
+ const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
+ const GLenum RASTERIZER_DISCARD = 0x8C89;
+ const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
+ const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
+ const GLenum INTERLEAVED_ATTRIBS = 0x8C8C;
+ const GLenum SEPARATE_ATTRIBS = 0x8C8D;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
+ const GLenum RGBA32UI = 0x8D70;
+ const GLenum RGB32UI = 0x8D71;
+ const GLenum RGBA16UI = 0x8D76;
+ const GLenum RGB16UI = 0x8D77;
+ const GLenum RGBA8UI = 0x8D7C;
+ const GLenum RGB8UI = 0x8D7D;
+ const GLenum RGBA32I = 0x8D82;
+ const GLenum RGB32I = 0x8D83;
+ const GLenum RGBA16I = 0x8D88;
+ const GLenum RGB16I = 0x8D89;
+ const GLenum RGBA8I = 0x8D8E;
+ const GLenum RGB8I = 0x8D8F;
+ const GLenum RED_INTEGER = 0x8D94;
+ const GLenum RGB_INTEGER = 0x8D98;
+ const GLenum RGBA_INTEGER = 0x8D99;
+ const GLenum SAMPLER_2D_ARRAY = 0x8DC1;
+ const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
+ const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5;
+ const GLenum UNSIGNED_INT_VEC2 = 0x8DC6;
+ const GLenum UNSIGNED_INT_VEC3 = 0x8DC7;
+ const GLenum UNSIGNED_INT_VEC4 = 0x8DC8;
+ const GLenum INT_SAMPLER_2D = 0x8DCA;
+ const GLenum INT_SAMPLER_3D = 0x8DCB;
+ const GLenum INT_SAMPLER_CUBE = 0x8DCC;
+ const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF;
+ const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
+ const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
+ const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
+ const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
+ const GLenum DEPTH_COMPONENT32F = 0x8CAC;
+ const GLenum DEPTH32F_STENCIL8 = 0x8CAD;
+ const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
+ const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
+ const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
+ const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
+ const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
+ const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
+ const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
+ const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
+ const GLenum UNSIGNED_INT_24_8 = 0x84FA;
+ const GLenum DEPTH24_STENCIL8 = 0x88F0;
+ const GLenum UNSIGNED_NORMALIZED = 0x8C17;
+ const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
+ const GLenum READ_FRAMEBUFFER = 0x8CA8;
+ const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
+ const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA;
+ const GLenum RENDERBUFFER_SAMPLES = 0x8CAB;
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+ const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF;
+ const GLenum COLOR_ATTACHMENT1 = 0x8CE1;
+ const GLenum COLOR_ATTACHMENT2 = 0x8CE2;
+ const GLenum COLOR_ATTACHMENT3 = 0x8CE3;
+ const GLenum COLOR_ATTACHMENT4 = 0x8CE4;
+ const GLenum COLOR_ATTACHMENT5 = 0x8CE5;
+ const GLenum COLOR_ATTACHMENT6 = 0x8CE6;
+ const GLenum COLOR_ATTACHMENT7 = 0x8CE7;
+ const GLenum COLOR_ATTACHMENT8 = 0x8CE8;
+ const GLenum COLOR_ATTACHMENT9 = 0x8CE9;
+ const GLenum COLOR_ATTACHMENT10 = 0x8CEA;
+ const GLenum COLOR_ATTACHMENT11 = 0x8CEB;
+ const GLenum COLOR_ATTACHMENT12 = 0x8CEC;
+ const GLenum COLOR_ATTACHMENT13 = 0x8CED;
+ const GLenum COLOR_ATTACHMENT14 = 0x8CEE;
+ const GLenum COLOR_ATTACHMENT15 = 0x8CEF;
+ const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
+ const GLenum MAX_SAMPLES = 0x8D57;
+ const GLenum HALF_FLOAT = 0x140B;
+ const GLenum RG = 0x8227;
+ const GLenum RG_INTEGER = 0x8228;
+ const GLenum R8 = 0x8229;
+ const GLenum RG8 = 0x822B;
+ const GLenum R16F = 0x822D;
+ const GLenum R32F = 0x822E;
+ const GLenum RG16F = 0x822F;
+ const GLenum RG32F = 0x8230;
+ const GLenum R8I = 0x8231;
+ const GLenum R8UI = 0x8232;
+ const GLenum R16I = 0x8233;
+ const GLenum R16UI = 0x8234;
+ const GLenum R32I = 0x8235;
+ const GLenum R32UI = 0x8236;
+ const GLenum RG8I = 0x8237;
+ const GLenum RG8UI = 0x8238;
+ const GLenum RG16I = 0x8239;
+ const GLenum RG16UI = 0x823A;
+ const GLenum RG32I = 0x823B;
+ const GLenum RG32UI = 0x823C;
+ const GLenum VERTEX_ARRAY_BINDING = 0x85B5;
+ const GLenum R8_SNORM = 0x8F94;
+ const GLenum RG8_SNORM = 0x8F95;
+ const GLenum RGB8_SNORM = 0x8F96;
+ const GLenum RGBA8_SNORM = 0x8F97;
+ const GLenum SIGNED_NORMALIZED = 0x8F9C;
+ const GLenum COPY_READ_BUFFER = 0x8F36;
+ const GLenum COPY_WRITE_BUFFER = 0x8F37;
+ const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
+ const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */
+ const GLenum UNIFORM_BUFFER = 0x8A11;
+ const GLenum UNIFORM_BUFFER_BINDING = 0x8A28;
+ const GLenum UNIFORM_BUFFER_START = 0x8A29;
+ const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A;
+ const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
+ const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
+ const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
+ const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
+ const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
+ const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
+ const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
+ const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
+ const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36;
+ const GLenum UNIFORM_TYPE = 0x8A37;
+ const GLenum UNIFORM_SIZE = 0x8A38;
+ const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A;
+ const GLenum UNIFORM_OFFSET = 0x8A3B;
+ const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C;
+ const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D;
+ const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E;
+ const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F;
+ const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
+ const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
+ const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
+ const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
+ const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
+ const GLenum INVALID_INDEX = 0xFFFFFFFF;
+ const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
+ const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
+ const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111;
+ const GLenum OBJECT_TYPE = 0x9112;
+ const GLenum SYNC_CONDITION = 0x9113;
+ const GLenum SYNC_STATUS = 0x9114;
+ const GLenum SYNC_FLAGS = 0x9115;
+ const GLenum SYNC_FENCE = 0x9116;
+ const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
+ const GLenum UNSIGNALED = 0x9118;
+ const GLenum SIGNALED = 0x9119;
+ const GLenum ALREADY_SIGNALED = 0x911A;
+ const GLenum TIMEOUT_EXPIRED = 0x911B;
+ const GLenum CONDITION_SATISFIED = 0x911C;
+ const GLenum WAIT_FAILED = 0x911D;
+ const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
+ const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
+ const GLenum ANY_SAMPLES_PASSED = 0x8C2F;
+ const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
+ const GLenum SAMPLER_BINDING = 0x8919;
+ const GLenum RGB10_A2UI = 0x906F;
+ const GLenum GREEN = 0x1904;
+ const GLenum BLUE = 0x1905;
+ const GLenum INT_2_10_10_10_REV = 0x8D9F;
+ const GLenum TRANSFORM_FEEDBACK = 0x8E22;
+ const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
+ const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
+ const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25;
+ const GLenum COMPRESSED_R11_EAC = 0x9270;
+ const GLenum COMPRESSED_SIGNED_R11_EAC = 0x9271;
+ const GLenum COMPRESSED_RG11_EAC = 0x9272;
+ const GLenum COMPRESSED_SIGNED_RG11_EAC = 0x9273;
+ const GLenum COMPRESSED_RGB8_ETC2 = 0x9274;
+ const GLenum COMPRESSED_SRGB8_ETC2 = 0x9275;
+ const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
+ const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
+ const GLenum COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
+ const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F;
+ const GLenum MAX_ELEMENT_INDEX = 0x8D6B;
+ const GLenum NUM_SAMPLE_COUNTS = 0x9380;
+ const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
+
+ // FIXME: This currently differs from the WebGL2 spec.
+ const GLuint TIMEOUT_IGNORED = 0xFFFFFFFF;
+
+ /* WebGL-specific enums */
+ const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247;
+
+ /* Buffer objects */
+ void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+ void getBufferSubData(GLenum target, GLintptr offset, ArrayBuffer returnedData);
+
+ /* Framebuffer objects */
+ void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+ void framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture texture, GLint level, GLint layer);
+ [CallWith=ScriptState] any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
+ void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
+ void invalidateSubFramebuffer (GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+ void readBuffer(GLenum mode);
+
+ /* Renderbuffer objects */
+ void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+ /* Texture objects */
+ void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
+ [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ArrayBufferView? pixels);
+ [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, ImageData? data);
+ [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLImageElement? image);
+ [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLCanvasElement? canvas);
+ [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, HTMLVideoElement? video);
+ void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, ArrayBufferView data);
+ void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, ArrayBufferView data);
+
+ /* Programs and shaders */
+ GLint getFragDataLocation(WebGLProgram? program, DOMString name);
+
+ /* Uniforms and attributes */
+ void uniform1ui(WebGLUniformLocation? location, GLuint v0);
+ void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
+ void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
+ void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+
+ void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void vertexAttribI4iv(GLuint index, sequence<GLint> v);
+ void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void vertexAttribI4uiv(GLuint index, sequence<GLuint> v);
+ void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+
+ /* Writing to the drawing buffer */
+ void vertexAttribDivisor(GLuint index, GLuint divisor);
+ void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
+ void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
+ void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
+
+ /* Multiple Render Targets */
+ void drawBuffers(sequence<GLenum> buffers);
+ void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32Array value);
+ void clearBufferiv(GLenum buffer, GLint drawbuffer, sequence<GLint> value);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32Array value);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, sequence<GLuint> value);
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32Array value);
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, sequence<GLfloat> value);
+ void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+
+ /* Query Objects */
+ WebGLQuery createQuery();
+ void deleteQuery(WebGLQuery? query);
+ GLboolean isQuery(WebGLQuery? query);
+ void beginQuery(GLenum target, WebGLQuery? query);
+ void endQuery(GLenum target);
+ WebGLQuery getQuery(GLenum target, GLenum pname);
+ [CallWith=ScriptState] any getQueryParameter(WebGLQuery? query, GLenum pname);
+
+ /* Sampler Objects */
+ WebGLSampler createSampler();
+ void deleteSampler(WebGLSampler? sampler);
+ GLboolean isSampler(WebGLSampler? sampler);
+ void bindSampler(GLuint unit, WebGLSampler? sampler);
+ void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);
+ void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);
+ [CallWith=ScriptState] any getSamplerParameter(WebGLSampler? sampler, GLenum pname);
+
+ /* Sync objects */
+ WebGLSync fenceSync(GLenum condition, GLbitfield flags);
+ GLboolean isSync(WebGLSync? sync);
+ void deleteSync(WebGLSync? sync);
+ GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLuint timeout);
+ void waitSync(WebGLSync? sync, GLbitfield flags, GLuint timeout);
+
+ [CallWith=ScriptState] any getSyncParameter(WebGLSync sync, GLenum pname);
+
+ /* Transform Feedback */
+ WebGLTransformFeedback createTransformFeedback();
+ void deleteTransformFeedback(WebGLTransformFeedback? feedback);
+ GLboolean isTransformFeedback(WebGLTransformFeedback? feedback);
+ void bindTransformFeedback (GLenum target, WebGLTransformFeedback? feedback);
+ void beginTransformFeedback(GLenum primitiveMode);
+ void endTransformFeedback();
+ void transformFeedbackVaryings(WebGLProgram? program, sequence<DOMString> varyings, GLenum bufferMode);
+ WebGLActiveInfo getTransformFeedbackVarying(WebGLProgram? program, GLuint index);
+ void pauseTransformFeedback();
+ void resumeTransformFeedback();
+
+ /* Uniform Buffer Objects and Transform Feedback Buffers */
+ void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
+ void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
+ [CallWith=ScriptState] any getIndexedParameter(GLenum target, GLuint index);
+ sequence<GLuint>? getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames);
+ sequence<GLint>? getActiveUniforms(WebGLProgram? program, sequence<GLuint> uniformIndices, GLenum pname);
+ GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName);
+ [CallWith=ScriptState] any getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname);
+ DOMString getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex);
+ void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+ /* Vertex Array Objects */
+ WebGLVertexArrayObject createVertexArray();
+ void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
+ GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
+ void bindVertexArray(WebGLVertexArrayObject? vertexArray);
+};
+WebGL2RenderingContextBase implements WebGLRenderingContextBase;
diff --git a/core/html/canvas/WebGLActiveInfo.idl b/modules/webgl/WebGLActiveInfo.idl
similarity index 100%
rename from core/html/canvas/WebGLActiveInfo.idl
rename to modules/webgl/WebGLActiveInfo.idl
diff --git a/core/html/canvas/WebGLBuffer.idl b/modules/webgl/WebGLBuffer.idl
similarity index 100%
rename from core/html/canvas/WebGLBuffer.idl
rename to modules/webgl/WebGLBuffer.idl
diff --git a/core/html/canvas/WebGLCompressedTextureATC.idl b/modules/webgl/WebGLCompressedTextureATC.idl
similarity index 97%
rename from core/html/canvas/WebGLCompressedTextureATC.idl
rename to modules/webgl/WebGLCompressedTextureATC.idl
index a66a329..25355c2 100644
--- a/core/html/canvas/WebGLCompressedTextureATC.idl
+++ b/modules/webgl/WebGLCompressedTextureATC.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLCompressedTextureATC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
diff --git a/core/html/canvas/WebGLCompressedTextureETC1.idl b/modules/webgl/WebGLCompressedTextureETC1.idl
similarity index 91%
rename from core/html/canvas/WebGLCompressedTextureETC1.idl
rename to modules/webgl/WebGLCompressedTextureETC1.idl
index fd8759d..db8ed21 100644
--- a/core/html/canvas/WebGLCompressedTextureETC1.idl
+++ b/modules/webgl/WebGLCompressedTextureETC1.idl
@@ -6,6 +6,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLCompressedTextureETC1 {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
diff --git a/core/html/canvas/WebGLCompressedTexturePVRTC.idl b/modules/webgl/WebGLCompressedTexturePVRTC.idl
similarity index 97%
rename from core/html/canvas/WebGLCompressedTexturePVRTC.idl
rename to modules/webgl/WebGLCompressedTexturePVRTC.idl
index 9eaa3a9..731bab6 100644
--- a/core/html/canvas/WebGLCompressedTexturePVRTC.idl
+++ b/modules/webgl/WebGLCompressedTexturePVRTC.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLCompressedTexturePVRTC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
diff --git a/core/html/canvas/WebGLCompressedTextureS3TC.idl b/modules/webgl/WebGLCompressedTextureS3TC.idl
similarity index 97%
rename from core/html/canvas/WebGLCompressedTextureS3TC.idl
rename to modules/webgl/WebGLCompressedTextureS3TC.idl
index eef723f..e5465c3 100644
--- a/core/html/canvas/WebGLCompressedTextureS3TC.idl
+++ b/modules/webgl/WebGLCompressedTextureS3TC.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLCompressedTextureS3TC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
diff --git a/core/html/canvas/WebGLContextAttributes.idl b/modules/webgl/WebGLContextAttributes.idl
similarity index 79%
rename from core/html/canvas/WebGLContextAttributes.idl
rename to modules/webgl/WebGLContextAttributes.idl
index ecd211a..9a48073 100644
--- a/core/html/canvas/WebGLContextAttributes.idl
+++ b/modules/webgl/WebGLContextAttributes.idl
@@ -24,15 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- NoInterfaceObject,
- WillBeGarbageCollected,
-] interface WebGLContextAttributes {
- attribute boolean alpha;
- attribute boolean depth;
- attribute boolean stencil;
- attribute boolean antialias;
- attribute boolean premultipliedAlpha;
- attribute boolean preserveDrawingBuffer;
- attribute boolean failIfMajorPerformanceCaveat;
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2
+
+dictionary WebGLContextAttributes {
+ boolean alpha = true;
+ boolean depth = true;
+ boolean stencil = false;
+ boolean antialias = true;
+ boolean premultipliedAlpha = true;
+ boolean preserveDrawingBuffer = false;
+ boolean failIfMajorPerformanceCaveat = false;
};
diff --git a/core/html/canvas/WebGLContextEvent.idl b/modules/webgl/WebGLContextEvent.idl
similarity index 88%
rename from core/html/canvas/WebGLContextEvent.idl
rename to modules/webgl/WebGLContextEvent.idl
index 18266e5..484b8bc 100644
--- a/core/html/canvas/WebGLContextEvent.idl
+++ b/modules/webgl/WebGLContextEvent.idl
@@ -23,9 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/1.0/#5.15
+
[
- EventConstructor,
+ Constructor(DOMString type, optional WebGLContextEventInit eventInit),
] interface WebGLContextEvent : Event {
- [InitializedByEventConstructor] readonly attribute DOMString statusMessage;
+ readonly attribute DOMString statusMessage;
};
diff --git a/modules/webgl/WebGLContextEventInit.idl b/modules/webgl/WebGLContextEventInit.idl
new file mode 100644
index 0000000..7a7ced8
--- /dev/null
+++ b/modules/webgl/WebGLContextEventInit.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.
+
+// https://www.khronos.org/registry/webgl/specs/1.0/#5.15
+
+dictionary WebGLContextEventInit : EventInit {
+ DOMString statusMessage;
+};
diff --git a/core/html/canvas/WebGLDebugRendererInfo.idl b/modules/webgl/WebGLDebugRendererInfo.idl
similarity index 97%
rename from core/html/canvas/WebGLDebugRendererInfo.idl
rename to modules/webgl/WebGLDebugRendererInfo.idl
index bf95c1b..ac4f2e1 100644
--- a/core/html/canvas/WebGLDebugRendererInfo.idl
+++ b/modules/webgl/WebGLDebugRendererInfo.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] 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/modules/webgl/WebGLDebugShaders.idl
similarity index 97%
rename from core/html/canvas/WebGLDebugShaders.idl
rename to modules/webgl/WebGLDebugShaders.idl
index 92c36be..770c12d 100644
--- a/core/html/canvas/WebGLDebugShaders.idl
+++ b/modules/webgl/WebGLDebugShaders.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
TypeChecking=Interface,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLDebugShaders {
DOMString? getTranslatedShaderSource(WebGLShader? shader);
};
diff --git a/core/html/canvas/WebGLDepthTexture.idl b/modules/webgl/WebGLDepthTexture.idl
similarity index 97%
rename from core/html/canvas/WebGLDepthTexture.idl
rename to modules/webgl/WebGLDepthTexture.idl
index d6a0874..773819b 100644
--- a/core/html/canvas/WebGLDepthTexture.idl
+++ b/modules/webgl/WebGLDepthTexture.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLDepthTexture {
const unsigned long UNSIGNED_INT_24_8_WEBGL = 0x84FA;
};
diff --git a/core/html/canvas/WebGLDrawBuffers.idl b/modules/webgl/WebGLDrawBuffers.idl
similarity index 98%
rename from core/html/canvas/WebGLDrawBuffers.idl
rename to modules/webgl/WebGLDrawBuffers.idl
index 82fc059..0a907aa 100644
--- a/core/html/canvas/WebGLDrawBuffers.idl
+++ b/modules/webgl/WebGLDrawBuffers.idl
@@ -29,6 +29,7 @@
NoInterfaceObject,
DoNotCheckConstants,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLDrawBuffers {
const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1;
diff --git a/core/html/canvas/WebGLFramebuffer.idl b/modules/webgl/WebGLFramebuffer.idl
similarity index 100%
rename from core/html/canvas/WebGLFramebuffer.idl
rename to modules/webgl/WebGLFramebuffer.idl
diff --git a/core/html/canvas/WebGLLoseContext.idl b/modules/webgl/WebGLLoseContext.idl
similarity index 97%
rename from core/html/canvas/WebGLLoseContext.idl
rename to modules/webgl/WebGLLoseContext.idl
index c235567..8e3a5d2 100644
--- a/core/html/canvas/WebGLLoseContext.idl
+++ b/modules/webgl/WebGLLoseContext.idl
@@ -27,6 +27,7 @@
NoInterfaceObject,
TypeChecking=Interface,
WillBeGarbageCollected,
+ SetWrapperReferenceFrom=canvas,
] interface WebGLLoseContext {
void loseContext();
void restoreContext();
diff --git a/core/html/canvas/WebGLProgram.idl b/modules/webgl/WebGLProgram.idl
similarity index 100%
rename from core/html/canvas/WebGLProgram.idl
rename to modules/webgl/WebGLProgram.idl
diff --git a/modules/webgl/WebGLQuery.idl b/modules/webgl/WebGLQuery.idl
new file mode 100644
index 0000000..257b911
--- /dev/null
+++ b/modules/webgl/WebGLQuery.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=UnsafeES3APIs,
+ WillBeGarbageCollected
+] interface WebGLQuery {
+};
\ No newline at end of file
diff --git a/core/html/canvas/WebGLRenderbuffer.idl b/modules/webgl/WebGLRenderbuffer.idl
similarity index 100%
rename from core/html/canvas/WebGLRenderbuffer.idl
rename to modules/webgl/WebGLRenderbuffer.idl
diff --git a/core/html/canvas/WebGLRenderingContext.idl b/modules/webgl/WebGLRenderingContext.idl
similarity index 97%
rename from core/html/canvas/WebGLRenderingContext.idl
rename to modules/webgl/WebGLRenderingContext.idl
index 6c12783..f0eb42f 100644
--- a/core/html/canvas/WebGLRenderingContext.idl
+++ b/modules/webgl/WebGLRenderingContext.idl
@@ -27,6 +27,7 @@
[
DoNotCheckConstants,
+ SetWrapperReferenceFrom=canvas,
TypeChecking=Interface,
WillBeGarbageCollected,
] interface WebGLRenderingContext { };
diff --git a/core/html/canvas/WebGLRenderingContextBase.idl b/modules/webgl/WebGLRenderingContextBase.idl
similarity index 72%
rename from core/html/canvas/WebGLRenderingContextBase.idl
rename to modules/webgl/WebGLRenderingContextBase.idl
index 5ba1683..d0a3dd1 100644
--- a/core/html/canvas/WebGLRenderingContextBase.idl
+++ b/modules/webgl/WebGLRenderingContextBase.idl
@@ -41,11 +41,11 @@
typedef unrestricted float GLclampf;
[
- // FIXME: [DoNotCheckConstants] and [TypeChecking=(Interface,Unrestricted)] should be applied
+ // FIXME: [DoNotCheckConstants] and [TypeChecking=Interface] 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,Unrestricted), // need to put on implementing interface
+ // TypeChecking=Interface, // need to put on implementing interface
WillBeGarbageCollected,
] interface WebGLRenderingContextBase {
@@ -470,21 +470,21 @@
const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
const GLenum BROWSER_DEFAULT_WEBGL = 0x9244;
- [DartNoAutoScope] readonly attribute GLsizei drawingBufferWidth;
- [DartNoAutoScope] readonly attribute GLsizei drawingBufferHeight;
+ readonly attribute GLsizei drawingBufferWidth;
+ readonly attribute GLsizei drawingBufferHeight;
- [DartNoAutoScope] void activeTexture(GLenum texture);
- [DartNoAutoScope] void attachShader(WebGLProgram? program, WebGLShader? shader);
- [DartNoAutoScope] void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
- [DartNoAutoScope] void bindBuffer(GLenum target, WebGLBuffer? buffer);
- [DartNoAutoScope] void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
- [DartNoAutoScope] void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
- [DartNoAutoScope] void bindTexture(GLenum target, WebGLTexture? texture);
- [DartNoAutoScope] void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- [DartNoAutoScope] void blendEquation(GLenum mode);
- [DartNoAutoScope] void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
- [DartNoAutoScope] void blendFunc(GLenum sfactor, GLenum dfactor);
- [DartNoAutoScope] void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+ void activeTexture(GLenum texture);
+ void attachShader(WebGLProgram? program, WebGLShader? shader);
+ void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
+ void bindBuffer(GLenum target, WebGLBuffer? buffer);
+ void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
+ void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
+ void bindTexture(GLenum target, WebGLTexture? texture);
+ void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+ void blendEquation(GLenum mode);
+ void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+ void blendFunc(GLenum sfactor, GLenum dfactor);
+ void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
// FIXME: should be union type
// https://www.khronos.org/bugzilla/show_bug.cgi?id=1172
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
@@ -493,21 +493,21 @@
void bufferSubData(GLenum target, GLintptr offset, ArrayBufferView data);
void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer? data);
- [DartNoAutoScope] GLenum checkFramebufferStatus(GLenum target);
- [DartNoAutoScope] void clear(GLbitfield mask);
- [DartNoAutoScope] void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- [DartNoAutoScope] void clearDepth(GLclampf depth);
- [DartNoAutoScope] void clearStencil(GLint s);
- [DartNoAutoScope] void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- [DartNoAutoScope] void compileShader(WebGLShader? shader);
+ GLenum checkFramebufferStatus(GLenum target);
+ void clear(GLbitfield mask);
+ void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+ void clearDepth(GLclampf depth);
+ void clearStencil(GLint s);
+ void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+ void compileShader(WebGLShader? shader);
- [DartNoAutoScope] void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, ArrayBufferView? data);
- [DartNoAutoScope] void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height, GLenum format, ArrayBufferView? data);
- [DartNoAutoScope] void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
- [DartNoAutoScope] void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+ void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
WebGLBuffer createBuffer();
WebGLFramebuffer createFramebuffer();
@@ -516,55 +516,54 @@
WebGLShader createShader(GLenum type);
WebGLTexture createTexture();
- [DartNoAutoScope] void cullFace(GLenum mode);
+ void cullFace(GLenum mode);
- [DartNoAutoScope] void deleteBuffer(WebGLBuffer? buffer);
- [DartNoAutoScope] void deleteFramebuffer(WebGLFramebuffer? framebuffer);
- [DartNoAutoScope] void deleteProgram(WebGLProgram? program);
- [DartNoAutoScope] void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
- [DartNoAutoScope] void deleteShader(WebGLShader? shader);
- [DartNoAutoScope] void deleteTexture(WebGLTexture? texture);
+ void deleteBuffer(WebGLBuffer? buffer);
+ void deleteFramebuffer(WebGLFramebuffer? framebuffer);
+ void deleteProgram(WebGLProgram? program);
+ void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
+ void deleteShader(WebGLShader? shader);
+ void deleteTexture(WebGLTexture? texture);
- [DartNoAutoScope] void depthFunc(GLenum func);
- [DartNoAutoScope] void depthMask(GLboolean flag);
- [DartNoAutoScope] void depthRange(GLclampf zNear, GLclampf zFar);
- [DartNoAutoScope] void detachShader(WebGLProgram? program, WebGLShader? shader);
- [DartNoAutoScope] void disable(GLenum cap);
- [DartNoAutoScope] void disableVertexAttribArray(GLuint index);
- [DartNoAutoScope] void drawArrays(GLenum mode, GLint first, GLsizei count);
- [DartNoAutoScope] void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
+ void depthFunc(GLenum func);
+ void depthMask(GLboolean flag);
+ void depthRange(GLclampf zNear, GLclampf zFar);
+ void detachShader(WebGLProgram? program, WebGLShader? shader);
+ void disable(GLenum cap);
+ void disableVertexAttribArray(GLuint index);
+ void drawArrays(GLenum mode, GLint first, GLsizei count);
+ void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
- [DartNoAutoScope] void enable(GLenum cap);
- [DartNoAutoScope] void enableVertexAttribArray(GLuint index);
- [DartNoAutoScope] void finish();
- [DartNoAutoScope] void flush();
- [DartNoAutoScope] void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer? renderbuffer);
- [DartNoAutoScope] void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture? texture, GLint level);
- [DartNoAutoScope] void frontFace(GLenum mode);
- [DartNoAutoScope] void generateMipmap(GLenum target);
+ void enable(GLenum cap);
+ void enableVertexAttribArray(GLuint index);
+ void finish();
+ void flush();
+ void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer? renderbuffer);
+ void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture? texture, GLint level);
+ void frontFace(GLenum mode);
+ void generateMipmap(GLenum target);
- [DartNoAutoScope] WebGLActiveInfo getActiveAttrib(WebGLProgram? program, GLuint index);
- [DartNoAutoScope] WebGLActiveInfo getActiveUniform(WebGLProgram? program, GLuint index);
+ WebGLActiveInfo getActiveAttrib(WebGLProgram? program, GLuint index);
+ WebGLActiveInfo getActiveUniform(WebGLProgram? program, GLuint index);
- [DartNoAutoScope] sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
+ sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
- [DartNoAutoScope] GLint getAttribLocation(WebGLProgram? program, DOMString name);
+ GLint getAttribLocation(WebGLProgram? program, DOMString name);
- [Custom] any getBufferParameter(GLenum target, GLenum pname);
+ [CallWith=ScriptState] any getBufferParameter(GLenum target, GLenum pname);
- WebGLContextAttributes getContextAttributes();
+ WebGLContextAttributes? getContextAttributes();
GLenum getError();
- // object getExtension(DOMString name);
- [Custom] any getExtension(DOMString name);
+ [CallWith=ScriptState] object? getExtension(DOMString name);
- [Custom] any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname);
- [Custom] any getParameter(GLenum pname);
- [Custom] any getProgramParameter(WebGLProgram? program, GLenum pname);
+ [CallWith=ScriptState] any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname);
+ [CallWith=ScriptState] any getParameter(GLenum pname);
+ [CallWith=ScriptState] any getProgramParameter(WebGLProgram? program, GLenum pname);
DOMString? getProgramInfoLog(WebGLProgram? program);
- [Custom] any getRenderbufferParameter(GLenum target, GLenum pname);
- [Custom] any getShaderParameter(WebGLShader? shader, GLenum pname);
+ [CallWith=ScriptState] any getRenderbufferParameter(GLenum target, GLenum pname);
+ [CallWith=ScriptState] any getShaderParameter(WebGLShader? shader, GLenum pname);
DOMString? getShaderInfoLog(WebGLShader? shader);
@@ -574,42 +573,42 @@
sequence<DOMString>? getSupportedExtensions();
- [Custom] any getTexParameter(GLenum target, GLenum pname);
+ [CallWith=ScriptState] any getTexParameter(GLenum target, GLenum pname);
- [Custom] any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
+ [CallWith=ScriptState] any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
WebGLUniformLocation getUniformLocation(WebGLProgram? program, DOMString name);
- [Custom] any getVertexAttrib(GLuint index, GLenum pname);
+ [CallWith=ScriptState] any getVertexAttrib(GLuint index, GLenum pname);
GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname);
- [DartNoAutoScope] void hint(GLenum target, GLenum mode);
- [DartNoAutoScope] GLboolean isBuffer(WebGLBuffer? buffer);
- [DartNoAutoScope] GLboolean isContextLost();
- [DartNoAutoScope] GLboolean isEnabled(GLenum cap);
- [DartNoAutoScope] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
- [DartNoAutoScope] GLboolean isProgram(WebGLProgram? program);
- [DartNoAutoScope] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
- [DartNoAutoScope] GLboolean isShader(WebGLShader? shader);
- [DartNoAutoScope] GLboolean isTexture(WebGLTexture? texture);
- [DartNoAutoScope] void lineWidth(GLfloat width);
- [DartNoAutoScope] void linkProgram(WebGLProgram? program);
- [DartNoAutoScope] void pixelStorei(GLenum pname, GLint param);
- [DartNoAutoScope] void polygonOffset(GLfloat factor, GLfloat units);
+ void hint(GLenum target, GLenum mode);
+ GLboolean isBuffer(WebGLBuffer? buffer);
+ GLboolean isContextLost();
+ GLboolean isEnabled(GLenum cap);
+ GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
+ GLboolean isProgram(WebGLProgram? program);
+ GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
+ GLboolean isShader(WebGLShader? shader);
+ GLboolean isTexture(WebGLTexture? texture);
+ void lineWidth(GLfloat width);
+ void linkProgram(WebGLProgram? program);
+ void pixelStorei(GLenum pname, GLint param);
+ void polygonOffset(GLfloat factor, GLfloat units);
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView? pixels);
void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void sampleCoverage(GLclampf value, GLboolean invert);
- [DartNoAutoScope] void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
+ void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
void shaderSource(WebGLShader? shader, DOMString string);
- [DartNoAutoScope] void stencilFunc(GLenum func, GLint ref, GLuint mask);
- [DartNoAutoScope] void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
- [DartNoAutoScope] void stencilMask(GLuint mask);
- [DartNoAutoScope] void stencilMaskSeparate(GLenum face, GLuint mask);
- [DartNoAutoScope] void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
- [DartNoAutoScope] void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+ void stencilFunc(GLenum func, GLint ref, GLuint mask);
+ void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+ void stencilMask(GLuint mask);
+ void stencilMaskSeparate(GLenum face, GLuint mask);
+ void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+ void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
void texParameterf(GLenum target, GLenum pname, GLfloat param);
void texParameteri(GLenum target, GLenum pname, GLint param);
@@ -651,40 +650,55 @@
GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLVideoElement video);
- [DartNoAutoScope] void uniform1f(WebGLUniformLocation? location, GLfloat x);
- [Custom, DartNoAutoScope] void uniform1fv(WebGLUniformLocation? location, Float32Array v);
- [DartNoAutoScope] void uniform1i(WebGLUniformLocation? location, GLint x);
- [Custom, DartNoAutoScope] void uniform1iv(WebGLUniformLocation? location, Int32Array v);
- [DartNoAutoScope] void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
- [Custom, DartNoAutoScope] void uniform2fv(WebGLUniformLocation? location, Float32Array v);
- [DartNoAutoScope] void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
- [Custom, DartNoAutoScope] void uniform2iv(WebGLUniformLocation? location, Int32Array v);
- [DartNoAutoScope] void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
- [Custom, DartNoAutoScope] void uniform3fv(WebGLUniformLocation? location, Float32Array v);
- [DartNoAutoScope] void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
- [Custom, DartNoAutoScope] void uniform3iv(WebGLUniformLocation? location, Int32Array v);
- [DartNoAutoScope] void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- [Custom, DartNoAutoScope] void uniform4fv(WebGLUniformLocation? location, Float32Array v);
- [DartNoAutoScope] void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
- [Custom, DartNoAutoScope] void uniform4iv(WebGLUniformLocation? location, Int32Array v);
+ void uniform1f(WebGLUniformLocation? location, GLfloat x);
+ void uniform1fv(WebGLUniformLocation? location, Float32Array v);
+ void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v);
+ void uniform1i(WebGLUniformLocation? location, GLint x);
+ void uniform1iv(WebGLUniformLocation? location, Int32Array v);
+ void uniform1iv(WebGLUniformLocation? location, sequence<GLint> v);
+ void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
+ void uniform2fv(WebGLUniformLocation? location, Float32Array v);
+ void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v);
+ void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
+ void uniform2iv(WebGLUniformLocation? location, Int32Array v);
+ void uniform2iv(WebGLUniformLocation? location, sequence<GLint> v);
+ void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
+ void uniform3fv(WebGLUniformLocation? location, Float32Array v);
+ void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v);
+ void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
+ void uniform3iv(WebGLUniformLocation? location, Int32Array v);
+ void uniform3iv(WebGLUniformLocation? location, sequence<GLint> v);
+ void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+ void uniform4fv(WebGLUniformLocation? location, Float32Array v);
+ void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v);
+ void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
+ void uniform4iv(WebGLUniformLocation? location, Int32Array v);
+ void uniform4iv(WebGLUniformLocation? location, sequence<GLint> v);
- [Custom, DartNoAutoScope] void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
- [Custom, DartNoAutoScope] void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
- [Custom, DartNoAutoScope] void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array);
- [DartNoAutoScope] void useProgram(WebGLProgram? program);
- [DartNoAutoScope] void validateProgram(WebGLProgram? program);
+ void useProgram(WebGLProgram? program);
+ void validateProgram(WebGLProgram? program);
- [DartNoAutoScope] void vertexAttrib1f(GLuint indx, GLfloat x);
- [Custom, DartNoAutoScope] void vertexAttrib1fv(GLuint indx, Float32Array values);
- [DartNoAutoScope] void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
- [Custom, DartNoAutoScope] void vertexAttrib2fv(GLuint indx, Float32Array values);
- [DartNoAutoScope] void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
- [Custom, DartNoAutoScope] void vertexAttrib3fv(GLuint indx, Float32Array values);
- [DartNoAutoScope] void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- [Custom, DartNoAutoScope] void vertexAttrib4fv(GLuint indx, Float32Array values);
- [DartNoAutoScope] void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized,
+ void vertexAttrib1f(GLuint indx, GLfloat x);
+ void vertexAttrib1fv(GLuint indx, Float32Array values);
+ void vertexAttrib1fv(GLuint indx, sequence<GLfloat> values);
+ void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+ void vertexAttrib2fv(GLuint indx, Float32Array values);
+ void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values);
+ void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+ void vertexAttrib3fv(GLuint indx, Float32Array values);
+ void vertexAttrib3fv(GLuint indx, sequence<GLfloat> values);
+ void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+ void vertexAttrib4fv(GLuint indx, Float32Array values);
+ void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
+ void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized,
GLsizei stride, GLintptr offset);
- [DartNoAutoScope] void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
+ void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
};
diff --git a/modules/webgl/WebGLSampler.idl b/modules/webgl/WebGLSampler.idl
new file mode 100644
index 0000000..565f3d6
--- /dev/null
+++ b/modules/webgl/WebGLSampler.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=UnsafeES3APIs,
+ WillBeGarbageCollected
+] interface WebGLSampler {
+};
\ No newline at end of file
diff --git a/core/html/canvas/WebGLShader.idl b/modules/webgl/WebGLShader.idl
similarity index 100%
rename from core/html/canvas/WebGLShader.idl
rename to modules/webgl/WebGLShader.idl
diff --git a/core/html/canvas/WebGLShaderPrecisionFormat.idl b/modules/webgl/WebGLShaderPrecisionFormat.idl
similarity index 100%
rename from core/html/canvas/WebGLShaderPrecisionFormat.idl
rename to modules/webgl/WebGLShaderPrecisionFormat.idl
diff --git a/modules/webgl/WebGLSync.idl b/modules/webgl/WebGLSync.idl
new file mode 100644
index 0000000..a401e20
--- /dev/null
+++ b/modules/webgl/WebGLSync.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=UnsafeES3APIs,
+ WillBeGarbageCollected
+] interface WebGLSync {
+};
\ No newline at end of file
diff --git a/core/html/canvas/WebGLTexture.idl b/modules/webgl/WebGLTexture.idl
similarity index 100%
rename from core/html/canvas/WebGLTexture.idl
rename to modules/webgl/WebGLTexture.idl
diff --git a/modules/webgl/WebGLTransformFeedback.idl b/modules/webgl/WebGLTransformFeedback.idl
new file mode 100644
index 0000000..bdf26ab
--- /dev/null
+++ b/modules/webgl/WebGLTransformFeedback.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=UnsafeES3APIs,
+ WillBeGarbageCollected
+] interface WebGLTransformFeedback {
+};
\ No newline at end of file
diff --git a/core/html/canvas/WebGLUniformLocation.idl b/modules/webgl/WebGLUniformLocation.idl
similarity index 100%
rename from core/html/canvas/WebGLUniformLocation.idl
rename to modules/webgl/WebGLUniformLocation.idl
diff --git a/modules/webgl/WebGLVertexArrayObject.idl b/modules/webgl/WebGLVertexArrayObject.idl
new file mode 100644
index 0000000..bb7ad25
--- /dev/null
+++ b/modules/webgl/WebGLVertexArrayObject.idl
@@ -0,0 +1,9 @@
+// Copyright 2015 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=UnsafeES3APIs,
+ WillBeGarbageCollected
+] interface WebGLVertexArrayObject {
+};
diff --git a/core/html/canvas/WebGLVertexArrayObjectOES.idl b/modules/webgl/WebGLVertexArrayObjectOES.idl
similarity index 100%
rename from core/html/canvas/WebGLVertexArrayObjectOES.idl
rename to modules/webgl/WebGLVertexArrayObjectOES.idl
diff --git a/modules/webmidi/MIDIAccess.idl b/modules/webmidi/MIDIAccess.idl
index 19c18c6..a65381d 100644
--- a/modules/webmidi/MIDIAccess.idl
+++ b/modules/webmidi/MIDIAccess.idl
@@ -29,14 +29,12 @@
*/
[
- NoInterfaceObject,
- ActiveDOMObject
+ ActiveDOMObject,
] interface MIDIAccess : EventTarget {
readonly attribute MIDIInputMap inputs;
readonly attribute MIDIOutputMap outputs;
readonly attribute boolean sysexEnabled;
- attribute EventHandler onconnect;
- attribute EventHandler ondisconnect;
+ attribute EventHandler onstatechange;
};
diff --git a/modules/webmidi/MIDIConnectionEvent.idl b/modules/webmidi/MIDIConnectionEvent.idl
index b53a633..73a77a3 100644
--- a/modules/webmidi/MIDIConnectionEvent.idl
+++ b/modules/webmidi/MIDIConnectionEvent.idl
@@ -28,9 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://webaudio.github.io/web-midi-api/#idl-def-MIDIConnectionEvent
+
[
- EventConstructor,
- RuntimeEnabled=WebMIDI,
+ Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict),
] interface MIDIConnectionEvent : Event {
- [InitializedByEventConstructor] readonly attribute MIDIPort port;
+ readonly attribute MIDIPort port;
};
diff --git a/modules/webmidi/MIDIConnectionEventInit.idl b/modules/webmidi/MIDIConnectionEventInit.idl
new file mode 100644
index 0000000..3e539ce
--- /dev/null
+++ b/modules/webmidi/MIDIConnectionEventInit.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.
+
+// http://webaudio.github.io/web-midi-api/#idl-def-MIDIConnectionEventInit
+
+dictionary MIDIConnectionEventInit : EventInit {
+ MIDIPort port;
+};
diff --git a/modules/webmidi/MIDIErrorCallback.idl b/modules/webmidi/MIDIErrorCallback.idl
deleted file mode 100644
index 4cf5308..0000000
--- a/modules/webmidi/MIDIErrorCallback.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-callback interface MIDIErrorCallback {
- void handleEvent(DOMError error);
-};
diff --git a/modules/webmidi/MIDIInput.idl b/modules/webmidi/MIDIInput.idl
index 4986c54..31a0627 100644
--- a/modules/webmidi/MIDIInput.idl
+++ b/modules/webmidi/MIDIInput.idl
@@ -29,7 +29,6 @@
*/
[
- NoInterfaceObject,
SetWrapperReferenceTo(MIDIAccess midiAccess),
] interface MIDIInput : MIDIPort {
attribute EventHandler onmidimessage;
diff --git a/modules/webmidi/MIDIInputMap.idl b/modules/webmidi/MIDIInputMap.idl
index e165c99..86ff124 100644
--- a/modules/webmidi/MIDIInputMap.idl
+++ b/modules/webmidi/MIDIInputMap.idl
@@ -6,17 +6,8 @@
// callback ForEachCallback = void(DOMString id, MIDIInput port);
[
- Iterable,
- NoInterfaceObject,
GarbageCollected,
] interface MIDIInputMap {
readonly attribute unsigned long size;
- Iterator keys();
- Iterator entries();
- Iterator values();
- // This function returns undefined if |!this->has(id)|.
- [ImplementedAs=getForBinding, CallWith=ScriptState] any get(DOMString id);
- boolean has(DOMString key);
- // FIXME: Implement forEach.
- // void forEach (ForEachCallback callback);
+ readonly maplike<DOMString, MIDIInput>;
};
diff --git a/modules/webmidi/MIDIMessageEvent.idl b/modules/webmidi/MIDIMessageEvent.idl
index 2145c0a..bf252c0 100644
--- a/modules/webmidi/MIDIMessageEvent.idl
+++ b/modules/webmidi/MIDIMessageEvent.idl
@@ -28,12 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// FIXME: The spec doesn't provide details about constructor, yet.
-// See also, https://github.com/WebAudio/web-midi-api/issues/1 .
+// http://webaudio.github.io/web-midi-api/#idl-def-MIDIMessageEvent
+
[
- EventConstructor,
- RuntimeEnabled=WebMIDI,
+ Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict),
] interface MIDIMessageEvent : Event {
- [InitializedByEventConstructor] readonly attribute double receivedTime;
- [InitializedByEventConstructor] readonly attribute Uint8Array data;
+ readonly attribute double receivedTime;
+ readonly attribute Uint8Array data;
};
diff --git a/modules/webmidi/MIDIMessageEventInit.idl b/modules/webmidi/MIDIMessageEventInit.idl
new file mode 100644
index 0000000..4c9e046
--- /dev/null
+++ b/modules/webmidi/MIDIMessageEventInit.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.
+
+// http://webaudio.github.io/web-midi-api/#idl-def-MIDIMessageEventInit
+
+dictionary MIDIMessageEventInit : EventInit {
+ double receivedTime;
+ Uint8Array data;
+};
diff --git a/modules/webmidi/MIDIOptions.idl b/modules/webmidi/MIDIOptions.idl
index 447e6cd..4be1426 100644
--- a/modules/webmidi/MIDIOptions.idl
+++ b/modules/webmidi/MIDIOptions.idl
@@ -4,8 +4,6 @@
// http://www.w3.org/TR/webmidi/#midioptions-dictionary
-[
- GarbageCollected
-] dictionary MIDIOptions {
+dictionary MIDIOptions {
boolean sysex;
};
diff --git a/modules/webmidi/MIDIOutput.idl b/modules/webmidi/MIDIOutput.idl
index a41bcfb..58a8635 100644
--- a/modules/webmidi/MIDIOutput.idl
+++ b/modules/webmidi/MIDIOutput.idl
@@ -32,9 +32,9 @@
// http://cwilso.github.io/web-midi-api/#idl-def-MIDIOutput
[
- NoInterfaceObject,
SetWrapperReferenceTo(MIDIAccess midiAccess),
] interface MIDIOutput : MIDIPort {
+ // TODO(toyoshim): implement void clear()
[RaisesException] void send(Uint8Array data, optional double timestamp);
[RaisesException] void send(sequence<unsigned long> data, optional double timestamp);
};
diff --git a/modules/webmidi/MIDIOutputMap.idl b/modules/webmidi/MIDIOutputMap.idl
index eec7a88..546f074 100644
--- a/modules/webmidi/MIDIOutputMap.idl
+++ b/modules/webmidi/MIDIOutputMap.idl
@@ -6,17 +6,8 @@
// callback ForEachCallback = void(DOMString id, MIDIOutput port);
[
- Iterable,
- NoInterfaceObject,
GarbageCollected,
] interface MIDIOutputMap {
readonly attribute unsigned long size;
- Iterator keys();
- Iterator entries();
- Iterator values();
- // This function returns undefined if |!this->has(id)|.
- [ImplementedAs=getForBinding, CallWith=ScriptState] any get(DOMString id);
- boolean has(DOMString key);
- // FIXME: Implement forEach.
- // void forEach (ForEachCallback callback);
+ readonly maplike<DOMString, MIDIOutput>;
};
diff --git a/modules/webmidi/MIDIPort.idl b/modules/webmidi/MIDIPort.idl
index 902c825..726fd01 100644
--- a/modules/webmidi/MIDIPort.idl
+++ b/modules/webmidi/MIDIPort.idl
@@ -28,20 +28,36 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+enum MIDIPortConnectionState {
+ "open",
+ "closed",
+ "pending"
+};
+
+enum MIDIPortDeviceState {
+ "disconnected",
+ "connected"
+};
+
enum MIDIPortType {
"input",
"output"
};
[
- NoInterfaceObject,
- GarbageCollected
+ ActiveDOMObject,
+ GarbageCollected,
] interface MIDIPort : EventTarget {
+ readonly attribute MIDIPortConnectionState connection;
readonly attribute DOMString id;
readonly attribute DOMString manufacturer;
readonly attribute DOMString name;
+ readonly attribute MIDIPortDeviceState state;
readonly attribute MIDIPortType type;
readonly attribute DOMString version;
- attribute EventHandler ondisconnect;
+ attribute EventHandler onstatechange;
+
+ [CallWith=ScriptState] Promise open();
+ [CallWith=ScriptState] Promise close();
};
diff --git a/modules/webmidi/MIDISuccessCallback.idl b/modules/webmidi/MIDISuccessCallback.idl
deleted file mode 100644
index b19f532..0000000
--- a/modules/webmidi/MIDISuccessCallback.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-callback interface MIDISuccessCallback {
- // FIXME: The second argument should be Dictionary, but IDL generator
- // can not handle Dictionary as a handleEvent argument correctly now.
- // http://crbug.com/246161
- void handleEvent(MIDIAccess access, boolean sysex);
-};
diff --git a/modules/webmidi/NavigatorWebMIDI.idl b/modules/webmidi/NavigatorWebMIDI.idl
index ba26473..6f4f7b5 100644
--- a/modules/webmidi/NavigatorWebMIDI.idl
+++ b/modules/webmidi/NavigatorWebMIDI.idl
@@ -28,9 +28,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- RuntimeEnabled=WebMIDI,
-] partial interface Navigator {
- // FIXMEDART: Remove the DartSuppress once Dart support Blink Promises.
- [CallWith=ScriptState, DartSuppress] Promise requestMIDIAccess(optional MIDIOptions options);
+partial interface Navigator {
+ [CallWith=ScriptState, MeasureAs=RequestMIDIAccess] Promise requestMIDIAccess(optional MIDIOptions options);
};
diff --git a/modules/websockets/CloseEvent.idl b/modules/websockets/CloseEvent.idl
index be0f1e3..7371ad9 100644
--- a/modules/websockets/CloseEvent.idl
+++ b/modules/websockets/CloseEvent.idl
@@ -28,11 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- EventConstructor,
-] interface CloseEvent : Event {
- [InitializedByEventConstructor] readonly attribute boolean wasClean;
- [InitializedByEventConstructor] readonly attribute unsigned short code;
- [InitializedByEventConstructor] readonly attribute DOMString reason;
-};
+// https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
+[
+ Constructor(DOMString type, optional CloseEventInit eventInitDict),
+ Exposed=(Window,Worker),
+] interface CloseEvent : Event {
+ readonly attribute boolean wasClean;
+ readonly attribute unsigned short code;
+ readonly attribute DOMString reason;
+};
diff --git a/modules/websockets/CloseEventInit.idl b/modules/websockets/CloseEventInit.idl
new file mode 100644
index 0000000..ff5c9e8
--- /dev/null
+++ b/modules/websockets/CloseEventInit.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.
+
+// https://html.spec.whatwg.org/multipage/comms.html#the-closeevent-interfaces
+
+dictionary CloseEventInit : EventInit {
+ boolean wasClean;
+ unsigned short code;
+ DOMString reason;
+};
diff --git a/modules/websockets/WebSocket.idl b/modules/websockets/WebSocket.idl
index c2a343c..47a8c2e 100644
--- a/modules/websockets/WebSocket.idl
+++ b/modules/websockets/WebSocket.idl
@@ -29,24 +29,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/html5/websockets/#websocket
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#websocket
+// https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
-// FIXME: use BinaryType in binaryType
enum BinaryType { "blob", "arraybuffer" };
[
ActiveDOMObject,
- // FIXME: should be optional union type http://crbug.com/240176
- Constructor(DOMString url, optional DOMString protocol),
- Constructor(DOMString url, sequence<DOMString> protocols),
+ // FIXME: Spec has DOMString[]. https://www.w3.org/Bugs/Public/show_bug.cgi?id=28102
+ Constructor(DOMString url, optional (DOMString or sequence<DOMString>) protocols),
ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker),
+ TypeChecking=Interface,
RaisesException=Constructor,
GarbageCollected,
ImplementedAs=DOMWebSocket,
] interface WebSocket : EventTarget {
- [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
@@ -58,17 +55,17 @@
readonly attribute unsigned long bufferedAmount;
// networking
- attribute EventHandler onopen;
- attribute EventHandler onerror;
- attribute EventHandler onclose;
- [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString extensions;
- [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString protocol;
- [RaisesException] void close([Clamp] optional unsigned short code, optional DOMString reason);
+ attribute EventHandler onopen;
+ attribute EventHandler onerror;
+ attribute EventHandler onclose;
+ readonly attribute DOMString extensions;
+ readonly attribute DOMString protocol;
+ [RaisesException] void close([Clamp] optional unsigned short code, optional USVString reason);
// messaging
- attribute EventHandler onmessage;
- attribute DOMString binaryType;
- [RaisesException] void send(DOMString data);
+ attribute EventHandler onmessage;
+ attribute BinaryType binaryType;
+ [RaisesException] void send(USVString data);
[RaisesException] void send(Blob data);
[RaisesException] void send(ArrayBuffer data);
[RaisesException] void send(ArrayBufferView data);