Chrome 63 roll with specific FIXMEDART Changes.
diff --git a/bindings/IDLExtendedAttributes.txt b/bindings/IDLExtendedAttributes.txt
index 58e04ee..e6a6cf3 100644
--- a/bindings/IDLExtendedAttributes.txt
+++ b/bindings/IDLExtendedAttributes.txt
@@ -5,7 +5,7 @@
# If you would like to add a new extended attribute or value, please:
# (1) add the extended attribute or value to this file
# (2) add an explanation to the Blink IDL extended attributes document:
-# idl-extended-attributes.md (in this directory)
+# IDLExtendedAttributes.md (in this directory)
# (3) add appropriate test cases to run-bindings-tests
#
# The syntax of this file is as follows:
@@ -31,18 +31,24 @@
# arbitrary, but that "X" is standard, e.g. [Attr=X], [Attr=Foo].
#
+ActiveScriptWrappable
+AllowShared
+CEReactions
+CachedAccessor
CachedAttribute=*
-CallWith=ExecutionContext|ScriptState|ScriptArguments|ActiveWindow|FirstWindow|ThisValue
+CallWith=ExecutionContext|ScriptState|ScriptArguments|CurrentWindow|EnteredWindow|ThisValue
CheckSecurity=Receiver|ReturnValue
Clamp
Constructor
# FIXME: remove [ConstructorCallWith=Document], as can instead use
# [ConstructorCallWith=ExecutionContext] + toDocument(executionContext)
ConstructorCallWith=ExecutionContext|ScriptState|Document
-Custom=|Getter|Setter|LegacyCallAsFunction|VisitDOMWrapper|PropertyGetter|PropertyEnumerator|PropertyQuery|CallPrologue|CallEpilogue
+ContextEnabled=*
+CrossOrigin=|Getter|Setter
+Custom=|Getter|Setter|LegacyCallAsFunction|PropertyGetter|PropertyEnumerator|PropertyQuery|CallPrologue|CallEpilogue
CustomConstructor
CustomElementCallbacks
-# Dartium specific attributes.
+# FIXMEDART: Dartium specific attributes.
# DartCustom can have no value or New if New an additional method is added (V8 will not see this method)
DartCustom=|New|Setter|Getter
# DartName should have the alias name to be used to resolve.
@@ -65,18 +71,18 @@
DependentLifetime
DeprecateAs=*
DoNotCheckConstants
-DoNotCheckSecurity=|Setter
-DoNotCheckSignature
+DoNotTestNewObject
EnforceRange
Exposed=*
+FeaturePolicy=*
FlexibleArrayBufferView
-GarbageCollected
Global=|*
+HTMLConstructor
+ImmutablePrototype
ImplementedAs=*
-ImplementedInPrivateScript
-Iterable
LegacyInterfaceTypeChecking
LegacyTreatAsPartialInterface
+LegacyUnenumerableNamedProperties
LenientThis
LogActivity=|GetterOnly|SetterOnly
LogAllWorlds
@@ -84,10 +90,8 @@
Measure
MeasureAs=*
NamedConstructor=*
-NoImplHeader
NoInterfaceObject
NotEnumerable
-OnlyExposedToPrivateScript
OriginTrialEnabled=*
OverrideBuiltins
PartialInterfaceImplementedAs=*
@@ -104,15 +108,17 @@
ReflectOnly=*
Replaceable
# Valid values for [RuntimeEnabled] are the Runtime Enabled Features, listed in
-# Source/core/page/RuntimeEnabledFeatures.in
+# Source/platform/runtime_enabled_features.json5
RuntimeEnabled=*
+# Valid values for [RuntimeCallStatsCounter] are counters defined in
+# Source/platform/bindings/RuntimeCallStats.h
+RuntimeCallStatsCounter=*
SameObject
-SetWrapperReferenceFrom=*
-SetWrapperReferenceTo=*
-SetterCallWith=ExecutionContext|ScriptArguments|ActiveWindow|FirstWindow
+SaveSameObject
+SecureContext
+SetterCallWith=ExecutionContext|ScriptArguments|CurrentWindow|EnteredWindow
TreatNullAs=NullString|EmptyString
-TreatUndefinedAs=NullString
URL
Unforgeable
-Unscopeable
-WillBeGarbageCollected
+Unscopable
+WebAgentAPI
diff --git a/bindings/PRESUBMIT.py b/bindings/PRESUBMIT.py
index 605322d..32d9c44 100644
--- a/bindings/PRESUBMIT.py
+++ b/bindings/PRESUBMIT.py
@@ -32,6 +32,9 @@
for more details about the presubmit API built into gcl.
"""
+# Make sure binding templates are considered as source files.
+WHITE_LIST = (r'.+\.tmpl$',)
+
# Changes to v8/ do not change generated code or tests, so exclude from
# _RunBindingsTests
BLACK_LIST = (r'.*\bv8[\\\/].*',)
@@ -39,7 +42,8 @@
def _RunBindingsTests(input_api, output_api):
# Skip if nothing to do
source_filter = lambda x: input_api.FilterSourceFile(
- x, black_list=input_api.DEFAULT_BLACK_LIST + BLACK_LIST)
+ x, white_list=input_api.DEFAULT_WHITE_LIST + WHITE_LIST,
+ black_list=input_api.DEFAULT_BLACK_LIST + BLACK_LIST)
if not input_api.AffectedFiles(file_filter=source_filter):
return []
@@ -56,6 +60,8 @@
cmd = [input_api.python_executable, run_bindings_tests_path]
else:
cmd = [run_bindings_tests_path]
+ if not input_api.verbose:
+ cmd.append('--suppress-diff')
test_cmd = input_api.Command(
name=cmd_name,
cmd=cmd,
diff --git a/bindings/dart/gyp/scripts/build_dart_snapshot.py b/bindings/dart/gyp/scripts/build_dart_snapshot.py
deleted file mode 100755
index e9e677c..0000000
--- a/bindings/dart/gyp/scripts/build_dart_snapshot.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/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.
-#
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# build_dart_snapshot.py generates two C++ files: DartSnapshot.cpp
-# with a constant which is a snapshot of major DOM libs an
-# DartResolver.cpp which is a resolver for dart:html library.
-
-import os.path
-import subprocess
-import sys
-
-
-def main(args):
- assert(len(args) >= 4)
- dartPath = args[1]
- dartSnapshotTemplateFile = args[2]
- outputFilePath = args[3]
- genSnapshotBinPath = args[4]
- snapshottedLibPaths = args[5:]
-
- def path(*components):
- return os.path.abspath(os.path.join(*components))
-
- def dartName(path):
- # Translates <dirs>/foo_dartium.dart into foo.
- return (os.path.splitext(os.path.split(path)[1])[0]
- .replace('_dartium', ''))
-
- snapshottedLibs = [(dartName(p), path(p))
- for p in snapshottedLibPaths]
-
- # Generate a Dart script to build the snapshot from.
- snapshotScriptName = os.path.join(outputFilePath, 'snapshotScript.dart')
- with file(snapshotScriptName, 'w') as snapshotScript:
- snapshotScript.write('library snapshot;\n')
- for name, _ in snapshottedLibs:
- # 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')
-
- 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),
- '--snapshot_kind=core',
- '--vm_output_bin=%s' % binaryVmIsolateSnapshotFile,
- '--isolate_output_bin=%s' % binaryIsolateSnapshotFile,
- '--script=%s' % snapshotScriptName,
- ]
- command.extend(['--url_mapping=dart:%s,%s' % lib for lib in snapshottedLibs])
-
- pipe = subprocess.Popen(command,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- out, error = pipe.communicate()
- if (pipe.returncode != 0):
- raise Exception('Snapshot bin generation failed: %s/%s' % (out, error))
-
- # Build a command to generate the snapshot file.
- command = [
- 'python',
- path(dartPath, 'runtime', 'tools', 'create_snapshot_file.py'),
- '--input_cc=%s' % dartSnapshotTemplateFile,
- '--vm_input_bin=%s' % binaryVmIsolateSnapshotFile,
- '--input_bin=%s' % binaryIsolateSnapshotFile,
- '--output=%s' % path(outputFilePath, 'DartSnapshot.bytes'),
- ]
-
- pipe = subprocess.Popen(command,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- out, error = pipe.communicate()
- if (pipe.returncode != 0):
- raise Exception('Snapshot file generation failed: %s/%s' % (out, error))
-
- snapshotSizeInBytes = os.path.getsize(binaryIsolateSnapshotFile)
- productDir = os.path.dirname(genSnapshotBinPath)
- snapshotSizeOutputPath = os.path.join(productDir, 'snapshot-size.txt')
- with file(snapshotSizeOutputPath, 'w') as snapshotSizeFile:
- snapshotSizeFile.write('%d\n' % snapshotSizeInBytes)
-
- return 0
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/bindings/dart/gyp/scripts/create_resources.py b/bindings/dart/gyp/scripts/create_resources.py
deleted file mode 100644
index 3b6b992..0000000
--- a/bindings/dart/gyp/scripts/create_resources.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-#
-# This python script creates string literals in a C++ source file from a C++
-# source template and one or more resource files.
-
-import os
-import sys
-from os.path import join
-import time
-from optparse import OptionParser
-import re
-from datetime import date
-
-
-def makeResources(root_dir, input_files):
- result = ''
- resources = []
-
- # Write each file's contents as a byte string constant.
- for resource_file in input_files:
- if root_dir and resource_file.startswith(root_dir):
- resource_file_name = resource_file[len(root_dir):]
- else:
- resource_file_name = resource_file
- resource_url = '/%s' % resource_file_name
- result += '// %s\n' % resource_file
- result += 'const char '
- resource_name = re.sub(r'(/|\.|-)', '_', resource_file_name) + '_'
- result += resource_name
- result += '[] = {\n '
- fileHandle = open(resource_file, 'rb')
- lineCounter = 0
- for byte in fileHandle.read():
- result += r" '\x%02x'," % ord(byte)
- lineCounter += 1
- if lineCounter == 10:
- result += '\n '
- lineCounter = 0
- if lineCounter != 0:
- result += '\n '
- result += ' 0\n};\n\n'
- resources.append(
- (resource_url, resource_name, os.stat(resource_file).st_size))
-
- # Write the resource table.
- result += 'Resources::resource_map_entry Resources::builtin_resources_[] = '
- result += '{\n'
- for res in resources:
- result += ' { "%s", %s, %d },\n' % res
- result += '};\n\n'
- result += 'const intptr_t Resources::builtin_resources_count_ '
- result += '= %d;\n' % len(resources)
- return result
-
-
-def makeFile(output_file, root_dir, input_files):
- cc_text = '''
-// Copyright (c) %d, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-''' % date.today().year
- cc_text += '#if defined(new)\n'
- cc_text += '#undef new\n'
- cc_text += '#endif\n\n'
- cc_text += '#if defined(delete)\n'
- cc_text += '#undef delete\n'
- cc_text += '#endif\n\n'
- cc_text += '#ifndef NDEBUG\n'
- cc_text += '#define DEBUG\n'
- cc_text += '#endif\n'
- cc_text += '#include "bin/resources.h"\n\n'
- cc_text += 'namespace dart {\n'
- cc_text += 'namespace bin {\n'
- cc_text += makeResources(root_dir, input_files)
- cc_text += '} // namespace bin\n} // namespace dart\n'
- open(output_file, 'w').write(cc_text)
- return True
-
-
-def main(args):
- try:
- # Parse input.
- parser = OptionParser()
- parser.add_option("--output",
- action="store", type="string",
- help="output file name")
- parser.add_option("--root_prefix",
- action="store", type="string",
- help="root directory for resources")
- (options, args) = parser.parse_args()
- if not options.output:
- sys.stderr.write('--output not specified\n')
- return -1
- if len(args) == 0:
- sys.stderr.write('No input files specified\n')
- return -1
-
- files = []
- for arg in args:
- files.append(arg)
-
- if not makeFile(options.output, options.root_prefix, files):
- return -1
-
- return 0
- except Exception, inst:
- sys.stderr.write('create_resources.py exception\n')
- sys.stderr.write(str(inst))
- sys.stderr.write('\n')
- return -1
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/bindings/dart/gyp/scripts/dart_action_derivedsourcesallinone.py b/bindings/dart/gyp/scripts/dart_action_derivedsourcesallinone.py
deleted file mode 100644
index 969ffa6..0000000
--- a/bindings/dart/gyp/scripts/dart_action_derivedsourcesallinone.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/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.
-#
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# dart_action_derivedsourceslist.py generates a single or several cpp files
-# that include all Dart bindings cpp files generated from idls.
-#
-# usage: dart_action_derivedsourceslist.py IDL_FILES_LIST -- OUTPUT_FILE1 OUTPUT_FILE2 ...
-#
-# Note that IDL_FILES_LIST is a text file containing the IDL file paths.
-
-import os.path
-import re
-import sys
-
-v8scriptPath = os.path.join(sys.path[0], '../../../../WebCore.gyp/scripts')
-sys.path.append(v8scriptPath)
-
-# FIXME: there are couple of very ugly hacks like duplication of main code and
-# regexp to rewrite V8 prefix to Dart. It all can be easily solved with minimal
-# modifications to action_derivedsourcesallinone.py.
-import action_derivedsourcesallinone as base
-
-
-def main(args):
- assert(len(args) > 3)
- inOutBreakIndex = args.index('--')
- inputFileName = args[1]
- outputFileNames = args[inOutBreakIndex + 1:]
-
- inputFile = open(inputFileName, 'r')
- idlFileNames = inputFile.read().split('\n')
- inputFile.close()
-
- filesMetaData = base.extractMetaData(idlFileNames)
- for fileName in outputFileNames:
- partition = outputFileNames.index(fileName)
- fileContents = base.generateContent(filesMetaData, partition, len(outputFileNames))
- # FIXME: ugly hack---change V8 prefix to Dart.
- fileContents = re.sub('\n#include "bindings/V8', '\n#include "bindings/Dart', fileContents)
- base.writeContent(fileContents, fileName)
-
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/bindings/dart/gyp/scripts/dart_html_lib_deps.py b/bindings/dart/gyp/scripts/dart_html_lib_deps.py
deleted file mode 100644
index ff534f0..0000000
--- a/bindings/dart/gyp/scripts/dart_html_lib_deps.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/python
-#
-# 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.
-#
-# Copyright (c) 2012 The Chromium 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 fnmatch
-import os
-import sys
-
-
-def printAllFilesRecursively(directory, pattern):
- def matches(basename): return fnmatch.fnmatch(basename, pattern)
- for root, _, files in os.walk(directory):
- for basename in filter(matches, files):
- # gyp operates correctly only on /, not Windows \.
- print os.path.join(root, basename).replace(os.sep, '/')
-
-
-
-def main(args):
- dart_html_lib_dir = args[1]
-
- deps = [
- ('idl', '*.idl'),
- ('scripts', '*.py'),
- ('src', '*.dart'),
- ('templates', '*.*template'),
- ]
-
- for directory, pattern in deps:
- printAllFilesRecursively(os.path.join(dart_html_lib_dir, directory), pattern)
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
diff --git a/bindings/dart/gyp/scripts/generate_dart_bindings.py b/bindings/dart/gyp/scripts/generate_dart_bindings.py
deleted file mode 100755
index a57881d..0000000
--- a/bindings/dart/gyp/scripts/generate_dart_bindings.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python
-#
-# 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.
-
-import glob
-import os.path
-import sys
-import tempfile
-
-def main(args):
- assert(len(args) == 6)
- idlListFileName = args[1]
- dartiumScriptDir = args[2]
- dartScriptDir = args[3]
- outputFilePath = args[4]
- featureDefines = args[5]
-
- # Clear out any stale dart/lib/html/scripts/.pyc files that are lurking.
- for f in glob.glob(os.path.join(dartScriptDir, '*.pyc')):
- os.remove(f)
-
- baseDir = os.path.dirname(dartiumScriptDir)
- idlListFile = open(idlListFileName, 'r')
- idlFiles = [os.path.join(baseDir, fileName.strip()) for fileName in idlListFile]
- idlListFile.close()
-
- def analyse(featureDef):
- featureDef = featureDef.strip('"')
- if '=' not in featureDef: return None
- feature, status = featureDef.split('=')
- if status == '1':
- return feature
- return None
-
- featureDefines = filter(None, map(analyse, featureDefines.split()))
-
- sys.path.insert(0, dartScriptDir)
- import fremontcutbuilder
- import dartdomgenerator
-
- database = fremontcutbuilder.build_database(idlFiles, tempfile.mkdtemp(), feature_defines=featureDefines)
- database.Load()
- dartdomgenerator.GenerateFromDatabase(database, None, outputFilePath)
- database.Delete()
-
- return 0
-
-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 4b71743..5619f48 100755
--- a/bindings/scripts/aggregate_generated_bindings.py
+++ b/bindings/scripts/aggregate_generated_bindings.py
@@ -32,28 +32,29 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Generate aggregate .cpp files that include multiple V8 binding .cpp files.
+"""Generates a .cpp file that includes all V8 binding .cpp files for interfaces.
-This can be a single output file, to preserve symbol space; or multiple output
-files, to reduce maximum compilation unit size and allow parallel compilation.
+It is expected to preserve symbol space, and to be acceptable to make static
+build on Windows.
Usage:
-aggregate_generated_bindings.py COMPONENT_DIR IDL_FILES_LIST -- OUTPUT_FILE1 OUTPUT_FILE2 ...
+ $ aggregate_generated_bindings.py --component COMPONENT IDL_FILES_LIST OUTPUT_FILE
-COMPONENT_DIR is the relative directory of a component, e.g., 'core', 'modules'.
-IDL_FILES_LIST is a text file containing the IDL file paths, so the command
-line doesn't exceed OS length limits.
-OUTPUT_FILE1 etc. are filenames of output files.
+ COMPONENT is the relative directory of a component, e.g., 'core', 'modules'.
+ IDL_FILES_LIST is a text file containing the IDL file paths
+ OUTPUT_FILE is the filename of output file.
-Design doc: http://www.chromium.org/developers/design-documents/idl-build
+ Design doc: http://www.chromium.org/developers/design-documents/idl-build
"""
import errno
+import optparse
import os
import re
import sys
-
-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
+from utilities import idl_filename_to_basename
+from utilities import read_idl_files_list_from_file
+from utilities import to_snake_case
COPYRIGHT_TEMPLATE = """/*
* THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
@@ -85,49 +86,32 @@
*/
"""
+def parse_options():
+ parser = optparse.OptionParser()
+ parser.add_option('--component')
+ # TODO(tkent): Remove the option after the great mv. crbug.com/760462
+ parser.add_option('--snake-case-generated-files',
+ action='store_true', default=False)
-def extract_meta_data(file_paths):
- """Extracts interface name from each IDL file."""
- meta_data_list = []
+ options, args = parser.parse_args()
+ if len(args) < 2:
+ raise Exception('Expected 2 filenames; one is for input, and the other is for output.')
- for file_path in file_paths:
- if not file_path.endswith('.idl'):
- print 'WARNING: non-IDL file passed: "%s"' % file_path
- continue
- if not os.path.exists(file_path):
- 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 = {
- 'name': interface_name,
- }
- meta_data_list.append(meta_data)
-
- return meta_data_list
+ return options, args
-def generate_content(component_dir, aggregate_partial_interfaces, files_meta_data_this_partition):
+def generate_content(component, basenames, snake_case_generated_files):
# Add fixed content.
output = [COPYRIGHT_TEMPLATE,
'#define NO_IMPLICIT_ATOMICSTRING\n\n']
- # List all includes.
- files_meta_data_this_partition.sort()
- for meta_data in files_meta_data_this_partition:
- 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))
+ basenames.sort()
+ if snake_case_generated_files:
+ output.extend('#include "bindings/%s/v8/v8_%s.cc"\n' % (component, to_snake_case(basename))
+ for basename in basenames)
+ else:
+ output.extend('#include "bindings/%s/v8/V8%s.cpp"\n' % (component, basename)
+ for basename in basenames)
return ''.join(output)
@@ -141,33 +125,16 @@
f.write(content)
-def main(args):
- if len(args) <= 4:
- raise Exception('Expected at least 5 arguments.')
- 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,
- is_gyp_format=True)
- 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):
- files_meta_data_this_partition = [
- meta_data for meta_data in files_meta_data
- if hash(meta_data['name']) % total_partitions == partition]
- file_contents = generate_content(component_dir,
- aggregate_partial_interfaces,
- files_meta_data_this_partition)
- write_content(file_contents, file_name)
+def main():
+ options, filenames = parse_options()
+ component = options.component
+ idl_filenames = read_idl_files_list_from_file(filenames[0],
+ is_gyp_format=False)
+ basenames = [idl_filename_to_basename(file_path)
+ for file_path in idl_filenames]
+ file_contents = generate_content(component, basenames, options.snake_case_generated_files)
+ write_content(file_contents, filenames[1])
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ sys.exit(main())
diff --git a/bindings/scripts/blink_idl_lexer.py b/bindings/scripts/blink_idl_lexer.py
index 31a71ff..c14b145 100644
--- a/bindings/scripts/blink_idl_lexer.py
+++ b/bindings/scripts/blink_idl_lexer.py
@@ -70,25 +70,9 @@
from idl_parser.idl_lexer import IDLLexer
LEXTAB = 'lextab'
-REMOVE_TOKENS = ['COMMENT']
class BlinkIDLLexer(IDLLexer):
- # ignore comments
- def t_COMMENT(self, t):
- r'(/\*(.|\n)*?\*/)|(//.*(\n[ \t]*//.*)*)'
- self.AddLines(t.value.count('\n'))
-
- # Analogs to _AddToken/_AddTokens in base lexer
- # Needed to remove COMMENT token, since comments ignored
- def _RemoveToken(self, token):
- if token in self.tokens:
- self.tokens.remove(token)
-
- def _RemoveTokens(self, tokens):
- for token in tokens:
- self._RemoveToken(token)
-
def __init__(self, debug=False, optimize=True, outputdir=None,
rewrite_tables=False):
if debug:
@@ -115,8 +99,6 @@
lextab = None
IDLLexer.__init__(self)
- # Overrides to parent class
- self._RemoveTokens(REMOVE_TOKENS)
# Optimized mode substantially decreases startup time (by disabling
# error checking), and also allows use of Python's optimized mode.
# See: Optimized Mode
diff --git a/bindings/scripts/blink_idl_parser.py b/bindings/scripts/blink_idl_parser.py
index 55c3e5f..be8030c 100644
--- a/bindings/scripts/blink_idl_parser.py
+++ b/bindings/scripts/blink_idl_parser.py
@@ -53,6 +53,7 @@
#
# Disable attribute validation, as lint can't import parent class to check
# pylint: disable=E1101
+#
import os.path
import sys
@@ -67,315 +68,14 @@
# Base parser is in Chromium src/tools/idl_parser
tools_dir = os.path.join(module_path, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, 'tools')
sys.path.append(tools_dir)
-from idl_parser.idl_parser import IDLParser, ListFromConcat
+from idl_parser.idl_parser import IDLParser # pylint: disable=import-error
from idl_parser.idl_parser import ParseFile as parse_file
from blink_idl_lexer import BlinkIDLLexer
import blink_idl_lexer
-# Explicitly set starting symbol to rule defined only in base parser.
-# BEWARE that the starting symbol should NOT be defined in both the base parser
-# and the derived one, as otherwise which is used depends on which line number
-# is lower, which is fragile. Instead, either use one in base parser or
-# create a new symbol, so that this is unambiguous.
-# FIXME: unfortunately, this doesn't work in PLY 3.4, so need to duplicate the
-# rule below.
-STARTING_SYMBOL = 'Definitions'
-
-# We ignore comments (and hence don't need 'Top') but base parser preserves them
-# FIXME: Upstream: comments should be removed in base parser
-REMOVED_RULES = ['Top', # [0]
- 'Comments', # [0.1]
- 'CommentsRest', # [0.2]
- ]
-
-# Remove rules from base class
-# FIXME: add a class method upstream: @classmethod IDLParser._RemoveRules
-for rule in REMOVED_RULES:
- production_name = 'p_' + rule
- delattr(IDLParser, production_name)
-
-
class BlinkIDLParser(IDLParser):
- # [1]
- # FIXME: Need to duplicate rule for starting symbol here, with line number
- # *lower* than in the base parser (idl_parser.py).
- # This is a bug in PLY: it determines starting symbol by lowest line number.
- # This can be overridden by the 'start' parameter, but as of PLY 3.4 this
- # doesn't work correctly.
- def p_Definitions(self, p):
- """Definitions : ExtendedAttributeList Definition Definitions
- | """
- if len(p) > 1:
- p[2].AddChildren(p[1])
- p[0] = ListFromConcat(p[2], p[3])
-
- # Below are grammar rules used by yacc, given by functions named p_<RULE>.
- # * The docstring is the production rule in BNF (grammar).
- # * The body is the yacc action (semantics).
- #
- # The PLY framework builds the actual low-level parser by introspecting this
- # parser object, selecting all attributes named p_<RULE> as grammar rules.
- # It extracts the docstrings and uses them as the production rules, building
- # the table of a LALR parser, and uses the body of the functions as actions.
- #
- # Reference:
- # http://www.dabeaz.com/ply/ply.html#ply_nn23
- #
- # Review of yacc:
- # Yacc parses a token stream, internally producing a Concrete Syntax Tree
- # (CST), where each node corresponds to a production rule in the grammar.
- # At each node, it runs an action, which is usually "produce a node in the
- # Abstract Syntax Tree (AST)" or "ignore this node" (for nodes in the CST
- # that aren't included in the AST, since only needed for parsing).
- #
- # The rules use pseudo-variables; in PLY syntax:
- # p[0] is the left side: assign return value to p[0] instead of returning,
- # p[1] ... p[n] are the right side: the values can be accessed, and they
- # can be modified.
- # (In yacc these are $$ and $1 ... $n.)
- #
- # The rules can look cryptic at first, but there are a few standard
- # transforms from the CST to AST. With these in mind, the actions should
- # be reasonably legible.
- #
- # * Ignore production
- # Discard this branch. Primarily used when one alternative is empty.
- #
- # Sample code:
- # if len(p) > 1:
- # p[0] = ...
- # # Note no assignment if len(p) == 1
- #
- # * Eliminate singleton production
- # Discard this node in the CST, pass the next level down up the tree.
- # Used to ignore productions only necessary for parsing, but not needed
- # in the AST.
- #
- # Sample code:
- # p[0] = p[1]
- #
- # * Build node
- # The key type of rule. In this parser, produces object of class IDLNode.
- # There are several helper functions:
- # * BuildProduction: actually builds an IDLNode, based on a production.
- # * BuildAttribute: builds an IDLAttribute, which is a temporary
- # object to hold a name-value pair, which is then
- # set as a Property of the IDLNode when the IDLNode
- # is built.
- # * BuildNamed: Same as BuildProduction, and sets the 'NAME' property.
- # * BuildTrue: BuildAttribute with value True, for flags.
- # See base idl_parser.py for definitions and more examples of use.
- #
- # Sample code:
- # # Build node of type NodeType, with value p[1], and children.
- # p[0] = self.BuildProduction('NodeType', p, 1, children)
- #
- # # Build named node of type NodeType, with name and value p[1].
- # # (children optional)
- # p[0] = self.BuildNamed('NodeType', p, 1)
- #
- # # Make a list
- # # Used if one node has several children.
- # children = ListFromConcat(p[2], p[3])
- # p[0] = self.BuildProduction('NodeType', p, 1, children)
- #
- # # Also used to collapse the right-associative tree
- # # produced by parsing a list back into a single list.
- # """Foos : Foo Foos
- # |"""
- # if len(p) > 1:
- # p[0] = ListFromConcat(p[1], p[2])
- #
- # # Add children.
- # # Primarily used to add attributes, produced via BuildTrue.
- # # p_StaticAttribute
- # """StaticAttribute : STATIC Attribute"""
- # p[2].AddChildren(self.BuildTrue('STATIC'))
- # p[0] = p[2]
- #
- # Numbering scheme for the rules is:
- # [1] for Web IDL spec (or additions in base parser)
- # These should all be upstreamed to the base parser.
- # [b1] for Blink IDL changes (overrides Web IDL)
- # [b1.1] for Blink IDL additions, auxiliary rules for [b1]
- # Numbers are as per Candidate Recommendation 19 April 2012:
- # http://www.w3.org/TR/2012/CR-WebIDL-20120419/
-
- # [3] Override action, since we distinguish callbacks
- # FIXME: Upstream
- def p_CallbackOrInterface(self, p):
- """CallbackOrInterface : CALLBACK CallbackRestOrInterface
- | Interface"""
- if len(p) > 2:
- p[2].AddChildren(self.BuildTrue('CALLBACK'))
- p[0] = p[2]
- else:
- p[0] = p[1]
-
- # [b27] Add strings, more 'Literal' productions
- # 'Literal's needed because integers and strings are both internally strings
- def p_ConstValue(self, p):
- """ConstValue : BooleanLiteral
- | FloatLiteral
- | IntegerLiteral
- | StringLiteral
- | null"""
- # Standard is (no 'string', fewer 'Literal's):
- # ConstValue : BooleanLiteral
- # | FloatLiteral
- # | integer
- # | NULL
- p[0] = p[1]
-
- # [b27.1]
- def p_IntegerLiteral(self, p):
- """IntegerLiteral : integer"""
- p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'integer'),
- self.BuildAttribute('NAME', p[1]))
-
- # [b27.2]
- def p_StringLiteral(self, p):
- """StringLiteral : string"""
- p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'DOMString'),
- self.BuildAttribute('NAME', p[1]))
-
- # [b47]
- def p_ExceptionMember(self, p):
- """ExceptionMember : Const
- | ExceptionField
- | Attribute
- | ExceptionOperation"""
- # Standard is (no Attribute, no ExceptionOperation):
- # ExceptionMember : Const
- # | ExceptionField
- # FIXME: In DOMException.idl, Attributes should be changed to
- # ExceptionFields, and Attribute removed from this rule.
- p[0] = p[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:
- # // Override in a Mozilla compatible format
- # [NotEnumerable] DOMString toString();
- # Limited form of Operation to prevent others from being added.
- # FIXME: Should be a stringifier instead.
- p[0] = self.BuildNamed('ExceptionOperation', p, 2, p[1])
-
- # Extended attributes
- # [b49] Override base parser: remove comment field, since comments stripped
- # FIXME: Upstream
- def p_ExtendedAttributeList(self, p):
- """ExtendedAttributeList : '[' ExtendedAttribute ExtendedAttributes ']'
- | '[' ']'
- | """
- if len(p) > 3:
- 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
- def p_ExtendedAttributes(self, p):
- """ExtendedAttributes : ',' ExtendedAttribute ExtendedAttributes
- | ','
- |"""
- if len(p) > 3:
- p[0] = ListFromConcat(p[2], p[3])
-
- # [b51] Add ExtendedAttributeStringLiteral and ExtendedAttributeStringLiteralList
- def p_ExtendedAttribute(self, p):
- """ExtendedAttribute : ExtendedAttributeNoArgs
- | ExtendedAttributeArgList
- | ExtendedAttributeIdent
- | ExtendedAttributeIdentList
- | ExtendedAttributeNamedArgList
- | ExtendedAttributeStringLiteral
- | ExtendedAttributeStringLiteralList"""
- p[0] = p[1]
-
- # [59]
- # FIXME: Upstream UnionType
- def p_UnionType(self, p):
- """UnionType : '(' UnionMemberType OR UnionMemberType UnionMemberTypes ')'"""
- members = ListFromConcat(p[2], p[4], p[5])
- p[0] = self.BuildProduction('UnionType', p, 1, members)
-
- # [60]
- def p_UnionMemberType(self, p):
- """UnionMemberType : NonAnyType
- | UnionType TypeSuffix
- | ANY '[' ']' TypeSuffix"""
- if len(p) == 2:
- p[0] = self.BuildProduction('Type', p, 1, p[1])
- elif len(p) == 3:
- p[0] = self.BuildProduction('Type', p, 1, ListFromConcat(p[1], p[2]))
- else:
- any_node = ListFromConcat(self.BuildProduction('Any', p, 1), p[4])
- p[0] = self.BuildProduction('Type', p, 1, any_node)
-
- # [61]
- def p_UnionMemberTypes(self, p):
- """UnionMemberTypes : OR UnionMemberType UnionMemberTypes
- |"""
- if len(p) > 2:
- p[0] = ListFromConcat(p[2], p[3])
-
- # [70] Override base parser to remove non-standard sized array
- # FIXME: Upstream
- def p_TypeSuffix(self, p):
- """TypeSuffix : '[' ']' TypeSuffix
- | '?' TypeSuffixStartingWithArray
- |"""
- if len(p) == 4:
- p[0] = self.BuildProduction('Array', p, 1, p[3])
- elif len(p) == 3:
- p[0] = ListFromConcat(self.BuildTrue('NULLABLE'), p[2])
-
- # Blink extension: Add support for string literal Extended Attribute values
- def p_ExtendedAttributeStringLiteral(self, p):
- """ExtendedAttributeStringLiteral : identifier '=' StringLiteral """
- def unwrap_string(ls):
- """Reach in and grab the string literal's "NAME"."""
- return ls[1].value
-
- value = self.BuildAttribute('VALUE', unwrap_string(p[3]))
- p[0] = self.BuildNamed('ExtAttribute', p, 1, value)
-
- # Blink extension: Add support for compound Extended Attribute values over string literals ("A","B")
- def p_ExtendedAttributeStringLiteralList(self, p):
- """ExtendedAttributeStringLiteralList : identifier '=' '(' StringLiteralList ')' """
- value = self.BuildAttribute('VALUE', p[4])
- p[0] = self.BuildNamed('ExtAttribute', p, 1, value)
-
- # Blink extension: one or more string literals. The values aren't propagated as literals,
- # but their by their value only.
- def p_StringLiteralList(self, p):
- """StringLiteralList : StringLiteral ',' StringLiteralList
- | StringLiteral"""
- def unwrap_string(ls):
- """Reach in and grab the string literal's "NAME"."""
- return ls[1].value
-
- if len(p) > 3:
- p[0] = ListFromConcat(unwrap_string(p[1]), p[3])
- else:
- p[0] = ListFromConcat(unwrap_string(p[1]))
-
def __init__(self,
# common parameters
debug=False,
@@ -406,10 +106,6 @@
optimize=optimize)
self.lexer = lexer
self.tokens = lexer.KnownTokens()
- # Using SLR (instead of LALR) generates the table faster,
- # but produces the same output. This is ok b/c Web IDL (and Blink IDL)
- # is an SLR grammar (as is often the case for simple LL(1) grammars).
- #
# Optimized mode substantially decreases startup time (by disabling
# error checking), and also allows use of Python's optimized mode.
# See: Using Python's Optimized Mode
@@ -420,8 +116,6 @@
# See: CHANGES, Version 3.2
# http://ply.googlecode.com/svn/trunk/CHANGES
self.yaccobj = yacc.yacc(module=self,
- start=STARTING_SYMBOL,
- method='SLR',
debug=debug,
optimize=optimize,
write_tables=write_tables,
diff --git a/bindings/scripts/blink_idl_parser_test.py b/bindings/scripts/blink_idl_parser_test.py
new file mode 100644
index 0000000..309b463
--- /dev/null
+++ b/bindings/scripts/blink_idl_parser_test.py
@@ -0,0 +1,21 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=no-member,relative-import
+
+"""Unit tests for blink_idl_parser.py."""
+
+import unittest
+
+from blink_idl_parser import BlinkIDLParser
+
+
+class BlinkIDLParserTest(unittest.TestCase):
+
+ def test_missing_semicolon_between_definitions(self):
+ # No semicolon after enum definition.
+ text = '''enum TestEnum { "value" } dictionary TestDictionary {};'''
+ parser = BlinkIDLParser()
+ parser.ParseText(filename='', data=text)
+ self.assertGreater(parser.GetErrors(), 0)
diff --git a/bindings/scripts/code_generator.py b/bindings/scripts/code_generator.py
new file mode 100644
index 0000000..66838f8
--- /dev/null
+++ b/bindings/scripts/code_generator.py
@@ -0,0 +1,201 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import
+
+"""Plumbing for a Jinja-based code generator, including CodeGeneratorBase, a base class for all generators."""
+
+import os
+import posixpath
+import re
+import sys
+
+from idl_types import set_ancestors, IdlType
+from v8_globals import includes
+from v8_interface import constant_filters
+from v8_types import set_component_dirs
+from v8_methods import method_filters
+import v8_utilities
+from v8_utilities import capitalize
+from utilities import (idl_filename_to_component, is_valid_component_dependency,
+ format_remove_duplicates, format_blink_cpp_source_code,
+ to_snake_case)
+
+# 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, _ = 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))
+TEMPLATES_DIR = os.path.normpath(os.path.join(
+ MODULE_PATH, os.pardir, 'templates'))
+
+# 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)
+import jinja2
+
+
+def generate_indented_conditional(code, conditional):
+ # Indent if statement to level of original code
+ indent = re.match(' *', code).group(0)
+ return ('%sif (%s) {\n' % (indent, conditional) +
+ ' %s\n' % '\n '.join(code.splitlines()) +
+ '%s}\n' % indent)
+
+
+# [Exposed]
+def exposed_if(code, exposed_test):
+ if not exposed_test:
+ return code
+ return generate_indented_conditional(code, 'executionContext && (%s)' % exposed_test)
+
+
+# [SecureContext]
+def secure_context_if(code, secure_context_test, test_result=None):
+ if not secure_context_test:
+ return code
+ if test_result:
+ return generate_indented_conditional(code, test_result)
+ return generate_indented_conditional(code, 'executionContext && (%s)' % secure_context_test)
+
+
+# [RuntimeEnabled]
+def runtime_enabled_if(code, name):
+ if not name:
+ return code
+
+ function = v8_utilities.runtime_enabled_function(name)
+ return generate_indented_conditional(code, function)
+
+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': capitalize,
+ 'exposed': exposed_if,
+ 'format_blink_cpp_source_code': format_blink_cpp_source_code,
+ 'format_remove_duplicates': format_remove_duplicates,
+ 'runtime_enabled': runtime_enabled_if,
+ 'runtime_enabled_function': v8_utilities.runtime_enabled_function,
+ 'secure_context': secure_context_if})
+ jinja_env.filters.update(constant_filters())
+ jinja_env.filters.update(method_filters())
+ return jinja_env
+
+
+def normalize_and_sort_includes(include_paths, snake_case):
+ normalized_include_paths = []
+ for include_path in include_paths:
+ match = re.search(r'/gen/blink/(.*)$', posixpath.abspath(include_path))
+ if match:
+ include_path = match.group(1)
+ if snake_case:
+ match = re.search(r'/([^/]+)\.h$', include_path)
+ if match:
+ name = match.group(1)
+ if name.lower() != name:
+ include_path = include_path[0:match.start(1)] + to_snake_case(name) + '.h'
+ normalized_include_paths.append(include_path)
+ return sorted(normalized_include_paths)
+
+
+def render_template(template, context):
+ filename = str(template.filename)
+ filename = filename[filename.rfind('third_party'):]
+ context['jinja_template_filename'] = filename
+ return template.render(context)
+
+
+class CodeGeneratorBase(object):
+ """Base class for jinja-powered jinja template generation.
+ """
+ def __init__(self, generator_name, info_provider, cache_dir, output_dir, snake_case):
+ self.generator_name = generator_name
+ self.info_provider = info_provider
+ self.jinja_env = initialize_jinja_env(cache_dir)
+ self.output_dir = output_dir
+ self.snake_case_generated_files = snake_case
+ self.set_global_type_info()
+
+ def should_generate_code(self, definitions):
+ return definitions.interfaces or definitions.dictionaries
+
+ def set_global_type_info(self):
+ interfaces_info = self.info_provider.interfaces_info
+ set_ancestors(interfaces_info['ancestors'])
+ IdlType.set_callback_interfaces(interfaces_info['callback_interfaces'])
+ IdlType.set_dictionaries(interfaces_info['dictionaries'])
+ IdlType.set_enums(self.info_provider.enumerations)
+ IdlType.set_callback_functions(self.info_provider.callback_functions)
+ IdlType.set_implemented_as_interfaces(interfaces_info['implemented_as_interfaces'])
+ IdlType.set_garbage_collected_types(interfaces_info['garbage_collected_interfaces'])
+ set_component_dirs(interfaces_info['component_dirs'])
+
+ def render_template(self, include_paths, header_template, cpp_template,
+ template_context, component=None):
+ template_context['code_generator'] = self.generator_name
+
+ # Add includes for any dependencies
+ template_context['header_includes'] = normalize_and_sort_includes(
+ template_context['header_includes'], self.snake_case_generated_files)
+
+ 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'] = normalize_and_sort_includes(includes, self.snake_case_generated_files)
+
+ header_text = render_template(header_template, template_context)
+ cpp_text = render_template(cpp_template, template_context)
+ return header_text, cpp_text
+
+ def generate_code(self, definitions, definition_name):
+ """Invokes code generation. The [definitions] argument is a list of definitions,
+ and the [definition_name] is the name of the definition
+ """
+ # This should be implemented in subclasses.
+ raise NotImplementedError()
+
+
+def main(argv):
+ # If file itself executed, cache templates
+ try:
+ cache_dir = argv[1]
+ dummy_filename = argv[2]
+ except IndexError:
+ print 'Usage: %s CACHE_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(('.tmpl', '.txt'))]
+ 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/scripts/code_generator_v8.py b/bindings/scripts/code_generator_v8.py
index 381d321..c971aa9 100644
--- a/bindings/scripts/code_generator_v8.py
+++ b/bindings/scripts/code_generator_v8.py
@@ -26,6 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# pylint: disable=import-error,print-statement,relative-import
+
"""Generate Blink V8 bindings (.h and .cpp files).
If run itself, caches Jinja templates (and creates dummy file for build,
@@ -45,121 +47,65 @@
import os
import posixpath
-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))
-templates_dir = os.path.normpath(os.path.join(
- module_path, os.pardir, '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)
-import jinja2
-
+from code_generator import CodeGeneratorBase, render_template, normalize_and_sort_includes
from idl_definitions import Visitor
-import idl_types
from idl_types import IdlType
+import v8_callback_function
import v8_callback_interface
import v8_dictionary
-from v8_globals import includes, interfaces
+from v8_globals import includes
import v8_interface
import v8_types
import v8_union
-from v8_utilities import capitalize, cpp_name, v8_class_name
-from utilities import KNOWN_COMPONENTS, idl_filename_to_component, is_valid_component_dependency, is_testing_target
+from v8_utilities import build_basename, cpp_name
+from utilities import idl_filename_to_component, is_testing_target, shorten_union_name, to_snake_case
-def normalize_and_sort_includes(include_paths):
- normalized_include_paths = []
- for include_path in include_paths:
- match = re.search(r'/gen/blink/(.*)$', posixpath.abspath(include_path))
- if match:
- include_path = match.group(1)
- normalized_include_paths.append(include_path)
- return sorted(normalized_include_paths)
+# Make sure extension is .py, not .pyc or .pyo, so doesn't depend on caching
+MODULE_PYNAME = os.path.splitext(os.path.basename(__file__))[0] + '.py'
-
-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'] = normalize_and_sort_includes(
- template_context['header_includes'])
-
- 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'] = normalize_and_sort_includes(includes)
-
- header_text = header_template.render(template_context)
- cpp_text = cpp_template.render(template_context)
- 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.
+def depending_union_type(idl_type):
+ """Returns the union type name if the given idl_type depends on a
+ union type.
"""
- 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
+ def find_base_type(current_type):
+ if current_type.is_array_or_sequence_type:
+ return find_base_type(current_type.element_type)
+ if current_type.is_record_type:
+ # IdlRecordType.key_type is always a string type, so we only need
+ # to looking into value_type.
+ return find_base_type(current_type.value_type)
+ if current_type.is_nullable:
+ return find_base_type(current_type.inner_type)
+ return current_type
+ base_type = find_base_type(idl_type)
+ if base_type.is_union_type:
+ return base_type
+ return None
class TypedefResolver(Visitor):
def __init__(self, info_provider):
self.info_provider = info_provider
+ self.additional_header_includes = set()
+ self.typedefs = {}
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()
+ self.additional_header_includes = set()
definitions.accept(self)
self._update_dependencies_include_paths(definition_name)
def _update_dependencies_include_paths(self, definition_name):
+ if definition_name not in self.info_provider.interfaces_info:
+ return
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)
+ interface_info['additional_header_includes'] = set(
+ self.additional_header_includes)
def _resolve_typedefs(self, typed_object):
"""Resolve typedefs to actual types in the object."""
@@ -171,9 +117,12 @@
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)
+ # TODO(bashi): Dependency resolution shouldn't happen here.
+ # Move this into includes_for_type() families.
+ union_type = depending_union_type(resolved_idl_type)
+ if union_type:
+ self.additional_header_includes.add(
+ self.info_provider.include_path_for_union_types(union_type))
# 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)
@@ -182,23 +131,19 @@
self._resolve_typedefs(typed_object)
-class CodeGeneratorBase(object):
+class CodeGeneratorV8Base(CodeGeneratorBase):
"""Base class for v8 bindings generator and IDL dictionary impl generator"""
- 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
+ def __init__(self, info_provider, cache_dir, output_dir, snake_case):
+ CodeGeneratorBase.__init__(self, MODULE_PYNAME, info_provider, cache_dir, output_dir, snake_case)
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):
+ if not self.should_generate_code(definitions):
return set()
- IdlType.set_callback_functions(definitions.callback_functions.keys())
# Resolve typedefs
self.typedef_resolver.resolve(definitions, definition_name)
return self.generate_code_internal(definitions, definition_name)
@@ -207,15 +152,19 @@
# This should be implemented in subclasses.
raise NotImplementedError()
+ def get_output_basename(self, definition_name, ext, prefix=None):
+ return build_basename(definition_name, self.snake_case_generated_files, prefix=prefix, ext=ext)
-class CodeGeneratorV8(CodeGeneratorBase):
- def __init__(self, info_provider, cache_dir, output_dir):
- CodeGeneratorBase.__init__(self, info_provider, cache_dir, output_dir)
+
+class CodeGeneratorV8(CodeGeneratorV8Base):
+ def __init__(self, info_provider, cache_dir, output_dir, snake_case):
+ CodeGeneratorV8Base.__init__(self, info_provider, cache_dir, output_dir, snake_case)
def output_paths(self, definition_name):
- header_path = posixpath.join(self.output_dir,
- 'V8%s.h' % definition_name)
- cpp_path = posixpath.join(self.output_dir, 'V8%s.cpp' % definition_name)
+ header_path = posixpath.join(self.output_dir, self.get_output_basename(
+ definition_name, '.h', prefix='V8'))
+ cpp_path = posixpath.join(self.output_dir, self.get_output_basename(
+ definition_name, '.cpp', prefix='V8'))
return header_path, cpp_path
def generate_code_internal(self, definitions, definition_name):
@@ -230,49 +179,55 @@
raise ValueError('%s is not in IDL definitions' % definition_name)
def generate_interface_code(self, definitions, interface_name, interface):
- # Store other interfaces for introspection
- interfaces.update(definitions.interfaces)
-
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'
+ #
+ # A callback interface with constants needs a special handling.
+ # https://heycam.github.io/webidl/#legacy-callback-interface-object
+ if interface.is_callback and len(interface.constants) > 0:
+ header_template_filename = 'legacy_callback_interface.h.tmpl'
+ cpp_template_filename = 'legacy_callback_interface.cpp.tmpl'
+ interface_context = v8_callback_interface.legacy_callback_interface_context
+ elif interface.is_callback:
+ header_template_filename = 'callback_interface.h.tmpl'
+ cpp_template_filename = 'callback_interface.cpp.tmpl'
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'
+ header_template_filename = 'partial_interface.h.tmpl'
+ cpp_template_filename = 'partial_interface.cpp.tmpl'
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'
+ header_template_filename = 'interface.h.tmpl'
+ cpp_template_filename = 'interface.cpp.tmpl'
interface_context = v8_interface.interface_context
- template_context = interface_context(interface)
+ template_context = interface_context(interface, definitions.interfaces)
includes.update(interface_info.get('cpp_includes', {}).get(component, set()))
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
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('core/typed_arrays/DOMTypedArray.h')
+ else:
template_context['header_includes'].add(interface_info['include_path'])
-
+ template_context['header_includes'].update(
+ interface_info.get('additional_header_includes', []))
+ header_path, cpp_path = self.output_paths(interface_name)
+ template_context['this_include_header_name'] = posixpath.basename(header_path)
header_template = self.jinja_env.get_template(header_template_filename)
cpp_template = self.jinja_env.get_template(cpp_template_filename)
- header_text, cpp_text = render_template(
+ header_text, cpp_text = self.render_template(
include_paths, header_template, cpp_template, template_context,
component)
- header_path, cpp_path = self.output_paths(interface_name)
return (
(header_path, header_text),
(cpp_path, cpp_text),
@@ -280,187 +235,181 @@
def generate_dictionary_code(self, definitions, dictionary_name,
dictionary):
+ # pylint: disable=unused-argument
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')
+ header_template = self.jinja_env.get_template('dictionary_v8.h.tmpl')
+ cpp_template = self.jinja_env.get_template('dictionary_v8.cpp.tmpl')
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
- if interface_info['include_path']:
- template_context['header_includes'].add(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(
- include_paths, header_template, cpp_template, template_context)
header_path, cpp_path = self.output_paths(dictionary_name)
+ template_context['this_include_header_name'] = posixpath.basename(header_path)
+ header_text, cpp_text = self.render_template(
+ include_paths, header_template, cpp_template, template_context)
return (
(header_path, header_text),
(cpp_path, cpp_text),
)
-class CodeGeneratorDictionaryImpl(CodeGeneratorBase):
- def __init__(self, info_provider, cache_dir, output_dir):
- CodeGeneratorBase.__init__(self, info_provider, cache_dir, output_dir)
+class CodeGeneratorDictionaryImpl(CodeGeneratorV8Base):
+ def __init__(self, info_provider, cache_dir, output_dir, snake_case):
+ CodeGeneratorV8Base.__init__(self, info_provider, cache_dir, output_dir, snake_case)
def output_paths(self, definition_name, interface_info):
output_dir = posixpath.join(self.output_dir,
interface_info['relative_dir'])
- header_path = posixpath.join(output_dir, '%s.h' % definition_name)
- cpp_path = posixpath.join(output_dir, '%s.cpp' % definition_name)
+ header_path = posixpath.join(output_dir,
+ self.get_output_basename(definition_name, '.h'))
+ cpp_path = posixpath.join(output_dir,
+ self.get_output_basename(definition_name, '.cpp'))
return header_path, cpp_path
def generate_code_internal(self, definitions, definition_name):
if not definition_name in definitions.dictionaries:
- raise ValueError('%s is not an IDL dictionary')
+ raise ValueError('%s is not an IDL dictionary' % definition_name)
interfaces_info = self.info_provider.interfaces_info
dictionary = definitions.dictionaries[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')
+ header_template = self.jinja_env.get_template('dictionary_impl.h.tmpl')
+ cpp_template = self.jinja_env.get_template('dictionary_impl.cpp.tmpl')
template_context = v8_dictionary.dictionary_impl_context(
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(
- include_paths, header_template, cpp_template, template_context)
+ template_context['header_includes'].update(
+ interface_info.get('additional_header_includes', []))
header_path, cpp_path = self.output_paths(
cpp_name(dictionary), interface_info)
+ template_context['this_include_header_name'] = posixpath.basename(header_path)
+ header_text, cpp_text = self.render_template(
+ include_paths, header_template, cpp_template, template_context)
return (
(header_path, header_text),
(cpp_path, cpp_text),
)
-class CodeGeneratorUnionType(object):
+class CodeGeneratorUnionType(CodeGeneratorBase):
"""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
+ def __init__(self, info_provider, cache_dir, output_dir, snake_case, target_component):
+ CodeGeneratorBase.__init__(self, MODULE_PYNAME, info_provider, cache_dir, output_dir, snake_case)
self.target_component = target_component
- set_global_type_info(info_provider)
+ # The code below duplicates parts of TypedefResolver. We do not use it
+ # directly because IdlUnionType is not a type defined in
+ # idl_definitions.py. What we do instead is to resolve typedefs in
+ # _generate_container_code() whenever a new union file is generated.
+ self.typedefs = {}
+ for name, typedef in self.info_provider.typedefs.iteritems():
+ self.typedefs[name] = typedef.idl_type
- 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')
-
+ def _generate_container_code(self, union_type):
+ union_type = union_type.resolve_typedefs(self.typedefs)
+ header_template = self.jinja_env.get_template('union_container.h.tmpl')
+ cpp_template = self.jinja_env.get_template('union_container.cpp.tmpl')
+ template_context = v8_union.container_context(
+ union_type, self.info_provider)
+ template_context['header_includes'].append(
+ self.info_provider.include_path_for_export)
template_context['header_includes'] = normalize_and_sort_includes(
- 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)
+ template_context['header_includes'], self.snake_case_generated_files)
+ template_context['cpp_includes'] = normalize_and_sort_includes(
+ template_context['cpp_includes'], self.snake_case_generated_files)
+ template_context['code_generator'] = self.generator_name
+ template_context['exported'] = self.info_provider.specifier_for_export
+ snake_base_name = to_snake_case(shorten_union_name(union_type))
+ template_context['this_include_header_name'] = snake_base_name
+ header_text = render_template(header_template, template_context)
+ cpp_text = render_template(cpp_template, template_context)
+ header_path = posixpath.join(self.output_dir, '%s.h' % snake_base_name)
+ cpp_path = posixpath.join(self.output_dir, '%s.cc' % snake_base_name)
return (
(header_path, header_text),
(cpp_path, cpp_text),
)
+ def _get_union_types_for_containers(self):
+ union_types = self.info_provider.union_types
+ if not union_types:
+ return None
+ # 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()
+ 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)
+ return union_types_for_containers
-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': capitalize,
- 'exposed': exposed_if,
- 'runtime_enabled': runtime_enabled_if,
- })
- return jinja_env
+ def generate_code(self):
+ union_types = self._get_union_types_for_containers()
+ if not union_types:
+ return ()
+ outputs = set()
+ for union_type in union_types:
+ outputs.update(self._generate_container_code(union_type))
+ return outputs
-def generate_indented_conditional(code, conditional):
- # Indent if statement to level of original code
- indent = re.match(' *', code).group(0)
- return ('%sif (%s) {\n' % (indent, conditional) +
- ' %s\n' % '\n '.join(code.splitlines()) +
- '%s}\n' % indent)
+class CodeGeneratorCallbackFunction(CodeGeneratorBase):
+ def __init__(self, info_provider, cache_dir, output_dir, snake_case, target_component):
+ CodeGeneratorBase.__init__(self, MODULE_PYNAME, info_provider, cache_dir, output_dir, snake_case)
+ self.target_component = target_component
+ self.typedef_resolver = TypedefResolver(info_provider)
+ def generate_code_internal(self, callback_function, path):
+ self.typedef_resolver.resolve(callback_function, callback_function.name)
+ header_template = self.jinja_env.get_template('callback_function.h.tmpl')
+ cpp_template = self.jinja_env.get_template('callback_function.cpp.tmpl')
+ template_context = v8_callback_function.callback_function_context(
+ callback_function)
+ if not is_testing_target(path):
+ template_context['exported'] = self.info_provider.specifier_for_export
+ template_context['header_includes'].append(
+ self.info_provider.include_path_for_export)
+ template_context['header_includes'] = normalize_and_sort_includes(
+ template_context['header_includes'], self.snake_case_generated_files)
+ template_context['cpp_includes'] = normalize_and_sort_includes(
+ template_context['cpp_includes'], self.snake_case_generated_files)
+ template_context['code_generator'] = MODULE_PYNAME
+ header_text = render_template(header_template, template_context)
+ cpp_text = render_template(cpp_template, template_context)
+ snake_base_name = to_snake_case('V8%s' % callback_function.name)
+ header_path = posixpath.join(self.output_dir, '%s.h' % snake_base_name)
+ cpp_path = posixpath.join(self.output_dir, '%s.cc' % snake_base_name)
+ return (
+ (header_path, header_text),
+ (cpp_path, cpp_text),
+ )
-# [Exposed]
-def exposed_if(code, exposed_test):
- if not exposed_test:
- return code
- return generate_indented_conditional(code, 'executionContext && (%s)' % exposed_test)
-
-
-# [RuntimeEnabled]
-def runtime_enabled_if(code, runtime_enabled_function_name):
- if not runtime_enabled_function_name:
- return code
- return generate_indented_conditional(code, '%s()' % runtime_enabled_function_name)
-
-
-################################################################################
-
-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 CACHE_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'))]
- 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))
+ # pylint: disable=W0221
+ def generate_code(self):
+ callback_functions = self.info_provider.callback_functions
+ if not callback_functions:
+ return ()
+ outputs = set()
+ for callback_function_dict in callback_functions.itervalues():
+ if callback_function_dict['component_dir'] != self.target_component:
+ continue
+ callback_function = callback_function_dict['callback_function']
+ if 'Custom' in callback_function.extended_attributes:
+ continue
+ path = callback_function_dict['full_path']
+ outputs.update(self.generate_code_internal(callback_function, path))
+ return outputs
diff --git a/bindings/scripts/code_generator_web_agent_api.py b/bindings/scripts/code_generator_web_agent_api.py
new file mode 100644
index 0000000..69d4aff
--- /dev/null
+++ b/bindings/scripts/code_generator_web_agent_api.py
@@ -0,0 +1,285 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import
+
+"""Generates Web Agent API bindings.
+
+The Web Agent API bindings provide a stable, IDL-generated interface for the
+Web Agents.
+
+The Web Agents are the high-level services like Autofill,
+Autocomplete, Translate, Distiller, Phishing Detector, and others. Web Agents
+typically want to introspec the document and rendering infromation to implement
+browser features.
+
+The bindings are meant to be as simple and as ephemeral as possible, mostly just
+wrapping existing DOM classes. Their primary goal is to avoid leaking the actual
+DOM classes to the Web Agents layer.
+"""
+
+import os
+import posixpath
+import sys
+
+from code_generator import CodeGeneratorBase, render_template
+# TODO(dglazkov): Move TypedefResolver to code_generator.py
+from code_generator_v8 import TypedefResolver
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..',
+ 'third_party', 'blink', 'tools'))
+from blinkpy.common.name_style_converter import NameStyleConverter
+
+MODULE_PYNAME = os.path.splitext(os.path.basename(__file__))[0] + '.py'
+
+STRING_INCLUDE_PATH = 'platform/wtf/text/WTFString.h'
+WEB_AGENT_API_IDL_ATTRIBUTE = 'WebAgentAPI'
+
+
+def interface_context(idl_interface, type_resolver):
+ builder = InterfaceContextBuilder(MODULE_PYNAME, type_resolver)
+ builder.set_class_name(idl_interface.name)
+ builder.set_inheritance(idl_interface.parent)
+
+ for idl_attribute in idl_interface.attributes:
+ builder.add_attribute(idl_attribute)
+
+ for idl_operation in idl_interface.operations:
+ builder.add_operation(idl_operation)
+
+ return builder.build()
+
+
+class TypeResolver(object):
+ """Resolves Web IDL types into corresponding C++ types and include paths
+ to the generated and existing files."""
+
+ def __init__(self, interfaces_info):
+ self.interfaces_info = interfaces_info
+
+ def includes_from_interface(self, interface_name):
+ interface_info = self.interfaces_info.get(interface_name)
+ if interface_info is None:
+ raise KeyError('Unknown interface "%s".' % interface_name)
+ return set([interface_info['include_path']])
+
+ def _includes_from_type(self, idl_type):
+ if idl_type.is_void:
+ return set()
+ if idl_type.is_primitive_type:
+ return set()
+ if idl_type.is_string_type:
+ return set([STRING_INCLUDE_PATH])
+
+ # TODO(dglazkov): Handle complex/weird types.
+ return self.includes_from_interface(idl_type.base_type)
+
+ def includes_from_definition(self, idl_definition):
+ return self._includes_from_type(idl_definition.idl_type)
+
+ def type_from_definition(self, idl_definition):
+ # TODO(dglazkov): The output of this method must be a reasonable C++
+ # type that can be used directly in the jinja2 template.
+ return idl_definition.idl_type.base_type
+
+ def base_class_includes(self):
+ return set(['platform/heap/Handle.h'])
+
+
+class MethodOverloadSplitter(object):
+ """Because of union and optional types being used as arguments, some
+ operations may result in more than one generated method. This class
+ contains the logic for spliting an operation into multiple C++ overloads.
+ """
+
+ def __init__(self, idl_operation):
+ self.idl_operation = idl_operation
+
+ def _update_argument_lists(self, argument_lists, idl_types):
+ """Given a list of IdlTypes and an existing list of argument lists (yes,
+ this is a list of lists), produces a next generation of the list of
+ lists. This is where the actual splitting into overloads happens.
+ """
+ result = []
+ for argument_list in argument_lists:
+ for idl_type in idl_types:
+ new_argument_list = list(argument_list)
+ if idl_type is not None:
+ new_argument_list.append(idl_type)
+ result.append(new_argument_list)
+ return result
+
+ def _enumerate_argument_types(self, idl_argument):
+ """Given an IdlArgument, returns a list of types that are included
+ in this argument. If optional, the list will include a 'None'."""
+ argument_type = idl_argument.idl_type
+ # TODO(dglazkov): What should we do with primitive nullable args?
+ if (argument_type.is_nullable and
+ argument_type.inner_type.is_primitive_type):
+ raise ValueError('Primitive nullable types are not supported.')
+
+ idl_types = []
+ if idl_argument.is_optional:
+ idl_types.append(None) # None is used to convey optionality.
+ if argument_type.is_union_type:
+ idl_types = idl_types + argument_type.member_types
+ else:
+ idl_types.append(argument_type)
+ return idl_types
+
+ def split_into_overloads(self):
+ """Splits an operation into one or more overloads that correctly reflect
+ the WebIDL semantics of the operation arguments. For example,
+ running this method on an IdlOperation that represents this WebIDL
+ definition:
+
+ void addEventListener(
+ DOMString type,
+ EventListener? listener,
+ optional (AddEventListenerOptions or boolean) options)
+
+ will produce a list of 3 argument lists:
+
+ 1) [DOMString, EventListener], since the third argument is optional,
+ 2) [DOMString, EventListener, AddEventListenerOptions], since the
+ third argument is a union type with AddEventListenerOptions as
+ one of its member types, and
+ 3) [DOMString, EventListener, boolean], since the other union member
+ type of the third argument is boolean.
+
+ This example is also captured as test in
+ MethodOverloadSplitterTest.test_split_add_event_listener.
+ """
+
+ argument_lists = [[]]
+ for idl_argument in self.idl_operation.arguments:
+ idl_types = self._enumerate_argument_types(idl_argument)
+ argument_lists = self._update_argument_lists(argument_lists,
+ idl_types)
+ return argument_lists
+
+
+class InterfaceContextBuilder(object):
+ def __init__(self, code_generator, type_resolver):
+ self.result = {'code_generator': code_generator}
+ self.type_resolver = type_resolver
+
+ def set_class_name(self, class_name):
+ converter = NameStyleConverter(class_name)
+ self.result['class_name'] = converter.to_all_cases()
+ self._ensure_set('cpp_includes').update(
+ self.type_resolver.includes_from_interface(class_name))
+
+ def set_inheritance(self, base_interface):
+ if base_interface is None:
+ self._ensure_set('header_includes').update(
+ self.type_resolver.base_class_includes())
+ return
+ self.result['base_class'] = base_interface
+ self._ensure_set('header_includes').update(
+ self.type_resolver.includes_from_interface(base_interface))
+
+ def _ensure_set(self, name):
+ return self.result.setdefault(name, set())
+
+ def _ensure_list(self, name):
+ return self.result.setdefault(name, [])
+
+ def add_attribute(self, idl_attribute):
+ self._ensure_list('attributes').append(
+ self.create_attribute(idl_attribute))
+ self._ensure_set('cpp_includes').update(
+ self.type_resolver.includes_from_definition(idl_attribute))
+
+ def add_operation(self, idl_operation):
+ if not idl_operation.name:
+ return
+ overload_splitter = MethodOverloadSplitter(idl_operation)
+ overloads = overload_splitter.split_into_overloads()
+ argument_names = [argument.name for argument
+ in idl_operation.arguments]
+ for argument_types in overloads:
+ arguments = []
+ for position, argument_type in enumerate(argument_types):
+ arguments.append(
+ self.create_argument(argument_names[position],
+ argument_type))
+ self._ensure_list('methods').append(
+ self.create_method(idl_operation, arguments))
+ self._ensure_set('cpp_includes').update(
+ self.type_resolver.includes_from_definition(idl_operation))
+
+ def create_argument(self, argument_name, argument_type):
+ name_converter = NameStyleConverter(argument_name)
+ return {
+ 'name': name_converter.to_snake_case(),
+ 'type': argument_type.base_type,
+ }
+
+ def create_method(self, idl_operation, arguments):
+ name_converter = NameStyleConverter(idl_operation.name)
+ return_type = self.type_resolver.type_from_definition(idl_operation)
+ return {
+ 'name': name_converter.to_upper_camel_case(),
+ 'type': return_type,
+ 'arguments': arguments
+ }
+
+ def create_attribute(self, idl_attribute):
+ name = idl_attribute.name
+ return_type = self.type_resolver.type_from_definition(idl_attribute)
+ return {
+ 'name': name,
+ 'type': return_type
+ }
+
+ def build(self):
+ return self.result
+
+
+class CodeGeneratorWebAgentAPI(CodeGeneratorBase):
+ def __init__(self, info_provider, cache_dir, output_dir, snake_case):
+ CodeGeneratorBase.__init__(self, MODULE_PYNAME, info_provider,
+ cache_dir, output_dir, snake_case)
+ self.type_resolver = TypeResolver(info_provider.interfaces_info)
+ self.typedef_resolver = TypedefResolver(info_provider)
+
+ def get_template(self, file_extension):
+ template_filename = 'web_agent_api_interface.%s.tmpl' % file_extension
+ return self.jinja_env.get_template(template_filename)
+
+ def generate_file(self, template_context, file_extension):
+ template = self.get_template(file_extension)
+ path = posixpath.join(
+ self.output_dir,
+ '%s.%s' % (template_context['class_name']['snake_case'],
+ file_extension))
+ text = render_template(template, template_context)
+ return (path, text)
+
+ def generate_interface_code(self, interface):
+ # TODO(dglazkov): Implement callback interfaces.
+ # TODO(dglazkov): Make sure partial interfaces are handled.
+ if interface.is_callback or interface.is_partial:
+ raise ValueError('Partial or callback interfaces are not supported')
+
+ template_context = interface_context(interface, self.type_resolver)
+
+ return (
+ self.generate_file(template_context, 'h'),
+ self.generate_file(template_context, 'cc')
+ )
+
+ def generate_code(self, definitions, definition_name):
+ self.typedef_resolver.resolve(definitions, definition_name)
+
+ # TODO(dglazkov): Implement dictionaries
+ if definition_name not in definitions.interfaces:
+ return None
+
+ interface = definitions.interfaces[definition_name]
+ if WEB_AGENT_API_IDL_ATTRIBUTE not in interface.extended_attributes:
+ return None
+
+ return self.generate_interface_code(interface)
diff --git a/bindings/scripts/code_generator_web_agent_api_test.py b/bindings/scripts/code_generator_web_agent_api_test.py
new file mode 100644
index 0000000..7f7b96e
--- /dev/null
+++ b/bindings/scripts/code_generator_web_agent_api_test.py
@@ -0,0 +1,337 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import,protected-access
+
+"""Unit tests for code_generator_web_agent_api.py."""
+
+import unittest
+
+from code_generator_web_agent_api import InterfaceContextBuilder
+from code_generator_web_agent_api import MethodOverloadSplitter
+from code_generator_web_agent_api import STRING_INCLUDE_PATH
+from code_generator_web_agent_api import TypeResolver
+from idl_definitions import IdlArgument
+from idl_definitions import IdlAttribute
+from idl_definitions import IdlOperation
+from idl_types import IdlType
+from idl_types import IdlNullableType
+from idl_types import IdlUnionType
+from idl_types import PRIMITIVE_TYPES
+from idl_types import STRING_TYPES
+
+
+# TODO(dglazkov): Convert to use actual objects, not stubs.
+# See http://crbug.com/673214 for more details.
+class IdlTestingHelper(object):
+ """A collection of stub makers and helper utils to make testing code
+ generation easy."""
+
+ def make_stub_idl_argument(self, name, idl_type, is_optional=False):
+ idl_argument = IdlArgument()
+ idl_argument.name = name
+ idl_argument.idl_type = idl_type
+ idl_argument.is_optional = is_optional
+ return idl_argument
+
+ def make_stub_idl_attribute(self, name, return_type):
+ idl_attribute_stub = IdlAttribute()
+ idl_attribute_stub.name = name
+ idl_attribute_stub.idl_type = IdlType(return_type)
+ return idl_attribute_stub
+
+ def make_stub_idl_operation(self, name, return_type):
+ idl_operation_stub = IdlOperation()
+ idl_operation_stub.name = name
+ idl_operation_stub.idl_type = IdlType(return_type)
+ return idl_operation_stub
+
+ def make_stub_idl_type(self, base_type):
+ return IdlType(base_type)
+
+ def make_stub_interfaces_info(self, classes_to_paths):
+ result = {}
+ for class_name, path in classes_to_paths.iteritems():
+ result[class_name] = {'include_path': path}
+ return result
+
+
+class TypeResolverTest(unittest.TestCase):
+
+ def test_includes_from_type_should_filter_primitive_types(self):
+ helper = IdlTestingHelper()
+ type_resolver = TypeResolver({})
+ for primitive_type in PRIMITIVE_TYPES:
+ idl_type = helper.make_stub_idl_type(primitive_type)
+ self.assertEqual(
+ type_resolver._includes_from_type(idl_type), set())
+
+ def test_includes_from_type_should_filter_void(self):
+ type_resolver = TypeResolver({})
+ helper = IdlTestingHelper()
+ idl_type = helper.make_stub_idl_type('void')
+ self.assertEqual(
+ type_resolver._includes_from_type(idl_type), set())
+
+ def test_includes_from_type_should_handle_string(self):
+ type_resolver = TypeResolver({})
+ helper = IdlTestingHelper()
+ for string_type in STRING_TYPES:
+ idl_type = helper.make_stub_idl_type(string_type)
+ self.assertEqual(
+ type_resolver._includes_from_type(idl_type),
+ set([STRING_INCLUDE_PATH]))
+
+
+class MethodOverloadSplitterTest(unittest.TestCase):
+
+ def test_enumerate_argument_types(self):
+ splitter = MethodOverloadSplitter(IdlOperation())
+ nullable_and_primitive = IdlArgument()
+ nullable_and_primitive.idl_type = IdlNullableType(IdlType('double'))
+ with self.assertRaises(ValueError):
+ splitter._enumerate_argument_types(nullable_and_primitive)
+
+ argument = IdlArgument()
+ foo_type = IdlType('Foo')
+ bar_type = IdlType('Bar')
+
+ argument.idl_type = foo_type
+ self.assertEqual(
+ splitter._enumerate_argument_types(argument), [foo_type])
+
+ argument.is_optional = True
+ self.assertEqual(
+ splitter._enumerate_argument_types(argument), [None, foo_type])
+
+ argument.is_optional = False
+ argument.idl_type = IdlUnionType([foo_type, bar_type])
+ self.assertEqual(
+ splitter._enumerate_argument_types(argument), [foo_type, bar_type])
+
+ argument.is_optional = True
+ self.assertEqual(
+ splitter._enumerate_argument_types(argument),
+ [None, foo_type, bar_type])
+
+ def test_update_argument_lists(self):
+ splitter = MethodOverloadSplitter(IdlOperation())
+ foo_type = IdlType('Foo')
+ bar_type = IdlType('Bar')
+ baz_type = IdlType('Baz')
+ qux_type = IdlType('Qux')
+
+ result = splitter._update_argument_lists([[]], [foo_type])
+ self.assertEqual(result, [[foo_type]])
+
+ result = splitter._update_argument_lists([[]], [foo_type, bar_type])
+ self.assertEqual(result, [[foo_type], [bar_type]])
+
+ existing_list = [[foo_type]]
+ result = splitter._update_argument_lists(existing_list, [bar_type])
+ self.assertEqual(result, [[foo_type, bar_type]])
+
+ existing_list = [[foo_type]]
+ result = splitter._update_argument_lists(existing_list,
+ [None, bar_type])
+ self.assertEqual(result, [[foo_type], [foo_type, bar_type]])
+
+ existing_list = [[foo_type]]
+ result = splitter._update_argument_lists(existing_list,
+ [bar_type, baz_type])
+ self.assertEqual(result, [[foo_type, bar_type], [foo_type, baz_type]])
+
+ existing_list = [[foo_type], [qux_type]]
+ result = splitter._update_argument_lists(existing_list,
+ [bar_type, baz_type])
+ self.assertEqual(result, [
+ [foo_type, bar_type],
+ [foo_type, baz_type],
+ [qux_type, bar_type],
+ [qux_type, baz_type],
+ ])
+
+ existing_list = [[foo_type], [qux_type]]
+ result = splitter._update_argument_lists(existing_list,
+ [None, bar_type, baz_type])
+ self.assertEqual(result, [
+ [foo_type],
+ [foo_type, bar_type],
+ [foo_type, baz_type],
+ [qux_type],
+ [qux_type, bar_type],
+ [qux_type, baz_type],
+ ])
+
+ existing_list = [[foo_type, qux_type]]
+ result = splitter._update_argument_lists(existing_list,
+ [bar_type, baz_type])
+ self.assertEqual(result, [
+ [foo_type, qux_type, bar_type],
+ [foo_type, qux_type, baz_type],
+ ])
+
+ def test_split_into_overloads(self):
+ helper = IdlTestingHelper()
+ type_double = IdlType('double')
+ type_foo = IdlType('foo')
+ type_double_or_foo = IdlUnionType([type_double, type_foo])
+ idl_operation = IdlOperation()
+
+ idl_operation.arguments = []
+ splitter = MethodOverloadSplitter(idl_operation)
+ result = splitter.split_into_overloads()
+ self.assertEqual(result, [[]])
+
+ idl_operation.arguments = [
+ helper.make_stub_idl_argument(None, type_double, True)
+ ]
+ splitter = MethodOverloadSplitter(idl_operation)
+ result = splitter.split_into_overloads()
+ self.assertEqual(result, [[], [type_double]])
+
+ idl_operation.arguments = [
+ helper.make_stub_idl_argument(None, type_double_or_foo)
+ ]
+ splitter = MethodOverloadSplitter(idl_operation)
+ result = splitter.split_into_overloads()
+ self.assertEqual(result, [[type_double], [type_foo]])
+
+ def test_split_add_event_listener(self):
+ """Tests how EventTarget.addEventListener is split into respective
+ overloads. From:
+
+ void addEventListener(
+ DOMString type,
+ EventListener? listener,
+ optional (AddEventListenerOptions or boolean) options)
+
+ produces: """
+
+ helper = IdlTestingHelper()
+ type_dom_string = IdlType('DOMString')
+ type_listener = IdlType('EventListener')
+ type_options = IdlType('AddEventListenerOptions')
+ type_boolean = IdlType('boolean')
+ type_union = IdlUnionType([type_options, type_boolean])
+ idl_operation = IdlOperation()
+ idl_operation.arguments = [
+ helper.make_stub_idl_argument('type', type_dom_string),
+ helper.make_stub_idl_argument('listener', type_listener),
+ helper.make_stub_idl_argument('options', type_union,
+ is_optional=True)]
+ splitter = MethodOverloadSplitter(idl_operation)
+ result = splitter.split_into_overloads()
+ self.assertEqual(
+ result,
+ [[type_dom_string, type_listener],
+ [type_dom_string, type_listener, type_options],
+ [type_dom_string, type_listener, type_boolean]])
+
+
+class InterfaceContextBuilderTest(unittest.TestCase):
+
+ def test_empty(self):
+ builder = InterfaceContextBuilder('test', TypeResolver({}))
+
+ self.assertEqual({'code_generator': 'test'}, builder.build())
+
+ def test_set_name(self):
+ helper = IdlTestingHelper()
+ builder = InterfaceContextBuilder(
+ 'test', TypeResolver(helper.make_stub_interfaces_info({
+ 'foo': 'path_to_foo',
+ })))
+
+ builder.set_class_name('foo')
+ self.assertEqual({
+ 'code_generator': 'test',
+ 'cpp_includes': set(['path_to_foo']),
+ 'class_name': {
+ 'snake_case': 'foo',
+ 'macro_case': 'FOO',
+ 'upper_camel_case': 'Foo'
+ },
+ }, builder.build())
+
+ def test_set_inheritance(self):
+ helper = IdlTestingHelper()
+ builder = InterfaceContextBuilder(
+ 'test', TypeResolver(helper.make_stub_interfaces_info({
+ 'foo': 'path_to_foo',
+ })))
+ builder.set_inheritance('foo')
+ self.assertEqual({
+ 'base_class': 'foo',
+ 'code_generator': 'test',
+ 'header_includes': set(['path_to_foo']),
+ }, builder.build())
+
+ builder = InterfaceContextBuilder('test', TypeResolver({}))
+ builder.set_inheritance(None)
+ self.assertEqual({
+ 'code_generator': 'test',
+ 'header_includes': set(['platform/heap/Handle.h']),
+ }, builder.build())
+
+ def test_add_attribute(self):
+ helper = IdlTestingHelper()
+ builder = InterfaceContextBuilder(
+ 'test', TypeResolver(helper.make_stub_interfaces_info({
+ 'foo': 'path_to_foo',
+ 'bar': 'path_to_bar'
+ })))
+
+ attribute = helper.make_stub_idl_attribute('foo', 'bar')
+ builder.add_attribute(attribute)
+ self.assertEqual({
+ 'code_generator': 'test',
+ 'cpp_includes': set(['path_to_bar']),
+ 'attributes': [{'name': 'foo', 'type': 'bar'}],
+ }, builder.build())
+
+ def test_add_method(self):
+ helper = IdlTestingHelper()
+ builder = InterfaceContextBuilder(
+ 'test', TypeResolver(helper.make_stub_interfaces_info({
+ 'foo': 'path_to_foo',
+ 'bar': 'path_to_bar',
+ 'garply': 'path_to_garply',
+ })))
+
+ operation = helper.make_stub_idl_operation('foo', 'bar')
+ builder.add_operation(operation)
+ self.assertEqual({
+ 'code_generator': 'test',
+ 'cpp_includes': set(['path_to_bar']),
+ 'methods': [{
+ 'arguments': [],
+ 'name': 'Foo',
+ 'type': 'bar'
+ }],
+ }, builder.build())
+
+ operation = helper.make_stub_idl_operation('quux', 'garply')
+ operation.arguments = [
+ helper.make_stub_idl_argument('barBaz', IdlType('qux'))
+ ]
+ builder.add_operation(operation)
+ self.assertEqual({
+ 'code_generator': 'test',
+ 'cpp_includes': set(['path_to_bar', 'path_to_garply']),
+ 'methods': [
+ {
+ 'arguments': [],
+ 'name': 'Foo',
+ 'type': 'bar'
+ },
+ {
+ 'arguments': [
+ {'name': 'bar_baz', 'type': 'qux'}
+ ],
+ 'name': 'Quux',
+ 'type': 'garply'
+ }
+ ],
+ }, builder.build())
diff --git a/bindings/scripts/collect_idls_into_json.py b/bindings/scripts/collect_idls_into_json.py
deleted file mode 100644
index a03026f..0000000
--- a/bindings/scripts/collect_idls_into_json.py
+++ /dev/null
@@ -1,432 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""Usage: collect_idls_into_json.py path_file.txt json_file.json
-This script collects and organizes interface information and that information dumps into json file.
-"""
-
-import json
-import os
-import sys
-import utilities
-
-
-from blink_idl_parser import parse_file, BlinkIDLParser
-
-_INTERFACE = 'Interface'
-_IMPLEMENT = 'Implements'
-_PARTIAL = 'Partial'
-_NAME = 'Name'
-_TYPE = 'Type'
-_UNIONTYPE = 'UnionType'
-_ARRAY = 'Array'
-_ANY = 'Any'
-_SEQUENCE = 'Sequence'
-_PROP_VALUE = 'VALUE'
-_VALUE = 'Value'
-_PARENT = 'Parent'
-_FILEPATH = 'FilePath'
-_PROP_FILENAME = 'FILENAME'
-_PROP_READONLY = 'READONLY'
-_READONLY = 'Readonly'
-_PROP_STATIC = 'STATIC'
-_STATIC = 'Static'
-_CONSTS = 'Consts'
-_CONST = 'Const'
-_ATTRIBUTES = 'Attributes'
-_ATTRIBUTE = 'Attribute'
-_OPERATIONS = 'Operations'
-_OPERATION = 'Operation'
-_PROP_GETTER = 'GETTER'
-_NAMED_GETTER = '__getter__'
-_PROP_SETTER = 'SETTER'
-_NAMED_SETTER = '__setter__'
-_PROP_DELETER = 'DELETER'
-_NAMED_DELETER = '__deleter__'
-_ARGUMENTS = 'Arguments'
-_ARGUMENT = 'Argument'
-_EXTATTRIBUTES = 'ExtAttributes'
-_EXTATTRIBUTE = 'ExtAttribute'
-_INHERIT = 'Inherit'
-_PROP_REFERENCE = 'REFERENCE'
-_PARTIAL_FILEPATH = 'Partial_FilePaths'
-_MEMBERS = [_CONSTS, _ATTRIBUTES, _OPERATIONS]
-
-
-def get_definitions(paths):
- """Returns a generator of IDL node.
- Args:
- paths: list of IDL file path
- Returns:
- a generator which yields IDL node objects
- """
- parser = BlinkIDLParser()
- for path in paths:
- definitions = parse_file(parser, path)
- for definition in definitions.GetChildren():
- yield definition
-
-
-def is_implements(definition):
- """Returns True if class of |definition| is Implements, otherwise False.
- Args:
- definition: IDL node
- Returns:
- True if class of |definition| is Implements, otherwise False.
- """
- return definition.GetClass() == _IMPLEMENT
-
-
-def is_partial(definition):
- """Returns True if |definition| is 'partial interface' class, otherwise False.
- Args:
- definition: IDL node
- Return:
- True if |definition| is 'partial interface' class, otherwise False.
- """
- return definition.GetClass() == _INTERFACE and definition.GetProperty(_PARTIAL)
-
-
-def get_filepath(interface_node):
- """Returns relative path to the IDL in which |interface_node| is defined.
- Args:
- interface_node: IDL interface
- Returns:
- str which is |interface_node|'s file path
- """
- filename = interface_node.GetProperty(_PROP_FILENAME)
- return os.path.relpath(filename)
-
-
-def get_const_node_list(interface_node):
- """Returns a list of Const node.
- Args:
- interface_node: interface node
- Returns:
- A list of const node
- """
- return interface_node.GetListOf(_CONST)
-
-
-def get_const_type(const_node):
- """Returns const's type.
- Args:
- const_node: const node
- Returns:
- str which is constant type.
- """
- return const_node.GetChildren()[0].GetName()
-
-
-def get_const_value(const_node):
- """Returns const's value.
- This function only supports primitive types.
-
- Args:
- const_node: const node
- Returns:
- str which is name of constant's value.
- """
- if const_node.GetChildren()[1].GetName():
- return const_node.GetChildren()[1].GetName()
- else:
- for const_child in const_node.GetChildren():
- if const_child.GetClass() == _VALUE and not const_child.GetName():
- return const_child.GetProperty(_PROP_VALUE)
- raise Exception('Constant value is empty')
-
-
-def const_node_to_dict(const_node):
- """Returns dictionary of const's information.
- Args:
- const_node: const node
- Returns:
- dictionary of const's information
- """
- return {
- _NAME: const_node.GetName(),
- _TYPE: get_const_type(const_node),
- _VALUE: get_const_value(const_node),
- _EXTATTRIBUTES: [extattr_node_to_dict(extattr) for extattr in get_extattribute_node_list(const_node)],
- }
-
-
-def get_attribute_node_list(interface_node):
- """Returns list of Attribute if the interface have one.
- Args:
- interface_node: interface node
- Returns:
- list of attribute node
- """
- return interface_node.GetListOf(_ATTRIBUTE)
-
-
-def get_attribute_type(attribute_node):
- """Returns type of attribute.
- Args:
- attribute_node: attribute node
- Returns:
- name of attribute's type
- """
- attr_type = attribute_node.GetOneOf(_TYPE).GetChildren()[0]
- type_list = []
- if attr_type.GetClass() == _UNIONTYPE:
- union_member_list = attr_type.GetListOf(_TYPE)
- for union_member in union_member_list:
- for type_component in union_member.GetChildren():
- if type_component.GetClass() == _ARRAY:
- type_list[-1] += '[]'
- elif type_component.GetClass() == _SEQUENCE:
- for seq_type in type_component.GetOneOf(_TYPE).GetChildren():
- type_list.append('<' + seq_type.GetName() + '>')
- else:
- type_list.append(type_component.GetName())
- return type_list
- elif attr_type.GetClass() == _SEQUENCE:
- union_member_types = []
- if attr_type.GetOneOf(_TYPE).GetChildren()[0].GetClass() == _UNIONTYPE:
- for union_member in attr_type.GetOneOf(_TYPE).GetOneOf(_UNIONTYPE).GetListOf(_TYPE):
- if len(union_member.GetChildren()) != 1:
- raise Exception('Complex type in a union in a sequence is not yet supported')
- type_component = union_member.GetChildren()[0]
- union_member_types.append(type_component.GetName())
- return '<' + str(union_member_types) + '>'
- else:
- for type_component in attr_type.GetOneOf(_TYPE).GetChildren():
- if type_component.GetClass() == _SEQUENCE:
- raise Exception('Sequence in another sequence is not yet supported')
- else:
- if type_component.GetClass() == _ARRAY:
- type_list[-1] += []
- else:
- type_list.append(type_component.GetName())
- return '<' + type_list[0] + '>'
- elif attr_type.GetClass() == _ANY:
- return _ANY
- else:
- for type_component in attribute_node.GetOneOf(_TYPE).GetChildren():
- if type_component.GetClass() == _ARRAY:
- type_list[-1] += '[]'
- else:
- type_list.append(type_component.GetName())
- return type_list[0]
-
-
-get_operation_type = get_attribute_type
-get_argument_type = get_attribute_type
-
-
-def attribute_node_to_dict(attribute_node):
- """Returns dictioary of attribute's information.
- Args:
- attribute_node: attribute node
- Returns:
- dictionary of attribute's information
- """
- return {
- _NAME: attribute_node.GetName(),
- _TYPE: get_attribute_type(attribute_node),
- _EXTATTRIBUTES: [extattr_node_to_dict(extattr) for extattr in get_extattribute_node_list(attribute_node)],
- _READONLY: attribute_node.GetProperty(_PROP_READONLY, default=False),
- _STATIC: attribute_node.GetProperty(_PROP_STATIC, default=False),
- }
-
-
-def get_operation_node_list(interface_node):
- """Returns operations node list.
- Args:
- interface_node: interface node
- Returns:
- list of oparation node
- """
- return interface_node.GetListOf(_OPERATION)
-
-
-def get_argument_node_list(operation_node):
- """Returns list of argument.
- Args:
- operation_node: operation node
- Returns:
- list of argument node
- """
- return operation_node.GetOneOf(_ARGUMENTS).GetListOf(_ARGUMENT)
-
-
-def argument_node_to_dict(argument_node):
- """Returns dictionary of argument's information.
- Args:
- argument_node: argument node
- Returns:
- dictionary of argument's information
- """
- return {
- _NAME: argument_node.GetName(),
- _TYPE: get_argument_type(argument_node),
- }
-
-
-def get_operation_name(operation_node):
- """Returns openration's name.
- Args:
- operation_node: operation node
- Returns:
- name of operation
- """
- if operation_node.GetProperty(_PROP_GETTER):
- return _NAMED_GETTER
- elif operation_node.GetProperty(_PROP_SETTER):
- return _NAMED_SETTER
- elif operation_node.GetProperty(_PROP_DELETER):
- return _NAMED_DELETER
- else:
- return operation_node.GetName()
-
-
-def operation_node_to_dict(operation_node):
- """Returns dictionary of operation's information.
- Args:
- operation_node: operation node
- Returns:
- dictionary of operation's informantion
- """
- return {
- _NAME: get_operation_name(operation_node),
- _ARGUMENTS: [argument_node_to_dict(argument) for argument in get_argument_node_list(operation_node) if argument_node_to_dict(argument)],
- _TYPE: get_operation_type(operation_node),
- _EXTATTRIBUTES: [extattr_node_to_dict(extattr) for extattr in get_extattribute_node_list(operation_node)],
- _STATIC: operation_node.GetProperty(_PROP_STATIC, default=False),
- }
-
-
-def get_extattribute_node_list(node):
- """Returns list of ExtAttribute.
- Args:
- node: IDL node
- Returns:
- list of ExtAttrbute
- """
- if node.GetOneOf(_EXTATTRIBUTES):
- return node.GetOneOf(_EXTATTRIBUTES).GetListOf(_EXTATTRIBUTE)
- else:
- return []
-
-
-def extattr_node_to_dict(extattr):
- """Returns dictionary of ExtAttribute's information.
- Args:
- extattr: ExtAttribute node
- Returns:
- dictionary of ExtAttribute's information
- """
- return {
- _NAME: extattr.GetName(),
- }
-
-
-def inherit_node_to_dict(interface_node):
- """Returns a dictionary of inheritance information.
- Args:
- interface_node: interface node
- Returns:
- A dictioanry of inheritance information.
- """
- inherit = interface_node.GetOneOf(_INHERIT)
- if inherit:
- return {_PARENT: inherit.GetName()}
- else:
- return {_PARENT: None}
-
-
-def interface_node_to_dict(interface_node):
- """Returns a dictioary of interface information.
- Args:
- interface_node: interface node
- Returns:
- A dictionary of the interface information.
- """
- return {
- _NAME: interface_node.GetName(),
- _FILEPATH: get_filepath(interface_node),
- _CONSTS: [const_node_to_dict(const) for const in get_const_node_list(interface_node)],
- _ATTRIBUTES: [attribute_node_to_dict(attr) for attr in get_attribute_node_list(interface_node) if attr],
- _OPERATIONS: [operation_node_to_dict(operation) for operation in get_operation_node_list(interface_node) if operation],
- _EXTATTRIBUTES: [extattr_node_to_dict(extattr) for extattr in get_extattribute_node_list(interface_node)],
- _INHERIT: inherit_node_to_dict(interface_node)
- }
-
-
-def merge_partial_dicts(interfaces_dict, partials_dict):
- """Merges partial interface into non-partial interface.
- Args:
- interfaces_dict: A dict of the non-partial interfaces.
- partial_dict: A dict of partial interfaces.
- Returns:
- A merged dictionary of |interface_dict| with |partial_dict|.
- """
- for interface_name, partial in partials_dict.iteritems():
- interface = interfaces_dict.get(interface_name)
- if not interface:
- raise Exception('There is a partial interface, but the corresponding non-partial interface was not found.')
- for member in _MEMBERS:
- interface[member].extend(partial.get(member))
- interface.setdefault(_PARTIAL_FILEPATH, []).append(partial[_FILEPATH])
- return interfaces_dict
-
-
-def merge_implement_nodes(interfaces_dict, implement_node_list):
- """Combines a dict of interface information with referenced interface information.
- Args:
- interfaces_dict: dict of interface information
- implement_nodes: list of implemented interface node
- Returns:
- A dict of interface information combined with implements nodes.
- """
- for implement in implement_node_list:
- reference = implement.GetProperty(_PROP_REFERENCE)
- implement = implement.GetName()
- if reference not in interfaces_dict.keys() or implement not in interfaces_dict.keys():
- raise Exception('There is not corresponding implement or reference interface.')
- for member in _MEMBERS:
- interfaces_dict[implement][member].extend(interfaces_dict[reference].get(member))
- return interfaces_dict
-
-
-def export_to_jsonfile(dictionary, json_file):
- """Writes a Python dict into a JSON file.
- Args:
- dictioary: interface dictionary
- json_file: json file for output
- """
- with open(json_file, 'w') as f:
- json.dump(dictionary, f, sort_keys=True)
-
-
-def usage():
- sys.stdout.write('Usage: collect_idls_into_json.py <path_file.txt> <output_file.json>\n')
-
-
-def main(args):
- if len(args) != 2:
- usage()
- exit(1)
- path_file = args[0]
- json_file = args[1]
- path_list = utilities.read_file_to_list(path_file)
- implement_node_list = [definition
- for definition in get_definitions(path_list)
- if is_implements(definition)]
- interfaces_dict = {definition.GetName(): interface_node_to_dict(definition)
- for definition in get_definitions(path_list)
- if not is_partial(definition)}
- partials_dict = {definition.GetName(): interface_node_to_dict(definition)
- for definition in get_definitions(path_list)
- if is_partial(definition)}
- dictionary = merge_partial_dicts(interfaces_dict, partials_dict)
- interfaces_dict = merge_implement_nodes(interfaces_dict, implement_node_list)
- export_to_jsonfile(dictionary, json_file)
-
-
-if __name__ == '__main__':
- main(sys.argv[1:])
diff --git a/bindings/scripts/compute_global_objects.py b/bindings/scripts/compute_global_objects.py
index 2e83e46..ececf61 100755
--- a/bindings/scripts/compute_global_objects.py
+++ b/bindings/scripts/compute_global_objects.py
@@ -12,12 +12,18 @@
Design document: http://www.chromium.org/developers/design-documents/idl-build
"""
+# pylint: disable=relative-import
+
import optparse
import os
-import cPickle as pickle
import sys
-from utilities import get_file_contents, idl_filename_to_interface_name, get_interface_extended_attributes_from_idl, read_file_to_list, read_pickle_files, write_pickle_file
+from utilities import get_file_contents
+from utilities import get_interface_extended_attributes_from_idl
+from utilities import get_first_interface_name_from_idl
+from utilities import read_file_to_list
+from utilities import read_pickle_files
+from utilities import write_pickle_file
GLOBAL_EXTENDED_ATTRIBUTES = frozenset([
'Global',
@@ -26,21 +32,20 @@
def parse_options():
- usage = 'Usage: %prog [options] [GlobalObjectsComponent.pickle]... [GlobalObjects.pickle]'
+ usage = 'Usage: %prog [options] [GlobalObjects.pickle]'
parser = optparse.OptionParser(usage=usage)
parser.add_option('--idl-files-list', help='file listing IDL files')
- 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('--global-objects-component-files', action='append',
+ help='optionally preceeded input pickle filename.')
options, args = parser.parse_args()
if options.idl_files_list is None:
parser.error('Must specify a file listing IDL files using --idl-files-list.')
- if options.write_file_only_if_changed is None:
- parser.error('Must specify whether output files are only written if changed using --write-file-only-if-changed.')
- options.write_file_only_if_changed = bool(options.write_file_only_if_changed)
- if not args:
- parser.error('Must specify an output pickle filename as argument, '
- 'optionally preceeded by input pickle filenames.')
+ if options.global_objects_component_files is None:
+ options.global_objects_component_files = []
+ if len(args) != 1:
+ parser.error('Must specify an output pickle filename as an argument')
return options, args
@@ -57,10 +62,10 @@
names; otherwise, the interface has a single global name, which is the
interface's identifier (http://heycam.github.io/webidl/#Global).
"""
- interface_name = idl_filename_to_interface_name(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)
+ interface_name = get_first_interface_name_from_idl(idl_file_contents)
global_keys = GLOBAL_EXTENDED_ATTRIBUTES.intersection(
extended_attributes.iterkeys())
@@ -80,7 +85,7 @@
def idl_files_to_interface_name_global_names(idl_files):
"""Yields pairs (interface_name, global_names) found in IDL files."""
for idl_filename in idl_files:
- interface_name = idl_filename_to_interface_name(idl_filename)
+ interface_name = get_first_interface_name_from_idl(get_file_contents(idl_filename))
global_names = idl_file_to_global_names(idl_filename)
if global_names:
yield interface_name, global_names
@@ -90,11 +95,11 @@
def main():
options, args = parse_options()
- # args = Input1, Input2, ..., Output
output_global_objects_filename = args.pop()
interface_name_global_names = dict_union(
existing_interface_name_global_names
- for existing_interface_name_global_names in read_pickle_files(args))
+ for existing_interface_name_global_names
+ in read_pickle_files(options.global_objects_component_files))
# Input IDL files are passed in a file, due to OS command line length
# limits. This is generated at GYP time, which is ok b/c files are static.
@@ -103,8 +108,7 @@
idl_files_to_interface_name_global_names(idl_files))
write_pickle_file(output_global_objects_filename,
- interface_name_global_names,
- options.write_file_only_if_changed)
+ interface_name_global_names)
if __name__ == '__main__':
diff --git a/bindings/scripts/compute_interfaces_info_individual.py b/bindings/scripts/compute_interfaces_info_individual.py
index 26af9fe..98fee87 100755
--- a/bindings/scripts/compute_interfaces_info_individual.py
+++ b/bindings/scripts/compute_interfaces_info_individual.py
@@ -47,10 +47,16 @@
import posixpath
import sys
-from idl_compiler import idl_filename_to_interface_name
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, merge_dict_recursively
+from utilities import idl_filename_to_component
+from utilities import idl_filename_to_basename
+from utilities import merge_dict_recursively
+from utilities import read_idl_files_list_from_file
+from utilities import shorten_union_name
+from utilities import to_snake_case
+from utilities import write_pickle_file
+
module_path = os.path.dirname(__file__)
source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
@@ -63,22 +69,20 @@
def parse_options():
- usage = 'Usage: %prog [options] [generated1.idl]...'
+ usage = 'Usage: %prog [options]'
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='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')
+ # TODO(tkent): Remove the option after the great mv. crbug.com/760462
+ parser.add_option('--snake-case-generated-files', action='store_true', default=False)
options, args = parser.parse_args()
if options.interfaces_info_file is None:
parser.error('Must specify an output file using --interfaces-info-file.')
if options.idl_files_list is None:
parser.error('Must specify a file listing 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, args
@@ -93,7 +97,7 @@
return relative_dir_local.replace(os.path.sep, posixpath.sep)
-def include_path(idl_filename, implemented_as=None):
+def include_path(idl_filename, snake_case_generated_files, implemented_as=None):
"""Returns relative path to header file in POSIX format; used in includes.
POSIX format is used for consistency of output, so reference tests are
@@ -105,9 +109,10 @@
relative_dir = relative_dir_posix(idl_filename, source_path)
# IDL file basename is used even if only a partial interface file
- cpp_class_name = implemented_as or idl_filename_to_interface_name(idl_filename)
-
- return posixpath.join(relative_dir, cpp_class_name + '.h')
+ output_file_basename = implemented_as or idl_filename_to_basename(idl_filename)
+ if snake_case_generated_files:
+ output_file_basename = to_snake_case(output_file_basename)
+ return posixpath.join(relative_dir, output_file_basename + '.h')
def get_implements_from_definitions(definitions, definition_name):
@@ -170,9 +175,10 @@
'full_paths': [],
'include_paths': [],
})
- self.enumerations = set()
+ self.enumerations = {}
self.union_types = set()
self.typedefs = {}
+ self.callback_functions = {}
def add_paths_to_partials_dict(self, partial_interface_name, full_path,
include_paths):
@@ -180,17 +186,24 @@
paths_dict['full_paths'].append(full_path)
paths_dict['include_paths'].extend(include_paths)
- def collect_info(self, idl_filename):
+ def check_enum_consistency(self, enum):
+ existing_enum = self.enumerations.get(enum.name)
+ if not existing_enum:
+ return True
+ # TODO(bashi): Ideally we should not allow multiple enum declarations
+ # but we allow them to work around core/module separation.
+ if len(existing_enum.values) != len(enum.values):
+ return False
+ return all(value in existing_enum.values for value in enum.values)
+
+ def collect_info(self, idl_filename, snake_case_generated_files=False):
"""Reads an idl file and collects information which is required by the
binding code generation."""
def collect_unforgeable_attributes(definition, idl_filename):
"""Collects [Unforgeable] attributes so that we can define them on
sub-interfaces later. The resulting structure is as follows.
interfaces_info[interface_name] = {
- 'unforgeable_attributes': {
- 'core': [IdlAttribute, ...],
- 'modules': [IdlAttribute, ...],
- },
+ 'unforgeable_attributes': [IdlAttribute, ...],
...
}
"""
@@ -206,9 +219,7 @@
# Come up with a better way to keep them consistent.
for attr in unforgeable_attributes:
attr.extended_attributes['PartialInterfaceImplementedAs'] = definition.extended_attributes.get('ImplementedAs', interface_basename)
- component = idl_filename_to_component(idl_filename)
- interface_info['unforgeable_attributes'] = {}
- interface_info['unforgeable_attributes'][component] = unforgeable_attributes
+ interface_info['unforgeable_attributes'] = unforgeable_attributes
return interface_info
definitions = self.reader.read_idl_file(idl_filename)
@@ -216,12 +227,19 @@
this_union_types = collect_union_types_from_definitions(definitions)
self.union_types.update(this_union_types)
self.typedefs.update(definitions.typedefs)
+ for callback_function_name, callback_function in definitions.callback_functions.iteritems():
+ # Set 'component_dir' to specify a directory that callback function files belong to
+ self.callback_functions[callback_function_name] = {
+ 'callback_function': callback_function,
+ 'component_dir': idl_filename_to_component(idl_filename),
+ 'full_path': os.path.realpath(idl_filename),
+ }
# 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())
+ for enum in definitions.enumerations.values():
+ if not self.check_enum_consistency(enum):
+ raise Exception('Enumeration "%s" is defined more than once '
+ 'with different valid values' % enum.name)
+ self.enumerations.update(definitions.enumerations)
if definitions.interfaces:
definition = next(definitions.interfaces.itervalues())
@@ -259,16 +277,13 @@
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)
+ this_include_path = include_path(idl_filename, snake_case_generated_files, 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:
- 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)
# Collects C++ header paths which should be included from generated
# .cpp files. The resulting structure is as follows.
@@ -295,7 +310,7 @@
interface_info.update({
'extended_attributes': extended_attributes,
'full_path': full_path,
- 'has_union_types': bool(this_union_types),
+ 'union_types': this_union_types,
'implemented_as': implemented_as,
'implemented_by_interfaces': left_interfaces,
'implements_interfaces': right_interfaces,
@@ -320,8 +335,9 @@
def get_component_info_as_dict(self):
"""Returns component wide information as a dict."""
return {
+ 'callback_functions': self.callback_functions,
'enumerations': dict((enum.name, enum.values)
- for enum in self.enumerations),
+ for enum in self.enumerations.values()),
'typedefs': self.typedefs,
'union_types': self.union_types,
}
@@ -330,29 +346,22 @@
################################################################################
def main():
- options, args = parse_options()
+ options, _ = parse_options()
- # Static IDL files are passed in a file (generated at GYP time), due to OS
- # command line length limits
- idl_files = read_file_to_list(options.idl_files_list)
- # Generated IDL files are passed at the command line, since these are in the
- # build directory, which is determined at build time, not GYP time, so these
- # cannot be included in the file listing static files
- idl_files.extend(args)
+ # IDL files are passed in a file, due to OS command line length limits
+ idl_files = read_idl_files_list_from_file(options.idl_files_list, is_gyp_format=False)
# 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:
- info_collector.collect_info(idl_filename)
+ info_collector.collect_info(idl_filename, options.snake_case_generated_files)
write_pickle_file(options.interfaces_info_file,
- info_collector.get_info_as_dict(),
- options.write_file_only_if_changed)
+ info_collector.get_info_as_dict())
write_pickle_file(options.component_info_file,
- info_collector.get_component_info_as_dict(),
- options.write_file_only_if_changed)
+ info_collector.get_component_info_as_dict())
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 f038b76..2791a9a 100755
--- a/bindings/scripts/compute_interfaces_info_overall.py
+++ b/bindings/scripts/compute_interfaces_info_overall.py
@@ -81,17 +81,22 @@
Design doc: http://www.chromium.org/developers/design-documents/idl-build
"""
-from collections import defaultdict
-import cPickle as pickle
+# pylint: disable=relative-import
+
import optparse
import sys
-from utilities import idl_filename_to_component, read_pickle_files, write_pickle_file, merge_dict_recursively
+from collections import defaultdict
+from utilities import idl_filename_to_component
+from utilities import merge_dict_recursively
+from utilities import read_pickle_files
+from utilities import shorten_union_name
+from utilities import write_pickle_file
INHERITED_EXTENDED_ATTRIBUTES = set([
+ 'ActiveScriptWrappable',
'DependentLifetime',
- 'GarbageCollected',
- 'WillBeGarbageCollected',
+ 'LegacyUnenumerableNamedProperties',
])
# Main variable (filled in and exported)
@@ -114,13 +119,8 @@
def parse_options():
usage = 'Usage: %prog [InfoIndividual.pickle]... [Info.pickle]'
parser = optparse.OptionParser(usage=usage)
- 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()
- 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, args
+ return parser.parse_args()
def dict_of_dicts_of_lists_update_or_append(existing, other):
@@ -168,7 +168,6 @@
dictionaries = {}
component_dirs = {}
implemented_as_interfaces = {}
- will_be_garbage_collected_interfaces = set()
garbage_collected_interfaces = set()
callback_interfaces = set()
@@ -185,17 +184,13 @@
implemented_as_interfaces[interface_name] = interface_info['implemented_as']
inherited_extended_attributes = interface_info['inherited_extended_attributes']
- if 'WillBeGarbageCollected' in inherited_extended_attributes:
- will_be_garbage_collected_interfaces.add(interface_name)
- if 'GarbageCollected' in inherited_extended_attributes:
- garbage_collected_interfaces.add(interface_name)
+ garbage_collected_interfaces.add(interface_name)
interfaces_info['ancestors'] = ancestors
interfaces_info['callback_interfaces'] = callback_interfaces
interfaces_info['dictionaries'] = dictionaries
interfaces_info['implemented_as_interfaces'] = implemented_as_interfaces
interfaces_info['garbage_collected_interfaces'] = garbage_collected_interfaces
- interfaces_info['will_be_garbage_collected_interfaces'] = will_be_garbage_collected_interfaces
interfaces_info['component_dirs'] = component_dirs
@@ -266,12 +261,10 @@
# However, they are needed for legacy implemented interfaces that
# are being treated as partial interfaces, until we remove these.
# http://crbug.com/360435
- implemented_interfaces_include_paths = []
- 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 = [
+ implemented_interface_info['include_path']
+ for implemented_interface_info in implemented_interfaces_info
+ if implemented_interface_info['is_legacy_treat_as_partial_interface']]
dependencies_full_paths = implemented_interfaces_full_paths
dependencies_include_paths = implemented_interfaces_include_paths
@@ -293,10 +286,6 @@
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': dependencies_full_paths,
'dependencies_include_paths': dependencies_include_paths,
@@ -309,7 +298,7 @@
# 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['union_types']
del interface_info['is_legacy_treat_as_partial_interface']
# Compute global_type_info to interfaces_info so that idl_compiler does
@@ -320,15 +309,13 @@
################################################################################
def main():
- options, args = parse_options()
+ _, args = parse_options()
# args = Input1, Input2, ..., Output
interfaces_info_filename = args.pop()
info_individuals = read_pickle_files(args)
compute_interfaces_info_overall(info_individuals)
- write_pickle_file(interfaces_info_filename,
- interfaces_info,
- options.write_file_only_if_changed)
+ write_pickle_file(interfaces_info_filename, interfaces_info)
if __name__ == '__main__':
diff --git a/bindings/scripts/generate_conditional_features.py b/bindings/scripts/generate_conditional_features.py
new file mode 100644
index 0000000..0028e8a
--- /dev/null
+++ b/bindings/scripts/generate_conditional_features.py
@@ -0,0 +1,250 @@
+#!/usr/bin/python
+#
+# Copyright 2017 The Chromium 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 script reads the global interface data collected by
+# compute_interfaces_info_overall.py, and writes out the code which adds
+# bindings for origin-trial-enabled features at runtime.
+
+import optparse
+import os
+import posixpath
+import sys
+from collections import defaultdict, namedtuple
+
+from code_generator import (initialize_jinja_env, normalize_and_sort_includes,
+ render_template)
+from idl_reader import IdlReader
+from utilities import (create_component_info_provider, write_file,
+ idl_filename_to_component)
+from v8_utilities import (binding_header_basename, v8_class_name,
+ v8_class_name_or_partial, uncapitalize)
+
+# Make sure extension is .py, not .pyc or .pyo, so doesn't depend on caching
+MODULE_PYNAME = os.path.splitext(os.path.basename(__file__))[0] + '.py'
+
+
+ConditionalInterfaceInfo = namedtuple('ConditionalInterfaceInfo', [
+ 'name', 'v8_class', 'v8_class_or_partial', 'is_global'])
+
+
+def get_install_functions(interfaces, feature_names):
+ """Construct a list of V8 bindings installation functions for each feature
+ on each interface.
+
+ interfaces is a list of ConditionalInterfaceInfo tuples
+ feature_names is a list of strings, containing names of features which can
+ be installed on those interfaces.
+ """
+ return [
+ {'condition': 'OriginTrials::%sEnabled' % uncapitalize(feature_name),
+ 'name': feature_name,
+ 'install_method': 'install%s' % feature_name,
+ 'interface_is_global': interface_info.is_global,
+ 'v8_class': interface_info.v8_class,
+ 'v8_class_or_partial': interface_info.v8_class_or_partial}
+ for feature_name in feature_names
+ for interface_info in interfaces]
+
+
+def get_conditional_feature_names_from_interface(interface):
+ feature_names = set()
+ if ('OriginTrialEnabled' in interface.extended_attributes and
+ interface.is_partial):
+ feature_names.add(interface.extended_attributes['OriginTrialEnabled'])
+ for operation in interface.operations:
+ if 'OriginTrialEnabled' in operation.extended_attributes:
+ feature_names.add(
+ operation.extended_attributes['OriginTrialEnabled'])
+ for attribute in interface.attributes:
+ if 'OriginTrialEnabled' in attribute.extended_attributes:
+ feature_names.add(
+ attribute.extended_attributes['OriginTrialEnabled'])
+ return feature_names
+
+
+def read_idl_file(reader, idl_filename):
+ definitions = reader.read_idl_file(idl_filename)
+ interfaces = definitions.interfaces
+ implements = definitions.implements
+ # There should only be a single interface defined in an IDL file. Return it.
+ assert len(interfaces) == 1
+ return (interfaces.values()[0], implements)
+
+
+def interface_is_global(interface):
+ return ('Global' in interface.extended_attributes or
+ 'PrimaryGlobal' in interface.extended_attributes)
+
+
+def conditional_features_info(info_provider, reader, idl_filenames, target_component, snake_case):
+ """Read a set of IDL files and compile the mapping between interfaces and
+ the conditional features defined on them.
+
+ Returns a tuple (features_for_type, types_for_feature, includes):
+ - features_for_type is a mapping of interface->feature
+ - types_for_feature is the reverse mapping: feature->interface
+ - includes is a set of header files which need to be included in the
+ generated implementation code.
+ """
+ features_for_type = defaultdict(set)
+ types_for_feature = defaultdict(set)
+ includes = set()
+
+ for idl_filename in idl_filenames:
+ interface, implements = read_idl_file(reader, idl_filename)
+ feature_names = get_conditional_feature_names_from_interface(interface)
+
+ # If this interface implements another one,
+ # it inherits any conditional features from it.
+ for implement in implements:
+ assert implement.left_interface == interface.name
+ implemented_interface, _ = read_idl_file(
+ reader,
+ info_provider.interfaces_info[implement.right_interface].get('full_path'))
+ feature_names |= get_conditional_feature_names_from_interface(implemented_interface)
+
+ feature_names = list(feature_names)
+ if feature_names:
+ is_global = interface_is_global(interface)
+ if interface.is_partial:
+ # For partial interfaces, we need to generate different
+ # includes if the parent interface is in a different
+ # component.
+ parent_interface_info = info_provider.interfaces_info[interface.name]
+ parent_interface, _ = read_idl_file(
+ reader, parent_interface_info.get('full_path'))
+ is_global = is_global or interface_is_global(parent_interface)
+ parent_component = idl_filename_to_component(
+ parent_interface_info.get('full_path'))
+ if interface.is_partial and target_component != parent_component:
+ includes.add('bindings/%s/v8/%s' %
+ (parent_component, binding_header_basename(interface.name, snake_case)))
+ includes.add('bindings/%s/v8/%s' %
+ (target_component, binding_header_basename(interface.name + 'Partial', snake_case)))
+ else:
+ includes.add('bindings/%s/v8/%s' %
+ (target_component, binding_header_basename(interface.name, snake_case)))
+ # If this is a partial interface in the same component as
+ # its parent, then treat it as a non-partial interface.
+ interface.is_partial = False
+ interface_info = ConditionalInterfaceInfo(interface.name,
+ v8_class_name(interface),
+ v8_class_name_or_partial(
+ interface),
+ is_global)
+ for feature_name in feature_names:
+ features_for_type[interface_info].add(feature_name)
+ types_for_feature[feature_name].add(interface_info)
+
+ return features_for_type, types_for_feature, includes
+
+
+def conditional_features_context(generator_name, feature_info, snake_case):
+ context = {'code_generator': generator_name}
+
+ # Unpack the feature info tuple.
+ features_for_type, types_for_feature, includes = feature_info
+
+ # Add includes needed for cpp code and normalize.
+ includes.update([
+ 'core/context_features/ContextFeatureSettings.h',
+ 'core/dom/ExecutionContext.h',
+ 'core/frame/Frame.h',
+ 'core/origin_trials/origin_trials.h',
+ 'platform/bindings/ConditionalFeatures.h',
+ 'platform/bindings/ScriptState.h',
+ # TODO(iclelland): Remove the need to explicitly include this; it is
+ # here because the ContextFeatureSettings code needs it.
+ 'bindings/core/v8/V8Window.h',
+ ])
+ context['includes'] = normalize_and_sort_includes(includes, snake_case)
+
+ # For each interface, collect a list of bindings installation functions to
+ # call, organized by conditional feature.
+ context['installers_by_interface'] = [
+ {'name': interface_info.name,
+ 'is_global': interface_info.is_global,
+ 'v8_class': interface_info.v8_class,
+ 'installers': get_install_functions([interface_info], feature_names)}
+ for interface_info, feature_names in features_for_type.items()]
+ context['installers_by_interface'].sort(key=lambda x: x['name'])
+
+ # For each conditional feature, collect a list of bindings installation
+ # functions to call, organized by interface.
+ context['installers_by_feature'] = [
+ {'name': feature_name,
+ 'name_constant': 'OriginTrials::k%sTrialName' % feature_name,
+ 'installers': get_install_functions(interfaces, [feature_name])}
+ for feature_name, interfaces in types_for_feature.items()]
+ context['installers_by_feature'].sort(key=lambda x: x['name'])
+
+ return context
+
+
+def parse_options():
+ parser = optparse.OptionParser()
+ parser.add_option('--cache-directory',
+ help='cache directory, defaults to output directory')
+ parser.add_option('--output-directory')
+ parser.add_option('--info-dir')
+ parser.add_option('--target-component',
+ type='choice',
+ choices=['Core', 'Modules'],
+ help='target component to generate code')
+ parser.add_option('--idl-files-list')
+ # TODO(tkent): Remove the option after the great mv. crbug.com/760462
+ parser.add_option('--snake-case-generated-files',
+ action='store_true', default=False)
+
+ options, _ = parser.parse_args()
+ if options.output_directory is None:
+ parser.error('Must specify output directory using --output-directory.')
+ return options
+
+
+def generate_conditional_features(info_provider, options, idl_filenames):
+ reader = IdlReader(info_provider.interfaces_info, options.cache_directory)
+ jinja_env = initialize_jinja_env(options.cache_directory)
+
+ # Extract the bidirectional mapping of conditional features <-> interfaces
+ # from the global info provider and the supplied list of IDL files.
+ feature_info = conditional_features_info(info_provider,
+ reader, idl_filenames,
+ options.target_component.lower(),
+ options.snake_case_generated_files)
+
+ # Convert that mapping into the context required for the Jinja2 templates.
+ template_context = conditional_features_context(
+ MODULE_PYNAME, feature_info, options.snake_case_generated_files)
+
+ # Generate and write out the header file
+ header_text = render_template(jinja_env.get_template(
+ 'ConditionalFeaturesFor%s.h.tmpl' % options.target_component.title()), template_context)
+ header_path = posixpath.join(options.output_directory,
+ 'ConditionalFeaturesFor%s.h' % options.target_component.title())
+ write_file(header_text, header_path)
+
+ # Generate and write out the implementation file
+ cpp_text = render_template(jinja_env.get_template(
+ 'ConditionalFeaturesFor%s.cpp.tmpl' % options.target_component.title()), template_context)
+ cpp_path = posixpath.join(options.output_directory,
+ 'ConditionalFeaturesFor%s.cpp' % options.target_component.title())
+ write_file(cpp_text, cpp_path)
+
+
+def main():
+ options = parse_options()
+
+ info_provider = create_component_info_provider(
+ os.path.normpath(options.info_dir), options.target_component.lower())
+ idl_filenames = map(str.strip, open(options.idl_files_list))
+
+ generate_conditional_features(info_provider, options, idl_filenames)
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/bindings/scripts/generate_event_interfaces.py b/bindings/scripts/generate_event_interfaces.py
index 6a2cc6a..5cc29ae 100755
--- a/bindings/scripts/generate_event_interfaces.py
+++ b/bindings/scripts/generate_event_interfaces.py
@@ -28,16 +28,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.
-"""Generate event interfaces .in file (EventInterfaces.in).
+"""Generate event interfaces .json5 file (EventInterfaces.json5).
-The event interfaces .in file contains a list of all Event interfaces, i.e.,
+The event interfaces .json5 file contains a list of all Event interfaces, i.e.,
all interfaces that inherit from Event, including Event itself,
together with certain extended attributes.
Paths are in POSIX format, and relative to Source/.
This list is used in core/ to generate EventFactory and EventNames.
-The .in format is documented in build/scripts/in_file.py.
+The .json5 format is documented in build/scripts/json5_generator.py.
"""
from optparse import OptionParser
@@ -45,7 +45,9 @@
import posixpath
import sys
-from utilities import get_file_contents, read_file_to_list, write_file, get_interface_extended_attributes_from_idl
+from utilities import (get_file_contents, get_first_interface_name_from_idl,
+ read_file_to_list, write_file,
+ get_interface_extended_attributes_from_idl)
EXPORTED_EXTENDED_ATTRIBUTES = (
'ImplementedAs',
@@ -59,7 +61,6 @@
parser = OptionParser()
parser.add_option('--event-idl-files-list', help='file listing event IDL files')
parser.add_option('--event-interfaces-file', help='output 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')
parser.add_option('--suffix', help='specify a suffix to the namespace, i.e., "Modules". Default is None.')
options, args = parser.parse_args()
@@ -67,46 +68,59 @@
parser.error('Must specify a file listing event IDL files using --event-idl-files-list.')
if options.event_interfaces_file is None:
parser.error('Must specify an output file using --event-interfaces-file.')
- 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)
if args:
parser.error('No arguments allowed, but %d given.' % len(args))
return options
-def write_event_interfaces_file(event_idl_files, destination_filename, only_if_changed, suffix):
- def extended_attribute_string(name, value):
- if name == 'RuntimeEnabled':
- value += 'Enabled'
- return name + '=' + value
-
+def write_event_interfaces_file(event_idl_files, destination_filename, suffix):
def interface_line(full_path):
- relative_path_local, _ = os.path.splitext(os.path.relpath(full_path, source_dir))
- relative_path_posix = relative_path_local.replace(os.sep, posixpath.sep)
+ relative_dir_local = os.path.dirname(os.path.relpath(full_path, source_dir))
+ relative_dir_posix = relative_dir_local.replace(os.sep, posixpath.sep)
idl_file_contents = get_file_contents(full_path)
+ interface_name = get_first_interface_name_from_idl(idl_file_contents)
extended_attributes = get_interface_extended_attributes_from_idl(idl_file_contents)
extended_attributes_list = [
- extended_attribute_string(name, extended_attributes[name])
+ (name, extended_attributes[name])
for name in EXPORTED_EXTENDED_ATTRIBUTES
if name in extended_attributes]
- return '%s %s\n' % (relative_path_posix,
- ', '.join(extended_attributes_list))
+ return (posixpath.join(relative_dir_posix, interface_name),
+ extended_attributes_list)
- lines = ['namespace="Event"\n']
+ lines = [
+ '{',
+ 'metadata: {',
+ ' namespace: "Event",'
+ ]
if suffix:
- lines.append('suffix="' + suffix + '"\n')
- lines.append('export=%s_EXPORT\n' % suffix.upper())
+ lines.append(' suffix: "' + suffix + '",')
+ lines.append(' export: "%s_EXPORT",' % suffix.upper())
else:
- lines.append('export=CORE_EXPORT\n')
- lines.append('\n')
+ lines.append(' export: "CORE_EXPORT",')
+ lines.extend([
+ '},',
+ 'data: ['
+ ])
interface_lines = [interface_line(event_idl_file)
for event_idl_file in event_idl_files]
interface_lines.sort()
- lines.extend(interface_lines)
- write_file(''.join(lines), destination_filename, only_if_changed)
+ for name, attributes in interface_lines:
+ lines.extend([
+ ' {',
+ ' name: "%s",' % name
+ ])
+ for param, value in attributes:
+ if param == 'RuntimeEnabled':
+ value += 'Enabled'
+ lines.append(' %s: "%s",' % (param, value))
+ lines.append(' },')
+ lines.extend([
+ ']',
+ '}'
+ ])
+ write_file('\n'.join(lines), destination_filename)
################################################################################
@@ -116,7 +130,6 @@
event_idl_files = read_file_to_list(options.event_idl_files_list)
write_event_interfaces_file(event_idl_files,
options.event_interfaces_file,
- options.write_file_only_if_changed,
options.suffix)
diff --git a/bindings/scripts/generate_global_constructors.py b/bindings/scripts/generate_global_constructors.py
index 6965f9a..c068fbd 100755
--- a/bindings/scripts/generate_global_constructors.py
+++ b/bindings/scripts/generate_global_constructors.py
@@ -17,17 +17,25 @@
Design document: http://www.chromium.org/developers/design-documents/idl-build
"""
+# pylint: disable=relative-import
+
import itertools
import optparse
import os
-import cPickle as pickle
import re
import sys
-from v8_utilities import EXPOSED_EXECUTION_CONTEXT_METHOD
-
from collections import defaultdict
-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
+from utilities import get_file_contents
+from utilities import get_first_interface_name_from_idl
+from utilities import get_interface_exposed_arguments
+from utilities import get_interface_extended_attributes_from_idl
+from utilities import is_non_legacy_callback_interface_from_idl
+from utilities import read_file_to_list
+from utilities import read_pickle_file
+from utilities import should_generate_impl_file_from_idl
+from utilities import write_file
+from v8_utilities import EXPOSED_EXECUTION_CONTEXT_METHOD
interface_name_to_global_names = {}
global_name_to_constructors = defaultdict(list)
@@ -42,17 +50,12 @@
parser = optparse.OptionParser()
parser.add_option('--idl-files-list', help='file listing IDL files')
parser.add_option('--global-objects-file', help='pickle file of global objects')
- 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()
if options.idl_files_list is None:
parser.error('Must specify a file listing IDL files using --idl-files-list.')
if options.global_objects_file is None:
parser.error('Must specify a pickle file of global objects using --global-objects-file.')
- if options.write_file_only_if_changed is None:
- parser.error('Must specify whether output files are 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, args
@@ -69,18 +72,16 @@
def record_global_constructors(idl_filename):
- interface_name = idl_filename_to_interface_name(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)
+ interface_name = get_first_interface_name_from_idl(idl_file_contents)
# An interface property is produced for every non-callback interface
# that does not have [NoInterfaceObject].
- # Callback interfaces with constants also have interface properties,
- # but there are none of these in Blink.
# http://heycam.github.io/webidl/#es-interfaces
if ((not should_generate_impl_file_from_idl(idl_file_contents)) or
- is_callback_interface_from_idl(idl_file_contents) or
+ is_non_legacy_callback_interface_from_idl(idl_file_contents) or
'NoInterfaceObject' in extended_attributes):
return
@@ -104,9 +105,9 @@
def generate_global_constructors_list(interface_name, extended_attributes):
extended_attributes_list = [
- name + '=' + extended_attributes[name]
- for name in 'RuntimeEnabled', 'OriginTrialEnabled'
- if name in extended_attributes]
+ name + (('=' + extended_attributes[name]) if extended_attributes[name] else '')
+ for name in 'RuntimeEnabled', 'OriginTrialEnabled', 'ContextEnabled', 'SecureContext'
+ if name in extended_attributes]
if extended_attributes_list:
extended_string = '[%s] ' % ', '.join(extended_attributes_list)
else:
@@ -131,18 +132,20 @@
return attributes_list
-def write_global_constructors_partial_interface(interface_name, idl_filename, constructor_attributes_list, only_if_changed):
+def write_global_constructors_partial_interface(interface_name, idl_filename, constructor_attributes_list):
+ idl_basename = os.path.basename(idl_filename)
+ basename = os.path.splitext(idl_basename)[0]
# FIXME: replace this with a simple Jinja template
- lines = (['partial interface %s {\n' % interface_name] +
+ lines = (['[\n',
+ ' ImplementedAs=%s\n' % basename,
+ '] partial interface %s {\n' % interface_name] +
[' %s;\n' % constructor_attribute
# FIXME: sort by interface name (not first by extended attributes)
for constructor_attribute in sorted(constructor_attributes_list)] +
['};\n'])
- write_file(''.join(lines), idl_filename, only_if_changed)
+ write_file(''.join(lines), idl_filename)
header_filename = os.path.splitext(idl_filename)[0] + '.h'
- idl_basename = os.path.basename(idl_filename)
- write_file(HEADER_FORMAT.format(idl_basename=idl_basename),
- header_filename, only_if_changed)
+ write_file(HEADER_FORMAT.format(idl_basename=idl_basename), header_filename)
################################################################################
@@ -161,8 +164,7 @@
interface_name_idl_filename = [(args[i], args[i + 1])
for i in range(0, len(args), 2)]
- with open(options.global_objects_file) as global_objects_file:
- interface_name_to_global_names.update(pickle.load(global_objects_file))
+ interface_name_to_global_names.update(read_pickle_file(options.global_objects_file))
for idl_filename in idl_files:
record_global_constructors(idl_filename)
@@ -182,10 +184,7 @@
for interface_name, idl_filename in interface_name_idl_filename:
constructors = interface_name_to_constructors(interface_name)
write_global_constructors_partial_interface(
- interface_name,
- idl_filename,
- constructors,
- options.write_file_only_if_changed)
+ interface_name, idl_filename, constructors)
if __name__ == '__main__':
diff --git a/bindings/scripts/generate_idl_diff.py b/bindings/scripts/generate_idl_diff.py
deleted file mode 100644
index ae98695..0000000
--- a/bindings/scripts/generate_idl_diff.py
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""generate_idl_diff.py is a script that generates a diff of two given IDL files.
-Usage: generate_idl_diff.py old_file.json new_file.json diff_file.json
- old_file.json: An input json file including idl data of old Chrome version
- new_file.json: An input json file including idl data of new Chrome version
- diff_file.json: An output json file expressing a diff between old_file.json
- and new_file.json
-"""
-
-import json
-import os
-import sys
-
-
-"""Data structure of input files of this script.
-The format of the json files is as follows. Each json file contains multiple
-"interface"s. Each "interface" contains 'ExtAttributes', 'Consts', 'Attributes'
-and 'Operations'. Each item in them are called a "member".
- {'InterfaceName': {
- 'ExtAttributes': [{'Name': '...'},
- ...,
- ],
- 'Consts': [{'Type': '...',
- 'Name': '...',
- 'Value': '...'
- },
- ...,
- ],
- 'Attributes': [{'Type': '...',
- 'Name': '...',
- 'ExtAttributes':[{'Name': '...'},
- ...,
- ]
- },
- ...,
- ],
- 'Operations': [{'Type': '...',
- 'Name': '...',
- 'ExtAttributes': [{'Name': '...'},
- ...,
- ]
- 'Arguments': [{'Type': '...',
- 'Name': '...'},
- ...,
- ]
- },
- ...,
- ],
- 'Name': '...'
- },
- ...,
- }
-"""
-
-
-EXTATTRIBUTES_AND_MEMBER_TYPES = ['ExtAttributes', 'Consts', 'Attributes', 'Operations']
-DIFF_INSENSITIVE_FIELDS = ['Name']
-DIFF_TAG = 'diff_tag'
-DIFF_TAG_ADDED = 'added'
-DIFF_TAG_DELETED = 'deleted'
-
-
-def load_json_file(filepath):
- """Load a json file into a dictionary.
- Args:
- filepath: A json file path of a json file that we want to load
- Returns:
- An "interfaces" object loaded from the json file
- """
- with open(filepath, 'r') as f:
- return json.load(f)
-
-
-def members_diff(old_interface, new_interface):
- """Create a diff between two "interface" objects by adding annotations to
- "member" objects that are not common in them.
- Args:
- old_interface: An "interface" object
- new_interface: An "interface" object
- Returns:
- (annotated, is_changed) where
- annotated: An annotated "interface" object
- is_changed: True if two interfaces are not identical, otherwise False
- """
- annotated = {}
- is_changed = False
- for member_type in EXTATTRIBUTES_AND_MEMBER_TYPES:
- annotated_members = []
- unannotated_members = []
- for member in new_interface[member_type]:
- if member in old_interface[member_type]:
- unannotated_members.append(member)
- old_interface[member_type].remove(member)
- else:
- is_changed = True
- member[DIFF_TAG] = DIFF_TAG_ADDED
- annotated_members.append(member)
- annotated[member_type] = annotated_members
- annotated[member_type].extend(unannotated_members)
- for member_type in EXTATTRIBUTES_AND_MEMBER_TYPES:
- for member in old_interface[member_type]:
- is_changed = True
- member[DIFF_TAG] = DIFF_TAG_DELETED
- annotated[member_type].extend(old_interface[member_type])
- for field in DIFF_INSENSITIVE_FIELDS:
- annotated[field] = old_interface[field]
- return (annotated, is_changed)
-
-
-def annotate_all_members(interface, diff_tag):
- """Add annotations to all "member" objects of |interface|.
- Args:
- interface: An "interface" object whose members should be annotated with
- |diff_tag|.
- diff_tag: DIFF_TAG_ADDED or DIFF_TAG_DELETED
- Returns:
- Annotated "interface" object
- """
- for member_type in EXTATTRIBUTES_AND_MEMBER_TYPES:
- for member in interface[member_type]:
- member[DIFF_TAG] = diff_tag
- return interface
-
-
-def interfaces_diff(old_interfaces, new_interfaces):
- """Compare two "interfaces" objects and create a diff between them by
- adding annotations (DIFF_TAG_ADDED or DIFF_TAG_DELETED) to each member
- and/or interface.
- Args:
- old_interfaces: An "interfaces" object
- new_interfaces: An "interfaces" object
- Returns:
- An "interfaces" object representing diff between |old_interfaces| and
- |new_interfaces|
- """
- annotated = {}
- for interface_name, interface in new_interfaces.items():
- if interface_name in old_interfaces:
- annotated_interface, is_changed = members_diff(old_interfaces[interface_name], interface)
- if is_changed:
- annotated[interface_name] = annotated_interface
- del old_interfaces[interface_name]
- else:
- interface = annotate_all_members(interface, DIFF_TAG_ADDED)
- interface[DIFF_TAG] = DIFF_TAG_ADDED
- annotated[interface_name] = interface
- for interface_name, interface in old_interfaces.items():
- interface = annotate_all_members(interface, DIFF_TAG_DELETED)
- interface[DIFF_TAG] = DIFF_TAG_DELETED
- annotated.update(old_interfaces)
- return annotated
-
-
-def write_diff(diff, filepath):
- """Write a diff dictionary to a json file.
- Args:
- diff: An "interfaces" object that represents a diff
- filepath: An output file path
- """
- with open(filepath, 'w') as f:
- json.dump(diff, f, indent=4)
-
-
-def main(argv):
- if len(argv) != 3:
- sys.stdout.write(
- 'Usage: make_diff.py <old_file.json> <new_file.json> '
- '<diff_file.json>\n')
- exit(1)
- old_json_file = argv[0]
- new_json_file = argv[1]
- output_file = argv[2]
- old_interfaces = load_json_file(old_json_file)
- new_interfaces = load_json_file(new_json_file)
- diff = interfaces_diff(old_interfaces, new_interfaces)
- write_diff(diff, output_file)
-
-
-if __name__ == '__main__':
- main(sys.argv[1:])
diff --git a/bindings/scripts/generate_idl_diff_test.py b/bindings/scripts/generate_idl_diff_test.py
deleted file mode 100644
index c301dce..0000000
--- a/bindings/scripts/generate_idl_diff_test.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-import generate_idl_diff
-import os
-import sys
-import unittest
-
-from generate_idl_diff import DIFF_TAG
-from generate_idl_diff import DIFF_TAG_DELETED
-from generate_idl_diff import DIFF_TAG_ADDED
-
-
-testdata_path = os.path.join(
- os.path.dirname(os.path.realpath(__file__)), 'testdata')
-old_data_path = os.path.join(testdata_path, 'old_chrome.json')
-new_data_path = os.path.join(testdata_path, 'new_chrome.json')
-
-
-class TestGenerateIDLDiff(unittest.TestCase):
-
- def setUp(self):
- old = generate_idl_diff.load_json_file('old_chrome.json')
- new = generate_idl_diff.load_json_file('new_chrome.json')
- self.diff = generate_idl_diff.interfaces_diff(old, new)
-
- def test_deleted_interface(self):
- self.assertTrue('AnimationEffectReadOnly' in self.diff)
- deleted_interface = self.diff.get('AnimationEffectReadOnly')
- self.assertIsNotNone(deleted_interface)
- self.assertEqual(deleted_interface.get(DIFF_TAG), DIFF_TAG_DELETED)
-
- def test_added_interface(self):
- self.assertTrue('AnimationEvent' in self.diff)
- added_interface = self.diff.get('AnimationEvent')
- self.assertIsNotNone(added_interface)
- self.assertEqual(added_interface.get(DIFF_TAG), DIFF_TAG_ADDED)
-
- def test_changed_interface(self):
- self.assertTrue('ANGLEInstancedArrays' in self.diff)
- changed_interface = self.diff.get('ANGLEInstancedArrays')
- self.assertIsNotNone(changed_interface)
- self.assertIsNone(changed_interface.get(DIFF_TAG))
-
- def test_unchanged_interface(self):
- self.assertFalse('AbstractWorker' in self.diff)
-
- def test_unchanged_consts(self):
- changed_interface = self.diff['ANGLEInstancedArrays']
- members = changed_interface['Consts']
- for member in members:
- self.assertEqual(member['Name'], 'VERTEX_ATTRIB_ARRAY_DIVISOR')
- self.assertEqual(member['Type'], 'unsigned long')
- self.assertEqual(member['Value'], '0x88FE')
-
- def test_changed_attribute(self):
- changed_interface = self.diff['ANGLEInstancedArrays']
- members = changed_interface['Attributes']
- for member in members:
- if member.get(DIFF_TAG) == DIFF_TAG_DELETED:
- deleted = member
- elif member.get(DIFF_TAG) == DIFF_TAG_ADDED:
- added = member
- else:
- unchanged = member
- self.assertEqual(deleted['Name'], 'animVal')
- self.assertEqual(deleted['Type'], 'SVGAngle')
- self.assertEqual(deleted['ExtAttributes'], [])
- self.assertEqual(added['Name'], 'computedTiming')
- self.assertEqual(added['Type'], 'ComputedTimingProperties')
- self.assertEqual(added['ExtAttributes'], [{"Name": "maxChannelCount"}])
- self.assertEqual(unchanged['Name'], 'timing')
- self.assertEqual(unchanged['Type'], 'AnimationEffectTiming')
- self.assertEqual(unchanged['ExtAttributes'], [])
-
- def test_changed_operation(self):
- changed_interface = self.diff['ANGLEInstancedArrays']
- members = changed_interface['Operations']
- deleted_arguments = [{"Type": "long", "Name": "primcount"}]
- added_arguments = [{"Type": "unsigned long", "Name": "mode"}]
- unchanged_arguments = [{"Type": "unsigned long", "Name": "mode"}]
- for member in members:
- if member.get(DIFF_TAG) == DIFF_TAG_DELETED:
- deleted = member
- elif member.get(DIFF_TAG) == DIFF_TAG_ADDED:
- added = member
- else:
- unchanged = member
- self.assertEqual(deleted['Name'], 'drawElementsInstancedANGLE')
- self.assertEqual(deleted['Type'], 'void')
- self.assertEqual(deleted['ExtAttributes'], [])
- self.assertEqual(deleted['Arguments'], deleted_arguments)
- self.assertEqual(added['Name'], 'drawElementsInstancedANGLE')
- self.assertEqual(added['Type'], 'void')
- self.assertEqual(added['ExtAttributes'], [])
- self.assertEqual(added['Arguments'], added_arguments)
- self.assertEqual(unchanged['Name'], 'drawArraysInstancedANGLE')
- self.assertEqual(unchanged['Type'], 'void')
- self.assertEqual(unchanged['ExtAttributes'], [])
- self.assertEqual(unchanged['Arguments'], unchanged_arguments)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/bindings/scripts/generate_init_partial_interfaces.py b/bindings/scripts/generate_init_partial_interfaces.py
index a604e57..63b782e 100755
--- a/bindings/scripts/generate_init_partial_interfaces.py
+++ b/bindings/scripts/generate_init_partial_interfaces.py
@@ -5,21 +5,24 @@
"""Generate initPartialInterfacesInModules(), which registers partial interfaces in modules to core interfaces."""
-import cPickle as pickle
+# pylint: disable=relative-import
+
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 get_file_contents
+from utilities import get_first_interface_name_from_idl
from utilities import read_idl_files_list_from_file
+from utilities import should_generate_impl_file_from_idl
+from utilities import write_file
+from v8_utilities import build_basename
_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
@@ -27,8 +30,7 @@
namespace blink {
-void initPartialInterfacesInModules()
-{
+void InitPartialInterfacesInModules() {
%s
}
@@ -39,35 +41,65 @@
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('--gyp-format-list', default=False, action='store_true', help="if specified, idl-files-list is newline separated. When unspecified, it's formatted as a Posix command line.")
- 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('--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('--gyp-format-list', default=False, action='store_true',
+ help='if specified, idl-files-list is newline separated. ' +
+ 'When unspecified, it\'s formatted as a Posix command line.')
parser.add_option('--output')
+ # TODO(tkent): Remove the option after the great mv. crbug.com/760462
+ parser.add_option('--snake-case-generated-files',
+ action='store_true', default=False)
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 extract_meta_data(file_paths):
+ """Extracts interface name from each IDL file."""
+ meta_data_list = []
+
+ for file_path in file_paths:
+ if not file_path.endswith('.idl'):
+ print 'WARNING: non-IDL file passed: "%s"' % file_path
+ continue
+ if not os.path.exists(file_path):
+ 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 content
+ basename = get_first_interface_name_from_idl(idl_file_contents)
+
+ meta_data = {
+ 'basename': basename,
+ }
+ meta_data_list.append(meta_data)
+
+ return meta_data_list
+
+
def main():
options = parse_options()
idl_file_names = read_idl_files_list_from_file(options.idl_files_list, is_gyp_format=options.gyp_format_list)
meta_data_list = extract_meta_data(idl_file_names)
- interface_names = ['V8%sPartial' % meta_data['name']
+ interface_names = ['V8%sPartial' % meta_data['basename']
for meta_data in meta_data_list]
interface_names.sort()
- includes = ['#include "bindings/modules/v8/%s.h"' % interface_name
+ includes = ['#include "bindings/modules/v8/%s"' %
+ build_basename(interface_name, options.snake_case_generated_files, ext='.h')
for interface_name in interface_names]
- initialize_calls = [' %s::initialize();' % interface_name
+ initialize_calls = [' %s::initialize();' % interface_name
for interface_name in interface_names]
content = _INIT_PARTIAL_INTERFACE % (
@@ -75,8 +107,7 @@
'\n'.join(includes),
'\n'.join(initialize_calls))
- write_file(content, options.output,
- only_if_changed=options.write_file_only_if_changed)
+ write_file(content, options.output)
if __name__ == '__main__':
diff --git a/bindings/scripts/generate_v8_context_snapshot_external_references.py b/bindings/scripts/generate_v8_context_snapshot_external_references.py
new file mode 100644
index 0000000..1fa3fae
--- /dev/null
+++ b/bindings/scripts/generate_v8_context_snapshot_external_references.py
@@ -0,0 +1,245 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=relative-import
+
+import argparse
+import os
+import posixpath
+
+from code_generator import initialize_jinja_env
+from idl_reader import IdlReader
+from utilities import create_component_info_provider, write_file
+import utilities
+import v8_attributes
+import v8_interface
+import v8_types
+import v8_utilities
+
+
+INCLUDES = frozenset([
+ 'bindings/core/v8/GeneratedCodeHelper.h',
+ 'bindings/core/v8/V8HTMLDocument.h',
+ 'bindings/core/v8/V8Initializer.h',
+ 'bindings/core/v8/V8Window.h',
+ 'platform/bindings/DOMWrapperWorld.h',
+ 'platform/bindings/V8ObjectConstructor.h',
+ 'platform/bindings/V8PerIsolateData.h',
+ 'platform/bindings/V8PrivateProperty.h',
+ 'v8/include/v8.h'])
+
+TEMPLATE_FILE = 'external_reference_table.cpp.tmpl'
+
+WHITE_LIST_INTERFACES = frozenset([
+ 'DOMMatrix', # crbug.com/733481
+])
+
+SNAPSHOTTED_INTERFACES = frozenset([
+ 'Window',
+ 'EventTarget',
+ 'HTMLDocument',
+ 'Document',
+ 'Node',
+])
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--idl-files-list', type=str, required=True,
+ help='file listing IDL files')
+ parser.add_argument('--output', type=str, required=True,
+ help='output file path')
+ parser.add_argument('--info-dir', type=str, required=True,
+ help='directory contains component info')
+ parser.add_argument('--cache-dir', type=str, required=True,
+ help='cache directory')
+ parser.add_argument('--target-component', type=str, required=True,
+ help='target component')
+ parser.add_argument('--snake-case-generated-files', action='store_true',
+ default=False)
+ return parser.parse_known_args()
+
+
+# This class creates a Jinja template context about an interface.
+class InterfaceTemplateContextBuilder(object):
+
+ def __init__(self, opts, info_provider):
+ self._opts = opts
+ self._info_provider = info_provider
+
+ def create_interface_context(self, interface, interfaces):
+ '''Creates a Jinja context which is based on an interface.'''
+
+ name = '%s%s' % (v8_utilities.cpp_name(interface), 'Partial' if interface.is_partial else '')
+
+ # Constructors
+ constructors = any(constructor.name == 'Constructor' for constructor in interface.constructors)
+ custom_constructors = interface.custom_constructors
+ html_constructor = 'HTMLConstructor' in interface.extended_attributes
+ has_constructor_callback = constructors or custom_constructors or html_constructor
+
+ attributes = []
+ methods = []
+ has_cross_origin_indexed_getter = False
+ has_cross_origin_named_enum = False
+ has_cross_origin_named_getter = False
+ has_cross_origin_named_setter = False
+ has_origin_safe_method_setter = False
+ has_security_check = False
+ indexed_property_getter = None
+ is_global = False
+ named_property_getter = None
+ if interface.name in SNAPSHOTTED_INTERFACES:
+ attributes = [v8_attributes.attribute_context(interface, attribute, interfaces)
+ for attribute in interface.attributes]
+ methods = v8_interface.methods_context(interface)['methods']
+ is_global = ('PrimaryGlobal' in interface.extended_attributes or
+ 'Global' in interface.extended_attributes)
+
+ named_property_getter = v8_interface.property_getter(
+ interface.named_property_getter, ['name'])
+ indexed_property_getter = v8_interface.property_getter(
+ interface.indexed_property_getter, ['index'])
+
+ if not interface.is_partial:
+ has_origin_safe_method_setter = is_global and any(
+ method['is_check_security_for_receiver'] and not method['is_unforgeable']
+ for method in methods)
+ has_security_check = ('CheckSecurity' in interface.extended_attributes and
+ interface.name != 'EventTarget')
+ has_cross_origin_named_getter = (any(method['is_cross_origin'] for method in methods) or
+ any(attribute['has_cross_origin_getter'] for attribute in attributes))
+ has_cross_origin_named_setter = any(attribute['has_cross_origin_setter'] for attribute in attributes)
+ has_cross_origin_indexed_getter = indexed_property_getter and indexed_property_getter['is_cross_origin']
+ has_cross_origin_named_enum = has_cross_origin_named_getter or has_cross_origin_named_setter
+ if named_property_getter and named_property_getter['is_cross_origin']:
+ has_cross_origin_named_getter = True
+
+ return {
+ 'attributes': attributes,
+ 'has_origin_safe_method_setter': has_origin_safe_method_setter,
+ 'has_constructor_callback': has_constructor_callback,
+ 'has_cross_origin_named_getter': has_cross_origin_named_getter,
+ 'has_cross_origin_named_setter': has_cross_origin_named_setter,
+ 'has_cross_origin_named_enumerator': has_cross_origin_named_enum,
+ 'has_cross_origin_indexed_getter': has_cross_origin_indexed_getter,
+ 'has_security_check': has_security_check,
+ 'indexed_property_getter': indexed_property_getter,
+ 'indexed_property_setter': v8_interface.property_setter(interface.indexed_property_setter, interface),
+ 'indexed_property_deleter': v8_interface.property_deleter(interface.indexed_property_deleter),
+ 'is_array_buffer_or_view': interface.idl_type.is_array_buffer_or_view,
+ 'is_callback': interface.is_callback,
+ 'is_partial': interface.is_partial,
+ 'is_snapshotted': interface in SNAPSHOTTED_INTERFACES,
+ 'methods': methods,
+ 'name': name,
+ 'named_constructor': v8_interface.named_constructor_context(interface),
+ 'named_property_getter': named_property_getter,
+ 'named_property_setter': v8_interface.property_setter(interface.named_property_setter, interface),
+ 'named_property_deleter': v8_interface.property_deleter(interface.named_property_deleter),
+ 'v8_name': v8_utilities.v8_class_name_or_partial(interface),
+ }
+
+
+# This class applies a Jinja template and creates a .cpp file for the external reference table.
+class ExternalReferenceTableGenerator(object):
+ def __init__(self, opts, info_provider):
+ self._opts = opts
+ self._info_provider = info_provider
+ self._reader = IdlReader(
+ info_provider.interfaces_info, opts.cache_dir)
+ self._interface_contexts = {}
+ self._include_files = set(INCLUDES)
+ v8_types.set_component_dirs(info_provider.interfaces_info['component_dirs'])
+
+ # Creates a Jinja context from an IDL file.
+ def process_idl_file(self, idl_filename):
+ definitions = self._reader.read_idl_definitions(idl_filename)
+ for component in definitions:
+ target_definitions = definitions[component]
+ interfaces = target_definitions.interfaces
+ first_name = target_definitions.first_name
+ if first_name in interfaces.keys():
+ interface = interfaces[first_name]
+ self._process_interface(interface, component, interfaces)
+
+ # Creates a Jinja context from an interface. Some interfaces are not used
+ # in V8 context snapshot, so we can skip them.
+ def _process_interface(self, interface, component, interfaces):
+ def has_impl(interface):
+ if interface.name in WHITE_LIST_INTERFACES:
+ return True
+ # Non legacy callback interface does not provide V8 callbacks.
+ if interface.is_callback:
+ return len(interface.constants) > 0
+ if 'RuntimeEnabled' in interface.extended_attributes:
+ return False
+ return True
+
+ if not has_impl(interface):
+ return
+
+ context_builder = InterfaceTemplateContextBuilder(self._opts, self._info_provider)
+ context = context_builder.create_interface_context(interface, interfaces)
+ name = '%s%s' % (interface.name, 'Partial' if interface.is_partial else '')
+ self._interface_contexts[name] = context
+ if self._opts.snake_case_generated_files:
+ include_file = 'bindings/%s/v8/%s.h' % (component, utilities.to_snake_case(context['v8_name']))
+ else:
+ include_file = 'bindings/%s/v8/%s.h' % (component, context['v8_name'])
+ self._include_files.add(include_file)
+
+ # Gathers all interface-dependent information and returns as a Jinja template context.
+ def _create_template_context(self):
+ interfaces = []
+ for name in sorted(self._interface_contexts):
+ interfaces.append(self._interface_contexts[name])
+ header_name = 'V8ContextSnapshotExternalReferences.h'
+ if self._opts.snake_case_generated_files:
+ header_name = 'v8_context_snapshot_external_references.h'
+ include_files = list(self._include_files)
+ # TODO(tkent): Update INCLUDES after the great mv, and remove the
+ # following block. crbug.com/760462
+ if self._opts.snake_case_generated_files:
+ include_files = []
+ for include in self._include_files:
+ dirname, basename = posixpath.split(include)
+ name, ext = posixpath.splitext(basename)
+ include_files.append(posixpath.join(
+ dirname, utilities.to_snake_case(name) + ext))
+ return {
+ 'class': 'V8ContextSnapshotExternalReferences',
+ 'interfaces': interfaces,
+ 'include_files': sorted(include_files),
+ 'this_include_header_name': header_name,
+ 'code_generator': os.path.basename(__file__),
+ 'jinja_template_filename': TEMPLATE_FILE
+ }
+
+ # Applies a Jinja template on a context and generates a C++ code.
+ def generate(self):
+ jinja_env = initialize_jinja_env(self._opts.cache_dir)
+ context = self._create_template_context()
+ cpp_template = jinja_env.get_template(TEMPLATE_FILE)
+ cpp_text = cpp_template.render(context)
+ return cpp_text
+
+
+def main():
+ opts, _ = parse_args()
+ # TODO(peria): get rid of |info_provider|
+ info_provider = create_component_info_provider(
+ opts.info_dir, opts.target_component)
+ generator = ExternalReferenceTableGenerator(opts, info_provider)
+
+ idl_files = utilities.read_idl_files_list_from_file(opts.idl_files_list, False)
+ for idl_file in idl_files:
+ generator.process_idl_file(idl_file)
+ output_code = generator.generate()
+ output_path = opts.output
+ write_file(output_code, output_path)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/bindings/scripts/idl_compiler.py b/bindings/scripts/idl_compiler.py
index baf2686..d876a0c 100755
--- a/bindings/scripts/idl_compiler.py
+++ b/bindings/scripts/idl_compiler.py
@@ -35,12 +35,16 @@
import abc
from optparse import OptionParser
import os
-import cPickle as pickle
import sys
-from code_generator_v8 import CodeGeneratorDictionaryImpl, CodeGeneratorV8, CodeGeneratorUnionType
+from code_generator_v8 import CodeGeneratorDictionaryImpl
+from code_generator_v8 import CodeGeneratorV8
+from code_generator_v8 import CodeGeneratorUnionType
+from code_generator_v8 import CodeGeneratorCallbackFunction
from idl_reader import IdlReader
-from utilities import create_component_info_provider, read_idl_files_list_from_file, write_file, idl_filename_to_component
+from utilities import create_component_info_provider
+from utilities import read_idl_files_list_from_file
+from utilities import write_file
def parse_options():
@@ -48,14 +52,20 @@
parser.add_option('--cache-directory',
help='cache directory, defaults to output directory')
parser.add_option('--generate-impl',
- action="store_true", default=False)
+ action='store_true', default=False)
+ # TODO(tkent): Remove the option after the great mv. crbug.com/760462
+ parser.add_option('--snake-case-generated-files',
+ action='store_true', default=False)
+ parser.add_option('--read-idl-list-from-file',
+ action='store_true', default=False)
parser.add_option('--output-directory')
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',
+ type='choice',
+ choices=['core', 'modules'],
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
@@ -64,139 +74,136 @@
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.
+ """The IDL Compiler.
- 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, cache_directory=None,
- code_generator=None, info_provider=None,
- only_if_changed=False, target_component=None):
+ code_generator_class=None, snake_case_generated_files=False,
+ info_provider=None, target_component=None):
"""
Args:
output_directory: directory to put output files.
cache_directory: directory which contains PLY caches.
- code_generator: code generator to be used.
+ code_generator_class: code generator class 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.
"""
self.cache_directory = cache_directory
- self.code_generator = code_generator
self.info_provider = info_provider
- self.only_if_changed = only_if_changed
self.output_directory = output_directory
self.target_component = target_component
self.reader = IdlReader(info_provider.interfaces_info, cache_directory)
+ self.code_generator = code_generator_class(self.info_provider,
+ self.cache_directory,
+ self.output_directory,
+ snake_case_generated_files)
def compile_and_write(self, idl_filename):
- interface_name = idl_filename_to_interface_name(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]
+ target_definitions = definitions[self.target_component]
+ interface_name = target_definitions.first_name
output_code_list = self.code_generator.generate_code(
target_definitions, interface_name)
+
+ # Generator may choose to omit the file.
+ if output_code_list is None:
+ return
+
for output_path, output_code in output_code_list:
- write_file(output_code, output_path, self.only_if_changed)
-
- @abc.abstractmethod
- def compile_file(self, idl_filename):
- pass
-
-
-class IdlCompilerV8(IdlCompiler):
- def __init__(self, *args, **kwargs):
- IdlCompiler.__init__(self, *args, **kwargs)
- self.code_generator = CodeGeneratorV8(self.info_provider,
- self.cache_directory,
- self.output_directory)
+ write_file(output_code, output_path)
def compile_file(self, idl_filename):
self.compile_and_write(idl_filename)
-class IdlCompilerDictionaryImpl(IdlCompiler):
- def __init__(self, *args, **kwargs):
- IdlCompiler.__init__(self, *args, **kwargs)
- self.code_generator = CodeGeneratorDictionaryImpl(
- 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,
+def generate_bindings(code_generator_class, info_provider, options,
+ input_filenames):
+ idl_compiler = IdlCompiler(
+ output_directory=options.output_directory,
cache_directory=options.cache_directory,
+ code_generator_class=code_generator_class,
+ snake_case_generated_files=options.snake_case_generated_files,
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.impl_output_directory,
- cache_directory=options.cache_directory,
- info_provider=info_provider,
- only_if_changed=options.write_file_only_if_changed)
-
- idl_filenames = read_idl_files_list_from_file(input_filename,
- is_gyp_format=True)
- for idl_filename in idl_filenames:
+ for idl_filename in input_filenames:
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(
+def generate_dictionary_impl(code_generator_class, info_provider, options,
+ input_filenames):
+ idl_compiler = IdlCompiler(
+ output_directory=options.impl_output_directory,
+ cache_directory=options.cache_directory,
+ code_generator_class=code_generator_class,
+ snake_case_generated_files=options.snake_case_generated_files,
+ info_provider=info_provider,
+ target_component=options.target_component)
+
+ for idl_filename in input_filenames:
+ idl_compiler.compile_file(idl_filename)
+
+
+def generate_union_type_containers(code_generator_class, info_provider,
+ options):
+ generator = code_generator_class(
info_provider,
options.cache_directory,
options.output_directory,
+ options.snake_case_generated_files,
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)
+ write_file(output_code, output_path)
+
+
+def generate_callback_function_impl(code_generator_class, info_provider,
+ options):
+ generator = code_generator_class(
+ info_provider,
+ options.cache_directory,
+ options.output_directory,
+ options.snake_case_generated_files,
+ options.target_component)
+ output_code_list = generator.generate_code()
+ for output_path, output_code in output_code_list:
+ write_file(output_code, output_path)
def main():
options, input_filename = parse_options()
- if options.generate_impl:
+ info_provider = create_component_info_provider(
+ options.info_dir, options.target_component)
+ if options.generate_impl or options.read_idl_list_from_file:
# |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)
+ input_filenames = read_idl_files_list_from_file(input_filename,
+ is_gyp_format=True)
else:
- # |input_filename| should be a path of an IDL file.
- generate_bindings(options, input_filename)
+ input_filenames = [input_filename]
+
+ if options.generate_impl:
+ if not info_provider.interfaces_info:
+ raise Exception('Interfaces info is required to generate '
+ 'impl classes')
+ generate_dictionary_impl(CodeGeneratorDictionaryImpl, info_provider,
+ options, input_filenames)
+ generate_union_type_containers(CodeGeneratorUnionType, info_provider,
+ options)
+ generate_callback_function_impl(CodeGeneratorCallbackFunction,
+ info_provider, options)
+ else:
+ generate_bindings(CodeGeneratorV8, info_provider, options,
+ input_filenames)
if __name__ == '__main__':
diff --git a/bindings/scripts/idl_definitions.py b/bindings/scripts/idl_definitions.py
index 16a8290..f2f0e54 100644
--- a/bindings/scripts/idl_definitions.py
+++ b/bindings/scripts/idl_definitions.py
@@ -26,6 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# pylint: disable=relative-import
+
"""Blink IDL Intermediate Representation (IR) classes.
Classes are primarily constructors, which build an IdlDefinitions object
@@ -52,8 +54,6 @@
IdlIterable < IdlIterableOrMaplikeOrSetlike
IdlMaplike < IdlIterableOrMaplikeOrSetlike
IdlSetlike < IdlIterableOrMaplikeOrSetlike
- IdlException < IdlInterface
- (same contents as IdlInterface)
TypedObject :: Object with one or more attributes that is a type.
@@ -64,9 +64,14 @@
import abc
-from idl_types import IdlType, IdlUnionType, IdlArrayType, IdlSequenceType, IdlNullableType
+from idl_types import IdlFrozenArrayType
+from idl_types import IdlNullableType
+from idl_types import IdlRecordType
+from idl_types import IdlSequenceType
+from idl_types import IdlType
+from idl_types import IdlUnionType
-SPECIAL_KEYWORD_LIST = ['GETTER', 'SETTER', 'DELETER']
+SPECIAL_KEYWORD_LIST = ['LEGACYCALLER', 'GETTER', 'SETTER', 'DELETER']
################################################################################
@@ -88,14 +93,14 @@
################################################################################
class IdlDefinitions(object):
- def __init__(self, idl_name, node):
+ def __init__(self, node):
"""Args: node: AST root node, class == 'File'"""
self.callback_functions = {}
self.dictionaries = {}
self.enumerations = {}
self.implements = []
self.interfaces = {}
- self.idl_name = idl_name
+ self.first_name = None
self.typedefs = {}
node_class = node.GetClass()
@@ -106,26 +111,26 @@
for child in children:
child_class = child.GetClass()
if child_class == 'Interface':
- interface = IdlInterface(idl_name, child)
+ interface = IdlInterface(child)
self.interfaces[interface.name] = interface
- elif child_class == 'Exception':
- exception = IdlException(idl_name, child)
- # For simplicity, treat exceptions as interfaces
- self.interfaces[exception.name] = exception
+ if not self.first_name:
+ self.first_name = interface.name
elif child_class == 'Typedef':
typedef = IdlTypedef(child)
self.typedefs[typedef.name] = typedef
elif child_class == 'Enum':
- enumeration = IdlEnum(idl_name, child)
+ enumeration = IdlEnum(child)
self.enumerations[enumeration.name] = enumeration
elif child_class == 'Callback':
- callback_function = IdlCallbackFunction(idl_name, child)
+ callback_function = IdlCallbackFunction(child)
self.callback_functions[callback_function.name] = callback_function
elif child_class == 'Implements':
self.implements.append(IdlImplement(child))
elif child_class == 'Dictionary':
- dictionary = IdlDictionary(idl_name, child)
+ dictionary = IdlDictionary(child)
self.dictionaries[dictionary.name] = dictionary
+ if not self.first_name:
+ self.first_name = dictionary.name
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -137,6 +142,10 @@
callback_function.accept(visitor)
for dictionary in self.dictionaries.itervalues():
dictionary.accept(visitor)
+ for enumeration in self.enumerations.itervalues():
+ enumeration.accept(visitor)
+ for implement in self.implements:
+ implement.accept(visitor)
for typedef in self.typedefs.itervalues():
typedef.accept(visitor)
@@ -166,20 +175,26 @@
################################################################################
class IdlCallbackFunction(TypedObject):
- def __init__(self, idl_name, node):
+ def __init__(self, node):
children = node.GetChildren()
num_children = len(children)
- if num_children != 2:
- raise ValueError('Expected 2 children, got %s' % num_children)
- type_node, arguments_node = children
+ if num_children < 2 or num_children > 3:
+ raise ValueError('Expected 2 or 3 children, got %s' % num_children)
+ type_node = children[0]
+ arguments_node = children[1]
+ if num_children == 3:
+ ext_attributes_node = children[2]
+ self.extended_attributes = (
+ ext_attributes_node_to_extended_attributes(ext_attributes_node))
+ else:
+ self.extended_attributes = {}
arguments_node_class = arguments_node.GetClass()
if arguments_node_class != 'Arguments':
raise ValueError('Expected Arguments node, got %s' % arguments_node_class)
- self.idl_name = idl_name
self.name = node.GetName()
self.idl_type = type_node_to_type(type_node)
- self.arguments = arguments_node_to_arguments(idl_name, arguments_node)
+ self.arguments = arguments_node_to_arguments(arguments_node)
def accept(self, visitor):
visitor.visit_callback_function(self)
@@ -192,10 +207,9 @@
################################################################################
class IdlDictionary(object):
- def __init__(self, idl_name, node):
+ def __init__(self, node):
self.extended_attributes = {}
- self.is_partial = bool(node.GetProperty('Partial'))
- self.idl_name = idl_name
+ self.is_partial = bool(node.GetProperty('PARTIAL'))
self.name = node.GetName()
self.members = []
self.parent = None
@@ -204,10 +218,10 @@
if child_class == 'Inherit':
self.parent = child.GetName()
elif child_class == 'Key':
- self.members.append(IdlDictionaryMember(idl_name, child))
+ self.members.append(IdlDictionaryMember(child))
elif child_class == 'ExtAttributes':
self.extended_attributes = (
- ext_attributes_node_to_extended_attributes(idl_name, child))
+ ext_attributes_node_to_extended_attributes(child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -218,11 +232,10 @@
class IdlDictionaryMember(TypedObject):
- def __init__(self, idl_name, node):
+ def __init__(self, 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():
@@ -233,7 +246,7 @@
self.default_value = default_node_to_idl_literal(child)
elif child_class == 'ExtAttributes':
self.extended_attributes = (
- ext_attributes_node_to_extended_attributes(idl_name, child))
+ ext_attributes_node_to_extended_attributes(child))
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -246,14 +259,15 @@
################################################################################
class IdlEnum(object):
- # FIXME: remove, just treat enums as a dictionary
- def __init__(self, idl_name, node):
- self.idl_name = idl_name
+ def __init__(self, node):
self.name = node.GetName()
self.values = []
for child in node.GetChildren():
self.values.append(child.GetName())
+ def accept(self, visitor):
+ visitor.visit_enumeration(self)
+
################################################################################
# Typedefs
@@ -271,11 +285,11 @@
################################################################################
-# Interfaces and Exceptions
+# Interfaces
################################################################################
class IdlInterface(object):
- def __init__(self, idl_name, node=None):
+ def __init__(self, node):
self.attributes = []
self.constants = []
self.constructors = []
@@ -287,67 +301,87 @@
self.stringifier = None
self.iterable = None
self.has_indexed_elements = False
+ self.has_named_property_getter = False
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 = bool(node.GetProperty('CALLBACK'))
- self.is_exception = False
- # FIXME: uppercase 'Partial' => 'PARTIAL' in base IDL parser
- self.is_partial = bool(node.GetProperty('Partial'))
- self.idl_name = idl_name
+ self.is_partial = bool(node.GetProperty('PARTIAL'))
self.name = node.GetName()
self.idl_type = IdlType(self.name)
has_indexed_property_getter = False
has_integer_typed_length = False
+ def is_blacklisted_attribute_type(idl_type):
+ return idl_type.is_callback_function or \
+ idl_type.is_dictionary or \
+ idl_type.is_record_type or \
+ idl_type.is_sequence_type
+
children = node.GetChildren()
for child in children:
child_class = child.GetClass()
if child_class == 'Attribute':
- attr = IdlAttribute(idl_name, child)
+ attr = IdlAttribute(child)
+ if is_blacklisted_attribute_type(attr.idl_type):
+ raise ValueError('Type "%s" cannot be used as an attribute.' % attr.idl_type)
if attr.idl_type.is_integer_type and attr.name == 'length':
has_integer_typed_length = True
self.attributes.append(attr)
elif child_class == 'Const':
- self.constants.append(IdlConstant(idl_name, child))
+ self.constants.append(IdlConstant(child))
elif child_class == 'ExtAttributes':
- extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
+ extended_attributes = ext_attributes_node_to_extended_attributes(child)
self.constructors, self.custom_constructors = (
- extended_attributes_to_constructors(idl_name, extended_attributes))
+ extended_attributes_to_constructors(extended_attributes))
clear_constructor_attributes(extended_attributes)
self.extended_attributes = extended_attributes
elif child_class == 'Operation':
- op = IdlOperation(idl_name, child)
- if 'getter' in op.specials and str(op.arguments[0].idl_type) == 'unsigned long':
- has_indexed_property_getter = True
+ op = IdlOperation(child)
+ if 'getter' in op.specials:
+ if str(op.arguments[0].idl_type) == 'unsigned long':
+ has_indexed_property_getter = True
+ elif str(op.arguments[0].idl_type) == 'DOMString':
+ self.has_named_property_getter = True
self.operations.append(op)
elif child_class == 'Inherit':
self.parent = child.GetName()
elif child_class == 'Serializer':
- self.serializer = IdlSerializer(idl_name, child)
+ self.serializer = IdlSerializer(child)
self.process_serializer()
elif child_class == 'Stringifier':
- self.stringifier = IdlStringifier(idl_name, child)
+ self.stringifier = IdlStringifier(child)
self.process_stringifier()
elif child_class == 'Iterable':
- self.iterable = IdlIterable(idl_name, child)
+ self.iterable = IdlIterable(child)
elif child_class == 'Maplike':
- self.maplike = IdlMaplike(idl_name, child)
+ self.maplike = IdlMaplike(child)
elif child_class == 'Setlike':
- self.setlike = IdlSetlike(idl_name, child)
+ self.setlike = IdlSetlike(child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1:
raise ValueError('Interface can only have one of iterable<>, maplike<> and setlike<>.')
+ # TODO(rakuco): This validation logic should be in v8_interface according to bashi@.
+ # At the moment, doing so does not work because several IDL files are partial Window
+ # interface definitions, and interface_dependency_resolver.py doesn't seem to have any logic
+ # to prevent these partial interfaces from resetting has_named_property to False.
+ if 'LegacyUnenumerableNamedProperties' in self.extended_attributes and \
+ not self.has_named_property_getter:
+ raise ValueError('[LegacyUnenumerableNamedProperties] can be used only in interfaces '
+ 'that support named properties.')
+
if has_integer_typed_length and has_indexed_property_getter:
self.has_indexed_elements = True
+ else:
+ if self.iterable is not None and self.iterable.key_type is None:
+ raise ValueError('Value iterators (iterable<V>) must be accompanied by an indexed '
+ 'property getter and an integer-typed length attribute.')
def accept(self, visitor):
visitor.visit_interface(self)
@@ -387,43 +421,10 @@
self.attributes.extend(other.attributes)
self.constants.extend(other.constants)
self.operations.extend(other.operations)
-
-
-class IdlException(IdlInterface):
- # Properly exceptions and interfaces are distinct, and thus should inherit a
- # common base class (say, "IdlExceptionOrInterface").
- # However, there is only one exception (DOMException), and new exceptions
- # are not expected. Thus it is easier to implement exceptions as a
- # restricted subclass of interfaces.
- # http://www.w3.org/TR/WebIDL/#idl-exceptions
- def __init__(self, idl_name, node):
- # Exceptions are similar to Interfaces, but simpler
- IdlInterface.__init__(self, idl_name)
- self.is_callback = False
- self.is_exception = True
- self.is_partial = False
- self.idl_name = idl_name
- self.name = node.GetName()
- self.idl_type = IdlType(self.name)
-
- children = node.GetChildren()
- for child in children:
- child_class = child.GetClass()
- if child_class == 'Attribute':
- attribute = IdlAttribute(idl_name, child)
- self.attributes.append(attribute)
- elif child_class == 'Const':
- self.constants.append(IdlConstant(idl_name, child))
- elif child_class == 'ExtAttributes':
- extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
- self.constructors, self.custom_constructors = (
- extended_attributes_to_constructors(idl_name, extended_attributes))
- clear_constructor_attributes(extended_attributes)
- self.extended_attributes = extended_attributes
- elif child_class == 'ExceptionOperation':
- self.operations.append(IdlOperation.from_exception_operation_node(idl_name, child))
- else:
- raise ValueError('Unrecognized node class: %s' % child_class)
+ if self.serializer is None:
+ self.serializer = other.serializer
+ if self.stringifier is None:
+ self.stringifier = other.stringifier
################################################################################
@@ -431,24 +432,23 @@
################################################################################
class IdlAttribute(TypedObject):
- def __init__(self, idl_name, node):
- 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
+ def __init__(self, node=None):
+ self.is_read_only = bool(node.GetProperty('READONLY')) if node else False
+ self.is_static = bool(node.GetProperty('STATIC')) if node else False
+ self.name = node.GetName() if node else None
self.idl_type = None
self.extended_attributes = {}
- children = node.GetChildren()
- for child in children:
- child_class = child.GetClass()
- if child_class == 'Type':
- self.idl_type = type_node_to_type(child)
- elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
- else:
- raise ValueError('Unrecognized node class: %s' % child_class)
+ if node:
+ children = node.GetChildren()
+ for child in children:
+ child_class = child.GetClass()
+ if child_class == 'Type':
+ self.idl_type = type_node_to_type(child)
+ elif child_class == 'ExtAttributes':
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
+ else:
+ raise ValueError('Unrecognized node class: %s' % child_class)
def accept(self, visitor):
visitor.visit_attribute(self)
@@ -459,7 +459,7 @@
################################################################################
class IdlConstant(TypedObject):
- def __init__(self, idl_name, node):
+ def __init__(self, node):
children = node.GetChildren()
num_children = len(children)
if num_children < 2 or num_children > 3:
@@ -470,22 +470,15 @@
if value_node_class != 'Value':
raise ValueError('Expected Value node, got %s' % value_node_class)
- self.idl_name = idl_name
self.name = node.GetName()
# ConstType is more limited than Type, so subtree is smaller and
# we don't use the full type_node_to_type function.
self.idl_type = type_node_inner_to_type(type_node)
- # FIXME: This code is unnecessarily complicated due to the rather
- # inconsistent way the upstream IDL parser outputs default values.
- # http://crbug.com/374178
- if value_node.GetProperty('TYPE') == 'float':
- self.value = value_node.GetProperty('VALUE')
- else:
- self.value = value_node.GetName()
+ self.value = value_node.GetProperty('VALUE')
if num_children == 3:
ext_attributes_node = children[2]
- self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, ext_attributes_node)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(ext_attributes_node)
else:
self.extended_attributes = {}
@@ -505,7 +498,10 @@
def __str__(self):
if self.idl_type == 'DOMString':
- return 'String("%s")' % self.value
+ if self.value:
+ return '"%s"' % self.value
+ else:
+ return 'WTF::g_empty_string'
if self.idl_type == 'integer':
return '%d' % self.value
if self.idl_type == 'float':
@@ -526,21 +522,18 @@
def default_node_to_idl_literal(node):
- # FIXME: This code is unnecessarily complicated due to the rather
- # inconsistent way the upstream IDL parser outputs default values.
- # http://crbug.com/374178
idl_type = node.GetProperty('TYPE')
+ value = node.GetProperty('VALUE')
if idl_type == 'DOMString':
- value = node.GetProperty('NAME')
if '"' in value or '\\' in value:
raise ValueError('Unsupported string value: %r' % value)
return IdlLiteral(idl_type, value)
if idl_type == 'integer':
- return IdlLiteral(idl_type, int(node.GetProperty('NAME'), base=0))
+ return IdlLiteral(idl_type, int(value, base=0))
if idl_type == 'float':
- return IdlLiteral(idl_type, float(node.GetProperty('VALUE')))
+ return IdlLiteral(idl_type, float(value))
if idl_type in ['boolean', 'sequence']:
- return IdlLiteral(idl_type, node.GetProperty('VALUE'))
+ return IdlLiteral(idl_type, value)
if idl_type == 'NULL':
return IdlLiteralNull()
raise ValueError('Unrecognized default value type: %s' % idl_type)
@@ -551,22 +544,18 @@
################################################################################
class IdlOperation(TypedObject):
- def __init__(self, idl_name, node=None):
+ def __init__(self, node=None):
self.arguments = []
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:
return
- self.name = node.GetName() # FIXME: should just be: or ''
- # FIXME: AST should use None internally
- if self.name == '_unnamed_':
- self.name = ''
+ self.name = node.GetName()
self.is_static = bool(node.GetProperty('STATIC'))
property_dictionary = node.GetProperties()
@@ -578,40 +567,19 @@
for child in children:
child_class = child.GetClass()
if child_class == 'Arguments':
- self.arguments = arguments_node_to_arguments(idl_name, child)
+ self.arguments = arguments_node_to_arguments(child)
elif child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@classmethod
- def from_exception_operation_node(cls, idl_name, node):
- # Needed to handle one case in DOMException.idl:
- # // Override in a Mozilla compatible format
- # [NotEnumerable] DOMString toString();
- # FIXME: can we remove this? replace with a stringifier?
- operation = cls(idl_name)
- operation.name = node.GetName()
- children = node.GetChildren()
- if len(children) < 1 or len(children) > 2:
- raise ValueError('ExceptionOperation node with %s children, expected 1 or 2' % len(children))
-
- type_node = children[0]
- operation.idl_type = type_node_to_type(type_node)
-
- if len(children) > 1:
- ext_attributes_node = children[1]
- operation.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, ext_attributes_node)
-
- return operation
-
- @classmethod
- def constructor_from_arguments_node(cls, name, idl_name, arguments_node):
- constructor = cls(idl_name)
+ def constructor_from_arguments_node(cls, name, arguments_node):
+ constructor = cls()
constructor.name = name
- constructor.arguments = arguments_node_to_arguments(idl_name, arguments_node)
+ constructor.arguments = arguments_node_to_arguments(arguments_node)
constructor.is_constructor = True
return constructor
@@ -626,12 +594,11 @@
################################################################################
class IdlArgument(TypedObject):
- def __init__(self, idl_name, node=None):
+ def __init__(self, node=None):
self.extended_attributes = {}
self.idl_type = None
self.is_optional = False # syntax: (optional T)
self.is_variadic = False # syntax: (T...)
- self.idl_name = idl_name
self.default_value = None
if not node:
@@ -646,7 +613,7 @@
if child_class == 'Type':
self.idl_type = type_node_to_type(child)
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
elif child_class == 'Argument':
child_name = child.GetName()
if child_name != '...':
@@ -657,27 +624,18 @@
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):
+def arguments_node_to_arguments(node):
# [Constructor] and [CustomConstructor] without arguments (the bare form)
# have None instead of an arguments node, but have the same meaning as using
# an empty argument list, [Constructor()], so special-case this.
# http://www.w3.org/TR/WebIDL/#Constructor
if node is None:
return []
- return [IdlArgument(idl_name, argument_node)
- for argument_node in node.GetChildren()]
+ return [IdlArgument(argument_node) for argument_node in node.GetChildren()]
################################################################################
@@ -685,7 +643,7 @@
################################################################################
class IdlSerializer(object):
- def __init__(self, idl_name, node):
+ def __init__(self, node):
self.attribute_name = node.GetProperty('ATTRIBUTE')
self.attribute_names = None
self.operation = None
@@ -695,12 +653,11 @@
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)
+ self.operation = IdlOperation(child)
elif child_class == 'List':
self.is_list = True
self.is_getter = bool(child.GetProperty('GETTER'))
@@ -712,7 +669,7 @@
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)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -722,22 +679,21 @@
################################################################################
class IdlStringifier(object):
- def __init__(self, idl_name, node):
+ def __init__(self, node):
self.attribute = None
self.operation = None
self.extended_attributes = {}
- self.idl_name = idl_name
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'Attribute':
- self.attribute = IdlAttribute(idl_name, child)
+ self.attribute = IdlAttribute(child)
elif child_class == 'Operation':
- operation = IdlOperation(idl_name, child)
+ operation = IdlOperation(child)
if operation.name:
self.operation = operation
elif child_class == 'ExtAttributes':
- self.extended_attributes = ext_attributes_node_to_extended_attributes(idl_name, child)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
else:
raise ValueError('Unrecognized node class: %s' % child_class)
@@ -753,14 +709,14 @@
################################################################################
class IdlIterableOrMaplikeOrSetlike(TypedObject):
- def __init__(self, idl_name, node):
+ def __init__(self, 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)
+ self.extended_attributes = ext_attributes_node_to_extended_attributes(child)
elif child_class == 'Type':
self.type_children.append(child)
else:
@@ -770,8 +726,8 @@
class IdlIterable(IdlIterableOrMaplikeOrSetlike):
idl_type_attributes = ('key_type', 'value_type')
- def __init__(self, idl_name, node):
- super(IdlIterable, self).__init__(idl_name, node)
+ def __init__(self, node):
+ super(IdlIterable, self).__init__(node)
if len(self.type_children) == 1:
self.key_type = None
@@ -790,8 +746,8 @@
class IdlMaplike(IdlIterableOrMaplikeOrSetlike):
idl_type_attributes = ('key_type', 'value_type')
- def __init__(self, idl_name, node):
- super(IdlMaplike, self).__init__(idl_name, node)
+ def __init__(self, node):
+ super(IdlMaplike, self).__init__(node)
self.is_read_only = bool(node.GetProperty('READONLY'))
@@ -809,8 +765,8 @@
class IdlSetlike(IdlIterableOrMaplikeOrSetlike):
idl_type_attributes = ('value_type',)
- def __init__(self, idl_name, node):
- super(IdlSetlike, self).__init__(idl_name, node)
+ def __init__(self, node):
+ super(IdlSetlike, self).__init__(node)
self.is_read_only = bool(node.GetProperty('READONLY'))
@@ -833,6 +789,9 @@
self.left_interface = node.GetName()
self.right_interface = node.GetProperty('REFERENCE')
+ def accept(self, visitor):
+ visitor.visit_implement(self)
+
################################################################################
# Extended attributes
@@ -849,7 +808,7 @@
self.runtime_enabled = runtime_enabled
-def ext_attributes_node_to_extended_attributes(idl_name, node):
+def ext_attributes_node_to_extended_attributes(node):
"""
Returns:
Dictionary of {ExtAttributeName: ExtAttributeValue}.
@@ -860,7 +819,6 @@
possible signatures of the custom constructor.
NamedConstructor: value is a Call node, corresponding to the single
signature of the named constructor.
- SetWrapperReferenceTo: value is an Arguments node.
"""
# Primarily just make a dictionary from the children.
# The only complexity is handling various types of constructors:
@@ -899,15 +857,6 @@
if child_class and child_class != 'Call':
raise ValueError('[NamedConstructor] only supports Call as child, but has child of class: %s' % child_class)
extended_attributes[name] = child
- 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] = 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)
@@ -915,7 +864,7 @@
if child_class == 'Arguments':
exposures = [Exposure(exposed=str(arg.idl_type),
runtime_enabled=arg.name)
- for arg in arguments_node_to_arguments('*', child)]
+ for arg in arguments_node_to_arguments(child)]
else:
value = extended_attribute_node.GetProperty('VALUE')
if type(value) is str:
@@ -939,7 +888,7 @@
return extended_attributes
-def extended_attributes_to_constructors(idl_name, extended_attributes):
+def extended_attributes_to_constructors(extended_attributes):
"""Returns constructors and custom_constructors (lists of IdlOperations).
Auxiliary function for IdlInterface.__init__.
@@ -947,12 +896,12 @@
constructor_list = extended_attributes.get('Constructors', [])
constructors = [
- IdlOperation.constructor_from_arguments_node('Constructor', idl_name, arguments_node)
+ IdlOperation.constructor_from_arguments_node('Constructor', arguments_node)
for arguments_node in constructor_list]
custom_constructor_list = extended_attributes.get('CustomConstructors', [])
custom_constructors = [
- IdlOperation.constructor_from_arguments_node('CustomConstructor', idl_name, arguments_node)
+ IdlOperation.constructor_from_arguments_node('CustomConstructor', arguments_node)
for arguments_node in custom_constructor_list]
if 'NamedConstructor' in extended_attributes:
@@ -964,7 +913,7 @@
if len(children) != 1:
raise ValueError('NamedConstructor node expects 1 child, got %s.' % len(children))
arguments_node = children[0]
- named_constructor = IdlOperation.constructor_from_arguments_node('NamedConstructor', idl_name, arguments_node)
+ named_constructor = IdlOperation.constructor_from_arguments_node('NamedConstructor', arguments_node)
# FIXME: should return named_constructor separately; appended for Perl
constructors.append(named_constructor)
@@ -987,24 +936,17 @@
def type_node_to_type(node):
children = node.GetChildren()
- if len(children) < 1 or len(children) > 2:
- raise ValueError('Type node expects 1 or 2 children (type + optional array []), got %s (multi-dimensional arrays are not supported).' % len(children))
+ if len(children) != 1 and len(children) != 2:
+ raise ValueError('Type node expects 1 or 2 child(ren), got %d.' % len(children))
base_type = type_node_inner_to_type(children[0])
+ if len(children) == 2:
+ extended_attributes = ext_attributes_node_to_extended_attributes(children[1])
+ base_type.set_extended_attributes(extended_attributes)
if node.GetProperty('NULLABLE'):
base_type = IdlNullableType(base_type)
- if len(children) == 2:
- array_node = children[1]
- array_node_class = array_node.GetClass()
- if array_node_class != 'Array':
- raise ValueError('Expected Array node as TypeSuffix, got %s node.' % array_node_class)
- array_type = IdlArrayType(base_type)
- if array_node.GetProperty('NULLABLE'):
- return IdlNullableType(array_type)
- return array_type
-
return base_type
@@ -1013,31 +955,52 @@
# Note Type*r*ef, not Typedef, meaning the type is an identifier, thus
# either a typedef shorthand (but not a Typedef declaration itself) or an
# interface type. We do not distinguish these, and just use the type name.
- if node_class in ['PrimitiveType', 'Typeref']:
+ if node_class in ['PrimitiveType', 'StringType', 'Typeref']:
# unrestricted syntax: unrestricted double | unrestricted float
is_unrestricted = bool(node.GetProperty('UNRESTRICTED'))
return IdlType(node.GetName(), is_unrestricted=is_unrestricted)
elif node_class == 'Any':
return IdlType('any')
- elif node_class == 'Sequence':
+ elif node_class in ['Sequence', 'FrozenArray']:
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')
+ elif node_class == 'Record':
+ return record_node_to_type(node)
raise ValueError('Unrecognized node class: %s' % node_class)
+def record_node_to_type(node):
+ children = node.GetChildren()
+ if len(children) != 2:
+ raise ValueError('record<K,V> node expects exactly 2 children, got %d' % (len(children)))
+ key_child = children[0]
+ value_child = children[1]
+ if key_child.GetClass() != 'StringType':
+ raise ValueError('Keys in record<K,V> nodes must be string types.')
+ if value_child.GetClass() != 'Type':
+ raise ValueError('Unrecognized node class for record<K,V> value: %s' % value_child.GetClass())
+ return IdlRecordType(IdlType(key_child.GetName()), type_node_to_type(value_child))
+
+
def sequence_node_to_type(node):
children = node.GetChildren()
+ class_name = node.GetClass()
if len(children) != 1:
- raise ValueError('Sequence node expects exactly 1 child, got %s' % len(children))
+ raise ValueError('%s node expects exactly 1 child, got %s' % (class_name, len(children)))
sequence_child = children[0]
sequence_child_class = sequence_child.GetClass()
if sequence_child_class != 'Type':
raise ValueError('Unrecognized node class: %s' % sequence_child_class)
element_type = type_node_to_type(sequence_child)
- sequence_type = IdlSequenceType(element_type)
+ if class_name == 'Sequence':
+ sequence_type = IdlSequenceType(element_type)
+ elif class_name == 'FrozenArray':
+ sequence_type = IdlFrozenArrayType(element_type)
+ else:
+ raise ValueError('Unexpected node: %s' % class_name)
if node.GetProperty('NULLABLE'):
return IdlNullableType(sequence_type)
return sequence_type
@@ -1082,6 +1045,12 @@
def visit_dictionary_member(self, member):
self.visit_typed_object(member)
+ def visit_enumeration(self, enumeration):
+ pass
+
+ def visit_implement(self, implement):
+ pass
+
def visit_interface(self, interface):
pass
diff --git a/bindings/scripts/idl_definitions_test.py b/bindings/scripts/idl_definitions_test.py
new file mode 100644
index 0000000..78dd732
--- /dev/null
+++ b/bindings/scripts/idl_definitions_test.py
@@ -0,0 +1,21 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import
+
+"""Unit tests for idl_definitions.py."""
+
+import unittest
+
+from idl_definitions import IdlAttribute
+
+
+class IdlAttributeTest(unittest.TestCase):
+
+ def test_no_params(self):
+ try:
+ IdlAttribute()
+ except Exception as exception: # pylint: disable=broad-except
+ self.fail('Creating an IdlAttribute with no parameters raised'
+ 'an exception: {}.'.format(exception))
diff --git a/bindings/scripts/idl_reader.py b/bindings/scripts/idl_reader.py
index f406c00..2bd219d 100644
--- a/bindings/scripts/idl_reader.py
+++ b/bindings/scripts/idl_reader.py
@@ -40,6 +40,7 @@
from idl_validator import EXTENDED_ATTRIBUTES_RELATIVE_PATH, IDLInvalidExtendedAttributeError, IDLExtendedAttributeValidator
from interface_dependency_resolver import InterfaceDependencyResolver
from utilities import idl_filename_to_component
+from utilities import to_snake_case
def validate_blink_idl_definitions(idl_filename, idl_file_basename,
@@ -47,7 +48,7 @@
"""Validate file contents with filename convention.
The Blink IDL conventions are:
- - If an IDL file defines an interface, a dictionary, or an exception,
+ - If an IDL file defines an interface or a dictionary,
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).
@@ -63,12 +64,17 @@
'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):
+ number_of_definitions = (
+ len(definitions.enumerations) + len(definitions.typedefs) +
+ len(definitions.callback_functions))
+ if number_of_definitions == 0:
raise Exception(
'No definition found in %s' % idl_filename)
return
target = targets[0]
- if not target.is_partial and target.name != idl_file_basename:
+ if target.is_partial:
+ return
+ if target.name != idl_file_basename and to_snake_case(target.name) != idl_file_basename:
raise Exception(
'Definition name "{0}" disagrees with IDL file basename "{1}".'
.format(target.name, idl_file_basename))
@@ -78,6 +84,7 @@
# FIXMEDART: Added multi_interface argument and property for IdlReader class.
def __init__(self, interfaces_info=None, outputdir='', multi_interface=False):
self.multi_interface = multi_interface
+
self.extended_attribute_validator = IDLExtendedAttributeValidator()
self.interfaces_info = interfaces_info
@@ -113,7 +120,7 @@
if not ast:
raise Exception('Failed to parse %s' % idl_filename)
idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
- definitions = IdlDefinitions(idl_file_basename, ast)
+ definitions = IdlDefinitions(ast)
# FIXMEDART: Added multi_interface.
if not self.multi_interface:
diff --git a/bindings/scripts/idl_types.py b/bindings/scripts/idl_types.py
index 5d776a7..05298fe 100644
--- a/bindings/scripts/idl_types.py
+++ b/bindings/scripts/idl_types.py
@@ -8,8 +8,8 @@
IdlType
IdlUnionType
IdlArrayOrSequenceType
- IdlArrayType
IdlSequenceType
+ IdlFrozenArrayType
IdlNullableType
IdlTypes are picklable because we store them in interfaces_info.
@@ -138,17 +138,18 @@
# FIXME: incorporate Nullable, etc.
# to support types like short?[] vs. short[]?, instead of treating these
# as orthogonal properties (via flags).
- callback_functions = set(STANDARD_CALLBACK_FUNCTIONS)
+ callback_functions = {}
callback_interfaces = set()
dictionaries = set()
enums = {} # name -> values
- def __init__(self, base_type, is_unrestricted=False):
+ def __init__(self, base_type, is_unrestricted=False, extended_attributes=None):
super(IdlType, self).__init__()
if is_unrestricted:
self.base_type = 'unrestricted %s' % base_type
else:
self.base_type = base_type
+ self.extended_attributes = extended_attributes
def __str__(self):
return self.base_type
@@ -156,18 +157,34 @@
def __getstate__(self):
return {
'base_type': self.base_type,
+ 'extended_attributes': self.extended_attributes,
}
def __setstate__(self, state):
self.base_type = state['base_type']
+ self.extended_attributes = state['extended_attributes']
+
+ def set_extended_attributes(self, extended_attributes):
+ self.extended_attributes = extended_attributes
@property
def is_basic_type(self):
return self.base_type in BASIC_TYPES
@property
- def is_callback_function(self):
- return self.base_type in IdlType.callback_functions
+ def is_callback_function(self): # pylint: disable=C0103
+ return self.base_type in IdlType.callback_functions or self.base_type in STANDARD_CALLBACK_FUNCTIONS
+
+ @property
+ def is_custom_callback_function(self):
+ # Treat standard callback functions as custom as they aren't generated.
+ if self.base_type in STANDARD_CALLBACK_FUNCTIONS:
+ return True
+ entry = IdlType.callback_functions.get(self.base_type)
+ callback_function = entry.get('callback_function')
+ if not callback_function:
+ return False
+ return 'Custom' in callback_function.extended_attributes
@property
def is_callback_interface(self):
@@ -196,6 +213,10 @@
return self.base_type in INTEGER_TYPES
@property
+ def is_void(self):
+ return self.base_type == 'void'
+
+ @property
def is_numeric_type(self):
return self.base_type in NUMERIC_TYPES
@@ -208,7 +229,7 @@
# Anything that is not another type is an interface type.
# http://www.w3.org/TR/WebIDL/#idl-types
# http://www.w3.org/TR/WebIDL/#idl-interface
- # In C++ these are RefPtr or PassRefPtr types.
+ # In C++ these are RefPtr types.
return not(self.is_basic_type or
self.is_callback_function or
self.is_dictionary or
@@ -282,13 +303,54 @@
self.member_types = state['member_types']
@property
+ def flattened_member_types(self):
+ """Returns the set of the union's flattened member types.
+
+ https://heycam.github.io/webidl/#dfn-flattened-union-member-types
+ """
+ # We cannot use a set directly because each member is an IdlTypeBase-derived class, and
+ # comparing two objects of the same type is not the same as comparing their names. In
+ # other words:
+ # x = IdlType('ByteString')
+ # y = IdlType('ByteString')
+ # x == y # False
+ # x.name == y.name # True
+ # |flattened_members|'s keys are type names, the values are type |objects.
+ # We assume we can use two IDL objects of the same type interchangeably.
+ flattened_members = {}
+ for member in self.member_types:
+ if member.is_nullable:
+ member = member.inner_type
+ if member.is_union_type:
+ for inner_member in member.flattened_member_types:
+ flattened_members[inner_member.name] = inner_member
+ else:
+ flattened_members[member.name] = member
+ return set(flattened_members.values())
+
+ @property
+ def number_of_nullable_member_types(self):
+ """Returns the union's number of nullable types.
+
+ http://heycam.github.io/webidl/#dfn-number-of-nullable-member-types
+ """
+ count = 0
+ for member in self.member_types:
+ if member.is_nullable:
+ count += 1
+ member = member.inner_type
+ if member.is_union_type:
+ count += member.number_of_nullable_member_types
+ return count
+
+ @property
def is_union_type(self):
return True
def single_matching_member_type(self, predicate):
- matching_types = filter(predicate, self.member_types)
+ matching_types = filter(predicate, self.flattened_member_types)
if len(matching_types) > 1:
- raise "%s is ambigious." % self.name
+ raise ValueError('%s is ambiguous.' % self.name)
return matching_types[0] if matching_types else None
@property
@@ -322,7 +384,7 @@
def resolve_typedefs(self, typedefs):
self.member_types = [
- typedefs.get(member_type, member_type)
+ member_type.resolve_typedefs(typedefs)
for member_type in self.member_types]
return self
@@ -334,11 +396,12 @@
################################################################################
-# IdlArrayOrSequenceType, IdlArrayType, IdlSequenceType
+# IdlArrayOrSequenceType, IdlSequenceType, IdlFrozenArrayType
################################################################################
+# TODO(bashi): Rename this like "IdlArrayTypeBase" or something.
class IdlArrayOrSequenceType(IdlTypeBase):
- """Base class for IdlArrayType and IdlSequenceType."""
+ """Base class for array-like types."""
def __init__(self, element_type):
super(IdlArrayOrSequenceType, self).__init__()
@@ -361,6 +424,14 @@
return True
@property
+ def is_sequence_type(self):
+ return False
+
+ @property
+ def is_frozen_array(self):
+ return False
+
+ @property
def enum_values(self):
return self.element_type.enum_values
@@ -374,18 +445,6 @@
yield idl_type
-class IdlArrayType(IdlArrayOrSequenceType):
- def __init__(self, element_type):
- super(IdlArrayType, self).__init__(element_type)
-
- def __str__(self):
- return '%s[]' % self.element_type
-
- @property
- def name(self):
- return self.element_type.name + 'Array'
-
-
class IdlSequenceType(IdlArrayOrSequenceType):
def __init__(self, element_type):
super(IdlSequenceType, self).__init__(element_type)
@@ -397,6 +456,70 @@
def name(self):
return self.element_type.name + 'Sequence'
+ @property
+ def is_sequence_type(self):
+ return True
+
+
+class IdlFrozenArrayType(IdlArrayOrSequenceType):
+ def __init__(self, element_type):
+ super(IdlFrozenArrayType, self).__init__(element_type)
+
+ def __str__(self):
+ return 'FrozenArray<%s>' % self.element_type
+
+ @property
+ def name(self):
+ return self.element_type.name + 'Array'
+
+ @property
+ def is_frozen_array(self):
+ return True
+
+
+################################################################################
+# IdlRecordType
+################################################################################
+
+class IdlRecordType(IdlTypeBase):
+ def __init__(self, key_type, value_type):
+ super(IdlRecordType, self).__init__()
+ self.key_type = key_type
+ self.value_type = value_type
+
+ def __str__(self):
+ return 'record<%s, %s>' % (self.key_type, self.value_type)
+
+ def __getstate__(self):
+ return {
+ 'key_type': self.key_type,
+ 'value_type': self.value_type,
+ }
+
+ def __setstate__(self, state):
+ self.key_type = state['key_type']
+ self.value_type = state['value_type']
+
+ def idl_types(self):
+ yield self
+ for idl_type in self.key_type.idl_types():
+ yield idl_type
+ for idl_type in self.value_type.idl_types():
+ yield idl_type
+
+ def resolve_typedefs(self, typedefs):
+ self.key_type = self.key_type.resolve_typedefs(typedefs)
+ self.value_type = self.value_type.resolve_typedefs(typedefs)
+ return self
+
+ @property
+ def is_record_type(self):
+ return True
+
+ @property
+ def name(self):
+ return self.key_type.name + self.value_type.name + 'Record'
+
################################################################################
# IdlNullableType
diff --git a/bindings/scripts/idl_types_test.py b/bindings/scripts/idl_types_test.py
new file mode 100644
index 0000000..e360d5a
--- /dev/null
+++ b/bindings/scripts/idl_types_test.py
@@ -0,0 +1,174 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import
+
+"""Unit tests for idl_types.py."""
+
+import unittest
+
+from idl_types import IdlNullableType
+from idl_types import IdlRecordType
+from idl_types import IdlSequenceType
+from idl_types import IdlType
+from idl_types import IdlUnionType
+
+
+class IdlTypeTest(unittest.TestCase):
+
+ def test_is_void(self):
+ idl_type = IdlType('void')
+ self.assertTrue(idl_type.is_void)
+ idl_type = IdlType('somethingElse')
+ self.assertFalse(idl_type.is_void)
+
+
+class IdlRecordTypeTest(unittest.TestCase):
+
+ def test_idl_types(self):
+ idl_type = IdlRecordType(IdlType('USVString'), IdlType('long'))
+ idl_types = list(idl_type.idl_types())
+ self.assertEqual(len(idl_types), 3)
+ self.assertIs(idl_types[0], idl_type)
+ self.assertEqual(idl_types[1].name, 'USVString')
+ self.assertEqual(idl_types[2].name, 'Long')
+ self.assertListEqual(list(idl_type.idl_types()),
+ [idl_type, idl_type.key_type, idl_type.value_type])
+
+ idl_type = IdlRecordType(IdlType('DOMString'), IdlSequenceType(IdlType('unrestricted float')))
+ idl_types = list(idl_type.idl_types())
+ self.assertEqual(len(idl_types), 4)
+ self.assertIs(idl_types[0], idl_type)
+ self.assertEqual(idl_types[1].name, 'String')
+ self.assertEqual(idl_types[2].name, 'UnrestrictedFloatSequence')
+ self.assertEqual(idl_types[3].name, 'UnrestrictedFloat')
+ self.assertListEqual(list(idl_type.idl_types()),
+ [idl_type, idl_type.key_type, idl_type.value_type, idl_type.value_type.element_type])
+
+ idl_type = IdlRecordType(IdlType('ByteString'),
+ IdlRecordType(IdlType('DOMString'), IdlType('octet')))
+ idl_types = list(idl_type.idl_types())
+ self.assertEqual(len(idl_types), 5)
+ self.assertIs(idl_types[0], idl_type)
+ self.assertEqual(idl_types[1].name, 'ByteString')
+ self.assertEqual(idl_types[2].name, 'StringOctetRecord')
+ self.assertEqual(idl_types[3].name, 'String')
+ self.assertEqual(idl_types[4].name, 'Octet')
+ self.assertListEqual(list(idl_type.idl_types()),
+ [idl_type, idl_type.key_type, idl_type.value_type, idl_type.value_type.key_type,
+ idl_type.value_type.value_type])
+
+ def test_is_record(self):
+ idl_type = IdlType('USVString')
+ self.assertFalse(idl_type.is_record_type)
+ idl_type = IdlSequenceType(IdlRecordType(IdlType('DOMString'), IdlType('byte')))
+ self.assertFalse(idl_type.is_record_type)
+ idl_type = IdlRecordType(IdlType('USVString'), IdlType('long'))
+ self.assertTrue(idl_type.is_record_type)
+ idl_type = IdlRecordType(IdlType('USVString'), IdlSequenceType(IdlType('boolean')))
+ self.assertTrue(idl_type.is_record_type)
+
+ def test_name(self):
+ idl_type = IdlRecordType(IdlType('ByteString'), IdlType('octet'))
+ self.assertEqual(idl_type.name, 'ByteStringOctetRecord')
+ idl_type = IdlRecordType(IdlType('USVString'), IdlSequenceType(IdlType('double')))
+ self.assertEqual(idl_type.name, 'USVStringDoubleSequenceRecord')
+ idl_type = IdlRecordType(IdlType('DOMString'),
+ IdlRecordType(IdlType('ByteString'),
+ IdlSequenceType(IdlType('unsigned short'))))
+ self.assertEqual(idl_type.name, 'StringByteStringUnsignedShortSequenceRecordRecord')
+
+
+class IdlUnionTypeTest(unittest.TestCase):
+
+ def test_flattened_member_types(self):
+ # We are only testing the algorithm here, so we do create some ambiguous union types.
+
+ def compare_flattened_members(actual, expected):
+ """Compare a set of IDL types by name, as the objects are different"""
+ actual_names = set([member.name for member in actual])
+ expected_names = set([member.name for member in expected])
+ self.assertEqual(actual_names, expected_names)
+
+ idl_type = IdlUnionType([IdlType('long'), IdlType('SomeInterface')])
+ compare_flattened_members(
+ idl_type.flattened_member_types,
+ set([IdlType('long'), IdlType('SomeInterface')]))
+
+ idl_type = IdlUnionType([IdlUnionType([IdlType('ByteString'), IdlType('float')]),
+ IdlType('boolean')])
+ compare_flattened_members(
+ idl_type.flattened_member_types,
+ set([IdlType('float'), IdlType('boolean'), IdlType('ByteString')]))
+
+ idl_type = IdlUnionType([IdlUnionType([IdlType('ByteString'), IdlType('DOMString')]),
+ IdlType('DOMString')])
+ compare_flattened_members(
+ idl_type.flattened_member_types,
+ set([IdlType('DOMString'), IdlType('ByteString')]))
+
+ idl_type = IdlUnionType(
+ [IdlNullableType(IdlType('ByteString')), IdlType('byte')])
+ compare_flattened_members(
+ idl_type.flattened_member_types,
+ set([IdlType('ByteString'), IdlType('byte')]))
+
+ idl_type = IdlUnionType(
+ [IdlNullableType(IdlType('ByteString')), IdlType('byte'),
+ IdlUnionType([IdlType('ByteString'), IdlType('float')])])
+ self.assertEqual(len(idl_type.flattened_member_types), 3)
+ compare_flattened_members(
+ idl_type.flattened_member_types,
+ set([IdlType('ByteString'), IdlType('byte'), IdlType('float')]))
+
+ # From the example in the spec: "the flattened member types of the union type (Node or (sequence<long> or Event) or
+ # (XMLHttpRequest or DOMString)? or sequence<(sequence<double> or NodeList)>) are the six types Node, sequence<long>,
+ # Event, XMLHttpRequest, DOMString and sequence<(sequence<double> or NodeList)>"
+ idl_type = IdlUnionType(
+ [IdlType('Node'),
+ IdlUnionType([IdlSequenceType(IdlType('long')), IdlType('Event')]),
+ IdlNullableType(IdlUnionType([IdlType('XMLHttpRequest'), IdlType('DOMString')])),
+ IdlSequenceType(IdlUnionType([IdlSequenceType(IdlType('double')), IdlType('NodeList')]))])
+ self.assertEqual(len(idl_type.flattened_member_types), 6)
+ compare_flattened_members(
+ idl_type.flattened_member_types,
+ set([IdlType('Node'), IdlSequenceType(IdlType('long')), IdlType('Event'),
+ IdlType('XMLHttpRequest'), IdlType('DOMString'),
+ IdlSequenceType(IdlUnionType([IdlSequenceType(IdlType('double')), IdlType('NodeList')]))]))
+
+ def test_resolve_typedefs(self):
+ # This is a simplification of the typedef mechanism to avoid having to
+ # use idl_definitions and use actual nodes from //tools/idl_parser.
+ typedefs = {
+ 'Foo': IdlType('unsigned short'),
+ 'MyBooleanType': IdlType('boolean'),
+ 'SomeInterfaceT': IdlType('MyInterface'),
+ }
+
+ # (long long or MyBooleanType)
+ union = IdlUnionType([IdlType('long long'), IdlType('MyBooleanType')]).resolve_typedefs(typedefs)
+ self.assertEqual(union.name, 'LongLongOrBoolean')
+ self.assertEqual(union.member_types[0].name, 'LongLong')
+ self.assertEqual(union.member_types[1].name, 'Boolean')
+
+ # (Foo or SomeInterfaceT)
+ union = IdlUnionType([IdlType('Foo'), IdlType('SomeInterfaceT')]).resolve_typedefs(typedefs)
+ self.assertEqual(union.name, 'UnsignedShortOrMyInterface')
+ self.assertEqual(union.member_types[0].name, 'UnsignedShort')
+ self.assertEqual(union.member_types[1].name, 'MyInterface')
+
+ # (Foo or sequence<(MyBooleanType or double)>)
+ union = IdlUnionType([
+ IdlType('Foo'),
+ IdlSequenceType(IdlUnionType([IdlType('MyBooleanType'),
+ IdlType('double')]))]).resolve_typedefs(typedefs)
+ self.assertEqual(union.name, 'UnsignedShortOrBooleanOrDoubleSequence')
+ self.assertEqual(union.member_types[0].name, 'UnsignedShort')
+ self.assertEqual(union.member_types[1].name, 'BooleanOrDoubleSequence')
+ self.assertEqual(union.member_types[1].element_type.name, 'BooleanOrDouble')
+ self.assertEqual(union.member_types[1].element_type.member_types[0].name,
+ 'Boolean')
+ self.assertEqual(union.member_types[1].element_type.member_types[1].name,
+ 'Double')
+ self.assertEqual(2, len(union.flattened_member_types))
diff --git a/bindings/scripts/interface_dependency_resolver.py b/bindings/scripts/interface_dependency_resolver.py
index 2fa6409..239f11e 100644
--- a/bindings/scripts/interface_dependency_resolver.py
+++ b/bindings/scripts/interface_dependency_resolver.py
@@ -45,7 +45,9 @@
# which changes the semantics and yields different code than the same extended
# attribute on the main interface.
DEPENDENCY_EXTENDED_ATTRIBUTES = frozenset([
+ 'OriginTrialEnabled',
'RuntimeEnabled',
+ 'SecureContext',
])
@@ -160,10 +162,9 @@
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)
+ dependency_idl_filename)
# We need to use different checkdeps here for partial interface and
# inheritance.
@@ -201,8 +202,8 @@
# 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));
+ # DOMWindow* impl = V8Window::ToImpl(holder);
+ # DOMWindowQuota* 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
@@ -245,7 +246,7 @@
return resolved_definitions
-def transfer_extended_attributes(dependency_interface, dependency_interface_basename):
+def transfer_extended_attributes(dependency_interface, dependency_idl_filename):
"""Transfer extended attributes from dependency interface onto members.
Merging consists of storing certain interface-level data in extended
@@ -253,24 +254,29 @@
interface post-merging).
The data storing consists of:
- * applying certain extended attributes from the dependency interface
- to its members
+ * moving certain extended attributes from the dependency interface
+ to its members (deleting the extended attribute from the interface)
* storing the C++ class of the implementation in an internal
extended attribute of each member, [PartialInterfaceImplementedAs]
No return: modifies dependency_interface in place.
"""
- merged_extended_attributes = dict(
- (key, value)
- for key, value in dependency_interface.extended_attributes.iteritems()
- if key in DEPENDENCY_EXTENDED_ATTRIBUTES)
+ merged_extended_attributes = {}
+ for key in DEPENDENCY_EXTENDED_ATTRIBUTES:
+ if key not in dependency_interface.extended_attributes:
+ continue
+
+ merged_extended_attributes[key] = dependency_interface.extended_attributes[key]
+ # Remove the merged attributes from the original dependency interface.
+ # This ensures that if other dependency interfaces are merged onto this
+ # one, its extended_attributes do not leak through
+ # (https://crbug.com/603782).
+ del dependency_interface.extended_attributes[key]
# A partial interface's members are implemented as static member functions
# in a separate C++ class. This class name is stored in
- # [PartialInterfaceImplementedAs] which defaults to the basename of
- # dependency IDL file.
- # This class name can be overridden by [ImplementedAs] on the partial
- # interface definition.
+ # [PartialInterfaceImplementedAs] which is copied from [ImplementedAs] on
+ # the partial interface definition.
#
# Note that implemented interfaces do *not* need [ImplementedAs], since
# they are implemented on the C++ object |impl| itself, just like members of
@@ -288,11 +294,17 @@
# for Blink class name and function name (or constant name), respectively.
# Thus we do not want to copy this from the interface to the member, but
# instead extract it and handle it separately.
- if (dependency_interface.is_partial or
- 'LegacyTreatAsPartialInterface' in dependency_interface.extended_attributes):
+ if dependency_interface.is_partial:
+ if 'ImplementedAs' not in dependency_interface.extended_attributes:
+ raise ValueError('Partial interface in %s must have ImplementedAs.'
+ % dependency_idl_filename)
+ merged_extended_attributes['PartialInterfaceImplementedAs'] = \
+ dependency_interface.extended_attributes.pop('ImplementedAs')
+ elif 'LegacyTreatAsPartialInterface' in \
+ dependency_interface.extended_attributes:
merged_extended_attributes['PartialInterfaceImplementedAs'] = (
- dependency_interface.extended_attributes.get(
- 'ImplementedAs', dependency_interface_basename))
+ dependency_interface.extended_attributes.pop(
+ 'ImplementedAs', dependency_interface.name))
def update_attributes(attributes, extras):
for key, value in extras.items():
@@ -311,9 +323,9 @@
"""Inherits [Unforgeable] attributes and updates the arguments accordingly.
For each interface in |resolved_definitions|, collects all [Unforgeable]
- attributes in ancestor interfaces in the same component and adds them to
- the interface. 'referenced_interfaces' and 'cpp_includes' in
- |interfaces_info| are updated accordingly.
+ attributes in ancestor interfaces and adds them to the interface.
+ 'referenced_interfaces' and 'cpp_includes' in |interfaces_info| are updated
+ accordingly.
"""
def collect_unforgeable_attributes_in_ancestors(interface_name, component):
if not interface_name:
@@ -321,7 +333,7 @@
return [], [], set()
interface = interfaces_info[interface_name]
unforgeable_attributes, referenced_interfaces, cpp_includes = collect_unforgeable_attributes_in_ancestors(interface.get('parent'), component)
- this_unforgeable = interface.get('unforgeable_attributes', {}).get(component, [])
+ this_unforgeable = interface.get('unforgeable_attributes', [])
unforgeable_attributes.extend(this_unforgeable)
this_referenced = [attr.idl_type.base_type for attr in this_unforgeable
if attr.idl_type.base_type in
diff --git a/bindings/scripts/overload_set_algorithm.py b/bindings/scripts/overload_set_algorithm.py
new file mode 100644
index 0000000..6425a84
--- /dev/null
+++ b/bindings/scripts/overload_set_algorithm.py
@@ -0,0 +1,130 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# coding=utf-8
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from collections import Counter
+import itertools
+from operator import itemgetter
+
+
+def sort_and_groupby(list_to_sort, key=None):
+ """Returns a generator of (key, list), sorting and grouping list by key."""
+ list_to_sort.sort(key=key)
+ return ((k, list(g)) for k, g in itertools.groupby(list_to_sort, key))
+
+
+def effective_overload_set(F): # pylint: disable=invalid-name
+ """Returns the effective overload set of an overloaded function.
+
+ An effective overload set is the set of overloaded functions + signatures
+ (type list of arguments, with optional and variadic arguments included or
+ not), and is used in the overload resolution algorithm.
+
+ For example, given input [f1(optional long x), f2(DOMString s)], the output
+ is informally [f1(), f1(long), f2(DOMString)], and formally
+ [(f1, [], []), (f1, [long], [optional]), (f2, [DOMString], [required])].
+
+ Currently the optionality list is a list of |is_optional| booleans (True
+ means optional, False means required); to support variadics this needs to
+ be tri-valued as required, optional, or variadic.
+
+ Formally:
+ An effective overload set represents the allowable invocations for a
+ particular operation, constructor (specified with [Constructor] or
+ [NamedConstructor]), legacy caller or callback function.
+
+ An additional argument N (argument count) is needed when overloading
+ variadics, but we don't use that currently.
+
+ Spec: http://heycam.github.io/webidl/#dfn-effective-overload-set
+
+ Formally the input and output lists are sets, but methods are stored
+ internally as dicts, which can't be stored in a set because they are not
+ hashable, so we use lists instead.
+
+ Arguments:
+ F: list of overloads for a given callable name.
+ value_reader: an OverloadSetValueReader instance.
+
+ Returns:
+ S: list of tuples of the form (callable, type list, optionality list).
+ """
+ # Code closely follows the algorithm in the spec, for clarity and
+ # correctness, and hence is not very Pythonic.
+
+ # 1. Initialize S to ∅.
+ # (We use a list because we can't use a set, as noted above.)
+ S = [] # pylint: disable=invalid-name
+
+ # 2. Let F be a set with elements as follows, according to the kind of
+ # effective overload set:
+ # (Passed as argument, nothing to do.)
+
+ # 3. & 4. (maxarg, m) are only needed for variadics, not used.
+
+ # 5. For each operation, extended attribute or callback function X in F:
+ for X in F: # X is the "callable". pylint: disable=invalid-name
+ arguments = X['arguments'] # pylint: disable=invalid-name
+ # 1. Let n be the number of arguments X is declared to take.
+ n = len(arguments) # pylint: disable=invalid-name
+ # 2. Let t0..n−1 be a list of types, where ti is the type of X’s
+ # argument at index i.
+ # (“type list”)
+ t = tuple(argument['idl_type_object'] # pylint: disable=invalid-name
+ for argument in arguments)
+ # 3. Let o0..n−1 be a list of optionality values, where oi is “variadic”
+ # 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/variadic vs. required.)
+ o = tuple(argument['is_optional'] # pylint: disable=invalid-name
+ 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:
+ # (Not used, so not implemented.)
+ # 6. Initialize i to n−1.
+ i = n - 1
+ # 7. While i ≥ 0:
+ # Spec bug (fencepost error); should be “While i > 0:”
+ # https://www.w3.org/Bugs/Public/show_bug.cgi?id=25590
+ while i > 0:
+ # 1. If argument i of X is not optional, then break this loop.
+ if not o[i]:
+ break
+ # 2. Otherwise, add to S the tuple <X, t0..i−1, o0..i−1>.
+ S.append((X, t[:i], o[:i]))
+ # 3. Set i to i−1.
+ i = i - 1
+ # 8. If n > 0 and all arguments of X are optional, then add to S the
+ # tuple <X, (), ()> (where “()” represents the empty list).
+ if n > 0 and all(oi for oi in o):
+ S.append((X, (), ()))
+ # 6. The effective overload set is S.
+ return S
+
+
+def effective_overload_set_by_length(overloads):
+ def type_list_length(entry):
+ # Entries in the effective overload set are 3-tuples:
+ # (callable, type list, optionality list)
+ return len(entry[1])
+
+ effective_overloads = effective_overload_set(overloads)
+ return list(sort_and_groupby(effective_overloads, type_list_length))
+
+
+def method_overloads_by_name(methods):
+ """Returns generator of overloaded methods by name: [name, [method]]"""
+ # Filter to only methods that are actually overloaded
+ method_counts = Counter(method['name'] for method in methods)
+ overloaded_method_names = set(name
+ for name, count in method_counts.iteritems()
+ if count > 1)
+ overloaded_methods = [method for method in methods
+ if method['name'] in overloaded_method_names]
+
+ # Group by name (generally will be defined together, but not necessarily)
+ return sort_and_groupby(overloaded_methods, itemgetter('name'))
diff --git a/bindings/scripts/overload_set_algorithm_test.py b/bindings/scripts/overload_set_algorithm_test.py
new file mode 100644
index 0000000..389a9ed
--- /dev/null
+++ b/bindings/scripts/overload_set_algorithm_test.py
@@ -0,0 +1,163 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import,protected-access
+
+"""Unit tests for overload_set_algorithm.py."""
+
+import unittest
+from overload_set_algorithm import effective_overload_set
+
+
+class EffectiveOverloadSetTest(unittest.TestCase):
+ def test_example_in_comments(self):
+ operation_list = [
+ {'arguments': [{'idl_type_object': 'long', # f1(optional long x)
+ 'is_optional': True,
+ 'is_variadic': False}]},
+ {'arguments': [{'idl_type_object': 'DOMString', # f2(DOMString s)
+ 'is_optional': False,
+ 'is_variadic': False}]}]
+
+ overload_set = [
+ ({'arguments': [{'idl_type_object': 'long', # f1(long)
+ 'is_optional': True,
+ 'is_variadic': False}]},
+ ('long',),
+ (True,)),
+ ({'arguments': [{'idl_type_object': 'long', # f1()
+ 'is_optional': True,
+ 'is_variadic': False}]},
+ (),
+ ()),
+ ({'arguments': [{'idl_type_object': 'DOMString', # f2(DOMString)
+ 'is_optional': False,
+ 'is_variadic': False}]},
+ ('DOMString',),
+ (False,))]
+
+ self.assertEqual(effective_overload_set(operation_list), overload_set)
+
+ def test_example_in_spec(self):
+ """Tests the example provided in Web IDL spec:
+ https://heycam.github.io/webidl/#dfn-effective-overload-set,
+ look for example right after the algorithm.
+
+ The output differs from spec because we don't implement the part
+ of the algorithm that handles variadic arguments."""
+ operation_list = [
+ # f1: f(DOMString a)
+ {'arguments': [{'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False}]},
+ # f2: f(Node a, DOMString b, double... c)
+ {'arguments': [{'idl_type_object': 'Node',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]},
+ # f3: f()
+ {'arguments': []},
+ # f4: f(Event a, DOMString b, optional DOMString c, double... d)
+ {'arguments': [{'idl_type_object': 'Event',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': True,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]}]
+ overload_set = [
+ # <f1, (DOMString), (required)>
+ ({'arguments': [{'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False}]},
+ ('DOMString',),
+ (False,)),
+ # <f2, (Node, DOMString, double), (required, required, variadic)>
+ ({'arguments': [{'idl_type_object': 'Node',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]},
+ ('Node', 'DOMString', 'double'),
+ (False, False, True)),
+ # <f2, (Node, DOMString), (required, required)>
+ ({'arguments': [{'idl_type_object': 'Node',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]},
+ ('Node', 'DOMString'),
+ (False, False)),
+ # Missing from the output:
+ # <f2, (Node, DOMString, double, double),
+ # (required, required, variadic, variadic)>,
+ # <f3, (), ()>
+ ({'arguments': []}, (), ()),
+ # <f4, (Event, DOMString, DOMString, double),
+ # (required, required, optional, variadic)>
+ ({'arguments': [{'idl_type_object': 'Event',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': True,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]},
+ ('Event', 'DOMString', 'DOMString', 'double'),
+ (False, False, True, True)),
+ # <f4, (Event, DOMString, DOMString),
+ # (required, required, optional)>
+ ({'arguments': [{'idl_type_object': 'Event',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': True,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]},
+ ('Event', 'DOMString', 'DOMString'),
+ (False, False, True)),
+ # <f4, (Event, DOMString), (required, required)>
+ ({'arguments': [{'idl_type_object': 'Event',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': False,
+ 'is_variadic': False},
+ {'idl_type_object': 'DOMString',
+ 'is_optional': True,
+ 'is_variadic': False},
+ {'idl_type_object': 'double',
+ 'is_optional': False,
+ 'is_variadic': True}]},
+ ('Event', 'DOMString'),
+ (False, False))]
+
+ self.assertEqual(effective_overload_set(operation_list), overload_set)
diff --git a/bindings/scripts/print_idl_diff.py b/bindings/scripts/print_idl_diff.py
deleted file mode 100644
index 9a8deea..0000000
--- a/bindings/scripts/print_idl_diff.py
+++ /dev/null
@@ -1,433 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""Print a diff generated by generate_idl_diff.py.
-Before printing, sort the diff in the alphabetical order or the order of
-diffing tags.
-Usage: print_idl_diff.py diff_file.json order
- diff.json:
- Output of generate_idl_diff.py. The json file contains a dictionary
- that represents a diff between two different Chromium versions. The
- structure of the dictionary is like below.
- order:
- Specify how to sort. Either by "ALPHABET" or "TAG".
-"""
-
-from collections import OrderedDict
-import json
-import sys
-
-from generate_idl_diff import load_json_file
-from generate_idl_diff import EXTATTRIBUTES_AND_MEMBER_TYPES
-from generate_idl_diff import DIFF_TAG
-from generate_idl_diff import DIFF_TAG_ADDED
-from generate_idl_diff import DIFF_TAG_DELETED
-
-
-"""Refer to the explanation of generate_idl_diff.py's input files.
-The deffference between the input structure of generate_idl_diff.py and
-that of print_diff.py is whether diffing tags are included or not.
- {'Interface': {
- 'diff_tag': 'deleted'
- 'ExtAttributes': [{'Name': '...'
- 'diff_tag': 'deleted'},
- ...,
- ],
- 'Consts': [{'Type': '...',
- 'Name': '...',
- 'Value': '...'
- 'diff_tag': 'deleted'},
- ...,
- ],
- 'Attributes': [{'Type': '...',
- 'Name': '...',
- 'ExtAttributes':[{'Name': '...'},
- ...,
- ]
- 'diff_tag': 'deleted'},
- ...,
- ],
- 'Operations': [{'Type': '...',
- 'Name': '...',
- 'ExtAttributes':[{'Name': '...'},
- ...,
- ],
- 'Arguments': [{'Type': '...',
- 'Name': '...'},
- ...,
- ]
- 'diff_tag': 'deleted'},
- ...,
- ],
- 'Name': '...'
- },
- {
- 'ExtAttributes': [{'Name': '...'},
- ...,
- ],
- 'Consts': [{'Type': '...',
- 'Name': '...',
- 'Value': '...'
- 'diff_tag': 'added'},
- ...,
- ],
- 'Attributes': [{'Type': '...',
- 'Name': '...',
- 'ExtAttributes':[{'Name': '...'},
- ...,
- ]},
- ...,
- ],
- 'Operations': [{'Type': '...',
- 'Name': '...',
- 'ExtAttributes':[{'Name': '...'},
- ...,
- ],
- 'Arguments': [{'Type': '...',
- 'Name': '...'},
- ...,
- ]
- 'diff_tag': 'deleted'},
- ...,
- ],
- 'Name': '...'
- },
- ...,
- }
-"""
-
-
-class Colorize(object):
- """This class outputs a colored text to sys.stdout.
- TODO(bashi): This class doesn't work on Windows. Provide a way to suppress
- escape sequences.
- """
-
- BLACK = 30
- RED = 31
- GREEN = 32
- YELLOW = 33
- COLORS = (BLACK, RED, GREEN, YELLOW)
-
- def __init__(self, out):
- self.out = out
-
- def reset_color(self):
- """Reset text's color to default.
- """
- self.out.write('\033[0m')
-
- def change_color(self, color):
- """Change text's color by specifing arguments.
- Args:
- color: A new color to change. It should be one of |COLORS|.
- """
- if color in self.COLORS:
- self.out.write('\033[' + str(color) + 'm')
- else:
- raise Exception('Unsupported color.')
-
- def writeln(self, string):
- """Print text with a line-break.
- """
- self.out.write(string + '\n')
-
- def write(self, string):
- """Print text without a line-break.
- """
- self.out.write(string)
-
-
-def sort_member_types(interface):
- """Sort the members in the order of EXTATTRIBUTES_AND_MEMBER_TYPES.
- Args:
- interface: An "interface" object
- Returns:
- A sorted "interface" object
- """
- sorted_interface = OrderedDict()
- for member_type in EXTATTRIBUTES_AND_MEMBER_TYPES:
- sorted_interface[member_type] = interface.get(member_type)
- sorted_interface[DIFF_TAG] = interface.get(DIFF_TAG)
- return sorted_interface
-
-
-def group_by_tag(interface_or_member_list):
- """Group members of |interface_or_member_list| by tags.
- Args:
- interface_or_member_list: A list of interface names or a list of "members"
- Returns:
- A tuple of (removed, added, unchanged) where
- removed: A list of removed members
- added: A list of added members
- unspecified: A list of other members
- """
- removed = []
- added = []
- unspecified = []
- for interface_or_member in interface_or_member_list:
- if DIFF_TAG in interface_or_member:
- if interface_or_member[DIFF_TAG] == DIFF_TAG_DELETED:
- removed.append(interface_or_member)
- elif interface_or_member[DIFF_TAG] == DIFF_TAG_ADDED:
- added.append(interface_or_member)
- else:
- unspecified.append(interface_or_member)
- return (removed, added, unspecified)
-
-
-def sort_interface_names_by_tags(interfaces):
- """Sort interface names as follows.
- [names of deleted "interface"s
- -> names of added "interface"s
- -> names of other "interface"s]
- Args:
- interfaces: "interface" objects.
- Returns:
- A list of sorted interface names
- """
- interface_list = interfaces.values()
- removed, added, unspecified = group_by_tag(interface_list)
- removed = map(lambda interface: interface['Name'], removed)
- added = map(lambda interface: interface['Name'], added)
- unspecified = map(lambda interface: interface['Name'], unspecified)
- sorted_interface_names = removed + added + unspecified
- return sorted_interface_names
-
-
-def sort_members_by_tags(interface):
- """Sort members of a given interface in the order of diffing tags.
- Args:
- An "interface" object
- Returns:
- A sorted "interface" object
- """
- sorted_interface = OrderedDict()
- if DIFF_TAG in interface:
- return interface
- for member_type in EXTATTRIBUTES_AND_MEMBER_TYPES:
- member_list = interface[member_type]
- removed, added, unspecified = group_by_tag(member_list)
- sorted_interface[member_type] = removed + added + unspecified
- return sorted_interface
-
-
-def sort_diff_by_tags(interfaces):
- """Sort an "interfaces" object in the order of diffing tags.
- Args:
- An "interfaces" object loaded by load_json_data().
- Returns:
- A sorted "interfaces" object
- """
- sorted_interfaces = OrderedDict()
- sorted_interface_names = sort_interface_names_by_tags(interfaces)
- for interface_name in sorted_interface_names:
- interface = sort_members_by_tags(interfaces[interface_name])
- sorted_interfaces[interface_name] = sort_member_types(interface)
- return sorted_interfaces
-
-
-def sort_members_in_alphabetical_order(interface):
- """Sort a "members" object in the alphabetical order.
- Args:
- An "interface" object
- Returns:
- A sorted "interface" object
- """
- sorted_interface = OrderedDict()
- for member_type in EXTATTRIBUTES_AND_MEMBER_TYPES:
- sorted_members = sorted(interface[member_type],
- key=lambda member: member['Name'])
- sorted_interface[member_type] = sorted_members
- return sorted_interface
-
-
-def sort_diff_in_alphabetical_order(interfaces):
- """Sort an "interfaces" object in the alphabetical order.
- Args:
- An "interfaces" object.
- Returns:
- A sorted "interfaces" object
- """
- sorted_interfaces = OrderedDict()
- for interface_name in sorted(interfaces.keys()):
- interface = interfaces[interface_name]
- sorted_interface = sort_members_in_alphabetical_order(interface)
- sorted_interface[DIFF_TAG] = interface.get(DIFF_TAG)
- sorted_interfaces[interface_name] = sorted_interface
- return sorted_interfaces
-
-
-def print_member_with_color(member, out):
- """Print the "member" with a colored text. '+' is added to an added
- "member". '-' is added to a removed "member".
- Args:
- member: A "member" object
- """
- if DIFF_TAG in member:
- if member[DIFF_TAG] == DIFF_TAG_DELETED:
- out.change_color(Colorize.RED)
- out.write('- ')
- elif member[DIFF_TAG] == DIFF_TAG_ADDED:
- out.change_color(Colorize.GREEN)
- out.write('+ ')
- else:
- out.change_color(Colorize.BLACK)
- out.write(' ')
-
-
-def print_extattributes(extattributes, out):
- """Print extattributes in an "interface" object.
- Args:
- A list of "ExtAttributes" in the "interface" object
- """
- for extattribute in extattributes:
- out.write(' ')
- print_member_with_color(extattribute, out)
- out.writeln(extattribute['Name'])
-
-
-def print_consts(consts, out):
- """Print consts in an "interface" object.
- Args:
- A list of "Consts" of the "interface" object
- """
- for const in consts:
- out.write(' ')
- print_member_with_color(const, out)
- out.write(str(const['Type']))
- out.write(' ')
- out.write(const['Name'])
- out.write(' ')
- out.writeln(const['Value'])
-
-
-def print_items(items, callback, out):
- """Calls |callback| for each item in |items|, printing commas between
- |callback| calls.
- Args:
- items: extattributes or arguments
- """
- count = 0
- for item in items:
- callback(item)
- count += 1
- if count < len(items):
- out.write(', ')
-
-
-def print_extattributes_in_member(extattributes, out):
- """Print extattributes in a "member" object.
- Args:
- A list of "ExtAttributes" in the "member" object
- """
- def callback(extattribute):
- out.write(extattribute['Name'])
-
- out.write('[')
- print_items(extattributes, callback, out)
- out.write(']')
-
-
-def print_attributes(attributes, out):
- """Print attributes in an "interface" object.
- Args:
- A list of "Attributes" in the "interface" object
- """
- for attribute in attributes:
- out.write(' ')
- print_member_with_color(attribute, out)
- if attribute['ExtAttributes']:
- print_extattributes_in_member(attribute['ExtAttributes'], out)
- out.write(str(attribute['Type']))
- out.write(' ')
- out.writeln(attribute['Name'])
-
-
-def print_arguments(arguments, out):
- """Print arguments in a "members" object named "Operations".
- Args: A list of "Arguments"
- """
- def callback(argument):
- out.write(argument['Name'])
-
- out.write('(')
- print_items(arguments, callback, out)
- out.writeln(')')
-
-
-def print_operations(operations, out):
- """Print operations in a "member" object.
- Args:
- A list of "Operations"
- """
- for operation in operations:
- out.write(' ')
- print_member_with_color(operation, out)
- if operation['ExtAttributes']:
- print_extattributes_in_member(operation['ExtAttributes'], out)
- out.write(str(operation['Type']))
- out.write(' ')
- if operation['Arguments']:
- out.write(operation['Name'])
- print_arguments(operation['Arguments'], out)
- else:
- out.writeln(operation['Name'])
-
-
-def print_diff(diff, out):
- """Print the diff on a shell.
- Args:
- A sorted diff
- """
- for interface_name, interface in diff.iteritems():
- print_member_with_color(interface, out)
- out.change_color(Colorize.YELLOW)
- out.write('[[')
- out.write(interface_name)
- out.writeln(']]')
- out.reset_color()
- for member_name, member in interface.iteritems():
- if member_name == 'ExtAttributes':
- out.writeln('ExtAttributes')
- print_extattributes(member, out)
- elif member_name == 'Consts':
- out.writeln(' Consts')
- print_consts(member, out)
- elif member_name == 'Attributes':
- out.writeln(' Attributes')
- print_attributes(member, out)
- elif member_name == 'Operations':
- out.writeln(' Operations')
- print_operations(member, out)
- out.reset_color()
-
-
-def print_usage():
- """Show usage."""
- sys.stdout.write('Usage: print_diff.py <diff_file.json> <"TAG"|"ALPHABET">\n')
-
-
-def main(argv):
- if len(argv) != 2:
- print_usage()
- exit(1)
- json_data = argv[0]
- order = argv[1]
- diff = load_json_file(json_data)
- if order == 'TAG':
- sort_func = sort_diff_by_tags
- elif order == 'ALPHABET':
- sort_func = sort_diff_in_alphabetical_order
- else:
- print_usage()
- exit(1)
- sorted_diff = sort_func(diff)
- out = Colorize(sys.stdout)
- print_diff(sorted_diff, out)
-
-
-if __name__ == '__main__':
- main(sys.argv[1:])
diff --git a/bindings/scripts/test_collect_idls_into_json.py b/bindings/scripts/test_collect_idls_into_json.py
deleted file mode 100644
index 49d6e55..0000000
--- a/bindings/scripts/test_collect_idls_into_json.py
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env python
-
-import unittest
-import collect_idls_into_json
-import utilities
-
-from blink_idl_parser import parse_file, BlinkIDLParser
-
-_FILE = 'Source/bindings/scripts/testdata/test_filepath.txt'
-_KEY_SET = set(['Operations', 'Name', 'FilePath', 'Inherit', 'Consts', 'ExtAttributes', 'Attributes'])
-_PARTIAL = {'Node': {'Operations': [], 'Name': 'Node', 'FilePath': 'Source/core/timing/WorkerGlobalScopePerformance.idl', 'Inherit': [], 'Consts': [], 'ExtAttributes': [], 'Attributes': [{'Static': False, 'Readonly': True, 'Type': 'WorkerPerformance', 'Name': 'performance', 'ExtAttributes': []}]}}
-
-
-class TestFunctions(unittest.TestCase):
- def setUp(self):
- parser = BlinkIDLParser()
- path = utilities.read_file_to_list(_FILE)[0]
- definitions = parse_file(parser, path)
- self.definition = definitions.GetChildren()[0]
-
- def test_get_definitions(self):
- pathfile = utilities.read_file_to_list(_FILE)
- for actual in collect_idls_into_json.get_definitions(pathfile):
- self.assertEqual(actual.GetName(), self.definition.GetName())
-
- def test_is_non_partial(self):
- if self.definition.GetClass() == 'Interface' and not self.definition.GetProperty('Partial'):
- self.assertTrue(collect_idls_into_json.is_non_partial(self.definition))
- else:
- self.assertFalse(collect_idls_into_json.is_non_partial(self.definition))
-
- def test_is_partial(self):
- if self.definition.GetClass() == 'Interface' and self.definition.GetProperty('Partial'):
- self.assertTrue(collect_idls_into_json.is_partial(self.definition))
- else:
- self.assertFalse(collect_idls_into_json.is_partial(self.definition))
-
- def test_get_filepaths(self):
- filepath = collect_idls_into_json.get_filepath(self.definition)
- self.assertTrue(filepath.startswith('Source'))
- self.assertTrue(filepath.endswith('.idl'))
-
- def test_const_node_to_dict(self):
- const_member = set(['Name', 'Type', 'Value', 'ExtAttributes'])
- for const in collect_idls_into_json.get_const_node_list(self.definition):
- if const:
- self.assertEqual(const.GetClass(), 'Const')
- self.assertEqual(collect_idls_into_json.get_const_type(const), 'unsigned short')
- self.assertEqual(collect_idls_into_json.get_const_value(const), '1')
- self.assertTrue(const_member.issuperset(collect_idls_into_json.const_node_to_dict(const).keys()))
- else:
- self.assertEqual(const, None)
-
- def test_attribute_node_to_dict(self):
- attribute_member = set(['Name', 'Type', 'ExtAttributes', 'Readonly', 'Static'])
- for attribute in collect_idls_into_json.get_attribute_node_list(self.definition):
- if attribute:
- self.assertEqual(attribute.GetClass(), 'Attribute')
- self.assertEqual(attribute.GetName(), 'parentNode')
- self.assertEqual(collect_idls_into_json.get_attribute_type(attribute), 'Node')
- self.assertTrue(attribute_member.issuperset(collect_idls_into_json.attribute_node_to_dict(attribute).keys()))
- else:
- self.assertEqual(attribute, None)
-
- def test_operation_node_to_dict(self):
- operate_member = set(['Static', 'ExtAttributes', 'Type', 'Name', 'Arguments'])
- argument_member = set(['Name', 'Type'])
- for operation in collect_idls_into_json.get_operation_node_list(self.definition):
- if operation:
- self.assertEqual(operation.GetClass(), 'Operation')
- self.assertEqual(operation.GetName(), 'appendChild')
- self.assertEqual(collect_idls_into_json.get_operation_type(operation), 'Node')
- self.assertTrue(operate_member.issuperset(collect_idls_into_json.operation_node_to_dict(operation).keys()))
- for argument in collect_idls_into_json.get_argument_node_list(operation):
- if argument:
- self.assertEqual(argument.GetClass(), 'Argument')
- self.assertEqual(argument.GetName(), 'newChild')
- self.assertEqual(collect_idls_into_json.get_argument_type(argument), 'Node')
- self.assertTrue(argument_member.issuperset(collect_idls_into_json.argument_node_to_dict(argument).keys()))
- else:
- self.assertEqual(argument, None)
- else:
- self.assertEqual(operation, None)
-
- def test_extattribute_node_to_dict(self):
- for extattr in collect_idls_into_json.get_extattribute_node_list(self.definition):
- if extattr:
- self.assertEqual(extattr.GetClass(), 'ExtAttribute')
- self.assertEqual(extattr.GetName(), 'CustomToV8')
- self.assertEqual(collect_idls_into_json.extattr_node_to_dict(extattr).keys(), ['Name'])
- self.assertEqual(collect_idls_into_json.extattr_node_to_dict(extattr).values(), ['CustomToV8'])
- else:
- self.assertEqual(extattr, None)
-
- def test_inherit_node_to_dict(self):
- inherit = collect_idls_into_json.inherit_node_to_dict(self.definition)
- if inherit:
- self.assertEqual(inherit.keys(), ['Parent'])
- self.assertEqual(inherit.values(), ['EventTarget'])
- else:
- self.assertEqual(inherit, [])
-
- def test_interface_node_to_dict(self):
- self.assertTrue(_KEY_SET.issuperset(collect_idls_into_json.interface_node_to_dict(self.definition)))
-
- def test_merge_partial_dicts(self):
- key_name = self.definition.GetName()
- self.assertEqual(collect_idls_into_json.merge_partial_dicts({key_name: collect_idls_into_json.interface_node_to_dict(self.definition)}, _PARTIAL)[key_name]['Partial_FilePaths'], ['Source/core/timing/WorkerGlobalScopePerformance.idl'])
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/bindings/scripts/testdata/test_interface.idl b/bindings/scripts/testdata/test_interface.idl
deleted file mode 100644
index 74ff3ba..0000000
--- a/bindings/scripts/testdata/test_interface.idl
+++ /dev/null
@@ -1,9 +0,0 @@
-[
- CustomToV8
- ] interface Node : EventTarget {
- [Reflect]const unsigned short ELEMENT_NODE = 1;
- [Clamp]attribute Node parentNode;
- [Custom] Node appendChild(Node newChild);
-};
-
-
diff --git a/bindings/scripts/utilities.py b/bindings/scripts/utilities.py
index 2370887..b641b42 100644
--- a/bindings/scripts/utilities.py
+++ b/bindings/scripts/utilities.py
@@ -13,14 +13,19 @@
import shlex
import string
import subprocess
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..',
+ 'third_party', 'blink', 'tools'))
+from blinkpy.common.name_style_converter import NameStyleConverter
KNOWN_COMPONENTS = frozenset(['core', 'modules'])
KNOWN_COMPONENTS_WITH_TESTING = frozenset(['core', 'modules', 'testing'])
-def idl_filename_to_interface_name(idl_filename):
- # interface name is the root of the basename: InterfaceName.idl
+def idl_filename_to_basename(idl_filename):
+ """Returns the basename without the extension."""
return os.path.splitext(os.path.basename(idl_filename))[0]
@@ -88,9 +93,13 @@
return set()
@property
- def include_path_for_union_types(self):
+ def include_path_for_union_types(self, union_type):
return None
+ @property
+ def callback_functions(self):
+ return {}
+
class ComponentInfoProviderCore(ComponentInfoProvider):
def __init__(self, interfaces_info, component_info):
@@ -118,9 +127,13 @@
def union_types(self):
return self._component_info['union_types']
+ def include_path_for_union_types(self, union_type):
+ name = to_snake_case(shorten_union_name(union_type))
+ return 'bindings/core/v8/%s.h' % name
+
@property
- def include_path_for_union_types(self):
- return 'bindings/core/v8/UnionTypesCore.h'
+ def callback_functions(self):
+ return self._component_info['callback_functions']
@property
def specifier_for_export(self):
@@ -165,9 +178,18 @@
# generating multiple container generation.
return self._component_info_modules['union_types'] - self._component_info_core['union_types']
+ def include_path_for_union_types(self, union_type):
+ core_union_type_names = [core_union_type.name for core_union_type
+ in self._component_info_core['union_types']]
+ name = shorten_union_name(union_type)
+ if union_type.name in core_union_type_names:
+ return 'bindings/core/v8/%s.h' % to_snake_case(name)
+ return 'bindings/modules/v8/%s.h' % to_snake_case(name)
+
@property
- def include_path_for_union_types(self):
- return 'bindings/modules/v8/UnionTypesModules.h'
+ def callback_functions(self):
+ return dict(self._component_info_core['callback_functions'].items() +
+ self._component_info_modules['callback_functions'].items())
@property
def specifier_for_export(self):
@@ -282,15 +304,21 @@
def read_pickle_files(pickle_filenames):
for pickle_filename in pickle_filenames:
- with open(pickle_filename) as pickle_file:
- yield pickle.load(pickle_file)
+ yield read_pickle_file(pickle_filename)
-def write_file(new_text, destination_filename, only_if_changed):
- if only_if_changed and os.path.isfile(destination_filename):
+def read_pickle_file(pickle_filename):
+ with open(pickle_filename) as pickle_file:
+ return pickle.load(pickle_file)
+
+
+def write_file(new_text, destination_filename):
+ # If |new_text| is same with the file content, we skip updating.
+ if os.path.isfile(destination_filename):
with open(destination_filename) as destination_file:
if destination_file.read() == new_text:
return
+
destination_dirname = os.path.dirname(destination_filename)
if not os.path.exists(destination_dirname):
os.makedirs(destination_dirname)
@@ -298,8 +326,9 @@
destination_file.write(new_text)
-def write_pickle_file(pickle_filename, data, only_if_changed):
- if only_if_changed and os.path.isfile(pickle_filename):
+def write_pickle_file(pickle_filename, data):
+ # If |data| is same with the file content, we skip updating.
+ if os.path.isfile(pickle_filename):
with open(pickle_filename) as pickle_file:
try:
if pickle.load(pickle_file) == data:
@@ -314,25 +343,29 @@
################################################################################
# IDL parsing
#
-# We use regular expressions for parsing; this is incorrect (Web IDL is not a
-# regular language), but simple and sufficient in practice.
+# TODO(bashi): We use regular expressions for parsing; this is incorrect
+# (Web IDL is not a regular language) and broken. Remove these functions and
+# always use the parser and ASTs.
# Leading and trailing context (e.g. following '{') used to avoid false matches.
################################################################################
-def is_callback_interface_from_idl(file_contents):
+def is_non_legacy_callback_interface_from_idl(file_contents):
+ """Returns True if the specified IDL is a non-legacy callback interface."""
match = re.search(r'callback\s+interface\s+\w+\s*{', file_contents)
- return bool(match)
+ # Having constants means it's a legacy callback interface.
+ # https://heycam.github.io/webidl/#legacy-callback-interface-object
+ return bool(match) and not re.search(r'\s+const\b', 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)
+ match = re.search(r'(interface|dictionary)\s+\w+', file_contents)
return bool(match)
-def match_interface_extended_attributes_from_idl(file_contents):
+def match_interface_extended_attributes_and_name_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)
@@ -340,19 +373,18 @@
file_contents = re.sub(single_line_comment_re, '', file_contents)
file_contents = re.sub(block_comment_re, '', file_contents)
- match = re.search(r'\[(.*)\]\s*'
- r'((callback|partial)\s+)?'
- r'(interface|exception)\s+'
- r'\w+\s*'
- r'(:\s*\w+\s*)?'
- r'{',
- file_contents, flags=re.DOTALL)
+ match = re.search(
+ r'(?:\[([^[]*)\]\s*)?'
+ r'(interface|callback\s+interface|partial\s+interface|dictionary)\s+'
+ r'(\w+)\s*'
+ 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:
+ match = match_interface_extended_attributes_and_name_from_idl(file_contents)
+ if not match or not match.group(1):
return {}
extended_attributes_string = match.group(1)
@@ -370,8 +402,8 @@
def get_interface_exposed_arguments(file_contents):
- match = match_interface_extended_attributes_from_idl(file_contents)
- if not match:
+ match = match_interface_extended_attributes_and_name_from_idl(file_contents)
+ if not match or not match.group(1):
return None
extended_attributes_string = match.group(1)
@@ -384,3 +416,142 @@
arguments.append({'exposed': exposed, 'runtime_enabled': runtime_enabled})
return arguments
+
+
+def get_first_interface_name_from_idl(file_contents):
+ match = match_interface_extended_attributes_and_name_from_idl(file_contents)
+ if match:
+ return match.group(3)
+ return None
+
+
+# Workaround for crbug.com/611437 and crbug.com/711464
+# TODO(bashi): Remove this hack once we resolve too-long generated file names.
+# pylint: disable=line-too-long
+def shorten_union_name(union_type):
+ aliases = {
+ # modules/canvas2d/CanvasRenderingContext2D.idl
+ 'CSSImageValueOrHTMLImageElementOrSVGImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvas': 'CanvasImageSource',
+ # modules/canvas/HTMLCanvasElementModule.idl
+ 'CanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContextOrImageBitmapRenderingContext': 'RenderingContext',
+ # core/imagebitmap/ImageBitmapFactories.idl
+ 'HTMLImageElementOrSVGImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOrImageBitmapOrOffscreenCanvas': 'ImageBitmapSource',
+ # bindings/tests/idls/core/TestTypedefs.idl
+ 'NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord': 'NestedUnionType',
+ # modules/offscreencanvas/OffscreenCanvasModules.idl
+ 'OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext': 'OffscreenRenderingContext',
+ }
+
+ idl_type = union_type
+ if union_type.is_nullable:
+ idl_type = union_type.inner_type
+ name = idl_type.cpp_type or idl_type.name
+ alias = aliases.get(name)
+ if alias:
+ return alias
+ if len(name) >= 80:
+ raise Exception('crbug.com/711464: The union name %s is too long. '
+ 'Please add an alias to shorten_union_name()' % name)
+ return name
+
+
+def to_snake_case(name):
+ if name.lower() == name:
+ return name
+ return NameStyleConverter(name).to_snake_case()
+
+
+def format_remove_duplicates(text, patterns):
+ """Removes duplicated line-basis patterns.
+
+ Based on simple pattern matching, removes duplicated lines in a block
+ of lines. Lines that match with a same pattern are considered as
+ duplicates.
+
+ Designed to be used as a filter function for Jinja2.
+
+ Args:
+ text: A str of multi-line text.
+ patterns: A list of str where each str represents a simple
+ pattern. The patterns are not considered as regexp, and
+ exact match is applied.
+
+ Returns:
+ A formatted str with duplicates removed.
+ """
+ pattern_founds = [False] * len(patterns)
+ output = []
+ for line in text.split('\n'):
+ to_be_removed = False
+ for i, pattern in enumerate(patterns):
+ if pattern not in line:
+ continue
+ if pattern_founds[i]:
+ to_be_removed = True
+ else:
+ pattern_founds[i] = True
+ if to_be_removed:
+ continue
+ output.append(line)
+
+ # Let |'\n'.join| emit the last newline.
+ if output:
+ output.append('')
+
+ return '\n'.join(output)
+
+
+def format_blink_cpp_source_code(text):
+ """Formats C++ source code.
+
+ Supported modifications are:
+ - Reduces successive empty lines into a single empty line.
+ - Removes empty lines just after an open brace or before closing brace.
+ This rule does not apply to namespaces.
+
+ Designed to be used as a filter function for Jinja2.
+
+ Args:
+ text: A str of C++ source code.
+
+ Returns:
+ A formatted str of the source code.
+ """
+ re_empty_line = re.compile(r'^\s*$')
+ re_first_brace = re.compile(r'(?P<first>[{}])')
+ re_last_brace = re.compile(r'.*(?P<last>[{}]).*?$')
+ was_open_brace = True # Trick to remove the empty lines at the beginning.
+ was_empty_line = False
+ output = []
+ for line in text.split('\n'):
+ # Skip empty lines.
+ if re_empty_line.match(line):
+ was_empty_line = True
+ continue
+
+ # Emit a single empty line if needed.
+ if was_empty_line:
+ was_empty_line = False
+ match = re_first_brace.search(line)
+ if was_open_brace:
+ # No empty line just after an open brace.
+ pass
+ elif match and match.group('first') == '}' and 'namespace' not in line:
+ # No empty line just before a closing brace.
+ pass
+ else:
+ # Preserve a single empty line.
+ output.append('')
+
+ # Emit the line itself.
+ output.append(line)
+
+ # Remember an open brace.
+ match = re_last_brace.search(line)
+ was_open_brace = (match and match.group('last') == '{' and 'namespace' not in line)
+
+ # Let |'\n'.join| emit the last newline.
+ if output:
+ output.append('')
+
+ return '\n'.join(output)
diff --git a/bindings/scripts/v8_attributes.py b/bindings/scripts/v8_attributes.py
index 2987967..fad2784 100644
--- a/bindings/scripts/v8_attributes.py
+++ b/bindings/scripts/v8_attributes.py
@@ -26,6 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# pylint: disable=relative-import
+
"""Generate template values for attributes.
Extends IdlType with property |constructor_type_name|.
@@ -35,7 +37,7 @@
import idl_types
from idl_types import inherits_interface
-from v8_globals import includes, interfaces
+from v8_globals import includes
import v8_types
import v8_utilities
from v8_utilities import (cpp_name_or_partial, capitalize, cpp_name, has_extended_attribute,
@@ -44,7 +46,19 @@
is_legacy_interface_type_checking)
-def attribute_context(interface, attribute):
+def attribute_context(interface, attribute, interfaces):
+ """Creates a Jinja template context for an attribute of an interface.
+
+ Args:
+ interface: An interface which |attribute| belongs to
+ attribute: An attribute to create the context for
+ interfaces: A dict which maps an interface name to the definition
+ which can be referred if needed
+
+ Returns:
+ A Jinja template context for |attribute|
+ """
+
idl_type = attribute.idl_type
base_idl_type = idl_type.base_type
extended_attributes = attribute.extended_attributes
@@ -54,61 +68,63 @@
includes.add('core/inspector/ConsoleMessage.h')
# [CheckSecurity]
- is_do_not_check_security = 'DoNotCheckSecurity' in extended_attributes
+ is_cross_origin = 'CrossOrigin' in extended_attributes
is_check_security_for_receiver = (
has_extended_attribute_value(interface, 'CheckSecurity', 'Receiver') and
- not is_do_not_check_security)
+ is_cross_origin)
is_check_security_for_return_value = (
has_extended_attribute_value(attribute, 'CheckSecurity', 'ReturnValue'))
if is_check_security_for_receiver or is_check_security_for_return_value:
includes.add('bindings/core/v8/BindingSecurity.h')
+ # [CrossOrigin]
+ if has_extended_attribute_value(attribute, 'CrossOrigin', 'Setter'):
+ includes.add('bindings/core/v8/V8CrossOriginSetterInfo.h')
# [Constructor]
# TODO(yukishiino): Constructors are much like methods although constructors
# are not methods. Constructors must be data-type properties, and we can
# support them as a kind of methods.
constructor_type = idl_type.constructor_type_name if is_constructor_attribute(attribute) else None
+ # [CEReactions]
+ is_ce_reactions = 'CEReactions' in extended_attributes
+ if is_ce_reactions:
+ includes.add('core/html/custom/CEReactionsScope.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')
- # [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
+ includes.add('core/html/custom/V0CustomElementProcessingStack.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)
+ # [SaveSameObject]
+ is_save_same_object = (
+ 'SameObject' in attribute.extended_attributes and
+ 'SaveSameObject' in attribute.extended_attributes)
+ if is_save_same_object:
+ includes.add('platform/bindings/V8PrivateProperty.h')
if (base_idl_type == 'EventHandler' and
- interface.name in ['Window', 'WorkerGlobalScope'] and
- attribute.name == 'onerror'):
+ 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')
+ includes.add('platform/bindings/V8PrivateProperty.h')
- if 'RuntimeEnabled' in extended_attributes:
- includes.add('platform/RuntimeEnabledFeatures.h')
-
- if 'OriginTrialEnabled' in extended_attributes:
- includes.add('core/inspector/ConsoleMessage.h')
- includes.add('core/origin_trials/OriginTrials.h')
+ # [CachedAccessor]
+ is_cached_accessor = 'CachedAccessor' in extended_attributes
+ if is_cached_accessor:
+ includes.add('platform/bindings/V8PrivateProperty.h')
context = {
- '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': cached_attribute_validation_method,
'constructor_type': constructor_type,
+ 'context_enabled_feature_name': v8_utilities.context_enabled_feature_name(attribute),
'cpp_name': cpp_name(attribute),
'cpp_type': idl_type.cpp_type,
'cpp_type_initializer': idl_type.cpp_type_initializer,
@@ -116,26 +132,32 @@
'enum_type': idl_type.enum_type,
'enum_values': idl_type.enum_values,
'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed]
+ 'has_cross_origin_getter':
+ has_extended_attribute_value(attribute, 'CrossOrigin', None) or
+ has_extended_attribute_value(attribute, 'CrossOrigin', 'Getter'),
+ 'has_cross_origin_setter': has_extended_attribute_value(attribute, 'CrossOrigin', 'Setter'),
'has_custom_getter': has_custom_getter(attribute),
'has_custom_setter': has_custom_setter(attribute),
- 'has_setter': has_setter(attribute),
- 'idl_type': str(idl_type), # need trailing [] on array for Dictionary::ConversionContext::setConversionType
- 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(attribute) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialEnabled]
+ 'has_promise_type': idl_type.name == 'Promise',
+ 'has_setter': has_setter(interface, attribute),
+ 'idl_type': str(idl_type),
+ 'is_cached_accessor': is_cached_accessor,
'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_ce_reactions': is_ce_reactions,
'is_check_security_for_receiver': is_check_security_for_receiver,
'is_check_security_for_return_value': is_check_security_for_return_value,
'is_custom_element_callbacks': is_custom_element_callbacks,
# TODO(yukishiino): Make all DOM attributes accessor-type properties.
- 'is_data_type_property': constructor_type or interface.name == 'Window' or interface.name == 'Location',
+ 'is_data_type_property': is_data_type_property(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_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_named_constructor': is_named_constructor_attribute(attribute),
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
@@ -143,43 +165,121 @@
'is_read_only': attribute.is_read_only,
'is_reflect': is_reflect,
'is_replaceable': 'Replaceable' in attribute.extended_attributes,
+ 'is_save_same_object': is_save_same_object,
'is_static': attribute.is_static,
'is_url': 'URL' in extended_attributes,
'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),
- 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(attribute), # [OriginTrialEnabled]
- 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialEnabled]
- 'origin_trial_name': extended_attributes.get('OriginTrialEnabled'), # [OriginTrialEnabled]
+ 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(attribute), # [OriginTrialEnabled]
+ 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(attribute), # [OriginTrialEnabled]
'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,
- 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
- 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]
- 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
- 'world_suffixes': ['', 'ForMainWorld']
- if 'PerWorldBindings' in extended_attributes
- else [''], # [PerWorldBindings]
+ 'runtime_enabled_feature_name': v8_utilities.runtime_enabled_feature_name(attribute), # [RuntimeEnabled]
+ 'secure_context_test': v8_utilities.secure_context(attribute, interface), # [SecureContext]
+ 'cached_accessor_name': '%s%sCachedAccessor' % (interface.name, attribute.name.capitalize()),
+ 'world_suffixes': (
+ ['', 'ForMainWorld']
+ if 'PerWorldBindings' in extended_attributes
+ else ['']), # [PerWorldBindings]
}
- if is_constructor_attribute(attribute):
- 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 has_setter(attribute):
- setter_context(interface, attribute, context)
+ if not has_custom_setter(attribute) and has_setter(interface, attribute):
+ setter_context(interface, attribute, interfaces, context)
+
+ # [RuntimeCallStatsCounter]
+ runtime_call_stats_context(interface, attribute, context)
+
+ # [CrossOrigin] is incompatible with a number of other attributes, so check
+ # for them here.
+ if is_cross_origin:
+ if context['has_cross_origin_setter'] and context['has_custom_setter']:
+ raise Exception('[CrossOrigin] and [Custom] are incompatible on the same setter: %s.%s', interface.name, attribute.name)
+ if context['is_per_world_bindings']:
+ raise Exception('[CrossOrigin] and [PerWorldBindings] are incompatible: %s.%s', interface.name, attribute.name)
+ if context['constructor_type']:
+ raise Exception('[CrossOrigin] cannot be used for constructors: %s.%s', interface.name, attribute.name)
return context
+def runtime_call_stats_context(interface, attribute, context):
+ includes.add('platform/bindings/RuntimeCallStats.h')
+ generic_counter_name = 'Blink_' + v8_utilities.cpp_name(interface) + '_' + attribute.name
+ (counter, extended_attribute_defined) = v8_utilities.rcs_counter_name(attribute, generic_counter_name)
+ runtime_call_stats = {
+ 'extended_attribute_defined': extended_attribute_defined,
+ 'getter_counter': '%s_Getter' % counter,
+ 'setter_counter': '%s_Setter' % counter,
+ 'constructor_getter_callback_counter': '%s_ConstructorGetterCallback' % generic_counter_name,
+ }
+ context.update({
+ 'runtime_call_stats': runtime_call_stats
+ })
+
+
+def is_secure_context(attribute):
+ return bool(attribute['secure_context_test'])
+
+
+def filter_accessors(attributes):
+ return [attribute for attribute in attributes if
+ not (attribute['exposed_test'] or
+ is_secure_context(attribute) or
+ attribute['context_enabled_feature_name'] or
+ attribute['origin_trial_enabled_function'] or
+ attribute['runtime_enabled_feature_name']) and
+ not attribute['is_data_type_property']]
+
+
+def is_data_attribute(attribute):
+ return (not (attribute['exposed_test'] or
+ is_secure_context(attribute) or
+ attribute['context_enabled_feature_name'] or
+ attribute['origin_trial_enabled_function'] or
+ attribute['runtime_enabled_feature_name']) and
+ attribute['is_data_type_property'])
+
+
+def is_lazy_data_attribute(attribute):
+ return ((attribute['constructor_type'] and not
+ (attribute['measure_as'] or attribute['deprecate_as'])) or
+ (attribute['idl_type'] == 'Window' and attribute['name'] == 'frames') or
+ (attribute['idl_type'] == 'Window' and attribute['name'] == 'self') or
+ (attribute['idl_type'] == 'Window' and attribute['name'] == 'window'))
+
+
+def filter_data_attributes(attributes):
+ return [attribute for attribute in attributes if is_data_attribute(attribute) and not is_lazy_data_attribute(attribute)]
+
+
+def filter_lazy_data_attributes(attributes):
+ return [attribute for attribute in attributes if is_data_attribute(attribute) and is_lazy_data_attribute(attribute)]
+
+
+def filter_runtime_enabled(attributes):
+ return [attribute for attribute in attributes if
+ not (attribute['exposed_test'] or
+ is_secure_context(attribute)) and
+ attribute['runtime_enabled_feature_name']]
+
+
+def filter_conditionally_enabled(attributes):
+ return [attribute for attribute in attributes if
+ attribute['exposed_test'] or
+ (is_secure_context(attribute) and
+ not attribute['origin_trial_feature_name'])]
+
+
################################################################################
# Getter
################################################################################
@@ -196,39 +296,29 @@
# 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 'ImplementedInPrivateScript' in extended_attributes:
- if (not idl_type.is_wrapper_type and
- not idl_type.is_basic_type and
- not idl_type.is_enum):
- raise Exception('Private scripts supports only primitive types and DOM wrappers.')
-
- context['cpp_value_original'] = cpp_value
- cpp_value = 'result'
- # EventHandler has special handling
- if base_idl_type != 'EventHandler':
- release = idl_type.release
- elif (idl_type.is_explicit_nullable or
- base_idl_type == 'EventHandler' or
- 'CachedAttribute' in extended_attributes or
- 'ReflectOnly' in extended_attributes or
- context['is_keep_alive_for_gc'] or
- context['is_getter_raises_exception']):
+ if (idl_type.is_explicit_nullable or
+ base_idl_type == 'EventHandler' or
+ 'CachedAttribute' in extended_attributes or
+ 'ReflectOnly' in extended_attributes or
+ context['is_keep_alive_for_gc'] or
+ context['is_getter_raises_exception']):
context['cpp_value_original'] = cpp_value
cpp_value = 'cppValue'
- # EventHandler has special handling
- if base_idl_type != 'EventHandler':
- release = idl_type.release
def v8_set_return_value_statement(for_main_world=False):
if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attributes:
- return 'v8SetReturnValue(info, v8Value)'
+ 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)
+ for_main_world=for_main_world, is_static=attribute.is_static)
+
+ cpp_value_to_script_wrappable = cpp_value
+ if idl_type.is_array_buffer_view_or_typed_array:
+ cpp_value_to_script_wrappable += '.View()'
context.update({
'cpp_value': cpp_value,
+ 'cpp_value_to_script_wrappable': cpp_value_to_script_wrappable,
'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
cpp_value=cpp_value, creation_context='holder',
extended_attributes=extended_attributes),
@@ -241,18 +331,13 @@
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('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
- arguments.append('impl')
- arguments.append('&result')
arguments.extend(v8_utilities.call_with_arguments(
attribute.extended_attributes.get('CallWith')))
# Members of IDL partial interface definitions are implemented in C++ as
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and
- not 'ImplementedInPrivateScript' in attribute.extended_attributes and
- not attribute.is_static):
+ not attribute.is_static):
arguments.append('*impl')
if attribute.idl_type.is_explicit_nullable:
arguments.append('isNull')
@@ -260,29 +345,35 @@
arguments.append('exceptionState')
if attribute.idl_type.use_output_parameter_for_result:
arguments.append('result')
- return '%s(%s)' % (getter_name, ', '.join(arguments))
+
+ expression = '%s(%s)' % (getter_name, ', '.join(arguments))
+ # Needed to handle getter expressions returning Type& as the
+ # use site for |expression| expects Type*.
+ if (attribute.idl_type.is_interface_type and len(arguments) == 0 and
+ not attribute.idl_type.is_array_buffer_view_or_typed_array):
+ return 'WTF::GetPtr(%s)' % expression
+ return expression
CONTENT_ATTRIBUTE_GETTER_NAMES = {
- 'boolean': 'fastHasAttribute',
- 'long': 'getIntegralAttribute',
- 'unsigned long': 'getUnsignedIntegralAttribute',
+ 'boolean': 'FastHasAttribute',
+ 'long': 'GetIntegralAttribute',
+ 'unsigned long': 'GetUnsignedIntegralAttribute',
}
def getter_base_name(interface, attribute, arguments):
extended_attributes = attribute.extended_attributes
- if 'ImplementedInPrivateScript' in extended_attributes:
- return '%sAttributeGetter' % uncapitalize(cpp_name(attribute))
-
if 'Reflect' not in extended_attributes:
- return uncapitalize(cpp_name(attribute))
+ name = cpp_name(attribute)
+ return name if 'ImplementedAs' in extended_attributes \
+ else uncapitalize(name)
content_attribute_name = extended_attributes['Reflect'] or attribute.name.lower()
if content_attribute_name in ['class', 'id', 'name']:
# Special-case for performance optimization.
- return 'get%sAttribute' % content_attribute_name.capitalize()
+ return 'Get%sAttribute' % content_attribute_name.capitalize()
arguments.append(scoped_content_attribute_name(interface, attribute))
@@ -290,14 +381,16 @@
if base_idl_type in CONTENT_ATTRIBUTE_GETTER_NAMES:
return CONTENT_ATTRIBUTE_GETTER_NAMES[base_idl_type]
if 'URL' in attribute.extended_attributes:
- return 'getURLAttribute'
- return 'fastGetAttribute'
+ return 'GetURLAttribute'
+ return 'FastGetAttribute'
def is_keep_alive_for_gc(interface, attribute):
idl_type = attribute.idl_type
base_idl_type = idl_type.base_type
extended_attributes = attribute.extended_attributes
+ if attribute.is_static:
+ return False
return (
# For readonly attributes, for performance reasons we keep the attribute
# wrapper alive while the owner wrapper is alive, because the attribute
@@ -320,25 +413,27 @@
# Setter
################################################################################
-def setter_context(interface, attribute, context):
+def setter_context(interface, attribute, interfaces, context):
if 'PutForwards' in attribute.extended_attributes:
- # Use target interface and attribute in place of original interface and
- # attribute from this point onwards.
+ # Make sure the target interface and attribute exist.
target_interface_name = attribute.idl_type.base_type
target_attribute_name = attribute.extended_attributes['PutForwards']
interface = interfaces[target_interface_name]
try:
- attribute = next(candidate
- for candidate in interface.attributes
- if candidate.name == target_attribute_name)
+ next(candidate
+ for candidate in interface.attributes
+ if candidate.name == target_attribute_name)
except StopIteration:
raise Exception('[PutForward] target not found:\n'
'Attribute "%s" is not present in interface "%s"' %
(target_attribute_name, target_interface_name))
+ context['target_attribute_name'] = target_attribute_name
+ return
- if ('Replaceable' in attribute.extended_attributes or
- is_constructor_attribute(attribute)):
- context['cpp_setter'] = '%sCreateDataProperty(propertyName, v8Value, info)' % cpp_name(interface)
+ if ('Replaceable' in attribute.extended_attributes):
+ context['cpp_setter'] = (
+ 'V8CallBoolean(info.Holder()->CreateDataProperty(' +
+ 'info.GetIsolate()->GetCurrentContext(), propertyName, v8Value))')
return
extended_attributes = attribute.extended_attributes
@@ -361,9 +456,6 @@
'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(
- 'cppValue', isolate='scriptState->isolate()',
- creation_context='scriptState->context()->Global()'),
'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
extended_attributes, 'v8Value', 'cppValue'),
})
@@ -385,29 +477,28 @@
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in extended_attributes and
- not 'ImplementedInPrivateScript' in extended_attributes and
- not attribute.is_static):
+ not attribute.is_static):
arguments.append('*impl')
idl_type = attribute.idl_type
- if 'ImplementedInPrivateScript' in extended_attributes:
- arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
- arguments.append('impl')
- arguments.append('cppValue')
- elif idl_type.base_type == 'EventHandler':
+ if idl_type.base_type == 'EventHandler':
getter_name = scoped_name(interface, attribute, cpp_name(attribute))
context['event_handler_getter_expression'] = '%s(%s)' % (
getter_name, ', '.join(arguments))
if (interface.name in ['Window', 'WorkerGlobalScope'] and
- attribute.name == 'onerror'):
+ attribute.name == 'onerror'):
includes.add('bindings/core/v8/V8ErrorHandler.h')
- arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(v8Value, true, ScriptState::current(info.GetIsolate()))')
+ arguments.append(
+ 'V8EventListenerHelper::EnsureErrorHandler(' +
+ 'ScriptState::ForRelevantRealm(info), v8Value)')
else:
- 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)')
+ arguments.append(
+ 'V8EventListenerHelper::GetEventListener(' +
+ 'ScriptState::ForRelevantRealm(info), v8Value, true, ' +
+ 'kListenerFindOrCreate)')
else:
arguments.append('cppValue')
+ if idl_type.is_explicit_nullable:
+ arguments.append('isNull')
if context['is_setter_raises_exception']:
arguments.append('exceptionState')
@@ -415,16 +506,13 @@
CONTENT_ATTRIBUTE_SETTER_NAMES = {
- 'boolean': 'setBooleanAttribute',
- 'long': 'setIntegralAttribute',
- 'unsigned long': 'setUnsignedIntegralAttribute',
+ 'boolean': 'SetBooleanAttribute',
+ 'long': 'SetIntegralAttribute',
+ 'unsigned long': 'SetUnsignedIntegralAttribute',
}
def setter_base_name(interface, attribute, arguments):
- if 'ImplementedInPrivateScript' in attribute.extended_attributes:
- return '%sAttributeSetter' % uncapitalize(cpp_name(attribute))
-
if 'Reflect' not in attribute.extended_attributes:
return 'set%s' % capitalize(cpp_name(attribute))
arguments.append(scoped_content_attribute_name(interface, attribute))
@@ -439,9 +527,10 @@
content_attribute_name = attribute.extended_attributes['Reflect'] or attribute.name.lower()
if interface.name.startswith('SVG'):
namespace = 'SVGNames'
+ includes.add('core/svg_names.h')
else:
namespace = 'HTMLNames'
- includes.add('core/%s.h' % namespace)
+ includes.add('core/html_names.h')
return '%s::%sAttr' % (namespace, content_attribute_name)
@@ -449,28 +538,28 @@
# Attribute configuration
################################################################################
-# [PutForwards], [Replaceable]
-def has_setter(attribute):
+# Property descriptor's {writable: boolean}
+def is_writable(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(interface, attribute):
- extended_attributes = attribute.extended_attributes
- access_control = []
- if 'DoNotCheckSecurity' in extended_attributes:
- do_not_check_security = extended_attributes['DoNotCheckSecurity']
- if do_not_check_security == 'Setter':
- access_control.append('v8::ALL_CAN_WRITE')
- else:
- access_control.append('v8::ALL_CAN_READ')
- if has_setter(attribute):
- access_control.append('v8::ALL_CAN_WRITE')
- if is_unforgeable(interface, attribute):
- access_control.append('v8::PROHIBITS_OVERWRITING')
- return access_control or ['v8::DEFAULT']
+def is_data_type_property(interface, attribute):
+ if 'CachedAccessor' in attribute.extended_attributes:
+ return False
+ return (is_constructor_attribute(attribute) or
+ 'CrossOrigin' in attribute.extended_attributes)
+
+
+# [PutForwards], [Replaceable]
+def has_setter(interface, attribute):
+ if (is_data_type_property(interface, attribute) and
+ (is_constructor_attribute(attribute) or
+ 'Replaceable' in attribute.extended_attributes)):
+ return False
+
+ return is_writable(attribute)
# [NotEnumerable], [Unforgeable]
@@ -478,10 +567,12 @@
extended_attributes = attribute.extended_attributes
property_attributes_list = []
if ('NotEnumerable' in extended_attributes or
- is_constructor_attribute(attribute)):
+ is_constructor_attribute(attribute)):
property_attributes_list.append('v8::DontEnum')
if is_unforgeable(interface, attribute):
property_attributes_list.append('v8::DontDelete')
+ if not is_writable(attribute):
+ property_attributes_list.append('v8::ReadOnly')
return property_attributes_list or ['v8::None']
@@ -505,19 +596,12 @@
################################################################################
idl_types.IdlType.constructor_type_name = property(
- # FIXME: replace this with a [ConstructorAttribute] extended attribute
lambda self: strip_suffix(self.base_type, 'Constructor'))
def is_constructor_attribute(attribute):
- # FIXME: replace this with [ConstructorAttribute] extended attribute
return attribute.idl_type.name.endswith('Constructor')
-def update_constructor_attribute_context(interface, attribute, context):
- context['needs_constructor_getter_callback'] = context['measure_as'] or context['deprecate_as'] or context['origin_trial_name']
- # 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']
+def is_named_constructor_attribute(attribute):
+ return attribute.idl_type.name.endswith('ConstructorConstructor')
diff --git a/bindings/scripts/v8_callback_function.py b/bindings/scripts/v8_callback_function.py
new file mode 100644
index 0000000..4f51dd2
--- /dev/null
+++ b/bindings/scripts/v8_callback_function.py
@@ -0,0 +1,110 @@
+# Copyright 2016 The Chromium 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 values for a callback function.
+
+Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
+"""
+
+from utilities import to_snake_case
+from v8_globals import includes
+
+CALLBACK_FUNCTION_H_INCLUDES = frozenset([
+ 'bindings/core/v8/NativeValueTraits.h',
+ 'platform/bindings/CallbackFunctionBase.h',
+ 'platform/bindings/ScriptWrappable.h',
+ 'platform/bindings/TraceWrapperV8Reference.h',
+ 'platform/heap/Handle.h',
+ 'platform/wtf/text/WTFString.h',
+])
+CALLBACK_FUNCTION_CPP_INCLUDES = frozenset([
+ 'bindings/core/v8/ExceptionState.h',
+ 'platform/bindings/ScriptState.h',
+ 'bindings/core/v8/NativeValueTraitsImpl.h',
+ 'bindings/core/v8/ToV8ForCore.h',
+ 'bindings/core/v8/V8BindingForCore.h',
+ 'core/dom/ExecutionContext.h',
+ 'platform/wtf/Assertions.h',
+])
+
+
+def callback_function_context(callback_function):
+ includes.clear()
+ includes.update(CALLBACK_FUNCTION_CPP_INCLUDES)
+ idl_type = callback_function.idl_type
+ idl_type_str = str(idl_type)
+
+ for argument in callback_function.arguments:
+ argument.idl_type.add_includes_for_type(
+ callback_function.extended_attributes)
+
+ context = {
+ # While both |callback_function_name| and |cpp_class| are identical at
+ # the moment, the two are being defined because their values may change
+ # in the future (e.g. if we support [ImplementedAs=] in callback
+ # functions).
+ 'callback_function_name': callback_function.name,
+ 'cpp_class': 'V8%s' % callback_function.name,
+ 'cpp_includes': sorted(includes),
+ 'forward_declarations': sorted(forward_declarations(callback_function)),
+ 'header_includes': sorted(CALLBACK_FUNCTION_H_INCLUDES),
+ 'idl_type': idl_type_str,
+ 'this_include_header_name': to_snake_case('V8%s' % callback_function.name),
+ }
+
+ if idl_type_str != 'void':
+ context.update({
+ 'return_cpp_type': idl_type.cpp_type + '&',
+ 'return_value': idl_type.v8_value_to_local_cpp_value(
+ callback_function.extended_attributes,
+ 'v8ReturnValue', 'cppValue',
+ isolate='script_state_->GetIsolate()',
+ bailout_return_value='false'),
+ })
+
+ context.update(arguments_context(callback_function.arguments, context.get('return_cpp_type')))
+ return context
+
+
+def forward_declarations(callback_function):
+ def find_forward_declaration(idl_type):
+ if idl_type.is_interface_type or idl_type.is_dictionary:
+ return idl_type.implemented_as
+ elif idl_type.is_array_or_sequence_type:
+ return find_forward_declaration(idl_type.element_type)
+ return None
+
+ declarations = []
+ for argument in callback_function.arguments:
+ name = find_forward_declaration(argument.idl_type)
+ if name:
+ declarations.append(name)
+ return declarations
+
+
+def arguments_context(arguments, return_cpp_type):
+ def argument_context(argument):
+ idl_type = argument.idl_type
+ return {
+ 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
+ argument.name, isolate='script_state_->GetIsolate()',
+ creation_context='script_state_->GetContext()->Global()'),
+ 'enum_type': idl_type.enum_type,
+ 'enum_values': idl_type.enum_values,
+ 'name': argument.name,
+ 'v8_name': 'v8_%s' % argument.name,
+ }
+
+ argument_declarations = [
+ 'ScriptWrappable* scriptWrappable',
+ ]
+ argument_declarations.extend(
+ '%s %s' % (argument.idl_type.callback_cpp_type, argument.name)
+ for argument in arguments)
+ if return_cpp_type:
+ argument_declarations.append('%s returnValue' % return_cpp_type)
+ return {
+ 'argument_declarations': argument_declarations,
+ 'arguments': [argument_context(argument) for argument in arguments],
+ }
diff --git a/bindings/scripts/v8_callback_interface.py b/bindings/scripts/v8_callback_interface.py
index 682cb55..c034dd3 100644
--- a/bindings/scripts/v8_callback_interface.py
+++ b/bindings/scripts/v8_callback_interface.py
@@ -35,21 +35,28 @@
from idl_types import IdlTypeBase
from v8_globals import includes
+from v8_interface import constant_context
import v8_types
import v8_utilities
CALLBACK_INTERFACE_H_INCLUDES = frozenset([
- 'bindings/core/v8/ActiveDOMCallback.h',
- 'bindings/core/v8/DOMWrapperWorld.h',
- 'bindings/core/v8/ScopedPersistent.h',
+ 'platform/bindings/DOMWrapperWorld.h',
+ 'platform/bindings/ScopedPersistent.h',
])
CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
'bindings/core/v8/ScriptController.h',
- 'bindings/core/v8/V8Binding.h',
+ 'bindings/core/v8/V8BindingForCore.h',
'core/dom/ExecutionContext.h',
- 'wtf/Assertions.h',
- 'wtf/GetPtr.h',
- 'wtf/RefPtr.h',
+ 'platform/wtf/Assertions.h',
+ 'platform/wtf/GetPtr.h',
+ 'platform/wtf/RefPtr.h',
+])
+LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
+ 'bindings/core/v8/ScriptController.h',
+ 'bindings/core/v8/V8BindingForCore.h',
+ 'bindings/core/v8/V8DOMConfiguration.h',
+ 'core/dom/ExecutionContext.h',
+ 'platform/wtf/Assertions.h',
])
@@ -57,21 +64,21 @@
# 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':
+ if idl_type_name == 'String' or idl_type.is_enum:
return 'const String&'
if idl_type_name == 'void':
return 'void'
# Callbacks use raw pointers, so raw_type=True
raw_cpp_type = idl_type.cpp_type_args(raw_type=True)
# Pass containers and dictionaries to callback method by const reference rather than by value
- if raw_cpp_type.startswith(('Vector', 'HeapVector', 'WillBeHeapVector')) or idl_type.is_dictionary:
+ if raw_cpp_type.startswith(('Vector', 'HeapVector')) or idl_type.is_dictionary:
return 'const %s&' % raw_cpp_type
return raw_cpp_type
IdlTypeBase.callback_cpp_type = property(cpp_type)
-def callback_interface_context(callback_interface):
+def callback_interface_context(callback_interface, _):
includes.clear()
includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
return {
@@ -83,6 +90,20 @@
}
+def legacy_callback_interface_context(callback_interface, _):
+ includes.clear()
+ includes.update(LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES)
+ return {
+ # TODO(bashi): Fix crbug.com/630986, and add 'methods'.
+ 'constants': [constant_context(constant, callback_interface)
+ for constant in callback_interface.constants],
+ 'cpp_class': callback_interface.name,
+ 'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES),
+ 'interface_name': callback_interface.name,
+ 'v8_class': v8_utilities.v8_class_name(callback_interface),
+ }
+
+
def add_includes_for_operation(operation):
operation.idl_type.add_includes_for_type()
for argument in operation.arguments:
@@ -117,8 +138,8 @@
return {
'handle': '%sHandle' % argument.name,
'cpp_value_to_v8_value': argument.idl_type.cpp_value_to_v8_value(
- argument.name, isolate='m_scriptState->isolate()',
- creation_context='m_scriptState->context()->Global()'),
+ argument.name, isolate='script_state_->GetIsolate()',
+ creation_context='script_state_->GetContext()->Global()'),
}
argument_declarations = ['ScriptValue thisValue'] if call_with_this_handle else []
diff --git a/bindings/scripts/v8_dictionary.py b/bindings/scripts/v8_dictionary.py
index dde7e1c..0909d11 100644
--- a/bindings/scripts/v8_dictionary.py
+++ b/bindings/scripts/v8_dictionary.py
@@ -8,6 +8,7 @@
import operator
from idl_types import IdlType
+from utilities import to_snake_case
from v8_globals import includes
import v8_types
import v8_utilities
@@ -15,8 +16,9 @@
DICTIONARY_H_INCLUDES = frozenset([
- 'bindings/core/v8/ToV8.h',
- 'bindings/core/v8/V8Binding.h',
+ 'bindings/core/v8/NativeValueTraits.h',
+ 'bindings/core/v8/ToV8ForCore.h',
+ 'bindings/core/v8/V8BindingForCore.h',
'platform/heap/Handle.h',
])
@@ -25,6 +27,11 @@
])
+def getter_name_for_dictionary_member(member):
+ name = v8_utilities.cpp_name(member)
+ return name
+
+
def setter_name_for_dictionary_member(member):
name = v8_utilities.cpp_name(member)
return 'set%s' % v8_utilities.capitalize(name)
@@ -53,13 +60,25 @@
def dictionary_context(dictionary, interfaces_info):
includes.clear()
includes.update(DICTIONARY_CPP_INCLUDES)
+
+ if 'RuntimeEnabled' in dictionary.extended_attributes:
+ raise Exception(
+ 'Dictionary cannot be RuntimeEnabled: %s' % dictionary.name)
+
+ members = [member_context(dictionary, member)
+ for member in sorted(dictionary.members,
+ key=operator.attrgetter('name'))]
+
+ for member in members:
+ if member['runtime_enabled_feature_name']:
+ includes.add('platform/runtime_enabled_features.h')
+ break
+
cpp_class = v8_utilities.cpp_name(dictionary)
context = {
'cpp_class': cpp_class,
'header_includes': set(DICTIONARY_H_INCLUDES),
- 'members': [member_context(dictionary, member)
- for member in sorted(dictionary.members,
- key=operator.attrgetter('name'))],
+ 'members': members,
'required_member_names': sorted([member.name
for member in dictionary.members
if member.is_required]),
@@ -101,7 +120,8 @@
return cpp_default_value, v8_default_value
cpp_default_value, v8_default_value = default_values()
- cpp_name = v8_utilities.cpp_name(member)
+ cpp_name = to_snake_case(v8_utilities.cpp_name(member))
+ getter_name = getter_name_for_dictionary_member(member)
is_deprecated_dictionary = unwrapped_idl_type.name == 'Dictionary'
return {
@@ -109,26 +129,27 @@
'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',
+ cpp_value='impl.%s()' % getter_name, isolate='isolate',
creation_context='creationContext',
extended_attributes=extended_attributes),
'deprecate_as': v8_utilities.deprecate_as(member),
'enum_type': idl_type.enum_type,
'enum_values': unwrapped_idl_type.enum_values,
+ 'getter_name': getter_name,
'has_method_name': has_method_name_for_dictionary_member(member),
'idl_type': idl_type.base_type,
- 'is_interface_type': idl_type.is_interface_type and not (idl_type.is_dictionary_type or is_deprecated_dictionary),
+ 'is_interface_type': idl_type.is_interface_type and not is_deprecated_dictionary,
'is_nullable': idl_type.is_nullable,
'is_object': unwrapped_idl_type.name == 'Object' or is_deprecated_dictionary,
'is_required': member.is_required,
'name': member.name,
- 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(member), # [RuntimeEnabled]
+ 'runtime_enabled_feature_name': v8_utilities.runtime_enabled_feature_name(member), # [RuntimeEnabled]
'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),
+ member.name + 'CppValue', isolate='isolate', use_exception_state=True),
}
@@ -149,11 +170,14 @@
return sorted(members_dict.values(), key=lambda member: member['cpp_name'])
includes.clear()
+ header_forward_decls = set()
header_includes = set(['platform/heap/Handle.h'])
- members = [member_impl_context(member, interfaces_info, header_includes)
+ members = [member_impl_context(member, interfaces_info,
+ header_includes, header_forward_decls)
for member in dictionary.members]
members = remove_duplicate_members(members)
context = {
+ 'header_forward_decls': header_forward_decls,
'header_includes': header_includes,
'cpp_class': v8_utilities.cpp_name(dictionary),
'members': members,
@@ -165,49 +189,68 @@
if parent_interface_info:
context['header_includes'].add(
parent_interface_info['include_path'])
+ else:
+ context['parent_cpp_class'] = 'IDLDictionaryBase'
+ context['header_includes'].add(
+ 'bindings/core/v8/IDLDictionaryBase.h')
return context
-def member_impl_context(member, interfaces_info, header_includes):
+def member_impl_context(member, interfaces_info, header_includes,
+ header_forward_decls):
idl_type = unwrap_nullable_if_needed(member.idl_type)
- cpp_name = v8_utilities.cpp_name(member)
+ cpp_name = to_snake_case(v8_utilities.cpp_name(member))
- def getter_expression():
- if idl_type.impl_should_use_nullable_container:
- return 'm_%s.get()' % cpp_name
- return 'm_%s' % cpp_name
+ nullable_indicator_name = None
+ if not idl_type.cpp_type_has_null_value:
+ nullable_indicator_name = 'has_' + 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 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)
- elif idl_type.name == 'Dictionary':
- return '!m_%s.isUndefinedOrNull()' % cpp_name
- else:
- return 'm_%s' % cpp_name
-
- def member_cpp_type():
- member_cpp_type = idl_type.cpp_type_args(used_in_cpp_sequence=True)
- if idl_type.impl_should_use_nullable_container:
- return v8_types.cpp_template_type('Nullable', member_cpp_type)
- return member_cpp_type
+ if nullable_indicator_name:
+ return nullable_indicator_name
+ if idl_type.is_union_type or idl_type.is_enum or idl_type.is_string_type:
+ return '!%s_.IsNull()' % cpp_name
+ if idl_type.name in ['Any', 'Object']:
+ return '!({0}_.IsEmpty() || {0}_.IsNull() || {0}_.IsUndefined())'.format(cpp_name)
+ if idl_type.name == 'Dictionary':
+ return '!%s_.IsUndefinedOrNull()' % cpp_name
+ return '%s_' % cpp_name
cpp_default_value = None
if member.default_value and not member.default_value.is_null:
cpp_default_value = idl_type.literal_cpp_value(member.default_value)
- header_includes.update(idl_type.impl_includes_for_type(interfaces_info))
+ forward_decl_name = idl_type.impl_forward_declaration_name
+ if forward_decl_name:
+ includes.update(idl_type.impl_includes_for_type(interfaces_info))
+ header_forward_decls.add(forward_decl_name)
+ else:
+ header_includes.update(idl_type.impl_includes_for_type(interfaces_info))
+
+ setter_value = 'value'
+ if idl_type.is_array_buffer_view_or_typed_array:
+ setter_value += '.View()'
+
+ non_null_type = idl_type.inner_type if idl_type.is_nullable else idl_type
+ setter_inline = 'inline ' if (
+ non_null_type.is_basic_type or
+ non_null_type.is_enum or
+ non_null_type.is_wrapper_type) else ''
+
return {
'cpp_default_value': cpp_default_value,
'cpp_name': cpp_name,
- 'getter_expression': getter_expression(),
+ 'getter_expression': cpp_name + '_',
+ 'getter_name': getter_name_for_dictionary_member(member),
'has_method_expression': has_method_expression(),
'has_method_name': has_method_name_for_dictionary_member(member),
'is_nullable': idl_type.is_nullable,
'is_traceable': idl_type.is_traceable,
- 'member_cpp_type': member_cpp_type(),
+ 'member_cpp_type': idl_type.cpp_type_args(used_in_cpp_sequence=True),
'null_setter_name': null_setter_name_for_dictionary_member(member),
+ 'nullable_indicator_name': nullable_indicator_name,
'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
+ 'setter_inline': setter_inline,
'setter_name': setter_name_for_dictionary_member(member),
+ 'setter_value': setter_value,
}
diff --git a/bindings/scripts/v8_globals.py b/bindings/scripts/v8_globals.py
index 9ca2a35..55ed257 100644
--- a/bindings/scripts/v8_globals.py
+++ b/bindings/scripts/v8_globals.py
@@ -29,4 +29,3 @@
"""Module to share global variables (includes and interfaces) across modules."""
includes = set()
-interfaces = {}
diff --git a/bindings/scripts/v8_interface.py b/bindings/scripts/v8_interface.py
index 35edaee..c8b3245 100644
--- a/bindings/scripts/v8_interface.py
+++ b/bindings/scripts/v8_interface.py
@@ -27,49 +27,175 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# pylint: disable=relative-import
+
"""Generate template values for an interface.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
+from operator import or_
-from collections import defaultdict
-import itertools
-from operator import itemgetter
-
-import idl_definitions
-from idl_definitions import IdlOperation, IdlArgument
-import idl_types
+from idl_definitions import IdlAttribute, IdlOperation, IdlArgument
from idl_types import IdlType, inherits_interface
+from overload_set_algorithm import effective_overload_set_by_length
+from overload_set_algorithm import method_overloads_by_name
+
import v8_attributes
from v8_globals import includes
import v8_methods
import v8_types
-from v8_types import cpp_ptr_type, cpp_template_type
import v8_utilities
-from v8_utilities import (origin_trial_enabled_function, cpp_name_or_partial, capitalize, cpp_name, gc_type,
- has_extended_attribute_value, runtime_enabled_function_name,
- extended_attribute_value_as_list, is_legacy_interface_type_checking)
+from v8_utilities import (context_enabled_feature_name, cpp_name_or_partial, cpp_name,
+ has_extended_attribute_value, runtime_enabled_feature_name,
+ is_legacy_interface_type_checking)
INTERFACE_H_INCLUDES = frozenset([
- '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',
+ 'bindings/core/v8/GeneratedCodeHelper.h',
+ 'bindings/core/v8/NativeValueTraits.h',
+ 'platform/bindings/ScriptWrappable.h',
+ 'bindings/core/v8/ToV8ForCore.h',
+ 'bindings/core/v8/V8BindingForCore.h',
+ 'platform/bindings/V8DOMWrapper.h',
+ 'platform/bindings/WrapperTypeInfo.h',
'platform/heap/Handle.h',
])
INTERFACE_CPP_INCLUDES = frozenset([
'bindings/core/v8/ExceptionState.h',
'bindings/core/v8/V8DOMConfiguration.h',
- 'bindings/core/v8/V8ObjectConstructor.h',
- 'core/dom/Document.h',
- 'wtf/GetPtr.h',
- 'wtf/RefPtr.h',
+ 'platform/bindings/V8ObjectConstructor.h',
+ 'core/dom/ExecutionContext.h',
+ 'platform/wtf/GetPtr.h',
+ 'platform/wtf/RefPtr.h',
])
-def interface_context(interface):
+def filter_has_constant_configuration(constants):
+ return [constant for constant in constants if
+ not constant['measure_as'] and
+ not constant['deprecate_as'] and
+ not constant['runtime_enabled_feature_name'] and
+ not constant['origin_trial_feature_name']]
+
+
+def filter_has_special_getter(constants):
+ return [constant for constant in constants if
+ constant['measure_as'] or
+ constant['deprecate_as']]
+
+
+def filter_runtime_enabled(constants):
+ return [constant for constant in constants if
+ constant['runtime_enabled_feature_name']]
+
+
+def filter_origin_trial_enabled(constants):
+ return [constant for constant in constants if
+ constant['origin_trial_feature_name']]
+
+
+def constant_filters():
+ return {'has_constant_configuration': filter_has_constant_configuration,
+ 'has_special_getter': filter_has_special_getter,
+ 'runtime_enabled_constants': filter_runtime_enabled,
+ 'origin_trial_enabled_constants': filter_origin_trial_enabled}
+
+
+def origin_trial_features(interface, constants, attributes, methods):
+ """ Returns a list of the origin trial features used in this interface.
+
+ Each element is a dictionary with keys 'name' and 'needs_instance'.
+ 'needs_instance' is true if any member associated with the interface needs
+ to be installed on every instance of the interface. This list is the union
+ of the sets of features used for constants, attributes and methods.
+ """
+ KEY = 'origin_trial_feature_name' # pylint: disable=invalid-name
+
+ def member_filter(members):
+ return sorted([member for member in members if member.get(KEY) and not member.get('exposed_test')])
+
+ def member_filter_by_name(members, name):
+ return [member for member in members if member[KEY] == name]
+
+ # Collect all members visible on this interface with a defined origin trial
+ origin_trial_constants = member_filter(constants)
+ origin_trial_attributes = member_filter(attributes)
+ origin_trial_methods = member_filter([method for method in methods
+ if v8_methods.method_is_visible(method, interface.is_partial) and
+ not v8_methods.custom_registration(method)])
+
+ feature_names = set([member[KEY] for member in origin_trial_constants + origin_trial_attributes + origin_trial_methods])
+
+ # Construct the list of dictionaries. 'needs_instance' will be true if any
+ # member for the feature has 'on_instance' defined as true.
+ features = [{'name': name,
+ 'constants': member_filter_by_name(origin_trial_constants, name),
+ 'attributes': member_filter_by_name(origin_trial_attributes, name),
+ 'methods': member_filter_by_name(origin_trial_methods, name)}
+ for name in feature_names]
+ for feature in features:
+ members = feature['constants'] + feature['attributes'] + feature['methods']
+ feature['needs_instance'] = any(member.get('on_instance', False) for member in members)
+ # TODO(chasej): Need to handle method overloads? e.g.
+ # (method['overloads']['secure_context_test_all'] if 'overloads' in method else method['secure_context_test'])
+ feature['needs_secure_context'] = any(member.get('secure_context_test', False) for member in members)
+
+ if features:
+ includes.add('platform/bindings/ScriptState.h')
+ includes.add('core/origin_trials/origin_trials.h')
+ return features
+
+
+def context_enabled_features(attributes):
+ """ Returns a list of context-enabled features from a set of attributes.
+
+ Each element is a dictionary with the feature's |name| and lists of
+ |attributes| associated with the feature.
+ """
+ KEY = 'context_enabled_feature_name' # pylint: disable=invalid-name
+
+ def member_filter(members):
+ return sorted([member for member in members if member.get(KEY) and not member.get('exposed_test')])
+
+ def member_filter_by_name(members, name):
+ return [member for member in members if member[KEY] == name]
+
+ # Collect all members visible on this interface with a defined origin trial
+ context_enabled_attributes = member_filter(attributes)
+ feature_names = set([member[KEY] for member in context_enabled_attributes])
+ features = [{'name': name,
+ 'attributes': member_filter_by_name(context_enabled_attributes, name),
+ 'needs_instance': False}
+ for name in feature_names]
+ if features:
+ includes.add('platform/bindings/ScriptState.h')
+ return features
+
+
+def runtime_call_stats_context(interface):
+ counter_prefix = 'Blink_' + v8_utilities.cpp_name(interface) + '_'
+ return {
+ 'constructor_counter': counter_prefix + 'Constructor',
+ 'cross_origin_named_getter_counter': counter_prefix + 'CrossOriginNamedGetter',
+ 'cross_origin_named_setter_counter': counter_prefix + 'CrossOriginNamedSetter',
+ 'indexed_property_getter_counter': counter_prefix + 'IndexedPropertyGetter',
+ 'named_property_getter_counter': counter_prefix + 'NamedPropertyGetter',
+ 'named_property_query_counter': counter_prefix + 'NamedPropertyQuery',
+ 'named_property_setter_counter': counter_prefix + 'NamedPropertySetter',
+ }
+
+def interface_context(interface, interfaces):
+ """Creates a Jinja template context for an interface.
+
+ Args:
+ interface: An interface to create the context for
+ interfaces: A dict which maps an interface name to the definition
+ which can be referred if needed
+
+ Returns:
+ A Jinja template context for |interface|
+ """
+
includes.clear()
includes.update(INTERFACE_CPP_INCLUDES)
header_includes = set(INTERFACE_H_INCLUDES)
@@ -108,10 +234,14 @@
'bindings/core/v8/V8Float64Array.h',
'bindings/core/v8/V8DataView.h'))
+ # [ActiveScriptWrappable]
+ active_scriptwrappable = 'ActiveScriptWrappable' in extended_attributes
+
# [CheckSecurity]
is_check_security = 'CheckSecurity' in extended_attributes
if is_check_security:
includes.add('bindings/core/v8/BindingSecurity.h')
+ includes.add('core/frame/LocalDOMWindow.h')
# [DependentLifetime]
is_dependent_lifetime = 'DependentLifetime' in extended_attributes
@@ -120,81 +250,62 @@
is_global = ('PrimaryGlobal' in extended_attributes or
'Global' in extended_attributes)
- # [SetWrapperReferenceFrom]
- set_wrapper_reference_from = extended_attributes.get('SetWrapperReferenceFrom')
- if set_wrapper_reference_from:
- includes.update(['bindings/core/v8/V8GCController.h',
- 'core/dom/Element.h'])
+ # [ImmutablePrototype]
+ # TODO(littledan): Is it possible to deduce this based on inheritance,
+ # as in the WebIDL spec?
+ is_immutable_prototype = is_global or 'ImmutablePrototype' in extended_attributes
- # [SetWrapperReferenceTo]
- 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()
+ wrapper_class_id = ('kNodeClassId' if inherits_interface(interface.name, 'Node') else 'kObjectClassId')
- # [SetWrapperReferenceFrom]
- has_visit_dom_wrapper = (
- has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
- set_wrapper_reference_from or set_wrapper_reference_to)
+ # [ActiveScriptWrappable] must be accompanied with [DependentLifetime].
+ if active_scriptwrappable and not is_dependent_lifetime:
+ raise Exception('[ActiveScriptWrappable] interface must also specify '
+ '[DependentLifetime]: %s' % interface.name)
- this_gc_type = gc_type(interface)
-
- wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Node') else 'ObjectClassId')
+ # [LegacyUnenumerableNamedProperties]
+ # pylint: disable=C0103
+ has_legacy_unenumerable_named_properties = (interface.has_named_property_getter and
+ 'LegacyUnenumerableNamedProperties' in extended_attributes)
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)
- if 'RuntimeEnabled' in extended_attributes:
- includes.add('platform/RuntimeEnabledFeatures.h')
-
- if 'OriginTrialEnabled' in extended_attributes:
- includes.add('core/inspector/ConsoleMessage.h')
- includes.add('core/origin_trials/OriginTrials.h')
+ # TODO(peria): Generate the target list from 'Window' and 'HTMLDocument'.
+ needs_runtime_enabled_installer = v8_class_name in [
+ 'V8Window', 'V8HTMLDocument', 'V8Document', 'V8Node', 'V8EventTarget']
context = {
+ 'active_scriptwrappable': active_scriptwrappable,
+ 'context_enabled_feature_name': context_enabled_feature_name(interface), # [ContextEnabled]
'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,
+ 'is_gc_type': True,
# 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_legacy_unenumerable_named_properties': has_legacy_unenumerable_named_properties,
'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_array_buffer_or_view': is_array_buffer_or_view,
'is_check_security': is_check_security,
'is_event_target': is_event_target,
- 'is_exception': interface.is_exception,
'is_global': is_global,
+ 'is_immutable_prototype': is_immutable_prototype,
'is_node': inherits_interface(interface.name, 'Node'),
'is_partial': interface.is_partial,
'is_typed_array_type': is_typed_array_type,
- 'lifetime': 'Dependent' if (has_visit_dom_wrapper or is_dependent_lifetime) else 'Independent',
+ 'lifetime': 'kDependent' if is_dependent_lifetime else 'kIndependent',
'measure_as': v8_utilities.measure_as(interface, None), # [MeasureAs]
- 'origin_trial_name': v8_utilities.origin_trial_name(interface),
+ 'needs_runtime_enabled_installer': needs_runtime_enabled_installer,
+ 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(interface),
'parent_interface': parent_interface,
- 'pass_cpp_type': cpp_template_type(
- cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type),
- cpp_name(interface)),
- 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled]
- 'set_wrapper_reference_from': set_wrapper_reference_from,
- 'set_wrapper_reference_to': set_wrapper_reference_to,
+ 'pass_cpp_type': cpp_name(interface) + '*',
+ 'runtime_call_stats': runtime_call_stats_context(interface),
+ 'runtime_enabled_feature_name': runtime_enabled_feature_name(interface), # [RuntimeEnabled]
'v8_class': v8_class_name,
'v8_class_or_partial': v8_class_name_or_partial,
'wrapper_class_id': wrapper_class_id,
@@ -216,6 +327,16 @@
number_of_required_arguments(constructor),
} for constructor in interface.custom_constructors]
+ # [HTMLConstructor]
+ has_html_constructor = 'HTMLConstructor' in extended_attributes
+ # https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
+ if has_html_constructor:
+ if ('Constructor' in extended_attributes) or ('NoInterfaceObject' in extended_attributes):
+ raise Exception('[Constructor] and [NoInterfaceObject] MUST NOT be'
+ ' specified with [HTMLConstructor]: '
+ '%s' % interface.name)
+ includes.add('bindings/core/v8/V8HTMLConstructor.h')
+
# [NamedConstructor]
named_constructor = named_constructor_context(interface)
@@ -224,91 +345,241 @@
raise Exception('[Constructor] and [NamedConstructor] MUST NOT be'
' specified on partial interface definitions: '
'%s' % interface.name)
+ if named_constructor:
+ includes.add('platform/bindings/V8PrivateProperty.h')
- includes.add('bindings/core/v8/V8ObjectConstructor.h')
+ includes.add('platform/bindings/V8ObjectConstructor.h')
includes.add('core/frame/LocalDOMWindow.h')
elif 'Measure' in extended_attributes or 'MeasureAs' in extended_attributes:
- raise Exception('[Measure] or [MeasureAs] specified for interface without a constructor: '
- '%s' % interface.name)
+ if not interface.is_partial:
+ raise Exception('[Measure] or [MeasureAs] specified for interface without a constructor: '
+ '%s' % interface.name)
- # [Unscopeable] attributes and methods
- unscopeables = []
+ # [ConstructorCallWith=Document]
+ if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Document'):
+ includes.add('core/dom/Document.h')
+
+ # [Unscopable] attributes and methods
+ unscopables = []
for attribute in interface.attributes:
- if 'Unscopeable' in attribute.extended_attributes:
- unscopeables.append((attribute.name, v8_utilities.runtime_enabled_function_name(attribute)))
+ if 'Unscopable' in attribute.extended_attributes:
+ unscopables.append((attribute.name, runtime_enabled_feature_name(attribute)))
for method in interface.operations:
- if 'Unscopeable' in method.extended_attributes:
- unscopeables.append((method.name, v8_utilities.runtime_enabled_function_name(method)))
+ if 'Unscopable' in method.extended_attributes:
+ unscopables.append((method.name, runtime_enabled_feature_name(method)))
+
+ # [CEReactions]
+ setter_or_deleters = (
+ interface.indexed_property_setter,
+ interface.indexed_property_deleter,
+ interface.named_property_setter,
+ interface.named_property_deleter,
+ )
+ has_ce_reactions = any(setter_or_deleter and 'CEReactions' in setter_or_deleter.extended_attributes
+ for setter_or_deleter in setter_or_deleters)
+ if has_ce_reactions:
+ includes.add('core/html/custom/CEReactionsScope.h')
context.update({
'constructors': constructors,
'has_custom_constructor': bool(custom_constructors),
+ 'has_html_constructor': has_html_constructor,
'interface_length':
- interface_length(interface, constructors + custom_constructors),
+ interface_length(constructors + custom_constructors),
'is_constructor_raises_exception': extended_attributes.get('RaisesException') == 'Constructor', # [RaisesException=Constructor]
'named_constructor': named_constructor,
- 'unscopeables': sorted(unscopeables),
+ 'unscopables': sorted(unscopables),
})
- constants = [constant_context(constant, interface) for constant in interface.constants]
-
- special_getter_constants = []
- runtime_enabled_constants = dict()
- constant_configuration_constants = []
-
- for constant in constants:
- if constant['measure_as'] or constant['deprecate_as'] or constant['origin_trial_name']:
- special_getter_constants.append(constant)
- continue
- runtime_enabled_function = constant['runtime_enabled_function']
- if runtime_enabled_function:
- if runtime_enabled_function not in runtime_enabled_constants:
- runtime_enabled_constants[runtime_enabled_function] = []
- runtime_enabled_constants[runtime_enabled_function].append(constant)
- continue
- constant_configuration_constants.append(constant)
-
# Constants
context.update({
- 'constant_configuration_constants': constant_configuration_constants,
- 'constants': constants,
+ 'constants': [constant_context(constant, interface) for constant in interface.constants],
'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes,
- 'has_constant_configuration': any(
- not constant['runtime_enabled_function']
- for constant in constants),
- 'runtime_enabled_constants': sorted(runtime_enabled_constants.iteritems()),
- 'special_getter_constants': special_getter_constants,
})
# Attributes
- attributes = [v8_attributes.attribute_context(interface, attribute)
+ attributes = attributes_context(interface, interfaces)
+
+ context.update({
+ 'attributes': attributes,
+ # Elements in attributes are broken in following members.
+ 'accessors': v8_attributes.filter_accessors(attributes),
+ 'data_attributes': v8_attributes.filter_data_attributes(attributes),
+ 'lazy_data_attributes': v8_attributes.filter_lazy_data_attributes(attributes),
+ 'runtime_enabled_attributes': v8_attributes.filter_runtime_enabled(attributes),
+ })
+
+ # Conditionally enabled attributes
+ conditional_enabled_attributes = v8_attributes.filter_conditionally_enabled(attributes)
+ has_conditional_attributes_on_prototype = any( # pylint: disable=invalid-name
+ attribute['on_prototype'] for attribute in conditional_enabled_attributes)
+ has_conditionally_enabled_constructors = any( # pylint: disable=invalid-name
+ attribute['constructor_type'] for attribute in conditional_enabled_attributes)
+ has_conditionally_enabled_secure_attributes = any( # pylint: disable=invalid-name
+ v8_attributes.is_secure_context(attribute) for attribute in conditional_enabled_attributes)
+ context.update({
+ 'has_conditionally_enabled_constructors':
+ has_conditionally_enabled_constructors,
+ 'has_conditionally_enabled_secure_attributes':
+ has_conditionally_enabled_secure_attributes,
+ 'conditionally_enabled_attributes': conditional_enabled_attributes,
+ })
+
+ # Methods
+ context.update(methods_context(interface))
+ methods = context['methods']
+ context.update({
+ 'has_origin_safe_method_setter': any(method['is_cross_origin'] and not method['is_unforgeable']
+ for method in methods),
+ })
+
+ # Conditionally enabled methods
+ conditionally_enabled_methods = v8_methods.filter_conditionally_enabled(methods, interface.is_partial)
+ has_conditionally_enabled_secure_methods = any( # pylint: disable=invalid-name
+ v8_methods.is_secure_context(method) for method in conditionally_enabled_methods)
+ context.update({
+ 'has_conditionally_enabled_secure_methods':
+ has_conditionally_enabled_secure_methods,
+ 'conditionally_enabled_methods': conditionally_enabled_methods,
+ })
+
+ # Window.idl in Blink has indexed properties, but the spec says Window
+ # interface doesn't have indexed properties, instead the WindowProxy exotic
+ # object has indexed properties. Thus, Window interface must not support
+ # iterators.
+ has_array_iterator = (not interface.is_partial and
+ interface.has_indexed_elements and
+ interface.name != 'Window')
+ context.update({
+ 'has_array_iterator': has_array_iterator,
+ 'iterable': interface.iterable,
+ })
+
+ # Conditionally enabled members
+ prepare_prototype_and_interface_object_func = None # pylint: disable=invalid-name
+ if (unscopables or has_conditional_attributes_on_prototype or
+ context['conditionally_enabled_methods']):
+ prepare_prototype_and_interface_object_func = '%s::preparePrototypeAndInterfaceObject' % v8_class_name_or_partial # pylint: disable=invalid-name
+ has_install_conditional_features_on_global_func = has_conditionally_enabled_constructors # pylint: disable=invalid-name
+
+ context.update({
+ 'prepare_prototype_and_interface_object_func': prepare_prototype_and_interface_object_func,
+ 'has_install_conditional_features_on_global_func': has_install_conditional_features_on_global_func,
+ })
+
+ context.update({
+ 'legacy_caller': legacy_caller(interface.legacy_caller, interface),
+ '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': property_getter(interface.named_property_getter, ['name']),
+ 'named_property_setter': property_setter(interface.named_property_setter, interface),
+ 'named_property_deleter': property_deleter(interface.named_property_deleter),
+ })
+ context.update({
+ 'has_named_properties_object': is_global and context['named_property_getter'],
+ })
+
+ # Origin Trials and ContextEnabled features
+ context.update({
+ 'optional_features':
+ sorted(origin_trial_features(interface, context['constants'], context['attributes'], context['methods']) +
+ context_enabled_features(context['attributes'])),
+ })
+
+ # Cross-origin interceptors
+ has_cross_origin_named_getter = False
+ has_cross_origin_named_setter = False
+ has_cross_origin_indexed_getter = False
+
+ for attribute in attributes:
+ if attribute['has_cross_origin_getter']:
+ has_cross_origin_named_getter = True
+ if attribute['has_cross_origin_setter']:
+ has_cross_origin_named_setter = True
+
+ # Methods are exposed as getter attributes on the interface: e.g.
+ # window.location gets the location attribute on the Window interface. For
+ # the cross-origin case, this attribute getter is guaranteed to only return
+ # a Function object, which the actual call is dispatched against.
+ for method in methods:
+ if method['is_cross_origin']:
+ has_cross_origin_named_getter = True
+
+ has_cross_origin_named_enumerator = has_cross_origin_named_getter or has_cross_origin_named_setter # pylint: disable=invalid-name
+
+ if context['named_property_getter'] and context['named_property_getter']['is_cross_origin']:
+ has_cross_origin_named_getter = True
+
+ if context['indexed_property_getter'] and context['indexed_property_getter']['is_cross_origin']:
+ has_cross_origin_indexed_getter = True
+
+ context.update({
+ 'has_cross_origin_named_getter': has_cross_origin_named_getter,
+ 'has_cross_origin_named_setter': has_cross_origin_named_setter,
+ 'has_cross_origin_named_enumerator': has_cross_origin_named_enumerator,
+ 'has_cross_origin_indexed_getter': has_cross_origin_indexed_getter,
+ })
+
+ return context
+
+
+def attributes_context(interface, interfaces):
+ """Creates a list of Jinja template contexts for attributes of an interface.
+
+ Args:
+ interface: An interface to create contexts for
+ interfaces: A dict which maps an interface name to the definition
+ which can be referred if needed
+
+ Returns:
+ A list of attribute contexts
+ """
+
+ attributes = [v8_attributes.attribute_context(interface, attribute, interfaces)
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)
+ 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_accessor_configuration': any(
- not (attribute['exposed_test'] or
- attribute['runtime_enabled_function']) and
- not attribute['is_data_type_property'] and
- attribute['should_be_exposed_to_script']
- for attribute in attributes),
- 'has_attribute_configuration': any(
- not (attribute['exposed_test'] or
- attribute['runtime_enabled_function']) and
- attribute['is_data_type_property'] and
- attribute['should_be_exposed_to_script']
- for attribute in attributes),
- 'has_constructor_attributes': any(attribute['constructor_type'] for attribute in attributes),
- 'needs_constructor_setter_callback': any(attribute['constructor_type'] == attribute['name'] for attribute in attributes),
- 'has_replaceable_attributes': any(attribute['is_replaceable'] for attribute in attributes),
- })
+ # See also comment in methods_context.
+ if not interface.is_partial and (interface.maplike or interface.setlike):
+ if any(attribute['name'] == 'size' for attribute in attributes):
+ raise ValueError(
+ 'An interface cannot define an attribute called "size"; it is '
+ 'implied by maplike/setlike in the IDL.')
+ size_attribute = IdlAttribute()
+ size_attribute.name = 'size'
+ size_attribute.idl_type = IdlType('unsigned long')
+ size_attribute.is_read_only = True
+ size_attribute.extended_attributes['NotEnumerable'] = None
+ attributes.append(v8_attributes.attribute_context(
+ interface, size_attribute, interfaces))
- # Methods
+ return attributes
+
+
+def methods_context(interface):
+ """Creates a list of Jinja template contexts for methods of an interface.
+
+ Args:
+ interface: An interface to create contexts for
+
+ Returns:
+ A dictionary with 3 keys:
+ 'iterator_method': An iterator context if available or None.
+ 'iterator_method_alias': A string that can also be used to refer to the
+ @@iterator symbol or None.
+ 'methods': A list of method contexts.
+ """
+
methods = []
+
if interface.original_interface:
methods.extend([v8_methods.method_context(interface, operation, is_visible=False)
for operation in interface.original_interface.operations
@@ -325,7 +596,7 @@
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 = IdlOperation()
operation.idl_type = return_type
operation.name = name
if arguments:
@@ -338,7 +609,7 @@
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 = IdlArgument()
argument.idl_type = idl_type
argument.name = name
argument.is_optional = is_optional
@@ -346,17 +617,20 @@
argument.extended_attributes.update(extended_attributes)
return argument
- # [Iterable], iterable<>, maplike<> and setlike<>
+ # iterable<>, maplike<> and setlike<>
iterator_method = None
- has_array_iterator = False
+
+ # Depending on the declaration, @@iterator may be a synonym for e.g.
+ # 'entries' or 'values'.
+ iterator_method_alias = 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 interface.has_indexed_elements or 'Iterable' in extended_attributes)):
+ if (not interface.is_partial and (
+ interface.iterable or interface.maplike or interface.setlike or
+ interface.has_indexed_elements)):
used_extended_attributes = {}
@@ -389,31 +663,45 @@
extended_attributes=used_extended_attributes,
implemented_as=implemented_as)
- if interface.iterable or interface.maplike or interface.setlike or 'Iterable' in extended_attributes:
- iterator_method = generated_iterator_method('iterator', implemented_as='iterator')
- elif interface.has_indexed_elements:
- has_array_iterator = True
+ if not interface.has_indexed_elements:
+ iterator_method = generated_iterator_method('iterator', implemented_as='GetIterator')
if interface.iterable or interface.maplike or interface.setlike:
- implicit_methods = [
- generated_iterator_method('keys'),
- generated_iterator_method('values'),
- generated_iterator_method('entries'),
+ non_overridable_methods = []
+ overridable_methods = []
- # 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),
- ]
+ is_value_iterator = interface.iterable and interface.iterable.key_type is None
+
+ # For value iterators, the |entries|, |forEach|, |keys| and |values| are originally set
+ # to corresponding properties in %ArrayPrototype%.
+ # For pair iterators and maplike declarations, |entries| is an alias for @@iterator
+ # itself. For setlike declarations, |values| is an alias for @@iterator.
+ if not is_value_iterator:
+ if not interface.setlike:
+ iterator_method_alias = 'entries'
+ entries_or_values_method = generated_iterator_method('values')
+ else:
+ iterator_method_alias = 'values'
+ entries_or_values_method = generated_iterator_method('entries')
+
+ non_overridable_methods.extend([
+ generated_iterator_method('keys'),
+ entries_or_values_method,
+
+ # 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([
+ non_overridable_methods.extend([
generated_method(IdlType('boolean'), 'has',
arguments=[key_argument],
extended_attributes=used_extended_attributes),
@@ -423,7 +711,7 @@
])
if not interface.maplike.is_read_only:
- implicit_methods.extend([
+ overridable_methods.extend([
generated_method(IdlType('void'), 'clear',
extended_attributes=used_extended_attributes),
generated_method(IdlType('boolean'), 'delete',
@@ -437,14 +725,14 @@
if interface.setlike:
value_argument = generated_argument(interface.setlike.value_type, 'value')
- implicit_methods.extend([
+ non_overridable_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([
+ overridable_methods.extend([
generated_method(IdlType(interface.name), 'add',
arguments=[value_argument],
extended_attributes=used_extended_attributes),
@@ -459,11 +747,19 @@
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:
+ for non_overridable_method in non_overridable_methods:
+ if non_overridable_method['name'] in methods_by_name:
+ raise ValueError(
+ 'An interface cannot define an operation called "%s()", it '
+ 'comes from the iterable, maplike or setlike declaration '
+ 'in the IDL.' % non_overridable_method['name'])
+ methods.append(non_overridable_method)
+
+ for overridable_method in overridable_methods:
+ if overridable_method['name'] in methods_by_name:
# FIXME: Check that the existing method is compatible.
continue
- methods.append(implicit_method)
+ methods.append(overridable_method)
# FIXME: maplike<> and setlike<> should also imply the presence of a
# 'size' attribute.
@@ -502,45 +798,6 @@
extended_attributes=stringifier_ext_attrs,
implemented_as=implemented_as))
- conditionally_enabled_methods = []
- custom_registration_methods = []
- method_configuration_methods = []
-
- for method in methods:
- # Skip all but one method in each set of overloaded methods.
- if 'overload_index' in method and 'overloads' not in method:
- continue
-
- if 'overloads' in method:
- overloads = method['overloads']
- 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'] or
- overloads['runtime_determined_lengths'])
- else:
- 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 has_custom_registration:
- custom_registration_methods.append(method)
- continue
- if conditionally_exposed_function:
- conditionally_enabled_methods.append(method)
- continue
- if runtime_enabled_function:
- custom_registration_methods.append(method)
- continue
- if method['should_be_exposed_to_script']:
- method_configuration_methods.append(method)
-
for method in methods:
# The value of the Function object’s “length” property is a Number
# determined as follows:
@@ -556,71 +813,41 @@
method['length'] = (method['overloads']['length'] if 'overloads' in method else
method['number_of_required_arguments'])
- context.update({
- 'conditionally_enabled_methods': conditionally_enabled_methods,
- 'custom_registration_methods': custom_registration_methods,
- 'has_origin_safe_method_setter': is_global and any(
- method['is_check_security_for_receiver'] and not method['is_unforgeable']
- 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),
+ return {
'iterator_method': iterator_method,
- 'has_array_iterator': has_array_iterator,
- 'method_configuration_methods': method_configuration_methods,
+ 'iterator_method_alias': iterator_method_alias,
'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({
- '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': 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),
- })
- context.update({
- 'has_named_properties_object': is_global and context['named_property_getter'],
- })
+def reflected_name(constant_name):
+ """Returns the name to use for the matching constant name in blink code.
- return context
+ Given an all-uppercase 'CONSTANT_NAME', returns a camel-case
+ 'kConstantName'.
+ """
+ # Check for SHOUTY_CASE constants
+ if constant_name.upper() != constant_name:
+ return constant_name
+ return 'k' + ''.join(part.title() for part in constant_name.split('_'))
# [DeprecateAs], [OriginTrialEnabled], [Reflect], [RuntimeEnabled]
def constant_context(constant, interface):
extended_attributes = constant.extended_attributes
- if 'OriginTrialEnabled' in extended_attributes:
- includes.add('core/inspector/ConsoleMessage.h')
- includes.add('core/origin_trials/OriginTrials.h')
-
return {
'cpp_class': extended_attributes.get('PartialInterfaceImplementedAs'),
'deprecate_as': v8_utilities.deprecate_as(constant), # [DeprecateAs]
'idl_type': constant.idl_type.name,
- 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(constant) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialEnabled]
'measure_as': v8_utilities.measure_as(constant, interface), # [MeasureAs]
'name': constant.name,
- 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(constant), # [OriginTrialEnabled]
- 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialEnabled]
- 'origin_trial_name': extended_attributes.get('OriginTrialEnabled'), # [OriginTrialEnabled]
+ 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(constant), # [OriginTrialEnabled]
+ 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(constant), # [OriginTrialEnabled]
# FIXME: use 'reflected_name' as correct 'name'
- 'reflected_name': extended_attributes.get('Reflect', constant.name),
- 'runtime_enabled_function': runtime_enabled_function_name(constant), # [RuntimeEnabled]
+ 'rcs_counter': 'Blink_' + v8_utilities.cpp_name(interface) + '_' + constant.name + '_ConstantGetter',
+ 'reflected_name': extended_attributes.get('Reflect', reflected_name(constant.name)),
+ 'runtime_enabled_feature_name': runtime_enabled_feature_name(constant), # [RuntimeEnabled]
'value': constant.value,
}
@@ -656,18 +883,6 @@
overloads[-1]['overloads']['name'] = name
-def method_overloads_by_name(methods):
- """Returns generator of overloaded methods by name: [name, [method]]"""
- # Filter to only methods that are actually overloaded
- method_counts = Counter(method['name'] for method in methods)
- overloaded_method_names = set(name
- for name, count in method_counts.iteritems()
- if count > 1)
- overloaded_methods = [method for method in methods
- if method['name'] in overloaded_method_names]
-
- # Group by name (generally will be defined together, but not necessarily)
- return sort_and_groupby(overloaded_methods, itemgetter('name'))
def overloads_context(interface, overloads):
@@ -680,6 +895,13 @@
for index, method in enumerate(overloads, 1):
method['overload_index'] = index
+ # [OriginTrialEnabled]
+ # TODO(iclelland): Allow origin trials on method overloads
+ # (crbug.com/621641)
+ if any(method.get('origin_trial_feature_name') for method in overloads):
+ raise Exception('[OriginTrialEnabled] cannot be specified on '
+ 'overloaded methods: %s.%s' % (interface.name, overloads[0]['name']))
+
effective_overloads_by_length = effective_overload_set_by_length(overloads)
lengths = [length for length, _ in effective_overloads_by_length]
name = overloads[0].get('name', '<constructor>')
@@ -691,26 +913,26 @@
# 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'):
+ if not common_value(overloads, 'runtime_enabled_feature_name'):
# 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')
+ if (all(method.get('runtime_enabled_feature_name')
for method, _, _ in shortest_overloads)):
- # Generate a list of (length, runtime_enabled_functions) tuples.
+ # Generate a list of (length, runtime_enabled_feature_names) tuples.
runtime_determined_lengths = []
for length, effective_overloads in effective_overloads_by_length:
- runtime_enabled_functions = set(
- method['runtime_enabled_function']
+ runtime_enabled_feature_names = set(
+ method['runtime_enabled_feature_name']
for method, _, _ in effective_overloads
- if method.get('runtime_enabled_function'))
- if not runtime_enabled_functions:
+ if method.get('runtime_enabled_feature_name'))
+ if not runtime_enabled_feature_names:
# This "length" is unconditionally enabled, so stop here.
runtime_determined_lengths.append((length, [None]))
break
runtime_determined_lengths.append(
- (length, sorted(runtime_enabled_functions)))
+ (length, sorted(runtime_enabled_feature_names)))
function_length = ('%sV8Internal::%sMethodLength()'
% (cpp_name_or_partial(interface), name))
@@ -718,38 +940,25 @@
# 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.
+ if (not common_value(overloads, 'runtime_enabled_feature_name') and
+ all(method.get('runtime_enabled_feature_name')
+ for method, _, _ in longest_overloads)):
+ # Generate a list of (length, runtime_enabled_feature_name) tuples.
runtime_determined_maxargs = []
for length, effective_overloads in reversed(effective_overloads_by_length):
- runtime_enabled_functions = set(
- method['runtime_enabled_function']
+ runtime_enabled_feature_names = set(
+ method['runtime_enabled_feature_name']
for method, _, _ in effective_overloads
- if method.get('runtime_enabled_function'))
- if not runtime_enabled_functions:
+ if method.get('runtime_enabled_feature_name'))
+ if not runtime_enabled_feature_names:
# This "length" is unconditionally enabled, so stop here.
runtime_determined_maxargs.append((length, [None]))
break
runtime_determined_maxargs.append(
- (length, sorted(runtime_enabled_functions)))
+ (length, sorted(runtime_enabled_feature_names)))
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.
- # Skip the check for overloaded constructors, since they don't support any
- # of the extended attributes in question.
- if not overloads[0].get('is_constructor'):
- overload_extended_attributes = [
- method['custom_registration_extended_attributes']
- for method in overloads]
- for extended_attribute in v8_methods.CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES:
- if common_key(overload_extended_attributes, extended_attribute) is None:
- raise ValueError('Overloads of %s have conflicting extended attribute %s'
- % (name, extended_attribute))
-
# 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('returns_promise'))
@@ -774,7 +983,6 @@
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
@@ -784,115 +992,18 @@
'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,
+ 'runtime_enabled_all': common_value(overloads, 'runtime_enabled_feature_name'), # [RuntimeEnabled]
+ 'secure_context_test_all': common_value(overloads, 'secure_context_test'), # [SecureContext]
+ '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,
}
-def effective_overload_set(F):
- """Returns the effective overload set of an overloaded function.
-
- An effective overload set is the set of overloaded functions + signatures
- (type list of arguments, with optional and variadic arguments included or
- not), and is used in the overload resolution algorithm.
-
- For example, given input [f1(optional long x), f2(DOMString s)], the output
- is informally [f1(), f1(long), f2(DOMString)], and formally
- [(f1, [], []), (f1, [long], [optional]), (f2, [DOMString], [required])].
-
- Currently the optionality list is a list of |is_optional| booleans (True
- means optional, False means required); to support variadics this needs to
- be tri-valued as required, optional, or variadic.
-
- Formally:
- An effective overload set represents the allowable invocations for a
- particular operation, constructor (specified with [Constructor] or
- [NamedConstructor]), legacy caller or callback function.
-
- An additional argument N (argument count) is needed when overloading
- variadics, but we don't use that currently.
-
- Spec: http://heycam.github.io/webidl/#dfn-effective-overload-set
-
- Formally the input and output lists are sets, but methods are stored
- internally as dicts, which can't be stored in a set because they are not
- hashable, so we use lists instead.
-
- Arguments:
- F: list of overloads for a given callable name.
-
- Returns:
- S: list of tuples of the form (callable, type list, optionality list).
- """
- # Code closely follows the algorithm in the spec, for clarity and
- # correctness, and hence is not very Pythonic.
-
- # 1. Initialize S to ∅.
- # (We use a list because we can't use a set, as noted above.)
- S = []
-
- # 2. Let F be a set with elements as follows, according to the kind of
- # effective overload set:
- # (Passed as argument, nothing to do.)
-
- # 3. & 4. (maxarg, m) are only needed for variadics, not used.
-
- # 5. For each operation, extended attribute or callback function X in F:
- for X in F: # X is the "callable", F is the overloads.
- arguments = X['arguments']
- # 1. Let n be the number of arguments X is declared to take.
- n = len(arguments)
- # 2. Let t0..n−1 be a list of types, where ti is the type of X’s
- # argument at index i.
- # (“type list”)
- t = tuple(argument['idl_type_object'] for argument in arguments)
- # 3. Let o0..n−1 be a list of optionality values, where oi is “variadic”
- # 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/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:
- # (Not used, so not implemented.)
- # 6. Initialize i to n−1.
- i = n - 1
- # 7. While i ≥ 0:
- # Spec bug (fencepost error); should be “While i > 0:”
- # https://www.w3.org/Bugs/Public/show_bug.cgi?id=25590
- while i > 0:
- # 1. If argument i of X is not optional, then break this loop.
- if not o[i]:
- break
- # 2. Otherwise, add to S the tuple <X, t0..i−1, o0..i−1>.
- S.append((X, t[:i], o[:i]))
- # 3. Set i to i−1.
- i = i - 1
- # 8. If n > 0 and all arguments of X are optional, then add to S the
- # tuple <X, (), ()> (where “()” represents the empty list).
- if n > 0 and all(oi for oi in o):
- S.append((X, [], []))
- # 6. The effective overload set is S.
- return S
-
-
-def effective_overload_set_by_length(overloads):
- def type_list_length(entry):
- # Entries in the effective overload set are 3-tuples:
- # (callable, type list, optionality list)
- return len(entry[1])
-
- effective_overloads = effective_overload_set(overloads)
- return list(sort_and_groupby(effective_overloads, type_list_length))
-
def distinguishing_argument_index(entries):
"""Returns the distinguishing argument index for a sequence of entries.
@@ -966,7 +1077,7 @@
distinguishing_argument_type_names = [type_list[index]
for type_list in type_lists]
if (len(set(distinguishing_argument_type_names)) !=
- len(distinguishing_argument_type_names)):
+ len(distinguishing_argument_type_names)):
raise ValueError('Types in distinguishing argument are not distinct:\n'
'%s' % distinguishing_argument_type_names)
@@ -1052,7 +1163,7 @@
try:
method = next(method for idl_type, method in idl_types_methods
if idl_type.is_nullable)
- test = 'isUndefinedOrNull(%s)' % cpp_value
+ test = 'IsUndefinedOrNull(%s)' % cpp_value
yield test, method
except StopIteration:
pass
@@ -1067,7 +1178,10 @@
for idl_type, method in ((idl_type, method)
for idl_type, method in idl_types_methods
if idl_type.is_wrapper_type):
- test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.format(idl_type=idl_type.base_type, cpp_value=cpp_value)
+ if idl_type.is_array_buffer_or_view:
+ test = '{cpp_value}->Is{idl_type}()'.format(idl_type=idl_type.base_type, cpp_value=cpp_value)
+ else:
+ test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.format(idl_type=idl_type.base_type, cpp_value=cpp_value)
yield test, method
# 13. Otherwise: if IsCallable(V) is true, and there is an entry in S that
@@ -1080,7 +1194,7 @@
# same thing.
try:
method = next(method for idl_type, method in idl_types_methods
- if idl_type.is_callback_function)
+ if idl_type.is_custom_callback_function)
test = '%s->IsFunction()' % cpp_value
yield test, method
except StopIteration:
@@ -1113,9 +1227,10 @@
# Array in overloaded method: http://crbug.com/262383
yield '%s->IsArray()' % cpp_value, method
for idl_type, method in idl_types_methods:
- if idl_type.is_dictionary or idl_type.name == 'Dictionary':
- # FIXME: should be '{1}->IsObject() && !{1}->IsDate() && !{1}->IsRegExp()'.format(cpp_value)
- # FIXME: the IsDate and IsRegExp checks can be skipped if we've
+ if idl_type.is_dictionary or idl_type.name == 'Dictionary' or \
+ idl_type.is_callback_interface or idl_type.is_record_type:
+ # FIXME: should be '{1}->IsObject() && !{1}->IsRegExp()'.format(cpp_value)
+ # FIXME: the IsRegExp checks can be skipped if we've
# already generated tests for them.
yield '%s->IsObject()' % cpp_value, method
@@ -1170,14 +1285,6 @@
# Utility functions
################################################################################
-def Counter(iterable):
- # Once using Python 2.7, using collections.Counter
- counter = defaultdict(lambda: 0)
- for item in iterable:
- counter[item] += 1
- return counter
-
-
def common(dicts, f):
"""Returns common result of f across an iterable of dicts, or None.
@@ -1208,12 +1315,6 @@
return common(dicts, lambda d: d.get(key))
-def sort_and_groupby(l, key=None):
- """Returns a generator of (key, list), sorting and grouping list by key."""
- l.sort(key=key)
- return ((k, list(g)) for k, g in itertools.groupby(l, key))
-
-
################################################################################
# Constructors
################################################################################
@@ -1230,27 +1331,25 @@
return {
'arguments': argument_contexts,
- 'cpp_type': cpp_template_type(
- cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)),
- cpp_name(interface)),
+ 'cpp_type': cpp_name(interface) + '*',
'cpp_value': v8_methods.cpp_value(
interface, constructor, len(constructor.arguments)),
'has_exception_state':
is_constructor_raises_exception or
any(argument for argument in constructor.arguments
if argument.idl_type.name == 'SerializedScriptValue' or
- argument.idl_type.v8_conversion_needs_exception_state),
+ argument.idl_type.v8_conversion_needs_exception_state),
'has_optional_argument_without_default_value':
any(True for argument_context in argument_contexts
if argument_context['is_optional_without_default_value']),
'is_call_with_document':
# [ConstructorCallWith=Document]
has_extended_attribute_value(interface,
- 'ConstructorCallWith', 'Document'),
+ 'ConstructorCallWith', 'Document'),
'is_call_with_execution_context':
# [ConstructorCallWith=ExecutionContext]
has_extended_attribute_value(interface,
- 'ConstructorCallWith', 'ExecutionContext'),
+ 'ConstructorCallWith', 'ExecutionContext'),
'is_call_with_script_state':
# [ConstructorCallWith=ScriptState]
has_extended_attribute_value(
@@ -1260,6 +1359,7 @@
'is_raises_exception': is_constructor_raises_exception,
'number_of_required_arguments':
number_of_required_arguments(constructor),
+ 'rcs_counter': 'Blink_' + v8_utilities.cpp_name(interface) + '_ConstructorCallback'
}
@@ -1286,7 +1386,7 @@
if not argument.is_optional])
-def interface_length(interface, constructors):
+def interface_length(constructors):
# Docs: http://heycam.github.io/webidl/#es-interface-call
if not constructors:
return 0
@@ -1299,19 +1399,23 @@
# http://heycam.github.io/webidl/#idl-special-operations
################################################################################
+def legacy_caller(caller, interface):
+ if not caller:
+ return None
+
+ return v8_methods.method_context(interface, caller)
+
def property_getter(getter, cpp_arguments):
if not getter:
return None
def is_null_expression(idl_type):
- if idl_type.use_output_parameter_for_result:
- return 'result.isNull()'
- if idl_type.is_string_type:
- return 'result.isNull()'
+ if idl_type.use_output_parameter_for_result or 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 'result.IsEmpty()'
return ''
extended_attributes = getter.extended_attributes
@@ -1336,8 +1440,8 @@
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_cross_origin': 'CrossOrigin' in extended_attributes,
'is_custom':
'Custom' in extended_attributes and
(not extended_attributes['Custom'] or
@@ -1346,12 +1450,14 @@
getter, 'Custom', 'PropertyEnumerator'),
'is_custom_property_query': has_extended_attribute_value(
getter, 'Custom', 'PropertyQuery'),
+ # TODO(rakuco): [NotEnumerable] does not make sense here and is only
+ # used in non-standard IDL operations. We need to get rid of them.
'is_enumerable': 'NotEnumerable' not in extended_attributes,
'is_null_expression': is_null_expression(idl_type),
'is_raises_exception': is_raises_exception,
'name': cpp_name(getter),
'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),
+ 'v8_set_return_value': idl_type.v8_set_return_value('result', extended_attributes=extended_attributes, script_wrappable='impl'),
}
@@ -1364,6 +1470,7 @@
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
+ is_ce_reactions = 'CEReactions' in extended_attributes
# [LegacyInterfaceTypeChecking]
has_type_checking_interface = (
@@ -1376,6 +1483,7 @@
'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_ce_reactions': is_ce_reactions,
'is_custom': 'Custom' in extended_attributes,
'is_nullable': idl_type.is_nullable,
'is_raises_exception': is_raises_exception,
@@ -1390,10 +1498,11 @@
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')
+ is_ce_reactions = 'CEReactions' in extended_attributes
return {
'is_call_with_script_state': is_call_with_script_state,
+ 'is_ce_reactions': is_ce_reactions,
'is_custom': 'Custom' in extended_attributes,
'is_raises_exception': 'RaisesException' in extended_attributes,
'name': cpp_name(deleter),
diff --git a/bindings/scripts/v8_methods.py b/bindings/scripts/v8_methods.py
index a3d4232..b199947 100644
--- a/bindings/scripts/v8_methods.py
+++ b/bindings/scripts/v8_methods.py
@@ -43,24 +43,83 @@
is_legacy_interface_type_checking)
-# Methods with any of these require custom method registration code in the
-# interface's configure*Template() function.
-CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([
- 'DoNotCheckSecurity',
- 'DoNotCheckSignature',
-])
+def method_is_visible(method, interface_is_partial):
+ if 'overloads' in method:
+ return method['overloads']['visible'] and not (method['overloads']['has_partial_overloads'] and interface_is_partial)
+ return method['visible'] and 'overload_index' not in method
+
+
+def is_origin_trial_enabled(method):
+ return bool(method['origin_trial_feature_name'])
+
+
+def is_secure_context(method):
+ return bool(method['overloads']['secure_context_test_all'] if 'overloads' in method else method['secure_context_test'])
+
+
+def is_conditionally_enabled(method):
+ exposed = method['overloads']['exposed_test_all'] if 'overloads' in method else method['exposed_test']
+ return exposed or is_secure_context(method)
+
+
+def filter_conditionally_enabled(methods, interface_is_partial):
+ return [method for method in methods if (
+ method_is_visible(method, interface_is_partial) and
+ is_conditionally_enabled(method) and
+ not is_origin_trial_enabled(method))]
+
+
+def custom_registration(method):
+ # TODO(dcheng): Currently, bindings must create a function object for each
+ # realm as a hack to support the incumbent realm. Remove the need for custom
+ # registration when Blink properly supports the incumbent realm.
+ if method['is_cross_origin']:
+ return True
+ if 'overloads' in method:
+ return (method['overloads']['runtime_determined_lengths'] or
+ (method['overloads']['runtime_enabled_all'] and not is_conditionally_enabled(method)))
+ return method['runtime_enabled_feature_name'] and not is_conditionally_enabled(method)
+
+
+def filter_custom_registration(methods, interface_is_partial):
+ return [method for method in methods if (
+ method_is_visible(method, interface_is_partial) and custom_registration(method))]
+
+
+def filter_method_configuration(methods, interface_is_partial):
+ return [method for method in methods if
+ method_is_visible(method, interface_is_partial) and
+ not is_origin_trial_enabled(method) and
+ not is_conditionally_enabled(method) and
+ not custom_registration(method)]
+
+
+def method_filters():
+ return {'custom_registration': filter_custom_registration,
+ 'has_method_configuration': filter_method_configuration}
def use_local_result(method):
extended_attributes = method.extended_attributes
idl_type = method.idl_type
return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or
- 'ImplementedInPrivateScript' in extended_attributes or
+ 'NewObject' in extended_attributes or
'RaisesException' in extended_attributes or
idl_type.is_union_type or
idl_type.is_explicit_nullable)
+def runtime_call_stats_context(interface, method):
+ includes.add('platform/bindings/RuntimeCallStats.h')
+ generic_counter_name = 'Blink_' + v8_utilities.cpp_name(interface) + '_' + method.name
+ (method_counter, extended_attribute_defined) = v8_utilities.rcs_counter_name(method, generic_counter_name)
+ return {
+ 'extended_attribute_defined': extended_attribute_defined,
+ 'method_counter': method_counter,
+ 'origin_safe_method_getter_counter': generic_counter_name + '_OriginSafeMethodGetter'
+ }
+
+
def method_context(interface, method, is_visible=True):
arguments = method.arguments
extended_attributes = method.extended_attributes
@@ -73,15 +132,6 @@
this_cpp_value = cpp_value(interface, method, len(arguments))
- is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_attributes
- if is_implemented_in_private_script:
- includes.add('bindings/core/v8/PrivateScriptRunner.h')
- includes.add('core/frame/LocalFrame.h')
- includes.add('platform/ScriptForbiddenScope.h')
-
- # [OnlyExposedToPrivateScript]
- is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended_attributes
-
is_call_with_script_arguments = has_extended_attribute_value(method, 'CallWith', 'ScriptArguments')
if is_call_with_script_arguments:
includes.update(['bindings/core/v8/ScriptCallStack.h',
@@ -89,42 +139,38 @@
is_call_with_script_state = has_extended_attribute_value(method, 'CallWith', 'ScriptState')
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')
+ includes.add('platform/bindings/ScriptState.h')
# [CheckSecurity]
- is_do_not_check_security = 'DoNotCheckSecurity' in extended_attributes
+ is_cross_origin = 'CrossOrigin' in extended_attributes
is_check_security_for_receiver = (
has_extended_attribute_value(interface, 'CheckSecurity', 'Receiver') and
- not is_do_not_check_security)
+ not is_cross_origin)
is_check_security_for_return_value = (
has_extended_attribute_value(method, 'CheckSecurity', 'ReturnValue'))
if is_check_security_for_receiver or is_check_security_for_return_value:
includes.add('bindings/core/v8/BindingSecurity.h')
+ is_ce_reactions = 'CEReactions' in extended_attributes
+ if is_ce_reactions:
+ includes.add('core/html/custom/CEReactionsScope.h')
is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attributes
if is_custom_element_callbacks:
- includes.add('core/dom/custom/CustomElementProcessingStack.h')
+ includes.add('core/html/custom/V0CustomElementProcessingStack.h')
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')
- includes.add('core/frame/ImageBitmap.h')
+ includes.add('bindings/core/v8/serialization/SerializedScriptValueFactory.h')
+ includes.add('bindings/core/v8/serialization/Transferables.h')
+ includes.add('core/typed_arrays/DOMArrayBufferBase.h')
+ includes.add('core/imagebitmap/ImageBitmap.h')
if 'LenientThis' in extended_attributes:
raise Exception('[LenientThis] is not supported for operations.')
- if 'RuntimeEnabled' in extended_attributes:
- includes.add('platform/RuntimeEnabledFeatures.h')
-
- if 'OriginTrialEnabled' in extended_attributes:
- includes.add('core/inspector/ConsoleMessage.h')
- includes.add('core/origin_trials/OriginTrials.h')
-
argument_contexts = [
argument_context(interface, method, argument, index, is_visible=is_visible)
for index, argument in enumerate(arguments)]
@@ -132,22 +178,13 @@
return {
'activity_logging_world_list': v8_utilities.activity_logging_world_list(method), # [ActivityLogging]
'arguments': argument_contexts,
- 'argument_declarations_for_private_script':
- argument_declarations_for_private_script(interface, method),
'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type)
if idl_type.is_explicit_nullable else idl_type.cpp_type),
'cpp_value': this_cpp_value,
'cpp_type_initializer': idl_type.cpp_type_initializer,
- 'custom_registration_extended_attributes':
- CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES.intersection(
- extended_attributes.iterkeys()),
'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs]
+ 'do_not_test_new_object': 'DoNotTestNewObject' in extended_attributes,
'exposed_test': v8_utilities.exposed(method, interface), # [Exposed]
- # TODO(yukishiino): Retire has_custom_registration flag. Should be
- # replaced with V8DOMConfiguration::PropertyLocationConfiguration.
- 'has_custom_registration':
- v8_utilities.has_extended_attribute(
- method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES),
'has_exception_state':
is_raises_exception or
is_check_security_for_receiver or
@@ -158,22 +195,21 @@
any(True for argument_context in argument_contexts
if argument_context['is_optional_without_default_value']),
'idl_type': idl_type.base_type,
- 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(method) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialEnabled]
'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_ce_reactions': is_ce_reactions,
'is_check_security_for_receiver': is_check_security_for_receiver,
'is_check_security_for_return_value': is_check_security_for_return_value,
+ 'is_cross_origin': 'CrossOrigin' 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,
'is_explicit_nullable': idl_type.is_explicit_nullable,
- 'is_implemented_in_private_script': is_implemented_in_private_script,
+ 'is_new_object': 'NewObject' in extended_attributes,
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
@@ -194,15 +230,13 @@
'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,
- 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(method), # [OriginTrialEnabled]
- 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialEnabled]
- 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
- extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->isolate()', bailout_return_value='false'),
+ 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(method), # [OriginTrialEnabled]
+ 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(method), # [OriginTrialEnabled]
'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),
+ 'runtime_call_stats': runtime_call_stats_context(interface, method),
+ 'runtime_enabled_feature_name': v8_utilities.runtime_enabled_feature_name(method), # [RuntimeEnabled]
+ 'secure_context_test': v8_utilities.secure_context(method, interface), # [SecureContext]
'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),
@@ -225,11 +259,6 @@
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.')
-
set_default_value = argument.set_default_value
this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes,
raw_type=True,
@@ -263,13 +292,10 @@
'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(method, argument, index),
+ 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(interface.name, method, argument, index),
}
context.update({
'is_optional_without_default_value':
@@ -281,37 +307,14 @@
return context
-def argument_declarations_for_private_script(interface, method):
- argument_declarations = ['LocalFrame* frame']
- argument_declarations.append('%s* holderImpl' % interface.name)
- argument_declarations.extend(['%s %s' % (argument.idl_type.cpp_type_args(
- used_as_rvalue_type=True), argument.name) for argument in method.arguments])
- if method.idl_type.name != 'void':
- argument_declarations.append('%s* %s' % (method.idl_type.cpp_type, 'result'))
- return argument_declarations
-
-
################################################################################
# Value handling
################################################################################
def cpp_value(interface, method, number_of_arguments):
- def cpp_argument(argument):
- idl_type = argument.idl_type
- if idl_type.name == 'EventListener':
- return argument.name
- if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull',
- 'XPathNSResolver', 'XPathNSResolverOrNull']):
- # FIXME: remove this special case
- return '%s.release()' % argument.name
- return argument.name
-
# Truncate omitted optional arguments
arguments = method.arguments[:number_of_arguments]
cpp_arguments = []
- if 'ImplementedInPrivateScript' in method.extended_attributes:
- cpp_arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
- cpp_arguments.append('impl')
if method.is_constructor:
call_with_values = interface.extended_attributes.get('ConstructorCallWith')
@@ -323,15 +326,11 @@
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in method.extended_attributes and
- 'ImplementedInPrivateScript' not in method.extended_attributes and
not method.is_static):
cpp_arguments.append('*impl')
- cpp_arguments.extend(cpp_argument(argument) for argument in arguments)
+ cpp_arguments.extend(argument.name for argument in arguments)
- if 'ImplementedInPrivateScript' in method.extended_attributes:
- if method.idl_type.name != 'void':
- cpp_arguments.append('&result')
- elif ('RaisesException' in method.extended_attributes or
+ if ('RaisesException' in method.extended_attributes or
(method.is_constructor and
has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
cpp_arguments.append('exceptionState')
@@ -343,11 +342,9 @@
cpp_arguments.append('result')
if method.name == 'Constructor':
- base_name = 'create'
+ base_name = 'Create'
elif method.name == 'NamedConstructor':
- base_name = 'createForJSConstructor'
- elif 'ImplementedInPrivateScript' in method.extended_attributes:
- base_name = '%sMethod' % method.name
+ base_name = 'CreateForJSConstructor'
else:
base_name = v8_utilities.cpp_name(method)
@@ -362,23 +359,16 @@
# Constructors and void methods don't have a return type
return None
- if ('ImplementedInPrivateScript' in extended_attributes and
- not idl_type.is_wrapper_type and
- not idl_type.is_basic_type):
- raise Exception('Private scripts supports only primitive types and DOM wrappers.')
-
- release = False
# [CallWith=ScriptState], [RaisesException]
if use_local_result(method):
if idl_type.is_explicit_nullable:
# result is of type Nullable<T>
- cpp_value = 'result.get()'
+ cpp_value = 'result.Get()'
else:
cpp_value = 'result'
- release = idl_type.release
script_wrappable = 'impl' if inherits_interface(interface_name, 'Node') else ''
- return idl_type.v8_set_return_value(cpp_value, extended_attributes, script_wrappable=script_wrappable, release=release, for_main_world=for_main_world, is_static=method.is_static)
+ return idl_type.v8_set_return_value(cpp_value, extended_attributes, script_wrappable=script_wrappable, for_main_world=for_main_world, is_static=method.is_static)
def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise):
@@ -386,35 +376,66 @@
idl_type = argument.idl_type
this_cpp_type = idl_type.cpp_type
- if method.returns_promise:
- check_expression = 'exceptionState.hadException()'
- else:
- check_expression = 'exceptionState.throwIfNeeded()'
-
if idl_type.is_dictionary or idl_type.is_union_type:
vector_type = 'HeapVector'
else:
vector_type = 'Vector'
return {
- 'assign_expression': 'toImplArguments<%s<%s>>(info, %s, exceptionState)' % (vector_type, this_cpp_type, index),
- 'check_expression': check_expression,
+ 'assign_expression': 'ToImplArguments<%s<%s>>(info, %s, exceptionState)' % (vector_type, this_cpp_type, index),
+ 'check_expression': 'exceptionState.HadException()',
'cpp_type': this_cpp_type,
'cpp_name': argument.name,
'declare_variable': False,
}
-def v8_value_to_local_cpp_value(method, argument, index, return_promise=False, restricted_float=False):
+def v8_value_to_local_cpp_ssv_value(extended_attributes, idl_type, v8_value, variable_name, for_storage):
+ this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, raw_type=True)
+
+ storage_policy = 'kForStorage' if for_storage else 'kNotForStorage'
+ arguments = ', '.join([
+ 'info.GetIsolate()',
+ v8_value,
+ '{ssv}::SerializeOptions({ssv}::{storage_policy})',
+ 'exceptionState'
+ ])
+ cpp_expression_format = 'NativeValueTraits<{ssv}>::NativeValue(%s)' % arguments
+ this_cpp_value = cpp_expression_format.format(
+ ssv='SerializedScriptValue',
+ storage_policy=storage_policy
+ )
+
+ return {
+ 'assign_expression': this_cpp_value,
+ 'check_expression': 'exceptionState.HadException()',
+ 'cpp_type': this_cpp_type,
+ 'cpp_name': variable_name,
+ 'declare_variable': False,
+ }
+
+
+def v8_value_to_local_cpp_value(interface_name, method, argument, index, return_promise=False):
extended_attributes = argument.extended_attributes
idl_type = argument.idl_type
name = argument.name
+ v8_value = 'info[%s]' % index
+
+ # History.pushState and History.replaceState are explicitly specified as
+ # serializing the value for storage. The default is to not serialize for
+ # storage. See https://html.spec.whatwg.org/multipage/browsers.html#dom-history-pushstate
+ if idl_type.name == 'SerializedScriptValue':
+ for_storage = (interface_name == 'History' and
+ method.name in ('pushState', 'replaceState'))
+ return v8_value_to_local_cpp_ssv_value(extended_attributes, idl_type,
+ v8_value, name,
+ for_storage=for_storage)
+
if argument.is_variadic:
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,
- use_exception_state=method.returns_promise,
- restricted_float=restricted_float)
+ return idl_type.v8_value_to_local_cpp_value(extended_attributes, v8_value,
+ name, declare_variable=False,
+ use_exception_state=method.returns_promise)
################################################################################
@@ -470,7 +491,7 @@
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,
+ 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))
diff --git a/bindings/scripts/v8_types.py b/bindings/scripts/v8_types.py
index 04739d2..b59f393 100644
--- a/bindings/scripts/v8_types.py
+++ b/bindings/scripts/v8_types.py
@@ -26,6 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# pylint: disable=relative-import
+
"""Functions for type handling and type conversion (Blink/C++ <-> V8/JS).
Extends IdlType and IdlUnionType with V8-specific properties, methods, and
@@ -39,9 +41,16 @@
import posixpath
-from idl_types import IdlTypeBase, IdlType, IdlUnionType, IdlArrayOrSequenceType, IdlNullableType
+from idl_types import IdlArrayOrSequenceType
+from idl_types import IdlNullableType
+from idl_types import IdlRecordType
+from idl_types import IdlType
+from idl_types import IdlTypeBase
+from idl_types import IdlUnionType
+from utilities import to_snake_case
import v8_attributes # for IdlType.constructor_type_name
from v8_globals import includes
+from v8_utilities import extended_attribute_value_contains
################################################################################
@@ -66,6 +75,9 @@
'Uint16Array',
'Uint32Array',
])
+ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES = TYPED_ARRAY_TYPES.union(frozenset([
+ 'ArrayBufferView'
+]))
ARRAY_BUFFER_AND_VIEW_TYPES = TYPED_ARRAY_TYPES.union(frozenset([
'ArrayBuffer',
'ArrayBufferView',
@@ -77,6 +89,9 @@
IdlType.is_array_buffer_or_view = property(
lambda self: self.base_type in ARRAY_BUFFER_AND_VIEW_TYPES)
+IdlType.is_array_buffer_view_or_typed_array = property(
+ lambda self: self.base_type in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES)
+
IdlType.is_typed_array = property(
lambda self: self.base_type in TYPED_ARRAY_TYPES)
@@ -93,29 +108,27 @@
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_INTEGER_CONVERSION_RULES = {
+ 'byte': 'int8_t',
+ 'octet': 'uint8_t',
+ 'short': 'int16_t',
+ 'unsigned short': 'uint16_t',
+ 'long': 'int32_t',
+ 'unsigned long': 'uint32_t',
+ 'long long': 'int64_t',
+ 'unsigned long long': 'uint64_t',
+}
CPP_SPECIAL_CONVERSION_RULES = {
'Date': 'double',
'Dictionary': 'Dictionary',
'EventHandler': 'EventListener*',
- 'NodeFilter': 'RefPtrWillBeRawPtr<NodeFilter>',
+ 'EventListener': 'EventListener*',
+ 'NodeFilter': 'V8NodeFilterCondition*',
'Promise': 'ScriptPromise',
'ScriptValue': 'ScriptValue',
# FIXME: Eliminate custom bindings for XPathNSResolver http://crbug.com/345529
- 'XPathNSResolver': 'RawPtr<XPathNSResolver>',
+ 'XPathNSResolver': 'XPathNSResolver*',
'boolean': 'bool',
'unrestricted double': 'double',
'unrestricted float': 'float',
@@ -139,15 +152,25 @@
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.
+ Containers can be an array, a sequence, a dictionary or a record.
"""
+
def string_mode():
+ if idl_type.is_nullable:
+ return 'kTreatNullAndUndefinedAsNullString'
+ # TODO(lisabelle): Remove these 4 lines when we have fully supported
+ # annoteted types. (crbug.com/714866)
+ # It is because at that time 'TreatNullAs' will only appear in
+ # type_extended_attributes, not in extended_attributes.
if extended_attributes.get('TreatNullAs') == 'EmptyString':
- return 'TreatNullAsEmptyString'
- if idl_type.is_nullable or extended_attributes.get('TreatNullAs') == 'NullString':
- if extended_attributes.get('TreatUndefinedAs') == 'NullString':
- return 'TreatNullAndUndefinedAsNullString'
- return 'TreatNullAsNullString'
+ return 'kTreatNullAsEmptyString'
+ if extended_attributes.get('TreatNullAs') == 'NullString':
+ return 'kTreatNullAsNullString'
+ type_extended_attributes = idl_type.extended_attributes or {}
+ if type_extended_attributes.get('TreatNullAs') == 'EmptyString':
+ return 'kTreatNullAsEmptyString'
+ if type_extended_attributes.get('TreatNullAs') == 'NullString':
+ return 'kTreatNullAsNullString'
return ''
extended_attributes = extended_attributes or {}
@@ -159,43 +182,59 @@
else:
native_array_element_type = idl_type.native_array_element_type
if native_array_element_type:
- vector_type = cpp_ptr_type('Vector', 'HeapVector', native_array_element_type.gc_type)
+ vector_type = cpp_ptr_type('Vector', 'HeapVector', native_array_element_type.is_gc_type)
vector_template_type = cpp_template_type(vector_type, native_array_element_type.cpp_type_args(used_in_cpp_sequence=True))
if used_as_rvalue_type:
return 'const %s&' % vector_template_type
return vector_template_type
+ # Record types.
+ if idl_type.is_record_type:
+ vector_type = cpp_ptr_type('Vector', 'HeapVector', idl_type.value_type.is_gc_type)
+ value_type = idl_type.value_type.cpp_type_args(used_in_cpp_sequence=True)
+ vector_template_type = cpp_template_type(vector_type,
+ 'std::pair<String, %s>' % value_type)
+ if used_as_rvalue_type:
+ return 'const %s&' % vector_template_type
+ return vector_template_type
+
# 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_INTEGER_CONVERSION_RULES:
+ return CPP_INTEGER_CONVERSION_RULES[base_idl_type]
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 == 'SerializedScriptValue':
+ return 'RefPtr<%s>' % base_idl_type
if idl_type.is_string_type:
if not raw_type:
- return 'String'
+ return 'const String&' if used_as_rvalue_type else 'String'
return 'V8StringResource<%s>' % string_mode()
- if idl_type.base_type == 'ArrayBufferView' and 'FlexibleArrayBufferView' in extended_attributes:
+ if base_idl_type == 'ArrayBufferView' and 'FlexibleArrayBufferView' in extended_attributes:
return 'FlexibleArrayBufferView'
- if idl_type.base_type in TYPED_ARRAY_TYPES and 'FlexibleArrayBufferView' in extended_attributes:
- return 'Flexible' + idl_type.base_type + 'View'
+ if base_idl_type in TYPED_ARRAY_TYPES and 'FlexibleArrayBufferView' in extended_attributes:
+ return 'Flexible' + base_idl_type + 'View'
+ if base_idl_type in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES:
+ if not used_in_cpp_sequence:
+ if 'AllowShared' in extended_attributes:
+ return cpp_template_type('MaybeShared', idl_type.implemented_as)
+ else:
+ return cpp_template_type('NotShared', idl_type.implemented_as)
if idl_type.is_interface_type:
implemented_as_class = idl_type.implemented_as
- if raw_type or (used_as_rvalue_type and idl_type.is_garbage_collected):
+ if raw_type or (used_as_rvalue_type and idl_type.is_garbage_collected) or not used_in_cpp_sequence:
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 not used_in_cpp_sequence:
+ return implemented_as_class + '*'
+ return cpp_template_type('Member', implemented_as_class)
if idl_type.is_dictionary:
+ if used_as_rvalue_type:
+ return 'const %s&' % base_idl_type
return base_idl_type
if idl_type.is_union_type:
# Avoid "AOrNullOrB" for cpp type of (A? or B) because we generate
@@ -204,10 +243,16 @@
if idl_type.is_nullable:
return idl_type.inner_type.name
return idl_type.name
- idl_type_name = "Or".join(member_cpp_name(member)
+ 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
+ if idl_type.is_callback_function:
+ if idl_type.is_custom_callback_function:
+ return 'V8%s' % base_idl_type
+ return 'V8%s*' % base_idl_type
+ if base_idl_type == 'void':
+ return base_idl_type
# Default, assume native type is a pointer with same type name as idl type
return base_idl_type + '*'
@@ -253,13 +298,9 @@
return format_string.format(template=template, inner_type=inner_type)
-def cpp_ptr_type(old_type, new_type, gc_type):
- if gc_type == 'GarbageCollectedObject':
+def cpp_ptr_type(old_type, new_type, is_gc_type):
+ if is_gc_type:
return new_type
- if gc_type == 'WillBeGarbageCollectedObject':
- if old_type == 'Vector':
- return 'WillBe' + new_type
- return old_type + 'WillBe' + new_type
return old_type
@@ -303,71 +344,55 @@
cls.garbage_collected_types.update(new_garbage_collected_types))
-# [WillBeGarbageCollected]
-IdlType.will_be_garbage_collected_types = set()
-
-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 is_gc_type(idl_type):
+ return idl_type.is_garbage_collected or idl_type.is_dictionary or idl_type.is_union_type
-def gc_type(idl_type):
- 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'
- return 'RefCountedObject'
-
-IdlTypeBase.gc_type = property(gc_type)
+IdlTypeBase.is_gc_type = property(is_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)
+ return (idl_type.is_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)
+IdlRecordType.is_traceable = property(
+ lambda self: self.value_type.is_traceable)
################################################################################
# Includes
################################################################################
-def includes_for_cpp_class(class_name, relative_dir_posix):
- return set([posixpath.join('bindings', relative_dir_posix, class_name + '.h')])
-
-
INCLUDES_FOR_TYPE = {
'object': set(),
'ArrayBufferView': set(['bindings/core/v8/V8ArrayBufferView.h',
- 'core/dom/FlexibleArrayBufferView.h']),
+ 'core/typed_arrays/ArrayBufferViewHelpers.h',
+ 'core/typed_arrays/FlexibleArrayBufferView.h']),
'Dictionary': set(['bindings/core/v8/Dictionary.h']),
'EventHandler': set(['bindings/core/v8/V8AbstractEventListener.h',
- 'bindings/core/v8/V8EventListenerList.h']),
+ 'bindings/core/v8/V8EventListenerHelper.h']),
'EventListener': set(['bindings/core/v8/BindingSecurity.h',
- 'bindings/core/v8/V8EventListenerList.h',
+ 'bindings/core/v8/V8EventListenerHelper.h',
'core/frame/LocalDOMWindow.h']),
'HTMLCollection': set(['bindings/core/v8/V8HTMLCollection.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']),
+ 'core/html/HTMLTableRowsCollection.h',
+ 'core/html/forms/HTMLDataListOptionsCollection.h',
+ 'core/html/forms/HTMLFormControlsCollection.h']),
+ 'NodeFilter': set(['bindings/core/v8/V8NodeFilterCondition.h']),
'NodeList': set(['bindings/core/v8/V8NodeList.h',
'core/dom/NameNodeList.h',
'core/dom/NodeList.h',
'core/dom/StaticNodeList.h',
- 'core/html/LabelsNodeList.h']),
+ 'core/html/forms/LabelsNodeList.h']),
'Promise': set(['bindings/core/v8/ScriptPromise.h']),
- 'SerializedScriptValue': set(['bindings/core/v8/SerializedScriptValue.h',
- 'bindings/core/v8/SerializedScriptValueFactory.h']),
+ 'SerializedScriptValue': set(['bindings/core/v8/serialization/SerializedScriptValue.h',
+ 'bindings/core/v8/serialization/SerializedScriptValueFactory.h']),
'ScriptValue': set(['bindings/core/v8/ScriptValue.h']),
}
@@ -380,12 +405,13 @@
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.base_type in TYPED_ARRAY_TYPES:
+ if base_idl_type in TYPED_ARRAY_TYPES:
return INCLUDES_FOR_TYPE['ArrayBufferView'].union(
set(['bindings/%s/v8/V8%s.h' % (component_dir[base_idl_type], base_idl_type)])
)
if idl_type.is_basic_type:
- return set()
+ return set(['bindings/core/v8/IDLTypes.h',
+ 'bindings/core/v8/NativeValueTraitsImpl.h'])
if base_idl_type.endswith('ConstructorConstructor'):
# FIXME: rename to NamedConstructor
# FIXME: replace with a [NamedConstructorAttribute] extended attribute
@@ -396,6 +422,11 @@
if base_idl_type.endswith('Constructor'):
# FIXME: replace with a [ConstructorAttribute] extended attribute
base_idl_type = idl_type.constructor_type_name
+ if idl_type.is_custom_callback_function:
+ return set()
+ if idl_type.is_callback_function:
+ component = IdlType.callback_functions[base_idl_type]['component_dir']
+ return set(['bindings/%s/v8/%s.h' % (component, to_snake_case('V8%s' % base_idl_type))])
if base_idl_type not in component_dir:
return set()
return set(['bindings/%s/v8/V8%s.h' % (component_dir[base_idl_type],
@@ -412,11 +443,20 @@
def includes_for_array_or_sequence_type(idl_type, extended_attributes=None):
- return idl_type.element_type.includes_for_type(extended_attributes)
+ return set.union(set(['bindings/core/v8/IDLTypes.h',
+ 'bindings/core/v8/NativeValueTraitsImpl.h']),
+ idl_type.element_type.includes_for_type(extended_attributes))
IdlArrayOrSequenceType.includes_for_type = includes_for_array_or_sequence_type
+def includes_for_record_type(idl_type, extended_attributes=None):
+ return set.union(idl_type.key_type.includes_for_type(extended_attributes),
+ idl_type.value_type.includes_for_type(extended_attributes))
+
+IdlRecordType.includes_for_type = includes_for_record_type
+
+
def add_includes_for_type(idl_type, extended_attributes=None):
includes.update(idl_type.includes_for_type(extended_attributes))
@@ -431,36 +471,26 @@
includes.update(includes_for_interface(interface_name))
-def impl_should_use_nullable_container(idl_type):
- return not(idl_type.cpp_type_has_null_value)
-
-IdlTypeBase.impl_should_use_nullable_container = property(
- impl_should_use_nullable_container)
-
-
def impl_includes_for_type(idl_type, interfaces_info):
includes_for_type = set()
- if idl_type.impl_should_use_nullable_container:
- includes_for_type.add('bindings/core/v8/Nullable.h')
idl_type = idl_type.preprocessed_type
native_array_element_type = idl_type.native_array_element_type
if native_array_element_type:
includes_for_type.update(impl_includes_for_type(
native_array_element_type, interfaces_info))
- includes_for_type.add('wtf/Vector.h')
+ includes_for_type.add('platform/wtf/Vector.h')
base_idl_type = idl_type.base_type
if idl_type.is_string_type:
- includes_for_type.add('wtf/text/WTFString.h')
+ includes_for_type.add('platform/wtf/text/WTFString.h')
if base_idl_type in interfaces_info:
- interface_info = interfaces_info[idl_type.base_type]
- if interface_info['include_path']:
- includes_for_type.add(interface_info['include_path'])
+ interface_info = interfaces_info[base_idl_type]
+ 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'])
+ if idl_type.is_array_buffer_view_or_typed_array:
+ return set(['core/typed_arrays/DOMTypedArray.h', 'core/typed_arrays/ArrayBufferViewHelpers.h'])
return includes_for_type
@@ -474,6 +504,20 @@
IdlUnionType.impl_includes_for_type = impl_includes_for_type_union
+def impl_forward_declaration_name(idl_type):
+ element_type = idl_type.native_array_element_type
+ if element_type:
+ return element_type.impl_forward_declaration_name
+
+ if idl_type.is_wrapper_type and not idl_type.is_typed_array:
+ return idl_type.implemented_as
+ return None
+
+
+IdlTypeBase.impl_forward_declaration_name = property(
+ impl_forward_declaration_name)
+
+
component_dir = {}
@@ -485,35 +529,18 @@
# V8 -> C++
################################################################################
+# TODO(rakuco): Get rid of this definition altogether and move to NativeValueTraits<T>::nativeValue().
+# That requires not requiring ExceptionState where it is not used, and we must be careful not
+# to introduce any performance regressions.
V8_VALUE_TO_CPP_VALUE = {
# Basic
- 'Date': 'toCoreDate({isolate}, {v8_value})',
'DOMString': '{v8_value}',
- '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}, exceptionState)',
- 'EventTarget': 'toEventTarget({isolate}, {v8_value})',
- 'FlexibleArrayBufferView': 'toFlexibleArrayBufferView({isolate}, {v8_value}, {variable_name}, allocateFlexibleArrayBufferViewStorage({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}, nullptr, nullptr, nullptr, exceptionState)',
- 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})',
- 'Window': 'toDOMWindow({isolate}, {v8_value})',
- 'XPathNSResolver': 'toXPathNSResolver(ScriptState::current({isolate}), {v8_value})',
+ 'FlexibleArrayBufferView': 'ToFlexibleArrayBufferView({isolate}, {v8_value}, {variable_name}, allocateFlexibleArrayBufferViewStorage({v8_value}))',
+ 'Promise': 'ScriptPromise::Cast(ScriptState::Current({isolate}), {v8_value})',
+ 'ScriptValue': 'ScriptValue(ScriptState::Current({isolate}), {v8_value})',
+ 'Window': 'ToDOMWindow({isolate}, {v8_value})',
+ 'XPathNSResolver': 'ToXPathNSResolver(ScriptState::Current({isolate}), {v8_value})',
}
@@ -521,10 +548,12 @@
return (idl_type.is_numeric_type or
idl_type.is_enum or
idl_type.is_dictionary or
- idl_type.name in ('Boolean', 'ByteString', 'Dictionary', 'USVString', 'SerializedScriptValue'))
+ idl_type.is_array_buffer_view_or_typed_array or
+ idl_type.name in ('Boolean', 'ByteString', 'Date', 'Dictionary', 'USVString', 'SerializedScriptValue'))
IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state)
IdlArrayOrSequenceType.v8_conversion_needs_exception_state = True
+IdlRecordType.v8_conversion_needs_exception_state = True
IdlUnionType.v8_conversion_needs_exception_state = True
@@ -548,85 +577,112 @@
IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial)
-def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index, isolate, restricted_float=False):
+def native_value_traits_type_name(idl_type):
+ idl_type = idl_type.preprocessed_type
+
+ if idl_type.is_nullable:
+ idl_type = idl_type.inner_type
+
+ if idl_type.native_array_element_type:
+ name = 'IDLSequence<%s>' % native_value_traits_type_name(idl_type.native_array_element_type)
+ elif idl_type.is_record_type:
+ name = 'IDLRecord<%s, %s>' % (native_value_traits_type_name(idl_type.key_type),
+ native_value_traits_type_name(idl_type.value_type))
+ elif idl_type.is_basic_type or idl_type.name == 'Promise':
+ name = 'IDL%s' % idl_type.name
+ elif idl_type.implemented_as is not None:
+ name = idl_type.implemented_as
+ else:
+ name = idl_type.name
+ return name
+
+
+def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, isolate):
if idl_type.name == 'void':
return ''
- # Array or sequence types
- native_array_element_type = idl_type.native_array_element_type
- if native_array_element_type:
- return v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, index, isolate)
-
# Simple types
idl_type = idl_type.preprocessed_type
base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else idl_type.base_type
+ type_extended_attributes = idl_type.extended_attributes or {}
if 'FlexibleArrayBufferView' in extended_attributes:
- if base_idl_type not in TYPED_ARRAY_TYPES.union(set(['ArrayBufferView'])):
- raise "Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)
+ if base_idl_type not in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES:
+ raise ValueError('Unrecognized base type for extended attribute "FlexibleArrayBufferView": %s' % (idl_type.base_type))
base_idl_type = 'FlexibleArrayBufferView'
+ if 'AllowShared' in extended_attributes and not idl_type.is_array_buffer_view_or_typed_array:
+ raise ValueError('Unrecognized base type for extended attribute "AllowShared": %s' % (idl_type.base_type))
+
if idl_type.is_integer_type:
- configuration = 'NormalConversion'
+ configuration = 'kNormalConversion'
+ # TODO(lisabelle): Remove these 4 lines when we have fully supported
+ # annoteted types.
+ # It is because at that time 'Clamp' and 'EnforceRange' will only
+ # appear in type_extended_attributes, not in extended_attributes.
if 'EnforceRange' in extended_attributes:
- configuration = 'EnforceRange'
+ configuration = 'kEnforceRange'
elif 'Clamp' in extended_attributes:
- configuration = 'Clamp'
- arguments = ', '.join([v8_value, configuration, 'exceptionState'])
+ configuration = 'kClamp'
+ if 'EnforceRange' in type_extended_attributes:
+ configuration = 'kEnforceRange'
+ elif 'Clamp' in type_extended_attributes:
+ configuration = 'kClamp'
+ arguments = ', '.join([v8_value, 'exceptionState', configuration])
+ elif base_idl_type == 'SerializedScriptValue':
+ arguments = ', '.join([
+ v8_value,
+ 'SerializedScriptValue::SerializeOptions(SerializedScriptValue::kNotForStorage)',
+ '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_array_buffer_or_view:
+ elif idl_type.name == 'ArrayBuffer':
cpp_expression_format = (
'{v8_value}->Is{idl_type}() ? '
- 'V8{idl_type}::toImpl(v8::Local<v8::{idl_type}>::Cast({v8_value})) : 0')
+ 'V8{idl_type}::ToImpl(v8::Local<v8::{idl_type}>::Cast({v8_value})) : 0')
+ elif idl_type.is_array_buffer_view_or_typed_array:
+ this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes)
+ if 'AllowShared' in extended_attributes:
+ cpp_expression_format = ('ToMaybeShared<%s>({isolate}, {v8_value}, exceptionState)' % this_cpp_type)
+ else:
+ cpp_expression_format = ('ToNotShared<%s>({isolate}, {v8_value}, exceptionState)' % this_cpp_type)
+
elif idl_type.is_union_type:
- nullable = 'UnionTypeConversionMode::Nullable' if idl_type.includes_nullable_type else 'UnionTypeConversionMode::NotNullable'
- cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, {variable_name}, %s, exceptionState)' % nullable
+ nullable = 'UnionTypeConversionMode::kNullable' if idl_type.includes_nullable_type \
+ else 'UnionTypeConversionMode::kNotNullable'
+ cpp_expression_format = 'V8{idl_type}::ToImpl({isolate}, {v8_value}, {variable_name}, %s, exceptionState)' % nullable
elif idl_type.use_output_parameter_for_result:
- cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, {variable_name}, exceptionState)'
+ cpp_expression_format = 'V8{idl_type}::ToImpl({isolate}, {v8_value}, {variable_name}, exceptionState)'
+ elif idl_type.is_callback_function:
+ cpp_expression_format = (
+ 'V8{idl_type}::Create(ScriptState::Current({isolate}), {v8_value})')
+ elif idl_type.v8_conversion_needs_exception_state:
+ # Effectively, this if branch means everything with v8_conversion_needs_exception_state == True
+ # except for unions and dictionary interfaces.
+ base_idl_type = native_value_traits_type_name(idl_type)
+ cpp_expression_format = (
+ 'NativeValueTraits<{idl_type}>::NativeValue({isolate}, {arguments})')
else:
cpp_expression_format = (
- 'V8{idl_type}::toImplWithTypeCheck({isolate}, {v8_value})')
+ 'V8{idl_type}::ToImplWithTypeCheck({isolate}, {v8_value})')
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()'):
- # 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)
- expression_format = '(to{ref_ptr_type}NativeArray<{native_array_element_type}, V8{native_array_element_type}>({v8_value}, {index}, {isolate}, exceptionState))'
- else:
- ref_ptr_type = None
- this_cpp_type = native_array_element_type.cpp_type
- 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
-
-
# 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):
+def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, declare_variable=True,
+ isolate='info.GetIsolate()', bailout_return_value=None, use_exception_state=False):
"""Returns an expression that converts a V8 value to a C++ value and stores it as a local value."""
this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, raw_type=True)
idl_type = idl_type.preprocessed_type
- 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, variable_name, isolate)
# Optional expression that returns a value to be assigned to the local variable.
assign_expression = None
@@ -638,13 +694,14 @@
# 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:
+ if 'FlexibleArrayBufferView' in extended_attributes:
+ if idl_type.base_type not in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES:
+ raise ValueError('Unrecognized base type for extended attribute "FlexibleArrayBufferView": %s' % (idl_type.base_type))
+ set_expression = cpp_value
+ elif idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state:
# Types for which conversion can fail and that need error handling.
- if use_exception_state:
- check_expression = 'exceptionState.hadException()'
- else:
- check_expression = 'exceptionState.throwIfNeeded()'
+ check_expression = 'exceptionState.HadException()'
if idl_type.is_dictionary or idl_type.is_union_type:
set_expression = cpp_value
@@ -656,17 +713,13 @@
# 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
+ check_expression = '!%s.Prepare(exceptionState)' % variable_name
else:
- check_expression = '!%s.prepare()' % variable_name
- elif not idl_type.v8_conversion_is_trivial:
+ check_expression = '!%s.Prepare()' % variable_name
+ elif not idl_type.v8_conversion_is_trivial and not idl_type.is_callback_function:
return {
'error_message': 'no V8 -> C++ conversion for IDL type: %s' % idl_type.name
}
- elif 'FlexibleArrayBufferView' in extended_attributes:
- if idl_type.base_type not in TYPED_ARRAY_TYPES.union(set(['ArrayBufferView'])):
- raise "Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)
- set_expression = cpp_value
else:
assign_expression = cpp_value
@@ -701,13 +754,16 @@
################################################################################
def preprocess_idl_type(idl_type):
+ extended_attributes = idl_type.extended_attributes
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.base_type in ['any', 'object'] or idl_type.is_callback_function:
- return IdlType('ScriptValue')
+ return IdlType('DOMString', extended_attributes)
+ if idl_type.base_type in ['any', 'object'] or idl_type.is_custom_callback_function:
+ return IdlType('ScriptValue', extended_attributes)
+ if idl_type.is_callback_function:
+ return idl_type
return idl_type
IdlTypeBase.preprocessed_type = property(preprocess_idl_type)
@@ -732,8 +788,8 @@
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 = cpp_value.replace('GetUnsignedIntegralAttribute',
+ 'GetIntegralAttribute')
cpp_value = 'std::max(0, static_cast<int>(%s))' % cpp_value
return idl_type, cpp_value
@@ -742,7 +798,7 @@
"""Returns V8 conversion type, adding any additional includes.
The V8 conversion type is used to select the C++ -> V8 conversion function
- or v8SetReturnValue* function; it can be an idl_type, a cpp_type, or a
+ or V8SetReturnValue* 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 {}
@@ -758,15 +814,17 @@
# Array or sequence types
native_array_element_type = idl_type.native_array_element_type
if native_array_element_type:
- return 'array'
+ return 'FrozenArray' if idl_type.is_frozen_array else 'sequence'
+
+ # Record types.
+ if idl_type.is_record_type:
+ return 'Record'
# Simple types
base_idl_type = idl_type.base_type
# Basic types, without additional includes
- 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_INTEGER_CONVERSION_RULES:
+ return CPP_INTEGER_CONVERSION_RULES[base_idl_type]
if idl_type.is_string_type:
if idl_type.is_nullable:
return 'StringOrNull'
@@ -778,7 +836,7 @@
return 'Dictionary'
# Data type with potential additional includes
- if base_idl_type in V8_SET_RETURN_VALUE: # Special v8SetReturnValue treatment
+ if base_idl_type in V8_SET_RETURN_VALUE: # Special V8SetReturnValue treatment
return base_idl_type
# Pointer type
@@ -788,52 +846,82 @@
V8_SET_RETURN_VALUE = {
- 'boolean': 'v8SetReturnValueBool(info, {cpp_value})',
- 'int': 'v8SetReturnValueInt(info, {cpp_value})',
- 'unsigned': 'v8SetReturnValueUnsigned(info, {cpp_value})',
- 'DOMString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
- 'ByteString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
- 'USVString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
- 'StringOrNull': 'v8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())',
+ 'boolean': 'V8SetReturnValueBool(info, {cpp_value})',
+ 'DOMString': 'V8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
+ 'ByteString': 'V8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
+ 'USVString': 'V8SetReturnValueString(info, {cpp_value}, info.GetIsolate())',
+ 'StringOrNull': 'V8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())',
'void': '',
- # No special v8SetReturnValue* function (set value directly)
- 'float': 'v8SetReturnValue(info, {cpp_value})',
- 'unrestricted float': 'v8SetReturnValue(info, {cpp_value})',
- 'double': 'v8SetReturnValue(info, {cpp_value})',
- 'unrestricted double': 'v8SetReturnValue(info, {cpp_value})',
- # No special v8SetReturnValue* function, but instead convert value to V8
- # and then use general v8SetReturnValue.
- 'array': 'v8SetReturnValue(info, {cpp_value})',
- 'Date': 'v8SetReturnValue(info, {cpp_value})',
- 'EventHandler': 'v8SetReturnValue(info, {cpp_value})',
- 'ScriptValue': 'v8SetReturnValue(info, {cpp_value})',
- 'SerializedScriptValue': 'v8SetReturnValue(info, {cpp_value})',
+ # All the int types below are converted to (u)int32_t in the V8SetReturnValue{Int,Unsigned}() calls.
+ # The 64-bit int types have already been converted to double when V8_SET_RETURN_VALUE is used, so they are not
+ # listed here.
+ 'int8_t': 'V8SetReturnValueInt(info, {cpp_value})',
+ 'int16_t': 'V8SetReturnValueInt(info, {cpp_value})',
+ 'int32_t': 'V8SetReturnValueInt(info, {cpp_value})',
+ 'uint8_t': 'V8SetReturnValueUnsigned(info, {cpp_value})',
+ 'uint16_t': 'V8SetReturnValueUnsigned(info, {cpp_value})',
+ 'uint32_t': 'V8SetReturnValueUnsigned(info, {cpp_value})',
+ # No special V8SetReturnValue* function (set value directly)
+ 'float': 'V8SetReturnValue(info, {cpp_value})',
+ 'unrestricted float': 'V8SetReturnValue(info, {cpp_value})',
+ 'double': 'V8SetReturnValue(info, {cpp_value})',
+ 'unrestricted double': 'V8SetReturnValue(info, {cpp_value})',
+ # No special V8SetReturnValue* function, but instead convert value to V8
+ # and then use general V8SetReturnValue.
+ 'sequence': 'V8SetReturnValue(info, {cpp_value})',
+ 'FrozenArray': 'V8SetReturnValue(info, {cpp_value})',
+ 'Date': 'V8SetReturnValue(info, {cpp_value})',
+ 'EventHandler': 'V8SetReturnValue(info, {cpp_value})',
+ 'NodeFilter': 'V8SetReturnValue(info, {cpp_value})',
+ 'ScriptValue': 'V8SetReturnValue(info, {cpp_value})',
+ 'SerializedScriptValue': 'V8SetReturnValue(info, {cpp_value})',
+ # Records.
+ 'Record': 'V8SetReturnValue(info, ToV8({cpp_value}, info.Holder(), info.GetIsolate()))',
# DOMWrapper
- 'DOMWrapperForMainWorld': 'v8SetReturnValueForMainWorld(info, WTF::getPtr({cpp_value}))',
- 'DOMWrapperFast': 'v8SetReturnValueFast(info, WTF::getPtr({cpp_value}), {script_wrappable})',
- 'DOMWrapperDefault': 'v8SetReturnValue(info, {cpp_value})',
+ 'DOMWrapperForMainWorld': 'V8SetReturnValueForMainWorld(info, {cpp_value})',
+ 'DOMWrapperFast': 'V8SetReturnValueFast(info, {cpp_value}, {script_wrappable})',
+ 'DOMWrapperDefault': 'V8SetReturnValue(info, {cpp_value})',
+ # If [CheckSecurity=ReturnValue] is specified, the returned object must be
+ # wrapped in its own realm, which can be different from the realm of the
+ # receiver object.
+ #
+ # [CheckSecurity=ReturnValue] is used only for contentDocument and
+ # getSVGDocument attributes of HTML{IFrame,Frame,Object,Embed}Element,
+ # and Window.frameElement. Except for Window.frameElement, all interfaces
+ # support contentWindow(), so we create a new wrapper in the realm of
+ # contentWindow(). Note that DOMWindow* has its own realm and there is no
+ # need to pass |creationContext| in for ToV8(DOMWindow*).
+ # Window.frameElement is implemented with [Custom].
+ 'DOMWrapperAcrossContext': (
+ 'V8SetReturnValue(info, ToV8({cpp_value}, ' +
+ 'ToV8(impl->contentWindow(), v8::Local<v8::Object>(), ' +
+ 'info.GetIsolate()).As<v8::Object>(), info.GetIsolate()))'),
# 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())',
+ 'DOMWrapperStatic': 'V8SetReturnValue(info, {cpp_value}, info.GetIsolate()->GetCurrentContext()->Global())',
# Generic dictionary type
- 'Dictionary': 'v8SetReturnValue(info, {cpp_value})',
+ 'Dictionary': 'V8SetReturnValue(info, {cpp_value})',
'DictionaryStatic': '#error not implemented yet',
# Nullable dictionaries
- 'NullableDictionary': 'v8SetReturnValue(info, result.get())',
- 'NullableDictionaryStatic': '#error not implemented yet',
+ 'NullableDictionary': 'V8SetReturnValue(info, result.Get())',
+ 'NullableDictionaryStatic': 'V8SetReturnValue(info, result.Get(), info.GetIsolate()->GetCurrentContext()->Global())',
# Union types or dictionaries
- 'DictionaryOrUnion': 'v8SetReturnValue(info, result)',
- 'DictionaryOrUnionStatic': '#error not implemented yet',
+ 'DictionaryOrUnion': 'V8SetReturnValue(info, result)',
+ 'DictionaryOrUnionStatic': 'V8SetReturnValue(info, result, info.GetIsolate()->GetCurrentContext()->Global())',
}
-def v8_set_return_value(idl_type, cpp_value, extended_attributes=None, script_wrappable='', release=False, for_main_world=False, is_static=False):
+def v8_set_return_value(idl_type, cpp_value, extended_attributes=None, script_wrappable='', 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 ('CheckSecurity' in extended_attributes and
+ extended_attribute_value_contains(
+ extended_attributes['CheckSecurity'], 'ReturnValue')):
+ return 'DOMWrapperAcrossContext'
if is_static:
return 'DOMWrapperStatic'
if not script_wrappable:
@@ -845,8 +933,9 @@
idl_type, cpp_value = preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes)
this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes)
# SetReturn-specific overrides
- if this_v8_conversion_type in ['Date', 'EventHandler', 'ScriptValue', 'SerializedScriptValue', 'array']:
- # Convert value to V8 and then use general v8SetReturnValue
+ if this_v8_conversion_type in ('Date', 'EventHandler', 'NodeFilter', 'ScriptValue',
+ 'SerializedScriptValue', 'sequence', 'FrozenArray'):
+ # Convert value to V8 and then use general V8SetReturnValue
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()
@@ -854,42 +943,50 @@
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.
- if release:
- cpp_value = '%s.release()' % cpp_value
statement = format_string.format(cpp_value=cpp_value, script_wrappable=script_wrappable)
return statement
IdlTypeBase.v8_set_return_value = v8_set_return_value
-IdlType.release = property(lambda self: self.is_interface_type)
-IdlUnionType.release = False
-
CPP_VALUE_TO_V8_VALUE = {
# Built-in types
- 'Date': 'v8DateOrNaN({isolate}, {cpp_value})',
- 'DOMString': 'v8String({isolate}, {cpp_value})',
- 'ByteString': '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})',
+ 'Date': 'V8DateOrNaN({isolate}, {cpp_value})',
+ 'DOMString': 'V8String({isolate}, {cpp_value})',
+ 'ByteString': 'V8String({isolate}, {cpp_value})',
+ 'USVString': 'V8String({isolate}, {cpp_value})',
+ 'boolean': 'v8::Boolean::New({isolate}, {cpp_value})',
+ # All the int types below are converted to (u)int32_t in the v8::Integer::New*() calls.
+ # The 64-bit int types have already been converted to double when CPP_VALUE_TO_V8_VALUE is used, so they are not
+ # listed here.
+ 'int8_t': 'v8::Integer::New({isolate}, {cpp_value})',
+ 'int16_t': 'v8::Integer::New({isolate}, {cpp_value})',
+ 'int32_t': 'v8::Integer::New({isolate}, {cpp_value})',
+ 'uint8_t': 'v8::Integer::NewFromUnsigned({isolate}, {cpp_value})',
+ 'uint16_t': 'v8::Integer::NewFromUnsigned({isolate}, {cpp_value})',
+ 'uint32_t': 'v8::Integer::NewFromUnsigned({isolate}, {cpp_value})',
'float': 'v8::Number::New({isolate}, {cpp_value})',
'unrestricted float': 'v8::Number::New({isolate}, {cpp_value})',
'double': 'v8::Number::New({isolate}, {cpp_value})',
'unrestricted double': 'v8::Number::New({isolate}, {cpp_value})',
'void': 'v8Undefined()',
- 'StringOrNull': '{cpp_value}.isNull() ? v8::Local<v8::Value>(v8::Null({isolate})) : v8String({isolate}, {cpp_value})',
+ 'StringOrNull': '{cpp_value}.IsNull() ? v8::Local<v8::Value>(v8::Null({isolate})) : V8String({isolate}, {cpp_value})',
# Special cases
- '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::Local<v8::Value>(v8::Null({isolate}))',
+ 'Dictionary': '{cpp_value}.V8Value()',
+ 'EventHandler': (
+ '{cpp_value} ? ' +
+ 'V8AbstractEventListener::Cast({cpp_value})->GetListenerOrNull(' +
+ '{isolate}, impl->GetExecutionContext()) : ' +
+ 'v8::Null({isolate}).As<v8::Value>()'),
+ 'NodeFilter': 'ToV8({cpp_value}, {creation_context}, {isolate})',
+ 'Record': 'ToV8({cpp_value}, {creation_context}, {isolate})',
+ 'ScriptValue': '{cpp_value}.V8Value()',
+ 'SerializedScriptValue': 'V8Deserialize({isolate}, {cpp_value})',
# General
- 'array': 'toV8({cpp_value}, {creation_context}, {isolate})',
- 'DOMWrapper': 'toV8({cpp_value}, {creation_context}, {isolate})',
+ 'sequence': 'ToV8({cpp_value}, {creation_context}, {isolate})',
+ 'FrozenArray': 'FreezeV8Object(ToV8({cpp_value}, {creation_context}, {isolate}), {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
@@ -900,7 +997,7 @@
# nullable dictionary type.
#
# Union types or dictionaries
- 'DictionaryOrUnion': 'toV8({cpp_value}, {creation_context}, {isolate})',
+ 'DictionaryOrUnion': 'ToV8({cpp_value}, {creation_context}, {isolate})',
}
@@ -922,7 +1019,7 @@
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:
+ if idl_type.base_type in ('octet', 'unsigned short', 'unsigned long'):
return literal_value + 'u'
return literal_value
@@ -939,12 +1036,12 @@
else:
raise ValueError('Unsupported literal type: ' + idl_literal.idl_type)
- return '%s::from%s(%s)' % (idl_type.name, member_type.name,
+ 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.
+ # Only support empty sequences.
if idl_literal.value == '[]':
return cpp_type(idl_type) + '()'
raise ValueError('Unsupported literal type: ' + idl_literal.idl_type)
@@ -962,16 +1059,20 @@
def cpp_type_has_null_value(idl_type):
# - String types (String/AtomicString) represent null as a null string,
- # i.e. one for which String::isNull() returns true.
+ # i.e. one for which String::IsNull() returns true.
# - Enum types, as they are implemented as Strings.
- # - Interface types (raw pointer or RefPtr/PassRefPtr) represent null as
+ # - Interface types (raw pointer or RefPtr) represent null as
# a null pointer.
# - 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)
+ return (idl_type.is_string_type
+ or idl_type.is_enum
+ or idl_type.is_interface_type
+ or idl_type.is_callback_interface
+ or idl_type.is_callback_function
+ or idl_type.is_custom_callback_function
+ or idl_type.is_union_type
+ or idl_type.base_type == 'object' or idl_type.base_type == 'any')
IdlTypeBase.cpp_type_has_null_value = property(cpp_type_has_null_value)
@@ -991,21 +1092,6 @@
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
diff --git a/bindings/scripts/v8_union.py b/bindings/scripts/v8_union.py
index fa22cdb..7778c88 100644
--- a/bindings/scripts/v8_union.py
+++ b/bindings/scripts/v8_union.py
@@ -2,63 +2,35 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from utilities import to_snake_case
+import v8_types
import v8_utilities
+UNION_CPP_INCLUDES = frozenset([
+ 'bindings/core/v8/ToV8ForCore.h',
+])
+
UNION_H_INCLUDES = frozenset([
'bindings/core/v8/Dictionary.h',
'bindings/core/v8/ExceptionState.h',
- 'bindings/core/v8/V8Binding.h',
+ 'bindings/core/v8/NativeValueTraits.h',
+ 'bindings/core/v8/V8BindingForCore.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()
header_includes = set()
-def union_context(union_types, interfaces_info):
+def container_context(union_type, info_provider):
cpp_includes.clear()
header_forward_decls.clear()
header_includes.clear()
+ cpp_includes.update(UNION_CPP_INCLUDES)
header_includes.update(UNION_H_INCLUDES)
-
- # 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()
- 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)
-
- union_types_for_containers = sorted(union_types_for_containers,
- key=lambda union_type: union_type.cpp_type)
-
- 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(header_includes),
- }
-
-
-def container_context(union_type, interfaces_info):
members = []
# These variables refer to member contexts if the given union type has
@@ -71,9 +43,10 @@
interface_types = []
numeric_type = None
object_type = None
+ record_type = None
string_type = None
- for member in union_type.member_types:
- context = member_context(member, interfaces_info)
+ for member in sorted(union_type.flattened_member_types, key=lambda m: m.name):
+ context = member_context(member, info_provider)
members.append(context)
if member.base_type == 'ArrayBuffer':
if array_buffer_type:
@@ -93,9 +66,13 @@
array_or_sequence_type = context
# "Dictionary" is an object, rather than an IDL dictionary.
elif member.base_type == 'Dictionary':
- if object_type:
+ if object_type or record_type:
raise Exception('%s is ambiguous.' % union_type.name)
object_type = context
+ elif member.is_record_type:
+ if object_type or record_type:
+ raise Exception('%s is ambiguous.' % union_type.name)
+ record_type = context
elif member.is_interface_type:
interface_types.append(context)
elif member is union_type.boolean_member_type:
@@ -114,63 +91,73 @@
if dictionary_type and nullable_members == 1:
raise Exception('%s has a dictionary and a nullable member' % union_type.name)
+ cpp_class = union_type.cpp_type
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,
+ 'cpp_class': cpp_class,
+ 'cpp_includes': sorted(cpp_includes),
'dictionary_type': dictionary_type,
+ 'header_includes': sorted(header_includes),
+ 'header_forward_decls': sorted(header_forward_decls),
'includes_nullable_type': union_type.includes_nullable_type,
'interface_types': interface_types,
'members': members,
'numeric_type': numeric_type,
'object_type': object_type,
+ 'record_type': record_type,
'string_type': string_type,
'type_string': str(union_type),
+ 'v8_class': v8_types.v8_type(cpp_class),
}
-def _update_includes_and_forward_decls(member, interface_info):
+def _update_includes_and_forward_decls(member, info_provider):
+ interface_info = info_provider.interfaces_info.get(member.name, None)
if interface_info:
cpp_includes.update(interface_info.get(
'dependencies_include_paths', []))
- # TODO(bashi): Workaround for http://crbug.com/524424
- # Avoid using forward declaration for IDL dictionaries so that they
- # aren't imcomplete types in UnionTypes.h. This enables an IDL
- # dictionary to have a union type which has an IDL dictionary. e.g.
- # dictionary DictA { (boolean or DictB) member; }
- # Note that this doesn't cover all cases. We still can't use an IDL
- # dictionary in a union type when the dictionary contains a union type.
- # e.g.
- # void foo((DOMString or DictA) arg); // won't compile
- if member.is_dictionary:
+ # We need complete types for IDL dictionaries in union containers.
+ if member.is_dictionary or member.is_array_buffer_view_or_typed_array:
header_includes.update(member.includes_for_type())
else:
cpp_includes.update(member.includes_for_type())
header_forward_decls.add(member.implemented_as)
else:
+ if member.is_record_type:
+ _update_includes_and_forward_decls(member.key_type, info_provider)
+ _update_includes_and_forward_decls(member.value_type, info_provider)
+ elif member.is_array_or_sequence_type:
+ _update_includes_and_forward_decls(member.element_type, info_provider)
+ elif member.is_union_type:
+ # Reaching this block means we have a union that is inside a
+ # record or sequence.
+ header_forward_decls.add(member.name)
+ cpp_includes.update([info_provider.include_path_for_union_types(member)])
cpp_includes.update(member.includes_for_type())
-def member_context(member, interfaces_info):
- interface_info = interfaces_info.get(member.name, None)
- _update_includes_and_forward_decls(member, interface_info)
+def member_context(member, info_provider):
+ _update_includes_and_forward_decls(member, info_provider)
if member.is_nullable:
member = member.inner_type
return {
- 'cpp_name': v8_utilities.uncapitalize(member.name),
+ 'cpp_name': to_snake_case(v8_utilities.cpp_name(member)),
'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',
+ cpp_value='impl.GetAs%s()' % member.name, isolate='isolate',
creation_context='creationContext'),
'enum_values': member.enum_values,
+ 'is_array_buffer_or_view_type': member.is_array_buffer_or_view,
+ 'is_array_buffer_view_or_typed_array': member.is_array_buffer_view_or_typed_array,
'is_traceable': member.is_traceable,
'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True),
- 'specific_type_enum': 'SpecificType' + member.name,
+ 'specific_type_enum': 'k' + 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),
+ use_exception_state=True)
}
diff --git a/bindings/scripts/v8_utilities.py b/bindings/scripts/v8_utilities.py
index 1e8733a..08c4fe8 100644
--- a/bindings/scripts/v8_utilities.py
+++ b/bindings/scripts/v8_utilities.py
@@ -31,11 +31,14 @@
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
+import os
import re
+import sys
from idl_types import IdlTypeBase
import idl_types
from idl_definitions import Exposure, IdlInterface, IdlAttribute
+from utilities import to_snake_case
from v8_globals import includes
ACRONYMS = [
@@ -44,6 +47,7 @@
'HTML',
'IME',
'JS',
+ 'SMIL',
'SVG',
'URL',
'WOFF',
@@ -112,13 +116,16 @@
return name[0].lower() + name[1:]
+def runtime_enabled_function(name):
+ """Returns a function call of a runtime enabled feature."""
+ return 'RuntimeEnabledFeatures::%sEnabled()' % name
+
+
################################################################################
# C++
################################################################################
def scoped_name(interface, definition, base_name):
- if 'ImplementedInPrivateScript' in definition.extended_attributes:
- return '%s::PrivateScript::%s' % (v8_class_name(interface), base_name)
# partial interfaces are implemented as separate classes, with their members
# implemented as static member functions
partial_interface_implemented_as = definition.extended_attributes.get('PartialInterfaceImplementedAs')
@@ -141,6 +148,26 @@
return class_name
+def build_basename(name, snake_case, prefix=None, ext=None):
+ basename = name
+ if prefix:
+ basename = prefix + name
+ if snake_case:
+ basename = to_snake_case(basename)
+ if not ext:
+ return basename
+ if ext == '.cpp':
+ return basename + '.cc'
+ return basename + ext
+ if ext:
+ return basename + ext
+ return basename
+
+
+def binding_header_basename(name, snake_case):
+ return build_basename(name, snake_case, prefix='V8', ext='.h')
+
+
################################################################################
# Specific extended attributes
################################################################################
@@ -158,7 +185,7 @@
if log_activity and not log_activity.startswith(access_type):
return set()
- includes.add('bindings/core/v8/V8DOMActivityLogger.h')
+ includes.add('platform/bindings/V8DOMActivityLogger.h')
if 'LogAllWorlds' in extended_attributes:
return set(['', 'ForMainWorld'])
return set(['']) # At minimum, include isolated worlds.
@@ -185,19 +212,19 @@
CALL_WITH_ARGUMENTS = {
'ScriptState': 'scriptState',
'ExecutionContext': 'executionContext',
- 'ScriptArguments': 'scriptArguments.release()',
- 'ActiveWindow': 'currentDOMWindow(info.GetIsolate())',
- 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())',
+ 'ScriptArguments': 'scriptArguments',
+ 'CurrentWindow': 'CurrentDOMWindow(info.GetIsolate())',
+ 'EnteredWindow': 'EnteredDOMWindow(info.GetIsolate())',
'Document': 'document',
- 'ThisValue': 'ScriptValue(scriptState, info.This())',
+ 'ThisValue': 'ScriptValue(scriptState, info.Holder())',
}
# List because key order matters, as we want arguments in deterministic order
CALL_WITH_VALUES = [
'ScriptState',
'ExecutionContext',
'ScriptArguments',
- 'ActiveWindow',
- 'FirstWindow',
+ 'CurrentWindow',
+ 'EnteredWindow',
'Document',
'ThisValue',
]
@@ -229,18 +256,19 @@
# [Exposed]
EXPOSED_EXECUTION_CONTEXT_METHOD = {
- 'CompositorWorker': 'isCompositorWorkerGlobalScope',
- 'DedicatedWorker': 'isDedicatedWorkerGlobalScope',
- 'ServiceWorker': 'isServiceWorkerGlobalScope',
- 'SharedWorker': 'isSharedWorkerGlobalScope',
- 'Window': 'isDocument',
- 'Worker': 'isWorkerGlobalScope',
- 'Worklet': 'isWorkletGlobalScope',
+ 'AnimationWorklet': 'IsAnimationWorkletGlobalScope',
+ 'AudioWorklet': 'IsAudioWorkletGlobalScope',
+ 'DedicatedWorker': 'IsDedicatedWorkerGlobalScope',
+ 'PaintWorklet': 'IsPaintWorkletGlobalScope',
+ 'ServiceWorker': 'IsServiceWorkerGlobalScope',
+ 'SharedWorker': 'IsSharedWorkerGlobalScope',
+ 'Window': 'IsDocument',
+ 'Worker': 'IsWorkerGlobalScope',
+ 'Worklet': 'IsWorkletGlobalScope',
}
EXPOSED_WORKERS = set([
- 'CompositorWorker',
'DedicatedWorker',
'SharedWorker',
'ServiceWorker',
@@ -282,8 +310,7 @@
exposed = ('executionContext->%s()' %
EXPOSED_EXECUTION_CONTEXT_METHOD[exposure.exposed])
if exposure.runtime_enabled is not None:
- runtime_enabled = ('RuntimeEnabledFeatures::%sEnabled()' %
- uncapitalize(exposure.runtime_enabled))
+ runtime_enabled = (runtime_enabled_function(exposure.runtime_enabled))
return '({0} && {1})'.format(exposed, runtime_enabled)
return exposed
@@ -305,8 +332,8 @@
=> context->isDocument()
EXAMPLE: [Exposed(Window Feature1, Window Feature2)]
- => context->isDocument() && RuntimeEnabledFeatures::feature1Enabled() ||
- context->isDocument() && RuntimeEnabledFeatures::feature2Enabled()
+ => context->isDocument() && RuntimeEnabledFeatures::Feature1Enabled() ||
+ context->isDocument() && RuntimeEnabledFeatures::Feature2Enabled()
"""
exposure_set = ExposureSet(
extended_attribute_value_as_list(member, 'Exposed'))
@@ -323,22 +350,21 @@
return exposure_set.code()
-# [GarbageCollected], [WillBeGarbageCollected]
-def gc_type(definition):
- extended_attributes = definition.extended_attributes
- if 'GarbageCollected' in extended_attributes:
- return 'GarbageCollectedObject'
- elif 'WillBeGarbageCollected' in extended_attributes:
- return 'WillBeGarbageCollectedObject'
- return 'RefCountedObject'
+# [SecureContext]
+def secure_context(member, interface):
+ """Returns C++ code that checks whether an interface/method/attribute/etc. is exposed
+ to the current context."""
+ if 'SecureContext' in member.extended_attributes or 'SecureContext' in interface.extended_attributes:
+ return 'executionContext->IsSecureContext()'
+ return None
# [ImplementedAs]
def cpp_name(definition_or_member):
extended_attributes = definition_or_member.extended_attributes
- if 'ImplementedAs' not in extended_attributes:
- return definition_or_member.name
- return extended_attributes['ImplementedAs']
+ if extended_attributes and 'ImplementedAs' in extended_attributes:
+ return extended_attributes['ImplementedAs']
+ return definition_or_member.name
def cpp_name_from_interfaces_info(name, interfaces_info):
@@ -367,48 +393,83 @@
return None
-def runtime_feature_name(definition_or_member):
+# [OriginTrialEnabled]
+def origin_trial_enabled_function_name(definition_or_member):
+ """Returns the name of the OriginTrials enabled function.
+
+ An exception is raised if OriginTrialEnabled is used in conjunction with any
+ of the following (which must be mutually exclusive with origin trials):
+ - RuntimeEnabled
+
+ The returned function checks if the IDL member should be enabled.
+ Given extended attribute OriginTrialEnabled=FeatureName, return:
+ OriginTrials::{featureName}Enabled
+
+ If the OriginTrialEnabled extended attribute is found, the includes are
+ also updated as a side-effect.
+ """
extended_attributes = definition_or_member.extended_attributes
- if 'RuntimeEnabled' not in extended_attributes:
- return None
- return extended_attributes['RuntimeEnabled']
+ is_origin_trial_enabled = 'OriginTrialEnabled' in extended_attributes
+
+ if is_origin_trial_enabled and 'RuntimeEnabled' in extended_attributes:
+ raise Exception('[OriginTrialEnabled] and [RuntimeEnabled] must '
+ 'not be specified on the same definition: %s'
+ % definition_or_member.name)
+
+ if is_origin_trial_enabled:
+ trial_name = extended_attributes['OriginTrialEnabled']
+ return 'OriginTrials::%sEnabled' % uncapitalize(trial_name)
+
+ is_feature_policy_enabled = 'FeaturePolicy' in extended_attributes
+
+ if is_feature_policy_enabled and 'RuntimeEnabled' in extended_attributes:
+ raise Exception('[FeaturePolicy] and [RuntimeEnabled] must '
+ 'not be specified on the same definition: %s'
+ % definition_or_member.name)
+
+ if is_feature_policy_enabled and 'SecureContext' in extended_attributes:
+ raise Exception('[FeaturePolicy] and [SecureContext] must '
+ 'not be specified on the same definition '
+ '(see https://crbug.com/695123 for workaround): %s'
+ % definition_or_member.name)
+
+ if is_feature_policy_enabled:
+ includes.add('platform/bindings/ScriptState.h')
+ includes.add('platform/feature_policy/FeaturePolicy.h')
+
+ trial_name = extended_attributes['FeaturePolicy']
+ return 'FeaturePolicy::%sEnabled' % uncapitalize(trial_name)
+
+ return None
-def is_origin_trial_enabled(definition_or_member):
- return 'OriginTrialEnabled' in definition_or_member.extended_attributes
+def origin_trial_feature_name(definition_or_member):
+ extended_attributes = definition_or_member.extended_attributes
+ return extended_attributes.get('OriginTrialEnabled') or extended_attributes.get('FeaturePolicy')
-def origin_trial_name(definition_or_member):
- return definition_or_member.extended_attributes['OriginTrialEnabled'] if is_origin_trial_enabled(definition_or_member) else None
+# [ContextEnabled]
+def context_enabled_feature_name(definition_or_member):
+ return definition_or_member.extended_attributes.get('ContextEnabled')
-def origin_trial_enabled_function(definition_or_member):
- trial_name = origin_trial_name(definition_or_member)
- feature_name = runtime_feature_name(definition_or_member)
- if not feature_name or not trial_name:
- return
- return 'OriginTrials::%sEnabled' % uncapitalize(feature_name)
+# [RuntimeCallStatsCounter]
+def rcs_counter_name(member, generic_counter_name):
+ extended_attribute_defined = 'RuntimeCallStatsCounter' in member.extended_attributes
+ if extended_attribute_defined:
+ counter = 'k' + member.extended_attributes['RuntimeCallStatsCounter']
+ else:
+ counter = generic_counter_name
+ return (counter, extended_attribute_defined)
# [RuntimeEnabled]
-def runtime_enabled_function_name(definition_or_member):
- """Returns the name of the RuntimeEnabledFeatures function.
-
- The returned function checks if a method/attribute is enabled.
- Given extended attribute RuntimeEnabled=FeatureName, return:
- RuntimeEnabledFeatures::{featureName}Enabled
- """
- feature_name = runtime_feature_name(definition_or_member)
-
- # If an origin trial is on the method/attribute, it overrides the runtime
- # enabled status. For now, we are unconditionally installing these
- # attributes/methods, so we are acting as though the runtime enabled
- # function doesn't exist. (It is checked in the generated OriginTrials
- # function, instead)
- trial_name = origin_trial_name(definition_or_member)
- if not feature_name or trial_name:
- return
- return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
+def runtime_enabled_feature_name(definition_or_member):
+ extended_attributes = definition_or_member.extended_attributes
+ if 'RuntimeEnabled' not in extended_attributes:
+ return None
+ includes.add('platform/runtime_enabled_features.h')
+ return extended_attributes['RuntimeEnabled']
# [Unforgeable]
@@ -429,16 +490,16 @@
"""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.
+ The following members must be defined on an instance object.
- [Unforgeable] members
- regular members of [Global] or [PrimaryGlobal] interfaces
"""
if member.is_static:
return False
- # TODO(yukishiino): Remove a hack for toString once we support
- # Symbol.toStringTag.
- if (interface.name == 'Window' and member.name == 'toString'):
+ # TODO(yukishiino): Remove a hack for ToString once we support
+ # Symbol.ToStringTag.
+ if interface.name == 'Window' and member.name == 'ToString':
return False
# TODO(yukishiino): Implement "interface object" and its [[Call]] method
@@ -500,6 +561,27 @@
################################################################################
+# Legacy callers
+# https://heycam.github.io/webidl/#idl-legacy-callers
+################################################################################
+
+def legacy_caller(interface):
+ try:
+ # Find legacy caller, if present; has form:
+ # legacycaller TYPE [OPTIONAL_IDENTIFIER](OPTIONAL_ARGUMENTS)
+ caller = next(
+ method
+ for method in interface.operations
+ if 'legacycaller' in method.specials)
+ if not caller.name:
+ raise Exception('legacycaller with no identifier is not supported: '
+ '%s' % interface.name)
+ return caller
+ except StopIteration:
+ return None
+
+
+################################################################################
# Indexed properties
# http://heycam.github.io/webidl/#idl-indexed-properties
################################################################################
@@ -561,7 +643,7 @@
if ('getter' in method.specials and
len(method.arguments) == 1 and
str(method.arguments[0].idl_type) == 'DOMString'))
- getter.name = getter.name or 'anonymousNamedGetter'
+ getter.name = getter.name or 'AnonymousNamedGetter'
return getter
except StopIteration:
return None
@@ -595,6 +677,7 @@
return None
+IdlInterface.legacy_caller = property(legacy_caller)
IdlInterface.indexed_property_getter = property(indexed_property_getter)
IdlInterface.indexed_property_setter = property(indexed_property_setter)
IdlInterface.indexed_property_deleter = property(indexed_property_deleter)
diff --git a/bindings/tests/idls/core/ArrayBuffer.idl b/bindings/tests/idls/core/ArrayBuffer.idl
index 7878c57..c0203e1 100644
--- a/bindings/tests/idls/core/ArrayBuffer.idl
+++ b/bindings/tests/idls/core/ArrayBuffer.idl
@@ -5,7 +5,7 @@
// https://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFER
[
- ImplementedAs=TestArrayBuffer,
+ 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
index e6e9262..3ea88e3 100644
--- a/bindings/tests/idls/core/ArrayBufferView.idl
+++ b/bindings/tests/idls/core/ArrayBufferView.idl
@@ -5,7 +5,7 @@
// https://www.khronos.org/registry/typedarray/specs/latest/#ARRAYBUFFERVIEW
[
- ImplementedAs=TestArrayBufferView,
+ ImplementedAs=TestArrayBufferView
] interface ArrayBufferView {
readonly attribute ArrayBuffer buffer;
readonly attribute unsigned long byteOffset;
diff --git a/bindings/tests/idls/core/DataView.idl b/bindings/tests/idls/core/DataView.idl
index e26468d..d21b90b 100644
--- a/bindings/tests/idls/core/DataView.idl
+++ b/bindings/tests/idls/core/DataView.idl
@@ -5,7 +5,7 @@
// https://www.khronos.org/registry/typedarray/specs/latest/#DATAVIEW
[
- ImplementedAs=TestDataView,
+ ImplementedAs=TestDataView
] interface DataView : ArrayBufferView {
[RaisesException] octet getUint8(unsigned long byteOffset);
[RaisesException] double getFloat64(unsigned long byteOffset, optional boolean littleEndian);
diff --git a/bindings/tests/idls/core/SVGTestInterface.idl b/bindings/tests/idls/core/SVGTestInterface.idl
index 81e8997..43fb132 100644
--- a/bindings/tests/idls/core/SVGTestInterface.idl
+++ b/bindings/tests/idls/core/SVGTestInterface.idl
@@ -28,11 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
// This test files starts with 'SVG' because /^SVG/ is used as a check
// for SVG interfaces (to use SVGNames for [Reflect] attributes)
[
- DependentLifetime,
+ DependentLifetime
] interface SVGTestInterface {
[Reflect] attribute DOMString type; // Test SVGNames namespace
};
diff --git a/bindings/tests/idls/core/TestAttributeGetters.idl b/bindings/tests/idls/core/TestAttributeGetters.idl
new file mode 100644
index 0000000..0bb8eb4
--- /dev/null
+++ b/bindings/tests/idls/core/TestAttributeGetters.idl
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium 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://heycam.github.io/webidl/#dfn-attribute-getter
+
+// Attribute getters must behave differently based on whether [LenientThis] has
+// been specified or whether the attribute's type is Promise<T>.
+// All attributes below are marked readonly because we are only interested in
+// the behavior of attribute getters.
+
+interface TestAttributeGetters {
+ // [LenientThis] causes some V8 type checks to be bypassed; they are done
+ // on the Blink side instead and access exceptions just return undefined.
+ [LenientThis] readonly attribute long lenientThisLongAttribute;
+
+ // Promise types must turn exceptions into promise rejections.
+ readonly attribute Promise<DOMString> stringPromiseAttribute;
+
+ // Mixing both should cause [LenientThis] to return without raising an
+ // exception if type checking fails.
+ [LenientThis] readonly attribute Promise<DOMString> lenientThisStringPromiseAttribute;
+
+ // [RaisesException] also creates an ExceptionState instance. Make sure it
+ // is not declared twice.
+ [RaisesException] readonly attribute Promise<short> raisesExceptionShortPromiseAttribute;
+
+ // Regular attribute with no special rules.
+ readonly attribute float floatAttribute;
+};
diff --git a/bindings/tests/idls/core/TestCallbackFunctions.idl b/bindings/tests/idls/core/TestCallbackFunctions.idl
new file mode 100644
index 0000000..10edce1
--- /dev/null
+++ b/bindings/tests/idls/core/TestCallbackFunctions.idl
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+callback VoidCallbackFunction = void ();
+callback AnyCallbackFunctionOptionalAnyArg = any (optional any optionalAnyArg);
+callback LongCallbackFunction = long (long num1, long num2);
+
+// Following callback functions are to be generated as expected.
+callback VoidCallbackFunctionInterfaceArg = void (HTMLDivElement divElement);
+callback VoidCallbackFunctionDictionaryArg = void (TestDictionary arg);
+callback VoidCallbackFunctionTestInterfaceSequenceArg = void (sequence<TestInterface> arg);
+callback StringSequenceCallbackFunctionLongSequenceArg = sequence<DOMString> (sequence<long> arg);
+callback VoidCallbackFunctionEnumArg = void (TestEnum arg);
+callback VoidCallbackFunctionTypedef = void (String arg);
+
+interface TestCallbackFunctions {
+ // Extended attributes
+ [CustomElementCallbacks] readonly attribute long customElementsCallbacksReadonlyAttribute;
+
+ // Methods
+ VoidCallbackFunction returnCallbackFunctionMethod();
+ AnyCallbackFunctionOptionalAnyArg returnCallbackFunctionMethod2();
+
+ void voidMethodCallbackFunctionInArg(VoidCallbackFunction voidCallbackFunctionArg);
+ void voidMethodCallbackFunctionInArg2(AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgArg);
+ void voidMethodCallbackFunctionWithReturnValueInArg(LongCallbackFunction longCallbackFunctionArg);
+
+ void voidMethodOptionalCallbackFunctionInArg(optional VoidCallbackFunction voidCallbackFunctionArg);
+ void voidMethodNullableCallbackFunctionInArg(VoidCallbackFunction? voidCallbackFunctionArg);
+ // Extended attributes
+ [CustomElementCallbacks] void customElementCallbacksMethod();
+};
diff --git a/bindings/tests/idls/core/TestCallbackInterface.idl b/bindings/tests/idls/core/TestCallbackInterface.idl
index cebfa19..283ffb2 100644
--- a/bindings/tests/idls/core/TestCallbackInterface.idl
+++ b/bindings/tests/idls/core/TestCallbackInterface.idl
@@ -36,7 +36,4 @@
void voidMethodTestInterfaceEmptyStringArg(TestInterfaceEmpty testInterfaceEmptyArg, DOMString stringArg);
[CallWith=ThisValue] void callbackWithThisValueVoidMethodStringArg(DOMString stringArg);
[Custom] void customVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
- // [WillBeGarbageCollected]
- void voidMethodWillBeGarbageCollectedSequenceArg(sequence<TestInterfaceWillBeGarbageCollected> sequenceArg);
- void voidMethodWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] arrayArg);
};
diff --git a/bindings/tests/idls/core/TestConstants.idl b/bindings/tests/idls/core/TestConstants.idl
new file mode 100644
index 0000000..8c604a6
--- /dev/null
+++ b/bindings/tests/idls/core/TestConstants.idl
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+interface TestConstants {
+ const unsigned short CONST_VALUE_ZERO = 0;
+ const unsigned short CONST_VALUE_ONE = 1;
+ const unsigned short CONST_VALUE_TWO = 2;
+ const short CONST_VALUE_NEGATIVE = -1;
+ const unsigned short CONST_VALUE_32_BITS = 0xffffffff;
+ const unsigned short CONST_VALUE_HEX = 0x01;
+ const unsigned short CONST_VALUE_HEX2 = 0X20;
+ const unsigned short CONST_VALUE_HEX3 = 0x1abc;
+ const unsigned short CONST_VALUE_OCT = 010;
+ const unsigned short CONST_VALUE_NEGATIVE_OCT = -010;
+ const unsigned short CONST_VALUE_NEGATIVE_HEX = -0x1A;
+ const unsigned short CONST_VALUE_NEGATIVE_HEX2 = -0X1a; // lower case
+ const double CONST_VALUE_DECIMAL = 0.123;
+ const double CONST_VALUE_DECIMAL2 = 4e9;
+ const double CONST_VALUE_DECIMAL3 = 3.4e5;
+ const double CONST_VALUE_DECIMAL4 = .123;
+ const double CONST_VALUE_DECIMAL5 = 5E+4;
+ const double CONST_VALUE_NEGATIVE_DECIMAL = -1.3;
+ const double CONST_VALUE_NEGATIVE_DECIMAL2 = -4e-9;
+ const float CONST_VALUE_FLOAT = 1;
+
+ // Extended attributes
+ [DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1;
+ [MeasureAs=Constant] const short MEASURED_CONSTANT = 1;
+ [RuntimeEnabled=FeatureName1] const short FEATURE1_ENABLED_CONST1 = 1;
+ [RuntimeEnabled=FeatureName1] const short FEATURE1_ENABLED_CONST2 = 2;
+ [RuntimeEnabled=FeatureName2] const short FEATURE2_ENABLED_CONST1 = 3;
+ [RuntimeEnabled=FeatureName2] const short FEATURE2_ENABLED_CONST2 = 4;
+ [OriginTrialEnabled=FeatureName1] const short FEATURE1_ORIGIN_TRIAL_ENABLED_CONST1 = 6;
+ [OriginTrialEnabled=FeatureName1] const short FEATURE1_ORIGIN_TRIAL_ENABLED_CONST2 = 7;
+ [OriginTrialEnabled=FeatureName2] const short FEATURE2_ORIGIN_TRIAL_ENABLED_CONST1 = 8;
+ [OriginTrialEnabled=FeatureName2] const short FEATURE2_ORIGIN_TRIAL_ENABLED_CONST2 = 9;
+ [Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1;
+};
diff --git a/bindings/tests/idls/core/TestDictionary.idl b/bindings/tests/idls/core/TestDictionary.idl
index 0ac0a68..136eb3d 100644
--- a/bindings/tests/idls/core/TestDictionary.idl
+++ b/bindings/tests/idls/core/TestDictionary.idl
@@ -14,13 +14,11 @@
TestInterface? testInterfaceOrNullMember;
TestInterfaceGarbageCollected testInterfaceGarbageCollectedMember;
TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullMember;
- TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedMember;
- TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullMember;
- DOMString[] stringArrayMember;
sequence<DOMString> stringSequenceMember = [];
+ sequence<[TreatNullAs=EmptyString] DOMString> treatNullAsStringSequenceMember = [];
sequence<TestInterface> testInterfaceSequenceMember = [];
+ sequence<TestObject> testObjectSequenceMember;
sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceMember = [];
- sequence<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeGarbageCollectedSequenceMember = [];
TestEnum enumMember = "foo";
sequence<TestEnum> enumSequenceMember;
Element? elementOrNullMember;
@@ -28,6 +26,8 @@
object? objectOrNullMember;
[ImplementedAs=createMember] boolean create;
[DeprecateAs=CreateMember, ImplementedAs=createMember] boolean deprecatedCreateMember;
+ // If done naively, collides with a C++ keyword.
+ [ImplementedAs=isPublic] boolean public;
(double or DOMString) doubleOrStringMember = 3.14;
sequence<(double or DOMString)> doubleOrStringSequenceMember;
(double or DOMString) otherDoubleOrStringMember = "default string value";
@@ -37,5 +37,12 @@
EventTarget eventTargetMember;
any anyMember = null;
Dictionary dictionaryMember;
- [RuntimeEnabled=runtimeFeature] boolean runtimeMember;
+ [RuntimeEnabled=RuntimeFeature] boolean runtimeMember;
+ record<ByteString, byte> recordMember;
+ record<USVString, TestObject> garbageCollectedRecordMember;
+ record<ByteString, (long or boolean)> unionInRecordMember;
+ record<DOMString, any> anyInRecordMember;
+ (Float or BooleanType) unionWithTypedefs;
+ [Clamp] long applicableToTypeLongMember;
+ [TreatNullAs=EmptyString] DOMString applicableToTypeStringMember;
};
diff --git a/bindings/tests/idls/core/TestDictionaryDerived.idl b/bindings/tests/idls/core/TestDictionaryDerived.idl
index 51817ef..4f274f1 100644
--- a/bindings/tests/idls/core/TestDictionaryDerived.idl
+++ b/bindings/tests/idls/core/TestDictionaryDerived.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- ImplementedAs=TestDictionaryDerivedImplementedAs,
+ ImplementedAs=TestDictionaryDerivedImplementedAs
] dictionary TestDictionaryDerived : TestDictionary {
DOMString derivedStringMember;
DOMString derivedStringMemberWithDefault = "default string value";
diff --git a/bindings/tests/idls/core/TestException.idl b/bindings/tests/idls/core/TestException.idl
deleted file mode 100644
index 0c918b4..0000000
--- a/bindings/tests/idls/core/TestException.idl
+++ /dev/null
@@ -1,39 +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:
- *
- * 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.
- */
-
-[
- Constructor(unsigned short argument),
- DoNotCheckConstants,
-] exception TestException {
- readonly attribute unsigned short readonlyUnsignedShortAttribute;
- readonly attribute DOMString readonlyStringAttribute;
-
- const unsigned short UNSIGNED_SHORT_CONSTANT = 1;
-
- [NotEnumerable] DOMString toString();
-};
diff --git a/bindings/tests/idls/core/TestImplements.idl b/bindings/tests/idls/core/TestImplements.idl
index ffe8372..601c050 100644
--- a/bindings/tests/idls/core/TestImplements.idl
+++ b/bindings/tests/idls/core/TestImplements.idl
@@ -27,7 +27,7 @@
*/
[
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface TestImplements {
static readonly attribute long implementsStaticReadOnlyLongAttribute;
static attribute DOMString implementsStaticStringAttribute;
@@ -45,4 +45,7 @@
[Reflect=IMPLEMENTS_REFLECT_CONSTANT] const unsigned short IMPLEMENTS_CONSTANT_2 = 2;
[RuntimeEnabled=ImplementsFeatureName] attribute Node implementsRuntimeEnabledNodeAttribute;
+
+ [NotEnumerable] stringifier;
+ [NotEnumerable, RaisesException] serializer;
};
diff --git a/bindings/tests/idls/core/TestImplements2.idl b/bindings/tests/idls/core/TestImplements2.idl
index ce0e357..e3e7905 100644
--- a/bindings/tests/idls/core/TestImplements2.idl
+++ b/bindings/tests/idls/core/TestImplements2.idl
@@ -31,7 +31,7 @@
[
LegacyTreatAsPartialInterface, // Conflicts with default implements behavior
NoInterfaceObject, // Always used on target of 'implements'
- RuntimeEnabled=Implements2FeatureName, // conflicts with [RuntimeEnabled] on member
+ RuntimeEnabled=Implements2FeatureName // conflicts with [RuntimeEnabled] on member
] interface TestImplements2 {
static attribute DOMString implements2StaticStringAttribute;
attribute DOMString implements2StringAttribute;
diff --git a/bindings/tests/idls/core/TestImplements3.idl b/bindings/tests/idls/core/TestImplements3.idl
index 4d18506..dff66fd 100644
--- a/bindings/tests/idls/core/TestImplements3.idl
+++ b/bindings/tests/idls/core/TestImplements3.idl
@@ -5,7 +5,7 @@
[
LegacyTreatAsPartialInterface, // used by [ImplementedAs]
ImplementedAs=TestImplements3Implementation, // Conflicts with default implements class name
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface TestImplements3 {
attribute DOMString implements3StringAttribute;
static attribute DOMString implements3StaticStringAttribute;
diff --git a/bindings/tests/idls/core/TestIntegerIndexed.idl b/bindings/tests/idls/core/TestIntegerIndexed.idl
index ddc9d20..606bf12 100644
--- a/bindings/tests/idls/core/TestIntegerIndexed.idl
+++ b/bindings/tests/idls/core/TestIntegerIndexed.idl
@@ -12,5 +12,7 @@
[Custom] setter Node (DOMString name, Node value);
[Custom] deleter boolean (DOMString name);
+ iterable <[Clamp] long, DOMString>;
+
void voidMethodDocument(Document document);
};
diff --git a/bindings/tests/idls/core/TestInterface.idl b/bindings/tests/idls/core/TestInterface.idl
index 58c1e12..ec52097 100644
--- a/bindings/tests/idls/core/TestInterface.idl
+++ b/bindings/tests/idls/core/TestInterface.idl
@@ -32,15 +32,14 @@
// Also used as a target by TestObject
[
+ ActiveScriptWrappable,
DependentLifetime,
Custom=LegacyCallAsFunction,
DoNotCheckConstants,
ImplementedAs=TestInterfaceImplementation,
- Iterable,
- OriginTrialEnabled=OriginTrialFeatureName,
RuntimeEnabled=FeatureName,
- SetWrapperReferenceTo(TestInterface referencedName),
- Exposed=(Worker,Window),
+ ContextEnabled=FeatureName,
+ Exposed=(Worker,Window)
] interface TestInterface : TestInterfaceEmpty {
// members needed to test [ImplementedAs], as this affect attribute
// configuration and method configuration
@@ -57,6 +56,8 @@
attribute unrestricted float unrestrictedFloatAttribute;
attribute TestEnum testEnumAttribute;
attribute DOMStringOrDouble stringOrDoubleAttribute;
+ attribute [EnforceRange] long withExtendedAttributeStringAttribute;
+ [ImplementedAs=CapitalImplementation] attribute Implementation uncapitalAttribute;
[RuntimeEnabled=FeatureName] attribute long conditionalLongAttribute;
[RuntimeEnabled=FeatureName] readonly attribute long conditionalReadOnlyLongAttribute;
static attribute DOMString staticStringAttribute;
@@ -73,18 +74,15 @@
[PerWorldBindings] void voidMethod();
// Anonymous indexed property operations
- [DoNotCheckSecurity] getter DOMString (unsigned long index);
+ [CrossOrigin] getter DOMString (unsigned long index);
setter DOMString (unsigned long index, DOMString value);
deleter boolean (unsigned long index);
// Anonymous named property operations
- [DoNotCheckSecurity] getter DOMString (DOMString name);
+ [CrossOrigin] 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();
[Exposed=Worker] void workerExposedMethod();
@@ -116,9 +114,24 @@
Promise promiseMethodPartialOverload(Window window);
static Promise staticPromiseMethodPartialOverload();
+ iterable<ByteString, long>;
+
[LenientThis] attribute any lenientThisAttribute;
[LegacyInterfaceTypeChecking] void legacyInterfaceTypeCheckingMethod(TestInterfaceEmpty testInterfaceEmptyArg);
+
+ [SecureContext] void secureContextMethod();
+ [SecureContext] attribute bool secureContextAttribute;
+ [SecureContext,RuntimeEnabled=SecureFeature] void secureContextRuntimeEnabledMethod();
+ [SecureContext,RuntimeEnabled=SecureFeature] attribute bool secureContextRuntimeEnabledAttribute;
+ [SecureContext,Exposed=Window] void secureContextWindowExposedMethod();
+ [SecureContext,Exposed=Window] attribute bool secureContextWindowExposedAttribute;
+ [SecureContext,Exposed=Worker] void secureContextWorkerExposedMethod();
+ [SecureContext,Exposed=Worker] attribute bool secureContextWorkerExposedAttribute;
+ [SecureContext,Exposed=Window,RuntimeEnabled=SecureFeature] void secureContextWindowExposedRuntimeEnabledMethod();
+ [SecureContext,Exposed=Window,RuntimeEnabled=SecureFeature] attribute bool secureContextWindowExposedRuntimeEnabledAttribute;
+ [SecureContext,Exposed=Worker,RuntimeEnabled=SecureFeature] void secureContextWorkerExposedRuntimeEnabledMethod();
+ [SecureContext,Exposed=Worker,RuntimeEnabled=SecureFeature] attribute bool secureContextWorkerExposedRuntimeEnabledAttribute;
};
TestInterface implements TestImplements;
diff --git a/bindings/tests/idls/core/TestInterface2.idl b/bindings/tests/idls/core/TestInterface2.idl
index 18ab03f..30ed232 100644
--- a/bindings/tests/idls/core/TestInterface2.idl
+++ b/bindings/tests/idls/core/TestInterface2.idl
@@ -34,16 +34,19 @@
// The more *minor* extended attribute should be put in this file.
[
+ ActiveScriptWrappable, // Covered by [ActiveScriptWrappable]
Constructor,
DependentLifetime, // Covered by [DependentLifetime]
- SetWrapperReferenceFrom=ownerNode, // Conflicts with [SetWrapperReferenceTo]
// 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)
+ 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;
+ // Legacy caller with an identifier
+ legacycaller TestInterfaceEmpty legacyCaller(unsigned long index);
+
// Indexed property operations with an identifier
[RaisesException] getter TestInterfaceEmpty item(unsigned long index);
[RaisesException] setter TestInterfaceEmpty setItem(unsigned long index, TestInterfaceEmpty value);
diff --git a/bindings/tests/idls/core/TestInterface3.idl b/bindings/tests/idls/core/TestInterface3.idl
index 4470f7c..8b9e423 100644
--- a/bindings/tests/idls/core/TestInterface3.idl
+++ b/bindings/tests/idls/core/TestInterface3.idl
@@ -34,9 +34,12 @@
// The more *minor* extended attribute should be put in this file.
[
- Custom=VisitDOMWrapper, // Conflict with [SetWrapperReferenceTo] and [SetWrapperReferenceFrom]
- NoImplHeader,
+ WebAgentAPI
] interface TestInterface3 {
+ // iterable<V> needs a "length" property accompanying the indexed property
+ // getter below.
+ readonly attribute unsigned long length;
+
[Custom] getter boolean (unsigned long index);
[Custom] setter boolean (unsigned long index, Node value);
[Custom] deleter boolean (unsigned long index);
@@ -48,5 +51,6 @@
void voidMethodDocument(Document document);
[RuntimeEnabled=FeatureName] iterable<any>;
- [RuntimeEnabled=FeatureName, CallWith=ScriptState, RaisesException, ImplementedAs=iterableKeys] Iterator keys();
+
+ stringifier readonly attribute DOMString readonlyStringifierAttribute;
};
diff --git a/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl b/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl
index 5aaf41d..fd04326 100644
--- a/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl
+++ b/bindings/tests/idls/core/TestInterfaceCheckSecurity.idl
@@ -28,19 +28,18 @@
[
CheckSecurity=Receiver,
- Global,
+ Global
] interface TestInterfaceCheckSecurity {
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;
+ [CrossOrigin] attribute long doNotCheckSecurityLongAttribute;
+ [CrossOrigin] readonly attribute long doNotCheckSecurityReadonlyLongAttribute; // Separate read only attribute to check attribute configuration
+ [CrossOrigin=Setter] attribute long doNotCheckSecurityOnSetterLongAttribute;
+ [CrossOrigin, Replaceable] readonly attribute long doNotCheckSecurityReplaceableReadonlyLongAttribute;
- [DoNotCheckSecurity] void doNotCheckSecurityVoidMethod();
- [DoNotCheckSecurity, DoNotCheckSignature] void doNotCheckSecurityDoNotCheckSignatureVoidMethod();
- [DoNotCheckSecurity, PerWorldBindings] void doNotCheckSecurityPerWorldBindingsVoidMethod();
- [DoNotCheckSecurity, Unforgeable] void doNotCheckSecurityUnforgeableVoidMethod();
+ [CrossOrigin] void doNotCheckSecurityVoidMethod();
+ [CrossOrigin, PerWorldBindings] void doNotCheckSecurityPerWorldBindingsVoidMethod();
+ [CrossOrigin, Unforgeable] void doNotCheckSecurityUnforgeableVoidMethod();
};
diff --git a/bindings/tests/idls/core/TestInterfaceConstructor.idl b/bindings/tests/idls/core/TestInterfaceConstructor.idl
index 29878ae..e60065d 100644
--- a/bindings/tests/idls/core/TestInterfaceConstructor.idl
+++ b/bindings/tests/idls/core/TestInterfaceConstructor.idl
@@ -46,6 +46,6 @@
NamedConstructor=Audio(DOMString arg, optional DOMString optArg),
ConstructorCallWith=(ScriptState,ExecutionContext,Document),
MeasureAs=TestFeature,
- RaisesException=Constructor,
+ RaisesException=Constructor
] interface TestInterfaceConstructor {
};
diff --git a/bindings/tests/idls/core/TestInterfaceConstructor2.idl b/bindings/tests/idls/core/TestInterfaceConstructor2.idl
index 209a000..097b27c 100644
--- a/bindings/tests/idls/core/TestInterfaceConstructor2.idl
+++ b/bindings/tests/idls/core/TestInterfaceConstructor2.idl
@@ -47,6 +47,6 @@
[Default=Undefined] optional DOMString defaultUndefinedOptionalStringArg,
optional DOMString defaultNullStringOptionalStringArg = null,
[Default=Undefined] optional Dictionary defaultUndefinedOptionalDictionaryArg,
- optional DOMString optionalStringArg),
+ optional DOMString optionalStringArg)
] interface TestInterfaceConstructor2 {
};
diff --git a/bindings/tests/idls/core/TestInterfaceConstructor3.idl b/bindings/tests/idls/core/TestInterfaceConstructor3.idl
index 19b6669..00d23be 100644
--- a/bindings/tests/idls/core/TestInterfaceConstructor3.idl
+++ b/bindings/tests/idls/core/TestInterfaceConstructor3.idl
@@ -30,6 +30,6 @@
// Test for length > 0, non-overloaded constructor.
[
- Constructor(DOMString stringArg),
+ Constructor(DOMString stringArg)
] interface TestInterfaceConstructor3 {
};
diff --git a/bindings/tests/idls/core/TestInterfaceConstructor4.idl b/bindings/tests/idls/core/TestInterfaceConstructor4.idl
index 2153167..e6980fb 100644
--- a/bindings/tests/idls/core/TestInterfaceConstructor4.idl
+++ b/bindings/tests/idls/core/TestInterfaceConstructor4.idl
@@ -6,6 +6,6 @@
// argument.
[
Constructor(TestInterfaceConstructor4 testInterface4Arg),
- Constructor(USVString usvStringArg),
+ Constructor(USVString usvStringArg)
] interface TestInterfaceConstructor4 {
};
diff --git a/bindings/tests/idls/core/TestInterfaceCustomConstructor.idl b/bindings/tests/idls/core/TestInterfaceCustomConstructor.idl
index dba8b7a..35fccd7 100644
--- a/bindings/tests/idls/core/TestInterfaceCustomConstructor.idl
+++ b/bindings/tests/idls/core/TestInterfaceCustomConstructor.idl
@@ -31,6 +31,6 @@
[
CustomConstructor,
CustomConstructor(TestInterfaceEmpty testInterfaceEmptyArg),
- CustomConstructor(double doubleArg, optional double optionalDoubleArg),
+ CustomConstructor(double doubleArg, optional double optionalDoubleArg)
] interface TestInterfaceCustomConstructor {
};
diff --git a/bindings/tests/idls/core/TestInterfaceEventInitConstructor.idl b/bindings/tests/idls/core/TestInterfaceEventInitConstructor.idl
index 2fa3746..0e30790 100644
--- a/bindings/tests/idls/core/TestInterfaceEventInitConstructor.idl
+++ b/bindings/tests/idls/core/TestInterfaceEventInitConstructor.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- Constructor(DOMString type, TestInterfaceEventInit testInterfaceEventInit),
+ Constructor(DOMString type, TestInterfaceEventInit testInterfaceEventInit)
] interface TestInterfaceEventInitConstructor : Event {
readonly attribute DOMString readonlyStringAttribute;
};
diff --git a/bindings/tests/idls/core/TestInterfaceEventTarget.idl b/bindings/tests/idls/core/TestInterfaceEventTarget.idl
index 742c6d7..f86dbfd 100644
--- a/bindings/tests/idls/core/TestInterfaceEventTarget.idl
+++ b/bindings/tests/idls/core/TestInterfaceEventTarget.idl
@@ -30,6 +30,6 @@
[
NamedConstructor=Name(),
- ConstructorCallWith=Document,
+ ConstructorCallWith=Document
] interface TestInterfaceEventTarget : EventTarget {
};
diff --git a/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl b/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl
index 216cbed..7e5313d 100644
--- a/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl
+++ b/bindings/tests/idls/core/TestInterfaceGarbageCollected.idl
@@ -3,11 +3,10 @@
// found in the LICENSE file.
[
- Constructor(DOMString str),
- GarbageCollected,
+ Constructor(DOMString str)
] interface TestInterfaceGarbageCollected : EventTarget { // Inherit from EventTarget to test order of internal fields
attribute TestInterfaceGarbageCollected attr1;
void func(TestInterfaceGarbageCollected arg);
- setlike<DOMString>;
+ setlike<[TreatNullAs=EmptyString] DOMString>;
};
diff --git a/bindings/tests/idls/core/TestInterfaceNamedConstructor.idl b/bindings/tests/idls/core/TestInterfaceNamedConstructor.idl
index 1185fab..4d57a70 100644
--- a/bindings/tests/idls/core/TestInterfaceNamedConstructor.idl
+++ b/bindings/tests/idls/core/TestInterfaceNamedConstructor.idl
@@ -27,6 +27,7 @@
*/
[
+ ActiveScriptWrappable,
DependentLifetime,
NamedConstructor=Audio(
DOMString stringArg,
@@ -36,7 +37,7 @@
optional DOMString defaultNullStringOptionalstringArg = null,
optional DOMString optionalStringArg),
ConstructorCallWith=Document,
- RaisesException=Constructor,
+ RaisesException=Constructor
] interface TestInterfaceNamedConstructor {
// An attribute of type {interface_name}ConstructorConstructor is generated
// in *Constructors.idl file, which is a partial interface for the global
diff --git a/bindings/tests/idls/core/TestInterfaceNamedConstructor2.idl b/bindings/tests/idls/core/TestInterfaceNamedConstructor2.idl
index 1494ffd..1f3aa01 100644
--- a/bindings/tests/idls/core/TestInterfaceNamedConstructor2.idl
+++ b/bindings/tests/idls/core/TestInterfaceNamedConstructor2.idl
@@ -30,6 +30,6 @@
// "Number of arguments" check varies if [RaisesException=Constructor] or not
[
- NamedConstructor=Audio(DOMString stringArg),
+ NamedConstructor=Audio(DOMString stringArg)
] interface TestInterfaceNamedConstructor2 {
};
diff --git a/bindings/tests/idls/core/TestInterfaceOriginTrialEnabled.idl b/bindings/tests/idls/core/TestInterfaceOriginTrialEnabled.idl
new file mode 100644
index 0000000..959db4b
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfaceOriginTrialEnabled.idl
@@ -0,0 +1,25 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test for [OriginTrialEnabled] extended attribute applied to an interface.
+// This is separate from TestInterface (and TestInterface[2|3]), as the
+// [OriginTrialEnabled] attribute takes precedence over [RuntimeEnabled].
+
+[
+ OriginTrialEnabled=InterfaceFeatureName
+] interface TestInterfaceOriginTrialEnabled {
+ const unsigned long UNSIGNED_LONG = 0;
+ const short CONST_JAVASCRIPT = 1;
+
+ attribute double doubleAttribute;
+ [RuntimeEnabled=FeatureName] attribute long conditionalLongAttribute;
+ [RuntimeEnabled=FeatureName] readonly attribute long conditionalReadOnlyLongAttribute;
+ static attribute DOMString staticStringAttribute;
+ [RuntimeEnabled=FeatureName] static readonly attribute long staticConditionalReadOnlyLongAttribute;
+
+ void voidMethodDoubleArgFloatArg(double doubleArg, float floatArg);
+
+ void voidMethodPartialOverload();
+ void voidMethodPartialOverload(double doubleArg);
+};
diff --git a/bindings/tests/idls/core/TestInterfacePartial.idl b/bindings/tests/idls/core/TestInterfacePartial.idl
new file mode 100644
index 0000000..fe896b2
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfacePartial.idl
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+enum PartialEnumType {
+ "foo",
+ "bar"
+};
+
+typedef DOMString PartialString;
+
+[Custom] callback PartialCallbackType = void (PartialString value);
+[
+ ImplementedAs=TestInterfacePartial,
+ RuntimeEnabled=PartialFeatureName
+] partial interface TestInterface {
+ const unsigned short PARTIAL_UNSIGNED_SHORT = 0;
+ const double PARTIAL_DOUBLE = 3.14;
+
+ attribute long partialLongAttribute;
+ static attribute long partialStaticLongAttribute;
+ [CallWith=ExecutionContext] attribute long partialCallWithExecutionContextLongAttribute;
+
+ void partialVoidMethod();
+ static void partialStaticVoidMethod();
+ void partialVoidMethodLongArg(long longArg);
+ [CallWith=ExecutionContext, RaisesException] void partialCallWithExecutionContextRaisesExceptionVoidMethod();
+
+ attribute PartialEnumType partialPartialEnumTypeAttribute;
+ void partialVoidMethodPartialCallbackTypeArg(PartialCallbackType partialCallbackTypeArg);
+
+ [SecureContext] attribute long partialSecureContextLongAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfacePartial2.idl b/bindings/tests/idls/core/TestInterfacePartial2.idl
new file mode 100644
index 0000000..59993ef
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfacePartial2.idl
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+[
+ ImplementedAs=TestInterfacePartial2Implementation // Conflicts with default partial interface class name
+] partial interface TestInterface {
+ const unsigned short PARTIAL2_UNSIGNED_SHORT = 0;
+
+ attribute long partial2LongAttribute;
+ static attribute long partial2StaticLongAttribute;
+
+ void partial2VoidMethod();
+ static void partial2StaticVoidMethod();
+
+ [SecureContext] void partial2SecureContextMethod();
+ [SecureContext] attribute bool partial2SecureContextAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfacePartialSecureContext.idl b/bindings/tests/idls/core/TestInterfacePartialSecureContext.idl
new file mode 100644
index 0000000..8b22d79
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfacePartialSecureContext.idl
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ SecureContext,
+ Exposed=(Window,Worker),
+ ImplementedAs=TestInterfacePartialSecureContext // Conflicts with default partial interface class name
+] partial interface TestInterface {
+ void partialSecureContextMethod();
+ attribute bool partialSecureContextAttribute;
+ [RuntimeEnabled=SecureFeature] void partialSecureContextRuntimeEnabledMethod();
+ [RuntimeEnabled=SecureFeature] attribute bool partialSecureContextRuntimeEnabledAttribute;
+ [Exposed=Window] void partialSecureContextWindowExposedMethod();
+ [Exposed=Window] attribute bool partialSecureContextWindowExposedAttribute;
+ [Exposed=Worker] void partialSecureContextWorkerExposedMethod();
+ [Exposed=Worker] attribute bool partialSecureContextWorkerExposedAttribute;
+ [Exposed=Window,RuntimeEnabled=SecureFeature] void partialSecureContextWindowExposedRuntimeEnabledMethod();
+ [Exposed=Window,RuntimeEnabled=SecureFeature] attribute bool partialSecureContextWindowExposedRuntimeEnabledAttribute;
+ [Exposed=Worker,RuntimeEnabled=SecureFeature] void partialSecureContextWorkerExposedRuntimeEnabledMethod();
+ [Exposed=Worker,RuntimeEnabled=SecureFeature] attribute bool partialSecureContextWorkerExposedRuntimeEnabledAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfaceSecureContext.idl b/bindings/tests/idls/core/TestInterfaceSecureContext.idl
new file mode 100644
index 0000000..e43c2b2
--- /dev/null
+++ b/bindings/tests/idls/core/TestInterfaceSecureContext.idl
@@ -0,0 +1,21 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ SecureContext,
+ Exposed=(Window,Worker)
+] interface TestInterfaceSecureContext {
+ void secureContextMethod();
+ attribute bool secureContextAttribute;
+ [RuntimeEnabled=SecureFeature] void secureContextRuntimeEnabledMethod();
+ [RuntimeEnabled=SecureFeature] attribute bool secureContextRuntimeEnabledAttribute;
+ [Exposed=Window] void secureContextWindowExposedMethod();
+ [Exposed=Window] attribute bool secureContextWindowExposedAttribute;
+ [Exposed=Worker] void secureContextWorkerExposedMethod();
+ [Exposed=Worker] attribute bool secureContextWorkerExposedAttribute;
+ [Exposed=Window,RuntimeEnabled=SecureFeature] void secureContextWindowExposedRuntimeEnabledMethod();
+ [Exposed=Window,RuntimeEnabled=SecureFeature] attribute bool secureContextWindowExposedRuntimeEnabledAttribute;
+ [Exposed=Worker,RuntimeEnabled=SecureFeature] void secureContextWorkerExposedRuntimeEnabledMethod();
+ [Exposed=Worker,RuntimeEnabled=SecureFeature] attribute bool secureContextWorkerExposedRuntimeEnabledAttribute;
+};
diff --git a/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl b/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl
deleted file mode 100644
index 8515a03..0000000
--- a/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl
+++ /dev/null
@@ -1,39 +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.
- */
-
-[
- 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/TestLegacyCallbackInterface.idl b/bindings/tests/idls/core/TestLegacyCallbackInterface.idl
new file mode 100644
index 0000000..78d7a1a
--- /dev/null
+++ b/bindings/tests/idls/core/TestLegacyCallbackInterface.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+callback interface TestLegacyCallbackInterface {
+ const unsigned short CONST_VALUE_USHORT_42 = 42;
+
+ unsigned short acceptNode(Node node);
+};
diff --git a/bindings/tests/idls/core/TestNode.idl b/bindings/tests/idls/core/TestNode.idl
index 0c767ee..3317c32 100644
--- a/bindings/tests/idls/core/TestNode.idl
+++ b/bindings/tests/idls/core/TestNode.idl
@@ -19,11 +19,11 @@
*/
[
- Constructor,
+ Constructor
] interface TestNode : Node {
// These attributes are needed to test [PutForwards] in TestObject.idl.
attribute DOMString href;
[RaisesException=Setter] attribute DOMString hrefThrows;
- [SetterCallWith=(ExecutionContext,ActiveWindow,FirstWindow)] attribute DOMString hrefCallWith;
+ [SetterCallWith=(ExecutionContext,CurrentWindow,EnteredWindow)] attribute DOMString hrefCallWith;
attribute ByteString hrefByteString;
};
diff --git a/bindings/tests/idls/core/TestObject.idl b/bindings/tests/idls/core/TestObject.idl
index 4e37b82..fe4069e 100644
--- a/bindings/tests/idls/core/TestObject.idl
+++ b/bindings/tests/idls/core/TestObject.idl
@@ -29,51 +29,10 @@
*/
enum TestEnum {"", "EnumValue1", "EnumValue2", "EnumValue3"};
-
-callback VoidCallbackFunction = void ();
-callback AnyCallbackFunctionOptionalAnyArg = any (optional any optionalAnyArg);
+enum TestEnum2 {"", "EnumValue1", "EnumValue2", "EnumValue3"};
// No extended attributes on the interface; those go in TestInterface.idl
interface TestObject {
- // Constants
- const unsigned short CONST_VALUE_0 = 0;
- const unsigned short CONST_VALUE_1 = 1;
- const unsigned short CONST_VALUE_2 = 2;
- const unsigned short CONST_VALUE_4 = 4;
- const unsigned short CONST_VALUE_8 = 8;
- const short CONST_VALUE_9 = -1;
- const unsigned short CONST_VALUE_11 = 0xffffffff;
- const unsigned short CONST_VALUE_12 = 0x01;
- const unsigned short CONST_VALUE_13 = 0X20;
- const unsigned short CONST_VALUE_14 = 0x1abc;
- const unsigned short CONST_VALUE_15 = 010;
- const unsigned short CONST_VALUE_16 = -010;
- const unsigned short CONST_VALUE_16 = -0x1A;
- const unsigned short CONST_VALUE_17 = -0X1a;
- const double CONST_VALUE_18 = 0.123;
- const double CONST_VALUE_19 = 4e9;
- const double CONST_VALUE_20 = 3.4e5;
- const double CONST_VALUE_21 = -1.3;
- const double CONST_VALUE_22 = -4e-9;
- const double CONST_VALUE_23 = .123;
- const double CONST_VALUE_24 = 5E+4;
- const float CONST_VALUE_25 = 1;
-
- // Extended attributes
- [DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1;
- [MeasureAs=Constant] const short MEASURED_CONSTANT = 1;
- [RuntimeEnabled=FeatureName1] const short FEATURE1_ENABLED_CONST1 = 1;
- [RuntimeEnabled=FeatureName1] const short FEATURE1_ENABLED_CONST2 = 2;
- [RuntimeEnabled=FeatureName2] const short FEATURE2_ENABLED_CONST1 = 3;
- [RuntimeEnabled=FeatureName2] const short FEATURE2_ENABLED_CONST2 = 4;
- [RuntimeEnabled=FeatureName3] const short FEATURE3_ENABLED_CONST1 = 5;
- [RuntimeEnabled=FeatureName1, OriginTrialEnabled=FeatureName1] const short FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1 = 1;
- [RuntimeEnabled=FeatureName1, OriginTrialEnabled=FeatureName1] const short FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2 = 2;
- [RuntimeEnabled=FeatureName2, OriginTrialEnabled=FeatureName2] const short FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1 = 3;
- [RuntimeEnabled=FeatureName2, OriginTrialEnabled=FeatureName2] const short FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2 = 4;
- [RuntimeEnabled=FeatureName3, OriginTrialEnabled=FeatureName3] const short FEATURE3_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1 = 5;
- [Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1;
-
stringifier attribute DOMString stringifierAttribute;
// Attributes
@@ -84,7 +43,7 @@
// [Foo] attribute DOMString? fooStringOrNullAttribute
//
// Type name reference:
- // http://heycam.github.io/webidl/#dfn-type-name
+ // https://heycam.github.io/webidl/#dfn-type-name
//
// TestInterfaceEmpty is used as a stub interface type, for testing behavior
// that should not depend on particular type (beyond "interface or not").
@@ -115,9 +74,6 @@
attribute TestInterfaceEmpty testInterfaceEmptyAttribute;
// Self-reference
attribute TestObject testObjectAttribute;
- // Callback function type
- attribute VoidCallbackFunction voidCallbackFunctionAttribute;
- attribute AnyCallbackFunctionOptionalAnyArg anyCallbackFunctionOptionalAnyArgAttribute;
// Names that begin with an acronym
attribute long cssAttribute;
attribute long imeAttribute;
@@ -148,11 +104,11 @@
readonly attribute Window readonlyWindowAttribute;
readonly attribute HTMLCollection htmlCollectionAttribute;
readonly attribute HTMLElement htmlElementAttribute;
- // Arrays
- attribute DOMString[] stringArrayAttribute;
- attribute TestInterfaceEmpty[] testInterfaceEmptyArrayAttribute;
- attribute float[] floatArrayAttribute;
+ // FrozenArrays
+ attribute FrozenArray<DOMString> stringFrozenArrayAttribute;
+ attribute FrozenArray<TestInterfaceEmpty> testInterfaceEmptyFrozenArrayAttribute;
// Nullable attributes
+ attribute boolean? booleanOrNullAttribute;
attribute DOMString? stringOrNullAttribute;
attribute long? longOrNullAttribute;
attribute TestInterface? testInterfaceOrNullAttribute;
@@ -171,13 +127,14 @@
attribute (DOMString or sequence<DOMString>) stringOrStringSequenceAttribute;
attribute (TestEnum or double) testEnumOrDoubleAttribute;
attribute (unrestricted double or DOMString) unrestrictedDoubleOrStringAttribute;
+ attribute ((double or DOMString) or sequence<(double or DOMString)>) nestedUnionAtribute;
// Extended attributes
[LogActivity, LogAllWorlds] attribute long activityLoggingAccessForAllWorldsLongAttribute;
[LogActivity=GetterOnly, LogAllWorlds] attribute long activityLoggingGetterForAllWorldsLongAttribute;
[LogActivity=SetterOnly, LogAllWorlds] attribute long activityLoggingSetterForAllWorldsLongAttribute;
[CachedAttribute=isValueDirty] attribute any cachedAttributeAnyAttribute;
- [CachedAttribute=isArrayDirty] attribute DOMString[] cachedArrayAttribute;
+ [CachedAttribute=isFrozenArrayDirty] attribute FrozenArray<DOMString> cachedArrayAttribute;
[CachedAttribute=isStringDirty] attribute DOMString? cachedStringOrNoneAttribute;
[CallWith=ExecutionContext] attribute any callWithExecutionContextAnyAttribute;
[CallWith=ScriptState] attribute any callWithScriptStateAnyAttribute;
@@ -191,16 +148,15 @@
[Custom=Getter] attribute long customGetterLongAttribute;
[Custom=Getter] readonly attribute object customGetterReadonlyObjectAttribute;
[Custom=Setter] attribute long customSetterLongAttribute;
- [CustomElementCallbacks] readonly attribute long customElementsCallbacksReadonlyLongAttribute;
[DeprecateAs=LongAttribute] attribute long deprecatedLongAttribute;
[EnforceRange] attribute long enforceRangeLongAttribute;
- [OriginTrialEnabled=FeatureName, RuntimeEnabled=FeatureName] attribute long experimentRuntimeEnabledLongAttribute;
[ImplementedAs=implementedAsName] attribute long implementedAsLongAttribute;
[Custom, ImplementedAs=implementedAsNameWithCustom] attribute long customImplementedAsLongAttribute;
[Custom=Getter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customGetterImplementedAsLongAttribute;
[Custom=Setter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customSetterImplementedAsLongAttribute;
[MeasureAs=TestFeature] attribute long measureAsLongAttribute;
[NotEnumerable] attribute long notEnumerableLongAttribute;
+ [OriginTrialEnabled=FeatureName] attribute long originTrialEnabledLongAttribute;
[PerWorldBindings] readonly attribute TestInterfaceEmpty perWorldBindingsReadonlyTestInterfaceEmptyAttribute;
[LogActivity, LogAllWorlds, PerWorldBindings] attribute long activityLoggingAccessPerWorldBindingsLongAttribute;
[LogActivity, PerWorldBindings] attribute long activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute;
@@ -213,7 +169,6 @@
[PerWorldBindings, PutForwards=href] readonly attribute TestNode locationWithPerWorldBindings;
[PutForwards=href, LegacyInterfaceTypeChecking] readonly attribute TestNode locationLegacyInterfaceTypeChecking;
[PutForwards=attr1] readonly attribute TestInterfaceGarbageCollected locationGarbageCollected;
- [PutForwards=attr1] readonly attribute TestInterfaceWillBeGarbageCollected locationWillBeGarbageCollected;
[RaisesException] attribute long raisesExceptionLongAttribute;
[RaisesException=Getter] attribute long raisesExceptionGetterLongAttribute;
[RaisesException=Setter] attribute long setterRaisesExceptionLongAttribute;
@@ -242,14 +197,16 @@
[Reflect, ReflectOnly=("ltr","rtl","auto"), ReflectMissing="auto", ReflectInvalid="ltr"] attribute DOMString limitedWithInvalidMissingDefaultAttribute;
[Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] readonly attribute DOMString corsSettingAttribute;
[Reflect, ReflectOnly=("empty","missing","invalid","a-normal"), ReflectEmpty="empty", ReflectMissing="missing", ReflectInvalid="invalid"] readonly attribute DOMString limitedWithEmptyMissingInvalidAttribute;
+ [RuntimeCallStatsCounter=RuntimeCallStatsCounterAttribute] attribute long RuntimeCallStatsCounterAttribute;
+ [RuntimeCallStatsCounter=RuntimeCallStatsCounterReadOnlyAttribute] readonly attribute double RuntimeCallStatsCounterReadOnlyAttribute;
[Replaceable] readonly attribute long replaceableReadonlyLongAttribute;
[PutForwards=href] readonly attribute TestNode locationPutForwards;
[RuntimeEnabled=FeatureName] attribute long runtimeEnabledLongAttribute;
- [SetterCallWith=(ActiveWindow,FirstWindow)] attribute DOMString setterCallWithActiveWindowAndFirstWindowStringAttribute;
+ [SetterCallWith=(CurrentWindow,EnteredWindow)] attribute DOMString setterCallWithCurrentWindowAndEnteredWindowStringAttribute;
[SetterCallWith=ExecutionContext] attribute DOMString setterCallWithExecutionContextStringAttribute;
- [TreatNullAs=EmptyString] attribute DOMString treatNullAsEmptyStringStringAttribute;
- [TreatNullAs=NullString] attribute DOMString treatNullAsNullStringStringAttribute;
+ attribute [TreatNullAs=EmptyString] DOMString treatNullAsEmptyStringStringAttribute;
+ attribute [TreatNullAs=NullString] DOMString treatNullAsNullStringStringAttribute;
[LegacyInterfaceTypeChecking] attribute float legacyInterfaceTypeCheckingFloatAttribute; // nop for non-interface types
[LegacyInterfaceTypeChecking] attribute TestInterface legacyInterfaceTypeCheckingTestInterfaceAttribute;
[LegacyInterfaceTypeChecking] attribute TestInterface? legacyInterfaceTypeCheckingTestInterfaceOrNullAttribute;
@@ -257,20 +214,21 @@
[Reflect=reflectUrlAttribute, URL] attribute DOMString urlStringAttribute;
[Unforgeable] attribute long unforgeableLongAttribute;
[Measure] attribute long measuredLongAttribute;
- [SameObject] attribute TestInterface sameObjectAttribute;
- [Unscopeable] attribute long unscopeableLongAttribute;
- [Unscopeable, OriginTrialEnabled=FeatureName, RuntimeEnabled=FeatureName] attribute long unscopeableExperimentEnabledLongAttribute;
- [Unscopeable, RuntimeEnabled=FeatureName] attribute long unscopeableRuntimeEnabledLongAttribute;
- [Unscopeable] void unscopeableVoidMethod();
- [Unscopeable, RuntimeEnabled=FeatureName] void unscopeableRuntimeEnabledVoidMethod();
-
+ [SameObject] readonly attribute TestInterface sameObjectAttribute;
+ [SameObject, SaveSameObject] readonly attribute TestInterface saveSameObjectAttribute;
+ [SameObject, SaveSameObject] static readonly attribute TestInterface staticSaveSameObjectAttribute;
+ [Unscopable] attribute long unscopableLongAttribute;
+ [Unscopable, OriginTrialEnabled=FeatureName] attribute long unscopableOriginTrialEnabledLongAttribute;
+ [Unscopable, RuntimeEnabled=FeatureName] attribute long unscopableRuntimeEnabledLongAttribute;
+ [Unscopable] void unscopableVoidMethod();
+ [Unscopable, RuntimeEnabled=FeatureName] void unscopableRuntimeEnabledVoidMethod();
// Methods
//
// Naming convention:
// ReturnType returnTypeMethodTypeName1ArgTypeName2Arg(Type1 typeName1Arg, Type2 typeName2Arg);
// E.g.,
- // void voidMethodStringArgLongArrayArg(DOMString stringArg, long[] longArrayArg);
+ // void voidMethodStringArgLongSequenceArg(DOMString stringArg, sequence<long> longSequenceArg);
void voidMethod();
static void staticVoidMethod();
@@ -313,13 +271,6 @@
TestInterfaceEmpty testInterfaceEmptyMethod();
void voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
void voidMethodLongArgTestInterfaceEmptyArg(long longArg, TestInterfaceEmpty testInterfaceEmptyArg);
- // Callback function type
- 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();
void voidMethodEventTargetArg(EventTarget eventTargetArg);
@@ -333,6 +284,7 @@
// Typed arrays
ArrayBuffer arrayBufferMethod();
ArrayBufferView arrayBufferViewMethod();
+ [RaisesException] ArrayBufferView arrayBufferViewMethodRaisesException();
Float32Array float32ArrayMethod();
Int32Array int32ArrayMethod();
Uint8Array uint8ArrayMethod();
@@ -344,14 +296,8 @@
void voidMethodFloat32ArrayArg(Float32Array float32ArrayArg);
void voidMethodInt32ArrayArg(Int32Array int32ArrayArg);
void voidMethodUint8ArrayArg(Uint8Array uint8ArrayArg);
- // Arrays
- long[] longArrayMethod();
- DOMString[] stringArrayMethod();
- TestInterfaceEmpty[] testInterfaceEmptyArrayMethod();
- void voidMethodArrayLongArg(long[] arrayLongArg);
- void voidMethodArrayStringArg(DOMString[] arrayStringArg);
- void voidMethodArrayTestInterfaceEmptyArg(TestInterfaceEmpty[] arrayTestInterfaceEmptyArg);
- void voidMethodNullableArrayLongArg(long[]? arrayLongArg);
+ void voidMethodAllowSharedArrayBufferViewArg([AllowShared] ArrayBufferView arrayBufferViewArg);
+ void voidMethodAllowSharedUint8ArrayArg([AllowShared] Uint8Array uint8ArrayArg);
// Sequences
sequence<long> longSequenceMethod();
sequence<DOMString> stringSequenceMethod();
@@ -361,6 +307,10 @@
void voidMethodSequenceTestInterfaceEmptyArg(sequence<TestInterfaceEmpty> testInterfaceEmptySequenceArg);
void voidMethodSequenceSequenceDOMStringArg(sequence<sequence<DOMString>> stringSequenceSequenceArg);
void voidMethodNullableSequenceLongArg(sequence<long>? longSequenceArg);
+ // FrozenArrays
+ FrozenArray<long> longFrozenArrayMethod();
+ void voidMethodStringFrozenArrayMethod(FrozenArray<DOMString> stringFrozenArrayArg);
+ void voidMethodTestInterfaceEmptyFrozenArrayMethod(FrozenArray<TestInterfaceEmpty> testInterfaceEmptyFrozenArrayArg);
// Nullable types
long? nullableLongMethod();
DOMString? nullableStringMethod();
@@ -368,14 +318,18 @@
sequence<long>? nullableLongSequenceMethod();
// Union types
(TestInterfaceGarbageCollected or DOMString) testInterfaceGarbageCollectedOrDOMStringMethod();
- (TestInterfaceWillBeGarbageCollected or TestDictionary) testInterfaceWillBeGarbageCollectedOrTestDictionaryMethod();
(boolean or DOMString or unrestricted double) booleanOrDOMStringOrUnrestrictedDoubleMethod();
(TestInterface or long) testInterfaceOrLongMethod();
+ static (TestInterfaceGarbageCollected or DOMString) staticTestInterfaceGarbageCollectedOrDOMStringMethod();
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);
+ // Unions with types that need extra includes/forward declarations in container types
+ void voidMethodBooleanOrElementSequenceArg((BooleanType or sequence<Element>) arg);
+ void voidMethodDoubleOrLongOrBooleanSequenceArg((double or sequence<(long or boolean)>) arg);
+ void voidMethodElementSequenceOrByteStringDoubleOrStringRecord((sequence<Element> or record<ByteString, (double or DOMString)>) arg);
// Array of Union types
void voidMethodArrayOfDoubleOrDOMStringArg((double or DOMString)... arg);
// Currently only used on interface type arguments
@@ -387,10 +341,13 @@
// Enumerations
TestEnum testEnumMethod();
void voidMethodTestEnumArg(TestEnum testEnumTypeArg);
+ void voidMethodTestMultipleEnumArg(TestEnum testEnumTypeArg, TestEnum2 testEnumTypeArg2);
// Exceptional types
Dictionary dictionaryMethod();
TestDictionary testDictionaryMethod();
TestDictionary? nullableTestDictionaryMethod();
+ static TestDictionary staticTestDictionaryMethod();
+ static TestDictionary? staticNullableTestDictionaryMethod();
void passPermissiveDictionaryMethod([PermissiveDictionaryConversion] optional TestDictionary arg);
NodeFilter nodeFilterMethod();
Promise<void> promiseMethod(long arg1, Dictionary arg2, DOMString arg3, DOMString... variadic);
@@ -443,7 +400,6 @@
void voidMethodVariadicTestInterfaceEmptyArg(TestInterfaceEmpty... variadicTestInterfaceEmptyArgs);
void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg, TestInterfaceEmpty... variadicTestInterfaceEmptyArgs);
void voidMethodVariadicTestInterfaceGarbageCollectedArg(TestInterfaceGarbageCollected... variadicTestInterfaceGarbageCollectedArg);
- void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg(TestInterfaceWillBeGarbageCollected... variadicTestInterfaceWillBeGarbageCollectedArg);
// Overloaded methods
void overloadedMethodA(long longArg);
@@ -453,7 +409,7 @@
void overloadedMethodC(long longArg);
void overloadedMethodC(TestInterfaceEmpty testInterfaceEmptyArg);
void overloadedMethodD(long longArg);
- void overloadedMethodD(long[] longArrayArg);
+ void overloadedMethodD(sequence<long> longArraySequence);
void overloadedMethodE(long longArg);
void overloadedMethodE(TestInterfaceEmpty? testInterfaceEmptyOrNullArg);
void overloadedMethodF(optional DOMString stringArg);
@@ -470,6 +426,8 @@
void overloadedMethodK(DOMString stringArg);
void overloadedMethodL(long longArg, any... restArgs);
void overloadedMethodL(DOMString stringArg, any... restArgs);
+ void overloadedMethodN(TestInterface testInterfaceArg);
+ void overloadedMethodN(TestCallbackInterface testCallbackInterfaceArg);
Promise promiseOverloadMethod();
Promise promiseOverloadMethod(Window arg1, double arg2);
@@ -499,10 +457,9 @@
void voidMethodDefaultUndefinedStringArg([Default=Undefined] optional DOMString defaultUndefinedStringArg);
// [EnforceRange]
void voidMethodEnforceRangeLongArg([EnforceRange] long enforceRangeLongArg);
- // [TreatNullAs], [TreatUndefinedAs]
+ // [TreatNullAs]
void voidMethodTreatNullAsEmptyStringStringArg([TreatNullAs=EmptyString] DOMString treatNullAsEmptyStringStringArg);
void voidMethodTreatNullAsNullStringStringArg([TreatNullAs=NullString] DOMString treatNullAsNullStringStringArg);
- void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString treatNullAsNullStringStringArg);
// Extended attributes for methods
[LogActivity, LogAllWorlds] void activityLoggingAccessForAllWorldsMethod();
@@ -512,24 +469,14 @@
[CallWith=(ScriptState,ExecutionContext)] void callWithScriptStateExecutionContextVoidMethod();
[CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethod();
[CallWith=(ScriptState,ScriptArguments)] void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(optional boolean optionalBooleanArg);
- [CallWith=ActiveWindow] void callWithActiveWindow();
- [CallWith=(ActiveWindow,FirstWindow)] void callWithActiveWindowScriptWindow();
+ [CallWith=CurrentWindow] void callWithCurrentWindow();
+ [CallWith=(CurrentWindow,EnteredWindow)] void callWithCurrentWindowScriptWindow();
[CallWith=ThisValue] void callWithThisValue();
[CheckSecurity=ReturnValue] void checkSecurityForNodeVoidMethod();
[Custom] void customVoidMethod();
[Custom=CallPrologue] void customCallPrologueVoidMethod();
[Custom=CallEpilogue] void customCallEpilogueVoidMethod();
- [CustomElementCallbacks] void customElementCallbacksVoidMethod();
[DeprecateAs=voidMethod] void deprecatedVoidMethod();
- [DoNotCheckSignature] void doNotCheckSignatureVoidMethod();
- [OriginTrialEnabled=FeatureName, RuntimeEnabled=FeatureName1] void experimentEnabledVoidMethod();
- [PerWorldBindings, OriginTrialEnabled=FeatureName, RuntimeEnabled=FeatureName1] void perWorldBindingsExperimentEnabledVoidMethod();
- [OriginTrialEnabled=FeatureName, RuntimeEnabled=FeatureName1] void experimentEnabledOverloadedVoidMethod(DOMString stringArg);
- [OriginTrialEnabled=FeatureName, RuntimeEnabled=FeatureName1] void experimentEnabledOverloadedVoidMethod(long longArg);
- [OriginTrialEnabled=FeatureName1, RuntimeEnabled=FeatureName1] void partiallyExperimentEnabledOverloadedVoidMethod(DOMString stringArg);
- [OriginTrialEnabled=FeatureName2, RuntimeEnabled=FeatureName1] void partiallyExperimentEnabledOverloadedVoidMethod(TestInterface testInterfaceArg);
- void partiallyExperimentEnabledOverloadedVoidMethod(long longArg, DOMString stringArg);
- [OriginTrialEnabled=FeatureName3] void partiallyExperimentEnabledOverloadedVoidMethod(long longArg, DOMString stringArg, TestInterface testInterfaceArg);
[ImplementedAs=implementedAsMethodName] void implementedAsVoidMethod();
[MeasureAs=TestFeature] void measureAsVoidMethod();
[Measure] void measureMethod();
@@ -550,9 +497,19 @@
[DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod();
[DeprecateAs=TestFeatureA, MeasureAs=TestFeatureB] void deprecateAsSameValueMeasureAsSameValueOverloadedMethod(long arg);
[NotEnumerable] void notEnumerableVoidMethod();
+ [OriginTrialEnabled=FeatureName] void originTrialEnabledVoidMethod();
+ [PerWorldBindings, OriginTrialEnabled=FeatureName] void perWorldBindingsOriginTrialEnabledVoidMethod();
+ // TODO(iclelland): Re-enable origin trials on overloaded methods
+ // (crbug.com/621641)
+ // [OriginTrialEnabled=FeatureName] void originTrialEnabledOverloadedVoidMethod(DOMString stringArg);
+ // [OriginTrialEnabled=FeatureName] void originTrialEnabledOverloadedVoidMethod(long longArg);
+ // [OriginTrialEnabled=FeatureName1] void partiallyOriginTrialEnabledOverloadedVoidMethod(DOMString stringArg);
+ // [OriginTrialEnabled=FeatureName2] void partiallyOriginTrialEnabledOverloadedVoidMethod(TestInterface testInterfaceArg);
+ // void partiallyOriginTrialEnabledOverloadedVoidMethod(long longArg, DOMString stringArg);
+ // [OriginTrialEnabled=FeatureName3] void partiallyOriginTrialEnabledOverloadedVoidMethod(long longArg, DOMString stringArg, TestInterface testInterfaceArg);
[PerWorldBindings] void perWorldBindingsVoidMethod();
[PerWorldBindings] void perWorldBindingsVoidMethodTestInterfaceEmptyArg(TestInterfaceEmpty testInterfaceEmptyArg);
- [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<object> transfer);
[LogActivity, LogAllWorlds, PerWorldBindings] void activityLoggingForAllWorldsPerWorldBindingsVoidMethod();
[LogActivity, PerWorldBindings] void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod();
[RaisesException] void raisesExceptionVoidMethod();
@@ -579,10 +536,10 @@
void useToImpl4ArgumentsCheckingIfPossibleWithUndefinedArg(Node node1, [Default=Undefined] optional Node node2);
[Unforgeable] void unforgeableVoidMethod();
void voidMethodTestInterfaceGarbageCollectedSequenceArg(sequence<TestInterfaceGarbageCollected> testInterfaceGarbageCollectedSequenceArg);
- void voidMethodTestInterfaceGarbageCollectedArrayArg(TestInterfaceGarbageCollected[] testInterfaceGarbageCollectedArrayArg);
- void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(sequence<TestInterfaceWillBeGarbageCollected> testInterfaceWillBeGarbageCollectedSequenceArg);
- void voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(TestInterfaceWillBeGarbageCollected[] testInterfaceWillBeGarbageCollectedArrayArg);
[NewObject] TestInterface newObjectTestInterfaceMethod();
+ [NewObject] Promise<TestInterface> newObjectTestInterfacePromiseMethod();
+ [RuntimeCallStatsCounter=RuntimeCallStatsCounterMethod] void RuntimeCallStatsCounterMethod();
+
serializer DOMString serializerMethod();
@@ -591,25 +548,7 @@
attribute TestInterface testInterfaceAttribute; // [ImplementedAs]
attribute TestInterfaceGarbageCollected testInterfaceGarbageCollectedAttribute; // [GarbageCollected]
attribute TestInterfaceGarbageCollected? testInterfaceGarbageCollectedOrNullAttribute; // [GarbageCollected]
- attribute TestInterfaceWillBeGarbageCollected testInterfaceWillBeGarbageCollectedAttribute; // [WillBeGarbageCollected]
- attribute TestInterfaceWillBeGarbageCollected? testInterfaceWillBeGarbageCollectedOrNullAttribute; // [WillBeGarbageCollected]
- // Private scripts
- [ImplementedInPrivateScript] void voidMethodImplementedInPrivateScript();
- [ImplementedInPrivateScript] short shortMethodImplementedInPrivateScript();
- [ImplementedInPrivateScript] short shortMethodWithShortArgumentImplementedInPrivateScript(short value);
- [ImplementedInPrivateScript] DOMString stringMethodWithStringArgumentImplementedInPrivateScript(DOMString value);
- [ImplementedInPrivateScript] Node nodeMethodWithNodeArgumentImplementedInPrivateScript(Node value);
- [ImplementedInPrivateScript] Node nodeMethodWithVariousArgumentsImplementedInPrivateScript(Document document, Node node, short value1, double value2, DOMString string);
- [ImplementedInPrivateScript] readonly attribute short readonlyShortAttribute;
- [ImplementedInPrivateScript] attribute short shortAttribute;
- [ImplementedInPrivateScript] attribute DOMString stringAttribute;
- [ImplementedInPrivateScript] attribute Node nodeAttribute;
- [OnlyExposedToPrivateScript] short methodImplementedInCPPForPrivateScriptOnly(short value1, short value2);
- [OnlyExposedToPrivateScript] attribute DOMString attributeImplementedInCPPForPrivateScriptOnly;
- [ImplementedInPrivateScript, OnlyExposedToPrivateScript] short methodForPrivateScriptOnly(short value1, short value2);
- [ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString attributeForPrivateScriptOnly;
- [ImplementedInPrivateScript] attribute TestEnum enumForPrivateScript;
-
- maplike<long, DOMStringOrDouble>;
+ maplike<[EnforceRange] long, DOMStringOrDouble>;
+ [RuntimeEnabled=FeatureName, CallWith=ScriptState, RaisesException, ImplementedAs=myMaplikeClear] boolean clear();
};
diff --git a/bindings/tests/idls/core/TestPartialInterface.idl b/bindings/tests/idls/core/TestPartialInterface.idl
deleted file mode 100644
index 0bc42ac..0000000
--- a/bindings/tests/idls/core/TestPartialInterface.idl
+++ /dev/null
@@ -1,59 +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.
- */
-
-enum PartialEnumType {
- "foo",
- "bar"
-};
-
-typedef DOMString PartialString;
-
-callback PartialCallbackType = void (PartialString value);
-[
- RuntimeEnabled=PartialFeatureName,
-] partial interface TestInterface {
- const unsigned short PARTIAL_UNSIGNED_SHORT = 0;
- const double PARTIAL_DOUBLE = 3.14;
-
- attribute long partialLongAttribute;
- static attribute long partialStaticLongAttribute;
- [CallWith=ExecutionContext] attribute long partialCallWithExecutionContextLongAttribute;
-
- void partialVoidMethod();
- static void partialStaticVoidMethod();
- void partialVoidMethodLongArg(long longArg);
- [CallWith=ExecutionContext, RaisesException] void partialCallWithExecutionContextRaisesExceptionVoidMethod();
-
- attribute PartialEnumType partialPartialEnumTypeAttribute;
- void partialVoidMethodPartialCallbackTypeArg(PartialCallbackType partialCallbackTypeArg);
-
- [ImplementedInPrivateScript] short shortMethodWithShortArgumentImplementedInPrivateScript(short value);
- [ImplementedInPrivateScript] attribute DOMString stringAttribute;
-};
diff --git a/bindings/tests/idls/core/TestPartialInterface2.idl b/bindings/tests/idls/core/TestPartialInterface2.idl
deleted file mode 100644
index 4bb8686..0000000
--- a/bindings/tests/idls/core/TestPartialInterface2.idl
+++ /dev/null
@@ -1,41 +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.
- */
-
-[
- ImplementedAs=TestPartialInterfaceImplementation, // Conflicts with default partial interface class name
-] partial interface TestInterface {
- const unsigned short PARTIAL2_UNSIGNED_SHORT = 0;
-
- attribute long partial2LongAttribute;
- static attribute long partial2StaticLongAttribute;
-
- void partial2VoidMethod();
- static void partial2StaticVoidMethod();
-};
diff --git a/bindings/tests/idls/core/TestSpecialOperations.idl b/bindings/tests/idls/core/TestSpecialOperations.idl
index 73c7c13..3bdc8a4 100644
--- a/bindings/tests/idls/core/TestSpecialOperations.idl
+++ b/bindings/tests/idls/core/TestSpecialOperations.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- OverrideBuiltins,
+ OverrideBuiltins
] interface TestSpecialOperations {
// [ImplementedAs], union return, nullability
// [OverrideBuiltins] affects named property operations
diff --git a/bindings/tests/idls/core/TestSpecialOperationsNotEnumerable.idl b/bindings/tests/idls/core/TestSpecialOperationsNotEnumerable.idl
index 0aed31b..2043b68 100644
--- a/bindings/tests/idls/core/TestSpecialOperationsNotEnumerable.idl
+++ b/bindings/tests/idls/core/TestSpecialOperationsNotEnumerable.idl
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+[LegacyUnenumerableNamedProperties]
interface TestSpecialOperationsNotEnumerable {
- [NotEnumerable] getter DOMString (unsigned long index);
- [NotEnumerable] getter DOMString (DOMString name);
+ // This getter without setter also checks that the property descriptor for
+ // indexed properties has [[Writable]] set to false.
+ getter DOMString (unsigned long index);
+ getter DOMString (DOMString name);
};
diff --git a/bindings/tests/idls/core/TestTypedefs.idl b/bindings/tests/idls/core/TestTypedefs.idl
index 9f3006e..58827ad 100644
--- a/bindings/tests/idls/core/TestTypedefs.idl
+++ b/bindings/tests/idls/core/TestTypedefs.idl
@@ -32,25 +32,33 @@
// as typedefs are resolved during IR construction (after parsing,
// before code generation), and thus the code generator never sees them.
+typedef boolean BooleanType;
typedef float Float;
typedef unsigned long long ULongLong;
+typedef [Clamp] long LongWithClamp;
typedef TestInterfaceEmpty TestInterfaceEmptyType;
-typedef long[] ArrayOfLongs;
+typedef sequence<long> LongSequence;
typedef DOMString String;
-typedef DOMString[] ArrayOfStrings;
+typedef FrozenArray<DOMString> FrozenStringArray;
typedef TestCallbackInterface TestCallbackInterfaceType;
typedef TestInterfaceConstructor T;
typedef (TestInterface or TestInterfaceEmpty) TestInterfaceOrTestInterfaceEmpty;
typedef (DOMString or double) DOMStringOrDouble;
+typedef record<ByteString, long> SomeRecordType;
+typedef record<USVString, TestObject> RecordWithOilpanValueType;
+typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) UnionWithRecord;
+typedef (Node or (sequence<long> or Event) or (XMLHttpRequest or DOMString)? or record<DOMString, (ByteString or NodeList)>) NestedUnionType;
+typedef (ULongLong or (BooleanType or TestCallbackInterfaceType)) UnionWithTypedef;
[
- Constructor(String stringArg),
+ Constructor(String stringArg)
] interface TestTypedefs {
attribute ULongLong uLongLongAttribute;
+ attribute LongWithClamp longWithClampAttribute;
attribute T tAttribute;
attribute DOMStringOrDouble? domStringOrDoubleOrNullAttribute;
- void voidMethodArrayOfLongsArg(optional ArrayOfLongs arrayOfLongsArg);
+ void voidMethodLongSequenceArg(optional LongSequence longSequenceArg);
void voidMethodFloatArgStringArg(Float floatArg, String stringArg);
void voidMethodTestCallbackInterfaceTypeArg(TestCallbackInterfaceType testCallbackInterfaceTypeArg);
@@ -59,6 +67,14 @@
TestInterfaceOrTestInterfaceEmpty testInterfaceOrTestInterfaceEmptyMethod();
DOMStringOrDouble domStringOrDoubleMethod();
- ArrayOfStrings arrayOfStringsMethodArrayOfStringsArg(ArrayOfStrings arrayOfStringsArg);
- String[] stringArrayMethodStringArrayArg(String[] stringArrayArg);
+ FrozenStringArray arrayOfStringsMethodArrayOfStringsArg(FrozenStringArray frozenStringArrayArg);
+
+ void methodTakingRecord(SomeRecordType arg);
+ void methodTakingOilpanValueRecord(RecordWithOilpanValueType arg);
+ double unionWithRecordMethod(UnionWithRecord arg);
+ record<DOMString, boolean> methodThatReturnsRecord();
+
+ void voidMethodNestedUnionType(NestedUnionType arg);
+
+ void voidMethodUnionWithTypedef(UnionWithTypedef arg);
};
diff --git a/bindings/tests/idls/core/Uint8ClampedArray.idl b/bindings/tests/idls/core/Uint8ClampedArray.idl
index 13f411c..024a206 100644
--- a/bindings/tests/idls/core/Uint8ClampedArray.idl
+++ b/bindings/tests/idls/core/Uint8ClampedArray.idl
@@ -5,6 +5,6 @@
// https://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
[
- ImplementedAs=TestUint8ClampedArray,
+ ImplementedAs=TestUint8ClampedArray
] interface Uint8ClampedArray : ArrayBufferView {
};
diff --git a/bindings/tests/idls/modules/TestInheritedLegacyUnenumerableNamedProperties.idl b/bindings/tests/idls/modules/TestInheritedLegacyUnenumerableNamedProperties.idl
new file mode 100644
index 0000000..137e7a2
--- /dev/null
+++ b/bindings/tests/idls/modules/TestInheritedLegacyUnenumerableNamedProperties.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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 file verifies that the [LegacyUnenumerableNamedProperties] extended
+// attribute is automatically inherited by all child interfaces.
+
+interface TestInheritedLegacyUnenumerableNamedProperties : TestSpecialOperationsNotEnumerable {
+ readonly attribute long longAttribute;
+
+ // The getter below should have been inherited (http://crbug.com/752877).
+ getter long (DOMString identifier);
+};
diff --git a/bindings/tests/idls/modules/TestInterface2Partial.idl b/bindings/tests/idls/modules/TestInterface2Partial.idl
new file mode 100644
index 0000000..34da9ce
--- /dev/null
+++ b/bindings/tests/idls/modules/TestInterface2Partial.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Regression test for https://crbug.com/603782: if the main interface is
+// declared in 'core', the alphabetically first partial interface in 'modules'
+// with a RuntimeEnabled will leak onto all of the other partial interfaces in
+// 'modules' that do not have an extended attributes section (i.e.,
+// TestInterface2Partial2.idl).
+//
+// This test ensures that TestInterface2Partial2 is NOT conditional on the
+// Interface2PartialFeatureName runtime flag.
+[
+ ImplementedAs=TestInterface2Partial,
+ RuntimeEnabled=Interface2PartialFeatureName
+]
+partial interface TestInterface2 {
+ void voidMethodPartial1(DOMString value);
+};
diff --git a/bindings/tests/idls/modules/TestInterface2Partial2.idl b/bindings/tests/idls/modules/TestInterface2Partial2.idl
new file mode 100644
index 0000000..1adc4af
--- /dev/null
+++ b/bindings/tests/idls/modules/TestInterface2Partial2.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Regression test for https://crbug.com/603782: see note in
+// TestInterface2Partial.idl. This test only works if there is *no*
+// RuntimeEnabled condition for this partial interface.
+[
+ ImplementedAs=TestInterface2Partial2
+] partial interface TestInterface2 {
+ void voidMethodPartial2(DOMString value);
+};
diff --git a/bindings/tests/idls/modules/TestInterface5.idl b/bindings/tests/idls/modules/TestInterface5.idl
index 7179186..8c1bd2e 100644
--- a/bindings/tests/idls/modules/TestInterface5.idl
+++ b/bindings/tests/idls/modules/TestInterface5.idl
@@ -32,15 +32,16 @@
// Also used as a target by TestObject
enum TestEnumModules { "EnumModulesValue1", "EnumModulesValue2" };
+callback VoidCallbackFunctionModules = void ();
[
+ ActiveScriptWrappable,
DependentLifetime,
Custom=LegacyCallAsFunction,
DoNotCheckConstants,
ImplementedAs=TestInterface5Implementation,
RuntimeEnabled=FeatureName,
- SetWrapperReferenceTo(TestInterface5 referencedName),
- Exposed=(Worker,Window),
+ Exposed=(Worker,Window)
] interface TestInterface5 : TestInterfaceEmpty {
// members needed to test [ImplementedAs], as this affect attribute
// configuration and method configuration
@@ -65,10 +66,12 @@
setter DOMString (unsigned long index, DOMString value);
deleter boolean (unsigned long index);
+ // iterable<V> needs a "length" property accompanying the indexed property
+ // operations above.
+ readonly attribute unsigned long length;
+
// Anonymous named property operations
getter DOMString (DOMString name);
- setter DOMString (DOMString name, DOMString value);
- deleter boolean (DOMString name);
[NotEnumerable] stringifier;
@@ -91,5 +94,9 @@
void voidMethodBooleanOrDOMStringArg((boolean or DOMString) arg);
void voidMethodDoubleOrDOMStringArg((double or DOMString) arg);
+ // Callback functions
+ void voidMethodVoidExperimentalCallbackFunction(VoidExperimentalCallbackFunction arg);
+ void voidMethodVoidCallbackFunctionModulesArg(VoidCallbackFunctionModules arg);
+
iterable<any>;
};
diff --git a/bindings/tests/idls/modules/TestInterfacePartial3.idl b/bindings/tests/idls/modules/TestInterfacePartial3.idl
new file mode 100644
index 0000000..a6507dc
--- /dev/null
+++ b/bindings/tests/idls/modules/TestInterfacePartial3.idl
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+[
+ ImplementedAs=TestInterfacePartial3Implementation
+] partial interface TestInterface {
+ const unsigned short PARTIAL3_UNSIGNED_SHORT = 0;
+
+ 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);
+ void partial2VoidTestEnumModulesRecordMethod(record<DOMString, TestEnumModules> arg);
+
+ [Unscopable] void unscopableVoidMethod();
+
+ // UnionWithTypedef is a typedef declared in core/TestTypedefs.idl.
+ UnionWithTypedef unionWithTypedefMethod();
+};
diff --git a/bindings/tests/idls/modules/TestInterfacePartial4.idl b/bindings/tests/idls/modules/TestInterfacePartial4.idl
new file mode 100644
index 0000000..86ee451
--- /dev/null
+++ b/bindings/tests/idls/modules/TestInterfacePartial4.idl
@@ -0,0 +1,20 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test for [OriginTrialEnabled] extended attribute applied to a partial
+// interface. This is separate from TestInterfacePartial, as the
+// [OriginTrialEnabled] attribute cannot be applied with [RuntimeEnabled].
+
+[
+ ImplementedAs=TestInterfacePartial4,
+ OriginTrialEnabled=OriginTrialPartialFeature // Conflicts with RuntimeEnabled
+] partial interface TestInterface {
+ const unsigned short PARTIAL4_UNSIGNED_SHORT = 4;
+
+ attribute long partial4LongAttribute;
+ static attribute long partial4StaticLongAttribute;
+
+ void partial4VoidMethod();
+ static void partial4StaticVoidMethod();
+};
diff --git a/bindings/tests/idls/modules/TestNotEnumerableNamedGetter.idl b/bindings/tests/idls/modules/TestNotEnumerableNamedGetter.idl
new file mode 100644
index 0000000..3be62aa
--- /dev/null
+++ b/bindings/tests/idls/modules/TestNotEnumerableNamedGetter.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Tests whether an interface that only supports named properties and has its
+// getter annotated with [NotEnumerable] works as expected.
+interface TestNotEnumerableNamedGetter {
+ [NotEnumerable] getter long (DOMString name);
+};
diff --git a/bindings/tests/idls/modules/TestPartialInterface3.idl b/bindings/tests/idls/modules/TestPartialInterface3.idl
deleted file mode 100644
index 353454e..0000000
--- a/bindings/tests/idls/modules/TestPartialInterface3.idl
+++ /dev/null
@@ -1,48 +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.
- */
-
-[
- ImplementedAs=TestPartialInterfaceImplementation3,
-] partial interface TestInterface {
- const unsigned short PARTIAL3_UNSIGNED_SHORT = 0;
-
- 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/bindings/tests/idls/modules/TestSubObject.idl b/bindings/tests/idls/modules/TestSubObject.idl
new file mode 100644
index 0000000..ecd19ad
--- /dev/null
+++ b/bindings/tests/idls/modules/TestSubObject.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+interface TestSubObject : TestObject {
+ [Unforgeable] attribute DOMString unforgeableStringAttribute;
+};
diff --git a/blink/tools/blinkpy/__init__.py b/blink/tools/blinkpy/__init__.py
new file mode 100644
index 0000000..a22a6ee
--- /dev/null
+++ b/blink/tools/blinkpy/__init__.py
@@ -0,0 +1,3 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
diff --git a/blink/tools/blinkpy/common/__init__.py b/blink/tools/blinkpy/common/__init__.py
new file mode 100644
index 0000000..a22a6ee
--- /dev/null
+++ b/blink/tools/blinkpy/common/__init__.py
@@ -0,0 +1,3 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
diff --git a/blink/tools/blinkpy/common/name_style_converter.py b/blink/tools/blinkpy/common/name_style_converter.py
new file mode 100644
index 0000000..a79b990
--- /dev/null
+++ b/blink/tools/blinkpy/common/name_style_converter.py
@@ -0,0 +1,128 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import
+
+import re
+
+SPECIAL_TOKENS = [
+ # This list should be sorted by length.
+ 'CString',
+ 'Float32',
+ 'Float64',
+ 'Base64',
+ 'IFrame',
+ 'Latin1',
+ 'PlugIn',
+ 'SQLite',
+ 'Uint16',
+ 'Uint32',
+ 'WebGL2',
+ 'ASCII',
+ 'CType',
+ 'DList',
+ 'Int16',
+ 'Int32',
+ 'MPath',
+ 'OList',
+ 'TSpan',
+ 'UList',
+ 'UTF16',
+ 'Uint8',
+ 'WebGL',
+ 'XPath',
+ 'ETC1',
+ 'HTML',
+ 'Int8',
+ 'S3TC',
+ 'SPv2',
+ 'UTF8',
+ 'API',
+ 'CSS',
+ 'DOM',
+ 'EXT',
+ 'RTC',
+ 'SVG',
+ '2D',
+ 'AX',
+ 'V0',
+ 'V8',
+]
+
+MATCHING_EXPRESSION = '((?:[A-Z][a-z]+)|[0-9]D?$)'
+
+
+class SmartTokenizer(object):
+ """Detects special cases that are not easily discernible without additional
+ knowledge, such as recognizing that in SVGSVGElement, the first two SVGs
+ are separate tokens, but WebGL is one token."""
+
+ def __init__(self, name):
+ self.remaining = name
+
+ def tokenize(self):
+ name = self.remaining
+ tokens = []
+ while len(name) > 0:
+ matched_token = None
+ for token in SPECIAL_TOKENS:
+ if name.startswith(token):
+ matched_token = token
+ break
+ if not matched_token:
+ match = re.search(MATCHING_EXPRESSION, name)
+ if not match:
+ matched_token = name
+ elif match.start(0) != 0:
+ matched_token = name[:match.start(0)]
+ else:
+ matched_token = match.group(0)
+ tokens.append(name[:len(matched_token)])
+ name = name[len(matched_token):]
+ return tokens
+
+
+class NameStyleConverter(object):
+ """Converts names from camelCase to various other styles.
+ """
+
+ def __init__(self, name):
+ self.tokens = self.tokenize(name)
+
+ def tokenize(self, name):
+ tokenizer = SmartTokenizer(name)
+ return tokenizer.tokenize()
+
+ def to_snake_case(self):
+ """Snake case is the file and variable name style per Google C++ Style
+ Guide:
+ https://google.github.io/styleguide/cppguide.html#Variable_Names
+
+ Also known as the hacker case.
+ https://en.wikipedia.org/wiki/Snake_case
+ """
+ return '_'.join([token.lower() for token in self.tokens])
+
+ def to_upper_camel_case(self):
+ """Upper-camel case is the class and function name style per
+ Google C++ Style Guide:
+ https://google.github.io/styleguide/cppguide.html#Function_Names
+
+ Also known as the PascalCase.
+ https://en.wikipedia.org/wiki/Camel_case.
+ """
+ return ''.join([token[0].upper() + token[1:] for token in self.tokens])
+
+ def to_macro_case(self):
+ """Macro case is the macro name style per Google C++ Style Guide:
+ https://google.github.io/styleguide/cppguide.html#Macro_Names
+ """
+ return '_'.join([token.upper() for token in self.tokens])
+
+ def to_all_cases(self):
+ return {
+ 'snake_case': self.to_snake_case(),
+ 'upper_camel_case': self.to_upper_camel_case(),
+ 'macro_case': self.to_macro_case(),
+ }
diff --git a/blink/tools/blinkpy/common/name_style_converter_test.py b/blink/tools/blinkpy/common/name_style_converter_test.py
new file mode 100644
index 0000000..e8bc11d
--- /dev/null
+++ b/blink/tools/blinkpy/common/name_style_converter_test.py
@@ -0,0 +1,178 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# pylint: disable=import-error,print-statement,relative-import,protected-access
+
+"""Unit tests for name_style_converter.py."""
+
+import unittest
+
+from name_style_converter import NameStyleConverter
+from name_style_converter import SmartTokenizer
+
+
+class SmartTokenizerTest(unittest.TestCase):
+ def test_simple_cases(self):
+ tokenizer = SmartTokenizer('foo')
+ self.assertEqual(tokenizer.tokenize(), ['foo'])
+
+ tokenizer = SmartTokenizer('fooBar')
+ self.assertEqual(tokenizer.tokenize(), ['foo', 'Bar'])
+
+ tokenizer = SmartTokenizer('fooBarBaz')
+ self.assertEqual(tokenizer.tokenize(), ['foo', 'Bar', 'Baz'])
+
+ tokenizer = SmartTokenizer('Baz')
+ self.assertEqual(tokenizer.tokenize(), ['Baz'])
+
+ tokenizer = SmartTokenizer('')
+ self.assertEqual(tokenizer.tokenize(), [])
+
+ tokenizer = SmartTokenizer('FOO')
+ self.assertEqual(tokenizer.tokenize(), ['FOO'])
+
+ tokenizer = SmartTokenizer('foo2')
+ self.assertEqual(tokenizer.tokenize(), ['foo', '2'])
+
+ def test_tricky_cases(self):
+ tokenizer = SmartTokenizer('XMLHttpRequest')
+ self.assertEqual(tokenizer.tokenize(), ['XML', 'Http', 'Request'])
+
+ tokenizer = SmartTokenizer('HTMLElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'Element'])
+
+ tokenizer = SmartTokenizer('WebGLRenderingContext')
+ self.assertEqual(tokenizer.tokenize(),
+ ['WebGL', 'Rendering', 'Context'])
+
+ tokenizer = SmartTokenizer('CanvasRenderingContext2D')
+ self.assertEqual(tokenizer.tokenize(),
+ ['Canvas', 'Rendering', 'Context', '2D'])
+ tokenizer = SmartTokenizer('CanvasRenderingContext2DAPITest')
+ self.assertEqual(tokenizer.tokenize(),
+ ['Canvas', 'Rendering', 'Context', '2D', 'API', 'Test'])
+
+ tokenizer = SmartTokenizer('SVGSVGElement')
+ self.assertEqual(tokenizer.tokenize(), ['SVG', 'SVG', 'Element'])
+
+ tokenizer = SmartTokenizer('CanvasRenderingContext2D')
+ self.assertEqual(tokenizer.tokenize(), ['Canvas', 'Rendering', 'Context', '2D'])
+
+ tokenizer = SmartTokenizer('CSSURLImageValue')
+ self.assertEqual(tokenizer.tokenize(), ['CSS', 'URL', 'Image', 'Value'])
+ tokenizer = SmartTokenizer('CSSPropertyAPID')
+ self.assertEqual(tokenizer.tokenize(), ['CSS', 'Property', 'API', 'D'])
+ tokenizer = SmartTokenizer('AXARIAGridCell')
+ self.assertEqual(tokenizer.tokenize(), ['AX', 'ARIA', 'Grid', 'Cell'])
+
+ tokenizer = SmartTokenizer('CDATASection')
+ self.assertEqual(tokenizer.tokenize(), ['CDATA', 'Section'])
+
+ tokenizer = SmartTokenizer('ASCIICType')
+ self.assertEqual(tokenizer.tokenize(), ['ASCII', 'CType'])
+ tokenizer = SmartTokenizer('CString')
+ self.assertEqual(tokenizer.tokenize(), ['CString'])
+
+ tokenizer = SmartTokenizer('HTMLDListElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'DList', 'Element'])
+ tokenizer = SmartTokenizer('HTMLOListElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'OList', 'Element'])
+ tokenizer = SmartTokenizer('HTMLIFrameElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'IFrame', 'Element'])
+ tokenizer = SmartTokenizer('HTMLPlugInElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'PlugIn', 'Element'])
+
+ # No special handling for OptGroup, FieldSet, and TextArea.
+ tokenizer = SmartTokenizer('HTMLOptGroupElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'Opt', 'Group', 'Element'])
+ tokenizer = SmartTokenizer('HTMLFieldSetElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'Field', 'Set', 'Element'])
+ tokenizer = SmartTokenizer('HTMLTextAreaElement')
+ self.assertEqual(tokenizer.tokenize(), ['HTML', 'Text', 'Area', 'Element'])
+
+ tokenizer = SmartTokenizer('Path2D')
+ self.assertEqual(tokenizer.tokenize(), ['Path', '2D'])
+ tokenizer = SmartTokenizer('Point2D')
+ self.assertEqual(tokenizer.tokenize(), ['Point', '2D'])
+ tokenizer = SmartTokenizer('CanvasRenderingContext2DState')
+ self.assertEqual(tokenizer.tokenize(), ['Canvas', 'Rendering', 'Context', '2D', 'State'])
+
+ tokenizer = SmartTokenizer('RTCDTMFSender')
+ self.assertEqual(tokenizer.tokenize(), ['RTC', 'DTMF', 'Sender'])
+
+ tokenizer = SmartTokenizer('WebGLCompressedTextureS3TCsRGB')
+ self.assertEqual(tokenizer.tokenize(), ['WebGL', 'Compressed', 'Texture', 'S3TC', 'sRGB'])
+ tokenizer = SmartTokenizer('WebGL2CompressedTextureETC1')
+ self.assertEqual(tokenizer.tokenize(), ['WebGL2', 'Compressed', 'Texture', 'ETC1'])
+ tokenizer = SmartTokenizer('EXTsRGB')
+ self.assertEqual(tokenizer.tokenize(), ['EXT', 'sRGB'])
+
+ tokenizer = SmartTokenizer('SVGFEBlendElement')
+ self.assertEqual(tokenizer.tokenize(), ['SVG', 'FE', 'Blend', 'Element'])
+ tokenizer = SmartTokenizer('SVGMPathElement')
+ self.assertEqual(tokenizer.tokenize(), ['SVG', 'MPath', 'Element'])
+ tokenizer = SmartTokenizer('SVGTSpanElement')
+ self.assertEqual(tokenizer.tokenize(), ['SVG', 'TSpan', 'Element'])
+ tokenizer = SmartTokenizer('SVGURIReference')
+ self.assertEqual(tokenizer.tokenize(), ['SVG', 'URI', 'Reference'])
+
+ tokenizer = SmartTokenizer('UTF16TextIterator')
+ self.assertEqual(tokenizer.tokenize(), ['UTF16', 'Text', 'Iterator'])
+ tokenizer = SmartTokenizer('UTF8Decoder')
+ self.assertEqual(tokenizer.tokenize(), ['UTF8', 'Decoder'])
+ tokenizer = SmartTokenizer('Uint8Array')
+ self.assertEqual(tokenizer.tokenize(), ['Uint8', 'Array'])
+ tokenizer = SmartTokenizer('DOMWindowBase64')
+ self.assertEqual(tokenizer.tokenize(), ['DOM', 'Window', 'Base64'])
+ tokenizer = SmartTokenizer('TextCodecLatin1')
+ self.assertEqual(tokenizer.tokenize(), ['Text', 'Codec', 'Latin1'])
+ tokenizer = SmartTokenizer('V8BindingForCore')
+ self.assertEqual(tokenizer.tokenize(), ['V8', 'Binding', 'For', 'Core'])
+ tokenizer = SmartTokenizer('V8DOMRect')
+ self.assertEqual(tokenizer.tokenize(), ['V8', 'DOM', 'Rect'])
+
+ tokenizer = SmartTokenizer('V0InsertionPoint')
+ self.assertEqual(tokenizer.tokenize(), ['V0', 'Insertion', 'Point'])
+ tokenizer = SmartTokenizer('ShadowDOMV0Test')
+ self.assertEqual(tokenizer.tokenize(), ['Shadow', 'DOM', 'V0', 'Test'])
+ tokenizer = SmartTokenizer('ElementShadowV0')
+ self.assertEqual(tokenizer.tokenize(), ['Element', 'Shadow', 'V0'])
+ tokenizer = SmartTokenizer('StubChromeClientForSPv2')
+ self.assertEqual(tokenizer.tokenize(), ['Stub', 'Chrome', 'Client', 'For', 'SPv2'])
+
+ tokenizer = SmartTokenizer('SQLiteAuthorizer')
+ self.assertEqual(tokenizer.tokenize(), ['SQLite', 'Authorizer'])
+ tokenizer = SmartTokenizer('XPathEvaluator')
+ self.assertEqual(tokenizer.tokenize(), ['XPath', 'Evaluator'])
+
+ tokenizer = SmartTokenizer('IsXHTMLDocument')
+ self.assertEqual(tokenizer.tokenize(), ['Is', 'XHTML', 'Document'])
+
+ tokenizer = SmartTokenizer('Animation.idl')
+ self.assertEqual(tokenizer.tokenize(), ['Animation', '.idl'])
+
+
+class NameStyleConverterTest(unittest.TestCase):
+ def test_snake_case(self):
+ converter = NameStyleConverter('HTMLElement')
+ self.assertEqual(converter.to_snake_case(), 'html_element')
+
+ def test_upper_camel_case(self):
+ converter = NameStyleConverter('someSuperThing')
+ self.assertEqual(converter.to_upper_camel_case(), 'SomeSuperThing')
+
+ converter = NameStyleConverter('SVGElement')
+ self.assertEqual(converter.to_upper_camel_case(), 'SVGElement')
+
+ def test_macro_case(self):
+ converter = NameStyleConverter('WebGLBaz2D')
+ self.assertEqual(converter.to_macro_case(), 'WEBGL_BAZ_2D')
+
+ def test_all_cases(self):
+ converter = NameStyleConverter('SVGScriptElement')
+ self.assertEqual(converter.to_all_cases(), {
+ 'snake_case': 'svg_script_element',
+ 'upper_camel_case': 'SVGScriptElement',
+ 'macro_case': 'SVG_SCRIPT_ELEMENT',
+ })
diff --git a/blink/tools/compile_devtools_frontend.py b/blink/tools/compile_devtools_frontend.py
new file mode 100644
index 0000000..7c6f8de
--- /dev/null
+++ b/blink/tools/compile_devtools_frontend.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env vpython
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Compile DevTools frontend code with Closure compiler.
+
+This script wraps devtools/scripts/compile_frontend.py.
+DevTools bot kicks this script.
+"""
+
+import os
+import sys
+
+sys.path.append(os.path.join(
+ os.path.dirname(__file__), '..', '..', 'WebKit', 'Source', 'devtools', 'scripts'))
+import compile_frontend
+
+if __name__ == '__main__':
+ sys.exit(compile_frontend.main())
diff --git a/blink/tools/move_blink_source.py b/blink/tools/move_blink_source.py
new file mode 100644
index 0000000..2b59693
--- /dev/null
+++ b/blink/tools/move_blink_source.py
@@ -0,0 +1,529 @@
+#!/usr/bin/env vpython
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Tool to move Blink source from third_party/WebKit to third_party/blink.
+
+See https://docs.google.com/document/d/1l3aPv1Wx__SpRkdOhvJz8ciEGigNT3wFKv78XiuW0Tw/edit?usp=sharing#heading=h.o225wrxp242h
+for the details.
+"""
+
+import argparse
+import logging
+import os
+import re
+import sys
+from functools import partial
+
+# Without abspath(), PathFinder can't find chromium_base correctly.
+sys.path.append(os.path.abspath(
+ os.path.join(os.path.dirname(__file__), '..', '..', '..',
+ 'third_party', 'WebKit', 'Tools', 'Scripts')))
+from blinkpy.common.name_style_converter import NameStyleConverter
+from plan_blink_move import plan_blink_move
+from plan_blink_move import relative_dest
+from webkitpy.common.checkout.git import Git
+from webkitpy.common.path_finder import get_chromium_src_dir
+from webkitpy.common.path_finder import get_scripts_dir
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.filesystem import FileSystem
+
+_log = logging.getLogger('move_blink_source')
+
+
+class FileType(object):
+ NONE = 0
+ BUILD = 1
+ BLINK_BUILD = 2
+ OWNERS = 3
+ DEPS = 4
+ MOJOM = 5
+ TYPEMAP = 6
+ BLINK_BUILD_PY = 7
+ LAYOUT_TESTS_WITH_MOJOM = 8
+
+ @staticmethod
+ def detect(path):
+ slash_dir, basename = os.path.split(path)
+ slash_dir = slash_dir.replace(os.path.sep, '/')
+ if basename == 'DEPS':
+ return FileType.DEPS
+ if basename == 'OWNERS':
+ return FileType.OWNERS
+ if basename.endswith('.mojom'):
+ return FileType.MOJOM
+ if basename.endswith('.typemap'):
+ return FileType.TYPEMAP
+ if basename.endswith('.py') and 'third_party/WebKit/Source/build' in slash_dir:
+ return FileType.BLINK_BUILD_PY
+ if basename.endswith(('.gn', '.gni')):
+ if 'third_party/WebKit' in path or 'third_party/blink' in slash_dir:
+ return FileType.BLINK_BUILD
+ if 'third_party' in slash_dir:
+ return FileType.NONE
+ return FileType.BUILD
+ if basename.endswith('.html') and re.search(
+ r'third_party/WebKit/LayoutTests/(geolocation-api|installedapp|' +
+ r'media/mediasession|payments|presentation|webshare)', slash_dir):
+ return FileType.LAYOUT_TESTS_WITH_MOJOM
+ return FileType.NONE
+
+
+class MoveBlinkSource(object):
+
+ def __init__(self, fs, options, repo_root):
+ self._fs = fs
+ self._options = options
+ _log.debug(options)
+ self._repo_root = repo_root
+
+ # The following fields are initialized in _create_basename_maps.
+ self._basename_map = None
+ self._basename_re = None
+ self._idl_generated_impl_headers = None
+ # _checked_in_header_re is used to distinguish checked-in header files
+ # and generated header files.
+ self._checked_in_header_re = None
+
+ self._updated_files = []
+
+ def update(self):
+ _log.info('Planning renaming ...')
+ file_pairs = plan_blink_move(self._fs, [])
+ _log.info('Will move %d files', len(file_pairs))
+
+ self._create_basename_maps(file_pairs)
+ dirs = self._update_file_content()
+
+ # Updates #includes in files in directories with updated DEPS +
+ # third_party/WebKit/{Source,common,public}.
+ self._append_unless_upper_dir_exists(dirs, self._fs.join(self._repo_root, 'third_party', 'WebKit', 'Source'))
+ self._append_unless_upper_dir_exists(dirs, self._fs.join(self._repo_root, 'third_party', 'WebKit', 'common'))
+ self._append_unless_upper_dir_exists(dirs, self._fs.join(self._repo_root, 'third_party', 'WebKit', 'public'))
+ self._append_unless_upper_dir_exists(dirs, self._fs.join(self._repo_root, 'mojo', 'public', 'tools',
+ 'bindings', 'generators', 'cpp_templates'))
+ self._update_cpp_includes_in_directories(dirs)
+
+ # Content update for individual files.
+ # The following is a list of tuples.
+ # Tuple: (<file path relative to repo root>, [replacement commands])
+ # Command: a callable object, or
+ # a tuple of (<original string>, <new string>).
+ file_replacement_list = [
+ ('DEPS',
+ [('src/third_party/WebKit/Source/devtools',
+ 'src/third_party/blink/renderer/devtools')]),
+ ('WATCHLISTS',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer'),
+ ('third_party/WebKit/public', 'third_party/blink/renderer/public')]),
+ ('build/check_gn_headers_whitelist.txt',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer'),
+ ('third_party/WebKit/public', 'third_party/blink/renderer/public'),
+ self._update_basename]),
+ ('testing/buildbot/gn_isolate_map.pyl',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('third_party/WebKit/Source/BUILD.gn',
+ [('$root_gen_dir/third_party/WebKit',
+ '$root_gen_dir/third_party/blink/renderer')]),
+ ('third_party/WebKit/Source/config.gni',
+ [('snake_case_source_files = false',
+ 'snake_case_source_files = true')]),
+ ('third_party/WebKit/Source/core/css/CSSProperties.json5',
+ [self._update_basename]),
+ ('third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5',
+ [self._update_basename]),
+ ('third_party/WebKit/Source/core/css/ComputedStyleFieldAliases.json5',
+ [self._update_basename]),
+ ('third_party/WebKit/Source/core/html/parser/create-html-entity-table',
+ [self._update_basename]),
+ ('third_party/WebKit/Source/core/inspector/inspector_protocol_config.json',
+ [self._update_basename]),
+ ('third_party/WebKit/Source/core/probe/CoreProbes.json5',
+ [self._update_basename]),
+ ('third_party/WebKit/Source/core/testing/InternalSettings.h',
+ [('InternalSettingsGenerated.h', 'internal_settings_generated.h')]),
+ ('third_party/WebKit/Source/core/testing/Internals.cpp',
+ [('InternalRuntimeFlags.h', 'internal_runtime_flags.h')]),
+ ('third_party/WebKit/Source/platform/probe/PlatformProbes.json5',
+ [self._update_basename]),
+ ('third_party/WebKit/public/BUILD.gn',
+ [('$root_gen_dir/third_party/WebKit',
+ '$root_gen_dir/third_party/blink/renderer')]),
+ ('third_party/WebKit/public/blink_resources.grd',
+ [('../Source/', '../')]),
+ ('tools/android/eclipse/.classpath',
+ [('third_party/WebKit/public', 'third_party/blink/renderer/public')]),
+ ('tools/android/loading/cloud/backend/deploy.sh',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('tools/android/loading/emulation_unittest.py',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('tools/android/loading/options.py',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('tools/android/loading/request_track.py',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('tools/gritsettings/resource_ids',
+ [('third_party/WebKit/public', 'third_party/blink/renderer/public'),
+ ('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('tools/metrics/actions/extract_actions.py',
+ [('third_party/WebKit/Source', 'third_party/blink/renderer')]),
+ ('tools/metrics/histograms/update_editor_commands.py',
+ [('third_party/WebKit/Source/core/editing/EditorCommand.cpp',
+ 'third_party/blink/renderer/core/editing/editor_command.cc')]),
+ ('tools/metrics/histograms/update_use_counter_css.py',
+ [('third_party/WebKit/Source/core/frame/UseCounter.cpp',
+ 'third_party/blink/renderer/core/frame/use_counter.cc')]),
+ ('tools/metrics/histograms/update_use_counter_feature_enum.py',
+ [('third_party/WebKit/public', 'third_party/blink/renderer/public')]),
+ ]
+ for file_path, replacement_list in file_replacement_list:
+ self._update_single_file_content(file_path, replacement_list, should_write=self._options.run)
+
+ if self._options.run:
+ _log.info('Formatting updated %d files ...', len(self._updated_files))
+ git = Git(cwd=self._repo_root)
+ # |git cl format| can't handle too many files at once.
+ while len(self._updated_files) > 0:
+ end_index = 100
+ if end_index > len(self._updated_files):
+ end_index = len(self._updated_files)
+ git.run(['cl', 'format'] + self._updated_files[:end_index])
+ self._updated_files = self._updated_files[end_index:]
+
+ _log.info('Make a local commit ...')
+ git.commit_locally_with_message("""The Great Blink mv for source files, part 1.
+
+Update file contents without moving files.
+
+Bug: 768828
+""")
+
+ def move(self):
+ _log.info('Planning renaming ...')
+ file_pairs = plan_blink_move(self._fs, [])
+ _log.info('Will move %d files', len(file_pairs))
+
+ git = Git(cwd=self._repo_root)
+ for i, (src, dest) in enumerate(file_pairs):
+ src_from_repo = self._fs.join('third_party', 'WebKit', src)
+ dest_from_repo = self._fs.join('third_party', 'blink', dest)
+ self._fs.maybe_make_directory(self._repo_root, 'third_party', 'blink', self._fs.dirname(dest))
+ if self._options.run_git:
+ if git.exists(src_from_repo):
+ git.move(src_from_repo, dest_from_repo)
+ _log.info('[%d/%d] Git moved %s', i + 1, len(file_pairs), src)
+ else:
+ _log.info('%s is not in the repository', src)
+ else:
+ self._fs.move(self._fs.join(self._repo_root, src_from_repo),
+ self._fs.join(self._repo_root, dest_from_repo))
+ _log.info('[%d/%d] Moved %s', i + 1, len(file_pairs), src)
+ self._update_single_file_content(
+ 'build/get_landmines.py',
+ [('\ndef main', ' print \'The Great Blink mv for source files (crbug.com/768828)\'\n\ndef main')])
+
+ _log.info('Run run-bindings-tests ...')
+ Executive().run_command(['python',
+ self._fs.join(get_scripts_dir(), 'run-bindings-tests'),
+ '--reset-results'],
+ cwd=self._repo_root)
+
+ if self._options.run_git:
+ _log.info('Make a local commit ...')
+ git.commit_locally_with_message("""The Great Blink mv for source files, part 2.
+
+Move and rename files.
+
+Bug: 768828
+""")
+
+ def _create_basename_maps(self, file_pairs):
+ basename_map = {}
+ # Generated inspector/protocol/* contains a lot of names duplicated with
+ # checked-in core files. We don't want to rename them, and don't want to
+ # replace them in BUILD.gn and #include accidentally.
+ pattern = r'(?<!inspector/protocol/)\b('
+ idl_headers = set()
+ header_pattern = r'(?<!inspector/protocol/)\b('
+ for source, dest in file_pairs:
+ _, source_base = self._fs.split(source)
+ _, dest_base = self._fs.split(dest)
+ # ConditionalFeaturesForCore.h in bindings/tests/results/modules/
+ # confuses generated/checked-in detection in _replace_include_path().
+ if 'bindings/tests' in source.replace('\\', '/'):
+ continue
+ if source_base.endswith('.h'):
+ header_pattern += re.escape(source_base) + '|'
+ if source_base == dest_base:
+ continue
+ basename_map[source_base] = dest_base
+ pattern += re.escape(source_base) + '|'
+ # IDL sometimes generates implementation files as well as
+ # binding files. We'd like to update #includes for such files.
+ if source_base.endswith('.idl'):
+ source_header = source_base.replace('.idl', '.h')
+ basename_map[source_header] = dest_base.replace('.idl', '.h')
+ pattern += re.escape(source_header) + '|'
+ idl_headers.add(source_header)
+ _log.info('Rename %d files for snake_case', len(basename_map))
+ self._basename_map = basename_map
+ self._basename_re = re.compile(pattern[0:len(pattern) - 1] + ')(?=["\']|$)')
+ self._idl_generated_impl_headers = idl_headers
+ self._checked_in_header_re = re.compile(header_pattern[0:len(header_pattern) - 1] + ')$')
+
+ def _shorten_path(self, path):
+ if path.startswith(self._repo_root):
+ return path[len(self._repo_root) + 1:]
+ return path
+
+ @staticmethod
+ def _filter_file(fs, dirname, basename):
+ return FileType.detect(fs.join(dirname, basename)) != FileType.NONE
+
+ def _update_build(self, content):
+ content = content.replace('//third_party/WebKit/Source', '//third_party/blink/renderer')
+ content = content.replace('//third_party/WebKit/common', '//third_party/blink/common')
+ content = content.replace('//third_party/WebKit/public', '//third_party/blink/renderer/public')
+ # export_header_blink exists outside of Blink too.
+ content = content.replace('export_header_blink = "third_party/WebKit/public/platform/WebCommon.h"',
+ 'export_header_blink = "third_party/blink/renderer/public/platform/web_common.h"')
+ return content
+
+ def _update_blink_build(self, content):
+ content = self._update_build(content)
+
+ # Update visibility=[...]
+ content = content.replace('//third_party/WebKit/*', '//third_party/blink/*')
+ content = content.replace('//third_party/WebKit/Source/*', '//third_party/blink/renderer/*')
+ content = content.replace('//third_party/WebKit/public/*', '//third_party/blink/renderer/public/*')
+
+ return self._update_basename(content)
+
+ def _update_owners(self, content):
+ content = content.replace('//third_party/WebKit/Source', '//third_party/blink/renderer')
+ content = content.replace('//third_party/WebKit/common', '//third_party/blink/common')
+ content = content.replace('//third_party/WebKit/public', '//third_party/blink/renderer/public')
+ return content
+
+ def _update_deps(self, content):
+ original_content = content
+ content = content.replace('third_party/WebKit/Source', 'third_party/blink/renderer')
+ content = content.replace('third_party/WebKit/common', 'third_party/blink/common')
+ content = content.replace('third_party/WebKit/public', 'third_party/blink/renderer/public')
+ content = content.replace('third_party/WebKit', 'third_party/blink')
+ if original_content == content:
+ return content
+ return self._update_basename(content)
+
+ def _update_mojom(self, content):
+ content = content.replace('third_party/WebKit/public', 'third_party/blink/renderer/public')
+ return content
+
+ def _update_typemap(self, content):
+ content = content.replace('//third_party/WebKit/Source', '//third_party/blink/renderer')
+ content = content.replace('//third_party/WebKit/common', '//third_party/blink/common')
+ content = content.replace('//third_party/WebKit/public', '//third_party/blink/renderer/public')
+ return self._update_basename(content)
+
+ def _update_blink_build_py(self, content):
+ # We don't prepend 'third_party/blink/renderer/' to matched basenames
+ # because it won't affect build and manual update after the great mv is
+ # enough.
+ return self._update_basename(content)
+
+ def _update_layout_tests(self, content):
+ return content.replace('file:///gen/third_party/WebKit/', 'file:///gen/third_party/blink/renderer/')
+
+ def _update_basename(self, content):
+ return self._basename_re.sub(lambda match: self._basename_map[match.group(1)], content)
+
+ @staticmethod
+ def _append_unless_upper_dir_exists(dirs, new_dir):
+ for i in range(0, len(dirs)):
+ if new_dir.startswith(dirs[i]):
+ return
+ if dirs[i].startswith(new_dir):
+ dirs[i] = new_dir
+ return
+ dirs.append(new_dir)
+
+ def _update_file_content(self):
+ _log.info('Find *.gn, *.mojom, *.py, *.typemap, DEPS, and OWNERS ...')
+ files = self._fs.files_under(
+ self._repo_root, dirs_to_skip=['.git', 'out'], file_filter=self._filter_file)
+ _log.info('Scan contents of %d files ...', len(files))
+ updated_deps_dirs = []
+ for file_path in files:
+ file_type = FileType.detect(file_path)
+ original_content = self._fs.read_text_file(file_path)
+ content = original_content
+ if file_type == FileType.BUILD:
+ content = self._update_build(content)
+ elif file_type == FileType.BLINK_BUILD:
+ content = self._update_blink_build(content)
+ elif file_type == FileType.OWNERS:
+ content = self._update_owners(content)
+ elif file_type == FileType.DEPS:
+ if self._fs.dirname(file_path) == self._repo_root:
+ _log.info("Skip //DEPS")
+ continue
+ content = self._update_deps(content)
+ elif file_type == FileType.MOJOM:
+ content = self._update_mojom(content)
+ elif file_type == FileType.TYPEMAP:
+ content = self._update_typemap(content)
+ elif file_type == FileType.BLINK_BUILD_PY:
+ content = self._update_blink_build_py(content)
+ elif file_type == FileType.LAYOUT_TESTS_WITH_MOJOM:
+ content = self._update_layout_tests(content)
+
+ if original_content == content:
+ continue
+ if self._options.run:
+ self._fs.write_text_file(file_path, content)
+ self._updated_files.append(file_path)
+ if file_type == FileType.DEPS:
+ self._append_unless_upper_dir_exists(updated_deps_dirs, self._fs.dirname(file_path))
+ _log.info('Updated %s', self._shorten_path(file_path))
+ return updated_deps_dirs
+
+ def _update_cpp_includes_in_directories(self, dirs):
+ for dirname in dirs:
+ _log.info('Processing #include in %s ...', self._shorten_path(dirname))
+ files = self._fs.files_under(
+ dirname, file_filter=lambda fs, _, basename: basename.endswith(
+ ('.h', '.cc', '.cpp', '.mm', '.cc.tmpl', '.cpp.tmpl',
+ '.h.tmpl', 'XPathGrammar.y', '.gperf')))
+ for file_path in files:
+ original_content = self._fs.read_text_file(file_path)
+
+ content = self._update_cpp_includes(original_content)
+ if file_path.endswith('.h') and '/third_party/WebKit/public/' in file_path.replace('\\', '/'):
+ content = self._update_basename_only_includes(content, file_path)
+ if file_path.endswith('.h') and '/third_party/WebKit/' in file_path.replace('\\', '/'):
+ content = self._update_include_guard(content, file_path)
+
+ if original_content == content:
+ continue
+ if self._options.run:
+ self._fs.write_text_file(file_path, content)
+ self._updated_files.append(file_path)
+ _log.info('Updated %s', self._shorten_path(file_path))
+
+ def _replace_include_path(self, match):
+ include_or_import = match.group(1)
+ path = match.group(2)
+
+ # If |path| starts with 'third_party/WebKit', we should adjust the
+ # directory name for third_party/blink, and replace its basename by
+ # self._basename_map.
+ #
+ # If |path| starts with a Blink-internal directory such as bindings,
+ # core, modules, platform, public, it refers to a checked-in file, or a
+ # generated file. For the former, we should add
+ # 'third_party/blink/renderer/' and replace the basename. For the
+ # latter, we should update the basename for a name mapped from an IDL
+ # renaming, and should not add 'third_party/blink/renderer'.
+
+ if path.startswith('third_party/WebKit'):
+ path = path.replace('third_party/WebKit/Source', 'third_party/blink/renderer')
+ path = path.replace('third_party/WebKit/common', 'third_party/blink/common')
+ path = path.replace('third_party/WebKit/public', 'third_party/blink/renderer/public')
+ path = self._update_basename(path)
+ return '#%s "%s"' % (include_or_import, path)
+
+ match = self._checked_in_header_re.search(path)
+ if match:
+ if match.group(1) in self._basename_map:
+ path = 'third_party/blink/renderer/' + path[:match.start(1)] + self._basename_map[match.group(1)]
+ else:
+ path = 'third_party/blink/renderer/' + path
+ elif 'core/inspector/protocol/' not in path:
+ basename_start = path.rfind('/') + 1
+ basename = path[basename_start:]
+ if basename in self._idl_generated_impl_headers:
+ path = path[:basename_start] + self._basename_map[basename]
+ elif basename.startswith('V8'):
+ path = path[:basename_start] + NameStyleConverter(basename[:len(basename) - 2]).to_snake_case() + '.h'
+ return '#%s "%s"' % (include_or_import, path)
+
+ def _update_cpp_includes(self, content):
+ pattern = re.compile(r'#(include|import)\s+"((bindings|core|modules|platform|public|' +
+ r'third_party/WebKit/(Source|common|public))/[-_\w/.]+)"')
+ return pattern.sub(self._replace_include_path, content)
+
+ def _replace_basename_only_include(self, subdir, source_path, match):
+ source_basename = match.group(1)
+ if source_basename in self._basename_map:
+ return '#include "third_party/blink/renderer/public/%s/%s"' % (subdir, self._basename_map[source_basename])
+ _log.warning('Basename-only %s in %s', match.group(0), self._shorten_path(source_path))
+ return match.group(0)
+
+ def _update_basename_only_includes(self, content, source_path):
+ if not source_path.endswith('.h') or '/third_party/WebKit/public/' not in source_path.replace('\\', '/'):
+ return
+ # In public/ header files, we should replace |#include "WebFoo.h"|
+ # with |#include "third_party/blink/renderer/public/platform-or-web/web_foo.h"|
+ subdir = self._fs.basename(self._fs.dirname(source_path))
+ # subdir is 'web' or 'platform'.
+ return re.sub(r'#include\s+"(\w+\.h)"',
+ partial(self._replace_basename_only_include, subdir, source_path), content)
+
+ def _update_include_guard(self, content, source_path):
+ current_guard = re.sub(r'[.]', '_', self._fs.basename(source_path))
+ new_path = relative_dest(self._fs, self._fs.relpath(
+ source_path, start=self._fs.join(self._repo_root, 'third_party', 'WebKit')))
+ new_guard = 'THIRD_PARTY_BLINK_' + re.sub(r'[\\/.]', '_', new_path.upper()) + '_'
+ content = re.sub(r'#ifndef\s+(WTF_)?' + current_guard, '#ifndef ' + new_guard, content);
+ content = re.sub(r'#define\s+(WTF_)?' + current_guard, '#define ' + new_guard, content);
+ content = re.sub(r'#endif\s+//\s+(WTF_)?' + current_guard, '#endif // ' + new_guard, content);
+ return content
+
+ def _update_single_file_content(self, file_path, replace_list, should_write=True):
+ full_path = self._fs.join(self._repo_root, file_path)
+ original_content = self._fs.read_text_file(full_path)
+ content = original_content
+ for command in replace_list:
+ if isinstance(command, tuple):
+ src, dest = command
+ content = content.replace(src, dest)
+ elif callable(command):
+ content = command(content)
+ else:
+ raise TypeError('A tuple or a function is expected.')
+ if content != original_content:
+ if should_write:
+ self._fs.write_text_file(full_path, content)
+ self._updated_files.append(full_path)
+ _log.info('Updated %s', file_path)
+ else:
+ _log.warning('%s does not contain specified source strings.', file_path)
+
+
+def main():
+ logging.basicConfig(level=logging.DEBUG,
+ format='[%(asctime)s %(levelname)s %(name)s] %(message)s',
+ datefmt='%H:%M:%S')
+ parser = argparse.ArgumentParser(description='Blink source mover')
+ sub_parsers = parser.add_subparsers()
+
+ update_parser = sub_parsers.add_parser('update')
+ update_parser.set_defaults(command='update')
+ update_parser.add_argument('--run', dest='run', action='store_true',
+ help='Update file contents')
+
+ move_parser = sub_parsers.add_parser('move')
+ move_parser.set_defaults(command='move')
+ move_parser.add_argument('--git', dest='run_git', action='store_true',
+ help='Run |git mv| command instead of |mv|.')
+
+ options = parser.parse_args()
+ mover = MoveBlinkSource(FileSystem(), options, get_chromium_src_dir())
+ if options.command == 'update':
+ mover.update()
+ elif options.command == 'move':
+ mover.move()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/blink/tools/plan_blink_move.py b/blink/tools/plan_blink_move.py
new file mode 100644
index 0000000..3a2b59d
--- /dev/null
+++ b/blink/tools/plan_blink_move.py
@@ -0,0 +1,96 @@
+#!/usr/bin/env vpython
+# Copyright 2017 The Chromium 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 os
+import re
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..',
+ 'third_party', 'WebKit', 'Tools', 'Scripts'))
+from blinkpy.common.name_style_converter import NameStyleConverter
+from webkitpy.common.system.filesystem import FileSystem
+
+
+def relative_dest(fs, filename):
+ """Returns a destination path string for given filename.
+
+ |filename| is a path relative to third_party/WebKit, and the resultant path
+ is relative to third_party/blink.
+ """
+ dest = None
+ if filename.startswith('public'):
+ dest = re.sub(r'^public', 'renderer' + fs.sep + 'public', filename)
+ elif filename.startswith('Source'):
+ dest = re.sub(r'^Source', 'renderer', filename)
+ elif filename.startswith('common'):
+ dest = filename
+ else:
+ raise ValueError('|filename| must start with "common", "public", or "Source": %s' % filename)
+ if filename.endswith(('.h', '.cpp', '.mm', '.idl', '.typemap', 'Settings.json5')):
+ dirname, basename = fs.split(dest)
+ basename, ext = fs.splitext(basename)
+ # Skip some inspector-related files. #includes for these files are
+ # generated by a script outside of Blink.
+ if (re.match(r'Inspector.*Agent', basename)
+ or basename == 'InspectorTraceEvents'
+ or basename == 'PerformanceMonitor'
+ or basename == 'PlatformTraceEventsAgent'):
+ return dest
+ # Skip CSSProperty*. Some files are generated, and some files are
+ # checked-in. It's hard to handle them automatically.
+ if re.search(r'css[\\/]properties$', dirname):
+ return dest
+ if filename.endswith('.cpp'):
+ ext = '.cc'
+ # WebKit.h should be renamed to blink.h.
+ if basename == 'WebKit' and ext == '.h':
+ basename = 'blink'
+ if basename.lower() != basename:
+ basename = NameStyleConverter(basename).to_snake_case()
+ return fs.join(dirname, basename + ext)
+ return dest
+
+
+def start_with_list(name, prefixes):
+ if len(prefixes) == 0:
+ return True
+ for prefix in prefixes:
+ if name.startswith(prefix):
+ return True
+ return False
+
+
+def plan_blink_move(fs, prefixes):
+ """Returns (source, dest) path pairs.
+
+ The source paths are relative to third_party/WebKit,
+ and the dest paths are relative to third_party/blink.
+ The paths use os.sep as the path part separator.
+ """
+ blink_dir = fs.join(fs.dirname(__file__), '..')
+ webkit_dir = fs.join(blink_dir, '..', '..', 'third_party', 'WebKit')
+ source_files = fs.files_under(fs.join(webkit_dir, 'Source'))
+ source_files += fs.files_under(fs.join(webkit_dir, 'common'))
+ source_files += fs.files_under(fs.join(webkit_dir, 'public'))
+
+ # It's possible to check git.exists() here, but we don't do it due to slow
+ # performance. We should check it just before executing git command.
+
+ source_files = [f[len(webkit_dir) + 1:] for f in source_files]
+ return [(f, relative_dest(fs, f)) for f in source_files
+ if f.find('node_modules') == -1 and start_with_list(f, prefixes)]
+
+
+def main():
+ fs = FileSystem()
+ file_pairs = plan_blink_move(fs, sys.argv[1:])
+ print 'Show renaming plan. It contains files not in the repository.'
+ print '<Source path relative to third_party/WebKit> => <Destination path relative to third_party/blink>'
+ for pair in file_pairs:
+ print '%s\t=>\t%s' % pair
+
+
+if __name__ == '__main__':
+ main()
diff --git a/core/animation/Animation.idl b/core/animation/Animation.idl
index 34099ba..eb2b2a3 100644
--- a/core/animation/Animation.idl
+++ b/core/animation/Animation.idl
@@ -33,11 +33,16 @@
enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
[
- DependentLifetime,
- NoInterfaceObject,
+ Constructor(optional AnimationEffectReadOnly? effect = null, optional AnimationTimeline? timeline),
+ Exposed(Window WebAnimationsAPI),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface Animation : EventTarget {
- // TODO(dstockwell): Add timeline property.
+ // TODO(suzyh): Make timeline mutable.
[RuntimeEnabled=WebAnimationsAPI] attribute AnimationEffectReadOnly? effect;
+ [RuntimeEnabled=WebAnimationsAPI] readonly attribute AnimationTimeline? timeline;
[Measure] attribute double? startTime;
[Measure] attribute double? currentTime;
[Measure] attribute double playbackRate;
diff --git a/core/animation/AnimationEffectReadOnly.idl b/core/animation/AnimationEffectReadOnly.idl
index 8011f9c..5f46ae5 100644
--- a/core/animation/AnimationEffectReadOnly.idl
+++ b/core/animation/AnimationEffectReadOnly.idl
@@ -31,10 +31,8 @@
// https://w3c.github.io/web-animations/#the-animationeffectreadonly-interface
[
- RuntimeEnabled=WebAnimationsAPI,
- GarbageCollected,
- ImplementedAs=AnimationEffect,
+ RuntimeEnabled=WebAnimationsAPI
] interface AnimationEffectReadOnly {
- readonly attribute AnimationEffectTiming timing;
- readonly attribute ComputedTimingProperties computedTiming;
+ readonly attribute AnimationEffectTimingReadOnly timing;
+ ComputedTimingProperties getComputedTiming();
};
diff --git a/core/animation/AnimationEffectTiming.idl b/core/animation/AnimationEffectTiming.idl
index 70d016f..502da5e 100644
--- a/core/animation/AnimationEffectTiming.idl
+++ b/core/animation/AnimationEffectTiming.idl
@@ -3,20 +3,16 @@
// found in the LICENSE file.
// https://w3c.github.io/web-animations/#the-animationeffecttiming-interface
-// TODO(dstockwell): Should extend AnimationEffectTimingReadOnly
[
- RuntimeEnabled=WebAnimationsAPI,
- GarbageCollected,
-] interface AnimationEffectTiming {
+ RuntimeEnabled=WebAnimationsAPI
+] interface AnimationEffectTiming : AnimationEffectTimingReadOnly {
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;
+ [RaisesException=Setter] attribute double iterationStart;
+ [RaisesException=Setter] attribute unrestricted double iterations;
+ [RaisesException=Setter] attribute (unrestricted double or DOMString) duration;
+ attribute PlaybackDirection direction;
+ [RaisesException=Setter] attribute DOMString easing;
};
diff --git a/core/animation/AnimationEffectTimingProperties.idl b/core/animation/AnimationEffectTimingProperties.idl
new file mode 100644
index 0000000..005894a
--- /dev/null
+++ b/core/animation/AnimationEffectTimingProperties.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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
+
+enum FillMode { "none", "forwards", "backwards", "both", "auto" };
+enum PlaybackDirection { "normal", "reverse", "alternate", "alternate-reverse" };
+
+dictionary AnimationEffectTimingProperties {
+ double delay = 0;
+ double endDelay = 0;
+ FillMode fill = "auto";
+ double iterationStart = 0.0;
+ unrestricted double iterations = 1.0;
+ (unrestricted double or DOMString) duration = "auto";
+ PlaybackDirection direction = "normal";
+ DOMString easing = "linear";
+};
diff --git a/core/animation/AnimationEffectTimingReadOnly.idl b/core/animation/AnimationEffectTimingReadOnly.idl
new file mode 100644
index 0000000..294bb70
--- /dev/null
+++ b/core/animation/AnimationEffectTimingReadOnly.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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-animationeffecttimingreadonly-interface
+// TODO(suzyh): Use enums instead of DOMStrings where specced
+
+[
+ RuntimeEnabled=WebAnimationsAPI
+] interface AnimationEffectTimingReadOnly {
+ readonly attribute double delay;
+ readonly attribute double endDelay;
+ readonly attribute DOMString fill;
+ readonly attribute double iterationStart;
+ readonly attribute unrestricted double iterations;
+ readonly attribute (unrestricted double or DOMString) duration;
+ readonly attribute PlaybackDirection direction;
+ readonly attribute DOMString easing;
+};
diff --git a/core/animation/AnimationTimeline.idl b/core/animation/AnimationTimeline.idl
index 772b2e6..dd32f96 100644
--- a/core/animation/AnimationTimeline.idl
+++ b/core/animation/AnimationTimeline.idl
@@ -2,17 +2,10 @@
// 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,
- GarbageCollected,
+ RuntimeEnabled=WebAnimationsAPI
] interface AnimationTimeline {
- attribute double? currentTime;
- attribute double playbackRate;
- Animation play(AnimationEffectReadOnly source);
- sequence<Animation> getAnimations();
+ readonly attribute double? currentTime;
};
diff --git a/core/animation/ComputedTimingProperties.idl b/core/animation/ComputedTimingProperties.idl
index 71e0530..1719f70 100644
--- a/core/animation/ComputedTimingProperties.idl
+++ b/core/animation/ComputedTimingProperties.idl
@@ -4,14 +4,10 @@
// 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;
+dictionary ComputedTimingProperties : AnimationEffectTimingProperties {
+ unrestricted double endTime;
+ unrestricted double activeDuration;
+ double? localTime;
+ double? progress;
+ unrestricted double? currentIteration;
};
diff --git a/core/animation/DocumentAnimation.idl b/core/animation/DocumentAnimation.idl
index 7e02888..1ccdcc8 100644
--- a/core/animation/DocumentAnimation.idl
+++ b/core/animation/DocumentAnimation.idl
@@ -5,8 +5,10 @@
// https://w3c.github.io/web-animations/#extensions-to-the-document-interface
[
- RuntimeEnabled=WebAnimationsAPI,
+ ImplementedAs=DocumentAnimation,
+ RuntimeEnabled=WebAnimationsAPI
] partial interface Document {
- // TODO(dstockwell): This should be a DocumentTimeline.
- readonly attribute AnimationTimeline timeline;
+ readonly attribute DocumentTimeline timeline;
+
+ sequence<Animation> getAnimations();
};
diff --git a/core/animation/DocumentTimeline.idl b/core/animation/DocumentTimeline.idl
new file mode 100644
index 0000000..54f9faa
--- /dev/null
+++ b/core/animation/DocumentTimeline.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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-documenttimeline-interface
+
+[
+ Constructor(optional DocumentTimelineOptions options),
+ ConstructorCallWith=ExecutionContext,
+ RuntimeEnabled=WebAnimationsAPI
+] interface DocumentTimeline : AnimationTimeline {
+};
diff --git a/core/animation/DocumentTimelineOptions.idl b/core/animation/DocumentTimelineOptions.idl
new file mode 100644
index 0000000..6730f6e
--- /dev/null
+++ b/core/animation/DocumentTimelineOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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/#dictdef-documenttimelineoptions
+
+dictionary DocumentTimelineOptions {
+ DOMHighResTimeStamp originTime = 0;
+};
diff --git a/core/animation/EffectModel.idl b/core/animation/EffectModel.idl
deleted file mode 100644
index 6393414..0000000
--- a/core/animation/EffectModel.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.
-
-// 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,
- GarbageCollected
-] interface EffectModel {
-};
diff --git a/core/animation/ElementAnimation.idl b/core/animation/ElementAnimation.idl
index a6ac513..b7639cb 100644
--- a/core/animation/ElementAnimation.idl
+++ b/core/animation/ElementAnimation.idl
@@ -28,17 +28,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/web-animations/#the-animatable-interface
-// http://www.w3.org/TR/web-animations/#extensions-to-the-element-interface
+// https://w3c.github.io/web-animations/#the-animatable-interface
+// https://w3c.github.io/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
+// implements Animatable.
-partial interface Element {
- // FIXME: Union types with dictionary type members doesn't work (yet).
- // Animation animate((EffectModel or sequence<Dictionary> or Dictionary)? effect, optional (double or KeyframeEffectOptions) timing);
- [Measure, RaisesException] Animation animate((EffectModel or sequence<Dictionary> or Dictionary)? effect, optional double timing);
- [Measure, RaisesException] Animation animate((EffectModel or sequence<Dictionary> or Dictionary)? effect, KeyframeEffectOptions timing);
+[
+ ImplementedAs=ElementAnimation
+] partial interface Element {
+ // TODO(dstockwell): The argument types do not match the spec.
+ [CallWith=ScriptState, Measure, RaisesException] Animation animate((sequence<Dictionary> or Dictionary)? effect, optional (unrestricted double or KeyframeAnimationOptions) options);
[RuntimeEnabled=WebAnimationsAPI] sequence<Animation> getAnimations();
};
diff --git a/core/animation/KeyframeAnimationOptions.idl b/core/animation/KeyframeAnimationOptions.idl
new file mode 100644
index 0000000..d83463e
--- /dev/null
+++ b/core/animation/KeyframeAnimationOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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/#dictdef-keyframeanimationoptions
+
+dictionary KeyframeAnimationOptions : KeyframeEffectOptions {
+ DOMString id = "";
+};
diff --git a/core/animation/KeyframeEffect.idl b/core/animation/KeyframeEffect.idl
index 5ec493d..a02fdd2 100644
--- a/core/animation/KeyframeEffect.idl
+++ b/core/animation/KeyframeEffect.idl
@@ -31,10 +31,9 @@
// 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, (EffectModel or sequence<Dictionary> or Dictionary)? effect, optional unrestricted double timing),
- Constructor(Element? target, (EffectModel or sequence<Dictionary> or Dictionary)? effect, KeyframeEffectOptions timing),
+ Constructor(Element? target, (sequence<Dictionary> or Dictionary)? effect, optional (unrestricted double or KeyframeEffectOptions) options),
+ ConstructorCallWith=ExecutionContext,
RaisesException=Constructor,
- RuntimeEnabled=WebAnimationsAPI,
-] interface KeyframeEffect : AnimationEffectReadOnly {
+ RuntimeEnabled=WebAnimationsAPI
+] interface KeyframeEffect : KeyframeEffectReadOnly {
};
diff --git a/core/animation/KeyframeEffectOptions.idl b/core/animation/KeyframeEffectOptions.idl
index fbf78ad..ac46caf 100644
--- a/core/animation/KeyframeEffectOptions.idl
+++ b/core/animation/KeyframeEffectOptions.idl
@@ -1,22 +1,9 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium 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-keyframeeffectoptions-dictionary
-enum FillMode { "none", "forwards", "backwards", "both", "auto" };
-enum PlaybackDirection { "normal", "reverse", "alternate", "alternate-reverse" };
-
-dictionary KeyframeEffectOptions {
- double delay = 0;
- double endDelay = 0;
- FillMode 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;
- PlaybackDirection direction = "normal";
- DOMString easing = "linear";
- DOMString id = "";
+dictionary KeyframeEffectOptions : AnimationEffectTimingProperties {
+ // TODO(alancutter): Implement iterationComposite, composite and spacing.
};
diff --git a/core/animation/KeyframeEffectReadOnly.idl b/core/animation/KeyframeEffectReadOnly.idl
new file mode 100644
index 0000000..e0fcf92
--- /dev/null
+++ b/core/animation/KeyframeEffectReadOnly.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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-keyframeeffect-interfaces
+
+[
+ Constructor(Element? target, (sequence<Dictionary> or Dictionary)? effect, optional (unrestricted double or KeyframeEffectOptions) options),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ RuntimeEnabled=WebAnimationsAPI
+] interface KeyframeEffectReadOnly : AnimationEffectReadOnly {
+};
diff --git a/core/animation/ScrollTimeline.idl b/core/animation/ScrollTimeline.idl
new file mode 100644
index 0000000..f0c240b
--- /dev/null
+++ b/core/animation/ScrollTimeline.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/scroll-animations/#scrolltimeline-interface
+
+[
+ Constructor(optional ScrollTimelineOptions options),
+ ConstructorCallWith=Document,
+ RaisesException=Constructor,
+ RuntimeEnabled=AnimationWorklet
+] interface ScrollTimeline : AnimationTimeline {
+ readonly attribute Element? scrollSource;
+ readonly attribute ScrollDirection orientation;
+ readonly attribute (double or ScrollTimelineAutoKeyword) timeRange;
+};
diff --git a/core/animation/ScrollTimelineOptions.idl b/core/animation/ScrollTimelineOptions.idl
new file mode 100644
index 0000000..aaaae39
--- /dev/null
+++ b/core/animation/ScrollTimelineOptions.idl
@@ -0,0 +1,18 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/scroll-animations/#dictdef-scrolltimelineoptions
+
+enum ScrollDirection {
+ "block",
+ "inline",
+};
+
+enum ScrollTimelineAutoKeyword { "auto" };
+
+dictionary ScrollTimelineOptions {
+ Element scrollSource;
+ ScrollDirection orientation = "block";
+ (double or ScrollTimelineAutoKeyword) timeRange = "auto";
+};
diff --git a/core/clipboard/Clipboard.idl b/core/clipboard/Clipboard.idl
new file mode 100644
index 0000000..22a0247
--- /dev/null
+++ b/core/clipboard/Clipboard.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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-interface
+
+[SecureContext]
+interface Clipboard : EventTarget {
+ [CallWith=ScriptState] Promise<DataTransfer> read();
+ [CallWith=ScriptState] Promise<DOMString> readText();
+
+ [CallWith=ScriptState] Promise<void> write(DataTransfer data);
+ [CallWith=ScriptState] Promise<void> writeText(DOMString data);
+};
diff --git a/core/clipboard/DataTransfer.idl b/core/clipboard/DataTransfer.idl
index 5b22118..e31df69 100644
--- a/core/clipboard/DataTransfer.idl
+++ b/core/clipboard/DataTransfer.idl
@@ -29,7 +29,7 @@
// https://html.spec.whatwg.org/#the-datatransfer-interface
[
- GarbageCollected
+ Constructor
] interface DataTransfer {
attribute DOMString dropEffect;
attribute DOMString effectAllowed;
@@ -39,7 +39,7 @@
void setDragImage(Element image, long x, long y);
/* old interface */
- [SameObject] readonly attribute DOMString[] types;
+ [CachedAttribute=hasDataStoreItemListChanged] readonly attribute FrozenArray<DOMString> types;
DOMString getData(DOMString format);
void setData(DOMString format, DOMString data);
void clearData(optional DOMString format);
diff --git a/core/clipboard/DataTransferItem.idl b/core/clipboard/DataTransferItem.idl
index 1328c6e..d7f3665 100644
--- a/core/clipboard/DataTransferItem.idl
+++ b/core/clipboard/DataTransferItem.idl
@@ -30,13 +30,9 @@
// https://html.spec.whatwg.org/#the-datatransferitem-interface
-[
- GarbageCollected,
-] interface DataTransferItem {
+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);
- // TODO(philipj): getAsFile() should return a File object. crbug.com/361145
- Blob? getAsFile();
-};
+ [CallWith=ScriptState] void getAsString(FunctionStringCallback? callback);
+ File? getAsFile();
+};
\ No newline at end of file
diff --git a/core/clipboard/DataTransferItemList.idl b/core/clipboard/DataTransferItemList.idl
index 8a3e6c8..a38c057 100644
--- a/core/clipboard/DataTransferItemList.idl
+++ b/core/clipboard/DataTransferItemList.idl
@@ -30,14 +30,11 @@
// https://html.spec.whatwg.org/#the-datatransferitemlist-interface
-[
- GarbageCollected,
-] interface DataTransferItemList {
+interface DataTransferItemList {
readonly attribute unsigned long length;
[ImplementedAs=item] getter DataTransferItem (unsigned long index);
[RaisesException] DataTransferItem? add(DOMString data, DOMString type);
- // TODO(philipj): The file argument should not be nullable.
- DataTransferItem? add(File? file);
+ 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 185541c..3ffe730 100644
--- a/core/css/CSS.idl
+++ b/core/css/CSS.idl
@@ -27,11 +27,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-conditional/#the-css-interface
+// https://drafts.csswg.org/css-conditional/#the-css-interface
[
- ImplementedAs=DOMWindowCSS,
- WillBeGarbageCollected
+ ImplementedAs=DOMWindowCSS
] interface CSS {
static boolean supports(DOMString property, DOMString value);
static boolean supports(DOMString conditionText);
diff --git a/core/css/CSSConditionRule.idl b/core/css/CSSConditionRule.idl
new file mode 100644
index 0000000..824a340
--- /dev/null
+++ b/core/css/CSSConditionRule.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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://drafts.csswg.org/css-conditional/#the-cssconditionrule-interface
+
+interface CSSConditionRule : CSSGroupingRule {
+ // TODO(xing.xu): readonly should be removed.
+ readonly attribute DOMString conditionText;
+};
diff --git a/core/css/CSSFontFaceRule.idl b/core/css/CSSFontFaceRule.idl
index cc71dcd..88f4e8d 100644
--- a/core/css/CSSFontFaceRule.idl
+++ b/core/css/CSSFontFaceRule.idl
@@ -20,11 +20,12 @@
// 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
+// https://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSFontFaceRule
+// https://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.
+// TODO(foolip): Make CSSFontFaceRule match new spec and/or change spec to match
+// what's implemented. https://crbug.com/709013
+// https://github.com/w3c/csswg-drafts/issues/825
interface CSSFontFaceRule : CSSRule {
[Measure] readonly attribute CSSStyleDeclaration style;
diff --git a/core/css/CSSGroupingRule.idl b/core/css/CSSGroupingRule.idl
index c6dbf4e..198a309 100644
--- a/core/css/CSSGroupingRule.idl
+++ b/core/css/CSSGroupingRule.idl
@@ -2,7 +2,7 @@
// 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
+// https://drafts.csswg.org/cssom/#the-cssgroupingrule-interface
interface CSSGroupingRule : CSSRule {
[SameObject] readonly attribute CSSRuleList cssRules;
diff --git a/core/css/CSSImportRule.idl b/core/css/CSSImportRule.idl
index e845ca2..b298deb 100644
--- a/core/css/CSSImportRule.idl
+++ b/core/css/CSSImportRule.idl
@@ -18,11 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssimportrule-interface
+// https://drafts.csswg.org/cssom/#the-cssimportrule-interface
interface CSSImportRule : CSSRule {
readonly attribute DOMString href;
- // TODO(philipj): media should have [PutForwards=mediaText].
+ // TODO(foolip): 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 739a2e1..85f732b 100644
--- a/core/css/CSSKeyframeRule.idl
+++ b/core/css/CSSKeyframeRule.idl
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-animations/#interface-csskeyframerule
+// https://drafts.csswg.org/css-animations/#interface-csskeyframerule
interface CSSKeyframeRule : CSSRule {
[RaisesException=Setter] attribute DOMString keyText;
diff --git a/core/css/CSSKeyframesRule.idl b/core/css/CSSKeyframesRule.idl
index 709f133..dc04ce0 100644
--- a/core/css/CSSKeyframesRule.idl
+++ b/core/css/CSSKeyframesRule.idl
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-animations/#interface-csskeyframesrule
+// https://drafts.csswg.org/css-animations/#interface-csskeyframesrule
interface CSSKeyframesRule : CSSRule {
attribute DOMString name;
diff --git a/core/css/CSSMediaRule.idl b/core/css/CSSMediaRule.idl
index 1e6c85a..b287b6d 100644
--- a/core/css/CSSMediaRule.idl
+++ b/core/css/CSSMediaRule.idl
@@ -18,9 +18,9 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssmediarule-interface
+// https://drafts.csswg.org/cssom/#the-cssmediarule-interface
-interface CSSMediaRule : CSSGroupingRule {
- // TODO(philipj): media should have [PutForwards=mediaText].
+interface CSSMediaRule : CSSConditionRule {
+ // TODO(foolip): media should have [PutForwards=mediaText].
[SameObject] readonly attribute MediaList media;
};
diff --git a/core/css/CSSNamespaceRule.idl b/core/css/CSSNamespaceRule.idl
index d48fc9a..64197ca 100644
--- a/core/css/CSSNamespaceRule.idl
+++ b/core/css/CSSNamespaceRule.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.
-
-// http://dev.w3.org/csswg/cssom-1/#the-cssnamespacerule-interface
+// https://drafts.csswg.org/cssom/#the-cssnamespacerule-interface
interface CSSNamespaceRule : CSSRule {
diff --git a/core/css/CSSPageRule.idl b/core/css/CSSPageRule.idl
index 5e04b6c..b659433 100644
--- a/core/css/CSSPageRule.idl
+++ b/core/css/CSSPageRule.idl
@@ -18,15 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-csspagerule-interface
+// https://drafts.csswg.org/cssom/#the-csspagerule-interface
-// TODO(philipj): CSSPageRule should inherit from CSSGroupingRule.
+// TODO(foolip): 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
+// spec https://drafts.csswg.org/css-page/#at-page-rule allows only
// margin at-rules inside @page.
interface CSSPageRule : CSSRule {
attribute DOMString selectorText;
- // TODO(philipj): style should have [PutForwards=cssText].
+ // TODO(foolip): style should have [PutForwards=cssText].
[SameObject] readonly attribute CSSStyleDeclaration style;
};
diff --git a/core/css/CSSRule.idl b/core/css/CSSRule.idl
index a064711..dbea2d4 100644
--- a/core/css/CSSRule.idl
+++ b/core/css/CSSRule.idl
@@ -18,11 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssrule-interface
+// https://drafts.csswg.org/cssom/#the-cssrule-interface
[
- DependentLifetime,
- WillBeGarbageCollected,
+ DependentLifetime
] interface CSSRule {
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;
@@ -30,7 +29,7 @@
const unsigned short MEDIA_RULE = 4;
const unsigned short FONT_FACE_RULE = 5;
const unsigned short PAGE_RULE = 6;
- // TODO(philipj): Implement CSSMarginRule.
+ // TODO(foolip): Implement CSSMarginRule.
// const unsigned short MARGIN_RULE = 9;
const unsigned short NAMESPACE_RULE = 10;
readonly attribute unsigned short type;
@@ -39,19 +38,15 @@
readonly attribute CSSStyleSheet? parentStyleSheet;
// CSS Animations
- // http://dev.w3.org/csswg/css-animations/#interface-cssrule
+ // https://drafts.csswg.org/css-animations/#interface-cssrule
const unsigned short KEYFRAMES_RULE = 7;
const unsigned short KEYFRAME_RULE = 8;
// CSS Conditional Rules
- // http://dev.w3.org/csswg/css-conditional/#extentions-to-cssrule-interface
+ // https://drafts.csswg.org/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
+ // https://drafts.csswg.org/css-device-adapt/#css-rule-interface
[RuntimeEnabled=CSSViewport] const unsigned short VIEWPORT_RULE = 15;
-
- // 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 ffb548c..c91518a 100644
--- a/core/css/CSSRuleList.idl
+++ b/core/css/CSSRuleList.idl
@@ -23,12 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssrulelist-interface
+// https://drafts.csswg.org/cssom/#the-cssrulelist-interface
-// TODO(philipj): CSSRuleList should be an [ArrayClass].
+// TODO(foolip): CSSRuleList should be an [ArrayClass].
[
- DependentLifetime,
- WillBeGarbageCollected,
+ DependentLifetime
] interface CSSRuleList {
[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 b109bb0..e518566 100644
--- a/core/css/CSSStyleDeclaration.idl
+++ b/core/css/CSSStyleDeclaration.idl
@@ -18,29 +18,28 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
+// https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface
[
- DependentLifetime,
- WillBeGarbageCollected
+ DependentLifetime
] interface CSSStyleDeclaration {
- [RaisesException=Setter] attribute DOMString cssText;
+ [CEReactions, RaisesException=Setter] attribute DOMString cssText;
readonly attribute unsigned long length;
getter DOMString item(unsigned long index);
DOMString getPropertyValue(DOMString property);
DOMString getPropertyPriority(DOMString property);
- // TODO(philipj): The value and priority arguments should have
+ // TODO(foolip): 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);
+ [CEReactions, 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);
+ [CEReactions, RaisesException] DOMString removeProperty(DOMString property);
readonly attribute CSSRule? parentRule;
- [RaisesException=Setter, TreatNullAs=EmptyString] attribute DOMString cssFloat;
+ [CEReactions, RaisesException=Setter, TreatNullAs=EmptyString] attribute DOMString cssFloat;
// 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
+ // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
+ // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-dashed-attribute
[Custom=(PropertyGetter,PropertyEnumerator,PropertyQuery)] getter (DOMString or float) (DOMString name);
[Custom] setter void (DOMString property, DOMString? propertyValue);
};
diff --git a/core/css/CSSStyleRule.idl b/core/css/CSSStyleRule.idl
index 52503b8..8a9f123 100644
--- a/core/css/CSSStyleRule.idl
+++ b/core/css/CSSStyleRule.idl
@@ -18,9 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssstylerule-interface
+// https://drafts.csswg.org/cssom/#the-cssstylerule-interface
-interface CSSStyleRule : CSSRule {
+[
+ DependentLifetime
+] interface CSSStyleRule : CSSRule {
attribute DOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};
diff --git a/core/css/CSSStyleSheet.idl b/core/css/CSSStyleSheet.idl
index 0f9254a..d3ec320 100644
--- a/core/css/CSSStyleSheet.idl
+++ b/core/css/CSSStyleSheet.idl
@@ -18,15 +18,14 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-cssstylesheet-interface
+// https://drafts.csswg.org/cssom/#the-cssstylesheet-interface
[
- SetWrapperReferenceFrom=ownerNode,
+ DependentLifetime
] interface CSSStyleSheet : StyleSheet {
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] unsigned long insertRule(DOMString rule, optional unsigned long index = 0);
[RaisesException] void deleteRule(unsigned long index);
// Non-standard APIs
diff --git a/core/css/CSSSupportsRule.idl b/core/css/CSSSupportsRule.idl
index d06a779..705a387 100644
--- a/core/css/CSSSupportsRule.idl
+++ b/core/css/CSSSupportsRule.idl
@@ -26,15 +26,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-conditional/#the-csssupportsrule-interface
+// https://drafts.csswg.org/css-conditional/#the-csssupportsrule-interface
-// 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);
+interface CSSSupportsRule : CSSConditionRule {
};
diff --git a/core/css/CSSViewportRule.idl b/core/css/CSSViewportRule.idl
index 640d484..4c1894b 100644
--- a/core/css/CSSViewportRule.idl
+++ b/core/css/CSSViewportRule.idl
@@ -27,8 +27,10 @@
* SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-device-adapt/#css-viewport-rule-interface
+// https://drafts.csswg.org/css-device-adapt/#css-viewport-rule-interface
-interface CSSViewportRule : CSSRule {
+[
+ RuntimeEnabled=CSSViewport
+] interface CSSViewportRule : CSSRule {
readonly attribute CSSStyleDeclaration style;
};
diff --git a/core/css/DocumentFontFaceSet.idl b/core/css/DocumentFontFaceSet.idl
deleted file mode 100644
index b1f217e..0000000
--- a/core/css/DocumentFontFaceSet.idl
+++ /dev/null
@@ -1,37 +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://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 527e800..b27465a 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/#fontface-interface
+// https://drafts.csswg.org/css-font-loading/#fontface-interface
enum FontFaceLoadStatus {
"unloaded",
@@ -37,14 +37,14 @@
"error"
};
-// TODO(philipj): This interface should be [Exposed=Window,Worker].
+// TODO(foolip): This interface should be [Exposed=Window,Worker].
[
+ ActiveScriptWrappable,
DependentLifetime,
// 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,
- MeasureAs=FontFaceConstructor,
- WillBeGarbageCollected,
+ MeasureAs=FontFaceConstructor
] interface FontFace {
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString family;
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString style;
@@ -53,6 +53,7 @@
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString unicodeRange;
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString variant;
[RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString featureSettings;
+ [RaisesException=Setter, SetterCallWith=ExecutionContext] attribute DOMString display;
readonly attribute FontFaceLoadStatus status;
diff --git a/core/css/FontFaceDescriptors.idl b/core/css/FontFaceDescriptors.idl
index c53b7b9..3c7e6c2 100644
--- a/core/css/FontFaceDescriptors.idl
+++ b/core/css/FontFaceDescriptors.idl
@@ -2,7 +2,7 @@
// 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/#dictdef-fontfacedescriptors
+// https://drafts.csswg.org/css-font-loading/#dictdef-fontfacedescriptors
dictionary FontFaceDescriptors {
DOMString style = "normal";
@@ -11,4 +11,5 @@
DOMString unicodeRange = "U+0-10FFFF";
DOMString variant = "normal";
DOMString featureSettings = "normal";
+ DOMString display = "auto";
};
diff --git a/core/css/FontFaceSet.idl b/core/css/FontFaceSet.idl
index 9f7480e..2e8622d 100644
--- a/core/css/FontFaceSet.idl
+++ b/core/css/FontFaceSet.idl
@@ -28,19 +28,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
+// https://drafts.csswg.org/css-font-loading/#FontFaceSet-interface
enum FontFaceSetLoadStatus { "loading", "loaded" };
-// TODO(philipj): This interface should be [Exposed=Window,Worker] and should
+// TODO(foolip): This interface should be [Exposed=Window,Worker] and should
// have a constructor, and thus not have [NoInterfaceObject].
[
DependentLifetime,
- SetWrapperReferenceFrom=document,
- NoInterfaceObject,
+ NoInterfaceObject
] interface FontFaceSet : EventTarget {
setlike<FontFace>;
- readonly attribute unsigned long size;
// events for when loading state changes
attribute EventHandler onloading;
diff --git a/core/css/FontFaceSetLoadEvent.idl b/core/css/FontFaceSetLoadEvent.idl
index 303c3c8..59da6a5 100644
--- a/core/css/FontFaceSetLoadEvent.idl
+++ b/core/css/FontFaceSetLoadEvent.idl
@@ -28,12 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-font-loading/#fontfacesetloadevent
+// https://drafts.csswg.org/css-font-loading/#fontfacesetloadevent
-// TODO(philipj): This interface should have a constructor and
-// [Exposed=Window,Worker], and thus not [NoInterfaceObject].
[
- NoInterfaceObject,
+ Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict),
+ // TODO(loonybear): Exposed=(Window,Worker)
+ Exposed=Window
] interface FontFaceSetLoadEvent : Event {
- readonly attribute sequence<FontFace> fontfaces;
+ [SameObject] readonly attribute FrozenArray<FontFace> fontfaces;
};
diff --git a/core/css/FontFaceSetLoadEventInit.idl b/core/css/FontFaceSetLoadEventInit.idl
index e058d33..e47188d 100644
--- a/core/css/FontFaceSetLoadEventInit.idl
+++ b/core/css/FontFaceSetLoadEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://drafts.csswg.org/css-font-loading/#fontfacesetloadevent
dictionary FontFaceSetLoadEventInit : EventInit {
sequence<FontFace> fontfaces = [];
diff --git a/core/css/FontFaceSource.idl b/core/css/FontFaceSource.idl
new file mode 100644
index 0000000..c7263bf
--- /dev/null
+++ b/core/css/FontFaceSource.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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://drafts.csswg.org/css-font-loading/#font-face-source
+
+[
+ LegacyTreatAsPartialInterface,
+ NoInterfaceObject
+] interface FontFaceSource {
+ [MeasureAs=DocumentFonts] readonly attribute FontFaceSet fonts;
+};
diff --git a/core/css/MediaList.idl b/core/css/MediaList.idl
index ff714af..06705b5 100644
--- a/core/css/MediaList.idl
+++ b/core/css/MediaList.idl
@@ -23,17 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/cssom/#the-medialist-interface
+// https://drafts.csswg.org/cssom/#the-medialist-interface
-// TODO(philipj): MediaList should be an [ArrayClass].
-[
- WillBeGarbageCollected
-] interface MediaList {
- // TODO(philipj): [TreatNullAs=EmptyString] stringifier attribute DOMString mediaText;
+// TODO(foolip): MediaList should be an [ArrayClass].
+interface MediaList {
+ // TODO(foolip): [TreatNullAs=EmptyString] stringifier attribute DOMString mediaText;
attribute DOMString? mediaText;
readonly attribute unsigned long length;
[Measure] getter DOMString? item(unsigned long index);
- // TODO(philipj): appendMedium() and deleteMedium() should never throw.
+ // TODO(foolip): 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 f1906be..a5e1929 100644
--- a/core/css/MediaQueryList.idl
+++ b/core/css/MediaQueryList.idl
@@ -17,18 +17,19 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface
+// https://drafts.csswg.org/cssom-view/#the-mediaquerylist-interface
[
- DependentLifetime,
+ ActiveScriptWrappable,
+ DependentLifetime
] 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, Custom=CallEpilogue] void addListener(EventListener? listener);
- [ImplementedAs=removeDeprecatedListener, Custom=CallEpilogue]void removeListener(EventListener? listener);
+ // https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-removelistener
+ [ImplementedAs=addDeprecatedListener] void addListener(EventListener? listener);
+ [ImplementedAs=removeDeprecatedListener] void removeListener(EventListener? listener);
attribute EventHandler onchange;
};
diff --git a/core/css/MediaQueryListEvent.idl b/core/css/MediaQueryListEvent.idl
index f229e79..094e9a2 100644
--- a/core/css/MediaQueryListEvent.idl
+++ b/core/css/MediaQueryListEvent.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.
-
-// http://dev.w3.org/csswg/cssom-view/#mediaquerylistevent
+// https://drafts.csswg.org/cssom-view/#mediaquerylistevent
[
Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict)
diff --git a/core/css/MediaQueryListEventInit.idl b/core/css/MediaQueryListEventInit.idl
index 69972f5..013bae0 100644
--- a/core/css/MediaQueryListEventInit.idl
+++ b/core/css/MediaQueryListEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://drafts.csswg.org/cssom-view/#mediaquerylistevent
dictionary MediaQueryListEventInit : EventInit {
DOMString media = "";
diff --git a/core/css/PropertyDescriptor.idl b/core/css/PropertyDescriptor.idl
new file mode 100644
index 0000000..18b455b
--- /dev/null
+++ b/core/css/PropertyDescriptor.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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 PropertyDescriptor {
+ required DOMString name;
+ DOMString syntax = "*";
+ boolean inherits = false;
+ DOMString initialValue;
+};
diff --git a/core/css/PropertyRegistration.idl b/core/css/PropertyRegistration.idl
new file mode 100644
index 0000000..7fdcab9
--- /dev/null
+++ b/core/css/PropertyRegistration.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
+[
+ ImplementedAs=PropertyRegistration
+] partial interface CSS {
+ [RuntimeEnabled=CSSVariables2, MeasureAs=CSSRegisterProperty, CallWith=ExecutionContext, RaisesException]
+ static void registerProperty(PropertyDescriptor descriptor);
+};
diff --git a/core/css/StyleMedia.idl b/core/css/StyleMedia.idl
index 38f4326..5e11e72 100644
--- a/core/css/StyleMedia.idl
+++ b/core/css/StyleMedia.idl
@@ -26,14 +26,13 @@
// 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
+// https://www.w3.org/TR/2009/WD-cssom-view-20090804/#the-media-interface
+// https://web.archive.org/web/20100206142043/http://dev.w3.org/csswg/cssom-view#the-stylemedia-interface
//
-// TODO(philipj): Remove this interface.
+// TODO(foolip): Remove this interface. https://crbug.com/692839
[
- NoInterfaceObject,
- WillBeGarbageCollected
+ NoInterfaceObject
] interface StyleMedia {
[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 09a1be3..def438d 100644
--- a/core/css/StyleSheet.idl
+++ b/core/css/StyleSheet.idl
@@ -18,19 +18,18 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-stylesheet-interface
+// https://drafts.csswg.org/cssom/#the-stylesheet-interface
[
- SetWrapperReferenceFrom=ownerNode,
- WillBeGarbageCollected
+ DependentLifetime
] interface StyleSheet {
readonly attribute DOMString type;
readonly attribute DOMString? href;
- // TODO(philipj): ownerNode should be (Element or ProcessingInstruction).
+ // TODO(foolip): 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].
+ // TODO(foolip): 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 ce31d3b..ee67024 100644
--- a/core/css/StyleSheetList.idl
+++ b/core/css/StyleSheetList.idl
@@ -18,12 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/csswg/cssom/#the-stylesheetlist-interface
+// https://drafts.csswg.org/cssom/#the-stylesheetlist-interface
-// TODO(philipj): StyleSheetList should be an [ArrayClass].
+// TODO(foolip): StyleSheetList should be an [ArrayClass].
[
- SetWrapperReferenceFrom=document,
- WillBeGarbageCollected
+ DependentLifetime
] interface StyleSheetList {
[Measure] getter StyleSheet? item(unsigned long index);
readonly attribute unsigned long length;
diff --git a/core/css/WebKitCSSMatrix.idl b/core/css/WebKitCSSMatrix.idl
deleted file mode 100644
index b43ec06..0000000
--- a/core/css/WebKitCSSMatrix.idl
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2008, 2010 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.
- */
-
-// 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 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 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);
-
- // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix)
- [LegacyInterfaceTypeChecking] WebKitCSSMatrix multiply([Default=Undefined] optional WebKitCSSMatrix secondMatrix);
-
- // Return the inverse of this matrix. Throw an exception if the matrix is not invertible
- [RaisesException] WebKitCSSMatrix inverse();
-
- // 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
- 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
- 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.
- 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).
- 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.
- 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.
- WebKitCSSMatrix skewY([Default=Undefined] optional unrestricted double angle);
-
- [NotEnumerable] stringifier;
-};
diff --git a/core/css/cssom/CSSImageValue.idl b/core/css/cssom/CSSImageValue.idl
new file mode 100644
index 0000000..cf3a8ca
--- /dev/null
+++ b/core/css/cssom/CSSImageValue.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// CSSImageValue is the base class for Typed OM's representation of various
+// image types.
+// https://drafts.css-houdini.org/css-typed-om/#imagevalue-objects
+[
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM,
+ ImplementedAs=CSSStyleImageValue
+] interface CSSImageValue : CSSResourceValue {
+ readonly attribute double? intrinsicWidth;
+ readonly attribute double? intrinsicHeight;
+ readonly attribute double? intrinsicRatio;
+};
diff --git a/core/css/cssom/CSSKeywordValue.idl b/core/css/cssom/CSSKeywordValue.idl
new file mode 100644
index 0000000..c080343
--- /dev/null
+++ b/core/css/cssom/CSSKeywordValue.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.
+
+// CSSKeywordValue represents CSS Values that are specified as keywords, for
+// example "initial".
+// https://drafts.css-houdini.org/css-typed-om/#keywordvalue-objects
+[
+ Constructor(DOMString keyword),
+ Exposed(Window CSSTypedOM, PaintWorklet CSSTypedOM),
+ RaisesException=Constructor
+] interface CSSKeywordValue : CSSStyleValue {
+ attribute DOMString value;
+};
diff --git a/core/css/cssom/CSSMatrixComponent.idl b/core/css/cssom/CSSMatrixComponent.idl
new file mode 100644
index 0000000..4ffa517
--- /dev/null
+++ b/core/css/cssom/CSSMatrixComponent.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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 a matrix value in a CSSTransformValue used for properties like
+// "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssmatrixcomponent
+[
+ Constructor(DOMMatrixReadOnly matrix,
+ optional CSSMatrixComponentOptions options),
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface CSSMatrixComponent : CSSTransformComponent {
+ attribute DOMMatrix matrix;
+};
diff --git a/core/css/cssom/CSSMatrixComponentOptions.idl b/core/css/cssom/CSSMatrixComponentOptions.idl
new file mode 100644
index 0000000..3b926a5
--- /dev/null
+++ b/core/css/cssom/CSSMatrixComponentOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Options for creating a CSSMatrixComponent. See CSSMatrixComponent for usage.
+// Spec: https://drafts.css-houdini.org/css-typed-om/#dictdef-cssmatrixcomponentoptions
+dictionary CSSMatrixComponentOptions {
+ boolean is2D = false;
+};
+
diff --git a/core/css/cssom/CSSNumericValue.idl b/core/css/cssom/CSSNumericValue.idl
new file mode 100644
index 0000000..d25cc87
--- /dev/null
+++ b/core/css/cssom/CSSNumericValue.idl
@@ -0,0 +1,19 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// CSSNumericValue is the base class for numeric and length typed CSS Values.
+// https://drafts.css-houdini.org/css-typed-om/#numeric-objects
+[
+ Exposed(Window CSSTypedOM, PaintWorklet CSSTypedOM)
+] interface CSSNumericValue : CSSStyleValue {
+ [RaisesException, NewObject] CSSNumericValue add(CSSNumericValue value);
+ [RaisesException, NewObject] CSSNumericValue sub(CSSNumericValue value);
+ [RaisesException, NewObject] CSSNumericValue mul(double value);
+ [RaisesException, NewObject] CSSNumericValue div(double value);
+
+ [RaisesException, NewObject] CSSNumericValue to(DOMString unit);
+
+ // Putting Exposed=Window in the next line makes |parse| not exposed to PaintWorklet.
+ [RaisesException, NewObject, Exposed=Window] static CSSNumericValue parse(DOMString cssText);
+};
diff --git a/core/css/cssom/CSSPerspective.idl b/core/css/cssom/CSSPerspective.idl
new file mode 100644
index 0000000..87b7b7e
--- /dev/null
+++ b/core/css/cssom/CSSPerspective.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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 a perspective value in a CSSTransformValue used for properties
+// like "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssperspective
+[
+ Constructor(CSSNumericValue length),
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM,
+ RaisesException=Constructor
+] interface CSSPerspective : CSSTransformComponent {
+ [RaisesException=Setter] attribute CSSNumericValue length;
+};
diff --git a/core/css/cssom/CSSPositionValue.idl b/core/css/cssom/CSSPositionValue.idl
new file mode 100644
index 0000000..6efa073
--- /dev/null
+++ b/core/css/cssom/CSSPositionValue.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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 a <position> value, i.e. a coordinate for properties like
+// background-position.
+// Spec: https://drafts.css-houdini.org/css-typed-om/#positionvalue-objects
+[
+ Constructor(CSSNumericValue x, CSSNumericValue y),
+ Exposed(Window CSSTypedOM, PaintWorklet CSSTypedOM),
+ RaisesException=Constructor
+] interface CSSPositionValue : CSSStyleValue {
+ [RaisesException=Setter] attribute CSSNumericValue x;
+ [RaisesException=Setter] attribute CSSNumericValue y;
+};
diff --git a/core/css/cssom/CSSResourceValue.idl b/core/css/cssom/CSSResourceValue.idl
new file mode 100644
index 0000000..e5159f5
--- /dev/null
+++ b/core/css/cssom/CSSResourceValue.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// CSSResourceValue is the base class used for representing loadable resources
+// in Typed OM. Example subclasses may include images and fonts.
+// Spec: https://drafts.css-houdini.org/css-typed-om/#resourcevalue-objects
+enum CSSResourceState {
+ "unloaded", "loading", "loaded", "error"
+};
+
+[
+ Exposed(Window CSSTypedOM, PaintWorklet CSSTypedOM)
+] interface CSSResourceValue : CSSStyleValue {
+ readonly attribute CSSResourceState state;
+};
diff --git a/core/css/cssom/CSSRotation.idl b/core/css/cssom/CSSRotation.idl
new file mode 100644
index 0000000..c4018ed
--- /dev/null
+++ b/core/css/cssom/CSSRotation.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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 a rotation value in a CSSTransformValue used for properties like
+// "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssrotation
+[
+ Constructor(CSSNumericValue angleValue),
+ Constructor(double x, double y, double z, CSSNumericValue angle),
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM,
+ RaisesException=Constructor
+] interface CSSRotation : CSSTransformComponent {
+ [RaisesException=Setter] attribute CSSNumericValue angle;
+ attribute double x;
+ attribute double y;
+ attribute double z;
+};
diff --git a/core/css/cssom/CSSScale.idl b/core/css/cssom/CSSScale.idl
new file mode 100644
index 0000000..44d2721
--- /dev/null
+++ b/core/css/cssom/CSSScale.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium 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 a scale value in a CSSTransformValue used for properties like
+// "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssscale
+[
+ Constructor(double x, double y),
+ Constructor(double x, double y, double z),
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface CSSScale : CSSTransformComponent {
+ attribute double x;
+ attribute double y;
+ attribute double z;
+};
diff --git a/core/css/cssom/CSSSkew.idl b/core/css/cssom/CSSSkew.idl
new file mode 100644
index 0000000..7427ddf
--- /dev/null
+++ b/core/css/cssom/CSSSkew.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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 a skew value in a CSSTransformValue used for properties like
+// "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssskew
+[
+ Constructor(CSSNumericValue ax, CSSNumericValue ay),
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface CSSSkew : CSSTransformComponent {
+ [RaisesException=Setter] attribute CSSNumericValue ax;
+ [RaisesException=Setter] attribute CSSNumericValue ay;
+};
diff --git a/core/css/cssom/CSSStyleValue.idl b/core/css/cssom/CSSStyleValue.idl
new file mode 100644
index 0000000..cf09319
--- /dev/null
+++ b/core/css/cssom/CSSStyleValue.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.
+
+// CSSStyleValue is the base class for all CSS values accessible from Typed OM.
+// Values that are not yet supported as specific types are also returned as
+// base CSSStyleValues.
+// Spec: https://drafts.css-houdini.org/css-typed-om/#stylevalue-objects
+[
+ Exposed(Window CSSTypedOM, PaintWorklet CSSPaintAPI)
+] interface CSSStyleValue {
+ stringifier;
+ // TODO(meade): Should be (CSSStyleValue or sequence<CSSStyleValue>)? instead of object?. Fix when the code generator supports this.
+ // Putting Exposed=Window in the next line makes |parse| not exposed to PaintWorklet.
+ [RaisesException, CallWith=ScriptState, Exposed=Window] static object? parse(DOMString property, DOMString cssText);
+};
diff --git a/core/css/cssom/CSSTransformComponent.idl b/core/css/cssom/CSSTransformComponent.idl
new file mode 100644
index 0000000..ec592a2
--- /dev/null
+++ b/core/css/cssom/CSSTransformComponent.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// CSSTransformComponent is the base class used for the representations of
+// the individual CSS transforms. They are combined in a CSSTransformValue
+// before they can be used as a value for properties like "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#csstransformcomponent
+[
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface CSSTransformComponent {
+ stringifier;
+ attribute boolean is2D;
+};
diff --git a/core/css/cssom/CSSTransformValue.idl b/core/css/cssom/CSSTransformValue.idl
new file mode 100644
index 0000000..14938a8
--- /dev/null
+++ b/core/css/cssom/CSSTransformValue.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ Constructor(),
+ Constructor(sequence<CSSTransformComponent> transformComponents),
+ Exposed(Window CSSTypedOM, PaintWorklet CSSTypedOM)
+] interface CSSTransformValue : CSSStyleValue {
+ // https://github.com/w3c/css-houdini-drafts/issues/358
+ readonly attribute unsigned long length;
+ [ImplementedAs=componentAtIndex] getter CSSTransformComponent (unsigned long index);
+ iterable<CSSTransformComponent>;
+
+ readonly attribute boolean is2D;
+ [RaisesException, RuntimeEnabled=GeometryInterfaces] DOMMatrix toMatrix();
+};
diff --git a/core/css/cssom/CSSTranslation.idl b/core/css/cssom/CSSTranslation.idl
new file mode 100644
index 0000000..3d66384
--- /dev/null
+++ b/core/css/cssom/CSSTranslation.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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 a translation value in a CSSTransformValue used for properties
+// like "transform".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#csstranslation
+[
+ Constructor(CSSNumericValue x, CSSNumericValue y),
+ Constructor(CSSNumericValue x, CSSNumericValue y, CSSNumericValue z),
+ Exposed=(Window,PaintWorklet),
+ RaisesException=Constructor,
+ RuntimeEnabled=CSSTypedOM
+] interface CSSTranslation : CSSTransformComponent {
+ [RaisesException=Setter] attribute CSSNumericValue x;
+ [RaisesException=Setter] attribute CSSNumericValue y;
+ [RaisesException=Setter] attribute CSSNumericValue z;
+};
diff --git a/core/css/cssom/CSSURLImageValue.idl b/core/css/cssom/CSSURLImageValue.idl
new file mode 100644
index 0000000..7798570
--- /dev/null
+++ b/core/css/cssom/CSSURLImageValue.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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 image values that are specified using "url(...)".
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssurlimagevalue
+[
+ Constructor(USVString url),
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface CSSURLImageValue : CSSImageValue {
+ readonly attribute USVString url;
+};
diff --git a/core/css/cssom/CSSUnitValue.idl b/core/css/cssom/CSSUnitValue.idl
new file mode 100644
index 0000000..c00d6c4
--- /dev/null
+++ b/core/css/cssom/CSSUnitValue.idl
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium 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 numeric values that can be expressed as a single number plus a
+// unit (or a naked number or percentage).
+// https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
+[
+ Constructor(double value, DOMString unit),
+ RaisesException=Constructor,
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface CSSUnitValue : CSSNumericValue {
+ [EnforceRange] attribute double value;
+ [RaisesException=Setter] attribute DOMString unit;
+ readonly attribute DOMString type;
+};
diff --git a/core/css/cssom/CSSUnitValues.idl b/core/css/cssom/CSSUnitValues.idl
new file mode 100644
index 0000000..37499d0
--- /dev/null
+++ b/core/css/cssom/CSSUnitValues.idl
@@ -0,0 +1,58 @@
+// Copyright 2017 The Chromium 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://drafts.css-houdini.org/css-typed-om/#numeric-factory
+
+[
+ ImplementedAs=CSSUnitValues,
+ RuntimeEnabled=CSSTypedOM
+] partial interface CSS {
+ [NewObject] static CSSUnitValue number(double value);
+ [NewObject] static CSSUnitValue percent(double value);
+
+ // <length>
+ [NewObject] static CSSUnitValue em(double value);
+ [NewObject] static CSSUnitValue ex(double value);
+ [NewObject] static CSSUnitValue ch(double value);
+ [NewObject] static CSSUnitValue rem(double value);
+ [NewObject] static CSSUnitValue vw(double value);
+ [NewObject] static CSSUnitValue vh(double value);
+ [NewObject] static CSSUnitValue vmin(double value);
+ [NewObject] static CSSUnitValue vmax(double value);
+ [NewObject] static CSSUnitValue cm(double value);
+ [NewObject] static CSSUnitValue mm(double value);
+ [NewObject] static CSSUnitValue in(double value);
+ [NewObject] static CSSUnitValue pt(double value);
+ [NewObject] static CSSUnitValue pc(double value);
+ [NewObject] static CSSUnitValue px(double value);
+ // Currently unsupported length units that are specified
+ // [NewObject] static CSSUnitValue ic(double value);
+ // [NewObject] static CSSUnitValue lh(double value);
+ // [NewObject] static CSSUnitValue rlh(double value);
+ // [NewObject] static CSSUnitValue vi(double value);
+ // [NewObject] static CSSUnitValue vb(double value);
+ // [NewObject] static CSSUnitValue q(double value);
+
+ // <angle>
+ [NewObject] static CSSUnitValue deg(double value);
+ [NewObject] static CSSUnitValue grad(double value);
+ [NewObject] static CSSUnitValue rad(double value);
+ [NewObject] static CSSUnitValue turn(double value);
+
+ // <time>
+ [NewObject] static CSSUnitValue s(double value);
+ [NewObject] static CSSUnitValue ms(double value);
+
+ // <frequency>
+ [NewObject] static CSSUnitValue Hz(double value);
+ [NewObject] static CSSUnitValue kHz(double value);
+
+ // <resolution>
+ [NewObject] static CSSUnitValue dpi(double value);
+ [NewObject] static CSSUnitValue dpcm(double value);
+ [NewObject] static CSSUnitValue dppx(double value);
+
+ // <flex>
+ [NewObject] static CSSUnitValue fr(double value);
+};
diff --git a/core/css/cssom/CSSUnparsedValue.idl b/core/css/cssom/CSSUnparsedValue.idl
new file mode 100644
index 0000000..acacca5
--- /dev/null
+++ b/core/css/cssom/CSSUnparsedValue.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// CSSUnparsedValue objects represent values that reference custom properties.
+// They represent a list of string fragments and variable references.
+// Spec: https://drafts.css-houdini.org/css-typed-om/#unparsedvalue-objects
+[
+ Exposed(Window CSSTypedOM, PaintWorklet CSSTypedOM)
+] interface CSSUnparsedValue : CSSStyleValue {
+ // https://github.com/w3c/css-houdini-drafts/issues/358
+ readonly attribute unsigned long length;
+ [ImplementedAs=fragmentAtIndex] getter (DOMString or CSSVariableReferenceValue) (unsigned long index);
+
+ iterable<(DOMString or CSSVariableReferenceValue)>;
+};
diff --git a/core/css/cssom/CSSVariableReferenceValue.idl b/core/css/cssom/CSSVariableReferenceValue.idl
new file mode 100644
index 0000000..4135a61
--- /dev/null
+++ b/core/css/cssom/CSSVariableReferenceValue.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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 a CSS var() reference in a CSS value.
+// Spec: https://drafts.css-houdini.org/css-typed-om/#cssvariablereferencevalue
+[
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM,
+ ImplementedAs=CSSStyleVariableReferenceValue
+] interface CSSVariableReferenceValue {
+ readonly attribute DOMString variable;
+ readonly attribute CSSUnparsedValue fallback;
+};
diff --git a/core/css/cssom/CalcDictionary.idl b/core/css/cssom/CalcDictionary.idl
deleted file mode 100644
index 2f925c3..0000000
--- a/core/css/cssom/CalcDictionary.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-dictionary CalcDictionary {
- double? px = null;
- double? percent = null;
- double? em = null;
- double? ex = null;
- double? ch = null;
- double? rem = null;
- double? vw = null;
- double? vh = null;
- double? vmin = null;
- double? vmax = null;
- double? cm = null;
- double? mm = null;
- double? in = null;
- double? pc = null;
- double? pt = null;
-};
diff --git a/core/css/cssom/CalcLength.idl b/core/css/cssom/CalcLength.idl
deleted file mode 100644
index 79b2d2c..0000000
--- a/core/css/cssom/CalcLength.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-[
- Constructor(LengthValue length),
- Constructor(CalcDictionary calcDictionary),
- ImplementedAs=StyleCalcLength,
- RaisesException=Constructor,
- RuntimeEnabled=CSSTypedOM
-] interface CalcLength : LengthValue {
- readonly attribute double? px;
- readonly attribute double? percent;
- readonly attribute double? em;
- readonly attribute double? ex;
- readonly attribute double? ch;
- readonly attribute double? rem;
- readonly attribute double? vw;
- readonly attribute double? vh;
- readonly attribute double? vmin;
- readonly attribute double? vmax;
- readonly attribute double? cm;
- readonly attribute double? mm;
- readonly attribute double? in;
- readonly attribute double? pc;
- readonly attribute double? pt;
-};
diff --git a/core/css/cssom/KeywordValue.idl b/core/css/cssom/KeywordValue.idl
deleted file mode 100644
index 8b7f660..0000000
--- a/core/css/cssom/KeywordValue.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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 keyword),
- RuntimeEnabled=CSSTypedOM,
- RaisesException=Constructor
-] interface KeywordValue : StyleValue {
- readonly attribute DOMString keywordValue;
-};
diff --git a/core/css/cssom/LengthValue.idl b/core/css/cssom/LengthValue.idl
deleted file mode 100644
index 611425d..0000000
--- a/core/css/cssom/LengthValue.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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 LengthType {
- "px", "percent", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax", "cm", "mm", "in", "pc", "pt"
-};
-
-[
- RuntimeEnabled=CSSTypedOM
-] interface LengthValue : StyleValue {
- [RaisesException, NewObject] LengthValue add(LengthValue other);
- [RaisesException, NewObject] LengthValue subtract(LengthValue other);
- [RaisesException, NewObject] LengthValue multiply(double value);
- [RaisesException, NewObject] LengthValue divide(double value);
-
- [RaisesException, NewObject] static LengthValue parse(DOMString cssString);
- [RaisesException, NewObject] static LengthValue fromValue(double value, LengthType type);
- [RaisesException, NewObject] static LengthValue fromDictionary(CalcDictionary dictionary);
-};
diff --git a/core/css/cssom/Matrix.idl b/core/css/cssom/Matrix.idl
deleted file mode 100644
index 92b12a8..0000000
--- a/core/css/cssom/Matrix.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2016 The Chromium 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(double a, double b, double c, double d, double e, double f),
- Constructor(double m11, double m12, double m13, double m14,
- double m21, double m22, double m23, double m24,
- double m31, double m32, double m33, double m34,
- double m41, double m42, double m43, double m44),
- ImplementedAs=MatrixTransformComponent,
- RuntimeEnabled=CSSTypedOM
-] interface Matrix : TransformComponent {
- readonly attribute double a;
- readonly attribute double b;
- readonly attribute double c;
- readonly attribute double d;
- readonly attribute double e;
- readonly attribute double f;
- readonly attribute double m11;
- readonly attribute double m12;
- readonly attribute double m13;
- readonly attribute double m14;
- readonly attribute double m21;
- readonly attribute double m22;
- readonly attribute double m23;
- readonly attribute double m24;
- readonly attribute double m31;
- readonly attribute double m32;
- readonly attribute double m33;
- readonly attribute double m34;
- readonly attribute double m41;
- readonly attribute double m42;
- readonly attribute double m43;
- readonly attribute double m44;
-};
diff --git a/core/css/cssom/NumberValue.idl b/core/css/cssom/NumberValue.idl
deleted file mode 100644
index 06bc109..0000000
--- a/core/css/cssom/NumberValue.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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(double value),
- RuntimeEnabled=CSSTypedOM
-] interface NumberValue : StyleValue {
- readonly attribute double value;
-};
diff --git a/core/css/cssom/Perspective.idl b/core/css/cssom/Perspective.idl
deleted file mode 100644
index 6baedaa..0000000
--- a/core/css/cssom/Perspective.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2016 The Chromium 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(LengthValue length),
- ImplementedAs=PerspectiveTransformComponent,
- RuntimeEnabled=CSSTypedOM,
- RaisesException=Constructor
-] interface Perspective : TransformComponent {
- readonly attribute LengthValue length;
-};
diff --git a/core/css/cssom/PositionValue.idl b/core/css/cssom/PositionValue.idl
deleted file mode 100644
index 5e405ec..0000000
--- a/core/css/cssom/PositionValue.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2016 The Chromium 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(LengthValue x, LengthValue y),
- RuntimeEnabled=CSSTypedOM
-] interface PositionValue : StyleValue {
- readonly attribute LengthValue x;
- readonly attribute LengthValue y;
-};
diff --git a/core/css/cssom/Rotation.idl b/core/css/cssom/Rotation.idl
deleted file mode 100644
index 7a81cdb..0000000
--- a/core/css/cssom/Rotation.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 The Chromium 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(double angle),
- Constructor(double angle, double x, double y, double z),
- ImplementedAs=RotationTransformComponent,
- RuntimeEnabled=CSSTypedOM
-] interface Rotation : TransformComponent {
- readonly attribute double angle;
- readonly attribute double x;
- readonly attribute double y;
- readonly attribute double z;
-};
diff --git a/core/css/cssom/Scale.idl b/core/css/cssom/Scale.idl
deleted file mode 100644
index 22ec20d..0000000
--- a/core/css/cssom/Scale.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 The Chromium 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(double x, double y),
- Constructor(double x, double y, double z),
- ImplementedAs=ScaleTransformComponent,
- RuntimeEnabled=CSSTypedOM
-] interface Scale : TransformComponent {
- readonly attribute double x;
- readonly attribute double y;
- readonly attribute double z;
-};
diff --git a/core/css/cssom/SimpleLength.idl b/core/css/cssom/SimpleLength.idl
deleted file mode 100644
index 07c0b49..0000000
--- a/core/css/cssom/SimpleLength.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// 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(double value, DOMString type),
- RaisesException=Constructor,
- RuntimeEnabled=CSSTypedOM
-] interface SimpleLength : LengthValue {
- [EnforceRange] attribute double value;
- [ImplementedAs=unit] readonly attribute LengthType type;
-};
diff --git a/core/css/cssom/Skew.idl b/core/css/cssom/Skew.idl
deleted file mode 100644
index 5755f2b..0000000
--- a/core/css/cssom/Skew.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2016 The Chromium 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(double ax, double ay),
- ImplementedAs=SkewTransformComponent,
- RuntimeEnabled=CSSTypedOM
-] interface Skew : TransformComponent {
- readonly attribute double ax;
- readonly attribute double ay;
-};
diff --git a/core/css/cssom/StylePropertyMap.idl b/core/css/cssom/StylePropertyMap.idl
index 17d3945..16bd61b 100644
--- a/core/css/cssom/StylePropertyMap.idl
+++ b/core/css/cssom/StylePropertyMap.idl
@@ -2,16 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// https://drafts.css-houdini.org/css-typed-om/#the-stylepropertymap
[
- RuntimeEnabled=CSSTypedOM,
- GarbageCollected
-] interface StylePropertyMap {
- [RaisesException] void append(DOMString property, (StyleValue or sequence<StyleValue> or DOMString) value);
+ Exposed=(Window,PaintWorklet),
+ RuntimeEnabled=CSSTypedOM
+] interface StylePropertyMap : StylePropertyMapReadonly {
+ [RaisesException] void append(DOMString property, (CSSStyleValue or sequence<CSSStyleValue> or DOMString) value);
[RaisesException, ImplementedAs=remove] void delete(DOMString property);
- StyleValue? get(DOMString property);
- sequence<StyleValue> getAll(DOMString property);
- boolean has(DOMString property);
- [RaisesException] void set(DOMString property, (StyleValue or sequence<StyleValue> or DOMString) value);
- iterable<DOMString, (StyleValue or sequence<StyleValue>)>;
- sequence<DOMString> getProperties();
+ [RaisesException] void set(DOMString property, (CSSStyleValue or sequence<CSSStyleValue> or DOMString) value);
};
diff --git a/core/css/cssom/StylePropertyMapReadonly.idl b/core/css/cssom/StylePropertyMapReadonly.idl
new file mode 100644
index 0000000..5bfc2e2
--- /dev/null
+++ b/core/css/cssom/StylePropertyMapReadonly.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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 CSSTypedOM, PaintWorklet CSSPaintAPI)
+] interface StylePropertyMapReadonly {
+ [RaisesException] CSSStyleValue? get(DOMString property);
+ [RaisesException] sequence<CSSStyleValue> getAll(DOMString property);
+ [RaisesException] boolean has(DOMString property);
+ iterable<DOMString, (CSSStyleValue or sequence<CSSStyleValue>)>;
+ sequence<DOMString> getProperties();
+};
diff --git a/core/css/cssom/StyleValue.idl b/core/css/cssom/StyleValue.idl
deleted file mode 100644
index 85b809d..0000000
--- a/core/css/cssom/StyleValue.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// 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=CSSTypedOM,
- GarbageCollected
-] interface StyleValue {
- readonly attribute DOMString cssString;
- // static (StyleValue or sequence<StyleValue>)? parse(DOMString property, DOMString cssText);
- [CallWith=ScriptState] static object? parse(DOMString property, DOMString cssText);
-};
diff --git a/core/css/cssom/TransformComponent.idl b/core/css/cssom/TransformComponent.idl
deleted file mode 100644
index f8da462..0000000
--- a/core/css/cssom/TransformComponent.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2016 The Chromium 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=CSSTypedOM,
- GarbageCollected
-] interface TransformComponent {
- readonly attribute DOMString cssString;
- boolean is2DComponent();
- [NewObject] Matrix asMatrix();
-};
diff --git a/core/css/cssom/TransformValue.idl b/core/css/cssom/TransformValue.idl
deleted file mode 100644
index 2168f5f..0000000
--- a/core/css/cssom/TransformValue.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- Constructor(),
- Constructor(sequence<TransformComponent> transformComponents),
- RuntimeEnabled=CSSTypedOM
-] interface TransformValue : StyleValue {
- iterable<TransformComponent>;
- boolean is2D();
-};
diff --git a/core/css/cssom/Translation.idl b/core/css/cssom/Translation.idl
deleted file mode 100644
index 464b7cd..0000000
--- a/core/css/cssom/Translation.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 The Chromium 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(LengthValue x, LengthValue y),
- Constructor(LengthValue x, LengthValue y, LengthValue z),
- ImplementedAs=TranslationTransformComponent,
- RaisesException=Constructor,
- RuntimeEnabled=CSSTypedOM
-] interface Translation : TransformComponent {
- readonly attribute LengthValue x;
- readonly attribute LengthValue y;
- readonly attribute LengthValue z;
-};
diff --git a/core/css/cssom/WindowGetComputedStyle.idl b/core/css/cssom/WindowGetComputedStyle.idl
new file mode 100644
index 0000000..e9b3105
--- /dev/null
+++ b/core/css/cssom/WindowGetComputedStyle.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/css-typed-om/#computed-stylepropertymap-objects
+
+[
+ ImplementedAs=WindowGetComputedStyle,
+ RuntimeEnabled=CSSTypedOM
+] partial interface Window {
+ [NewObject] StylePropertyMapReadonly getComputedStyleMap(Element element, optional DOMString? pseudoElement = null);
+};
diff --git a/core/dom/AccessibleNode.idl b/core/dom/AccessibleNode.idl
new file mode 100644
index 0000000..f19a3ac
--- /dev/null
+++ b/core/dom/AccessibleNode.idl
@@ -0,0 +1,69 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Accessibility Object Model node
+// Explainer: https://github.com/WICG/aom/blob/master/explainer.md
+// Spec: https://wicg.github.io/aom/spec/
+[
+ Constructor,
+ ConstructorCallWith=Document,
+ RuntimeEnabled=AccessibilityObjectModel
+] interface AccessibleNode : EventTarget {
+ attribute AccessibleNode? activeDescendant;
+ attribute boolean? atomic;
+ attribute DOMString? autocomplete;
+ attribute boolean? busy;
+ attribute DOMString? checked;
+ attribute long? colCount;
+ attribute unsigned long? colIndex;
+ attribute unsigned long? colSpan;
+ attribute AccessibleNodeList? controls;
+ attribute DOMString? current;
+ attribute AccessibleNodeList? describedBy;
+ attribute AccessibleNode? details;
+ attribute boolean? disabled;
+ attribute AccessibleNode? errorMessage;
+ attribute boolean? expanded;
+ attribute AccessibleNodeList? flowTo;
+ attribute DOMString? hasPopUp;
+ attribute boolean? hidden;
+ attribute DOMString? invalid;
+ attribute DOMString? keyShortcuts;
+ attribute DOMString? label;
+ attribute AccessibleNodeList? labeledBy;
+ attribute unsigned long? level;
+ attribute DOMString? live;
+ attribute boolean? modal;
+ attribute boolean? multiline;
+ attribute boolean? multiselectable;
+ attribute DOMString? orientation;
+ attribute AccessibleNodeList? owns;
+ attribute DOMString? placeholder;
+ attribute unsigned long? posInSet;
+ attribute DOMString? pressed;
+ attribute boolean? readOnly;
+ attribute DOMString? relevant;
+ attribute boolean? required;
+ attribute DOMString? role;
+ attribute DOMString? roleDescription;
+ attribute long? rowCount;
+ attribute unsigned long? rowIndex;
+ attribute unsigned long? rowSpan;
+ attribute boolean? selected;
+ attribute long? setSize;
+ attribute DOMString? sort;
+ attribute double? valueMax;
+ attribute double? valueMin;
+ attribute double? valueNow;
+ attribute DOMString? valueText;
+
+ attribute EventHandler onaccessibleclick;
+ attribute EventHandler onaccessiblecontextmenu;
+ attribute EventHandler onaccessibledecrement;
+ attribute EventHandler onaccessiblefocus;
+ attribute EventHandler onaccessibleincrement;
+ attribute EventHandler onaccessiblescrollintoview;
+
+ [RaisesException] void appendChild(AccessibleNode child);
+};
diff --git a/core/dom/AccessibleNodeList.idl b/core/dom/AccessibleNodeList.idl
new file mode 100644
index 0000000..ec9a2b1
--- /dev/null
+++ b/core/dom/AccessibleNodeList.idl
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Accessibility Object Model node list
+// Explainer: https://github.com/WICG/aom/blob/master/explainer.md
+// Spec: https://wicg.github.io/aom/spec/
+[
+ Constructor(optional sequence<AccessibleNode> nodes = []),
+ RuntimeEnabled=AccessibilityObjectModel
+] interface AccessibleNodeList {
+ attribute unsigned long length;
+ getter AccessibleNode? item(unsigned long index);
+ [RaisesException] setter void (unsigned long index, AccessibleNode node);
+ void add(AccessibleNode node, optional AccessibleNode? before = null);
+ void remove(long index);
+};
diff --git a/core/dom/ArrayBuffer.idl b/core/dom/ArrayBuffer.idl
deleted file mode 100644
index 12c506b..0000000
--- a/core/dom/ArrayBuffer.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://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
deleted file mode 100644
index d300904..0000000
--- a/core/dom/ArrayBufferView.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://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 54540ba..0d099d8 100644
--- a/core/dom/Attr.idl
+++ b/core/dom/Attr.idl
@@ -20,17 +20,14 @@
// https://dom.spec.whatwg.org/#interface-attr
-// FIXME: Attr should not inherit from Node. crbug.com/305105
interface Attr : Node {
readonly attribute DOMString? namespaceURI;
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
+ [CEReactions, CustomElementCallbacks] attribute DOMString value;
- [MeasureAs=AttributeOwnerElement] readonly attribute Element? ownerElement;
+ readonly attribute Element? ownerElement;
- [MeasureAs=AttributeSpecified] readonly attribute boolean specified; // useless; always returns true
+ readonly attribute boolean specified; // useless; always returns true
};
diff --git a/core/dom/CDATASection.idl b/core/dom/CDATASection.idl
index d672cce..6cd8f22 100644
--- a/core/dom/CDATASection.idl
+++ b/core/dom/CDATASection.idl
@@ -17,9 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-// https://dom.spec.whatwg.org/#cdatasection
+// https://dom.spec.whatwg.org/#interface-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 5be7888..1d21611 100644
--- a/core/dom/CharacterData.idl
+++ b/core/dom/CharacterData.idl
@@ -20,7 +20,7 @@
// https://dom.spec.whatwg.org/#interface-characterdata
interface CharacterData : Node {
- [TreatNullAs=NullString] attribute DOMString data;
+ attribute [TreatNullAs=NullString] DOMString data;
readonly attribute unsigned long length;
[RaisesException] DOMString substringData(unsigned long offset, unsigned long count);
void appendData(DOMString data);
diff --git a/core/dom/ChildNode.idl b/core/dom/ChildNode.idl
index 8c2f9f3..1d71889 100644
--- a/core/dom/ChildNode.idl
+++ b/core/dom/ChildNode.idl
@@ -24,11 +24,10 @@
[
LegacyTreatAsPartialInterface,
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface ChildNode {
- // [Unscopeable] void before((Node or DOMString)... nodes);
- // [Unscopeable] void after((Node or DOMString)... nodes);
- // [Unscopeable] void replaceWith((Node or DOMString)... nodes);
- // TODO(philipj): remove() should be [Unscopeable]. crbug.com/462916
- [RaisesException, CustomElementCallbacks] void remove();
+ [Unscopable, RaisesException, CEReactions, CustomElementCallbacks] void before((Node or DOMString) ... nodes);
+ [Unscopable, RaisesException, CEReactions, CustomElementCallbacks] void after((Node or DOMString)... nodes);
+ [Unscopable, RaisesException, CEReactions, CustomElementCallbacks] void replaceWith((Node or DOMString)... nodes);
+ [Unscopable, RaisesException, CEReactions, CustomElementCallbacks] void remove();
};
diff --git a/core/dom/ClientRect.idl b/core/dom/ClientRect.idl
deleted file mode 100644
index 5d68b87..0000000
--- a/core/dom/ClientRect.idl
+++ /dev/null
@@ -1,44 +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.
- *
- */
-
-// 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
-
-[
- GarbageCollected,
-] interface ClientRect {
- readonly attribute float top;
- readonly attribute float right;
- readonly attribute float bottom;
- readonly attribute float left;
- readonly attribute float width;
- readonly attribute float height;
-};
diff --git a/core/dom/ClientRectList.idl b/core/dom/ClientRectList.idl
deleted file mode 100644
index 38eb2a6..0000000
--- a/core/dom/ClientRectList.idl
+++ /dev/null
@@ -1,48 +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.
- *
- */
-
-// 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."
-
-[
- GarbageCollected,
-] interface ClientRectList {
- readonly attribute unsigned long length;
- [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 6ecf8f0..c22cc4a 100644
--- a/core/dom/Comment.idl
+++ b/core/dom/Comment.idl
@@ -21,6 +21,6 @@
[
Constructor(optional DOMString data = ""),
- ConstructorCallWith=Document,
+ ConstructorCallWith=Document
] interface Comment : CharacterData {
};
diff --git a/core/dom/CommonDefinitions.idl b/core/dom/CommonDefinitions.idl
index 30bb95f..d9e3f29 100644
--- a/core/dom/CommonDefinitions.idl
+++ b/core/dom/CommonDefinitions.idl
@@ -2,7 +2,11 @@
// 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
+// https://heycam.github.io/webidl/#common
typedef (ArrayBuffer or ArrayBufferView) BufferSource;
typedef unsigned long long DOMTimeStamp;
+
+// typedefs used in multiple files.
+
+typedef object JSON;
diff --git a/core/dom/CompositorProxy.idl b/core/dom/CompositorProxy.idl
deleted file mode 100644
index 53de14b..0000000
--- a/core/dom/CompositorProxy.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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
deleted file mode 100644
index d0c9544..0000000
--- a/core/dom/DOMError.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 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.
- * 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.
- */
-
-// https://dom.spec.whatwg.org/#domerror
-
-// FIXME: DOMError has been removed from the spec. crbug.com/460725
-[
- Constructor(DOMString name, optional DOMString message = null),
- GarbageCollected,
- Measure,
-] interface DOMError {
- [Measure] readonly attribute DOMString name;
- [Measure] readonly attribute DOMString message;
-};
diff --git a/core/dom/DOMException.idl b/core/dom/DOMException.idl
index a2f4571..bbf3701 100644
--- a/core/dom/DOMException.idl
+++ b/core/dom/DOMException.idl
@@ -27,23 +27,19 @@
*/
// Web IDL exceptions are defined in prose rather than IDL.
-// http://heycam.github.io/webidl/#idl-exceptions
-// http://heycam.github.io/webidl/#es-DOMException
+// https://heycam.github.io/webidl/#idl-exceptions
+// https://heycam.github.io/webidl/#es-DOMException
[
Constructor(optional DOMString message = "", optional DOMString name = "Error"),
Exposed=(Window,Worker),
- DoNotCheckConstants,
- GarbageCollected,
-] exception DOMException {
+ DoNotCheckConstants
+] interface DOMException {
readonly attribute unsigned short code;
readonly attribute DOMString name;
readonly attribute DOMString message;
- // Override in a Mozilla compatible format
- [NotEnumerable] DOMString toString();
-
// ExceptionCode
const unsigned short INDEX_SIZE_ERR = 1;
const unsigned short DOMSTRING_SIZE_ERR = 2;
diff --git a/core/dom/DOMImplementation.idl b/core/dom/DOMImplementation.idl
index b058f29..55871f8 100644
--- a/core/dom/DOMImplementation.idl
+++ b/core/dom/DOMImplementation.idl
@@ -21,14 +21,12 @@
// https://dom.spec.whatwg.org/#interface-domimplementation
[
- SetWrapperReferenceFrom=document,
- WillBeGarbageCollected,
+ DependentLifetime
] 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);
+ [NewObject] Document createHTMLDocument(optional DOMString title);
// useless; always returns true
boolean hasFeature();
diff --git a/core/dom/DOMMatrix.idl b/core/dom/DOMMatrix.idl
deleted file mode 100644
index ee0290d..0000000
--- a/core/dom/DOMMatrix.idl
+++ /dev/null
@@ -1,59 +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://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
- 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;
-
- 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
- DOMMatrix multiplySelf(DOMMatrix other);
- DOMMatrix preMultiplySelf(DOMMatrix other);
- DOMMatrix translateSelf(unrestricted double tx,
- unrestricted double ty,
- optional unrestricted double tz = 0);
- DOMMatrix scaleSelf(unrestricted double scale,
- optional unrestricted double originX = 0,
- optional unrestricted double originY = 0);
- DOMMatrix scale3dSelf(unrestricted double scale,
- 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
deleted file mode 100644
index f0cd565..0000000
--- a/core/dom/DOMMatrixReadOnly.idl
+++ /dev/null
@@ -1,63 +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://dev.w3.org/fxtf/geometry/#DOMMatrix
-
-[
- // FIXME: Constructor(sequence<unrestricted double> numberSequence)
- // FIXME: Exposed=(Window,Worker)
- GarbageCollected,
- RuntimeEnabled=GeometryInterfaces,
-] interface DOMMatrixReadOnly {
- // These attributes are simple aliases for certain elements of the 4x4 matrix
- readonly attribute unrestricted double a;
- readonly attribute unrestricted double b;
- readonly attribute unrestricted double c;
- readonly attribute unrestricted double d;
- readonly attribute unrestricted double e;
- readonly attribute unrestricted double f;
-
- readonly attribute unrestricted double m11;
- readonly attribute unrestricted double m12;
- readonly attribute unrestricted double m13;
- readonly attribute unrestricted double m14;
- readonly attribute unrestricted double m21;
- readonly attribute unrestricted double m22;
- readonly attribute unrestricted double m23;
- readonly attribute unrestricted double m24;
- readonly attribute unrestricted double m31;
- readonly attribute unrestricted double m32;
- readonly attribute unrestricted double m33;
- readonly attribute unrestricted double m34;
- readonly attribute unrestricted double m41;
- readonly attribute unrestricted double m42;
- readonly attribute unrestricted double m43;
- readonly attribute unrestricted double m44;
-
- readonly attribute boolean is2D;
- readonly attribute boolean isIdentity;
-
- // FIXME: Should implement some methods (See: crbug.com/388780)
- // Immutable transform methods
- DOMMatrix translate(unrestricted double tx,
- unrestricted double ty,
- optional unrestricted double tz = 0);
- DOMMatrix scale(unrestricted double scale,
- optional unrestricted double originX = 0,
- optional unrestricted double originY = 0);
- DOMMatrix scale3d(unrestricted double scale,
- 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
deleted file mode 100644
index 8c99323..0000000
--- a/core/dom/DOMPoint.idl
+++ /dev/null
@@ -1,20 +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://dev.w3.org/fxtf/geometry/#DOMPoint
-
-[
- // 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 {
- 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
deleted file mode 100644
index 136627f..0000000
--- a/core/dom/DOMPointInit.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.
-
-// http://dev.w3.org/fxtf/geometry/#DOMPoint
-
-dictionary DOMPointInit {
- unrestricted double x = 0;
- unrestricted double y = 0;
- unrestricted double z = 0;
- unrestricted double w = 1;
-};
diff --git a/core/dom/DOMPointReadOnly.idl b/core/dom/DOMPointReadOnly.idl
deleted file mode 100644
index e33d4f2..0000000
--- a/core/dom/DOMPointReadOnly.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://dev.w3.org/fxtf/geometry/#DOMPoint
-
-[
- Constructor(unrestricted double x, unrestricted double y,
- unrestricted double z, unrestricted double w),
- // FIXME: Exposed=(Window,Worker)
- GarbageCollected,
- RuntimeEnabled=GeometryInterfaces,
-] interface DOMPointReadOnly {
- readonly attribute unrestricted double x;
- readonly attribute unrestricted double y;
- readonly attribute unrestricted double z;
- readonly attribute unrestricted double w;
-
- // FIXME: Implement matrixTransform.
- // DOMPoint matrixTransform(DOMMatrixReadOnly matrix);
-};
diff --git a/core/dom/DOMRect.idl b/core/dom/DOMRect.idl
deleted file mode 100644
index 185d3ff..0000000
--- a/core/dom/DOMRect.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.
-
-// 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 {
- 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
deleted file mode 100644
index ca8532a..0000000
--- a/core/dom/DOMRectReadOnly.idl
+++ /dev/null
@@ -1,22 +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://dev.w3.org/fxtf/geometry/#DOMRect
-
-[
- Constructor(unrestricted double x, unrestricted double y,
- unrestricted double width, unrestricted double height),
- // FIXME: Exposed=(Window,Worker)
- GarbageCollected,
- RuntimeEnabled=GeometryInterfaces,
-] interface DOMRectReadOnly {
- readonly attribute unrestricted double x;
- readonly attribute unrestricted double y;
- readonly attribute unrestricted double width;
- readonly attribute unrestricted double height;
- readonly attribute unrestricted double top;
- readonly attribute unrestricted double right;
- readonly attribute unrestricted double bottom;
- readonly attribute unrestricted double left;
-};
diff --git a/core/dom/DOMStringList.idl b/core/dom/DOMStringList.idl
index 3821bd8..aabd5f5 100644
--- a/core/dom/DOMStringList.idl
+++ b/core/dom/DOMStringList.idl
@@ -23,15 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://dom.spec.whatwg.org/#domstringlist
+// https://html.spec.whatwg.org/multipage/infrastructure.html#domstringlist
-// FIXME: DOMStringList has been removed from the spec. crbug.com/460726
-[
- WillBeGarbageCollected,
-] interface DOMStringList {
+[Exposed=(Window,Worker)]
+interface DOMStringList {
readonly attribute unsigned long length;
- getter DOMString? (unsigned long index);
-
- [CallWith=ExecutionContext] DOMString? item(unsigned long index);
- [CallWith=ExecutionContext,MeasureAs=DOMStringListContains] boolean contains(DOMString string);
+ getter DOMString? item(unsigned long index);
+ boolean contains(DOMString string);
};
diff --git a/core/dom/DOMStringMap.idl b/core/dom/DOMStringMap.idl
index 2034eac..7e1045e 100644
--- a/core/dom/DOMStringMap.idl
+++ b/core/dom/DOMStringMap.idl
@@ -26,17 +26,10 @@
// https://html.spec.whatwg.org/#the-domstringmap-interface
[
- OverrideBuiltins,
- SetWrapperReferenceFrom=element,
- WillBeGarbageCollected,
+ DependentLifetime,
+ OverrideBuiltins
] interface DOMStringMap {
[ImplementedAs=item] getter DOMString (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);
+ [CEReactions, RaisesException] setter void (DOMString name, DOMString value);
+ [CEReactions] deleter void (DOMString name);
};
diff --git a/core/dom/DOMTokenList.idl b/core/dom/DOMTokenList.idl
index e49a183..1f8ef8c 100644
--- a/core/dom/DOMTokenList.idl
+++ b/core/dom/DOMTokenList.idl
@@ -10,37 +10,33 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
// https://dom.spec.whatwg.org/#interface-domtokenlist
[
- SetWrapperReferenceFrom=element,
- WillBeGarbageCollected,
+ DependentLifetime
] interface DOMTokenList {
readonly attribute unsigned long length;
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);
+ boolean contains(DOMString token);
+ [RaisesException, CEReactions, CustomElementCallbacks] void add(DOMString... tokens);
+ [RaisesException, CEReactions, CustomElementCallbacks] void remove(DOMString... tokens);
+ [RaisesException, CEReactions, CustomElementCallbacks] boolean toggle(DOMString token, optional boolean force);
+ [RaisesException, CEReactions] void replace(DOMString token, DOMString newToken);
[RaisesException, CustomElementCallbacks] boolean supports(DOMString token);
- attribute DOMString value;
- // FIXME: stringifier should be enumerable.
- [NotEnumerable] stringifier;
+ [CEReactions] attribute DOMString value;
+ stringifier;
iterable<DOMString>;
-
-
- // FIXME: This getter is not in the spec.
- [ImplementedAs=item] getter DOMString? (unsigned long index);
};
diff --git a/core/dom/DataView.idl b/core/dom/DataView.idl
deleted file mode 100644
index 876a0a8..0000000
--- a/core/dom/DataView.idl
+++ /dev/null
@@ -1,31 +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.
- */
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#DATAVIEW
-
-[
- ImplementedAs=DOMDataView,
-] interface DataView : ArrayBufferView {
-};
diff --git a/core/dom/Document.idl b/core/dom/Document.idl
index aafcdaf..48f6600 100644
--- a/core/dom/Document.idl
+++ b/core/dom/Document.idl
@@ -18,24 +18,32 @@
* Boston, MA 02110-1301, USA.
*/
-callback CustomElementConstructor = Element ();
+[Custom] callback CustomElementConstructor = Element ();
// https://html.spec.whatwg.org/#the-document-object
enum DocumentReadyState { "loading", "interactive", "complete" };
-// http://www.w3.org/TR/page-visibility/#VisibilityState
-enum VisibilityState { "hidden", "visible", "prerender", "unloaded" };
+
+// https://w3c.github.io/page-visibility/#visibility-states-and-the-visibilitystate-enum
+enum VisibilityState { "hidden", "visible", "prerender"};
+
+// https://wicg.github.io/cors-rfc1918/#feature-detect
+enum AddressSpace { "local", "private", "public" };
+
+typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
// https://dom.spec.whatwg.org/#interface-document
-// FIXME: Document should have a constructor. crbug.com/238234
-interface Document : Node {
+[
+ Constructor(),
+ ConstructorCallWith=Document
+] interface Document : Node {
[SameObject] readonly attribute DOMImplementation implementation;
- readonly attribute DOMString URL;
+ [ImplementedAs=urlForBinding] readonly attribute DOMString URL;
// FIXME: documentURI should not be nullable.
- [ImplementedAs=url] readonly attribute DOMString? documentURI;
- readonly attribute DOMString origin;
- [RuntimeEnabled=suborigins] readonly attribute DOMString suborigin;
+ [ImplementedAs=urlForBinding] readonly attribute DOMString? documentURI;
+ [MeasureAs=DocumentOrigin] readonly attribute DOMString origin;
+ [RuntimeEnabled=Suborigins] readonly attribute DOMString suborigin;
readonly attribute DOMString compatMode;
readonly attribute DOMString characterSet;
@@ -49,20 +57,21 @@
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, DoNotTestNewObject, CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName);
+ [NewObject, DoNotTestNewObject, CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
[NewObject] DocumentFragment createDocumentFragment();
[NewObject] Text createTextNode(DOMString data);
+ [NewObject, RaisesException] CDATASection createCDATASection(DOMString data);
[NewObject] Comment createComment(DOMString data);
[NewObject, RaisesException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
- [NewObject, CustomElementCallbacks, RaisesException] Node importNode(Node node, optional boolean deep = false);
- [RaisesException, CustomElementCallbacks] Node adoptNode(Node node);
+ [NewObject, DoNotTestNewObject, CEReactions, CustomElementCallbacks, RaisesException] Node importNode(Node node, optional boolean deep = false);
+ [RaisesException, CEReactions, CustomElementCallbacks] Node adoptNode(Node node);
[NewObject, RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute(DOMString localName);
[NewObject, RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName);
- [NewObject, RaisesException, CallWith=ExecutionContext] Event createEvent(DOMString eventType);
+ [NewObject, RaisesException, CallWith=ScriptState] Event createEvent(DOMString eventType);
[NewObject] Range createRange();
@@ -70,8 +79,8 @@
[NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[NewObject] 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);
+ // NonDocumentRootScroller (https://github.com/bokand/NonDocumentRootScroller)
+ [RaisesException=Setter, RuntimeEnabled=SetRootScroller, Measure] attribute Element? rootScroller;
// FIXME: xmlEncoding/xmlVersion/xmlStandalone have been removed from the spec.
[MeasureAs=DocumentXMLEncoding] readonly attribute DOMString? xmlEncoding;
@@ -83,45 +92,47 @@
// resource metadata management
- // Inheritance of [Unforgeable] attributes is not supported. So we have to
- // define the same unforgeable attributes in derived interfaces as well.
- // See that HTMLDocument and XMLDocument redefine 'location' attribute.
- // Keep all the definitions consistent.
- // TODO(yukishiino): Support inheritance of attributes defined on instance.
[PutForwards=href, Unforgeable] readonly attribute Location? location;
[RaisesException=Setter] attribute DOMString domain;
readonly attribute DOMString referrer;
- [RaisesException] attribute DOMString cookie;
+ [RaisesException, RuntimeCallStatsCounter=DocumentCookie] attribute DOMString cookie;
readonly attribute DOMString lastModified;
readonly attribute DocumentReadyState readyState;
// DOM tree accessors
- [CustomElementCallbacks] attribute DOMString title;
- [CustomElementCallbacks] attribute DOMString dir;
- [RaisesException=Setter, CustomElementCallbacks, PerWorldBindings] attribute HTMLElement? body;
+ // Named getter is implemented without IDL code generation for better
+ // performance. See LocalWindowProxy.cpp.
+ // getter object (DOMString name);
+ [CEReactions, CustomElementCallbacks] attribute DOMString title;
+ [CEReactions, CustomElementCallbacks] attribute DOMString dir;
+ [CEReactions, RaisesException=Setter, CustomElementCallbacks, PerWorldBindings] 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;
+ [SameObject, Measure] readonly attribute HTMLCollection images;
+ [SameObject, Measure] readonly attribute HTMLCollection embeds;
+ [SameObject, ImplementedAs=embeds, Measure] readonly attribute HTMLCollection plugins;
+ [SameObject, Measure] readonly attribute HTMLCollection links;
+ [SameObject, Measure] readonly attribute HTMLCollection forms;
+ [SameObject, Measure] readonly attribute HTMLCollection scripts;
[PerWorldBindings] NodeList getElementsByName(DOMString elementName);
- readonly attribute HTMLScriptElement? currentScript;
+ [ImplementedAs=currentScriptForBinding] readonly attribute HTMLOrSVGScriptElement? currentScript;
// dynamic markup insertion
// FIXME: There are two open() methods in the spec.
- [Custom, CustomElementCallbacks, RaisesException] void open();
- [RaisesException] void close();
- [CallWith=FirstWindow, CustomElementCallbacks, RaisesException] void write(DOMString... text);
- [CallWith=FirstWindow, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
+ [Custom, CEReactions, CustomElementCallbacks, RaisesException, MeasureAs=DocumentOpen] void open();
+ [CEReactions, RaisesException] void close();
+ [CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException] void write(DOMString... text);
+ [CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
+
+ // TrustedTypes variants of the above.
+ // TODO(mkwst): Write a spec for this.
+ [RuntimeEnabled=TrustedDOMTypes, CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException] void write(TrustedHTML text);
+ [RuntimeEnabled=TrustedDOMTypes, CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException] void writeln(TrustedHTML text);
// user interaction
- [ImplementedAs=domWindow] readonly attribute Window? defaultView;
- readonly attribute Element? activeElement;
+ readonly attribute Window? defaultView;
boolean hasFocus();
- [CustomElementCallbacks, MeasureAs=DocumentDesignMode] attribute DOMString designMode;
- [CustomElementCallbacks, RaisesException] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
+ [CEReactions, CustomElementCallbacks, MeasureAs=DocumentDesignMode] attribute DOMString designMode;
+ [CEReactions, 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);
@@ -135,71 +146,64 @@
// FIXME: *Color are on HTMLDocument.
- readonly attribute HTMLCollection anchors;
- readonly attribute HTMLCollection applets;
+ [Measure] readonly attribute HTMLCollection anchors;
+ [Measure] 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;
+ // https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
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
+ // https://w3c.github.io/pointerlock/#extensions-to-the-document-interface
attribute EventHandler onpointerlockchange;
attribute EventHandler onpointerlockerror;
- [MeasureAs=DocumentPointerLockElement] readonly attribute Element? pointerLockElement;
[MeasureAs=DocumentExitPointerLock] void exitPointerLock();
// 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, LegacyInterfaceTypeChecking] 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);
+ // https://w3c.github.io/touch-events/#extensions-to-the-document-interface
+ [OriginTrialEnabled=TouchEventFeatureDetection, Measure, LegacyInterfaceTypeChecking, Custom=CallPrologue]
+ Touch createTouch(Window view,
+ EventTarget target,
+ long identifier,
+ double pageX,
+ double pageY,
+ double screenX,
+ double screenY,
+ optional unrestricted double radiusX = 0,
+ optional unrestricted double radiusY = 0,
+ optional unrestricted float rotationAngle = 0,
+ optional unrestricted float force = 0);
+ [OriginTrialEnabled=TouchEventFeatureDetection] TouchList createTouchList(Touch... touches);
// Custom Elements
- // http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register
+ // https://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
+ // https://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);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName, (DOMString or Dictionary)? options);
+ [CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName, (DOMString or Dictionary)? options);
// Page Visibility
- // http://www.w3.org/TR/page-visibility/#sec-document-interface
+ // https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
readonly attribute boolean hidden;
readonly attribute VisibilityState visibilityState;
+ // CORS and RFC1918
+ // https://wicg.github.io/cors-rfc1918/#feature-detect
+ [RuntimeEnabled=CorsRFC1918, ImplementedAs=addressSpaceForBindings] readonly attribute AddressSpace addressSpace;
+
// Non-standard APIs
[MeasureAs=DocumentCaretRangeFromPoint] Range caretRangeFromPoint([Default=Undefined] optional long x, [Default=Undefined] optional long y);
// 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.
+ // document in the console. It's possible https://crbug.com/43394 will resolve this.
[MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityState] readonly attribute DOMString webkitVisibilityState;
[MeasureAs=PrefixedPageVisibility, ImplementedAs=hidden] readonly attribute boolean webkitHidden;
@@ -214,9 +218,11 @@
[RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute EventHandler onsecuritypolicyviolation;
attribute EventHandler onselectionchange;
attribute EventHandler onselectstart;
- attribute EventHandler onwheel;
+ attribute EventHandler onvisibilitychange;
};
Document implements GlobalEventHandlers;
Document implements ParentNode;
Document implements NonElementParentNode;
+Document implements DocumentOrShadowRoot;
+Document implements FontFaceSource;
diff --git a/core/dom/DocumentFragment.idl b/core/dom/DocumentFragment.idl
index e4df24a..ab728d2 100644
--- a/core/dom/DocumentFragment.idl
+++ b/core/dom/DocumentFragment.idl
@@ -21,7 +21,7 @@
[
Constructor,
- ConstructorCallWith=Document,
+ ConstructorCallWith=Document
] interface DocumentFragment : Node {
};
diff --git a/core/dom/DocumentFullscreen.idl b/core/dom/DocumentFullscreen.idl
deleted file mode 100644
index 808ac15..0000000
--- a/core/dom/DocumentFullscreen.idl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
- * Copyright (C) 2013 Google 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.
- */
-
-// https://fullscreen.spec.whatwg.org/#api
-
-partial interface Document {
- [RuntimeEnabled=FullscreenUnprefixed] readonly attribute boolean fullscreenEnabled;
- [RuntimeEnabled=FullscreenUnprefixed] readonly attribute Element? fullscreenElement;
-
- [RuntimeEnabled=FullscreenUnprefixed] void exitFullscreen();
-
- [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenchange;
- [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenerror;
-
- // Mozilla version
- [MeasureAs=PrefixedDocumentIsFullscreen, ImplementedAs=webkitCurrentFullScreenElement] readonly attribute boolean webkitIsFullScreen;
- [MeasureAs=PrefixedDocumentCurrentFullScreenElement] readonly attribute Element webkitCurrentFullScreenElement;
- [MeasureAs=PrefixedDocumentCancelFullScreen, ImplementedAs=exitFullscreen] void webkitCancelFullScreen();
-
- // W3C version
- [MeasureAs=PrefixedDocumentFullscreenEnabled, ImplementedAs=fullscreenEnabled] readonly attribute boolean webkitFullscreenEnabled;
- [MeasureAs=PrefixedDocumentFullscreenElement, ImplementedAs=fullscreenElement] readonly attribute Element webkitFullscreenElement;
- [MeasureAs=PrefixedDocumentExitFullscreen, ImplementedAs=exitFullscreen] void webkitExitFullscreen();
-
- attribute EventHandler onwebkitfullscreenchange;
- attribute EventHandler onwebkitfullscreenerror;
-};
diff --git a/core/dom/DocumentOrShadowRoot.idl b/core/dom/DocumentOrShadowRoot.idl
new file mode 100644
index 0000000..49f8af9
--- /dev/null
+++ b/core/dom/DocumentOrShadowRoot.idl
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium 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/#mixin-documentorshadowroot
+// https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
+[
+ LegacyTreatAsPartialInterface,
+ NoInterfaceObject
+] interface DocumentOrShadowRoot {
+ // Selection API
+ // https://w3c.github.io/selection-api/#extensions-to-document-interface
+ Selection? getSelection();
+ // CSSOM View Module
+ // https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
+ // TODO(foolip): 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;
+ [SameObject] readonly attribute StyleSheetList styleSheets;
+ // PointerLock API
+ // https://w3c.github.io/pointerlock/
+ readonly attribute Element? pointerLockElement;
+ // Fullscreen API
+ // https://fullscreen.spec.whatwg.org/
+ [RuntimeEnabled=FullscreenUnprefixed] readonly attribute Element? fullscreenElement;
+};
diff --git a/core/dom/Element.idl b/core/dom/Element.idl
index a516e09..6c8cf93 100644
--- a/core/dom/Element.idl
+++ b/core/dom/Element.idl
@@ -31,61 +31,73 @@
readonly attribute DOMString localName;
readonly attribute DOMString tagName;
- [Reflect] attribute DOMString id;
- [Reflect=class] attribute DOMString className;
- [SameObject, PerWorldBindings, PutForwards=value] readonly attribute DOMTokenList classList;
+ [CEReactions, Reflect] attribute DOMString id;
+ [CEReactions, Reflect=class] attribute DOMString className;
+ [SameObject, CEReactions, PerWorldBindings, PutForwards=value] readonly attribute DOMTokenList classList;
+ [Unscopable, CEReactions, Reflect] attribute DOMString slot;
- [MeasureAs=HasAttributes] boolean hasAttributes();
+ // Pointer Events
+ // https://w3c.github.io/pointerevents/#extensions-to-the-element-interface
+ [RaisesException] void setPointerCapture (long pointerId);
+ [RaisesException] void releasePointerCapture (long pointerId);
+ boolean hasPointerCapture (long pointerId);
+
+ boolean hasAttributes();
[SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes;
+ sequence<DOMString> getAttributeNames();
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);
+ [RaisesException, CEReactions, CustomElementCallbacks] void setAttribute(DOMString name, DOMString value);
+ [RaisesException, CEReactions, CustomElementCallbacks] void setAttributeNS(DOMString? namespaceURI, DOMString name, DOMString value);
+ [CEReactions, CustomElementCallbacks] void removeAttribute(DOMString name);
+ [CEReactions, CustomElementCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
boolean hasAttribute(DOMString name);
boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
- [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);
+ Attr? getAttributeNode(DOMString name);
+ Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
+ [RaisesException, CEReactions, CustomElementCallbacks] Attr? setAttributeNode(Attr attr);
+ [RaisesException, CEReactions, CustomElementCallbacks] Attr? setAttributeNodeNS(Attr attr);
+ [RaisesException, CEReactions, CustomElementCallbacks] Attr removeAttributeNode(Attr attr);
[RaisesException] Element? closest(DOMString selectors);
[RaisesException] boolean matches(DOMString selectors);
+ [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors); // historical alias of .matches
+
+ [RaisesException, CallWith=ScriptState, MeasureAs=ElementAttachShadow] ShadowRoot attachShadow(ShadowRootInit shadowRootInitDict);
+ [PerWorldBindings, ImplementedAs=OpenShadowRoot] readonly attribute ShadowRoot? shadowRoot;
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, CEReactions, CustomElementCallbacks] Element? insertAdjacentElement(DOMString where, Element element);
+ [RaisesException] void insertAdjacentText(DOMString where, DOMString data);
- // Shadow DOM
- // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
- [RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot();
- [RuntimeEnabled=ShadowDOMV1, RaisesException, CallWith=ScriptState, MeasureAs=ElementAttachShadow] ShadowRoot attachShadow(ShadowRootInit shadowRootInitDict);
- NodeList getDestinationInsertionPoints();
- [PerWorldBindings, ImplementedAs=openShadowRoot] readonly attribute ShadowRoot? shadowRoot;
- [RuntimeEnabled=ShadowDOMV1, Reflect] attribute DOMString slot;
- [RuntimeEnabled=ShadowDOMV1, ImplementedAs=assignedSlotForBinding] readonly attribute HTMLSlotElement assignedSlot;
+ // Mixin Slotable
+ // https://dom.spec.whatwg.org/#mixin-slotable
+ [ImplementedAs=assignedSlotForBinding] readonly attribute HTMLSlotElement? assignedSlot;
+
+ // DOM Parsing and Serialization
+ // https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
+ //
+ // TODO(mkwst): Write a spec for the `TrustedHTML` variants.
+ [TreatNullAs=NullString, CEReactions, CustomElementCallbacks, RaisesException=Setter, RuntimeCallStatsCounter=ElementInnerHTML] attribute HTMLString innerHTML;
+ [TreatNullAs=NullString, CEReactions, CustomElementCallbacks, RaisesException=Setter] attribute HTMLString outerHTML;
+ [CEReactions, CustomElementCallbacks, RaisesException] void insertAdjacentHTML(DOMString position, HTMLString text);
// Pointer Lock
- // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-element-interface
+ // https://w3c.github.io/pointerlock/#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);
+ // https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface
+ DOMRectList getClientRects();
+ [RuntimeCallStatsCounter=ElementGetBoundingClientRect] DOMRect getBoundingClientRect();
+
+ // TODO(sunyunjia): Add default value for scrollIntoView() once
+ // crbug.com/734599 is fixed.
+ void scrollIntoView(optional (ScrollIntoViewOptions or boolean) arg);
[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);
@@ -105,17 +117,22 @@
[RuntimeEnabled=ScrollCustomization] void setApplyScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
[RuntimeEnabled=ScrollCustomization] void setDistributeScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
- // 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);
+ // Typed OM
+ // https://drafts.css-houdini.org/css-typed-om/#inline-stylepropertymap-objects
+ [RuntimeEnabled=CSSTypedOM, SameObject] readonly attribute StylePropertyMap styleMap;
+
+ // Non-standard API
[MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
- [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors);
+ [RuntimeEnabled=ShadowDOMV0, RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot();
+ [RuntimeEnabled=ShadowDOMV0] NodeList getDestinationInsertionPoints();
// Experimental accessibility API
[RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedRole;
[RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? computedName;
+ // Accessibility Object Model
+ [RuntimeEnabled=AccessibilityObjectModel] readonly attribute AccessibleNode? accessibleNode;
+
// Event handler attributes
attribute EventHandler onbeforecopy;
attribute EventHandler onbeforecut;
@@ -125,7 +142,6 @@
attribute EventHandler onpaste;
attribute EventHandler onsearch;
attribute EventHandler onselectstart;
- attribute EventHandler onwheel;
};
Element implements ParentNode;
diff --git a/core/dom/ElementCreationOptions.idl b/core/dom/ElementCreationOptions.idl
new file mode 100644
index 0000000..feae6b5
--- /dev/null
+++ b/core/dom/ElementCreationOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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/#dictdef-elementcreationoptions
+
+dictionary ElementCreationOptions {
+ DOMString is;
+};
diff --git a/core/dom/ElementDefinitionOptions.idl b/core/dom/ElementDefinitionOptions.idl
new file mode 100644
index 0000000..e0844ed
--- /dev/null
+++ b/core/dom/ElementDefinitionOptions.idl
@@ -0,0 +1,7 @@
+// Copyright 2016 The Chromium 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://html.spec.whatwg.org/#elementdefinitionoptions
+dictionary ElementDefinitionOptions {
+ DOMString? extends = null;
+};
diff --git a/core/dom/ElementFullscreen.idl b/core/dom/ElementFullscreen.idl
deleted file mode 100644
index e27ee3d..0000000
--- a/core/dom/ElementFullscreen.idl
+++ /dev/null
@@ -1,18 +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://fullscreen.spec.whatwg.org/#api
-
-partial interface Element {
- [RuntimeEnabled=FullscreenUnprefixed] void requestFullscreen();
-
- // Mozilla version
- [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen();
-
- // W3C version
- [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen();
-
- attribute EventHandler onwebkitfullscreenchange;
- attribute EventHandler onwebkitfullscreenerror;
-};
diff --git a/core/dom/ElementRegistrationOptions.idl b/core/dom/ElementRegistrationOptions.idl
index cbda61d..0dba4c3 100644
--- a/core/dom/ElementRegistrationOptions.idl
+++ b/core/dom/ElementRegistrationOptions.idl
@@ -2,7 +2,7 @@
// 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
+// Spec: https://w3c.github.io/webcomponents/spec/custom/#api-element-registration-options
dictionary ElementRegistrationOptions {
object? prototype = null;
diff --git a/core/dom/Float32Array.idl b/core/dom/Float32Array.idl
deleted file mode 100644
index a0f1e1a..0000000
--- a/core/dom/Float32Array.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://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
deleted file mode 100644
index f384340..0000000
--- a/core/dom/Float64Array.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://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
-
-[
- ImplementedAs=DOMFloat64Array,
- NoInterfaceObject,
-] interface Float64Array : ArrayBufferView {
-};
diff --git a/core/dom/FrameRequestCallback.idl b/core/dom/FrameRequestCallback.idl
index ddf7cda..927a889 100644
--- a/core/dom/FrameRequestCallback.idl
+++ b/core/dom/FrameRequestCallback.idl
@@ -28,10 +28,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TODO(philipj): FrameRequestCallback should not be a callback interface.
-// https://www.w3.org/Bugs/Public/show_bug.cgi?id=28152
-callback interface FrameRequestCallback {
- // highResTime is passed as high resolution timestamp, see
- // http://www.w3.org/TR/hr-time/ for details.
- void handleEvent(double highResTime);
-};
+// https://html.spec.whatwg.org/multipage/window-object.html#framerequestcallback
+
+callback FrameRequestCallback = void(DOMHighResTimeStamp highResTime);
diff --git a/core/dom/FunctionStringCallback.idl b/core/dom/FunctionStringCallback.idl
new file mode 100644
index 0000000..9df2be6
--- /dev/null
+++ b/core/dom/FunctionStringCallback.idl
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+// https://html.spec.whatwg.org/#the-datatransferitem-interface
+
+callback FunctionStringCallback = void (DOMString data);
diff --git a/core/dom/GetRootNodeOptions.idl b/core/dom/GetRootNodeOptions.idl
new file mode 100644
index 0000000..f0a99c7
--- /dev/null
+++ b/core/dom/GetRootNodeOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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/#dictdef-getrootnodeoptions
+
+dictionary GetRootNodeOptions {
+ boolean composed = false;
+};
diff --git a/core/dom/GlobalEventHandlers.idl b/core/dom/GlobalEventHandlers.idl
index 5366bd8..861515d 100644
--- a/core/dom/GlobalEventHandlers.idl
+++ b/core/dom/GlobalEventHandlers.idl
@@ -31,11 +31,9 @@
[
LegacyTreatAsPartialInterface,
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface GlobalEventHandlers {
attribute EventHandler onabort;
- [RuntimeEnabled=RequestAutocomplete] attribute EventHandler onautocomplete;
- [RuntimeEnabled=RequestAutocomplete] attribute EventHandler onautocompleteerror;
attribute EventHandler onblur;
attribute EventHandler oncancel;
attribute EventHandler oncanplay;
@@ -88,7 +86,6 @@
attribute EventHandler onseeked;
attribute EventHandler onseeking;
attribute EventHandler onselect;
- attribute EventHandler onshow;
//attribute EventHandler onsort;
attribute EventHandler onstalled;
attribute EventHandler onsubmit;
@@ -97,22 +94,29 @@
attribute EventHandler ontoggle;
attribute EventHandler onvolumechange;
attribute EventHandler onwaiting;
+ attribute EventHandler onwheel;
+
+ // auxclick
+ // https://wicg.github.io/auxclick/
+ attribute EventHandler onauxclick;
// Pointer Events
// https://w3c.github.io/pointerevents/#extensions-to-the-globaleventhandlers-interface
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerdown;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointermove;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerup;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointercancel;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerover;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerout;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerenter;
- [RuntimeEnabled=PointerEvent] attribute EventHandler onpointerleave;
+ attribute EventHandler ongotpointercapture;
+ attribute EventHandler onlostpointercapture;
+ attribute EventHandler onpointerdown;
+ attribute EventHandler onpointermove;
+ attribute EventHandler onpointerup;
+ attribute EventHandler onpointercancel;
+ attribute EventHandler onpointerover;
+ attribute EventHandler onpointerout;
+ attribute EventHandler onpointerenter;
+ attribute EventHandler onpointerleave;
// Touch Events
// https://w3c.github.io/touch-events/#extensions-to-the-globaleventhandlers-interface
- [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchend;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
- [RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
+ [OriginTrialEnabled=TouchEventFeatureDetection] attribute EventHandler ontouchcancel;
+ [OriginTrialEnabled=TouchEventFeatureDetection] attribute EventHandler ontouchend;
+ [OriginTrialEnabled=TouchEventFeatureDetection] attribute EventHandler ontouchmove;
+ [OriginTrialEnabled=TouchEventFeatureDetection] attribute EventHandler ontouchstart;
};
diff --git a/core/dom/IdleDeadline.idl b/core/dom/IdleDeadline.idl
index 1550789..806691f 100644
--- a/core/dom/IdleDeadline.idl
+++ b/core/dom/IdleDeadline.idl
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- GarbageCollected,
- RuntimeEnabled=RequestIdleCallback,
-] interface IdleDeadline {
+// https://w3c.github.io/requestidlecallback/#window_extensions
+
+interface IdleDeadline {
double timeRemaining();
readonly attribute boolean didTimeout;
};
diff --git a/core/dom/IdleRequestCallback.idl b/core/dom/IdleRequestCallback.idl
index b4cda7e..e2f9c0c 100644
--- a/core/dom/IdleRequestCallback.idl
+++ b/core/dom/IdleRequestCallback.idl
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- GarbageCollected,
- RuntimeEnabled=RequestIdleCallback,
-] callback interface IdleRequestCallback {
- void handleEvent(IdleDeadline deadline);
-};
+// https://w3c.github.io/requestidlecallback/#window_extensions
+
+callback IdleRequestCallback = void (IdleDeadline deadline);
diff --git a/core/dom/IdleRequestOptions.idl b/core/dom/IdleRequestOptions.idl
index cd89101..9764baa 100644
--- a/core/dom/IdleRequestOptions.idl
+++ b/core/dom/IdleRequestOptions.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://w3c.github.io/requestidlecallback/#window_extensions
+
dictionary IdleRequestOptions {
unsigned long timeout = 0;
};
diff --git a/core/dom/Int16Array.idl b/core/dom/Int16Array.idl
deleted file mode 100644
index 19edc3c..0000000
--- a/core/dom/Int16Array.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://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
deleted file mode 100644
index 76a42f6..0000000
--- a/core/dom/Int32Array.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://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
deleted file mode 100644
index a56cf6d..0000000
--- a/core/dom/Int8Array.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://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
-
-[
- ImplementedAs=DOMInt8Array,
- NoInterfaceObject,
-] interface Int8Array : ArrayBufferView {
-};
diff --git a/core/dom/IntersectionObserver.idl b/core/dom/IntersectionObserver.idl
deleted file mode 100644
index eb6122b..0000000
--- a/core/dom/IntersectionObserver.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Chromium 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(szager): add link to final spec.
-callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
-
-// TODO(szager): Update the doc link when the spec has an official home.
-// https://github.com/slightlyoff/IntersectionObserver
-[
- CustomConstructor(IntersectionObserverCallback callback, IntersectionObserverInit options),
- Custom=VisitDOMWrapper,
- GarbageCollected,
- RuntimeEnabled=IntersectionObserver,
-] interface IntersectionObserver {
- [RaisesException] void observe(Element target);
- [RaisesException] void unobserve(Element target);
- void disconnect();
- sequence<IntersectionObserverEntry> takeRecords();
- readonly attribute Element? root;
- readonly attribute DOMString rootMargin;
- readonly attribute double[] thresholds;
-};
diff --git a/core/dom/IntersectionObserverEntry.idl b/core/dom/IntersectionObserverEntry.idl
deleted file mode 100644
index 14d7268..0000000
--- a/core/dom/IntersectionObserverEntry.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2016 The Chromium 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/slightlyoff/IntersectionObserver
-
-[
- GarbageCollected,
- RuntimeEnabled=IntersectionObserver,
-] interface IntersectionObserverEntry {
- readonly attribute ClientRect boundingClientRect;
- readonly attribute ClientRect intersectionRect;
- readonly attribute ClientRect? rootBounds;
- readonly attribute Element target;
- readonly attribute DOMHighResTimeStamp time;
-};
diff --git a/core/dom/IntersectionObserverInit.idl b/core/dom/IntersectionObserverInit.idl
deleted file mode 100644
index f333646..0000000
--- a/core/dom/IntersectionObserverInit.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 The Chromium 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(szager): link to final spec
-
-[
- RuntimeEnabled=IntersectionObserver
-] dictionary IntersectionObserverInit {
- Element? root;
- DOMString rootMargin;
- (double or double[]) threshold = 0;
-};
diff --git a/core/dom/Iterator.idl b/core/dom/Iterator.idl
index 4a13fe5..106a46a 100644
--- a/core/dom/Iterator.idl
+++ b/core/dom/Iterator.idl
@@ -5,9 +5,7 @@
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-iterator-interface
[
- Iterable,
- GarbageCollected,
- NoInterfaceObject,
+ NoInterfaceObject
] interface Iterator {
[CallWith=ScriptState, RaisesException] any next(optional any value);
};
diff --git a/core/dom/MessageChannel.idl b/core/dom/MessageChannel.idl
index 35aa1c0..8462ff0 100644
--- a/core/dom/MessageChannel.idl
+++ b/core/dom/MessageChannel.idl
@@ -29,8 +29,7 @@
[
CustomConstructor,
Exposed=(Window,Worker),
- GarbageCollected,
- Measure,
+ Measure
] interface MessageChannel {
readonly attribute MessagePort port1;
readonly attribute MessagePort port2;
diff --git a/core/dom/MessagePort.idl b/core/dom/MessagePort.idl
index 895e05e..d42739e 100644
--- a/core/dom/MessagePort.idl
+++ b/core/dom/MessagePort.idl
@@ -28,14 +28,15 @@
// https://html.spec.whatwg.org/#message-ports
[
+ ActiveScriptWrappable,
DependentLifetime,
- Exposed=(Window,Worker),
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface MessagePort : EventTarget {
- [PostMessage, RaisesException, Measure] void postMessage(any message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException, Measure] void postMessage(any message, optional sequence<object> transfer = []);
[Measure] void start();
[Measure] void close();
// event handlers
attribute EventHandler onmessage;
+ attribute EventHandler onmessageerror;
};
diff --git a/core/dom/MutationObserver.idl b/core/dom/MutationObserver.idl
index 467b454..e266d48 100644
--- a/core/dom/MutationObserver.idl
+++ b/core/dom/MutationObserver.idl
@@ -30,12 +30,16 @@
// https://dom.spec.whatwg.org/#interface-mutationobserver
+callback MutationCallback = void (sequence<MutationRecord> mutations,
+ MutationObserver observer);
+
[
- CustomConstructor(MutationCallback callback),
- Custom=VisitDOMWrapper,
- WillBeGarbageCollected,
+ ConstructorCallWith=ScriptState,
+ Constructor(MutationCallback callback),
+ ActiveScriptWrappable,
+ DependentLifetime
] interface MutationObserver {
- [RaisesException] void observe(Node target, MutationObserverInit options);
+ [RaisesException] void observe(Node target, optional MutationObserverInit options);
void disconnect();
sequence<MutationRecord> takeRecords();
};
diff --git a/core/dom/MutationRecord.idl b/core/dom/MutationRecord.idl
index 0ca53dc..7231500 100644
--- a/core/dom/MutationRecord.idl
+++ b/core/dom/MutationRecord.idl
@@ -30,9 +30,7 @@
// https://dom.spec.whatwg.org/#interface-mutationrecord
-[
- WillBeGarbageCollected,
-] interface MutationRecord {
+interface MutationRecord {
readonly attribute DOMString type;
readonly attribute Node target;
[SameObject] readonly attribute NodeList addedNodes;
diff --git a/core/dom/NamedNodeMap.idl b/core/dom/NamedNodeMap.idl
index b5af211..4b7fa55 100644
--- a/core/dom/NamedNodeMap.idl
+++ b/core/dom/NamedNodeMap.idl
@@ -21,17 +21,15 @@
// https://dom.spec.whatwg.org/#interface-namednodemap
[
- SetWrapperReferenceFrom=element,
- WillBeGarbageCollected,
+ DependentLifetime,
+ LegacyUnenumerableNamedProperties
] interface NamedNodeMap {
readonly attribute unsigned long length;
[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=NamedNodeMapGetNamedItem] getter Attr? getNamedItem(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);
+ [RaisesException, CEReactions, CustomElementCallbacks, MeasureAs=NamedNodeMapSetNamedItem] Attr? setNamedItem(Attr attr);
+ [RaisesException, CEReactions, CustomElementCallbacks, MeasureAs=NamedNodeMapSetNamedItemNS] Attr? setNamedItemNS(Attr attr);
+ [RaisesException, CEReactions, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItem] Attr removeNamedItem(DOMString name);
+ [RaisesException, CEReactions, CustomElementCallbacks, MeasureAs=NamedNodeMapRemoveNamedItemNS] Attr removeNamedItemNS(DOMString? namespaceURI, DOMString localName);
};
diff --git a/core/dom/Node.idl b/core/dom/Node.idl
index d3271a4..bcee1ff 100644
--- a/core/dom/Node.idl
+++ b/core/dom/Node.idl
@@ -21,13 +21,11 @@
// https://dom.spec.whatwg.org/#interface-node
[
- DependentLifetime,
+ DependentLifetime
] 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
@@ -38,10 +36,11 @@
const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
const unsigned short NOTATION_NODE = 12; // historical
[ImplementedAs=getNodeType] readonly attribute unsigned short nodeType;
- readonly attribute DOMString nodeName;
+ [RuntimeCallStatsCounter=NodeName] readonly attribute DOMString nodeName;
- readonly attribute DOMString? baseURI;
+ readonly attribute USVString baseURI;
+ [Measure] readonly attribute boolean isConnected;
[PerWorldBindings] readonly attribute Document? ownerDocument;
[PerWorldBindings] readonly attribute Node? parentNode;
[PerWorldBindings] readonly attribute Element? parentElement;
@@ -51,15 +50,16 @@
[PerWorldBindings] readonly attribute Node? lastChild;
[PerWorldBindings] readonly attribute Node? previousSibling;
[PerWorldBindings] readonly attribute Node? nextSibling;
- [RuntimeEnabled=ShadowDOMV1, MeasureAs=NodeTreeRoot] readonly attribute Node treeRoot;
+ [MeasureAs=NodeGetRootNode] Node getRootNode(optional GetRootNodeOptions options);
- [CustomElementCallbacks] attribute DOMString? nodeValue;
- // FIXME: textContent should not have [TreatUndefinedAs=NullString].
- [TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString? textContent;
- [CustomElementCallbacks] void normalize();
+ [CEReactions, CustomElementCallbacks] attribute DOMString? nodeValue;
- [NewObject, CustomElementCallbacks] Node cloneNode(optional boolean deep = false);
- boolean isEqualNode(Node? node);
+ [CEReactions, CustomElementCallbacks] attribute DOMString? textContent;
+ [CEReactions, CustomElementCallbacks] void normalize();
+
+ [NewObject, DoNotTestNewObject, CEReactions, CustomElementCallbacks, RaisesException] Node cloneNode(optional boolean deep = false);
+ boolean isEqualNode(Node? otherNode);
+ boolean isSameNode(Node? otherNode); // historical alias of ===
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
@@ -74,12 +74,8 @@
DOMString? lookupNamespaceURI(DOMString? prefix);
boolean isDefaultNamespace(DOMString? namespaceURI);
- [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: isSameNode has been removed from the spec:
- // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27424
- [MeasureAs=NodeIsSameNode, ImplementedAs=isSameNodeDeprecated] boolean isSameNode(Node? other);
+ [CEReactions, CustomElementCallbacks, PerWorldBindings, RaisesException] Node insertBefore(Node node, Node? child);
+ [CEReactions, CustomElementCallbacks, PerWorldBindings, RaisesException, RuntimeCallStatsCounter=NodeAppendChild] Node appendChild(Node node);
+ [CEReactions, CustomElementCallbacks, PerWorldBindings, RaisesException] Node replaceChild(Node node, Node child);
+ [CEReactions, CustomElementCallbacks, RaisesException, RuntimeCallStatsCounter=NodeRemoveChild] Node removeChild(Node child);
};
diff --git a/core/dom/NodeFilter.idl b/core/dom/NodeFilter.idl
index bcb5557..dac845f 100644
--- a/core/dom/NodeFilter.idl
+++ b/core/dom/NodeFilter.idl
@@ -20,11 +20,9 @@
// https://dom.spec.whatwg.org/#interface-nodefilter
-// FIXME: NodeFilter should be a callback interface. crbug.com/462946
[
- DependentLifetime,
- WillBeGarbageCollected,
-] interface NodeFilter {
+ DependentLifetime
+] callback interface NodeFilter {
// Constants for acceptNode()
const unsigned short FILTER_ACCEPT = 1;
const unsigned short FILTER_REJECT = 2;
@@ -35,7 +33,7 @@
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_CDATA_SECTION = 0x8;
const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical
const unsigned long SHOW_ENTITY = 0x20; // historical
const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40;
@@ -45,6 +43,8 @@
const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400;
const unsigned long SHOW_NOTATION = 0x800; // historical
- // FIXME: The node argument should not be optional.
- [RaisesException, LegacyInterfaceTypeChecking] unsigned short acceptNode([Default=Undefined] optional Node node);
+ // This function declaration doesn't generate any code because
+ // V8NodeFilterCondition represents this callback interface in Blink.
+ // TODO(bashi): Fix crbug.com/630986, and use generated code.
+ [RaisesException] unsigned short acceptNode(Node node);
};
diff --git a/core/dom/NodeIterator.idl b/core/dom/NodeIterator.idl
index 4262b7a..b6c4a39 100644
--- a/core/dom/NodeIterator.idl
+++ b/core/dom/NodeIterator.idl
@@ -21,8 +21,7 @@
// https://dom.spec.whatwg.org/#interface-nodeiterator
[
- SetWrapperReferenceTo(NodeFilter filter),
- WillBeGarbageCollected,
+ DependentLifetime
] interface NodeIterator {
[SameObject] readonly attribute Node root;
readonly attribute Node referenceNode;
diff --git a/core/dom/NodeList.idl b/core/dom/NodeList.idl
index 0d85493..6a6e594 100644
--- a/core/dom/NodeList.idl
+++ b/core/dom/NodeList.idl
@@ -21,11 +21,9 @@
// https://dom.spec.whatwg.org/#interface-nodelist
[
- DependentLifetime,
- SetWrapperReferenceFrom=virtualOwnerNode,
- WillBeGarbageCollected,
+ DependentLifetime
] interface NodeList {
getter Node? item(unsigned long index);
readonly attribute unsigned long length;
- [RuntimeEnabled=IterableCollections] iterable<Node>;
+ iterable<Node>;
};
diff --git a/core/dom/NonDocumentTypeChildNode.idl b/core/dom/NonDocumentTypeChildNode.idl
index b2883c4..d186e00 100644
--- a/core/dom/NonDocumentTypeChildNode.idl
+++ b/core/dom/NonDocumentTypeChildNode.idl
@@ -6,8 +6,8 @@
[
LegacyTreatAsPartialInterface,
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface NonDocumentTypeChildNode {
- [PerWorldBindings] readonly attribute Element previousElementSibling;
- [PerWorldBindings] readonly attribute Element nextElementSibling;
+ [PerWorldBindings] readonly attribute Element? previousElementSibling;
+ [PerWorldBindings] readonly attribute Element? nextElementSibling;
};
diff --git a/core/dom/NonElementParentNode.idl b/core/dom/NonElementParentNode.idl
index 3f4ef6e..03511a6 100644
--- a/core/dom/NonElementParentNode.idl
+++ b/core/dom/NonElementParentNode.idl
@@ -6,7 +6,7 @@
[
LegacyTreatAsPartialInterface,
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface NonElementParentNode {
[PerWorldBindings] Element? getElementById(DOMString elementId);
};
diff --git a/core/dom/NoncedElement.idl b/core/dom/NoncedElement.idl
new file mode 100644
index 0000000..cf3b6d7
--- /dev/null
+++ b/core/dom/NoncedElement.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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/whatwg/html/pull/2373/
+//
+// TODO(mkwst): Update the link iff this lands.
+
+[
+ NoInterfaceObject
+] interface NoncedElement {
+ [CEReactions] attribute DOMString nonce;
+};
diff --git a/core/dom/ParentNode.idl b/core/dom/ParentNode.idl
index e660f6c..e73eac8 100644
--- a/core/dom/ParentNode.idl
+++ b/core/dom/ParentNode.idl
@@ -32,18 +32,18 @@
[
LegacyTreatAsPartialInterface,
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface ParentNode {
[SameObject, PerWorldBindings] readonly attribute HTMLCollection children;
[PerWorldBindings] readonly attribute Element? firstElementChild;
[PerWorldBindings] readonly attribute Element? lastElementChild;
readonly attribute unsigned long childElementCount;
- // [Unscopeable] void prepend((Node or DOMString)... nodes);
- // [Unscopeable] void append((Node or DOMString)... nodes);
+ [Unscopable, RaisesException, CEReactions, CustomElementCallbacks] void prepend((Node or DOMString)... nodes);
+ [Unscopable, RaisesException, CEReactions, CustomElementCallbacks] void append((Node or DOMString)... nodes);
- // [Unscopeable] Element? query(DOMString relativeSelectors);
- // [NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
+ // [Unscopable] Element? query(DOMString relativeSelectors);
+ // [NewObject, Unscopable] 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 650e74c..e466208 100644
--- a/core/dom/ProcessingInstruction.idl
+++ b/core/dom/ProcessingInstruction.idl
@@ -24,6 +24,6 @@
readonly attribute DOMString target;
// ProcessingInstruction implements LinkStyle
- // http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction
- readonly attribute StyleSheet sheet;
+ // https://drafts.csswg.org/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 88a4a36..b52226d 100644
--- a/core/dom/Range.idl
+++ b/core/dom/Range.idl
@@ -19,22 +19,19 @@
*/
// https://dom.spec.whatwg.org/#interface-range
-
-// FIXME: All long types in this interface should be unsigned long.
[
Constructor,
- ConstructorCallWith=Document,
- WillBeGarbageCollected,
+ ConstructorCallWith=Document
] interface Range {
readonly attribute Node startContainer;
- readonly attribute long startOffset;
+ readonly attribute unsigned long startOffset;
readonly attribute Node endContainer;
- readonly attribute long endOffset;
+ readonly attribute unsigned long endOffset;
readonly attribute boolean collapsed;
readonly attribute Node commonAncestorContainer;
- [RaisesException] void setStart(Node node, long offset);
- [RaisesException] void setEnd(Node node, long offset);
+ [RaisesException] void setStart(Node node, unsigned long offset);
+ [RaisesException] void setEnd(Node node, unsigned long offset);
[RaisesException] void setStartBefore(Node node);
[RaisesException] void setStartAfter(Node node);
[RaisesException] void setEndBefore(Node node);
@@ -49,32 +46,30 @@
const unsigned short END_TO_START = 3;
[RaisesException] short compareBoundaryPoints(unsigned short how, Range sourceRange);
- [RaisesException, CustomElementCallbacks] void deleteContents();
- [NewObject, RaisesException, CustomElementCallbacks] DocumentFragment extractContents();
- [NewObject, RaisesException, CustomElementCallbacks] DocumentFragment cloneContents();
- [RaisesException, CustomElementCallbacks] void insertNode(Node node);
- [RaisesException, CustomElementCallbacks] void surroundContents(Node newParent);
+ [RaisesException, CEReactions, CustomElementCallbacks] void deleteContents();
+ [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFragment extractContents();
+ [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFragment cloneContents();
+ [RaisesException, CEReactions, CustomElementCallbacks] void insertNode(Node node);
+ [RaisesException, CEReactions, CustomElementCallbacks] void surroundContents(Node newParent);
[NewObject] Range cloneRange();
[MeasureAs=RangeDetach] void detach();
- [RaisesException] boolean isPointInRange(Node node, long offset);
- [RaisesException] short comparePoint(Node node, long offset);
+ [RaisesException] boolean isPointInRange(Node node, unsigned long offset);
+ [RaisesException] short comparePoint(Node node, unsigned long offset);
[RaisesException] boolean intersectsNode(Node node);
stringifier;
// 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();
+ // https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface
+ DOMRectList getClientRects();
+ DOMRect 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);
+ // https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface
+ [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFragment createContextualFragment(DOMString fragment);
// Non-standard API
[RaisesException, DeprecateAs=RangeExpand] void expand([Default=Undefined] optional DOMString unit);
diff --git a/core/dom/ShadowRoot.idl b/core/dom/ShadowRoot.idl
new file mode 100644
index 0000000..cbf84ee
--- /dev/null
+++ b/core/dom/ShadowRoot.idl
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ * * 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/webcomponents/spec/shadow/#the-shadowroot-interface
+
+interface ShadowRoot : DocumentFragment {
+ readonly attribute ShadowRootMode mode;
+ readonly attribute Element host;
+ [ImplementedAs=olderShadowRootForBindings] readonly attribute ShadowRoot? olderShadowRoot;
+ [TreatNullAs=NullString, CEReactions, CustomElementCallbacks, RaisesException=Setter] attribute HTMLString innerHTML;
+ readonly attribute boolean delegatesFocus;
+};
+
+ShadowRoot implements DocumentOrShadowRoot;
diff --git a/core/dom/ShadowRootInit.idl b/core/dom/ShadowRootInit.idl
new file mode 100644
index 0000000..6bba7b9
--- /dev/null
+++ b/core/dom/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 {
+ required ShadowRootMode mode;
+ boolean delegatesFocus;
+};
diff --git a/core/dom/SharedArrayBuffer.idl b/core/dom/SharedArrayBuffer.idl
deleted file mode 100644
index 9ba56d5..0000000
--- a/core/dom/SharedArrayBuffer.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.
-
-// Draft spec: https://github.com/lars-t-hansen/ecmascript_sharedmem
-[
- ImplementedAs=DOMSharedArrayBuffer,
- NoInterfaceObject,
- RuntimeEnabled=SharedArrayBuffer,
-] interface SharedArrayBuffer {
- readonly attribute unsigned long byteLength;
-};
diff --git a/core/dom/StaticRange.idl b/core/dom/StaticRange.idl
new file mode 100644
index 0000000..2cb4a71
--- /dev/null
+++ b/core/dom/StaticRange.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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://garykac.github.io/staticrange/#interface-staticrange
+
+[
+ RuntimeEnabled=InputEvent
+] interface StaticRange {
+ readonly attribute Node startContainer;
+ readonly attribute unsigned long startOffset;
+ readonly attribute Node endContainer;
+ readonly attribute unsigned long endOffset;
+ readonly attribute boolean collapsed;
+};
diff --git a/core/dom/StringCallback.idl b/core/dom/StringCallback.idl
deleted file mode 100644
index b26a090..0000000
--- a/core/dom/StringCallback.idl
+++ /dev/null
@@ -1,33 +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:
- *
- * * 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 StringCallback {
- void handleEvent(DOMString data);
-};
diff --git a/core/dom/Text.idl b/core/dom/Text.idl
index f970d49..36f98f5 100644
--- a/core/dom/Text.idl
+++ b/core/dom/Text.idl
@@ -21,13 +21,15 @@
[
Constructor(optional DOMString data = ""),
- ConstructorCallWith=Document,
+ ConstructorCallWith=Document
] interface Text : CharacterData {
- [NewObject, RaisesException] Text splitText(unsigned long offset);
+ [NewObject, DoNotTestNewObject, RaisesException] Text splitText(unsigned long offset);
[MeasureAs=TextWholeText] readonly attribute DOMString wholeText;
- // Shadow DOM
- // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-text-interface
- NodeList getDestinationInsertionPoints();
- [RuntimeEnabled=ShadowDOMV1, ImplementedAs=assignedSlotForBinding] readonly attribute HTMLSlotElement assignedSlot;
+ // Mixin Slotable
+ // https://dom.spec.whatwg.org/#mixin-slotable
+ [ImplementedAs=assignedSlotForBinding] readonly attribute HTMLSlotElement? assignedSlot;
+
+ // Non-standard API:
+ [RuntimeEnabled=ShadowDOMV0] NodeList getDestinationInsertionPoints();
};
diff --git a/core/dom/Touch.idl b/core/dom/Touch.idl
deleted file mode 100644
index a48a023..0000000
--- a/core/dom/Touch.idl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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.
- */
-
-// https://w3c.github.io/touch-events/#touch-interface
-
-[
- Constructor(TouchInit initDict),
- ConstructorCallWith=Document,
- WillBeGarbageCollected,
-] interface Touch {
- 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;
- readonly attribute float radiusX;
- readonly attribute float radiusY;
- readonly attribute float rotationAngle;
- readonly attribute float force;
-};
diff --git a/core/dom/TouchInit.idl b/core/dom/TouchInit.idl
deleted file mode 100644
index ba733b6..0000000
--- a/core/dom/TouchInit.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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/touch-events/#touch-interface
-
-dictionary TouchInit {
- required long identifier;
- required EventTarget target;
- double clientX = 0;
- double clientY = 0;
- double screenX = 0;
- double screenY = 0;
- double pageX = 0;
- double pageY = 0;
- float radiusX = 0;
- float radiusY = 0;
- float rotationAngle = 0;
- float force = 0;
-};
diff --git a/core/dom/TouchList.idl b/core/dom/TouchList.idl
deleted file mode 100644
index ea7d013..0000000
--- a/core/dom/TouchList.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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.
- */
-
-// https://w3c.github.io/touch-events/#touchlist-interface
-
-[
- WillBeGarbageCollected,
-] interface TouchList {
- readonly attribute unsigned long length;
- getter Touch? item(unsigned long index);
-};
diff --git a/core/dom/TreeWalker.idl b/core/dom/TreeWalker.idl
index 4fa1298..3be3c86 100644
--- a/core/dom/TreeWalker.idl
+++ b/core/dom/TreeWalker.idl
@@ -21,8 +21,7 @@
// https://dom.spec.whatwg.org/#interface-treewalker
[
- SetWrapperReferenceTo(NodeFilter filter),
- WillBeGarbageCollected,
+ DependentLifetime
] interface TreeWalker {
[SameObject] readonly attribute Node root;
readonly attribute unsigned long whatToShow;
diff --git a/core/dom/URL.idl b/core/dom/URL.idl
deleted file mode 100644
index f5df0bb..0000000
--- a/core/dom/URL.idl
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2012 Motorola Mobility Inc.
- *
- * 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.
- */
-
-// https://url.spec.whatwg.org/#url
-
-[
- Constructor(USVString url, optional USVString base),
- Exposed=(Window,Worker),
- ImplementedAs=DOMURL,
- RaisesException=Constructor,
- GarbageCollected,
-] interface URL {
- // 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): The return type should not be nullable.
- [RaisesException, CallWith=ExecutionContext] static DOMString? createObjectURL(Blob blob);
- [CallWith=ExecutionContext] static void revokeObjectURL(DOMString url);
-};
-
-URL implements URLUtils;
diff --git a/core/dom/URLSearchParams.idl b/core/dom/URLSearchParams.idl
deleted file mode 100644
index 409542c..0000000
--- a/core/dom/URLSearchParams.idl
+++ /dev/null
@@ -1,21 +0,0 @@
-// 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://url.spec.whatwg.org/#interface-urlsearchparams
-
-[
- Constructor(optional (USVString or URLSearchParams) init = ""),
- GarbageCollected,
- Exposed=(Window,Worker)
-] interface URLSearchParams {
- void append(USVString name, USVString value);
- [ImplementedAs=deleteAllWithName] void delete(USVString name);
- USVString? get(USVString name);
- sequence<USVString> getAll(USVString name);
- boolean has(USVString name);
- void set(USVString name, USVString value);
-
- iterable<USVString, USVString>;
- stringifier;
-};
diff --git a/core/dom/URLUtils.idl b/core/dom/URLUtils.idl
deleted file mode 100644
index 8826e11..0000000
--- a/core/dom/URLUtils.idl
+++ /dev/null
@@ -1,49 +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:
- * 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.
- */
-
-// 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 USVString href;
- attribute USVString href;
- [NotEnumerable, ImplementedAs=href] USVString toString();
- readonly attribute USVString origin;
-
- 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 USVString hash;
-};
diff --git a/core/dom/URLUtilsReadOnly.idl b/core/dom/URLUtilsReadOnly.idl
deleted file mode 100644
index 9f5aac0..0000000
--- a/core/dom/URLUtilsReadOnly.idl
+++ /dev/null
@@ -1,45 +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:
- * 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.
- */
-
-// 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 USVString href;
- readonly attribute USVString href;
- [NotEnumerable, ImplementedAs=href] USVString toString();
- readonly attribute USVString origin;
-
- 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
deleted file mode 100644
index c494d06..0000000
--- a/core/dom/Uint16Array.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://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
deleted file mode 100644
index c68b421..0000000
--- a/core/dom/Uint32Array.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://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
deleted file mode 100644
index 5070342..0000000
--- a/core/dom/Uint8Array.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://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
deleted file mode 100644
index 0b74baf..0000000
--- a/core/dom/Uint8ClampedArray.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://www.khronos.org/registry/typedarray/specs/latest/#TYPEDARRAYS
-
-[
- ImplementedAs=DOMUint8ClampedArray,
- NoInterfaceObject,
-] interface Uint8ClampedArray : ArrayBufferView {
-};
diff --git a/core/dom/events/AddEventListenerOptions.idl b/core/dom/events/AddEventListenerOptions.idl
new file mode 100644
index 0000000..1d9e744
--- /dev/null
+++ b/core/dom/events/AddEventListenerOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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/#dictdef-addeventlisteneroptions
+
+dictionary AddEventListenerOptions : EventListenerOptions {
+ boolean passive;
+ boolean once = false;
+};
diff --git a/core/dom/events/CustomEvent.idl b/core/dom/events/CustomEvent.idl
new file mode 100644
index 0000000..410a1d7
--- /dev/null
+++ b/core/dom/events/CustomEvent.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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.
+ */
+
+// https://dom.spec.whatwg.org/#interface-customevent
+
+[
+ Constructor(DOMString type, optional CustomEventInit eventInitDict),
+ ConstructorCallWith=ScriptState,
+ DependentLifetime,
+ Exposed=(Window,Worker)
+] interface CustomEvent : Event {
+ [CallWith=ScriptState] readonly attribute any detail;
+
+ [Measure, CallWith=ScriptState] void initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null);
+};
diff --git a/core/events/CustomEventInit.idl b/core/dom/events/CustomEventInit.idl
similarity index 100%
rename from core/events/CustomEventInit.idl
rename to core/dom/events/CustomEventInit.idl
diff --git a/core/dom/events/Event.idl b/core/dom/events/Event.idl
new file mode 100644
index 0000000..b2115a2
--- /dev/null
+++ b/core/dom/events/Event.idl
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2006, 2007, 2009, 2011 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.
+ */
+
+// https://dom.spec.whatwg.org/#interface-event
+
+[
+ Constructor(DOMString type, optional EventInit eventInitDict),
+ Exposed=(Window,Worker)
+] interface Event {
+ readonly attribute DOMString type;
+ readonly attribute EventTarget? target;
+ readonly attribute EventTarget? currentTarget;
+ [MeasureAs=EventComposedPath, CallWith=ScriptState] sequence<EventTarget> composedPath();
+
+ 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;
+
+ [Measure] void stopPropagation();
+ [Measure] void stopImmediatePropagation();
+
+ readonly attribute boolean bubbles;
+ readonly attribute boolean cancelable;
+ void preventDefault();
+ readonly attribute boolean defaultPrevented;
+
+ [MeasureAs=EventComposed] readonly attribute boolean composed;
+
+ [Unforgeable] readonly attribute boolean isTrusted;
+
+ [CallWith=ScriptState] readonly attribute DOMHighResTimeStamp timeStamp;
+
+ [Measure] void initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false);
+
+ // Non-standard APIs
+ [MeasureAs=EventSrcElement] readonly attribute EventTarget srcElement;
+ [MeasureAs=EventReturnValue, CallWith=ScriptState, ImplementedAs=legacyReturnValue] attribute boolean returnValue;
+ [MeasureAs=EventCancelBubble, CallWith=ScriptState] attribute boolean cancelBubble;
+ [MeasureAs=EventPath, CallWith=ScriptState] readonly attribute object path;
+};
diff --git a/core/dom/events/EventInit.idl b/core/dom/events/EventInit.idl
new file mode 100644
index 0000000..97c7963
--- /dev/null
+++ b/core/dom/events/EventInit.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://dom.spec.whatwg.org/#interface-event
+
+dictionary EventInit {
+ boolean bubbles = false;
+ boolean cancelable = false;
+ boolean composed = false;
+};
diff --git a/core/dom/events/EventListener.idl b/core/dom/events/EventListener.idl
new file mode 100644
index 0000000..3f601bd
--- /dev/null
+++ b/core/dom/events/EventListener.idl
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+// https://dom.spec.whatwg.org/#callbackdef-eventlistener
+
+callback interface EventListener {
+ void handleEvent(Event event);
+};
diff --git a/core/dom/events/EventListenerOptions.idl b/core/dom/events/EventListenerOptions.idl
new file mode 100644
index 0000000..fc7785b
--- /dev/null
+++ b/core/dom/events/EventListenerOptions.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/#dictdef-eventlisteneroptions
+
+dictionary EventListenerOptions {
+ boolean capture = false;
+};
diff --git a/core/dom/events/EventModifierInit.idl b/core/dom/events/EventModifierInit.idl
new file mode 100644
index 0000000..73da090
--- /dev/null
+++ b/core/dom/events/EventModifierInit.idl
@@ -0,0 +1,19 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// https://w3c.github.io/uievents/#idl-def-EventModifierInit
+
+dictionary EventModifierInit : UIEventInit {
+ boolean ctrlKey = false;
+ boolean shiftKey = false;
+ boolean altKey = false;
+ boolean metaKey = false;
+ boolean modifierAltGraph = false;
+ boolean modifierCapsLock = false;
+ boolean modifierFn = false;
+ boolean modifierNumLock = false;
+ boolean modifierScrollLock = false;
+ boolean modifierSymbol = false;
+ // FIXME: Add modifierXXX members when needed.
+};
diff --git a/core/dom/events/EventTarget.idl b/core/dom/events/EventTarget.idl
new file mode 100644
index 0000000..7567440
--- /dev/null
+++ b/core/dom/events/EventTarget.idl
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+// https://dom.spec.whatwg.org/#interface-eventtarget
+
+[
+ CheckSecurity=Receiver,
+ Exposed=(Window,Worker),
+ ImmutablePrototype
+] interface EventTarget {
+ [Custom=CallPrologue] void addEventListener(DOMString type, EventListener? listener, optional (AddEventListenerOptions or boolean) options);
+ [Custom=CallPrologue] void removeEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
+ [ImplementedAs=dispatchEventForBindings, RaisesException, RuntimeCallStatsCounter=EventTargetDispatchEvent] boolean dispatchEvent(Event event);
+};
diff --git a/core/dom/shadow/ShadowRoot.idl b/core/dom/shadow/ShadowRoot.idl
deleted file mode 100644
index f783a41..0000000
--- a/core/dom/shadow/ShadowRoot.idl
+++ /dev/null
@@ -1,46 +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.
- * * 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/webcomponents/spec/shadow/#the-shadowroot-interface
-
-interface ShadowRoot : DocumentFragment {
- 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(optional boolean deep = false);
-};
diff --git a/core/dom/shadow/ShadowRootInit.idl b/core/dom/shadow/ShadowRootInit.idl
deleted file mode 100644
index 69321e7..0000000
--- a/core/dom/shadow/ShadowRootInit.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// 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 {
- required ShadowRootMode mode;
- [RuntimeEnabled=ShadowRootDelegatesFocus] boolean delegatesFocus;
-};
diff --git a/core/dom/trustedtypes/TrustedHTML.idl b/core/dom/trustedtypes/TrustedHTML.idl
new file mode 100644
index 0000000..6ddc306
--- /dev/null
+++ b/core/dom/trustedtypes/TrustedHTML.idl
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium 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 (DOMString or TrustedHTML) HTMLString;
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=TrustedDOMTypes
+] interface TrustedHTML {
+ [CallWith=ScriptState] static TrustedHTML escape(DOMString html);
+ [CallWith=ScriptState] static TrustedHTML unsafelyCreate(DOMString html);
+
+
+ stringifier;
+};
+
diff --git a/core/dom/trustedtypes/TrustedScriptURL.idl b/core/dom/trustedtypes/TrustedScriptURL.idl
new file mode 100644
index 0000000..67fff86
--- /dev/null
+++ b/core/dom/trustedtypes/TrustedScriptURL.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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 (DOMString or TrustedScriptURL) ScriptURLString;
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=TrustedDOMTypes
+] interface TrustedScriptURL {
+ [CallWith=ScriptState] static TrustedScriptURL unsafelyCreate(DOMString url);
+
+ stringifier;
+};
diff --git a/core/dom/trustedtypes/TrustedURL.idl b/core/dom/trustedtypes/TrustedURL.idl
new file mode 100644
index 0000000..c83585a
--- /dev/null
+++ b/core/dom/trustedtypes/TrustedURL.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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 (DOMString or TrustedURL) URLString;
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=TrustedDOMTypes
+] interface TrustedURL {
+ [CallWith=ScriptState] static TrustedURL create(DOMString url);
+ [CallWith=ScriptState] static TrustedURL unsafelyCreate(DOMString url);
+
+ stringifier;
+};
diff --git a/core/editing/Selection.idl b/core/editing/Selection.idl
index 51c2879..fc128c0 100644
--- a/core/editing/Selection.idl
+++ b/core/editing/Selection.idl
@@ -27,55 +27,43 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/selection-api/#idl-def-Selection
-
-// TODO(yoichio): All long types should be unsigned long. crbug.com/391673
-// TODO(philipj): No arguments are optional in the spec, but some should be:
-// https://github.com/w3c/selection-api/issues/30
+// https://w3c.github.io/selection-api/#selection-interface
[
- ImplementedAs=DOMSelection,
- WillBeGarbageCollected,
+ ImplementedAs=DOMSelection
] interface Selection {
[MeasureAs=SelectionAnchorNode] readonly attribute Node? anchorNode;
- [MeasureAs=SelectionAnchorOffset] readonly attribute long anchorOffset;
+ [MeasureAs=SelectionAnchorOffset] readonly attribute unsigned long anchorOffset;
[MeasureAs=SelectionFocusNode] readonly attribute Node? focusNode;
- [MeasureAs=SelectionFocusOffset] readonly attribute long focusOffset;
+ [MeasureAs=SelectionFocusOffset] readonly attribute unsigned long focusOffset;
[MeasureAs=SelectionIsCollapsed] readonly attribute boolean isCollapsed;
- [MeasureAs=SelectionRangeCount] readonly attribute long rangeCount;
+ [MeasureAs=SelectionRangeCount] readonly attribute unsigned long rangeCount;
[MeasureAs=SelectionType] readonly attribute DOMString type;
- [MeasureAs=SelectionGetRangeAt, RaisesException] Range getRangeAt(long index);
+ [MeasureAs=SelectionGetRangeAt, RaisesException] Range getRangeAt(unsigned long index);
[MeasureAs=SelectionAddRange] void addRange(Range range);
- // TODO(yoichio): Implement removeRange. crbug.com/391673
- //void removeRange(Range range);
+ void removeRange(Range range);
[MeasureAs=SelectionRemoveAllRanges] void removeAllRanges();
[MeasureAs=SelectionEmpty] void empty();
- [MeasureAs=SelectionCollapse, RaisesException, LegacyInterfaceTypeChecking] void collapse(Node? node, optional long offset = 0);
- [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, LegacyInterfaceTypeChecking] void setPosition(Node? node, optional long offset = 0);
+ [MeasureAs=SelectionCollapse, RaisesException] void collapse(Node? node, optional unsigned long offset = 0);
+ [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException] void setPosition(Node? node, optional unsigned long offset = 0);
[MeasureAs=SelectionCollapseToStart, RaisesException] void collapseToStart();
[MeasureAs=SelectionCollapseToEnd, RaisesException] void collapseToEnd();
- [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional long offset = 0);
- // TODO(philipj): The arguments should be anchorNode, anchorOffset,
- // focusNode and focusOffset, and none of them are optional or nullable in
- // the spec.
- [MeasureAs=SelectionSetBaseAndExtent, RaisesException, LegacyInterfaceTypeChecking] void setBaseAndExtent([Default=Undefined] optional Node? baseNode,
- [Default=Undefined] optional long baseOffset,
- [Default=Undefined] optional Node? extentNode,
- [Default=Undefined] optional long extentOffset);
+ [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional unsigned long offset = 0);
+ // TODO(foolip): The arguments should be anchorNode, anchorOffset,
+ // focusNode and focusOffset, and none of them are nullable in the spec.
+ [MeasureAs=SelectionSetBaseAndExtent, RaisesException] void setBaseAndExtent(Node? baseNode, unsigned long baseOffset,
+ Node? extentNode, unsigned long extentOffset);
[MeasureAs=SelectionSelectAllChildren, RaisesException] void selectAllChildren(Node node);
- [MeasureAs=SelectionDeleteDromDocument, CustomElementCallbacks] void deleteFromDocument();
+ [MeasureAs=SelectionDeleteDromDocument, CEReactions, CustomElementCallbacks] void deleteFromDocument();
[MeasureAs=SelectionContainsNode] boolean containsNode(Node node, optional boolean allowPartialContainment = false);
- // 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
- [MeasureAs=SelectionDOMString, NotEnumerable] stringifier DOMString();
+ [MeasureAs=SelectionDOMString] stringifier;
// Non-standard APIs
// https://github.com/w3c/selection-api/issues/34
[MeasureAs=SelectionBaseNode] readonly attribute Node? baseNode;
- [MeasureAs=SelectionBaseOffset] readonly attribute long baseOffset;
+ [MeasureAs=SelectionBaseOffset] readonly attribute unsigned long baseOffset;
[MeasureAs=SelectionExtentNode] readonly attribute Node? extentNode;
- [MeasureAs=SelectionExtentOffset] readonly attribute long extentOffset;
+ [MeasureAs=SelectionExtentOffset] readonly attribute unsigned long extentOffset;
// https://github.com/w3c/selection-api/issues/37
[MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMString alter,
diff --git a/core/events/AnimationEvent.idl b/core/events/AnimationEvent.idl
index 8b0b794..7daded3 100644
--- a/core/events/AnimationEvent.idl
+++ b/core/events/AnimationEvent.idl
@@ -23,13 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-animations/#interface-animationevent
+// https://drafts.csswg.org/css-animations/#interface-animationevent
[
- Constructor(DOMString type, optional AnimationEventInit eventInitDict),
+ Constructor(DOMString type, optional AnimationEventInit eventInitDict)
] interface AnimationEvent : Event {
readonly attribute DOMString animationName;
- // TODO(philipj): elapsedTime should be float.
+ // TODO(foolip): elapsedTime should be float.
readonly attribute double elapsedTime;
- // TODO(philipj): readonly attribute DOMString pseudoElement;
+ // TODO(foolip): readonly attribute DOMString pseudoElement;
};
diff --git a/core/events/AnimationEventInit.idl b/core/events/AnimationEventInit.idl
index ae6c9b9..c50bd68 100644
--- a/core/events/AnimationEventInit.idl
+++ b/core/events/AnimationEventInit.idl
@@ -2,11 +2,11 @@
// 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
+// https://drafts.csswg.org/css-animations/#interface-animationevent
dictionary AnimationEventInit : EventInit {
DOMString animationName = "";
- // TODO(philipj): elapsedTime should be float.
+ // TODO(foolip): elapsedTime should be float.
double elapsedTime = 0.0;
- // TODO(philipj): DOMString pseudoElement = "";
+ // TODO(foolip): DOMString pseudoElement = "";
};
diff --git a/core/events/AnimationPlaybackEvent.idl b/core/events/AnimationPlaybackEvent.idl
new file mode 100644
index 0000000..7558260
--- /dev/null
+++ b/core/events/AnimationPlaybackEvent.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/web-animations/#the-animationplaybackevent-interface
+
+[
+ Constructor(DOMString type, optional AnimationPlaybackEventInit eventInitDict),
+ RuntimeEnabled=WebAnimationsAPI
+] interface AnimationPlaybackEvent : Event {
+ readonly attribute double? currentTime;
+ readonly attribute double? timelineTime;
+};
diff --git a/core/events/AnimationPlaybackEventInit.idl b/core/events/AnimationPlaybackEventInit.idl
new file mode 100644
index 0000000..c8c82b1
--- /dev/null
+++ b/core/events/AnimationPlaybackEventInit.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/web-animations/#the-animationplaybackevent-interface
+
+dictionary AnimationPlaybackEventInit : EventInit {
+ double? currentTime = null;
+ double? timelineTime = null;
+};
diff --git a/core/events/AnimationPlayerEvent.idl b/core/events/AnimationPlayerEvent.idl
deleted file mode 100644
index 291567a..0000000
--- a/core/events/AnimationPlayerEvent.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// 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/
-
-[
- Constructor(DOMString type, optional AnimationPlayerEventInit eventInitDict),
- RuntimeEnabled=WebAnimationsAPI,
-] interface AnimationPlayerEvent : Event {
- readonly attribute double? currentTime;
- readonly attribute double timelineTime;
-};
diff --git a/core/events/AnimationPlayerEventInit.idl b/core/events/AnimationPlayerEventInit.idl
deleted file mode 100644
index f77620d..0000000
--- a/core/events/AnimationPlayerEventInit.idl
+++ /dev/null
@@ -1,13 +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://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 debc4a0..8bb5374 100644
--- a/core/events/ApplicationCacheErrorEvent.idl
+++ b/core/events/ApplicationCacheErrorEvent.idl
@@ -5,11 +5,11 @@
// 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:
+// TODO(foolip): Update the spec link once this is in the HTML spec:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22702
[
- Constructor(DOMString type, optional ApplicationCacheErrorEventInit eventInitDict),
+ Constructor(DOMString type, optional ApplicationCacheErrorEventInit eventInitDict)
] interface ApplicationCacheErrorEvent : Event {
readonly attribute DOMString reason;
readonly attribute DOMString url;
diff --git a/core/events/AutocompleteErrorEvent.idl b/core/events/AutocompleteErrorEvent.idl
deleted file mode 100644
index a65f1ee..0000000
--- a/core/events/AutocompleteErrorEvent.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:
- * 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. 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 INC. 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.
- */
-
-// 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
deleted file mode 100644
index 840ce04..0000000
--- a/core/events/AutocompleteErrorEventInit.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.
-
-// https://html.spec.whatwg.org/multipage/forms.html#the-autocompleteerrorevent-interface
-
-dictionary AutocompleteErrorEventInit : EventInit {
- AutocompleteErrorReason reason;
-};
diff --git a/core/events/ClipboardEvent.idl b/core/events/ClipboardEvent.idl
index 0b10b27..157705b 100644
--- a/core/events/ClipboardEvent.idl
+++ b/core/events/ClipboardEvent.idl
@@ -4,8 +4,8 @@
// 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;
+[
+ Constructor(DOMString type, optional ClipboardEventInit eventInitDict)
+] interface ClipboardEvent : Event {
+ readonly attribute DataTransfer? clipboardData;
};
diff --git a/core/events/ClipboardEventInit.idl b/core/events/ClipboardEventInit.idl
new file mode 100644
index 0000000..81ea1a4
--- /dev/null
+++ b/core/events/ClipboardEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium Authors. All rihts reserved.
+// Use of this source code is governed by a BST-style license that can be
+// found in the LICENSE file.
+
+// https://w3c.github.io/clipboard-apis/#clipboard-event-interfaces
+
+dictionary ClipboardEventInit : EventInit {
+ DataTransfer? clipboardData = null;
+};
diff --git a/core/events/CompositionEvent.idl b/core/events/CompositionEvent.idl
index 3d2a209..6a98cfe 100644
--- a/core/events/CompositionEvent.idl
+++ b/core/events/CompositionEvent.idl
@@ -26,12 +26,12 @@
// https://w3c.github.io/uievents/#interface-CompositionEvent
[
- Constructor(DOMString type, optional CompositionEventInit eventInitDict),
+ Constructor(DOMString type, optional CompositionEventInit eventInitDict)
] interface CompositionEvent : UIEvent {
readonly attribute DOMString data;
// https://w3c.github.io/uievents/#idl-interface-CompositionEvent-initializers
- // TODO(philipj): None of the initCompositionEvent() arguments should be
+ // TODO(foolip): 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,
diff --git a/core/events/CustomEvent.idl b/core/events/CustomEvent.idl
deleted file mode 100644
index ca1e27f..0000000
--- a/core/events/CustomEvent.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- *
- * 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.
- */
-
-// https://dom.spec.whatwg.org/#interface-customevent
-
-[
- // TODO(bashi): Don't use CustomConstructor. Constructor should be:
- // Constructor(DOMString type, optional CustomEventInit eventInitDict),
- CustomConstructor,
- Exposed=(Window,Worker),
-] interface CustomEvent : Event {
- [Custom=Getter] readonly attribute any detail;
-
- [Measure,Custom=(CallEpilogue)] void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
-};
diff --git a/core/events/DragEvent.idl b/core/events/DragEvent.idl
index 04047e2..13cf4b6 100644
--- a/core/events/DragEvent.idl
+++ b/core/events/DragEvent.idl
@@ -5,7 +5,7 @@
// https://html.spec.whatwg.org/multipage/interaction.html#dragevent
[
- Constructor(DOMString type, optional DragEventInit eventInitDict),
+ Constructor(DOMString type, optional DragEventInit eventInitDict)
] interface DragEvent : MouseEvent {
- readonly attribute DataTransfer dataTransfer;
+ [ImplementedAs=getDataTransfer] readonly attribute DataTransfer? dataTransfer;
};
diff --git a/core/events/DragEventInit.idl b/core/events/DragEventInit.idl
index 3b90386..ccf5837 100644
--- a/core/events/DragEventInit.idl
+++ b/core/events/DragEventInit.idl
@@ -5,5 +5,5 @@
// https://html.spec.whatwg.org/multipage/interaction.html#drageventinit
dictionary DragEventInit : MouseEventInit {
- DataTransfer? dataTransfer;
+ [ImplementedAs=getDataTransfer] DataTransfer? dataTransfer;
};
diff --git a/core/events/ErrorEvent.idl b/core/events/ErrorEvent.idl
index a26bac6..d6298b1 100644
--- a/core/events/ErrorEvent.idl
+++ b/core/events/ErrorEvent.idl
@@ -32,7 +32,8 @@
[
Constructor(DOMString type, optional ErrorEventInit eventInitDict),
- // TODO(philipj): Exposed=(Window,Worker)
+ ConstructorCallWith=ScriptState
+ // TODO(foolip): Exposed=(Window,Worker)
] interface ErrorEvent : Event {
readonly attribute DOMString message;
readonly attribute DOMString filename;
diff --git a/core/events/Event.idl b/core/events/Event.idl
deleted file mode 100644
index e2f5a1c..0000000
--- a/core/events/Event.idl
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2009, 2011 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.
- */
-
-// https://dom.spec.whatwg.org/#interface-event
-
-[
- Constructor(DOMString type, optional EventInit eventInitDict),
- Exposed=(Window,Worker),
- WillBeGarbageCollected,
-] interface Event {
- readonly attribute DOMString type;
- readonly attribute EventTarget? target;
- readonly attribute EventTarget? currentTarget;
-
- 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;
-
- void stopPropagation();
- void stopImmediatePropagation();
-
- readonly attribute boolean bubbles;
- readonly attribute boolean cancelable;
- void preventDefault();
- readonly attribute boolean defaultPrevented;
-
- [RuntimeEnabled=ShadowDOMV1, MeasureAs=EventScoped] readonly attribute boolean scoped;
-
- [RuntimeEnabled=TrustedEvents, Unforgeable] readonly attribute boolean isTrusted;
-
- // TODO(majidvp): At the moment the actual return value type can either
- // be:
- // - DOMTimeStamp (i.e. long long): legacy type
- // - DOMHighResTimeStamp (i.e. double): HighResEventTimeStamp REF is
- // enabled
- // Below IDL definition uses DOMHighResTimeStamp because all DOMTimeStamp
- // values can be represented in double type without any loss of precision.
- // Once the feature is enabled by default the return value type will always
- // match the definition here.
- [CallWith=ScriptState] readonly attribute DOMHighResTimeStamp 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;
- [RuntimeEnabled=ShadowDOMV1, MeasureAs=EventDeepPath, CallWith=ScriptState] sequence<EventTarget> deepPath();
-
- // 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;
- [MeasureAs=EventReturnValue, CallWith=ExecutionContext, ImplementedAs=legacyReturnValue] attribute boolean returnValue;
- [MeasureAs=EventCancelBubble] attribute boolean cancelBubble;
-};
diff --git a/core/events/EventInit.idl b/core/events/EventInit.idl
deleted file mode 100644
index 0ddc8ca..0000000
--- a/core/events/EventInit.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://dom.spec.whatwg.org/#interface-event
-
-dictionary EventInit {
- boolean bubbles = false;
- boolean cancelable = false;
- [RuntimeEnabled=ShadowDOMV1] boolean scoped = false;
-};
diff --git a/core/events/EventListener.idl b/core/events/EventListener.idl
deleted file mode 100644
index 2823f16..0000000
--- a/core/events/EventListener.idl
+++ /dev/null
@@ -1,27 +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.
- */
-
-// https://dom.spec.whatwg.org/#callbackdef-eventlistener
-
-[
- WillBeGarbageCollected
-] callback interface EventListener {
- void handleEvent(Event event);
-};
diff --git a/core/events/EventListenerOptions.idl b/core/events/EventListenerOptions.idl
deleted file mode 100644
index f670de3..0000000
--- a/core/events/EventListenerOptions.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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/RByers/EventListenerOptions
-
-dictionary EventListenerOptions {
- // TODO: |capture| is runtime enabled and its value actually
- // changes whether the feature is enabled or not. Setting
- // it to a default value here prevents the ability of checking
- // whether it was set manually or by default. See EventTarget.cpp
- // where it is populated. crbug.com/543685
- [RuntimeEnabled=EventListenerOptions] boolean capture;
- [RuntimeEnabled=PassiveEventListeners] boolean passive;
-};
diff --git a/core/events/EventModifierInit.idl b/core/events/EventModifierInit.idl
deleted file mode 100644
index 44caeb1..0000000
--- a/core/events/EventModifierInit.idl
+++ /dev/null
@@ -1,20 +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://w3c.github.io/uievents/#idl-def-EventModifierInit
-
-dictionary EventModifierInit : UIEventInit {
- boolean ctrlKey = false;
- boolean shiftKey = false;
- boolean altKey = false;
- boolean metaKey = false;
- boolean modifierAltGraph = false;
- boolean modifierCapsLock = false;
- boolean modifierFn = false;
- boolean modifierNumLock = false;
- boolean modifierOS = false;
- boolean modifierScrollLock = false;
- boolean modifierSymbol = false;
- // FIXME: Add modifierXXX members when needed.
-};
diff --git a/core/events/EventTarget.idl b/core/events/EventTarget.idl
deleted file mode 100644
index b17db3f..0000000
--- a/core/events/EventTarget.idl
+++ /dev/null
@@ -1,31 +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.
- */
-
-// https://dom.spec.whatwg.org/#interface-eventtarget
-
-[
- CheckSecurity=Receiver,
- WillBeGarbageCollected,
- Exposed=(Window,Worker)
-] interface EventTarget {
- [Custom] void addEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
- [Custom] void removeEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
- [ImplementedAs=dispatchEventForBindings, RaisesException] boolean dispatchEvent(Event event);
-};
diff --git a/core/events/FocusEvent.idl b/core/events/FocusEvent.idl
index 2f95287..a1cdb61 100644
--- a/core/events/FocusEvent.idl
+++ b/core/events/FocusEvent.idl
@@ -26,7 +26,7 @@
// https://w3c.github.io/uievents/#interface-FocusEvent
[
- Constructor(DOMString type, optional FocusEventInit eventInitDict),
+ Constructor(DOMString type, optional FocusEventInit eventInitDict)
] interface FocusEvent : UIEvent {
readonly attribute EventTarget? relatedTarget;
};
diff --git a/core/events/HashChangeEvent.idl b/core/events/HashChangeEvent.idl
index 40d4ec3..2629746 100644
--- a/core/events/HashChangeEvent.idl
+++ b/core/events/HashChangeEvent.idl
@@ -20,8 +20,8 @@
// https://html.spec.whatwg.org/multipage/browsers.html#the-hashchangeevent-interface
[
- Constructor(DOMString type, optional HashChangeEventInit eventInitDict),
- // TODO(philipj): Exposed=(Window,Worker)
+ Constructor(DOMString type, optional HashChangeEventInit eventInitDict)
+ // TODO(foolip): Exposed=(Window,Worker)
] interface HashChangeEvent : Event {
readonly attribute DOMString oldURL;
readonly attribute DOMString newURL;
diff --git a/core/events/InputEvent.idl b/core/events/InputEvent.idl
index cc1d595..ce2862c 100644
--- a/core/events/InputEvent.idl
+++ b/core/events/InputEvent.idl
@@ -2,11 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://w3c.github.io/editing/input-events.html
+// UI Events
+// https://w3c.github.io/uievents/#idl-inputevent
[
Constructor(DOMString type, optional InputEventInit eventInitDict),
- RuntimeEnabled=InputEvent,
+ RuntimeEnabled=InputEvent
] interface InputEvent : UIEvent {
- // TODO(chongz): Add 'inputType', 'data', 'isComposing' and 'targetRanges'
+ readonly attribute DOMString? data;
+ readonly attribute boolean isComposing;
+
+ // Input Events Level 1
+ // https://www.w3.org/TR/2017/WD-input-events-1-20170321/#interface-InputEvent
+ readonly attribute DOMString inputType;
+ readonly attribute DataTransfer? dataTransfer;
+ sequence<StaticRange> getTargetRanges();
};
diff --git a/core/events/InputEventInit.idl b/core/events/InputEventInit.idl
index 6b2d07d..9f59850 100644
--- a/core/events/InputEventInit.idl
+++ b/core/events/InputEventInit.idl
@@ -2,10 +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/editing/input-events.html
+// UI Events
+// https://w3c.github.io/uievents/#idl-inputeventinit
-[
- RuntimeEnabled=InputEvent,
-] dictionary InputEventInit : UIEventInit {
- // TODO(chongz): Add 'inputType', 'data', 'isComposing' and 'targetRanges'
+dictionary InputEventInit : UIEventInit {
+ DOMString? data;
+ boolean isComposing = false;
+
+ // Input Events Level 1
+ // https://www.w3.org/TR/2017/WD-input-events-1-20170321/#interface-InputEvent
+ DOMString inputType = "";
+ DataTransfer? dataTransfer;
+ sequence<StaticRange> targetRanges = [];
};
diff --git a/core/events/KeyboardEvent.idl b/core/events/KeyboardEvent.idl
index 15990ac..c9d23ec 100644
--- a/core/events/KeyboardEvent.idl
+++ b/core/events/KeyboardEvent.idl
@@ -22,42 +22,37 @@
[
Constructor(DOMString type, optional KeyboardEventInit eventInitDict),
- ConstructorCallWith=ScriptState,
+ 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 DOMString key;
+ 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;
+ readonly attribute boolean isComposing;
boolean getModifierState(DOMString keyArg);
// 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);
+ [CallWith=ScriptState, Measure] void initKeyboardEvent(DOMString type,
+ optional boolean bubbles = false,
+ optional boolean cancelable = false,
+ optional Window? view = null,
+ optional DOMString keyIdentifier = "",
+ optional unsigned long location = 0,
+ optional boolean ctrlKey = false,
+ optional boolean altKey = false,
+ optional boolean shiftKey = false,
+ optional boolean metaKey = false);
// https://w3c.github.io/uievents/#KeyboardEvent-supplemental-interface
readonly attribute long charCode;
readonly attribute long keyCode;
- readonly attribute long which;
-
- // Non-standard APIs
- [Measure] readonly attribute DOMString keyIdentifier;
};
diff --git a/core/events/KeyboardEventInit.idl b/core/events/KeyboardEventInit.idl
index d45a16d..e3091b9 100644
--- a/core/events/KeyboardEventInit.idl
+++ b/core/events/KeyboardEventInit.idl
@@ -5,12 +5,9 @@
// https://w3c.github.io/uievents/#idl-def-KeyboardEventInit
dictionary KeyboardEventInit : EventModifierInit {
- [RuntimeEnabled=KeyboardEventKey] DOMString key = "";
- [RuntimeEnabled=KeyboardEventCode] DOMString code = "";
+ DOMString key = "";
+ DOMString code = "";
unsigned long location = 0;
boolean repeat = false;
- // TODO(philipj): boolean isComposing = false;
-
- // Non-standard APIs
- DOMString keyIdentifier = "";
+ boolean isComposing = false;
};
diff --git a/core/events/MessageEvent.idl b/core/events/MessageEvent.idl
index 536ba1f..c6cbbad 100644
--- a/core/events/MessageEvent.idl
+++ b/core/events/MessageEvent.idl
@@ -30,24 +30,25 @@
[
Constructor(DOMString type, optional MessageEventInit eventInitDict),
Exposed=(Window,Worker),
- RaisesException=Constructor,
+ RaisesException=Constructor
] interface MessageEvent : Event {
[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;
- [RuntimeEnabled=suborigins] readonly attribute DOMString suborigin;
+ [CachedAttribute=isPortsDirty] readonly attribute FrozenArray<MessagePort> ports;
+ [RuntimeEnabled=Suborigins] readonly attribute DOMString suborigin;
- // TODO(philipj): None of the initMessageEvent() arguments should be
- // optional, and |sourceArg| and |portsArg| are of the wrong type.
+ // TODO(foolip): |typeArg| should not be optional, none of the arguments
+ // should have [Default=Undefined] (they have other default values in the
+ // spec) and |sourceArg|'s type is wrong.
[Custom, MeasureAs=InitMessageEvent] void initMessageEvent([Default=Undefined] optional DOMString typeArg,
[Default=Undefined] optional boolean canBubbleArg,
[Default=Undefined] optional boolean cancelableArg,
[Default=Undefined] optional any dataArg,
[Default=Undefined] optional DOMString originArg,
[Default=Undefined] optional DOMString lastEventIdArg,
- [Default=Undefined] optional Window sourceArg,
- [Default=Undefined] optional MessagePort[] portsArg);
+ [Default=Undefined] optional EventTarget sourceArg,
+ [Default=Undefined] optional sequence<MessagePort> portsArg);
};
diff --git a/core/events/MessageEventInit.idl b/core/events/MessageEventInit.idl
index d252965..bab4872 100644
--- a/core/events/MessageEventInit.idl
+++ b/core/events/MessageEventInit.idl
@@ -9,8 +9,6 @@
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;
+ EventTarget? source;
+ sequence<MessagePort> ports = [];
};
diff --git a/core/events/MouseEvent.idl b/core/events/MouseEvent.idl
index 0f4eab1..bf41fc8 100644
--- a/core/events/MouseEvent.idl
+++ b/core/events/MouseEvent.idl
@@ -21,12 +21,12 @@
[
Constructor(DOMString type, optional MouseEventInit eventInitDict),
- ConstructorCallWith=ScriptState,
+ ConstructorCallWith=ScriptState
] interface MouseEvent : UIEvent {
- readonly attribute long screenX;
- readonly attribute long screenY;
- readonly attribute long clientX;
- readonly attribute long clientY;
+ readonly attribute double screenX;
+ readonly attribute double screenY;
+ readonly attribute double clientX;
+ readonly attribute double clientY;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
@@ -37,7 +37,7 @@
boolean getModifierState(DOMString keyArg);
// https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers
- // TODO(philipj): None of the initMouseEvent() arguments should be optional.
+ // TODO(foolip): 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,
@@ -54,26 +54,25 @@
[Default=Undefined] optional unsigned short button,
[Default=Undefined] optional EventTarget? relatedTarget);
- // 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;
+ readonly attribute double pageX;
+ readonly attribute double pageY;
+ [MeasureAs=MouseEventX] readonly attribute double x;
+ [MeasureAs=MouseEventY] readonly attribute double y;
+ [MeasureAs=MouseEventOffsetX] readonly attribute double offsetX;
+ [MeasureAs=MouseEventOffsetY] readonly attribute double offsetY;
// Pointer Lock
- // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-mouseevent-interface
+ // https://w3c.github.io/pointerlock/#extensions-to-the-mouseevent-interface
[MeasureAs=MouseEventMovementX] readonly attribute long movementX;
[MeasureAs=MouseEventMovementY] readonly attribute long movementY;
+ // Canvas Hit Regions
+ // https://html.spec.whatwg.org/multipage/scripting.html#MouseEvent-partial
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute DOMString? region;
+
// Non-standard
[MeasureAs=MouseEventFromElement] readonly attribute Node fromElement;
[MeasureAs=MouseEventToElement] readonly attribute Node toElement;
- [MeasureAs=MouseEventWhich] readonly attribute long which;
[Measure] readonly attribute long layerX;
[Measure] readonly attribute long layerY;
};
diff --git a/core/events/MouseEventInit.idl b/core/events/MouseEventInit.idl
index cbb4d7d..001c4ad 100644
--- a/core/events/MouseEventInit.idl
+++ b/core/events/MouseEventInit.idl
@@ -5,16 +5,20 @@
// https://w3c.github.io/uievents/#idl-def-MouseEventInit
dictionary MouseEventInit : EventModifierInit {
- long screenX = 0;
- long screenY = 0;
- long clientX = 0;
- long clientY = 0;
+ double screenX = 0;
+ double screenY = 0;
+ double clientX = 0;
+ double 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
+ // https://w3c.github.io/pointerlock/#extensions-to-the-mouseeventinit-dictionary
long movementX = 0;
long movementY = 0;
+
+ // Canvas Hit Regions
+ // https://html.spec.whatwg.org/multipage/scripting.html#hit-regions:mouseeventinit
+ DOMString? region = null;
};
diff --git a/core/events/MutationEvent.idl b/core/events/MutationEvent.idl
index d3607a4..c377ae5 100644
--- a/core/events/MutationEvent.idl
+++ b/core/events/MutationEvent.idl
@@ -30,7 +30,7 @@
readonly attribute DOMString newValue;
readonly attribute DOMString attrName;
readonly attribute unsigned short attrChange;
- // TODO(philipj): None of the initMutationEvent() arguments should be optional.
+ // TODO(foolip): 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,
diff --git a/core/events/NavigatorEvents.idl b/core/events/NavigatorEvents.idl
index 433a944..0bc89e2 100644
--- a/core/events/NavigatorEvents.idl
+++ b/core/events/NavigatorEvents.idl
@@ -30,6 +30,8 @@
// https://w3c.github.io/pointerevents/#extensions-to-the-navigator-interface
-partial interface Navigator {
+[
+ ImplementedAs=NavigatorEvents
+] partial interface Navigator {
readonly attribute long maxTouchPoints;
};
diff --git a/core/events/PageTransitionEvent.idl b/core/events/PageTransitionEvent.idl
index 7dc109e..edd5d8b 100644
--- a/core/events/PageTransitionEvent.idl
+++ b/core/events/PageTransitionEvent.idl
@@ -26,8 +26,8 @@
// https://html.spec.whatwg.org/multipage/browsers.html#the-pagetransitionevent-interface
[
- Constructor(DOMString type, optional PageTransitionEventInit eventInitDict),
- // TODO(philipj): Exposed=(Window,Worker)
+ Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)
+ // TODO(foolip): Exposed=(Window,Worker)
] interface PageTransitionEvent : Event {
readonly attribute boolean persisted;
};
diff --git a/core/events/PointerEvent.idl b/core/events/PointerEvent.idl
index cecf01e..28f2625 100644
--- a/core/events/PointerEvent.idl
+++ b/core/events/PointerEvent.idl
@@ -5,15 +5,19 @@
// https://w3c.github.io/pointerevents/#pointerevent-interface
[
- Constructor(DOMString type, optional PointerEventInit eventInitDict),
- RuntimeEnabled=PointerEvent,
+ Constructor(DOMString type, optional PointerEventInit eventInitDict)
] 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;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute long pointerId;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute double width;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute double height;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute float pressure;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute long tiltX;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute long tiltY;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute float tangentialPressure;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute long twist;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute DOMString pointerType;
+ [MeasureAs=PointerEventAttributeCount] readonly attribute boolean isPrimary;
+
+ // https://w3c.github.io/pointerevents/extension.html#extensions-to-the-pointerevent-interface
+ [RuntimeEnabled=CoalescedEvents] sequence<PointerEvent> getCoalescedEvents();
};
diff --git a/core/events/PointerEventInit.idl b/core/events/PointerEventInit.idl
index d474bcd..2cd7d44 100644
--- a/core/events/PointerEventInit.idl
+++ b/core/events/PointerEventInit.idl
@@ -4,15 +4,18 @@
// https://w3c.github.io/pointerevents/#pointerevent-interface
-[
- RuntimeEnabled=PointerEvent,
-] dictionary PointerEventInit : MouseEventInit {
+dictionary PointerEventInit : MouseEventInit {
long pointerId = 0;
- double width = 0;
- double height = 0;
+ double width = 1;
+ double height = 1;
float pressure = 0;
long tiltX = 0;
long tiltY = 0;
+ float tangentialPressure = 0;
+ long twist = 0;
DOMString pointerType = "";
boolean isPrimary = false;
+
+ // https://w3c.github.io/pointerevents/extension.html#extensions-to-the-pointerevent-interface
+ [RuntimeEnabled=CoalescedEvents] sequence<PointerEvent> coalescedEvents = [];
};
diff --git a/core/events/PopStateEvent.idl b/core/events/PopStateEvent.idl
index 5d05163..ae8210c 100644
--- a/core/events/PopStateEvent.idl
+++ b/core/events/PopStateEvent.idl
@@ -28,7 +28,8 @@
[
Constructor(DOMString type, optional PopStateEventInit eventInitDict),
- // TODO(philipj): Exposed=(Window,Worker)
+ ConstructorCallWith=ScriptState
+ // TODO(foolip): Exposed=(Window,Worker)
] interface PopStateEvent : Event {
[Custom=Getter] readonly attribute any state;
};
diff --git a/core/events/PromiseRejectionEvent.idl b/core/events/PromiseRejectionEvent.idl
index 6cb2adf..074bb08 100644
--- a/core/events/PromiseRejectionEvent.idl
+++ b/core/events/PromiseRejectionEvent.idl
@@ -5,11 +5,10 @@
// https://github.com/domenic/unhandled-rejections-browser-spec
[
- RuntimeEnabled=PromiseRejectionEvent,
- Custom=VisitDOMWrapper,
Constructor(DOMString type, PromiseRejectionEventInit eventInitDict),
ConstructorCallWith=ScriptState,
Exposed=(Window,Worker),
+ DependentLifetime
] 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
index caa0e7e..fc5c110 100644
--- a/core/events/PromiseRejectionEventInit.idl
+++ b/core/events/PromiseRejectionEventInit.idl
@@ -4,9 +4,7 @@
// https://github.com/domenic/unhandled-rejections-browser-spec
-[
- RuntimeEnabled=PromiseRejectionEvent,
-] dictionary PromiseRejectionEventInit : EventInit {
+dictionary PromiseRejectionEventInit : EventInit {
required Promise<any> promise;
any reason;
};
diff --git a/core/events/RelatedEvent.idl b/core/events/RelatedEvent.idl
deleted file mode 100644
index 142bf29..0000000
--- a/core/events/RelatedEvent.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://html.spec.whatwg.org/#the-relatedevent-interfaces
-
-[
- Constructor(DOMString type, optional RelatedEventInit eventInitDict),
- RuntimeEnabled=ContextMenu,
-] interface RelatedEvent : Event {
- readonly attribute EventTarget? relatedTarget;
-};
diff --git a/core/events/RelatedEventInit.idl b/core/events/RelatedEventInit.idl
deleted file mode 100644
index 3322b55..0000000
--- a/core/events/RelatedEventInit.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.
-
-// https://html.spec.whatwg.org/#the-relatedevent-interfaces
-
-dictionary RelatedEventInit : EventInit {
- EventTarget? relatedTarget;
-};
diff --git a/core/events/ResourceProgressEvent.idl b/core/events/ResourceProgressEvent.idl
index 660b8b1..e55a362 100644
--- a/core/events/ResourceProgressEvent.idl
+++ b/core/events/ResourceProgressEvent.idl
@@ -31,8 +31,7 @@
// constructable by web content at all, and so does not provide the usual
// EventInit pattern for Event construction.
[
- NoInterfaceObject,
+ NoInterfaceObject
] interface ResourceProgressEvent : ProgressEvent {
readonly attribute DOMString url;
};
-
diff --git a/core/events/SecurityPolicyViolationEvent.idl b/core/events/SecurityPolicyViolationEvent.idl
index 2ae1dbf..c928820 100644
--- a/core/events/SecurityPolicyViolationEvent.idl
+++ b/core/events/SecurityPolicyViolationEvent.idl
@@ -10,33 +10,40 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-// http://w3c.github.io/webappsec/specs/content-security-policy/#securitypolicyviolationevent-interface
+// https://w3c.github.io/webappsec-csp/#idl-index
+
+enum SecurityPolicyViolationEventDisposition {
+ "enforce", "report"
+};
[
- Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict),
+ Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict)
] interface SecurityPolicyViolationEvent : Event {
- // TODO(philipj): The spec says "documentURL".
+ // TODO(foolip): The spec says "documentURL".
[Measure] readonly attribute DOMString documentURI;
readonly attribute DOMString referrer;
- // TODO(philipj): The spec says "blockedURL".
+ // TODO(foolip): The spec says "blockedURL".
[Measure] readonly attribute DOMString blockedURI;
readonly attribute DOMString violatedDirective;
readonly attribute DOMString effectiveDirective;
readonly attribute DOMString originalPolicy;
+ readonly attribute SecurityPolicyViolationEventDisposition disposition;
readonly attribute DOMString sourceFile;
[Measure] readonly attribute unsigned short statusCode;
readonly attribute long lineNumber;
readonly attribute long columnNumber;
+ readonly attribute DOMString sample;
};
diff --git a/core/events/SecurityPolicyViolationEventInit.idl b/core/events/SecurityPolicyViolationEventInit.idl
index 77d3db3..4230272 100644
--- a/core/events/SecurityPolicyViolationEventInit.idl
+++ b/core/events/SecurityPolicyViolationEventInit.idl
@@ -2,19 +2,21 @@
// 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
+// https://w3c.github.io/webappsec-csp/#idl-index
dictionary SecurityPolicyViolationEventInit : EventInit {
- // TODO(philipj): The spec says "documentURL".
+ // TODO(foolip): The spec says "documentURL".
DOMString documentURI;
DOMString referrer;
- // TODO(philipj): The spec says "blockedURL".
+ // TODO(foolip): The spec says "blockedURL".
DOMString blockedURI;
DOMString violatedDirective;
DOMString effectiveDirective;
DOMString originalPolicy;
+ SecurityPolicyViolationEventDisposition disposition;
DOMString sourceFile;
unsigned short statusCode;
long lineNumber;
long columnNumber;
+ DOMString sample;
};
diff --git a/core/events/TextEvent.idl b/core/events/TextEvent.idl
index b49c98f..2ae52eb 100644
--- a/core/events/TextEvent.idl
+++ b/core/events/TextEvent.idl
@@ -25,8 +25,9 @@
// 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:
+// TODO(foolip): Remove the textinput event and the TextEvent interface.
+// https://crbug.com/701480
+// 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
diff --git a/core/events/TouchEvent.idl b/core/events/TouchEvent.idl
index 42e234d..04300c5 100644
--- a/core/events/TouchEvent.idl
+++ b/core/events/TouchEvent.idl
@@ -26,7 +26,7 @@
// https://w3c.github.io/touch-events/#touchevent-interface
[
- Constructor(DOMString type, optional TouchEventInit eventInitDict),
+ Constructor(DOMString type, optional TouchEventInit eventInitDict)
] interface TouchEvent : UIEvent {
readonly attribute TouchList touches;
readonly attribute TouchList targetTouches;
@@ -35,18 +35,4 @@
readonly attribute boolean metaKey;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
-
- [CallWith=ScriptState, DeprecateAs=V8TouchEvent_InitTouchEvent_Method, LegacyInterfaceTypeChecking] 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 2cf9480..1491fa0 100644
--- a/core/events/TransitionEvent.idl
+++ b/core/events/TransitionEvent.idl
@@ -24,13 +24,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/css-transitions/#transition-events
+// https://dev.w3.org/csswg/css-transitions/#transition-events
[
- Constructor(DOMString type, optional TransitionEventInit eventInitDict),
+ Constructor(DOMString type, optional TransitionEventInit eventInitDict)
] interface TransitionEvent : Event {
readonly attribute DOMString propertyName;
- // TODO(philipj): elapsedTime should be float.
+ // TODO(foolip): elapsedTime should be float.
readonly attribute double elapsedTime;
readonly attribute DOMString pseudoElement;
};
diff --git a/core/events/TransitionEventInit.idl b/core/events/TransitionEventInit.idl
index 8a0f8ea..3d82d4f 100644
--- a/core/events/TransitionEventInit.idl
+++ b/core/events/TransitionEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://dev.w3.org/csswg/css-transitions/#transition-events
dictionary TransitionEventInit : EventInit {
DOMString propertyName = "";
diff --git a/core/events/UIEvent.idl b/core/events/UIEvent.idl
index c0ae319..2b0e986 100644
--- a/core/events/UIEvent.idl
+++ b/core/events/UIEvent.idl
@@ -24,16 +24,15 @@
] interface UIEvent : Event {
readonly attribute Window? view;
readonly attribute long detail;
- [RuntimeEnabled=InputDeviceCapabilities] readonly attribute InputDeviceCapabilities? sourceCapabilities;
+ readonly attribute InputDeviceCapabilities? sourceCapabilities;
// https://w3c.github.io/uievents/#idl-interface-UIEvent-initializers
- // TODO(philipj): None of the initUIEvent() arguments should be optional.
+ // TODO(foolip): 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: this belongs on the KeyboardEvent interface
- [MeasureAs=UIEventWhich] readonly attribute long which;
+ readonly attribute unsigned long which;
};
diff --git a/core/events/UIEventInit.idl b/core/events/UIEventInit.idl
index e1f9cbe..a994a6b 100644
--- a/core/events/UIEventInit.idl
+++ b/core/events/UIEventInit.idl
@@ -7,5 +7,5 @@
dictionary UIEventInit : EventInit {
Window? view = null;
long detail = 0;
- [RuntimeEnabled=InputDeviceCapabilities] InputDeviceCapabilities? sourceCapabilities = null;
-};
\ No newline at end of file
+ InputDeviceCapabilities? sourceCapabilities = null;
+};
diff --git a/core/events/WheelEvent.idl b/core/events/WheelEvent.idl
index cf556e4..4d1163f 100644
--- a/core/events/WheelEvent.idl
+++ b/core/events/WheelEvent.idl
@@ -22,7 +22,7 @@
// https://w3c.github.io/uievents/#interface-WheelEvent
[
- Constructor(DOMString type, optional WheelEventInit eventInitDict),
+ Constructor(DOMString type, optional WheelEventInit eventInitDict)
] interface WheelEvent : MouseEvent {
// DeltaModeCode
const unsigned long DOM_DELTA_PIXEL = 0x00;
diff --git a/core/fileapi/Blob.idl b/core/fileapi/Blob.idl
index 4abe9ed..fa0d250 100644
--- a/core/fileapi/Blob.idl
+++ b/core/fileapi/Blob.idl
@@ -30,20 +30,16 @@
// https://w3c.github.io/FileAPI/#blob
+typedef (ArrayBuffer or ArrayBufferView or Blob or USVString) BlobPart;
[
- GarbageCollected,
- Constructor,
- Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options),
+ Constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options),
+ ConstructorCallWith=ExecutionContext,
RaisesException=Constructor,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] 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();
+ [RaisesException] Blob slice(optional long long start, optional long long end, optional DOMString contentType);
};
diff --git a/core/fileapi/File.idl b/core/fileapi/File.idl
index 666b073..a74bece 100644
--- a/core/fileapi/File.idl
+++ b/core/fileapi/File.idl
@@ -26,11 +26,10 @@
// https://w3c.github.io/FileAPI/#file
[
- // 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),
+ Constructor(sequence<BlobPart> fileBits, USVString fileName, optional FilePropertyBag options),
+ ConstructorCallWith=ExecutionContext,
RaisesException=Constructor,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface File : Blob {
readonly attribute DOMString name;
readonly attribute long long lastModified;
diff --git a/core/fileapi/FileError.idl b/core/fileapi/FileError.idl
deleted file mode 100644
index 9022489..0000000
--- a/core/fileapi/FileError.idl
+++ /dev/null
@@ -1,48 +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:
- *
- * * 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.
- */
-
-// TODO(philipj): Remove the FileError interface. crbug.com/496901
-[Exposed=(Window,Worker)]
-interface FileError : DOMError {
- const unsigned short NOT_FOUND_ERR = 1;
- const unsigned short SECURITY_ERR = 2;
- const unsigned short ABORT_ERR = 3;
- const unsigned short NOT_READABLE_ERR = 4;
- const unsigned short ENCODING_ERR = 5;
- const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6;
- const unsigned short INVALID_STATE_ERR = 7;
- const unsigned short SYNTAX_ERR = 8;
- const unsigned short INVALID_MODIFICATION_ERR = 9;
- const unsigned short QUOTA_EXCEEDED_ERR = 10;
- const unsigned short TYPE_MISMATCH_ERR = 11;
- const unsigned short PATH_EXISTS_ERR = 12;
-
- [DeprecateAs=FileError] readonly attribute unsigned short code;
-};
diff --git a/core/fileapi/FileList.idl b/core/fileapi/FileList.idl
index 9bbd8a5..25db9a0 100644
--- a/core/fileapi/FileList.idl
+++ b/core/fileapi/FileList.idl
@@ -26,8 +26,7 @@
// https://w3c.github.io/FileAPI/#filelist-section
[
- Exposed=(Window,Worker),
- GarbageCollected
+ Exposed=(Window,Worker)
] interface FileList {
getter File? item(unsigned long index);
readonly attribute unsigned long length;
diff --git a/core/fileapi/FilePropertyBag.idl b/core/fileapi/FilePropertyBag.idl
index 950fc84..692b138 100644
--- a/core/fileapi/FilePropertyBag.idl
+++ b/core/fileapi/FilePropertyBag.idl
@@ -4,11 +4,6 @@
// https://w3c.github.io/FileAPI/#file
-dictionary FilePropertyBag {
- DOMString type = "";
+dictionary FilePropertyBag : BlobPropertyBag {
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 c299840..7d223a9 100644
--- a/core/fileapi/FileReader.idl
+++ b/core/fileapi/FileReader.idl
@@ -32,17 +32,15 @@
// https://w3c.github.io/FileAPI/#APIASynch
[
- GarbageCollected,
+ ActiveScriptWrappable,
DependentLifetime,
Constructor,
ConstructorCallWith=ExecutionContext,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface FileReader : EventTarget {
// async read methods
[RaisesException] void readAsArrayBuffer(Blob blob);
- // 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 readAsBinaryString(Blob blob);
[RaisesException] void readAsText(Blob blob, optional DOMString label);
[RaisesException] void readAsDataURL(Blob blob);
@@ -56,10 +54,10 @@
[ImplementedAs=getReadyState] readonly attribute unsigned short readyState;
// File or Blob data
+ [CallWith=ScriptState]
readonly attribute (DOMString or ArrayBuffer)? result;
- // TODO(philipj): error should be DOMError. crbug.com/496901
- [Measure] readonly attribute FileError? error;
+ readonly attribute DOMException? error;
// event handler attributes
attribute EventHandler onloadstart;
diff --git a/core/fileapi/FileReaderSync.idl b/core/fileapi/FileReaderSync.idl
index d587242..702b27a 100644
--- a/core/fileapi/FileReaderSync.idl
+++ b/core/fileapi/FileReaderSync.idl
@@ -31,14 +31,13 @@
// https://w3c.github.io/FileAPI/#FileReaderSync
[
- GarbageCollected,
- Exposed=Worker,
+ Exposed=(DedicatedWorker,SharedWorker),
Constructor,
+ ConstructorCallWith=ExecutionContext,
+ Measure
] interface FileReaderSync {
- [CallWith=ExecutionContext, RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob);
- // 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);
+ [CallWith=ScriptState, RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob);
+ [CallWith=ScriptState, RaisesException] DOMString readAsBinaryString(Blob blob);
+ [CallWith=ScriptState, RaisesException] DOMString readAsText(Blob blob, optional DOMString label);
+ [CallWith=ScriptState, RaisesException] DOMString readAsDataURL(Blob blob);
};
diff --git a/core/fileapi/URLFileAPI.idl b/core/fileapi/URLFileAPI.idl
new file mode 100644
index 0000000..da2b186
--- /dev/null
+++ b/core/fileapi/URLFileAPI.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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/#creating-revoking
+[
+ ImplementedAs=URLFileAPI
+] partial interface URL {
+ [Exposed=(Window,DedicatedWorker,SharedWorker), CallWith=ScriptState, RaisesException] static DOMString createObjectURL(Blob blob);
+ [Exposed=(Window,DedicatedWorker,SharedWorker), CallWith=ScriptState] static void revokeObjectURL(DOMString url);
+};
diff --git a/core/frame/BarProp.idl b/core/frame/BarProp.idl
index 278b34d..433d23a 100644
--- a/core/frame/BarProp.idl
+++ b/core/frame/BarProp.idl
@@ -28,8 +28,6 @@
// https://html.spec.whatwg.org/#barprop
-[
- WillBeGarbageCollected,
-] interface BarProp {
+interface BarProp {
readonly attribute boolean visible;
};
diff --git a/core/frame/Console.idl b/core/frame/Console.idl
deleted file mode 100644
index 66e8ec3..0000000
--- a/core/frame/Console.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * 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:
- *
- * 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.
- */
-
-// 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 {
-};
diff --git a/core/frame/ConsoleBase.idl b/core/frame/ConsoleBase.idl
deleted file mode 100644
index 057aca9..0000000
--- a/core/frame/ConsoleBase.idl
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * 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:
- *
- * 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.
- */
-
-// Console API (non-standard but widely implemented in some form)
-// https://developer.chrome.com/devtools/docs/console-api
-
-[
- NoInterfaceObject,
- GarbageCollected,
-] interface ConsoleBase {
- [CallWith=(ScriptArguments,ScriptState)] void debug();
- [CallWith=(ScriptArguments,ScriptState)] void error();
- [CallWith=(ScriptArguments,ScriptState)] void info();
- [CallWith=(ScriptArguments,ScriptState)] void log();
- [CallWith=(ScriptArguments,ScriptState)] void warn();
- [CallWith=(ScriptArguments,ScriptState)] void dir();
- [CallWith=(ScriptArguments,ScriptState)] void dirxml();
- [CallWith=(ScriptArguments,ScriptState)] void table();
- [CallWith=(ScriptArguments,ScriptState)] void trace();
- [CallWith=(ScriptArguments,ScriptState), ImplementedAs=assertCondition] void assert([Default=Undefined] optional boolean condition);
- [CallWith=(ScriptArguments,ScriptState)] void count();
- [DeprecateAs=ConsoleMarkTimeline] void markTimeline(optional DOMString title = null);
-
- void profile(optional DOMString title = null);
- void profileEnd(optional DOMString title = null);
-
- void time(optional DOMString title = null);
- [CallWith=ScriptState] void timeEnd(optional DOMString title = null);
- void timeStamp(optional DOMString title = null);
-
- [DeprecateAs=ConsoleTimeline,CallWith=ScriptState] void timeline(optional DOMString title = null);
- [DeprecateAs=ConsoleTimelineEnd,CallWith=ScriptState] void timelineEnd(optional DOMString title = null);
-
- [CallWith=(ScriptArguments,ScriptState)] void group();
- [CallWith=(ScriptArguments,ScriptState)] void groupCollapsed();
- void groupEnd();
- [CallWith=(ScriptArguments,ScriptState)] void clear();
-};
diff --git a/core/frame/DeprecationReport.idl b/core/frame/DeprecationReport.idl
new file mode 100644
index 0000000..6836be7
--- /dev/null
+++ b/core/frame/DeprecationReport.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/WICG/reporting/blob/master/EXPLAINER.md#reportingobserver---observing-reports-from-javascript
+
+[
+ NoInterfaceObject,
+ RuntimeEnabled=ReportingObserver
+] interface DeprecationReport : ReportBody {
+ // TODO(paulmeyer): Add additional data, including: id, anticipatedRemoval.
+ readonly attribute DOMString message;
+ readonly attribute DOMString sourceFile;
+ readonly attribute long lineNumber;
+};
diff --git a/core/frame/External.idl b/core/frame/External.idl
new file mode 100644
index 0000000..977e4e0
--- /dev/null
+++ b/core/frame/External.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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]
+interface External {
+ void AddSearchProvider();
+ void IsSearchProviderInstalled();
+};
diff --git a/core/frame/History.idl b/core/frame/History.idl
index bec0890..376d6c5 100644
--- a/core/frame/History.idl
+++ b/core/frame/History.idl
@@ -27,18 +27,14 @@
enum ScrollRestoration {"auto", "manual"};
-[
- GarbageCollected,
-] interface History {
- readonly attribute unsigned long length;
- [RuntimeEnabled=ScrollRestoration, Measure] attribute ScrollRestoration scrollRestoration;
- // TODO(philipj): The SerializedScriptValue type should be any.
- [CachedAttribute=stateChanged] readonly attribute SerializedScriptValue state;
- [CallWith=ExecutionContext] void go(optional long delta = 0);
- [CallWith=ExecutionContext] void back();
- [CallWith=ExecutionContext] void forward();
- // TODO(philipj): The SerializedScriptValue types should be any.
- // TODO(philipj): The title arguments should simply be 'DOMString title'.
- [RaisesException] void pushState(SerializedScriptValue data, [TreatUndefinedAs=NullString] DOMString? title, optional DOMString? url = null);
- [RaisesException] void replaceState(SerializedScriptValue data, [TreatUndefinedAs=NullString] DOMString? title, optional DOMString? url = null);
+interface History {
+ [RaisesException] readonly attribute unsigned long length;
+ [Measure, RaisesException] attribute ScrollRestoration scrollRestoration;
+ // TODO(foolip): The SerializedScriptValue type should be any.
+ [CachedAttribute=stateChanged, RaisesException] readonly attribute SerializedScriptValue state;
+ [CallWith=ScriptState, RaisesException] void go(optional long delta = 0);
+ [CallWith=ScriptState, RaisesException] void back();
+ [CallWith=ScriptState, RaisesException] void forward();
+ [RaisesException] void pushState(SerializedScriptValue data, DOMString title, optional DOMString? url = null);
+ [RaisesException] void replaceState(SerializedScriptValue data, DOMString title, optional DOMString? url = null);
};
diff --git a/core/frame/ImageBitmap.idl b/core/frame/ImageBitmap.idl
deleted file mode 100644
index b47435f..0000000
--- a/core/frame/ImageBitmap.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2013 The Chromium 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/#images
-
-[
- Exposed=(Window,Worker),
- WillBeGarbageCollected,
-] interface ImageBitmap {
- readonly attribute unsigned long width;
- readonly attribute unsigned long height;
- [RuntimeEnabled=ExperimentalCanvasFeatures] void close();
-};
diff --git a/core/frame/InterventionReport.idl b/core/frame/InterventionReport.idl
new file mode 100644
index 0000000..aa0c81d
--- /dev/null
+++ b/core/frame/InterventionReport.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/WICG/reporting/blob/master/EXPLAINER.md#reportingobserver---observing-reports-from-javascript
+
+[
+ NoInterfaceObject,
+ RuntimeEnabled=ReportingObserver
+] interface InterventionReport : ReportBody {
+ // TODO(paulmeyer): Add additional data, such as id.
+ readonly attribute DOMString message;
+ readonly attribute DOMString sourceFile;
+ readonly attribute long lineNumber;
+};
diff --git a/core/frame/Location.idl b/core/frame/Location.idl
index 592474d..c1c14d0 100644
--- a/core/frame/Location.idl
+++ b/core/frame/Location.idl
@@ -26,42 +26,52 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://html.spec.whatwg.org/#the-location-interface
+// https://html.spec.whatwg.org/multipage/browsers.html#location
[
CheckSecurity=Receiver,
- Unforgeable,
- WillBeGarbageCollected,
+ DependentLifetime,
+ Unforgeable
] interface Location {
- // |assign|, |replace|, and *writing* |href| do not require a security
- // check, as they *change* the page, and thus these do not change any
- // property of an *existing* document at a different origin.
+ // |assign| is *NOT* cross-origin accessible in the spec, but it needs
+ // the Incumbent realm when navigating the page. See the below link.
+ // https://html.spec.whatwg.org/multipage/browsers.html#location-object-navigate
+ // Unfortunately, Blink does not support the Incumbent realm so far, and
+ // we need a hack of assignOriginSafeMethodGetter to simulate the Incumbent
+ // realm. Thus, we have [CrossOrigin] here just for the hack although
+ // |assign| itself is not cross-origin accessible.
+ // TODO(yukishiino): Remove [CrossOrigin] once we support the Incumbent
+ // realm correctly.
+ [CallWith=(CurrentWindow,EnteredWindow), CrossOrigin, RaisesException] void assign(DOMString url);
+
+ // |replace|, and *writing* |href| do not require a security check, as they
+ // *change* the page, and thus these do not change any 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.
- [CallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity] void assign(DOMString url);
- [CallWith=(ActiveWindow,FirstWindow), DoNotCheckSecurity] void replace(DOMString url);
- [CallWith=ActiveWindow] void reload();
+ // https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
+ [CallWith=(CurrentWindow,EnteredWindow), CrossOrigin, RaisesException] void replace(DOMString url);
+ [CallWith=CurrentWindow] 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;
+ // TODO(foolip): |ancestorOrigins| should have [Unforgeable, SameObject].
+ readonly attribute DOMStringList ancestorOrigins;
- // TODO(philipj): Per spec, Location implements URLUtils. The below is
+ // TODO(foolip): 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;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), CrossOrigin=Setter, RaisesException=Setter] attribute URLString href;
+ [NotEnumerable] DOMString toString();
+ [MeasureAs=LocationOrigin] readonly attribute DOMString origin;
- [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;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString protocol;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString host;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString hostname;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString port;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString pathname;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString search;
+ [SetterCallWith=(CurrentWindow,EnteredWindow), RaisesException=Setter] attribute DOMString hash;
- // TODO(philipj): Location does not have a valueOf() override in the spec.
+ // TODO(foolip): 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 d9665b0..622910d 100644
--- a/core/frame/Navigator.idl
+++ b/core/frame/Navigator.idl
@@ -19,23 +19,25 @@
// https://html.spec.whatwg.org/#the-navigator-object
-[
- GarbageCollected,
-] interface Navigator {
+interface Navigator {
// objects implementing this interface also implement the interfaces given below
- // TODO(philipj): vendorSub should be on NavigatorID.
+ // TODO(foolip): vendorSub should be on NavigatorID.
[MeasureAs=NavigatorVendorSub] readonly attribute DOMString vendorSub;
- // TODO(philipj): productSub and vendor are not yet in the spec:
+ // TODO(foolip): 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;
+ // https://github.com/w3c/device-memory#the-web-exposed-api
+ [MeasureAs=NavigatorDeviceMemory,RuntimeEnabled=NavigatorDeviceMemory,SecureContext]
+ readonly attribute float deviceMemory;
};
-Navigator implements NavigatorCPU;
+Navigator implements NavigatorConcurrentHardware;
+Navigator implements NavigatorCookies;
Navigator implements NavigatorID;
Navigator implements NavigatorLanguage;
Navigator implements NavigatorOnLine;
-Navigator implements NavigatorStorageUtils;
+Navigator implements NavigatorAutomationInformation;
diff --git a/core/frame/NavigatorAutomationInformation.idl b/core/frame/NavigatorAutomationInformation.idl
new file mode 100644
index 0000000..e14af26
--- /dev/null
+++ b/core/frame/NavigatorAutomationInformation.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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/webdriver/webdriver-spec.html#interface
+
+[
+ NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window),
+ RuntimeEnabled=AutomationControlled
+] interface NavigatorAutomationInformation {
+ readonly attribute boolean webdriver;
+};
diff --git a/core/frame/NavigatorCPU.idl b/core/frame/NavigatorCPU.idl
deleted file mode 100644
index a951a1d..0000000
--- a/core/frame/NavigatorCPU.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://wiki.whatwg.org/wiki/Navigator_HW_Concurrency
-
-[
- NoInterfaceObject,
- Exposed=(Window,Worker),
-] interface NavigatorCPU {
- readonly attribute unsigned long hardwareConcurrency;
-};
diff --git a/core/frame/NavigatorClipboard.idl b/core/frame/NavigatorClipboard.idl
new file mode 100644
index 0000000..aaa5ee9
--- /dev/null
+++ b/core/frame/NavigatorClipboard.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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/#navigator-interface
+
+[
+ ImplementedAs=NavigatorClipboard,
+ RuntimeEnabled=AsyncClipboard
+] partial interface Navigator {
+ [CallWith=ScriptState, SecureContext, SameObject]
+ readonly attribute Clipboard clipboard;
+};
diff --git a/core/frame/NavigatorConcurrentHardware.idl b/core/frame/NavigatorConcurrentHardware.idl
new file mode 100644
index 0000000..b6f63bb
--- /dev/null
+++ b/core/frame/NavigatorConcurrentHardware.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://html.spec.whatwg.org/multipage/workers.html#navigator.hardwareconcurrency
+
+[
+ NoInterfaceObject,
+ Exposed=(Window,Worker)
+] interface NavigatorConcurrentHardware {
+ readonly attribute unsigned long long hardwareConcurrency;
+};
diff --git a/core/frame/NavigatorCookies.idl b/core/frame/NavigatorCookies.idl
new file mode 100644
index 0000000..c77322a
--- /dev/null
+++ b/core/frame/NavigatorCookies.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#cookies
+
+[NoInterfaceObject]
+interface NavigatorCookies {
+ readonly attribute boolean cookieEnabled;
+};
diff --git a/core/frame/NavigatorID.idl b/core/frame/NavigatorID.idl
index 0bf48d5..a00b98c 100644
--- a/core/frame/NavigatorID.idl
+++ b/core/frame/NavigatorID.idl
@@ -32,7 +32,7 @@
[
NoInterfaceObject, // Always used on target of 'implements'
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface NavigatorID {
readonly attribute DOMString appCodeName; // constant "Mozilla"
readonly attribute DOMString appName; // constant "Netscape"
diff --git a/core/frame/NavigatorLanguage.idl b/core/frame/NavigatorLanguage.idl
index d36183d..d77bba5 100644
--- a/core/frame/NavigatorLanguage.idl
+++ b/core/frame/NavigatorLanguage.idl
@@ -6,8 +6,8 @@
[
NoInterfaceObject,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface NavigatorLanguage {
- readonly attribute DOMString? language;
- [CachedAttribute=hasLanguagesChanged] readonly attribute DOMString[] languages;
+ readonly attribute DOMString language;
+ [CachedAttribute=hasLanguagesChanged] readonly attribute FrozenArray<DOMString> languages;
};
diff --git a/core/frame/NavigatorOnLine.idl b/core/frame/NavigatorOnLine.idl
index 94468aa..d9f71c1 100644
--- a/core/frame/NavigatorOnLine.idl
+++ b/core/frame/NavigatorOnLine.idl
@@ -32,7 +32,7 @@
[
NoInterfaceObject, // Always used on target of 'implements'
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface NavigatorOnLine {
readonly attribute boolean onLine;
};
diff --git a/core/frame/NavigatorStorageUtils.idl b/core/frame/NavigatorStorageUtils.idl
deleted file mode 100644
index b408dc7..0000000
--- a/core/frame/NavigatorStorageUtils.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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;
-};
diff --git a/core/frame/PRESUBMIT.py b/core/frame/PRESUBMIT.py
index eba4c2f..a702108 100644
--- a/core/frame/PRESUBMIT.py
+++ b/core/frame/PRESUBMIT.py
@@ -12,29 +12,32 @@
def _RunUseCounterChecks(input_api, output_api):
for f in input_api.AffectedFiles():
if f.LocalPath().endswith('UseCounter.cpp'):
- useCounterCpp = f
+ use_counter_cpp_file = f
break
else:
return []
- largestFoundBucket = 0
- maximumBucket = 0
- # Looking for a line like "case CSSPropertyGrid: return 453;"
- bucketFinder = input_api.re.compile(r'.*CSSProperty.*return\s*([0-9]+).*')
- # Looking for a line like "static int maximumCSSSampleId() { return 452; }"
- maximumFinder = input_api.re.compile(
- r'static int maximumCSSSampleId\(\) { return ([0-9]+)')
- for line in useCounterCpp.NewContents():
- bucketMatch = bucketFinder.match(line)
- if bucketMatch:
- bucket = int(bucketMatch.group(1))
- largestFoundBucket = max(largestFoundBucket, bucket)
- else:
- maximumMatch = maximumFinder.match(line)
- if maximumMatch:
- maximumBucket = int(maximumMatch.group(1))
+ largest_found_bucket = 0
+ expected_max_bucket = 0
- if largestFoundBucket != maximumBucket:
+ # Looking for a line like "case CSSPropertyGrid: return 453;"
+ bucket_finder = input_api.re.compile(
+ r'case CSSProperty\w*?:\s+?return (\d+);',
+ input_api.re.MULTILINE)
+ # Looking for a line like "constexpr int kMaximumCSSSampleId = 452;"
+ expected_max_finder = input_api.re.compile(
+ r'constexpr int kMaximumCSSSampleId = (\d+);')
+ joined_contents = '\n'.join(use_counter_cpp_file.NewContents())
+
+ expected_max_match = expected_max_finder.search(joined_contents)
+ if expected_max_match:
+ expected_max_bucket = int(expected_max_match.group(1))
+
+ for bucket_match in bucket_finder.finditer(joined_contents):
+ bucket = int(bucket_match.group(1))
+ largest_found_bucket = max(largest_found_bucket, bucket)
+
+ if largest_found_bucket != expected_max_bucket:
if input_api.is_committing:
message_type = output_api.PresubmitError
else:
@@ -42,16 +45,20 @@
return [message_type(
'Largest found CSSProperty bucket Id (%d) does not match '
- 'maximumCSSSampleId (%d)' %
- (largestFoundBucket, maximumBucket),
- items=[useCounterCpp.LocalPath()])]
+ 'maximumCSSSampleId (%d)' % (
+ largest_found_bucket, expected_max_bucket),
+ items=[use_counter_cpp_file.LocalPath()])]
return []
def CheckChangeOnUpload(input_api, output_api):
- return _RunUseCounterChecks(input_api, output_api)
+ results = []
+ results.extend(_RunUseCounterChecks(input_api, output_api))
+ return results
def CheckChangeOnCommit(input_api, output_api):
- return _RunUseCounterChecks(input_api, output_api)
+ results = []
+ results.extend(_RunUseCounterChecks(input_api, output_api))
+ return results
diff --git a/core/frame/Report.idl b/core/frame/Report.idl
new file mode 100644
index 0000000..b1a271d
--- /dev/null
+++ b/core/frame/Report.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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/WICG/reporting/blob/master/EXPLAINER.md#reportingobserver---observing-reports-from-javascript
+
+[
+ NoInterfaceObject,
+ RuntimeEnabled=ReportingObserver
+] interface Report {
+ readonly attribute DOMString type;
+ readonly attribute DOMString url;
+ readonly attribute ReportBody? body;
+};
diff --git a/core/frame/ReportBody.idl b/core/frame/ReportBody.idl
new file mode 100644
index 0000000..4ff3db0
--- /dev/null
+++ b/core/frame/ReportBody.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/WICG/reporting/blob/master/EXPLAINER.md#reportingobserver---observing-reports-from-javascript
+
+[
+ NoInterfaceObject,
+ RuntimeEnabled=ReportingObserver
+] interface ReportBody {
+};
diff --git a/core/frame/ReportingObserver.idl b/core/frame/ReportingObserver.idl
new file mode 100644
index 0000000..f3cbb92
--- /dev/null
+++ b/core/frame/ReportingObserver.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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/WICG/reporting/blob/master/EXPLAINER.md#reportingobserver---observing-reports-from-javascript
+
+callback ReportingObserverCallback = void (sequence<Report> reports, ReportingObserver observer);
+
+[
+ Constructor(ReportingObserverCallback callback),
+ ConstructorCallWith=ExecutionContext,
+ RuntimeEnabled=ReportingObserver
+] interface ReportingObserver {
+ void observe();
+ void disconnect();
+};
diff --git a/core/frame/Screen.idl b/core/frame/Screen.idl
index 33d9afc..90fa671 100644
--- a/core/frame/Screen.idl
+++ b/core/frame/Screen.idl
@@ -26,11 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/csswg/cssom-view/#the-screen-interface
+// https://drafts.csswg.org/cssom-view/#the-screen-interface
-[
- GarbageCollected,
-] interface Screen {
+interface Screen {
readonly attribute long availWidth;
readonly attribute long availHeight;
readonly attribute long width;
diff --git a/core/frame/ScrollIntoViewOptions.idl b/core/frame/ScrollIntoViewOptions.idl
new file mode 100644
index 0000000..8e22c35
--- /dev/null
+++ b/core/frame/ScrollIntoViewOptions.idl
@@ -0,0 +1,6 @@
+enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
+
+dictionary ScrollIntoViewOptions : ScrollOptions {
+ ScrollLogicalPosition block = "center";
+ [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "center";
+};
\ No newline at end of file
diff --git a/core/frame/ScrollOptions.idl b/core/frame/ScrollOptions.idl
index b09ded9..d34b3ff 100644
--- a/core/frame/ScrollOptions.idl
+++ b/core/frame/ScrollOptions.idl
@@ -2,7 +2,7 @@
// 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
+// https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
enum ScrollBehavior { "auto", "instant", "smooth" };
diff --git a/core/frame/ScrollToOptions.idl b/core/frame/ScrollToOptions.idl
index b324e7a..1a54d9c 100644
--- a/core/frame/ScrollToOptions.idl
+++ b/core/frame/ScrollToOptions.idl
@@ -2,7 +2,7 @@
// 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
+// https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
dictionary ScrollToOptions : ScrollOptions {
unrestricted double left;
diff --git a/core/frame/VisualViewport.idl b/core/frame/VisualViewport.idl
new file mode 100644
index 0000000..be7e37d
--- /dev/null
+++ b/core/frame/VisualViewport.idl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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.
+ */
+
+ // Visual Viewport API.
+ // WICG proposal: https://github.com/WICG/ViewportAPI
+
+[
+ RuntimeEnabled=VisualViewportAPI,
+ ImplementedAs=DOMVisualViewport
+] interface VisualViewport : EventTarget {
+ [Measure] readonly attribute double offsetLeft;
+ [Measure] readonly attribute double offsetTop;
+
+ [Measure] readonly attribute double pageLeft;
+ [Measure] readonly attribute double pageTop;
+
+ [Measure] readonly attribute double width;
+ [Measure] readonly attribute double height;
+
+ [Measure] readonly attribute double scale;
+
+ attribute EventHandler onresize;
+ attribute EventHandler onscroll;
+};
diff --git a/core/frame/Window.idl b/core/frame/Window.idl
index f73fac7..ac6f1c8 100644
--- a/core/frame/Window.idl
+++ b/core/frame/Window.idl
@@ -26,19 +26,20 @@
// https://html.spec.whatwg.org/#the-window-object
-// FIXME: explain all uses of [DoNotCheckSecurity]
+// FIXME: explain all uses of [CrossOrigin]
[
CheckSecurity=Receiver,
ImplementedAs=DOMWindow,
- PrimaryGlobal,
+ PrimaryGlobal
] interface Window : EventTarget {
// 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;
+ [Unforgeable, CrossOrigin] readonly attribute Window window;
+ [Replaceable, CrossOrigin] readonly attribute Window self;
+ [Unforgeable, CachedAccessor] readonly attribute Document document;
+ [Replaceable] readonly attribute DOMString origin;
attribute DOMString name;
- [PutForwards=href, Unforgeable, DoNotCheckSecurity] readonly attribute Location location;
+ [PutForwards=href, Unforgeable, CrossOrigin=(Getter,Setter), Custom=Getter] readonly attribute Location location;
readonly attribute History history;
[Replaceable, MeasureAs=BarPropLocationbar] readonly attribute BarProp locationbar;
[Replaceable, MeasureAs=BarPropMenubar] readonly attribute BarProp menubar;
@@ -47,57 +48,78 @@
[Replaceable, MeasureAs=BarPropStatusbar] readonly attribute BarProp statusbar;
[Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar;
attribute DOMString status;
- [DoNotCheckSecurity, CallWith=ExecutionContext] void close();
- [DoNotCheckSecurity] readonly attribute boolean closed;
+ // https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close
+ // TODO(yukishiino): Replace |CurrentWindow| with the incumbent window or
+ // something once the incumbent realm is implemented. Currently,
+ // OriginSafeMethodGetter + CurrentWindow are used instead of the incumbent
+ // one.
+ [CrossOrigin, CallWith=CurrentWindow] void close();
+ [CrossOrigin] readonly attribute boolean closed;
void stop();
- [DoNotCheckSecurity, CallWith=ExecutionContext] void focus();
- [DoNotCheckSecurity] void blur();
+ // https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
+ // https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps
+ // TODO(yukishiino): Remove [CallWith=CurrentWindow] or clarify why
+ // we need it. focus() is not supposed to use the incumbent realm.
+ // So, we shouldn't need to use CurrentWindow here, however, somehow
+ // DOMWindow::focus() is checking if the incumbent window is eligible to
+ // focus another window.
+ [CrossOrigin, CallWith=CurrentWindow] void focus();
+ [CrossOrigin] void blur();
// other browsing contexts
- [Replaceable, DoNotCheckSecurity] readonly attribute Window frames;
- [Replaceable, DoNotCheckSecurity] readonly attribute unsigned long length;
- [Unforgeable, DoNotCheckSecurity] readonly attribute Window top;
+ [Replaceable, CrossOrigin] readonly attribute Window frames;
+ [Replaceable, CrossOrigin] readonly attribute unsigned long length;
+ [Unforgeable, CrossOrigin] readonly attribute Window? top;
// FIXME: opener should be of type any.
- [DoNotCheckSecurity, Custom=Setter] attribute Window opener;
- [Replaceable, DoNotCheckSecurity] readonly attribute Window parent;
+ [CrossOrigin, Custom=Setter] attribute Window opener;
+ [Replaceable, CrossOrigin] readonly attribute Window? parent;
[CheckSecurity=ReturnValue, 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, RaisesException] Window? open(DOMString url, DOMString target, optional DOMString features);
+
+ // indexed properties
+ // https://html.spec.whatwg.org/C/browsers.html#windowproxy-getownproperty
+ [NotEnumerable, CrossOrigin] getter Window (unsigned long index);
+
+ // named properties
+ [Custom, NotEnumerable, CrossOrigin] getter object (DOMString name);
// the user agent
[LogActivity=GetterOnly] readonly attribute Navigator navigator;
- [RuntimeEnabled=ApplicationCache, LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache;
+ [LogActivity=GetterOnly] readonly attribute ApplicationCache applicationCache;
// user prompts
- [Measure] void alert();
- [Measure] void alert(DOMString message);
- [Measure] boolean confirm(optional DOMString message = "");
- [Measure] DOMString? prompt(optional DOMString message = "", optional DOMString defaultValue = "");
- [Measure] void print();
+ [Measure, CallWith=ScriptState] void alert();
+ [Measure, CallWith=ScriptState] void alert(DOMString message);
+ [Measure, CallWith=ScriptState] boolean confirm(optional DOMString message = "");
+ [Measure, CallWith=ScriptState] DOMString? prompt(optional DOMString message = "", optional DOMString defaultValue = "");
+ [Measure, CallWith=ScriptState] void print();
[MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(FrameRequestCallback callback);
void cancelAnimationFrame(long handle);
- [Measure, RuntimeEnabled=RequestIdleCallback] long requestIdleCallback(IdleRequestCallback callback, optional IdleRequestOptions options);
- [RuntimeEnabled=RequestIdleCallback] void cancelIdleCallback(long handle);
+ [Measure] long requestIdleCallback(IdleRequestCallback callback, optional IdleRequestOptions options);
+ void cancelIdleCallback(long handle);
- [DoNotCheckSecurity, Custom, RaisesException] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
+ [CrossOrigin, Custom, RaisesException] void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
+
+ // Custom elements
+ // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-api
+ [CallWith=ScriptState] readonly attribute CustomElementRegistry customElements;
// HTML obsolete features
// https://html.spec.whatwg.org/#Window-partial
[MeasureAs=WindowCaptureEvents] void captureEvents();
[MeasureAs=WindowReleaseEvents] void releaseEvents();
+ [Replaceable, SameObject] readonly attribute External external;
+
// 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] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString? pseudoElt = null);
+ // https://drafts.csswg.org/cssom/#extensions-to-the-window-interface
+ [NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString? pseudoElt);
// CSSOM View Module
- // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
+ // https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
[NewObject] MediaQueryList matchMedia(DOMString query);
[SameObject, Replaceable] readonly attribute Screen screen;
@@ -123,6 +145,10 @@
[RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions options);
void scrollBy(unrestricted double x, unrestricted double y);
+ // Visual Viewport API
+ // https://github.com/WICG/ViewportAPI
+ [RuntimeEnabled=VisualViewportAPI, Replaceable, SameObject] readonly attribute VisualViewport visualViewport;
+
// client
[Replaceable] readonly attribute long screenX;
[Replaceable] readonly attribute long screenY;
@@ -131,12 +157,22 @@
[Replaceable] readonly attribute double devicePixelRatio;
// Selection API
- // http://w3c.github.io/selection-api/#extensions-to-window-interface
+ // https://w3c.github.io/selection-api/#extensions-to-window-interface
Selection? getSelection();
- // Console API (non-standard but widely implemented in some form)
- // https://developer.chrome.com/devtools/docs/console-api
- [Replaceable] readonly attribute Console console;
+ // Console API
+ // https://console.spec.whatwg.org/#console-interface
+ // [Replaceable] readonly attribute Console console;
+ // Console is installed by v8 inspector when context is created
+ // and is left commented here just for documentation.
+
+ // Compatibility
+ // https://compat.spec.whatwg.org/#windoworientation-interface
+ [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
+ // 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.
+ [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attribute long orientation;
// Non-standard APIs
[MeasureAs=WindowClientInformation, Replaceable] readonly attribute Navigator clientInformation;
@@ -154,15 +190,10 @@
[MeasureAs=WindowDefaultStatus] attribute DOMString defaultStatus;
[MeasureAs=WindowDefaultstatus, ImplementedAs=defaultStatus] attribute DOMString defaultstatus;
[MeasureAs=StyleMedia] readonly attribute StyleMedia styleMedia;
- [DeprecateAs=GetMatchedCSSRules, LegacyInterfaceTypeChecking] 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.
- [MeasureAs=WindowOrientation, RuntimeEnabled=OrientationEvent] readonly attribute long orientation;
+ [RuntimeEnabled=GetMatchedCSSRules, DeprecateAs=GetMatchedCSSRules, LegacyInterfaceTypeChecking] CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element,
+ [Default=Undefined] optional DOMString? pseudoElement);
[DeprecateAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(FrameRequestCallback callback);
[DeprecateAs=PrefixedCancelAnimationFrame, ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(long id);
- [DeprecateAs=PrefixedCancelRequestAnimationFrame, ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(long id);
[MeasureAs=PrefixedTransitionEventConstructor] attribute TransitionEventConstructor WebKitTransitionEvent;
[Measure] attribute AnimationEventConstructor WebKitAnimationEvent;
[DeprecateAs=PrefixedWindowURL] attribute URLConstructor webkitURL;
@@ -172,33 +203,18 @@
attribute EventHandler onanimationend;
attribute EventHandler onanimationiteration;
attribute EventHandler onanimationstart;
- [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
attribute EventHandler onsearch;
attribute EventHandler ontransitionend;
attribute EventHandler onwebkitanimationend;
attribute EventHandler onwebkitanimationiteration;
attribute EventHandler onwebkitanimationstart;
attribute EventHandler onwebkittransitionend;
- attribute EventHandler onwheel;
// https://w3c.github.io/webappsec/specs/powerfulfeatures/#monkey-patching-global-object
readonly attribute boolean isSecureContext;
-};
-// http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects
-//
-// Expressing the Transferable typedef in IDL depends on http://crbug.com/240176.
-// The postMessage() methods taking a Transferable array argument have custom
-// binding code that is able to handle the Transferables that we currently
-// recognize. To be able to declare a postMessage() signature that matches
-// the implementation, we provide a Transferable typedef but with an
-// incomplete type.
-//
-// FIXME: make this typedef accurate once enough of http://crbug.com/240176
-// is in place.
-// FIXME: consider putting this typedef in an .idl file containing spec-wide
-// utility type definitions.
-typedef MessagePort Transferable;
+ attribute DOMMatrixConstructor WebKitCSSMatrix;
+};
Window implements GlobalEventHandlers;
Window implements WindowBase64;
diff --git a/core/frame/WindowBase64.idl b/core/frame/WindowBase64.idl
index fe2fe8a..a19439e 100644
--- a/core/frame/WindowBase64.idl
+++ b/core/frame/WindowBase64.idl
@@ -29,7 +29,7 @@
[
NoInterfaceObject, // Always used on target of 'implements'
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface WindowBase64 {
[RaisesException] DOMString btoa(DOMString btoa);
[RaisesException] DOMString atob(DOMString atob);
diff --git a/core/frame/WindowEventHandlers.idl b/core/frame/WindowEventHandlers.idl
index 9b76672..9bd850d 100644
--- a/core/frame/WindowEventHandlers.idl
+++ b/core/frame/WindowEventHandlers.idl
@@ -32,25 +32,23 @@
[
ImplementedAs=DOMWindowEventHandlers,
LegacyTreatAsPartialInterface,
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface WindowEventHandlers {
- //attribute EventHandler onafterprint;
- //attribute EventHandler onbeforeprint;
+ attribute EventHandler onafterprint;
+ attribute EventHandler onbeforeprint;
// FIXME: onbeforeunload should be an OnBeforeUnloadEventHandler.
attribute EventHandler onbeforeunload;
attribute EventHandler onhashchange;
attribute EventHandler onlanguagechange;
attribute EventHandler onmessage;
+ attribute EventHandler onmessageerror;
attribute EventHandler onoffline;
attribute EventHandler ononline;
attribute EventHandler onpagehide;
attribute EventHandler onpageshow;
attribute EventHandler onpopstate;
+ attribute EventHandler onrejectionhandled;
attribute EventHandler onstorage;
+ attribute EventHandler onunhandledrejection;
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 0840392..9f8fc07 100644
--- a/core/frame/WindowTimers.idl
+++ b/core/frame/WindowTimers.idl
@@ -31,12 +31,12 @@
ImplementedAs=DOMWindowTimers,
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface WindowTimers {
// 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
- [CallWith=ScriptState] long setTimeout(Function handler, optional long timeout = 0, any... arguments);
+ [CallWith=ScriptState, RuntimeCallStatsCounter=WindowSetTimeout] 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);
diff --git a/core/fullscreen/DocumentFullscreen.idl b/core/fullscreen/DocumentFullscreen.idl
new file mode 100644
index 0000000..de3a8a2
--- /dev/null
+++ b/core/fullscreen/DocumentFullscreen.idl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
+ * Copyright (C) 2013 Google 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.
+ */
+
+// https://fullscreen.spec.whatwg.org/#api
+
+[
+ ImplementedAs=DocumentFullscreen
+] partial interface Document {
+ [RuntimeEnabled=FullscreenUnprefixed] readonly attribute boolean fullscreenEnabled;
+
+ [RuntimeEnabled=FullscreenUnprefixed] void exitFullscreen();
+
+ [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenchange;
+ [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenerror;
+
+ // Mozilla version
+ [MeasureAs=PrefixedDocumentIsFullscreen, ImplementedAs=fullscreenElement] readonly attribute boolean webkitIsFullScreen;
+ [MeasureAs=PrefixedDocumentCurrentFullScreenElement, ImplementedAs=fullscreenElement] readonly attribute Element webkitCurrentFullScreenElement;
+ [MeasureAs=PrefixedDocumentCancelFullScreen, ImplementedAs=exitFullscreen] void webkitCancelFullScreen();
+
+ // W3C version
+ [MeasureAs=PrefixedDocumentFullscreenEnabled, ImplementedAs=fullscreenEnabled] readonly attribute boolean webkitFullscreenEnabled;
+ [MeasureAs=PrefixedDocumentFullscreenElement, ImplementedAs=fullscreenElement] readonly attribute Element webkitFullscreenElement;
+ [MeasureAs=PrefixedDocumentExitFullscreen, ImplementedAs=exitFullscreen] void webkitExitFullscreen();
+
+ attribute EventHandler onwebkitfullscreenchange;
+ attribute EventHandler onwebkitfullscreenerror;
+};
diff --git a/core/fullscreen/ElementFullscreen.idl b/core/fullscreen/ElementFullscreen.idl
new file mode 100644
index 0000000..723279f
--- /dev/null
+++ b/core/fullscreen/ElementFullscreen.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://fullscreen.spec.whatwg.org/#api
+
+[
+ ImplementedAs=ElementFullscreen
+] partial interface Element {
+ [RuntimeEnabled=FullscreenUnprefixed] void requestFullscreen();
+
+ [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenchange;
+ [RuntimeEnabled=FullscreenUnprefixed] attribute EventHandler onfullscreenerror;
+
+ // Mozilla version
+ [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen();
+
+ // W3C version
+ [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen();
+
+ attribute EventHandler onwebkitfullscreenchange;
+ attribute EventHandler onwebkitfullscreenerror;
+};
diff --git a/core/geometry/DOMMatrix.idl b/core/geometry/DOMMatrix.idl
new file mode 100644
index 0000000..5f3378c
--- /dev/null
+++ b/core/geometry/DOMMatrix.idl
@@ -0,0 +1,73 @@
+// 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://drafts.fxtf.org/geometry/#DOMMatrix
+
+[
+ Constructor(optional (DOMString or sequence<unrestricted double>) init),
+ RaisesException=Constructor,
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+] interface DOMMatrix : DOMMatrixReadOnly {
+ [RaisesException, NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
+ [RaisesException, NewObject] static DOMMatrix fromFloat32Array(Float32Array array32);
+ [RaisesException, NewObject] static DOMMatrix fromFloat64Array(Float64Array array64);
+
+ // These attributes are simple aliases for certain elements of the 4x4 matrix
+ 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;
+
+ 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;
+
+ // Mutable transform methods
+ [RaisesException] DOMMatrix multiplySelf(optional DOMMatrixInit other);
+ [RaisesException] DOMMatrix preMultiplySelf(optional DOMMatrixInit other);
+ DOMMatrix translateSelf(optional unrestricted double tx = 0,
+ optional unrestricted double ty = 0,
+ optional unrestricted double tz = 0);
+ DOMMatrix scaleSelf(optional unrestricted double scaleX = 1,
+ optional unrestricted double scaleY,
+ optional unrestricted double scaleZ = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix scale3dSelf(optional unrestricted double scale = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix rotateSelf(optional unrestricted double rotX = 0,
+ optional unrestricted double rotY,
+ optional unrestricted double rotZ);
+ DOMMatrix rotateFromVectorSelf(optional unrestricted double x = 0,
+ optional unrestricted double y = 0);
+ DOMMatrix rotateAxisAngleSelf(optional unrestricted double x = 0,
+ optional unrestricted double y = 0,
+ optional unrestricted double z = 0,
+ optional unrestricted double angle = 0);
+ DOMMatrix skewXSelf(optional unrestricted double sx = 0);
+ DOMMatrix skewYSelf(optional unrestricted double sy = 0);
+ DOMMatrix invertSelf();
+
+ [Exposed=Window, RaisesException] DOMMatrix setMatrixValue(DOMString transformList);
+};
diff --git a/core/geometry/DOMMatrix2DInit.idl b/core/geometry/DOMMatrix2DInit.idl
new file mode 100644
index 0000000..78d90b5
--- /dev/null
+++ b/core/geometry/DOMMatrix2DInit.idl
@@ -0,0 +1,20 @@
+// Copyright 2017 The Chromium 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://drafts.fxtf.org/geometry/#dictdef-dommatrix2dinit
+
+dictionary DOMMatrix2DInit {
+ unrestricted double a;
+ unrestricted double b;
+ unrestricted double c;
+ unrestricted double d;
+ unrestricted double e;
+ unrestricted double f;
+ unrestricted double m11;
+ unrestricted double m12;
+ unrestricted double m21;
+ unrestricted double m22;
+ unrestricted double m41;
+ unrestricted double m42;
+};
\ No newline at end of file
diff --git a/core/geometry/DOMMatrixInit.idl b/core/geometry/DOMMatrixInit.idl
new file mode 100644
index 0000000..9608a63
--- /dev/null
+++ b/core/geometry/DOMMatrixInit.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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://drafts.fxtf.org/geometry/#dictdef-dommatrixinit
+
+dictionary DOMMatrixInit : DOMMatrix2DInit {
+ unrestricted double m13 = 0;
+ unrestricted double m14 = 0;
+ unrestricted double m23 = 0;
+ unrestricted double m24 = 0;
+ unrestricted double m31 = 0;
+ unrestricted double m32 = 0;
+ unrestricted double m33 = 1;
+ unrestricted double m34 = 0;
+ unrestricted double m43 = 0;
+ unrestricted double m44 = 1;
+ boolean is2D;
+};
diff --git a/core/geometry/DOMMatrixReadOnly.idl b/core/geometry/DOMMatrixReadOnly.idl
new file mode 100644
index 0000000..5bf2e2a
--- /dev/null
+++ b/core/geometry/DOMMatrixReadOnly.idl
@@ -0,0 +1,81 @@
+// 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://drafts.fxtf.org/geometry/#DOMMatrix
+
+[
+ Constructor(optional (DOMString or sequence<unrestricted double>) init),
+ RaisesException=Constructor,
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+] interface DOMMatrixReadOnly {
+ [RaisesException, NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other);
+ [RaisesException, NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32);
+ [RaisesException, NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64);
+
+ // These attributes are simple aliases for certain elements of the 4x4 matrix
+ readonly attribute unrestricted double a;
+ readonly attribute unrestricted double b;
+ readonly attribute unrestricted double c;
+ readonly attribute unrestricted double d;
+ readonly attribute unrestricted double e;
+ readonly attribute unrestricted double f;
+
+ readonly attribute unrestricted double m11;
+ readonly attribute unrestricted double m12;
+ readonly attribute unrestricted double m13;
+ readonly attribute unrestricted double m14;
+ readonly attribute unrestricted double m21;
+ readonly attribute unrestricted double m22;
+ readonly attribute unrestricted double m23;
+ readonly attribute unrestricted double m24;
+ readonly attribute unrestricted double m31;
+ readonly attribute unrestricted double m32;
+ readonly attribute unrestricted double m33;
+ readonly attribute unrestricted double m34;
+ readonly attribute unrestricted double m41;
+ readonly attribute unrestricted double m42;
+ readonly attribute unrestricted double m43;
+ readonly attribute unrestricted double m44;
+
+ readonly attribute boolean is2D;
+ readonly attribute boolean isIdentity;
+
+ // Immutable transform methods
+ DOMMatrix translate(optional unrestricted double tx = 0,
+ optional unrestricted double ty = 0,
+ optional unrestricted double tz = 0);
+ DOMMatrix scale(optional unrestricted double scaleX = 1,
+ optional unrestricted double scaleY,
+ optional unrestricted double scaleZ = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix scale3d(optional unrestricted double scale = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix rotate(optional unrestricted double rotX = 0,
+ optional unrestricted double rotY,
+ optional unrestricted double rotZ);
+ DOMMatrix rotateFromVector(optional unrestricted double x = 0,
+ optional unrestricted double y = 0);
+ DOMMatrix rotateAxisAngle(optional unrestricted double x = 0,
+ optional unrestricted double y = 0,
+ optional unrestricted double z = 0,
+ optional unrestricted double angle = 0);
+ DOMMatrix skewX(optional unrestricted double sx = 0);
+ DOMMatrix skewY(optional unrestricted double sy = 0);
+ [RaisesException] DOMMatrix multiply(optional DOMMatrixInit other);
+ DOMMatrix flipX();
+ DOMMatrix flipY();
+ DOMMatrix inverse();
+
+ DOMPoint transformPoint(optional DOMPointInit point);
+ Float32Array toFloat32Array();
+ Float64Array toFloat64Array();
+ [Exposed=Window, RaisesException] stringifier;
+ serializer = { attribute };
+};
diff --git a/core/geometry/DOMPoint.idl b/core/geometry/DOMPoint.idl
new file mode 100644
index 0000000..63f084c
--- /dev/null
+++ b/core/geometry/DOMPoint.idl
@@ -0,0 +1,18 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// https://drafts.fxtf.org/geometry/#DOMPoint
+
+[
+ Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
+ optional unrestricted double z = 0, optional unrestricted double w = 1),
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+] interface DOMPoint : DOMPointReadOnly {
+ [NewObject] static DOMPoint fromPoint(optional DOMPointInit other);
+ inherit attribute unrestricted double x;
+ inherit attribute unrestricted double y;
+ inherit attribute unrestricted double z;
+ inherit attribute unrestricted double w;
+};
diff --git a/core/geometry/DOMPointInit.idl b/core/geometry/DOMPointInit.idl
new file mode 100644
index 0000000..e901792
--- /dev/null
+++ b/core/geometry/DOMPointInit.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://drafts.fxtf.org/geometry/#DOMPoint
+
+dictionary DOMPointInit {
+ unrestricted double x = 0;
+ unrestricted double y = 0;
+ unrestricted double z = 0;
+ unrestricted double w = 1;
+};
diff --git a/core/geometry/DOMPointReadOnly.idl b/core/geometry/DOMPointReadOnly.idl
new file mode 100644
index 0000000..3ac60c5
--- /dev/null
+++ b/core/geometry/DOMPointReadOnly.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://drafts.fxtf.org/geometry/#dompointreadonly
+
+[
+ Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
+ optional unrestricted double z = 0, optional unrestricted double w = 1),
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+] interface DOMPointReadOnly {
+ [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other);
+
+ readonly attribute unrestricted double x;
+ readonly attribute unrestricted double y;
+ readonly attribute unrestricted double z;
+ readonly attribute unrestricted double w;
+
+ [RaisesException] DOMPoint matrixTransform(optional DOMMatrixInit matrix);
+
+ serializer = { attribute };
+};
diff --git a/core/geometry/DOMQuad.idl b/core/geometry/DOMQuad.idl
new file mode 100644
index 0000000..72f4b2f
--- /dev/null
+++ b/core/geometry/DOMQuad.idl
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium 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://drafts.fxtf.org/geometry/#domquad
+
+[
+ Constructor(optional DOMPointInit p1, optional DOMPointInit p2,
+ optional DOMPointInit p3, optional DOMPointInit p4),
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+]
+interface DOMQuad {
+ [NewObject] static DOMQuad fromRect(optional DOMRectInit other);
+ [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other);
+
+ [SameObject] readonly attribute DOMPoint p1;
+ [SameObject] readonly attribute DOMPoint p2;
+ [SameObject] readonly attribute DOMPoint p3;
+ [SameObject] readonly attribute DOMPoint p4;
+ [NewObject] DOMRect getBounds();
+
+ serializer = { attribute };
+};
diff --git a/core/geometry/DOMQuadInit.idl b/core/geometry/DOMQuadInit.idl
new file mode 100644
index 0000000..126a47a
--- /dev/null
+++ b/core/geometry/DOMQuadInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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://drafts.fxtf.org/geometry/#dictdef-domquadinit
+
+dictionary DOMQuadInit {
+ DOMPointInit p1;
+ DOMPointInit p2;
+ DOMPointInit p3;
+ DOMPointInit p4;
+};
diff --git a/core/geometry/DOMRect.idl b/core/geometry/DOMRect.idl
new file mode 100644
index 0000000..6fa18c6
--- /dev/null
+++ b/core/geometry/DOMRect.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.
+
+// https://drafts.fxtf.org/geometry/#DOMRect
+
+[
+ Constructor(optional unrestricted double x = 0,
+ optional unrestricted double y = 0,
+ optional unrestricted double width = 0,
+ optional unrestricted double height = 0),
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+] interface DOMRect : DOMRectReadOnly {
+ [NewObject] static DOMRect fromRect(optional DOMRectInit other);
+
+ inherit attribute unrestricted double x;
+ inherit attribute unrestricted double y;
+ inherit attribute unrestricted double width;
+ inherit attribute unrestricted double height;
+};
diff --git a/core/geometry/DOMRectInit.idl b/core/geometry/DOMRectInit.idl
new file mode 100644
index 0000000..2bcc9f3
--- /dev/null
+++ b/core/geometry/DOMRectInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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://drafts.fxtf.org/geometry/#dictdef-domrectinit
+
+dictionary DOMRectInit {
+ unrestricted double x = 0;
+ unrestricted double y = 0;
+ unrestricted double width = 0;
+ unrestricted double height = 0;
+};
diff --git a/core/geometry/DOMRectList.idl b/core/geometry/DOMRectList.idl
new file mode 100644
index 0000000..4d3d608
--- /dev/null
+++ b/core/geometry/DOMRectList.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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://drafts.fxtf.org/geometry/#DOMRectList
+// Spec update: https://github.com/w3c/fxtf-drafts/pull/186
+
+// DOMRectList only exists for compatibility with legacy web content.
+// When specifying a new API, use sequence<DOMRect> instead.
+
+// TODO: Spec also includes LegacyArrayClass that our IDL doesn't support yet.
+[ NoInterfaceObject ] interface DOMRectList {
+ readonly attribute unsigned long length;
+ [MeasureAs=ClientRectListItem] getter DOMRect? item(unsigned long index);
+};
diff --git a/core/geometry/DOMRectReadOnly.idl b/core/geometry/DOMRectReadOnly.idl
new file mode 100644
index 0000000..05854af
--- /dev/null
+++ b/core/geometry/DOMRectReadOnly.idl
@@ -0,0 +1,25 @@
+// 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://drafts.fxtf.org/geometry/#DOMRect
+
+[
+ Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
+ optional unrestricted double width = 0, optional unrestricted double height = 0),
+ Exposed=(Window,Worker),
+ RuntimeEnabled=GeometryInterfaces
+] interface DOMRectReadOnly {
+ [NewObject] static DOMRectReadOnly fromRect(optional DOMRectInit other);
+
+ readonly attribute unrestricted double x;
+ readonly attribute unrestricted double y;
+ readonly attribute unrestricted double width;
+ readonly attribute unrestricted double height;
+ readonly attribute unrestricted double top;
+ readonly attribute unrestricted double right;
+ readonly attribute unrestricted double bottom;
+ readonly attribute unrestricted double left;
+
+ serializer = { attribute };
+};
diff --git a/core/html/AssignedNodesOptions.idl b/core/html/AssignedNodesOptions.idl
index 5247c06..5d699ec 100644
--- a/core/html/AssignedNodesOptions.idl
+++ b/core/html/AssignedNodesOptions.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://w3c.github.io/webcomponents/spec/shadow/#idl-def-AssignedNodesOptions
+// https://w3c.github.io/webcomponents/spec/shadow/#idl-def-AssignedNodesOptions
dictionary AssignedNodesOptions {
boolean flatten = false;
diff --git a/core/html/FormData.idl b/core/html/FormData.idl
deleted file mode 100644
index 70df8fe..0000000
--- a/core/html/FormData.idl
+++ /dev/null
@@ -1,56 +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:
- *
- * * 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://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,
- LegacyInterfaceTypeChecking,
-] interface FormData {
- // 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] 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 dc4ba0d..e3c39c6 100644
--- a/core/html/HTMLAllCollection.idl
+++ b/core/html/HTMLAllCollection.idl
@@ -29,15 +29,14 @@
[
Custom=LegacyCallAsFunction,
DependentLifetime,
- SetWrapperReferenceFrom=ownerNode,
- WillBeGarbageCollected,
+ LegacyUnenumerableNamedProperties
] interface HTMLAllCollection {
readonly attribute unsigned long length;
[ImplementedAs=item] getter Element (unsigned long index);
// 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: namedItem() should be a legacycaller. crbug.com/465009
+ // FIXME: namedItem() should be a legacycaller.
// 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 255acf0..1b736f4 100644
--- a/core/html/HTMLAnchorElement.idl
+++ b/core/html/HTMLAnchorElement.idl
@@ -21,25 +21,25 @@
// https://html.spec.whatwg.org/#the-a-element
interface HTMLAnchorElement : HTMLElement {
- [Reflect] attribute DOMString target;
- [Reflect] attribute DOMString download;
+ [CEReactions, Reflect] attribute DOMString target;
+ [CEReactions, Reflect] attribute DOMString download;
// FIXME: ping should be a DOMTokenList.
- [Reflect] attribute DOMString ping;
- [Reflect] attribute DOMString rel;
+ [CEReactions, Reflect] attribute DOMString ping;
+ [CEReactions, Reflect] attribute DOMString rel;
// FIXME: readonly attribute DOMTokenList relList;
- [Reflect] attribute DOMString hreflang;
- [Reflect] attribute DOMString type;
- [RuntimeEnabled=ReferrerPolicyAttribute, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerpolicy;
+ [CEReactions, Reflect] attribute DOMString hreflang;
+ [CEReactions, Reflect] attribute DOMString type;
+ [CEReactions, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerPolicy;
- [ImplementedAs=textContent] attribute DOMString text;
+ [CEReactions, ImplementedAs=textContent] attribute DOMString text;
// 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;
+ [CEReactions, Reflect] attribute DOMString coords;
+ [CEReactions, Reflect] attribute DOMString charset;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString rev;
+ [CEReactions, Reflect] attribute DOMString shape;
};
-HTMLAnchorElement implements URLUtils;
+HTMLAnchorElement implements HTMLHyperlinkElementUtils;
diff --git a/core/html/HTMLAreaElement.idl b/core/html/HTMLAreaElement.idl
index 4782665..55b3a88 100644
--- a/core/html/HTMLAreaElement.idl
+++ b/core/html/HTMLAreaElement.idl
@@ -21,18 +21,20 @@
// https://html.spec.whatwg.org/#the-area-element
interface HTMLAreaElement : HTMLElement {
- [Reflect] attribute DOMString alt;
- [Reflect] attribute DOMString coords;
- [Reflect] attribute DOMString shape;
- [Reflect] attribute DOMString target;
+ [CEReactions, Reflect] attribute DOMString alt;
+ [CEReactions, Reflect] attribute DOMString coords;
+ [CEReactions, Reflect] attribute DOMString download;
+ [CEReactions, Reflect] attribute DOMString shape;
+ [CEReactions, Reflect] attribute DOMString target;
// FIXME: ping should be a DOMTokenList.
- [Reflect] attribute DOMString ping;
- // FIXME: download, rel, relList are missing
- [RuntimeEnabled=ReferrerPolicyAttribute, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerpolicy;
+ [CEReactions, Reflect] attribute DOMString ping;
+ [CEReactions, Reflect] attribute DOMString rel;
+ // FIXME: relList is missing
+ [CEReactions, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerPolicy;
// obsolete members
// https://html.spec.whatwg.org/#HTMLAreaElement-partial
- [Reflect] attribute boolean noHref;
+ [CEReactions, Reflect] attribute boolean noHref;
};
-HTMLAreaElement implements URLUtils;
+HTMLAreaElement implements HTMLHyperlinkElementUtils;
diff --git a/core/html/HTMLAudioElement.idl b/core/html/HTMLAudioElement.idl
index 5e1076b..13ea2f7 100644
--- a/core/html/HTMLAudioElement.idl
+++ b/core/html/HTMLAudioElement.idl
@@ -26,9 +26,7 @@
// 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),
+ NamedConstructor=Audio(optional DOMString src),
ConstructorCallWith=Document
] interface HTMLAudioElement : HTMLMediaElement {
};
diff --git a/core/html/HTMLBRElement.idl b/core/html/HTMLBRElement.idl
index 0f10d28..11020c1 100644
--- a/core/html/HTMLBRElement.idl
+++ b/core/html/HTMLBRElement.idl
@@ -22,5 +22,5 @@
interface HTMLBRElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLBRElement-partial
- [Reflect] attribute DOMString clear;
+ [CEReactions, Reflect] attribute DOMString clear;
};
diff --git a/core/html/HTMLBaseElement.idl b/core/html/HTMLBaseElement.idl
index 4a6273d..63229fe 100644
--- a/core/html/HTMLBaseElement.idl
+++ b/core/html/HTMLBaseElement.idl
@@ -20,6 +20,6 @@
// https://html.spec.whatwg.org/#the-base-element
interface HTMLBaseElement : HTMLElement {
- attribute DOMString href;
- [Reflect] attribute DOMString target;
+ [CEReactions] attribute DOMString href;
+ [CEReactions, Reflect] attribute DOMString target;
};
diff --git a/core/html/HTMLBodyElement.idl b/core/html/HTMLBodyElement.idl
index 51f0308..a8011d5 100644
--- a/core/html/HTMLBodyElement.idl
+++ b/core/html/HTMLBodyElement.idl
@@ -23,14 +23,14 @@
interface HTMLBodyElement : HTMLElement {
// 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;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString text;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString link;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString vLink;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString aLink;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [CEReactions, Reflect] attribute DOMString background;
- // TODO(philipj): These event handler attributes should be inherited from
+ // TODO(foolip): 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;
@@ -40,7 +40,8 @@
attribute EventHandler onresize;
attribute EventHandler onscroll;
- // Non-standard APIs
+ // Compatibility
+ // https://compat.spec.whatwg.org/#windoworientation-interface
[RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange;
};
diff --git a/core/html/HTMLButtonElement.idl b/core/html/HTMLButtonElement.idl
deleted file mode 100644
index a6c47d6..0000000
--- a/core/html/HTMLButtonElement.idl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 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.
- */
-
-// 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;
- attribute DOMString formAction;
- attribute DOMString formEnctype;
- attribute DOMString formMethod;
- [Reflect] attribute boolean formNoValidate;
- [Reflect] attribute DOMString formTarget;
- [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();
- boolean reportValidity();
- void setCustomValidity(DOMString error);
-
- readonly attribute NodeList labels;
-};
diff --git a/core/html/HTMLCanvasElement.idl b/core/html/HTMLCanvasElement.idl
index 15e7e50..2541c49 100644
--- a/core/html/HTMLCanvasElement.idl
+++ b/core/html/HTMLCanvasElement.idl
@@ -28,30 +28,16 @@
interface HTMLCanvasElement : HTMLElement
{
- // FIXME: width and height should be unsigned long.
- attribute long width;
- attribute long height;
+ // Note: Due to dependecies on modules, getContext is defined in a partial
+ // interface in HTMLCanvasElementModule.idl
- // 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.
- //
- [CallWith=ScriptState] any getContext(DOMString contextId, [PermissiveDictionaryConversion] optional CanvasContextCreationAttributes attributes);
+ [RaisesException=Setter, CEReactions] attribute unsigned long width;
+ [RaisesException=Setter, CEReactions] attribute unsigned long height;
// Note: The arguments argument is variadic in the spec, but not here as
// only one extra argument is actually used.
// FIXME: type should not have a default value.
- [RaisesException] DOMString toDataURL(optional DOMString type = null, optional any arguments);
+ [MeasureAs=CanvasToDataURL, RaisesException] DOMString toDataURL(optional DOMString type = null, optional any arguments);
- [RaisesException] void toBlob(BlobCallback _callback, optional DOMString type = null, optional any arguments);
+ [MeasureAs=CanvasToBlob, RaisesException] void toBlob(BlobCallback _callback, optional DOMString type = null, optional any arguments);
};
diff --git a/core/html/HTMLCollection.idl b/core/html/HTMLCollection.idl
index b285517..7bbe9b3 100644
--- a/core/html/HTMLCollection.idl
+++ b/core/html/HTMLCollection.idl
@@ -23,8 +23,7 @@
[
DependentLifetime,
- SetWrapperReferenceFrom=ownerNode,
- WillBeGarbageCollected,
+ LegacyUnenumerableNamedProperties
] interface HTMLCollection {
readonly attribute unsigned long length;
getter Element? item(unsigned long index);
diff --git a/core/html/HTMLContentElement.idl b/core/html/HTMLContentElement.idl
index 0979cf8..937de47 100644
--- a/core/html/HTMLContentElement.idl
+++ b/core/html/HTMLContentElement.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/webcomponents/spec/shadow/#the-content-element
+// https://w3c.github.io/webcomponents/spec/shadow/#the-content-element
interface HTMLContentElement : HTMLElement {
[Reflect] attribute DOMString select;
diff --git a/core/html/HTMLDListElement.idl b/core/html/HTMLDListElement.idl
index 9813b53..23813a5 100644
--- a/core/html/HTMLDListElement.idl
+++ b/core/html/HTMLDListElement.idl
@@ -22,5 +22,5 @@
interface HTMLDListElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLDListElement-partial
- [Reflect] attribute boolean compact;
+ [CEReactions, Reflect] attribute boolean compact;
};
diff --git a/core/html/HTMLDataElement.idl b/core/html/HTMLDataElement.idl
new file mode 100644
index 0000000..6f65099
--- /dev/null
+++ b/core/html/HTMLDataElement.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/text-level-semantics.html#the-data-element
+
+[HTMLConstructor]
+interface HTMLDataElement : HTMLElement {
+ [CEReactions, Reflect] attribute DOMString value;
+};
\ No newline at end of file
diff --git a/core/html/HTMLDetailsElement.idl b/core/html/HTMLDetailsElement.idl
index e3711bc..10e96f4 100644
--- a/core/html/HTMLDetailsElement.idl
+++ b/core/html/HTMLDetailsElement.idl
@@ -20,5 +20,5 @@
// https://html.spec.whatwg.org/#the-details-element
interface HTMLDetailsElement : HTMLElement {
- [Reflect] attribute boolean open;
+ [CEReactions, Reflect] attribute boolean open;
};
diff --git a/core/html/HTMLDialogElement.idl b/core/html/HTMLDialogElement.idl
index b6d8711..c26d9f8 100644
--- a/core/html/HTMLDialogElement.idl
+++ b/core/html/HTMLDialogElement.idl
@@ -26,11 +26,9 @@
// https://html.spec.whatwg.org/#the-dialog-element
interface HTMLDialogElement : HTMLElement {
- [Reflect] attribute boolean open;
+ [CEReactions, Reflect] attribute boolean open;
attribute DOMString returnValue;
- // 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);
+ [CEReactions] void show();
+ [CEReactions, RaisesException] void showModal();
+ [CEReactions] void close(optional DOMString returnValue);
};
diff --git a/core/html/HTMLDirectoryElement.idl b/core/html/HTMLDirectoryElement.idl
index ea9d1a5..64e76d5 100644
--- a/core/html/HTMLDirectoryElement.idl
+++ b/core/html/HTMLDirectoryElement.idl
@@ -20,5 +20,5 @@
// https://html.spec.whatwg.org/#htmldirectoryelement
interface HTMLDirectoryElement : HTMLElement {
- [Reflect] attribute boolean compact;
+ [CEReactions, Reflect] attribute boolean compact;
};
diff --git a/core/html/HTMLDivElement.idl b/core/html/HTMLDivElement.idl
index 9ee666d..2eb1215 100644
--- a/core/html/HTMLDivElement.idl
+++ b/core/html/HTMLDivElement.idl
@@ -18,9 +18,9 @@
*/
// https://html.spec.whatwg.org/#the-div-element
-
+[HTMLConstructor]
interface HTMLDivElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLDivElement-partial
- [Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLDocument.idl b/core/html/HTMLDocument.idl
index 2b3f5b9..7a49a53 100644
--- a/core/html/HTMLDocument.idl
+++ b/core/html/HTMLDocument.idl
@@ -26,16 +26,16 @@
interface HTMLDocument : Document {
// https://html.spec.whatwg.org/#Document-partial
- [TreatNullAs=EmptyString, CustomElementCallbacks] attribute DOMString fgColor;
- [TreatNullAs=EmptyString, CustomElementCallbacks] attribute DOMString linkColor;
- [TreatNullAs=EmptyString, CustomElementCallbacks] attribute DOMString vlinkColor;
- [TreatNullAs=EmptyString, CustomElementCallbacks] attribute DOMString alinkColor;
- [TreatNullAs=EmptyString, CustomElementCallbacks] attribute DOMString bgColor;
+ [CEReactions, CustomElementCallbacks] attribute [TreatNullAs=EmptyString] DOMString fgColor;
+ [CEReactions, CustomElementCallbacks] attribute [TreatNullAs=EmptyString] DOMString linkColor;
+ [CEReactions, CustomElementCallbacks] attribute [TreatNullAs=EmptyString] DOMString vlinkColor;
+ [CEReactions, CustomElementCallbacks] attribute [TreatNullAs=EmptyString] DOMString alinkColor;
+ [CEReactions, CustomElementCallbacks] attribute [TreatNullAs=EmptyString] DOMString bgColor;
[MeasureAs=DocumentClear] void clear();
[MeasureAs=DocumentCaptureEvents] void captureEvents();
[MeasureAs=DocumentReleaseEvents] void releaseEvents();
// FIXME: all should not be [Replaceable].
- [Replaceable, ImplementedAs=allForBinding] readonly attribute HTMLAllCollection all;
+ [Replaceable, MeasureAs=DocumentAll] readonly attribute HTMLAllCollection all;
};
diff --git a/core/html/HTMLElement.idl b/core/html/HTMLElement.idl
index d39a27a..de97f7e 100644
--- a/core/html/HTMLElement.idl
+++ b/core/html/HTMLElement.idl
@@ -19,47 +19,48 @@
*/
// https://html.spec.whatwg.org/#htmlelement
-
+[HTMLConstructor]
interface HTMLElement : Element {
// metadata attributes
- [Reflect] attribute DOMString title;
- [Reflect] attribute DOMString lang;
- attribute boolean translate;
- attribute DOMString dir;
+ [CEReactions, Reflect] attribute DOMString title;
+ [CEReactions, Reflect] attribute DOMString lang;
+ [CEReactions] attribute boolean translate;
+ [CEReactions] attribute DOMString dir;
[SameObject, PerWorldBindings] readonly attribute DOMStringMap dataset;
// user interaction
- [Reflect] attribute boolean hidden;
- [ImplementedAs=clickForBindings] void click();
- [CustomElementCallbacks] attribute long tabIndex;
+ [CEReactions, Reflect] attribute boolean hidden;
+ [RuntimeCallStatsCounter=HTMLElementClick] void click();
+ [CEReactions, CustomElementCallbacks] attribute long tabIndex;
+ [CEReactions, RuntimeEnabled=InertAttribute, Reflect] attribute boolean inert;
void focus();
void blur();
- [Reflect] attribute DOMString accessKey;
- [CustomElementCallbacks] attribute boolean draggable;
- [RuntimeEnabled=ContextMenu] attribute HTMLMenuElement? contextMenu;
- attribute boolean spellcheck;
+ [CEReactions, Reflect] attribute DOMString accessKey;
+ [CEReactions, CustomElementCallbacks] attribute boolean draggable;
+ [CEReactions] attribute boolean spellcheck;
// HTMLElement implements ElementContentEditable
// https://html.spec.whatwg.org/#contenteditable
- [CustomElementCallbacks, RaisesException=Setter] attribute DOMString contentEditable;
- readonly attribute boolean isContentEditable;
+ [CEReactions, CustomElementCallbacks, RaisesException=Setter] attribute DOMString contentEditable;
+ [ImplementedAs=isContentEditableForBinding] readonly attribute boolean isContentEditable;
+ [RuntimeEnabled=InputModeAttribute, CEReactions, Reflect] attribute DOMString inputMode;
// 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;
+ // https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
+ [PerWorldBindings, ImplementedAs=unclosedOffsetParent] readonly attribute Element? offsetParent;
+ [ImplementedAs=offsetTopForBinding] readonly attribute long offsetTop;
+ [ImplementedAs=offsetLeftForBinding] readonly attribute long offsetLeft;
+ [ImplementedAs=offsetWidthForBinding] readonly attribute long offsetWidth;
+ [ImplementedAs=offsetHeightForBinding] readonly attribute long offsetHeight;
// CSS Object Model (CSSOM)
- // http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface
+ // https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface
[SameObject, PerWorldBindings, PutForwards=cssText] 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;
+ [CEReactions, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementInnerText] attribute [TreatNullAs=NullString] DOMString innerText;
+ [CEReactions, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementOuterText] attribute [TreatNullAs=NullString] DOMString outerText;
};
HTMLElement implements GlobalEventHandlers;
+HTMLElement implements NoncedElement;
diff --git a/core/html/HTMLEmbedElement.idl b/core/html/HTMLEmbedElement.idl
index 11f7722..f9df7f0 100644
--- a/core/html/HTMLEmbedElement.idl
+++ b/core/html/HTMLEmbedElement.idl
@@ -22,26 +22,21 @@
// TODO(yukishiino): HTMLEmbedElement should not have [OverrideBuiltins].
[
-// FIXMEDART: TODO(terry): Needed to remove Custom=LegacyCallAsFunction from Embed and Object
-// otherwise an anonymous function is returned.
-// Custom=LegacyCallAsFunction,
OverrideBuiltins,
+ ActiveScriptWrappable
] interface HTMLEmbedElement : HTMLElement {
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString type;
- [Reflect] attribute DOMString width;
- [Reflect] attribute DOMString height;
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect] attribute DOMString type;
+ [CEReactions, Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString height;
[CheckSecurity=ReturnValue, 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;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, 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);
};
diff --git a/core/html/HTMLFieldSetElement.idl b/core/html/HTMLFieldSetElement.idl
deleted file mode 100644
index fb86dc8..0000000
--- a/core/html/HTMLFieldSetElement.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * 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.
- */
-
-// https://html.spec.whatwg.org/#the-fieldset-element
-
-interface HTMLFieldSetElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
- [Reflect] attribute DOMString name;
-
- readonly attribute DOMString type;
-
- [Measure] readonly attribute HTMLFormControlsCollection elements;
-
- 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 c6ec865..d006f90 100644
--- a/core/html/HTMLFontElement.idl
+++ b/core/html/HTMLFontElement.idl
@@ -20,7 +20,7 @@
// https://html.spec.whatwg.org/#htmlfontelement
interface HTMLFontElement : HTMLElement {
- [Reflect, TreatNullAs=EmptyString] attribute DOMString color;
- [Reflect] attribute DOMString face;
- [Reflect] attribute DOMString size;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString color;
+ [CEReactions, Reflect] attribute DOMString face;
+ [CEReactions, Reflect] attribute DOMString size;
};
diff --git a/core/html/HTMLFormControlsCollection.idl b/core/html/HTMLFormControlsCollection.idl
deleted file mode 100644
index 90ca091..0000000
--- a/core/html/HTMLFormControlsCollection.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * Copyright (C) 2014 Samsung Electronics. 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.
- */
-
-// 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);
-};
diff --git a/core/html/HTMLFormElement.idl b/core/html/HTMLFormElement.idl
deleted file mode 100644
index d9e9d4c..0000000
--- a/core/html/HTMLFormElement.idl
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 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.
- */
-
-// https://html.spec.whatwg.org/#the-form-element
-
-[
- OverrideBuiltins,
-] interface HTMLFormElement : HTMLElement {
- [Reflect=accept_charset] attribute DOMString acceptCharset;
- [Reflect, URL] attribute DOMString action;
- [Reflect, ReflectOnly=("on","off"), ReflectMissing="on", ReflectInvalid="on"] attribute DOMString autocomplete;
- [CustomElementCallbacks] attribute DOMString enctype;
- [CustomElementCallbacks] attribute DOMString encoding;
- [CustomElementCallbacks] attribute DOMString method;
- [Reflect] attribute DOMString name;
- [Reflect] attribute boolean noValidate;
- [Reflect] attribute DOMString target;
-
- 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, MeasureAs=RequestAutocomplete] void requestAutocomplete();
-};
diff --git a/core/html/HTMLFrameElement.idl b/core/html/HTMLFrameElement.idl
index 54e2901..a20103f 100644
--- a/core/html/HTMLFrameElement.idl
+++ b/core/html/HTMLFrameElement.idl
@@ -21,15 +21,15 @@
// https://html.spec.whatwg.org/#htmlframeelement
interface HTMLFrameElement : HTMLElement {
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString scrolling;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString frameBorder;
- [Reflect, URL] attribute DOMString longDesc;
- [Reflect] attribute boolean noResize;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString scrolling;
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect] attribute DOMString frameBorder;
+ [CEReactions, Reflect, URL] attribute DOMString longDesc;
+ [CEReactions, Reflect] attribute boolean noResize;
[CheckSecurity=ReturnValue] readonly attribute Document? contentDocument;
readonly attribute Window? contentWindow;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
};
diff --git a/core/html/HTMLFrameSetElement.idl b/core/html/HTMLFrameSetElement.idl
index 21caf79..aa00c48 100644
--- a/core/html/HTMLFrameSetElement.idl
+++ b/core/html/HTMLFrameSetElement.idl
@@ -22,12 +22,12 @@
// FIXME: HTMLFrameSetElement should not have [OverrideBuiltins].
[
- OverrideBuiltins,
+ OverrideBuiltins
] interface HTMLFrameSetElement : HTMLElement {
- [Reflect] attribute DOMString cols;
- [Reflect] attribute DOMString rows;
+ [CEReactions, Reflect] attribute DOMString cols;
+ [CEReactions, Reflect] attribute DOMString rows;
- // TODO(philipj): These event handler attributes should be inherited from
+ // TODO(foolip): 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;
diff --git a/core/html/HTMLHRElement.idl b/core/html/HTMLHRElement.idl
index 1023126..bed39c7 100644
--- a/core/html/HTMLHRElement.idl
+++ b/core/html/HTMLHRElement.idl
@@ -17,15 +17,14 @@
* 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;
- [Reflect] attribute DOMString size;
- [Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString color;
+ [CEReactions, Reflect] attribute boolean noShade;
+ [CEReactions, Reflect] attribute DOMString size;
+ [CEReactions, Reflect] attribute DOMString width;
};
diff --git a/core/html/HTMLHeadingElement.idl b/core/html/HTMLHeadingElement.idl
index 4ce52c9..db2088e 100644
--- a/core/html/HTMLHeadingElement.idl
+++ b/core/html/HTMLHeadingElement.idl
@@ -22,5 +22,5 @@
interface HTMLHeadingElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLHeadingElement-partial
- [Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLHtmlElement.idl b/core/html/HTMLHtmlElement.idl
index c302e46..43de481 100644
--- a/core/html/HTMLHtmlElement.idl
+++ b/core/html/HTMLHtmlElement.idl
@@ -22,5 +22,5 @@
interface HTMLHtmlElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLHtmlElement-partial
- [Reflect] attribute DOMString version;
+ [CEReactions, Reflect] attribute DOMString version;
};
diff --git a/core/html/HTMLHyperlinkElementUtils.idl b/core/html/HTMLHyperlinkElementUtils.idl
new file mode 100644
index 0000000..ac6f340
--- /dev/null
+++ b/core/html/HTMLHyperlinkElementUtils.idl
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium 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/#htmlhyperlinkelementutils
+
+[
+ NoInterfaceObject // Always used on target of 'implements'
+] interface HTMLHyperlinkElementUtils {
+ [CEReactions] stringifier attribute USVString href;
+ readonly attribute USVString origin;
+
+ [CEReactions] attribute USVString protocol;
+ [CEReactions] attribute USVString username;
+ [CEReactions] attribute USVString password;
+ [CEReactions] attribute USVString host;
+ [CEReactions] attribute USVString hostname;
+ [CEReactions] attribute USVString port;
+ [CEReactions] attribute USVString pathname;
+ [CEReactions] attribute USVString search;
+ [CEReactions] attribute USVString hash;
+};
diff --git a/core/html/HTMLIFrameElement.idl b/core/html/HTMLIFrameElement.idl
index 1c98d81..fd0ef48 100644
--- a/core/html/HTMLIFrameElement.idl
+++ b/core/html/HTMLIFrameElement.idl
@@ -21,27 +21,32 @@
// https://html.spec.whatwg.org/#the-iframe-element
interface HTMLIFrameElement : HTMLElement {
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString srcdoc;
- [Reflect] attribute DOMString name;
- [PutForwards=value] readonly attribute DOMTokenList sandbox;
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect] attribute DOMString srcdoc;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, PutForwards=value] readonly attribute DOMTokenList sandbox;
// Note: The seamless attribute was once supported, but was removed.
- [Reflect] attribute boolean allowFullscreen;
- [Reflect] attribute DOMString width;
- [Reflect] attribute DOMString height;
+ [CEReactions, Reflect] attribute boolean allowFullscreen;
+ [CEReactions, Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString height;
+
[CheckSecurity=ReturnValue] readonly attribute Document? contentDocument;
readonly attribute Window? contentWindow;
[CheckSecurity=ReturnValue, RaisesException] Document? getSVGDocument();
- [RuntimeEnabled=ReferrerPolicyAttribute, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerpolicy;
+ [CEReactions, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerPolicy;
+ // https://w3c.github.io/webappsec-csp/embedded/#dom-htmliframeelement-csp
+ [RuntimeEnabled=EmbedderCSPEnforcement, CEReactions, Reflect] attribute DOMString csp;
-
+ // Feature Policy allow attribute
+ // https://wicg.github.io/feature-policy/
+ [RuntimeEnabled=FeaturePolicy, CEReactions, Reflect] attribute DOMString allow;
// 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;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString scrolling;
+ [CEReactions, Reflect] attribute DOMString frameBorder;
+ [CEReactions, Reflect, URL] attribute DOMString longDesc;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString marginHeight;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString marginWidth;
};
diff --git a/core/html/HTMLImageElement.idl b/core/html/HTMLImageElement.idl
index abec4c2..d0c7448 100644
--- a/core/html/HTMLImageElement.idl
+++ b/core/html/HTMLImageElement.idl
@@ -20,39 +20,42 @@
// https://html.spec.whatwg.org/#the-img-element
-// TODO(philipj): All long types in this interfaces should be unsigned long.
[
- NamedConstructor=Image(optional long width, optional long height),
- ConstructorCallWith=Document
+ ActiveScriptWrappable,
+ ConstructorCallWith=Document,
+ NamedConstructor=Image(optional unsigned long width, optional unsigned long height)
] interface HTMLImageElement : HTMLElement {
- [Reflect] attribute DOMString alt;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString srcset;
- [Reflect] attribute DOMString sizes;
- [Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
- [Reflect] attribute DOMString useMap;
- [Reflect] attribute boolean isMap;
- attribute long width;
- attribute long height;
- readonly attribute long naturalWidth;
- readonly attribute long naturalHeight;
+ [CEReactions, Reflect] attribute DOMString alt;
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect] attribute DOMString srcset;
+ [CEReactions, Reflect] attribute DOMString sizes;
+ [CEReactions, Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
+ [CEReactions, Reflect] attribute DOMString useMap;
+ [CEReactions, Reflect] attribute boolean isMap;
+ [CEReactions] attribute unsigned long width;
+ [CEReactions] attribute unsigned long height;
+ readonly attribute unsigned long naturalWidth;
+ readonly attribute unsigned long naturalHeight;
readonly attribute boolean complete;
readonly attribute DOMString currentSrc;
- [RuntimeEnabled=ReferrerPolicyAttribute, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerpolicy;
+ [CEReactions, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerPolicy;
+ [RuntimeEnabled=ImageAsyncAttribute, CEReactions, Reflect] attribute DOMString async;
// 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;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect, URL] attribute DOMString lowsrc;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute unsigned long hspace;
+ [CEReactions, Reflect] attribute unsigned long vspace;
+ [CEReactions, Reflect, URL] attribute DOMString longDesc;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString border;
// CSSOM View Module
- // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlimageelement-interface
+ // https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlimageelement-interface
[MeasureAs=HTMLImageElementX] readonly attribute long x;
[MeasureAs=HTMLImageElementY] readonly attribute long y;
+
+ [RuntimeEnabled=JSImageDecode, CallWith=ScriptState, RaisesException] Promise decode();
};
diff --git a/core/html/HTMLInputElement.idl b/core/html/HTMLInputElement.idl
deleted file mode 100644
index b82f096..0000000
--- a/core/html/HTMLInputElement.idl
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * Copyright (C) 2012 Samsung Electronics. 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.
- */
-
-// https://html.spec.whatwg.org/#the-input-element
-
-enum SelectionMode { "select", "start", "end", "preserve" };
-
-interface HTMLInputElement : HTMLElement {
- [Reflect] attribute DOMString accept;
- [Reflect] attribute DOMString alt;
- [Reflect] attribute DOMString autocomplete;
- [Reflect] attribute boolean autofocus;
- [Reflect=checked] attribute boolean defaultChecked;
- attribute boolean checked;
- [Reflect] attribute DOMString dirName;
- [Reflect] attribute boolean disabled;
- [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 DOMString formAction;
- [CustomElementCallbacks] attribute DOMString formEnctype;
- [CustomElementCallbacks] attribute DOMString formMethod;
- [Reflect] attribute boolean formNoValidate;
- [Reflect] attribute DOMString formTarget;
- [CustomElementCallbacks] attribute unsigned long height;
- attribute boolean indeterminate;
- [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
- 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;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString step;
- [CustomElementCallbacks] attribute DOMString type;
- [Reflect=value, CustomElementCallbacks] attribute DOMString defaultValue;
- [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);
-
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- 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);
- [RaisesException] void setRangeText(DOMString replacement,
- unsigned long start,
- unsigned long end,
- optional SelectionMode 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);
-
- // 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;
-};
diff --git a/core/html/HTMLKeygenElement.idl b/core/html/HTMLKeygenElement.idl
deleted file mode 100644
index 011687d..0000000
--- a/core/html/HTMLKeygenElement.idl
+++ /dev/null
@@ -1,51 +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:
- *
- * * 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://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;
- [Reflect, ReflectOnly="rsa", ReflectMissing="rsa"] attribute DOMString keytype;
- [Reflect] attribute DOMString name;
-
- readonly attribute DOMString type;
-
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- boolean reportValidity();
- void setCustomValidity(DOMString error);
-
- readonly attribute NodeList labels;
-};
diff --git a/core/html/HTMLLIElement.idl b/core/html/HTMLLIElement.idl
index b80c489..b9ed2de 100644
--- a/core/html/HTMLLIElement.idl
+++ b/core/html/HTMLLIElement.idl
@@ -20,9 +20,9 @@
// https://html.spec.whatwg.org/#the-li-element
interface HTMLLIElement : HTMLElement {
- [Reflect] attribute long value;
+ [CEReactions, Reflect] attribute long value;
// obsolete members
// https://html.spec.whatwg.org/#HTMLLIElement-partial
- [Reflect] attribute DOMString type;
+ [CEReactions, Reflect] attribute DOMString type;
};
diff --git a/core/html/HTMLLabelElement.idl b/core/html/HTMLLabelElement.idl
deleted file mode 100644
index 4db6d18..0000000
--- a/core/html/HTMLLabelElement.idl
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 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.
- */
-
-// https://html.spec.whatwg.org/#the-label-element
-
-interface HTMLLabelElement : HTMLElement {
- [ImplementedAs=formForBinding, MeasureAs=HTMLLabelElementFormIDLAttribute] readonly attribute HTMLFormElement? form;
- [Reflect=for] attribute DOMString htmlFor;
- readonly attribute HTMLElement? control;
-};
diff --git a/core/html/HTMLLegendElement.idl b/core/html/HTMLLegendElement.idl
deleted file mode 100644
index 452bcfe..0000000
--- a/core/html/HTMLLegendElement.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 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.
- */
-
-// https://html.spec.whatwg.org/#the-legend-element
-
-interface HTMLLegendElement : HTMLElement {
- 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 1d19a86..54d1948 100644
--- a/core/html/HTMLLinkElement.idl
+++ b/core/html/HTMLLinkElement.idl
@@ -26,23 +26,24 @@
// 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 rel;
- [RuntimeEnabled=LinkPreload, PutForwards=value] readonly attribute DOMTokenList relList;
- [Reflect] attribute DOMString media;
- [Reflect] attribute DOMString hreflang;
- [Reflect] attribute DOMString type;
- [Reflect, RuntimeEnabled=LinkPreload] attribute DOMString as;
- [PutForwards=value] readonly attribute DOMTokenList sizes;
+ [CEReactions, Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
+ [CEReactions, Reflect] attribute DOMString rel;
+ [CEReactions, PutForwards=value] readonly attribute DOMTokenList relList;
+ [CEReactions, Reflect] attribute DOMString media;
+ [CEReactions, Reflect] attribute DOMString hreflang;
+ [CEReactions, Reflect] attribute DOMString type;
+ [Reflect, ReflectOnly=("script","style","image","video", "audio", "track", "font", "fetch")] attribute DOMString as;
+ [CEReactions, Reflect, ReflectOnly=("","no-referrer","origin","no-referrer-when-downgrade","origin-when-cross-origin","unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString referrerPolicy;
+ [CEReactions, PutForwards=value] readonly attribute DOMTokenList sizes;
// obsolete members
// https://html.spec.whatwg.org/#HTMLLinkElement-partial
- [Reflect] attribute DOMString charset;
- [Reflect] attribute DOMString rev;
- [Reflect] attribute DOMString target;
+ [CEReactions, Reflect] attribute DOMString charset;
+ [CEReactions, Reflect] attribute DOMString rev;
+ [CEReactions, Reflect] attribute DOMString target;
// HTMLLinkElement implements LinkStyle
- // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
+ // https://drafts.csswg.org/cssom/#the-linkstyle-interface
readonly attribute StyleSheet? sheet;
// HTML Imports
@@ -50,6 +51,10 @@
readonly attribute Document? import;
// Subresource Integrity
- // http://w3c.github.io/webappsec/specs/subresourceintegrity/#htmllinkelement-1
+ // https://w3c.github.io/webappsec-subresource-integrity/#HTMLLinkElement
[Reflect] attribute DOMString integrity;
+
+ // Service workers
+ // https://w3c.github.io/ServiceWorker/#link-element-interface-extensions
+ [Reflect, OriginTrialEnabled=LinkServiceWorker] attribute USVString scope;
};
diff --git a/core/html/HTMLMapElement.idl b/core/html/HTMLMapElement.idl
index 21b7b20..5a6e5f1 100644
--- a/core/html/HTMLMapElement.idl
+++ b/core/html/HTMLMapElement.idl
@@ -21,6 +21,6 @@
// https://html.spec.whatwg.org/#the-map-element
interface HTMLMapElement : HTMLElement {
- [Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString name;
readonly attribute HTMLCollection areas;
};
diff --git a/core/html/HTMLMarqueeElement.idl b/core/html/HTMLMarqueeElement.idl
index 4103315..4260c5b 100644
--- a/core/html/HTMLMarqueeElement.idl
+++ b/core/html/HTMLMarqueeElement.idl
@@ -20,18 +20,17 @@
// 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;
- [ImplementedInPrivateScript, Reflect] attribute unsigned long vspace;
- [ImplementedInPrivateScript, Reflect] attribute DOMString width;
+ [Reflect] attribute DOMString behavior;
+ [Reflect] attribute DOMString bgColor;
+ [Reflect] attribute DOMString direction;
+ [Reflect] attribute DOMString height;
+ [Reflect] attribute unsigned long hspace;
+ [RaisesException=Setter] attribute long loop;
+ attribute unsigned long scrollAmount;
+ attribute unsigned long scrollDelay;
+ [Reflect] attribute boolean trueSpeed;
+ [Reflect] attribute unsigned long vspace;
+ [Reflect] attribute DOMString width;
// FIXME: Implement the following event handler attributes
// https://bugs.webkit.org/show_bug.cgi?id=49788
@@ -39,12 +38,6 @@
// 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);
+ void start();
+ void stop();
};
diff --git a/core/html/HTMLMediaElement.idl b/core/html/HTMLMediaElement.idl
index 80899b4..071e8b2 100644
--- a/core/html/HTMLMediaElement.idl
+++ b/core/html/HTMLMediaElement.idl
@@ -27,24 +27,24 @@
enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
[
- DependentLifetime,
- RuntimeEnabled=Media,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface HTMLMediaElement : HTMLElement {
// error state
readonly attribute MediaError? error;
// network state
- [Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect, URL] attribute DOMString src;
// FIXME: attribute MediaProvider? srcObject; crbug.com/387740
readonly attribute DOMString currentSrc;
- [Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
+ [CEReactions, 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;
+ [ImplementedAs=getNetworkState] readonly attribute unsigned short networkState;
+ [CEReactions] attribute DOMString preload;
readonly attribute TimeRanges buffered;
void load();
CanPlayTypeResult canPlayType(DOMString type);
@@ -69,16 +69,18 @@
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
- [Reflect] attribute boolean autoplay;
- [Reflect] attribute boolean loop;
+ [CEReactions, Reflect] attribute boolean autoplay;
+ [CEReactions, Reflect] attribute boolean loop;
[CallWith=ScriptState, ImplementedAs=playForBindings] Promise<void> play();
void pause();
// controls
- [Reflect] attribute boolean controls;
+ [CEReactions, Reflect] attribute boolean controls;
+ // Spec: https://wicg.github.io/controls-list/html-output/multipage/embedded-content.html#attr-media-controlslist
+ [SameObject, PutForwards=value] readonly attribute DOMTokenList controlsList;
[RaisesException=Setter] attribute double volume;
attribute boolean muted;
- [Reflect=muted] attribute boolean defaultMuted;
+ [CEReactions, Reflect=muted] attribute boolean defaultMuted;
// tracks
[SameObject, RuntimeEnabled=AudioVideoTracks] readonly attribute AudioTrackList audioTracks;
diff --git a/core/html/HTMLMenuElement.idl b/core/html/HTMLMenuElement.idl
index 9d54c09..e7913e2 100644
--- a/core/html/HTMLMenuElement.idl
+++ b/core/html/HTMLMenuElement.idl
@@ -20,10 +20,7 @@
// 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;
+ [CEReactions, Reflect] attribute boolean compact;
};
diff --git a/core/html/HTMLMenuItemElement.idl b/core/html/HTMLMenuItemElement.idl
deleted file mode 100644
index 99cd880..0000000
--- a/core/html/HTMLMenuItemElement.idl
+++ /dev/null
@@ -1,18 +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://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: readonly attribute HTMLElement? command;
-};
diff --git a/core/html/HTMLMetaElement.idl b/core/html/HTMLMetaElement.idl
index c575e03..e07c48d 100644
--- a/core/html/HTMLMetaElement.idl
+++ b/core/html/HTMLMetaElement.idl
@@ -20,11 +20,11 @@
// https://html.spec.whatwg.org/#the-meta-element
interface HTMLMetaElement : HTMLElement {
- [Reflect] attribute DOMString name;
- [Reflect=http_equiv] attribute DOMString httpEquiv;
- [Reflect] attribute DOMString content;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect=http_equiv] attribute DOMString httpEquiv;
+ [CEReactions, Reflect] attribute DOMString content;
// obsolete members
// https://html.spec.whatwg.org/#HTMLMetaElement-partial
- [Reflect] attribute DOMString scheme;
+ [CEReactions, Reflect] attribute DOMString scheme;
};
diff --git a/core/html/HTMLMeterElement.idl b/core/html/HTMLMeterElement.idl
index bb457ee..7e1e755 100644
--- a/core/html/HTMLMeterElement.idl
+++ b/core/html/HTMLMeterElement.idl
@@ -20,11 +20,11 @@
// https://html.spec.whatwg.org/#the-meter-element
interface HTMLMeterElement : HTMLElement {
- attribute double value;
- attribute double min;
- attribute double max;
- attribute double low;
- attribute double high;
- attribute double optimum;
+ [CEReactions] attribute double value;
+ [CEReactions] attribute double min;
+ [CEReactions] attribute double max;
+ [CEReactions] attribute double low;
+ [CEReactions] attribute double high;
+ [CEReactions] attribute double optimum;
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLModElement.idl b/core/html/HTMLModElement.idl
index cde233c..5ef7dea 100644
--- a/core/html/HTMLModElement.idl
+++ b/core/html/HTMLModElement.idl
@@ -21,6 +21,6 @@
// https://html.spec.whatwg.org/#the-del-element
interface HTMLModElement : HTMLElement {
- [Reflect, URL] attribute DOMString cite;
- [Reflect] attribute DOMString dateTime;
+ [CEReactions, Reflect, URL] attribute DOMString cite;
+ [CEReactions, Reflect] attribute DOMString dateTime;
};
diff --git a/core/html/HTMLOListElement.idl b/core/html/HTMLOListElement.idl
index 52294de..de98778 100644
--- a/core/html/HTMLOListElement.idl
+++ b/core/html/HTMLOListElement.idl
@@ -20,11 +20,11 @@
// https://html.spec.whatwg.org/#the-ol-element
interface HTMLOListElement : HTMLElement {
- [Reflect] attribute boolean reversed;
- attribute long start;
- [Reflect] attribute DOMString type;
+ [CEReactions, Reflect] attribute boolean reversed;
+ [CEReactions] attribute long start;
+ [CEReactions, Reflect] attribute DOMString type;
// obsolete members
// https://html.spec.whatwg.org/#HTMLOListElement-partial
- [Reflect] attribute boolean compact;
+ [CEReactions, Reflect] attribute boolean compact;
};
diff --git a/core/html/HTMLObjectElement.idl b/core/html/HTMLObjectElement.idl
index d71a2cc..f160057 100644
--- a/core/html/HTMLObjectElement.idl
+++ b/core/html/HTMLObjectElement.idl
@@ -22,21 +22,20 @@
// TODO(yukishiino): HTMLObjectElement should not have [OverrideBuiltins].
[
-// FIXMEDART: TODO(terry): Needed to remove Custom=LegacyCallAsFunction from Embed and Object
-// otherwise an anonymous function is returned.
-// Custom=LegacyCallAsFunction,
OverrideBuiltins,
+ ActiveScriptWrappable
] interface HTMLObjectElement : HTMLElement {
- [Reflect, URL] attribute DOMString data;
- [Reflect] attribute DOMString type;
- // TODO(philipj): attribute boolean typeMustMatch;
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString useMap;
+ [CEReactions, Reflect, URL] attribute DOMString data;
+ [CEReactions, Reflect] attribute DOMString type;
+ // TODO(foolip): attribute boolean typeMustMatch;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString useMap;
[ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
- [Reflect] attribute DOMString width;
- [Reflect] attribute DOMString height;
+ [CEReactions, Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString height;
[CheckSecurity=ReturnValue] readonly attribute Document? contentDocument;
- // TODO(philipj): readonly attribute WindowProxy? contentWindow;
+ // TODO(shanmuga.m): The spec uses the WindowProxy type for this attribute.
+ readonly attribute Window? contentWindow;
[CheckSecurity=ReturnValue, RaisesException] Document? getSVGDocument();
readonly attribute boolean willValidate;
@@ -46,26 +45,21 @@
boolean reportValidity();
void setCustomValidity(DOMString error);
- // 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;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString archive;
+ [CEReactions, Reflect] attribute DOMString code;
+ [CEReactions, Reflect] attribute boolean declare;
+ [CEReactions, Reflect] attribute unsigned long hspace;
+ [CEReactions, Reflect] attribute DOMString standby;
+ [CEReactions, Reflect] attribute unsigned long vspace;
+ [CEReactions, Reflect, URL] attribute DOMString codeBase;
+ [CEReactions, Reflect] attribute DOMString codeType;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
+ [CEReactions, 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);
+ // TODO(foolip): These getters and setters are not in the spec.
[Custom, NotEnumerable] getter Node (DOMString name);
[Custom] setter Node (DOMString name, Node value);
};
diff --git a/core/html/HTMLOptGroupElement.idl b/core/html/HTMLOptGroupElement.idl
deleted file mode 100644
index 8820449..0000000
--- a/core/html/HTMLOptGroupElement.idl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 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.
- */
-
-// 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
deleted file mode 100644
index 92a2323..0000000
--- a/core/html/HTMLOptionElement.idl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2010 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.
- */
-
-// https://html.spec.whatwg.org/#the-option-element
-
-[
- NamedConstructor=Option(optional DOMString data = null,
- optional DOMString value = null,
- optional boolean defaultSelected = false,
- optional boolean selected = false),
- ConstructorCallWith=Document,
- RaisesException=Constructor
-] interface HTMLOptionElement : HTMLElement {
- [Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement? form;
- attribute DOMString label;
- [Reflect=selected] attribute boolean defaultSelected;
- [ImplementedAs=selectedForBinding] 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
deleted file mode 100644
index 6907ffb..0000000
--- a/core/html/HTMLOptionsCollection.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * Copyright (C) 2013, 2014 Samsung Electronics. 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.
- */
-
-// https://html.spec.whatwg.org/#the-htmloptionscollection-interface
-
-[
- DependentLifetime,
- SetWrapperReferenceFrom=ownerNode,
-] interface HTMLOptionsCollection : HTMLCollection {
- // inherits item()
- [RaisesException=Setter] attribute unsigned long length; // shadows inherited length
- // FIXME: The spec has a legacycaller HTMLOptionElement? (DOMString name);
- [RaisesException] setter void (unsigned long index, HTMLOptionElement? option);
- [RaisesException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
- void remove(long index);
- attribute long selectedIndex;
- // 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);
- [ImplementedAs=namedGetter] getter (NodeList or Element)? namedItem(DOMString name);
-};
diff --git a/core/html/HTMLOutputElement.idl b/core/html/HTMLOutputElement.idl
deleted file mode 100644
index 8efb9a0..0000000
--- a/core/html/HTMLOutputElement.idl
+++ /dev/null
@@ -1,44 +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 INC. 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 INC. 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.
- */
-
-// https://html.spec.whatwg.org/#the-output-element
-
-interface HTMLOutputElement : HTMLElement {
- [PutForwards=value] readonly attribute DOMTokenList htmlFor;
- [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
- [Reflect] attribute DOMString name;
-
- readonly attribute DOMString type;
- attribute DOMString defaultValue;
- attribute DOMString value;
-
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- boolean reportValidity();
- void setCustomValidity(DOMString error);
-
- readonly attribute NodeList labels;
-};
diff --git a/core/html/HTMLParagraphElement.idl b/core/html/HTMLParagraphElement.idl
index 840231e..48ca805 100644
--- a/core/html/HTMLParagraphElement.idl
+++ b/core/html/HTMLParagraphElement.idl
@@ -18,9 +18,9 @@
*/
// https://html.spec.whatwg.org/#the-p-element
-
+[HTMLConstructor]
interface HTMLParagraphElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLParagraphElement-partial
- [Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLParamElement.idl b/core/html/HTMLParamElement.idl
index cd4cb67..a711d71 100644
--- a/core/html/HTMLParamElement.idl
+++ b/core/html/HTMLParamElement.idl
@@ -20,11 +20,11 @@
// https://html.spec.whatwg.org/#the-param-element
interface HTMLParamElement : HTMLElement {
- [Reflect] attribute DOMString name;
- [Reflect] attribute DOMString value;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString value;
// obsolete members
// https://html.spec.whatwg.org/#HTMLParamElement-partial
- [Reflect] attribute DOMString type;
- [Reflect] attribute DOMString valueType;
+ [CEReactions, Reflect] attribute DOMString type;
+ [CEReactions, Reflect] attribute DOMString valueType;
};
diff --git a/core/html/HTMLPreElement.idl b/core/html/HTMLPreElement.idl
index 2da036d..2141a2b 100644
--- a/core/html/HTMLPreElement.idl
+++ b/core/html/HTMLPreElement.idl
@@ -23,5 +23,5 @@
interface HTMLPreElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLPreElement-partial
- [Reflect] attribute long width;
+ [CEReactions, Reflect] attribute long width;
};
diff --git a/core/html/HTMLProgressElement.idl b/core/html/HTMLProgressElement.idl
index ffe0d51..85da4e1 100644
--- a/core/html/HTMLProgressElement.idl
+++ b/core/html/HTMLProgressElement.idl
@@ -20,8 +20,8 @@
// https://html.spec.whatwg.org/#the-progress-element
interface HTMLProgressElement : HTMLElement {
- attribute double value;
- attribute double max;
+ [CEReactions] attribute double value;
+ [CEReactions] attribute double max;
readonly attribute double position;
readonly attribute NodeList labels;
};
diff --git a/core/html/HTMLQuoteElement.idl b/core/html/HTMLQuoteElement.idl
index d559397..5e5d7bf 100644
--- a/core/html/HTMLQuoteElement.idl
+++ b/core/html/HTMLQuoteElement.idl
@@ -21,5 +21,5 @@
// https://html.spec.whatwg.org/#the-q-element
interface HTMLQuoteElement : HTMLElement {
- [Reflect, URL] attribute DOMString cite;
+ [CEReactions, Reflect, URL] attribute DOMString cite;
};
diff --git a/core/html/HTMLScriptElement.idl b/core/html/HTMLScriptElement.idl
index 064e63a..89f8ddb 100644
--- a/core/html/HTMLScriptElement.idl
+++ b/core/html/HTMLScriptElement.idl
@@ -20,26 +20,23 @@
// https://html.spec.whatwg.org/#the-script-element
interface HTMLScriptElement : HTMLElement {
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString type;
- [Reflect] attribute DOMString charset;
- attribute boolean async;
- [Reflect] attribute boolean defer;
- [Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
- attribute DOMString text;
+ [CEReactions, Reflect, URL, RaisesException=Setter] attribute ScriptURLString src;
+ [CEReactions, Reflect] attribute DOMString type;
+ [CEReactions, Reflect, RuntimeEnabled=ModuleScripts] attribute boolean noModule;
+ [CEReactions, Reflect] attribute DOMString charset;
+ [CEReactions] attribute boolean async;
+ [CEReactions, Reflect] attribute boolean defer;
+ [CEReactions, Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
+ [CEReactions] attribute DOMString text;
// obsolete members
// https://html.spec.whatwg.org/#HTMLScriptElement-partial
- // TODO(philipj): The event and htmlFor attributes should return the empty
+ // TODO(foolip): 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;
+ [CEReactions, Reflect] attribute DOMString event;
+ [CEReactions, Reflect=for] attribute DOMString htmlFor;
// Subresource Integrity
- // https://w3c.github.io/webappsec/specs/subresourceintegrity/#htmlscriptelement-1
+ // https://w3c.github.io/webappsec-subresource-integrity/#HTMLScriptElement
[Reflect] attribute DOMString integrity;
};
diff --git a/core/html/HTMLSelectElement.idl b/core/html/HTMLSelectElement.idl
deleted file mode 100644
index f631cc2..0000000
--- a/core/html/HTMLSelectElement.idl
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * Copyright (C) 2013 Samsung Electronics. 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.
- */
-
-// 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;
- attribute boolean multiple;
- [Reflect] attribute DOMString name;
- [Reflect] attribute boolean required;
- 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);
- HTMLOptionElement? namedItem(DOMString name);
- [RaisesException] void add((HTMLOptionElement or HTMLOptGroupElement) element,
- optional (HTMLElement or long)? before = null);
- [RaisesException] void remove(); // ChildNode overload
- void remove(long index);
- [RaisesException] setter void (unsigned long index, HTMLOptionElement? option);
-
- readonly attribute HTMLCollection selectedOptions;
- attribute long selectedIndex;
- attribute DOMString value;
-
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- boolean reportValidity();
- void setCustomValidity(DOMString error);
-
- readonly attribute NodeList labels;
-};
diff --git a/core/html/HTMLSlotElement.idl b/core/html/HTMLSlotElement.idl
index 3dc032a..ad93831 100644
--- a/core/html/HTMLSlotElement.idl
+++ b/core/html/HTMLSlotElement.idl
@@ -24,11 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/webcomponents/spec/shadow/#the-slot-element
+// https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element
-[
- RuntimeEnabled=ShadowDOMV1,
-] interface HTMLSlotElement : HTMLElement {
- [Reflect] attribute DOMString name;
- [ImplementedAs=getAssignedNodesForBinding] sequence<Node> getAssignedNodes(optional AssignedNodesOptions options);
+interface HTMLSlotElement : HTMLElement {
+ [CEReactions, Reflect] attribute DOMString name;
+ [ImplementedAs=assignedNodesForBinding] sequence<Node> assignedNodes(optional AssignedNodesOptions options);
};
diff --git a/core/html/HTMLSourceElement.idl b/core/html/HTMLSourceElement.idl
index 50efebd..5a7882a 100644
--- a/core/html/HTMLSourceElement.idl
+++ b/core/html/HTMLSourceElement.idl
@@ -25,14 +25,12 @@
// https://html.spec.whatwg.org/#the-source-element
-[
- RuntimeEnabled=Media
-] interface HTMLSourceElement : HTMLElement {
- [Reflect, URL] attribute DOMString src;
- attribute DOMString type;
+interface HTMLSourceElement : HTMLElement {
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions] attribute DOMString type;
// 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;
+ [CEReactions, Reflect] attribute DOMString srcset;
+ [CEReactions, Reflect] attribute DOMString sizes;
+ [CEReactions, Reflect] attribute DOMString media;
};
diff --git a/core/html/HTMLStyleElement.idl b/core/html/HTMLStyleElement.idl
index 8c035ff..befeb9a 100644
--- a/core/html/HTMLStyleElement.idl
+++ b/core/html/HTMLStyleElement.idl
@@ -21,13 +21,13 @@
// https://html.spec.whatwg.org/#the-style-element
interface HTMLStyleElement : HTMLElement {
- // TODO(philipj): The disabled attribute has been removed from the spec:
+ // TODO(foolip): 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;
+ [CEReactions, Reflect] attribute DOMString media;
+ [CEReactions, Reflect] attribute DOMString type;
// HTMLStyleElement implements LinkStyle
- // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
+ // https://drafts.csswg.org/cssom/#the-linkstyle-interface
readonly attribute StyleSheet? sheet;
};
diff --git a/core/html/HTMLTableCaptionElement.idl b/core/html/HTMLTableCaptionElement.idl
index 9f9b728..b9307a8 100644
--- a/core/html/HTMLTableCaptionElement.idl
+++ b/core/html/HTMLTableCaptionElement.idl
@@ -23,5 +23,5 @@
interface HTMLTableCaptionElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLTableCaptionElement-partial
- [Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString align;
};
diff --git a/core/html/HTMLTableCellElement.idl b/core/html/HTMLTableCellElement.idl
index 933fedb..6974c3a 100644
--- a/core/html/HTMLTableCellElement.idl
+++ b/core/html/HTMLTableCellElement.idl
@@ -21,31 +21,31 @@
// 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
+ [CEReactions] attribute unsigned long colSpan;
+ [CEReactions] attribute unsigned long rowSpan;
+ // TODO(foolip): headers should be a [PutForwards=value] readonly attribute
// DOMTokenList.
- [Reflect, TreatNullAs=NullString] attribute DOMString headers;
+ [CEReactions, Reflect, TreatNullAs=NullString] attribute DOMString headers;
readonly attribute long cellIndex;
// obsolete members
// https://html.spec.whatwg.org/#HTMLTableCellElement-partial
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString axis;
- [Reflect] attribute DOMString height;
- [Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString axis;
+ [CEReactions, Reflect] attribute DOMString height;
+ [CEReactions, Reflect] attribute DOMString width;
- [Reflect=char] attribute DOMString ch;
- [Reflect=charoff] attribute DOMString chOff;
- [Reflect] attribute boolean noWrap;
- [Reflect] attribute DOMString vAlign;
+ [CEReactions, Reflect=char] attribute DOMString ch;
+ [CEReactions, Reflect=charoff] attribute DOMString chOff;
+ [CEReactions, Reflect] attribute boolean noWrap;
+ [CEReactions, Reflect] attribute DOMString vAlign;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
- // TODO(philipj): The spec has HTMLTableHeaderCellElement and
+ // TODO(foolip): 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;
+ [CEReactions, Reflect] attribute DOMString abbr;
+ [CEReactions, Reflect, ReflectOnly=("row", "col", "rowgroup", "colgroup")] attribute DOMString scope;
};
diff --git a/core/html/HTMLTableColElement.idl b/core/html/HTMLTableColElement.idl
index 8ad6945..2d3dbad 100644
--- a/core/html/HTMLTableColElement.idl
+++ b/core/html/HTMLTableColElement.idl
@@ -22,13 +22,13 @@
// https://html.spec.whatwg.org/#the-col-element
interface HTMLTableColElement : HTMLElement {
- attribute unsigned long span;
+ [CEReactions] 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;
- [Reflect] attribute DOMString vAlign;
- [Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect=char] attribute DOMString ch;
+ [CEReactions, Reflect=charoff] attribute DOMString chOff;
+ [CEReactions, Reflect] attribute DOMString vAlign;
+ [CEReactions, Reflect] attribute DOMString width;
};
diff --git a/core/html/HTMLTableElement.idl b/core/html/HTMLTableElement.idl
index b36de85..b785a69 100644
--- a/core/html/HTMLTableElement.idl
+++ b/core/html/HTMLTableElement.idl
@@ -21,34 +21,34 @@
// https://html.spec.whatwg.org/#the-table-element
interface HTMLTableElement : HTMLElement {
- // TODO(philipj): The caption, tHead and tFoot setters should never throw.
- [RaisesException=Setter] attribute HTMLTableCaptionElement? caption;
- HTMLTableCaptionElement createCaption();
- void deleteCaption();
- [RaisesException=Setter] attribute HTMLTableSectionElement? tHead;
- HTMLTableSectionElement createTHead();
- void deleteTHead();
- [RaisesException=Setter] attribute HTMLTableSectionElement? tFoot;
- HTMLTableSectionElement createTFoot();
- void deleteTFoot();
+ // TODO(foolip): The caption, tHead and tFoot setters should never throw.
+ [CEReactions, RaisesException=Setter] attribute HTMLTableCaptionElement? caption;
+ [CEReactions] HTMLTableCaptionElement createCaption();
+ [CEReactions] void deleteCaption();
+ [CEReactions, RaisesException=Setter] attribute HTMLTableSectionElement? tHead;
+ [CEReactions] HTMLTableSectionElement createTHead();
+ [CEReactions] void deleteTHead();
+ [CEReactions, RaisesException=Setter] attribute HTMLTableSectionElement? tFoot;
+ [CEReactions] HTMLTableSectionElement createTFoot();
+ [CEReactions] void deleteTFoot();
readonly attribute HTMLCollection tBodies;
- HTMLTableSectionElement createTBody();
+ [CEReactions] HTMLTableSectionElement createTBody();
readonly attribute HTMLCollection rows;
- [RaisesException] HTMLTableRowElement insertRow(optional long index = -1);
- [RaisesException] void deleteRow(long index);
+ [CEReactions, RaisesException] HTMLTableRowElement insertRow(optional long index = -1);
+ [CEReactions, RaisesException] void deleteRow(long index);
// attribute boolean sortable;
// void stopSorting();
// obsolete members
// https://html.spec.whatwg.org/#HTMLTableElement-partial
- [Reflect] attribute DOMString align;
- [Reflect] attribute DOMString border;
- [Reflect] attribute DOMString frame;
- [Reflect] attribute DOMString rules;
- [Reflect] attribute DOMString summary;
- [Reflect] attribute DOMString width;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString border;
+ [CEReactions, Reflect] attribute DOMString frame;
+ [CEReactions, Reflect] attribute DOMString rules;
+ [CEReactions, Reflect] attribute DOMString summary;
+ [CEReactions, Reflect] attribute DOMString width;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString cellPadding;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString cellSpacing;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString cellPadding;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString cellSpacing;
};
diff --git a/core/html/HTMLTableRowElement.idl b/core/html/HTMLTableRowElement.idl
index bba0de5..5b5707d 100644
--- a/core/html/HTMLTableRowElement.idl
+++ b/core/html/HTMLTableRowElement.idl
@@ -24,15 +24,15 @@
readonly attribute long rowIndex;
readonly attribute long sectionRowIndex;
readonly attribute HTMLCollection cells;
- [RaisesException] HTMLElement insertCell(optional long index = -1);
- [RaisesException] void deleteCell(long index);
+ [CEReactions, RaisesException] HTMLElement insertCell(optional long index = -1);
+ [CEReactions, RaisesException] void deleteCell(long index);
// obsolete members
// https://html.spec.whatwg.org/#HTMLTableRowElement-partial
- [Reflect] attribute DOMString align;
- [Reflect=char] attribute DOMString ch;
- [Reflect=charoff] attribute DOMString chOff;
- [Reflect] attribute DOMString vAlign;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect=char] attribute DOMString ch;
+ [CEReactions, Reflect=charoff] attribute DOMString chOff;
+ [CEReactions, Reflect] attribute DOMString vAlign;
- [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
};
diff --git a/core/html/HTMLTableSectionElement.idl b/core/html/HTMLTableSectionElement.idl
index f0f19cf..36c47bf 100644
--- a/core/html/HTMLTableSectionElement.idl
+++ b/core/html/HTMLTableSectionElement.idl
@@ -24,13 +24,13 @@
interface HTMLTableSectionElement : HTMLElement {
readonly attribute HTMLCollection rows;
- [RaisesException] HTMLElement insertRow(optional long index = -1);
- [RaisesException] void deleteRow(long index);
+ [CEReactions, RaisesException] HTMLElement insertRow(optional long index = -1);
+ [CEReactions, 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;
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect=char] attribute DOMString ch;
+ [CEReactions, Reflect=charoff] attribute DOMString chOff;
+ [CEReactions, Reflect] attribute DOMString vAlign;
};
diff --git a/core/html/HTMLTextAreaElement.idl b/core/html/HTMLTextAreaElement.idl
deleted file mode 100644
index ea7ca76..0000000
--- a/core/html/HTMLTextAreaElement.idl
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- * Copyright (C) 2011 Motorola Mobility, 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.
- */
-
-// https://html.spec.whatwg.org/#the-textarea-element
-
-interface HTMLTextAreaElement : HTMLElement {
- // attribute DOMString autocomplete;
- [Reflect] attribute boolean autofocus;
- attribute unsigned long cols;
- [Reflect] attribute DOMString dirName;
- [Reflect] attribute boolean disabled;
- [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 unsigned long rows;
- [Reflect] attribute DOMString wrap;
-
- readonly attribute DOMString type;
- attribute DOMString defaultValue;
- [TreatNullAs=NullString] attribute DOMString value;
- readonly attribute unsigned long textLength;
-
- readonly attribute boolean willValidate;
- readonly attribute ValidityState validity;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- 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);
- [RaisesException] void setRangeText(DOMString replacement,
- unsigned long start,
- unsigned long end,
- optional SelectionMode selectionMode = "preserve");
- // 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/HTMLTimeElement.idl b/core/html/HTMLTimeElement.idl
new file mode 100644
index 0000000..48677ff
--- /dev/null
+++ b/core/html/HTMLTimeElement.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/text-level-semantics.html#the-time-element
+
+[HTMLConstructor]
+interface HTMLTimeElement : HTMLElement {
+ [CEReactions, Reflect] attribute DOMString dateTime;
+};
\ No newline at end of file
diff --git a/core/html/HTMLTitleElement.idl b/core/html/HTMLTitleElement.idl
index f775f8c..4f06106 100644
--- a/core/html/HTMLTitleElement.idl
+++ b/core/html/HTMLTitleElement.idl
@@ -20,5 +20,5 @@
// https://html.spec.whatwg.org/#the-title-element
interface HTMLTitleElement : HTMLElement {
- attribute DOMString text;
+ [CEReactions] attribute DOMString text;
};
diff --git a/core/html/HTMLTrackElement.idl b/core/html/HTMLTrackElement.idl
index 08b3f14..b3334c2 100644
--- a/core/html/HTMLTrackElement.idl
+++ b/core/html/HTMLTrackElement.idl
@@ -26,17 +26,16 @@
// https://html.spec.whatwg.org/#the-track-element
interface HTMLTrackElement : HTMLElement {
- attribute DOMString kind;
- [Reflect, URL] attribute DOMString src;
- [Reflect] attribute DOMString srclang;
- [Reflect] attribute DOMString label;
- [Reflect] attribute boolean default;
+ [CEReactions] attribute DOMString kind;
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect] attribute DOMString srclang;
+ [CEReactions, Reflect] attribute DOMString label;
+ [CEReactions, Reflect] attribute boolean default;
const unsigned short NONE = 0;
const unsigned short LOADING = 1;
const unsigned short LOADED = 2;
- // Reflect is used for ERROR because it conflicts with a windows define.
- [Reflect=TRACK_ERROR] const unsigned short ERROR = 3;
+ const unsigned short ERROR = 3;
[ImplementedAs=getReadyState] readonly attribute unsigned short readyState;
readonly attribute TextTrack track;
diff --git a/core/html/HTMLUListElement.idl b/core/html/HTMLUListElement.idl
index 43c6f43..907fd7a 100644
--- a/core/html/HTMLUListElement.idl
+++ b/core/html/HTMLUListElement.idl
@@ -22,6 +22,6 @@
interface HTMLUListElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLUListElement-partial
- [Reflect] attribute boolean compact;
- [Reflect] attribute DOMString type;
+ [CEReactions, Reflect] attribute boolean compact;
+ [CEReactions, Reflect] attribute DOMString type;
};
diff --git a/core/html/HTMLVideoElement.idl b/core/html/HTMLVideoElement.idl
index 3f2d0cc..2e9974d 100644
--- a/core/html/HTMLVideoElement.idl
+++ b/core/html/HTMLVideoElement.idl
@@ -26,13 +26,13 @@
// https://html.spec.whatwg.org/#the-video-element
[
- RuntimeEnabled=Media
+ ActiveScriptWrappable
] interface HTMLVideoElement : HTMLMediaElement {
- [Reflect] attribute unsigned long width;
- [Reflect] attribute unsigned long height;
+ [CEReactions, Reflect] attribute unsigned long width;
+ [CEReactions, Reflect] attribute unsigned long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
- [Reflect, URL] attribute DOMString poster;
+ [CEReactions, Reflect, URL, Measure] attribute DOMString poster;
// Non-standard APIs
[RuntimeEnabled=PrefixedVideoFullscreen, DeprecateAs=PrefixedVideoSupportsFullscreen] readonly attribute boolean webkitSupportsFullscreen;
diff --git a/core/html/ImageData.idl b/core/html/ImageData.idl
index 152a63d..52153cc 100644
--- a/core/html/ImageData.idl
+++ b/core/html/ImageData.idl
@@ -27,17 +27,20 @@
*/
// https://html.spec.whatwg.org/#dom-imagedata
+// https://github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md#imagedata
+
+typedef (Uint8ClampedArray or Uint16Array or Float32Array) ImageDataArray;
[
Constructor(unsigned long sw, unsigned long sh),
Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
Exposed=(Window,Worker),
- RaisesException=Constructor,
- GarbageCollected,
+ RaisesException=Constructor
] interface ImageData {
+ [RuntimeEnabled=ExperimentalCanvasFeatures] ImageDataColorSettings getColorSettings();
+
readonly attribute unsigned long width;
readonly attribute unsigned long height;
- // TODO(philipj): Expose data.
- // FIXMEDART: Uncomment - we need this property.
readonly attribute Uint8ClampedArray data;
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute ImageDataArray dataUnion;
};
diff --git a/core/html/ImageDataColorSettings.idl b/core/html/ImageDataColorSettings.idl
new file mode 100644
index 0000000..828808c
--- /dev/null
+++ b/core/html/ImageDataColorSettings.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md#imageda
+
+enum ImageDataStorageFormat {
+ "uint8", // default
+ "uint16",
+ "float32",
+};
+
+dictionary ImageDataColorSettings {
+ CanvasColorSpace colorSpace = "srgb";
+ ImageDataStorageFormat storageFormat = "uint8";
+};
diff --git a/core/html/MediaError.idl b/core/html/MediaError.idl
deleted file mode 100644
index 712251d..0000000
--- a/core/html/MediaError.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 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.
- */
-
-// https://html.spec.whatwg.org/#error-codes
-
-[
- GarbageCollected,
- RuntimeEnabled=Media,
-] interface MediaError {
- const unsigned short MEDIA_ERR_ABORTED = 1;
- const unsigned short MEDIA_ERR_NETWORK = 2;
- const unsigned short MEDIA_ERR_DECODE = 3;
- const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
- readonly attribute unsigned short code;
-};
diff --git a/core/html/RadioNodeList.idl b/core/html/RadioNodeList.idl
deleted file mode 100644
index d1be414..0000000
--- a/core/html/RadioNodeList.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2012 Motorola Mobility, 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 MOTOROLA MOBILITY, INC. 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 MOTOROLA MOBILITY, INC. 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.
- */
-
-// https://html.spec.whatwg.org/#radionodelist
-
-interface RadioNodeList : NodeList {
- attribute DOMString value;
-
- // 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 e5d8fdb..68b0ee4 100644
--- a/core/html/TextMetrics.idl
+++ b/core/html/TextMetrics.idl
@@ -25,11 +25,9 @@
// https://html.spec.whatwg.org/#textmetrics
-// TODO(philipj): All float types in this interface should be double.
-[
- // TODO(philipj): Exposed=(Window,Worker)
- GarbageCollected,
-] interface TextMetrics {
+// TODO(foolip): All float types in this interface should be double.
+// TODO(foolip): Exposed=(Window,Worker)
+interface TextMetrics {
// x-direction
readonly attribute float width; // advance width
[RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute float actualBoundingBoxLeft;
diff --git a/core/html/TimeRanges.idl b/core/html/TimeRanges.idl
index 281861e..a7387ff 100644
--- a/core/html/TimeRanges.idl
+++ b/core/html/TimeRanges.idl
@@ -25,10 +25,7 @@
// https://html.spec.whatwg.org/#time-ranges
-[
- GarbageCollected,
- RuntimeEnabled=Media
-] interface TimeRanges {
+interface TimeRanges {
readonly attribute unsigned long length;
[RaisesException] double start(unsigned long index);
[RaisesException] double end(unsigned long index);
diff --git a/core/html/ValidityState.idl b/core/html/ValidityState.idl
deleted file mode 100644
index 5883d83..0000000
--- a/core/html/ValidityState.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of the WebKit project.
- *
- * Copyright (C) 2009 Michelangelo De Simone <micdesim@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.
- *
- */
-
-// 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 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 daf58ab..3b43682 100644
--- a/core/html/VoidCallback.idl
+++ b/core/html/VoidCallback.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// TODO(philipj): This callback interface was added for HTMLMediaElement's
+// TODO(foolip): 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.
diff --git a/core/html/canvas/CanvasContextCreationAttributes.idl b/core/html/canvas/CanvasContextCreationAttributes.idl
index 3d5a8f2..752714c 100644
--- a/core/html/canvas/CanvasContextCreationAttributes.idl
+++ b/core/html/canvas/CanvasContextCreationAttributes.idl
@@ -21,10 +21,28 @@
//
// N.B.: Web IDL doesn't support multiple inheritance of dictionaries.
+enum CanvasColorSpace {
+ "srgb", // default
+ "rec2020",
+ "p3",
+};
+
+enum CanvasPixelFormat {
+ "8-8-8-8", // default
+ "10-10-10-2",
+ "12-12-12-12",
+ "float16",
+};
+
[PermissiveDictionaryConversion]
dictionary CanvasContextCreationAttributes {
// Canvas 2D attributes
boolean alpha = true; // Also used for WebGL.
+ // TODO(crbug.com/637288): Do we keep "legacy-srgb" as the default?
+ // Must decide before shipping.
+ [RuntimeEnabled=ExperimentalCanvasFeatures] CanvasColorSpace colorSpace = "legacy-srgb";
+ [RuntimeEnabled=ExperimentalCanvasFeatures] CanvasPixelFormat pixelFormat = "8-8-8-8";
+ [RuntimeEnabled=ExperimentalCanvasFeatures] boolean linearPixelMath = false;
// WebGL attributes
boolean depth = true;
diff --git a/core/html/canvas/OffscreenCanvas.idl b/core/html/canvas/OffscreenCanvas.idl
deleted file mode 100644
index be5bf91..0000000
--- a/core/html/canvas/OffscreenCanvas.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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([EnforceRange] unsigned long width, [EnforceRange] unsigned long height),
- GarbageCollected,
- Exposed=(Window,Worker),
- RuntimeEnabled=ExperimentalCanvasFeatures,
-] interface OffscreenCanvas {
- [EnforceRange] attribute unsigned long width;
- [EnforceRange] attribute unsigned long height;
-};
diff --git a/core/html/custom/CustomElementRegistry.idl b/core/html/custom/CustomElementRegistry.idl
new file mode 100644
index 0000000..01ad2a1
--- /dev/null
+++ b/core/html/custom/CustomElementRegistry.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+interface CustomElementRegistry {
+ [CallWith=ScriptState, CEReactions, CustomElementCallbacks, RaisesException, MeasureAs=CustomElementRegistryDefine] void define(DOMString name, Function constructor, optional ElementDefinitionOptions options);
+ any get(DOMString name);
+ [CallWith=ScriptState,RaisesException] Promise<void> whenDefined(DOMString name);
+};
diff --git a/core/html/forms/FormData.idl b/core/html/forms/FormData.idl
new file mode 100644
index 0000000..2fcaf4b
--- /dev/null
+++ b/core/html/forms/FormData.idl
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+// https://xhr.spec.whatwg.org/#interface-formdata
+
+typedef (File or USVString) FormDataEntryValue;
+
+// TODO(foolip): Remove LegacyInterfaceTypeChecking, which allows for
+// `append('name', null, 'filename')` and `set('name', null, 'filename')` to
+// append/set null values instead of throwing. https://crbug.com/561338
+[
+ Constructor(optional HTMLFormElement form),
+ Exposed=(Window,Worker),
+ LegacyInterfaceTypeChecking
+] interface FormData {
+ void append(USVString name, USVString value);
+ [CallWith=ScriptState] void append(USVString name, Blob value, optional USVString filename);
+ [ImplementedAs=deleteEntry] void delete(USVString name);
+ FormDataEntryValue? get(USVString name);
+ sequence<FormDataEntryValue> getAll(USVString name);
+ boolean has(USVString name);
+ void set(USVString name, USVString value);
+ void set(USVString name, Blob value, optional USVString filename);
+ iterable<USVString, FormDataEntryValue>;
+};
diff --git a/core/html/forms/HTMLButtonElement.idl b/core/html/forms/HTMLButtonElement.idl
new file mode 100644
index 0000000..b357e68
--- /dev/null
+++ b/core/html/forms/HTMLButtonElement.idl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2006, 2010 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.
+ */
+
+// https://html.spec.whatwg.org/#the-button-element
+
+interface HTMLButtonElement : HTMLElement {
+ [CEReactions, Reflect] attribute boolean autofocus;
+ [CEReactions, Reflect] attribute boolean disabled;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
+ [CEReactions] attribute DOMString formAction;
+ [CEReactions] attribute DOMString formEnctype;
+ [CEReactions] attribute DOMString formMethod;
+ [CEReactions, Reflect] attribute boolean formNoValidate;
+ [CEReactions, Reflect] attribute DOMString formTarget;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions] attribute DOMString type;
+ [CEReactions, Reflect] attribute DOMString value;
+ // FIXME: attribute HTMLMenuElement? menu;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
diff --git a/core/html/HTMLDataListElement.idl b/core/html/forms/HTMLDataListElement.idl
similarity index 100%
rename from core/html/HTMLDataListElement.idl
rename to core/html/forms/HTMLDataListElement.idl
diff --git a/core/html/forms/HTMLFieldSetElement.idl b/core/html/forms/HTMLFieldSetElement.idl
new file mode 100644
index 0000000..dcf557f
--- /dev/null
+++ b/core/html/forms/HTMLFieldSetElement.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * 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.
+ */
+
+// https://html.spec.whatwg.org/#the-fieldset-element
+
+interface HTMLFieldSetElement : HTMLElement {
+ [CEReactions, Reflect] attribute boolean disabled;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
+ [CEReactions, Reflect] attribute DOMString name;
+
+ readonly attribute DOMString type;
+
+ [Measure] readonly attribute HTMLCollection elements;
+
+ 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/forms/HTMLFormControlsCollection.idl b/core/html/forms/HTMLFormControlsCollection.idl
new file mode 100644
index 0000000..2cd0ea2
--- /dev/null
+++ b/core/html/forms/HTMLFormControlsCollection.idl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2014 Samsung Electronics. 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.
+ */
+
+// https://html.spec.whatwg.org/#the-htmlformcontrolscollection-interface
+
+[
+ DependentLifetime
+] interface HTMLFormControlsCollection : HTMLCollection {
+ // inherits length and item()
+ [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);
+};
diff --git a/core/html/forms/HTMLFormElement.idl b/core/html/forms/HTMLFormElement.idl
new file mode 100644
index 0000000..342d19b
--- /dev/null
+++ b/core/html/forms/HTMLFormElement.idl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006, 2010 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.
+ */
+
+// https://html.spec.whatwg.org/#the-form-element
+
+[
+ OverrideBuiltins
+] interface HTMLFormElement : HTMLElement {
+ [CEReactions, Reflect=accept_charset] attribute DOMString acceptCharset;
+ [CEReactions, Reflect, URL] attribute DOMString action;
+ [CEReactions, Reflect, ReflectOnly=("on","off"), ReflectMissing="on", ReflectInvalid="on"] attribute DOMString autocomplete;
+ [CEReactions, CustomElementCallbacks] attribute DOMString enctype;
+ [CEReactions, CustomElementCallbacks] attribute DOMString encoding;
+ [CEReactions, CustomElementCallbacks] attribute DOMString method;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute boolean noValidate;
+ [CEReactions, Reflect] attribute DOMString target;
+
+ 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();
+ [CEReactions, CustomElementCallbacks] void reset();
+ boolean checkValidity();
+ boolean reportValidity();
+};
diff --git a/core/html/forms/HTMLInputElement.idl b/core/html/forms/HTMLInputElement.idl
new file mode 100644
index 0000000..12495b0
--- /dev/null
+++ b/core/html/forms/HTMLInputElement.idl
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2012 Samsung Electronics. 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.
+ */
+
+// https://html.spec.whatwg.org/#the-input-element
+
+enum SelectionMode { "select", "start", "end", "preserve" };
+
+[
+ ActiveScriptWrappable
+] interface HTMLInputElement : HTMLElement {
+ [CEReactions, Reflect] attribute DOMString accept;
+ [CEReactions, Reflect] attribute DOMString alt;
+ [CEReactions, Reflect] attribute DOMString autocomplete;
+ [CEReactions, Reflect] attribute boolean autofocus;
+ [CEReactions, Reflect=checked] attribute boolean defaultChecked;
+ attribute boolean checked;
+ [CEReactions, Reflect] attribute DOMString dirName;
+ [CEReactions, Reflect] attribute boolean disabled;
+ [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;
+ [CEReactions] attribute DOMString formAction;
+ [CEReactions, CustomElementCallbacks] attribute DOMString formEnctype;
+ [CEReactions, CustomElementCallbacks] attribute DOMString formMethod;
+ [CEReactions, Reflect] attribute boolean formNoValidate;
+ [CEReactions, Reflect] attribute DOMString formTarget;
+ [CEReactions, CustomElementCallbacks] attribute unsigned long height;
+ attribute boolean indeterminate;
+ readonly attribute HTMLElement? list;
+ [CEReactions, Reflect] attribute DOMString max;
+ [CEReactions, RaisesException=Setter, CustomElementCallbacks] attribute long maxLength;
+ [CEReactions, Reflect] attribute DOMString min;
+ [CEReactions, RaisesException=Setter, CustomElementCallbacks] attribute long minLength;
+ [CEReactions, Reflect] attribute boolean multiple;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString pattern;
+ [CEReactions, Reflect] attribute DOMString placeholder;
+ [CEReactions, Reflect] attribute boolean readOnly;
+ [CEReactions, Reflect] attribute boolean required;
+ [CEReactions, RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size;
+ [CEReactions, Reflect, URL] attribute DOMString src;
+ [CEReactions, Reflect] attribute DOMString step;
+ [CEReactions, CustomElementCallbacks] attribute DOMString type;
+ [CEReactions, Reflect=value, CustomElementCallbacks] attribute DOMString defaultValue;
+ [CEReactions, TreatNullAs=EmptyString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
+ [CEReactions, 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
+ [CEReactions, CustomElementCallbacks] attribute unsigned long width;
+
+ [RaisesException, CustomElementCallbacks] void stepUp(optional long n = 1);
+ [RaisesException, CustomElementCallbacks] void stepDown(optional long n = 1);
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+
+ void select();
+ [RaisesException, ImplementedAs=selectionStartForBinding] attribute unsigned long? selectionStart;
+ [RaisesException, ImplementedAs=selectionEndForBinding] attribute unsigned long? selectionEnd;
+ [RaisesException, ImplementedAs=selectionDirectionForBinding] attribute DOMString? selectionDirection;
+ [RaisesException] void setRangeText(DOMString replacement);
+ [RaisesException] void setRangeText(DOMString replacement,
+ unsigned long start,
+ unsigned long end,
+ optional SelectionMode selectionMode = "preserve");
+ [RaisesException, ImplementedAs=setSelectionRangeForBinding]
+ void setSelectionRange(unsigned long start,
+ unsigned long end,
+ optional DOMString direction);
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLInputElement-partial
+ [CEReactions, Reflect] attribute DOMString align;
+ [CEReactions, Reflect] attribute DOMString useMap;
+
+ // HTML autocapitalize proposal
+ // https://github.com/mounirlamouri/html-autocapitalize/blob/master/proposal.md
+ [Measure] attribute DOMString autocapitalize;
+
+ // HTML Media Capture
+ // https://w3c.github.io/html-media-capture/#the-capture-attribute
+ // Using DOMString as enum cannot be reflected. https://github.com/w3c/html-media-capture/issues/12
+ [Measure, RuntimeEnabled=MediaCapture, Reflect] attribute DOMString capture;
+
+ // Non-standard APIs
+ [Reflect, MeasureAs=PrefixedDirectoryAttribute] attribute boolean webkitdirectory;
+ [Reflect, MeasureAs=IncrementalAttribute] attribute boolean incremental;
+};
diff --git a/core/html/forms/HTMLLabelElement.idl b/core/html/forms/HTMLLabelElement.idl
new file mode 100644
index 0000000..4106313
--- /dev/null
+++ b/core/html/forms/HTMLLabelElement.idl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2006, 2010 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.
+ */
+
+// https://html.spec.whatwg.org/#the-label-element
+
+interface HTMLLabelElement : HTMLElement {
+ readonly attribute HTMLFormElement? form;
+ [CEReactions, Reflect=for] attribute DOMString htmlFor;
+ readonly attribute HTMLElement? control;
+};
diff --git a/core/html/forms/HTMLLegendElement.idl b/core/html/forms/HTMLLegendElement.idl
new file mode 100644
index 0000000..6f52bcd
--- /dev/null
+++ b/core/html/forms/HTMLLegendElement.idl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2006, 2010 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.
+ */
+
+// https://html.spec.whatwg.org/#the-legend-element
+
+interface HTMLLegendElement : HTMLElement {
+ readonly attribute HTMLFormElement? form;
+
+ // obsolete members
+ // https://html.spec.whatwg.org/#HTMLLegendElement-partial
+ [CEReactions, Reflect] attribute DOMString align;
+};
diff --git a/core/html/forms/HTMLOptGroupElement.idl b/core/html/forms/HTMLOptGroupElement.idl
new file mode 100644
index 0000000..b2f1296
--- /dev/null
+++ b/core/html/forms/HTMLOptGroupElement.idl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2006, 2010 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.
+ */
+
+// https://html.spec.whatwg.org/#the-optgroup-element
+
+interface HTMLOptGroupElement : HTMLElement {
+ [CEReactions, Reflect] attribute boolean disabled;
+ [CEReactions, Reflect] attribute DOMString label;
+};
diff --git a/core/html/forms/HTMLOptionElement.idl b/core/html/forms/HTMLOptionElement.idl
new file mode 100644
index 0000000..d3325f8
--- /dev/null
+++ b/core/html/forms/HTMLOptionElement.idl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2006, 2007, 2010 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.
+ */
+
+// https://html.spec.whatwg.org/#the-option-element
+
+[
+ NamedConstructor=Option(optional DOMString data = null,
+ optional DOMString value = null,
+ optional boolean defaultSelected = false,
+ optional boolean selected = false),
+ ConstructorCallWith=Document,
+ RaisesException=Constructor
+] interface HTMLOptionElement : HTMLElement {
+ [CEReactions, Reflect] attribute boolean disabled;
+ readonly attribute HTMLFormElement? form;
+ [CEReactions] attribute DOMString label;
+ [CEReactions, Reflect=selected] attribute boolean defaultSelected;
+ [ImplementedAs=selectedForBinding] attribute boolean selected;
+ [CEReactions] attribute DOMString value;
+
+ // TODO(foolip): The text setter should never throw.
+ [CEReactions, RaisesException=Setter] attribute DOMString text;
+ readonly attribute long index;
+};
diff --git a/core/html/forms/HTMLOptionsCollection.idl b/core/html/forms/HTMLOptionsCollection.idl
new file mode 100644
index 0000000..5948567
--- /dev/null
+++ b/core/html/forms/HTMLOptionsCollection.idl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2013, 2014 Samsung Electronics. 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.
+ */
+
+// https://html.spec.whatwg.org/#the-htmloptionscollection-interface
+
+[
+ DependentLifetime
+] interface HTMLOptionsCollection : HTMLCollection {
+ // inherits item()
+ [CEReactions, RaisesException=Setter] attribute unsigned long length; // shadows inherited length
+ // FIXME: The spec has a legacycaller HTMLOptionElement? (DOMString name);
+ [CEReactions, RaisesException] setter void (unsigned long index, HTMLOptionElement? option);
+ [CEReactions, RaisesException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+ [CEReactions] void remove(long index);
+ attribute long selectedIndex;
+
+ // TODO(tkent): We need to declare this indexed property getter because our
+ // IDL compiler doesn't support inheritance of indexed property
+ // getters. crbug.com/752877
+ [ImplementedAs=item] getter Element? (unsigned long index);
+
+ // TODO(tkent): This should return only Element. crbug.com/695902
+ [ImplementedAs=namedGetter] getter (NodeList or Element)? namedItem(DOMString name);
+};
diff --git a/core/html/forms/HTMLOutputElement.idl b/core/html/forms/HTMLOutputElement.idl
new file mode 100644
index 0000000..8e55d6c
--- /dev/null
+++ b/core/html/forms/HTMLOutputElement.idl
@@ -0,0 +1,45 @@
+/*
+ * 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 INC. 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 INC. 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.
+ */
+
+// https://html.spec.whatwg.org/#the-output-element
+
+interface HTMLOutputElement : HTMLElement {
+ [CEReactions, PutForwards=value] readonly attribute DOMTokenList htmlFor;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
+ [CEReactions, Reflect] attribute DOMString name;
+
+ readonly attribute DOMString type;
+ [CEReactions] attribute DOMString defaultValue;
+ [CEReactions] attribute DOMString value;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
diff --git a/core/html/forms/HTMLSelectElement.idl b/core/html/forms/HTMLSelectElement.idl
new file mode 100644
index 0000000..ef30ae1
--- /dev/null
+++ b/core/html/forms/HTMLSelectElement.idl
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2013 Samsung Electronics. 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.
+ */
+
+// https://html.spec.whatwg.org/#the-select-element
+
+interface HTMLSelectElement : HTMLElement {
+ // TODO(foolip): attribute DOMString autocomplete;
+ [CEReactions, Reflect] attribute boolean autofocus;
+ [CEReactions, Reflect] attribute boolean disabled;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
+ [CEReactions, Reflect] attribute boolean multiple;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute boolean required;
+ [CEReactions, Reflect] attribute unsigned long size;
+
+ readonly attribute DOMString type;
+
+ readonly attribute HTMLOptionsCollection options;
+ // TODO(foolip): The length setter should never throw.
+ [CEReactions, RaisesException=Setter] attribute unsigned long length;
+ getter Element? item(unsigned long index);
+ HTMLOptionElement? namedItem(DOMString name);
+ [CEReactions, RaisesException] void add((HTMLOptionElement or HTMLOptGroupElement) element,
+ optional (HTMLElement or long)? before = null);
+ [CEReactions, RaisesException] void remove(); // ChildNode overload
+ [CEReactions] void remove(long index);
+ [CEReactions, RaisesException] setter void (unsigned long index, HTMLOptionElement? option);
+
+ readonly attribute HTMLCollection selectedOptions;
+ attribute long selectedIndex;
+ attribute DOMString value;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+};
diff --git a/core/html/forms/HTMLTextAreaElement.idl b/core/html/forms/HTMLTextAreaElement.idl
new file mode 100644
index 0000000..39421b2
--- /dev/null
+++ b/core/html/forms/HTMLTextAreaElement.idl
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2011 Motorola Mobility, 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.
+ */
+
+// https://html.spec.whatwg.org/#the-textarea-element
+
+interface HTMLTextAreaElement : HTMLElement {
+ // attribute DOMString autocomplete;
+ [CEReactions, Reflect] attribute boolean autofocus;
+ [CEReactions] attribute unsigned long cols;
+ [CEReactions, Reflect] attribute DOMString dirName;
+ [CEReactions, Reflect] attribute boolean disabled;
+ [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
+ [CEReactions, RaisesException=Setter] attribute long maxLength;
+ [CEReactions, RaisesException=Setter] attribute long minLength;
+ [CEReactions, Reflect] attribute DOMString name;
+ [CEReactions, Reflect] attribute DOMString placeholder;
+ [CEReactions, Reflect] attribute boolean readOnly;
+ [CEReactions, Reflect] attribute boolean required;
+ [CEReactions] attribute unsigned long rows;
+ [CEReactions, Reflect] attribute DOMString wrap;
+
+ readonly attribute DOMString type;
+ [CEReactions] attribute DOMString defaultValue;
+ [CEReactions, TreatNullAs=NullString] attribute DOMString value;
+ readonly attribute unsigned long textLength;
+
+ readonly attribute boolean willValidate;
+ readonly attribute ValidityState validity;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ boolean reportValidity();
+ void setCustomValidity(DOMString error);
+
+ readonly attribute NodeList labels;
+
+ void select();
+ attribute unsigned long selectionStart;
+ attribute unsigned long selectionEnd;
+ attribute DOMString selectionDirection;
+ [RaisesException] void setRangeText(DOMString replacement);
+ [RaisesException] void setRangeText(DOMString replacement,
+ unsigned long start,
+ unsigned long end,
+ optional SelectionMode selectionMode = "preserve");
+ [ImplementedAs=setSelectionRangeForBinding]
+ void setSelectionRange(unsigned long start,
+ unsigned 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/forms/RadioNodeList.idl b/core/html/forms/RadioNodeList.idl
new file mode 100644
index 0000000..9cd41f6
--- /dev/null
+++ b/core/html/forms/RadioNodeList.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012 Motorola Mobility, 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 MOTOROLA MOBILITY, INC. 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 MOTOROLA MOBILITY, INC. 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.
+ */
+
+// https://html.spec.whatwg.org/#radionodelist
+
+interface RadioNodeList : NodeList {
+ attribute DOMString value;
+
+ // TODO(tkent): We need to declare this indexed property getter because our
+ // IDL compiler doesn't support inheritance of indexed property
+ // getters. crbug.com/752877
+ [ImplementedAs=item] getter Node? (unsigned long index);
+};
diff --git a/core/html/forms/ValidityState.idl b/core/html/forms/ValidityState.idl
new file mode 100644
index 0000000..117bb92
--- /dev/null
+++ b/core/html/forms/ValidityState.idl
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the WebKit project.
+ *
+ * Copyright (C) 2009 Michelangelo De Simone <micdesim@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.
+ *
+ */
+
+// https://html.spec.whatwg.org/#validitystate
+
+interface ValidityState {
+ 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/media/MediaError.idl b/core/html/media/MediaError.idl
new file mode 100644
index 0000000..cd551b6
--- /dev/null
+++ b/core/html/media/MediaError.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 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.
+ */
+
+// https://html.spec.whatwg.org/#error-codes
+
+interface MediaError {
+ const unsigned short MEDIA_ERR_ABORTED = 1;
+ const unsigned short MEDIA_ERR_NETWORK = 2;
+ const unsigned short MEDIA_ERR_DECODE = 3;
+ const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
+ readonly attribute unsigned short code;
+ readonly attribute DOMString message;
+};
diff --git a/core/html/track/AudioTrack.idl b/core/html/track/AudioTrack.idl
index 6299715..5ab1662 100644
--- a/core/html/track/AudioTrack.idl
+++ b/core/html/track/AudioTrack.idl
@@ -5,9 +5,8 @@
// https://html.spec.whatwg.org/#audiotrack
[
- RuntimeEnabled=AudioVideoTracks,
- SetWrapperReferenceFrom=owner,
- GarbageCollected,
+ DependentLifetime,
+ RuntimeEnabled=AudioVideoTracks
] interface AudioTrack {
readonly attribute DOMString id;
readonly attribute DOMString kind;
diff --git a/core/html/track/AudioTrackList.idl b/core/html/track/AudioTrackList.idl
index 80ba853..98084b0 100644
--- a/core/html/track/AudioTrackList.idl
+++ b/core/html/track/AudioTrackList.idl
@@ -5,9 +5,8 @@
// https://html.spec.whatwg.org/#audiotracklist
[
- GarbageCollected,
- RuntimeEnabled=AudioVideoTracks,
- SetWrapperReferenceFrom=owner,
+ DependentLifetime,
+ RuntimeEnabled=AudioVideoTracks
] interface AudioTrackList : EventTarget {
readonly attribute unsigned long length;
getter AudioTrack (unsigned long index);
diff --git a/core/html/track/TextTrack.idl b/core/html/track/TextTrack.idl
index 3ce419b..ed942c8 100644
--- a/core/html/track/TextTrack.idl
+++ b/core/html/track/TextTrack.idl
@@ -29,8 +29,7 @@
enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" };
[
- GarbageCollected,
- SetWrapperReferenceFrom=owner,
+ DependentLifetime
] interface TextTrack : EventTarget {
readonly attribute TextTrackKind kind;
readonly attribute DOMString label;
@@ -48,10 +47,4 @@
[RaisesException] void removeCue(TextTrackCue cue);
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 7e4c6c8..8902e31 100644
--- a/core/html/track/TextTrackCue.idl
+++ b/core/html/track/TextTrackCue.idl
@@ -26,8 +26,7 @@
// https://html.spec.whatwg.org/#texttrackcue
[
- GarbageCollected,
- SetWrapperReferenceFrom=owner,
+ DependentLifetime
] interface TextTrackCue : EventTarget {
readonly attribute TextTrack? track;
diff --git a/core/html/track/TextTrackCueList.idl b/core/html/track/TextTrackCueList.idl
index 116c75c..b6e90f2 100644
--- a/core/html/track/TextTrackCueList.idl
+++ b/core/html/track/TextTrackCueList.idl
@@ -25,9 +25,7 @@
// https://html.spec.whatwg.org/#texttrackcuelist
-[
- GarbageCollected,
-] interface TextTrackCueList {
+interface TextTrackCueList {
readonly attribute unsigned long length;
getter TextTrackCue (unsigned long index);
TextTrackCue? getCueById(DOMString id);
diff --git a/core/html/track/TextTrackList.idl b/core/html/track/TextTrackList.idl
index cef8012..11ccda8 100644
--- a/core/html/track/TextTrackList.idl
+++ b/core/html/track/TextTrackList.idl
@@ -26,8 +26,7 @@
// https://html.spec.whatwg.org/#texttracklist
[
- GarbageCollected,
- SetWrapperReferenceFrom=owner,
+ DependentLifetime
] interface TextTrackList : EventTarget {
readonly attribute unsigned long length;
getter TextTrack (unsigned long index);
diff --git a/core/html/track/TrackEvent.idl b/core/html/track/TrackEvent.idl
index 29066ef..ac013fb 100644
--- a/core/html/track/TrackEvent.idl
+++ b/core/html/track/TrackEvent.idl
@@ -26,7 +26,7 @@
// https://html.spec.whatwg.org/multipage/embedded-content.html#the-trackevent-interface
[
- Constructor(DOMString type, optional TrackEventInit eventInitDict),
+ Constructor(DOMString type, optional TrackEventInit eventInitDict)
] interface TrackEvent : Event {
readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
};
diff --git a/core/html/track/VideoTrack.idl b/core/html/track/VideoTrack.idl
index 8a6b8f6..980e8de 100644
--- a/core/html/track/VideoTrack.idl
+++ b/core/html/track/VideoTrack.idl
@@ -5,9 +5,8 @@
// https://html.spec.whatwg.org/#videotrack
[
- RuntimeEnabled=AudioVideoTracks,
- SetWrapperReferenceFrom=owner,
- GarbageCollected,
+ DependentLifetime,
+ RuntimeEnabled=AudioVideoTracks
] interface VideoTrack {
readonly attribute DOMString id;
readonly attribute DOMString kind;
diff --git a/core/html/track/VideoTrackList.idl b/core/html/track/VideoTrackList.idl
index 79727b7..d3f2d66 100644
--- a/core/html/track/VideoTrackList.idl
+++ b/core/html/track/VideoTrackList.idl
@@ -5,9 +5,8 @@
// https://html.spec.whatwg.org/#videotracklist
[
- GarbageCollected,
- RuntimeEnabled=AudioVideoTracks,
- SetWrapperReferenceFrom=owner,
+ DependentLifetime,
+ RuntimeEnabled=AudioVideoTracks
] interface VideoTrackList : EventTarget {
readonly attribute unsigned long length;
getter VideoTrack (unsigned long index);
diff --git a/core/html/track/vtt/VTTCue.idl b/core/html/track/vtt/VTTCue.idl
index 93c903b..3ea44af 100644
--- a/core/html/track/vtt/VTTCue.idl
+++ b/core/html/track/vtt/VTTCue.idl
@@ -27,21 +27,20 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/html5/webvtt/#the-vttcue-interface
+// https://w3c.github.io/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" };
+enum AlignSetting { "start", "center", "end", "left", "right" };
[
Constructor(double startTime, double endTime, DOMString text),
ConstructorCallWith=Document,
- SetWrapperReferenceFrom=owner,
+ DependentLifetime
] interface VTTCue : TextTrackCue {
- // TODO(philipj): regionId has been replaced by a region attribute.
- [RuntimeEnabled=WebVTTRegions] attribute DOMString regionId;
+ [RuntimeEnabled=WebVTTRegions] attribute VTTRegion? region;
attribute DirectionSetting vertical;
attribute boolean snapToLines;
attribute (double or AutoKeyword) line;
diff --git a/core/html/track/vtt/VTTRegion.idl b/core/html/track/vtt/VTTRegion.idl
index a2843fd..e57a8ef 100644
--- a/core/html/track/vtt/VTTRegion.idl
+++ b/core/html/track/vtt/VTTRegion.idl
@@ -23,25 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/html5/webvtt/#the-vttregion-interface
+// https://w3c.github.io/webvtt/#the-vttregion-interface
+
+enum ScrollSetting { "" /* none */, "up" };
[
Constructor,
- RuntimeEnabled=WebVTTRegions,
- GarbageCollected,
+ RuntimeEnabled=WebVTTRegions
] interface VTTRegion {
+ attribute DOMString id;
[RaisesException=Setter] attribute double width;
- // TODO(philipj): height should be called lines.
- [RaisesException=Setter] attribute long height;
+ [RaisesException=Setter] attribute long lines;
[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;
+ attribute ScrollSetting scroll;
};
diff --git a/core/html/track/vtt/VTTRegionList.idl b/core/html/track/vtt/VTTRegionList.idl
deleted file mode 100644
index 8eff2cd..0000000
--- a/core/html/track/vtt/VTTRegionList.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:
- * 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.
- */
-
-// TODO(philipj): The VTTRegionList interface has been removed from the spec:
-// https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
-
-[
- RuntimeEnabled=WebVTTRegions,
- GarbageCollected,
-] interface VTTRegionList {
- readonly attribute unsigned long length;
- getter VTTRegion item(unsigned long index);
- VTTRegion getRegionById(DOMString id);
-};
diff --git a/core/imagebitmap/ImageBitmap.idl b/core/imagebitmap/ImageBitmap.idl
new file mode 100644
index 0000000..8e0df94
--- /dev/null
+++ b/core/imagebitmap/ImageBitmap.idl
@@ -0,0 +1,13 @@
+// Copyright 2013 The Chromium 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/#images
+
+[
+ Exposed=(Window,Worker)
+] interface ImageBitmap {
+ readonly attribute unsigned long width;
+ readonly attribute unsigned long height;
+ void close();
+};
diff --git a/core/imagebitmap/ImageBitmapFactories.idl b/core/imagebitmap/ImageBitmapFactories.idl
index 02b3425..5ef7a45 100644
--- a/core/imagebitmap/ImageBitmapFactories.idl
+++ b/core/imagebitmap/ImageBitmapFactories.idl
@@ -31,23 +31,23 @@
// https://html.spec.whatwg.org/#imagebitmapfactories
typedef (HTMLImageElement or
+ SVGImageElement or
HTMLVideoElement or
HTMLCanvasElement or
Blob or
ImageData or
- ImageBitmap) ImageBitmapSource;
+ ImageBitmap or
+ OffscreenCanvas) ImageBitmapSource;
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface ImageBitmapFactories {
- [CallWith=ScriptState, RaisesException] Promise createImageBitmap(ImageBitmapSource imageBitmap);
- [CallWith=ScriptState, RaisesException, RuntimeEnabled=ExperimentalCanvasFeatures] Promise createImageBitmap(
- ImageBitmapSource imageBitmap, ImageBitmapOptions options);
- [CallWith=ScriptState, RaisesException] Promise createImageBitmap(ImageBitmapSource imageBitmap, long sx, long sy, long sw, long sh);
- [CallWith=ScriptState, RaisesException, RuntimeEnabled=ExperimentalCanvasFeatures] Promise createImageBitmap(
- ImageBitmapSource imageBitmap, long sx, long sy, long sw, long sh, ImageBitmapOptions options);
+ [CallWith=ScriptState] Promise createImageBitmap(
+ ImageBitmapSource imageBitmap, optional ImageBitmapOptions options);
+ [CallWith=ScriptState] Promise createImageBitmap(
+ ImageBitmapSource imageBitmap, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options);
};
Window implements ImageBitmapFactories;
diff --git a/core/imagebitmap/ImageBitmapOptions.idl b/core/imagebitmap/ImageBitmapOptions.idl
index e8c231d..cffb30c 100644
--- a/core/imagebitmap/ImageBitmapOptions.idl
+++ b/core/imagebitmap/ImageBitmapOptions.idl
@@ -2,9 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[RuntimeEnabled=ExperimentalCanvasFeatures] enum ImageOrientation { "none", "flipY" };
-[RuntimeEnabled=ExperimentalCanvasFeatures] enum PremultiplyAlpha { "none", "default" };
+// https://html.spec.whatwg.org/#imagebitmapoptions
+
+enum ImageOrientation { "none", "flipY" };
+enum PremultiplyAlpha { "none", "premultiply", "default" };
+enum ColorSpaceConversion { "none", "default", "srgb", "linear-rgb", "rec2020", "p3" };
+[RuntimeEnabled=ExperimentalCanvasFeatures] enum ResizeQuality { "pixelated", "low", "medium", "high" };
dictionary ImageBitmapOptions {
- [RuntimeEnabled=ExperimentalCanvasFeatures] PremultiplyAlpha premultiplyAlpha = "default";
- [RuntimeEnabled=ExperimentalCanvasFeatures] ImageOrientation imageOrientation = "none";
+ ImageOrientation imageOrientation = "none";
+ PremultiplyAlpha premultiplyAlpha = "default";
+ ColorSpaceConversion colorSpaceConversion = "default";
+ [RuntimeEnabled=ExperimentalCanvasFeatures, EnforceRange] unsigned long resizeWidth;
+ [RuntimeEnabled=ExperimentalCanvasFeatures, EnforceRange] unsigned long resizeHeight;
+ [RuntimeEnabled=ExperimentalCanvasFeatures] ResizeQuality resizeQuality = "low";
};
diff --git a/core/input/InputDeviceCapabilities.idl b/core/input/InputDeviceCapabilities.idl
index 6263af8..16e39ab 100644
--- a/core/input/InputDeviceCapabilities.idl
+++ b/core/input/InputDeviceCapabilities.idl
@@ -3,18 +3,18 @@
// found in the LICENSE file.
// Represents capabilities for a group of related input devices.
-// To ease implementation, developers cannot rely on comparing two
+// To ease implementation, developers cannot rely on comparing two
// InputDeviceCapabilities instances for equality. Now we only have two
// InputDeviceCapabilities instances: one for devices which send touch
// events, and one for those that don't, because currently all we care
// about is if the input device fires touch events or not.
+// https://wicg.github.io/InputDeviceCapabilities/#the-inputdevicecapabilities-interface
+
[
- Constructor(optional InputDeviceCapabilitiesInit deviceInitDict),
- RuntimeEnabled=InputDeviceCapabilities,
- GarbageCollected,
+ Constructor(optional InputDeviceCapabilitiesInit deviceInitDict)
] interface InputDeviceCapabilities {
-
+
// 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.
diff --git a/core/input/InputDeviceCapabilitiesInit.idl b/core/input/InputDeviceCapabilitiesInit.idl
index e7ae86d..a4025d4 100644
--- a/core/input/InputDeviceCapabilitiesInit.idl
+++ b/core/input/InputDeviceCapabilitiesInit.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.
-[
- RuntimeEnabled=InputDeviceCapabilities,
-] dictionary InputDeviceCapabilitiesInit {
+// https://wicg.github.io/InputDeviceCapabilities/#the-inputdevicecapabilities-interface
+
+dictionary InputDeviceCapabilitiesInit {
boolean firesTouchEvents = false;
};
diff --git a/core/input/Touch.idl b/core/input/Touch.idl
new file mode 100644
index 0000000..c526612
--- /dev/null
+++ b/core/input/Touch.idl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2008, The Android Open Source Project
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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.
+ */
+
+// https://w3c.github.io/touch-events/#touch-interface
+
+[
+ Constructor(TouchInit initDict),
+ ConstructorCallWith=Document
+] interface Touch {
+ 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;
+ readonly attribute float radiusX;
+ readonly attribute float radiusY;
+ readonly attribute float rotationAngle;
+ readonly attribute float force;
+
+ // Canvas Hit Regions
+ // https://html.spec.whatwg.org/multipage/scripting.html#Touch-partial
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute DOMString? region;
+};
diff --git a/core/input/TouchInit.idl b/core/input/TouchInit.idl
new file mode 100644
index 0000000..2ae7f0f
--- /dev/null
+++ b/core/input/TouchInit.idl
@@ -0,0 +1,24 @@
+// 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/touch-events/#touch-interface
+
+dictionary TouchInit {
+ required long identifier;
+ required EventTarget target;
+ double clientX = 0;
+ double clientY = 0;
+ double screenX = 0;
+ double screenY = 0;
+ double pageX = 0;
+ double pageY = 0;
+ float radiusX = 0;
+ float radiusY = 0;
+ float rotationAngle = 0;
+ float force = 0;
+
+ // Canvas Hit Regions
+ // https://github.com/whatwg/html/issues/547
+ DOMString? region = null;
+};
diff --git a/core/input/TouchList.idl b/core/input/TouchList.idl
new file mode 100644
index 0000000..f8381a4
--- /dev/null
+++ b/core/input/TouchList.idl
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008, The Android Open Source Project
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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.
+ */
+
+// https://w3c.github.io/touch-events/#touchlist-interface
+
+interface TouchList {
+ readonly attribute unsigned long length;
+ getter Touch? item(unsigned long index);
+};
diff --git a/core/inspector/CodeGeneratorInstrumentation.py b/core/inspector/CodeGeneratorInstrumentation.py
deleted file mode 100755
index efcdb6d..0000000
--- a/core/inspector/CodeGeneratorInstrumentation.py
+++ /dev/null
@@ -1,548 +0,0 @@
-#!/usr/bin/env 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.
-
-import optparse
-import re
-import string
-import sys
-
-template_h = string.Template("""// Code generated from InspectorInstrumentation.idl
-
-#ifndef ${file_name}_h
-#define ${file_name}_h
-
-${includes}
-
-namespace blink {
-
-${forward_declarations}
-
-namespace InspectorInstrumentation {
-
-$methods
-} // namespace InspectorInstrumentation
-
-} // namespace blink
-
-#endif // !defined(${file_name}_h)
-""")
-
-template_inline = string.Template("""
-inline void ${name}(${params_public})
-{ ${fast_return}
- if (${condition})
- ${name}Impl(${params_impl});
-}
-""")
-
-template_inline_forward = string.Template("""
-inline void ${name}(${params_public})
-{ ${fast_return}
- ${name}Impl(${params_impl});
-}
-""")
-
-template_inline_returns_value = string.Template("""
-inline ${return_type} ${name}(${params_public})
-{ ${fast_return}
- if (${condition})
- return ${name}Impl(${params_impl});
- return ${default_return_value};
-}
-""")
-
-
-template_cpp = string.Template("""// Code generated from InspectorInstrumentation.idl
-
-${includes}
-
-namespace blink {
-${extra_definitions}
-
-namespace InspectorInstrumentation {
-$methods
-
-} // namespace InspectorInstrumentation
-
-} // namespace blink
-""")
-
-template_outofline = string.Template("""
-${return_type} ${name}Impl(${params_impl})
-{${impl_lines}
-}""")
-
-template_agent_call = string.Template("""
- if (${agent_class}* agent = ${agent_fetch})
- ${maybe_return}agent->${name}(${params_agent});""")
-
-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/Allocator.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-
-namespace blink {
-
-${forward_list}
-
-class CORE_EXPORT InstrumentingAgents : public RefCountedWillBeGarbageCollectedFinalized<InstrumentingAgents> {
- WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
- USING_FAST_MALLOC_WILL_BE_REMOVED(InstrumentingAgents);
-public:
- static PassRefPtrWillBeRawPtr<InstrumentingAgents> create()
- {
- return adoptRefWillBeNoop(new InstrumentingAgents());
- }
- ~InstrumentingAgents() { }
- DECLARE_TRACE();
- void reset();
-
-${accessor_list}
-
-private:
- InstrumentingAgents();
-
-${member_list}
-};
-
-}
-
-#endif // !defined(InstrumentingAgentsInl_h)
-""")
-
-template_instrumenting_agent_accessor = string.Template("""
- ${class_name}* ${getter_name}() const { return ${member_name}; }
- void set${class_name}(${class_name}* agent) { ${member_name} = agent; }""")
-
-template_instrumenting_agents_cpp = string.Template("""
-InstrumentingAgents::InstrumentingAgents()
- : $init_list
-{
-}
-
-DEFINE_TRACE(InstrumentingAgents)
-{
- $trace_list
-}
-
-void InstrumentingAgents::reset()
-{
- $reset_list
-}""")
-
-
-
-def match_and_consume(pattern, source):
- match = re.match(pattern, source)
- if match:
- return match, source[len(match.group(0)):].strip()
- return None, source
-
-
-def load_model_from_idl(source):
- source = re.sub("//.*", "", source) # Remove line comments
- source = re.sub("/\*(.|\n)*?\*/", "", source, re.MULTILINE) # Remove block comments
- source = re.sub("\]\s*?\n\s*", "] ", source) # Merge the method annotation with the next line
- source = source.strip()
-
- model = []
-
- while len(source):
- match, source = match_and_consume("interface\s(\w*)\s?\{([^\{]*)\}", source)
- if not match:
- sys.stderr.write("Cannot parse %s\n" % source[:100])
- sys.exit(1)
- model.append(File(match.group(1), match.group(2)))
-
- return model
-
-
-class File:
- def __init__(self, name, source):
- self.name = name
- self.header_name = self.name + "Inl"
- self.includes = [include_inspector_header("InspectorInstrumentation")]
- self.forward_declarations = []
- self.declarations = []
- for line in map(str.strip, source.split("\n")):
- line = re.sub("\s{2,}", " ", line).strip() # Collapse whitespace
- if len(line) == 0:
- continue
- if line[0] == "#":
- self.includes.append(line)
- elif line.startswith("class "):
- self.forward_declarations.append(line)
- else:
- self.declarations.append(Method(line))
- self.includes.sort()
- self.forward_declarations.sort()
-
- def generate(self, cpp_lines, used_agents):
- header_lines = []
- for declaration in self.declarations:
- for agent in set(declaration.agents):
- used_agents.add(agent)
- declaration.generate_header(header_lines)
- declaration.generate_cpp(cpp_lines)
-
- return template_h.substitute(None,
- file_name=self.header_name,
- includes="\n".join(self.includes),
- forward_declarations="\n".join(self.forward_declarations),
- methods="\n".join(header_lines))
-
-
-class Method:
- def __init__(self, source):
- match = re.match("(\[[\w|,|=|\s]*\])?\s?(\w*\*?) (\w*)\((.*)\)\s?;", source)
- if not match:
- sys.stderr.write("Cannot parse %s\n" % source)
- sys.exit(1)
-
- self.options = []
- if match.group(1):
- options_str = re.sub("\s", "", match.group(1)[1:-1])
- if len(options_str) != 0:
- self.options = options_str.split(",")
-
- self.return_type = match.group(2)
-
- self.name = match.group(3)
-
- # Splitting parameters by a comma, assuming that attribute lists contain no more than one attribute.
- self.params = map(Parameter, map(str.strip, match.group(4).split(",")))
-
- self.accepts_cookie = len(self.params) and self.params[0].type == "const InspectorInstrumentationCookie&"
- self.returns_cookie = self.return_type == "InspectorInstrumentationCookie"
-
- self.returns_value = self.return_type != "void"
-
- if self.return_type == "bool":
- self.default_return_value = "false"
- elif self.return_type == "int":
- self.default_return_value = "0"
- elif self.return_type == "String":
- self.default_return_value = "\"\""
- else:
- self.default_return_value = self.return_type + "()"
-
- for param in self.params:
- if "DefaultReturn" in param.options:
- self.default_return_value = param.name
-
- self.params_impl = self.params
- if not self.accepts_cookie and not "Inline=Forward" in self.options:
- if not "Keep" in self.params_impl[0].options:
- self.params_impl = self.params_impl[1:]
- self.params_impl = [Parameter("InstrumentingAgents* agents")] + self.params_impl
-
- self.agents = filter(lambda option: not "=" in option, self.options)
-
- def generate_header(self, header_lines):
- if "Inline=Custom" in self.options:
- return
-
- 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:
- fast_return = "\n FAST_RETURN_IF_NO_FRONTENDS(%s);" % self.default_return_value
- else:
- fast_return = ""
-
- for param in self.params:
- if "FastReturn" in param.options:
- fast_return += "\n if (!%s)\n return %s;" % (param.name, self.default_return_value)
-
- if self.accepts_cookie:
- condition = "%s.isValid()" % self.params_impl[0].name
- template = template_inline
- elif "Inline=Forward" in self.options:
- condition = ""
- template = template_inline_forward
- else:
- condition = "InstrumentingAgents* agents = instrumentingAgentsFor(%s)" % self.params[0].name
-
- if self.returns_value:
- template = template_inline_returns_value
- else:
- template = template_inline
-
- header_lines.append(template.substitute(
- None,
- name=self.name,
- fast_return=fast_return,
- return_type=self.return_type,
- default_return_value=self.default_return_value,
- params_public=", ".join(map(Parameter.to_str_full, self.params)),
- params_impl=", ".join(map(Parameter.to_str_name, self.params_impl)),
- condition=condition))
-
- def generate_cpp(self, cpp_lines):
- if len(self.agents) == 0:
- return
-
- body_lines = map(self.generate_ref_ptr, self.params)
- body_lines += map(self.generate_agent_call, self.agents)
-
- if self.returns_cookie:
- body_lines.append("\n return InspectorInstrumentationCookie(agents);")
- elif self.returns_value:
- body_lines.append("\n return %s;" % self.default_return_value)
-
- 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))
- 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)
-
- leading_param_name = self.params_impl[0].name
- if not self.accepts_cookie:
- agent_fetch = "%s->%s()" % (leading_param_name, agent_getter)
- else:
- agent_fetch = "%s.instrumentingAgents()->%s()" % (leading_param_name, agent_getter)
-
- template = template_agent_call
-
- if not self.returns_value or self.returns_cookie:
- maybe_return = ""
- else:
- maybe_return = "return "
-
- return template.substitute(
- None,
- name=self.name,
- agent_class=agent_class,
- agent_fetch=agent_fetch,
- maybe_return=maybe_return,
- params_agent=", ".join(map(Parameter.to_str_value, self.params_impl)[1:]))
-
- def generate_ref_ptr(self, param):
- if param.is_prp:
- return "\n RefPtr<%s> %s = %s;" % (param.inner_type, param.value, param.name)
- else:
- return ""
-
-class Parameter:
- def __init__(self, source):
- self.options = []
- match, source = match_and_consume("\[(\w*)\]", source)
- if match:
- self.options.append(match.group(1))
-
- parts = map(str.strip, source.split("="))
- if len(parts) == 1:
- self.default_value = None
- else:
- self.default_value = parts[1]
-
- param_decl = parts[0]
-
- if re.match("(const|unsigned long) ", param_decl):
- min_type_tokens = 2
- else:
- min_type_tokens = 1
-
- if len(param_decl.split(" ")) > min_type_tokens:
- parts = param_decl.split(" ")
- self.type = " ".join(parts[:-1])
- self.name = parts[-1]
- else:
- self.type = param_decl
- self.name = generate_param_name(self.type)
-
- if re.match("PassRefPtr<", param_decl):
- self.is_prp = True
- self.value = self.name
- self.name = "prp" + self.name[0].upper() + self.name[1:]
- self.inner_type = re.match("PassRefPtr<(.+)>", param_decl).group(1)
- else:
- self.is_prp = False
- self.value = self.name
-
-
- def to_str_full(self):
- if self.default_value is None:
- return self.to_str_class_and_name()
- return "%s %s = %s" % (self.type, self.name, self.default_value)
-
- def to_str_class_and_name(self):
- return "%s %s" % (self.type, self.name)
-
- def to_str_class(self):
- return self.type
-
- def to_str_name(self):
- return self.name
-
- def to_str_value(self):
- return self.value
-
-
-def generate_param_name(param_type):
- base_name = re.match("(const |PassRefPtr<)?(\w*)", param_type).group(2)
- return "param" + base_name
-
-
-def agent_class_name(agent):
- 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
-
-
-def agent_getter_signature(agent):
- agent_class = agent_class_name(agent)
- return agent_class, agent_class[0].lower() + agent_class[1:]
-
-
-def include_header(name):
- return "#include \"%s.h\"" % name
-
-
-def include_inspector_header(name):
- return include_header("core/inspector/" + name)
-
-
-def generate_instrumenting_agents(used_agents):
- agents = list(used_agents)
-
- forward_list = []
- accessor_list = []
- member_list = []
- init_list = []
- trace_list = []
- reset_list = []
-
- for agent in agents:
- class_name, getter_name = agent_getter_signature(agent)
- member_name = "m_" + getter_name
-
- forward_list.append("class %s;" % class_name)
- accessor_list.append(template_instrumenting_agent_accessor.substitute(
- None,
- class_name=class_name,
- getter_name=getter_name,
- member_name=member_name))
- member_list.append(" RawPtrWillBeMember<%s> %s;" % (class_name, member_name))
- init_list.append("%s(nullptr)" % member_name)
- trace_list.append("visitor->trace(%s);" % member_name)
- reset_list.append("%s = nullptr;" % member_name)
-
- forward_list.sort()
- accessor_list.sort()
- member_list.sort()
- init_list.sort()
- trace_list.sort()
- reset_list.sort()
-
- header_lines = template_instrumenting_agents_h.substitute(
- None,
- forward_list="\n".join(forward_list),
- accessor_list="\n".join(accessor_list),
- member_list="\n".join(member_list))
-
- cpp_lines = template_instrumenting_agents_cpp.substitute(
- None,
- init_list="\n , ".join(init_list),
- trace_list="\n ".join(trace_list),
- reset_list="\n ".join(reset_list))
-
- return header_lines, cpp_lines
-
-
-def generate(input_path, output_dir):
- fin = open(input_path, "r")
- files = load_model_from_idl(fin.read())
- fin.close()
-
- cpp_includes = []
- cpp_lines = []
- used_agents = set()
- for f in files:
- cpp_includes.append(include_header(f.header_name))
-
- fout = open(output_dir + "/" + f.header_name + ".h", "w")
- fout.write(f.generate(cpp_lines, used_agents))
- fout.close()
-
- 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)
-
- fout = open(output_dir + "/" + "InstrumentingAgentsInl.h", "w")
- fout.write(instrumenting_agents_header)
- fout.close()
-
- fout = open(output_dir + "/InspectorInstrumentationImpl.cpp", "w")
- fout.write(template_cpp.substitute(None,
- includes="\n".join(cpp_includes),
- extra_definitions=instrumenting_agents_cpp,
- methods="\n".join(cpp_lines)))
- fout.close()
-
-
-cmdline_parser = optparse.OptionParser()
-cmdline_parser.add_option("--output_dir")
-
-try:
- arg_options, arg_values = cmdline_parser.parse_args()
- if (len(arg_values) != 1):
- raise Exception("Exactly one plain argument expected (found %s)" % len(arg_values))
- input_path = arg_values[0]
- output_dirpath = arg_options.output_dir
- if not output_dirpath:
- raise Exception("Output directory must be specified")
-except Exception:
- # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
- exc = sys.exc_info()[1]
- sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc)
- sys.stderr.write("Usage: <script> --output_dir <output_dir> InspectorInstrumentation.idl\n")
- exit(1)
-
-generate(input_path, output_dirpath)
diff --git a/core/inspector/DevToolsHost.idl b/core/inspector/DevToolsHost.idl
index 096fd64..7aca074 100644
--- a/core/inspector/DevToolsHost.idl
+++ b/core/inspector/DevToolsHost.idl
@@ -31,13 +31,10 @@
*/
[
- WillBeGarbageCollected,
- NoInterfaceObject,
+ NoInterfaceObject
] interface DevToolsHost {
float zoomFactor();
- void setInjectedScriptForOrigin(DOMString origin, DOMString script);
-
void copyText(DOMString text);
[Custom] DOMString platform();
diff --git a/core/inspector/InspectorInstrumentation.idl b/core/inspector/InspectorInstrumentation.idl
deleted file mode 100644
index 260db42..0000000
--- a/core/inspector/InspectorInstrumentation.idl
+++ /dev/null
@@ -1,454 +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.
-*/
-
-/*
-* CodeGeneratorInstrumentation.py uses this file as a source to generate
-* InspectorInstrumentationInl.h and InspectorInstrumentationImpl.cpp
-*
-* The code below is not a correct IDL but a mix of IDL and C++.
-*
-* The syntax for an instrumentation method is as follows:
-*
-* [methodAttributes] returnValue methodName([paramAttr1] param1, [paramAttr2] param2, ...)
-*
-* Where:
-* methodAttributes - optional list of method attributes.
-* Attributes containing "=" are code generation options:
-* Inline=Custom - do not generate the public inline method.
-* Inline=FastReturn - return early from the inline method if there are no frontends.
-* Inline=Forward - generate a simple forwarding inline method that does not
- modify the parameter list (implies Inline=FastReturn)
-* Attributes without "=" are the names of the agents to be invoked.
-* Examples: DOM, Page, Debugger.
-*
-* paramAttr - optional attribute controlling the parameters handling (one attribute per parameter max).
-* Keep - pass first parameter (used to access the InstrumentingAgents instance) to agents.
-* FastReturn - return early from the inline method if this parameter is 0/false.
-*
-* returnValue: C++ return value. Only "void" and "InspectorInstrumentationCookie" are supported.
-*
-* methodName: C++ name for the public instrumentation method and agents methods.
-*
-* paramList: C++ parameter list with optional names. Names will be deduced from types if omitted but you have to
-* specify explicit names for multiple parameters of the same type.
-*
-* Parameters with type PassRefPtr<T> are converted to raw pointers,
-* so reference will not be passed or released until all agents are notified.
-*/
-
-interface InspectorInstrumentation {
-
-#include "core/dom/PseudoElement.h"
-
- // 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]
- void willCloseWindow(ExecutionContext*);
-
- [DOMDebugger, Inline=FastReturn]
- void willInsertDOMNode([Keep] Node* parent);
-
- [DOM, DOMDebugger, Inline=FastReturn]
- void didInsertDOMNode([Keep] Node*);
-
- [DOMDebugger, DOM, Inline=FastReturn]
- void willRemoveDOMNode([Keep] Node*);
-
- [DOMDebugger, DOM, Inline=FastReturn]
- void willModifyDOMAttr([Keep] Element*, const AtomicString& oldValue, const AtomicString& newValue);
-
- [DOM, Inline=FastReturn]
- void didModifyDOMAttr([Keep] Element*, const QualifiedName& name, const AtomicString& value);
-
- [DOM, Inline=FastReturn]
- void didRemoveDOMAttr([Keep] Element*, const QualifiedName& name);
-
- [DOM, Inline=FastReturn]
- void characterDataModified([Keep] CharacterData*);
-
- [DOM, DOMDebugger, Inline=FastReturn]
- void didInvalidateStyleAttr([Keep] Node*);
-
- [DOM, Inline=FastReturn]
- void didPerformElementShadowDistribution([Keep] Element*);
-
- [CSS]
- void documentDetached([Keep] Document*);
-
- [CSS, Inline=FastReturn]
- void activeStyleSheetsUpdated([Keep] Document*);
-
- [CSS, Inline=FastReturn]
- void mediaQueryResultChanged(Document*);
-
- [DOM, Inline=FastReturn]
- void didPushShadowRoot([Keep] Element* host, ShadowRoot*);
-
- [DOM, Inline=FastReturn]
- void willPopShadowRoot([Keep] Element* host, ShadowRoot*);
-
- [DOMDebugger]
- void willSetInnerHTML(Element* element);
-
- [DOMDebugger, Inline=FastReturn]
- void willSendXMLHttpRequest(ExecutionContext*, const String& url);
-
- [DOMDebugger, Inline=FastReturn]
- void didFireWebGLError(Element*, const String& errorName);
-
- [DOMDebugger, Inline=FastReturn]
- void didFireWebGLWarning(Element*);
-
- [DOMDebugger, Inline=FastReturn]
- void didFireWebGLErrorOrWarning(Element*, const String& message);
-
- [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
- void didInstallTimer([Keep] ExecutionContext*, int timerId, int timeout, bool singleShot);
-
- [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
- void didRemoveTimer([Keep] ExecutionContext*, int timerId);
-
- [Debugger, Inline=FastReturn]
- InspectorInstrumentationCookie willExecuteScript(ExecutionContext*, int scriptId);
-
- [Debugger, Inline=FastReturn]
- void didExecuteScript(const InspectorInstrumentationCookie&);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didEnqueueEvent([Keep] EventTarget*, Event*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didRemoveEvent([Keep] EventTarget*, Event*);
-
- [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
- InspectorInstrumentationCookie willHandleEvent([Keep] EventTarget*, Event*, EventListener* listener, bool useCapture);
-
- [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
- void didHandleEvent(const InspectorInstrumentationCookie&);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didEnqueueMutationRecord([Keep] ExecutionContext*, MutationObserver*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didClearAllMutationRecords([Keep] ExecutionContext*, MutationObserver*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void willDeliverMutationRecords([Keep] ExecutionContext*, MutationObserver*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didDeliverMutationRecords(ExecutionContext*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didPostExecutionContextTask([Keep] ExecutionContext*, ExecutionContextTask*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didKillAllExecutionContextTasks([Keep] ExecutionContext*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void willPerformExecutionContextTask([Keep] ExecutionContext*, ExecutionContextTask*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didPerformExecutionContextTask(ExecutionContext*);
-
- [DOMDebugger, Inline=FastReturn]
- void willEvaluateScript(ExecutionContext*);
-
- [PageRuntime]
- void didCreateScriptContext([Keep] LocalFrame*, ScriptState*, SecurityOrigin*, int worldId);
-
- [PageRuntime, Inline=FastReturn]
- void willReleaseScriptContext([Keep] LocalFrame*, ScriptState*);
-
- [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
- InspectorInstrumentationCookie willFireTimer([Keep] ExecutionContext*, int timerId);
-
- [AsyncCallTracker, DOMDebugger, Inline=FastReturn]
- void didFireTimer(const InspectorInstrumentationCookie&);
-
- [Page, Inline=FastReturn]
- void didUpdateLayout(LocalFrame*);
-
- [Page, Inline=FastReturn]
- void didResizeMainFrame(LocalFrame*);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didDispatchXHRLoadendEvent(ExecutionContext*, XMLHttpRequest*);
-
- [LayerTree, Inline=FastReturn]
- void didPaint([Keep] LayoutObject*, const GraphicsLayer*, GraphicsContext&, const LayoutRect&);
-
- [Resource, Inline=FastReturn]
- InspectorInstrumentationCookie willRecalculateStyle([Keep] Document*);
-
- [Resource, Page, Inline=FastReturn]
- void didRecalculateStyle(const InspectorInstrumentationCookie&, int elementCount);
-
- [Resource, Inline=FastReturn]
- void didScheduleStyleRecalculation([Keep] Document*);
-
- [Resource, Inline=FastReturn]
- void applyUserAgentOverride(LocalFrame*, String* userAgent);
-
- [Resource]
- void didBlockRequest([Keep] LocalFrame*, const ResourceRequest&, DocumentLoader*, const FetchInitiatorInfo&, ResourceRequestBlockedReason);
-
- [Resource]
- void willSendRequest([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&);
-
- [Resource]
- void markResourceAsCached(LocalFrame*, unsigned long identifier);
-
- [Resource]
- void didReceiveResourceResponse([Keep] LocalFrame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
-
- [Inline=Forward]
- void continueAfterXFrameOptionsDenied(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
-
- [Inline=Forward]
- void continueWithPolicyIgnore(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
-
- [Resource, Inline=FastReturn]
- void didReceiveData([Keep] LocalFrame*, unsigned long identifier, const char* data, int dataLength, int 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*);
-
- [Resource]
- void didFailLoading(LocalFrame* frame, unsigned long identifier, const ResourceError&);
-
- [Resource]
- void documentThreadableLoaderStartedLoadingForClient(ExecutionContext*, unsigned long identifier, ThreadableLoaderClient* client);
-
- [Resource]
- void willSendEventSourceRequest(ExecutionContext*, ThreadableLoaderClient* eventSource);
-
- [Resource]
- void willDispatchEventSourceEvent(ExecutionContext*, ThreadableLoaderClient* eventSource, const AtomicString& eventName, const AtomicString& eventId, const String& 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<EncodedFormData>, const HTTPHeaderMap& headers, bool includeCredentials);
-
- [Resource]
- void didFailXHRLoading([Keep] ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const String& url);
-
- [Resource]
- void didFinishXHRLoading([Keep] ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const String& url);
-
- [Resource]
- void willStartFetch(ExecutionContext*, ThreadableLoaderClient*);
-
- [Resource]
- void didFailFetch(ExecutionContext*, ThreadableLoaderClient*);
-
- [Resource]
- void didFinishFetch([Keep] ExecutionContext*, ThreadableLoaderClient*, const AtomicString& method, const String& url);
-
- [Resource]
- void scriptImported(ExecutionContext*, unsigned long identifier, const String& sourceString);
-
- [Debugger]
- void scriptExecutionBlockedByCSP(ExecutionContext*, const String& directiveText);
-
- [Resource]
- void didReceiveScriptResponse(ExecutionContext*, unsigned long identifier);
-
- [PageDebugger]
- void didStartProvisionalLoad([Keep] LocalFrame*);
-
- [DOM, Page]
- void domContentLoadedEventFired([Keep] LocalFrame*);
-
- [Page]
- void loadEventFired([Keep] LocalFrame*);
-
- [Page]
- void frameAttachedToParent([Keep] LocalFrame*);
-
- [Page]
- void frameDetachedFromParent([Keep] LocalFrame*);
-
- [Resource, DOM, Page]
- void didCommitLoad([Keep] LocalFrame*, DocumentLoader*);
-
- [DOM, Inline=FastReturn]
- void frameDocumentUpdated([Keep] LocalFrame*);
-
- [Page]
- void frameStartedLoading([Keep] LocalFrame*);
-
- [Page]
- void frameStoppedLoading([Keep] LocalFrame*);
-
- [Page, Resource]
- void frameScheduledNavigation([Keep] LocalFrame*, double delay);
-
- [Page, Resource]
- void frameClearedScheduledNavigation([Keep] LocalFrame*);
-
- [Page, Inline=FastReturn]
- InspectorInstrumentationCookie willRunJavaScriptDialog(LocalFrame*, const String& message, ChromeClient::DialogType dialogType);
-
- [Page, Inline=FastReturn]
- void didRunJavaScriptDialog(const InspectorInstrumentationCookie&, bool result);
-
- [Inline=Forward]
- void removedResourceFromMemoryCache(Resource* cachedResource);
-
- [AsyncCallTracker, DOMDebugger]
- void didRequestAnimationFrame([Keep] ExecutionContext*, int callbackId);
-
- [AsyncCallTracker, DOMDebugger]
- void didCancelAnimationFrame([Keep] ExecutionContext*, int callbackId);
-
- [AsyncCallTracker, DOMDebugger]
- InspectorInstrumentationCookie willFireAnimationFrame([Keep] ExecutionContext*, int callbackId);
-
- [AsyncCallTracker, Inline=FastReturn]
- void didFireAnimationFrame(const InspectorInstrumentationCookie&);
-
- [Worker]
- void didStartWorker(ExecutionContext*, WorkerInspectorProxy* proxy, const KURL& url);
-
- [Worker, PageConsole]
- void workerTerminated(ExecutionContext*, WorkerInspectorProxy* proxy);
-
- [Profiler]
- void willProcessTask(WorkerGlobalScope* context);
-
- [Profiler]
- void didProcessTask(WorkerGlobalScope* context);
-
- [Profiler]
- void willEnterNestedRunLoop(WorkerGlobalScope* context);
-
- [Profiler]
- void didLeaveNestedRunLoop(WorkerGlobalScope* context);
-
- [Resource]
- void didCreateWebSocket([Keep] Document*, unsigned long identifier, const KURL& requestURL, const String& protocol);
-
- [Resource]
- void willSendWebSocketHandshakeRequest([Keep] Document*, unsigned long identifier, const WebSocketHandshakeRequest* request);
-
- [Resource]
- void didReceiveWebSocketHandshakeResponse([Keep] Document*, unsigned long identifier, const WebSocketHandshakeRequest* request, const WebSocketHandshakeResponse* response);
-
- [Resource]
- void didCloseWebSocket([Keep] Document*, unsigned long identifier);
-
- [Resource]
- void didReceiveWebSocketFrame(Document*, unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength);
-
- [Resource]
- void didSendWebSocketFrame(Document*, unsigned long identifier, int opCode, bool masked, const char* payload, size_t payloadLength);
-
- [Resource]
- void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
-
- [ApplicationCache, Inline=FastReturn]
- void networkStateChanged([Keep] LocalFrame*, bool online);
-
- [ApplicationCache, Inline=FastReturn]
- void updateApplicationCacheStatus([Keep] LocalFrame*);
-
- [LayerTree, Inline=FastReturn]
- void layerTreeDidChange(LocalFrame*);
-
- [DOM, Inline=FastReturn]
- void pseudoElementCreated([Keep] PseudoElement*);
-
- [DOM, Inline=FastReturn]
- void pseudoElementDestroyed([Keep] PseudoElement*);
-
- [AsyncCallTracker, Inline=FastReturn]
- int traceAsyncOperationStarting([Keep] ExecutionContext*, const String& operationName);
-
- [AsyncCallTracker, Inline=FastReturn]
- int traceAsyncOperationStarting([Keep] ExecutionContext*, const String& operationName, int prevOperationId);
-
- [AsyncCallTracker, Inline=FastReturn]
- void traceAsyncOperationCompleted([Keep] ExecutionContext*, int operationId);
-
- [AsyncCallTracker, Inline=FastReturn]
- InspectorInstrumentationCookie traceAsyncOperationCompletedCallbackStarting([Keep] ExecutionContext*, int operationId);
-
- [AsyncCallTracker, Inline=FastReturn]
- InspectorInstrumentationCookie traceAsyncCallbackStarting([Keep] ExecutionContext*, int operationId);
-
- [AsyncCallTracker, Inline=FastReturn]
- void traceAsyncCallbackCompleted(const InspectorInstrumentationCookie&);
-
- [Animation, Inline=FastReturn]
- void didCreateAnimation(Document*, unsigned);
-
- [Animation, Inline=FastReturn]
- void animationPlayStateChanged(Document*, Animation*, Animation::AnimationPlayState oldPlayState, Animation::AnimationPlayState newPlayState);
-
- [Page, Inline=FastReturn]
- void windowCreated(LocalFrame* opener, LocalFrame* created);
-}
-
-interface InspectorConsoleInstrumentation {
-
-#include "core/inspector/ScriptArguments.h"
-
-class ConsoleMessage;
-
- [Console]
- void addMessageToConsole(ExecutionContext* context, ConsoleMessage* consoleMessage);
-
- [Profiler, Inline=FastReturn]
- void consoleProfile([Keep] ExecutionContext* context, const String& title);
-
- [Profiler, Inline=FastReturn]
- void consoleProfileEnd(ExecutionContext* context, const String& title);
-
- [Console]
- void consoleMessagesCleared(ExecutionContext* context);
-}
-
-interface InspectorOverrides {
- [CSS, Inline=FastReturn]
- bool forcePseudoState([Keep] Element* element, CSSSelector::PseudoType pseudoState);
-
- [Worker, Inline=FastReturn]
- bool shouldPauseDedicatedWorkerOnStart(ExecutionContext* context);
-
- [Resource, Inline=FastReturn]
- bool shouldForceCORSPreflight(Document*);
-}
diff --git a/core/inspector/InspectorOverlayHost.idl b/core/inspector/InspectorOverlayHost.idl
index c35fdeb..2f1978e 100644
--- a/core/inspector/InspectorOverlayHost.idl
+++ b/core/inspector/InspectorOverlayHost.idl
@@ -29,15 +29,8 @@
*/
[
- WillBeGarbageCollected,
NoInterfaceObject
] interface InspectorOverlayHost {
void resume();
void stepOver();
- void startPropertyChange(DOMString propertyName);
- void changeProperty(float cssDelta);
- void endPropertyChange();
- void clearSelection(boolean commitChanges);
- void nextSelector();
- void previousSelector();
};
diff --git a/core/inspector/PRESUBMIT.py b/core/inspector/PRESUBMIT.py
new file mode 100644
index 0000000..5465d00
--- /dev/null
+++ b/core/inspector/PRESUBMIT.py
@@ -0,0 +1,35 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+def _CompileDevtoolsFrontend(input_api, output_api):
+ # Need to get all affected files from change (not just within this subtree)
+ local_paths = [f.AbsoluteLocalPath() for f in input_api.change.AffectedFiles()]
+ devtools = input_api.os_path.realpath(
+ input_api.os_path.join(input_api.PresubmitLocalPath(), '..', '..', 'devtools'))
+
+ # If a devtools file is changed, the PRESUBMIT hook in Source/devtools
+ # will run closure compiler
+ if (any("browser_protocol.json" in path for path in local_paths) and
+ all(devtools not in path for path in local_paths)):
+ compile_path = input_api.os_path.join(
+ input_api.PresubmitLocalPath(), "..", "..", "devtools", "scripts", "compile_frontend.py")
+ out, _ = input_api.subprocess.Popen(
+ [input_api.python_executable, compile_path], stdout=input_api.subprocess.PIPE,
+ stderr=input_api.subprocess.STDOUT).communicate()
+ if "ERROR" in out or "WARNING" in out:
+ return [output_api.PresubmitError(out)]
+ if "NOTE" in out:
+ return [output_api.PresubmitPromptWarning(out)]
+ return []
+
+
+def CheckChangeOnUpload(input_api, output_api):
+ results = []
+ results.extend(_CompileDevtoolsFrontend(input_api, output_api))
+ return results
+
+
+def CheckChangeOnCommit(input_api, output_api):
+ return []
diff --git a/core/intersection_observer/IntersectionObserver.idl b/core/intersection_observer/IntersectionObserver.idl
new file mode 100644
index 0000000..31773be
--- /dev/null
+++ b/core/intersection_observer/IntersectionObserver.idl
@@ -0,0 +1,26 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/IntersectionObserver/#intersection-observer-callback
+
+callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
+
+// https://wicg.github.io/IntersectionObserver/#intersection-observer-interface
+
+[
+ Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
+ ConstructorCallWith=ScriptState,
+ MeasureAs=IntersectionObserver_Constructor,
+ RaisesException=Constructor,
+ DependentLifetime
+] interface IntersectionObserver {
+ readonly attribute Element? root;
+ readonly attribute DOMString rootMargin;
+ // https://github.com/WICG/IntersectionObserver/issues/114
+ readonly attribute FrozenArray<double> thresholds;
+ [RaisesException] void observe(Element target);
+ [RaisesException] void unobserve(Element target);
+ [RaisesException] void disconnect();
+ [RaisesException] sequence<IntersectionObserverEntry> takeRecords();
+};
diff --git a/core/intersection_observer/IntersectionObserverEntry.idl b/core/intersection_observer/IntersectionObserverEntry.idl
new file mode 100644
index 0000000..fb26cf2
--- /dev/null
+++ b/core/intersection_observer/IntersectionObserverEntry.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/IntersectionObserver/#intersection-observer-entry
+
+interface IntersectionObserverEntry {
+ readonly attribute DOMHighResTimeStamp time;
+ // TODO(szager): |rootBounds| should not be nullable.
+ readonly attribute DOMRectReadOnly? rootBounds;
+ readonly attribute DOMRectReadOnly boundingClientRect;
+ readonly attribute DOMRectReadOnly intersectionRect;
+ readonly attribute boolean isIntersecting;
+ readonly attribute double intersectionRatio;
+ readonly attribute Element target;
+};
diff --git a/core/intersection_observer/IntersectionObserverInit.idl b/core/intersection_observer/IntersectionObserverInit.idl
new file mode 100644
index 0000000..ef0de4a
--- /dev/null
+++ b/core/intersection_observer/IntersectionObserverInit.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/IntersectionObserver/#intersection-observer-init
+
+dictionary IntersectionObserverInit {
+ Element? root = null;
+ DOMString rootMargin = "0px";
+ (double or sequence<double>) threshold = 0;
+};
diff --git a/core/loader/appcache/ApplicationCache.idl b/core/loader/appcache/ApplicationCache.idl
index de2ca5f..1cfcf6f 100644
--- a/core/loader/appcache/ApplicationCache.idl
+++ b/core/loader/appcache/ApplicationCache.idl
@@ -26,9 +26,8 @@
// https://html.spec.whatwg.org/#application-cache-api
[
- DoNotCheckConstants,
- GarbageCollected,
- // TODO(philipj): Exposed=(Window,SharedWorker)
+ DoNotCheckConstants
+ // TODO(foolip): Exposed=(Window,SharedWorker)
] interface ApplicationCache : EventTarget {
// update status
const unsigned short UNCACHED = 0;
diff --git a/core/mojo/Mojo.idl b/core/mojo/Mojo.idl
new file mode 100644
index 0000000..294f0b8
--- /dev/null
+++ b/core/mojo/Mojo.idl
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// IDL for mojo core module. This is not a specced IDL.
+
+typedef unsigned long MojoResult;
+
+enum MojoScope {
+ // Refers to the InterfaceProvider associated with the current execution
+ // context. Either a Document or WorkerGlobalScope.
+ "context",
+ // Refers to the InterfaceProvider of the current process.
+ //
+ // Note: A "process" is not a web concept. In some cases the browser process
+ // concept of a "site instance" may be useful however there is currently no
+ // InterfaceProvider per site instance.
+ "process",
+};
+
+[
+ ContextEnabled=MojoJS,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=MojoJS
+] interface Mojo {
+ const MojoResult RESULT_OK = 0;
+ const MojoResult RESULT_CANCELLED = 1;
+ const MojoResult RESULT_UNKNOWN = 2;
+ const MojoResult RESULT_INVALID_ARGUMENT = 3;
+ const MojoResult RESULT_DEADLINE_EXCEEDED = 4;
+ const MojoResult RESULT_NOT_FOUND = 5;
+ const MojoResult RESULT_ALREADY_EXISTS = 6;
+ const MojoResult RESULT_PERMISSION_DENIED = 7;
+ const MojoResult RESULT_RESOURCE_EXHAUSTED = 8;
+ const MojoResult RESULT_FAILED_PRECONDITION = 9;
+ const MojoResult RESULT_ABORTED = 10;
+ const MojoResult RESULT_OUT_OF_RANGE = 11;
+ const MojoResult RESULT_UNIMPLEMENTED = 12;
+ const MojoResult RESULT_INTERNAL = 13;
+ const MojoResult RESULT_UNAVAILABLE = 14;
+ const MojoResult RESULT_DATA_LOSS = 15;
+ const MojoResult RESULT_BUSY = 16;
+ const MojoResult RESULT_SHOULD_WAIT = 17;
+
+ static MojoCreateMessagePipeResult createMessagePipe();
+ static MojoCreateDataPipeResult createDataPipe(MojoCreateDataPipeOptions options);
+ static MojoCreateSharedBufferResult createSharedBuffer(unsigned long numBytes);
+
+ [CallWith=ScriptState] static void bindInterface(DOMString interfaceName, MojoHandle request_handle, optional MojoScope scope = "context");
+};
diff --git a/core/mojo/MojoCreateDataPipeOptions.idl b/core/mojo/MojoCreateDataPipeOptions.idl
new file mode 100644
index 0000000..0fba87a
--- /dev/null
+++ b/core/mojo/MojoCreateDataPipeOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2017 The Chromium 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 MojoCreateDataPipeOptions {
+ unsigned long elementNumBytes;
+ unsigned long capacityNumBytes;
+};
diff --git a/core/mojo/MojoCreateDataPipeResult.idl b/core/mojo/MojoCreateDataPipeResult.idl
new file mode 100644
index 0000000..5066767
--- /dev/null
+++ b/core/mojo/MojoCreateDataPipeResult.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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 MojoCreateDataPipeResult {
+ required MojoResult result;
+ MojoHandle producer;
+ MojoHandle consumer;
+};
diff --git a/core/mojo/MojoCreateMessagePipeResult.idl b/core/mojo/MojoCreateMessagePipeResult.idl
new file mode 100644
index 0000000..eb2d1b0
--- /dev/null
+++ b/core/mojo/MojoCreateMessagePipeResult.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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 MojoCreateMessagePipeResult {
+ // TODO(alokp): Consider raising exception for error.
+ required MojoResult result;
+ MojoHandle handle0;
+ MojoHandle handle1;
+};
diff --git a/core/mojo/MojoCreateSharedBufferResult.idl b/core/mojo/MojoCreateSharedBufferResult.idl
new file mode 100644
index 0000000..336eda2
--- /dev/null
+++ b/core/mojo/MojoCreateSharedBufferResult.idl
@@ -0,0 +1,8 @@
+// Copyright 2017 The Chromium 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 MojoCreateSharedBufferResult {
+ required MojoResult result;
+ MojoHandle handle;
+};
diff --git a/core/mojo/MojoDiscardDataOptions.idl b/core/mojo/MojoDiscardDataOptions.idl
new file mode 100644
index 0000000..87a62f8
--- /dev/null
+++ b/core/mojo/MojoDiscardDataOptions.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium 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 MojoDiscardDataOptions {
+ boolean allOrNone = false;
+};
diff --git a/core/mojo/MojoDuplicateBufferHandleOptions.idl b/core/mojo/MojoDuplicateBufferHandleOptions.idl
new file mode 100644
index 0000000..4faf0fd
--- /dev/null
+++ b/core/mojo/MojoDuplicateBufferHandleOptions.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium 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 MojoDuplicateBufferHandleOptions {
+ boolean readOnly = false;
+};
diff --git a/core/mojo/MojoHandle.idl b/core/mojo/MojoHandle.idl
new file mode 100644
index 0000000..4fe2ab2
--- /dev/null
+++ b/core/mojo/MojoHandle.idl
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+callback MojoWatchCallback = void (MojoResult result);
+
+[
+ ContextEnabled=MojoJS,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=MojoJS
+] interface MojoHandle {
+ void close();
+ [CallWith=ScriptState] MojoWatcher watch(MojoHandleSignals signals, MojoWatchCallback callback);
+
+ // TODO(alokp): Create MojoMessagePipeHandle, a subclass of MojoHandle
+ // and move the following member functions.
+ MojoResult writeMessage(BufferSource buffer, sequence<MojoHandle> handles);
+ MojoReadMessageResult readMessage(optional MojoReadMessageFlags flags);
+
+ // TODO(alokp): Create MojoDataPipeProducerHandle and MojoDataPipeConsumerHandle,
+ // subclasses of MojoHandle and move the following member functions.
+ MojoWriteDataResult writeData(BufferSource buffer, optional MojoWriteDataOptions options);
+ MojoReadDataResult queryData();
+ MojoReadDataResult discardData(unsigned long numBytes, optional MojoDiscardDataOptions options);
+ MojoReadDataResult readData(BufferSource buffer, optional MojoReadDataOptions options);
+
+ // TODO(alokp): Create MojoSharedBufferHandle, a subclass of MojoHandle
+ // and move the following member functions.
+ MojoMapBufferResult mapBuffer(unsigned long offset, unsigned long numBytes);
+ MojoCreateSharedBufferResult duplicateBufferHandle(optional MojoDuplicateBufferHandleOptions options);
+};
diff --git a/core/mojo/MojoHandleSignals.idl b/core/mojo/MojoHandleSignals.idl
new file mode 100644
index 0000000..fe0f02d
--- /dev/null
+++ b/core/mojo/MojoHandleSignals.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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 MojoHandleSignals {
+ boolean readable = false;
+ boolean writable = false;
+ boolean peerClosed = false;
+};
diff --git a/core/mojo/MojoMapBufferResult.idl b/core/mojo/MojoMapBufferResult.idl
new file mode 100644
index 0000000..83f4757
--- /dev/null
+++ b/core/mojo/MojoMapBufferResult.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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 MojoMapBufferResult {
+ required MojoResult result;
+
+ // TODO(alokp): Consider wrapping the buffer into a MojoSharedBufferMapping
+ // that would expose an unmap method to free the shared buffer eagerly
+ // rather than waiting for GC. This would be similar to ImageBitmap.close
+ // that disposes of graphical resources.
+ ArrayBuffer buffer;
+};
diff --git a/core/mojo/MojoReadDataOptions.idl b/core/mojo/MojoReadDataOptions.idl
new file mode 100644
index 0000000..b0f027d
--- /dev/null
+++ b/core/mojo/MojoReadDataOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2017 The Chromium 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 MojoReadDataOptions {
+ boolean allOrNone = false;
+ boolean peek = false;
+};
diff --git a/core/mojo/MojoReadDataResult.idl b/core/mojo/MojoReadDataResult.idl
new file mode 100644
index 0000000..e3150c5
--- /dev/null
+++ b/core/mojo/MojoReadDataResult.idl
@@ -0,0 +1,8 @@
+// Copyright 2017 The Chromium 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 MojoReadDataResult {
+ required MojoResult result;
+ required unsigned long numBytes;
+};
diff --git a/core/mojo/MojoReadMessageFlags.idl b/core/mojo/MojoReadMessageFlags.idl
new file mode 100644
index 0000000..3ab6e77
--- /dev/null
+++ b/core/mojo/MojoReadMessageFlags.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium 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 MojoReadMessageFlags {
+ boolean mayDiscard = false;
+};
diff --git a/core/mojo/MojoReadMessageResult.idl b/core/mojo/MojoReadMessageResult.idl
new file mode 100644
index 0000000..f08503c
--- /dev/null
+++ b/core/mojo/MojoReadMessageResult.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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 MojoReadMessageResult {
+ // TODO(alokp): Consider raising exception for read error.
+ required MojoResult result;
+
+ // TODO(alokp): Check if returning DataView makes sense.
+ // It would require some changes in mojo/js/public/[buffer,codec].js.
+ ArrayBuffer buffer;
+
+ sequence<MojoHandle> handles;
+};
diff --git a/core/mojo/MojoWatcher.idl b/core/mojo/MojoWatcher.idl
new file mode 100644
index 0000000..1b370a8
--- /dev/null
+++ b/core/mojo/MojoWatcher.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Exposed=(Window,Worker),
+ ContextEnabled=MojoJS,
+ RuntimeEnabled=MojoJS
+] interface MojoWatcher {
+ MojoResult cancel();
+};
diff --git a/core/mojo/MojoWriteDataOptions.idl b/core/mojo/MojoWriteDataOptions.idl
new file mode 100644
index 0000000..67fa570
--- /dev/null
+++ b/core/mojo/MojoWriteDataOptions.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium 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 MojoWriteDataOptions {
+ boolean allOrNone = false;
+};
diff --git a/core/mojo/MojoWriteDataResult.idl b/core/mojo/MojoWriteDataResult.idl
new file mode 100644
index 0000000..89916a1
--- /dev/null
+++ b/core/mojo/MojoWriteDataResult.idl
@@ -0,0 +1,8 @@
+// Copyright 2017 The Chromium 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 MojoWriteDataResult {
+ required MojoResult result;
+ required unsigned long numBytes;
+};
diff --git a/core/mojo/test/MojoInterfaceInterceptor.idl b/core/mojo/test/MojoInterfaceInterceptor.idl
new file mode 100644
index 0000000..b5456b9
--- /dev/null
+++ b/core/mojo/test/MojoInterfaceInterceptor.idl
@@ -0,0 +1,19 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ ActiveScriptWrappable,
+ Constructor(DOMString interfaceName, optional MojoScope scope = "context"),
+ ConstructorCallWith=ExecutionContext,
+ DependentLifetime,
+ Exposed=(Window,Worker),
+ RaisesException=Constructor,
+ ContextEnabled=MojoJSTest,
+ RuntimeEnabled=MojoJSTest
+] interface MojoInterfaceInterceptor : EventTarget {
+ [RaisesException] void start();
+ void stop();
+
+ attribute EventHandler oninterfacerequest;
+};
diff --git a/core/mojo/test/MojoInterfaceRequestEvent.idl b/core/mojo/test/MojoInterfaceRequestEvent.idl
new file mode 100644
index 0000000..21a5a2d
--- /dev/null
+++ b/core/mojo/test/MojoInterfaceRequestEvent.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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 MojoInterfaceRequestEventInit eventInitDict),
+ Exposed=(Window,Worker),
+ ContextEnabled=MojoJSTest,
+ RuntimeEnabled=MojoJSTest
+] interface MojoInterfaceRequestEvent : Event {
+ readonly attribute MojoHandle handle;
+};
diff --git a/core/mojo/test/MojoInterfaceRequestEventInit.idl b/core/mojo/test/MojoInterfaceRequestEventInit.idl
new file mode 100644
index 0000000..3eaf1da
--- /dev/null
+++ b/core/mojo/test/MojoInterfaceRequestEventInit.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium 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 MojoInterfaceRequestEventInit : EventInit {
+ MojoHandle handle;
+};
diff --git a/core/offscreencanvas/ImageEncodeOptions.idl b/core/offscreencanvas/ImageEncodeOptions.idl
new file mode 100644
index 0000000..338adc7
--- /dev/null
+++ b/core/offscreencanvas/ImageEncodeOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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/scripting.html#the-offscreencanvas-interface
+
+dictionary ImageEncodeOptions {
+ DOMString type = "image/png";
+ unrestricted double quality = 1.0; // Defaults to 1.0 if value is outside 0:1 range
+};
diff --git a/core/offscreencanvas/OffscreenCanvas.idl b/core/offscreencanvas/OffscreenCanvas.idl
new file mode 100644
index 0000000..a290546
--- /dev/null
+++ b/core/offscreencanvas/OffscreenCanvas.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://html.spec.whatwg.org/multipage/scripting.html#the-offscreencanvas-interface
+
+[
+ Constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height),
+ Exposed=(Window,Worker),
+ RuntimeEnabled=ExperimentalCanvasFeatures,
+ MeasureAs=OffscreenCanvas
+] interface OffscreenCanvas : EventTarget {
+ [EnforceRange] attribute unsigned long width;
+ [EnforceRange] attribute unsigned long height;
+
+ [CallWith=ScriptState, RaisesException] ImageBitmap transferToImageBitmap();
+ [MeasureAs=OffscreenCanvasConvertToBlob, RaisesException, CallWith=ScriptState] Promise<Blob> convertToBlob(optional ImageEncodeOptions options);
+};
diff --git a/core/origin_trials/testing/InternalsFrobulate.idl b/core/origin_trials/testing/InternalsFrobulate.idl
deleted file mode 100644
index 7c8c5cb..0000000
--- a/core/origin_trials/testing/InternalsFrobulate.idl
+++ /dev/null
@@ -1,9 +0,0 @@
-// 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 {
- [CallWith=ScriptState, RaisesException] readonly attribute boolean frobulate;
- readonly attribute boolean frobulateNoEnabledCheck;
-};
-
diff --git a/core/page/EventSource.idl b/core/page/EventSource.idl
deleted file mode 100644
index 05abf39..0000000
--- a/core/page/EventSource.idl
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2009 Ericsson AB. All rights reserved.
- * Copyright (C) 2010, 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.
- * 3. Neither the name of Ericsson 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://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface
-
-[
- DependentLifetime,
- Constructor(DOMString url, optional EventSourceInit eventSourceInitDict),
- ConstructorCallWith=ExecutionContext,
- Exposed=(Window,Worker),
- GarbageCollected,
- RaisesException=Constructor,
-] interface EventSource : EventTarget {
- readonly attribute DOMString url;
- readonly attribute boolean withCredentials;
-
- // ready state
- const unsigned short CONNECTING = 0;
- const unsigned short OPEN = 1;
- const unsigned short CLOSED = 2;
- readonly attribute unsigned short readyState;
-
- // networking
- attribute EventHandler onopen;
- attribute EventHandler onmessage;
- attribute EventHandler onerror;
- void close();
-};
diff --git a/core/page/PagePopupController.idl b/core/page/PagePopupController.idl
index f32cc46..26668d7 100644
--- a/core/page/PagePopupController.idl
+++ b/core/page/PagePopupController.idl
@@ -28,8 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// PagePopupController provides functions used by form control popup
+// implementations, and it's not exposed to the Web. WebPagePopupImpl class
+// enables this interface by provideContextFeaturesTo().
[
- WillBeGarbageCollected,
NoInterfaceObject,
RuntimeEnabled=PagePopup
] interface PagePopupController {
diff --git a/core/page/scrolling/ScrollState.idl b/core/page/scrolling/ScrollState.idl
index 7e5ff50..e1a9006 100644
--- a/core/page/scrolling/ScrollState.idl
+++ b/core/page/scrolling/ScrollState.idl
@@ -6,20 +6,18 @@
[
Constructor(optional ScrollStateInit scrollStateInit),
- WillBeGarbageCollected,
- RuntimeEnabled = ScrollCustomization,
+ RuntimeEnabled = ScrollCustomization
] interface ScrollState
{
readonly attribute double deltaX;
readonly attribute double deltaY;
- readonly attribute long startPositionX;
- readonly attribute long startPositionY;
+ readonly attribute long positionX;
+ readonly attribute long positionY;
readonly attribute double velocityX;
readonly attribute double velocityY;
readonly attribute boolean isBeginning;
readonly attribute boolean inInertialPhase;
readonly attribute boolean isEnding;
- readonly attribute boolean shouldPropagate;
readonly attribute boolean fromUserInput;
readonly attribute boolean isDirectManipulation;
readonly attribute double deltaGranularity;
diff --git a/core/page/scrolling/ScrollStateInit.idl b/core/page/scrolling/ScrollStateInit.idl
index d7aa140..d2be156 100644
--- a/core/page/scrolling/ScrollStateInit.idl
+++ b/core/page/scrolling/ScrollStateInit.idl
@@ -7,8 +7,10 @@
dictionary ScrollStateInit {
double deltaX = 0;
double deltaY = 0;
- long startPositionX = 0;
- long startPositionY = 0;
+ double deltaXHint = 0;
+ double deltaYHint = 0;
+ long positionX = 0;
+ long positionY = 0;
double velocityX = 0;
double velocityY = 0;
boolean isBeginning = false;
diff --git a/core/resize_observer/ResizeObserver.idl b/core/resize_observer/ResizeObserver.idl
new file mode 100644
index 0000000..a8554d2
--- /dev/null
+++ b/core/resize_observer/ResizeObserver.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/ResizeObserver/#resize-observer-callback
+
+callback ResizeObserverCallback = void (sequence<ResizeObserverEntry> entries, ResizeObserver observer);
+
+// https://wicg.github.io/ResizeObserver/#resize-observer-interface
+
+[
+ Constructor(ResizeObserverCallback callback),
+ ConstructorCallWith=Document,
+ RuntimeEnabled=ResizeObserver
+] interface ResizeObserver {
+ void observe(Element target);
+ void unobserve(Element target);
+ void disconnect();
+};
diff --git a/core/resize_observer/ResizeObserverEntry.idl b/core/resize_observer/ResizeObserverEntry.idl
new file mode 100644
index 0000000..29e5d96
--- /dev/null
+++ b/core/resize_observer/ResizeObserverEntry.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/ResizeObserver/#resize-observer-entry-interface
+
+[
+ RuntimeEnabled=ResizeObserver
+] interface ResizeObserverEntry {
+ readonly attribute Element target;
+ readonly attribute DOMRectReadOnly contentRect;
+};
diff --git a/core/streams/ReadableByteStream.idl b/core/streams/ReadableByteStream.idl
deleted file mode 100644
index d881c27..0000000
--- a/core/streams/ReadableByteStream.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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
deleted file mode 100644
index c7c1996..0000000
--- a/core/streams/ReadableByteStreamReader.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-// 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/ReadableStreamReader.idl b/core/streams/ReadableStreamReader.idl
deleted file mode 100644
index b3419cd..0000000
--- a/core/streams/ReadableStreamReader.idl
+++ /dev/null
@@ -1,18 +0,0 @@
-// 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,
- DependentLifetime,
- 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
deleted file mode 100644
index 1d3128f..0000000
--- a/core/streams/Stream.idl
+++ /dev/null
@@ -1,45 +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.
- */
-
-// FIXME: close() method which is necessary for Stream building feature
-// is omitted for now. Add it when necessary.
-//
-// FIXME: Add a flag to indicate if this stream frees memory when read or not
-// (e.g. boolean isReadOnce()).
-//
-// FIXME: Make the Blob a subclass of the Stream.
-
-[
- RuntimeEnabled=ExperimentalStream,
- DependentLifetime,
- GarbageCollected
-] interface Stream {
- readonly attribute DOMString type;
-};
diff --git a/core/streams/UnderlyingSourceBase.idl b/core/streams/UnderlyingSourceBase.idl
index 0c0486f..8e7b4ef 100644
--- a/core/streams/UnderlyingSourceBase.idl
+++ b/core/streams/UnderlyingSourceBase.idl
@@ -7,9 +7,16 @@
// UnderlyingSourceBase, and a JavaScript object can then be generated
// automatically for use in initializing a ReadableStream.
-[NoInterfaceObject, GarbageCollected, DependentLifetime]
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ NoInterfaceObject
+]
interface UnderlyingSourceBase {
[CallWith=ScriptState, ImplementedAs=startWrapper] Promise<void> start(any stream);
[CallWith=ScriptState] Promise<void> pull();
[CallWith=ScriptState, ImplementedAs=cancelWrapper] Promise<void> cancel([Default=Undefined] optional any reason);
+
+ void notifyLockAcquired();
+ void notifyLockReleased();
};
diff --git a/core/svg/SVGAElement.idl b/core/svg/SVGAElement.idl
index 15d5148..c8a8956 100644
--- a/core/svg/SVGAElement.idl
+++ b/core/svg/SVGAElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/linking.html#InterfaceSVGAElement
+// https://svgwg.org/svg2-draft/linking.html#InterfaceSVGAElement
interface SVGAElement : SVGGraphicsElement {
[ImplementedAs=svgTarget, Measure] readonly attribute SVGAnimatedString target;
diff --git a/core/svg/SVGAngle.idl b/core/svg/SVGAngle.idl
index 64aa811..95bcda1 100644
--- a/core/svg/SVGAngle.idl
+++ b/core/svg/SVGAngle.idl
@@ -20,12 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAngle
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAngle
[
- ImplementedAs=SVGAngleTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGAngleTearOff
] interface SVGAngle {
// Angle Unit Types
const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGAnimateElement.idl b/core/svg/SVGAnimateElement.idl
index 01eea93..1579217 100644
--- a/core/svg/SVGAnimateElement.idl
+++ b/core/svg/SVGAnimateElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimateElement
+// https://svgwg.org/specs/animations/#InterfaceSVGAnimateElement
interface SVGAnimateElement : SVGAnimationElement {
};
diff --git a/core/svg/SVGAnimateMotionElement.idl b/core/svg/SVGAnimateMotionElement.idl
index bba3d50..1b5b3ca 100644
--- a/core/svg/SVGAnimateMotionElement.idl
+++ b/core/svg/SVGAnimateMotionElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimateMotionElement
+// https://svgwg.org/specs/animations/#InterfaceSVGAnimateMotionElement
interface SVGAnimateMotionElement : SVGAnimationElement {
};
diff --git a/core/svg/SVGAnimateTransformElement.idl b/core/svg/SVGAnimateTransformElement.idl
index 0d98368..fe64235 100644
--- a/core/svg/SVGAnimateTransformElement.idl
+++ b/core/svg/SVGAnimateTransformElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimateTransformElement
+// https://svgwg.org/specs/animations/#InterfaceSVGAnimateTransformElement
interface SVGAnimateTransformElement : SVGAnimationElement {
};
diff --git a/core/svg/SVGAnimatedAngle.idl b/core/svg/SVGAnimatedAngle.idl
index 4bd5848..a69b631 100644
--- a/core/svg/SVGAnimatedAngle.idl
+++ b/core/svg/SVGAnimatedAngle.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedAngle
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedAngle
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedAngle {
readonly attribute SVGAngle baseVal;
readonly attribute SVGAngle animVal;
diff --git a/core/svg/SVGAnimatedBoolean.idl b/core/svg/SVGAnimatedBoolean.idl
index 531af6a..4ec6bab 100644
--- a/core/svg/SVGAnimatedBoolean.idl
+++ b/core/svg/SVGAnimatedBoolean.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedBoolean
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedBoolean
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedBoolean {
[RaisesException=Setter] attribute boolean baseVal;
readonly attribute boolean animVal;
diff --git a/core/svg/SVGAnimatedEnumeration.idl b/core/svg/SVGAnimatedEnumeration.idl
index 830f2c9..1766bc7 100644
--- a/core/svg/SVGAnimatedEnumeration.idl
+++ b/core/svg/SVGAnimatedEnumeration.idl
@@ -23,12 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedEnumeration
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedEnumeration
[
- ImplementedAs=SVGAnimatedEnumerationBase,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGAnimatedEnumerationBase
] 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 78520f6..505d444 100644
--- a/core/svg/SVGAnimatedInteger.idl
+++ b/core/svg/SVGAnimatedInteger.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedInteger
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedInteger
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedInteger {
[RaisesException=Setter] attribute long baseVal;
readonly attribute long animVal;
diff --git a/core/svg/SVGAnimatedLength.idl b/core/svg/SVGAnimatedLength.idl
index 3fbc245..3da68c9 100644
--- a/core/svg/SVGAnimatedLength.idl
+++ b/core/svg/SVGAnimatedLength.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedLength
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedLength
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedLength {
readonly attribute SVGLength baseVal;
readonly attribute SVGLength animVal;
diff --git a/core/svg/SVGAnimatedLengthList.idl b/core/svg/SVGAnimatedLengthList.idl
index 2f79e7f..eeef1ad 100644
--- a/core/svg/SVGAnimatedLengthList.idl
+++ b/core/svg/SVGAnimatedLengthList.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedLengthList
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedLengthList
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedLengthList {
readonly attribute SVGLengthList baseVal;
readonly attribute SVGLengthList animVal;
diff --git a/core/svg/SVGAnimatedNumber.idl b/core/svg/SVGAnimatedNumber.idl
index 9f228b4..ddc7fab 100644
--- a/core/svg/SVGAnimatedNumber.idl
+++ b/core/svg/SVGAnimatedNumber.idl
@@ -24,11 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedNumber
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedNumber
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedNumber {
[RaisesException=Setter] attribute float baseVal;
readonly attribute float animVal;
diff --git a/core/svg/SVGAnimatedNumberList.idl b/core/svg/SVGAnimatedNumberList.idl
index c38f5cd..c1c49de 100644
--- a/core/svg/SVGAnimatedNumberList.idl
+++ b/core/svg/SVGAnimatedNumberList.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedNumberList
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedNumberList
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedNumberList {
readonly attribute SVGNumberList baseVal;
readonly attribute SVGNumberList animVal;
diff --git a/core/svg/SVGAnimatedPreserveAspectRatio.idl b/core/svg/SVGAnimatedPreserveAspectRatio.idl
index e4b4a93..a943f6d 100644
--- a/core/svg/SVGAnimatedPreserveAspectRatio.idl
+++ b/core/svg/SVGAnimatedPreserveAspectRatio.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGAnimatedPreserveAspectRatio
+// https://svgwg.org/svg2-draft/coords.html#InterfaceSVGAnimatedPreserveAspectRatio
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedPreserveAspectRatio {
readonly attribute SVGPreserveAspectRatio baseVal;
readonly attribute SVGPreserveAspectRatio animVal;
diff --git a/core/svg/SVGAnimatedRect.idl b/core/svg/SVGAnimatedRect.idl
index d020f95..9bbbcc7 100644
--- a/core/svg/SVGAnimatedRect.idl
+++ b/core/svg/SVGAnimatedRect.idl
@@ -23,13 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedRect
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedRect
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedRect {
- // TODO(philipj): SVGRect should be DOMRectReadOnly.
+ // TODO(foolip): 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 e881925..2bbc8e7 100644
--- a/core/svg/SVGAnimatedString.idl
+++ b/core/svg/SVGAnimatedString.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedString
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedString
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedString {
[RaisesException=Setter] attribute DOMString baseVal;
readonly attribute DOMString animVal;
diff --git a/core/svg/SVGAnimatedTransformList.idl b/core/svg/SVGAnimatedTransformList.idl
index fca3d24..9e58b14 100644
--- a/core/svg/SVGAnimatedTransformList.idl
+++ b/core/svg/SVGAnimatedTransformList.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGAnimatedTransformList
+// https://svgwg.org/svg2-draft/coords.html#InterfaceSVGAnimatedTransformList
[
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime
] interface SVGAnimatedTransformList {
[MeasureAs=SVGAnimatedTransformListBaseVal] readonly attribute SVGTransformList baseVal;
readonly attribute SVGTransformList animVal;
diff --git a/core/svg/SVGAnimationElement.idl b/core/svg/SVGAnimationElement.idl
index d20ae51..0eaf56f 100644
--- a/core/svg/SVGAnimationElement.idl
+++ b/core/svg/SVGAnimationElement.idl
@@ -24,9 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGAnimationElement
+// https://svgwg.org/specs/animations/#InterfaceSVGAnimationElement
-[RuntimeEnabled=smil]
+[RuntimeEnabled=SMIL]
interface SVGAnimationElement : SVGElement {
readonly attribute SVGElement targetElement;
@@ -34,14 +34,14 @@
attribute EventHandler onend;
attribute EventHandler onrepeat;
- [RaisesException] float getStartTime();
- float getCurrentTime();
- [RaisesException] float getSimpleDuration();
+ [MeasureAs=SVGSMILAnimationElementTiming, RaisesException] float getStartTime();
+ [MeasureAs=SVGSMILAnimationElementTiming] float getCurrentTime();
+ [MeasureAs=SVGSMILAnimationElementTiming, RaisesException] float getSimpleDuration();
- void beginElement();
- void beginElementAt(float offset);
- void endElement();
- void endElementAt(float offset);
+ [MeasureAs=SVGSMILBeginEndAnimationElement] void beginElement();
+ [MeasureAs=SVGSMILBeginEndAnimationElement] void beginElementAt(float offset);
+ [MeasureAs=SVGSMILBeginEndAnimationElement] void endElement();
+ [MeasureAs=SVGSMILBeginEndAnimationElement] void endElementAt(float offset);
};
SVGAnimationElement implements SVGTests;
diff --git a/core/svg/SVGCircleElement.idl b/core/svg/SVGCircleElement.idl
index 00a32e7..76f2a42 100644
--- a/core/svg/SVGCircleElement.idl
+++ b/core/svg/SVGCircleElement.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGCircleElement
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGCircleElement
interface SVGCircleElement : SVGGeometryElement {
[MeasureAs=SVG1DOMShape] readonly attribute SVGAnimatedLength cx;
diff --git a/core/svg/SVGClipPathElement.idl b/core/svg/SVGClipPathElement.idl
index 543feac..de70efd 100644
--- a/core/svg/SVGClipPathElement.idl
+++ b/core/svg/SVGClipPathElement.idl
@@ -24,9 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/css-masking/#InterfaceSVGClipPathElement
+// https://drafts.fxtf.org/css-masking-1/#InterfaceSVGClipPathElement
-// TODO(philipj): SVGClipPathElement should inherit from SVGElement and
+// TODO(foolip): SVGClipPathElement should inherit from SVGElement and
// implement SVGUnitTypes. The transform attribute (which is on
// SVGGraphicsElement) should also be on SVGClipPathElement.
interface SVGClipPathElement : SVGGraphicsElement {
diff --git a/core/svg/SVGComponentTransferFunctionElement.idl b/core/svg/SVGComponentTransferFunctionElement.idl
index 8fe18b0..b51e23b 100644
--- a/core/svg/SVGComponentTransferFunctionElement.idl
+++ b/core/svg/SVGComponentTransferFunctionElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGComponentTransferFunctionElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGComponentTransferFunctionElement
[
DoNotCheckConstants
diff --git a/core/svg/SVGCursorElement.idl b/core/svg/SVGCursorElement.idl
deleted file mode 100644
index d61be40..0000000
--- a/core/svg/SVGCursorElement.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.
- */
-
-// http://www.w3.org/TR/SVG2/interact.html#InterfaceSVGCursorElement
-
-interface SVGCursorElement : SVGElement {
- [MeasureAs=SVG1DOMCursorElement] readonly attribute SVGAnimatedLength x;
- [MeasureAs=SVG1DOMCursorElement] readonly attribute SVGAnimatedLength y;
-};
-
-SVGCursorElement implements SVGURIReference;
-
-// 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 43fe927..ba525a6 100644
--- a/core/svg/SVGDefsElement.idl
+++ b/core/svg/SVGDefsElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGDefsElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGDefsElement
interface SVGDefsElement : SVGGraphicsElement {
};
diff --git a/core/svg/SVGDescElement.idl b/core/svg/SVGDescElement.idl
index 6ee5bed..68ed11d 100644
--- a/core/svg/SVGDescElement.idl
+++ b/core/svg/SVGDescElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGDescElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGDescElement
interface SVGDescElement : SVGElement {
};
diff --git a/core/svg/SVGDiscardElement.idl b/core/svg/SVGDiscardElement.idl
index 72b8939..a6db8fa 100644
--- a/core/svg/SVGDiscardElement.idl
+++ b/core/svg/SVGDiscardElement.idl
@@ -28,9 +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
+// https://svgwg.org/specs/animations/#InterfaceSVGDiscardElement
-[RuntimeEnabled=smil]
+[RuntimeEnabled=SMIL]
interface SVGDiscardElement : SVGElement {
};
diff --git a/core/svg/SVGDocument.idl b/core/svg/SVGDocument.idl
index 8ba643a..dd1a4ac 100644
--- a/core/svg/SVGDocument.idl
+++ b/core/svg/SVGDocument.idl
@@ -19,7 +19,7 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGDocument
+// https://svgwg.org/svg2-draft/struct.html#InterfaceDocumentExtensions
[
ImplementedAs=SVGDocumentExtensions
diff --git a/core/svg/SVGElement.idl b/core/svg/SVGElement.idl
index d8faebb..2e01c8b 100644
--- a/core/svg/SVGElement.idl
+++ b/core/svg/SVGElement.idl
@@ -20,12 +20,13 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement
interface SVGElement : Element {
[MeasureAs=SVGClassName] readonly attribute SVGAnimatedString className;
+ [SameObject, PerWorldBindings] readonly attribute DOMStringMap dataset;
// CSS Object Model (CSSOM)
- // http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface
+ // https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
readonly attribute SVGSVGElement? ownerSVGElement;
@@ -36,3 +37,4 @@
};
SVGElement implements GlobalEventHandlers;
+SVGElement implements NoncedElement;
diff --git a/core/svg/SVGEllipseElement.idl b/core/svg/SVGEllipseElement.idl
index 08750c6..546f532 100644
--- a/core/svg/SVGEllipseElement.idl
+++ b/core/svg/SVGEllipseElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGEllipseElement
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGEllipseElement
interface SVGEllipseElement : SVGGeometryElement {
[MeasureAs=SVG1DOMShape] readonly attribute SVGAnimatedLength cx;
diff --git a/core/svg/SVGFEBlendElement.idl b/core/svg/SVGFEBlendElement.idl
index 4b9ffe4..9141ef7 100644
--- a/core/svg/SVGFEBlendElement.idl
+++ b/core/svg/SVGFEBlendElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEBlendElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEBlendElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFEBlendElement : SVGElement {
// Blend Mode Types
diff --git a/core/svg/SVGFEColorMatrixElement.idl b/core/svg/SVGFEColorMatrixElement.idl
index d5fd90c..45efacc 100644
--- a/core/svg/SVGFEColorMatrixElement.idl
+++ b/core/svg/SVGFEColorMatrixElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEColorMatrixElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEColorMatrixElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFEColorMatrixElement : SVGElement {
// Color Matrix Types
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGFEComponentTransferElement.idl b/core/svg/SVGFEComponentTransferElement.idl
index 8eda50f..dbc0da2 100644
--- a/core/svg/SVGFEComponentTransferElement.idl
+++ b/core/svg/SVGFEComponentTransferElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEComponentTransferElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEComponentTransferElement
interface SVGFEComponentTransferElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFECompositeElement.idl b/core/svg/SVGFECompositeElement.idl
index 7f1fb25..5ff09bc 100644
--- a/core/svg/SVGFECompositeElement.idl
+++ b/core/svg/SVGFECompositeElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFECompositeElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFECompositeElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFECompositeElement : SVGElement {
// Composite Operators
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
diff --git a/core/svg/SVGFEConvolveMatrixElement.idl b/core/svg/SVGFEConvolveMatrixElement.idl
index 0c9edfd..c0411ad 100644
--- a/core/svg/SVGFEConvolveMatrixElement.idl
+++ b/core/svg/SVGFEConvolveMatrixElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEConvolveMatrixElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEConvolveMatrixElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFEConvolveMatrixElement : SVGElement {
// Edge Mode Values
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
@@ -46,9 +46,9 @@
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
- // TODO(philipj): The following was part of SVG 1.1:
+ // TODO(foolip): The following was part of SVG 1.1. https://crbug.com/695977
// http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFEConvolveMatrixElement
- // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28703
+ // https://github.com/w3c/fxtf-drafts/issues/114
[Measure] readonly attribute SVGAnimatedBoolean preserveAlpha;
};
diff --git a/core/svg/SVGFEDiffuseLightingElement.idl b/core/svg/SVGFEDiffuseLightingElement.idl
index aa6d9f4..c1ad350 100644
--- a/core/svg/SVGFEDiffuseLightingElement.idl
+++ b/core/svg/SVGFEDiffuseLightingElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDiffuseLightingElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEDiffuseLightingElement
interface SVGFEDiffuseLightingElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFEDisplacementMapElement.idl b/core/svg/SVGFEDisplacementMapElement.idl
index 9b70e29..90f5145 100644
--- a/core/svg/SVGFEDisplacementMapElement.idl
+++ b/core/svg/SVGFEDisplacementMapElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDisplacementMapElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEDisplacementMapElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFEDisplacementMapElement : SVGElement {
// Channel Selectors
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_CHANNEL_UNKNOWN = 0;
diff --git a/core/svg/SVGFEDistantLightElement.idl b/core/svg/SVGFEDistantLightElement.idl
index a5c6979..1594292 100644
--- a/core/svg/SVGFEDistantLightElement.idl
+++ b/core/svg/SVGFEDistantLightElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDistantLightElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEDistantLightElement
interface SVGFEDistantLightElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber azimuth;
diff --git a/core/svg/SVGFEDropShadowElement.idl b/core/svg/SVGFEDropShadowElement.idl
index 47d742f..d6aa10e 100644
--- a/core/svg/SVGFEDropShadowElement.idl
+++ b/core/svg/SVGFEDropShadowElement.idl
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEDropShadowElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEDropShadowElement
interface SVGFEDropShadowElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFEFloodElement.idl b/core/svg/SVGFEFloodElement.idl
index e586c72..125c8c8 100644
--- a/core/svg/SVGFEFloodElement.idl
+++ b/core/svg/SVGFEFloodElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFloodElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEFloodElement
interface SVGFEFloodElement : SVGElement {
};
diff --git a/core/svg/SVGFEFuncAElement.idl b/core/svg/SVGFEFuncAElement.idl
index 2a886fd..8cf23db 100644
--- a/core/svg/SVGFEFuncAElement.idl
+++ b/core/svg/SVGFEFuncAElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncAElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEFuncAElement
interface SVGFEFuncAElement : SVGComponentTransferFunctionElement {
};
diff --git a/core/svg/SVGFEFuncBElement.idl b/core/svg/SVGFEFuncBElement.idl
index 0ac1240..f281afe 100644
--- a/core/svg/SVGFEFuncBElement.idl
+++ b/core/svg/SVGFEFuncBElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncBElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEFuncBElement
interface SVGFEFuncBElement : SVGComponentTransferFunctionElement {
};
diff --git a/core/svg/SVGFEFuncGElement.idl b/core/svg/SVGFEFuncGElement.idl
index 7d21395..91e0155 100644
--- a/core/svg/SVGFEFuncGElement.idl
+++ b/core/svg/SVGFEFuncGElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncGElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEFuncGElement
interface SVGFEFuncGElement : SVGComponentTransferFunctionElement {
};
diff --git a/core/svg/SVGFEFuncRElement.idl b/core/svg/SVGFEFuncRElement.idl
index 3073190..9f26071 100644
--- a/core/svg/SVGFEFuncRElement.idl
+++ b/core/svg/SVGFEFuncRElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEFuncRElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEFuncRElement
interface SVGFEFuncRElement : SVGComponentTransferFunctionElement {
};
diff --git a/core/svg/SVGFEGaussianBlurElement.idl b/core/svg/SVGFEGaussianBlurElement.idl
index c9326d3..a474905 100644
--- a/core/svg/SVGFEGaussianBlurElement.idl
+++ b/core/svg/SVGFEGaussianBlurElement.idl
@@ -23,9 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFEGaussianBlurElement
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEGaussianBlurElement
-// Currently SVG 1.1 (SVG 2 members not implemented)
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEGaussianBlurElement
interface SVGFEGaussianBlurElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFEImageElement.idl b/core/svg/SVGFEImageElement.idl
index 05ecf0c..c1c4521 100644
--- a/core/svg/SVGFEImageElement.idl
+++ b/core/svg/SVGFEImageElement.idl
@@ -23,9 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFEImageElement
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEImageElement
-// Currently SVG 1.1, SVG 2 members not implemented
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEImageElement
interface SVGFEImageElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
diff --git a/core/svg/SVGFEMergeElement.idl b/core/svg/SVGFEMergeElement.idl
index d9da6e8..a34d1e1 100644
--- a/core/svg/SVGFEMergeElement.idl
+++ b/core/svg/SVGFEMergeElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEMergeElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEMergeElement
interface SVGFEMergeElement : SVGElement {
};
diff --git a/core/svg/SVGFEMergeNodeElement.idl b/core/svg/SVGFEMergeNodeElement.idl
index 1e91f7a..4409db5 100644
--- a/core/svg/SVGFEMergeNodeElement.idl
+++ b/core/svg/SVGFEMergeNodeElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEMergeNodeElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEMergeNodeElement
interface SVGFEMergeNodeElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFEMorphologyElement.idl b/core/svg/SVGFEMorphologyElement.idl
index c7facb7..71f157b 100644
--- a/core/svg/SVGFEMorphologyElement.idl
+++ b/core/svg/SVGFEMorphologyElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEMorphologyElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEMorphologyElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFEMorphologyElement : SVGElement {
// Morphology Operators
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
diff --git a/core/svg/SVGFEOffsetElement.idl b/core/svg/SVGFEOffsetElement.idl
index 41fb654..ca28037 100644
--- a/core/svg/SVGFEOffsetElement.idl
+++ b/core/svg/SVGFEOffsetElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEOffsetElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEOffsetElement
interface SVGFEOffsetElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFEPointLightElement.idl b/core/svg/SVGFEPointLightElement.idl
index c37d706..e162bb1 100644
--- a/core/svg/SVGFEPointLightElement.idl
+++ b/core/svg/SVGFEPointLightElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFEPointLightElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFEPointLightElement
interface SVGFEPointLightElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber x;
diff --git a/core/svg/SVGFESpecularLightingElement.idl b/core/svg/SVGFESpecularLightingElement.idl
index 49baa91..474c74d 100644
--- a/core/svg/SVGFESpecularLightingElement.idl
+++ b/core/svg/SVGFESpecularLightingElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFESpecularLightingElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFESpecularLightingElement
interface SVGFESpecularLightingElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFESpotLightElement.idl b/core/svg/SVGFESpotLightElement.idl
index bb0c3e8..dc99e0b 100644
--- a/core/svg/SVGFESpotLightElement.idl
+++ b/core/svg/SVGFESpotLightElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFESpotLightElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFESpotLightElement
interface SVGFESpotLightElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber x;
diff --git a/core/svg/SVGFETileElement.idl b/core/svg/SVGFETileElement.idl
index 13da3c0..6411e77 100644
--- a/core/svg/SVGFETileElement.idl
+++ b/core/svg/SVGFETileElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFETileElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFETileElement
interface SVGFETileElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
diff --git a/core/svg/SVGFETurbulenceElement.idl b/core/svg/SVGFETurbulenceElement.idl
index 08b2b83..41718c3 100644
--- a/core/svg/SVGFETurbulenceElement.idl
+++ b/core/svg/SVGFETurbulenceElement.idl
@@ -23,10 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFETurbulenceElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFETurbulenceElement
[
- DoNotCheckConstants,
+ DoNotCheckConstants
] interface SVGFETurbulenceElement : SVGElement {
// Turbulence Types
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGFilterElement.idl b/core/svg/SVGFilterElement.idl
index 2d939a3..49c8a67 100644
--- a/core/svg/SVGFilterElement.idl
+++ b/core/svg/SVGFilterElement.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFilterElement
+// https://drafts.fxtf.org/filters/#InterfaceSVGFilterElement
interface SVGFilterElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration filterUnits;
diff --git a/core/svg/SVGFilterPrimitiveStandardAttributes.idl b/core/svg/SVGFilterPrimitiveStandardAttributes.idl
index 458d616..41675c9 100644
--- a/core/svg/SVGFilterPrimitiveStandardAttributes.idl
+++ b/core/svg/SVGFilterPrimitiveStandardAttributes.idl
@@ -24,10 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/filter-effects/#InterfaceSVGFilterPrimitiveStandardAttributes
+// https://drafts.fxtf.org/filters/#InterfaceSVGFilterPrimitiveStandardAttributes
[
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface SVGFilterPrimitiveStandardAttributes {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedLength x;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedLength y;
diff --git a/core/svg/SVGFitToViewBox.idl b/core/svg/SVGFitToViewBox.idl
index 45d3d53..b8af7cf 100644
--- a/core/svg/SVGFitToViewBox.idl
+++ b/core/svg/SVGFitToViewBox.idl
@@ -24,10 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGFitToViewBox
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGFitToViewBox
[
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface SVGFitToViewBox {
[MeasureAs=SVG1DOMFitToViewBox] readonly attribute SVGAnimatedRect viewBox;
[MeasureAs=SVG1DOMFitToViewBox] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
diff --git a/core/svg/SVGForeignObjectElement.idl b/core/svg/SVGForeignObjectElement.idl
index 9825185..03f3aff 100644
--- a/core/svg/SVGForeignObjectElement.idl
+++ b/core/svg/SVGForeignObjectElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/extend.html#InterfaceSVGForeignObjectElement
+// https://svgwg.org/svg2-draft/embedded.html#InterfaceSVGForeignObjectElement
interface SVGForeignObjectElement : SVGGraphicsElement {
[MeasureAs=SVG1DOMForeignObjectElement] readonly attribute SVGAnimatedLength x;
diff --git a/core/svg/SVGGElement.idl b/core/svg/SVGGElement.idl
index 97bb0a5..cf7d964 100644
--- a/core/svg/SVGGElement.idl
+++ b/core/svg/SVGGElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGGElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGGElement
interface SVGGElement : SVGGraphicsElement {
};
diff --git a/core/svg/SVGGeometryElement.idl b/core/svg/SVGGeometryElement.idl
index 8f1619a..445c15b 100644
--- a/core/svg/SVGGeometryElement.idl
+++ b/core/svg/SVGGeometryElement.idl
@@ -28,10 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGGeometryElement
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
interface SVGGeometryElement : SVGGraphicsElement {
- // TODO(philipj): SVGPoint should be DOMPoint.
+ [SameObject] readonly attribute SVGAnimatedNumber pathLength;
+
+ // TODO(foolip): SVGPoint should be DOMPoint.
boolean isPointInFill(SVGPoint point);
boolean isPointInStroke(SVGPoint point);
+ float getTotalLength();
+ SVGPoint getPointAtLength(float distance);
};
diff --git a/core/svg/SVGGradientElement.idl b/core/svg/SVGGradientElement.idl
index 5d77514..d3abb19 100644
--- a/core/svg/SVGGradientElement.idl
+++ b/core/svg/SVGGradientElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGGradientElement
+// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGGradientElement
[
DoNotCheckConstants
diff --git a/core/svg/SVGGraphicsElement.idl b/core/svg/SVGGraphicsElement.idl
index 77474ef..f27e75d 100644
--- a/core/svg/SVGGraphicsElement.idl
+++ b/core/svg/SVGGraphicsElement.idl
@@ -28,17 +28,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGGraphicsElement
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGraphicsElement
interface SVGGraphicsElement : SVGElement {
[Measure] readonly attribute SVGAnimatedTransformList transform;
+ [ImplementedAs=getBBoxFromJavascript] SVGRect getBBox();
+ SVGMatrix getCTM();
+ SVGMatrix getScreenCTM();
+
+ // TODO(foolip): The following two properties existed on SVGLocatable in SVG
+ // 1.1, but were removed in SVG2. https://crbug.com/695981
+ // https://www.w3.org/TR/SVG11/types.html#InterfaceSVGLocatable
[MeasureAs=SVGLocatableNearestViewportElement] readonly attribute SVGElement nearestViewportElement;
[MeasureAs=SVGLocatableFarthestViewportElement] readonly attribute SVGElement farthestViewportElement;
-
- [ImplementedAs=getBBoxFromJavascript] SVGRect getBBox();
- [ImplementedAs=getCTMFromJavascript] SVGMatrix getCTM();
- [ImplementedAs=getScreenCTMFromJavascript] SVGMatrix getScreenCTM();
};
SVGGraphicsElement implements SVGTests;
diff --git a/core/svg/SVGImageElement.idl b/core/svg/SVGImageElement.idl
index 611a2cc..6006402 100644
--- a/core/svg/SVGImageElement.idl
+++ b/core/svg/SVGImageElement.idl
@@ -23,14 +23,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/embedded.html#InterfaceSVGImageElement
+// https://svgwg.org/svg2-draft/embedded.html#InterfaceSVGImageElement
-interface SVGImageElement : SVGGraphicsElement {
+[
+ ActiveScriptWrappable
+] interface SVGImageElement : SVGGraphicsElement {
[MeasureAs=SVG1DOMImageElement] readonly attribute SVGAnimatedLength x;
[MeasureAs=SVG1DOMImageElement] readonly attribute SVGAnimatedLength y;
[MeasureAs=SVG1DOMImageElement] readonly attribute SVGAnimatedLength width;
[MeasureAs=SVG1DOMImageElement] readonly attribute SVGAnimatedLength height;
[MeasureAs=SVG1DOMImageElement] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
+ [RuntimeEnabled=ImageAsyncAttribute, CEReactions, Reflect] attribute DOMString async;
+
+ [RuntimeEnabled=JSImageDecode, CallWith=ScriptState, RaisesException] Promise decode();
};
SVGImageElement implements SVGURIReference;
diff --git a/core/svg/SVGLength.idl b/core/svg/SVGLength.idl
index 06b7617..cd8e588 100644
--- a/core/svg/SVGLength.idl
+++ b/core/svg/SVGLength.idl
@@ -20,12 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGLength
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGLength
[
- ImplementedAs=SVGLengthTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGLengthTearOff
] interface SVGLength {
// Length Unit Types
const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGLengthList.idl b/core/svg/SVGLengthList.idl
index 5d6113c..db01d2a 100644
--- a/core/svg/SVGLengthList.idl
+++ b/core/svg/SVGLengthList.idl
@@ -24,12 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGLengthList
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGLengthList
[
- ImplementedAs=SVGLengthListTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGLengthListTearOff
] interface SVGLengthList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/svg/SVGLineElement.idl b/core/svg/SVGLineElement.idl
index 73e56a1..2485608 100644
--- a/core/svg/SVGLineElement.idl
+++ b/core/svg/SVGLineElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGLineElement
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGLineElement
interface SVGLineElement : SVGGeometryElement {
[MeasureAs=SVG1DOMShape] readonly attribute SVGAnimatedLength x1;
diff --git a/core/svg/SVGLinearGradientElement.idl b/core/svg/SVGLinearGradientElement.idl
index 06c5c32..64c8656 100644
--- a/core/svg/SVGLinearGradientElement.idl
+++ b/core/svg/SVGLinearGradientElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGLinearGradientElement
+// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGLinearGradientElement
interface SVGLinearGradientElement : SVGGradientElement {
[MeasureAs=SVG1DOMPaintServer] readonly attribute SVGAnimatedLength x1;
diff --git a/core/svg/SVGMPathElement.idl b/core/svg/SVGMPathElement.idl
index a0a1a5c..c3933b2 100644
--- a/core/svg/SVGMPathElement.idl
+++ b/core/svg/SVGMPathElement.idl
@@ -23,9 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGMPathElement
+// https://svgwg.org/specs/animations/#InterfaceSVGMPathElement
-[RuntimeEnabled=smil]
+[RuntimeEnabled=SMIL]
interface SVGMPathElement : SVGElement {
};
diff --git a/core/svg/SVGMarkerElement.idl b/core/svg/SVGMarkerElement.idl
index 3ae585f..610dfaf 100644
--- a/core/svg/SVGMarkerElement.idl
+++ b/core/svg/SVGMarkerElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
+// https://svgwg.org/svg2-draft/painting.html#InterfaceSVGMarkerElement
interface SVGMarkerElement : SVGElement {
diff --git a/core/svg/SVGMaskElement.idl b/core/svg/SVGMaskElement.idl
index 0045a16..7af6900 100644
--- a/core/svg/SVGMaskElement.idl
+++ b/core/svg/SVGMaskElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/css-masking/#InterfaceSVGMaskElement
+// https://drafts.fxtf.org/css-masking-1/#InterfaceSVGMaskElement
interface SVGMaskElement : SVGElement {
[MeasureAs=SVG1DOMMaskElement] readonly attribute SVGAnimatedEnumeration maskUnits;
@@ -36,5 +36,5 @@
// SVGMaskElement implements SVGUnitTypes;
-// TODO(philipj): The following is not part of any spec:
+// TODO(foolip): The following is not part of any spec. https://crbug.com/701893
SVGMaskElement implements SVGTests;
diff --git a/core/svg/SVGMatrix.idl b/core/svg/SVGMatrix.idl
index 0c960a1..53690ac 100644
--- a/core/svg/SVGMatrix.idl
+++ b/core/svg/SVGMatrix.idl
@@ -22,11 +22,11 @@
// http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix
-// TODO(philipj): SVGMatrix is gone from SVG 2, replaced by DOMMatrix.
+// TODO(foolip): SVGMatrix is gone from SVG 2, replaced by DOMMatrix.
+// https://crbug.com/709001
[
- ImplementedAs=SVGMatrixTearOff,
- SetWrapperReferenceTo(SVGTransform contextTransform),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGMatrixTearOff
] interface SVGMatrix {
// FIXME: these attributes should all be floats but since we implement
// AffineTransform with doubles setting these as doubles makes more sense.
diff --git a/core/svg/SVGMetadataElement.idl b/core/svg/SVGMetadataElement.idl
index 5f336ab..9c557f1 100644
--- a/core/svg/SVGMetadataElement.idl
+++ b/core/svg/SVGMetadataElement.idl
@@ -19,7 +19,7 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGMetadataElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGMetadataElement
interface SVGMetadataElement : SVGElement {
};
diff --git a/core/svg/SVGNumber.idl b/core/svg/SVGNumber.idl
index 0a2aa67..51ca938 100644
--- a/core/svg/SVGNumber.idl
+++ b/core/svg/SVGNumber.idl
@@ -20,12 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumber
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGNumber
[
- ImplementedAs=SVGNumberTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGNumberTearOff
] interface SVGNumber {
[RaisesException=Setter] attribute float value;
};
diff --git a/core/svg/SVGNumberList.idl b/core/svg/SVGNumberList.idl
index 3d02ae5..c4ecd9e 100644
--- a/core/svg/SVGNumberList.idl
+++ b/core/svg/SVGNumberList.idl
@@ -24,12 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumberList
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGNumberList
[
- ImplementedAs=SVGNumberListTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGNumberListTearOff
] interface SVGNumberList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/svg/SVGPathElement.idl b/core/svg/SVGPathElement.idl
index c5bb32f..748f418 100644
--- a/core/svg/SVGPathElement.idl
+++ b/core/svg/SVGPathElement.idl
@@ -24,13 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/paths.html#InterfaceSVGPathElement
+// https://svgwg.org/svg2-draft/paths.html#InterfaceSVGPathElement
interface SVGPathElement : SVGGeometryElement {
- [Measure] readonly attribute SVGAnimatedNumber pathLength;
-
- float getTotalLength();
- // TODO(philipj): SVGPoint should be DOMPoint.
- SVGPoint getPointAtLength(float distance);
- unsigned long getPathSegAtLength(float distance);
};
diff --git a/core/svg/SVGPatternElement.idl b/core/svg/SVGPatternElement.idl
index 76fd7bf..fba4f7b 100644
--- a/core/svg/SVGPatternElement.idl
+++ b/core/svg/SVGPatternElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGPatternElement
+// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGPatternElement
interface SVGPatternElement : SVGElement {
[MeasureAs=SVG1DOMPaintServer] readonly attribute SVGAnimatedEnumeration patternUnits;
@@ -39,6 +39,6 @@
SVGPatternElement implements SVGURIReference;
// SVGPatternElement implements SVGUnitTypes;
-// TODO(philipj): The following was part of SVG 1.1:
+// TODO(foolip): The following was part of SVG 1.1. https://crbug.com/701893
// 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 b7c1434..110f5a5 100644
--- a/core/svg/SVGPoint.idl
+++ b/core/svg/SVGPoint.idl
@@ -22,11 +22,11 @@
// http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGPoint
-// TODO(philipj): SVGPoint is gone from SVG 2, replaced by DOMPoint.
+// TODO(foolip): SVGPoint is gone from SVG 2, replaced by DOMPoint.
+// https://crbug.com/709001
[
- ImplementedAs=SVGPointTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGPointTearOff
] interface SVGPoint {
[RaisesException=Setter] attribute unrestricted float x;
[RaisesException=Setter] attribute unrestricted float y;
diff --git a/core/svg/SVGPointList.idl b/core/svg/SVGPointList.idl
index 97589be..b502738 100644
--- a/core/svg/SVGPointList.idl
+++ b/core/svg/SVGPointList.idl
@@ -23,18 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGPointList
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGPointList
[
- ImplementedAs=SVGPointListTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGPointListTearOff
] interface SVGPointList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
[RaisesException] void clear();
- // TODO(philipj): SVGPoint should be DOMPoint.
+ // TODO(foolip): SVGPoint should be DOMPoint.
[RaisesException] SVGPoint initialize(SVGPoint newItem);
[RaisesException] getter SVGPoint getItem(unsigned long index);
[RaisesException] SVGPoint insertItemBefore(SVGPoint newItem, unsigned long index);
diff --git a/core/svg/SVGPolygonElement.idl b/core/svg/SVGPolygonElement.idl
index 75e87c3..02bf320 100644
--- a/core/svg/SVGPolygonElement.idl
+++ b/core/svg/SVGPolygonElement.idl
@@ -23,12 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGPolygonElement
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGPolygonElement
interface SVGPolygonElement : SVGGeometryElement {
- // TODO(philipj): points and animatedPoints be on the SVGAnimatedPoints
+ // TODO(foolip): points and animatedPoints be on the SVGAnimatedPoints
// interface which SVGPolygonElement should implement:
- // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGAnimatedPoints
+ // https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGAnimatedPoints
[MeasureAs=SVG1DOMShape, ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
[MeasureAs=SVG1DOMShape] readonly attribute SVGPointList animatedPoints;
};
diff --git a/core/svg/SVGPolylineElement.idl b/core/svg/SVGPolylineElement.idl
index fae6f4e..2bb4518 100644
--- a/core/svg/SVGPolylineElement.idl
+++ b/core/svg/SVGPolylineElement.idl
@@ -23,12 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGPolylineElement
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGPolylineElement
interface SVGPolylineElement : SVGGeometryElement {
- // TODO(philipj): points and animatedPoints should be on the
+ // TODO(foolip): points and animatedPoints should be on the
// SVGAnimatedPoints interface which SVGPolylineElement should implement:
- // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGAnimatedPoints
+ // https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGAnimatedPoints
[MeasureAs=SVG1DOMShape, ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
[MeasureAs=SVG1DOMShape] readonly attribute SVGPointList animatedPoints;
};
diff --git a/core/svg/SVGPreserveAspectRatio.idl b/core/svg/SVGPreserveAspectRatio.idl
index 6e1d4ad..0d32580 100644
--- a/core/svg/SVGPreserveAspectRatio.idl
+++ b/core/svg/SVGPreserveAspectRatio.idl
@@ -23,12 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGPreserveAspectRatio
+// https://svgwg.org/svg2-draft/coords.html#InterfaceSVGPreserveAspectRatio
[
- ImplementedAs=SVGPreserveAspectRatioTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGPreserveAspectRatioTearOff
] interface SVGPreserveAspectRatio {
// Alignment types
const unsigned short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0;
diff --git a/core/svg/SVGRadialGradientElement.idl b/core/svg/SVGRadialGradientElement.idl
index 16a496b..a128bf5 100644
--- a/core/svg/SVGRadialGradientElement.idl
+++ b/core/svg/SVGRadialGradientElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGRadialGradientElement
+// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGRadialGradientElement
interface SVGRadialGradientElement : SVGGradientElement {
[MeasureAs=SVG1DOMPaintServer] readonly attribute SVGAnimatedLength cx;
diff --git a/core/svg/SVGRect.idl b/core/svg/SVGRect.idl
index 725ee0f..fa37947 100644
--- a/core/svg/SVGRect.idl
+++ b/core/svg/SVGRect.idl
@@ -22,11 +22,11 @@
// http://www.w3.org/TR/SVG11/types.html#InterfaceSVGRect
-// TODO(philipj): SVGRect is gone from SVG 2, replaced by DOMRect.
+// TODO(foolip): SVGRect is gone from SVG 2, replaced by DOMRect.
+// https://crbug.com/709001
[
- ImplementedAs=SVGRectTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGRectTearOff
] interface SVGRect {
[RaisesException=Setter] attribute unrestricted float x;
[RaisesException=Setter] attribute unrestricted float y;
diff --git a/core/svg/SVGRectElement.idl b/core/svg/SVGRectElement.idl
index 98fb22d..bde3c4b 100644
--- a/core/svg/SVGRectElement.idl
+++ b/core/svg/SVGRectElement.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGRectElement
+// https://svgwg.org/svg2-draft/shapes.html#InterfaceSVGRectElement
interface SVGRectElement : SVGGeometryElement {
[MeasureAs=SVG1DOMShape] readonly attribute SVGAnimatedLength x;
diff --git a/core/svg/SVGSVGElement.idl b/core/svg/SVGSVGElement.idl
index b05a259..4cc98bb 100644
--- a/core/svg/SVGSVGElement.idl
+++ b/core/svg/SVGSVGElement.idl
@@ -20,53 +20,50 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSVGElement
interface SVGSVGElement : SVGGraphicsElement {
[MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength x;
[MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength y;
[MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength width;
[MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength height;
- // TODO(philipj): viewport should be a DOMRectReadOnly.
- [Measure] readonly attribute SVGRect viewport;
- // 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.
+
+ attribute float currentScale;
+ // TODO(foolip): currentTranslate should be a DOMPointReadOnly.
[ImplementedAs=currentTranslateFromJavascript] readonly attribute SVGPoint currentTranslate;
- [MeasureAs=SVGSVGElementSuspendRedraw] unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
- [MeasureAs=SVGSVGElementUnsuspendRedraw] void unsuspendRedraw(unsigned long suspendHandleId);
- [MeasureAs=SVGSVGElementUnsuspendRedrawAll] void unsuspendRedrawAll();
- [MeasureAs=SVGSVGElementForceRedraw] void forceRedraw();
-
- [RuntimeEnabled=smil] void pauseAnimations();
- [RuntimeEnabled=smil] void unpauseAnimations();
- [RuntimeEnabled=smil] boolean animationsPaused();
- [RuntimeEnabled=smil] float getCurrentTime();
- [RuntimeEnabled=smil] void setCurrentTime(float seconds);
-
- // TODO(philipj): The rect arguments should be DOMRectReadOnly.
+ // TODO(foolip): 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();
+
[Measure] SVGNumber createSVGNumber();
[Measure] SVGLength createSVGLength();
[Measure] SVGAngle createSVGAngle();
- // TODO(philipj): SVGPoint/Matrix/Rect should be DOMPoint/Matrix/Rect.
+ // TODO(foolip): SVGPoint/Matrix/Rect should be DOMPoint/Matrix/Rect.
[Measure] SVGPoint createSVGPoint();
[Measure] SVGMatrix createSVGMatrix();
[Measure] SVGRect createSVGRect();
[Measure] SVGTransform createSVGTransform();
[Measure] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
- // TODO(philipj): The following was part of SVG 1.1:
- // http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement
[Measure] Element getElementById(DOMString elementId);
+
+ [MeasureAs=SVGSVGElementSuspendRedraw] unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
+ [MeasureAs=SVGSVGElementUnsuspendRedraw] void unsuspendRedraw(unsigned long suspendHandleId);
+ [MeasureAs=SVGSVGElementUnsuspendRedrawAll] void unsuspendRedrawAll();
+ [MeasureAs=SVGSVGElementForceRedraw] void forceRedraw();
+
+ // SVG Animations
+ // https://svgwg.org/specs/animations/#InterfaceSVGSVGElement
+ [MeasureAs=SVGSMILPausing, RuntimeEnabled=SMIL] void pauseAnimations();
+ [MeasureAs=SVGSMILPausing, RuntimeEnabled=SMIL] void unpauseAnimations();
+ [MeasureAs=SVGSMILPausing, RuntimeEnabled=SMIL] boolean animationsPaused();
+ [MeasureAs=SVGSMILCurrentTime, RuntimeEnabled=SMIL] float getCurrentTime();
+ [MeasureAs=SVGSMILCurrentTime, RuntimeEnabled=SMIL] void setCurrentTime(float seconds);
};
SVGSVGElement implements SVGFitToViewBox;
diff --git a/core/svg/SVGScriptElement.idl b/core/svg/SVGScriptElement.idl
index f3e4ace..52d84e7 100644
--- a/core/svg/SVGScriptElement.idl
+++ b/core/svg/SVGScriptElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/script.html#InterfaceSVGScriptElement
+// https://svgwg.org/svg2-draft/interact.html#InterfaceSVGScriptElement
interface SVGScriptElement : SVGElement {
[Reflect] attribute DOMString type;
diff --git a/core/svg/SVGSetElement.idl b/core/svg/SVGSetElement.idl
index f3f025f..ecb0229 100644
--- a/core/svg/SVGSetElement.idl
+++ b/core/svg/SVGSetElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/animate.html#InterfaceSVGSetElement
+// https://svgwg.org/specs/animations/#InterfaceSVGSetElement
interface SVGSetElement : SVGAnimationElement {
};
diff --git a/core/svg/SVGStopElement.idl b/core/svg/SVGStopElement.idl
index a8406d4..642e3aa 100644
--- a/core/svg/SVGStopElement.idl
+++ b/core/svg/SVGStopElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/pservers.html#InterfaceSVGStopElement
+// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGStopElement
interface SVGStopElement : SVGElement {
[MeasureAs=SVG1DOMPaintServer] readonly attribute SVGAnimatedNumber offset;
diff --git a/core/svg/SVGStringList.idl b/core/svg/SVGStringList.idl
index 7241243..171e1fb 100644
--- a/core/svg/SVGStringList.idl
+++ b/core/svg/SVGStringList.idl
@@ -23,12 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGStringList
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGStringList
[
- SetWrapperReferenceTo(SVGElement contextElement),
- ImplementedAs=SVGStringListTearOff,
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGStringListTearOff
] interface SVGStringList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
diff --git a/core/svg/SVGStyleElement.idl b/core/svg/SVGStyleElement.idl
index afd2a33..4796534 100644
--- a/core/svg/SVGStyleElement.idl
+++ b/core/svg/SVGStyleElement.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/styling.html#InterfaceSVGStyleElement
+// https://svgwg.org/svg2-draft/styling.html#InterfaceSVGStyleElement
interface SVGStyleElement : SVGElement {
attribute DOMString type;
@@ -32,10 +32,10 @@
[MeasureAs=SVGStyleElementTitle] attribute DOMString title;
// SVGStyleElement implements LinkStyle
- // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
+ // https://drafts.csswg.org/cssom/#the-linkstyle-interface
readonly attribute StyleSheet? sheet;
- // TODO(philipj): The disabled attribute was not in SVG 1.1 and has been
+ // TODO(foolip): 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 0370c7f..3611d23 100644
--- a/core/svg/SVGSwitchElement.idl
+++ b/core/svg/SVGSwitchElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSwitchElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSwitchElement
interface SVGSwitchElement : SVGGraphicsElement {
};
diff --git a/core/svg/SVGSymbolElement.idl b/core/svg/SVGSymbolElement.idl
index 9a5b351..f2c657b 100644
--- a/core/svg/SVGSymbolElement.idl
+++ b/core/svg/SVGSymbolElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSymbolElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSymbolElement
interface SVGSymbolElement : SVGElement {
};
diff --git a/core/svg/SVGTSpanElement.idl b/core/svg/SVGTSpanElement.idl
index db5be69..d72fa86 100644
--- a/core/svg/SVGTSpanElement.idl
+++ b/core/svg/SVGTSpanElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTSpanElement
+// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTSpanElement
interface SVGTSpanElement : SVGTextPositioningElement {
};
diff --git a/core/svg/SVGTests.idl b/core/svg/SVGTests.idl
index 1a76c1e..665ac6f 100644
--- a/core/svg/SVGTests.idl
+++ b/core/svg/SVGTests.idl
@@ -24,12 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGTests
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGTests
[
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface SVGTests {
- [MeasureAs=SVG1DOMSVGTests] readonly attribute SVGStringList requiredFeatures;
[MeasureAs=SVG1DOMSVGTests] readonly attribute SVGStringList requiredExtensions;
[MeasureAs=SVG1DOMSVGTests] readonly attribute SVGStringList systemLanguage;
};
diff --git a/core/svg/SVGTextContentElement.idl b/core/svg/SVGTextContentElement.idl
index 77a7baa..4617f7f 100644
--- a/core/svg/SVGTextContentElement.idl
+++ b/core/svg/SVGTextContentElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextContentElement
+// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextContentElement
interface SVGTextContentElement : SVGGraphicsElement {
// lengthAdjust Types
@@ -37,7 +37,7 @@
long getNumberOfChars();
float getComputedTextLength();
[RaisesException] float getSubStringLength(unsigned long charnum, unsigned long nchars);
- // TODO(philipj): SVGPoint/SVGRect should be DOMPoint/DOMRect.
+ // TODO(foolip): SVGPoint/SVGRect should be DOMPoint/DOMRect.
[RaisesException] SVGPoint getStartPositionOfChar(unsigned long charnum);
[RaisesException] SVGPoint getEndPositionOfChar(unsigned long charnum);
[RaisesException] SVGRect getExtentOfChar(unsigned long charnum);
diff --git a/core/svg/SVGTextElement.idl b/core/svg/SVGTextElement.idl
index 0c9fa35..d3cbdf8 100644
--- a/core/svg/SVGTextElement.idl
+++ b/core/svg/SVGTextElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextElement
+// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextElement
interface SVGTextElement : SVGTextPositioningElement {
};
diff --git a/core/svg/SVGTextPathElement.idl b/core/svg/SVGTextPathElement.idl
index 6d47b57..8aee74f 100644
--- a/core/svg/SVGTextPathElement.idl
+++ b/core/svg/SVGTextPathElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextPathElement
+// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextPathElement
interface SVGTextPathElement : SVGTextContentElement {
// textPath Method Types
diff --git a/core/svg/SVGTextPositioningElement.idl b/core/svg/SVGTextPositioningElement.idl
index f389dfa..c55fe38 100644
--- a/core/svg/SVGTextPositioningElement.idl
+++ b/core/svg/SVGTextPositioningElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextPositioningElement
+// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextPositioningElement
interface SVGTextPositioningElement : SVGTextContentElement {
[MeasureAs=SVG1DOMText] readonly attribute SVGAnimatedLengthList x;
diff --git a/core/svg/SVGTitleElement.idl b/core/svg/SVGTitleElement.idl
index a217a61..cfb65fb 100644
--- a/core/svg/SVGTitleElement.idl
+++ b/core/svg/SVGTitleElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGTitleElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGTitleElement
interface SVGTitleElement : SVGElement {
};
diff --git a/core/svg/SVGTransform.idl b/core/svg/SVGTransform.idl
index dd594e1..b28517a 100644
--- a/core/svg/SVGTransform.idl
+++ b/core/svg/SVGTransform.idl
@@ -19,12 +19,11 @@
* Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGTransform
+// https://svgwg.org/svg2-draft/coords.html#InterfaceSVGTransform
[
- ImplementedAs=SVGTransformTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGTransformTearOff
] interface SVGTransform {
// Transform Types
const unsigned short SVG_TRANSFORM_UNKNOWN = 0;
@@ -36,10 +35,11 @@
const unsigned short SVG_TRANSFORM_SKEWY = 6;
[ImplementedAs=transformType] readonly attribute unsigned short type;
- // TODO(philipj): SVGMatrix should be DOMMatrixReadOnly.
+ // TODO(foolip): SVGMatrix should be DOMMatrix.
readonly attribute SVGMatrix matrix;
readonly attribute float angle;
+ // TODO(foolip): SVGMatrix should be DOMMatrixReadOnly.
[RaisesException] void setMatrix(SVGMatrix matrix);
[RaisesException] void setTranslate(float tx, float ty);
[RaisesException] void setScale(float sx, float sy);
diff --git a/core/svg/SVGTransformList.idl b/core/svg/SVGTransformList.idl
index 2ffb5bc..8bf512e 100644
--- a/core/svg/SVGTransformList.idl
+++ b/core/svg/SVGTransformList.idl
@@ -24,12 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/coords.html#InterfaceSVGTransformList
+// https://svgwg.org/svg2-draft/coords.html#InterfaceSVGTransformList
[
- ImplementedAs=SVGTransformListTearOff,
- SetWrapperReferenceTo(SVGElement contextElement),
- WillBeGarbageCollected,
+ DependentLifetime,
+ ImplementedAs=SVGTransformListTearOff
] interface SVGTransformList {
readonly attribute unsigned long length;
[ImplementedAs=length] readonly attribute unsigned long numberOfItems;
@@ -41,7 +40,7 @@
[RaisesException] SVGTransform replaceItem(SVGTransform newItem, unsigned long index);
[RaisesException] SVGTransform removeItem(unsigned long index);
[RaisesException] SVGTransform appendItem(SVGTransform newItem);
- // TODO(philipj): SVGMatrix should be DOMMatrix.
+ // TODO(foolip): SVGMatrix should be DOMMatrix.
SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
[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 18932b0..6f6cee2 100644
--- a/core/svg/SVGURIReference.idl
+++ b/core/svg/SVGURIReference.idl
@@ -24,10 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGURIReference
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGURIReference
[
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface SVGURIReference {
[MeasureAs=SVG1DOMUriReference] readonly attribute SVGAnimatedString href;
};
diff --git a/core/svg/SVGUnitTypes.idl b/core/svg/SVGUnitTypes.idl
index 2b42b50..7a1434a 100644
--- a/core/svg/SVGUnitTypes.idl
+++ b/core/svg/SVGUnitTypes.idl
@@ -23,11 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGUnitTypes
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGUnitTypes
[
- DependentLifetime,
- WillBeGarbageCollected
+ DependentLifetime
] interface SVGUnitTypes {
// Unit Types
const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0;
diff --git a/core/svg/SVGUseElement.idl b/core/svg/SVGUseElement.idl
index 316ee3b..b096a2f 100644
--- a/core/svg/SVGUseElement.idl
+++ b/core/svg/SVGUseElement.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGUseElement
+// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGUseElement
interface SVGUseElement : SVGGraphicsElement {
[MeasureAs=SVG1DOMUseElement] readonly attribute SVGAnimatedLength x;
diff --git a/core/svg/SVGViewElement.idl b/core/svg/SVGViewElement.idl
index 147ad37..731a978 100644
--- a/core/svg/SVGViewElement.idl
+++ b/core/svg/SVGViewElement.idl
@@ -23,10 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/linking.html#InterfaceSVGViewElement
+// https://svgwg.org/svg2-draft/linking.html#InterfaceSVGViewElement
interface SVGViewElement : SVGElement {
- [Measure] readonly attribute SVGStringList viewTarget;
};
SVGViewElement implements SVGFitToViewBox;
diff --git a/core/svg/SVGViewSpec.idl b/core/svg/SVGViewSpec.idl
deleted file mode 100644
index 5c16d61..0000000
--- a/core/svg/SVGViewSpec.idl
+++ /dev/null
@@ -1,42 +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.
- */
-
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGViewSpec
-
-[
- DependentLifetime,
- WillBeGarbageCollected,
- SetWrapperReferenceTo(SVGElement contextElement),
-] interface SVGViewSpec {
- [ImplementedAs=transformFromJavascript] readonly attribute SVGTransformList transform;
- readonly attribute SVGElement viewTarget;
- readonly attribute DOMString viewBoxString;
- readonly attribute DOMString preserveAspectRatioString;
- readonly attribute DOMString transformString;
- readonly attribute DOMString viewTargetString;
-};
-
-SVGViewSpec implements SVGFitToViewBox;
-SVGViewSpec implements SVGZoomAndPan;
diff --git a/core/svg/SVGZoomAndPan.idl b/core/svg/SVGZoomAndPan.idl
index 624eae4..20e6ce5 100644
--- a/core/svg/SVGZoomAndPan.idl
+++ b/core/svg/SVGZoomAndPan.idl
@@ -24,10 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/SVG2/types.html#InterfaceSVGZoomAndPan
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGZoomAndPan
[
- NoInterfaceObject, // Always used on target of 'implements'
+ NoInterfaceObject // Always used on target of 'implements'
] interface SVGZoomAndPan {
// Zoom and Pan Types
diff --git a/core/svg/SVGZoomEvent.idl b/core/svg/SVGZoomEvent.idl
deleted file mode 100644
index ca6ee41..0000000
--- a/core/svg/SVGZoomEvent.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.
- */
-
-// 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;
- readonly attribute float newScale;
- readonly attribute SVGPoint newTranslate;
-};
diff --git a/core/testing/CallbackFunctionTest.idl b/core/testing/CallbackFunctionTest.idl
new file mode 100644
index 0000000..bbbabb4
--- /dev/null
+++ b/core/testing/CallbackFunctionTest.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+callback TestCallback = DOMString (DOMString message1, DOMString message2);
+callback TestInterfaceCallback = void (HTMLDivElement divElement);
+callback TestReceiverObjectCallback = void ();
+callback TestSequenceCallback = sequence<DOMString> (sequence<long> numbers);
+callback TestEnumCallback = void (InternalEnum arg);
+
+interface CallbackFunctionTest {
+ [RaisesException] DOMString testCallback(TestCallback callback, DOMString message1, DOMString message2);
+ [RaisesException] DOMString testNullableCallback(TestCallback? callback, DOMString message1, DOMString message2);
+ [RaisesException] void testInterfaceCallback(TestInterfaceCallback callback, HTMLDivElement divElement);
+ [RaisesException] void testReceiverObjectCallback(TestReceiverObjectCallback callback);
+ [RaisesException] sequence<DOMString> testSequenceCallback(TestSequenceCallback callback, sequence<long> numbers);
+ [RaisesException] void testEnumCallback(TestEnumCallback callback, InternalEnum enum_value);
+};
diff --git a/core/testing/DeathAwareScriptWrappable.idl b/core/testing/DeathAwareScriptWrappable.idl
new file mode 100644
index 0000000..fed2e45
--- /dev/null
+++ b/core/testing/DeathAwareScriptWrappable.idl
@@ -0,0 +1,6 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+interface DeathAwareScriptWrappable {
+};
diff --git a/core/testing/DictionaryTest.idl b/core/testing/DictionaryTest.idl
index 699e669..e1cddf7 100644
--- a/core/testing/DictionaryTest.idl
+++ b/core/testing/DictionaryTest.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.
-[
- GarbageCollected
-] interface DictionaryTest {
+interface DictionaryTest {
void set(optional InternalDictionary testingDictionary);
InternalDictionary get();
[CallWith=ScriptState] object getDictionaryMemberProperties();
@@ -12,5 +10,8 @@
void setDerived(InternalDictionaryDerived derived);
InternalDictionaryDerived getDerived();
- [CallWith=ExecutionContext, RaisesException] DOMString stringFromIterable(Dictionary iterableDictionary);
+ void setDerivedDerived(InternalDictionaryDerivedDerived derived);
+ InternalDictionaryDerivedDerived getDerivedDerived();
+
+ [CallWith=ScriptState, RaisesException] DOMString stringFromIterable(Dictionary iterableDictionary);
};
diff --git a/core/testing/GCObservation.idl b/core/testing/GCObservation.idl
index ba754c0..7f49066 100644
--- a/core/testing/GCObservation.idl
+++ b/core/testing/GCObservation.idl
@@ -28,9 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface GCObservation {
+interface GCObservation {
// Technically, this is true if the object was "near death"; the
// object may have been kept alive through a weak handle. Having
// been collected is the common case, though.
diff --git a/core/testing/GarbageCollectedScriptWrappable.idl b/core/testing/GarbageCollectedScriptWrappable.idl
index 0fd3bde..1c9df06 100644
--- a/core/testing/GarbageCollectedScriptWrappable.idl
+++ b/core/testing/GarbageCollectedScriptWrappable.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.
-[
- GarbageCollected
-] interface GarbageCollectedScriptWrappable {
+interface GarbageCollectedScriptWrappable {
[NotEnumerable] DOMString toString();
};
diff --git a/core/testing/InternalDictionary.idl b/core/testing/InternalDictionary.idl
index 982650b..6596f08 100644
--- a/core/testing/InternalDictionary.idl
+++ b/core/testing/InternalDictionary.idl
@@ -26,7 +26,6 @@
InternalEnum enumMember;
InternalEnum enumMemberWithDefault = "foo";
InternalEnum? enumOrNullMember;
- InternalEnum[] enumArrayMember;
Element elementMember;
Element? elementOrNullMember;
object objectMember;
diff --git a/core/testing/InternalDictionaryDerivedDerived.idl b/core/testing/InternalDictionaryDerivedDerived.idl
new file mode 100644
index 0000000..9635903
--- /dev/null
+++ b/core/testing/InternalDictionaryDerivedDerived.idl
@@ -0,0 +1,7 @@
+// Copyright 2016 The Chromium 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 InternalDictionaryDerivedDerived : InternalDictionaryDerived {
+ DOMString derivedDerivedStringMember;
+};
diff --git a/core/testing/InternalSettings.idl b/core/testing/InternalSettings.idl
index ed536e6..133d3c5 100644
--- a/core/testing/InternalSettings.idl
+++ b/core/testing/InternalSettings.idl
@@ -23,12 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- WillBeGarbageCollected,
-] interface InternalSettings : InternalSettingsGenerated {
+interface InternalSettings : InternalSettingsGenerated {
// All methods which access Page::settings() can raise an exception
// when the page cannot be accessed. (Such as during page tear-down.)
[RaisesException] void setMockScrollbarsEnabled(boolean enabled);
+ [RaisesException] void setHideScrollbars(boolean enabled);
[RaisesException] void setMockGestureTapHighlightsEnabled(boolean enabled);
[RaisesException] void setStandardFontFamily(DOMString family, DOMString script);
[RaisesException] void setSerifFontFamily(DOMString family, DOMString script);
@@ -48,22 +47,21 @@
[RaisesException] void setDefaultVideoPosterURL(DOMString poster);
[RaisesException] void setViewportEnabled(boolean enabled);
[RaisesException] void setViewportMetaEnabled(boolean enabled);
+ [RaisesException] void setViewportStyle(DOMString style);
[RaisesException] void setAvailablePointerTypes(DOMString pointers);
[RaisesException] void setPrimaryPointerType(DOMString pointer);
[RaisesException] void setAvailableHoverTypes(DOMString types);
[RaisesException] void setPrimaryHoverType(DOMString type);
[RaisesException] void setImageAnimationPolicy(DOMString policy);
- [RaisesException] void setCompositorWorkerEnabled(boolean enabled);
+ [RaisesException] void setPresentationReceiver(boolean enabled);
+ [RaisesException] void setAutoplayPolicy(DOMString policy);
// FIXME: The following are RuntimeEnabledFeatures and likely
// cannot be changed after process start. These setters should
// be removed or moved onto internals.runtimeFlags:
- void setAuthorShadowDOMForAnyElementEnabled(boolean enabled);
void setCSSStickyPositionEnabled(boolean enabled);
void setLangAttributeAwareFormControlUIEnabled(boolean enabled);
void setOverlayScrollbarsEnabled(boolean enabled);
void setExperimentalContentSecurityPolicyFeaturesEnabled(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 dc69202..3b052e9 100644
--- a/core/testing/Internals.idl
+++ b/core/testing/Internals.idl
@@ -24,21 +24,25 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- DoNotCheckConstants,
- GarbageCollected,
- ConstructorCallWith=ScriptState,
-] interface Internals {
- DOMString address(Node node);
+enum EffectiveConnectionType {
+ "slow-2g",
+ "2g",
+ "3g",
+ "4g"
+};
+[
+ DoNotCheckConstants
+] interface Internals {
GCObservation observeGC(any observed);
[RaisesException] DOMString elementLayoutTreeAsText(Element element);
boolean isPreloaded(DOMString url);
boolean isPreloadedBy(DOMString url, Document document);
+ boolean isLoading(DOMString url);
boolean isLoadingFromMemoryCache(DOMString url);
-
- boolean isSharingStyle(Element element1, Element element2);
+ unsigned long getResourcePriority (DOMString url, Document document);
+ DOMString getResourceHeader (DOMString url, DOMString header, Document document);
CSSStyleDeclaration computedStyleIncludingVisitedInfo(Node node);
@@ -49,6 +53,9 @@
ShadowRoot oldestShadowRoot(Element host);
[RaisesException] ShadowRoot youngerShadowRoot(Node root);
+ void setBrowserControlsState(float top_height, float bottom_height, boolean shrinksLayout);
+ void setBrowserControlsShownRatio(float ratio);
+
[RaisesException] DOMString shadowRootType(Node root);
[RaisesException] boolean hasShadowInsertionPoint(Node root);
[RaisesException] boolean hasContentElement(Node root);
@@ -57,9 +64,6 @@
[RaisesException] boolean isValidContentSelect(Element contentElement);
Node treeScopeRootNode(Node node);
Node parentTreeScope(Node node);
- [RaisesException] boolean hasSelectorForIdInShadow(Element host, DOMString id);
- [RaisesException] boolean hasSelectorForClassInShadow(Element host, DOMString className);
- [RaisesException] boolean hasSelectorForAttributeInShadow(Element host, DOMString attributeName);
[RaisesException] unsigned short compareTreeScopePosition(Node treeScope1, Node treeScope2);
[RaisesException] unsigned long updateStyleAndReturnAffectedElementCount();
[RaisesException] unsigned long needsLayoutCount();
@@ -90,26 +94,30 @@
[RaisesException] Node previousInFlatTree(Node node);
DOMString visiblePlaceholder(Element element);
-
+ boolean isValidationMessageVisible(Element element);
void selectColorInColorChooser(Element element, DOMString colorValue);
void endColorChooser(Element element);
// If the argument is omitted, the top-level document is used.
boolean hasAutofocusRequest(optional Document document);
- [RaisesException] DOMString[] formControlStateOfHistoryItem();
+ [RaisesException] sequence<DOMString> formControlStateOfHistoryItem();
[RaisesException] void setFormControlStateOfHistoryItem(sequence<DOMString> values);
readonly attribute Window pagePopupWindow;
- [RaisesException] ClientRect absoluteCaretBounds();
+ [RaisesException] DOMRectReadOnly absoluteCaretBounds();
- ClientRect boundingBox(Element element);
+ DOMRectReadOnly boundingBox(Element element);
+ [RaisesException] void setMarker(Document document, Range range, DOMString markerType);
[RaisesException] unsigned long markerCountForNode(Node node, DOMString markerType);
unsigned long activeMarkerCountForNode(Node node);
[RaisesException] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
[RaisesException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
- void addTextMatchMarker(Range range, boolean isActive);
- void setMarkersActive(Node node, unsigned long startOffset, unsigned long endOffset, boolean active);
+ [RaisesException] void addTextMatchMarker(Range range, DOMString matchStatus);
+ [RaisesException] void addCompositionMarker(Range range, DOMString underlineColorValue, DOMString thicknessValue, DOMString backgroundColorValue);
+ [RaisesException] void addActiveSuggestionMarker(Range range, DOMString underlineColorValue, DOMString thicknessValue, DOMString backgroundColorValue);
+ [RaisesException] void addSuggestionMarker(Range range, sequence<DOMString> suggestions, DOMString suggestionHighlightColorValue, DOMString underlineColorValue, DOMString thicknessValue, DOMString backgroundColorValue);
+ void setTextMatchMarkersActive(Node node, unsigned long startOffset, unsigned long endOffset, boolean active);
void setMarkedTextMatchesAreHighlighted(Document document, boolean highlight);
[RaisesException] void setFrameViewPosition(Document document, long x, long y);
@@ -134,18 +142,25 @@
[RaisesException] Node touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
[RaisesException] DOMPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
[RaisesException] Node touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
- [RaisesException] ClientRect bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document document);
+ [RaisesException] DOMRectReadOnly bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document document);
[RaisesException] long lastSpellCheckRequestSequence(Document document);
[RaisesException] long lastSpellCheckProcessedSequence(Document document);
+ [RaisesException] void cancelCurrentSpellCheckRequest(Document document);
+ [RaisesException] DOMString idleTimeSpellCheckerState(Document document);
+ [RaisesException] void runIdleTimeSpellChecker(Document document);
sequence<DOMString> userPreferredLanguages();
void setUserPreferredLanguages(sequence<DOMString> languages);
- unsigned long activeDOMObjectCount(Document document);
+ unsigned long mediaKeysCount();
+ unsigned long mediaKeySessionCount();
+ unsigned long suspendableObjectCount(Document document);
unsigned long wheelEventHandlerCount(Document document);
unsigned long scrollEventHandlerCount(Document document);
- unsigned long touchEventHandlerCount(Document document);
+ unsigned long touchStartOrMoveEventHandlerCount(Document document);
+ unsigned long touchEndOrCancelEventHandlerCount(Document document);
+ unsigned long pointerEventHandlerCount(Document document);
[RaisesException] LayerRectList touchEventTargetLayerRects(Document document);
[RaisesException] boolean executeCommand(Document document, DOMString name, DOMString value);
@@ -159,9 +174,13 @@
unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
boolean ignoreClipping, boolean allowChildFrameContent);
- boolean hasSpellingMarker(Document document, long from, long length);
- boolean hasGrammarMarker(Document document, long from, long length);
- void setContinuousSpellCheckingEnabled(boolean enabled);
+ [RaisesException] boolean hasSpellingMarker(Document document, long from, long length);
+ [RaisesException] boolean hasGrammarMarker(Document document, long from, long length);
+ [RaisesException] void setSpellCheckingEnabled(boolean enabled);
+ [RaisesException] void replaceMisspelled(Document document, DOMString replacement);
+
+ bool canHyphenate(DOMString locale);
+ void setMockHyphenation(DOMString locale);
boolean isOverwriteModeEnabled(Document document);
void toggleOverwriteModeEnabled(Document document);
@@ -177,12 +196,13 @@
// Flags for layerTreeAsText.
// The values of these constants must be kept in sync with the values of LayerTreeFlags in GraphicsLayerClient.h.
const unsigned short LAYER_TREE_INCLUDES_DEBUG_INFO = 1;
- const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 2;
+ const unsigned short LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS = 2;
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_PAINT_INVALIDATION_OBJECTS = 32;
- const unsigned short LAYER_TREE_INCLUDES_COMPOSITING_REASONS = 64;
+ const unsigned short LAYER_TREE_INCLUDES_COMPOSITING_REASONS = 32;
+ const unsigned short OUTPUT_AS_LAYER_TREE = 64;
+
[RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags);
[RaisesException] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
@@ -190,33 +210,33 @@
DOMString scrollingStateTreeAsText(Document document);
[RaisesException] DOMString mainThreadScrollingReasons(Document document);
- [RaisesException] ClientRectList nonFastScrollableRects(Document document);
+ [RaisesException] DOMRectList nonFastScrollableRects(Document document);
void evictAllResources();
unsigned long numberOfLiveNodes();
unsigned long numberOfLiveDocuments();
- DOMString dumpRefCountedInstanceCounts();
- sequence<DOMString> consoleMessageArgumentCounts(Document document);
- unsigned long[] setMemoryCacheCapacities(unsigned long minDeadBytes, unsigned long maxDeadBytes, unsigned long totalBytes);
DOMString counterValue(Element element);
[RaisesException] long pageNumber(Element element, optional float pageWidth = 800, optional float pageHeight = 600);
- DOMString[] shortcutIconURLs(Document document);
- DOMString[] allIconURLs(Document document);
+ sequence<DOMString> shortcutIconURLs(Document document);
+ sequence<DOMString> allIconURLs(Document document);
[RaisesException] long numberOfPages(optional double pageWidthInPixels = 800, optional double pageHeightInPixels = 600);
[RaisesException] DOMString pageProperty(DOMString propertyName, long pageNumber);
[RaisesException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
+ [RaisesException] float pageScaleFactor();
[RaisesException] void setPageScaleFactor(float scaleFactor);
[RaisesException] void setPageScaleFactorLimits(float minScaleFactor, float maxScaleFactor);
[RaisesException] void setIsCursorVisible(Document document, boolean isVisible);
- double effectiveMediaVolume(HTMLMediaElement mediaElement);
+ // HTMLMediaElement, HTMLAudioElement and HTMLVideoElement.
+ DOMString effectivePreload(HTMLMediaElement mediaElement);
void mediaPlayerRemoteRouteAvailabilityChanged(HTMLMediaElement mediaElement, boolean available);
void mediaPlayerPlayingRemotelyChanged(HTMLMediaElement mediaElement, boolean remote);
- void setAllowHiddenVolumeControls(HTMLMediaElement mediaElement, boolean allow);
+ void setMediaElementNetworkState(HTMLMediaElement element, long state);
+ void setPersistent(HTMLVideoElement video, boolean persistent);
void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme, sequence<DOMString> policyAreas);
@@ -224,16 +244,10 @@
TypeConversions typeConversions();
- // This is enabled only in Debug builds.
- // This is because we want to avoid putting the byte stream of testing private scripts
- // into the binary of Release builds.
- PrivateScriptTest privateScriptTest();
-
- DOMString[] getReferencedFilePaths();
+ sequence<DOMString> getReferencedFilePaths();
// These functions both reset the tracked repaint rects. They are intended to be used in the following order:
// startTrackingRepaints(), repaintRectsAsText(), stopTrackingRepaints().
- // TODO(wangxianzhu): Remove these functions when we no longer use repaint rects.
[RaisesException] void startTrackingRepaints(Document document);
[RaisesException] void stopTrackingRepaints(Document document);
@@ -244,33 +258,29 @@
[RaisesException] void forceFullRepaint(Document document);
- // These functions both reset the tracked paint invalidation objects. They are intended to be used in the following order:
- // startTrackingPaintInvalidationObjects(), trackedPaintInvalidationObjects(), stopTrackingPaintInvalidationObjects().
- void startTrackingPaintInvalidationObjects();
- void stopTrackingPaintInvalidationObjects();
-
- // Returns a list of debug strings for objects that were invalidated between
- // startTrackingPaintInvalidationObjects() and stopTrackingPaintInvalidationObjects().
- // If an object is invalidated multiple times, it will appear in the list multiple times.
- DOMString[] trackedPaintInvalidationObjects();
-
// Returns a list of draggable/non-draggable regions in the document.
- [RaisesException] ClientRectList draggableRegions(Document document);
- [RaisesException] ClientRectList nonDraggableRegions(Document document);
+ [RaisesException] DOMRectList draggableRegions(Document document);
+ [RaisesException] DOMRectList nonDraggableRegions(Document document);
// Returns a string with information about the mouse cursor used at the specified client location.
DOMString getCurrentCursorInfo();
readonly attribute boolean cursorUpdatePending;
+ readonly attribute boolean fakeMouseMovePending;
DOMString markerTextForListItem(Element element);
SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
ArrayBuffer serializeObject(SerializedScriptValue obj);
+ [CallWith=ScriptState] any deserializeBufferContainingWasm(ArrayBuffer buffer);
+ ArrayBuffer serializeWithInlineWasm(any obj);
+
+
void forceReload(boolean endToEnd);
DOMString getImageSourceURL(Element element);
+ [RaisesException] void forceImageReload(Element element);
DOMString selectMenuListText(HTMLSelectElement select);
boolean isSelectPopupVisible(Node node);
@@ -278,7 +288,12 @@
long selectPopupItemStyleFontHeight(Node select, long itemIndex);
void resetTypeAheadSession(HTMLSelectElement select);
- [RaisesException] ClientRect selectionBounds();
+ readonly attribute Node? visibleSelectionAnchorNode;
+ readonly attribute unsigned long visibleSelectionAnchorOffset;
+ readonly attribute Node? visibleSelectionFocusNode;
+ readonly attribute unsigned long visibleSelectionFocusOffset;
+ [RaisesException] DOMRect selectionBounds();
+ readonly attribute DOMString textAffinity;
boolean loseSharedGraphicsContext3D();
@@ -291,14 +306,14 @@
[CallWith=ScriptState] Promise createResolvedPromise(any value);
[CallWith=ScriptState] Promise createRejectedPromise(any reason);
[CallWith=ScriptState] Promise addOneToPromise(Promise promise);
- [CallWith=ScriptState, RaisesException] Promise promiseCheck(long arg1, boolean arg2, Dictionary arg3, DOMString arg4, DOMString[] arg5);
+ [CallWith=ScriptState, RaisesException] Promise promiseCheck(long arg1, boolean arg2, Dictionary arg3, DOMString arg4, sequence<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);
+ void setValueForUser(HTMLInputElement element, DOMString value);
DOMString textSurroundingNode(Node node, long x, long y, unsigned long maxLength);
@@ -307,10 +322,10 @@
boolean ignoreLayoutWithPendingStylesheets(Document document);
- // These functions are for testing NetInfo. You must call setNetworkStateNotifierTestOnly(true)
- // before calling setNetworkConnectionInfo.
- void setNetworkStateNotifierTestOnly(boolean testOnly);
- [RaisesException] void setNetworkConnectionInfo(DOMString type, double downlinkMaxMbps);
+ // These functions are for testing NetInfo. You must call clearNetworkConnectionInfoOverride() at the end.
+ [RaisesException] void setNetworkConnectionInfoOverride(boolean onLine, DOMString type, double downlinkMaxMbps);
+ [RaisesException] void setNetworkQualityInfoOverride(EffectiveConnectionType effective_type, unsigned long transport_rtt_msec, double downlink_throughput_mbps);
+ void clearNetworkConnectionInfoOverride();
// This function is for testing HitRegions on Canvas2D.
unsigned long countHitRegions(CanvasRenderingContext2D context);
@@ -319,8 +334,11 @@
unsigned long canvasFontCacheMaxFonts();
DictionaryTest dictionaryTest();
+ RecordTest recordTest();
+ SequenceTest sequenceTest();
UnionTypesTest unionTypesTest();
- [RaisesException] void setScrollChain(ScrollState scrollState, Element[] elements);
+ CallbackFunctionTest callbackFunctionTest();
+ [RaisesException] void setScrollChain(ScrollState scrollState, sequence<Element> elements);
void forceBlinkGCWithoutV8GC();
DOMString selectedHTMLForClipboard();
@@ -334,29 +352,58 @@
bool magnifyScaleAroundAnchor(float offset, float x, float y);
- boolean isUseCounted(Document document, long useCounterId);
+ boolean isUseCounted(Document document, unsigned long feature);
boolean isCSSPropertyUseCounted(Document document, DOMString propertyName);
+ boolean isAnimatedCSSPropertyUseCounted(Document document, DOMString propertyName);
+ sequence<DOMString> getCSSPropertyLonghands();
+ sequence<DOMString> getCSSPropertyShorthands();
+ sequence<DOMString> getCSSPropertyAliases();
+
+ // Returns a promise that is resolved when |feature| is counted on
+ // |document|'s UseCounter. When |feature| was already counted, it's
+ // immediately resolved.
+ [CallWith=ScriptState] Promise<bool> observeUseCounter(Document document, unsigned long feature);
+
+ readonly attribute unsigned long length;
+ getter long (unsigned long index);
iterable<long>;
- [Unscopeable] readonly attribute DOMString unscopeableAttribute;
- [Unscopeable] DOMString unscopeableMethod();
+ [Unscopable] readonly attribute DOMString unscopableAttribute;
+ [Unscopable] DOMString unscopableMethod();
- ClientRectList focusRingRects(Element element);
- ClientRectList outlineRects(Element element);
+ DOMRectList focusRingRects(Element element);
+ DOMRectList outlineRects(Element element);
void setCapsLockState(boolean enabled);
// Returns whether the scrollbar was able to be shown or hidden; not all platforms
// support overlay scrollbars.
bool setScrollbarVisibilityInScrollableArea(Node node, boolean visible);
- void forceRestrictIFramePermissions();
[RaisesException] double monotonicTimeToZeroBasedDocumentTime(double platformTime);
- void setMediaElementNetworkState(HTMLMediaElement element, long state);
+ DOMString getScrollAnimationState(Node node);
- // TODO(liberato): remove once autoplay gesture override experiment concludes.
- void triggerAutoplayViewportCheck(HTMLMediaElement mediaElement);
+ DOMString getProgrammaticScrollAnimationState(Node node);
- int getScrollAnimationState(Node node);
+ DOMRect visualRect(Node node);
+
+ OriginTrialsTest originTrialsTest();
+
+ void crash();
+
+ void setIsLowEndDevice(boolean isLowEndDevice);
+ boolean isLowEndDevice();
+
+ sequence<DOMString> supportedTextEncodingLabels();
+
+ // When RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() and
+ // simulateRasterUnderInvalidation(true) is called, all changed pixels will
+ // be reported as raster under-invalidations.
+ void simulateRasterUnderInvalidations(boolean enable);
+
+ // Bypass the threshold of 'script-compile' of long-task attribution in
+ // PerformanceMonitor for testing. "PerformanceObserver should be observing
+ // 'longtask' while calling BypassLongCompileThresholdOnce.
+ [RaisesException] void BypassLongCompileThresholdOnce();
};
diff --git a/core/testing/LayerRect.idl b/core/testing/LayerRect.idl
index 1bf1154..8556f41 100644
--- a/core/testing/LayerRect.idl
+++ b/core/testing/LayerRect.idl
@@ -28,9 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface LayerRect {
+interface LayerRect {
/* The node that most closely represents the layer in which the rect
occurs. When a layer doesn't correspond directly to a node (eg.
for layer squashing) this will the node representing an ancestor
@@ -41,5 +39,5 @@
readonly attribute long associatedNodeOffsetX;
readonly attribute long associatedNodeOffsetY;
/* Rectange in the GraphicsLayer co-ordinate space */
- readonly attribute ClientRect layerRelativeRect;
+ readonly attribute DOMRectReadOnly layerRelativeRect;
};
diff --git a/core/testing/LayerRectList.idl b/core/testing/LayerRectList.idl
index 566be6e..469a760 100644
--- a/core/testing/LayerRectList.idl
+++ b/core/testing/LayerRectList.idl
@@ -28,9 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface LayerRectList {
+interface LayerRectList {
readonly attribute unsigned long length;
getter LayerRect item(unsigned long index);
};
diff --git a/core/testing/OriginTrialsTest.idl b/core/testing/OriginTrialsTest.idl
new file mode 100644
index 0000000..bebe0c7
--- /dev/null
+++ b/core/testing/OriginTrialsTest.idl
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+interface OriginTrialsTest {
+ [OriginTrialEnabled=OriginTrialsSampleAPI] readonly attribute boolean normalAttribute;
+ [OriginTrialEnabled=OriginTrialsSampleAPI] static readonly attribute boolean staticAttribute;
+ [OriginTrialEnabled=OriginTrialsSampleAPI] boolean normalMethod();
+ [OriginTrialEnabled=OriginTrialsSampleAPI] static boolean staticMethod();
+ [OriginTrialEnabled=OriginTrialsSampleAPI] const unsigned short CONSTANT = 1;
+
+ // This attribute uses native code to test whether the trial is enabled,
+ // and throws an exception in JavaScript if it is not.
+ [CallWith=ScriptState, RaisesException] readonly attribute boolean throwingAttribute;
+
+ // These are available whether or not the trial is enabled.
+ readonly attribute boolean unconditionalAttribute;
+ static readonly attribute boolean staticUnconditionalAttribute;
+ boolean unconditionalMethod();
+ static boolean staticUnconditionalMethod();
+ const unsigned short UNCONDITIONAL_CONSTANT = 99;
+
+ // These are available whether or not the trial is enabled, but only in a
+ // secure context
+ [SecureContext] readonly attribute boolean secureUnconditionalAttribute;
+ // TODO(chasej): Add [SecureContext] when that attribute is fixed to work on
+ // static attributes. That problem is not related to [OriginTrialEnabled].
+ static readonly attribute boolean secureStaticUnconditionalAttribute;
+ [SecureContext] boolean secureUnconditionalMethod();
+ [SecureContext] static boolean secureStaticUnconditionalMethod();
+
+ // These are only available if the trial is enabled, as well as in secure
+ // context.
+ [SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] readonly attribute boolean secureAttribute;
+ [SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] static readonly attribute boolean secureStaticAttribute;
+ [SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] boolean secureMethod();
+ [SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] static boolean secureStaticMethod();
+};
diff --git a/core/testing/OriginTrialsTestPartial.idl b/core/testing/OriginTrialsTestPartial.idl
new file mode 100644
index 0000000..9cf0e48
--- /dev/null
+++ b/core/testing/OriginTrialsTestPartial.idl
@@ -0,0 +1,20 @@
+// Copyright 2016 The Chromium 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=OriginTrialsTestPartial,
+ OriginTrialEnabled=OriginTrialsSampleAPI
+] partial interface OriginTrialsTest {
+ const unsigned short CONSTANT_PARTIAL = 2;
+ readonly attribute boolean normalAttributePartial;
+ static readonly attribute boolean staticAttributePartial;
+ boolean normalMethodPartial();
+ static boolean staticMethodPartial();
+
+ // These are only available in a secure context.
+ [SecureContext] readonly attribute boolean secureAttributePartial;
+ [SecureContext] static readonly attribute boolean secureStaticAttributePartial;
+ [SecureContext] boolean secureMethodPartial();
+ [SecureContext] static boolean secureStaticMethodPartial();
+};
diff --git a/core/testing/PartialPrivateScriptTest.idl b/core/testing/PartialPrivateScriptTest.idl
deleted file mode 100644
index 5175774..0000000
--- a/core/testing/PartialPrivateScriptTest.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.
-
-[
- NoImplHeader
-] partial interface PrivateScriptTest {
- [ImplementedInPrivateScript] short addIntegerInPartial(short value1, short value2);
- [ImplementedInPrivateScript] short addInteger2InPartial(short value1, short value2);
- [ImplementedInPrivateScript] attribute DOMString stringAttributeInPartial;
-};
diff --git a/core/testing/PrivateScriptTest.idl b/core/testing/PrivateScriptTest.idl
deleted file mode 100644
index 8e6d976..0000000
--- a/core/testing/PrivateScriptTest.idl
+++ /dev/null
@@ -1,46 +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 PrivateScriptTest {
- [ImplementedInPrivateScript] void doNothing();
- [ImplementedInPrivateScript] short return123();
- [ImplementedInPrivateScript] short echoInteger(short value);
- [ImplementedInPrivateScript] DOMString echoString(DOMString value);
- [ImplementedInPrivateScript] Node echoNode(Node value);
- [ImplementedInPrivateScript] short addInteger(short value1, short value2);
- [ImplementedInPrivateScript] DOMString addString(DOMString value1, DOMString value2);
- [ImplementedInPrivateScript] void setIntegerToPrototype(short value);
- [ImplementedInPrivateScript] short getIntegerFromPrototype();
- [ImplementedInPrivateScript] void setIntegerToDocument(Document document, short value);
- [ImplementedInPrivateScript] short getIntegerFromDocument(Document document);
- [ImplementedInPrivateScript] Node createElement(Document document);
- [ImplementedInPrivateScript] void appendChild(Node node1, Node node2);
- [ImplementedInPrivateScript] Node firstChild(Node node);
- [ImplementedInPrivateScript] Node nextSibling(Node node);
- [ImplementedInPrivateScript] DOMString innerHTML(Node node);
- [ImplementedInPrivateScript] void setInnerHTML(Node node, DOMString string);
- [ImplementedInPrivateScript] void addClickListener(Node node);
- [ImplementedInPrivateScript] void clickNode(Document document, Node node);
- [ImplementedInPrivateScript] readonly attribute short readonlyShortAttribute;
- [ImplementedInPrivateScript] attribute short shortAttribute;
- [ImplementedInPrivateScript] attribute DOMString stringAttribute;
- [ImplementedInPrivateScript] attribute Node nodeAttribute;
- [ImplementedInPrivateScript] attribute Node? nodeAttributeThrowsIndexSizeError;
- [ImplementedInPrivateScript] void voidMethodThrowsDOMSyntaxError();
- [ImplementedInPrivateScript] void voidMethodThrowsError();
- [ImplementedInPrivateScript] void voidMethodThrowsTypeError();
- [ImplementedInPrivateScript] void voidMethodThrowsRangeError();
- [ImplementedInPrivateScript] void voidMethodThrowsSyntaxError();
- [ImplementedInPrivateScript] void voidMethodThrowsReferenceError();
- [ImplementedInPrivateScript] void voidMethodThrowsStackOverflowError();
- [ImplementedInPrivateScript, OnlyExposedToPrivateScript] short addIntegerForPrivateScriptOnly(short value1, short value2);
- [ImplementedInPrivateScript, OnlyExposedToPrivateScript] attribute DOMString stringAttributeForPrivateScriptOnly;
- [ImplementedInPrivateScript] short addIntegerImplementedInCPP(short value1, short value2);
- [OnlyExposedToPrivateScript] short addIntegerImplementedInCPPForPrivateScriptOnly(short value1, short value2);
- [ImplementedInPrivateScript] attribute DOMString stringAttributeImplementedInCPP;
- [OnlyExposedToPrivateScript] attribute DOMString stringAttributeImplementedInCPPForPrivateScriptOnly;
- [ImplementedInPrivateScript] void dispatchDocumentOnload(Document document);
-};
diff --git a/core/testing/RecordTest.idl b/core/testing/RecordTest.idl
new file mode 100644
index 0000000..4d2b153
--- /dev/null
+++ b/core/testing/RecordTest.idl
@@ -0,0 +1,29 @@
+// Copyright 2017 The Chromium 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 record<DOMString, long> RecordTypedef;
+
+interface RecordTest {
+ void setStringLongRecord(RecordTypedef arg);
+ RecordTypedef getStringLongRecord();
+
+ void setNullableStringLongRecord(RecordTypedef? arg);
+ RecordTypedef? getNullableStringLongRecord();
+
+ void setByteStringByteStringRecord(record<ByteString, ByteString> arg);
+
+ void setStringElementRecord(record<DOMString, Element> arg);
+ record<DOMString, Element> getStringElementRecord();
+
+ void setUSVStringUSVStringBooleanRecordRecord(record<USVString, record<USVString, boolean>> arg);
+ record<USVString, record<USVString, boolean>> getUSVStringUSVStringBooleanRecordRecord();
+
+ record<DOMString, sequence<ByteString>> returnStringByteStringSequenceRecord();
+
+ boolean unionReceivedARecord((boolean or record<ByteString, ByteString>) arg);
+
+ // Test the bindings generator code: unions and dictionaries must trace a
+ // record when it's represented as a HeapVector.
+ void setFloatOrStringElementRecord((float or record<DOMString, Element>) arg);
+};
diff --git a/core/testing/RefCountedScriptWrappable.idl b/core/testing/RefCountedScriptWrappable.idl
deleted file mode 100644
index 1fc7fe0..0000000
--- a/core/testing/RefCountedScriptWrappable.idl
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
-] interface RefCountedScriptWrappable {
- [NotEnumerable] DOMString toString();
-};
diff --git a/core/testing/SequenceTest.idl b/core/testing/SequenceTest.idl
new file mode 100644
index 0000000..c0d5e5d
--- /dev/null
+++ b/core/testing/SequenceTest.idl
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium 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 FoodEnum {
+ "Bread",
+ "Spaghetti",
+ "Sushi"
+};
+
+interface SequenceTest {
+ // The identity functions just return what they have received in |arg|, to
+ // test converting both to and from V8.
+ sequence<sequence<ByteString>> identityByteStringSequenceSequence(sequence<sequence<ByteString>> arg);
+ sequence<double> identityDoubleSequence(sequence<double> arg);
+ sequence<FoodEnum> identityFoodEnumSequence(sequence<FoodEnum> arg);
+ sequence<long> identityLongSequence(sequence<long> arg);
+ sequence<octet>? identityOctetSequenceOrNull(sequence<octet>? arg);
+
+ sequence<Element> getElementSequence();
+ void setElementSequence(sequence<Element> arg);
+
+ bool unionReceivedSequence((double or sequence<double>) arg);
+};
diff --git a/core/testing/TypeConversions.idl b/core/testing/TypeConversions.idl
index a937e5e..69827eb 100644
--- a/core/testing/TypeConversions.idl
+++ b/core/testing/TypeConversions.idl
@@ -23,9 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface TypeConversions {
+interface TypeConversions {
attribute long testLong;
[EnforceRange, ImplementedAs=testLong] attribute long testEnforceRangeLong;
attribute unsigned long testUnsignedLong;
diff --git a/core/testing/UnionTypesTest.idl b/core/testing/UnionTypesTest.idl
index d6cef15..c615b8a 100644
--- a/core/testing/UnionTypesTest.idl
+++ b/core/testing/UnionTypesTest.idl
@@ -2,10 +2,8 @@
// 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;
+interface UnionTypesTest {
+ attribute (double or DOMString or sequence<DOMString>) doubleOrStringOrStringSequenceAttribute;
DOMString doubleOrStringArg((double or DOMString) arg);
DOMString doubleOrInternalEnumArg((double or InternalEnum) arg);
@@ -14,14 +12,11 @@
[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/testing/WorkerInternals.idl b/core/testing/WorkerInternals.idl
new file mode 100644
index 0000000..4f372e9
--- /dev/null
+++ b/core/testing/WorkerInternals.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+interface WorkerInternals {
+ OriginTrialsTest originTrialsTest();
+
+ // Records |feature| in worker's use counter. |feature| must be one of the
+ // values from the UseCounter::Feature enum.
+ [CallWith=ScriptState, RaisesException] void countFeature(unsigned long feature);
+ [CallWith=ScriptState, RaisesException] void countDeprecation(unsigned long feature);
+
+ [CallWith=ScriptState] void collectGarbage();
+};
diff --git a/core/timing/ConsoleMemory.idl b/core/timing/ConsoleMemory.idl
deleted file mode 100644
index 4a19192..0000000
--- a/core/timing/ConsoleMemory.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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, LegacyInterfaceTypeChecking] attribute MemoryInfo memory;
-};
diff --git a/core/timing/MemoryInfo.idl b/core/timing/MemoryInfo.idl
index 325406d..2af4ab2 100644
--- a/core/timing/MemoryInfo.idl
+++ b/core/timing/MemoryInfo.idl
@@ -28,11 +28,10 @@
* 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:
+// TODO(foolip): 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
[
- GarbageCollected,
NoInterfaceObject
] interface MemoryInfo {
[Measure] readonly attribute unsigned long totalJSHeapSize;
diff --git a/core/timing/Performance.idl b/core/timing/Performance.idl
index 44eccbc..ba90e0e 100644
--- a/core/timing/Performance.idl
+++ b/core/timing/Performance.idl
@@ -31,18 +31,17 @@
// https://w3c.github.io/hr-time/#the-performance-interface
-// TODO(philipj): This interface should be [Exposed=(Window,Worker)]. Doing that
+// TODO(foolip): 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
+// TODO(foolip): None of the optional DOMString arguments in this interface
// should have a default value.
-[
- GarbageCollected
-] interface Performance : EventTarget {
+interface Performance : EventTarget {
DOMHighResTimeStamp now();
+ readonly attribute DOMHighResTimeStamp timeOrigin;
// Performance Timeline
// https://w3c.github.io/performance-timeline/#the-performance-interface
- // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+ // TODO(foolip): 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);
@@ -53,11 +52,6 @@
void setResourceTimingBufferSize(unsigned long maxSize);
attribute EventHandler onresourcetimingbufferfull;
- // TODO(ksakamoto): Remove these prefixed APIs.
- [DeprecateAs=PrefixedPerformanceClearResourceTimings, ImplementedAs=clearResourceTimings] void webkitClearResourceTimings();
- [DeprecateAs=PrefixedPerformanceSetResourceTimingBufferSize, ImplementedAs=setResourceTimingBufferSize] void webkitSetResourceTimingBufferSize(unsigned long maxSize);
- [DeprecateAs=PrefixedPerformanceResourceTimingBufferFull] attribute EventHandler onwebkitresourcetimingbufferfull;
-
// Navigation Timing
// https://w3c.github.io/navigation-timing/#extensions-to-the-performance-interface
[SameObject, Measure] readonly attribute PerformanceTiming timing;
@@ -71,13 +65,9 @@
[MeasureAs=UnprefixedUserTiming, RaisesException] void measure(DOMString measureName, optional DOMString startMark = null, optional DOMString endMark = null);
[MeasureAs=UnprefixedUserTiming] void clearMeasures(optional DOMString measureName = null);
- // 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:
+ // TODO(foolip): 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;
+
+ serializer = {attribute};
};
diff --git a/core/timing/PerformanceCompositeTiming.idl b/core/timing/PerformanceCompositeTiming.idl
deleted file mode 100644
index 60eb075..0000000
--- a/core/timing/PerformanceCompositeTiming.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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
- * 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/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 b18ac79..9432257 100644
--- a/core/timing/PerformanceEntry.idl
+++ b/core/timing/PerformanceEntry.idl
@@ -30,10 +30,8 @@
// https://w3c.github.io/performance-timeline/#the-performanceentry-interface
-[
- // TODO(philipj): Exposed=(Window,Worker)
- GarbageCollected,
-] interface PerformanceEntry {
+[Exposed=(Window,Worker)]
+interface PerformanceEntry {
readonly attribute DOMString name;
readonly attribute DOMString entryType;
readonly attribute DOMHighResTimeStamp startTime;
diff --git a/core/timing/PerformanceLongTaskTiming.idl b/core/timing/PerformanceLongTaskTiming.idl
new file mode 100644
index 0000000..9f7c9dc
--- /dev/null
+++ b/core/timing/PerformanceLongTaskTiming.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/longtasks/#sec-PerformanceLongTaskTiming
+interface PerformanceLongTaskTiming : PerformanceEntry {
+ [SameObject, SaveSameObject] readonly attribute FrozenArray<TaskAttributionTiming> attribution;
+};
diff --git a/core/timing/PerformanceNavigation.idl b/core/timing/PerformanceNavigation.idl
index 30ee7b2..a516f3b 100644
--- a/core/timing/PerformanceNavigation.idl
+++ b/core/timing/PerformanceNavigation.idl
@@ -30,9 +30,10 @@
// https://w3c.github.io/navigation-timing/#the-performancenavigation-interface
+// Legacy support for NT1(https://www.w3.org/TR/navigation-timing/).
+
[
- Exposed=Window,
- GarbageCollected
+ Exposed=Window
] interface PerformanceNavigation {
const unsigned short TYPE_NAVIGATE = 0;
const unsigned short TYPE_RELOAD = 1;
@@ -40,5 +41,5 @@
const unsigned short TYPE_RESERVED = 255;
readonly attribute unsigned short type;
readonly attribute unsigned short redirectCount;
- // TODO(philipj): serializer = {attribute};
+ serializer = {attribute};
};
diff --git a/core/timing/PerformanceNavigationTiming.idl b/core/timing/PerformanceNavigationTiming.idl
new file mode 100644
index 0000000..973206a
--- /dev/null
+++ b/core/timing/PerformanceNavigationTiming.idl
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium 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/navigation-timing/#sec-PerformanceNavigationTiming
+
+enum NavigationType {
+ "navigate",
+ "reload",
+ "back_forward",
+ "prerender"
+};
+[
+ RuntimeEnabled=PerformanceNavigationTiming2
+] interface PerformanceNavigationTiming : PerformanceResourceTiming {
+ readonly attribute DOMHighResTimeStamp unloadEventStart;
+ readonly attribute DOMHighResTimeStamp unloadEventEnd;
+ readonly attribute DOMHighResTimeStamp domInteractive;
+ readonly attribute DOMHighResTimeStamp domContentLoadedEventStart;
+ readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd;
+ readonly attribute DOMHighResTimeStamp domComplete;
+ readonly attribute DOMHighResTimeStamp loadEventStart;
+ readonly attribute DOMHighResTimeStamp loadEventEnd;
+ readonly attribute NavigationType type;
+ readonly attribute unsigned short redirectCount;
+ serializer = {inherit, attribute};
+};
diff --git a/core/timing/PerformanceObserver.idl b/core/timing/PerformanceObserver.idl
index de04cb9..026eeab 100644
--- a/core/timing/PerformanceObserver.idl
+++ b/core/timing/PerformanceObserver.idl
@@ -2,14 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://w3c.github.io/performance-timeline/#idl-def-PerformanceObserverCallback
+// https://w3c.github.io/performance-timeline/#idl-def-PerformanceObserverCallback
callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer);
-// http://w3c.github.io/performance-timeline/#the-performance-observer-interface
+// https://w3c.github.io/performance-timeline/#the-performance-observer-interface
[
- CustomConstructor(PerformanceObserverCallback callback),
- RuntimeEnabled=PerformanceObserver,
- GarbageCollected,
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Constructor(PerformanceObserverCallback callback),
+ ConstructorCallWith=ScriptState,
+ Exposed=(Window,Worker)
] interface PerformanceObserver {
[RaisesException] void observe(PerformanceObserverInit options);
void disconnect();
diff --git a/core/timing/PerformanceObserverEntryList.idl b/core/timing/PerformanceObserverEntryList.idl
index 0d34346..763a536 100644
--- a/core/timing/PerformanceObserverEntryList.idl
+++ b/core/timing/PerformanceObserverEntryList.idl
@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://w3c.github.io/performance-timeline/#the-performance-observer-interface
+// https://w3c.github.io/performance-timeline/#the-performance-observer-interface
[
- RuntimeEnabled=PerformanceObserver,
- Exposed=(Window,Worker),
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface PerformanceObserverEntryList {
- // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+ // TODO(foolip): getEntries() should take an optional FilterOptions argument.
sequence<PerformanceEntry> getEntries();
sequence<PerformanceEntry> getEntriesByType(DOMString entryType);
sequence<PerformanceEntry> getEntriesByName(DOMString name, optional DOMString entryType = null);
diff --git a/core/timing/PerformanceObserverInit.idl b/core/timing/PerformanceObserverInit.idl
index 635a31c..bb4bfd7 100644
--- a/core/timing/PerformanceObserverInit.idl
+++ b/core/timing/PerformanceObserverInit.idl
@@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://w3c.github.io/performance-timeline/#the-performance-observer-interface
-[
- RuntimeEnabled=PerformanceObserver,
-] dictionary PerformanceObserverInit {
+// https://w3c.github.io/performance-timeline/#the-performance-observer-interface
+
+dictionary PerformanceObserverInit {
required sequence<DOMString> entryTypes;
};
diff --git a/core/timing/PerformancePaintTiming.idl b/core/timing/PerformancePaintTiming.idl
new file mode 100644
index 0000000..5289d47
--- /dev/null
+++ b/core/timing/PerformancePaintTiming.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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/WICG/paint-timing
+
+[
+ RuntimeEnabled=PerformancePaintTiming
+] interface PerformancePaintTiming : PerformanceEntry {
+};
diff --git a/core/timing/PerformanceRenderTiming.idl b/core/timing/PerformanceRenderTiming.idl
deleted file mode 100644
index eafd490..0000000
--- a/core/timing/PerformanceRenderTiming.idl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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
- * 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/frame-timing/#performancerendertiming
-
-[
- 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 d9a7cce..3005a6e 100644
--- a/core/timing/PerformanceResourceTiming.idl
+++ b/core/timing/PerformanceResourceTiming.idl
@@ -30,11 +30,11 @@
// https://w3c.github.io/resource-timing/#performanceresourcetiming
-// TODO(philipj): This interface should be [Exposed=(Window,Worker)].
+[Exposed=(Window,Worker)]
interface PerformanceResourceTiming : PerformanceEntry {
readonly attribute DOMString initiatorType;
- // TODO(philipj): readonly attribute DOMString nextHopProtocol;
- [RuntimeEnabled=ServiceWorkerPerformanceTimeline] readonly attribute DOMHighResTimeStamp workerStart;
+ readonly attribute DOMString nextHopProtocol;
+ readonly attribute DOMHighResTimeStamp workerStart;
readonly attribute DOMHighResTimeStamp redirectStart;
readonly attribute DOMHighResTimeStamp redirectEnd;
readonly attribute DOMHighResTimeStamp fetchStart;
@@ -46,10 +46,10 @@
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;
+ [MeasureAs=PerformanceResourceTimingSizes] readonly attribute unsigned long long transferSize;
+ [MeasureAs=PerformanceResourceTimingSizes] readonly attribute unsigned long long encodedBodySize;
+ [MeasureAs=PerformanceResourceTimingSizes] readonly attribute unsigned long long decodedBodySize;
+ [RuntimeEnabled=ServerTiming] readonly attribute FrozenArray<PerformanceServerTiming> serverTiming;
+ // TODO(foolip): The spec has a serializer:
// serializer = {inherit, attribute};
};
diff --git a/core/timing/PerformanceServerTiming.idl b/core/timing/PerformanceServerTiming.idl
new file mode 100644
index 0000000..3bc1dbd
--- /dev/null
+++ b/core/timing/PerformanceServerTiming.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/server-timing/
+
+[
+ RuntimeEnabled=ServerTiming,
+ Exposed=(Window,Worker)
+] interface PerformanceServerTiming {
+ readonly attribute DOMString name;
+ readonly attribute DOMHighResTimeStamp duration;
+ readonly attribute DOMString description;
+ serializer = {attribute};
+};
diff --git a/core/timing/PerformanceTiming.idl b/core/timing/PerformanceTiming.idl
index 2a7bcc7..cefa9ed 100644
--- a/core/timing/PerformanceTiming.idl
+++ b/core/timing/PerformanceTiming.idl
@@ -30,9 +30,10 @@
// https://w3c.github.io/navigation-timing/#the-performancetiming-interface
+// Legacy support for NT1(https://www.w3.org/TR/navigation-timing/).
+
[
- Exposed=Window,
- GarbageCollected
+ Exposed=Window
] interface PerformanceTiming {
readonly attribute unsigned long long navigationStart;
readonly attribute unsigned long long unloadEventStart;
diff --git a/core/timing/SharedWorkerPerformance.idl b/core/timing/SharedWorkerPerformance.idl
deleted file mode 100644
index 8010681..0000000
--- a/core/timing/SharedWorkerPerformance.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2014, Opera Software ASA. 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 Opera Software ASA 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 HOLDER 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.
- */
-
-// 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 {
- [CallWith=ExecutionContext, Measure] readonly attribute DOMHighResTimeStamp workerStart;
-};
diff --git a/core/timing/TaskAttributionTiming.idl b/core/timing/TaskAttributionTiming.idl
new file mode 100644
index 0000000..e1ee405
--- /dev/null
+++ b/core/timing/TaskAttributionTiming.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/wicg/longtasks
+interface TaskAttributionTiming : PerformanceEntry {
+ [RuntimeEnabled=LongTaskV2] readonly attribute DOMString scriptURL;
+ readonly attribute DOMString containerType;
+ readonly attribute DOMString containerSrc;
+ readonly attribute DOMString containerId;
+ readonly attribute DOMString containerName;
+};
diff --git a/core/timing/WindowPerformance.idl b/core/timing/WindowPerformance.idl
index 209a4cd..e660507 100644
--- a/core/timing/WindowPerformance.idl
+++ b/core/timing/WindowPerformance.idl
@@ -4,10 +4,10 @@
// https://w3c.github.io/hr-time/#the-performance-interface
-// TODO(philipj): This should be a GlobalPerformance interface implemented by
+// TODO(foolip): This should be a GlobalPerformance interface implemented by
// Window and WorkerGlobalScope.
[
- ImplementedAs=DOMWindowPerformance,
+ ImplementedAs=DOMWindowPerformance
] partial interface Window {
[Replaceable] readonly attribute Performance performance;
};
diff --git a/core/timing/WorkerGlobalScopePerformance.idl b/core/timing/WorkerGlobalScopePerformance.idl
index d283fd8..2961d5f 100644
--- a/core/timing/WorkerGlobalScopePerformance.idl
+++ b/core/timing/WorkerGlobalScopePerformance.idl
@@ -30,8 +30,10 @@
// https://w3c.github.io/hr-time/#the-performance-interface
-// TODO(philipj): This should be a GlobalPerformance interface implemented by
+// TODO(foolip): This should be a GlobalPerformance interface implemented by
// Window and WorkerGlobalScope.
-partial interface WorkerGlobalScope {
+[
+ ImplementedAs=WorkerGlobalScopePerformance
+] partial interface WorkerGlobalScope {
readonly attribute WorkerPerformance performance;
};
diff --git a/core/timing/WorkerPerformance.idl b/core/timing/WorkerPerformance.idl
index b3ac8ac..eed8db1 100644
--- a/core/timing/WorkerPerformance.idl
+++ b/core/timing/WorkerPerformance.idl
@@ -30,37 +30,37 @@
// 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
+// TODO(foolip): This interface should be merged into Performance.
+// TODO(foolip): None of the optional DOMString arguments in this interface
// should have a default value.
[
- GarbageCollected,
NoInterfaceObject
] interface WorkerPerformance : EventTarget {
DOMHighResTimeStamp now();
+ readonly attribute DOMHighResTimeStamp timeOrigin;
// 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);
+ // TODO(foolip): getEntries() should take an optional FilterOptions argument.
+ PerformanceEntryList getEntries();
+ PerformanceEntryList getEntriesByType(DOMString entryType);
+ PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType = null);
// Resource Timing
// https://w3c.github.io/resource-timing/#extensions-performance-interface
- [RuntimeEnabled=ServiceWorkerPerformanceTimeline] void clearResourceTimings();
- [RuntimeEnabled=ServiceWorkerPerformanceTimeline] void setResourceTimingBufferSize(unsigned long maxSize);
- [RuntimeEnabled=ServiceWorkerPerformanceTimeline] attribute EventHandler onresourcetimingbufferfull;
+ void clearResourceTimings();
+ void setResourceTimingBufferSize(unsigned long maxSize);
+ attribute EventHandler onresourcetimingbufferfull;
// 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);
+ [RaisesException] void mark(DOMString markName);
+ 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);
+ [RaisesException] void measure(DOMString measureName, optional DOMString startMark = null, optional DOMString endMark = null);
+ void clearMeasures(optional DOMString measureName = null);
- // TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+ // TODO(foolip): 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/typed_arrays/ArrayBuffer.idl b/core/typed_arrays/ArrayBuffer.idl
new file mode 100644
index 0000000..bddb19f
--- /dev/null
+++ b/core/typed_arrays/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.
+
+// http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor
+
+[
+ ImplementedAs=DOMArrayBuffer,
+ NoInterfaceObject
+] interface ArrayBuffer {
+ readonly attribute unsigned long byteLength;
+};
diff --git a/core/typed_arrays/ArrayBufferView.idl b/core/typed_arrays/ArrayBufferView.idl
new file mode 100644
index 0000000..73b264a
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/DataView.idl b/core/typed_arrays/DataView.idl
new file mode 100644
index 0000000..8723dc1
--- /dev/null
+++ b/core/typed_arrays/DataView.idl
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+// https://www.khronos.org/registry/typedarray/specs/latest/#DATAVIEW
+
+[
+ ImplementedAs=DOMDataView
+] interface DataView : ArrayBufferView {
+};
diff --git a/core/typed_arrays/Float32Array.idl b/core/typed_arrays/Float32Array.idl
new file mode 100644
index 0000000..bcc4d0e
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Float64Array.idl b/core/typed_arrays/Float64Array.idl
new file mode 100644
index 0000000..5652637
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Int16Array.idl b/core/typed_arrays/Int16Array.idl
new file mode 100644
index 0000000..d71aa23
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Int32Array.idl b/core/typed_arrays/Int32Array.idl
new file mode 100644
index 0000000..67da272
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Int8Array.idl b/core/typed_arrays/Int8Array.idl
new file mode 100644
index 0000000..694a0e4
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/SharedArrayBuffer.idl b/core/typed_arrays/SharedArrayBuffer.idl
new file mode 100644
index 0000000..08a5a86
--- /dev/null
+++ b/core/typed_arrays/SharedArrayBuffer.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.
+
+// Draft spec: https://github.com/lars-t-hansen/ecmascript_sharedmem
+[
+ ImplementedAs=DOMSharedArrayBuffer,
+ NoInterfaceObject,
+ RuntimeEnabled=SharedArrayBuffer
+] interface SharedArrayBuffer {
+ readonly attribute unsigned long byteLength;
+};
diff --git a/core/typed_arrays/Uint16Array.idl b/core/typed_arrays/Uint16Array.idl
new file mode 100644
index 0000000..d9b19a2
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Uint32Array.idl b/core/typed_arrays/Uint32Array.idl
new file mode 100644
index 0000000..d9b34d9
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Uint8Array.idl b/core/typed_arrays/Uint8Array.idl
new file mode 100644
index 0000000..e677e0b
--- /dev/null
+++ b/core/typed_arrays/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/typed_arrays/Uint8ClampedArray.idl b/core/typed_arrays/Uint8ClampedArray.idl
new file mode 100644
index 0000000..ed6c346
--- /dev/null
+++ b/core/typed_arrays/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/url/URL.idl b/core/url/URL.idl
new file mode 100644
index 0000000..1537b4c
--- /dev/null
+++ b/core/url/URL.idl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Motorola Mobility Inc.
+ *
+ * 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.
+ */
+
+// https://url.spec.whatwg.org/#url
+
+[
+ Constructor(USVString url, optional USVString base),
+ Exposed=(Window,Worker),
+ ImplementedAs=DOMURL,
+ RaisesException=Constructor
+] interface URL {
+ // TODO(foolip): Implement domainToASCII() and domainToUnicode().
+ // crbug.com/493908
+ // static USVString domainToASCII(USVString domain);
+ // static USVString domainToUnicode(USVString domain);
+
+ stringifier attribute USVString href;
+ readonly attribute USVString origin;
+
+ attribute USVString protocol;
+ attribute USVString username;
+ attribute USVString password;
+ attribute USVString host;
+ attribute USVString hostname;
+ attribute USVString port;
+ attribute USVString pathname;
+ attribute USVString search;
+ readonly attribute URLSearchParams searchParams;
+ attribute USVString hash;
+};
diff --git a/core/url/URLSearchParams.idl b/core/url/URLSearchParams.idl
new file mode 100644
index 0000000..c9148aa
--- /dev/null
+++ b/core/url/URLSearchParams.idl
@@ -0,0 +1,23 @@
+// 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://url.spec.whatwg.org/#interface-urlsearchparams
+
+[
+ Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""),
+ Exposed=(Window,Worker),
+ RaisesException=Constructor
+] interface URLSearchParams {
+ void append(USVString name, USVString value);
+ [ImplementedAs=deleteAllWithName] void delete(USVString name);
+ USVString? get(USVString name);
+ sequence<USVString> getAll(USVString name);
+ boolean has(USVString name);
+ void set(USVString name, USVString value);
+
+ void sort();
+
+ iterable<USVString, USVString>;
+ stringifier;
+};
diff --git a/core/url/URLUtilsReadOnly.idl b/core/url/URLUtilsReadOnly.idl
new file mode 100644
index 0000000..4b15bf8
--- /dev/null
+++ b/core/url/URLUtilsReadOnly.idl
@@ -0,0 +1,45 @@
+/*
+ * 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:
+ * 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.
+ */
+
+// This interface was defined independently in the WHATWG URL spec, but has
+// been removed from it in
+// https://github.com/whatwg/url/commit/c2877946857bc904ecb8a5805abc423c82d9da98.
+// It's now inlined in the users. See crbug.com/699873.
+
+[
+ NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker)
+] interface URLUtilsReadOnly {
+ stringifier readonly attribute USVString href;
+ readonly attribute USVString origin;
+
+ 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/workers/AbstractWorker.idl b/core/workers/AbstractWorker.idl
index c88428d..0b9f596 100644
--- a/core/workers/AbstractWorker.idl
+++ b/core/workers/AbstractWorker.idl
@@ -34,8 +34,7 @@
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
- Exposed=(Window,Worker),
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface AbstractWorker {
attribute EventHandler onerror;
};
diff --git a/core/workers/DedicatedWorkerGlobalScope.idl b/core/workers/DedicatedWorkerGlobalScope.idl
index 1fe2730..3e9922e 100644
--- a/core/workers/DedicatedWorkerGlobalScope.idl
+++ b/core/workers/DedicatedWorkerGlobalScope.idl
@@ -32,8 +32,12 @@
[
Global=(Worker,DedicatedWorker),
- Exposed=DedicatedWorker,
+ Exposed=DedicatedWorker
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
- [PostMessage, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException] void postMessage(any message, optional sequence<object> transfer = []);
+
+ void close();
+
attribute EventHandler onmessage;
+ attribute EventHandler onmessageerror;
};
diff --git a/core/workers/SharedWorker.idl b/core/workers/SharedWorker.idl
index 3cb45e7..9e56013 100644
--- a/core/workers/SharedWorker.idl
+++ b/core/workers/SharedWorker.idl
@@ -32,14 +32,14 @@
// https://html.spec.whatwg.org/#shared-workers-and-the-sharedworker-interface
[
- DependentLifetime,
- // TODO(philipj): The name argument should not have a default null value.
+ ActiveScriptWrappable,
+ // TODO(foolip): The name argument should not have a default null value.
Constructor(DOMString scriptURL, optional DOMString name = null),
ConstructorCallWith=ExecutionContext,
- GarbageCollected,
- // TODO(philipj): Exposed=(Window,Worker),
+ DependentLifetime,
+ // TODO(foolip): Exposed=(Window,Worker),
RaisesException=Constructor,
- RuntimeEnabled=SharedWorker,
+ RuntimeEnabled=SharedWorker
] interface SharedWorker : EventTarget {
readonly attribute MessagePort port;
};
diff --git a/core/workers/SharedWorkerGlobalScope.idl b/core/workers/SharedWorkerGlobalScope.idl
index abc4aaf..9b3d13b 100644
--- a/core/workers/SharedWorkerGlobalScope.idl
+++ b/core/workers/SharedWorkerGlobalScope.idl
@@ -32,9 +32,12 @@
[
Global=(Worker,SharedWorker),
- Exposed=SharedWorker,
+ Exposed=SharedWorker
] interface SharedWorkerGlobalScope : WorkerGlobalScope {
readonly attribute DOMString name;
- // TODO(philipj): readonly attribute ApplicationCache applicationCache;
+ // TODO(foolip): readonly attribute ApplicationCache applicationCache;
+
+ void close();
+
attribute EventHandler onconnect;
};
diff --git a/core/workers/Worker.idl b/core/workers/Worker.idl
index 70e5235..90d429d 100644
--- a/core/workers/Worker.idl
+++ b/core/workers/Worker.idl
@@ -28,17 +28,17 @@
// https://html.spec.whatwg.org/#dedicated-workers-and-the-worker-interface
[
+ ActiveScriptWrappable,
DependentLifetime,
Constructor(DOMString scriptUrl),
ConstructorCallWith=ExecutionContext,
- GarbageCollected,
- // TODO(philipj): Exposed=(Window,Worker),
+ // TODO(foolip): Exposed=(Window,Worker),
RaisesException=Constructor,
+ ImplementedAs=DedicatedWorker
] interface Worker : EventTarget {
void terminate();
- // TODO(philipj): The SerializedScriptValue type should be any.
- [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException] void postMessage(any message, optional sequence<object> transfer);
attribute EventHandler onmessage;
};
diff --git a/core/workers/WorkerConsole.idl b/core/workers/WorkerConsole.idl
deleted file mode 100644
index 79d4f8b..0000000
--- a/core/workers/WorkerConsole.idl
+++ /dev/null
@@ -1,38 +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:
- *
- * 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.
- */
-
-// 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 1d3f4d5..1d50998 100644
--- a/core/workers/WorkerGlobalScope.idl
+++ b/core/workers/WorkerGlobalScope.idl
@@ -27,13 +27,15 @@
// https://html.spec.whatwg.org/#the-workerglobalscope-common-interface
[
+ ActiveScriptWrappable,
+ DependentLifetime,
Exposed=Worker,
+ ImmutablePrototype
] interface WorkerGlobalScope : EventTarget {
readonly attribute WorkerGlobalScope self;
readonly attribute WorkerLocation location;
- void close();
- // TODO(philipj): onerror should be an OnErrorEventHandler.
+ // TODO(foolip): onerror should be an OnErrorEventHandler.
attribute EventHandler onerror;
// attribute EventHandler onlanguagechange;
// attribute EventHandler onoffline;
@@ -43,14 +45,27 @@
[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;
+
+ // Console API
+ // https://console.spec.whatwg.org/#console-interface
+ // [Replaceable] readonly attribute Console console;
+ // Console is installed by v8 inspector when context is created
+ // and is left commented here just for documentation.
+
+ // CORS and RFC1918
+ // https://wicg.github.io/cors-rfc1918/#feature-detect
+ [RuntimeEnabled=CorsRFC1918, ImplementedAs=addressSpaceForBindings] readonly attribute AddressSpace addressSpace;
// Unhandled Promise Rejection Events
- // https://github.com/domenic/unhandled-rejections-browser-spec
- [RuntimeEnabled=PromiseRejectionEvent] attribute EventHandler onrejectionhandled;
- [RuntimeEnabled=PromiseRejectionEvent] attribute EventHandler onunhandledrejection;
+ attribute EventHandler onrejectionhandled;
+ attribute EventHandler onunhandledrejection;
+
+ // Secure Contexts
+ // https://w3c.github.io/webappsec-secure-contexts/#dom-windoworworkerglobalscope-issecurecontext
+ [ImplementedAs=isSecureContextForBindings] readonly attribute boolean isSecureContext;
+
+ // https://html.spec.whatwg.org/#windoworworkerglobalscope-mixin
+ [Replaceable] readonly attribute DOMString origin;
};
WorkerGlobalScope implements WindowBase64;
diff --git a/core/workers/WorkerLocation.idl b/core/workers/WorkerLocation.idl
index dd60b70..e271597 100644
--- a/core/workers/WorkerLocation.idl
+++ b/core/workers/WorkerLocation.idl
@@ -29,8 +29,7 @@
// https://html.spec.whatwg.org/#worker-locations
[
- Exposed=Worker,
- GarbageCollected,
+ Exposed=Worker
] interface WorkerLocation {
};
diff --git a/core/workers/WorkerNavigator.idl b/core/workers/WorkerNavigator.idl
index a910af5..1d9c714 100644
--- a/core/workers/WorkerNavigator.idl
+++ b/core/workers/WorkerNavigator.idl
@@ -29,12 +29,11 @@
// https://html.spec.whatwg.org/#the-workernavigator-object
[
- Exposed=Worker,
- GarbageCollected,
+ Exposed=Worker
] interface WorkerNavigator {
};
-WorkerNavigator implements NavigatorCPU;
+WorkerNavigator implements NavigatorConcurrentHardware;
WorkerNavigator implements NavigatorID;
-// TODO(philipj): WorkerNavigator implements NavigatorLanguage;
+// TODO(foolip): WorkerNavigator implements NavigatorLanguage;
WorkerNavigator implements NavigatorOnLine;
diff --git a/core/workers/Worklet.idl b/core/workers/Worklet.idl
new file mode 100644
index 0000000..73ded81
--- /dev/null
+++ b/core/workers/Worklet.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/worklets/#worklet
+
+[
+ DependentLifetime,
+ RuntimeEnabled=Worklet
+] interface Worklet {
+ [CallWith=ScriptState] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options);
+};
diff --git a/core/workers/WorkletGlobalScope.idl b/core/workers/WorkletGlobalScope.idl
new file mode 100644
index 0000000..6f5a127
--- /dev/null
+++ b/core/workers/WorkletGlobalScope.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/worklets/#workletglobalscope
+
+[
+ DependentLifetime,
+ ActiveScriptWrappable,
+ Exposed=Worklet,
+ RuntimeEnabled=Worklet,
+ ImmutablePrototype
+] interface WorkletGlobalScope {
+};
diff --git a/core/workers/WorkletOptions.idl b/core/workers/WorkletOptions.idl
new file mode 100644
index 0000000..5fcff7e
--- /dev/null
+++ b/core/workers/WorkletOptions.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://fetch.spec.whatwg.org/#requestcredentials
+// Copied from modules/fetch/Request.idl because it's not accessible from core/
+// directory.
+// TODO(nhiroki): Consider how to reuse the existing enum.
+enum RequestCredentials { "omit", "same-origin", "include" };
+
+// https://drafts.css-houdini.org/worklets/#dictdef-workletoptions
+dictionary WorkletOptions {
+ RequestCredentials credentials = "omit";
+};
diff --git a/core/xml/DOMParser.idl b/core/xml/DOMParser.idl
index f817255..5c7cc3f 100644
--- a/core/xml/DOMParser.idl
+++ b/core/xml/DOMParser.idl
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-// https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#the-domparser-interface
+// https://w3c.github.io/DOM-Parsing/#the-domparser-interface
enum SupportedType {
"text/html",
@@ -29,8 +29,7 @@
[
Constructor,
- ConstructorCallWith=Document,
- GarbageCollected,
+ ConstructorCallWith=Document
] interface DOMParser {
[NewObject] Document parseFromString(DOMString str, SupportedType type);
};
diff --git a/core/xml/DocumentXMLTreeViewer.idl b/core/xml/DocumentXMLTreeViewer.idl
deleted file mode 100644
index 150d440..0000000
--- a/core/xml/DocumentXMLTreeViewer.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.
-
-[
- NoImplHeader
-] partial interface Document {
- [ImplementedInPrivateScript, OnlyExposedToPrivateScript] void transformDocumentToTreeView(DOMString noStyleMessage);
-};
diff --git a/core/xml/DocumentXPathEvaluator.idl b/core/xml/DocumentXPathEvaluator.idl
index 5f47dc4..3a97f65 100644
--- a/core/xml/DocumentXPathEvaluator.idl
+++ b/core/xml/DocumentXPathEvaluator.idl
@@ -19,7 +19,9 @@
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
-partial interface Document {
+[
+ ImplementedAs=DocumentXPathEvaluator
+] partial interface Document {
[MeasureAs=DocumentXPathCreateExpression, RaisesException] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null);
[MeasureAs=DocumentXPathCreateNSResolver] XPathNSResolver createNSResolver(Node nodeResolver);
diff --git a/core/xml/XMLSerializer.idl b/core/xml/XMLSerializer.idl
index 9995b0e..531f4ba 100644
--- a/core/xml/XMLSerializer.idl
+++ b/core/xml/XMLSerializer.idl
@@ -18,11 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
-// https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#the-xmlserializer-interface
+// https://w3c.github.io/DOM-Parsing/#the-xmlserializer-interface
[
- Constructor,
- GarbageCollected,
+ Constructor
] interface XMLSerializer {
DOMString serializeToString(Node root);
};
diff --git a/core/xml/XPathEvaluator.idl b/core/xml/XPathEvaluator.idl
index 0210849..f9f735e 100644
--- a/core/xml/XPathEvaluator.idl
+++ b/core/xml/XPathEvaluator.idl
@@ -27,8 +27,7 @@
[
Constructor,
- GarbageCollected,
- Measure,
+ Measure
] interface XPathEvaluator {
[Measure, RaisesException] XPathExpression createExpression(DOMString expression, optional XPathNSResolver? resolver = null);
diff --git a/core/xml/XPathExpression.idl b/core/xml/XPathExpression.idl
index 3effc99..80d810f 100644
--- a/core/xml/XPathExpression.idl
+++ b/core/xml/XPathExpression.idl
@@ -20,8 +20,6 @@
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
-[
- GarbageCollected,
-] interface XPathExpression {
+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 e5888ee..cb45d03 100644
--- a/core/xml/XPathNSResolver.idl
+++ b/core/xml/XPathNSResolver.idl
@@ -20,13 +20,12 @@
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
-// TODO(philipj): XPathNSResolver should be a callback interface. The spec
+// TODO(foolip): 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
[
- GarbageCollected,
NoInterfaceObject
] interface XPathNSResolver {
DOMString? lookupNamespaceURI([Default=Undefined] optional DOMString prefix);
diff --git a/core/xml/XPathResult.idl b/core/xml/XPathResult.idl
index 319b719..0a87159 100644
--- a/core/xml/XPathResult.idl
+++ b/core/xml/XPathResult.idl
@@ -19,9 +19,7 @@
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
-[
- GarbageCollected
-] interface XPathResult {
+interface XPathResult {
// XPathResultType
const unsigned short ANY_TYPE = 0;
const unsigned short NUMBER_TYPE = 1;
diff --git a/core/xml/XSLTProcessor.idl b/core/xml/XSLTProcessor.idl
index b7b5158..ba796f2 100644
--- a/core/xml/XSLTProcessor.idl
+++ b/core/xml/XSLTProcessor.idl
@@ -31,20 +31,19 @@
// https://hg.mozilla.org/mozilla-central/file/012853bd80b7/dom/webidl/XSLTProcessor.webidl
[
- GarbageCollected,
Constructor,
ConstructorCallWith=Document,
RuntimeEnabled=XSLT,
- MeasureAs=XSLTProcessor,
+ MeasureAs=XSLTProcessor
] interface XSLTProcessor {
void importStylesheet(Node style);
- // TODO(philipj): In Gecko, the transformTo*() methods throw an exception in
+ // TODO(foolip): 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);
- // TODO(philipj): In Gecko, it's possible to set and get back any parameter
+ // TODO(foolip): 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);
diff --git a/core/xmlhttprequest/XMLHttpRequest.idl b/core/xmlhttprequest/XMLHttpRequest.idl
index 28d9452..1b9d315 100644
--- a/core/xmlhttprequest/XMLHttpRequest.idl
+++ b/core/xmlhttprequest/XMLHttpRequest.idl
@@ -35,15 +35,15 @@
"document",
"json",
"text",
- "legacystream",
};
-// TODO(philipj): Most DOMString types in the XMLHttpRequest interface should be
+// TODO(foolip): Most DOMString types in the XMLHttpRequest interface should be
// either ByteString or USVString.
[
- DependentLifetime,
+ ActiveScriptWrappable,
Constructor,
ConstructorCallWith=ScriptState,
+ DependentLifetime,
Exposed=(Window,DedicatedWorker,SharedWorker)
] interface XMLHttpRequest : XMLHttpRequestEventTarget {
// event handler
@@ -64,9 +64,9 @@
[RaisesException=Setter] attribute unsigned long timeout;
[RaisesException=Setter] attribute boolean withCredentials;
readonly attribute XMLHttpRequestUpload upload;
- // TODO(philipj): The data argument should be of type
+ // TODO(foolip): 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);
+ [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob or Document or DOMString or FormData or URLSearchParams)? body = null);
void abort();
// response
@@ -79,6 +79,6 @@
[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].
+ // TODO(foolip): responseXML should be [Exposed=Window].
[RaisesException=Getter] readonly attribute Document? responseXML;
};
diff --git a/core/xmlhttprequest/XMLHttpRequestEventTarget.idl b/core/xmlhttprequest/XMLHttpRequestEventTarget.idl
index 154a1a5..3a16c77 100644
--- a/core/xmlhttprequest/XMLHttpRequestEventTarget.idl
+++ b/core/xmlhttprequest/XMLHttpRequestEventTarget.idl
@@ -27,7 +27,6 @@
// https://xhr.spec.whatwg.org/#xmlhttprequesteventtarget
[
- GarbageCollected,
Exposed=(Window,DedicatedWorker,SharedWorker)
] interface XMLHttpRequestEventTarget : EventTarget {
// event handlers
diff --git a/modules/accessibility/testing/InternalsAccessibility.idl b/modules/accessibility/testing/InternalsAccessibility.idl
index 90c1c8a..b056677 100644
--- a/modules/accessibility/testing/InternalsAccessibility.idl
+++ b/modules/accessibility/testing/InternalsAccessibility.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.
-partial interface Internals {
+[
+ ImplementedAs=InternalsAccessibility
+] partial interface Internals {
unsigned long numberOfLiveAXObjects();
};
diff --git a/modules/app_banner/AppBannerPromptResult.idl b/modules/app_banner/AppBannerPromptResult.idl
index 6ac8395..51804cb 100644
--- a/modules/app_banner/AppBannerPromptResult.idl
+++ b/modules/app_banner/AppBannerPromptResult.idl
@@ -4,10 +4,7 @@
enum AppBannerPromptOutcome { "accepted", "dismissed" };
-[
- GarbageCollected,
- RuntimeEnabled=AppBanner,
-] interface AppBannerPromptResult {
- readonly attribute DOMString platform;
- readonly attribute AppBannerPromptOutcome outcome;
+dictionary AppBannerPromptResult {
+ required DOMString platform;
+ required AppBannerPromptOutcome outcome;
};
diff --git a/modules/app_banner/BeforeInstallPromptEvent.idl b/modules/app_banner/BeforeInstallPromptEvent.idl
index 691aa0c..83cd1b8 100644
--- a/modules/app_banner/BeforeInstallPromptEvent.idl
+++ b/modules/app_banner/BeforeInstallPromptEvent.idl
@@ -3,10 +3,12 @@
// found in the LICENSE file.
[
+ ActiveScriptWrappable,
+ DependentLifetime,
Constructor(DOMString type, optional BeforeInstallPromptEventInit eventInitDict),
- RuntimeEnabled=AppBanner,
+ ConstructorCallWith=ExecutionContext
] interface BeforeInstallPromptEvent : Event {
- readonly attribute sequence<DOMString> platforms;
- [CallWith=ScriptState] readonly attribute Promise<DOMString> userChoice;
+ readonly attribute FrozenArray<DOMString> platforms;
+ [CallWith=ScriptState] readonly attribute Promise<AppBannerPromptResult> userChoice;
[CallWith=ScriptState] Promise<void> prompt();
};
diff --git a/modules/app_banner/WindowInstallation.idl b/modules/app_banner/WindowInstallation.idl
new file mode 100644
index 0000000..db86387
--- /dev/null
+++ b/modules/app_banner/WindowInstallation.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/appmanifest/#extensions-to-the-window-object
+
+[
+ ImplementedAs=DOMWindowInstallation
+] partial interface Window {
+ attribute EventHandler onappinstalled;
+ attribute EventHandler onbeforeinstallprompt;
+};
diff --git a/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl b/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl
index b8a3195..a6f5a2f 100644
--- a/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl
+++ b/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.idl
@@ -4,7 +4,9 @@
// https://w3c.github.io/mediacapture-output/#htmlmediaelement-extensions
-partial interface HTMLMediaElement {
+[
+ ImplementedAs=HTMLMediaElementAudioOutputDevice
+] partial interface HTMLMediaElement {
[RuntimeEnabled=AudioOutputDevices] readonly attribute DOMString sinkId;
[RuntimeEnabled=AudioOutputDevices, CallWith=ScriptState] Promise<void> setSinkId(DOMString sinkId);
};
diff --git a/modules/background_fetch/BackgroundFetchClickEvent.idl b/modules/background_fetch/BackgroundFetchClickEvent.idl
new file mode 100644
index 0000000..0859160
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchClickEvent.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-click-event
+
+enum BackgroundFetchState { "pending", "succeeded", "failed" };
+
+[
+ Constructor(DOMString type, BackgroundFetchClickEventInit init),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchClickEvent : BackgroundFetchEvent {
+ readonly attribute BackgroundFetchState state;
+};
diff --git a/modules/background_fetch/BackgroundFetchClickEventInit.idl b/modules/background_fetch/BackgroundFetchClickEventInit.idl
new file mode 100644
index 0000000..cf1cb86
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchClickEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-click-event
+
+dictionary BackgroundFetchClickEventInit : BackgroundFetchEventInit {
+ required BackgroundFetchState state;
+};
diff --git a/modules/background_fetch/BackgroundFetchEvent.idl b/modules/background_fetch/BackgroundFetchEvent.idl
new file mode 100644
index 0000000..632db60
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchEvent.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-event
+
+[
+ Constructor(DOMString type, BackgroundFetchEventInit init),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchEvent : ExtendableEvent {
+ readonly attribute DOMString id;
+};
diff --git a/modules/background_fetch/BackgroundFetchEventInit.idl b/modules/background_fetch/BackgroundFetchEventInit.idl
new file mode 100644
index 0000000..24194f4
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-event
+
+dictionary BackgroundFetchEventInit : ExtendableEventInit {
+ required DOMString id;
+};
diff --git a/modules/background_fetch/BackgroundFetchFailEvent.idl b/modules/background_fetch/BackgroundFetchFailEvent.idl
new file mode 100644
index 0000000..1f86f8e
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchFailEvent.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-fail-event
+
+[
+ Constructor(DOMString type, BackgroundFetchFailEventInit init),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchFailEvent : BackgroundFetchEvent {
+ readonly attribute FrozenArray<BackgroundFetchSettledFetch> fetches;
+};
diff --git a/modules/background_fetch/BackgroundFetchFailEventInit.idl b/modules/background_fetch/BackgroundFetchFailEventInit.idl
new file mode 100644
index 0000000..69b314c
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchFailEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-fail-event
+
+dictionary BackgroundFetchFailEventInit : BackgroundFetchEventInit {
+ required sequence<BackgroundFetchSettledFetch> fetches;
+};
diff --git a/modules/background_fetch/BackgroundFetchFetch.idl b/modules/background_fetch/BackgroundFetchFetch.idl
new file mode 100644
index 0000000..c87e156
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchFetch.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#backgroundfetchfetch
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchFetch {
+ readonly attribute Request request;
+};
diff --git a/modules/background_fetch/BackgroundFetchManager.idl b/modules/background_fetch/BackgroundFetchManager.idl
new file mode 100644
index 0000000..12e59cc
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchManager.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-manager
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchManager {
+ [CallWith=ScriptState, RaisesException] Promise<BackgroundFetchRegistration> fetch(DOMString id, (RequestInfo or sequence<RequestInfo>) requests, optional BackgroundFetchOptions options);
+ [CallWith=ScriptState] Promise<BackgroundFetchRegistration?> get(DOMString id);
+ [CallWith=ScriptState] Promise<FrozenArray<DOMString>> getIds();
+};
diff --git a/modules/background_fetch/BackgroundFetchOptions.idl b/modules/background_fetch/BackgroundFetchOptions.idl
new file mode 100644
index 0000000..408371e
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchOptions.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-manager
+
+dictionary BackgroundFetchOptions {
+ sequence<IconDefinition> icons = [];
+ DOMString title = "";
+ [ImplementedAs=downloadTotal] unsigned long long totalDownloadSize = 0;
+ unsigned long long downloadTotal = 0;
+};
diff --git a/modules/background_fetch/BackgroundFetchRegistration.idl b/modules/background_fetch/BackgroundFetchRegistration.idl
new file mode 100644
index 0000000..07356fe
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchRegistration.idl
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-registration
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchRegistration : EventTarget {
+ readonly attribute DOMString id;
+ readonly attribute unsigned long long uploadTotal;
+ readonly attribute unsigned long long uploaded;
+ readonly attribute unsigned long long downloadTotal;
+ readonly attribute unsigned long long downloaded;
+ // TODO(crbug.com/699957): Implement the `activeFetches` attribute.
+
+ attribute EventHandler onprogress;
+
+ [CallWith=ScriptState] Promise<bool> abort();
+
+ // TODO(crbug.com/769770): Remove the following deprecated attributes.
+ readonly attribute FrozenArray<IconDefinition> icons;
+ [ImplementedAs=downloadTotal] readonly attribute long totalDownloadSize;
+ readonly attribute DOMString title;
+};
diff --git a/modules/background_fetch/BackgroundFetchSettledFetch.idl b/modules/background_fetch/BackgroundFetchSettledFetch.idl
new file mode 100644
index 0000000..74090be
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchSettledFetch.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#backgroundfetchsettledfetch
+
+[
+ Constructor(Request request, Response response),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchSettledFetch : BackgroundFetchFetch {
+ readonly attribute Response? response;
+};
diff --git a/modules/background_fetch/BackgroundFetchedEvent.idl b/modules/background_fetch/BackgroundFetchedEvent.idl
new file mode 100644
index 0000000..2226821
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchedEvent.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-end-event
+
+[
+ Constructor(DOMString type, BackgroundFetchedEventInit init),
+ Exposed=ServiceWorker,
+ RuntimeEnabled=BackgroundFetch
+] interface BackgroundFetchedEvent : BackgroundFetchEvent {
+ readonly attribute FrozenArray<BackgroundFetchSettledFetch> fetches;
+
+ [CallWith=ScriptState] Promise<void> updateUI(DOMString title);
+};
diff --git a/modules/background_fetch/BackgroundFetchedEventInit.idl b/modules/background_fetch/BackgroundFetchedEventInit.idl
new file mode 100644
index 0000000..68d6f68
--- /dev/null
+++ b/modules/background_fetch/BackgroundFetchedEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-end-event
+
+dictionary BackgroundFetchedEventInit : BackgroundFetchEventInit {
+ required sequence<BackgroundFetchSettledFetch> fetches;
+};
diff --git a/modules/background_fetch/IconDefinition.idl b/modules/background_fetch/IconDefinition.idl
new file mode 100644
index 0000000..8fc31b5
--- /dev/null
+++ b/modules/background_fetch/IconDefinition.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#background-fetch-manager
+
+dictionary IconDefinition {
+ DOMString src;
+ DOMString sizes;
+ DOMString type;
+};
diff --git a/modules/background_fetch/ServiceWorkerGlobalScopeBackgroundFetch.idl b/modules/background_fetch/ServiceWorkerGlobalScopeBackgroundFetch.idl
new file mode 100644
index 0000000..1932259
--- /dev/null
+++ b/modules/background_fetch/ServiceWorkerGlobalScopeBackgroundFetch.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#events
+
+[
+ ImplementedAs=ServiceWorkerGlobalScopeBackgroundFetch,
+ RuntimeEnabled=BackgroundFetch
+] partial interface ServiceWorkerGlobalScope {
+ attribute EventHandler onbackgroundfetched;
+ attribute EventHandler onbackgroundfetchfail;
+ attribute EventHandler onbackgroundfetchabort;
+ attribute EventHandler onbackgroundfetchclick;
+};
diff --git a/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.idl b/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.idl
new file mode 100644
index 0000000..a1d9dee
--- /dev/null
+++ b/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/background-fetch/#extensions-to-service-worker-registration
+
+[
+ Exposed=(Window,Worker),
+ ImplementedAs=ServiceWorkerRegistrationBackgroundFetch,
+ RuntimeEnabled=BackgroundFetch
+] partial interface ServiceWorkerRegistration {
+ readonly attribute BackgroundFetchManager backgroundFetch;
+};
diff --git a/modules/background_sync/ServiceWorkerGlobalScopeSync.idl b/modules/background_sync/ServiceWorkerGlobalScopeSync.idl
index 0860b81..517376a 100644
--- a/modules/background_sync/ServiceWorkerGlobalScopeSync.idl
+++ b/modules/background_sync/ServiceWorkerGlobalScopeSync.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- RuntimeEnabled=BackgroundSync,
+ ImplementedAs=ServiceWorkerGlobalScopeSync
] partial interface ServiceWorkerGlobalScope {
attribute EventHandler onsync;
};
diff --git a/modules/background_sync/ServiceWorkerRegistrationSync.idl b/modules/background_sync/ServiceWorkerRegistrationSync.idl
index 0620451..030feaa 100644
--- a/modules/background_sync/ServiceWorkerRegistrationSync.idl
+++ b/modules/background_sync/ServiceWorkerRegistrationSync.idl
@@ -3,8 +3,8 @@
// found in the LICENSE file.
[
- Exposed=(Window, ServiceWorker),
- RuntimeEnabled=BackgroundSync,
+ Exposed=(Window,Worker),
+ ImplementedAs=ServiceWorkerRegistrationSync
] partial interface ServiceWorkerRegistration {
[MeasureAs=BackgroundSync] readonly attribute SyncManager sync;
};
diff --git a/modules/background_sync/SyncEvent.idl b/modules/background_sync/SyncEvent.idl
index f663de0..7a80e3f 100644
--- a/modules/background_sync/SyncEvent.idl
+++ b/modules/background_sync/SyncEvent.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://wicg.github.io/BackgroundSync/spec/#sync-event
+
[
Constructor(DOMString type, SyncEventInit init),
- Exposed=ServiceWorker,
- RuntimeEnabled=BackgroundSync,
+ Exposed=ServiceWorker
] interface SyncEvent : ExtendableEvent {
readonly attribute DOMString tag;
readonly attribute boolean lastChance;
diff --git a/modules/background_sync/SyncEventInit.idl b/modules/background_sync/SyncEventInit.idl
index 1a2a804..cd2b118 100644
--- a/modules/background_sync/SyncEventInit.idl
+++ b/modules/background_sync/SyncEventInit.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://wicg.github.io/BackgroundSync/spec/#sync-event
+
dictionary SyncEventInit : ExtendableEventInit {
required DOMString tag;
boolean lastChance = false;
diff --git a/modules/background_sync/SyncManager.idl b/modules/background_sync/SyncManager.idl
index 16899c1..d3d1ad0 100644
--- a/modules/background_sync/SyncManager.idl
+++ b/modules/background_sync/SyncManager.idl
@@ -2,17 +2,11 @@
// 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"
-};
+// https://wicg.github.io/BackgroundSync/spec/#sync-manager-interface
[
- Exposed=(Window,ServiceWorker),
- GarbageCollected,
- RuntimeEnabled=BackgroundSync,
+ Exposed=(Window,Worker)
] interface SyncManager {
- [MeasureAs=BackgroundSyncRegister,CallWith=(ScriptState,ExecutionContext),ImplementedAs=registerFunction] Promise<void> register(DOMString tag);
+ [MeasureAs=BackgroundSyncRegister,CallWith=ScriptState,ImplementedAs=registerFunction] Promise<void> register(DOMString tag);
[CallWith=ScriptState] Promise<sequence<DOMString>> getTags();
};
diff --git a/modules/battery/BatteryManager.idl b/modules/battery/BatteryManager.idl
index 26eebff..48a8f7d 100644
--- a/modules/battery/BatteryManager.idl
+++ b/modules/battery/BatteryManager.idl
@@ -2,8 +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/dap/raw-file/tip/battery/Overview.html#batterymanager-interface
+// https://w3c.github.io/battery/#the-batterymanager-interface
[
+ ActiveScriptWrappable,
DependentLifetime
] interface BatteryManager : EventTarget {
readonly attribute boolean charging;
diff --git a/modules/battery/NavigatorBattery.idl b/modules/battery/NavigatorBattery.idl
index e3950a6..35a0548 100644
--- a/modules/battery/NavigatorBattery.idl
+++ b/modules/battery/NavigatorBattery.idl
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-partial interface Navigator {
+[
+ ImplementedAs=NavigatorBattery
+] partial interface Navigator {
[CallWith=ScriptState] Promise getBattery();
};
-
diff --git a/modules/battery/testing/InternalsBattery.idl b/modules/battery/testing/InternalsBattery.idl
deleted file mode 100644
index 69256c9..0000000
--- a/modules/battery/testing/InternalsBattery.idl
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2016 The Chromium 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(yukishiino): Remove this API once JS bindings of Mojo services get
-// available.
-partial interface Internals {
- void updateBatteryStatus(boolean charging, float chargingTime, float dischargingTime, float level);
-};
diff --git a/modules/beacon/NavigatorBeacon.idl b/modules/beacon/NavigatorBeacon.idl
index 34f7323..469711f 100644
--- a/modules/beacon/NavigatorBeacon.idl
+++ b/modules/beacon/NavigatorBeacon.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/webperf/raw-file/tip/specs/Beacon/Overview.html#Navigator
+// https://w3c.github.io/beacon/#sec-sendBeacon-method
-partial interface Navigator {
- [CallWith=ExecutionContext, MeasureAs=SendBeacon, RaisesException] boolean sendBeacon(DOMString url, optional (ArrayBufferView or Blob or DOMString or FormData)? data = null);
+[
+ ImplementedAs=NavigatorBeacon
+] partial interface Navigator {
+ [CallWith=ScriptState, 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
index 4055338..302b496 100644
--- a/modules/bluetooth/Bluetooth.idl
+++ b/modules/bluetooth/Bluetooth.idl
@@ -2,16 +2,10 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetooth
[
- GarbageCollected,
- NoInterfaceObject,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface Bluetooth {
- [CallWith=ScriptState, RaisesException] Promise<BluetoothDevice> requestDevice (
- RequestDeviceOptions options
- );
+ [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRequestDevice] Promise<BluetoothDevice> requestDevice (optional RequestDeviceOptions options);
};
diff --git a/modules/bluetooth/BluetoothAdvertisingData.idl b/modules/bluetooth/BluetoothAdvertisingData.idl
deleted file mode 100644
index 818e5b4..0000000
--- a/modules/bluetooth/BluetoothAdvertisingData.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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/#bluetoothadvertisingdata
-
-// Implement BluetoothAdvertisingData interface: http://crbug.com/542756
-
-[
- GarbageCollected,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
-] interface BluetoothAdvertisingData {
- // readonly attribute unsigned short? appearance;
- readonly attribute byte? txPower;
- readonly attribute byte? rssi;
- // readonly attribute ManufacturerDataMap manufacturerData;
- // readonly attribute ServiceDataMap serviceData;
-};
diff --git a/modules/bluetooth/BluetoothCharacteristicProperties.idl b/modules/bluetooth/BluetoothCharacteristicProperties.idl
index ca87d7d..d4d46cf 100644
--- a/modules/bluetooth/BluetoothCharacteristicProperties.idl
+++ b/modules/bluetooth/BluetoothCharacteristicProperties.idl
@@ -2,15 +2,12 @@
// 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/#characteristicproperties
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothcharacteristicproperties
// Implement BluetoothCharacteristicProperties interface: http://crbug.com/483345
[
- GarbageCollected,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface BluetoothCharacteristicProperties {
readonly attribute boolean broadcast;
readonly attribute boolean read;
diff --git a/modules/bluetooth/BluetoothDevice.idl b/modules/bluetooth/BluetoothDevice.idl
index 13ac479..e8ce370 100644
--- a/modules/bluetooth/BluetoothDevice.idl
+++ b/modules/bluetooth/BluetoothDevice.idl
@@ -2,38 +2,21 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothdevice
// Implement BluetoothDevice interface: http://crbug.com/421668
-enum VendorIDSource {
- "bluetooth",
- "usb"
-};
-
[
- GarbageCollected,
DependentLifetime,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface BluetoothDevice : EventTarget
// Implement ServiceEventHandlers interface: http://crbug.com/421670
// : ServiceEventHandlers
{
// Implement BluetoothDevice interface: http://crbug.com/421668
- [DeprecateAs=BluetoothDeviceInstanceId, ImplementedAs=id] readonly attribute DOMString instanceID;
readonly attribute DOMString id;
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 BluetoothRemoteGATTServer gatt;
- readonly attribute UUID[] uuids;
- [CallWith=ScriptState, DeprecateAs=BluetoothDeviceConnectGATT] Promise<BluetoothRemoteGATTServer> connectGATT ();
attribute EventHandler ongattserverdisconnected;
};
diff --git a/modules/bluetooth/BluetoothLEScanFilterInit.idl b/modules/bluetooth/BluetoothLEScanFilterInit.idl
new file mode 100644
index 0000000..ea372ec
--- /dev/null
+++ b/modules/bluetooth/BluetoothLEScanFilterInit.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://webbluetoothcg.github.io/web-bluetooth/#dictdef-bluetoothlescanfilterinit
+
+dictionary BluetoothLEScanFilterInit {
+ sequence<BluetoothServiceUUID> services;
+ DOMString name;
+ DOMString namePrefix;
+ // TODO(crbug.com/707635): Support manufacturerData and serviceData filters.
+};
diff --git a/modules/bluetooth/BluetoothRemoteGATTCharacteristic.idl b/modules/bluetooth/BluetoothRemoteGATTCharacteristic.idl
index 16c2dd2..b455703 100644
--- a/modules/bluetooth/BluetoothRemoteGATTCharacteristic.idl
+++ b/modules/bluetooth/BluetoothRemoteGATTCharacteristic.idl
@@ -2,29 +2,24 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattcharacteristic
// Implement BluetoothRemoteGATTCharacteristic interface: https://crbug.com/483344
[
- GarbageCollected,
DependentLifetime,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface BluetoothRemoteGATTCharacteristic : EventTarget {//: CharacteristicEventHandlers {
- // TODO(ortuno): Add test to make sure service matches the service
- // used to call getCharacteristic.
- // readonly attribute BluetoothRemoteGATTService service;
- readonly attribute UUID uuid;
- readonly attribute BluetoothCharacteristicProperties properties;
- readonly attribute DataView? value;
- // Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor);
- // Promise<sequence<BluetoothRemoteGATTDescriptor>> getDescriptors(optional BluetoothDescriptorUUID descriptor);
- [CallWith=ScriptState] Promise<DataView> readValue();
- [CallWith=ScriptState] Promise<void> writeValue(BufferSource value);
- [CallWith=ScriptState] Promise<void> startNotifications();
- [CallWith=ScriptState] Promise<void> stopNotifications();
+ [SameObject] readonly attribute BluetoothRemoteGATTService service;
+ readonly attribute UUID uuid;
+ readonly attribute BluetoothCharacteristicProperties properties;
+ readonly attribute DataView? value;
+ [RaisesException, CallWith=ScriptState, MeasureAs=WebBluetoothRemoteCharacteristicGetDescriptor] Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor);
+ [RaisesException, CallWith=ScriptState, MeasureAs=WebBluetoothRemoteCharacteristicGetDescriptors] Promise<sequence<BluetoothRemoteGATTDescriptor>> getDescriptors(optional BluetoothDescriptorUUID descriptor);
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteCharacteristicReadValue] Promise<DataView> readValue();
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteCharacteristicWriteValue] Promise<void> writeValue(BufferSource value);
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteCharacteristicStartNotifications] Promise<BluetoothRemoteGATTCharacteristic> startNotifications();
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteCharacteristicStopNotifications] Promise<BluetoothRemoteGATTCharacteristic> stopNotifications();
// TODO(ortuno): Move this to CharacteristicEventHandlers.
// http://crbug.com/537459
diff --git a/modules/bluetooth/BluetoothRemoteGATTDescriptor.idl b/modules/bluetooth/BluetoothRemoteGATTDescriptor.idl
new file mode 100644
index 0000000..83b2593
--- /dev/null
+++ b/modules/bluetooth/BluetoothRemoteGATTDescriptor.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium 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/#bluetoothremotegattdescriptor
+
+// Implement BluetoothRemoteGATTDescriptor interface: https://crbug.com/660699
+
+[
+ RuntimeEnabled=WebBluetooth
+] interface BluetoothRemoteGATTDescriptor {
+ [SameObject] readonly attribute BluetoothRemoteGATTCharacteristic characteristic;
+ readonly attribute UUID uuid;
+ readonly attribute DataView? value;
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteDescriptorReadValue] Promise<DataView> readValue();
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteDescriptorWriteValue] Promise<void> writeValue(BufferSource value);
+};
diff --git a/modules/bluetooth/BluetoothRemoteGATTServer.idl b/modules/bluetooth/BluetoothRemoteGATTServer.idl
index 5e26954..b1bd31a 100644
--- a/modules/bluetooth/BluetoothRemoteGATTServer.idl
+++ b/modules/bluetooth/BluetoothRemoteGATTServer.idl
@@ -2,21 +2,18 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattserver
// Implement BluetoothGATTRemoteServer interface: https://crbug.com/476735
[
- GarbageCollected,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface BluetoothRemoteGATTServer
{
- readonly attribute BluetoothDevice device;
- readonly attribute boolean connected;
- [CallWith=ScriptState] Promise<BluetoothRemoteGATTServer> connect();
- [CallWith=ScriptState] void disconnect();
- [CallWith=ScriptState, RaisesException] Promise<BluetoothRemoteGATTService> getPrimaryService (BluetoothServiceUUID service);
- // Promise<sequence<BluetoothRemoteGATTService>> getPrimaryServices (optional BluetoothServiceUUID service);
+ [SameObject] readonly attribute BluetoothDevice device;
+ readonly attribute boolean connected;
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteServerConnect] Promise<BluetoothRemoteGATTServer> connect();
+ [CallWith=ScriptState, MeasureAs=WebBluetoothRemoteServerDisconnect] void disconnect();
+ [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRemoteServerGetPrimaryService] Promise<BluetoothRemoteGATTService> getPrimaryService (BluetoothServiceUUID service);
+ [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRemoteServerGetPrimaryServices] Promise<sequence<BluetoothRemoteGATTService>> getPrimaryServices (optional BluetoothServiceUUID service);
};
diff --git a/modules/bluetooth/BluetoothRemoteGATTService.idl b/modules/bluetooth/BluetoothRemoteGATTService.idl
index 85ce907..edab043 100644
--- a/modules/bluetooth/BluetoothRemoteGATTService.idl
+++ b/modules/bluetooth/BluetoothRemoteGATTService.idl
@@ -2,23 +2,18 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice
// Implement BluetoothRemoteGATTService interface: https://crbug.com/483342
[
- GarbageCollected,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface BluetoothRemoteGATTService { // : 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<BluetoothRemoteGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic);
- [RaisesException, CallWith=ScriptState] Promise<sequence<BluetoothRemoteGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic);
- // Promise<BluetoothRemoteGATTService> getIncludedService(BluetoothServiceUUID service);
- // Promise<sequence<BluetoothRemoteGATTService>> getIncludedServices(optional BluetoothServiceUUID service);
+ [SameObject] readonly attribute BluetoothDevice device;
+ readonly attribute UUID uuid;
+ readonly attribute boolean isPrimary;
+ [RaisesException, CallWith=ScriptState, MeasureAs=WebBluetoothRemoteServiceGetCharacteristic] Promise<BluetoothRemoteGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic);
+ [RaisesException, CallWith=ScriptState, MeasureAs=WebBluetoothRemoteServiceGetCharacteristics] Promise<sequence<BluetoothRemoteGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic);
+ // Promise<BluetoothRemoteGATTService> getIncludedService(BluetoothServiceUUID service);
+ // Promise<sequence<BluetoothRemoteGATTService>> getIncludedServices(optional BluetoothServiceUUID service);
};
diff --git a/modules/bluetooth/BluetoothScanFilter.idl b/modules/bluetooth/BluetoothScanFilter.idl
deleted file mode 100644
index b8e7447..0000000
--- a/modules/bluetooth/BluetoothScanFilter.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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;
- DOMString name;
- DOMString namePrefix;
-};
diff --git a/modules/bluetooth/BluetoothUUID.idl b/modules/bluetooth/BluetoothUUID.idl
index a064b3d..09a09d4 100644
--- a/modules/bluetooth/BluetoothUUID.idl
+++ b/modules/bluetooth/BluetoothUUID.idl
@@ -2,16 +2,10 @@
// 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-bluetoothuuid
-
-// Implement BluetoothUUID: http://crbug.com/491441
-// Significant TODOs remain in BluetoothUUID.cpp.
+// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothuuid
[
- GarbageCollected,
- RuntimeEnabled=WebBluetooth,
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth,
+ RuntimeEnabled=WebBluetooth
] interface BluetoothUUID {
[RaisesException] static UUID getService((DOMString or unsigned long) name);
[RaisesException] static UUID getCharacteristic((DOMString or unsigned long) name);
diff --git a/modules/bluetooth/NavigatorBluetooth.idl b/modules/bluetooth/NavigatorBluetooth.idl
index e7c777c..e73d80e 100644
--- a/modules/bluetooth/NavigatorBluetooth.idl
+++ b/modules/bluetooth/NavigatorBluetooth.idl
@@ -2,16 +2,11 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#navigator-extensions
[
- RuntimeEnabled=WebBluetooth,
+ ImplementedAs=NavigatorBluetooth,
+ RuntimeEnabled=WebBluetooth
] partial interface Navigator {
- // Experimental Framework doesn't support adding bindings to partial
- // interfaces yet, so we add it to the bluetooth attribute instead.
- // https://crbug.com/585656
- [
- // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
- // OriginTrialEnabled=WebBluetooth
- ] readonly attribute Bluetooth bluetooth;
+ [SameObject] readonly attribute Bluetooth bluetooth;
};
diff --git a/modules/bluetooth/RequestDeviceOptions.idl b/modules/bluetooth/RequestDeviceOptions.idl
index 89d5ea9..6987c61 100644
--- a/modules/bluetooth/RequestDeviceOptions.idl
+++ b/modules/bluetooth/RequestDeviceOptions.idl
@@ -2,9 +2,10 @@
// 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
+// https://webbluetoothcg.github.io/web-bluetooth/#dictdef-requestdeviceoptions
dictionary RequestDeviceOptions {
- required sequence<BluetoothScanFilter> filters;
+ sequence<BluetoothLEScanFilterInit> filters;
sequence<BluetoothServiceUUID> optionalServices = [];
+ boolean acceptAllDevices = false;
};
diff --git a/modules/bluetooth/testing/clusterfuzz/PRESUBMIT.py b/modules/bluetooth/testing/clusterfuzz/PRESUBMIT.py
new file mode 100644
index 0000000..39bd805
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/PRESUBMIT.py
@@ -0,0 +1,27 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Script that runs tests before uploading a patch."""
+
+
+def _RunTests(input_api, output_api):
+ """Runs all test files in the directory."""
+ cmd_name = 'all_python_tests'
+ cmd = ['python', '-m', 'unittest', 'discover', '-p', '*test.py']
+ test_cmd = input_api.Command(
+ name=cmd_name,
+ cmd=cmd,
+ kwargs={},
+ message=output_api.PresubmitError)
+ if input_api.verbose:
+ print 'Running ' + cmd_name
+ return input_api.RunTests([test_cmd])
+
+
+def CheckChangeOnUpload(input_api, output_api):
+ return _RunTests(input_api, output_api)
+
+
+def CheckChangeOnCommit(input_api, output_api):
+ return _RunTests(input_api, output_api)
diff --git a/modules/bluetooth/testing/clusterfuzz/constraints.py b/modules/bluetooth/testing/clusterfuzz/constraints.py
new file mode 100644
index 0000000..11c3176
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/constraints.py
@@ -0,0 +1,427 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Module to get random numbers, strings, etc.
+
+ The values returned by the various functions can be replaced in
+ templates to generate test cases.
+"""
+
+import math
+import random
+import sys
+import uuid
+
+# This script needs the utils.py and fuzzy_types.py modules in order
+# to work. This files are copied by the setup.py script and not checked-in
+# next to this code, so we need to disable the style warning.
+# pylint: disable=F0401
+from resources import utils
+from resources import fuzzy_types
+
+import gatt_aliases
+import wbt_fakes
+
+
+# Strings that are used to generate the beginning of a test. The replacement
+# fields are replaced by Get*Base() functions below to generate valid test
+# cases.
+BASIC_BASE = \
+ ' return setBluetoothFakeAdapter({fake_adapter_name})\n'\
+ ' .then(() => {{\n'
+
+DEVICE_DISCOVERY_BASE = BASIC_BASE + \
+ ' return requestDeviceWithKeyDown({{\n'\
+ ' filters: [{{services: [{service_uuid}]}}]}});\n'\
+ ' }})\n'\
+ ' .then(device => {{\n'
+
+CONNECTABLE_BASE = DEVICE_DISCOVERY_BASE + \
+ ' return device.gatt.connect();\n'\
+ ' }})\n'\
+ ' .then(gatt => {{\n'
+
+SERVICE_RETRIEVED_BASE = CONNECTABLE_BASE + \
+ ' return gatt.getPrimaryService({service_uuid});\n'\
+ ' }})\n'\
+ ' .then(services => {{\n'
+
+SERVICES_RETRIEVED_BASE = CONNECTABLE_BASE + \
+ ' return gatt.getPrimaryServices({optional_service_uuid});\n'\
+ ' }})\n'\
+ ' .then(services => {{\n'
+
+CHARACTERISTIC_RETRIEVED_BASE = \
+ ' TRANSFORM_PICK_A_SERVICE;\n'\
+ ' return service.getCharacteristic({characteristic_uuid});\n'\
+ ' }})\n'\
+ ' .then(characteristics => {{\n'
+
+CHARACTERISTICS_RETRIEVED_BASE = \
+ ' TRANSFORM_PICK_A_SERVICE;\n'\
+ ' return service.getCharacteristics({optional_characteristic_uuid});\n'\
+ ' }})\n'\
+ ' .then(characteristics => {{\n'
+
+
+def _ToJsStr(s):
+ return u'\'{}\''.format(s)
+
+
+def _get_random_number():
+ return utils.UniformExpoInteger(0, sys.maxsize.bit_length() + 1)
+
+
+def _GetFuzzedJsString(s):
+ """Returns a fuzzed string based on |s|.
+
+ Args:
+ s: The base string to fuzz.
+ Returns:
+ A single line string surrounded by quotes.
+ """
+ while True:
+ fuzzed_string = fuzzy_types.FuzzyString(s)
+ try:
+ fuzzed_string = fuzzed_string.decode('utf8')
+ except UnicodeDecodeError:
+ print 'Can\'t decode fuzzed string. Trying again.'
+ else:
+ # Escape 'escape' characters.
+ fuzzed_string = fuzzed_string.replace('\\', r'\\')
+ # Escape quote characters.
+ fuzzed_string = fuzzed_string.replace('\'', r'\'')
+ # Put everything in a single line.
+ fuzzed_string = '\\n'.join(fuzzed_string.split())
+ return _ToJsStr(fuzzed_string)
+
+
+def _get_array_of_random_ints(max_length, max_value):
+ """Returns an string with an array of random integer."""
+ length = utils.UniformExpoInteger(0, math.log(max_length, 2))
+ exp_max_value = math.log(max_value, 2)
+ return '[{}]'.format(', '.join(
+ str(utils.UniformExpoInteger(0, exp_max_value)) for _ in xrange(length))
+ )
+
+
+def _get_typed_array():
+ """Generates a TypedArray constructor.
+
+ There are nine types of TypedArrays and TypedArray has four constructors.
+
+ Types:
+ * Int8Array
+ * Int16Array
+ * Int32Array
+ * Uint8Array
+ * Uint16Array
+ * Uint32Array
+ * Uint8ClampedArray
+ * Float32Array
+ * Float64Array
+
+ Constructors:
+
+ * new TypedArray(length)
+ * new TypedArray(typedArray)
+ * new TypedArray(object)
+ * new TypedArray(buffer)
+
+ Returns:
+ A string made up of a randomly chosen type and argument type from the
+ lists above.
+ """
+ array_type = random.choice(['Int8Array', 'Int16Array', 'Int32Array',
+ 'Uint8Array', 'Uint16Array', 'Uint32Array',
+ 'Uint8ClampedArray', 'Float32Array',
+ 'Float64Array'])
+
+ # Choose an argument type at random.
+ arguments = random.choice([
+ # length e.g. 293
+ # We choose 2**10 as the upper boundry because the max length allowed
+ # by WebBluetooth is 2**10.
+ lambda: utils.UniformExpoInteger(0, 10),
+ # typedArray e.g. new Uint8Array([1,2,3])
+ _get_typed_array,
+ # object e.g. [1,2,3]
+ lambda: _get_array_of_random_ints(max_length=1000, max_value=2 ** 64),
+ # buffer e.g. new Uint8Array(10).buffer
+ lambda: _get_typed_array() + '.buffer',
+ ])
+
+ return 'new {array_type}({arguments})'.format(array_type=array_type,
+ arguments=arguments())
+
+
+def GetAdvertisedServiceUUIDFromFakes():
+ """Returns a random service string from the list of fake services."""
+ return _ToJsStr(random.choice(wbt_fakes.ADVERTISED_SERVICES))
+
+
+def get_service_uuid_from_fakes():
+ """Returns a random service string from a list of fake services."""
+ return _ToJsStr(random.choice(wbt_fakes.SERVICES))
+
+
+def get_characteristic_uuid_from_fakes():
+ """Returns a random characteristic string from a fake characteristics list."""
+ return _ToJsStr(random.choice(wbt_fakes.CHARACTERISTICS))
+
+
+def GetValidServiceAlias():
+ """Returns a valid service alias from the list of services aliases."""
+ return _ToJsStr(random.choice(gatt_aliases.SERVICES))
+
+
+def get_valid_characteristic_alias():
+ """Returns a valid service alias from the list of services aliases."""
+ return _ToJsStr(random.choice(gatt_aliases.CHARACTERISTICS))
+
+
+def GetRandomUUID():
+ """Returns a random UUID, a random number or a fuzzed uuid or alias."""
+ choice = random.choice(['uuid', 'number', 'fuzzed string'])
+ if choice == 'uuid':
+ return _ToJsStr(uuid.uuid4())
+ elif choice == 'number':
+ return _get_random_number()
+ elif choice == 'fuzzed string':
+ choice2 = random.choice(['uuid', 'alias'])
+ if choice2 == 'uuid':
+ random_uuid = str(uuid.uuid4())
+ return _GetFuzzedJsString(random_uuid)
+ elif choice2 == 'alias':
+ alias = random.choice(gatt_aliases.SERVICES)
+ return _GetFuzzedJsString(alias)
+
+
+def GetAdvertisedServiceUUID():
+ """Generates a random Service UUID from a set of functions.
+
+ See get_service_uuid_from_fakes(), GetValidServiceAlias() and GetRandomUUID()
+ for the different values this function can return.
+
+ This function weights get_service_uuid_from_fakes() more heavily to increase the
+ probability of generating test pages that can interact with the fake
+ adapters.
+
+ Returns:
+ A string or a number that can be used as a Service UUID by the Web
+ Bluetooth API.
+ """
+ roll = random.random()
+ if roll < 0.8:
+ return GetAdvertisedServiceUUIDFromFakes()
+ elif roll < 0.9:
+ return GetValidServiceAlias()
+ else:
+ return GetRandomUUID()
+
+
+def get_service_uuid():
+ """Generates a random Service UUID from a set of functions.
+
+ Similar to GetAdvertisedServiceUUID() but weights get_service_uuid_from_fakes()
+ more heavily to increase the probability of generating test pages that can
+ interact with the fake adapters.
+
+ See get_service_uuid_from_fakes(), GetValidServiceAlias() and
+ GetRandomUUID() for the different values this function can return.
+
+ Returns:
+ A string or a number that can be used as a Service UUID by the Web
+ Bluetooth API.
+ """
+ roll = random.random()
+ if roll < 0.8:
+ return get_service_uuid_from_fakes()
+ elif roll < 0.9:
+ return GetValidServiceAlias()
+ else:
+ return GetRandomUUID()
+
+
+def get_characteristic_uuid():
+ """Generates a random Characteristic UUID from a set of functions.
+
+ Similar to get_service_uuid() but weights get_characteristic_uuid_from_fakes()
+ more heavily to increase the probability of generating test pages that can
+ interact with the fake adapters.
+
+ See get_characteristic_uuid_from_fakes(), get_valid_characteristic_alias() and
+ GetRandomUUID() for the different values this function can return.
+
+ Returns:
+ A string or a number that can be used as a Service UUID by the Web
+ Bluetooth API.
+ """
+ roll = random.random()
+ if roll < 0.8:
+ return get_characteristic_uuid_from_fakes()
+ elif roll < 0.9:
+ return get_valid_characteristic_alias()
+ else:
+ return GetRandomUUID()
+
+
+def GetRequestDeviceOptions():
+ """Returns an object used by navigator.bluetooth.requestDevice."""
+ # TODO(ortuno): Randomize the members, number of filters, services, etc.
+
+ return '{filters: [{services: [ %s ]}]}' % GetAdvertisedServiceUUID()
+
+
+def GetBasicBase():
+ """Returns a string that sets a random fake adapter."""
+ adapter = _ToJsStr(random.choice(wbt_fakes.ALL_ADAPTERS))
+ return BASIC_BASE.format(fake_adapter_name=adapter)
+
+
+def GetDeviceDiscoveryBase():
+ """Generates a string that contains all steps to find a device."""
+ adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_DEVICES)
+ return DEVICE_DISCOVERY_BASE.format(
+ fake_adapter_name=_ToJsStr(adapter),
+ service_uuid=_ToJsStr(random.choice(services)))
+
+
+def GetConnectableBase():
+ """Generates a string that contains all steps to connect to a device.
+
+ Returns: A string that:
+ 1. Sets an adapter to a fake adapter with a connectable device.
+ 2. Looks for the connectable device.
+ 3. Connects to it.
+ """
+ adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_DEVICES)
+ return DEVICE_DISCOVERY_BASE.format(
+ fake_adapter_name=_ToJsStr(adapter),
+ service_uuid=_ToJsStr(random.choice(services)))
+
+
+def get_services_retrieved_base():
+ """Returns a string that contains all steps to retrieve a service.
+
+ Returns: A string that:
+ 1. Sets an adapter to a fake adapter with a connectable device with
+ services.
+ 2. Use one of the device's services to look for that device.
+ 3. Connects to it.
+ 4. Retrieve the device's service used in 2.
+ """
+ adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_SERVICES)
+ service_uuid = _ToJsStr(random.choice(services))
+
+ base = random.choice([SERVICE_RETRIEVED_BASE, SERVICES_RETRIEVED_BASE])
+ return base.format(
+ fake_adapter_name=_ToJsStr(adapter),
+ service_uuid=service_uuid,
+ optional_service_uuid=random.choice(['', service_uuid]))
+
+
+def get_characteristics_retrieved_base():
+ """Returns a string that contains all steps to retrieve a characteristic.
+
+ Returns: A string that:
+ 1. Sets an adapter to a fake adapter with a connectable device with
+ services.
+ 2. Use one of the device's services to look for that device.
+ 3. Connects to it.
+ 4. Retrieve the device's service used in 2.
+ 5. Retrieve a characteristic from that service.
+ """
+ adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_CHARACTERISTICS)
+
+ service_uuid, characteristics = random.choice(services)
+ service_uuid = _ToJsStr(service_uuid)
+
+ characteristic_uuid = _ToJsStr(random.choice(characteristics))
+
+ optional_service_uuid = random.choice(['', service_uuid])
+ optional_characteristic_uuid = random.choice(['', characteristic_uuid])
+
+ services_base = random.choice([SERVICE_RETRIEVED_BASE,
+ SERVICES_RETRIEVED_BASE])
+
+ characteristics_base = services_base + random.choice([
+ CHARACTERISTIC_RETRIEVED_BASE,
+ CHARACTERISTICS_RETRIEVED_BASE,
+ ])
+
+ return characteristics_base.format(
+ fake_adapter_name=_ToJsStr(adapter),
+ service_uuid=service_uuid,
+ optional_service_uuid=optional_service_uuid,
+ characteristic_uuid=characteristic_uuid,
+ optional_characteristic_uuid=optional_characteristic_uuid)
+
+
+def get_get_primary_services_call():
+ call = random.choice([u'getPrimaryService({service_uuid})',
+ u'getPrimaryServices({optional_service_uuid})'])
+
+ return call.format(
+ service_uuid=get_service_uuid(),
+ optional_service_uuid=random.choice(['', get_service_uuid()]))
+
+
+def get_characteristics_call():
+ call = random.choice([
+ u'getCharacteristic({characteristic_uuid})',
+ u'getCharacteristics({optional_characteristic_uuid})'
+ ])
+
+ return call.format(
+ characteristic_uuid=get_characteristic_uuid(),
+ optional_characteristic_uuid=random.choice(
+ ['', get_characteristic_uuid()]))
+
+
+def get_pick_a_service():
+ """Returns a string that picks a service from 'services'."""
+ # 'services' may be defined by the GetPrimaryService(s) tokens.
+ string = \
+ 'var service; '\
+ 'if (typeof services !== \'undefined\') '\
+ ' service = Array.isArray(services)'\
+ ' ? services[{} % services.length]'\
+ ' : services'
+ return string.format(random.randint(0, sys.maxint))
+
+
+def get_pick_a_characteristic():
+ """Returns a string that picks a characteristic from 'characteristics'."""
+ # 'characteristics' maybe be defined by the GetCharacteristic(s) tokens.
+ string = \
+ 'var characteristic; '\
+ 'if (typeof characteristics !== \'undefined\') '\
+ ' characteristic = Array.isArray(characteristics)'\
+ ' ? characteristics[{} % characteristics.length]'\
+ ' : characteristics'
+ return string.format(random.randint(0, sys.maxint))
+
+
+def get_reload_id():
+ return _ToJsStr(_get_random_number())
+
+
+def get_buffer_source():
+ """Returns a new BufferSource.
+ https://heycam.github.io/webidl/#BufferSource
+ """
+
+ choice = random.choice(['ArrayBuffer', 'DataView', 'TypedArray'])
+
+ if choice == 'ArrayBuffer':
+ # We choose 2**10 as the upper boundry because the max length allowed
+ # by WebBluetooth is 2**10.
+ return 'new ArrayBuffer({length})'.format(
+ length=utils.UniformExpoInteger(0, 10))
+ if choice == 'DataView':
+ return 'new DataView({typed_array}.buffer)'.format(
+ typed_array=_get_typed_array())
+ if choice == 'TypedArray':
+ return _get_typed_array()
diff --git a/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py b/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py
new file mode 100644
index 0000000..4080b8a
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/fuzz_integration_test.py
@@ -0,0 +1,44 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Test that the fuzzer works the way ClusterFuzz invokes it."""
+
+import glob
+import os
+import shutil
+import sys
+import tempfile
+import unittest
+
+import setup
+
+
+class WebBluetoothFuzzerTest(unittest.TestCase):
+
+ def setUp(self):
+ self._output_dir = tempfile.mkdtemp()
+ self._resources_path = setup.RetrieveResources()
+
+ def tearDown(self):
+ shutil.rmtree(self._output_dir)
+ shutil.rmtree(self._resources_path)
+
+ def testCanGenerate100Files(self):
+ sys.argv = ['fuzz_main_run.py', '--no_of_files=100',
+ '--input_dir={}'.format(self._output_dir),
+ '--output_dir={}'.format(self._output_dir)]
+
+ import fuzz_main_run
+ fuzz_main_run.main()
+
+ written_files = glob.glob(os.path.join(self._output_dir, '*.html'))
+
+ self.assertEquals(100, len(written_files), 'Should have written 100 '
+ 'test files.')
+
+ for test_case in written_files:
+ self.assertFalse('TRANSFORM' in open(test_case).read())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/modules/bluetooth/testing/clusterfuzz/fuzz_main_run.py b/modules/bluetooth/testing/clusterfuzz/fuzz_main_run.py
new file mode 100644
index 0000000..725c344
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/fuzz_main_run.py
@@ -0,0 +1,166 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Script to generate Web Bluetooth Layout Tests that can be run in ClusterFuzz.
+
+This script uses templates in the templates/ directory to generate html files
+that can be run as Layout Tests. The script reads a template, includes files
+necessary to run as a layout test, fuzzes its parameters and saves the result in
+a new file in the directory specified when running the script.
+"""
+
+import argparse
+import glob
+import os
+import sys
+import tempfile
+import time
+
+from fuzzer_helpers import FillInParameter
+import parameter_fuzzer
+import test_case_fuzzer
+
+JS_FILES_AND_PARAMETERS = (
+ ('testharness.js', 'INCLUDE_TESTHARNESS'),
+ ('testharnessreport.js', 'INCLUDE_REPORT'),
+ ('bluetooth-helpers.js', 'INCLUDE_BLUETOOTH_HELPERS'))
+
+SCRIPT_PREFIX = '<script type="text/javascript">\n'
+SCRIPT_SUFFIX = '\n</script>\n'
+
+
+def _GetArguments():
+ """Parses the arguments passed when running this script.
+
+ Returns:
+ An argparse.Namespace object containing the arguments in sys.argv.
+ """
+ parser = argparse.ArgumentParser()
+
+ # Arguments used by ClusterFuzz:
+ parser.add_argument('-n', '--no_of_files', type=int, required=True,
+ help='The number of test cases that the fuzzer is '
+ 'expected to generate')
+ parser.add_argument('-i', '--input_dir',
+ help='The directory containing the fuzzer\'s data '
+ 'bundle.')
+ parser.add_argument('-o', '--output_dir', required=True,
+ help='The directory where test case files should be '
+ 'written to.')
+
+ parser.add_argument('--content_shell_dir',
+ help='The directory of content shell. If present the '
+ 'program will print a command to run the '
+ 'generated test file.')
+
+ return parser.parse_args()
+
+
+def FuzzTemplate(template_path, resources_path):
+ """Uses a template to return a test case that can be run as a layout test.
+
+ This functions reads the template in |template_path|, injects the necessary
+ js files to run as a layout test and fuzzes the template's parameters to
+ generate a test case.
+
+ Args:
+ template_path: The path to the template that will be used to generate
+ a new test case.
+ resources_path: Path to the js files that need to be included.
+
+ Returns:
+ A string containing the test case.
+ """
+ print 'Generating test file based on {}'.format(template_path)
+
+ # Read the template.
+ template_file_handle = open(template_path)
+ template_file_data = template_file_handle.read().decode('utf-8')
+ template_file_handle.close()
+
+ # Generate a test file based on the template.
+ generated_test = test_case_fuzzer.GenerateTestFile(template_file_data)
+ # Fuzz parameters.
+ fuzzed_file_data = parameter_fuzzer.FuzzParameters(generated_test)
+
+ # Add includes
+ for (js_file_name, include_parameter) in JS_FILES_AND_PARAMETERS:
+ # Read js file.
+ js_file_handle = open(os.path.join(resources_path, js_file_name))
+ js_file_data = js_file_handle.read()
+ js_file_handle.close()
+
+ js_file_data = (SCRIPT_PREFIX + js_file_data + SCRIPT_SUFFIX)
+
+ fuzzed_file_data = FillInParameter(include_parameter,
+ lambda data=js_file_data: data,
+ fuzzed_file_data)
+
+ return fuzzed_file_data.encode('utf-8')
+
+
+def WriteTestFile(test_file_data, test_file_prefix, output_dir):
+ """Creates a new file with a unique name and writes the test case to it.
+
+ Args:
+ test_file_data: The data to be included in the new file.
+ test_file_prefix: Used as a prefix when generating a new file.
+ output_dir: The directory where the new file should be created.
+
+ Returns:
+ A string representing the file path to access the new file.
+ """
+
+ file_descriptor, file_path = tempfile.mkstemp(
+ prefix=test_file_prefix,
+ suffix='.html',
+ dir=output_dir)
+
+ with os.fdopen(file_descriptor, 'wb') as output:
+ print 'Writing {} bytes to \'{}\''.format(len(test_file_data),
+ file_path)
+ output.write(test_file_data)
+
+ return file_path
+
+
+def main():
+ args = _GetArguments()
+
+ print 'Generating {} test file(s).'.format(args.no_of_files)
+ print 'Writing test files to: \'{}\''.format(args.output_dir)
+ if args.input_dir:
+ print 'Reading data bundle from: \'{}\''.format(args.input_dir)
+
+ # Get Templates
+ current_path = os.path.dirname(os.path.realpath(__file__))
+ available_templates = glob.glob(os.path.join(current_path,
+ 'templates',
+ '*.html'))
+
+ # Generate Test Files
+ resources_path = os.path.join(current_path, 'resources')
+ start_time = time.time()
+ for file_no in range(args.no_of_files):
+ template_path = available_templates[file_no % len(available_templates)]
+
+ test_file_data = FuzzTemplate(template_path, resources_path)
+
+ # Get Test File
+ template_name = os.path.splitext(os.path.basename(template_path))[0]
+ test_file_name = 'fuzz-{}-{}-{}'.format(template_name,
+ int(start_time),
+ int(file_no))
+
+ test_file_path = WriteTestFile(test_file_data,
+ test_file_name,
+ args.output_dir)
+
+ if args.content_shell_dir:
+ print '{} --run-layout-test {}'.format(args.content_shell_dir,
+ test_file_path)
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/modules/bluetooth/testing/clusterfuzz/fuzzer_helpers.py b/modules/bluetooth/testing/clusterfuzz/fuzzer_helpers.py
new file mode 100644
index 0000000..798fe86
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/fuzzer_helpers.py
@@ -0,0 +1,26 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Module that includes classes and functions used by fuzzers."""
+
+
+def FillInParameter(parameter, func, template):
+ """Replaces occurrences of a parameter by calling a provided generator.
+
+ Args:
+ parameter: A string representing the parameter that should be replaced.
+ func: A function that returns a string representing the value used to
+ replace an instance of the parameter.
+ template: A string that contains the parameter to be replaced.
+
+ Returns:
+ A string containing the value of |template| in which instances of
+ |pameter| have been replaced by results of calling |func|.
+
+ """
+ result = template
+ while parameter in result:
+ result = result.replace(parameter, func(), 1)
+
+ return result
diff --git a/modules/bluetooth/testing/clusterfuzz/gatt_aliases.py b/modules/bluetooth/testing/clusterfuzz/gatt_aliases.py
new file mode 100644
index 0000000..e28d502
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/gatt_aliases.py
@@ -0,0 +1,251 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Contains Services, Characteristics and Descriptor aliases.
+
+These values are copied from:
+
+https://www.bluetooth.com/specifications/gatt/services
+
+https://www.bluetooth.com/specifications/gatt/characteristics
+"""
+
+
+SERVICES = [
+ 'alert_notification',
+ 'automation_io',
+ 'battery_service',
+ 'blood_pressure',
+ 'body_composition',
+ 'bond_management',
+ 'continuous_glucose_monitoring',
+ 'current_time',
+ 'cycling_power',
+ 'cycling_speed_and_cadence',
+ 'device_information',
+ 'environmental_sensing',
+ 'fitness_machine',
+ 'generic_access',
+ 'generic_attribute',
+ 'glucose',
+ 'health_thermometer',
+ 'heart_rate',
+ 'http_proxy',
+ 'human_interface_device',
+ 'immediate_alert',
+ 'indoor_positioning',
+ 'internet_protocol_support',
+ 'link_loss',
+ 'location_and_navigation',
+ 'next_dst_change',
+ 'object_transfer',
+ 'phone_alert_status',
+ 'pulse_oximeter',
+ 'reference_time_update',
+ 'running_speed_and_cadence',
+ 'scan_parameters',
+ 'transport_discovery',
+ 'tx_power',
+ 'user_data',
+ 'weight_scale',
+]
+
+
+CHARACTERISTICS = [
+ 'aerobic_heart_rate_lower_limit',
+ 'aerobic_heart_rate_upper_limit',
+ 'aerobic_threshold',
+ 'age',
+ 'aggregate',
+ 'alert_category_id',
+ 'alert_category_id_bit_mask',
+ 'alert_level',
+ 'alert_notification_control_point',
+ 'alert_status',
+ 'altitude',
+ 'anaerobic_heart_rate_lower_limit',
+ 'anaerobic_heart_rate_upper_limit',
+ 'anaerobic_threshold',
+ 'analog',
+ 'apparent_wind_direction',
+ 'apparent_wind_speed',
+ 'gap.appearance',
+ 'barometric_pressure_trend',
+ 'battery_level',
+ 'blood_pressure_feature',
+ 'blood_pressure_measurement',
+ 'body_composition_feature',
+ 'body_composition_measurement',
+ 'body_sensor_location',
+ 'bond_management_control_point',
+ 'bond_management_feature',
+ 'boot_keyboard_input_report',
+ 'boot_keyboard_output_report',
+ 'boot_mouse_input_report',
+ 'gap.central_address_resolution_support',
+ 'cgm_feature',
+ 'cgm_measurement',
+ 'cgm_session_run_time',
+ 'cgm_session_start_time',
+ 'cgm_specific_ops_control_point',
+ 'cgm_status',
+ 'cross_trainer_data',
+ 'csc_feature',
+ 'csc_measurement',
+ 'current_time',
+ 'cycling_power_control_point',
+ 'cycling_power_feature',
+ 'cycling_power_measurement',
+ 'cycling_power_vector',
+ 'database_change_increment',
+ 'date_of_birth',
+ 'date_of_threshold_assessment',
+ 'date_time',
+ 'day_date_time',
+ 'day_of_week',
+ 'descriptor_value_changed',
+ 'gap.device_name',
+ 'dew_point',
+ 'digital',
+ 'dst_offset',
+ 'elevation',
+ 'email_address',
+ 'exact_time_256',
+ 'fat_burn_heart_rate_lower_limit',
+ 'fat_burn_heart_rate_upper_limit',
+ 'firmware_revision_string',
+ 'first_name',
+ 'fitness_machine_control_point',
+ 'fitness_machine_feature',
+ 'fitness_machine_status',
+ 'five_zone_heart_rate_limits',
+ 'floor_number',
+ 'gender',
+ 'glucose_feature',
+ 'glucose_measurement',
+ 'glucose_measurement_context',
+ 'gust_factor',
+ 'hardware_revision_string',
+ 'heart_rate_control_point',
+ 'heart_rate_max',
+ 'heart_rate_measurement',
+ 'heat_index',
+ 'height',
+ 'hid_control_point',
+ 'hid_information',
+ 'hip_circumference',
+ 'http_control_point',
+ 'http_entity_body',
+ 'http_headers',
+ 'http_status_code',
+ 'https_security',
+ 'humidity',
+ 'ieee_11073-20601_regulatory_certification_data_list',
+ 'indoor_bike_data',
+ 'indoor_positioning_configuration',
+ 'intermediate_cuff_pressure',
+ 'intermediate_temperature',
+ 'irradiance',
+ 'language',
+ 'last_name',
+ 'latitude',
+ 'ln_control_point',
+ 'ln_feature',
+ 'local_east_coordinate',
+ 'local_north_coordinate',
+ 'local_time_information',
+ 'location_and_speed',
+ 'location_name',
+ 'longitude',
+ 'magnetic_declination',
+ 'magnetic_flux_density_2D',
+ 'magnetic_flux_density_3D',
+ 'manufacturer_name_string',
+ 'maximum_recommended_heart_rate',
+ 'measurement_interval',
+ 'model_number_string',
+ 'navigation',
+ 'new_alert',
+ 'object_action_control_point',
+ 'object_changed',
+ 'object_first_created',
+ 'object_id',
+ 'object_last_modified',
+ 'object_list_control_point',
+ 'object_list_filter',
+ 'object_name',
+ 'object_properties',
+ 'object_size',
+ 'object_type',
+ 'ots_feature',
+ 'gap.peripheral_preferred_connection_parameters',
+ 'gap.peripheral_privacy_flag',
+ 'plx_continuous_measurement',
+ 'plx_features',
+ 'plx_spot_check_measurement',
+ 'pnp_id',
+ 'pollen_concentration',
+ 'position_quality',
+ 'pressure',
+ 'protocol_mode',
+ 'rainfall',
+ 'gap.reconnection_address',
+ 'record_access_control_point',
+ 'reference_time_information',
+ 'report',
+ 'report_map',
+ 'resolvable_private_address_only',
+ 'resting_heart_rate',
+ 'ringer_control_point',
+ 'ringer_setting',
+ 'rower_data',
+ 'rsc_feature',
+ 'rsc_measurement',
+ 'sc_control_point',
+ 'scan_interval_window',
+ 'scan_refresh',
+ 'serial_number_string',
+ 'gatt.service_changed',
+ 'software_revision_string',
+ 'sport_type_for_aerobic_and_anaerobic_thresholds',
+ 'stair_climber_data',
+ 'step_climber_data',
+ 'supported_heart_rate_range',
+ 'supported_inclination_range',
+ 'supported_new_alert_category',
+ 'supported_power_range',
+ 'supported_resistance_level_range',
+ 'supported_speed_range',
+ 'supported_unread_alert_category',
+ 'system_id',
+ 'tds_control_point',
+ 'temperature',
+ 'temperature_measurement',
+ 'temperature_type',
+ 'three_zone_heart_rate_limits',
+ 'time_accuracy',
+ 'time_source',
+ 'time_update_control_point',
+ 'time_update_state',
+ 'time_with_dst',
+ 'time_zone',
+ 'training_status',
+ 'treadmill_data',
+ 'true_wind_direction',
+ 'true_wind_speed',
+ 'two_zone_heart_rate_limit',
+ 'tx_power_level',
+ 'uncertainty',
+ 'unread_alert_status',
+ 'uri',
+ 'user_control_point',
+ 'user_index',
+ 'uv_index',
+ 'vo2_max',
+ 'waist_circumference',
+ 'weight',
+ 'weight_measurement',
+ 'weight_scale_feature',
+ 'wind_chill',
+]
diff --git a/modules/bluetooth/testing/clusterfuzz/parameter_fuzzer.py b/modules/bluetooth/testing/clusterfuzz/parameter_fuzzer.py
new file mode 100644
index 0000000..0c9bdb5
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/parameter_fuzzer.py
@@ -0,0 +1,73 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Module to fuzz parameters of a template."""
+
+import constraints
+from fuzzer_helpers import FillInParameter
+
+
+def FuzzParameters(test_file_data):
+ """Fuzzes the data in the string provided.
+
+ For now this function only replaces the TRANSFORM_SERVICE_UUID parameter
+ with a valid UUID string.
+
+ Args:
+ test_file_data: String that contains parameters to be replaced.
+
+ Returns:
+ A string containing the value of test_file_data but with all its
+ parameters replaced.
+ """
+
+ test_file_data = FillInParameter('TRANSFORM_BASIC_BASE',
+ constraints.GetBasicBase,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_DEVICE_DISCOVERY_BASE',
+ constraints.GetDeviceDiscoveryBase,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_CONNECTABLE_BASE',
+ constraints.GetConnectableBase,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_SERVICES_RETRIEVED_BASE',
+ constraints.get_services_retrieved_base,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_CHARACTERISTICS_RETRIEVED_BASE',
+ constraints.get_characteristics_retrieved_base,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_REQUEST_DEVICE_OPTIONS',
+ constraints.GetRequestDeviceOptions,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_GET_PRIMARY_SERVICES',
+ constraints.get_get_primary_services_call,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_GET_CHARACTERISTICS',
+ constraints.get_characteristics_call,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_PICK_A_SERVICE',
+ constraints.get_pick_a_service,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_PICK_A_CHARACTERISTIC',
+ constraints.get_pick_a_characteristic,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_VALUE',
+ constraints.get_buffer_source,
+ test_file_data)
+
+ test_file_data = FillInParameter('TRANSFORM_RELOAD_ID',
+ constraints.get_reload_id,
+ test_file_data)
+
+ return test_file_data
diff --git a/modules/bluetooth/testing/clusterfuzz/setup.py b/modules/bluetooth/testing/clusterfuzz/setup.py
new file mode 100644
index 0000000..f281ad0
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/setup.py
@@ -0,0 +1,109 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Script that helps run the fuzzer locally and in ClusterFuzz.
+
+ To prepare to run the fuzzer locally, this script copies the necessary
+ resources.
+
+ To prepare to run the fuzzer in ClusterFuzz this script generates two zip
+ files: web_bluetooth_fuzzer.tar.bz2. This zip file can then be directly
+ uploaded to ClusterFuzz.
+"""
+
+import argparse
+import glob
+import os
+import shutil
+import sys
+
+# src path from this file's path.
+SRC_PATH = os.path.join(
+ os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir)
+LAYOUT_TESTS_RESOURCES_PATH = os.path.join(
+ SRC_PATH, 'third_party', 'WebKit', 'LayoutTests', 'resources')
+COMMON_FUZZER_RESOURCES_PATH = os.path.join(
+ SRC_PATH, 'testing', 'clusterfuzz', 'common')
+RESOURCES = [
+ os.path.join(LAYOUT_TESTS_RESOURCES_PATH, 'testharness.js'),
+ os.path.join(LAYOUT_TESTS_RESOURCES_PATH, 'testharnessreport.js'),
+ os.path.join(LAYOUT_TESTS_RESOURCES_PATH, 'bluetooth',
+ 'bluetooth-helpers.js'),
+ os.path.join(COMMON_FUZZER_RESOURCES_PATH, 'fuzzy_types.py'),
+ os.path.join(COMMON_FUZZER_RESOURCES_PATH, 'utils.py'),
+ os.path.join(COMMON_FUZZER_RESOURCES_PATH, '__init__.py'),
+]
+
+
+def _GetCurrentPath():
+ """Returns this file's directory path"""
+ return os.path.dirname(os.path.realpath(__file__))
+
+
+def RetrieveResources():
+ # Create resources directory if it doesn't exist. Clear it otherwise.
+ current_path = _GetCurrentPath()
+ resources_path = os.path.join(current_path, 'resources')
+ if not os.path.exists(resources_path):
+ print '\'resources\' folder doesn\'t exist. Creating one...'
+ os.makedirs(resources_path)
+ else:
+ print '\'resources\' folder already exists. Clearing it...'
+ filelist = glob.glob(os.path.join(resources_path, '*'))
+ for f in filelist:
+ os.remove(f)
+
+ # Copy necessary files.
+ for r in RESOURCES:
+ print 'Copying: ' + os.path.abspath(os.path.join(current_path, r))
+ shutil.copy(os.path.join(current_path, r), resources_path)
+
+ return resources_path
+
+
+def main():
+
+ # Get arguments.
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-c', '--cluster_fuzz', action='store_true',
+ help='If present, this script generates tar.bz2 file '
+ 'containing the fuzzer. This file can be uploaded '
+ 'and run on ClusterFuzz.')
+ parser.add_argument('-l', '--local', action='store_true',
+ help='If present, this script retrieves the files '
+ 'necessary to run the fuzzer locally.')
+
+ args = parser.parse_args()
+
+ if not (args.cluster_fuzz or args.local):
+ print 'No action requested.'
+ return
+
+ RetrieveResources()
+
+ # To run locally we only need to copy the files.
+ if args.local:
+ print 'Ready to run locally!'
+
+ # To run on ClusterFuzz we create a tar.bz2 file.
+ if args.cluster_fuzz:
+ # Clean directory
+ current_path = _GetCurrentPath()
+ filelist = glob.glob(os.path.join(current_path, '*.pyc'))
+ for f in filelist:
+ os.remove(f)
+
+ # Compress folder to upload
+ compressed_file_path = os.path.join(current_path,
+ 'web_bluetooth_fuzzer')
+ shutil.make_archive(
+ compressed_file_path,
+ format='bztar',
+ root_dir=os.path.join(current_path, os.pardir),
+ base_dir='clusterfuzz')
+ print 'File wrote to: ' + compressed_file_path + '.tar.bz2'
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/modules/bluetooth/testing/clusterfuzz/test_case_fuzzer.py b/modules/bluetooth/testing/clusterfuzz/test_case_fuzzer.py
new file mode 100644
index 0000000..c493270
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/test_case_fuzzer.py
@@ -0,0 +1,198 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Module to generate a test file with random calls to the Web Bluetooth API."""
+
+import random
+from fuzzer_helpers import FillInParameter
+
+# Contains the different types of base tokens used when generating a test case.
+BASE_TOKENS = [
+ 'TRANSFORM_BASIC_BASE',
+ 'TRANSFORM_DEVICE_DISCOVERY_BASE',
+ 'TRANSFORM_CONNECTABLE_BASE',
+ 'TRANSFORM_SERVICES_RETRIEVED_BASE',
+ 'TRANSFORM_CHARACTERISTICS_RETRIEVED_BASE',
+]
+
+# Contains strings that represent calls to the Web Bluetooth API. These
+# strings can be sequentially placed together to generate sequences of
+# calls to the API. These strings are separated by line and placed so
+# that indentation can be performed more easily.
+TOKENS = [
+ [
+ '})',
+ '.catch(e => console.log(e.name + \': \' + e.message))',
+ '.then(() => {',
+ ],
+ # Request Device Tokens
+ [
+ ' requestDeviceWithKeyDown(TRANSFORM_REQUEST_DEVICE_OPTIONS);'
+ ],
+ [
+ ' return requestDeviceWithKeyDown(TRANSFORM_REQUEST_DEVICE_OPTIONS);',
+ '})',
+ '.then(device => {',
+ ],
+ # Connect Tokens
+ [
+ ' device.gatt.connect();',
+ ],
+ [
+ ' return device.gatt.connect();',
+ '})'
+ '.then(gatt => {',
+ ],
+ [
+ ' gatt.connect();',
+ ],
+ [
+ ' return gatt.connect();',
+ '})'
+ '.then(gatt => {',
+ ],
+ # GetPrimaryService(s) Tokens
+ [
+ ' device.gatt.TRANSFORM_GET_PRIMARY_SERVICES;',
+ ],
+ [
+ ' gatt.TRANSFORM_GET_PRIMARY_SERVICES;',
+ ],
+ [
+ ' return device.gatt.TRANSFORM_GET_PRIMARY_SERVICES;',
+ '})'
+ '.then(services => {',
+ ],
+ [
+ ' return gatt.TRANSFORM_GET_PRIMARY_SERVICES;',
+ '})'
+ '.then(services => {',
+ ],
+ # GetCharacteristic(s) Tokens
+ [
+ ' TRANSFORM_PICK_A_SERVICE;',
+ ' service.TRANSFORM_GET_CHARACTERISTICS;',
+ ],
+ [
+ ' TRANSFORM_PICK_A_SERVICE;',
+ ' return service.TRANSFORM_GET_CHARACTERISTICS;',
+ ],
+ # ReadValue Tokens
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' characteristic.readValue();',
+ ],
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' return characteristic.readValue().then(_ => characteristics);',
+ '})',
+ '.then(characteristics => {',
+ ],
+ # WriteValue Tokens
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' characteristic.writeValue(TRANSFORM_VALUE);',
+ ],
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' return characteristic.writeValue(TRANSFORM_VALUE).then(_ => characteristics);',
+ '})',
+ '.then(characteristics => {',
+ ],
+ # Start Notifications Tokens
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' characteristic.startNotifications();',
+ ],
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' return characteristic.startNotitications().then(_ => characteristics);',
+ '})',
+ '.then(characteristics => {',
+ ],
+ # Stop Notifications Tokens
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' characteristic.stopNotifications();',
+ ],
+ [
+ ' TRANSFORM_PICK_A_CHARACTERISTIC;',
+ ' return characteristic.stopNotitications().then(() => characteristics);',
+ '})',
+ '.then(characteristics => {',
+ ],
+ # Garbage Collection
+ [
+ ' runGarbageCollection();',
+ ],
+ [
+ '})',
+ '.then(runGarbageCollection)',
+ '.then(() => {',
+ ],
+ # Reload Tokens
+ # We generate a unique id for each reload and save it in sessionStorage.
+ # This ensures that the reload is only executed once and that if test cases
+ # share the same sessionStorage all their reloads are executed.
+ [
+ ' (() => {',
+ ' let reload_id = TRANSFORM_RELOAD_ID;',
+ ' if (!sessionStorage.getItem(reload_id)) {',
+ ' sessionStorage.setItem(reload_id, true);',
+ ' location.reload();',
+ ' }',
+ ' })();',
+ ],
+]
+
+INDENT = ' '
+BREAK = '\n'
+END_TOKEN = '});'
+
+# Maximum number of tokens that will be inserted in the generated
+# test case.
+MAX_NUM_OF_TOKENS = 100
+
+
+def _GenerateSequenceOfRandomTokens():
+ """Generates a sequence of calls to the Web Bluetooth API.
+
+ Uses the arrays of strings in TOKENS and randomly picks a number between
+ [1, 100] to generate a random sequence of calls to the Web Bluetooth API,
+ calls to reload the page, and calls to perform garbage collection.
+
+ Returns:
+ A string containing a sequence of calls to the Web Bluetooth API.
+ """
+ result = random.choice(BASE_TOKENS)
+
+ for _ in xrange(random.randint(1, MAX_NUM_OF_TOKENS)):
+ # Get random token.
+ token = random.choice(TOKENS)
+
+ # Indent and break line.
+ for line in token:
+ result += INDENT + line + BREAK
+
+ result += INDENT + END_TOKEN
+
+ return result
+
+
+def GenerateTestFile(template_file_data):
+ """Inserts a sequence of calls to the Web Bluetooth API into a template.
+
+ Args:
+ template_file_data: A template containing the 'TRANSFORM_RANDOM_TOKENS'
+ string.
+ Returns:
+ A string consisting of template_file_data with the string
+ 'TRANSFORM_RANDOM_TOKENS' replaced with a sequence of calls to the Web
+ Bluetooth API and calls to reload the page and perform garbage
+ collection.
+ """
+
+ return FillInParameter('TRANSFORM_RANDOM_TOKENS',
+ _GenerateSequenceOfRandomTokens,
+ template_file_data)
diff --git a/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py b/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py
new file mode 100644
index 0000000..dddb407
--- /dev/null
+++ b/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py
@@ -0,0 +1,215 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Module that contains information about Web Bluetooth's Fake Adapters."""
+
+BLOCKLISTED_UUID = '611c954a-263b-4f4a-aab6-01ddb953f985'
+DISCONNECTION_UUID = '01d7d889-7451-419f-aeb8-d65e7b9277af'
+GATT_ERROR_UUID = '000000a0-97e5-4cd7-b9f1-f5a427670c59'
+
+CONNECTION_ERROR_UUIDS = [
+ '00000000-97e5-4cd7-b9f1-f5a427670c59',
+ '00000001-97e5-4cd7-b9f1-f5a427670c59',
+ '00000002-97e5-4cd7-b9f1-f5a427670c59',
+ '00000003-97e5-4cd7-b9f1-f5a427670c59',
+ '00000004-97e5-4cd7-b9f1-f5a427670c59',
+ '00000005-97e5-4cd7-b9f1-f5a427670c59',
+ '00000006-97e5-4cd7-b9f1-f5a427670c59',
+ '00000007-97e5-4cd7-b9f1-f5a427670c59',
+ '00000008-97e5-4cd7-b9f1-f5a427670c59',
+ '00000009-97e5-4cd7-b9f1-f5a427670c59',
+ '0000000a-97e5-4cd7-b9f1-f5a427670c59',
+ '0000000b-97e5-4cd7-b9f1-f5a427670c59',
+ '0000000c-97e5-4cd7-b9f1-f5a427670c59',
+ '0000000d-97e5-4cd7-b9f1-f5a427670c59',
+ '0000000e-97e5-4cd7-b9f1-f5a427670c59',
+]
+
+# List of services that are included in our fake adapters.
+ADVERTISED_SERVICES = [
+ 'generic_access',
+ 'glucose',
+ 'tx_power',
+ 'heart_rate',
+ 'human_interface_device',
+ 'device_information',
+ 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes',
+ BLOCKLISTED_UUID,
+ CONNECTION_ERROR_UUIDS[0],
+ DISCONNECTION_UUID,
+ GATT_ERROR_UUID,
+]
+
+# List of services inside devices.
+SERVICES = [
+ 'generic_access',
+ 'heart_rate',
+ 'device_information',
+ 'generic_access',
+ 'heart_rate',
+ 'human_interface_device',
+ 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes',
+ BLOCKLISTED_UUID,
+ DISCONNECTION_UUID,
+ GATT_ERROR_UUID,
+]
+
+# List of characteristics inside devices.
+CHARACTERISTICS = [
+ 'bad1c9a2-9a5b-4015-8b60-1579bbbf2135',
+ '01d7d88a-7451-419f-aeb8-d65e7b9277af',
+ 'body_sensor_location',
+ 'gap.device_name',
+ 'heart_rate_measurement',
+ 'serial_number_string',
+ 'gap.peripheral_privacy_flag',
+]
+
+# Tuples of common service uuid and their characteristics uuids.
+GENERIC_ACCESS_SERVICE = (
+ 'generic_access', ['gap.device_name', 'gap.peripheral_privacy_flag']
+)
+
+HEART_RATE_SERVICE = (
+ 'heart_rate', ['heart_rate_measurement', 'body_sensor_location']
+)
+
+# List of available fake adapters.
+ALL_ADAPTERS = [
+ 'NotPresentAdapter',
+ 'NotPoweredAdapter',
+ 'EmptyAdapter',
+ 'FailStartDiscoveryAdapter',
+ 'GlucoseHeartRateAdapter',
+ 'UnicodeDeviceAdapter',
+ 'MissingServiceHeartRateAdapter',
+ 'MissingCharacteristicHeartRateAdapter',
+ 'HeartRateAdapter',
+ 'TwoHeartRateServicesAdapter',
+ 'DisconnectingHeartRateAdapter',
+ 'BlocklistTestAdapter',
+ 'FailingConnectionsAdapter',
+ 'FailingGATTOperationsAdapter',
+ 'DelayedServicesDiscoveryAdapter',
+ 'DeviceNameLongerThan29BytesAdapter',
+]
+
+# List of fake adapters that include devices.
+ADAPTERS_WITH_DEVICES = [
+ (
+ 'GlucoseHeartRateAdapter',
+ ['generic_access', 'heart_rate', 'glucose', 'tx_power'],
+ ),
+ (
+ 'MissingServiceHeartRateAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'MissingCharacteristicHeartRateAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'HeartRateAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'TwoHeartRateServicesAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'DisconnectingHeartRateAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'BlocklistTestAdapter',
+ [BLOCKLISTED_UUID, 'device_information', 'generic_access',
+ 'heart_rate', 'human_interface_device'],
+ ),
+ (
+ 'FailingConnectionsAdapter',
+ CONNECTION_ERROR_UUIDS,
+ ),
+ (
+ 'FailingGATTOperationsAdapter',
+ [GATT_ERROR_UUID],
+ ),
+ (
+ 'DelayedServicesDiscoveryAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'DeviceNameLongerThan29BytesAdapter',
+ ['a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes'],
+ ),
+]
+
+# List of fake adapters with services.
+ADAPTERS_WITH_SERVICES = [
+ (
+ 'MissingCharacteristicHeartRateAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'HeartRateAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'TwoHeartRateServicesAdapter',
+ ['generic_access', 'heart_rate'],
+ ),
+ (
+ 'DisconnectingHeartRateAdapter',
+ ['generic_access', 'heart_rate', DISCONNECTION_UUID],
+ ),
+ (
+ 'BlocklistTestAdapter',
+ [BLOCKLISTED_UUID, 'device_information', 'generic_access',
+ 'heart_rate', 'human_interface_device'],
+ ),
+ (
+ 'FailingGATTOperationsAdapter',
+ [GATT_ERROR_UUID],
+ ),
+ (
+ 'DelayedServicesDiscoveryAdapter',
+ ['heart_rate']
+ ),
+]
+
+ADAPTERS_WITH_CHARACTERISTICS = [
+ (
+ 'HeartRateAdapter',
+ [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE],
+ ),
+ (
+ 'TwoHeartRateServicesAdapter',
+ [HEART_RATE_SERVICE],
+ ),
+ (
+ 'DisconnectingHeartRateAdapter',
+ [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE,
+ (DISCONNECTION_UUID, ['01d7d88a-7451-419f-aeb8-d65e7b9277af'])]
+ ),
+ (
+ 'BlocklistTestAdapter',
+ [GENERIC_ACCESS_SERVICE, HEART_RATE_SERVICE, (
+ BLOCKLISTED_UUID, ['bad1c9a2-9a5b-4015-8b60-1579bbbf2135'],
+ ), (
+ 'device_information', ['serial_number_string'],
+ )]
+ ),
+ (
+ 'FailingGATTOperationsAdapter',
+ [(GATT_ERROR_UUID, [
+ '000000a1-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a2-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a3-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a4-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a5-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a6-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a7-97e5-4cd7-b9f1-f5a427670c59',
+ '000000a8-97e5-4cd7-b9f1-f5a427670c59',
+ ])],
+ ),
+]
diff --git a/modules/broadcastchannel/BroadcastChannel.idl b/modules/broadcastchannel/BroadcastChannel.idl
new file mode 100644
index 0000000..f971cab
--- /dev/null
+++ b/modules/broadcastchannel/BroadcastChannel.idl
@@ -0,0 +1,24 @@
+// Copyright 2016 The Chromium 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#broadcastchannel
+
+[
+ Constructor(DOMString name),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ Exposed=(Window,Worker),
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Measure
+] interface BroadcastChannel : EventTarget {
+ readonly attribute DOMString name;
+
+ [RaisesException, Measure] void postMessage(any message);
+ [Measure] void close();
+
+ // event handlers
+ attribute EventHandler onmessage;
+ attribute EventHandler onmessageerror;
+};
diff --git a/modules/budget/BudgetService.idl b/modules/budget/BudgetService.idl
new file mode 100644
index 0000000..e0235e2
--- /dev/null
+++ b/modules/budget/BudgetService.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/budget-api/#budget-service-interface
+
+enum OperationType {
+ "silent-push"
+};
+
+[
+ RuntimeEnabled=Budget,
+ Exposed=(Window,Worker)
+] interface BudgetService {
+ [OriginTrialEnabled=BudgetQuery, CallWith=ScriptState, MeasureAs=BudgetAPIGetCost] Promise<double> getCost(OperationType operation);
+ [OriginTrialEnabled=BudgetQuery, CallWith=ScriptState, MeasureAs=BudgetAPIGetBudget] Promise<sequence<BudgetState>> getBudget();
+ [CallWith=ScriptState] Promise<boolean> reserve(OperationType operation);
+};
diff --git a/modules/budget/BudgetState.idl b/modules/budget/BudgetState.idl
new file mode 100644
index 0000000..41e6f4d
--- /dev/null
+++ b/modules/budget/BudgetState.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/budget-api/#budget-state-interface
+
+[
+ OriginTrialEnabled=BudgetQuery,
+ Exposed=(Window,Worker)
+] interface BudgetState {
+ readonly attribute double budgetAt;
+ readonly attribute DOMTimeStamp time;
+};
diff --git a/modules/budget/NavigatorBudget.idl b/modules/budget/NavigatorBudget.idl
new file mode 100644
index 0000000..92105ca
--- /dev/null
+++ b/modules/budget/NavigatorBudget.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/budget-api/#navigator-workernavigator-extensions
+
+[
+ ImplementedAs=NavigatorBudget,
+ RuntimeEnabled=Budget
+] partial interface Navigator {
+ [SameObject] readonly attribute BudgetService budget;
+};
diff --git a/modules/budget/WorkerNavigatorBudget.idl b/modules/budget/WorkerNavigatorBudget.idl
new file mode 100644
index 0000000..8f4f2b5
--- /dev/null
+++ b/modules/budget/WorkerNavigatorBudget.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/budget-api/#navigator-workernavigator-extensions
+
+[
+ ImplementedAs=WorkerNavigatorBudget,
+ RuntimeEnabled=Budget
+] partial interface WorkerNavigator {
+ [SameObject, CallWith=ExecutionContext] readonly attribute BudgetService budget;
+};
diff --git a/modules/cachestorage/Cache.idl b/modules/cachestorage/Cache.idl
index 6bd3c42..7c0fb2a 100644
--- a/modules/cachestorage/Cache.idl
+++ b/modules/cachestorage/Cache.idl
@@ -2,17 +2,16 @@
// 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
+// https://w3c.github.io/ServiceWorker/#cache-interface
[
- GarbageCollected,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface Cache {
- [CallWith=ScriptState, RaisesException] Promise<Response> match(RequestInfo request, optional CacheQueryOptions options);
+ [CallWith=ScriptState, RaisesException] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
[CallWith=ScriptState, RaisesException] Promise<sequence<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
[CallWith=ScriptState, RaisesException] Promise<void> add(RequestInfo request);
[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);
+ [CallWith=ScriptState, RaisesException] Promise<sequence<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options);
};
diff --git a/modules/cachestorage/CacheQueryOptions.idl b/modules/cachestorage/CacheQueryOptions.idl
index c867090..032ff17 100644
--- a/modules/cachestorage/CacheQueryOptions.idl
+++ b/modules/cachestorage/CacheQueryOptions.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/ServiceWorker/#cache-interface
dictionary CacheQueryOptions {
boolean ignoreSearch = false;
boolean ignoreMethod = false;
diff --git a/modules/cachestorage/CacheStorage.idl b/modules/cachestorage/CacheStorage.idl
index 5749c17..65af41b 100644
--- a/modules/cachestorage/CacheStorage.idl
+++ b/modules/cachestorage/CacheStorage.idl
@@ -2,14 +2,13 @@
// 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
+// See https://w3c.github.io/ServiceWorker/#cachestorage-interface
[
- GarbageCollected,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface CacheStorage {
+ [CallWith=ScriptState, RaisesException] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
[CallWith=ScriptState, RaisesException] Promise<boolean> has(DOMString cacheName);
[CallWith=ScriptState, RaisesException] Promise<Cache> open(DOMString cacheName);
[CallWith=ScriptState, RaisesException, ImplementedAs=deleteFunction] Promise<boolean> delete(DOMString cacheName);
[CallWith=ScriptState, RaisesException] 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
index 7aadd81..5f1e045 100644
--- a/modules/cachestorage/WindowCacheStorage.idl
+++ b/modules/cachestorage/WindowCacheStorage.idl
@@ -2,10 +2,9 @@
// 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
+// https://w3c.github.io/ServiceWorker/#self-caches
[
- RuntimeEnabled=GlobalCacheStorage,
- ImplementedAs=GlobalCacheStorage,
+ ImplementedAs=GlobalCacheStorage
] partial interface Window {
- [Unforgeable, MeasureAs=GlobalCacheStorage, RuntimeEnabled=GlobalCacheStorage, RaisesException] readonly attribute CacheStorage caches;
+ [MeasureAs=GlobalCacheStorage, RaisesException] readonly attribute CacheStorage caches;
};
diff --git a/modules/cachestorage/WorkerCacheStorage.idl b/modules/cachestorage/WorkerCacheStorage.idl
index 5916e88..62ebc32 100644
--- a/modules/cachestorage/WorkerCacheStorage.idl
+++ b/modules/cachestorage/WorkerCacheStorage.idl
@@ -2,10 +2,9 @@
// 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
+// https://w3c.github.io/ServiceWorker/#self-caches
[
- RuntimeEnabled=GlobalCacheStorage,
- ImplementedAs=GlobalCacheStorage,
+ ImplementedAs=GlobalCacheStorage
] partial interface WorkerGlobalScope {
- [Unforgeable, MeasureAs=GlobalCacheStorage, RuntimeEnabled=GlobalCacheStorage, RaisesException] readonly attribute CacheStorage caches;
+ [MeasureAs=GlobalCacheStorage, RaisesException] readonly attribute CacheStorage caches;
};
diff --git a/modules/canvas/HTMLCanvasElementModule.idl b/modules/canvas/HTMLCanvasElementModule.idl
new file mode 100644
index 0000000..6bdc7c6
--- /dev/null
+++ b/modules/canvas/HTMLCanvasElementModule.idl
@@ -0,0 +1,23 @@
+// Copyright 2016 The Chromium 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-canvas-element
+
+typedef (CanvasRenderingContext2D or
+ WebGLRenderingContext or
+ WebGL2RenderingContext or
+ ImageBitmapRenderingContext) RenderingContext;
+
+[
+ ImplementedAs=HTMLCanvasElementModule
+] partial interface HTMLCanvasElement
+{
+ // 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.
+ // Related spec issue: https://github.com/whatwg/html/issues/595
+ [RaisesException] RenderingContext? getContext(DOMString contextId, [PermissiveDictionaryConversion] optional CanvasContextCreationAttributes attributes);
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, MeasureAs=OffscreenCanvas] OffscreenCanvas transferControlToOffscreen();
+};
diff --git a/modules/canvas2d/Canvas2DContextAttributes.idl b/modules/canvas2d/Canvas2DContextAttributes.idl
deleted file mode 100644
index 41f8b80..0000000
--- a/modules/canvas2d/Canvas2DContextAttributes.idl
+++ /dev/null
@@ -1,29 +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.
- *
- * 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.
- */
-
-dictionary Canvas2DContextAttributes {
- boolean alpha = true;
-};
diff --git a/modules/canvas2d/CanvasGradient.idl b/modules/canvas2d/CanvasGradient.idl
index 8b7d542..8f06b50 100644
--- a/modules/canvas2d/CanvasGradient.idl
+++ b/modules/canvas2d/CanvasGradient.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
- GarbageCollected,
+ Exposed(Worker ExperimentalCanvasFeatures, Window StableBlinkFeatures)
] interface CanvasGradient {
[RaisesException] void addColorStop(float offset, DOMString color);
diff --git a/modules/canvas2d/CanvasPath.idl b/modules/canvas2d/CanvasPath.idl
new file mode 100644
index 0000000..0fcd2ab
--- /dev/null
+++ b/modules/canvas2d/CanvasPath.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://html.spec.whatwg.org/multipage/scripting.html#canvaspath
+
+[
+ NoInterfaceObject // Always used on target of 'implements'
+] interface CanvasPath {
+ // shared path API methods
+ void closePath();
+ void moveTo(unrestricted float x, unrestricted float y);
+ void lineTo(unrestricted float x, unrestricted float y);
+ void quadraticCurveTo(unrestricted float cpx, unrestricted float cpy, unrestricted float x, unrestricted float y);
+ void bezierCurveTo(unrestricted float cp1x, unrestricted float cp1y, unrestricted float cp2x, unrestricted float cp2y, unrestricted float x, unrestricted float y);
+ [RaisesException] void arcTo(unrestricted float x1, unrestricted float y1, unrestricted float x2, unrestricted float y2, unrestricted float radius);
+ void rect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+ [RaisesException] void arc(unrestricted float x, unrestricted float y, unrestricted float radius, unrestricted float startAngle, unrestricted float endAngle, [Default=Undefined] optional boolean anticlockwise);
+ [RaisesException] void ellipse(unrestricted float x, unrestricted float y, unrestricted float radiusX, unrestricted float radiusY, unrestricted float rotation, unrestricted float startAngle, unrestricted float endAngle, [Default=Undefined] optional boolean anticlockwise);
+};
diff --git a/modules/canvas2d/CanvasPathMethods.idl b/modules/canvas2d/CanvasPathMethods.idl
deleted file mode 100644
index 2c37810..0000000
--- a/modules/canvas2d/CanvasPathMethods.idl
+++ /dev/null
@@ -1,20 +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://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvaspathmethods
-
-[
- NoInterfaceObject, // Always used on target of 'implements'
-] interface CanvasPathMethods {
- // shared path API methods
- void closePath();
- void moveTo(unrestricted float x, unrestricted float y);
- void lineTo(unrestricted float x, unrestricted float y);
- void quadraticCurveTo(unrestricted float cpx, unrestricted float cpy, unrestricted float x, unrestricted float y);
- void bezierCurveTo(unrestricted float cp1x, unrestricted float cp1y, unrestricted float cp2x, unrestricted float cp2y, unrestricted float x, unrestricted float y);
- [RaisesException] void arcTo(unrestricted float x1, unrestricted float y1, unrestricted float x2, unrestricted float y2, unrestricted float radius);
- void rect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
- [RaisesException] void arc(unrestricted float x, unrestricted float y, unrestricted float radius, unrestricted float startAngle, unrestricted float endAngle, [Default=Undefined] optional boolean anticlockwise);
- [RaisesException] void ellipse(unrestricted float x, unrestricted float y, unrestricted float radiusX, unrestricted float radiusY, unrestricted float rotation, unrestricted float startAngle, unrestricted float endAngle, [Default=Undefined] optional boolean anticlockwise);
-};
diff --git a/modules/canvas2d/CanvasPattern.idl b/modules/canvas2d/CanvasPattern.idl
index d0804d7..8cd46b0 100644
--- a/modules/canvas2d/CanvasPattern.idl
+++ b/modules/canvas2d/CanvasPattern.idl
@@ -23,9 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
- GarbageCollected,
+ Exposed(Worker ExperimentalCanvasFeatures, Window StableBlinkFeatures)
] interface CanvasPattern {
- [RuntimeEnabled=ExperimentalCanvasFeatures] void setTransform(SVGMatrix transform);
+ [RuntimeEnabled=ExperimentalCanvasFeatures,Exposed=Window] void setTransform(SVGMatrix transform);
};
diff --git a/modules/canvas2d/CanvasRenderingContext2D.idl b/modules/canvas2d/CanvasRenderingContext2D.idl
index a2a897c..9cd7355 100644
--- a/modules/canvas2d/CanvasRenderingContext2D.idl
+++ b/modules/canvas2d/CanvasRenderingContext2D.idl
@@ -25,18 +25,27 @@
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasrenderingcontext2d
-typedef (HTMLImageElement or
+// The spec specifies:
+// typedef (HTMLImageElement or
+// SVGImageElement) HTMLOrSVGImageElement;
+// but there's a problem with our IDL code generator for typedef-in-typedef,
+// so we split this into two for simplicity. There's no difference from a user
+// perspective.
+// TODO(fserb): revisit this once union typedefs are finalized.
+
+typedef (CSSImageValue or
+ HTMLImageElement or
+ SVGImageElement or
HTMLVideoElement or
HTMLCanvasElement or
- // CanvasRenderingContext2D or
- ImageBitmap) CanvasImageSource;
+ ImageBitmap or
+ OffscreenCanvas) CanvasImageSource;
enum CanvasFillRule { "nonzero", "evenodd" };
enum ImageSmoothingQuality {"low", "medium", "high"};
[
- SetWrapperReferenceFrom=canvas,
- WillBeGarbageCollected,
+ DependentLifetime
] interface CanvasRenderingContext2D {
// back-reference to the canvas
readonly attribute HTMLCanvasElement canvas;
@@ -57,19 +66,18 @@
// compositing
attribute unrestricted double globalAlpha; // (default 1.0)
attribute DOMString globalCompositeOperation; // (default source-over)
- [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString filter; // (default 'none')
+ [MeasureAs=Canvas2DFilter] attribute DOMString filter; // (default 'none')
// image smoothing
- [ImplementedAs=imageSmoothingEnabled, DeprecateAs=PrefixedImageSmoothingEnabled] attribute boolean webkitImageSmoothingEnabled;
- [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothingEnabled; // (default True)
- [RuntimeEnabled=ExperimentalCanvasFeatures] attribute ImageSmoothingQuality imageSmoothingQuality; // (default "low")
+ attribute boolean imageSmoothingEnabled; // (default True)
+ [MeasureAs=Canvas2DImageSmoothingQuality]attribute ImageSmoothingQuality imageSmoothingQuality; // (default "low")
// 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(double x0, double y0, double x1, double y1);
[RaisesException] CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
- [RaisesException] CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType);
+ [CallWith=ScriptState, RaisesException] CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType);
// shadows
attribute unrestricted double shadowOffsetX;
@@ -82,7 +90,7 @@
void fillRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
void strokeRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
- // path API (see also CanvasPathMethods)
+ // path API (see also CanvasPath)
void beginPath();
void fill(optional CanvasFillRule winding);
void fill(Path2D path, optional CanvasFillRule winding);
@@ -106,9 +114,9 @@
TextMetrics measureText(DOMString text);
// drawing images
- [RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y);
- [RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
- [RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
// hit regions
[RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegion(optional HitRegionOptions options);
@@ -116,17 +124,21 @@
[RuntimeEnabled=ExperimentalCanvasFeatures] void clearHitRegions();
// pixel manipulation
- ImageData createImageData(ImageData imagedata);
- [RaisesException] ImageData createImageData(double sw, double sh);
- [RaisesException] ImageData getImageData(double sx, double sy, double sw, double sh);
- [RaisesException] void putImageData(ImageData imagedata, double dx, double dy);
- [RaisesException] void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
+ [RaisesException] ImageData createImageData(ImageData imagedata);
+ [RaisesException] ImageData createImageData(long sw, long sh);
+ [RaisesException] ImageData getImageData(long sx, long sy, long sw, long sh);
+ [RaisesException] void putImageData(ImageData imagedata, long dx, long dy);
+ [RaisesException] void putImageData(ImageData imagedata, long dx, long dy, long dirtyX, long dirtyY, long dirtyWidth, long dirtyHeight);
+
+ // https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(unsigned long sw, unsigned long sh, ImageDataColorSettings imageDataColorSettings);
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(ImageDataArray data, unsigned long sw, unsigned long sh, optional ImageDataColorSettings imageDataColorSettings);
// Context state
// Should be merged with WebGL counterpart in CanvasRenderingContext, once no-longer experimental
[RuntimeEnabled=ExperimentalCanvasFeatures] boolean isContextLost();
- Canvas2DContextAttributes getContextAttributes();
+ [RuntimeEnabled=ExperimentalCanvasFeatures, MeasureAs=GetCanvas2DContextAttributes] CanvasRenderingContext2DSettings getContextAttributes();
// FIXME: factor out to CanvasDrawingStyles
// line caps/joins
@@ -148,4 +160,4 @@
};
-CanvasRenderingContext2D implements CanvasPathMethods;
+CanvasRenderingContext2D implements CanvasPath;
diff --git a/modules/canvas2d/CanvasRenderingContext2DSettings.idl b/modules/canvas2d/CanvasRenderingContext2DSettings.idl
new file mode 100644
index 0000000..283cb92
--- /dev/null
+++ b/modules/canvas2d/CanvasRenderingContext2DSettings.idl
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium 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/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md
+
+[PermissiveDictionaryConversion]
+dictionary CanvasRenderingContext2DSettings {
+ boolean alpha = true;
+
+ // TODO(crbug.com/637288): Do we keep "legacy-srgb" as the default?
+ // Must decide before shipping.
+ [RuntimeEnabled=ExperimentalCanvasFeatures] CanvasColorSpace colorSpace = "legacy-srgb";
+ [RuntimeEnabled=ExperimentalCanvasFeatures] CanvasPixelFormat pixelFormat = "8-8-8-8";
+ [RuntimeEnabled=ExperimentalCanvasFeatures] boolean linearPixelMath = false;
+};
+
diff --git a/modules/canvas2d/MouseEventHitRegion.idl b/modules/canvas2d/MouseEventHitRegion.idl
deleted file mode 100644
index e501b4e..0000000
--- a/modules/canvas2d/MouseEventHitRegion.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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#MouseEvent-partial
-
-[
- RuntimeEnabled=ExperimentalCanvasFeatures
-] partial interface MouseEvent {
- readonly attribute DOMString? region;
-};
diff --git a/modules/canvas2d/Path2D.idl b/modules/canvas2d/Path2D.idl
index 8f8a2a1..0842495 100644
--- a/modules/canvas2d/Path2D.idl
+++ b/modules/canvas2d/Path2D.idl
@@ -32,10 +32,10 @@
Constructor,
Constructor(Path2D path),
Constructor(DOMString text),
- GarbageCollected,
+ Exposed(Worker ExperimentalCanvasFeatures, Window StableBlinkFeatures, PaintWorklet CSSPaintAPI)
] interface Path2D {
[RuntimeEnabled=ExperimentalCanvasFeatures] void addPath(Path2D path, optional SVGMatrix? transform);
};
-Path2D implements CanvasPathMethods;
+Path2D implements CanvasPath;
diff --git a/modules/canvas2d/TouchHitRegion.idl b/modules/canvas2d/TouchHitRegion.idl
deleted file mode 100644
index 50c6a92..0000000
--- a/modules/canvas2d/TouchHitRegion.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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/scripting.html#Touch-partial
-
-[
- RuntimeEnabled=ExperimentalCanvasFeatures
-] partial interface Touch {
- readonly attribute DOMString? region;
-};
diff --git a/modules/compositorworker/AnimationWorkletGlobalScope.idl b/modules/compositorworker/AnimationWorkletGlobalScope.idl
new file mode 100644
index 0000000..e94fd5b
--- /dev/null
+++ b/modules/compositorworker/AnimationWorkletGlobalScope.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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=AnimationWorklet,
+ Global=(Worklet,AnimationWorklet),
+ RuntimeEnabled=AnimationWorklet
+] interface AnimationWorkletGlobalScope : WorkletGlobalScope {
+ [RaisesException] void registerAnimator(DOMString name, Function animatorConstructor);
+};
diff --git a/modules/compositorworker/CompositorWorker.idl b/modules/compositorworker/CompositorWorker.idl
deleted file mode 100644
index c7a57ed..0000000
--- a/modules/compositorworker/CompositorWorker.idl
+++ /dev/null
@@ -1,18 +0,0 @@
-// 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.
-
-[
- DependentLifetime,
- Constructor(DOMString scriptUrl),
- ConstructorCallWith=ExecutionContext,
- GarbageCollected,
- RaisesException=Constructor,
- RuntimeEnabled=CompositorWorker,
-] 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
deleted file mode 100644
index f51d663..0000000
--- a/modules/compositorworker/CompositorWorkerGlobalScope.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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,
-] 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/compositorworker/WindowAnimationWorklet.idl b/modules/compositorworker/WindowAnimationWorklet.idl
new file mode 100644
index 0000000..071ccd6
--- /dev/null
+++ b/modules/compositorworker/WindowAnimationWorklet.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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=WindowAnimationWorklet,
+ RuntimeEnabled=AnimationWorklet
+] partial interface Window {
+ readonly attribute Worklet animationWorklet;
+};
diff --git a/modules/compositorworker/WorkletAnimation.idl b/modules/compositorworker/WorkletAnimation.idl
new file mode 100644
index 0000000..e2afda4
--- /dev/null
+++ b/modules/compositorworker/WorkletAnimation.idl
@@ -0,0 +1,19 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/animation-worklet/#worklet-animation-desc
+
+// TODO(smcgruer): Update constructor to match latest spec.
+[
+ Constructor(DOMString animatorName,
+ sequence<KeyframeEffectReadOnly> effects,
+ sequence<(DocumentTimeline or ScrollTimeline)> timelines,
+ SerializedScriptValue options),
+ RaisesException=Constructor,
+ RuntimeEnabled=AnimationWorklet
+] interface WorkletAnimation {
+ readonly attribute AnimationPlayState playState;
+ void play();
+ void cancel();
+};
diff --git a/modules/cookie_store/CookieListItem.idl b/modules/cookie_store/CookieListItem.idl
new file mode 100644
index 0000000..a886361
--- /dev/null
+++ b/modules/cookie_store/CookieListItem.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/WICG/async-cookies-api/blob/gh-pages/explainer.md
+
+dictionary CookieListItem {
+ DOMString name;
+ DOMString value;
+};
+
+typedef sequence<CookieListItem> CookieList;
diff --git a/modules/cookie_store/CookieStore.idl b/modules/cookie_store/CookieStore.idl
new file mode 100644
index 0000000..04aa7d9
--- /dev/null
+++ b/modules/cookie_store/CookieStore.idl
@@ -0,0 +1,20 @@
+// Copyright 2017 The Chromium 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/WICG/async-cookies-api/blob/gh-pages/explainer.md
+
+[
+ Exposed=Window,
+ RuntimeEnabled=AsyncCookies
+] interface CookieStore {
+ // https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md#reading
+ [CallWith=ScriptState, RaisesException] Promise<CookieList?> getAll(
+ optional CookieStoreGetOptions options);
+
+ // https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md#writing
+ [CallWith=ScriptState, RaisesException] Promise<void> set(
+ DOMString name, DOMString value, optional CookieStoreSetOptions options);
+
+ // TODO(crbug.com/729800): Implement the other operations in the spec.
+};
diff --git a/modules/cookie_store/CookieStoreGetOptions.idl b/modules/cookie_store/CookieStoreGetOptions.idl
new file mode 100644
index 0000000..b7f3ebb
--- /dev/null
+++ b/modules/cookie_store/CookieStoreGetOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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/WICG/async-cookies-api/blob/gh-pages/explainer.md
+
+dictionary CookieStoreGetOptions {
+ // TODO(crbug.com/729800): Implement the members in the specification.
+};
diff --git a/modules/cookie_store/CookieStoreSetOptions.idl b/modules/cookie_store/CookieStoreSetOptions.idl
new file mode 100644
index 0000000..d6ee7d9
--- /dev/null
+++ b/modules/cookie_store/CookieStoreSetOptions.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/WICG/async-cookies-api/blob/gh-pages/explainer.md
+
+dictionary CookieStoreSetOptions {
+ // TODO(crbug.com/729800): Implement the other members in the specification.
+
+ DOMTimeStamp? expires = null;
+};
diff --git a/modules/cookie_store/WindowCookieStore.idl b/modules/cookie_store/WindowCookieStore.idl
new file mode 100644
index 0000000..70f6518
--- /dev/null
+++ b/modules/cookie_store/WindowCookieStore.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/WICG/async-cookies-api/blob/gh-pages/explainer.md
+
+[
+ RuntimeEnabled=AsyncCookies,
+ ImplementedAs=GlobalCookieStore
+] partial interface Window {
+ [Replaceable, SameObject] readonly attribute CookieStore cookieStore;
+};
diff --git a/modules/credentialmanager/AuthenticatorAssertionResponse.idl b/modules/credentialmanager/AuthenticatorAssertionResponse.idl
new file mode 100644
index 0000000..a88a613
--- /dev/null
+++ b/modules/credentialmanager/AuthenticatorAssertionResponse.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#authenticatorassertionresponse
+
+[
+ RuntimeEnabled=WebAuth,
+ SecureContext
+] interface AuthenticatorAssertionResponse : AuthenticatorResponse {
+ readonly attribute ArrayBuffer authenticatorData;
+ readonly attribute ArrayBuffer signature;
+};
diff --git a/modules/credentialmanager/AuthenticatorAttestationResponse.idl b/modules/credentialmanager/AuthenticatorAttestationResponse.idl
new file mode 100644
index 0000000..f203582
--- /dev/null
+++ b/modules/credentialmanager/AuthenticatorAttestationResponse.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#authenticatorattestationresponse
+
+[
+ RuntimeEnabled=WebAuth,
+ SecureContext
+] interface AuthenticatorAttestationResponse : AuthenticatorResponse {
+ readonly attribute ArrayBuffer attestationObject;
+};
diff --git a/modules/credentialmanager/AuthenticatorResponse.idl b/modules/credentialmanager/AuthenticatorResponse.idl
new file mode 100644
index 0000000..b10dc2e
--- /dev/null
+++ b/modules/credentialmanager/AuthenticatorResponse.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#authenticatorresponse
+
+[
+ RuntimeEnabled=WebAuth,
+ SecureContext
+] interface AuthenticatorResponse {
+ readonly attribute ArrayBuffer clientDataJSON;
+};
diff --git a/modules/credentialmanager/AuthenticatorSelectionCriteria.idl b/modules/credentialmanager/AuthenticatorSelectionCriteria.idl
new file mode 100644
index 0000000..b2a1528
--- /dev/null
+++ b/modules/credentialmanager/AuthenticatorSelectionCriteria.idl
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#enumdef-authenticatorattachment
+
+enum Attachment {
+ "platform",
+ "cross-platform"
+};
+
+// https://www.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-authenticatorselectioncriteria
+
+dictionary AuthenticatorSelectionCriteria {
+ Attachment attachment;
+ boolean requireResidentKey = false;
+};
diff --git a/modules/credentialmanager/CollectedClientData.idl b/modules/credentialmanager/CollectedClientData.idl
new file mode 100644
index 0000000..01ac885
--- /dev/null
+++ b/modules/credentialmanager/CollectedClientData.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-collectedclientdata
+
+dictionary CollectedClientData {
+ required DOMString challenge;
+ required DOMString origin;
+ required DOMString hashAlg;
+ DOMString tokenBindingId;
+ // TODO(crbug.com/733033): Add extension support
+};
diff --git a/modules/credentialmanager/Credential.idl b/modules/credentialmanager/Credential.idl
index 27a73ae..01b853e 100644
--- a/modules/credentialmanager/Credential.idl
+++ b/modules/credentialmanager/Credential.idl
@@ -2,17 +2,10 @@
// 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
+// https://w3c.github.io/webappsec-credential-management/#credential
-[
- RuntimeEnabled=CredentialManager,
- GarbageCollected,
- Exposed=Window
-] interface Credential {
- readonly attribute DOMString id;
+[Exposed=Window, SecureContext]
+interface Credential {
+ readonly attribute USVString id;
readonly attribute DOMString type;
-
- // TODO(mkwst): These should be on LocallyStoredCredential.
- readonly attribute DOMString name;
- readonly attribute DOMString iconURL;
};
diff --git a/modules/credentialmanager/CredentialCreationOptions.idl b/modules/credentialmanager/CredentialCreationOptions.idl
new file mode 100644
index 0000000..6a3cf46
--- /dev/null
+++ b/modules/credentialmanager/CredentialCreationOptions.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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-credential-management/#dictdef-credentialcreationoptions
+// https://w3c.github.io/webappsec-credential-management/#dictdef-credentialcreationoptions0
+// https://w3c.github.io/webappsec-credential-management/#dictdef-credentialcreationoptions1
+
+typedef (PasswordCredentialData or HTMLFormElement) PasswordCredentialInit;
+
+dictionary CredentialCreationOptions {
+ PasswordCredentialInit? password;
+ FederatedCredentialInit? federated;
+ MakeCredentialOptions? publicKey;
+};
diff --git a/modules/credentialmanager/CredentialData.idl b/modules/credentialmanager/CredentialData.idl
index 68d5363..55c2f8f 100644
--- a/modules/credentialmanager/CredentialData.idl
+++ b/modules/credentialmanager/CredentialData.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/webappsec-credential-management/#dictdef-credentialdata
dictionary CredentialData {
DOMString id;
diff --git a/modules/credentialmanager/CredentialRequestOptions.idl b/modules/credentialmanager/CredentialRequestOptions.idl
index 0e5902a..7cab340 100644
--- a/modules/credentialmanager/CredentialRequestOptions.idl
+++ b/modules/credentialmanager/CredentialRequestOptions.idl
@@ -2,11 +2,29 @@
// 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
+// https://w3c.github.io/webappsec-credential-management/#dictdef-credentialrequestoptions
+
+enum CredentialMediationRequirement {
+ "silent",
+ "optional",
+ "required"
+};
dictionary CredentialRequestOptions {
- FederatedCredentialRequestOptions federated;
+ FederatedCredentialRequestOptions? federated;
boolean password = false;
- boolean unmediated = false;
+ // Defaults to false. This is not set here to detect when both 'unmediated'
+ // and 'mediation' are user provided, which results in a warning if they
+ // contradict each other.
+ [DeprecateAs=CredentialManagerCredentialRequestOptionsUnmediated] boolean
+ unmediated;
+ // Defaults to "optional". This is not set here to detect when both
+ // 'unmediated' and 'mediation' are user provided, which results in a
+ // warning if they contradict each other.
+ // TODO(http://crbug.com/715077): Set the default here when 'unmediated' is
+ // removed.
+ CredentialMediationRequirement mediation;
+
+ PublicKeyCredentialRequestOptions? publicKey;
};
diff --git a/modules/credentialmanager/CredentialUserData.idl b/modules/credentialmanager/CredentialUserData.idl
new file mode 100644
index 0000000..970140e
--- /dev/null
+++ b/modules/credentialmanager/CredentialUserData.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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-credential-management/#credentialuserdata
+
+[NoInterfaceObject]
+interface CredentialUserData {
+ readonly attribute USVString name;
+ readonly attribute USVString iconURL;
+};
diff --git a/modules/credentialmanager/CredentialsContainer.idl b/modules/credentialmanager/CredentialsContainer.idl
index dc7c109..61af179 100644
--- a/modules/credentialmanager/CredentialsContainer.idl
+++ b/modules/credentialmanager/CredentialsContainer.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.
-[
- RuntimeEnabled=CredentialManager,
- GarbageCollected
-] interface CredentialsContainer {
+// https://w3c.github.io/webappsec-credential-management/#credentialscontainer
+
+[Exposed=Window, SecureContext]
+interface CredentialsContainer {
[CallWith=ScriptState, MeasureAs=CredentialManagerGet] Promise get(optional CredentialRequestOptions options);
[CallWith=ScriptState, MeasureAs=CredentialManagerStore] Promise store(Credential credential);
- [CallWith=ScriptState, MeasureAs=CredentialManagerRequireUserMediation] Promise requireUserMediation();
+ [CallWith=ScriptState, RaisesException, MeasureAs=CredentialManagerCreate] Promise create(optional CredentialCreationOptions options);
+ [CallWith=ScriptState, MeasureAs=CredentialManagerPreventSilentAccess] Promise preventSilentAccess();
+ [CallWith=ScriptState, DeprecateAs=CredentialManagerRequireUserMediation] Promise requireUserMediation();
};
diff --git a/modules/credentialmanager/FederatedCredential.idl b/modules/credentialmanager/FederatedCredential.idl
index f72009a..efd7e22 100644
--- a/modules/credentialmanager/FederatedCredential.idl
+++ b/modules/credentialmanager/FederatedCredential.idl
@@ -2,16 +2,17 @@
// 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
+// https://w3c.github.io/webappsec-credential-management/#federatedcredential
[
- RuntimeEnabled=CredentialManager,
RaisesException=Constructor,
- Constructor(FederatedCredentialData data),
- Exposed=Window
+ Constructor(FederatedCredentialInit data),
+ Exposed=Window,
+ SecureContext
] interface FederatedCredential : Credential {
readonly attribute USVString provider;
// TODO(mkwst): We don't really support this yet; it always returns ''.
readonly attribute DOMString? protocol;
};
+FederatedCredential implements CredentialUserData;
diff --git a/modules/credentialmanager/FederatedCredentialData.idl b/modules/credentialmanager/FederatedCredentialData.idl
deleted file mode 100644
index e9c92cb..0000000
--- a/modules/credentialmanager/FederatedCredentialData.idl
+++ /dev/null
@@ -1,9 +0,0 @@
-// 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/FederatedCredentialInit.idl b/modules/credentialmanager/FederatedCredentialInit.idl
new file mode 100644
index 0000000..4e4fff4
--- /dev/null
+++ b/modules/credentialmanager/FederatedCredentialInit.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-credential-management/#dictdef-federatedcredentialinit
+
+dictionary FederatedCredentialInit : CredentialData {
+ USVString name;
+ USVString iconURL;
+ required USVString provider;
+ DOMString protocol;
+};
diff --git a/modules/credentialmanager/FederatedCredentialRequestOptions.idl b/modules/credentialmanager/FederatedCredentialRequestOptions.idl
index d1eea0f..4f7937a 100644
--- a/modules/credentialmanager/FederatedCredentialRequestOptions.idl
+++ b/modules/credentialmanager/FederatedCredentialRequestOptions.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/webappsec-credential-management/#dictdef-federatedcredentialrequestoptions
dictionary FederatedCredentialRequestOptions {
sequence<DOMString> providers;
diff --git a/modules/credentialmanager/FormDataOptions.idl b/modules/credentialmanager/FormDataOptions.idl
index 76ddd9c..680a79e 100644
--- a/modules/credentialmanager/FormDataOptions.idl
+++ b/modules/credentialmanager/FormDataOptions.idl
@@ -2,7 +2,7 @@
// 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-formdataoptions
+// TODO: Add specification URL.
dictionary FormDataOptions {
DOMString idName = "username";
diff --git a/modules/credentialmanager/LocallyStoredCredentialData.idl b/modules/credentialmanager/LocallyStoredCredentialData.idl
deleted file mode 100644
index 2d127f9..0000000
--- a/modules/credentialmanager/LocallyStoredCredentialData.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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/MakeCredentialOptions.idl b/modules/credentialmanager/MakeCredentialOptions.idl
new file mode 100644
index 0000000..b318e81
--- /dev/null
+++ b/modules/credentialmanager/MakeCredentialOptions.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-makecredentialoptions
+
+dictionary MakeCredentialOptions {
+ required PublicKeyCredentialEntity rp;
+ required PublicKeyCredentialUserEntity user;
+ required BufferSource challenge;
+ required sequence<PublicKeyCredentialParameters> parameters;
+ unsigned long timeout;
+ sequence<PublicKeyCredentialDescriptor> excludeList = [];
+ AuthenticatorSelectionCriteria authenticatorSelection;
+ // TODO(crbug.com/733033): Add extension support
+};
diff --git a/modules/credentialmanager/NavigatorCredentials.idl b/modules/credentialmanager/NavigatorCredentials.idl
index 35b163b..f41a5e6 100644
--- a/modules/credentialmanager/NavigatorCredentials.idl
+++ b/modules/credentialmanager/NavigatorCredentials.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- RuntimeEnabled=CredentialManager,
+ ImplementedAs=NavigatorCredentials
] partial interface Navigator {
- readonly attribute CredentialsContainer credentials;
+ [SecureContext, SameObject] readonly attribute CredentialsContainer credentials;
};
diff --git a/modules/credentialmanager/PasswordCredential.idl b/modules/credentialmanager/PasswordCredential.idl
index 2e91a60..f9508c9 100644
--- a/modules/credentialmanager/PasswordCredential.idl
+++ b/modules/credentialmanager/PasswordCredential.idl
@@ -2,15 +2,20 @@
// 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-credential-management/#passwordcredential
+
typedef (FormData or URLSearchParams) CredentialBodyType;
[
- RuntimeEnabled=CredentialManager,
RaisesException=Constructor,
Constructor(PasswordCredentialData data),
+ Constructor(HTMLFormElement form),
Exposed=Window,
+ SecureContext
] interface PasswordCredential : Credential {
- attribute USVString idName;
- attribute USVString passwordName;
- attribute CredentialBodyType? additionalData;
+ [DeprecateAs=CredentialManagerIdName] attribute USVString idName;
+ [DeprecateAs=CredentialManagerPasswordName] attribute USVString passwordName;
+ [DeprecateAs=CredentialManagerAdditionalData] attribute CredentialBodyType? additionalData;
+ readonly attribute DOMString password;
};
+PasswordCredential implements CredentialUserData;
diff --git a/modules/credentialmanager/PasswordCredentialData.idl b/modules/credentialmanager/PasswordCredentialData.idl
index 8739fe6..3c6b2d9 100644
--- a/modules/credentialmanager/PasswordCredentialData.idl
+++ b/modules/credentialmanager/PasswordCredentialData.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://w3c.github.io/webappsec/specs/credentialmanagement/#dictdef-passwordcredentialdata
+// https://w3c.github.io/webappsec-credential-management/#dictdef-passwordcredentialdata
-dictionary PasswordCredentialData : LocallyStoredCredentialData {
- DOMString password;
+dictionary PasswordCredentialData : CredentialData {
+ USVString name;
+ USVString iconURL;
+ required USVString password;
};
diff --git a/modules/credentialmanager/PublicKeyCredential.idl b/modules/credentialmanager/PublicKeyCredential.idl
new file mode 100644
index 0000000..c8c8127
--- /dev/null
+++ b/modules/credentialmanager/PublicKeyCredential.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#publickeycredential
+
+[
+ RuntimeEnabled=WebAuth,
+ SecureContext,
+ Exposed=Window
+] interface PublicKeyCredential : Credential {
+ [SameObject] readonly attribute ArrayBuffer rawId;
+ [SameObject] readonly attribute AuthenticatorResponse response;
+ // TODO(crbug.com/733033): Add extension support
+};
diff --git a/modules/credentialmanager/PublicKeyCredentialDescriptor.idl b/modules/credentialmanager/PublicKeyCredentialDescriptor.idl
new file mode 100644
index 0000000..0a3e924
--- /dev/null
+++ b/modules/credentialmanager/PublicKeyCredentialDescriptor.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#enumdef-authenticatortransport
+
+enum Transport {
+ "usb",
+ "nfc",
+ "ble"
+};
+
+// https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptor
+
+dictionary PublicKeyCredentialDescriptor {
+ required PublicKeyCredentialType type;
+ required BufferSource id;
+ sequence<Transport> transports;
+};
diff --git a/modules/credentialmanager/PublicKeyCredentialEntity.idl b/modules/credentialmanager/PublicKeyCredentialEntity.idl
new file mode 100644
index 0000000..0e15dc9
--- /dev/null
+++ b/modules/credentialmanager/PublicKeyCredentialEntity.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-publickeycredentialentity
+
+dictionary PublicKeyCredentialEntity {
+ DOMString id;
+ DOMString name;
+ USVString icon;
+};
diff --git a/modules/credentialmanager/PublicKeyCredentialParameters.idl b/modules/credentialmanager/PublicKeyCredentialParameters.idl
new file mode 100644
index 0000000..82a3aeb
--- /dev/null
+++ b/modules/credentialmanager/PublicKeyCredentialParameters.idl
@@ -0,0 +1,20 @@
+// Copyright 2016 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#enumdef-publickeycredentialtype
+
+enum PublicKeyCredentialType {
+ "public-key"
+};
+
+// https://w3c.github.io/webauthn/#alg-identifier
+
+typedef long COSEAlgorithmIdentifier;
+
+// https://www.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-publickeycredentialparameters
+
+dictionary PublicKeyCredentialParameters {
+ required PublicKeyCredentialType type;
+ required COSEAlgorithmIdentifier algorithm;
+};
diff --git a/modules/credentialmanager/PublicKeyCredentialRequestOptions.idl b/modules/credentialmanager/PublicKeyCredentialRequestOptions.idl
new file mode 100644
index 0000000..1386f77
--- /dev/null
+++ b/modules/credentialmanager/PublicKeyCredentialRequestOptions.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-publickeycredentialrequestoptions
+
+dictionary PublicKeyCredentialRequestOptions {
+ required BufferSource challenge;
+ unsigned long timeout;
+ USVString rpId;
+ sequence <PublicKeyCredentialDescriptor> allowList = [];
+ // TODO(crbug.com/733033): Add extension support
+};
diff --git a/modules/credentialmanager/PublicKeyCredentialUserEntity.idl b/modules/credentialmanager/PublicKeyCredentialUserEntity.idl
new file mode 100644
index 0000000..c792c80
--- /dev/null
+++ b/modules/credentialmanager/PublicKeyCredentialUserEntity.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-publickeycredentialuserentity
+
+dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity {
+ DOMString displayName;
+};
diff --git a/modules/crypto/Crypto.idl b/modules/crypto/Crypto.idl
index b754187..01f7bc8 100644
--- a/modules/crypto/Crypto.idl
+++ b/modules/crypto/Crypto.idl
@@ -26,11 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/webcrypto/Overview.html#crypto-interface
+
[
- GarbageCollected,
Exposed=(Window,Worker)
] interface Crypto {
[RaisesException, MeasureAs=CryptoGetRandomValues] ArrayBufferView getRandomValues(ArrayBufferView array);
- readonly attribute SubtleCrypto subtle;
+ [SecureContext] readonly attribute SubtleCrypto subtle;
};
diff --git a/modules/crypto/CryptoKey.idl b/modules/crypto/CryptoKey.idl
index 3fcabf1..4063752 100644
--- a/modules/crypto/CryptoKey.idl
+++ b/modules/crypto/CryptoKey.idl
@@ -28,12 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/webcrypto/Overview.html#cryptokey-interface
+
[
- GarbageCollected,
Exposed=(Window,Worker)
] interface CryptoKey {
readonly attribute DOMString type;
readonly attribute boolean extractable;
[CallWith=ScriptState] readonly attribute object algorithm;
- readonly attribute DOMString[] usages;
+ [CallWith=ScriptState] readonly attribute object usages;
};
diff --git a/modules/crypto/SubtleCrypto.idl b/modules/crypto/SubtleCrypto.idl
index 04beea2..c5c75b0 100644
--- a/modules/crypto/SubtleCrypto.idl
+++ b/modules/crypto/SubtleCrypto.idl
@@ -28,15 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface
+// https://w3c.github.io/webcrypto/Overview.html#subtlecrypto-interface
typedef DOMString KeyFormat;
typedef DOMString KeyUsage;
typedef (Dictionary or DOMString) AlgorithmIdentifier;
[
- GarbageCollected,
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface SubtleCrypto {
[CallWith=ScriptState, MeasureAs=SubtleCryptoEncrypt] Promise encrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data);
[CallWith=ScriptState, MeasureAs=SubtleCryptoDecrypt] Promise decrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data);
diff --git a/modules/crypto/WindowCrypto.idl b/modules/crypto/WindowCrypto.idl
index b80f161..28bd167 100644
--- a/modules/crypto/WindowCrypto.idl
+++ b/modules/crypto/WindowCrypto.idl
@@ -28,8 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/webcrypto/Overview.html#crypto-interface
+
[
- ImplementedAs=DOMWindowCrypto,
+ ImplementedAs=DOMWindowCrypto
] partial interface Window {
readonly attribute Crypto crypto;
};
diff --git a/modules/crypto/WorkerGlobalScopeCrypto.idl b/modules/crypto/WorkerGlobalScopeCrypto.idl
index 86786bf..c180ef3 100644
--- a/modules/crypto/WorkerGlobalScopeCrypto.idl
+++ b/modules/crypto/WorkerGlobalScopeCrypto.idl
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface WorkerGlobalScope {
+// https://w3c.github.io/webcrypto/Overview.html#crypto-interface
+
+[
+ ImplementedAs=WorkerGlobalScopeCrypto
+] partial interface WorkerGlobalScope {
readonly attribute Crypto crypto;
};
diff --git a/modules/csspaint/CSSPaintWorklet.idl b/modules/csspaint/CSSPaintWorklet.idl
new file mode 100644
index 0000000..a1fbc67
--- /dev/null
+++ b/modules/csspaint/CSSPaintWorklet.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/css-paint-api/#dom-css-paintworklet
+
+[
+ ImplementedAs=CSSPaintWorklet,
+ RuntimeEnabled=CSSPaintAPI
+] partial interface CSS {
+ [CallWith=ScriptState] static readonly attribute Worklet paintWorklet;
+};
diff --git a/modules/csspaint/PaintRenderingContext2D.idl b/modules/csspaint/PaintRenderingContext2D.idl
new file mode 100644
index 0000000..7acb4a3
--- /dev/null
+++ b/modules/csspaint/PaintRenderingContext2D.idl
@@ -0,0 +1,82 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/css-paint-api/#paintrenderingcontext2d
+
+[
+ Exposed=PaintWorklet,
+ RuntimeEnabled=CSSPaintAPI
+] interface PaintRenderingContext2D {
+ // 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 double x, unrestricted double y);
+ void rotate(unrestricted double angle);
+ void translate(unrestricted double x, unrestricted double y);
+ void transform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
+ void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
+ void resetTransform();
+
+ // compositing
+ attribute unrestricted double globalAlpha; // (default 1.0)
+ attribute DOMString globalCompositeOperation; // (default source-over)
+ attribute DOMString filter;
+
+ // image smoothing
+ attribute boolean imageSmoothingEnabled; // (default True)
+ [RuntimeEnabled=ExperimentalCanvasFeatures] attribute ImageSmoothingQuality imageSmoothingQuality; // (default "low")
+
+ // 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(double x0, double y0, double x1, double y1);
+ [RaisesException] CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
+ [CallWith=ScriptState, RaisesException] CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType);
+
+ // shadows
+ attribute unrestricted double shadowOffsetX;
+ attribute unrestricted double shadowOffsetY;
+ attribute unrestricted double shadowBlur;
+ attribute DOMString shadowColor;
+
+ // rects
+ void clearRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ void fillRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ void strokeRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+
+ // path API (see also CanvasPath)
+ void beginPath();
+ void fill(optional CanvasFillRule winding);
+ void fill(Path2D path, optional CanvasFillRule winding);
+ void stroke();
+ void stroke(Path2D path);
+
+ void clip(optional CanvasFillRule winding);
+ void clip(Path2D path, optional CanvasFillRule winding);
+ boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasFillRule winding);
+ boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, optional CanvasFillRule winding);
+ boolean isPointInStroke(unrestricted double x, unrestricted double y);
+ boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
+
+ // drawing images
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
+
+ // FIXME: factor out to CanvasDrawingStyles
+ // line caps/joins
+ attribute unrestricted double lineWidth; // (default 1)
+ attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
+ attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
+ attribute unrestricted double miterLimit; // (default 10)
+
+ // dashed lines
+ void setLineDash(sequence<unrestricted double> dash);
+ sequence<unrestricted double> getLineDash();
+ attribute unrestricted double lineDashOffset;
+};
+PaintRenderingContext2D implements CanvasPath;
diff --git a/modules/csspaint/PaintRenderingContext2DSettings.idl b/modules/csspaint/PaintRenderingContext2DSettings.idl
new file mode 100644
index 0000000..a1ff9be
--- /dev/null
+++ b/modules/csspaint/PaintRenderingContext2DSettings.idl
@@ -0,0 +1,7 @@
+// Copyright 2017 The Chromium 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 PaintRenderingContext2DSettings {
+ boolean alpha = true;
+};
diff --git a/modules/csspaint/PaintSize.idl b/modules/csspaint/PaintSize.idl
new file mode 100644
index 0000000..d7d9a81
--- /dev/null
+++ b/modules/csspaint/PaintSize.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/css-paint-api/#paintworkletglobalscope
+
+[
+ Exposed=PaintWorklet,
+ RuntimeEnabled=CSSPaintAPI
+] interface PaintSize {
+ readonly attribute double width;
+ readonly attribute double height;
+};
diff --git a/modules/csspaint/PaintWorkletGlobalScope.idl b/modules/csspaint/PaintWorkletGlobalScope.idl
new file mode 100644
index 0000000..88bfdc1
--- /dev/null
+++ b/modules/csspaint/PaintWorkletGlobalScope.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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://drafts.css-houdini.org/css-paint-api/#paintworkletglobalscope
+
+[
+ Exposed=PaintWorklet,
+ Global=(Worklet,PaintWorklet),
+ RuntimeEnabled=CSSPaintAPI
+] interface PaintWorkletGlobalScope : WorkletGlobalScope {
+ readonly attribute unrestricted double devicePixelRatio;
+ [RaisesException] void registerPaint(DOMString name, Function paintCtor);
+};
diff --git a/modules/device_light/DeviceLightEvent.idl b/modules/device_light/DeviceLightEvent.idl
deleted file mode 100644
index 6a1f13f..0000000
--- a/modules/device_light/DeviceLightEvent.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.
-
-// http://w3c.github.io/ambient-light/#idl-def-DeviceLightEvent
-
-[
- RuntimeEnabled=DeviceLight,
- Constructor(DOMString type, optional DeviceLightEventInit eventInitDict),
-] interface DeviceLightEvent : Event {
- readonly attribute unrestricted double value;
-};
diff --git a/modules/device_light/DeviceLightEventInit.idl b/modules/device_light/DeviceLightEventInit.idl
deleted file mode 100644
index c7245e6..0000000
--- a/modules/device_light/DeviceLightEventInit.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.
-
-// http://w3c.github.io/ambient-light/#idl-def-DeviceLightEvent
-
-dictionary DeviceLightEventInit : EventInit {
- unrestricted double value;
-};
diff --git a/modules/device_light/WindowDeviceLight.idl b/modules/device_light/WindowDeviceLight.idl
deleted file mode 100644
index 1b8cd79..0000000
--- a/modules/device_light/WindowDeviceLight.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.
-
-[
- RuntimeEnabled=DeviceLight,
- ImplementedAs=DOMWindowDeviceLight
-] partial interface Window {
- attribute EventHandler ondevicelight;
-};
diff --git a/modules/device_orientation/DeviceAcceleration.idl b/modules/device_orientation/DeviceAcceleration.idl
index 1b2c23e..f1bc23d 100644
--- a/modules/device_orientation/DeviceAcceleration.idl
+++ b/modules/device_orientation/DeviceAcceleration.idl
@@ -23,10 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
+// https://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
[
- GarbageCollected,
NoInterfaceObject
] interface DeviceAcceleration {
readonly attribute double? x;
diff --git a/modules/device_orientation/DeviceAccelerationInit.idl b/modules/device_orientation/DeviceAccelerationInit.idl
new file mode 100644
index 0000000..85ece50
--- /dev/null
+++ b/modules/device_orientation/DeviceAccelerationInit.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/deviceorientation/spec-source-orientation.html#devicemotion
+
+dictionary DeviceAccelerationInit {
+ double? x = null;
+ double? y = null;
+ double? z = null;
+};
diff --git a/modules/device_orientation/DeviceMotionEvent.idl b/modules/device_orientation/DeviceMotionEvent.idl
index 138f704..9d4636b 100644
--- a/modules/device_orientation/DeviceMotionEvent.idl
+++ b/modules/device_orientation/DeviceMotionEvent.idl
@@ -23,22 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
+// https://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
-// TODO(philipj): DeviceMotionEvent should have a constructor.
+[Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict)]
interface DeviceMotionEvent : Event {
readonly attribute DeviceAcceleration? acceleration;
readonly attribute DeviceAcceleration? accelerationIncludingGravity;
readonly attribute DeviceRotationRate? rotationRate;
- readonly attribute double? interval;
-
- // TODO(philipj): The init*Event() methods are not in the spec:
- // https://github.com/w3c/deviceorientation/issues/18
- [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);
+ readonly attribute double interval;
};
diff --git a/modules/device_orientation/DeviceMotionEventInit.idl b/modules/device_orientation/DeviceMotionEventInit.idl
new file mode 100644
index 0000000..5995c96
--- /dev/null
+++ b/modules/device_orientation/DeviceMotionEventInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/deviceorientation/spec-source-orientation.html#devicemotion
+
+dictionary DeviceMotionEventInit : EventInit {
+ DeviceAccelerationInit? acceleration;
+ DeviceAccelerationInit? accelerationIncludingGravity;
+ DeviceRotationRateInit? rotationRate;
+ double interval = 0;
+};
diff --git a/modules/device_orientation/DeviceOrientationEvent.idl b/modules/device_orientation/DeviceOrientationEvent.idl
index e8e0c9d..14a53d6 100644
--- a/modules/device_orientation/DeviceOrientationEvent.idl
+++ b/modules/device_orientation/DeviceOrientationEvent.idl
@@ -23,23 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientation
+// https://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientation
-// TODO(philipj): DeviceOrientationEvent should have a constructor.
+[Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict)]
interface DeviceOrientationEvent : Event {
readonly attribute double? alpha;
readonly attribute double? beta;
readonly attribute double? gamma;
- // TODO(philipj): absolute should not be nullable.
- readonly attribute boolean? absolute;
-
- // TODO(philipj): The init*Event() methods are not in the spec:
- // https://github.com/w3c/deviceorientation/issues/18
- [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);
+ readonly attribute boolean absolute;
};
diff --git a/modules/device_orientation/DeviceOrientationEventInit.idl b/modules/device_orientation/DeviceOrientationEventInit.idl
new file mode 100644
index 0000000..12d5761
--- /dev/null
+++ b/modules/device_orientation/DeviceOrientationEventInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/deviceorientation/spec-source-orientation.html#deviceorientation
+
+dictionary DeviceOrientationEventInit : EventInit {
+ double? alpha = null;
+ double? beta = null;
+ double? gamma = null;
+ boolean absolute = false;
+};
diff --git a/modules/device_orientation/DeviceRotationRate.idl b/modules/device_orientation/DeviceRotationRate.idl
index a8c780b..78ea0b6 100644
--- a/modules/device_orientation/DeviceRotationRate.idl
+++ b/modules/device_orientation/DeviceRotationRate.idl
@@ -23,10 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
+// https://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
[
- GarbageCollected,
NoInterfaceObject
] interface DeviceRotationRate {
readonly attribute double? alpha;
diff --git a/modules/device_orientation/DeviceRotationRateInit.idl b/modules/device_orientation/DeviceRotationRateInit.idl
new file mode 100644
index 0000000..e08ef7e
--- /dev/null
+++ b/modules/device_orientation/DeviceRotationRateInit.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/deviceorientation/spec-source-orientation.html#deviceorientation
+
+dictionary DeviceRotationRateInit {
+ double? alpha = null;
+ double? beta = null;
+ double? gamma = null;
+};
diff --git a/modules/device_orientation/WindowDeviceOrientation.idl b/modules/device_orientation/WindowDeviceOrientation.idl
index ccbcf55..b8fc188 100644
--- a/modules/device_orientation/WindowDeviceOrientation.idl
+++ b/modules/device_orientation/WindowDeviceOrientation.idl
@@ -6,5 +6,5 @@
ImplementedAs=DOMWindowDeviceOrientation
] partial interface Window {
attribute EventHandler ondeviceorientation;
- [RuntimeEnabled=DeviceOrientationAbsolute] attribute EventHandler ondeviceorientationabsolute;
+ attribute EventHandler ondeviceorientationabsolute;
};
diff --git a/modules/donottrack/NavigatorDoNotTrack.idl b/modules/donottrack/NavigatorDoNotTrack.idl
index 1f1b615..ef59beb 100644
--- a/modules/donottrack/NavigatorDoNotTrack.idl
+++ b/modules/donottrack/NavigatorDoNotTrack.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface Navigator {
+[
+ ImplementedAs=NavigatorDoNotTrack
+] partial interface Navigator {
readonly attribute DOMString? doNotTrack;
};
diff --git a/modules/encoding/TextDecodeOptions.idl b/modules/encoding/TextDecodeOptions.idl
index da115c4..ca6472c 100644
--- a/modules/encoding/TextDecodeOptions.idl
+++ b/modules/encoding/TextDecodeOptions.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://encoding.spec.whatwg.org/#textdecoder
+// https://encoding.spec.whatwg.org/#textdecoder
dictionary TextDecodeOptions {
boolean stream = false;
diff --git a/modules/encoding/TextDecoder.idl b/modules/encoding/TextDecoder.idl
index 6127555..9e1a9b6 100644
--- a/modules/encoding/TextDecoder.idl
+++ b/modules/encoding/TextDecoder.idl
@@ -32,7 +32,6 @@
Exposed=(Window,Worker),
Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
RaisesException=Constructor,
- GarbageCollected,
MeasureAs=TextDecoderConstructor
] interface TextDecoder {
readonly attribute DOMString encoding;
diff --git a/modules/encoding/TextDecoderOptions.idl b/modules/encoding/TextDecoderOptions.idl
index c222515..58c0103 100644
--- a/modules/encoding/TextDecoderOptions.idl
+++ b/modules/encoding/TextDecoderOptions.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.
-// http://encoding.spec.whatwg.org/#textdecoder
+// https://encoding.spec.whatwg.org/#textdecoder
-[
- GarbageCollected
-] dictionary TextDecoderOptions {
+dictionary TextDecoderOptions {
boolean fatal = false;
boolean ignoreBOM = false;
};
diff --git a/modules/encoding/TextEncoder.idl b/modules/encoding/TextEncoder.idl
index 8730de4..e18d109 100644
--- a/modules/encoding/TextEncoder.idl
+++ b/modules/encoding/TextEncoder.idl
@@ -30,10 +30,9 @@
[
Exposed=(Window,Worker),
- Constructor(optional DOMString utfLabel = "utf-8"),
+ Constructor(),
ConstructorCallWith=ExecutionContext,
RaisesException=Constructor,
- GarbageCollected,
MeasureAs=TextEncoderConstructor
] interface TextEncoder {
readonly attribute DOMString encoding;
diff --git a/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl b/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
index f096397..1c6bc5b 100644
--- a/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
+++ b/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.idl
@@ -1,9 +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.
-
-partial interface HTMLMediaElement {
- [RuntimeEnabled=EncryptedMedia] readonly attribute MediaKeys mediaKeys;
- [RuntimeEnabled=EncryptedMedia, CallWith=ScriptState] Promise setMediaKeys(MediaKeys? mediaKeys);
- [RuntimeEnabled=EncryptedMedia] attribute EventHandler onencrypted;
+[
+ ImplementedAs=HTMLMediaElementEncryptedMedia
+] partial interface HTMLMediaElement {
+ readonly attribute MediaKeys mediaKeys;
+ [SecureContext, CallWith=ScriptState] Promise setMediaKeys(MediaKeys? mediaKeys);
+ attribute EventHandler onencrypted;
+ attribute EventHandler onwaitingforkey;
};
diff --git a/modules/encryptedmedia/MediaEncryptedEvent.idl b/modules/encryptedmedia/MediaEncryptedEvent.idl
index ec07de9..7239a36 100644
--- a/modules/encryptedmedia/MediaEncryptedEvent.idl
+++ b/modules/encryptedmedia/MediaEncryptedEvent.idl
@@ -26,10 +26,8 @@
// https://w3c.github.io/encrypted-media/#mediaencryptedevent
[
- Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict),
- RuntimeEnabled=EncryptedMedia,
+ Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict)
] interface MediaEncryptedEvent : Event {
readonly attribute DOMString initDataType;
readonly attribute ArrayBuffer? initData;
};
-
diff --git a/modules/encryptedmedia/MediaKeyMessageEvent.idl b/modules/encryptedmedia/MediaKeyMessageEvent.idl
index 1d9dbdb..5afa759 100644
--- a/modules/encryptedmedia/MediaKeyMessageEvent.idl
+++ b/modules/encryptedmedia/MediaKeyMessageEvent.idl
@@ -32,10 +32,8 @@
};
[
- Constructor(DOMString type, optional MediaKeyMessageEventInit eventInitDict),
- RuntimeEnabled=EncryptedMedia
+ Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)
] interface MediaKeyMessageEvent : Event {
readonly attribute MediaKeyMessageType messageType;
readonly attribute ArrayBuffer message;
};
-
diff --git a/modules/encryptedmedia/MediaKeyMessageEventInit.idl b/modules/encryptedmedia/MediaKeyMessageEventInit.idl
index a5e355d..1a8e92e 100644
--- a/modules/encryptedmedia/MediaKeyMessageEventInit.idl
+++ b/modules/encryptedmedia/MediaKeyMessageEventInit.idl
@@ -5,6 +5,6 @@
// https://w3c.github.io/encrypted-media/#mediakeymessageevent
dictionary MediaKeyMessageEventInit : EventInit {
- MediaKeyMessageType messageType = "license-request";
- ArrayBuffer message;
+ required MediaKeyMessageType messageType;
+ required ArrayBuffer message;
};
diff --git a/modules/encryptedmedia/MediaKeySession.idl b/modules/encryptedmedia/MediaKeySession.idl
index 5c3e214..e16a995 100644
--- a/modules/encryptedmedia/MediaKeySession.idl
+++ b/modules/encryptedmedia/MediaKeySession.idl
@@ -24,15 +24,16 @@
*/
[
- DependentLifetime,
- RuntimeEnabled=EncryptedMedia,
- GarbageCollected,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface MediaKeySession : EventTarget {
// session properties
readonly attribute DOMString sessionId;
readonly attribute unrestricted double expiration;
- [CallWith=ScriptState] readonly attribute Promise closed;
+ [CallWith=ScriptState] readonly attribute Promise<void> closed;
readonly attribute MediaKeyStatusMap keyStatuses;
+ attribute EventHandler onkeystatuseschange;
+ attribute EventHandler onmessage;
// session initialization
[CallWith=ScriptState] Promise<void> generateRequest(DOMString initDataType, BufferSource initData);
diff --git a/modules/encryptedmedia/MediaKeyStatusMap.idl b/modules/encryptedmedia/MediaKeyStatusMap.idl
index e5956a2..f6f363f 100644
--- a/modules/encryptedmedia/MediaKeyStatusMap.idl
+++ b/modules/encryptedmedia/MediaKeyStatusMap.idl
@@ -14,9 +14,9 @@
"internal-error"
};
-[
- GarbageCollected,
-] interface MediaKeyStatusMap {
+interface MediaKeyStatusMap {
+ iterable <BufferSource, MediaKeyStatus>;
readonly attribute unsigned long size;
- readonly maplike <BufferSource, MediaKeyStatus>;
+ boolean has(BufferSource keyId);
+ [CallWith=ScriptState] any get(BufferSource keyId);
};
diff --git a/modules/encryptedmedia/MediaKeySystemAccess.idl b/modules/encryptedmedia/MediaKeySystemAccess.idl
index 02069e7..44292eb 100644
--- a/modules/encryptedmedia/MediaKeySystemAccess.idl
+++ b/modules/encryptedmedia/MediaKeySystemAccess.idl
@@ -2,12 +2,9 @@
// 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
+// https://w3c.github.io/encrypted-media/#mediakeysystemaccess-interface
-[
- RuntimeEnabled=EncryptedMedia,
- GarbageCollected,
-] interface MediaKeySystemAccess {
+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
index 2db1454..5261952 100644
--- a/modules/encryptedmedia/MediaKeySystemConfiguration.idl
+++ b/modules/encryptedmedia/MediaKeySystemConfiguration.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/encrypted-media/#mediakeysystemconfiguration-dictionary
enum MediaKeysRequirement {
"required",
@@ -10,14 +10,12 @@
"not-allowed"
};
-[
- RuntimeEnabled=EncryptedMedia
-] dictionary MediaKeySystemConfiguration {
- sequence<DOMString> initDataTypes;
- sequence<MediaKeySystemMediaCapability> audioCapabilities;
- sequence<MediaKeySystemMediaCapability> videoCapabilities;
+dictionary MediaKeySystemConfiguration {
+ DOMString label = "";
+ 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
index 4f06468..2895169 100644
--- a/modules/encryptedmedia/MediaKeySystemMediaCapability.idl
+++ b/modules/encryptedmedia/MediaKeySystemMediaCapability.idl
@@ -4,9 +4,7 @@
// https://w3c.github.io/encrypted-media/#idl-def-MediaKeySystemMediaCapability
-[
- RuntimeEnabled=EncryptedMedia
-] dictionary MediaKeySystemMediaCapability {
+dictionary MediaKeySystemMediaCapability {
DOMString contentType = "";
DOMString robustness = "";
};
diff --git a/modules/encryptedmedia/MediaKeys.idl b/modules/encryptedmedia/MediaKeys.idl
index 8bf9389..a5fb5de 100644
--- a/modules/encryptedmedia/MediaKeys.idl
+++ b/modules/encryptedmedia/MediaKeys.idl
@@ -29,11 +29,11 @@
};
[
+ ActiveScriptWrappable,
DependentLifetime,
- RuntimeEnabled=EncryptedMedia,
- GarbageCollected,
+ SecureContext
] interface MediaKeys {
[CallWith=ScriptState, RaisesException] MediaKeySession createSession(optional MediaKeySessionType sessionType = "temporary");
- [CallWith=ScriptState] Promise<void> setServerCertificate(BufferSource serverCertificate);
+ [CallWith=ScriptState] Promise<boolean> setServerCertificate(BufferSource serverCertificate);
};
diff --git a/modules/encryptedmedia/MediaKeysGetStatusForPolicy.idl b/modules/encryptedmedia/MediaKeysGetStatusForPolicy.idl
new file mode 100644
index 0000000..0555f98
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeysGetStatusForPolicy.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/WICG/media-capabilities/blob/master/eme-extension-policy-check.md
+
+[
+ ImplementedAs=MediaKeysGetStatusForPolicy,
+ RuntimeEnabled=EncryptedMediaHdcpPolicyCheck
+] partial interface MediaKeys {
+ [CallWith=ScriptState] Promise<MediaKeyStatus> getStatusForPolicy(MediaKeysPolicy policy);
+};
diff --git a/modules/encryptedmedia/MediaKeysPolicy.idl b/modules/encryptedmedia/MediaKeysPolicy.idl
new file mode 100644
index 0000000..845ff41
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeysPolicy.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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/WICG/media-capabilities/blob/master/eme-extension-policy-check.md
+
+[
+ Exposed=Window,
+ RuntimeEnabled=EncryptedMediaHdcpPolicyCheck,
+ Constructor(MediaKeysPolicyInit init)
+] interface MediaKeysPolicy {
+ readonly attribute DOMString minHdcpVersion;
+};
diff --git a/modules/encryptedmedia/MediaKeysPolicyInit.idl b/modules/encryptedmedia/MediaKeysPolicyInit.idl
new file mode 100644
index 0000000..d13abfa
--- /dev/null
+++ b/modules/encryptedmedia/MediaKeysPolicyInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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/WICG/media-capabilities/blob/master/eme-extension-policy-check.md
+
+dictionary MediaKeysPolicyInit {
+ DOMString minHdcpVersion = "";
+};
diff --git a/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.idl b/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.idl
index e04f29a..a71acbe 100644
--- a/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.idl
+++ b/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.idl
@@ -5,7 +5,7 @@
// https://w3c.github.io/encrypted-media/#navigator-extension-requestmediakeysystemaccess
[
- RuntimeEnabled=EncryptedMedia
+ ImplementedAs=NavigatorRequestMediaKeySystemAccess
] partial interface Navigator {
- [CallWith=ScriptState] Promise<MediaKeySystemAccess> requestMediaKeySystemAccess(DOMString keySystem, sequence<MediaKeySystemConfiguration> supportedConfigurations);
+ [SecureContext, CallWith=ScriptState] Promise<MediaKeySystemAccess> requestMediaKeySystemAccess(DOMString keySystem, sequence<MediaKeySystemConfiguration> supportedConfigurations);
};
diff --git a/modules/eventsource/EventSource.idl b/modules/eventsource/EventSource.idl
new file mode 100644
index 0000000..3030a55
--- /dev/null
+++ b/modules/eventsource/EventSource.idl
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 Ericsson AB. All rights reserved.
+ * Copyright (C) 2010, 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.
+ * 3. Neither the name of Ericsson 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://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Constructor(DOMString url, optional EventSourceInit eventSourceInitDict),
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ RaisesException=Constructor
+] interface EventSource : EventTarget {
+ readonly attribute DOMString url;
+ readonly attribute boolean withCredentials;
+
+ // ready state
+ const unsigned short CONNECTING = 0;
+ const unsigned short OPEN = 1;
+ const unsigned short CLOSED = 2;
+ readonly attribute unsigned short readyState;
+
+ // networking
+ attribute EventHandler onopen;
+ attribute EventHandler onmessage;
+ attribute EventHandler onerror;
+ void close();
+};
diff --git a/core/page/EventSourceInit.idl b/modules/eventsource/EventSourceInit.idl
similarity index 100%
rename from core/page/EventSourceInit.idl
rename to modules/eventsource/EventSourceInit.idl
diff --git a/modules/fetch/Body.idl b/modules/fetch/Body.idl
index f943545..7e13072 100644
--- a/modules/fetch/Body.idl
+++ b/modules/fetch/Body.idl
@@ -2,24 +2,22 @@
// 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;
+// https://fetch.spec.whatwg.org/#body
+
[
- Exposed=ServiceWorker,
- NoInterfaceObject,
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
+ Exposed=ServiceWorker,
+ NoInterfaceObject
] 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();
+ [CallWith=ScriptState, NewObject] Promise<ArrayBuffer> arrayBuffer();
+ [CallWith=ScriptState, NewObject] Promise<Blob> blob();
+ [CallWith=ScriptState, NewObject] Promise<FormData> formData();
+ [CallWith=ScriptState, NewObject] Promise<JSON> json();
+ [CallWith=ScriptState, NewObject] 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/fetch/Headers.idl b/modules/fetch/Headers.idl
index 6ea05d7..102691f 100644
--- a/modules/fetch/Headers.idl
+++ b/modules/fetch/Headers.idl
@@ -2,21 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://fetch.spec.whatwg.org/#headers-class
-typedef Dictionary OpenEndedDictionary;
+// https://fetch.spec.whatwg.org/#typedefdef-headersinit
+
+typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit;
+
+// https://fetch.spec.whatwg.org/#headers-class
+
[
- Constructor,
- Constructor(Headers input),
- Constructor(OpenEndedDictionary input),
- Constructor(sequence<sequence<ByteString>> input),
+ Constructor(optional HeadersInit init),
Exposed=(Window,Worker),
- RaisesException=Constructor,
- GarbageCollected,
+ RaisesException=Constructor
] interface Headers {
[RaisesException] void append(ByteString name, ByteString value);
[ImplementedAs=remove, RaisesException] void delete(ByteString key);
[RaisesException] ByteString? get(ByteString key);
- [RaisesException] sequence<ByteString> getAll(ByteString name);
[RaisesException] boolean has(ByteString key);
[RaisesException] void set(ByteString key, ByteString value);
iterable<ByteString, ByteString>;
diff --git a/modules/fetch/Request.idl b/modules/fetch/Request.idl
index 7fe8fed..ab7a576 100644
--- a/modules/fetch/Request.idl
+++ b/modules/fetch/Request.idl
@@ -2,39 +2,47 @@
// 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
+// https://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 { "navigate", "same-origin", "no-cors", "cors" };
enum RequestCredentials { "omit", "same-origin", "include" };
enum RequestRedirect { "follow", "error", "manual" };
+enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache",
+ "only-if-cached" };
+
+// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
+
+enum ReferrerPolicy {
+ "",
+ "no-referrer",
+ "no-referrer-when-downgrade",
+ "origin",
+ "origin-when-cross-origin",
+ "unsafe-url"
+};
[
+ ActiveScriptWrappable,
Constructor(RequestInfo input, optional Dictionary requestInitDict),
ConstructorCallWith=ScriptState,
Exposed=(Window,Worker),
RaisesException=Constructor,
- DependentLifetime,
- GarbageCollected,
+ DependentLifetime
] interface Request {
readonly attribute ByteString method;
readonly attribute USVString url;
- readonly attribute Headers headers;
+ [ImplementedAs=getHeaders, SameObject] readonly attribute Headers headers;
readonly attribute DOMString referrer;
+ [ImplementedAs=getReferrerPolicy] readonly attribute ReferrerPolicy referrerPolicy;
readonly attribute RequestMode mode;
readonly attribute RequestCredentials credentials;
+ [RuntimeEnabled=FetchRequestCache]readonly attribute RequestCache cache;
readonly attribute RequestRedirect redirect;
readonly attribute DOMString integrity;
- [RaisesException] Request clone();
+ [RaisesException, CallWith=ScriptState, DoNotTestNewObject, NewObject] Request clone();
};
Request implements Body;
diff --git a/modules/fetch/Response.idl b/modules/fetch/Response.idl
index cd8a275..6ed6118 100644
--- a/modules/fetch/Response.idl
+++ b/modules/fetch/Response.idl
@@ -2,32 +2,33 @@
// 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
+// https://fetch.spec.whatwg.org/#response-class
enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" };
[
+ ActiveScriptWrappable,
// TODO(yhirano): We use "any" for body because the IDL processor doesn't
// recognize ReadableStream implemented with V8 extras. Fix it.
- Constructor(optional any body, optional Dictionary responseInitDict),
+ Constructor(optional any body, optional ResponseInit init),
ConstructorCallWith=ScriptState,
- Exposed=(Window,Worker),
- RaisesException=Constructor,
DependentLifetime,
- GarbageCollected,
+ Exposed=(Window,Worker),
+ RaisesException=Constructor
] interface Response {
- [CallWith=ExecutionContext] static Response error();
- [CallWith=ExecutionContext, RaisesException] static Response redirect(USVString url, optional unsigned short status = 302);
+ [CallWith=ScriptState, NewObject] static Response error();
+ [CallWith=ScriptState, NewObject, RaisesException] static Response redirect(USVString url, optional unsigned short status = 302);
readonly attribute ResponseType type;
readonly attribute USVString url;
+ readonly attribute boolean redirected;
readonly attribute unsigned short status;
readonly attribute boolean ok;
readonly attribute ByteString statusText;
- readonly attribute Headers headers;
+ [SameObject] readonly attribute Headers headers;
- [RaisesException] Response clone();
+ [RaisesException, CallWith=ScriptState, DoNotTestNewObject, NewObject] Response clone();
- [ImplementedAs=bodyWithUseCounter] readonly attribute ReadableByteStream body;
+ [CallWith=ScriptState, MeasureAs=FetchBodyStream] readonly attribute any body;
};
Response implements Body;
diff --git a/modules/fetch/ResponseInit.idl b/modules/fetch/ResponseInit.idl
new file mode 100644
index 0000000..8dc8e0d
--- /dev/null
+++ b/modules/fetch/ResponseInit.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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://fetch.spec.whatwg.org/#responseinit
+
+dictionary ResponseInit {
+ unsigned short status = 200;
+ ByteString statusText = "OK";
+ HeadersInit headers;
+};
diff --git a/modules/fetch/WindowFetch.idl b/modules/fetch/WindowFetch.idl
index d2b48ad..f2de064 100644
--- a/modules/fetch/WindowFetch.idl
+++ b/modules/fetch/WindowFetch.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- ImplementedAs=GlobalFetch,
+ ImplementedAs=GlobalFetch
] partial interface Window {
- [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
+ [CallWith=ScriptState, NewObject, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
};
diff --git a/modules/fetch/WorkerFetch.idl b/modules/fetch/WorkerFetch.idl
index 8c2c87e..1954a75 100644
--- a/modules/fetch/WorkerFetch.idl
+++ b/modules/fetch/WorkerFetch.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- ImplementedAs=GlobalFetch,
+ ImplementedAs=GlobalFetch
] partial interface WorkerGlobalScope {
- [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
+ [CallWith=ScriptState, NewObject, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
};
diff --git a/modules/fetch/testing/InternalsFetch.idl b/modules/fetch/testing/InternalsFetch.idl
new file mode 100644
index 0000000..c68fdd5
--- /dev/null
+++ b/modules/fetch/testing/InternalsFetch.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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=InternalsFetch
+] partial interface Internals {
+ sequence<USVString> getInternalResponseURLList(Response response);
+};
diff --git a/modules/fetch/testing/WorkerInternalsFetch.idl b/modules/fetch/testing/WorkerInternalsFetch.idl
new file mode 100644
index 0000000..9115908
--- /dev/null
+++ b/modules/fetch/testing/WorkerInternalsFetch.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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=WorkerInternalsFetch
+] partial interface WorkerInternals {
+ sequence<USVString> getInternalResponseURLList(Response response);
+};
diff --git a/modules/filesystem/DOMFileSystem.idl b/modules/filesystem/DOMFileSystem.idl
index 1652123..cc985ba 100644
--- a/modules/filesystem/DOMFileSystem.idl
+++ b/modules/filesystem/DOMFileSystem.idl
@@ -29,10 +29,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileSystem
[
- NoInterfaceObject,
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
+ NoInterfaceObject
] interface DOMFileSystem {
readonly attribute DOMString name;
readonly attribute DirectoryEntry root;
diff --git a/modules/filesystem/DOMFileSystemSync.idl b/modules/filesystem/DOMFileSystemSync.idl
index 55ce1d7..f106f69 100644
--- a/modules/filesystem/DOMFileSystemSync.idl
+++ b/modules/filesystem/DOMFileSystemSync.idl
@@ -28,9 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileSystemSync
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface DOMFileSystemSync {
readonly attribute DOMString name;
readonly attribute DirectoryEntrySync root;
diff --git a/modules/filesystem/DataTransferItemFileSystem.idl b/modules/filesystem/DataTransferItemFileSystem.idl
index 28f3151..90f5215 100644
--- a/modules/filesystem/DataTransferItemFileSystem.idl
+++ b/modules/filesystem/DataTransferItemFileSystem.idl
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface DataTransferItem {
- [CallWith=ExecutionContext] Entry webkitGetAsEntry();
+// https://wicg.github.io/entries-api/#html-data
+
+[
+ ImplementedAs=DataTransferItemFileSystem
+] partial interface DataTransferItem {
+ [CallWith=ScriptState, Measure] Entry? webkitGetAsEntry();
};
diff --git a/modules/filesystem/DedicatedWorkerGlobalScopeFileSystem.idl b/modules/filesystem/DedicatedWorkerGlobalScopeFileSystem.idl
index d050cd6..0777415 100644
--- a/modules/filesystem/DedicatedWorkerGlobalScopeFileSystem.idl
+++ b/modules/filesystem/DedicatedWorkerGlobalScopeFileSystem.idl
@@ -24,6 +24,7 @@
*
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-LocalFileSystem
[ImplementedAs=WorkerGlobalScopeFileSystem]
partial interface DedicatedWorkerGlobalScope {
const unsigned short TEMPORARY = 0;
diff --git a/modules/filesystem/DevToolsHostFileSystem.idl b/modules/filesystem/DevToolsHostFileSystem.idl
index c0a283a..51bd9a4 100644
--- a/modules/filesystem/DevToolsHostFileSystem.idl
+++ b/modules/filesystem/DevToolsHostFileSystem.idl
@@ -3,7 +3,8 @@
// found in the LICENSE file.
[
- RuntimeEnabled=FileSystem,
+ ImplementedAs=DevToolsHostFileSystem,
+ RuntimeEnabled=FileSystem
] 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 854a088..5ef306a 100644
--- a/modules/filesystem/DirectoryEntry.idl
+++ b/modules/filesystem/DirectoryEntry.idl
@@ -28,11 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-DirectoryEntry
[
NoInterfaceObject
] interface DirectoryEntry : Entry {
DirectoryReader createReader();
- 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 getFile(DOMString? path, optional FileSystemFlags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ void getDirectory(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 07de469..eb86bbb 100644
--- a/modules/filesystem/DirectoryEntrySync.idl
+++ b/modules/filesystem/DirectoryEntrySync.idl
@@ -28,11 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-DirectoryEntrySync
[
NoInterfaceObject
] interface DirectoryEntrySync : EntrySync {
DirectoryReaderSync createReader();
- [RaisesException] FileEntrySync getFile([TreatUndefinedAs=NullString] DOMString? path, FileSystemFlags flags);
- [RaisesException] DirectoryEntrySync getDirectory([TreatUndefinedAs=NullString] DOMString? path, FileSystemFlags flags);
+ [RaisesException] FileEntrySync getFile(DOMString? path, FileSystemFlags flags);
+ [RaisesException] DirectoryEntrySync getDirectory(DOMString? path, FileSystemFlags flags);
[RaisesException] void removeRecursively();
};
diff --git a/modules/filesystem/DirectoryReader.idl b/modules/filesystem/DirectoryReader.idl
index f4971fa..f7cf5e4 100644
--- a/modules/filesystem/DirectoryReader.idl
+++ b/modules/filesystem/DirectoryReader.idl
@@ -28,9 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-DirectoryReader
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface DirectoryReader {
void readEntries(EntriesCallback successCallback, optional ErrorCallback errorCallback);
};
diff --git a/modules/filesystem/DirectoryReaderSync.idl b/modules/filesystem/DirectoryReaderSync.idl
index 2f30b1c..b8123af 100644
--- a/modules/filesystem/DirectoryReaderSync.idl
+++ b/modules/filesystem/DirectoryReaderSync.idl
@@ -28,9 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-DirectoryReaderSync
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface DirectoryReaderSync {
- [RaisesException] EntrySync[] readEntries();
+ [RaisesException] sequence<EntrySync> readEntries();
};
diff --git a/modules/filesystem/EntriesCallback.idl b/modules/filesystem/EntriesCallback.idl
index ba3cca9..bfeb66f 100644
--- a/modules/filesystem/EntriesCallback.idl
+++ b/modules/filesystem/EntriesCallback.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-EntriesCallback
callback interface EntriesCallback {
- void handleEvent(Entry[] entries);
+ void handleEvent(sequence<Entry> entries);
};
diff --git a/modules/filesystem/Entry.idl b/modules/filesystem/Entry.idl
index d7162ef..ae0d2ed 100644
--- a/modules/filesystem/Entry.idl
+++ b/modules/filesystem/Entry.idl
@@ -28,20 +28,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-Entry
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface Entry {
readonly attribute boolean isFile;
readonly attribute boolean isDirectory;
readonly attribute DOMString name;
readonly attribute DOMString fullPath;
- readonly attribute DOMFileSystem filesystem;
+ [CallWith=ScriptState] readonly attribute DOMFileSystem filesystem;
- void getMetadata(MetadataCallback successCallback, optional ErrorCallback errorCallback);
- void moveTo(DirectoryEntry parent, [TreatUndefinedAs=NullString] optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
- void copyTo(DirectoryEntry parent, [TreatUndefinedAs=NullString] optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
- DOMString toURL();
- void remove(VoidCallback successCallback, optional ErrorCallback errorCallback);
- void getParent(optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ [CallWith=ScriptState] void getMetadata(MetadataCallback successCallback, optional ErrorCallback errorCallback);
+ [CallWith=ScriptState] void moveTo(DirectoryEntry parent, optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ [CallWith=ScriptState] void copyTo(DirectoryEntry parent, optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
+ [CallWith=ScriptState] DOMString toURL();
+ [CallWith=ScriptState] void remove(VoidCallback successCallback, optional ErrorCallback errorCallback);
+ [CallWith=ScriptState] void getParent(optional EntryCallback successCallback, optional ErrorCallback errorCallback);
};
diff --git a/modules/filesystem/EntryCallback.idl b/modules/filesystem/EntryCallback.idl
index 02eebc5..10a3706 100644
--- a/modules/filesystem/EntryCallback.idl
+++ b/modules/filesystem/EntryCallback.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-EntryCallback
callback interface EntryCallback {
void handleEvent(Entry entry);
};
diff --git a/modules/filesystem/EntrySync.idl b/modules/filesystem/EntrySync.idl
index e574cbc..2b60af9 100644
--- a/modules/filesystem/EntrySync.idl
+++ b/modules/filesystem/EntrySync.idl
@@ -28,9 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-EntrySync
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface EntrySync {
readonly attribute boolean isFile;
readonly attribute boolean isDirectory;
@@ -39,8 +39,8 @@
readonly attribute DOMFileSystemSync filesystem;
[RaisesException] Metadata getMetadata();
- [RaisesException] EntrySync moveTo(DirectoryEntrySync parent, [TreatUndefinedAs=NullString] DOMString? name);
- [RaisesException] EntrySync copyTo(DirectoryEntrySync parent, [TreatUndefinedAs=NullString] DOMString? name);
+ [RaisesException] EntrySync moveTo(DirectoryEntrySync parent, DOMString? name);
+ [RaisesException] EntrySync copyTo(DirectoryEntrySync parent, DOMString? name);
DOMString toURL();
[RaisesException] void remove();
DirectoryEntrySync getParent();
diff --git a/modules/filesystem/ErrorCallback.idl b/modules/filesystem/ErrorCallback.idl
index 8f05cf4..bd3566f 100644
--- a/modules/filesystem/ErrorCallback.idl
+++ b/modules/filesystem/ErrorCallback.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-ErrorCallback
callback interface ErrorCallback {
- void handleEvent(FileError error);
+ void handleEvent(DOMException error);
};
diff --git a/modules/filesystem/FileEntry.idl b/modules/filesystem/FileEntry.idl
index a8382ea..c1f791a 100644
--- a/modules/filesystem/FileEntry.idl
+++ b/modules/filesystem/FileEntry.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileEntry
[
NoInterfaceObject
] interface FileEntry : Entry {
diff --git a/modules/filesystem/FileEntrySync.idl b/modules/filesystem/FileEntrySync.idl
index 52b3e2a..af2ceb9 100644
--- a/modules/filesystem/FileEntrySync.idl
+++ b/modules/filesystem/FileEntrySync.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileEntrySync
[
NoInterfaceObject
] interface FileEntrySync : EntrySync {
diff --git a/modules/filesystem/FileSystemCallback.idl b/modules/filesystem/FileSystemCallback.idl
index 6a10f18..ef2d658 100644
--- a/modules/filesystem/FileSystemCallback.idl
+++ b/modules/filesystem/FileSystemCallback.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileSystemCallback
callback interface FileSystemCallback {
void handleEvent(DOMFileSystem fileSystem);
};
diff --git a/modules/filesystem/FileSystemFlags.idl b/modules/filesystem/FileSystemFlags.idl
index 84707ae..7d68450 100644
--- a/modules/filesystem/FileSystemFlags.idl
+++ b/modules/filesystem/FileSystemFlags.idl
@@ -2,7 +2,7 @@
// 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/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-Flags
// In the spec, the flags don't have default values, but Blink assumes
// that they are false when not specified.
diff --git a/modules/filesystem/FileWriter.idl b/modules/filesystem/FileWriter.idl
index 0e07baf..c38e0ef 100644
--- a/modules/filesystem/FileWriter.idl
+++ b/modules/filesystem/FileWriter.idl
@@ -29,10 +29,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-writer-api-20120417/#idl-def-FileWriter
[
- NoInterfaceObject,
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
+ NoInterfaceObject
] interface FileWriter : EventTarget {
// ready states
const unsigned short INIT = 0;
@@ -47,7 +48,7 @@
[RaisesException] void abort();
- readonly attribute FileError error;
+ readonly attribute DOMException? error;
readonly attribute long long position;
readonly attribute long long length;
diff --git a/modules/filesystem/FileWriterCallback.idl b/modules/filesystem/FileWriterCallback.idl
index 9492e24..aa7bf43 100644
--- a/modules/filesystem/FileWriterCallback.idl
+++ b/modules/filesystem/FileWriterCallback.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileWriterCallback
callback interface FileWriterCallback {
void handleEvent(FileWriter fileWriter);
};
diff --git a/modules/filesystem/FileWriterSync.idl b/modules/filesystem/FileWriterSync.idl
index 40fca49..463d0dd 100644
--- a/modules/filesystem/FileWriterSync.idl
+++ b/modules/filesystem/FileWriterSync.idl
@@ -28,9 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-writer-api-20120417/#idl-def-FileWriterSync
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface FileWriterSync {
// synchronous write/modify methods
[RaisesException] void write(Blob data);
diff --git a/modules/filesystem/HTMLInputElementFileSystem.idl b/modules/filesystem/HTMLInputElementFileSystem.idl
index c55dcd9..71ffafe 100644
--- a/modules/filesystem/HTMLInputElementFileSystem.idl
+++ b/modules/filesystem/HTMLInputElementFileSystem.idl
@@ -28,8 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://wicg.github.io/entries-api/#html-forms
+
[
- RuntimeEnabled=FileSystem,
+ ImplementedAs=HTMLInputElementFileSystem,
+ RuntimeEnabled=FileSystem
] partial interface HTMLInputElement {
- [CallWith=ExecutionContext] readonly attribute Entry[] webkitEntries;
+ [CallWith=ScriptState, Measure] readonly attribute FrozenArray<Entry> webkitEntries;
};
diff --git a/modules/filesystem/Metadata.idl b/modules/filesystem/Metadata.idl
index 5e556fe..afcabf6 100644
--- a/modules/filesystem/Metadata.idl
+++ b/modules/filesystem/Metadata.idl
@@ -28,9 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-Metadata
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface Metadata {
readonly attribute Date modificationTime;
readonly attribute unsigned long long size;
diff --git a/modules/filesystem/MetadataCallback.idl b/modules/filesystem/MetadataCallback.idl
index 819a299..300c721 100644
--- a/modules/filesystem/MetadataCallback.idl
+++ b/modules/filesystem/MetadataCallback.idl
@@ -28,6 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-MetadataCallback
callback interface MetadataCallback {
void handleEvent(Metadata metadata);
};
diff --git a/modules/filesystem/SharedWorkerGlobalScopeFileSystem.idl b/modules/filesystem/SharedWorkerGlobalScopeFileSystem.idl
index b01deac..77d78ee 100644
--- a/modules/filesystem/SharedWorkerGlobalScopeFileSystem.idl
+++ b/modules/filesystem/SharedWorkerGlobalScopeFileSystem.idl
@@ -24,6 +24,7 @@
*
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-LocalFileSystem
[ImplementedAs=WorkerGlobalScopeFileSystem]
partial interface SharedWorkerGlobalScope {
const unsigned short TEMPORARY = 0;
diff --git a/modules/filesystem/WindowFileSystem.idl b/modules/filesystem/WindowFileSystem.idl
index 4d98026..c133ee4 100644
--- a/modules/filesystem/WindowFileSystem.idl
+++ b/modules/filesystem/WindowFileSystem.idl
@@ -24,8 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-LocalFileSystem
[
- ImplementedAs=DOMWindowFileSystem,
+ ImplementedAs=DOMWindowFileSystem
] partial interface Window {
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
diff --git a/modules/gamepad/Gamepad.idl b/modules/gamepad/Gamepad.idl
index 9459de1..73e64de 100644
--- a/modules/gamepad/Gamepad.idl
+++ b/modules/gamepad/Gamepad.idl
@@ -23,14 +23,25 @@
* DAMAGE.
*/
-[
- GarbageCollected,
-] interface Gamepad {
+// https://w3c.github.io/gamepad/extensions.html#gamepadhand-enum
+enum GamepadHand {
+ "left",
+ "right"
+};
+
+// https://w3c.github.io/gamepad/#gamepad-interface
+interface Gamepad {
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 double[] axes;
- readonly attribute GamepadButton[] buttons;
+ [CachedAttribute=isAxisDataDirty, MeasureAs=GamepadAxes] readonly attribute FrozenArray<double> axes;
+ [CachedAttribute=isButtonDataDirty, MeasureAs=GamepadButtons] readonly attribute FrozenArray<GamepadButton> buttons;
+
+ [OriginTrialEnabled=GamepadExtensions, MeasureAs=GamepadPose] readonly attribute GamepadPose? pose;
+ [OriginTrialEnabled=GamepadExtensions, MeasureAs=GamepadHand] readonly attribute GamepadHand hand;
+
+ // https://w3c.github.io/webvr/#interface-gamepad
+ [OriginTrialEnabled=GamepadExtensions, MeasureAs=GamepadDisplayId] readonly attribute unsigned long displayId;
};
diff --git a/modules/gamepad/GamepadButton.idl b/modules/gamepad/GamepadButton.idl
index 1a4a8cb..85f09c8 100644
--- a/modules/gamepad/GamepadButton.idl
+++ b/modules/gamepad/GamepadButton.idl
@@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[
- GarbageCollected,
-] interface GamepadButton {
+interface GamepadButton {
readonly attribute boolean pressed;
+ [OriginTrialEnabled=GamepadExtensions, MeasureAs=GamepadButtonTouched] readonly attribute boolean touched;
readonly attribute double value;
};
diff --git a/modules/gamepad/GamepadEvent.idl b/modules/gamepad/GamepadEvent.idl
index 86c0b2a..e38ef38 100644
--- a/modules/gamepad/GamepadEvent.idl
+++ b/modules/gamepad/GamepadEvent.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.
-// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepadevent-interface
+// https://w3c.github.io/gamepad/#gamepadevent-interface
[
- Constructor(DOMString type, optional GamepadEventInit eventInitDict),
+ Constructor(DOMString type, optional GamepadEventInit eventInitDict)
] interface GamepadEvent : Event {
- readonly attribute Gamepad gamepad;
+ [ImplementedAs=getGamepad] readonly attribute Gamepad gamepad;
};
diff --git a/modules/gamepad/GamepadEventInit.idl b/modules/gamepad/GamepadEventInit.idl
index 4291a7e..3bccf6c 100644
--- a/modules/gamepad/GamepadEventInit.idl
+++ b/modules/gamepad/GamepadEventInit.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://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepadevent-interface
+// https://w3c.github.io/gamepad/#gamepadevent-interface
dictionary GamepadEventInit : EventInit {
- Gamepad gamepad;
+ // TODO(foolip): |gamepad| should be required and not nullable.
+ // https://crbug.com/647693
+ // https://github.com/w3c/gamepad/issues/35
+ Gamepad? gamepad;
};
diff --git a/modules/gamepad/GamepadList.idl b/modules/gamepad/GamepadList.idl
index 03602d4..de8254c 100644
--- a/modules/gamepad/GamepadList.idl
+++ b/modules/gamepad/GamepadList.idl
@@ -24,8 +24,7 @@
*/
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface GamepadList {
readonly attribute unsigned long length;
getter Gamepad item([Default=Undefined] optional unsigned long index);
diff --git a/modules/gamepad/GamepadPose.idl b/modules/gamepad/GamepadPose.idl
new file mode 100644
index 0000000..05495f2
--- /dev/null
+++ b/modules/gamepad/GamepadPose.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium 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/gamepad/extensions.html#gamepadpose-interface
+[
+ OriginTrialEnabled=GamepadExtensions
+] interface GamepadPose {
+ [MeasureAs=GamepadPoseHasOrientation] readonly attribute boolean hasOrientation;
+ [MeasureAs=GamepadPoseHasPosition] readonly attribute boolean hasPosition;
+ [MeasureAs=GamepadPosePosition] readonly attribute Float32Array? position;
+ [MeasureAs=GamepadPoseLinearVelocity] readonly attribute Float32Array? linearVelocity;
+ [MeasureAs=GamepadPoseLinearAcceleration] readonly attribute Float32Array? linearAcceleration;
+ [MeasureAs=GamepadPoseOrientation] readonly attribute Float32Array? orientation;
+ [MeasureAs=GamepadPoseAngularVelocity] readonly attribute Float32Array? angularVelocity;
+ [MeasureAs=GamepadPoseAngularAcceleration] readonly attribute Float32Array? angularAcceleration;
+};
diff --git a/modules/gamepad/NavigatorGamepad.idl b/modules/gamepad/NavigatorGamepad.idl
index a854d79..7ed5277 100644
--- a/modules/gamepad/NavigatorGamepad.idl
+++ b/modules/gamepad/NavigatorGamepad.idl
@@ -17,6 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-partial interface Navigator {
- GamepadList getGamepads();
+[
+ ImplementedAs=NavigatorGamepad
+] partial interface Navigator {
+ [MeasureAs=GetGamepads] GamepadList getGamepads();
};
diff --git a/modules/geofencing/CircularGeofencingRegion.idl b/modules/geofencing/CircularGeofencingRegion.idl
deleted file mode 100644
index 6cac262..0000000
--- a/modules/geofencing/CircularGeofencingRegion.idl
+++ /dev/null
@@ -1,17 +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=Geofencing,
- Exposed=(Window,Worker),
- GarbageCollected,
- Constructor(CircularGeofencingRegionInit init)
-] interface CircularGeofencingRegion : GeofencingRegion {
- const double MIN_RADIUS = 1.0;
- const double MAX_RADIUS = 100.0;
-
- readonly attribute double latitude;
- readonly attribute double longitude;
- readonly attribute double radius;
-};
diff --git a/modules/geofencing/CircularGeofencingRegionInit.idl b/modules/geofencing/CircularGeofencingRegionInit.idl
deleted file mode 100644
index 4abc486..0000000
--- a/modules/geofencing/CircularGeofencingRegionInit.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.
-
-// FIXME: Add the spec URL.
-
-dictionary CircularGeofencingRegionInit {
- DOMString? id = null;
- double latitude;
- double longitude;
- double radius;
-};
diff --git a/modules/geofencing/Geofencing.idl b/modules/geofencing/Geofencing.idl
deleted file mode 100644
index 7b36e70..0000000
--- a/modules/geofencing/Geofencing.idl
+++ /dev/null
@@ -1,13 +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,
- RuntimeEnabled=Geofencing,
- GarbageCollected,
-] interface Geofencing {
- [CallWith=ScriptState] Promise registerRegion(GeofencingRegion region);
- [CallWith=ScriptState] Promise unregisterRegion(DOMString regionId);
- [CallWith=ScriptState] Promise getRegisteredRegions();
-};
diff --git a/modules/geofencing/GeofencingEvent.idl b/modules/geofencing/GeofencingEvent.idl
deleted file mode 100644
index 47b3cc9..0000000
--- a/modules/geofencing/GeofencingEvent.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.
-
-[
- 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
deleted file mode 100644
index 4e22058..0000000
--- a/modules/geofencing/GeofencingRegion.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.
-
-[
- RuntimeEnabled=Geofencing,
- NoInterfaceObject,
- GarbageCollected,
-] interface GeofencingRegion {
- readonly attribute DOMString id;
-};
diff --git a/modules/geofencing/ServiceWorkerGlobalScopeGeofencing.idl b/modules/geofencing/ServiceWorkerGlobalScopeGeofencing.idl
deleted file mode 100644
index 418f02e..0000000
--- a/modules/geofencing/ServiceWorkerGlobalScopeGeofencing.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.
-
-[
- RuntimeEnabled=Geofencing,
-] partial interface ServiceWorkerGlobalScope {
- attribute EventHandler ongeofenceenter;
- attribute EventHandler ongeofenceleave;
-};
diff --git a/modules/geofencing/ServiceWorkerRegistrationGeofencing.idl b/modules/geofencing/ServiceWorkerRegistrationGeofencing.idl
deleted file mode 100644
index 1d0df55..0000000
--- a/modules/geofencing/ServiceWorkerRegistrationGeofencing.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=Geofencing,
-] partial interface ServiceWorkerRegistration {
- readonly attribute Geofencing geofencing;
-};
diff --git a/modules/geofencing/WorkerNavigatorGeofencing.idl b/modules/geofencing/WorkerNavigatorGeofencing.idl
deleted file mode 100644
index 6af4e01..0000000
--- a/modules/geofencing/WorkerNavigatorGeofencing.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.
-
-[
- 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/Coordinates.idl b/modules/geolocation/Coordinates.idl
index 9ff3e28..ed2b8bf 100644
--- a/modules/geolocation/Coordinates.idl
+++ b/modules/geolocation/Coordinates.idl
@@ -24,7 +24,6 @@
*/
[
- GarbageCollected,
NoInterfaceObject
] interface Coordinates {
readonly attribute double latitude;
diff --git a/modules/geolocation/Geolocation.idl b/modules/geolocation/Geolocation.idl
index 1961845..5a6e5c5 100644
--- a/modules/geolocation/Geolocation.idl
+++ b/modules/geolocation/Geolocation.idl
@@ -23,10 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/geolocation-API/#geolocation_interface
+// https://www.w3.org/TR/geolocation-API/#geolocation_interface
[
- GarbageCollected,
- NoInterfaceObject,
+ NoInterfaceObject
] interface Geolocation {
[LogActivity] void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
@@ -38,3 +37,6 @@
void clearWatch(long watchID);
};
+
+// https://www.w3.org/TR/geolocation-API/#position-callback
+callback PositionCallback = void(Position position);
diff --git a/modules/geolocation/Geoposition.idl b/modules/geolocation/Geoposition.idl
deleted file mode 100644
index 7d5c597..0000000
--- a/modules/geolocation/Geoposition.idl
+++ /dev/null
@@ -1,32 +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.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject
-] interface Geoposition {
- readonly attribute Coordinates coords;
- readonly attribute DOMTimeStamp timestamp;
-};
diff --git a/modules/geolocation/NavigatorGeolocation.idl b/modules/geolocation/NavigatorGeolocation.idl
index 9b96fd7..8cab44e 100644
--- a/modules/geolocation/NavigatorGeolocation.idl
+++ b/modules/geolocation/NavigatorGeolocation.idl
@@ -17,6 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-partial interface Navigator {
+[
+ ImplementedAs=NavigatorGeolocation
+] partial interface Navigator {
readonly attribute Geolocation geolocation;
};
diff --git a/modules/geolocation/Position.idl b/modules/geolocation/Position.idl
new file mode 100644
index 0000000..8081e3f
--- /dev/null
+++ b/modules/geolocation/Position.idl
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+// https://www.w3.org/TR/geolocation-API/#position_interface
+
+[
+ NoInterfaceObject,
+ ImplementedAs=Geoposition
+] interface Position {
+ readonly attribute Coordinates coords;
+ readonly attribute DOMTimeStamp timestamp;
+};
diff --git a/modules/geolocation/PositionCallback.idl b/modules/geolocation/PositionCallback.idl
deleted file mode 100644
index b00d1d0..0000000
--- a/modules/geolocation/PositionCallback.idl
+++ /dev/null
@@ -1,27 +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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
- */
-
-callback interface PositionCallback {
- void handleEvent(Geoposition position);
-};
diff --git a/modules/geolocation/PositionError.idl b/modules/geolocation/PositionError.idl
index b4a7f83..a05815e 100644
--- a/modules/geolocation/PositionError.idl
+++ b/modules/geolocation/PositionError.idl
@@ -24,7 +24,6 @@
*/
[
- GarbageCollected,
NoInterfaceObject
] interface PositionError {
readonly attribute unsigned short code;
@@ -34,4 +33,3 @@
const unsigned short POSITION_UNAVAILABLE = 2;
const unsigned short TIMEOUT = 3;
};
-
diff --git a/modules/geolocation/PositionErrorCallback.idl b/modules/geolocation/PositionErrorCallback.idl
index a1470c1..272e70a 100644
--- a/modules/geolocation/PositionErrorCallback.idl
+++ b/modules/geolocation/PositionErrorCallback.idl
@@ -10,16 +10,17 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
callback interface PositionErrorCallback {
diff --git a/modules/geolocation/testing/InternalsGeolocation.idl b/modules/geolocation/testing/InternalsGeolocation.idl
deleted file mode 100644
index ac6b2d3..0000000
--- a/modules/geolocation/testing/InternalsGeolocation.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-partial interface Internals {
- void setGeolocationClientMock(Document document);
- void setGeolocationPosition(Document document, double latitude, double longitude, double accuracy);
- void setGeolocationPositionUnavailableError(Document document, DOMString message);
- void setGeolocationPermission(Document document, boolean allowed);
- long numberOfPendingGeolocationPermissionRequests(Document document);
-};
diff --git a/modules/imagebitmap/ImageBitmapRenderingContext.idl b/modules/imagebitmap/ImageBitmapRenderingContext.idl
index ac6f794..c50300a 100644
--- a/modules/imagebitmap/ImageBitmapRenderingContext.idl
+++ b/modules/imagebitmap/ImageBitmapRenderingContext.idl
@@ -2,13 +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/multipage/scripting.html#the-imagebitmap-rendering-context
+
[
- RuntimeEnabled=ExperimentalCanvasFeatures,
- SetWrapperReferenceFrom=canvas,
- WillBeGarbageCollected,
+ DependentLifetime
] interface ImageBitmapRenderingContext {
// back-reference to the canvas
readonly attribute HTMLCanvasElement canvas;
- void transferImageBitmap(ImageBitmap bitmap);
+ [RaisesException] void transferFromImageBitmap(ImageBitmap? bitmap);
};
diff --git a/modules/imagecapture/ConstrainPoint2DParameters.idl b/modules/imagecapture/ConstrainPoint2DParameters.idl
new file mode 100644
index 0000000..763a9a5
--- /dev/null
+++ b/modules/imagecapture/ConstrainPoint2DParameters.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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-image/#additional-constrainable-props
+
+dictionary ConstrainPoint2DParameters {
+ sequence<Point2D> exact;
+ sequence<Point2D> ideal;
+};
diff --git a/modules/imagecapture/ImageCapture.idl b/modules/imagecapture/ImageCapture.idl
new file mode 100644
index 0000000..fec612d
--- /dev/null
+++ b/modules/imagecapture/ImageCapture.idl
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium 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-image/#ImageCaptureAPI
+
+[
+ ActiveScriptWrappable,
+ ConstructorCallWith=ExecutionContext,
+ Constructor(MediaStreamTrack track),
+ DependentLifetime,
+ MeasureAs=ImageCaptureConstructor,
+ RaisesException=Constructor
+] interface ImageCapture {
+ [ImplementedAs=videoStreamTrack] readonly attribute MediaStreamTrack track;
+
+ [CallWith=ScriptState] Promise<PhotoCapabilities> getPhotoCapabilities();
+ [CallWith=ScriptState] Promise<PhotoSettings> getPhotoSettings();
+ [CallWith=ScriptState, MeasureAs=ImageCaptureSetOptions] Promise<void> setOptions(PhotoSettings photoSettings);
+ [CallWith=ScriptState] Promise<Blob> takePhoto(optional PhotoSettings photoSettings);
+ [CallWith=ScriptState] Promise<ImageBitmap> grabFrame();
+};
diff --git a/modules/imagecapture/MediaSettingsRange.idl b/modules/imagecapture/MediaSettingsRange.idl
new file mode 100644
index 0000000..6acf927
--- /dev/null
+++ b/modules/imagecapture/MediaSettingsRange.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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-image/#mediasettingsrange
+
+interface MediaSettingsRange {
+ readonly attribute double max;
+ readonly attribute double min;
+ readonly attribute double step;
+};
diff --git a/modules/imagecapture/PhotoCapabilities.idl b/modules/imagecapture/PhotoCapabilities.idl
new file mode 100644
index 0000000..e97ead1
--- /dev/null
+++ b/modules/imagecapture/PhotoCapabilities.idl
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium 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-image/##photocapabilities-section
+
+enum MeteringMode {
+ "none",
+ "manual",
+ "single-shot",
+ "continuous",
+};
+
+enum RedEyeReduction {
+ "never",
+ "always",
+ "controllable",
+};
+
+enum FillLightMode {
+ "off",
+ "auto",
+ "flash",
+};
+
+interface PhotoCapabilities {
+ readonly attribute RedEyeReduction redEyeReduction;
+ readonly attribute MediaSettingsRange imageHeight;
+ readonly attribute MediaSettingsRange imageWidth;
+ readonly attribute FrozenArray<FillLightMode> fillLightMode;
+};
diff --git a/modules/imagecapture/PhotoSettings.idl b/modules/imagecapture/PhotoSettings.idl
new file mode 100644
index 0000000..8e2f6bf
--- /dev/null
+++ b/modules/imagecapture/PhotoSettings.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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-image/##photosettings-section
+
+dictionary PhotoSettings {
+ boolean redEyeReduction;
+ double imageHeight;
+ double imageWidth;
+ FillLightMode fillLightMode;
+};
diff --git a/modules/imagecapture/Point2D.idl b/modules/imagecapture/Point2D.idl
new file mode 100644
index 0000000..b77caf6
--- /dev/null
+++ b/modules/imagecapture/Point2D.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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-image/#point2d-section
+
+dictionary Point2D {
+ float x = 0.0;
+ float y = 0.0;
+};
diff --git a/modules/indexeddb/IDBCursor.idl b/modules/indexeddb/IDBCursor.idl
index a0a25f3..e07e2e4 100644
--- a/modules/indexeddb/IDBCursor.idl
+++ b/modules/indexeddb/IDBCursor.idl
@@ -35,18 +35,17 @@
// https://w3c.github.io/IndexedDB/#idl-def-IDBCursor
[
- Exposed=(Window,Worker),
- GarbageCollected
+ Exposed=(Window,Worker)
] 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, RaisesException] IDBRequest update(any value);
[RaisesException] void advance([EnforceRange] unsigned long count);
[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();
+ [CallWith=ScriptState, RaisesException] void continuePrimaryKey(any key, any primaryKey);
+
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest update(any value);
+ [NewObject, CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete();
};
diff --git a/modules/indexeddb/IDBCursorWithValue.idl b/modules/indexeddb/IDBCursorWithValue.idl
index b9887cd..7755c39 100644
--- a/modules/indexeddb/IDBCursorWithValue.idl
+++ b/modules/indexeddb/IDBCursorWithValue.idl
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursorWithValue
+// https://w3c.github.io/IndexedDB/#idbcursorwithvalue
[
Exposed=(Window,Worker)
diff --git a/modules/indexeddb/IDBDatabase.idl b/modules/indexeddb/IDBDatabase.idl
index b6d72d4..9304f41 100644
--- a/modules/indexeddb/IDBDatabase.idl
+++ b/modules/indexeddb/IDBDatabase.idl
@@ -27,19 +27,22 @@
// https://w3c.github.io/IndexedDB/#idl-def-IDBDatabase
[
- Exposed=(Window,Worker),
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface IDBDatabase : EventTarget {
readonly attribute DOMString name;
readonly attribute unsigned long long version;
- [Measure] readonly attribute DOMStringList objectStoreNames;
+ readonly attribute DOMStringList objectStoreNames;
- [RaisesException] IDBObjectStore createObjectStore(DOMString name, optional IDBObjectStoreParameters options);
- [RaisesException] void deleteObjectStore(DOMString name);
- [CallWith=ScriptState, RaisesException] IDBTransaction transaction((DOMString or sequence<DOMString> or DOMStringList) storeNames, optional IDBTransactionMode mode = "readonly");
+ [NewObject, CallWith=ScriptState, RaisesException] IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames,
+ optional IDBTransactionMode mode = "readonly");
void close();
+ [NewObject, RaisesException] IDBObjectStore createObjectStore(DOMString name,
+ optional IDBObjectStoreParameters options);
+ [RaisesException] void deleteObjectStore(DOMString name);
+
attribute EventHandler onabort;
attribute EventHandler onclose;
attribute EventHandler onerror;
diff --git a/modules/indexeddb/IDBFactory.idl b/modules/indexeddb/IDBFactory.idl
index 4e57591..60e0cd8 100644
--- a/modules/indexeddb/IDBFactory.idl
+++ b/modules/indexeddb/IDBFactory.idl
@@ -23,16 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory
+// https://w3c.github.io/IndexedDB/#idbfactory
[
- Exposed=(Window,Worker),
- GarbageCollected
+ Exposed=(Window,Worker)
] interface IDBFactory {
- [CallWith=ScriptState, ImplementedAs=getDatabaseNames, RaisesException] IDBRequest webkitGetDatabaseNames();
-
- [CallWith=ScriptState, RaisesException] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
- [CallWith=ScriptState, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBOpenDBRequest open(DOMString name,
+ [EnforceRange] optional unsigned long long version);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name);
[CallWith=ScriptState, RaisesException] short cmp(any first, any second);
};
diff --git a/modules/indexeddb/IDBIndex.idl b/modules/indexeddb/IDBIndex.idl
index e2e17b7..8e26c8b 100644
--- a/modules/indexeddb/IDBIndex.idl
+++ b/modules/indexeddb/IDBIndex.idl
@@ -26,23 +26,24 @@
// https://w3c.github.io/IndexedDB/#idl-def-IDBIndex
[
- Exposed=(Window,Worker),
- GarbageCollected
+ Exposed=(Window,Worker)
] interface IDBIndex {
- readonly attribute DOMString name;
- readonly attribute IDBObjectStore objectStore;
+ [RaisesException=Setter] attribute DOMString name;
+ [SameObject] readonly attribute IDBObjectStore objectStore;
[CallWith=ScriptState] readonly attribute any keyPath;
readonly attribute boolean multiEntry;
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] 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] 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");
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest get(any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAll([Default=Undefined] optional any query,
+ [EnforceRange] optional unsigned long count);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([Default=Undefined] optional any query,
+ [EnforceRange] optional unsigned long count);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range,
+ optional IDBCursorDirection direction = "next");
+ [NewObject, 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 c6f07ba..33bd183 100644
--- a/modules/indexeddb/IDBIndexParameters.idl
+++ b/modules/indexeddb/IDBIndexParameters.idl
@@ -2,7 +2,7 @@
// 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-IDBIndexParameters
+// https://w3c.github.io/IndexedDB/#dictdef-idbindexparameters
dictionary IDBIndexParameters {
boolean unique = false;
diff --git a/modules/indexeddb/IDBKeyRange.idl b/modules/indexeddb/IDBKeyRange.idl
index a55200e..2c88174 100644
--- a/modules/indexeddb/IDBKeyRange.idl
+++ b/modules/indexeddb/IDBKeyRange.idl
@@ -23,19 +23,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
+// https://w3c.github.io/IndexedDB/#idbkeyrange
[
- Exposed=(Window,Worker),
- GarbageCollected
+ Exposed=(Window,Worker)
] interface IDBKeyRange {
[ImplementedAs=lowerValue, CallWith=ScriptState] readonly attribute any lower;
[ImplementedAs=upperValue, CallWith=ScriptState] readonly attribute any upper;
readonly attribute boolean lowerOpen;
readonly attribute boolean upperOpen;
- [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);
+ [NewObject, CallWith=ScriptState, RaisesException] static IDBKeyRange only(any value);
+ [NewObject, CallWith=ScriptState, RaisesException] static IDBKeyRange lowerBound(any bound, optional boolean open = false);
+ [NewObject, CallWith=ScriptState, RaisesException] static IDBKeyRange upperBound(any bound, optional boolean open = false);
+ [NewObject, CallWith=ScriptState, RaisesException] static IDBKeyRange bound(any lower,
+ any upper,
+ optional boolean lowerOpen = false,
+ optional boolean upperOpen = false);
+
+ [CallWith=ScriptState, RaisesException] boolean includes(any key);
};
diff --git a/modules/indexeddb/IDBObjectStore.idl b/modules/indexeddb/IDBObjectStore.idl
index 3422d7c..c38bbb6 100644
--- a/modules/indexeddb/IDBObjectStore.idl
+++ b/modules/indexeddb/IDBObjectStore.idl
@@ -26,28 +26,34 @@
// https://w3c.github.io/IndexedDB/#idl-def-IDBObjectStore
[
- Exposed=(Window,Worker),
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface IDBObjectStore {
- readonly attribute DOMString name;
+ [RaisesException=Setter] attribute DOMString name;
[CallWith=ScriptState] readonly attribute any keyPath;
- [Measure] readonly attribute DOMStringList indexNames;
- readonly attribute IDBTransaction transaction;
+ readonly attribute DOMStringList indexNames;
+ [SameObject] 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 clear();
- [CallWith=ScriptState, RaisesException] IDBRequest get(any key);
- // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
- [CallWith=ScriptState, RaisesException] 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] 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] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
- [CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters options);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest put(any value, [Default=Undefined] optional any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest add(any value, [Default=Undefined] optional any key);
+ [NewObject, CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete(any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest clear();
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest get(any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAll([Default=Undefined] optional any query,
+ [EnforceRange] optional unsigned long count);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([Default=Undefined] optional any query,
+ [EnforceRange] optional unsigned long count);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
+
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range,
+ optional IDBCursorDirection direction = "next");
+ [NewObject, CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor([Default=Undefined] optional any range,
+ optional IDBCursorDirection direction = "next");
+
[RaisesException] IDBIndex index(DOMString name);
+ [NewObject, CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name,
+ (DOMString or sequence<DOMString>) keyPath,
+ optional IDBIndexParameters options);
[RaisesException] void deleteIndex(DOMString name);
};
diff --git a/modules/indexeddb/IDBObjectStoreParameters.idl b/modules/indexeddb/IDBObjectStoreParameters.idl
index cd49459..32d9fff 100644
--- a/modules/indexeddb/IDBObjectStoreParameters.idl
+++ b/modules/indexeddb/IDBObjectStoreParameters.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/IndexedDB/#dictdef-idbobjectstoreparameters
dictionary IDBObjectStoreParameters {
(DOMString or sequence<DOMString>)? keyPath = null;
diff --git a/modules/indexeddb/IDBObservation.idl b/modules/indexeddb/IDBObservation.idl
new file mode 100644
index 0000000..c25bbf5
--- /dev/null
+++ b/modules/indexeddb/IDBObservation.idl
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium 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/WICG/indexed-db-observers/blob/gh-pages/EXPLAINER.md#records
+
+enum IDBObservationType {
+ "add",
+ "put",
+ "delete",
+ "clear"
+};
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=IDBObserver
+]
+ interface IDBObservation {
+ readonly attribute IDBObservationType type;
+ // When the record is a "delete" type, this is an IDBKeyRange.
+ [CallWith=ScriptState] readonly attribute any key;
+ [CallWith=ScriptState] readonly attribute any value;
+};
diff --git a/modules/indexeddb/IDBObserver.idl b/modules/indexeddb/IDBObserver.idl
new file mode 100644
index 0000000..258c490
--- /dev/null
+++ b/modules/indexeddb/IDBObserver.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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/WICG/indexed-db-observers/issues/24
+
+callback IDBObserverCallback = void (IDBObserverChanges changes);
+
+[
+ Exposed=(Window,Worker),
+ Constructor(IDBObserverCallback callback),
+ RuntimeEnabled=IDBObserver
+] interface IDBObserver {
+ [RaisesException, Measure] void observe(IDBDatabase db, IDBTransaction tx, IDBObserverInit options);
+ [RaisesException, Measure] void unobserve(IDBDatabase db);
+};
diff --git a/modules/indexeddb/IDBObserverChanges.idl b/modules/indexeddb/IDBObserverChanges.idl
new file mode 100644
index 0000000..8090820
--- /dev/null
+++ b/modules/indexeddb/IDBObserverChanges.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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/WICG/indexed-db-observers/blob/gh-pages/EXPLAINER.md#changes-argument
+
+[
+ Exposed=(Window, Worker),
+ RuntimeEnabled=IDBObserver
+] interface IDBObserverChanges {
+ readonly attribute IDBDatabase database;
+ // Transaction contains the same object stores as the transaction on which IDBTransaction.observe was called.
+ readonly attribute IDBTransaction transaction;
+ // Map object from String (object store name) to Array of IDBObservation.
+ [CallWith=ScriptState] readonly attribute any records;
+};
diff --git a/modules/indexeddb/IDBObserverInit.idl b/modules/indexeddb/IDBObserverInit.idl
new file mode 100644
index 0000000..d22dfbd
--- /dev/null
+++ b/modules/indexeddb/IDBObserverInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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/WICG/indexed-db-observers/blob/gh-pages/EXPLAINER.md#options-argument
+
+dictionary IDBObserverInit {
+ boolean transaction = false;
+ boolean values = false;
+ boolean noRecords = false;
+ sequence<IDBObservationType> operationTypes = [];
+};
diff --git a/modules/indexeddb/IDBOpenDBRequest.idl b/modules/indexeddb/IDBOpenDBRequest.idl
index dbb2313..9594c8a 100644
--- a/modules/indexeddb/IDBOpenDBRequest.idl
+++ b/modules/indexeddb/IDBOpenDBRequest.idl
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBOpenDBRequest
+// https://w3c.github.io/IndexedDB/#idbopendbrequest
[
Exposed=(Window,Worker)
diff --git a/modules/indexeddb/IDBRequest.idl b/modules/indexeddb/IDBRequest.idl
index 0620d7f..4f8a88a 100644
--- a/modules/indexeddb/IDBRequest.idl
+++ b/modules/indexeddb/IDBRequest.idl
@@ -27,27 +27,24 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequestReadyState
+// https://w3c.github.io/IndexedDB/#enumdef-idbrequestreadystate
enum IDBRequestReadyState {
"pending",
"done"
};
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
+// https://w3c.github.io/IndexedDB/#idbrequest
[
- Exposed=(Window,Worker),
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface IDBRequest : EventTarget {
- [RaisesException=Getter, CachedAttribute=isResultDirty] readonly attribute any result;
+ [CallWith=ScriptState, RaisesException=Getter, CachedAttribute=isResultDirty] readonly attribute any result;
[RaisesException=Getter] readonly attribute DOMException error;
-
- readonly attribute any source;
+ [CallWith=ScriptState] readonly attribute any source;
readonly attribute IDBTransaction transaction;
-
- // States
readonly attribute IDBRequestReadyState readyState;
// Events
diff --git a/modules/indexeddb/IDBTransaction.idl b/modules/indexeddb/IDBTransaction.idl
index abe303d..49a272e 100644
--- a/modules/indexeddb/IDBTransaction.idl
+++ b/modules/indexeddb/IDBTransaction.idl
@@ -35,15 +35,15 @@
// https://w3c.github.io/IndexedDB/#idl-def-IDBTransaction
[
- Exposed=(Window,Worker),
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected
+ Exposed=(Window,Worker)
] interface IDBTransaction : EventTarget {
// Properties
- [Measure] readonly attribute DOMStringList objectStoreNames;
+ readonly attribute DOMStringList objectStoreNames;
readonly attribute IDBTransactionMode mode;
- readonly attribute IDBDatabase db;
+ [SameObject] readonly attribute IDBDatabase db;
readonly attribute DOMException error;
// Methods
diff --git a/modules/indexeddb/IDBVersionChangeEvent.idl b/modules/indexeddb/IDBVersionChangeEvent.idl
index b6656a7..b3bdfbb 100644
--- a/modules/indexeddb/IDBVersionChangeEvent.idl
+++ b/modules/indexeddb/IDBVersionChangeEvent.idl
@@ -23,11 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEvent
+// https://w3c.github.io/IndexedDB/#events
-// FIXME: This enum is non-standard, see
-// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
+// FIXME: This enum is non-standard, see https://crbug.com/711586
enum IDBDataLossAmount { "none", "total" };
+
[
Exposed=(Window,Worker),
Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)
@@ -35,8 +35,7 @@
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
+ // FIXME: These are non-standard, see https://crbug.com/711586
readonly attribute IDBDataLossAmount dataLoss;
readonly attribute DOMString dataLossMessage;
};
diff --git a/modules/indexeddb/IDBVersionChangeEventInit.idl b/modules/indexeddb/IDBVersionChangeEventInit.idl
index 1ee4c85..1742fae 100644
--- a/modules/indexeddb/IDBVersionChangeEventInit.idl
+++ b/modules/indexeddb/IDBVersionChangeEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/IndexedDB/#events
dictionary IDBVersionChangeEventInit : EventInit {
unsigned long long oldVersion = 0;
diff --git a/modules/indexeddb/WindowIndexedDatabase.idl b/modules/indexeddb/WindowIndexedDatabase.idl
index eb08dd1..183376f 100644
--- a/modules/indexeddb/WindowIndexedDatabase.idl
+++ b/modules/indexeddb/WindowIndexedDatabase.idl
@@ -25,18 +25,7 @@
*/
[
- ImplementedAs=DOMWindowIndexedDatabase,
+ ImplementedAs=GlobalIndexedDB
] partial interface Window {
- [ImplementedAs=indexedDB, DeprecateAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
-
[MeasureAs=UnprefixedIndexedDB] readonly attribute IDBFactory indexedDB;
-
- [DeprecateAs=PrefixedIDBCursorConstructor] attribute IDBCursorConstructor webkitIDBCursor;
- [DeprecateAs=PrefixedIDBDatabaseConstructor] attribute IDBDatabaseConstructor webkitIDBDatabase;
- [DeprecateAs=PrefixedIDBFactoryConstructor] attribute IDBFactoryConstructor webkitIDBFactory;
- [DeprecateAs=PrefixedIDBIndexConstructor] attribute IDBIndexConstructor webkitIDBIndex;
- [DeprecateAs=PrefixedIDBKeyRangeConstructor] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
- [DeprecateAs=PrefixedIDBObjectStoreConstructor] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
- [DeprecateAs=PrefixedIDBRequestConstructor] attribute IDBRequestConstructor webkitIDBRequest;
- [DeprecateAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
};
diff --git a/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl b/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
index 796cd5d..75bf1f0 100644
--- a/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
+++ b/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl
@@ -24,17 +24,8 @@
*
*/
-partial interface WorkerGlobalScope {
- [ImplementedAs=indexedDB, DeprecateAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
-
- [DeprecateAs=PrefixedIDBCursorConstructor] attribute IDBCursorConstructor webkitIDBCursor;
- [DeprecateAs=PrefixedIDBDatabaseConstructor] attribute IDBDatabaseConstructor webkitIDBDatabase;
- [DeprecateAs=PrefixedIDBFactoryConstructor] attribute IDBFactoryConstructor webkitIDBFactory;
- [DeprecateAs=PrefixedIDBIndexConstructor] attribute IDBIndexConstructor webkitIDBIndex;
- [DeprecateAs=PrefixedIDBKeyRangeConstructor] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
- [DeprecateAs=PrefixedIDBObjectStoreConstructor] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
- [DeprecateAs=PrefixedIDBRequestConstructor] attribute IDBRequestConstructor webkitIDBRequest;
- [DeprecateAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
-
+[
+ ImplementedAs=GlobalIndexedDB
+] partial interface WorkerGlobalScope {
readonly attribute IDBFactory indexedDB;
};
diff --git a/modules/installedapp/NavigatorInstalledApp.idl b/modules/installedapp/NavigatorInstalledApp.idl
new file mode 100644
index 0000000..11b223f
--- /dev/null
+++ b/modules/installedapp/NavigatorInstalledApp.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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(mgiuca): Link to full spec, rather than explainer, upon completion.
+// https://github.com/WICG/get-installed-related-apps/blob/master/EXPLAINER.md
+
+[
+ ImplementedAs=NavigatorInstalledApp,
+ OriginTrialEnabled=InstalledApp
+] partial interface Navigator {
+ [CallWith=ScriptState, Measure, SecureContext] Promise<RelatedApplication> getInstalledRelatedApps();
+};
diff --git a/modules/installedapp/RelatedApplication.idl b/modules/installedapp/RelatedApplication.idl
new file mode 100644
index 0000000..80fe74a
--- /dev/null
+++ b/modules/installedapp/RelatedApplication.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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(mgiuca): Link to full spec, rather than explainer, upon completion.
+// https://github.com/WICG/get-installed-related-apps/blob/master/EXPLAINER.md
+
+// TODO(mgiuca): This should be a dictionary, not an interface.
+// (NoInterfaceObject is basically a makeshift dictionary.)
+// https://crbug.com/687444.
+[
+ NoInterfaceObject,
+ OriginTrialEnabled=InstalledApp
+] interface RelatedApplication {
+ readonly attribute DOMString platform;
+ readonly attribute DOMString url;
+ readonly attribute DOMString id;
+};
diff --git a/modules/keyboard_lock/NavigatorKeyboardLock.idl b/modules/keyboard_lock/NavigatorKeyboardLock.idl
new file mode 100644
index 0000000..b39db8e
--- /dev/null
+++ b/modules/keyboard_lock/NavigatorKeyboardLock.idl
@@ -0,0 +1,25 @@
+// Copyright 2017 The Chromium 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://rawgit.com/w3c/keyboard-lock/gh-pages/index.html.
+// TODO(zijiehe, garykac): Update the spec to match the implementation.
+// 1. "System" should be removed from both the function names: these functions
+// are not for system keys or key combinations only.
+// See https://github.com/w3c/keyboard-lock/issues/6
+// 2. Returns Promise<void> from requestKeyboardLock() function: user agents can
+// decline the request, and web page can get a notification once the
+// requested keys should be received.
+// See https://github.com/w3c/keyboard-lock/issues/7
+// 3. The parameter of requestKeyboardLock() should be
+// optional sequence<DOMString> keyCodes = []
+// See https://github.com/w3c/keyboard-lock/issues/21
+// 4. cancelKeyboardLock() function is implicitly called whenever the unloading
+// document cleanup steps run with a document.
+// See https://github.com/w3c/keyboard-lock/issues/22
+[
+ ImplementedAs=NavigatorKeyboardLock
+] partial interface Navigator {
+ [SecureContext, RuntimeEnabled=KeyboardLock, CallWith=ScriptState] Promise<void> requestKeyboardLock(optional sequence<DOMString> keyCodes = []);
+ [SecureContext, RuntimeEnabled=KeyboardLock] void cancelKeyboardLock();
+};
diff --git a/modules/media_capabilities/AudioConfiguration.idl b/modules/media_capabilities/AudioConfiguration.idl
new file mode 100644
index 0000000..37ce30e
--- /dev/null
+++ b/modules/media_capabilities/AudioConfiguration.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#dictdef-audioconfiguration
+
+dictionary AudioConfiguration {
+ required DOMString contentType;
+
+ DOMString channels;
+ unsigned long bitrate;
+ unsigned long samplerate;
+};
diff --git a/modules/media_capabilities/MediaCapabilities.idl b/modules/media_capabilities/MediaCapabilities.idl
new file mode 100644
index 0000000..21def83
--- /dev/null
+++ b/modules/media_capabilities/MediaCapabilities.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#mediacapabilities
+
+[
+ Exposed=Window,
+ RuntimeEnabled=MediaCapabilities
+] interface MediaCapabilities {
+ [CallWith=ScriptState] Promise<MediaCapabilitiesInfo> decodingInfo(MediaDecodingConfiguration configuration);
+ [CallWith=ScriptState] Promise<MediaCapabilitiesInfo> encodingInfo(
+ MediaEncodingConfiguration configuration);
+};
diff --git a/modules/media_capabilities/MediaCapabilitiesInfo.idl b/modules/media_capabilities/MediaCapabilitiesInfo.idl
new file mode 100644
index 0000000..6feab9a
--- /dev/null
+++ b/modules/media_capabilities/MediaCapabilitiesInfo.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#mediacapabilitiesinfo
+
+[
+ Exposed=Window,
+ RuntimeEnabled=MediaCapabilities
+] interface MediaCapabilitiesInfo {
+ readonly attribute boolean supported;
+ readonly attribute boolean smooth;
+ readonly attribute boolean powerEfficient;
+};
diff --git a/modules/media_capabilities/MediaConfiguration.idl b/modules/media_capabilities/MediaConfiguration.idl
new file mode 100644
index 0000000..afaa0f0
--- /dev/null
+++ b/modules/media_capabilities/MediaConfiguration.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#dictdef-mediaconfiguration
+
+dictionary MediaConfiguration {
+ VideoConfiguration video;
+ AudioConfiguration audio;
+};
diff --git a/modules/media_capabilities/MediaDecodingConfiguration.idl b/modules/media_capabilities/MediaDecodingConfiguration.idl
new file mode 100644
index 0000000..b794fd6
--- /dev/null
+++ b/modules/media_capabilities/MediaDecodingConfiguration.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#enumdef-mediadecodingtype
+
+enum MediaDecodingType {
+ "file",
+ "media-source",
+};
+
+// https://wicg.github.io/media-capabilities/#dictdef-mediadecodingconfiguration
+
+dictionary MediaDecodingConfiguration : MediaConfiguration {
+ required MediaDecodingType type;
+};
diff --git a/modules/media_capabilities/MediaEncodingConfiguration.idl b/modules/media_capabilities/MediaEncodingConfiguration.idl
new file mode 100644
index 0000000..d433c36
--- /dev/null
+++ b/modules/media_capabilities/MediaEncodingConfiguration.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#dictdef-mediaencodingconfiguration
+
+enum MediaEncodingType {
+ "record",
+ // TODO(mcasas): Implement other types https://crbug.com/709181
+};
+
+dictionary MediaEncodingConfiguration : MediaConfiguration{
+ required MediaEncodingType type;
+};
diff --git a/modules/media_capabilities/NavigatorMediaCapabilities.idl b/modules/media_capabilities/NavigatorMediaCapabilities.idl
new file mode 100644
index 0000000..ed04a7e
--- /dev/null
+++ b/modules/media_capabilities/NavigatorMediaCapabilities.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#navigators-extensions
+
+[
+ Exposed=Window,
+ ImplementedAs=NavigatorMediaCapabilities,
+ RuntimeEnabled=MediaCapabilities
+] partial interface Navigator {
+ [SameObject] readonly attribute MediaCapabilities mediaCapabilities;
+};
diff --git a/modules/media_capabilities/VideoConfiguration.idl b/modules/media_capabilities/VideoConfiguration.idl
new file mode 100644
index 0000000..af63d0b
--- /dev/null
+++ b/modules/media_capabilities/VideoConfiguration.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/media-capabilities/#dictdef-videoconfiguration
+
+dictionary VideoConfiguration {
+ required DOMString contentType;
+ required unsigned long width;
+ required unsigned long height;
+ required unsigned long bitrate;
+ required double framerate;
+};
diff --git a/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.idl b/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.idl
index 69c5fef..e283bb7 100644
--- a/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.idl
+++ b/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.idl
@@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://www.w3.org/TR/mediacapture-fromelement/#the-canvascapturemediastream
-[
- RuntimeEnabled=MediaCaptureFromCanvas
-] interface CanvasCaptureMediaStreamTrack : MediaStreamTrack {
+// https://w3c.github.io/mediacapture-fromelement/#the-canvascapturemediastreamtrack
+interface CanvasCaptureMediaStreamTrack : MediaStreamTrack {
readonly attribute HTMLCanvasElement canvas;
void requestFrame ();
};
diff --git a/modules/mediacapturefromelement/HTMLCanvasElementCapture.idl b/modules/mediacapturefromelement/HTMLCanvasElementCapture.idl
index ca2cc74..73eb3bb 100644
--- a/modules/mediacapturefromelement/HTMLCanvasElementCapture.idl
+++ b/modules/mediacapturefromelement/HTMLCanvasElementCapture.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.
-// https://www.w3.org/TR/mediacapture-fromelement/#html-canvas-element-media-capture-extensions
+// https://w3c.github.io/mediacapture-fromelement/#html-canvas-element-media-capture-extensions
[
- RuntimeEnabled=MediaCaptureFromCanvas
+ ImplementedAs=HTMLCanvasElementCapture
] partial interface HTMLCanvasElement {
- [RaisesException] MediaStream captureStream (optional double frameRate);
+ [RaisesException, CallWith=ScriptState] MediaStream captureStream (optional double frameRate);
};
diff --git a/modules/mediacapturefromelement/HTMLMediaElementCapture.idl b/modules/mediacapturefromelement/HTMLMediaElementCapture.idl
index 059f3d1..212dd1e 100644
--- a/modules/mediacapturefromelement/HTMLMediaElementCapture.idl
+++ b/modules/mediacapturefromelement/HTMLMediaElementCapture.idl
@@ -5,6 +5,7 @@
// https://w3c.github.io/mediacapture-fromelement/#html-media-element-media-capture-extensions
[
+ ImplementedAs=HTMLMediaElementCapture,
RuntimeEnabled=MediaCaptureFromVideo
] partial interface HTMLMediaElement {
[RaisesException] MediaStream captureStream();
diff --git a/modules/mediarecorder/BlobEvent.idl b/modules/mediarecorder/BlobEvent.idl
index 5d46d57..a73a18f 100644
--- a/modules/mediarecorder/BlobEvent.idl
+++ b/modules/mediarecorder/BlobEvent.idl
@@ -5,9 +5,9 @@
// https://w3c.github.io/mediacapture-record/MediaRecorder.html#blob-event
[
- Constructor(DOMString type, BlobEventInit eventInitDict),
- RuntimeEnabled=MediaRecorder
+ Constructor(DOMString type, BlobEventInit eventInitDict)
]
interface BlobEvent : Event {
- readonly attribute Blob data;
+ [SameObject] readonly attribute Blob data;
+ readonly attribute DOMHighResTimeStamp timecode;
};
diff --git a/modules/mediarecorder/BlobEventInit.idl b/modules/mediarecorder/BlobEventInit.idl
index 23fe9bd..f6c3595 100644
--- a/modules/mediarecorder/BlobEventInit.idl
+++ b/modules/mediarecorder/BlobEventInit.idl
@@ -6,4 +6,5 @@
dictionary BlobEventInit : EventInit {
required Blob data;
+ DOMHighResTimeStamp timecode;
};
diff --git a/modules/mediarecorder/MediaRecorder.idl b/modules/mediarecorder/MediaRecorder.idl
index aa15744..3eb90d6 100644
--- a/modules/mediarecorder/MediaRecorder.idl
+++ b/modules/mediarecorder/MediaRecorder.idl
@@ -7,12 +7,11 @@
enum RecordingState { "inactive", "recording", "paused" };
[
- GarbageCollected,
- DependentLifetime,
- Constructor(MediaStream stream, optional MediaRecorderOptions options),
+ ActiveScriptWrappable,
ConstructorCallWith=ExecutionContext,
- RaisesException=Constructor,
- RuntimeEnabled=MediaRecorder,
+ Constructor(MediaStream stream, optional MediaRecorderOptions options),
+ DependentLifetime,
+ RaisesException=Constructor
] interface MediaRecorder : EventTarget {
readonly attribute MediaStream stream;
readonly attribute DOMString mimeType;
@@ -24,11 +23,10 @@
attribute EventHandler onpause;
attribute EventHandler onresume;
attribute EventHandler onerror;
- attribute boolean ignoreMutedMedia;
readonly attribute unsigned long videoBitsPerSecond;
readonly attribute unsigned long audioBitsPerSecond;
- [RaisesException] void start(optional long timeslice);
+ [RaisesException, Measure] void start(optional long timeslice);
[RaisesException] void stop();
[RaisesException] void pause();
[RaisesException] void resume();
diff --git a/modules/mediasession/HTMLMediaElementMediaSession.idl b/modules/mediasession/HTMLMediaElementMediaSession.idl
deleted file mode 100644
index a32ece1..0000000
--- a/modules/mediasession/HTMLMediaElementMediaSession.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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
-
-[
- RuntimeEnabled=MediaSession,
-] partial interface HTMLMediaElement {
- [RaisesException=Setter] attribute MediaSession? session;
-};
diff --git a/modules/mediasession/MediaImage.idl b/modules/mediasession/MediaImage.idl
new file mode 100644
index 0000000..ef4703a
--- /dev/null
+++ b/modules/mediasession/MediaImage.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/mediasession/#dictdef-mediaimage
+
+dictionary MediaImage {
+ required USVString src;
+ DOMString sizes = "";
+ DOMString type = "";
+};
diff --git a/modules/mediasession/MediaMetadata.idl b/modules/mediasession/MediaMetadata.idl
index 03f0d45..5456a5d 100644
--- a/modules/mediasession/MediaMetadata.idl
+++ b/modules/mediasession/MediaMetadata.idl
@@ -2,14 +2,16 @@
// 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-mediametadata-interface
+// https://wicg.github.io/mediasession/#the-mediametadata-interface
[
- Constructor(MediaMetadataInit metadata),
- GarbageCollected,
- RuntimeEnabled=MediaSession,
+ ConstructorCallWith=ScriptState,
+ Constructor(optional MediaMetadataInit metadata),
+ RaisesException=Constructor,
+ RuntimeEnabled=MediaSession
] interface MediaMetadata {
- readonly attribute DOMString title;
- readonly attribute DOMString artist;
- readonly attribute DOMString album;
+ attribute DOMString title;
+ attribute DOMString artist;
+ attribute DOMString album;
+ [CallWith=ScriptState, RaisesException=Setter] attribute FrozenArray<MediaImage> artwork;
};
diff --git a/modules/mediasession/MediaMetadataInit.idl b/modules/mediasession/MediaMetadataInit.idl
index 60377cd..4f08593 100644
--- a/modules/mediasession/MediaMetadataInit.idl
+++ b/modules/mediasession/MediaMetadataInit.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://mediasession.spec.whatwg.org/#the-mediametadata-interface
+// https://wicg.github.io/mediasession/#the-mediametadata-interface
dictionary MediaMetadataInit {
DOMString title = "";
DOMString artist = "";
DOMString album = "";
+ sequence<MediaImage> artwork = [];
};
diff --git a/modules/mediasession/MediaSession.idl b/modules/mediasession/MediaSession.idl
index b09cbc3..73413db 100644
--- a/modules/mediasession/MediaSession.idl
+++ b/modules/mediasession/MediaSession.idl
@@ -2,17 +2,34 @@
// 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
+// https://wicg.github.io/mediasession/#enumdef-mediasessionplaybackstate
+
+enum MediaSessionPlaybackState {
+ "none",
+ "paused",
+ "playing"
+};
+
+// https://wicg.github.io/mediasession/#the-mediasession-interface
+
+enum MediaSessionAction {
+ "play",
+ "pause",
+ "previoustrack",
+ "nexttrack",
+ "seekbackward",
+ "seekforward"
+};
+
+callback MediaSessionActionHandler = void ();
[
- Constructor(),
- ConstructorCallWith=ExecutionContext,
- RaisesException=Constructor,
- GarbageCollected,
RuntimeEnabled=MediaSession,
+ DependentLifetime
] interface MediaSession {
- attribute MediaMetadata? metadata;
+ [Measure] attribute MediaMetadata? metadata;
+ [Measure] attribute MediaSessionPlaybackState playbackState;
- [CallWith=ScriptState] Promise<void> activate();
- [CallWith=ScriptState] Promise<void> deactivate();
+ [Measure] void setActionHandler(MediaSessionAction action,
+ MediaSessionActionHandler? handler);
};
diff --git a/modules/mediasession/NavigatorMediaSession.idl b/modules/mediasession/NavigatorMediaSession.idl
new file mode 100644
index 0000000..5f6d68d
--- /dev/null
+++ b/modules/mediasession/NavigatorMediaSession.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/mediasession/#the-mediasession-interface
+
+[
+ Exposed=(Window),
+ ImplementedAs=NavigatorMediaSession,
+ RuntimeEnabled=MediaSession
+] partial interface Navigator {
+ [CallWith=ScriptState, SameObject] readonly attribute MediaSession mediaSession;
+};
diff --git a/modules/mediasource/AudioTrackSourceBuffer.idl b/modules/mediasource/AudioTrackSourceBuffer.idl
new file mode 100644
index 0000000..cc19b7f
--- /dev/null
+++ b/modules/mediasource/AudioTrackSourceBuffer.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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/media-source/#audio-track-extensions
+[
+ ImplementedAs=SourceBufferTrackBaseSupplement,
+ RuntimeEnabled=AudioVideoTracks
+] partial interface AudioTrack {
+ readonly attribute SourceBuffer? sourceBuffer;
+};
diff --git a/modules/mediasource/HTMLVideoElementMediaSource.idl b/modules/mediasource/HTMLVideoElementMediaSource.idl
index 57de64f..f9ff337 100644
--- a/modules/mediasource/HTMLVideoElementMediaSource.idl
+++ b/modules/mediasource/HTMLVideoElementMediaSource.idl
@@ -29,7 +29,8 @@
*/
[
- RuntimeEnabled=MediaSourceExperimental,
+ ImplementedAs=HTMLVideoElementMediaSource,
+ RuntimeEnabled=MediaSourceExperimental
] partial interface HTMLVideoElement {
VideoPlaybackQuality getVideoPlaybackQuality();
};
diff --git a/modules/mediasource/MediaSource.idl b/modules/mediasource/MediaSource.idl
index 253faa0..cd6ac7b 100644
--- a/modules/mediasource/MediaSource.idl
+++ b/modules/mediasource/MediaSource.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#idl-def-MediaSource
+// https://w3c.github.io/media-source/#idl-def-mediasource
enum EndOfStreamError {
"network",
@@ -36,10 +36,10 @@
};
[
- DependentLifetime,
+ ActiveScriptWrappable,
Constructor,
ConstructorCallWith=ExecutionContext,
- RuntimeEnabled=MediaSource,
+ DependentLifetime
] interface MediaSource : EventTarget {
// All the source buffers created by this object.
readonly attribute SourceBufferList sourceBuffers;
@@ -48,13 +48,16 @@
readonly attribute SourceBufferList activeSourceBuffers;
[RaisesException=Setter] attribute unrestricted double duration;
-
+ attribute EventHandler onsourceopen;
+ attribute EventHandler onsourceended;
+ attribute EventHandler onsourceclose;
[RaisesException] SourceBuffer addSourceBuffer(DOMString type);
[RaisesException] void removeSourceBuffer(SourceBuffer buffer);
-
readonly attribute DOMString readyState;
-
[RaisesException] void endOfStream(optional EndOfStreamError error);
+ [RaisesException] void setLiveSeekableRange(double start, double end);
+ [RaisesException] void clearLiveSeekableRange();
+
static boolean isTypeSupported (DOMString type);
};
diff --git a/modules/mediasource/SourceBuffer.idl b/modules/mediasource/SourceBuffer.idl
index a3f206e..3ad08b3 100644
--- a/modules/mediasource/SourceBuffer.idl
+++ b/modules/mediasource/SourceBuffer.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#idl-def-SourceBuffer
+// https://w3c.github.io/media-source/#idl-def-sourcebuffer
enum AppendMode {
"segments",
@@ -36,8 +36,8 @@
};
[
- DependentLifetime,
- RuntimeEnabled=MediaSource,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface SourceBuffer : EventTarget {
// Gets or sets the AppendMode.
@@ -51,18 +51,25 @@
// Applies an offset to media segment timestamps.
[RaisesException=Setter] attribute double timestampOffset;
+ [RuntimeEnabled=AudioVideoTracks] readonly attribute AudioTrackList audioTracks;
+ [RuntimeEnabled=AudioVideoTracks] readonly attribute VideoTrackList videoTracks;
+
// Presentation timestamp for the start of append window.
[RaisesException=Setter] attribute double appendWindowStart;
// Presentation timestamp for the end of append window.
[RaisesException=Setter] attribute unrestricted double appendWindowEnd;
+ attribute EventHandler onupdatestart;
+ attribute EventHandler onupdate;
+ attribute EventHandler onupdateend;
+ attribute EventHandler onerror;
+ attribute EventHandler onabort;
+
// Append segment data.
[RaisesException] void appendBuffer(ArrayBuffer data);
[RaisesException] void appendBuffer(ArrayBufferView data);
- [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);
diff --git a/modules/mediasource/SourceBufferList.idl b/modules/mediasource/SourceBufferList.idl
index 2cd26cc..2a3049e 100644
--- a/modules/mediasource/SourceBufferList.idl
+++ b/modules/mediasource/SourceBufferList.idl
@@ -28,11 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
- RuntimeEnabled=MediaSource,
-] interface SourceBufferList : EventTarget {
+interface SourceBufferList : EventTarget {
readonly attribute unsigned long length;
+ attribute EventHandler onaddsourcebuffer;
+ attribute EventHandler onremovesourcebuffer;
[ImplementedAs=item] getter SourceBuffer (unsigned long index);
};
-
diff --git a/modules/mediasource/TrackDefault.idl b/modules/mediasource/TrackDefault.idl
index 5c8687f..8a8e11a 100644
--- a/modules/mediasource/TrackDefault.idl
+++ b/modules/mediasource/TrackDefault.idl
@@ -10,12 +10,16 @@
[
Constructor(TrackDefaultType type, DOMString language, DOMString label, sequence<DOMString> kinds, optional DOMString byteStreamTrackID = ""),
RaisesException=Constructor,
- GarbageCollected,
- RuntimeEnabled=MediaSourceExperimental,
+ RuntimeEnabled=MediaSourceExperimental
] interface TrackDefault {
readonly attribute TrackDefaultType type;
readonly attribute DOMString byteStreamTrackID;
readonly attribute DOMString language;
readonly attribute DOMString label;
- readonly attribute DOMString[] kinds;
+ // TrackDefault was removed from the spec in
+ // https://github.com/w3c/media-source/pull/138, and the last version to
+ // have it had getKinds() instead of |kinds|. Use an object here to avoid
+ // WebIDL arrays (which no longer exist) while not breaking compatibility
+ // See also: https://crbug.com/619665.
+ [CallWith=ScriptState] readonly attribute object kinds;
};
diff --git a/modules/mediasource/TrackDefaultList.idl b/modules/mediasource/TrackDefaultList.idl
index 2b962fc..9ed5174 100644
--- a/modules/mediasource/TrackDefaultList.idl
+++ b/modules/mediasource/TrackDefaultList.idl
@@ -8,8 +8,7 @@
[
Constructor(optional sequence<TrackDefault> trackDefaults = []),
RaisesException=Constructor,
- GarbageCollected,
- RuntimeEnabled=MediaSourceExperimental,
+ RuntimeEnabled=MediaSourceExperimental
] interface TrackDefaultList {
readonly attribute unsigned long length;
[ImplementedAs=item] getter TrackDefault (unsigned long index);
diff --git a/modules/mediasource/URLMediaSource.idl b/modules/mediasource/URLMediaSource.idl
index db0aa53..7151a94 100644
--- a/modules/mediasource/URLMediaSource.idl
+++ b/modules/mediasource/URLMediaSource.idl
@@ -28,8 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#idl-def-URL
+// https://w3c.github.io/media-source/#url
-partial interface URL {
- [CallWith=ExecutionContext] static DOMString? createObjectURL(MediaSource source);
+[
+ ImplementedAs=URLMediaSource
+] partial interface URL {
+ [Exposed=(Window,DedicatedWorker,SharedWorker), CallWith=ScriptState] static DOMString createObjectURL(MediaSource source);
};
diff --git a/modules/mediasource/VideoPlaybackQuality.idl b/modules/mediasource/VideoPlaybackQuality.idl
index 063888e..809bb88 100644
--- a/modules/mediasource/VideoPlaybackQuality.idl
+++ b/modules/mediasource/VideoPlaybackQuality.idl
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
- GarbageCollected,
- RuntimeEnabled=MediaSourceExperimental,
+ RuntimeEnabled=MediaSourceExperimental
] interface VideoPlaybackQuality {
readonly attribute double creationTime;
readonly attribute unsigned long totalVideoFrames;
diff --git a/modules/mediasource/VideoTrackSourceBuffer.idl b/modules/mediasource/VideoTrackSourceBuffer.idl
new file mode 100644
index 0000000..3b986a2
--- /dev/null
+++ b/modules/mediasource/VideoTrackSourceBuffer.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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/media-source/#video-track-extensions
+[
+ ImplementedAs=SourceBufferTrackBaseSupplement,
+ RuntimeEnabled=AudioVideoTracks
+] partial interface VideoTrack {
+ readonly attribute SourceBuffer? sourceBuffer;
+};
diff --git a/modules/mediastream/ConstrainBooleanParameters.idl b/modules/mediastream/ConstrainBooleanParameters.idl
index c8e9677..55aafb0 100644
--- a/modules/mediastream/ConstrainBooleanParameters.idl
+++ b/modules/mediastream/ConstrainBooleanParameters.idl
@@ -2,7 +2,7 @@
// 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-main/getusermedia.html#idl-def-ConstrainBooleanParameters
+// https://w3c.github.io/mediacapture-main/#idl-def-constrainbooleanparameters
dictionary ConstrainBooleanParameters {
boolean exact;
diff --git a/modules/mediastream/ConstrainDOMStringParameters.idl b/modules/mediastream/ConstrainDOMStringParameters.idl
index 93bc42e..a27c88b 100644
--- a/modules/mediastream/ConstrainDOMStringParameters.idl
+++ b/modules/mediastream/ConstrainDOMStringParameters.idl
@@ -2,13 +2,9 @@
// 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-main/getusermedia.html#idl-def-ConstrainLongRange
+// https://w3c.github.io/mediacapture-main/#idl-def-constraindomstringparameters
dictionary ConstrainDOMStringParameters {
- sequence<DOMString> exact;
- sequence<DOMString> ideal;
- // The spec says that the members should be:
- // (DOMString or sequence<DOMString>) exact;
- // (DOMString or sequence<DOMString>) ideal;
- // This is blocked on https://crbug.com/524424
+ (DOMString or sequence<DOMString>) exact;
+ (DOMString or sequence<DOMString>) ideal;
};
diff --git a/modules/mediastream/ConstrainDoubleRange.idl b/modules/mediastream/ConstrainDoubleRange.idl
index 15e92f2..aefc25a 100644
--- a/modules/mediastream/ConstrainDoubleRange.idl
+++ b/modules/mediastream/ConstrainDoubleRange.idl
@@ -2,7 +2,7 @@
// 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-main/getusermedia.html#idl-def-ConstrainDoubleRange
+// https://w3c.github.io/mediacapture-main/#idl-def-constraindoublerange
dictionary ConstrainDoubleRange : DoubleRange {
double exact;
diff --git a/modules/mediastream/ConstrainLongRange.idl b/modules/mediastream/ConstrainLongRange.idl
index a894734..d3ece44 100644
--- a/modules/mediastream/ConstrainLongRange.idl
+++ b/modules/mediastream/ConstrainLongRange.idl
@@ -2,7 +2,7 @@
// 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-main/getusermedia.html#idl-def-ConstrainLongRange
+// https://w3c.github.io/mediacapture-main/#idl-def-constrainlongrange
dictionary ConstrainLongRange : LongRange {
long exact;
diff --git a/modules/mediastream/DoubleRange.idl b/modules/mediastream/DoubleRange.idl
index 424dfb0..774d3f5 100644
--- a/modules/mediastream/DoubleRange.idl
+++ b/modules/mediastream/DoubleRange.idl
@@ -2,7 +2,7 @@
// 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-main/getusermedia.html#idl-def-DoubleRange
+// https://w3c.github.io/mediacapture-main/#idl-def-doublerange
dictionary DoubleRange {
double max;
diff --git a/modules/mediastream/LongRange.idl b/modules/mediastream/LongRange.idl
index d6dc0a4..d251187 100644
--- a/modules/mediastream/LongRange.idl
+++ b/modules/mediastream/LongRange.idl
@@ -2,7 +2,7 @@
// 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-main/getusermedia.html#idl-def-LongRange
+// https://w3c.github.io/mediacapture-main/#idl-def-longrange
dictionary LongRange {
long max;
diff --git a/modules/mediastream/MediaDeviceInfo.idl b/modules/mediastream/MediaDeviceInfo.idl
index 34b0e0c..3ff1e1d 100644
--- a/modules/mediastream/MediaDeviceInfo.idl
+++ b/modules/mediastream/MediaDeviceInfo.idl
@@ -23,16 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://w3c.github.io/mediacapture-main/#device-info
+
enum MediaDeviceKind {
"audioinput",
"audiooutput",
"videoinput"
};
-[
- GarbageCollected,
- NoInterfaceObject
-] interface MediaDeviceInfo {
+interface MediaDeviceInfo {
readonly attribute DOMString deviceId;
readonly attribute MediaDeviceKind kind;
readonly attribute DOMString label;
diff --git a/modules/mediastream/MediaDevices.idl b/modules/mediastream/MediaDevices.idl
index f7aa991..bfd830d 100644
--- a/modules/mediastream/MediaDevices.idl
+++ b/modules/mediastream/MediaDevices.idl
@@ -3,14 +3,18 @@
// 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
+// https://w3c.github.io/mediacapture-main/#mediadevices
+// https://w3c.github.io/mediacapture-main/#mediadevices-interface-extensions
[
- GarbageCollected,
- RuntimeEnabled=MediaDevices
-]
-interface MediaDevices {
+ ActiveScriptWrappable,
+ DependentLifetime
+] interface MediaDevices : EventTarget {
+ [RuntimeEnabled=OnDeviceChange] attribute EventHandler ondevicechange;
[CallWith=ScriptState, MeasureAs=MediaDevicesEnumerateDevices] Promise<sequence<MediaDeviceInfo>> enumerateDevices();
- [RuntimeEnabled=GetUserMedia, CallWith=ScriptState, RaisesException] Promise<MediaStream> getUserMedia(MediaStreamConstraints options);
+ MediaTrackSupportedConstraints getSupportedConstraints();
+ [CallWith=ScriptState,
+ RaisesException,
+ MeasureAs=GetUserMediaPromise
+ ] Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
};
diff --git a/modules/mediastream/MediaStream.idl b/modules/mediastream/MediaStream.idl
index 146dff1..9add324 100644
--- a/modules/mediastream/MediaStream.idl
+++ b/modules/mediastream/MediaStream.idl
@@ -10,47 +10,41 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-// http://w3c.github.io/mediacapture-main/getusermedia.html#idl-def-MediaStream
+// https://w3c.github.io/mediacapture-main/#idl-def-mediastream
[
- GarbageCollected,
Constructor,
Constructor(MediaStream stream),
- Constructor(MediaStreamTrack[] tracks),
- ConstructorCallWith=ExecutionContext,
- NoInterfaceObject,
+ Constructor(sequence<MediaStreamTrack> tracks),
+ ConstructorCallWith=ExecutionContext
] interface MediaStream : EventTarget {
-
readonly attribute DOMString id;
-
sequence<MediaStreamTrack> getAudioTracks();
sequence<MediaStreamTrack> getVideoTracks();
sequence<MediaStreamTrack> getTracks();
-
+ MediaStreamTrack? getTrackById(DOMString trackId);
[RaisesException] void addTrack(MediaStreamTrack track);
[RaisesException] void removeTrack(MediaStreamTrack track);
- MediaStreamTrack getTrackById(DOMString trackId);
- [CallWith=ExecutionContext] MediaStream clone();
-
- readonly attribute boolean active;
-
- attribute EventHandler onactive;
- attribute EventHandler oninactive;
- // DEPRECATED
- [MeasureAs=MediaStreamOnEnded] attribute EventHandler onended;
-
+ [CallWith=ScriptState] MediaStream clone();
+ [Measure] readonly attribute boolean active;
attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
+
+ // TODO(guidou): Remove the active and inactive events on MediaStream.
+ // https://crbug.com/649328
+ attribute EventHandler onactive;
+ attribute EventHandler oninactive;
};
diff --git a/modules/mediastream/MediaStreamConstraints.idl b/modules/mediastream/MediaStreamConstraints.idl
index b5a8fee..a63c6e3 100644
--- a/modules/mediastream/MediaStreamConstraints.idl
+++ b/modules/mediastream/MediaStreamConstraints.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.
-// https://w3c.github.io/mediacapture-main/getusermedia.html#idl-def-MediaStreamConstraints
+// https://w3c.github.io/mediacapture-main/#idl-def-mediastreamconstraints
dictionary MediaStreamConstraints {
- (boolean or MediaTrackConstraintSet) video;
- (boolean or MediaTrackConstraintSet) audio;
+ (boolean or MediaTrackConstraints) video = false;
+ (boolean or MediaTrackConstraints) audio = false;
};
diff --git a/modules/mediastream/MediaStreamEvent.idl b/modules/mediastream/MediaStreamEvent.idl
index f088583..80a1082 100644
--- a/modules/mediastream/MediaStreamEvent.idl
+++ b/modules/mediastream/MediaStreamEvent.idl
@@ -10,22 +10,24 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-// http://www.w3.org/TR/webrtc/#mediastreamevent
+// An old version of WebRTC defines the MediaStreamEvent interface:
+// https://www.w3.org/TR/2015/WD-webrtc-20150210/#mediastreamevent
[
- Constructor(DOMString type, optional MediaStreamEventInit eventInitDict),
+ 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
index f7ba224..8c58e16 100644
--- a/modules/mediastream/MediaStreamEventInit.idl
+++ b/modules/mediastream/MediaStreamEventInit.idl
@@ -2,8 +2,9 @@
// 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
+// An old version of WebRTC defines the MediaStreamEvent interface:
+// https://www.w3.org/TR/2015/WD-webrtc-20150210/#mediastreamevent
dictionary MediaStreamEventInit : EventInit {
- MediaStream stream;
+ MediaStream? stream;
};
diff --git a/modules/mediastream/MediaStreamTrack.idl b/modules/mediastream/MediaStreamTrack.idl
index 1c7f1fd..a5783f7 100644
--- a/modules/mediastream/MediaStreamTrack.idl
+++ b/modules/mediastream/MediaStreamTrack.idl
@@ -10,20 +10,31 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// https://w3c.github.io/mediacapture-main/#mediastreamtrack
+
+// TODO(foolip): Remove or standardize MediaStreamTrackState "muted".
+// https://crbug.com/651414
+enum MediaStreamTrackState {
+ "live",
+ "muted",
+ "ended"
+};
+
[
- GarbageCollected,
+ ActiveScriptWrappable,
DependentLifetime
] interface MediaStreamTrack : EventTarget {
readonly attribute DOMString kind;
@@ -31,15 +42,19 @@
readonly attribute DOMString label;
attribute boolean enabled;
readonly attribute boolean muted;
- readonly attribute boolean remote;
- readonly attribute DOMString readyState;
-
- [CallWith=ExecutionContext, RaisesException, DeprecateAs=MediaStreamTrackGetSources] static void getSources(MediaStreamTrackSourcesCallback callback);
- [ImplementedAs=stopTrack, RaisesException] void stop();
- [CallWith=ExecutionContext] MediaStreamTrack clone();
-
attribute EventHandler onmute;
attribute EventHandler onunmute;
+ readonly attribute MediaStreamTrackState readyState;
attribute EventHandler onended;
-};
+ [CallWith=ScriptState] MediaStreamTrack clone();
+ [ImplementedAs=stopTrack, RaisesException] void stop();
+
+ MediaTrackCapabilities getCapabilities();
+ MediaTrackConstraints getConstraints();
+ MediaTrackSettings getSettings();
+ // Spec resolves applyConstraints() with void, here we resolve with the
+ // applied MediaTrackConstraints instead:
+ // https://github.com/w3c/mediacapture-main/issues/462
+ [CallWith=ScriptState] Promise<MediaTrackConstraints> applyConstraints(optional MediaTrackConstraints constraints);
+};
diff --git a/modules/mediastream/MediaStreamTrackContentHint.idl b/modules/mediastream/MediaStreamTrackContentHint.idl
new file mode 100644
index 0000000..c333f0e
--- /dev/null
+++ b/modules/mediastream/MediaStreamTrackContentHint.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/mst-content-hint/#extension-to-mediastreamtrack
+[
+ ImplementedAs=MediaStreamTrackContentHint,
+ RuntimeEnabled=MediaStreamTrackContentHint
+] partial interface MediaStreamTrack {
+ attribute DOMString contentHint;
+};
diff --git a/modules/mediastream/MediaStreamTrackEvent.idl b/modules/mediastream/MediaStreamTrackEvent.idl
index b3967d4..0d0f447 100644
--- a/modules/mediastream/MediaStreamTrackEvent.idl
+++ b/modules/mediastream/MediaStreamTrackEvent.idl
@@ -10,21 +10,24 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-[
- NoInterfaceObject
-] interface MediaStreamTrackEvent : Event {
- readonly attribute MediaStreamTrack track;
-};
+// https://w3c.github.io/mediacapture-main/#mediastreamtrackevent
+[
+ Exposed=Window,
+ Constructor(DOMString type, MediaStreamTrackEventInit eventInitDict)
+] interface MediaStreamTrackEvent : Event {
+ [SameObject] readonly attribute MediaStreamTrack track;
+};
diff --git a/modules/mediastream/MediaStreamTrackEventInit.idl b/modules/mediastream/MediaStreamTrackEventInit.idl
new file mode 100644
index 0000000..4be97fa
--- /dev/null
+++ b/modules/mediastream/MediaStreamTrackEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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-main/#mediastreamtrackevent
+
+dictionary MediaStreamTrackEventInit : EventInit {
+ required MediaStreamTrack track;
+};
diff --git a/modules/mediastream/MediaStreamTrackSourcesCallback.idl b/modules/mediastream/MediaStreamTrackSourcesCallback.idl
deleted file mode 100644
index e18f7bb..0000000
--- a/modules/mediastream/MediaStreamTrackSourcesCallback.idl
+++ /dev/null
@@ -1,29 +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:
- * 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 MediaStreamTrackSourcesCallback {
- void handleEvent(sequence<SourceInfo> sources);
-};
-
diff --git a/modules/mediastream/MediaTrackCapabilities.idl b/modules/mediastream/MediaTrackCapabilities.idl
new file mode 100644
index 0000000..ee500dc
--- /dev/null
+++ b/modules/mediastream/MediaTrackCapabilities.idl
@@ -0,0 +1,22 @@
+// Copyright 2017 The Chromium 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 MediaTrackCapabilities {
+ // W3C Image Capture API
+ // https://w3c.github.io/mediacapture-image/#mediatrackcapabilities-section
+ // TODO(mcasas) move out when partial dictionaries are supported
+ // http://crbug.com/579896.
+ sequence<DOMString> whiteBalanceMode;
+ sequence<DOMString> exposureMode;
+ sequence<DOMString> focusMode;
+ MediaSettingsRange exposureCompensation;
+ MediaSettingsRange colorTemperature;
+ MediaSettingsRange iso;
+ MediaSettingsRange brightness;
+ MediaSettingsRange contrast;
+ MediaSettingsRange saturation;
+ MediaSettingsRange sharpness;
+ MediaSettingsRange zoom;
+ boolean torch;
+};
diff --git a/modules/mediastream/MediaTrackConstraintSet.idl b/modules/mediastream/MediaTrackConstraintSet.idl
index 04a3f33..eb1d7c5 100644
--- a/modules/mediastream/MediaTrackConstraintSet.idl
+++ b/modules/mediastream/MediaTrackConstraintSet.idl
@@ -2,33 +2,55 @@
// 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-main/getusermedia.html#idl-def-MediaTrackConstraintSet
+// https://w3c.github.io/mediacapture-main/#idl-def-mediatrackconstraintset
-typedef ConstrainLongRange ConstrainLong;
-typedef ConstrainDoubleRange ConstrainDouble;
-typedef ConstrainBooleanParameters ConstrainBoolean;
-typedef ConstrainDOMStringParameters ConstrainDOMString;
-// The spec says that the typedefs should be:
-// typedef (long or ConstrainLongRange) ConstrainLong;
-// typedef (double or ConstrainDoubleRange) ConstrainDouble;
-// typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
-// typedef (DOMString or sequence<DOMString> or ConstrainDomStringParameters) ConstrainDomString;
-// This is blocked on https://crbug.com/524424
+typedef (long or ConstrainLongRange) ConstrainLong;
+typedef (double or ConstrainDoubleRange) ConstrainDouble;
+typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
+typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
+typedef (sequence<Point2D> or ConstrainPoint2DParameters) ConstrainPoint2D;
dictionary MediaTrackConstraintSet {
- [RuntimeEnabled=MediaConstraints] ConstrainLong width;
- [RuntimeEnabled=MediaConstraints] ConstrainLong height;
- [RuntimeEnabled=MediaConstraints] ConstrainDouble aspectRatio;
- [RuntimeEnabled=MediaConstraints] ConstrainDouble frameRate;
- [RuntimeEnabled=MediaConstraints] ConstrainDOMString facingMode;
- [RuntimeEnabled=MediaConstraints] ConstrainDouble volume;
- [RuntimeEnabled=MediaConstraints] ConstrainLong sampleRate;
- [RuntimeEnabled=MediaConstraints] ConstrainLong sampleSize;
- [RuntimeEnabled=MediaConstraints] ConstrainBoolean echoCancellation;
- [RuntimeEnabled=MediaConstraints] ConstrainDouble latency;
- [RuntimeEnabled=MediaConstraints] ConstrainLong channelCount;
- [RuntimeEnabled=MediaConstraints] ConstrainDOMString deviceId;
- [RuntimeEnabled=MediaConstraints] ConstrainDOMString groupId;
+ ConstrainLong width;
+ ConstrainLong height;
+ ConstrainDouble aspectRatio;
+ ConstrainDouble frameRate;
+ ConstrainDOMString facingMode;
+ ConstrainDouble volume;
+ ConstrainLong sampleRate;
+ ConstrainLong sampleSize;
+ ConstrainBoolean echoCancellation;
+ ConstrainDouble latency;
+ ConstrainLong channelCount;
+ ConstrainDOMString deviceId;
+ ConstrainDOMString groupId;
+ // Media Capture Depth Stream Extensions
+ // https://w3c.github.io/mediacapture-depth/#mediatrackconstraints
+ // TODO(aleksandar.stojiljkovic): videoKind, depthNear, depthFar,
+ // focalLengthX and focalLengthY attributes should be declared as partial
+ // dictionary but IDL parser can't support it yet. http://crbug.com/579896.
+ [RuntimeEnabled=MediaCaptureDepthVideoKind] ConstrainDOMString videoKind;
+ [RuntimeEnabled=MediaCaptureDepth] ConstrainDouble depthNear;
+ [RuntimeEnabled=MediaCaptureDepth] ConstrainDouble depthFar;
+ [RuntimeEnabled=MediaCaptureDepth] ConstrainDouble focalLengthX;
+ [RuntimeEnabled=MediaCaptureDepth] ConstrainDouble focalLengthY;
+ // W3C Image Capture API
+ // https://w3c.github.io/mediacapture-image/#mediatrackconstraintset-section
+ // TODO(mcasas) move out when partial dictionaries are supported
+ // http://crbug.com/579896.
+ ConstrainDOMString whiteBalanceMode;
+ ConstrainDOMString exposureMode;
+ ConstrainDOMString focusMode;
+ ConstrainPoint2D pointsOfInterest;
+ ConstrainDouble exposureCompensation;
+ ConstrainDouble colorTemperature;
+ ConstrainDouble iso;
+ ConstrainDouble brightness;
+ ConstrainDouble contrast;
+ ConstrainDouble saturation;
+ ConstrainDouble sharpness;
+ ConstrainDouble zoom;
+ ConstrainBoolean torch;
// The "mandatory" and "_optional" members are retained for conformance
// with https://www.w3.org/TR/2013/WD-mediacapture-streams-20130903/
Dictionary mandatory;
diff --git a/modules/mediastream/MediaTrackConstraints.idl b/modules/mediastream/MediaTrackConstraints.idl
new file mode 100644
index 0000000..78de586
--- /dev/null
+++ b/modules/mediastream/MediaTrackConstraints.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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-main/#idl-def-mediatrackconstraints
+
+dictionary MediaTrackConstraints : MediaTrackConstraintSet {
+ sequence<MediaTrackConstraintSet> advanced;
+};
diff --git a/modules/mediastream/MediaTrackSettings.idl b/modules/mediastream/MediaTrackSettings.idl
new file mode 100644
index 0000000..0c21eaa
--- /dev/null
+++ b/modules/mediastream/MediaTrackSettings.idl
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium 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-main/#idl-def-mediatracksettings
+
+dictionary MediaTrackSettings {
+ long width;
+ long height;
+ double aspectRatio;
+ double frameRate;
+ DOMString facingMode;
+ // volume, sampleRate and sampleSize are not implemented.
+ // double volume;
+ // long sampleRate;
+ // long sampleSize;
+ boolean echoCancellation;
+ // latency and channelCount are not implemented.
+ // double latency;
+ // long channelCount;
+ DOMString deviceId;
+ // groupId is not implemented.
+ // DOMString groupId;
+ // Media Capture Depth Stream Extensions
+ // https://w3c.github.io/mediacapture-depth/#mediatracksettings-dictionary
+ // TODO(aleksandar.stojiljkovic): videoKind, depthNear, depthFar,
+ // focalLengthX and focalLengthY attributes should be declared as partial
+ // dictionary but IDL parser can't support it yet. http://crbug.com/579896.
+ [RuntimeEnabled=MediaCaptureDepthVideoKind] DOMString videoKind;
+ [RuntimeEnabled=MediaCaptureDepth] double depthNear;
+ [RuntimeEnabled=MediaCaptureDepth] double depthFar;
+ [RuntimeEnabled=MediaCaptureDepth] double focalLengthX;
+ [RuntimeEnabled=MediaCaptureDepth] double focalLengthY;
+ // W3C Image Capture API
+ // https://w3c.github.io/mediacapture-image/#mediatracksettings-section
+ // TODO(mcasas) move out when partial dictionaries are supported
+ // http://crbug.com/579896.
+ DOMString whiteBalanceMode;
+ DOMString exposureMode;
+ DOMString focusMode;
+ sequence<Point2D> pointsOfInterest;
+ double exposureCompensation;
+ double colorTemperature;
+ double iso;
+ double brightness;
+ double contrast;
+ double saturation;
+ double sharpness;
+ double zoom;
+ boolean torch;
+};
diff --git a/modules/mediastream/MediaTrackSupportedConstraints.idl b/modules/mediastream/MediaTrackSupportedConstraints.idl
new file mode 100644
index 0000000..4f07446
--- /dev/null
+++ b/modules/mediastream/MediaTrackSupportedConstraints.idl
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium 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-main/#idl-def-mediatracksupportedconstraints
+
+// NOTE: The names of this dictionary MUST be kept aligned with those in
+// MediaTrackConstraintSet.idl.
+
+dictionary MediaTrackSupportedConstraints {
+ boolean width = true;
+ boolean height = true;
+ boolean aspectRatio = true;
+ boolean frameRate = true;
+ boolean facingMode = true;
+ boolean volume = true;
+ boolean sampleRate = true;
+ boolean sampleSize = true;
+ boolean echoCancellation = true;
+ boolean latency = true;
+ boolean channelCount = true;
+ boolean deviceId = true;
+ boolean groupId = true;
+
+ // Media Capture Depth Stream Extensions
+ // https://w3c.github.io/mediacapture-depth
+ // TODO(aleksandar.stojiljkovic): videoKind, depthNear, depthFar,
+ // focalLengthX and focalLengthY attributes should be declared as partial
+ // dictionary but IDL parser can't support it yet. http://crbug.com/579896.
+ [RuntimeEnabled=MediaCaptureDepthVideoKind] boolean videoKind = true;
+ [RuntimeEnabled=MediaCaptureDepth] boolean depthNear = true;
+ [RuntimeEnabled=MediaCaptureDepth] boolean depthFar = true;
+ [RuntimeEnabled=MediaCaptureDepth] boolean focalLengthX = true;
+ [RuntimeEnabled=MediaCaptureDepth] boolean focalLengthY = true;
+
+ // W3C Image Capture API
+ // https://w3c.github.io/mediacapture-image/#mediatracksupportedconstraints-section
+ // TODO(mcasas) move out when partial dictionaries are supported
+ // http://crbug.com/579896.
+ boolean whiteBalanceMode = true;
+ boolean exposureMode = true;
+ boolean focusMode = true;
+ boolean pointsOfInterest = true;
+ boolean exposureCompensation = true;
+ boolean colorTemperature = true;
+ boolean iso = true;
+ boolean brightness = true;
+ boolean contrast = true;
+ boolean saturation = true;
+ boolean sharpness = true;
+ boolean zoom = true;
+ boolean torch = true;
+};
diff --git a/modules/mediastream/NavigatorMediaStream.idl b/modules/mediastream/NavigatorMediaStream.idl
index 9453f9f..85c3e5f 100644
--- a/modules/mediastream/NavigatorMediaStream.idl
+++ b/modules/mediastream/NavigatorMediaStream.idl
@@ -17,8 +17,22 @@
* Boston, MA 02110-1301, USA.
*/
-partial interface Navigator {
- [RaisesException] void webkitGetUserMedia(MediaStreamConstraints options,
- NavigatorUserMediaSuccessCallback successCallback,
- NavigatorUserMediaErrorCallback errorCallback);
+// https://w3c.github.io/mediacapture-main/#navigatorusermedia-interface-extensions
+
+[
+ ImplementedAs=NavigatorMediaStream
+] partial interface Navigator {
+ [RaisesException,
+ MeasureAs=GetUserMediaLegacy
+ ] void getUserMedia(MediaStreamConstraints constraints,
+ NavigatorUserMediaSuccessCallback successCallback,
+ NavigatorUserMediaErrorCallback errorCallback);
+
+ // Non-standard
+ [RaisesException,
+ ImplementedAs=getUserMedia,
+ MeasureAs=GetUserMediaPrefixed
+ ] void webkitGetUserMedia(MediaStreamConstraints constraints,
+ NavigatorUserMediaSuccessCallback successCallback,
+ NavigatorUserMediaErrorCallback errorCallback);
};
diff --git a/modules/mediastream/NavigatorUserMedia.idl b/modules/mediastream/NavigatorUserMedia.idl
index c3ba9f0..fa51c2d 100644
--- a/modules/mediastream/NavigatorUserMedia.idl
+++ b/modules/mediastream/NavigatorUserMedia.idl
@@ -2,9 +2,10 @@
// 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
+// https://w3c.github.io/mediacapture-main/#navigatorusermedia
-partial interface Navigator {
- [RuntimeEnabled=MediaDevices] readonly attribute MediaDevices mediaDevices;
+[
+ ImplementedAs=NavigatorUserMedia
+] partial interface Navigator {
+ [SameObject] readonly attribute MediaDevices mediaDevices;
};
-
diff --git a/modules/mediastream/NavigatorUserMediaError.idl b/modules/mediastream/NavigatorUserMediaError.idl
index f3b5fbb..6a44acd 100644
--- a/modules/mediastream/NavigatorUserMediaError.idl
+++ b/modules/mediastream/NavigatorUserMediaError.idl
@@ -10,24 +10,30 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// https://w3c.github.io/mediacapture-main/archives/20150629/getusermedia.html#mediastreamerror
+
+// TODO(foolip): This become OverconstrainedError in
+// https://github.com/w3c/mediacapture-main/pull/194 but but that does not have
+// a |constraintName| member:
+// https://w3c.github.io/mediacapture-main/#overconstrainederror-object
+// See also https://github.com/w3c/mediacapture-main/issues/405
[
- GarbageCollected,
NoInterfaceObject
] interface NavigatorUserMediaError {
readonly attribute DOMString name;
readonly attribute DOMString message;
- readonly attribute DOMString constraintName;
+ [Measure] readonly attribute DOMString constraintName;
};
-
diff --git a/modules/mediastream/NavigatorUserMediaErrorCallback.idl b/modules/mediastream/NavigatorUserMediaErrorCallback.idl
index e1304de..ceeceed 100644
--- a/modules/mediastream/NavigatorUserMediaErrorCallback.idl
+++ b/modules/mediastream/NavigatorUserMediaErrorCallback.idl
@@ -10,19 +10,23 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// https://w3c.github.io/mediacapture-main/#navigatorusermediaerrorcallback
+
+// TODO(foolip): This should be a callback function, not a callback interface.
+// https://crbug.com/569301
callback interface NavigatorUserMediaErrorCallback {
void handleEvent(NavigatorUserMediaError error);
};
-
diff --git a/modules/mediastream/NavigatorUserMediaSuccessCallback.idl b/modules/mediastream/NavigatorUserMediaSuccessCallback.idl
index 8f443a6..02db88b 100644
--- a/modules/mediastream/NavigatorUserMediaSuccessCallback.idl
+++ b/modules/mediastream/NavigatorUserMediaSuccessCallback.idl
@@ -10,19 +10,23 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// https://w3c.github.io/mediacapture-main/#navigatorusermediasuccesscallback
+
+// TODO(foolip): This should be a callback function, not a callback interface.
+// https://crbug.com/569301
callback interface NavigatorUserMediaSuccessCallback {
void handleEvent(MediaStream stream);
};
-
diff --git a/modules/mediastream/OverconstrainedError.idl b/modules/mediastream/OverconstrainedError.idl
new file mode 100644
index 0000000..328a768
--- /dev/null
+++ b/modules/mediastream/OverconstrainedError.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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-main/#overconstrainederror-object
+
+// TODO(guidou): OverconstrainedError should be an Error subclass and not an
+// interface. http://crbug.com/769726
+[
+ Constructor(DOMString constraint, DOMString message)
+] interface OverconstrainedError {
+ readonly attribute DOMString name;
+ readonly attribute DOMString? message;
+ readonly attribute DOMString? constraint;
+};
diff --git a/modules/mediastream/RTCCertificate.idl b/modules/mediastream/RTCCertificate.idl
deleted file mode 100644
index b6e9a4a..0000000
--- a/modules/mediastream/RTCCertificate.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 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 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/webrtc-pc/#rtccertificate-interface
-[
- GarbageCollected,
-] interface RTCCertificate {
- // The expiration time in ms relative to epoch, 1970-01-01T00:00:00Z.
- readonly attribute DOMTimeStamp expires;
-};
diff --git a/modules/mediastream/RTCDTMFSender.idl b/modules/mediastream/RTCDTMFSender.idl
deleted file mode 100644
index 25cd3e5..0000000
--- a/modules/mediastream/RTCDTMFSender.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:
- * 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.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject,
- DependentLifetime
-] interface RTCDTMFSender : EventTarget {
- readonly attribute boolean canInsertDTMF;
- readonly attribute MediaStreamTrack track;
- readonly attribute DOMString toneBuffer;
- readonly attribute long duration;
- readonly attribute long interToneGap;
-
- [RaisesException] void insertDTMF(DOMString tones, optional long duration, optional long interToneGap);
-
- attribute EventHandler ontonechange;
-};
diff --git a/modules/mediastream/RTCDTMFToneChangeEvent.idl b/modules/mediastream/RTCDTMFToneChangeEvent.idl
deleted file mode 100644
index 15b64ac..0000000
--- a/modules/mediastream/RTCDTMFToneChangeEvent.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:
- * 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.
- */
-
-// http://www.w3.org/TR/webrtc/#rtcdtmftonechangeevent
-
-[
- NoInterfaceObject,
- Constructor(DOMString type, RTCDTMFToneChangeEventInit eventInitDict),
-] interface RTCDTMFToneChangeEvent : Event {
- readonly attribute DOMString tone;
-};
diff --git a/modules/mediastream/RTCDTMFToneChangeEventInit.idl b/modules/mediastream/RTCDTMFToneChangeEventInit.idl
deleted file mode 100644
index a070229..0000000
--- a/modules/mediastream/RTCDTMFToneChangeEventInit.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.
-
-// http://www.w3.org/TR/webrtc/#rtcdtmftonechangeevent
-
-dictionary RTCDTMFToneChangeEventInit : EventInit {
- DOMString tone;
-};
diff --git a/modules/mediastream/RTCDataChannel.idl b/modules/mediastream/RTCDataChannel.idl
deleted file mode 100644
index ee017de..0000000
--- a/modules/mediastream/RTCDataChannel.idl
+++ /dev/null
@@ -1,53 +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:
- * 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. 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 INC. 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.
- */
-
-// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannel
-
-[
- GarbageCollected,
- NoInterfaceObject,
-] interface RTCDataChannel : EventTarget {
- readonly attribute DOMString label;
- readonly attribute boolean reliable; // DEPRECATED
- readonly attribute boolean ordered;
- readonly attribute unsigned short maxRetransmitTime;
- readonly attribute unsigned short maxRetransmits;
- readonly attribute DOMString protocol;
- readonly attribute boolean negotiated;
- readonly attribute unsigned short id;
- readonly attribute DOMString readyState;
- readonly attribute unsigned long bufferedAmount;
- attribute unsigned long bufferedAmountLowThreshold;
- attribute EventHandler onopen;
- attribute EventHandler onbufferedamountlow;
- attribute EventHandler onerror;
- attribute EventHandler onclose;
- void close();
- attribute EventHandler onmessage;
- [RaisesException=Setter] attribute DOMString binaryType;
- [RaisesException] void send(DOMString data);
- [RaisesException] void send(Blob data);
- [RaisesException] void send(ArrayBuffer data);
- [RaisesException] void send(ArrayBufferView data);
-};
diff --git a/modules/mediastream/RTCDataChannelEvent.idl b/modules/mediastream/RTCDataChannelEvent.idl
deleted file mode 100644
index 98f40d6..0000000
--- a/modules/mediastream/RTCDataChannelEvent.idl
+++ /dev/null
@@ -1,29 +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:
- * 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. 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 INC. 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.
- */
-
-[
- NoInterfaceObject
-] interface RTCDataChannelEvent : Event {
- readonly attribute RTCDataChannel channel;
-};
diff --git a/modules/mediastream/RTCIceCandidate.idl b/modules/mediastream/RTCIceCandidate.idl
deleted file mode 100644
index d3bce54..0000000
--- a/modules/mediastream/RTCIceCandidate.idl
+++ /dev/null
@@ -1,41 +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:
- *
- * 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 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,
- Constructor(RTCIceCandidateInit candidateInitDict),
- RaisesException=Constructor
-] interface RTCIceCandidate {
- attribute DOMString candidate;
- attribute DOMString sdpMid;
- attribute unsigned short sdpMLineIndex;
- serializer = {attribute};
-};
-
diff --git a/modules/mediastream/RTCIceCandidateEvent.idl b/modules/mediastream/RTCIceCandidateEvent.idl
deleted file mode 100644
index 0cd3e43..0000000
--- a/modules/mediastream/RTCIceCandidateEvent.idl
+++ /dev/null
@@ -1,30 +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:
- * 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. 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 INC. 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.
- */
-
-[
- NoInterfaceObject
-] interface RTCIceCandidateEvent : Event {
- readonly attribute RTCIceCandidate candidate;
-};
-
diff --git a/modules/mediastream/RTCIceCandidateInit.idl b/modules/mediastream/RTCIceCandidateInit.idl
deleted file mode 100644
index e5a883e..0000000
--- a/modules/mediastream/RTCIceCandidateInit.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.
-
-// 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
deleted file mode 100644
index 8938088..0000000
--- a/modules/mediastream/RTCPeerConnection.idl
+++ /dev/null
@@ -1,133 +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:
- *
- * 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 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/webrtc-pc/#state-definitions
-
-enum RTCSignalingState {
- "stable",
- "have-local-offer",
- "have-remote-offer",
- "have-local-pranswer",
- "have-remote-pranswer",
- "closed"
-};
-
-enum RTCIceGatheringState {
- "new",
- "gathering",
- "complete"
-};
-
-enum RTCIceConnectionState {
- "new",
- "checking",
- "connected",
- "completed",
- "failed",
- "disconnected",
- "closed"
-};
-
-// https://w3c.github.io/webrtc-pc/#interface-definition
-
-// TODO(guidou): Many types are of the wrong type in this interface:
-// * Dictionary -> specific dictionary types like RTCConfiguration
-// * VoidCallback -> VoidFunction
-[
- GarbageCollected,
- DependentLifetime,
- // TODO(guidou): There should only be one constructor argument, and it
- // should be optional.
- Constructor(Dictionary rtcConfiguration, optional Dictionary mediaConstraints),
- ConstructorCallWith=ExecutionContext,
- NoInterfaceObject,
- RaisesException=Constructor,
-] interface RTCPeerConnection : EventTarget {
- // Promise<RTCSessionDescription> createOffer(optional RTCOfferOptions options);
- // Promise<RTCSessionDescription> createAnswer(optional RTCAnswerOptions options);
- [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescriptionInit description);
- readonly attribute RTCSessionDescription? localDescription;
- // readonly attribute RTCSessionDescription? currentLocalDescription;
- // readonly attribute RTCSessionDescription? pendingLocalDescription;
- [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescriptionInit description);
- readonly attribute RTCSessionDescription? remoteDescription;
- // readonly attribute RTCSessionDescription? currentRemoteDescription;
- // readonly attribute RTCSessionDescription? pendingRemoteDescription;
- [CallWith=ScriptState] Promise<void> addIceCandidate ((RTCIceCandidateInit or RTCIceCandidate) candidate);
- readonly attribute RTCSignalingState signalingState;
- readonly attribute RTCIceGatheringState iceGatheringState;
- readonly attribute RTCIceConnectionState iceConnectionState;
- // readonly attribute boolean? canTrickleIceCandidates;
- // RTCConfiguration getConfiguration();
- // void setConfiguration(RTCConfiguration configuration);
- // TODO(guidou): close() should never throw an exception.
- [RaisesException] void close();
- attribute EventHandler onnegotiationneeded;
- attribute EventHandler onicecandidate;
- attribute EventHandler onsignalingstatechange;
- attribute EventHandler oniceconnectionstatechange;
- // attribute EventHandler onicegatheringstatechange;
-
- // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions
- // These methods return or will be changed to return Promise<void> because
- // having Promise-based versions requires that all overloads return Promises.
- [CallWith=ExecutionContext, RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Dictionary rtcOfferOptions);
- // TODO(guidou): There should be no mediaConstraints argument.
- [CallWith=ExecutionContext, RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Dictionary mediaConstraints);
- [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescription description, VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
- // TODO(guidou): The failureCallback argument should be non-optional.
- [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescription description, VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
- [CallWith=ScriptState] Promise<void> addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
- // TODO(guidou): The selector argument should the first (nullable,
- // non-optional) argument, and there should be a third failureCallback
- // argument.
- [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCStatsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selector);
-
- // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api
- // TODO(guidou): The label argument should have [TreatNullAs=EmptyString]
- // and be non-nullable.
- [RaisesException] RTCDataChannel createDataChannel([TreatUndefinedAs=NullString] DOMString? label, optional Dictionary options);
- attribute EventHandler ondatachannel;
-
- // Non-standard or removed from the spec:
- [CallWith=ExecutionContext, RaisesException] void updateIce(optional Dictionary configuration, optional Dictionary mediaConstraints);
- sequence<MediaStream> getLocalStreams();
- sequence<MediaStream> getRemoteStreams();
- MediaStream getStreamById(DOMString streamId);
- [CallWith=ExecutionContext, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints);
- [RaisesException] void removeStream(MediaStream? stream);
- [RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track);
- attribute EventHandler onaddstream;
- attribute EventHandler onremovestream;
-
- // Certificate management
- // http://w3c.github.io/webrtc-pc/#sec.cert-mgmt
- [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> generateCertificate(AlgorithmIdentifier keygenAlgorithm);
-};
diff --git a/modules/mediastream/RTCPeerConnectionErrorCallback.idl b/modules/mediastream/RTCPeerConnectionErrorCallback.idl
deleted file mode 100644
index c159a9f..0000000
--- a/modules/mediastream/RTCPeerConnectionErrorCallback.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 The Chromium 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/webrtc-pc/#rtcpeerconnectionerrorcallback
-
-callback interface RTCPeerConnectionErrorCallback {
- void handleEvent(DOMException exception);
-};
-
diff --git a/modules/mediastream/RTCSessionDescription.idl b/modules/mediastream/RTCSessionDescription.idl
deleted file mode 100644
index 6c9f668..0000000
--- a/modules/mediastream/RTCSessionDescription.idl
+++ /dev/null
@@ -1,47 +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:
- *
- * 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 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/webrtc/#idl-def-RTCSessionDescription
-
-enum RTCSdpType {
- "offer",
- "pranswer",
- "answer"
-};
-
-[
- GarbageCollected,
- Constructor(optional RTCSessionDescriptionInit descriptionInitDict)
-] interface RTCSessionDescription {
- attribute RTCSdpType? type;
- attribute DOMString? sdp;
- serializer = {attribute};
-};
-
diff --git a/modules/mediastream/RTCSessionDescriptionCallback.idl b/modules/mediastream/RTCSessionDescriptionCallback.idl
deleted file mode 100644
index 59ffe44..0000000
--- a/modules/mediastream/RTCSessionDescriptionCallback.idl
+++ /dev/null
@@ -1,34 +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:
- *
- * 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 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 RTCSessionDescriptionCallback {
- void handleEvent(RTCSessionDescription sdp);
-};
-
diff --git a/modules/mediastream/RTCSessionDescriptionInit.idl b/modules/mediastream/RTCSessionDescriptionInit.idl
deleted file mode 100644
index ed958e7..0000000
--- a/modules/mediastream/RTCSessionDescriptionInit.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.
-
-// http://www.w3.org/TR/webrtc/#idl-def-RTCSessionDescription
-
-dictionary RTCSessionDescriptionInit {
- RTCSdpType type;
- DOMString sdp;
-};
diff --git a/modules/mediastream/RTCStatsCallback.idl b/modules/mediastream/RTCStatsCallback.idl
deleted file mode 100644
index 8e0c080..0000000
--- a/modules/mediastream/RTCStatsCallback.idl
+++ /dev/null
@@ -1,28 +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:
- * 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. 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 INC. 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.
- */
-
-callback interface RTCStatsCallback {
- void handleEvent(RTCStatsResponse response);
-};
-
diff --git a/modules/mediastream/RTCStatsReport.idl b/modules/mediastream/RTCStatsReport.idl
deleted file mode 100644
index a00ebaa..0000000
--- a/modules/mediastream/RTCStatsReport.idl
+++ /dev/null
@@ -1,34 +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:
- * 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. 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 INC. 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.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject
-] interface RTCStatsReport {
- readonly attribute Date timestamp;
- readonly attribute DOMString id;
- readonly attribute DOMString type;
- DOMString stat(DOMString name);
- sequence<DOMString> names();
-};
diff --git a/modules/mediastream/RTCStatsResponse.idl b/modules/mediastream/RTCStatsResponse.idl
deleted file mode 100644
index 69fd239..0000000
--- a/modules/mediastream/RTCStatsResponse.idl
+++ /dev/null
@@ -1,32 +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:
- * 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. 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 INC. 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.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject
-] interface RTCStatsResponse {
- sequence<RTCStatsReport> result();
- RTCStatsReport namedItem([Default=Undefined] optional DOMString name);
- [NotEnumerable, ImplementedAs=namedItem] getter RTCStatsReport ([Default=Undefined] optional DOMString name);
-};
diff --git a/modules/mediastream/SourceInfo.idl b/modules/mediastream/SourceInfo.idl
deleted file mode 100644
index 60f2419..0000000
--- a/modules/mediastream/SourceInfo.idl
+++ /dev/null
@@ -1,34 +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:
- * 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.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject
-] interface SourceInfo {
- readonly attribute DOMString id;
- readonly attribute DOMString kind;
- readonly attribute DOMString label;
- readonly attribute DOMString facing;
-};
diff --git a/modules/mediastream/URLMediaStream.idl b/modules/mediastream/URLMediaStream.idl
index 334509f..c7f8d34 100644
--- a/modules/mediastream/URLMediaStream.idl
+++ b/modules/mediastream/URLMediaStream.idl
@@ -28,8 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/mediacapture-streams/#idl-def-URL
+// An old version of Media Capture and Streams defines URL.createObjectURL:
+// https://w3c.github.io/mediacapture-main/archives/20131017/getusermedia.html
-partial interface URL {
- [CallWith=ExecutionContext] static DOMString? createObjectURL(MediaStream stream);
+// TODO(foolip): Update link if it's revived in the spec:
+// https://github.com/w3c/mediacapture-main/issues/404
+
+[
+ ImplementedAs=URLMediaStream
+] partial interface URL {
+ [Exposed=(Window,DedicatedWorker,SharedWorker), CallWith=ScriptState] static DOMString createObjectURL(MediaStream stream);
};
diff --git a/modules/mediastream/WindowMediaStream.idl b/modules/mediastream/WindowMediaStream.idl
index fb06a6a..63c2c59 100644
--- a/modules/mediastream/WindowMediaStream.idl
+++ b/modules/mediastream/WindowMediaStream.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- ImplementedAs=DOMWindowMediaStream,
+ ImplementedAs=DOMWindowMediaStream
] partial interface Window {
attribute MediaStreamConstructor webkitMediaStream;
diff --git a/modules/mediastream/testing/InternalsMediaStream.idl b/modules/mediastream/testing/InternalsMediaStream.idl
new file mode 100644
index 0000000..02717c6
--- /dev/null
+++ b/modules/mediastream/testing/InternalsMediaStream.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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=InternalsMediaStream
+] partial interface Internals {
+ [CallWith=ScriptState] Promise<void> addFakeDevice(
+ MediaDeviceInfo deviceInfo,
+ MediaTrackConstraints capabilities,
+ MediaStreamTrack? dataSource);
+};
diff --git a/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl b/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl
deleted file mode 100644
index cc868af..0000000
--- a/modules/navigatorconnect/CrossOriginServiceWorkerClient.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// 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
deleted file mode 100644
index 99f52f8..0000000
--- a/modules/navigatorconnect/NavigatorServices.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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
deleted file mode 100644
index 8cbfeee..0000000
--- a/modules/navigatorconnect/ServicePort.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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
deleted file mode 100644
index bcdc2b0..0000000
--- a/modules/navigatorconnect/ServicePortCollection.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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,
- RuntimeEnabled=NavigatorConnect,
-] 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
deleted file mode 100644
index 27fd436..0000000
--- a/modules/navigatorconnect/ServicePortConnectEvent.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-// 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,
- 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
deleted file mode 100644
index 1afd760..0000000
--- a/modules/navigatorconnect/ServicePortConnectEventInit.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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
deleted file mode 100644
index 4268cb1..0000000
--- a/modules/navigatorconnect/ServicePortConnectOptions.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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
deleted file mode 100644
index ea7e097..0000000
--- a/modules/navigatorconnect/ServicePortConnectResponse.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// 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
deleted file mode 100644
index b596995..0000000
--- a/modules/navigatorconnect/ServicePortMatchOptions.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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
deleted file mode 100644
index fe645ae..0000000
--- a/modules/navigatorconnect/ServiceWorkerGlobalScopeNavigatorConnect.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.
-
-// http://mkruisselbrink.github.io/navigator-connect/#idl-def-ServiceWorkerGlobalScope
-
-[
- RuntimeEnabled=NavigatorConnect,
-] partial interface ServiceWorkerGlobalScope {
- attribute EventHandler oncrossoriginmessage;
-};
diff --git a/modules/navigatorconnect/WorkerNavigatorServices.idl b/modules/navigatorconnect/WorkerNavigatorServices.idl
deleted file mode 100644
index e5e87bd..0000000
--- a/modules/navigatorconnect/WorkerNavigatorServices.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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/navigatorcontentutils/NavigatorContentUtils.idl b/modules/navigatorcontentutils/NavigatorContentUtils.idl
index b5a05db..8bf44a1 100644
--- a/modules/navigatorcontentutils/NavigatorContentUtils.idl
+++ b/modules/navigatorcontentutils/NavigatorContentUtils.idl
@@ -18,8 +18,11 @@
Boston, MA 02110-1301, USA.
*/
-// http://www.w3.org/TR/html5/system-state-and-capabilities.html#custom-handlers
-partial interface Navigator {
+// https://html.spec.whatwg.org/multipage/webappapis.html#custom-handlers
+
+[
+ ImplementedAs=NavigatorContentUtils
+] partial interface Navigator {
[RuntimeEnabled=NavigatorContentUtils, RaisesException] void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
[RuntimeEnabled=CustomSchemeHandler, RaisesException] DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
[RuntimeEnabled=NavigatorContentUtils, RaisesException] void unregisterProtocolHandler(DOMString scheme, DOMString url);
diff --git a/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.idl b/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.idl
index 0d43a95..a8430ed 100644
--- a/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.idl
+++ b/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.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.
-partial interface Internals {
+[
+ ImplementedAs=InternalsNavigatorContentUtils
+] partial interface Internals {
void setNavigatorContentUtilsClientMock(Document document);
};
diff --git a/modules/netinfo/NavigatorNetworkInformation.idl b/modules/netinfo/NavigatorNetworkInformation.idl
index 7d41395..b5857d3 100644
--- a/modules/netinfo/NavigatorNetworkInformation.idl
+++ b/modules/netinfo/NavigatorNetworkInformation.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- RuntimeEnabled=NetworkInformation
+ ImplementedAs=NavigatorNetworkInformation
] partial interface Navigator {
[MeasureAs=NetInfo] readonly attribute NetworkInformation connection;
};
diff --git a/modules/netinfo/NetworkInformation.idl b/modules/netinfo/NetworkInformation.idl
index c45ccdb..90589e3 100644
--- a/modules/netinfo/NetworkInformation.idl
+++ b/modules/netinfo/NetworkInformation.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://wicg.github.io/netinfo/#the-networkinformation-interface
+
enum ConnectionType {
"cellular",
"bluetooth",
@@ -13,17 +15,26 @@
"unknown"
};
-typedef unrestricted double Megabit;
-
-[
- RuntimeEnabled=NetworkInformation,
- Exposed=(Window,Worker),
- GarbageCollected,
- DependentLifetime
-] interface NetworkInformation : EventTarget {
- [MeasureAs=NetInfoType] readonly attribute ConnectionType type;
- [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly attribute Megabit downlinkMax;
- [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnChange] attribute EventHandler onchange;
- [MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange;
+enum EffectiveConnectionType {
+ "slow-2g",
+ "2g",
+ "3g",
+ "4g"
};
+typedef unrestricted double Megabit;
+typedef unsigned long long Milliseconds;
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Exposed=(Window,Worker)
+] interface NetworkInformation : EventTarget {
+ [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoType] readonly attribute ConnectionType type;
+ [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly attribute Megabit downlinkMax;
+ [RuntimeEnabled=NetInfoEffectiveType, MeasureAs=NetInfoOnChange] attribute EventHandler onchange;
+ [RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange;
+ [RuntimeEnabled=NetInfoEffectiveType, MeasureAs=NetInfoEffectiveType] readonly attribute EffectiveConnectionType effectiveType;
+ [RuntimeEnabled=NetInfoRtt, MeasureAs=NetInfoRtt] readonly attribute Milliseconds rtt;
+ [RuntimeEnabled=NetInfoDownlink, MeasureAs=NetInfoDownlink] readonly attribute Megabit downlink;
+};
diff --git a/modules/netinfo/WorkerNavigatorNetworkInformation.idl b/modules/netinfo/WorkerNavigatorNetworkInformation.idl
index b47c770..888d8df 100644
--- a/modules/netinfo/WorkerNavigatorNetworkInformation.idl
+++ b/modules/netinfo/WorkerNavigatorNetworkInformation.idl
@@ -3,8 +3,8 @@
// found in the LICENSE file.
[
- RuntimeEnabled=NetworkInformation,
- Exposed=Worker
+ Exposed=Worker,
+ ImplementedAs=WorkerNavigatorNetworkInformation
] partial interface WorkerNavigator {
- [CallWith=ExecutionContext, MeasureAs=NetInfo] readonly attribute NetworkInformation connection;
+ [CallWith=ScriptState, MeasureAs=NetInfo] readonly attribute NetworkInformation connection;
};
diff --git a/modules/nfc/NFC.idl b/modules/nfc/NFC.idl
index bb0f520..050972f 100644
--- a/modules/nfc/NFC.idl
+++ b/modules/nfc/NFC.idl
@@ -7,11 +7,10 @@
typedef (DOMString or ArrayBuffer or NFCMessage) NFCPushMessage;
[
- GarbageCollected,
- RuntimeEnabled=WebNFC,
+ RuntimeEnabled=WebNFC
] interface NFC {
- [CallWith=ScriptState] Promise<void> push (NFCPushMessage message, optional NFCPushOptions options);
- [CallWith=ScriptState] Promise<void> cancelPush (optional NFCPushTarget target = "any");
- [CallWith=ScriptState] Promise<long> watch (MessageCallback callback, optional NFCWatchOptions options);
- [CallWith=ScriptState] Promise<void> cancelWatch (optional long id);
+ [CallWith=ScriptState, MeasureAs=WebNFCPush] Promise<void> push (NFCPushMessage message, optional NFCPushOptions options);
+ [CallWith=ScriptState, MeasureAs=WebNFCCancelPush] Promise<void> cancelPush (optional NFCPushTarget target = "any");
+ [CallWith=ScriptState, MeasureAs=WebNFCWatch] Promise<long> watch (MessageCallback callback, optional NFCWatchOptions options);
+ [CallWith=ScriptState, MeasureAs=WebNFCCancelWatch] Promise<void> cancelWatch (optional long id);
};
diff --git a/modules/nfc/NFCMessage.idl b/modules/nfc/NFCMessage.idl
index 5cea9c7..de49b5d 100644
--- a/modules/nfc/NFCMessage.idl
+++ b/modules/nfc/NFCMessage.idl
@@ -5,6 +5,6 @@
// https://w3c.github.io/web-nfc/#the-nfcmessage-dictionary
dictionary NFCMessage {
- sequence<NFCRecord> data;
+ sequence<NFCRecord> records;
USVString url;
};
diff --git a/modules/nfc/NavigatorNFC.idl b/modules/nfc/NavigatorNFC.idl
index 1b6d2e6..8fb0fb1 100644
--- a/modules/nfc/NavigatorNFC.idl
+++ b/modules/nfc/NavigatorNFC.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.
-// http://w3c.github.io/web-nfc/
+// https://w3c.github.io/web-nfc/#extensions-to-the-navigator-interface
[
- RuntimeEnabled=WebNFC,
+ ImplementedAs=NavigatorNFC,
+ RuntimeEnabled=WebNFC
] partial interface Navigator {
readonly attribute NFC nfc;
};
diff --git a/modules/notifications/Notification.idl b/modules/notifications/Notification.idl
index 8ad23a1..075c432 100644
--- a/modules/notifications/Notification.idl
+++ b/modules/notifications/Notification.idl
@@ -40,14 +40,14 @@
// https://notifications.spec.whatwg.org/#api
[
- GarbageCollected,
- DependentLifetime,
- Constructor(DOMString title, optional NotificationOptions options),
+ ActiveScriptWrappable,
ConstructorCallWith=ExecutionContext,
+ Constructor(DOMString title, optional NotificationOptions options),
+ DependentLifetime,
Exposed=(Window,Worker),
MeasureAs=NotificationCreated,
RaisesException=Constructor,
- RuntimeEnabled=Notifications,
+ RuntimeEnabled=Notifications
] interface Notification : EventTarget {
[CallWith=ExecutionContext, MeasureAs=NotificationPermission] static readonly attribute NotificationPermission permission;
@@ -65,19 +65,17 @@
readonly attribute DOMString lang;
readonly attribute DOMString body;
readonly attribute DOMString tag;
+ [RuntimeEnabled=NotificationContentImage] readonly attribute USVString image;
readonly attribute USVString icon;
+ readonly attribute USVString badge;
- [RuntimeEnabled=NotificationExperimental] readonly attribute sequence<unsigned long>? vibrate;
+ [SameObject, SaveSameObject] readonly attribute FrozenArray<unsigned long> vibrate;
readonly attribute DOMTimeStamp timestamp;
readonly attribute boolean renotify;
readonly attribute boolean silent;
readonly attribute boolean requireInteraction;
- [CallWith=ScriptState, SameObject] readonly attribute any data;
-
- // TODO(johnme): Ship once Blink supports FrozenArray (https://crbug.com/515920)
- // and we've implemented the additional Object.freeze described in
- // https://notifications.spec.whatwg.org/#dom-notification-actions
- [RuntimeEnabled=NotificationExperimental] readonly attribute sequence<NotificationAction> actions;
+ [CallWith=ScriptState, SameObject, SaveSameObject] readonly attribute any data;
+ [CallWith=ScriptState, SameObject, SaveSameObject] readonly attribute FrozenArray<NotificationAction> actions;
[MeasureAs=NotificationClosed] void close();
};
diff --git a/modules/notifications/NotificationAction.idl b/modules/notifications/NotificationAction.idl
index be78856..4f0ec6c 100644
--- a/modules/notifications/NotificationAction.idl
+++ b/modules/notifications/NotificationAction.idl
@@ -4,8 +4,15 @@
// https://notifications.spec.whatwg.org/#dictdef-notificationaction
+[RuntimeEnabled=NotificationInlineReplies] enum NotificationActionType {
+ "button",
+ "text"
+};
+
dictionary NotificationAction {
+ [RuntimeEnabled=NotificationInlineReplies] NotificationActionType type = "button";
required DOMString action;
required DOMString title;
- [RuntimeEnabled=NotificationActionIcons] USVString icon;
+ USVString icon;
+ [RuntimeEnabled=NotificationInlineReplies] DOMString? placeholder = null;
};
diff --git a/modules/notifications/NotificationEvent.idl b/modules/notifications/NotificationEvent.idl
index 4261777..7490f2a 100644
--- a/modules/notifications/NotificationEvent.idl
+++ b/modules/notifications/NotificationEvent.idl
@@ -7,8 +7,9 @@
[
Constructor(DOMString type, NotificationEventInit eventInitDict),
Exposed=ServiceWorker,
- RuntimeEnabled=Notifications,
+ RuntimeEnabled=Notifications
] interface NotificationEvent : ExtendableEvent {
- readonly attribute Notification notification;
+ [ImplementedAs=getNotification] readonly attribute Notification notification;
readonly attribute DOMString action;
+ [RuntimeEnabled=NotificationInlineReplies] readonly attribute DOMString? reply;
};
diff --git a/modules/notifications/NotificationEventInit.idl b/modules/notifications/NotificationEventInit.idl
index 79ab16b..b1081e3 100644
--- a/modules/notifications/NotificationEventInit.idl
+++ b/modules/notifications/NotificationEventInit.idl
@@ -7,4 +7,5 @@
dictionary NotificationEventInit : ExtendableEventInit {
required Notification notification;
DOMString action = "";
+ [RuntimeEnabled=NotificationInlineReplies] DOMString? reply = "";
};
diff --git a/modules/notifications/NotificationOptions.idl b/modules/notifications/NotificationOptions.idl
index 9b1ded4..40e0cd5 100644
--- a/modules/notifications/NotificationOptions.idl
+++ b/modules/notifications/NotificationOptions.idl
@@ -15,7 +15,9 @@
DOMString lang = "";
DOMString body = "";
DOMString tag = "";
+ [RuntimeEnabled=NotificationContentImage] USVString image;
USVString icon;
+ USVString badge;
// TODO(sh919.park): vibrate should be ([Clamp] unsigned long or sequence<unsigned long>)
(unsigned long or sequence<unsigned long>) vibrate;
DOMTimeStamp timestamp;
diff --git a/modules/notifications/ServiceWorkerGlobalScopeNotifications.idl b/modules/notifications/ServiceWorkerGlobalScopeNotifications.idl
index 45f2c54..725c91b 100644
--- a/modules/notifications/ServiceWorkerGlobalScopeNotifications.idl
+++ b/modules/notifications/ServiceWorkerGlobalScopeNotifications.idl
@@ -5,7 +5,8 @@
// https://notifications.spec.whatwg.org/#service-worker-api
[
- RuntimeEnabled=Notifications,
+ ImplementedAs=ServiceWorkerGlobalScopeNotifications,
+ RuntimeEnabled=Notifications
] partial interface ServiceWorkerGlobalScope {
attribute EventHandler onnotificationclick;
attribute EventHandler onnotificationclose;
diff --git a/modules/notifications/ServiceWorkerRegistrationNotifications.idl b/modules/notifications/ServiceWorkerRegistrationNotifications.idl
index bb5330b..587cb1f 100644
--- a/modules/notifications/ServiceWorkerRegistrationNotifications.idl
+++ b/modules/notifications/ServiceWorkerRegistrationNotifications.idl
@@ -5,7 +5,8 @@
// https://notifications.spec.whatwg.org/#service-worker-api
[
- Exposed=(Window, ServiceWorker),
+ Exposed=(Window,Worker),
+ ImplementedAs=ServiceWorkerRegistrationNotifications,
RuntimeEnabled=Notifications
] partial interface ServiceWorkerRegistration {
[CallWith=ScriptState, RaisesException] Promise showNotification(DOMString title, optional NotificationOptions options);
diff --git a/modules/offscreencanvas/OffscreenCanvasModules.idl b/modules/offscreencanvas/OffscreenCanvasModules.idl
new file mode 100644
index 0000000..081dcd2
--- /dev/null
+++ b/modules/offscreencanvas/OffscreenCanvasModules.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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/scripting.html#the-offscreencanvas-interface
+
+typedef (OffscreenCanvasRenderingContext2D or
+ WebGLRenderingContext or
+ WebGL2RenderingContext) OffscreenRenderingContext;
+enum OffscreenRenderingContextType { "2d", "webgl", "webgl2" };
+
+[
+ ImplementedAs=OffscreenCanvasModules
+] partial interface OffscreenCanvas {
+ [CallWith=ExecutionContext, RaisesException, RuntimeEnabled=ExperimentalCanvasFeatures] OffscreenRenderingContext? getContext(OffscreenRenderingContextType contextType, optional CanvasContextCreationAttributes attributes);
+};
diff --git a/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl b/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl
new file mode 100644
index 0000000..256d375
--- /dev/null
+++ b/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl
@@ -0,0 +1,109 @@
+// Copyright 2016 The Chromium 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/scripting.html#the-offscreen-2d-rendering-context
+
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=ExperimentalCanvasFeatures
+] interface OffscreenCanvasRenderingContext2D {
+ // back-reference to the canvas
+ [ImplementedAs=offscreenCanvasForBinding] readonly attribute OffscreenCanvas canvas;
+
+ [CallWith=ScriptState, RaisesException] Promise commit();
+
+ // state
+ void save(); // push state on state stack
+ void restore(); // pop state stack and restore state
+
+ // transformations (default transform is the identity matrix)
+ void scale(unrestricted double x, unrestricted double y);
+ void rotate(unrestricted double angle);
+ void translate(unrestricted double x, unrestricted double y);
+ void transform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
+ void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
+ void resetTransform();
+
+ // compositing
+ attribute unrestricted double globalAlpha; // (default 1.0)
+ attribute DOMString globalCompositeOperation; // (default source-over)
+ [MeasureAs=Canvas2DFilter]attribute DOMString filter;
+
+ // image smoothing
+ attribute boolean imageSmoothingEnabled; // (default True)
+ [MeasureAs=Canvas2DImageSmoothingQuality] attribute ImageSmoothingQuality imageSmoothingQuality; // (default "low")
+
+ // colors and styles
+ attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
+ attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
+ CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
+ [RaisesException] CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
+ [CallWith=ScriptState, RaisesException] CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType);
+
+ // shadows
+ attribute unrestricted double shadowOffsetX;
+ attribute unrestricted double shadowOffsetY;
+ attribute unrestricted double shadowBlur;
+ attribute DOMString shadowColor;
+
+ // CanvasRect interface
+ void clearRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ void fillRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ void strokeRect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+
+ // Path API (See BaseRenderingContext2D)
+ void beginPath();
+ void fill(optional CanvasFillRule winding);
+ void fill(Path2D path, optional CanvasFillRule winding);
+ void stroke();
+ void stroke(Path2D path);
+ void clip();
+ void clip(Path2D path);
+ boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasFillRule winding);
+ boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, optional CanvasFillRule winding);
+ boolean isPointInStroke(unrestricted double x, unrestricted double y);
+ boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
+
+ // text (see also the CanvasDrawingStyles interface)
+ void fillText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
+ void strokeText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
+ TextMetrics measureText(DOMString text);
+
+ // drawing images
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
+ [CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
+
+ // pixel manipulation
+ [RaisesException] ImageData createImageData(ImageData imagedata);
+ [RaisesException] ImageData createImageData(long sw, long sh);
+ [RaisesException] ImageData getImageData(long sx, long sy, long sw, long sh);
+ [RaisesException] void putImageData(ImageData imagedata, long dx, long dy);
+ [RaisesException] void putImageData(ImageData imagedata, long dx, long dy, long dirtyX, long dirtyY, long dirtyWidth, long dirtyHeight);
+
+ // If OffscreenCanva ships before color managed canvas, this method must remain behind flag.
+ // https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(unsigned long sw, unsigned long sh, ImageDataColorSettings imageDataColorSettings);
+ [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(ImageDataArray data, unsigned long sw, unsigned long sh, ImageDataColorSettings imageDataColorSettings);
+
+
+ // Line caps/joins
+ attribute unrestricted double lineWidth; // (default 1)
+ attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
+ attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
+ attribute unrestricted double miterLimit; // (default 10)
+
+ // dashed lines
+ void setLineDash(sequence<unrestricted double> dash);
+ sequence<unrestricted double> getLineDash();
+ attribute unrestricted double 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")
+};
+
+OffscreenCanvasRenderingContext2D implements CanvasPath;
diff --git a/modules/payments/AbortPaymentEvent.idl b/modules/payments/AbortPaymentEvent.idl
new file mode 100644
index 0000000..e1cd327
--- /dev/null
+++ b/modules/payments/AbortPaymentEvent.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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/w3c/payment-handler/pull/170
+
+[
+ RuntimeEnabled=PaymentApp,
+ Constructor(DOMString type, ExtendableEventInit eventInitDict),
+ Exposed=ServiceWorker
+] interface AbortPaymentEvent : ExtendableEvent {
+ [CallWith=ScriptState, RaisesException] void respondWith(Promise<boolean> paymentAbortedResponse);
+};
diff --git a/modules/payments/AndroidPayMethodData.idl b/modules/payments/AndroidPayMethodData.idl
new file mode 100644
index 0000000..ad52173
--- /dev/null
+++ b/modules/payments/AndroidPayMethodData.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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://developers.google.com/web/fundamentals/getting-started/primers/payment-request/android-pay
+// TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173
+
+dictionary AndroidPayMethodData {
+ DOMString environment;
+ DOMString merchantName;
+ DOMString merchantId;
+ sequence<DOMString> allowedCardNetworks;
+ AndroidPayTokenization paymentMethodTokenizationParameters;
+ DOMString minGooglePlayServicesVersion;
+ long apiVersion;
+};
diff --git a/modules/payments/AndroidPayTokenization.idl b/modules/payments/AndroidPayTokenization.idl
new file mode 100644
index 0000000..dfd7688
--- /dev/null
+++ b/modules/payments/AndroidPayTokenization.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://developers.google.com/web/fundamentals/getting-started/primers/payment-request/android-pay
+// TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173
+
+dictionary AndroidPayTokenization {
+ DOMString tokenizationType;
+ Dictionary parameters;
+};
diff --git a/modules/payments/BasicCardRequest.idl b/modules/payments/BasicCardRequest.idl
new file mode 100644
index 0000000..9bd0aeb
--- /dev/null
+++ b/modules/payments/BasicCardRequest.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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/webpayments-methods-card/#basiccardrequest
+
+enum BasicCardType {
+ "credit",
+ "debit",
+ "prepaid"
+};
+
+dictionary BasicCardRequest {
+ sequence<DOMString> supportedNetworks;
+ sequence<BasicCardType> supportedTypes;
+};
diff --git a/modules/payments/CanMakePaymentEvent.idl b/modules/payments/CanMakePaymentEvent.idl
new file mode 100644
index 0000000..0c49b5a
--- /dev/null
+++ b/modules/payments/CanMakePaymentEvent.idl
@@ -0,0 +1,18 @@
+// Copyright 2017 The Chromium 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/w3c/payment-handler/pull/170
+
+[
+ RuntimeEnabled=PaymentApp,
+ Constructor(DOMString type, CanMakePaymentEventInit eventInitDict),
+ Exposed=ServiceWorker
+] interface CanMakePaymentEvent : ExtendableEvent {
+ readonly attribute USVString topLevelOrigin;
+ readonly attribute USVString paymentRequestOrigin;
+ readonly attribute FrozenArray<PaymentMethodData> methodData;
+ readonly attribute FrozenArray<PaymentDetailsModifier> modifiers;
+
+ [CallWith=ScriptState, RaisesException] void respondWith(Promise<boolean> canMakePaymentResponse);
+};
diff --git a/modules/payments/CanMakePaymentEventInit.idl b/modules/payments/CanMakePaymentEventInit.idl
new file mode 100644
index 0000000..ebb909b
--- /dev/null
+++ b/modules/payments/CanMakePaymentEventInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/w3c/payment-handler/pull/170
+
+dictionary CanMakePaymentEventInit : ExtendableEventInit {
+ USVString topLevelOrigin;
+ USVString paymentRequestOrigin;
+ sequence<PaymentMethodData> methodData;
+ sequence<PaymentDetailsModifier> modifiers;
+};
diff --git a/modules/payments/HTMLIFrameElementPayments.idl b/modules/payments/HTMLIFrameElementPayments.idl
new file mode 100644
index 0000000..7b5bc9b
--- /dev/null
+++ b/modules/payments/HTMLIFrameElementPayments.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentrequest-and-iframes
+
+[
+ ImplementedAs=HTMLIFrameElementPayments,
+ RuntimeEnabled=PaymentRequest
+] partial interface HTMLIFrameElement {
+ [CEReactions, Reflect] attribute boolean allowPaymentRequest;
+};
diff --git a/modules/payments/ImageObject.idl b/modules/payments/ImageObject.idl
new file mode 100644
index 0000000..e8ddb48
--- /dev/null
+++ b/modules/payments/ImageObject.idl
@@ -0,0 +1,13 @@
+// Copyright 2017 The Chromium 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/w3c/payment-handler/pull/174/files/6e6768c423e24719cb0e592cd98614f052e52a78
+
+dictionary ImageObject {
+ // Note that the src could be relative path to the service worker
+ // scope.
+ required USVString src;
+ DOMString sizes;
+ DOMString type;
+};
diff --git a/modules/payments/PaymentAddress.idl b/modules/payments/PaymentAddress.idl
new file mode 100644
index 0000000..8f51485
--- /dev/null
+++ b/modules/payments/PaymentAddress.idl
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentaddress-interface
+
+[
+ RuntimeEnabled=PaymentRequest
+] interface PaymentAddress {
+ serializer = {attribute};
+ readonly attribute DOMString country;
+ readonly attribute FrozenArray<DOMString> addressLine;
+ readonly attribute DOMString region;
+ readonly attribute DOMString city;
+ readonly attribute DOMString dependentLocality;
+ readonly attribute DOMString postalCode;
+ readonly attribute DOMString sortingCode;
+ readonly attribute DOMString languageCode;
+ readonly attribute DOMString organization;
+ readonly attribute DOMString recipient;
+ readonly attribute DOMString phone;
+};
diff --git a/modules/payments/PaymentAppServiceWorkerGlobalScope.idl b/modules/payments/PaymentAppServiceWorkerGlobalScope.idl
new file mode 100644
index 0000000..ae5001e
--- /dev/null
+++ b/modules/payments/PaymentAppServiceWorkerGlobalScope.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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/webpayments-payment-apps-api/#idl-def-serviceworkerglobalscope-partial-1
+
+[
+ ImplementedAs=PaymentAppServiceWorkerGlobalScope,
+ RuntimeEnabled=PaymentApp
+] partial interface ServiceWorkerGlobalScope {
+ attribute EventHandler onabortpayment;
+ attribute EventHandler oncanmakepayment;
+ attribute EventHandler onpaymentrequest;
+};
diff --git a/modules/payments/PaymentAppServiceWorkerRegistration.idl b/modules/payments/PaymentAppServiceWorkerRegistration.idl
new file mode 100644
index 0000000..030c354
--- /dev/null
+++ b/modules/payments/PaymentAppServiceWorkerRegistration.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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/webpayments-payment-apps-api/#idl-def-serviceworkerregistration-partial-1
+
+[
+ ImplementedAs=PaymentAppServiceWorkerRegistration,
+ RuntimeEnabled=PaymentApp
+] partial interface ServiceWorkerRegistration {
+ [CallWith=ScriptState] readonly attribute PaymentManager paymentManager;
+};
diff --git a/modules/payments/PaymentCurrencyAmount.idl b/modules/payments/PaymentCurrencyAmount.idl
new file mode 100644
index 0000000..0f13ffa
--- /dev/null
+++ b/modules/payments/PaymentCurrencyAmount.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentcurrencyamount
+
+dictionary PaymentCurrencyAmount {
+ required DOMString currency;
+ required DOMString value;
+ DOMString currencySystem = "urn:iso:std:iso:4217";
+};
diff --git a/modules/payments/PaymentDetailsBase.idl b/modules/payments/PaymentDetailsBase.idl
new file mode 100644
index 0000000..4b85564
--- /dev/null
+++ b/modules/payments/PaymentDetailsBase.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/browser-payment-api/#paymentdetailsbase-dictionary
+
+dictionary PaymentDetailsBase {
+ sequence<PaymentItem> displayItems;
+ sequence<PaymentShippingOption> shippingOptions;
+ sequence<PaymentDetailsModifier> modifiers;
+};
diff --git a/modules/payments/PaymentDetailsInit.idl b/modules/payments/PaymentDetailsInit.idl
new file mode 100644
index 0000000..9a784e3
--- /dev/null
+++ b/modules/payments/PaymentDetailsInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/browser-payment-api/#paymentdetailsinit-dictionary
+
+dictionary PaymentDetailsInit : PaymentDetailsBase {
+ DOMString id;
+ required PaymentItem total;
+};
diff --git a/modules/payments/PaymentDetailsModifier.idl b/modules/payments/PaymentDetailsModifier.idl
new file mode 100644
index 0000000..0da69ce
--- /dev/null
+++ b/modules/payments/PaymentDetailsModifier.idl
@@ -0,0 +1,20 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#idl-def-paymentdetailsmodifier
+
+dictionary PaymentDetailsModifier {
+ // TODO(zino): The supportedMethods's type was changed from
+ // sequence<DOMString> to DOMString[1][2]. But we are not sure if we can
+ // remove them now. So, we will define it as union type of DOMString and
+ // sequence<DOMString> temporarily for now.
+ // Please see: https://crbug.com/754779
+ //
+ // [1] https://github.com/w3c/browser-payment-api/pull/551
+ // [2] https://w3c.github.io/browser-payment-api/#paymentdetailsmodifier-dictionary
+ required (DOMString or sequence<DOMString>) supportedMethods;
+ PaymentItem total;
+ sequence<PaymentItem> additionalDisplayItems;
+ [RuntimeEnabled=PaymentDetailsModifierData] object data;
+};
diff --git a/modules/payments/PaymentDetailsUpdate.idl b/modules/payments/PaymentDetailsUpdate.idl
new file mode 100644
index 0000000..73d0fcd
--- /dev/null
+++ b/modules/payments/PaymentDetailsUpdate.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/browser-payment-api/#paymentdetailsupdate-dictionary
+
+dictionary PaymentDetailsUpdate : PaymentDetailsBase {
+ DOMString error;
+ PaymentItem total;
+};
diff --git a/modules/payments/PaymentHandlerResponse.idl b/modules/payments/PaymentHandlerResponse.idl
new file mode 100644
index 0000000..0327bd0
--- /dev/null
+++ b/modules/payments/PaymentHandlerResponse.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/payment-handler/#paymenthandlerresponse-dictionary
+
+dictionary PaymentHandlerResponse {
+ DOMString methodName;
+ object details;
+};
diff --git a/modules/payments/PaymentInstrument.idl b/modules/payments/PaymentInstrument.idl
new file mode 100644
index 0000000..ad09a33
--- /dev/null
+++ b/modules/payments/PaymentInstrument.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/payment-handler/#paymentinstrument-dictionary
+
+dictionary PaymentInstrument {
+ required DOMString name;
+ sequence<ImageObject> icons;
+ sequence<DOMString> enabledMethods;
+ object capabilities;
+};
diff --git a/modules/payments/PaymentInstruments.idl b/modules/payments/PaymentInstruments.idl
new file mode 100644
index 0000000..53cdad9
--- /dev/null
+++ b/modules/payments/PaymentInstruments.idl
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium 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/webpayments-payment-apps-api/#payment-instruments
+
+[
+ RuntimeEnabled=PaymentApp,
+ Exposed=(Window,Worker)
+] interface PaymentInstruments {
+ [CallWith=ScriptState, ImplementedAs=deleteInstrument] Promise<boolean> delete(DOMString instrumentKey);
+ [CallWith=ScriptState] Promise<PaymentInstrument> get(DOMString instrumentKey);
+ [CallWith=ScriptState] Promise<sequence<DOMString>> keys();
+ [CallWith=ScriptState] Promise<boolean> has(DOMString instrumentKey);
+ [CallWith=ScriptState, RaisesException] Promise<void> set(DOMString instrumentKey, PaymentInstrument details);
+ [CallWith=ScriptState] Promise<void> clear();
+};
diff --git a/modules/payments/PaymentItem.idl b/modules/payments/PaymentItem.idl
new file mode 100644
index 0000000..48b92d9
--- /dev/null
+++ b/modules/payments/PaymentItem.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentitem-dictionary
+
+dictionary PaymentItem {
+ required DOMString label;
+ required PaymentCurrencyAmount amount;
+ boolean pending = false;
+};
diff --git a/modules/payments/PaymentManager.idl b/modules/payments/PaymentManager.idl
new file mode 100644
index 0000000..414659b
--- /dev/null
+++ b/modules/payments/PaymentManager.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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/webpayments-payment-apps-api/#idl-def-paymentappmanager
+
+[
+ RuntimeEnabled=PaymentApp,
+ ConstructorCallWith=ExecutionContext,
+ DependentLifetime
+] interface PaymentManager {
+ readonly attribute PaymentInstruments instruments;
+ attribute DOMString userHint;
+};
diff --git a/modules/payments/PaymentMethodData.idl b/modules/payments/PaymentMethodData.idl
new file mode 100644
index 0000000..4cd8cfc
--- /dev/null
+++ b/modules/payments/PaymentMethodData.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#idl-def-paymentmethoddata
+
+dictionary PaymentMethodData {
+ // TODO(zino): The supportedMethods's type was changed from
+ // sequence<DOMString> to DOMString[1][2]. But we are not sure if we can
+ // remove them now. So, we will define it as union type of DOMString and
+ // sequence<DOMString> temporarily for now.
+ // Please see: https://crbug.com/754779
+ //
+ // [1] https://github.com/w3c/browser-payment-api/pull/551
+ // [2] https://w3c.github.io/browser-payment-api/#paymentdetailsmodifier-dictionary
+ required (DOMString or sequence<DOMString>) supportedMethods;
+ object data;
+};
diff --git a/modules/payments/PaymentOptions.idl b/modules/payments/PaymentOptions.idl
new file mode 100644
index 0000000..9520cf1
--- /dev/null
+++ b/modules/payments/PaymentOptions.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentoptions-dictionary
+
+enum PaymentShippingType {
+ "shipping",
+ "delivery",
+ "pickup"
+};
+
+dictionary PaymentOptions {
+ boolean requestPayerName = false;
+ boolean requestPayerEmail = false;
+ boolean requestPayerPhone = false;
+ boolean requestShipping = false;
+ PaymentShippingType shippingType = "shipping";
+};
diff --git a/modules/payments/PaymentRequest.idl b/modules/payments/PaymentRequest.idl
new file mode 100644
index 0000000..20f5cc3
--- /dev/null
+++ b/modules/payments/PaymentRequest.idl
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentrequest-interface
+// http://crbug.com/587995
+
+[
+ RuntimeEnabled=PaymentRequest,
+ Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ ActiveScriptWrappable,
+ DependentLifetime
+] interface PaymentRequest : EventTarget {
+ [CallWith=ScriptState] Promise<PaymentResponse> show();
+ [CallWith=ScriptState] Promise<void> abort();
+ [CallWith=ScriptState] Promise<boolean> canMakePayment();
+
+ readonly attribute DOMString id;
+ [ImplementedAs=getShippingAddress] readonly attribute PaymentAddress? shippingAddress;
+ readonly attribute DOMString? shippingOption;
+ readonly attribute PaymentShippingType? shippingType;
+
+ attribute EventHandler onshippingaddresschange;
+ attribute EventHandler onshippingoptionchange;
+};
diff --git a/modules/payments/PaymentRequestEvent.idl b/modules/payments/PaymentRequestEvent.idl
new file mode 100644
index 0000000..4e375c8
--- /dev/null
+++ b/modules/payments/PaymentRequestEvent.idl
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium 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/payment-handler/#the-paymentrequestevent
+
+[
+ RuntimeEnabled=PaymentApp,
+ Constructor(DOMString type, PaymentRequestEventInit eventInitDict),
+ Exposed=ServiceWorker
+] interface PaymentRequestEvent : ExtendableEvent {
+ readonly attribute USVString topLevelOrigin;
+ readonly attribute USVString paymentRequestOrigin;
+ readonly attribute DOMString paymentRequestId;
+ readonly attribute FrozenArray<PaymentMethodData> methodData;
+ [CallWith=ScriptState] readonly attribute object total;
+ readonly attribute FrozenArray<PaymentDetailsModifier> modifiers;
+ readonly attribute DOMString instrumentKey;
+
+ [CallWith=ScriptState] Promise<WindowClient?> openWindow(USVString url);
+ [CallWith=ScriptState, RaisesException] void respondWith(Promise<PaymentResponse> response);
+};
diff --git a/modules/payments/PaymentRequestEventInit.idl b/modules/payments/PaymentRequestEventInit.idl
new file mode 100644
index 0000000..9404171
--- /dev/null
+++ b/modules/payments/PaymentRequestEventInit.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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/payment-handler/#paymentrequesteventinit-dictionary
+
+dictionary PaymentRequestEventInit : ExtendableEventInit {
+ USVString topLevelOrigin;
+ USVString paymentRequestOrigin;
+ DOMString paymentRequestId;
+ sequence<PaymentMethodData> methodData;
+ PaymentCurrencyAmount total;
+ sequence<PaymentDetailsModifier> modifiers;
+ DOMString instrumentKey;
+};
diff --git a/modules/payments/PaymentRequestUpdateEvent.idl b/modules/payments/PaymentRequestUpdateEvent.idl
new file mode 100644
index 0000000..c3aed3a
--- /dev/null
+++ b/modules/payments/PaymentRequestUpdateEvent.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#idl-def-paymentrequestupdateevent
+
+[
+ RuntimeEnabled=PaymentRequest,
+ Constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict),
+ ConstructorCallWith=ExecutionContext
+] interface PaymentRequestUpdateEvent : Event {
+ [CallWith=ScriptState,RaisesException] void updateWith(Promise<PaymentDetailsUpdate> detailsPromise);
+};
diff --git a/modules/payments/PaymentRequestUpdateEventInit.idl b/modules/payments/PaymentRequestUpdateEventInit.idl
new file mode 100644
index 0000000..f6eb356
--- /dev/null
+++ b/modules/payments/PaymentRequestUpdateEventInit.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#idl-def-paymentrequestupdateevent
+
+dictionary PaymentRequestUpdateEventInit : EventInit {
+};
diff --git a/modules/payments/PaymentResponse.idl b/modules/payments/PaymentResponse.idl
new file mode 100644
index 0000000..8a5bb93
--- /dev/null
+++ b/modules/payments/PaymentResponse.idl
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium 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/payment-request/#dom-paymentcomplete
+
+enum PaymentComplete {
+ "fail",
+ "success",
+ "unknown"
+};
+
+// https://w3c.github.io/browser-payment-api/#paymentresponse-interface
+
+[
+ RuntimeEnabled=PaymentRequest
+] interface PaymentResponse {
+ serializer = {attribute};
+
+ readonly attribute DOMString requestId;
+ readonly attribute DOMString methodName;
+ readonly attribute DOMString? payerName;
+ readonly attribute DOMString? payerEmail;
+ readonly attribute DOMString? payerPhone;
+ [CallWith=ScriptState, RaisesException] readonly attribute object details;
+ readonly attribute PaymentAddress? shippingAddress;
+ readonly attribute DOMString? shippingOption;
+
+ [CallWith=ScriptState] Promise<void> complete(optional PaymentComplete paymentResult = "unknown");
+};
diff --git a/modules/payments/PaymentShippingOption.idl b/modules/payments/PaymentShippingOption.idl
new file mode 100644
index 0000000..cf99041
--- /dev/null
+++ b/modules/payments/PaymentShippingOption.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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/browser-payment-api/#paymentshippingoption-dictionary
+
+dictionary PaymentShippingOption {
+ required DOMString id;
+ required DOMString label;
+ required PaymentCurrencyAmount amount;
+ boolean selected = false;
+};
diff --git a/modules/peerconnection/RTCAnswerOptions.idl b/modules/peerconnection/RTCAnswerOptions.idl
new file mode 100644
index 0000000..a92204a
--- /dev/null
+++ b/modules/peerconnection/RTCAnswerOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#offer-answer-options
+
+dictionary RTCAnswerOptions : RTCOfferAnswerOptions {
+};
diff --git a/modules/peerconnection/RTCCertificate.idl b/modules/peerconnection/RTCCertificate.idl
new file mode 100644
index 0000000..cc4210a
--- /dev/null
+++ b/modules/peerconnection/RTCCertificate.idl
@@ -0,0 +1,36 @@
+/*
+ * 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 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 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/webrtc-pc/#rtccertificate-interface
+interface RTCCertificate {
+ // The expiration time in ms relative to epoch, 1970-01-01T00:00:00Z.
+ readonly attribute DOMTimeStamp expires;
+ sequence<RTCDtlsFingerprint> getFingerprints();
+};
diff --git a/modules/peerconnection/RTCConfiguration.idl b/modules/peerconnection/RTCConfiguration.idl
new file mode 100644
index 0000000..3daa5c3
--- /dev/null
+++ b/modules/peerconnection/RTCConfiguration.idl
@@ -0,0 +1,42 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#rtcicetransportpolicy-enum
+
+enum RTCIceTransportPolicy {
+ "relay",
+ "all"
+};
+
+// https://w3c.github.io/webrtc-pc/#rtcbundlepolicy-enum
+
+enum RTCBundlePolicy {
+ "balanced",
+ "max-compat",
+ "max-bundle"
+};
+
+// https://w3c.github.io/webrtc-pc/#rtcrtcpmuxpolicy-enum
+
+enum RTCRtcpMuxPolicy {
+ "negotiate",
+ "require"
+};
+
+// https://w3c.github.io/webrtc-pc/#rtcconfiguration-dictionary
+
+dictionary RTCConfiguration {
+ sequence<RTCIceServer> iceServers;
+ // TODO(foolip): |iceTransportPolicy| default should be "all", but it is
+ // omitted to allow fallback to |iceTransports| if not specified.
+ RTCIceTransportPolicy iceTransportPolicy;
+ // TODO(foolip): |iceTransports| is not in the spec.
+ // https://crbug.com/659131
+ RTCIceTransportPolicy iceTransports;
+ RTCBundlePolicy bundlePolicy = "balanced";
+ RTCRtcpMuxPolicy rtcpMuxPolicy = "require";
+ // TODO(foolip): DOMString peerIdentity;
+ sequence<RTCCertificate> certificates;
+ [EnforceRange] octet iceCandidatePoolSize = 0;
+};
diff --git a/modules/peerconnection/RTCDTMFSender.idl b/modules/peerconnection/RTCDTMFSender.idl
new file mode 100644
index 0000000..790e0ce
--- /dev/null
+++ b/modules/peerconnection/RTCDTMFSender.idl
@@ -0,0 +1,39 @@
+/*
+ * 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:
+ * 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.
+ */
+
+[
+ NoInterfaceObject,
+ DependentLifetime
+] interface RTCDTMFSender : EventTarget {
+ readonly attribute boolean canInsertDTMF;
+ readonly attribute MediaStreamTrack track;
+ readonly attribute DOMString toneBuffer;
+ readonly attribute long duration;
+ readonly attribute long interToneGap;
+
+ [RaisesException] void insertDTMF(DOMString tones, optional long duration, optional long interToneGap);
+
+ attribute EventHandler ontonechange;
+};
diff --git a/modules/peerconnection/RTCDTMFToneChangeEvent.idl b/modules/peerconnection/RTCDTMFToneChangeEvent.idl
new file mode 100644
index 0000000..c162262
--- /dev/null
+++ b/modules/peerconnection/RTCDTMFToneChangeEvent.idl
@@ -0,0 +1,33 @@
+/*
+ * 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:
+ * 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.
+ */
+
+// https://w3c.github.io/webrtc-pc/#rtcdtmftonechangeevent
+
+[
+ NoInterfaceObject,
+ Constructor(DOMString type, RTCDTMFToneChangeEventInit eventInitDict)
+] interface RTCDTMFToneChangeEvent : Event {
+ readonly attribute DOMString tone;
+};
diff --git a/modules/peerconnection/RTCDTMFToneChangeEventInit.idl b/modules/peerconnection/RTCDTMFToneChangeEventInit.idl
new file mode 100644
index 0000000..82b8213
--- /dev/null
+++ b/modules/peerconnection/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.
+
+// https://w3c.github.io/webrtc-pc/#rtcdtmftonechangeevent
+
+dictionary RTCDTMFToneChangeEventInit : EventInit {
+ DOMString tone;
+};
diff --git a/modules/peerconnection/RTCDataChannel.idl b/modules/peerconnection/RTCDataChannel.idl
new file mode 100644
index 0000000..406eb05
--- /dev/null
+++ b/modules/peerconnection/RTCDataChannel.idl
@@ -0,0 +1,68 @@
+/*
+ * 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:
+ * 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. 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 INC. 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.
+ */
+
+// https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate
+
+enum RTCDataChannelState {
+ "connecting",
+ "open",
+ "closing",
+ "closed"
+};
+
+// https://w3c.github.io/webrtc-pc/#rtcdatachannel
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime
+] interface RTCDataChannel : EventTarget {
+ readonly attribute USVString label;
+ readonly attribute boolean ordered;
+ // TODO(foolip): |maxRetransmitTime| is called |maxPacketLifeTime| in the
+ // spec and both it and |maxRetransmits| are nullable.
+ [Measure] readonly attribute unsigned short maxRetransmitTime;
+ [Measure] readonly attribute unsigned short maxRetransmits;
+ readonly attribute USVString protocol;
+ readonly attribute boolean negotiated;
+ readonly attribute unsigned short id;
+ readonly attribute RTCDataChannelState readyState;
+ readonly attribute unsigned long bufferedAmount;
+ attribute unsigned long bufferedAmountLowThreshold;
+ attribute EventHandler onopen;
+ attribute EventHandler onbufferedamountlow;
+ attribute EventHandler onerror;
+ attribute EventHandler onclose;
+ void close();
+ attribute EventHandler onmessage;
+ [RaisesException=Setter] attribute DOMString binaryType;
+ // TODO(foolip): |data| should be USVString.
+ [RaisesException] void send(DOMString data);
+ [RaisesException] void send(Blob data);
+ [RaisesException] void send(ArrayBuffer data);
+ [RaisesException] void send(ArrayBufferView data);
+
+ // Non-standard APIs
+ [Measure] readonly attribute boolean reliable;
+};
diff --git a/modules/peerconnection/RTCDataChannelEvent.idl b/modules/peerconnection/RTCDataChannelEvent.idl
new file mode 100644
index 0000000..6ba2684
--- /dev/null
+++ b/modules/peerconnection/RTCDataChannelEvent.idl
@@ -0,0 +1,32 @@
+/*
+ * 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:
+ * 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. 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 INC. 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.
+ */
+
+// https://w3c.github.io/webrtc-pc/#rtcdatachannelevent
+
+[
+ Constructor(DOMString type, RTCDataChannelEventInit eventInitDict)
+] interface RTCDataChannelEvent : Event {
+ readonly attribute RTCDataChannel channel;
+};
diff --git a/modules/peerconnection/RTCDataChannelEventInit.idl b/modules/peerconnection/RTCDataChannelEventInit.idl
new file mode 100644
index 0000000..ac9bef8
--- /dev/null
+++ b/modules/peerconnection/RTCDataChannelEventInit.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#idl-def-rtcdatachanneleventinit
+
+dictionary RTCDataChannelEventInit : EventInit {
+ required RTCDataChannel channel;
+};
diff --git a/modules/peerconnection/RTCDataChannelInit.idl b/modules/peerconnection/RTCDataChannelInit.idl
new file mode 100644
index 0000000..6ecbe84
--- /dev/null
+++ b/modules/peerconnection/RTCDataChannelInit.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#idl-def-rtcdatachannelinit
+
+dictionary RTCDataChannelInit {
+ boolean ordered = true;
+ // TODO(guidou): Rename |maxRetransmitTime| to |maxPacketLifeTime|.
+ // https://crbug.com/696681
+ unsigned short maxRetransmitTime;
+ unsigned short maxRetransmits;
+ USVString protocol = "";
+ boolean negotiated = false;
+ [EnforceRange] unsigned short id;
+};
diff --git a/modules/peerconnection/RTCDtlsFingerprint.idl b/modules/peerconnection/RTCDtlsFingerprint.idl
new file mode 100644
index 0000000..6299ba7
--- /dev/null
+++ b/modules/peerconnection/RTCDtlsFingerprint.idl
@@ -0,0 +1,9 @@
+// Copyright 2017 The Chromium 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/webrtc-pc/#rtcdtlsfingerprint*
+dictionary RTCDtlsFingerprint {
+ DOMString algorithm;
+ DOMString value;
+};
diff --git a/modules/peerconnection/RTCIceCandidate.idl b/modules/peerconnection/RTCIceCandidate.idl
new file mode 100644
index 0000000..be3173e
--- /dev/null
+++ b/modules/peerconnection/RTCIceCandidate.idl
@@ -0,0 +1,40 @@
+/*
+ * 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:
+ *
+ * 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 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.
+ */
+
+[
+ Constructor(RTCIceCandidateInit candidateInitDict),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor
+] interface RTCIceCandidate {
+ attribute DOMString candidate;
+ attribute DOMString sdpMid;
+ attribute unsigned short sdpMLineIndex;
+ serializer = {attribute};
+};
diff --git a/modules/peerconnection/RTCIceCandidateInit.idl b/modules/peerconnection/RTCIceCandidateInit.idl
new file mode 100644
index 0000000..76c5bc1
--- /dev/null
+++ b/modules/peerconnection/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.
+
+// https://w3c.github.io/webrtc-pc/#idl-def-rtcicecandidateinit
+
+dictionary RTCIceCandidateInit {
+ DOMString candidate;
+ DOMString sdpMid;
+ unsigned short sdpMLineIndex;
+};
diff --git a/modules/peerconnection/RTCIceServer.idl b/modules/peerconnection/RTCIceServer.idl
new file mode 100644
index 0000000..038af94
--- /dev/null
+++ b/modules/peerconnection/RTCIceServer.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#rtciceserver-dictionary
+
+dictionary RTCIceServer {
+ // TODO(foolip): |urls| should be required and |url| is not in the spec.
+ // https://crbug.com/659133
+ (DOMString or sequence<DOMString>) urls;
+ DOMString url;
+ DOMString username;
+ DOMString credential;
+ // TODO(foolip): RTCIceCredentialType credentialType = "password";
+};
diff --git a/modules/peerconnection/RTCLegacyStatsReport.idl b/modules/peerconnection/RTCLegacyStatsReport.idl
new file mode 100644
index 0000000..79a28e3
--- /dev/null
+++ b/modules/peerconnection/RTCLegacyStatsReport.idl
@@ -0,0 +1,34 @@
+/*
+ * 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:
+ * 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. 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 INC. 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.
+ */
+
+[
+ NoInterfaceObject
+] interface RTCLegacyStatsReport {
+ readonly attribute Date timestamp;
+ readonly attribute DOMString id;
+ readonly attribute DOMString type;
+ DOMString stat(DOMString name);
+ sequence<DOMString> names();
+};
diff --git a/modules/peerconnection/RTCOfferAnswerOptions.idl b/modules/peerconnection/RTCOfferAnswerOptions.idl
new file mode 100644
index 0000000..26f98a3
--- /dev/null
+++ b/modules/peerconnection/RTCOfferAnswerOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#offer-answer-options
+
+dictionary RTCOfferAnswerOptions {
+ boolean voiceActivityDetection = true;
+};
diff --git a/modules/peerconnection/RTCOfferOptions.idl b/modules/peerconnection/RTCOfferOptions.idl
new file mode 100644
index 0000000..7075df0
--- /dev/null
+++ b/modules/peerconnection/RTCOfferOptions.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#offer-answer-options
+
+dictionary RTCOfferOptions : RTCOfferAnswerOptions {
+ boolean iceRestart = false;
+
+ // TODO(guidou): Deprecate the offerToReceive fields depending on the
+ // outcome of https://github.com/w3c/webrtc-pc/issues/709
+ long offerToReceiveVideo;
+ long offerToReceiveAudio;
+};
diff --git a/modules/peerconnection/RTCPeerConnection.idl b/modules/peerconnection/RTCPeerConnection.idl
new file mode 100644
index 0000000..aec6dc4
--- /dev/null
+++ b/modules/peerconnection/RTCPeerConnection.idl
@@ -0,0 +1,142 @@
+/*
+ * 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:
+ *
+ * 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 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/webrtc-pc/#state-definitions
+
+enum RTCSignalingState {
+ "stable",
+ "have-local-offer",
+ "have-remote-offer",
+ "have-local-pranswer",
+ "have-remote-pranswer",
+ "closed"
+};
+
+enum RTCIceGatheringState {
+ "new",
+ "gathering",
+ "complete"
+};
+
+enum RTCIceConnectionState {
+ "new",
+ "checking",
+ "connected",
+ "completed",
+ "failed",
+ "disconnected",
+ "closed"
+};
+
+// https://w3c.github.io/webrtc-pc/#interface-definition
+
+// TODO(guidou): Many types are of the wrong type in this interface:
+// * Dictionary -> specific dictionary types like RTCConfiguration
+// * VoidCallback -> VoidFunction
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ // TODO(guidou): There should only be one constructor argument.
+ Constructor(optional RTCConfiguration configuration, optional Dictionary mediaConstraints),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor
+] interface RTCPeerConnection : EventTarget {
+ [CallWith=ScriptState] Promise<RTCSessionDescription> createOffer(optional RTCOfferOptions options);
+ [CallWith=ScriptState] Promise<RTCSessionDescription> createAnswer(optional RTCAnswerOptions options);
+ [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescriptionInit description);
+ readonly attribute RTCSessionDescription? localDescription;
+ // readonly attribute RTCSessionDescription? currentLocalDescription;
+ // readonly attribute RTCSessionDescription? pendingLocalDescription;
+ [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescriptionInit description);
+ readonly attribute RTCSessionDescription? remoteDescription;
+ // readonly attribute RTCSessionDescription? currentRemoteDescription;
+ // readonly attribute RTCSessionDescription? pendingRemoteDescription;
+ [CallWith=ScriptState, MeasureAs=RTCPeerConnectionAddIceCandidatePromise] Promise<void> addIceCandidate ((RTCIceCandidateInit or RTCIceCandidate) candidate);
+ readonly attribute RTCSignalingState signalingState;
+ readonly attribute RTCIceGatheringState iceGatheringState;
+ readonly attribute RTCIceConnectionState iceConnectionState;
+ // readonly attribute boolean? canTrickleIceCandidates;
+ // RTCConfiguration getConfiguration();
+ [CallWith=ScriptState, RaisesException] void setConfiguration(RTCConfiguration configuration);
+ void close();
+ attribute EventHandler onnegotiationneeded;
+ attribute EventHandler onicecandidate;
+ attribute EventHandler onsignalingstatechange;
+ attribute EventHandler oniceconnectionstatechange;
+ attribute EventHandler onicegatheringstatechange;
+
+ // https://w3c.github.io/webrtc-pc/#legacy-interface-extensions
+ // These methods return Promise<void> because having Promise-based versions requires that all overloads return Promises.
+ [CallWith=ScriptState, RaisesException] Promise<void> createOffer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Dictionary rtcOfferOptions);
+ // TODO(guidou): There should be no mediaConstraints argument.
+ [CallWith=ScriptState] Promise<void> createAnswer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional Dictionary mediaConstraints);
+ [CallWith=ScriptState] Promise<void> setLocalDescription(RTCSessionDescriptionInit description, VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
+ // TODO(guidou): The failureCallback argument should be non-optional.
+ [CallWith=ScriptState] Promise<void> setRemoteDescription(RTCSessionDescriptionInit description, VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
+ [CallWith=ScriptState, MeasureAs=RTCPeerConnectionAddIceCandidateLegacy] Promise<void> addIceCandidate((RTCIceCandidateInit or RTCIceCandidate) candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
+
+ // TODO(guidou): The selector argument should the first (nullable,
+ // non-optional) argument, and there should be a third failureCallback
+ // argument.
+ [CallWith=ScriptState, LegacyInterfaceTypeChecking] Promise<void> getStats(RTCStatsCallback successCallback, optional MediaStreamTrack? selector);
+ // TODO(hbos): The spec has an optional |selector| argument that is not
+ // supported yet. There is a discussion about what to do with it (clarify
+ // spec, remove it or change it?): https://github.com/w3c/webrtc-stats/issues/116
+ [CallWith=ScriptState] Promise<RTCStatsReport> getStats();
+
+ // RTP Media API
+ // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-getsenders
+ [RuntimeEnabled=RTCRtpSender] sequence<RTCRtpSender> getSenders();
+ // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-getreceivers
+ sequence<RTCRtpReceiver> getReceivers();
+ // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtrack
+ [RuntimeEnabled=RTCRtpSender, RaisesException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
+ // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-removetrack
+ [RuntimeEnabled=RTCRtpSender, RaisesException] void removeTrack(RTCRtpSender sender);
+ // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-ontrack
+ [RuntimeEnabled=RTCRtpSender] attribute EventHandler ontrack;
+
+ // https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api
+ [CallWith=ScriptState, RaisesException] RTCDataChannel createDataChannel(USVString label, optional RTCDataChannelInit dataChannelDict);
+ attribute EventHandler ondatachannel;
+
+ // Certificate management
+ // https://w3c.github.io/webrtc-pc/#sec.cert-mgmt
+ [RaisesException, CallWith=ScriptState] static Promise<RTCCertificate> generateCertificate(AlgorithmIdentifier keygenAlgorithm);
+
+ // Non-standard or removed from the spec:
+ [Measure] sequence<MediaStream> getLocalStreams();
+ [Measure] sequence<MediaStream> getRemoteStreams();
+ [Measure, CallWith=ScriptState, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints);
+ [Measure, RaisesException] void removeStream(MediaStream? stream);
+ [Measure, RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track);
+ attribute EventHandler onaddstream;
+ attribute EventHandler onremovestream;
+};
diff --git a/modules/peerconnection/RTCPeerConnectionErrorCallback.idl b/modules/peerconnection/RTCPeerConnectionErrorCallback.idl
new file mode 100644
index 0000000..f42696d
--- /dev/null
+++ b/modules/peerconnection/RTCPeerConnectionErrorCallback.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#rtcpeerconnectionerrorcallback
+
+callback interface RTCPeerConnectionErrorCallback {
+ void handleEvent(DOMException exception);
+};
diff --git a/modules/peerconnection/RTCPeerConnectionIceEvent.idl b/modules/peerconnection/RTCPeerConnectionIceEvent.idl
new file mode 100644
index 0000000..a5440dd
--- /dev/null
+++ b/modules/peerconnection/RTCPeerConnectionIceEvent.idl
@@ -0,0 +1,32 @@
+/*
+ * 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:
+ * 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. 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 INC. 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.
+ */
+
+[
+ Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict)
+] interface RTCPeerConnectionIceEvent : Event {
+ readonly attribute RTCIceCandidate? candidate;
+ // TODO(loonybear): add nullable url attribute here:
+ // https://rawgit.com/w3c/webrtc-pc/master/webrtc.html#rtcpeerconnectioniceevent
+};
diff --git a/modules/peerconnection/RTCPeerConnectionIceEventInit.idl b/modules/peerconnection/RTCPeerConnectionIceEventInit.idl
new file mode 100644
index 0000000..7b18b69
--- /dev/null
+++ b/modules/peerconnection/RTCPeerConnectionIceEventInit.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#rtcpeerconnectioniceeventinit
+
+dictionary RTCPeerConnectionIceEventInit : EventInit {
+ RTCIceCandidate? candidate;
+ // TODO(loonybear): add url attribute.
+ // DOMString? url;
+};
diff --git a/modules/peerconnection/RTCRtpContributingSource.idl b/modules/peerconnection/RTCRtpContributingSource.idl
new file mode 100644
index 0000000..0a0ff1f
--- /dev/null
+++ b/modules/peerconnection/RTCRtpContributingSource.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/webrtc-pc/#dom-rtcrtpcontributingsource
+interface RTCRtpContributingSource {
+ readonly attribute DOMHighResTimeStamp timestamp;
+ readonly attribute unsigned long source;
+
+ // TODO(hbos): Support every member of the spec. https://crbug.com/705993
+};
diff --git a/modules/peerconnection/RTCRtpReceiver.idl b/modules/peerconnection/RTCRtpReceiver.idl
new file mode 100644
index 0000000..c4cb2d6
--- /dev/null
+++ b/modules/peerconnection/RTCRtpReceiver.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/webrtc-pc/#rtcrtpreceiver-interface
+interface RTCRtpReceiver {
+ readonly attribute MediaStreamTrack track;
+ sequence<RTCRtpContributingSource> getContributingSources();
+
+ // TODO(hbos): Support every member of the spec. https://crbug.com/700916
+};
diff --git a/modules/peerconnection/RTCRtpSender.idl b/modules/peerconnection/RTCRtpSender.idl
new file mode 100644
index 0000000..6718c79
--- /dev/null
+++ b/modules/peerconnection/RTCRtpSender.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/webrtc-pc/#rtcrtpsender-interface
+[
+ RuntimeEnabled=RTCRtpSender
+] interface RTCRtpSender {
+ readonly attribute MediaStreamTrack? track;
+ // TODO(hbos): Implement the rest of RTCRtpSender, https://crbug.com/700916.
+};
diff --git a/modules/peerconnection/RTCSessionDescription.idl b/modules/peerconnection/RTCSessionDescription.idl
new file mode 100644
index 0000000..00b6ca1
--- /dev/null
+++ b/modules/peerconnection/RTCSessionDescription.idl
@@ -0,0 +1,49 @@
+/*
+ * 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:
+ *
+ * 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 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/webrtc-pc/#rtcsessiondescription-class
+
+enum RTCSdpType {
+ "offer",
+ "pranswer",
+ "answer"
+ // TODO(foolip): "rollback" is in the spec and Gecko's IDL.
+};
+
+[
+ Constructor(optional RTCSessionDescriptionInit descriptionInitDict),
+ ConstructorCallWith=ExecutionContext
+] interface RTCSessionDescription {
+ // TODO(foolip): |type| and |sdp| should be readonly and not nullable.
+ // https://crbug.com/662898
+ [Measure] attribute RTCSdpType? type;
+ [Measure] attribute DOMString? sdp;
+ serializer = {attribute};
+};
diff --git a/modules/peerconnection/RTCSessionDescriptionCallback.idl b/modules/peerconnection/RTCSessionDescriptionCallback.idl
new file mode 100644
index 0000000..5bf268e
--- /dev/null
+++ b/modules/peerconnection/RTCSessionDescriptionCallback.idl
@@ -0,0 +1,33 @@
+/*
+ * 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:
+ *
+ * 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 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 RTCSessionDescriptionCallback {
+ void handleEvent(RTCSessionDescription sdp);
+};
diff --git a/modules/peerconnection/RTCSessionDescriptionInit.idl b/modules/peerconnection/RTCSessionDescriptionInit.idl
new file mode 100644
index 0000000..4baebd3
--- /dev/null
+++ b/modules/peerconnection/RTCSessionDescriptionInit.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/webrtc-pc/#rtcsessiondescription-class
+
+dictionary RTCSessionDescriptionInit {
+ // TODO(foolip): |type| should be required. https://crbug.com/662898
+ RTCSdpType type;
+ DOMString sdp;
+};
diff --git a/modules/peerconnection/RTCStatsCallback.idl b/modules/peerconnection/RTCStatsCallback.idl
new file mode 100644
index 0000000..acbecb2
--- /dev/null
+++ b/modules/peerconnection/RTCStatsCallback.idl
@@ -0,0 +1,28 @@
+/*
+ * 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:
+ * 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. 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 INC. 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.
+ */
+
+callback interface RTCStatsCallback {
+ void handleEvent(RTCStatsResponse response);
+};
diff --git a/modules/peerconnection/RTCStatsReport.idl b/modules/peerconnection/RTCStatsReport.idl
new file mode 100644
index 0000000..3b9f98a
--- /dev/null
+++ b/modules/peerconnection/RTCStatsReport.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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/webrtc-pc/#rtcstatsreport-object
+interface RTCStatsReport {
+ readonly maplike<DOMString, object>;
+};
diff --git a/modules/peerconnection/RTCStatsResponse.idl b/modules/peerconnection/RTCStatsResponse.idl
new file mode 100644
index 0000000..641ca05
--- /dev/null
+++ b/modules/peerconnection/RTCStatsResponse.idl
@@ -0,0 +1,32 @@
+/*
+ * 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:
+ * 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. 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 INC. 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.
+ */
+
+[
+ NoInterfaceObject
+] interface RTCStatsResponse {
+ sequence<RTCLegacyStatsReport> result();
+ RTCLegacyStatsReport namedItem([Default=Undefined] optional DOMString name);
+ [NotEnumerable, ImplementedAs=namedItem] getter RTCLegacyStatsReport ([Default=Undefined] optional DOMString name);
+};
diff --git a/modules/peerconnection/RTCTrackEvent.idl b/modules/peerconnection/RTCTrackEvent.idl
new file mode 100644
index 0000000..d9dd31c
--- /dev/null
+++ b/modules/peerconnection/RTCTrackEvent.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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/webrtc-pc/#rtctrackevent
+[
+ RuntimeEnabled=RTCRtpSender,
+ Constructor(DOMString type, RTCTrackEventInit eventInitDict)
+] interface RTCTrackEvent : Event {
+ readonly attribute RTCRtpReceiver receiver;
+ readonly attribute MediaStreamTrack track;
+ [SameObject]
+ readonly attribute FrozenArray<MediaStream> streams;
+ // TODO(hbos): When RTCRtpTransceiver is supported, add:
+ // readonly attribute RTCRtpTransceiver transceiver;
+};
diff --git a/modules/peerconnection/RTCTrackEventInit.idl b/modules/peerconnection/RTCTrackEventInit.idl
new file mode 100644
index 0000000..74d6c43
--- /dev/null
+++ b/modules/peerconnection/RTCTrackEventInit.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/webrtc-pc/#rtctrackevent
+dictionary RTCTrackEventInit : EventInit {
+ required RTCRtpReceiver receiver;
+ required MediaStreamTrack track;
+ sequence<MediaStream> streams = [];
+ // TODO(hbos): When RTCRtpTransceiver is supported, add:
+ // required RTCRtpTransceiver transceiver;
+};
diff --git a/modules/peerconnection/testing/InternalsRTCCertificate.idl b/modules/peerconnection/testing/InternalsRTCCertificate.idl
new file mode 100644
index 0000000..c61cf2a
--- /dev/null
+++ b/modules/peerconnection/testing/InternalsRTCCertificate.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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=InternalsRTCCertificate
+] partial interface Internals {
+ boolean rtcCertificateEquals(RTCCertificate a, RTCCertificate b);
+};
diff --git a/modules/permissions/NavigatorPermissions.idl b/modules/permissions/NavigatorPermissions.idl
index 1735096..45c5e4f 100644
--- a/modules/permissions/NavigatorPermissions.idl
+++ b/modules/permissions/NavigatorPermissions.idl
@@ -7,6 +7,7 @@
[
Exposed=(Window),
+ ImplementedAs=NavigatorPermissions,
RuntimeEnabled=Permissions
] partial interface Navigator {
readonly attribute Permissions permissions;
diff --git a/modules/permissions/PermissionDescriptor.idl b/modules/permissions/PermissionDescriptor.idl
index 22e1725..3ce943f 100644
--- a/modules/permissions/PermissionDescriptor.idl
+++ b/modules/permissions/PermissionDescriptor.idl
@@ -6,7 +6,13 @@
"geolocation",
"midi",
"notifications",
- "push"
+ "push",
+ "background-sync",
+ "ambient-light-sensor",
+ "accelerometer",
+ "gyroscope",
+ "magnetometer",
+ "accessibility-events",
};
// The PermissionDescriptor dictionary is a base to describe permissions. Some
diff --git a/modules/permissions/PermissionStatus.idl b/modules/permissions/PermissionStatus.idl
index e62fa89..b4c2940 100644
--- a/modules/permissions/PermissionStatus.idl
+++ b/modules/permissions/PermissionStatus.idl
@@ -12,10 +12,10 @@
};
[
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
Exposed=(Window,Worker),
- RuntimeEnabled=Permissions,
+ RuntimeEnabled=Permissions
] interface PermissionStatus : EventTarget {
readonly attribute PermissionState state;
attribute EventHandler onchange;
diff --git a/modules/permissions/Permissions.idl b/modules/permissions/Permissions.idl
index 9f2306a..121b762 100644
--- a/modules/permissions/Permissions.idl
+++ b/modules/permissions/Permissions.idl
@@ -7,7 +7,6 @@
[
Exposed=(Window,Worker),
- GarbageCollected,
RuntimeEnabled=Permissions
] interface Permissions {
[CallWith=ScriptState, Measure] Promise<PermissionStatus> query(Dictionary permission);
diff --git a/modules/permissions/PushPermissionDescriptor.idl b/modules/permissions/PushPermissionDescriptor.idl
index 952743d..2cf1afb 100644
--- a/modules/permissions/PushPermissionDescriptor.idl
+++ b/modules/permissions/PushPermissionDescriptor.idl
@@ -3,6 +3,6 @@
// found in the LICENSE file.
dictionary PushPermissionDescriptor : PermissionDescriptor {
- // See https://w3c.github.io/push-api/.
+ // https://w3c.github.io/push-api/#pushsubscriptionoptions-interface-and-dictionary
boolean userVisibleOnly = false;
};
diff --git a/modules/permissions/WorkerNavigatorPermissions.idl b/modules/permissions/WorkerNavigatorPermissions.idl
index 917433a..f73ad6b 100644
--- a/modules/permissions/WorkerNavigatorPermissions.idl
+++ b/modules/permissions/WorkerNavigatorPermissions.idl
@@ -7,6 +7,7 @@
[
Exposed=(Worker),
+ ImplementedAs=WorkerNavigatorPermissions,
RuntimeEnabled=Permissions
] partial interface WorkerNavigator {
readonly attribute Permissions permissions;
diff --git a/modules/plugins/MimeType.idl b/modules/plugins/MimeType.idl
index e70959e..213765e 100644
--- a/modules/plugins/MimeType.idl
+++ b/modules/plugins/MimeType.idl
@@ -19,7 +19,6 @@
*/
[
- GarbageCollected,
ImplementedAs=DOMMimeType
] interface MimeType {
readonly attribute DOMString type;
@@ -27,4 +26,3 @@
readonly attribute DOMString description;
readonly attribute Plugin enabledPlugin;
};
-
diff --git a/modules/plugins/MimeTypeArray.idl b/modules/plugins/MimeTypeArray.idl
index 9e583c7..1a59dcf 100644
--- a/modules/plugins/MimeTypeArray.idl
+++ b/modules/plugins/MimeTypeArray.idl
@@ -19,12 +19,10 @@
*/
[
- GarbageCollected,
- ImplementedAs=DOMMimeTypeArray
+ ImplementedAs=DOMMimeTypeArray,
+ LegacyUnenumerableNamedProperties
] interface MimeTypeArray {
readonly attribute unsigned long length;
- getter MimeType item([Default=Undefined] optional unsigned long index);
- MimeType namedItem([Default=Undefined] optional DOMString name);
- [NotEnumerable, ImplementedAs=namedItem] getter MimeType ([Default=Undefined] optional DOMString name);
+ getter MimeType? item(unsigned long index);
+ getter MimeType? namedItem(DOMString name);
};
-
diff --git a/modules/plugins/NavigatorPlugins.idl b/modules/plugins/NavigatorPlugins.idl
index 97b209a..8c2ee1d 100644
--- a/modules/plugins/NavigatorPlugins.idl
+++ b/modules/plugins/NavigatorPlugins.idl
@@ -3,7 +3,9 @@
// found in the LICENSE file.
// https://html.spec.whatwg.org/multipage/webappapis.html#navigatorplugins
-partial interface Navigator {
+[
+ ImplementedAs=NavigatorPlugins
+] partial interface Navigator {
readonly attribute PluginArray plugins;
readonly attribute MimeTypeArray mimeTypes;
boolean javaEnabled();
diff --git a/modules/plugins/Plugin.idl b/modules/plugins/Plugin.idl
index 94a9a88..2a8136c 100644
--- a/modules/plugins/Plugin.idl
+++ b/modules/plugins/Plugin.idl
@@ -18,16 +18,16 @@
Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/multipage/webappapis.html#plugins-2
+
[
- GarbageCollected,
- ImplementedAs=DOMPlugin
+ ImplementedAs=DOMPlugin,
+ LegacyUnenumerableNamedProperties
] interface Plugin {
readonly attribute DOMString name;
readonly attribute DOMString filename;
readonly attribute DOMString description;
readonly attribute unsigned long length;
- getter MimeType item([Default=Undefined] optional unsigned long index);
- MimeType namedItem([Default=Undefined] optional DOMString name);
- [NotEnumerable, ImplementedAs=namedItem] getter MimeType ([Default=Undefined] optional DOMString name);
+ getter MimeType? item(unsigned long index);
+ getter MimeType? namedItem(DOMString name);
};
-
diff --git a/modules/plugins/PluginArray.idl b/modules/plugins/PluginArray.idl
index c0a5abb..8b744aa 100644
--- a/modules/plugins/PluginArray.idl
+++ b/modules/plugins/PluginArray.idl
@@ -18,14 +18,14 @@
Boston, MA 02110-1301, USA.
*/
+// https://html.spec.whatwg.org/multipage/webappapis.html#plugins-2
+
[
- GarbageCollected,
- ImplementedAs=DOMPluginArray
+ ImplementedAs=DOMPluginArray,
+ LegacyUnenumerableNamedProperties
] interface PluginArray {
readonly attribute unsigned long length;
- getter Plugin item([Default=Undefined] optional unsigned long index);
- Plugin namedItem([Default=Undefined] optional DOMString name);
- [NotEnumerable, ImplementedAs=namedItem] getter Plugin ([Default=Undefined] optional DOMString name);
+ getter Plugin? item(unsigned long index);
+ getter Plugin? namedItem(DOMString name);
void refresh([Default=Undefined] optional boolean reload);
};
-
diff --git a/modules/presentation/NavigatorPresentation.idl b/modules/presentation/NavigatorPresentation.idl
index 2056380..7b0799a 100644
--- a/modules/presentation/NavigatorPresentation.idl
+++ b/modules/presentation/NavigatorPresentation.idl
@@ -5,6 +5,7 @@
// https://w3c.github.io/presentation-api/#interface-navigatorpresentation
[
+ ImplementedAs=NavigatorPresentation,
RuntimeEnabled=Presentation
] partial interface Navigator {
[SameObject] readonly attribute Presentation presentation;
diff --git a/modules/presentation/Presentation.idl b/modules/presentation/Presentation.idl
index 968abde..2305de7 100644
--- a/modules/presentation/Presentation.idl
+++ b/modules/presentation/Presentation.idl
@@ -5,11 +5,10 @@
// https://w3c.github.io/presentation-api/#interface-presentation
[
- GarbageCollected,
RuntimeEnabled=Presentation
] interface Presentation {
[MeasureAs=PresentationDefaultRequest] attribute PresentationRequest? defaultRequest;
// This API is available on the receiving browsing context.
- [RuntimeEnabled=PresentationReceiver, SameObject] readonly attribute PresentationReceiver? receiver;
+ [SameObject] readonly attribute PresentationReceiver? receiver;
};
diff --git a/modules/presentation/PresentationAvailability.idl b/modules/presentation/PresentationAvailability.idl
index a1c72cb..90e2b56 100644
--- a/modules/presentation/PresentationAvailability.idl
+++ b/modules/presentation/PresentationAvailability.idl
@@ -5,9 +5,9 @@
// https://w3c.github.io/presentation-api/#interface-presentationavailability
[
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
- RuntimeEnabled=Presentation,
+ RuntimeEnabled=Presentation
] interface PresentationAvailability : EventTarget {
readonly attribute boolean value;
attribute EventHandler onchange;
diff --git a/modules/presentation/PresentationConnection.idl b/modules/presentation/PresentationConnection.idl
index 0210567..9b6138f 100644
--- a/modules/presentation/PresentationConnection.idl
+++ b/modules/presentation/PresentationConnection.idl
@@ -11,14 +11,13 @@
};
[
- GarbageCollected,
RuntimeEnabled=Presentation
] interface PresentationConnection : EventTarget {
- readonly attribute DOMString? id;
+ readonly attribute USVString id;
+ readonly attribute USVString url;
readonly attribute PresentationConnectionState state;
[MeasureAs=PresentationConnectionClose] void close();
[MeasureAs=PresentationConnectionTerminate] void terminate();
- [DeprecateAs=PresentationConnectionStateChangeEventListener] attribute EventHandler onstatechange;
attribute EventHandler onconnect;
attribute EventHandler onclose;
attribute EventHandler onterminate;
diff --git a/modules/presentation/PresentationConnectionCloseEvent.idl b/modules/presentation/PresentationConnectionCloseEvent.idl
index 88f004b..c742216 100644
--- a/modules/presentation/PresentationConnectionCloseEvent.idl
+++ b/modules/presentation/PresentationConnectionCloseEvent.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://w3c.github.io/presentation-api/#interface-presentationconnectioncloseevent
+// https://w3c.github.io/presentation-api/#interface-presentationconnectioncloseevent
enum PresentationConnectionCloseReason { "error", "closed", "wentaway" };
diff --git a/modules/presentation/PresentationConnectionList.idl b/modules/presentation/PresentationConnectionList.idl
new file mode 100644
index 0000000..6e1fe7e
--- /dev/null
+++ b/modules/presentation/PresentationConnectionList.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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-presentationconnectionlist
+
+interface PresentationConnectionList : EventTarget {
+ readonly attribute FrozenArray<PresentationConnection> connections;
+ attribute EventHandler onconnectionavailable;
+};
diff --git a/modules/presentation/PresentationReceiver.idl b/modules/presentation/PresentationReceiver.idl
index 4039cec..0058b57 100644
--- a/modules/presentation/PresentationReceiver.idl
+++ b/modules/presentation/PresentationReceiver.idl
@@ -2,14 +2,8 @@
// 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-presentation
+// https://w3c.github.io/presentation-api/#idl-def-presentationreceiver
-[
- GarbageCollected,
- RuntimeEnabled=PresentationReceiver
-] interface PresentationReceiver : EventTarget {
- [CallWith=ScriptState] Promise<PresentationConnection> getConnection();
- [CallWith=ScriptState] Promise<sequence<PresentationConnection>> getConnections();
-
- attribute EventHandler onconnectionavailable;
+interface PresentationReceiver {
+ [SameObject, CallWith=ScriptState] readonly attribute Promise<PresentationConnectionList> connectionList;
};
diff --git a/modules/presentation/PresentationRequest.idl b/modules/presentation/PresentationRequest.idl
index dc92159..9b2c951 100644
--- a/modules/presentation/PresentationRequest.idl
+++ b/modules/presentation/PresentationRequest.idl
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(mlamouri): double-check link after spec changes have landed.
// https://w3c.github.io/presentation-api/#interface-presentationrequest
[
- Constructor(DOMString url),
+ ActiveScriptWrappable,
ConstructorCallWith=ExecutionContext,
- RaisesException=Constructor,
+ Constructor(USVString url),
+ Constructor(sequence<USVString> urls),
DependentLifetime,
- GarbageCollected,
- RuntimeEnabled=Presentation,
- MeasureAs=PresentationRequestConstructor
+ MeasureAs=PresentationRequestConstructor,
+ RaisesException=Constructor,
+ RuntimeEnabled=Presentation
] interface PresentationRequest : EventTarget {
[CallWith=ScriptState, MeasureAs=PresentationRequestStart] Promise<PresentationConnection> start();
[CallWith=ScriptState, MeasureAs=PresentationRequestReconnect] Promise<PresentationConnection> reconnect(DOMString id);
diff --git a/modules/push_messaging/PushEvent.idl b/modules/push_messaging/PushEvent.idl
index aa6d116..28a1cdc 100644
--- a/modules/push_messaging/PushEvent.idl
+++ b/modules/push_messaging/PushEvent.idl
@@ -7,7 +7,7 @@
[
Constructor(DOMString type, optional PushEventInit eventInitDict),
Exposed=ServiceWorker,
- RuntimeEnabled=PushMessaging,
+ RuntimeEnabled=PushMessaging
] interface PushEvent : ExtendableEvent {
- [RuntimeEnabled=PushMessagingData] readonly attribute PushMessageData data;
+ readonly attribute PushMessageData? data;
};
diff --git a/modules/push_messaging/PushManager.idl b/modules/push_messaging/PushManager.idl
index ddb6139..1441123 100644
--- a/modules/push_messaging/PushManager.idl
+++ b/modules/push_messaging/PushManager.idl
@@ -5,11 +5,13 @@
// https://w3c.github.io/push-api/#pushmanager-interface
[
- Exposed=(Window,ServiceWorker),
- GarbageCollected,
- RuntimeEnabled=PushMessaging,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=PushMessaging
] interface PushManager {
- [CallWith=ScriptState] Promise<PushSubscription> subscribe(optional PushSubscriptionOptions options);
+ [SameObject, SaveSameObject]
+ static readonly attribute FrozenArray<DOMString> supportedContentEncodings;
+
+ [CallWith=ScriptState, RaisesException] Promise<PushSubscription> subscribe(optional PushSubscriptionOptionsInit options);
[CallWith=ScriptState] Promise<PushSubscription?> getSubscription();
- [CallWith=ScriptState] Promise permissionState(optional PushSubscriptionOptions options);
+ [CallWith=ScriptState, RaisesException] Promise permissionState(optional PushSubscriptionOptionsInit options);
};
diff --git a/modules/push_messaging/PushMessageData.idl b/modules/push_messaging/PushMessageData.idl
index 9af96db..6385558 100644
--- a/modules/push_messaging/PushMessageData.idl
+++ b/modules/push_messaging/PushMessageData.idl
@@ -2,14 +2,10 @@
// 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;
+// https://w3c.github.io/push-api/#pushmessagedata-interface
[
- Exposed=ServiceWorker,
- GarbageCollected,
- RuntimeEnabled=PushMessagingData,
+ Exposed=ServiceWorker
] interface PushMessageData {
ArrayBuffer arrayBuffer();
Blob blob();
diff --git a/modules/push_messaging/PushSubscription.idl b/modules/push_messaging/PushSubscription.idl
index 469bd8c..9304c02 100644
--- a/modules/push_messaging/PushSubscription.idl
+++ b/modules/push_messaging/PushSubscription.idl
@@ -10,13 +10,14 @@
};
[
- Exposed=(Window,ServiceWorker),
- GarbageCollected,
- RuntimeEnabled=PushMessaging,
+ Exposed=(Window,Worker),
+ RuntimeEnabled=PushMessaging
] interface PushSubscription {
readonly attribute USVString endpoint;
+ readonly attribute DOMTimeStamp? expirationTime;
+ [SameObject] readonly attribute PushSubscriptionOptions options;
- [RuntimeEnabled=PushMessagingData] ArrayBuffer? getKey(PushEncryptionKeyName name);
+ ArrayBuffer? getKey(PushEncryptionKeyName name);
[CallWith=ScriptState] Promise<boolean> unsubscribe();
serializer;
diff --git a/modules/push_messaging/PushSubscriptionOptions.idl b/modules/push_messaging/PushSubscriptionOptions.idl
index f034242..16d2076 100644
--- a/modules/push_messaging/PushSubscriptionOptions.idl
+++ b/modules/push_messaging/PushSubscriptionOptions.idl
@@ -4,6 +4,10 @@
// https://w3c.github.io/push-api/#idl-def-PushSubscriptionOptions
-dictionary PushSubscriptionOptions {
- boolean userVisibleOnly = false;
+[
+ Exposed=(Window,Worker),
+ RuntimeEnabled=PushMessaging
+] interface PushSubscriptionOptions {
+ readonly attribute boolean userVisibleOnly;
+ [SameObject] readonly attribute ArrayBuffer? applicationServerKey;
};
diff --git a/modules/push_messaging/PushSubscriptionOptionsInit.idl b/modules/push_messaging/PushSubscriptionOptionsInit.idl
new file mode 100644
index 0000000..7201018
--- /dev/null
+++ b/modules/push_messaging/PushSubscriptionOptionsInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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-PushSubscriptionOptionsInit
+
+dictionary PushSubscriptionOptionsInit {
+ boolean userVisibleOnly = false;
+ BufferSource? applicationServerKey = null;
+};
diff --git a/modules/push_messaging/ServiceWorkerGlobalScopePush.idl b/modules/push_messaging/ServiceWorkerGlobalScopePush.idl
index 3395b3d..cc7848a 100644
--- a/modules/push_messaging/ServiceWorkerGlobalScopePush.idl
+++ b/modules/push_messaging/ServiceWorkerGlobalScopePush.idl
@@ -3,7 +3,8 @@
// found in the LICENSE file.
[
- RuntimeEnabled=PushMessaging,
+ ImplementedAs=ServiceWorkerGlobalScopePush,
+ RuntimeEnabled=PushMessaging
] partial interface ServiceWorkerGlobalScope {
attribute EventHandler onpush;
};
diff --git a/modules/push_messaging/ServiceWorkerRegistrationPush.idl b/modules/push_messaging/ServiceWorkerRegistrationPush.idl
index 06e1cfd..51f9fd7 100644
--- a/modules/push_messaging/ServiceWorkerRegistrationPush.idl
+++ b/modules/push_messaging/ServiceWorkerRegistrationPush.idl
@@ -5,8 +5,9 @@
// https://w3c.github.io/push-api/#extensions-to-the-serviceworkerregistration-interface
[
- Exposed=(Window, ServiceWorker),
- RuntimeEnabled=PushMessaging,
+ Exposed=(Window,Worker),
+ ImplementedAs=ServiceWorkerRegistrationPush,
+ RuntimeEnabled=PushMessaging
] partial interface ServiceWorkerRegistration {
readonly attribute PushManager pushManager;
};
diff --git a/modules/quota/DOMError.idl b/modules/quota/DOMError.idl
new file mode 100644
index 0000000..cd62ea7
--- /dev/null
+++ b/modules/quota/DOMError.idl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 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.
+ * 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.
+ */
+
+// https://dom.spec.whatwg.org/#domerror
+
+// FIXME: DOMError has been removed from the spec. crbug.com/460725
+[
+ Constructor(DOMString name, optional DOMString message = null),
+ Measure
+] interface DOMError {
+ [Measure] readonly attribute DOMString name;
+ [Measure] readonly attribute DOMString message;
+};
diff --git a/modules/quota/DeprecatedStorageInfo.idl b/modules/quota/DeprecatedStorageInfo.idl
index c69dcbc..cb59d9f 100644
--- a/modules/quota/DeprecatedStorageInfo.idl
+++ b/modules/quota/DeprecatedStorageInfo.idl
@@ -24,12 +24,11 @@
*/
[
- GarbageCollected,
NoInterfaceObject
] interface DeprecatedStorageInfo {
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
- [CallWith=ExecutionContext] void queryUsageAndQuota(unsigned short storageType, optional StorageUsageCallback usageCallback, optional StorageErrorCallback errorCallback);
- [CallWith=ExecutionContext] void requestQuota(unsigned short storageType, unsigned long long newQuotaInBytes, optional StorageQuotaCallback quotaCallback, optional StorageErrorCallback errorCallback);
+ [Measure, CallWith=ScriptState] void queryUsageAndQuota(unsigned short storageType, optional StorageUsageCallback usageCallback, optional StorageErrorCallback errorCallback);
+ [Measure, CallWith=ScriptState] void requestQuota(unsigned short storageType, unsigned long long newQuotaInBytes, optional StorageQuotaCallback quotaCallback, optional StorageErrorCallback errorCallback);
};
diff --git a/modules/quota/DeprecatedStorageQuota.idl b/modules/quota/DeprecatedStorageQuota.idl
index 1562bc4..fc8e356 100644
--- a/modules/quota/DeprecatedStorageQuota.idl
+++ b/modules/quota/DeprecatedStorageQuota.idl
@@ -24,9 +24,8 @@
*/
[
- GarbageCollected,
NoInterfaceObject
] interface DeprecatedStorageQuota {
- [CallWith=ExecutionContext] void queryUsageAndQuota(StorageUsageCallback usageCallback, optional StorageErrorCallback errorCallback);
- [CallWith=ExecutionContext] void requestQuota(unsigned long long newQuotaInBytes, optional StorageQuotaCallback quotaCallback, optional StorageErrorCallback errorCallback);
+ [Measure, CallWith=ScriptState] void queryUsageAndQuota(StorageUsageCallback usageCallback, optional StorageErrorCallback errorCallback);
+ [Measure, CallWith=ScriptState] void requestQuota(unsigned long long newQuotaInBytes, optional StorageQuotaCallback quotaCallback, optional StorageErrorCallback errorCallback);
};
diff --git a/modules/quota/NavigatorStorageQuota.idl b/modules/quota/NavigatorStorageQuota.idl
index 26483d3..e8bd4d5 100644
--- a/modules/quota/NavigatorStorageQuota.idl
+++ b/modules/quota/NavigatorStorageQuota.idl
@@ -17,16 +17,15 @@
* Boston, MA 02110-1301, USA.
*/
-// This partial interface is a merge of three different partial interfaces
+// This partial interface is a merge of two different partial interfaces
// related to storage.
-partial interface Navigator {
+[
+ ImplementedAs=NavigatorStorageQuota
+] partial interface Navigator {
// http://www.w3.org/TR/2012/WD-quota-api-20120703/#idl-def-StorageQuotaEnvironment
[MeasureAs=PrefixedStorageQuota] readonly attribute DeprecatedStorageQuota webkitTemporaryStorage;
[MeasureAs=PrefixedStorageQuota] readonly attribute DeprecatedStorageQuota webkitPersistentStorage;
- // http://www.w3.org/TR/2015/WD-quota-api-20150409/#accessing-storagequota-interface
- [RuntimeEnabled=QuotaPromise] readonly attribute StorageQuota storageQuota;
-
// https://storage.spec.whatwg.org/#api
- [RuntimeEnabled=DurableStorage] readonly attribute StorageManager storage;
+ [SecureContext] readonly attribute StorageManager storage;
};
diff --git a/modules/quota/StorageEstimate.idl b/modules/quota/StorageEstimate.idl
new file mode 100644
index 0000000..3b38d01
--- /dev/null
+++ b/modules/quota/StorageEstimate.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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://storage.spec.whatwg.org/#api
+
+dictionary StorageEstimate {
+ unsigned long long usage;
+ unsigned long long quota;
+};
diff --git a/modules/quota/StorageInfo.idl b/modules/quota/StorageInfo.idl
deleted file mode 100644
index 112f4a4..0000000
--- a/modules/quota/StorageInfo.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.
- */
-
-[
- GarbageCollected,
- NoInterfaceObject,
- RuntimeEnabled=QuotaPromise
-] interface StorageInfo {
- readonly attribute unsigned long long usage;
- readonly attribute unsigned long long quota;
-};
diff --git a/modules/quota/StorageManager.idl b/modules/quota/StorageManager.idl
index 7d48dac..0fb919d 100644
--- a/modules/quota/StorageManager.idl
+++ b/modules/quota/StorageManager.idl
@@ -4,15 +4,12 @@
// https://storage.spec.whatwg.org/#storagemanager
-enum PersistentStoragePermission { "default", "denied", "granted" };
-
+// TODO(jsbell): Should have [SecureContext] on interface
[
- Exposed=(Window,Worker),
- GarbageCollected,
- RuntimeEnabled=DurableStorage,
+ Exposed=(Window,Worker)
] interface StorageManager {
- [Exposed=Window, CallWith=ScriptState] Promise<boolean> requestPersistent();
- [CallWith=ScriptState] Promise<PersistentStoragePermission> persistentPermission();
+ [CallWith=ScriptState, MeasureAs=DurableStoragePersisted] Promise<boolean> persisted();
+ [Exposed=Window, CallWith=ScriptState, MeasureAs=DurableStoragePersist] Promise<boolean> persist();
- // TODO(dgrogan): Implement estimate() and persistentEstimate().
+ [CallWith=ScriptState, MeasureAs=DurableStorageEstimate] Promise<StorageEstimate> estimate();
};
diff --git a/modules/quota/StorageQuota.idl b/modules/quota/StorageQuota.idl
deleted file mode 100644
index 1cfb28a..0000000
--- a/modules/quota/StorageQuota.idl
+++ /dev/null
@@ -1,44 +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.
- */
-
-enum StorageType {
- "temporary",
- "persistent"
-};
-
-[
- GarbageCollected,
- NoInterfaceObject,
- RuntimeEnabled=QuotaPromise
-] interface StorageQuota {
- readonly attribute StorageType[] supportedTypes;
- [CallWith=ScriptState] Promise queryInfo(StorageType type);
- [CallWith=ScriptState] Promise requestPersistentQuota([Clamp] unsigned long long newQuota);
-};
diff --git a/modules/quota/WindowQuota.idl b/modules/quota/WindowQuota.idl
index 5d14c0b..786bc1b 100644
--- a/modules/quota/WindowQuota.idl
+++ b/modules/quota/WindowQuota.idl
@@ -24,7 +24,7 @@
*/
[
- ImplementedAs=DOMWindowQuota,
+ ImplementedAs=DOMWindowQuota
] partial interface Window {
[DeprecateAs=PrefixedStorageInfo] readonly attribute DeprecatedStorageInfo webkitStorageInfo;
};
diff --git a/modules/quota/WorkerNavigatorStorageQuota.idl b/modules/quota/WorkerNavigatorStorageQuota.idl
index cb14bb6..0acd78e 100644
--- a/modules/quota/WorkerNavigatorStorageQuota.idl
+++ b/modules/quota/WorkerNavigatorStorageQuota.idl
@@ -17,13 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
-// This partial interface is a merge of two different partial interfaces
-// related to storage.
-partial interface WorkerNavigator {
- // http://www.w3.org/TR/2012/WD-quota-api-20120703/#idl-def-StorageQuotaEnvironment
- [MeasureAs=PrefixedStorageQuota] readonly attribute DeprecatedStorageQuota webkitTemporaryStorage;
- [MeasureAs=PrefixedStorageQuota] readonly attribute DeprecatedStorageQuota webkitPersistentStorage;
-
+[
+ ImplementedAs=WorkerNavigatorStorageQuota
+] partial interface WorkerNavigator {
// https://storage.spec.whatwg.org/#api
- [RuntimeEnabled=DurableStorage] readonly attribute StorageManager storage;
+ [SecureContext] readonly attribute StorageManager storage;
};
diff --git a/modules/remoteplayback/HTMLMediaElementRemotePlayback.idl b/modules/remoteplayback/HTMLMediaElementRemotePlayback.idl
index 87e23c7..d9ef231 100644
--- a/modules/remoteplayback/HTMLMediaElementRemotePlayback.idl
+++ b/modules/remoteplayback/HTMLMediaElementRemotePlayback.idl
@@ -4,6 +4,9 @@
// https://w3c.github.io/remote-playback/#extension-to-the-htmlmediaelement
-partial interface HTMLMediaElement {
- [Reflect] attribute boolean disableRemotePlayback;
+[
+ ImplementedAs=HTMLMediaElementRemotePlayback
+] partial interface HTMLMediaElement {
+ [RuntimeEnabled=RemotePlayback] readonly attribute RemotePlayback remote;
+ [CEReactions, Reflect, RuntimeEnabled=RemotePlayback] attribute boolean disableRemotePlayback;
};
diff --git a/modules/remoteplayback/RemotePlayback.idl b/modules/remoteplayback/RemotePlayback.idl
new file mode 100644
index 0000000..6c328a8
--- /dev/null
+++ b/modules/remoteplayback/RemotePlayback.idl
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium 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/remote-playback/#idl-def-remoteplayback
+
+enum RemotePlaybackState {
+ "connecting",
+ "connected",
+ "disconnected"
+};
+
+callback RemotePlaybackAvailabilityCallback = void(boolean available);
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ RuntimeEnabled=RemotePlayback
+] interface RemotePlayback : EventTarget {
+ readonly attribute RemotePlaybackState state;
+ attribute EventHandler onconnecting;
+ attribute EventHandler onconnect;
+ attribute EventHandler ondisconnect;
+
+ [CallWith=ScriptState] Promise<long> watchAvailability(RemotePlaybackAvailabilityCallback callback);
+ [CallWith=ScriptState] Promise<void> cancelWatchAvailability(optional long id);
+ [CallWith=ScriptState] Promise<void> prompt();
+};
diff --git a/modules/screen_orientation/ScreenOrientation.idl b/modules/screen_orientation/ScreenOrientation.idl
index 8569fbd..f46ee29 100644
--- a/modules/screen_orientation/ScreenOrientation.idl
+++ b/modules/screen_orientation/ScreenOrientation.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://w3c.github.io/screen-orientation/#screenorientation-interface
+
enum OrientationLockType {
"any",
"natural",
@@ -20,10 +22,7 @@
"landscape-secondary"
};
-[
- GarbageCollected,
- RuntimeEnabled=ScreenOrientation
-] interface ScreenOrientation : EventTarget {
+interface ScreenOrientation : EventTarget {
[MeasureAs=ScreenOrientationAngle] readonly attribute unsigned short angle;
[MeasureAs=ScreenOrientationType] readonly attribute DOMString type;
diff --git a/modules/screen_orientation/ScreenScreenOrientation.idl b/modules/screen_orientation/ScreenScreenOrientation.idl
index 2905343..f2eb03f 100644
--- a/modules/screen_orientation/ScreenScreenOrientation.idl
+++ b/modules/screen_orientation/ScreenScreenOrientation.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- RuntimeEnabled=ScreenOrientation
+ ImplementedAs=ScreenScreenOrientation
] partial interface Screen {
[CallWith=ScriptState] readonly attribute ScreenOrientation orientation;
};
diff --git a/modules/sensor/AbsoluteOrientationSensor.idl b/modules/sensor/AbsoluteOrientationSensor.idl
new file mode 100644
index 0000000..aff2bb0
--- /dev/null
+++ b/modules/sensor/AbsoluteOrientationSensor.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/orientation-sensor/#absoluteorientationsensor-interface
+
+[
+ OriginTrialEnabled=Sensor,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=AbsoluteOrientationSensorConstructor
+] interface AbsoluteOrientationSensor : OrientationSensor {
+};
diff --git a/modules/sensor/Accelerometer.idl b/modules/sensor/Accelerometer.idl
new file mode 100644
index 0000000..fc0f66e
--- /dev/null
+++ b/modules/sensor/Accelerometer.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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/accelerometer/#accelerometer-interface
+
+[
+ OriginTrialEnabled=Sensor,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=AccelerometerConstructor
+] interface Accelerometer : Sensor {
+ readonly attribute unrestricted double? x;
+ readonly attribute unrestricted double? y;
+ readonly attribute unrestricted double? z;
+};
diff --git a/modules/sensor/AmbientLightSensor.idl b/modules/sensor/AmbientLightSensor.idl
new file mode 100644
index 0000000..dc36105
--- /dev/null
+++ b/modules/sensor/AmbientLightSensor.idl
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium 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/ambient-light/#ambient-light-sensor-interface
+
+[
+ RuntimeEnabled=SensorExtraClasses,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=AmbientLightSensorConstructor
+] interface AmbientLightSensor : Sensor {
+ readonly attribute unrestricted double? illuminance;
+};
diff --git a/modules/sensor/Gyroscope.idl b/modules/sensor/Gyroscope.idl
new file mode 100644
index 0000000..69684f4
--- /dev/null
+++ b/modules/sensor/Gyroscope.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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/gyroscope/#gyroscope-interface
+
+[
+ OriginTrialEnabled=Sensor,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=GyroscopeConstructor
+] interface Gyroscope : Sensor {
+ readonly attribute unrestricted double? x;
+ readonly attribute unrestricted double? y;
+ readonly attribute unrestricted double? z;
+};
diff --git a/modules/sensor/LinearAccelerationSensor.idl b/modules/sensor/LinearAccelerationSensor.idl
new file mode 100644
index 0000000..bba298d
--- /dev/null
+++ b/modules/sensor/LinearAccelerationSensor.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/accelerometer/#linearaccelerationsensor
+
+[
+ OriginTrialEnabled=Sensor,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=LinearAccelerationSensorConstructor
+] interface LinearAccelerationSensor : Accelerometer {
+};
diff --git a/modules/sensor/Magnetometer.idl b/modules/sensor/Magnetometer.idl
new file mode 100644
index 0000000..5024f0d
--- /dev/null
+++ b/modules/sensor/Magnetometer.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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/magnetometer/#magnetometer-interface
+
+[
+ RuntimeEnabled=SensorExtraClasses,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=MagnetometerConstructor
+] interface Magnetometer : Sensor {
+ readonly attribute unrestricted double? x;
+ readonly attribute unrestricted double? y;
+ readonly attribute unrestricted double? z;
+};
diff --git a/modules/sensor/OrientationSensor.idl b/modules/sensor/OrientationSensor.idl
new file mode 100644
index 0000000..091f5e3
--- /dev/null
+++ b/modules/sensor/OrientationSensor.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/orientation-sensor/
+
+typedef (Float32Array or Float64Array or DOMMatrix) RotationMatrixType;
+
+[
+ OriginTrialEnabled=Sensor
+] interface OrientationSensor : Sensor {
+ [CachedAttribute=isReadingDirty] readonly attribute FrozenArray<double>? quaternion;
+ [RaisesException, MeasureAs=OrientationSensorPopulateMatrix] void populateMatrix(RotationMatrixType targetBuffer);
+};
diff --git a/modules/sensor/RelativeOrientationSensor.idl b/modules/sensor/RelativeOrientationSensor.idl
new file mode 100644
index 0000000..a448333
--- /dev/null
+++ b/modules/sensor/RelativeOrientationSensor.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/orientation-sensor/#relativeorientationsensor-interface
+
+[
+ OriginTrialEnabled=Sensor,
+ Constructor(optional SensorOptions sensorOptions),
+ ConstructorCallWith=ExecutionContext,
+ RaisesException=Constructor,
+ MeasureAs=RelativeOrientationSensorConstructor
+] interface RelativeOrientationSensor : OrientationSensor {
+};
diff --git a/modules/sensor/Sensor.idl b/modules/sensor/Sensor.idl
new file mode 100644
index 0000000..8d122af
--- /dev/null
+++ b/modules/sensor/Sensor.idl
@@ -0,0 +1,23 @@
+// Copyright 2016 The Chromium 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/sensors/#the-sensor-interface
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ OriginTrialEnabled=Sensor
+] interface Sensor : EventTarget {
+ [MeasureAs=GenericSensorActivated] readonly attribute boolean activated;
+ readonly attribute boolean hasReading;
+ [CallWith=ScriptState] readonly attribute DOMHighResTimeStamp? timestamp;
+
+ [MeasureAs=GenericSensorStart] void start();
+ [MeasureAs=GenericSensorStop] void stop();
+
+ [MeasureAs=GenericSensorOnError] attribute EventHandler onerror;
+ [MeasureAs=GenericSensorOnChange] attribute EventHandler onreading;
+ [MeasureAs=GenericSensorOnActivate] attribute EventHandler onactivate;
+};
diff --git a/modules/sensor/SensorErrorEvent.idl b/modules/sensor/SensorErrorEvent.idl
new file mode 100644
index 0000000..9e38c7c
--- /dev/null
+++ b/modules/sensor/SensorErrorEvent.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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/sensors/#sensorerrorevent
+
+[
+ OriginTrialEnabled=Sensor,
+ Constructor(DOMString type, SensorErrorEventInit eventInitDict)
+] interface SensorErrorEvent : Event {
+ readonly attribute DOMException error;
+};
diff --git a/modules/sensor/SensorErrorEventInit.idl b/modules/sensor/SensorErrorEventInit.idl
new file mode 100644
index 0000000..27e44e4
--- /dev/null
+++ b/modules/sensor/SensorErrorEventInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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/sensors/#dictdef-sensorerroreventinit
+
+dictionary SensorErrorEventInit : EventInit {
+ DOMException error;
+};
diff --git a/modules/sensor/SensorOptions.idl b/modules/sensor/SensorOptions.idl
new file mode 100644
index 0000000..8ea6530
--- /dev/null
+++ b/modules/sensor/SensorOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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/sensors/#dictdef-sensoroptions
+
+dictionary SensorOptions {
+ double? frequency;
+};
diff --git a/modules/serviceworkers/Client.idl b/modules/serviceworkers/Client.idl
index 01dd03e..2761202 100644
--- a/modules/serviceworkers/Client.idl
+++ b/modules/serviceworkers/Client.idl
@@ -2,14 +2,16 @@
// 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
+// https://w3c.github.io/ServiceWorker/#client-interface
[
Exposed=ServiceWorker,
- GarbageCollected,
- ImplementedAs=ServiceWorkerClient,
+ 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);
+ readonly attribute USVString url;
+ readonly attribute DOMString id;
+ readonly attribute ClientType type;
+ [PostMessage, RaisesException, CallWith=ScriptState] void postMessage(any message, optional sequence<object> transfer);
+
+ // FIXME: frameType is non-standard, see https://crbug.com/697110
+ [CallWith=ScriptState] readonly attribute ContextFrameType frameType;
};
diff --git a/modules/serviceworkers/ClientQueryOptions.idl b/modules/serviceworkers/ClientQueryOptions.idl
index 0d1437a..e840839 100644
--- a/modules/serviceworkers/ClientQueryOptions.idl
+++ b/modules/serviceworkers/ClientQueryOptions.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/ServiceWorker/#enumdef-clienttype
enum ClientType {
"window",
"worker",
@@ -10,7 +10,7 @@
"all"
};
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#serviceworker-client-query-options-dictionary
+// https://w3c.github.io/ServiceWorker/#dictdef-clientqueryoptions
dictionary ClientQueryOptions {
boolean includeUncontrolled = false;
ClientType type = "window";
diff --git a/modules/serviceworkers/Clients.idl b/modules/serviceworkers/Clients.idl
index df84bec..8f90d4d 100644
--- a/modules/serviceworkers/Clients.idl
+++ b/modules/serviceworkers/Clients.idl
@@ -2,14 +2,13 @@
// 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
+// https://w3c.github.io/ServiceWorker/#clients-interface
[
Exposed=ServiceWorker,
- GarbageCollected,
- ImplementedAs=ServiceWorkerClients,
+ ImplementedAs=ServiceWorkerClients
] interface Clients {
- [RuntimeEnabled=ServiceWorkerClientsGetID, CallWith=ScriptState] Promise<any> get(DOMString id);
+ [CallWith=ScriptState] Promise<any> get(DOMString id);
[CallWith=ScriptState] Promise<sequence<Client>> matchAll(optional ClientQueryOptions options);
- [RuntimeEnabled=ServiceWorkerClientAttributes, CallWith=ScriptState] Promise<WindowClient?> openWindow(USVString url);
+ [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 6bef9da..a55175d 100644
--- a/modules/serviceworkers/ExtendableEvent.idl
+++ b/modules/serviceworkers/ExtendableEvent.idl
@@ -28,10 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#extendable-event-interface
+// https://w3c.github.io/ServiceWorker/#extendableevent-interface
[
Constructor(DOMString type, optional ExtendableEventInit eventInitDict),
- Exposed=ServiceWorker,
+ Exposed=ServiceWorker
] interface ExtendableEvent : Event {
[CallWith=ScriptState, RaisesException] void waitUntil(Promise<any> f);
};
diff --git a/modules/serviceworkers/ExtendableEventInit.idl b/modules/serviceworkers/ExtendableEventInit.idl
index 81d8afa..bef230b 100644
--- a/modules/serviceworkers/ExtendableEventInit.idl
+++ b/modules/serviceworkers/ExtendableEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit
dictionary ExtendableEventInit : EventInit {
// Defined for the forward compatibility across the derived events
diff --git a/modules/serviceworkers/ExtendableMessageEvent.idl b/modules/serviceworkers/ExtendableMessageEvent.idl
index 6da6bbf..a508c35 100644
--- a/modules/serviceworkers/ExtendableMessageEvent.idl
+++ b/modules/serviceworkers/ExtendableMessageEvent.idl
@@ -2,7 +2,7 @@
// 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#extendablemessage-event-section
+// https://w3c.github.io/ServiceWorker/#extendablemessageevent-interface
[
// TODO(bashi): Stop using CustomConstructor once we solve reference
@@ -10,12 +10,11 @@
// Constructor should be:
// Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict),
CustomConstructor,
- Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorkerExtendableMessageEvent,
+ Exposed=ServiceWorker
] interface ExtendableMessageEvent : ExtendableEvent {
[Custom=Getter] readonly attribute any data;
readonly attribute DOMString origin;
readonly attribute DOMString lastEventId;
[SameObject] readonly attribute (Client or ServiceWorker or MessagePort)? source;
- [SameObject] readonly attribute MessagePort[]? ports;
+ readonly attribute FrozenArray<MessagePort> ports;
};
diff --git a/modules/serviceworkers/ExtendableMessageEventInit.idl b/modules/serviceworkers/ExtendableMessageEventInit.idl
index 9d3bbe0..765cda3 100644
--- a/modules/serviceworkers/ExtendableMessageEventInit.idl
+++ b/modules/serviceworkers/ExtendableMessageEventInit.idl
@@ -2,14 +2,12 @@
// 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#extendablemessage-event-section
+// https://w3c.github.io/ServiceWorker/#dictdef-extendablemessageeventinit
-[
- RuntimeEnabled=ServiceWorkerExtendableMessageEvent,
-] dictionary ExtendableMessageEventInit : ExtendableEventInit {
+dictionary ExtendableMessageEventInit : ExtendableEventInit {
any data;
DOMString origin;
DOMString lastEventId;
(Client or ServiceWorker or MessagePort)? source;
- sequence<MessagePort>? ports;
+ sequence<MessagePort> ports;
};
diff --git a/modules/serviceworkers/FetchEvent.idl b/modules/serviceworkers/FetchEvent.idl
index e8f4551..3529ee3 100644
--- a/modules/serviceworkers/FetchEvent.idl
+++ b/modules/serviceworkers/FetchEvent.idl
@@ -2,14 +2,18 @@
// 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
+// https://w3c.github.io/ServiceWorker/#fetchevent-interface
[
+ ActiveScriptWrappable,
+ DependentLifetime,
Constructor(DOMString type, FetchEventInit eventInitDict),
- Exposed=ServiceWorker,
+ ConstructorCallWith=ScriptState,
+ Exposed=ServiceWorker
] interface FetchEvent : ExtendableEvent {
[SameObject] readonly attribute Request request;
readonly attribute DOMString? clientId;
readonly attribute boolean isReload;
[CallWith=ScriptState, RaisesException] void respondWith(Promise<Response> r);
+ [CallWith=ScriptState] readonly attribute Promise<any> preloadResponse;
};
diff --git a/modules/serviceworkers/FetchEventInit.idl b/modules/serviceworkers/FetchEventInit.idl
index 80da60f..c373916 100644
--- a/modules/serviceworkers/FetchEventInit.idl
+++ b/modules/serviceworkers/FetchEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/ServiceWorker/#dictdef-fetcheventinit
dictionary FetchEventInit : ExtendableEventInit {
required Request request;
diff --git a/modules/serviceworkers/ForeignFetchEvent.idl b/modules/serviceworkers/ForeignFetchEvent.idl
new file mode 100644
index 0000000..815af4b
--- /dev/null
+++ b/modules/serviceworkers/ForeignFetchEvent.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/ServiceWorker/#foreignfetchevent-interface
+[
+ Constructor(DOMString type, ForeignFetchEventInit eventInitDict),
+ ConstructorCallWith=ScriptState,
+ Exposed=ServiceWorker,
+ OriginTrialEnabled=ForeignFetch
+] interface ForeignFetchEvent : ExtendableEvent {
+ [SameObject] readonly attribute Request request;
+ readonly attribute USVString origin;
+
+ [CallWith=ScriptState, RaisesException] void respondWith(Promise<ForeignFetchResponse> r);
+};
diff --git a/modules/serviceworkers/ForeignFetchEventInit.idl b/modules/serviceworkers/ForeignFetchEventInit.idl
new file mode 100644
index 0000000..af8274c
--- /dev/null
+++ b/modules/serviceworkers/ForeignFetchEventInit.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/ServiceWorker/#dictdef-foreignfetcheventinit
+
+dictionary ForeignFetchEventInit : ExtendableEventInit {
+ required Request request;
+ USVString origin = "null";
+};
diff --git a/modules/serviceworkers/ForeignFetchOptions.idl b/modules/serviceworkers/ForeignFetchOptions.idl
new file mode 100644
index 0000000..2a7b72a
--- /dev/null
+++ b/modules/serviceworkers/ForeignFetchOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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/ServiceWorker/#dictdef-foreignfetchoptions
+
+dictionary ForeignFetchOptions {
+ required sequence<USVString> scopes;
+ required sequence<USVString> origins;
+};
diff --git a/modules/serviceworkers/ForeignFetchResponse.idl b/modules/serviceworkers/ForeignFetchResponse.idl
new file mode 100644
index 0000000..53ac924
--- /dev/null
+++ b/modules/serviceworkers/ForeignFetchResponse.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/ServiceWorker/#dictdef-foreignfetchresponse
+
+dictionary ForeignFetchResponse {
+ required Response response;
+ USVString origin;
+ sequence<ByteString> headers;
+};
diff --git a/modules/serviceworkers/InstallEvent.idl b/modules/serviceworkers/InstallEvent.idl
index dc9ee12..2113e2f 100644
--- a/modules/serviceworkers/InstallEvent.idl
+++ b/modules/serviceworkers/InstallEvent.idl
@@ -2,11 +2,11 @@
// 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
+// https://w3c.github.io/ServiceWorker/#installevent
+
[
Constructor(DOMString type, optional ExtendableEventInit eventInitDict),
- Exposed=ServiceWorker,
- RuntimeEnabled=ForeignFetch,
+ Exposed=ServiceWorker
] interface InstallEvent : ExtendableEvent {
- [CallWith=ExecutionContext, RaisesException] void registerForeignFetchScopes(sequence<USVString> subScopes, (USVString or sequence<USVString>) origins);
+ [OriginTrialEnabled=ForeignFetch, CallWith=ScriptState, RaisesException] void registerForeignFetch(ForeignFetchOptions options);
};
diff --git a/modules/serviceworkers/NavigationPreloadManager.idl b/modules/serviceworkers/NavigationPreloadManager.idl
new file mode 100644
index 0000000..7c830b6
--- /dev/null
+++ b/modules/serviceworkers/NavigationPreloadManager.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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(falken): Revise link when this lands in the spec:
+// https://github.com/w3c/ServiceWorker/issues/920
+[
+ Exposed=(Window,Worker)
+] interface NavigationPreloadManager {
+ // TODO(mgiuca): Put SecureContext on the interface, not individual methods.
+ // Currently prevented due to clash with OriginTrialEnabled. This can be
+ // resolved either when OriginTrialEnabled is removed, or
+ // https://crbug.com/695123 is fixed.
+ [SecureContext, CallWith=ScriptState] Promise<void> enable();
+ [SecureContext, CallWith=ScriptState] Promise<void> disable();
+ [SecureContext, CallWith=ScriptState] Promise<void> setHeaderValue(ByteString value);
+ [SecureContext, CallWith=ScriptState] Promise<NavigationPreloadState> getState();
+};
diff --git a/modules/serviceworkers/NavigationPreloadState.idl b/modules/serviceworkers/NavigationPreloadState.idl
new file mode 100644
index 0000000..2a06381
--- /dev/null
+++ b/modules/serviceworkers/NavigationPreloadState.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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(falken): Revise link when this lands in the spec:
+// https://github.com/w3c/ServiceWorker/issues/920
+dictionary NavigationPreloadState {
+ boolean enabled = false;
+ ByteString headerValue;
+};
diff --git a/modules/serviceworkers/NavigatorServiceWorker.idl b/modules/serviceworkers/NavigatorServiceWorker.idl
index 7ffe838..ef59d5d 100644
--- a/modules/serviceworkers/NavigatorServiceWorker.idl
+++ b/modules/serviceworkers/NavigatorServiceWorker.idl
@@ -2,7 +2,9 @@
// 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#navigator-service-worker
-partial interface Navigator {
- [RaisesException, CallWith=ExecutionContext] readonly attribute ServiceWorkerContainer serviceWorker;
+// https://w3c.github.io/ServiceWorker/#navigator-serviceworker
+[
+ ImplementedAs=NavigatorServiceWorker
+] partial interface Navigator {
+ [RaisesException, CallWith=ScriptState] readonly attribute ServiceWorkerContainer serviceWorker;
};
diff --git a/modules/serviceworkers/RegistrationOptions.idl b/modules/serviceworkers/RegistrationOptions.idl
index 17f2d20..afc7562 100644
--- a/modules/serviceworkers/RegistrationOptions.idl
+++ b/modules/serviceworkers/RegistrationOptions.idl
@@ -2,7 +2,7 @@
// 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#registration-option-list-dictionary
+// https://w3c.github.io/ServiceWorker/#dictdef-registrationoptions
dictionary RegistrationOptions {
USVString scope;
};
diff --git a/modules/serviceworkers/ServiceWorker.idl b/modules/serviceworkers/ServiceWorker.idl
index 12f157b..b50b477 100644
--- a/modules/serviceworkers/ServiceWorker.idl
+++ b/modules/serviceworkers/ServiceWorker.idl
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-interface
+// https://w3c.github.io/ServiceWorker/#serviceworker-interface
enum ServiceWorkerState {
"installing",
@@ -39,11 +39,11 @@
};
[
- DependentLifetime,
- GarbageCollected,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface ServiceWorker : EventTarget {
- [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ [PostMessage, RaisesException] void postMessage(any message, optional sequence<object> transfer);
readonly attribute USVString scriptURL;
readonly attribute ServiceWorkerState state;
diff --git a/modules/serviceworkers/ServiceWorkerContainer.idl b/modules/serviceworkers/ServiceWorkerContainer.idl
index bc58128..135059b 100644
--- a/modules/serviceworkers/ServiceWorkerContainer.idl
+++ b/modules/serviceworkers/ServiceWorkerContainer.idl
@@ -28,11 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-interface
-[
- GarbageCollected,
-] interface ServiceWorkerContainer : EventTarget {
- [Unforgeable] readonly attribute ServiceWorker? controller;
+// https://w3c.github.io/ServiceWorker/#serviceworkercontainer-interface
+interface ServiceWorkerContainer : EventTarget {
+ readonly attribute ServiceWorker? controller;
[CallWith=ScriptState] readonly attribute Promise<ServiceWorkerRegistration> ready;
[CallWith=ScriptState, ImplementedAs=registerServiceWorker] Promise<ServiceWorkerRegistration> register(USVString url, optional RegistrationOptions options);
diff --git a/modules/serviceworkers/ServiceWorkerGlobalScope.idl b/modules/serviceworkers/ServiceWorkerGlobalScope.idl
index df412a7..4efdf5a 100644
--- a/modules/serviceworkers/ServiceWorkerGlobalScope.idl
+++ b/modules/serviceworkers/ServiceWorkerGlobalScope.idl
@@ -28,11 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-interface
+// https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-interface
[
Exposed=ServiceWorker,
- Global=(Worker,ServiceWorker),
+ Global=(Worker,ServiceWorker)
] interface ServiceWorkerGlobalScope : WorkerGlobalScope {
readonly attribute Clients clients;
@@ -40,13 +40,11 @@
[CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
- [RaisesException] void close();
-
[CallWith=ScriptState] Promise<void> skipWaiting();
attribute EventHandler onactivate;
attribute EventHandler onfetch;
attribute EventHandler oninstall;
attribute EventHandler onmessage;
- [RuntimeEnabled=ForeignFetch] attribute EventHandler onforeignfetch;
+ [OriginTrialEnabled=ForeignFetch] attribute EventHandler onforeignfetch;
};
diff --git a/modules/serviceworkers/ServiceWorkerMessageEvent.idl b/modules/serviceworkers/ServiceWorkerMessageEvent.idl
deleted file mode 100644
index f110925..0000000
--- a/modules/serviceworkers/ServiceWorkerMessageEvent.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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
-
-[
- // TODO(bashi): Stop using CustomConstructor once we solve reference
- // circulation between Blink and V8. http://crbug.com/501866
- // Constructor should be:
- // Constructor(DOMString type, optional ServiceWorkerMessageEventInit eventInitDict),
- CustomConstructor,
- 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
deleted file mode 100644
index 9c134ec..0000000
--- a/modules/serviceworkers/ServiceWorkerMessageEventInit.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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 97d7b82..bd9d3c6 100644
--- a/modules/serviceworkers/ServiceWorkerRegistration.idl
+++ b/modules/serviceworkers/ServiceWorkerRegistration.idl
@@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-obj
+// https://w3c.github.io/ServiceWorker/#serviceworkerregistration-interface
[
- Exposed=(Window,Worker),
+ ActiveScriptWrappable,
DependentLifetime,
- GarbageCollected,
+ Exposed=(Window,Worker)
] interface ServiceWorkerRegistration : EventTarget {
- [Unforgeable] readonly attribute ServiceWorker? installing;
- [Unforgeable] readonly attribute ServiceWorker? waiting;
- [Unforgeable] readonly attribute ServiceWorker? active;
+ readonly attribute ServiceWorker? installing;
+ readonly attribute ServiceWorker? waiting;
+ readonly attribute ServiceWorker? active;
+ readonly attribute NavigationPreloadManager navigationPreload;
readonly attribute USVString scope;
diff --git a/modules/serviceworkers/WindowClient.idl b/modules/serviceworkers/WindowClient.idl
index 3639408..5b31045 100644
--- a/modules/serviceworkers/WindowClient.idl
+++ b/modules/serviceworkers/WindowClient.idl
@@ -2,7 +2,7 @@
// 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
+// https://w3c.github.io/ServiceWorker/#context-frame-type-enum
enum ContextFrameType {
"top-level",
"nested",
@@ -10,15 +10,13 @@
"none"
};
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#window-client-interface
+// https://w3c.github.io/ServiceWorker/#windowclient
[
Exposed=ServiceWorker,
- RuntimeEnabled=ServiceWorkerClientAttributes,
- GarbageCollected,
- ImplementedAs=ServiceWorkerWindowClient,
+ ImplementedAs=ServiceWorkerWindowClient
] interface WindowClient : Client {
readonly attribute VisibilityState visibilityState;
readonly attribute boolean focused;
[CallWith=ScriptState] Promise<WindowClient> focus();
- [RuntimeEnabled=ServiceWorkerWindowClientNavigate, CallWith=ScriptState] Promise<WindowClient> navigate(USVString url);
+ [CallWith=ScriptState] Promise<WindowClient> navigate(USVString url);
};
diff --git a/modules/serviceworkers/testing/InternalsServiceWorker.idl b/modules/serviceworkers/testing/InternalsServiceWorker.idl
index f20eecb..36f71b6 100644
--- a/modules/serviceworkers/testing/InternalsServiceWorker.idl
+++ b/modules/serviceworkers/testing/InternalsServiceWorker.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.
-partial interface Internals {
+[
+ ImplementedAs=InternalsServiceWorker
+] partial interface Internals {
void terminateServiceWorker(ServiceWorker worker);
};
diff --git a/modules/shapedetection/BarcodeDetector.idl b/modules/shapedetection/BarcodeDetector.idl
new file mode 100644
index 0000000..42690b5
--- /dev/null
+++ b/modules/shapedetection/BarcodeDetector.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/shape-detection-api/#barcode-detection-api
+
+[
+ Constructor,
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ MeasureAs=ShapeDetection_BarcodeDetectorConstructor,
+ RuntimeEnabled=ShapeDetection
+] interface BarcodeDetector {
+ [CallWith=ScriptState] Promise<sequence<DetectedBarcode>> detect(ImageBitmapSource image);
+};
diff --git a/modules/shapedetection/DetectedBarcode.idl b/modules/shapedetection/DetectedBarcode.idl
new file mode 100644
index 0000000..6bd2f7b
--- /dev/null
+++ b/modules/shapedetection/DetectedBarcode.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/shape-detection-api/#barcode-detection-api
+
+[
+ Constructor,
+ RuntimeEnabled=ShapeDetection
+] interface DetectedBarcode {
+ // TODO(mcasas): Implement missing fields. https://crbug.com/646083
+ [SameObject] readonly attribute DOMString rawValue;
+ [SameObject] readonly attribute DOMRect boundingBox;
+ // 4 corner points in clockwise direction starting with top-left. Due to
+ // possible perspective distortions, this is not necessarily a rectangle.
+ [SameObject, SaveSameObject] readonly attribute FrozenArray<Point2D> cornerPoints;
+};
diff --git a/modules/shapedetection/DetectedFace.idl b/modules/shapedetection/DetectedFace.idl
new file mode 100644
index 0000000..fe8dba2
--- /dev/null
+++ b/modules/shapedetection/DetectedFace.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/shape-detection-api/#face-detection-api
+
+[
+ Constructor,
+ RuntimeEnabled=ShapeDetection
+] interface DetectedFace {
+ // TODO(xianglu): Implement any other fields. https://crbug.com/646083
+ [SameObject] readonly attribute DOMRect boundingBox;
+ [SameObject, SaveSameObject] readonly attribute FrozenArray<Landmark> landmarks;
+};
diff --git a/modules/shapedetection/DetectedText.idl b/modules/shapedetection/DetectedText.idl
new file mode 100644
index 0000000..17df6ff
--- /dev/null
+++ b/modules/shapedetection/DetectedText.idl
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/shape-detection-api/#text-detection-api
+
+[
+ Constructor,
+ RuntimeEnabled=ShapeDetection
+] interface DetectedText {
+ [SameObject] readonly attribute DOMString rawValue;
+ [SameObject] readonly attribute DOMRect boundingBox;
+ // 4 corner points in clockwise direction starting with top-left. Due to
+ // possible perspective distortions, this is not necessarily a rectangle.
+ [SameObject] readonly attribute FrozenArray<Point2D> cornerPoints;
+};
diff --git a/modules/shapedetection/FaceDetector.idl b/modules/shapedetection/FaceDetector.idl
new file mode 100644
index 0000000..6b3b8ab
--- /dev/null
+++ b/modules/shapedetection/FaceDetector.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/shape-detection-api/#face-detection-api
+
+[
+ Constructor(optional FaceDetectorOptions faceDetectorOptions),
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ MeasureAs=ShapeDetection_FaceDetectorConstructor,
+ RuntimeEnabled=ShapeDetection
+] interface FaceDetector {
+ [CallWith=ScriptState] Promise<sequence<DetectedFace>> detect(ImageBitmapSource image);
+};
diff --git a/modules/shapedetection/FaceDetectorOptions.idl b/modules/shapedetection/FaceDetectorOptions.idl
new file mode 100644
index 0000000..3ee1e7e
--- /dev/null
+++ b/modules/shapedetection/FaceDetectorOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/shape-detection-api/#face-detection-api
+
+dictionary FaceDetectorOptions {
+ unsigned short maxDetectedFaces = 10;
+ boolean fastMode = false;
+};
diff --git a/modules/shapedetection/Landmark.idl b/modules/shapedetection/Landmark.idl
new file mode 100644
index 0000000..6f57886
--- /dev/null
+++ b/modules/shapedetection/Landmark.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/shape-detection-api/#enumdef-landmarktype
+enum LandmarkType { "mouth", "eye" };
+
+// https://wicg.github.io/shape-detection-api/#dictdef-landmark
+dictionary Landmark {
+ required Point2D location;
+ LandmarkType type;
+};
diff --git a/modules/shapedetection/TextDetector.idl b/modules/shapedetection/TextDetector.idl
new file mode 100644
index 0000000..56df055
--- /dev/null
+++ b/modules/shapedetection/TextDetector.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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://wicg.github.io/shape-detection-api/#text-detection-api
+
+[
+ Constructor,
+ ConstructorCallWith=ExecutionContext,
+ Exposed=(Window,Worker),
+ MeasureAs=ShapeDetection_TextDetectorConstructor,
+ RuntimeEnabled=ShapeDetection
+] interface TextDetector {
+ [CallWith=ScriptState] Promise<sequence<DetectedText>> detect(ImageBitmapSource image);
+};
diff --git a/modules/speech/SpeechGrammar.idl b/modules/speech/SpeechGrammar.idl
index 1e3a346..e1d0f25 100644
--- a/modules/speech/SpeechGrammar.idl
+++ b/modules/speech/SpeechGrammar.idl
@@ -23,11 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#dfn-speechgrammar
+
[
Constructor,
- GarbageCollected,
- NoInterfaceObject,
+ NoInterfaceObject
] interface SpeechGrammar {
- [URL,CallWith=ExecutionContext] attribute DOMString src;
+ [URL,CallWith=ScriptState] attribute DOMString src;
attribute float weight;
};
diff --git a/modules/speech/SpeechGrammarList.idl b/modules/speech/SpeechGrammarList.idl
index 48f78b8..85a60d4 100644
--- a/modules/speech/SpeechGrammarList.idl
+++ b/modules/speech/SpeechGrammarList.idl
@@ -23,13 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#dfn-speechgrammarlist
+
[
Constructor,
- GarbageCollected,
- NoInterfaceObject,
+ NoInterfaceObject
] interface SpeechGrammarList {
readonly attribute unsigned long length;
getter SpeechGrammar item(unsigned long index);
- [CallWith=ExecutionContext] void addFromUri(DOMString src, optional float weight);
+ [CallWith=ScriptState] void addFromUri(DOMString src, optional float weight);
void addFromString(DOMString string, optional float weight);
};
diff --git a/modules/speech/SpeechRecognition.idl b/modules/speech/SpeechRecognition.idl
index cbd14c2..5901b6c 100644
--- a/modules/speech/SpeechRecognition.idl
+++ b/modules/speech/SpeechRecognition.idl
@@ -23,24 +23,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#dfn-speechreco
+
[
- GarbageCollected,
- NoInterfaceObject,
- DependentLifetime,
+ ActiveScriptWrappable,
Constructor,
ConstructorCallWith=ExecutionContext,
+ DependentLifetime,
+ NoInterfaceObject
] interface SpeechRecognition : EventTarget {
- [LegacyInterfaceTypeChecking] attribute SpeechGrammarList grammars;
+ // recognition parameters
+ attribute SpeechGrammarList grammars;
attribute DOMString lang;
attribute boolean continuous;
attribute boolean interimResults;
attribute unsigned long maxAlternatives;
- [RuntimeEnabled=MediaStreamSpeech, LegacyInterfaceTypeChecking] attribute MediaStreamTrack audioTrack;
- [RaisesException] void start();
+ // Speech Recognition with WebRTC. https://crbug.com/408940
+ [RuntimeEnabled=MediaStreamSpeech] attribute MediaStreamTrack? audioTrack;
+
+ // methods to drive the speech interaction
+ [RaisesException, Measure] void start();
[ImplementedAs=stopFunction] void stop();
void abort();
+ // event methods
attribute EventHandler onaudiostart;
attribute EventHandler onsoundstart;
attribute EventHandler onspeechstart;
diff --git a/modules/speech/SpeechRecognitionAlternative.idl b/modules/speech/SpeechRecognitionAlternative.idl
index 38acdc0..920719a 100644
--- a/modules/speech/SpeechRecognitionAlternative.idl
+++ b/modules/speech/SpeechRecognitionAlternative.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#speechrecognitionalternative
+
[
- GarbageCollected,
NoInterfaceObject
] interface SpeechRecognitionAlternative {
readonly attribute DOMString transcript;
diff --git a/modules/speech/SpeechRecognitionError.idl b/modules/speech/SpeechRecognitionError.idl
index 5267e53..9eae1c3 100644
--- a/modules/speech/SpeechRecognitionError.idl
+++ b/modules/speech/SpeechRecognitionError.idl
@@ -23,9 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#speechrecognitionerror
+
[
NoInterfaceObject,
- Constructor(DOMString type, optional SpeechRecognitionErrorInit initDict),
+ Constructor(DOMString type, optional SpeechRecognitionErrorInit initDict)
] interface SpeechRecognitionError : Event {
readonly attribute DOMString error;
readonly attribute DOMString message;
diff --git a/modules/speech/SpeechRecognitionErrorInit.idl b/modules/speech/SpeechRecognitionErrorInit.idl
index c258ab6..3f7aeb3 100644
--- a/modules/speech/SpeechRecognitionErrorInit.idl
+++ b/modules/speech/SpeechRecognitionErrorInit.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// FIXME: Add spec URL.
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#dfn-speechrecognitionerror
dictionary SpeechRecognitionErrorInit : EventInit {
DOMString error;
diff --git a/modules/speech/SpeechRecognitionEvent.idl b/modules/speech/SpeechRecognitionEvent.idl
index 289b103..06bab39 100644
--- a/modules/speech/SpeechRecognitionEvent.idl
+++ b/modules/speech/SpeechRecognitionEvent.idl
@@ -23,13 +23,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#speechrecognitionevent
+
[
NoInterfaceObject,
- Constructor(DOMString type, optional SpeechRecognitionEventInit initDict),
+ Constructor(DOMString type, optional SpeechRecognitionEventInit initDict)
] interface SpeechRecognitionEvent : Event {
readonly attribute unsigned long resultIndex;
- readonly attribute SpeechRecognitionResultList results;
+ readonly attribute SpeechRecognitionResultList? results;
- readonly attribute Document interpretation;
- readonly attribute Document emma;
+ readonly attribute Document? interpretation;
+ readonly attribute Document? emma;
};
diff --git a/modules/speech/SpeechRecognitionEventInit.idl b/modules/speech/SpeechRecognitionEventInit.idl
index 4f55ebb..3c1dd4a 100644
--- a/modules/speech/SpeechRecognitionEventInit.idl
+++ b/modules/speech/SpeechRecognitionEventInit.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.
-// FIXME: Add spec URL.
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#speechrecognitionevent
dictionary SpeechRecognitionEventInit : EventInit {
unsigned long resultIndex;
- SpeechRecognitionResultList results;
+ SpeechRecognitionResultList? results;
};
diff --git a/modules/speech/SpeechRecognitionResult.idl b/modules/speech/SpeechRecognitionResult.idl
index ab0761b..6802d29 100644
--- a/modules/speech/SpeechRecognitionResult.idl
+++ b/modules/speech/SpeechRecognitionResult.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#speechrecognitionresult
+
[
- GarbageCollected,
NoInterfaceObject
] interface SpeechRecognitionResult {
readonly attribute unsigned long length;
diff --git a/modules/speech/SpeechRecognitionResultList.idl b/modules/speech/SpeechRecognitionResultList.idl
index e93a5cf..a4de925 100644
--- a/modules/speech/SpeechRecognitionResultList.idl
+++ b/modules/speech/SpeechRecognitionResultList.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#speechrecognitionresultlist
+
[
- GarbageCollected,
NoInterfaceObject
] interface SpeechRecognitionResultList {
readonly attribute unsigned long length;
diff --git a/modules/speech/SpeechSynthesis.idl b/modules/speech/SpeechSynthesis.idl
index 17fa33a..6f07665 100644
--- a/modules/speech/SpeechSynthesis.idl
+++ b/modules/speech/SpeechSynthesis.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#tts-section
+
[
- GarbageCollected,
NoInterfaceObject
] interface SpeechSynthesis : EventTarget {
readonly attribute boolean pending;
diff --git a/modules/speech/SpeechSynthesisEvent.idl b/modules/speech/SpeechSynthesisEvent.idl
index cec1e47..4c35b5d 100644
--- a/modules/speech/SpeechSynthesisEvent.idl
+++ b/modules/speech/SpeechSynthesisEvent.idl
@@ -23,6 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#tts-section
+
[
RuntimeEnabled=ScriptedSpeech
] interface SpeechSynthesisEvent : Event {
diff --git a/modules/speech/SpeechSynthesisUtterance.idl b/modules/speech/SpeechSynthesisUtterance.idl
index 872fa89..e8e8fa2 100644
--- a/modules/speech/SpeechSynthesisUtterance.idl
+++ b/modules/speech/SpeechSynthesisUtterance.idl
@@ -23,15 +23,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#tts-section
+
[
Constructor(optional DOMString text = null),
ConstructorCallWith=ExecutionContext,
- RuntimeEnabled=ScriptedSpeech,
- GarbageCollected,
+ RuntimeEnabled=ScriptedSpeech
] interface SpeechSynthesisUtterance : EventTarget {
attribute DOMString text;
attribute DOMString lang;
- [LegacyInterfaceTypeChecking] attribute SpeechSynthesisVoice voice;
+ attribute SpeechSynthesisVoice? voice;
attribute float volume;
attribute float rate;
attribute float pitch;
diff --git a/modules/speech/SpeechSynthesisVoice.idl b/modules/speech/SpeechSynthesisVoice.idl
index ea323b0..68f18cd 100644
--- a/modules/speech/SpeechSynthesisVoice.idl
+++ b/modules/speech/SpeechSynthesisVoice.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://dvcs.w3.org/hg/speech-api/raw-file/tip/webspeechapi.html#tts-section
+
[
- GarbageCollected,
NoInterfaceObject
] interface SpeechSynthesisVoice {
readonly attribute DOMString voiceURI;
diff --git a/modules/speech/WindowSpeech.idl b/modules/speech/WindowSpeech.idl
index 0d331cc..fdc4623 100644
--- a/modules/speech/WindowSpeech.idl
+++ b/modules/speech/WindowSpeech.idl
@@ -4,11 +4,11 @@
[
ImplementedAs=DOMWindowSpeech,
- RuntimeEnabled=ScriptedSpeech,
+ RuntimeEnabled=ScriptedSpeech
] partial interface Window {
- attribute SpeechGrammarConstructor webkitSpeechGrammar;
- attribute SpeechGrammarListConstructor webkitSpeechGrammarList;
- attribute SpeechRecognitionConstructor webkitSpeechRecognition;
- attribute SpeechRecognitionErrorConstructor webkitSpeechRecognitionError;
- attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent;
+ [Measure] attribute SpeechGrammarConstructor webkitSpeechGrammar;
+ [Measure] attribute SpeechGrammarListConstructor webkitSpeechGrammarList;
+ [Measure] attribute SpeechRecognitionConstructor webkitSpeechRecognition;
+ [Measure] attribute SpeechRecognitionErrorConstructor webkitSpeechRecognitionError;
+ [Measure] attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent;
};
diff --git a/modules/speech/WindowSpeechSynthesis.idl b/modules/speech/WindowSpeechSynthesis.idl
index 85f5b49..ca27255 100644
--- a/modules/speech/WindowSpeechSynthesis.idl
+++ b/modules/speech/WindowSpeechSynthesis.idl
@@ -25,7 +25,7 @@
[
ImplementedAs=DOMWindowSpeechSynthesis,
- RuntimeEnabled=ScriptedSpeech,
+ RuntimeEnabled=ScriptedSpeech
] partial interface Window {
- readonly attribute SpeechSynthesis speechSynthesis;
+ [Measure, CallWith=ScriptState] readonly attribute SpeechSynthesis speechSynthesis;
};
diff --git a/modules/speech/testing/InternalsSpeechSynthesis.idl b/modules/speech/testing/InternalsSpeechSynthesis.idl
index 34f2bc8..3488084 100644
--- a/modules/speech/testing/InternalsSpeechSynthesis.idl
+++ b/modules/speech/testing/InternalsSpeechSynthesis.idl
@@ -28,6 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface Internals {
- void enableMockSpeechSynthesizer(Document document);
+[
+ ImplementedAs=InternalsSpeechSynthesis
+] partial interface Internals {
+ [CallWith=ScriptState] void enableMockSpeechSynthesizer(Window window);
};
diff --git a/modules/srcobject/HTMLMediaElementSrcObject.idl b/modules/srcobject/HTMLMediaElementSrcObject.idl
new file mode 100644
index 0000000..501bf86
--- /dev/null
+++ b/modules/srcobject/HTMLMediaElementSrcObject.idl
@@ -0,0 +1,18 @@
+// Copyright 2016 The Chromium 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#dom-media-srcobject
+
+// TODO(guidou): Add support for MediaSource and Blob, as defined in the spec.
+typedef MediaStream MediaProvider;
+
+[
+ ImplementedAs=HTMLMediaElementSrcObject
+] partial interface HTMLMediaElement {
+ // TODO(haraken): Per the spec, the srcObject should be defined in
+ // HTMLMediaElement.idl. However, we cannot define srcObject in
+ // HTMLMediaElement.idl because of the dependency restriction from modules/
+ // to core/. For now we avoid the problem by using a partial interface.
+ [Measure] attribute MediaProvider? srcObject;
+};
diff --git a/modules/storage/Storage.idl b/modules/storage/Storage.idl
index d972137..76b9815 100644
--- a/modules/storage/Storage.idl
+++ b/modules/storage/Storage.idl
@@ -25,24 +25,11 @@
// https://html.spec.whatwg.org/multipage/webstorage.html#the-storage-interface
-[
- GarbageCollected
-] interface Storage {
- // TODO(philipj): [NotEnumerable] should not be used anywhere in this interface.
- [NotEnumerable, RaisesException=Getter] readonly attribute unsigned long length;
- [NotEnumerable, RaisesException] DOMString? key(unsigned long index);
- [LogActivity, NotEnumerable, RaisesException] DOMString? getItem(DOMString key);
- [LogActivity, NotEnumerable, RaisesException] void setItem(DOMString key, DOMString value);
- [LogActivity, NotEnumerable, RaisesException] void removeItem(DOMString key);
- [LogActivity, NotEnumerable, RaisesException] void clear();
-
- // TODO(philipj): Merge these into getItem/setItem/removeItem.
- [RaisesException] getter DOMString (DOMString name);
- [RaisesException] setter DOMString (DOMString name, DOMString value);
- [RaisesException] deleter boolean (DOMString name);
-
- // Non-standard APIs
- [NotEnumerable, RaisesException] getter DOMString (unsigned long index);
- [RaisesException] setter DOMString (unsigned long index, DOMString value);
- [RaisesException] deleter boolean (unsigned long index);
+interface Storage {
+ [RaisesException=Getter] readonly attribute unsigned long length;
+ [RaisesException] DOMString? key(unsigned long index);
+ [LogActivity, RaisesException] getter DOMString? getItem(DOMString key);
+ [LogActivity, RaisesException] setter void setItem(DOMString key, DOMString value);
+ [LogActivity, RaisesException] deleter void removeItem(DOMString key);
+ [LogActivity, RaisesException] void clear();
};
diff --git a/modules/storage/StorageEvent.idl b/modules/storage/StorageEvent.idl
index bcf9162..f4a3688 100644
--- a/modules/storage/StorageEvent.idl
+++ b/modules/storage/StorageEvent.idl
@@ -26,7 +26,7 @@
// https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface
[
- Constructor(DOMString type, optional StorageEventInit eventInitDict),
+ Constructor(DOMString type, optional StorageEventInit eventInitDict)
] interface StorageEvent : Event {
readonly attribute DOMString? key;
readonly attribute DOMString? oldValue;
diff --git a/modules/storage/WindowStorage.idl b/modules/storage/WindowStorage.idl
index 5ddd617..91790a6 100644
--- a/modules/storage/WindowStorage.idl
+++ b/modules/storage/WindowStorage.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
[
- ImplementedAs=DOMWindowStorage,
+ ImplementedAs=DOMWindowStorage
] partial interface Window {
// https://html.spec.whatwg.org/#the-sessionstorage-attribute
[LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage sessionStorage;
diff --git a/modules/vibration/NavigatorVibration.idl b/modules/vibration/NavigatorVibration.idl
index 8ed6624..33d86d0 100644
--- a/modules/vibration/NavigatorVibration.idl
+++ b/modules/vibration/NavigatorVibration.idl
@@ -17,10 +17,12 @@
* Boston, MA 02110-1301, USA.
*/
-// http://dev.w3.org/2009/dap/vibration/#idl-def-Navigator
+// https://w3c.github.io/vibration/#vibration-interface
-partial interface Navigator {
- // FIXME: should be union type http://crbug.com/240176
+[
+ ImplementedAs=NavigatorVibration
+] partial interface Navigator {
+ // FIXME: should be union type https://crbug.com/240176
// FIXME: The contents of the pattern argument should be clamped.
// See https://code.google.com/p/chromium/issues/detail?id=310138
boolean vibrate([Clamp] unsigned long pattern);
diff --git a/modules/vibration/testing/InternalsVibration.idl b/modules/vibration/testing/InternalsVibration.idl
index 5da4484..e1cb852 100644
--- a/modules/vibration/testing/InternalsVibration.idl
+++ b/modules/vibration/testing/InternalsVibration.idl
@@ -28,7 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface Internals {
- boolean isVibrating(Document document);
- sequence<unsigned long> pendingVibrationPattern(Document document);
+[
+ ImplementedAs=InternalsVibration
+] partial interface Internals {
+ boolean isVibrating(Navigator navigator);
+ sequence<unsigned long> pendingVibrationPattern(Navigator navigator);
};
diff --git a/modules/vr/HMDVRDevice.idl b/modules/vr/HMDVRDevice.idl
deleted file mode 100644
index 2737c66..0000000
--- a/modules/vr/HMDVRDevice.idl
+++ /dev/null
@@ -1,19 +0,0 @@
-// 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,
-] interface HMDVRDevice : VRDevice {
- VREyeParameters getEyeParameters(VREye whichEye);
- void setFieldOfView(optional VRFieldOfView leftFov, optional VRFieldOfView rightFov);
-};
diff --git a/modules/vr/NavigatorVR.idl b/modules/vr/NavigatorVR.idl
new file mode 100644
index 0000000..e4ba710
--- /dev/null
+++ b/modules/vr/NavigatorVR.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://w3c.github.io/webvr/#interface-navigator
+[
+ ImplementedAs=NavigatorVR,
+ OriginTrialEnabled=WebVR
+] partial interface Navigator {
+ // Latest API
+ [SecureContext] readonly attribute VR vr;
+
+ // Legacy API
+ [CallWith=ScriptState] Promise getVRDisplays();
+};
diff --git a/modules/vr/NavigatorVRDevice.idl b/modules/vr/NavigatorVRDevice.idl
deleted file mode 100644
index 89c4c82..0000000
--- a/modules/vr/NavigatorVRDevice.idl
+++ /dev/null
@@ -1,9 +0,0 @@
-// 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
deleted file mode 100644
index ecd70d3..0000000
--- a/modules/vr/PositionSensorVRDevice.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-// 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
deleted file mode 100644
index 9bb4610..0000000
--- a/modules/vr/VRDevice.idl
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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/VRDisplay.idl b/modules/vr/VRDisplay.idl
new file mode 100644
index 0000000..121ac6f
--- /dev/null
+++ b/modules/vr/VRDisplay.idl
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium 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"
+};
+
+// https://w3c.github.io/webvr/#interface-vrdisplay
+[
+ ActiveScriptWrappable,
+ DependentLifetime,
+ OriginTrialEnabled=WebVR
+] interface VRDisplay : EventTarget {
+ // An identifier for this device unique across VRDisplays.
+ readonly attribute unsigned long displayId;
+
+ // A user-readable name identifying the device.
+ [MeasureAs=VRDisplayDisplayName] readonly attribute DOMString displayName;
+
+ readonly attribute boolean isPresenting;
+
+ // [Constant]?
+ readonly attribute VRDisplayCapabilities capabilities;
+
+ readonly attribute VRStageParameters stageParameters;
+
+ boolean getFrameData(VRFrameData frameData);
+
+ attribute double depthNear;
+ attribute double depthFar;
+
+ VREyeParameters getEyeParameters(VREye whichEye);
+
+ long requestAnimationFrame(FrameRequestCallback callback);
+ void cancelAnimationFrame(long handle);
+
+ // Begin presenting to the VRDisplay. Must be called in response to a user
+ // gesture. Repeat calls while already presenting will update the layer
+ // being displayed.
+ [CallWith=ScriptState] Promise requestPresent(sequence<VRLayerInit> layers);
+
+ // Stops presenting to the VRDisplay.
+ [CallWith=ScriptState] Promise exitPresent();
+
+ // Get the sources currently being presented.
+ sequence<VRLayerInit> getLayers();
+
+ // The layer provided to the `VRDisplay` will be captured and presented
+ // in the HMD. Calling this function has the same effect on the source
+ // canvas as any other operation that uses its source image, and canvases
+ // created without preserveDrawingBuffer set to true will be cleared.
+ void submitFrame();
+};
diff --git a/modules/vr/VRDisplayCapabilities.idl b/modules/vr/VRDisplayCapabilities.idl
new file mode 100644
index 0000000..14d8265
--- /dev/null
+++ b/modules/vr/VRDisplayCapabilities.idl
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium 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/webvr/#interface-vrdisplaycapabilities
+[
+ OriginTrialEnabled=WebVR
+] interface VRDisplayCapabilities {
+ // Whether or not the VR display is capable of reporting user position.
+ // If false position may still be reported using simulated values like
+ // neck modeling.
+ readonly attribute boolean hasPosition;
+
+ // Whether or not the VRDisplay is separate from the device’s primary display.
+ // If presenting VR content will obscure other content on the device, this
+ // should be false. When false VR content should not be mirrored.
+ readonly attribute boolean hasExternalDisplay;
+
+ // Whether or not the VRDisplay is capable of presenting content to an HMD or
+ // similar device. Can be used to indicate “magic window” devices that are
+ // capable of 6DoF tracking but for which requestPresent is not meaningful. If
+ // false then calls to requestPresent should always fail, and getEyeParameters
+ // should return null.
+ readonly attribute boolean canPresent;
+
+ // The maximum length of the array that VRDisplay.requestPresent will accept.
+ readonly attribute unsigned long maxLayers;
+};
diff --git a/modules/vr/VRDisplayEvent.idl b/modules/vr/VRDisplayEvent.idl
new file mode 100644
index 0000000..ae9103a
--- /dev/null
+++ b/modules/vr/VRDisplayEvent.idl
@@ -0,0 +1,20 @@
+// Copyright 2016 The Chromium 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 VRDisplayEventReason {
+ "connected",
+ "disconnected",
+ "navigation",
+ "mounted",
+ "unmounted"
+};
+
+// https://w3c.github.io/webvr/#interface-vrdisplayevent
+[
+ OriginTrialEnabled=WebVR,
+ Constructor(DOMString type, optional VRDisplayEventInit eventInitDict)
+] interface VRDisplayEvent : Event {
+ readonly attribute VRDisplay display;
+ readonly attribute VRDisplayEventReason reason;
+};
diff --git a/modules/vr/VRDisplayEventInit.idl b/modules/vr/VRDisplayEventInit.idl
new file mode 100644
index 0000000..2b8695a
--- /dev/null
+++ b/modules/vr/VRDisplayEventInit.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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/webvr/#interface-vrdisplayeventinit
+
+dictionary VRDisplayEventInit : EventInit {
+ // TODO(foolip): |display| should be required and not nullable.
+ // https://crbug.com/647693
+ // https://github.com/w3c/webvr/issues/83
+ VRDisplay? display;
+ VRDisplayEventReason reason;
+};
diff --git a/modules/vr/VREyeParameters.idl b/modules/vr/VREyeParameters.idl
index 5a83da5..7b5b630 100644
--- a/modules/vr/VREyeParameters.idl
+++ b/modules/vr/VREyeParameters.idl
@@ -2,18 +2,12 @@
// 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
+// https://w3c.github.io/webvr/#interface-vreyeparameters
[
- RuntimeEnabled=WebVR,
- GarbageCollected
+ OriginTrialEnabled=WebVR
] 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
+ [DeprecateAs=VREyeParametersOffset] readonly attribute Float32Array offset;
+ readonly attribute unsigned long renderWidth;
+ readonly attribute unsigned long renderHeight;
+};
diff --git a/modules/vr/VRFieldOfView.idl b/modules/vr/VRFieldOfView.idl
deleted file mode 100644
index 23049d2..0000000
--- a/modules/vr/VRFieldOfView.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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,
- 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
deleted file mode 100644
index 75cac9e..0000000
--- a/modules/vr/VRFieldOfViewInit.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-// 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/VRFrameData.idl b/modules/vr/VRFrameData.idl
new file mode 100644
index 0000000..5d1f348
--- /dev/null
+++ b/modules/vr/VRFrameData.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium 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/webvr/#interface-vrframedata
+[
+ OriginTrialEnabled=WebVR,
+ Constructor
+] interface VRFrameData {
+ readonly attribute Float32Array leftProjectionMatrix;
+ readonly attribute Float32Array leftViewMatrix;
+
+ readonly attribute Float32Array rightProjectionMatrix;
+ readonly attribute Float32Array rightViewMatrix;
+
+ readonly attribute VRPose pose;
+};
diff --git a/modules/vr/VRLayerInit.idl b/modules/vr/VRLayerInit.idl
new file mode 100644
index 0000000..114de35
--- /dev/null
+++ b/modules/vr/VRLayerInit.idl
@@ -0,0 +1,21 @@
+// Copyright 2016 The Chromium 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 (HTMLCanvasElement or OffscreenCanvas) VRSource;
+
+// https://w3c.github.io/webvr/#interface-vrlayerinit
+
+dictionary VRLayerInit {
+ // The canvas to be presented to the VRDisplay
+ VRSource? source = null;
+
+ // The left and right bounds contain 4 git statvalues defining the texture bounds
+ // within the canvas to present to the eye in UV space.
+ // [0] left offset of the bounds (0.0 - 1.0)
+ // [1] top offset of the bounds (0.0 - 1.0)
+ // [2] width of the bounds (0.0 - 1.0)
+ // [3] height of the bounds (0.0 - 1.0)
+ sequence<float> leftBounds = []; //= [0.0, 0.0, 0.5, 1.0];
+ sequence<float> rightBounds = []; //= [0.5, 0.0, 0.5, 1.0];
+};
diff --git a/modules/vr/VRPose.idl b/modules/vr/VRPose.idl
new file mode 100644
index 0000000..e935c5f
--- /dev/null
+++ b/modules/vr/VRPose.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://w3c.github.io/webvr/#interface-vrpose
+[
+ OriginTrialEnabled=WebVR
+] interface VRPose {
+ readonly attribute Float32Array? position;
+ [MeasureAs=VRPoseLinearVelocity] readonly attribute Float32Array? linearVelocity;
+ [MeasureAs=VRPoseLinearAcceleration] readonly attribute Float32Array? linearAcceleration;
+ readonly attribute Float32Array? orientation;
+ [MeasureAs=VRPoseAngularVelocity] readonly attribute Float32Array? angularVelocity;
+ [MeasureAs=VRPoseAngularAcceleration] readonly attribute Float32Array? angularAcceleration;
+};
diff --git a/modules/vr/VRPositionState.idl b/modules/vr/VRPositionState.idl
deleted file mode 100644
index 4a22a02..0000000
--- a/modules/vr/VRPositionState.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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/vr/VRStageParameters.idl b/modules/vr/VRStageParameters.idl
new file mode 100644
index 0000000..458582f
--- /dev/null
+++ b/modules/vr/VRStageParameters.idl
@@ -0,0 +1,25 @@
+// Copyright 2016 The Chromium 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/webvr/#interface-vrstageparameters
+[
+ OriginTrialEnabled=WebVR
+] interface VRStageParameters {
+ // A 16 element array containing the components of a 4x4 transform
+ // matrix. This matrix transforms the sitting space position
+ // returned by get{Immediate}Pose() to a standing space position.
+ readonly attribute Float32Array sittingToStandingTransform;
+
+ // Dimensions of the play area bounds. The bounds are defined
+ // as an axis aligned rectangle on the floor.
+ // The center of the rectangle is at (0,0,0) in standing space
+ // coordinates.
+ // These bounds are defined for safety purposes.
+ // Content should not require the user to move beyond these
+ // bounds; however, it is possible for the user to ignore
+ // the bounds resulting in position values outside of
+ // this rectangle.
+ readonly attribute float sizeX;
+ readonly attribute float sizeZ;
+};
diff --git a/modules/vr/latest/VR.idl b/modules/vr/latest/VR.idl
new file mode 100644
index 0000000..da58f9c
--- /dev/null
+++ b/modules/vr/latest/VR.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vr-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2
+] interface VR : EventTarget {
+ attribute EventHandler ondeviceconnect;
+ attribute EventHandler ondevicedisconnect;
+
+ [CallWith=ScriptState] Promise getDevices();
+};
diff --git a/modules/vr/latest/VRCoordinateSystem.idl b/modules/vr/latest/VRCoordinateSystem.idl
new file mode 100644
index 0000000..fd447f5
--- /dev/null
+++ b/modules/vr/latest/VRCoordinateSystem.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrcoordinatesystem-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2
+] interface VRCoordinateSystem {
+ Float32Array? getTransformTo(VRCoordinateSystem other);
+};
diff --git a/modules/vr/latest/VRDevice.idl b/modules/vr/latest/VRDevice.idl
new file mode 100644
index 0000000..1843d0e
--- /dev/null
+++ b/modules/vr/latest/VRDevice.idl
@@ -0,0 +1,15 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrdevice-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2
+] interface VRDevice : EventTarget {
+ readonly attribute DOMString deviceName;
+ readonly attribute boolean isExternal;
+
+ [CallWith=ScriptState] Promise supportsSession([PermissiveDictionaryConversion] optional VRSessionCreationOptions options);
+ [CallWith=ScriptState] Promise requestSession([PermissiveDictionaryConversion] optional VRSessionCreationOptions options);
+};
diff --git a/modules/vr/latest/VRDeviceEvent.idl b/modules/vr/latest/VRDeviceEvent.idl
new file mode 100644
index 0000000..f6bb7ee
--- /dev/null
+++ b/modules/vr/latest/VRDeviceEvent.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrdeviceevent-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2,
+ Constructor(DOMString type, VRDeviceEventInit eventInitDict)
+] interface VRDeviceEvent : Event {
+ readonly attribute VRDevice device;
+};
\ No newline at end of file
diff --git a/modules/vr/latest/VRDeviceEventInit.idl b/modules/vr/latest/VRDeviceEventInit.idl
new file mode 100644
index 0000000..9d00575
--- /dev/null
+++ b/modules/vr/latest/VRDeviceEventInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrdeviceevent-interface
+[
+ SecureContext
+] dictionary VRDeviceEventInit : EventInit {
+ required VRDevice device;
+};
\ No newline at end of file
diff --git a/modules/vr/latest/VRFrameOfReference.idl b/modules/vr/latest/VRFrameOfReference.idl
new file mode 100644
index 0000000..fd1fbce
--- /dev/null
+++ b/modules/vr/latest/VRFrameOfReference.idl
@@ -0,0 +1,19 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrframeofreference-interface
+
+enum VRFrameOfReferenceType {
+ "headModel",
+ "eyeLevel",
+ "stage",
+};
+
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2
+] interface VRFrameOfReference : VRCoordinateSystem {
+ readonly attribute VRStageBounds? bounds;
+ readonly attribute double emulatedHeight;
+};
diff --git a/modules/vr/latest/VRFrameOfReferenceOptions.idl b/modules/vr/latest/VRFrameOfReferenceOptions.idl
new file mode 100644
index 0000000..66f955f
--- /dev/null
+++ b/modules/vr/latest/VRFrameOfReferenceOptions.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrframeofreference-interface
+[
+ SecureContext
+] dictionary VRFrameOfReferenceOptions {
+ boolean disableStageEmulation = false;
+ [EnforceRange] double stageEmulationHeight = 0.0;
+};
diff --git a/modules/vr/latest/VRSession.idl b/modules/vr/latest/VRSession.idl
new file mode 100644
index 0000000..cfd38e2
--- /dev/null
+++ b/modules/vr/latest/VRSession.idl
@@ -0,0 +1,23 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrsession-interface
+[
+ RuntimeEnabled=WebVR2
+] interface VRSession : EventTarget {
+ readonly attribute VRDevice device;
+ readonly attribute boolean exclusive;
+
+ attribute double depthNear;
+ attribute double depthFar;
+
+ attribute EventHandler onblur;
+ attribute EventHandler onfocus;
+ attribute EventHandler onresetpose;
+ attribute EventHandler onend;
+
+ [CallWith=ScriptState] Promise<VRFrameOfReference> requestFrameOfReference(VRFrameOfReferenceType type, [PermissiveDictionaryConversion] optional VRFrameOfReferenceOptions options);
+
+ [CallWith=ScriptState] Promise<void> end();
+};
diff --git a/modules/vr/latest/VRSessionCreationOptions.idl b/modules/vr/latest/VRSessionCreationOptions.idl
new file mode 100644
index 0000000..786d630
--- /dev/null
+++ b/modules/vr/latest/VRSessionCreationOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrsessioncreationoptions-interface
+[
+ SecureContext
+] dictionary VRSessionCreationOptions {
+ boolean exclusive = false;
+};
diff --git a/modules/vr/latest/VRSessionEvent.idl b/modules/vr/latest/VRSessionEvent.idl
new file mode 100644
index 0000000..68df3b3
--- /dev/null
+++ b/modules/vr/latest/VRSessionEvent.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrsessionevent-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2,
+ Constructor(DOMString type, VRSessionEventInit eventInitDict)
+] interface VRSessionEvent : Event {
+ readonly attribute VRSession session;
+};
\ No newline at end of file
diff --git a/modules/vr/latest/VRSessionEventInit.idl b/modules/vr/latest/VRSessionEventInit.idl
new file mode 100644
index 0000000..fc46fe2
--- /dev/null
+++ b/modules/vr/latest/VRSessionEventInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrsessionevent-interface
+[
+ SecureContext
+] dictionary VRSessionEventInit : EventInit {
+ required VRSession session;
+};
\ No newline at end of file
diff --git a/modules/vr/latest/VRStageBounds.idl b/modules/vr/latest/VRStageBounds.idl
new file mode 100644
index 0000000..2831aeb
--- /dev/null
+++ b/modules/vr/latest/VRStageBounds.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrstagebounds-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2
+] interface VRStageBounds {
+ readonly attribute FrozenArray<VRStageBoundsPoint> geometry;
+};
diff --git a/modules/vr/latest/VRStageBoundsPoint.idl b/modules/vr/latest/VRStageBoundsPoint.idl
new file mode 100644
index 0000000..55768fd
--- /dev/null
+++ b/modules/vr/latest/VRStageBoundsPoint.idl
@@ -0,0 +1,12 @@
+// Copyright 2017 The Chromium 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/webvr/spec/latest/#vrstageboundspoint-interface
+[
+ SecureContext,
+ RuntimeEnabled=WebVR2
+] interface VRStageBoundsPoint {
+ readonly attribute double x;
+ readonly attribute double z;
+};
diff --git a/modules/wake_lock/ScreenWakeLock.idl b/modules/wake_lock/ScreenWakeLock.idl
index 38b8d26..b005ad6 100644
--- a/modules/wake_lock/ScreenWakeLock.idl
+++ b/modules/wake_lock/ScreenWakeLock.idl
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-[RuntimeEnabled=WakeLock] partial interface Screen {
+[
+ ImplementedAs=ScreenWakeLock,
+ RuntimeEnabled=WakeLock
+] partial interface Screen {
attribute boolean keepAwake;
};
diff --git a/modules/webaudio/AnalyserNode.idl b/modules/webaudio/AnalyserNode.idl
index 854920e..49a80ad 100644
--- a/modules/webaudio/AnalyserNode.idl
+++ b/modules/webaudio/AnalyserNode.idl
@@ -10,18 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-analysernode-interface
+[
+ Constructor(BaseAudioContext context, optional AnalyserOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface AnalyserNode : AudioNode {
[RaisesException=Setter] attribute unsigned long fftSize;
readonly attribute unsigned long frequencyBinCount;
diff --git a/modules/webaudio/AnalyserOptions.idl b/modules/webaudio/AnalyserOptions.idl
new file mode 100644
index 0000000..8825426
--- /dev/null
+++ b/modules/webaudio/AnalyserOptions.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#analyseroptions
+dictionary AnalyserOptions : AudioNodeOptions {
+ unsigned long fftSize = 2048;
+ float maxDecibels = -30;
+ float minDecibels = -100;
+ float smoothingTimeConstant = 0.8;
+};
\ No newline at end of file
diff --git a/modules/webaudio/AudioBuffer.idl b/modules/webaudio/AudioBuffer.idl
index 155a9c6..08e683e 100644
--- a/modules/webaudio/AudioBuffer.idl
+++ b/modules/webaudio/AudioBuffer.idl
@@ -26,8 +26,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// See https://webaudio.github.io/web-audio-api/#AudioBuffer
[
- GarbageCollected,
+ Constructor(AudioBufferOptions options),
+ RaisesException=Constructor,
+ Measure
] interface AudioBuffer {
readonly attribute long length; // in sample-frames
readonly attribute double duration; // in seconds
diff --git a/modules/webaudio/AudioBufferCallback.idl b/modules/webaudio/AudioBufferCallback.idl
deleted file mode 100644
index 35241eb..0000000
--- a/modules/webaudio/AudioBufferCallback.idl
+++ /dev/null
@@ -1,28 +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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
- */
-
-callback interface AudioBufferCallback {
- void handleEvent(AudioBuffer audioBuffer);
- void handleEvent(DOMException exception);
-};
diff --git a/modules/webaudio/AudioBufferOptions.idl b/modules/webaudio/AudioBufferOptions.idl
new file mode 100644
index 0000000..a021652
--- /dev/null
+++ b/modules/webaudio/AudioBufferOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#audiobufferoptions
+dictionary AudioBufferOptions {
+ unsigned long numberOfChannels = 1;
+ required unsigned long length;
+ required float sampleRate;
+};
diff --git a/modules/webaudio/AudioBufferSourceNode.idl b/modules/webaudio/AudioBufferSourceNode.idl
index 3daec8c..1ea55cc 100644
--- a/modules/webaudio/AudioBufferSourceNode.idl
+++ b/modules/webaudio/AudioBufferSourceNode.idl
@@ -10,21 +10,30 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
// A cached (non-streamed), memory-resident audio source
-interface AudioBufferSourceNode : AudioSourceNode {
- [RaisesException=Setter] attribute AudioBuffer buffer;
+// See https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode
+[
+ Constructor(BaseAudioContext context, optional AudioBufferSourceOptions options),
+ RaisesException=Constructor,
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Measure
+]
+interface AudioBufferSourceNode : AudioScheduledSourceNode {
+ [RaisesException=Setter] attribute AudioBuffer? buffer;
readonly attribute AudioParam playbackRate;
readonly attribute AudioParam detune;
@@ -33,8 +42,6 @@
attribute double loopStart;
attribute double loopEnd;
- [RaisesException] void start(optional double when, optional double grainOffset, optional double grainDuration);
- [RaisesException] void stop(optional double when);
+ [RaisesException] void start(optional double when = 0, optional double grainOffset, optional double grainDuration);
- attribute EventHandler onended;
};
diff --git a/modules/webaudio/AudioBufferSourceOptions.idl b/modules/webaudio/AudioBufferSourceOptions.idl
new file mode 100644
index 0000000..5dd5e85
--- /dev/null
+++ b/modules/webaudio/AudioBufferSourceOptions.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#audiobuffersourceoptions
+dictionary AudioBufferSourceOptions {
+ AudioBuffer? buffer;
+ float detune = 0;
+ boolean loop = false;
+ double loopEnd = 0;
+ double loopStart = 0;
+ float playbackRate = 1;
+};
\ No newline at end of file
diff --git a/modules/webaudio/AudioContext.idl b/modules/webaudio/AudioContext.idl
index b56876e..c8297b2 100644
--- a/modules/webaudio/AudioContext.idl
+++ b/modules/webaudio/AudioContext.idl
@@ -11,86 +11,48 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-enum AudioContextState {
- "suspended",
- "running",
- "closed"
+enum AudioContextLatencyCategory {
+ "balanced",
+ "interactive",
+ "playback"
};
+// See https://webaudio.github.io/web-audio-api/#AudioContext
[
- GarbageCollected,
- DependentLifetime,
- Constructor,
+ ActiveScriptWrappable,
+ Constructor(optional AudioContextOptions contextOptions),
ConstructorCallWith=Document,
- ImplementedAs=AbstractAudioContext,
- NoInterfaceObject,
+ DependentLifetime,
RaisesException=Constructor,
-] interface AudioContext : EventTarget {
- // All rendered audio ultimately connects to destination, which represents the audio hardware.
- readonly attribute AudioDestinationNode destination;
-
- // All scheduled times are relative to this time in seconds.
- readonly attribute double currentTime;
-
- // All AudioNodes in the context run at this sample-rate (sample-frames per second).
- readonly attribute float sampleRate;
-
- // 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.
- [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptState] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional AudioBufferCallback successCallback, optional AudioBufferCallback errorCallback);
-
- // Sources
- [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourceNode createBufferSource();
-
- [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
-
- [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
- [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaStreamAudioDestinationNode createMediaStreamDestination();
-
- // Processing nodes
- [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain();
- [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(optional double maxDelayTime);
- [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode createBiquadFilter();
- [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode createIIRFilter(sequence<double> feedForward, sequence<double> feedBack);
- [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] 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] PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag, optional Dictionary options);
-
- // Channel splitting and merging
- [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs);
- [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs);
-
- // Close
+ Measure
+] interface AudioContext : BaseAudioContext {
+ [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendContext] Promise<void> suspend();
[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();
+ // Output timestamp
+ [MeasureAs=AudioContextGetOutputTimestamp, CallWith=ScriptState] AudioTimestamp getOutputTimestamp();
- attribute EventHandler onstatechange;
+ // Number of seconds of processing latency incurred by the AudioContext
+ // passing the audio from the AudioDestinationNode to the audio subsystem
+ readonly attribute double baseLatency;
+
+ // Sources
+ // TODO(rtoy): The following methods should be here instead of in BaseAudioContext:
+ //
+ // createMediaElementSource(HTMLMediaElement mediaElement)
+ // createMediaStreamSource(MediaStream mediaStream)
+ // createMediaStreamDestination()
};
diff --git a/modules/webaudio/AudioContextOptions.idl b/modules/webaudio/AudioContextOptions.idl
new file mode 100644
index 0000000..6fc6a38
--- /dev/null
+++ b/modules/webaudio/AudioContextOptions.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#audiocontextoptions
+dictionary AudioContextOptions {
+ // If passed as a double this should be the requested output latency in
+ // seconds, without taking into account double buffering (same as
+ // AudioContext.baseLatency).
+ (AudioContextLatencyCategory or double) latencyHint = "interactive";
+};
diff --git a/modules/webaudio/AudioDestinationNode.idl b/modules/webaudio/AudioDestinationNode.idl
index f638bb2..2991173 100644
--- a/modules/webaudio/AudioDestinationNode.idl
+++ b/modules/webaudio/AudioDestinationNode.idl
@@ -10,18 +10,20 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#AudioDestinationNode
interface AudioDestinationNode : AudioNode {
readonly attribute unsigned long maxChannelCount;
};
diff --git a/modules/webaudio/AudioListener.idl b/modules/webaudio/AudioListener.idl
index 843e290..7cc1cd7 100644
--- a/modules/webaudio/AudioListener.idl
+++ b/modules/webaudio/AudioListener.idl
@@ -26,13 +26,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface AudioListener {
- [DeprecateAs=AudioListenerDopplerFactor] attribute float dopplerFactor; // same as OpenAL (default 1.0)
- [DeprecateAs=AudioListenerSpeedOfSound] attribute float speedOfSound; // in meters / second (default 343.3)
+// See https://webaudio.github.io/web-audio-api/#AudioListener
+interface AudioListener {
+ [MeasureAs=AudioListenerSetPosition] void setPosition(float x, float y, float z);
+ [MeasureAs=AudioListenerSetOrientation] void setOrientation(float x, float y, float z, float xUp, float yUp, float zUp);
- void setPosition(float x, float y, float z);
- void setOrientation(float x, float y, float z, float xUp, float yUp, float zUp);
- [DeprecateAs=AudioListenerSetVelocity] void setVelocity(float x, float y, float z);
+ // Location of the listener
+ readonly attribute AudioParam positionX;
+ readonly attribute AudioParam positionY;
+ readonly attribute AudioParam positionZ;
+
+ // Forward direction vector of the listener
+ readonly attribute AudioParam forwardX;
+ readonly attribute AudioParam forwardY;
+ readonly attribute AudioParam forwardZ;
+
+ // Up direction vector for the listener
+ readonly attribute AudioParam upX;
+ readonly attribute AudioParam upY;
+ readonly attribute AudioParam upZ;
};
diff --git a/modules/webaudio/AudioNode.idl b/modules/webaudio/AudioNode.idl
index 7dbb3a8..516456f 100644
--- a/modules/webaudio/AudioNode.idl
+++ b/modules/webaudio/AudioNode.idl
@@ -10,18 +10,21 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// https://webaudio.github.io/web-audio-api/#the-audionode-interface
+
enum ChannelCountMode {
"max",
"clamped-max",
@@ -33,11 +36,7 @@
"discrete"
};
-// http://webaudio.github.io/web-audio-api/#idl-def-AudioNode
-
-[
- GarbageCollected,
-] interface AudioNode : EventTarget {
+interface AudioNode : EventTarget {
[RaisesException, MeasureAs=AudioNodeConnectToAudioNode] AudioNode connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
[RaisesException, MeasureAs=AudioNodeConnectToAudioParam] void connect(AudioParam destination, optional unsigned long output = 0);
void disconnect();
@@ -47,7 +46,7 @@
[RaisesException, MeasureAs=AudioNodeDisconnectFromAudioNode] void disconnect(AudioNode destination, unsigned long output, unsigned long input);
[RaisesException, MeasureAs=AudioNodeDisconnectFromAudioParam] void disconnect(AudioParam destination);
[RaisesException, MeasureAs=AudioNodeDisconnectFromAudioParam] void disconnect(AudioParam destination, unsigned long output);
- readonly attribute AudioContext context;
+ readonly attribute BaseAudioContext context;
readonly attribute unsigned long numberOfInputs;
readonly attribute unsigned long numberOfOutputs;
[RaisesException=Setter] attribute unsigned long channelCount;
diff --git a/modules/webaudio/AudioNodeOptions.idl b/modules/webaudio/AudioNodeOptions.idl
new file mode 100644
index 0000000..48ca7cc
--- /dev/null
+++ b/modules/webaudio/AudioNodeOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#dictionary-audionodeoptions-members
+dictionary AudioNodeOptions {
+ unsigned long channelCount;
+ ChannelCountMode channelCountMode;
+ ChannelInterpretation channelInterpretation;
+};
diff --git a/modules/webaudio/AudioParam.idl b/modules/webaudio/AudioParam.idl
index 02501ec..7be04a6 100644
--- a/modules/webaudio/AudioParam.idl
+++ b/modules/webaudio/AudioParam.idl
@@ -26,12 +26,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface AudioParam {
+// See https://webaudio.github.io/web-audio-api/#AudioParam
+interface AudioParam {
attribute float value;
readonly attribute float defaultValue;
+ // Nominal range for the value.
+ readonly attribute float minValue;
+ readonly attribute float maxValue;
+
// Parameter automation.
[RaisesException, MeasureAs=AudioParamSetValueAtTime] AudioParam setValueAtTime(float value, double time);
[RaisesException, MeasureAs=AudioParamLinearRampToValueAtTime] AudioParam linearRampToValueAtTime(float value, double time);
@@ -42,9 +45,12 @@
// 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.
- [RaisesException, MeasureAs=AudioParamSetValueCurveAtTime] AudioParam setValueCurveAtTime(Float32Array values, double time, double duration);
+ [RaisesException, MeasureAs=AudioParamSetValueCurveAtTime] AudioParam setValueCurveAtTime(sequence<float> values, double time, double duration);
// Cancels all scheduled parameter changes with times greater than or equal to startTime.
[RaisesException, MeasureAs=AudioParamCancelScheduledValues] AudioParam cancelScheduledValues(double startTime);
+ // Cancel scheduled parameter changes and hold the last value
+ [RaisesException, MeasureAs=AudioParamCancelAndHoldAtTime] AudioParam cancelAndHoldAtTime(double startTime);
+
};
diff --git a/modules/webaudio/AudioParamDescriptor.idl b/modules/webaudio/AudioParamDescriptor.idl
new file mode 100644
index 0000000..70cd045
--- /dev/null
+++ b/modules/webaudio/AudioParamDescriptor.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#idl-def-AudioParamDescriptor
+dictionary AudioParamDescriptor {
+ required DOMString name;
+ float defaultValue = 0;
+
+ // TODO(hongchan): These numbers are minimum/maximum number possible for
+ // |float| type. Remove this comment when the spec is fixed.
+ float minValue = -3.4028235e38;
+ float maxValue = 3.4028235e38;
+};
diff --git a/modules/webaudio/AudioParamMap.idl b/modules/webaudio/AudioParamMap.idl
new file mode 100644
index 0000000..740c70f
--- /dev/null
+++ b/modules/webaudio/AudioParamMap.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#idl-def-AudioParamMap
+[
+ RuntimeEnabled=AudioWorklet
+] interface AudioParamMap {
+ readonly maplike<DOMString, AudioParam>;
+};
diff --git a/modules/webaudio/AudioProcessingEvent.idl b/modules/webaudio/AudioProcessingEvent.idl
index b897a7f..ad82edd 100644
--- a/modules/webaudio/AudioProcessingEvent.idl
+++ b/modules/webaudio/AudioProcessingEvent.idl
@@ -10,18 +10,23 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-audioprocessingevent-interface---deprecated
+[
+ Constructor(DOMString type, AudioProcessingEventInit eventInitDict)
+]
interface AudioProcessingEvent : Event {
readonly attribute double playbackTime;
readonly attribute AudioBuffer inputBuffer;
diff --git a/modules/webaudio/AudioProcessingEventInit.idl b/modules/webaudio/AudioProcessingEventInit.idl
new file mode 100644
index 0000000..eda9d93
--- /dev/null
+++ b/modules/webaudio/AudioProcessingEventInit.idl
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#audioprocessingeventinit
+dictionary AudioProcessingEventInit : EventInit {
+ required double playbackTime;
+ required AudioBuffer inputBuffer;
+ required AudioBuffer outputBuffer;
+};
diff --git a/modules/webaudio/AudioScheduledSourceNode.idl b/modules/webaudio/AudioScheduledSourceNode.idl
new file mode 100644
index 0000000..adc0ab9
--- /dev/null
+++ b/modules/webaudio/AudioScheduledSourceNode.idl
@@ -0,0 +1,14 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/
+[
+ ActiveScriptWrappable,
+ DependentLifetime
+]
+interface AudioScheduledSourceNode : AudioNode {
+ [RaisesException] void start(optional double when);
+ [RaisesException] void stop(optional double when);
+ attribute EventHandler onended;
+};
diff --git a/modules/webaudio/AudioSourceNode.idl b/modules/webaudio/AudioSourceNode.idl
deleted file mode 100644
index 04bc6ee..0000000
--- a/modules/webaudio/AudioSourceNode.idl
+++ /dev/null
@@ -1,33 +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.
- * 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.
- */
-
-[
- NoInterfaceObject,
- DependentLifetime
-] interface AudioSourceNode : AudioNode {
-};
diff --git a/modules/webaudio/AudioTimestamp.idl b/modules/webaudio/AudioTimestamp.idl
new file mode 100644
index 0000000..e1b738e
--- /dev/null
+++ b/modules/webaudio/AudioTimestamp.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#audiotimestamp
+dictionary AudioTimestamp {
+ double contextTime;
+ DOMHighResTimeStamp performanceTime;
+};
diff --git a/modules/webaudio/AudioWorkletGlobalScope.idl b/modules/webaudio/AudioWorkletGlobalScope.idl
new file mode 100644
index 0000000..fe9de84
--- /dev/null
+++ b/modules/webaudio/AudioWorkletGlobalScope.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#AudioWorkletGlobalScope
+
+[
+ Exposed=AudioWorklet,
+ Global=(Worklet,AudioWorklet),
+ RuntimeEnabled=AudioWorklet
+] interface AudioWorkletGlobalScope : WorkletGlobalScope {
+ [RaisesException] void registerProcessor(DOMString name, Function processorConstructor);
+ readonly attribute double currentTime;
+ readonly attribute float sampleRate;
+};
diff --git a/modules/webaudio/AudioWorkletNode.idl b/modules/webaudio/AudioWorkletNode.idl
new file mode 100644
index 0000000..d2258a6
--- /dev/null
+++ b/modules/webaudio/AudioWorkletNode.idl
@@ -0,0 +1,20 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#AudioWorkletNode
+
+[
+ ActiveScriptWrappable,
+ Constructor(BaseAudioContext context, DOMString name, optional AudioWorkletNodeOptions options),
+ DependentLifetime,
+ Global=(Worklet,AudioWorklet),
+ RaisesException=Constructor,
+ RuntimeEnabled=AudioWorklet
+] interface AudioWorkletNode : AudioNode {
+ readonly attribute AudioParamMap parameters;
+ // TODO(hongchan): Implement the following.
+ // readonly attribute MessagePort port;
+ // readonly attribute AudioWorkletProcessorState processorState;
+ // attribute EventHandler onprocessorstatechange;
+};
diff --git a/modules/webaudio/AudioWorkletNodeOptions.idl b/modules/webaudio/AudioWorkletNodeOptions.idl
new file mode 100644
index 0000000..45458dd
--- /dev/null
+++ b/modules/webaudio/AudioWorkletNodeOptions.idl
@@ -0,0 +1,11 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#AudioWorkletNodeOptions
+dictionary AudioWorkletNodeOptions : AudioNodeOptions {
+ unsigned long numberOfInputs = 1;
+ unsigned long numberOfOutputs = 1;
+ sequence<unsigned long> outputChannelCount;
+ record<DOMString, double> parameterData;
+};
diff --git a/modules/webaudio/AudioWorkletProcessor.idl b/modules/webaudio/AudioWorkletProcessor.idl
new file mode 100644
index 0000000..de8a36f
--- /dev/null
+++ b/modules/webaudio/AudioWorkletProcessor.idl
@@ -0,0 +1,14 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#AudioWorkletProcessor
+
+[
+ Exposed=AudioWorklet,
+ Global=(Worklet,AudioWorklet),
+ RuntimeEnabled=AudioWorklet
+] interface AudioWorkletProcessor {
+ // TODO(hongchan): Implement the following.
+ // readonly attribute MessagePort port;
+};
diff --git a/modules/webaudio/BaseAudioContext.idl b/modules/webaudio/BaseAudioContext.idl
new file mode 100644
index 0000000..267005a
--- /dev/null
+++ b/modules/webaudio/BaseAudioContext.idl
@@ -0,0 +1,73 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#BaseAudioContext
+
+enum AudioContextState {
+ "suspended",
+ "running",
+ "closed"
+};
+
+callback DecodeErrorCallback = void (DOMException error);
+callback DecodeSuccessCallback = void (AudioBuffer decodedData);
+
+[
+ ActiveScriptWrappable,
+ DependentLifetime
+] interface BaseAudioContext : EventTarget {
+ // All rendered audio ultimately connects to destination, which represents the audio hardware.
+ readonly attribute AudioDestinationNode destination;
+
+ // All scheduled times are relative to this time in seconds.
+ readonly attribute double currentTime;
+
+ // All AudioNodes in the context run at this sample-rate (sample-frames per second).
+ readonly attribute float sampleRate;
+
+ // 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.
+ [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptState] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional DecodeSuccessCallback successCallback, optional DecodeErrorCallback errorCallback);
+
+ // Sources
+ [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourceNode createBufferSource();
+ [RaisesException, MeasureAs=AudioContextCreateConstantSource] ConstantSourceNode createConstantSource();
+
+ // Processing nodes
+ [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain();
+ [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(optional double maxDelayTime);
+ [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode createBiquadFilter();
+ [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode createIIRFilter(sequence<double> feedForward, sequence<double> feedBack);
+ [RaisesException, MeasureAs=AudioContextCreateWaveShaper] WaveShaperNode createWaveShaper();
+ [RaisesException, MeasureAs=AudioContextCreatePannerAutomated] PannerNode createPanner();
+ [RaisesException, MeasureAs=AudioContextCreateConvolver] ConvolverNode createConvolver();
+ [RaisesException, MeasureAs=AudioContextCreateDynamicsCompressor] DynamicsCompressorNode createDynamicsCompressor();
+ [RaisesException, MeasureAs=AudioContextCreateAnalyser] AnalyserNode createAnalyser();
+ [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] 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] PeriodicWave createPeriodicWave(sequence<float> real, sequence<float> imag, optional PeriodicWaveConstraints options);
+
+ // Channel splitting and merging
+ [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs);
+ [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs);
+
+ // Pause/resume
+ [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeContext] Promise<void> resume();
+
+ // TODO(rtoy): These really belong to the AudioContext, but we need them
+ // here so we can use an offline audio context to test these.
+ [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
+ [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
+ [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaStreamAudioDestinationNode createMediaStreamDestination();
+
+ attribute EventHandler onstatechange;
+};
diff --git a/modules/webaudio/BiquadFilterNode.idl b/modules/webaudio/BiquadFilterNode.idl
index 0a16aab..90f76ee 100644
--- a/modules/webaudio/BiquadFilterNode.idl
+++ b/modules/webaudio/BiquadFilterNode.idl
@@ -10,18 +10,20 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-biquadfilternode-interface
enum BiquadFilterType {
"lowpass",
"highpass",
@@ -33,6 +35,11 @@
"allpass"
};
+[
+ Constructor(BaseAudioContext context, optional BiquadFilterOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface BiquadFilterNode : AudioNode {
attribute BiquadFilterType type;
diff --git a/modules/webaudio/BiquadFilterOptions.idl b/modules/webaudio/BiquadFilterOptions.idl
new file mode 100644
index 0000000..3d8c7b8
--- /dev/null
+++ b/modules/webaudio/BiquadFilterOptions.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#biquadfilteroptions
+dictionary BiquadFilterOptions : AudioNodeOptions {
+ BiquadFilterType type = "lowpass";
+ float Q = 1;
+ float detune = 0;
+ float frequency = 350;
+ float gain = 0;
+};
\ No newline at end of file
diff --git a/modules/webaudio/ChannelMergerNode.idl b/modules/webaudio/ChannelMergerNode.idl
index 5d27dde..7573a9f 100644
--- a/modules/webaudio/ChannelMergerNode.idl
+++ b/modules/webaudio/ChannelMergerNode.idl
@@ -26,5 +26,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// See https://webaudio.github.io/web-audio-api/#the-channelmergernode-interface
+[
+ Constructor(BaseAudioContext context, optional ChannelMergerOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface ChannelMergerNode : AudioNode {
};
diff --git a/modules/webaudio/ChannelMergerOptions.idl b/modules/webaudio/ChannelMergerOptions.idl
new file mode 100644
index 0000000..1e9e7d2
--- /dev/null
+++ b/modules/webaudio/ChannelMergerOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#channelmergeroptions
+dictionary ChannelMergerOptions : AudioNodeOptions {
+ unsigned long numberOfInputs = 6;
+};
\ No newline at end of file
diff --git a/modules/webaudio/ChannelSplitterNode.idl b/modules/webaudio/ChannelSplitterNode.idl
index 413ee74..c651a69 100644
--- a/modules/webaudio/ChannelSplitterNode.idl
+++ b/modules/webaudio/ChannelSplitterNode.idl
@@ -10,17 +10,24 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-channelsplitternode-interface
+[
+ Constructor(BaseAudioContext context, optional ChannelSplitterOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface ChannelSplitterNode : AudioNode {
};
diff --git a/modules/webaudio/ChannelSplitterOptions.idl b/modules/webaudio/ChannelSplitterOptions.idl
new file mode 100644
index 0000000..b97a616
--- /dev/null
+++ b/modules/webaudio/ChannelSplitterOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#channelsplitteroptions
+dictionary ChannelSplitterOptions : AudioNodeOptions {
+ unsigned long numberOfOutputs = 6;
+};
\ No newline at end of file
diff --git a/modules/webaudio/ConstantSourceNode.idl b/modules/webaudio/ConstantSourceNode.idl
new file mode 100644
index 0000000..b281ad2
--- /dev/null
+++ b/modules/webaudio/ConstantSourceNode.idl
@@ -0,0 +1,15 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#ConstantSourceNode
+[
+ Constructor(BaseAudioContext context, optional ConstantSourceOptions options),
+ RaisesException=Constructor,
+ ActiveScriptWrappable,
+ DependentLifetime,
+ Measure
+]
+interface ConstantSourceNode : AudioScheduledSourceNode {
+ readonly attribute AudioParam offset;
+};
diff --git a/modules/webaudio/ConstantSourceOptions.idl b/modules/webaudio/ConstantSourceOptions.idl
new file mode 100644
index 0000000..5cd584c
--- /dev/null
+++ b/modules/webaudio/ConstantSourceOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#constantsourceoptions
+dictionary ConstantSourceOptions {
+ float offset = 1;
+};
\ No newline at end of file
diff --git a/modules/webaudio/ConvolverNode.idl b/modules/webaudio/ConvolverNode.idl
index e797e5c..53559c5 100644
--- a/modules/webaudio/ConvolverNode.idl
+++ b/modules/webaudio/ConvolverNode.idl
@@ -10,19 +10,26 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
// A linear convolution effect
+// See https://webaudio.github.io/web-audio-api/#ConvolverNode
+[
+ Constructor(BaseAudioContext context, optional ConvolverOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface ConvolverNode : AudioNode {
[RaisesException=Setter] attribute AudioBuffer? buffer;
attribute boolean normalize;
diff --git a/modules/webaudio/ConvolverOptions.idl b/modules/webaudio/ConvolverOptions.idl
new file mode 100644
index 0000000..4db8a86
--- /dev/null
+++ b/modules/webaudio/ConvolverOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#convolveroptions
+dictionary ConvolverOptions : AudioNodeOptions {
+ AudioBuffer? buffer;
+ boolean disableNormalization = false;
+};
diff --git a/modules/webaudio/DelayNode.idl b/modules/webaudio/DelayNode.idl
index a6a0f18..cc9d24c 100644
--- a/modules/webaudio/DelayNode.idl
+++ b/modules/webaudio/DelayNode.idl
@@ -10,18 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#DelayNode
+[
+ Constructor(BaseAudioContext context, optional DelayOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface DelayNode : AudioNode {
readonly attribute AudioParam delayTime;
};
diff --git a/modules/webaudio/DelayOptions.idl b/modules/webaudio/DelayOptions.idl
new file mode 100644
index 0000000..9ace73f
--- /dev/null
+++ b/modules/webaudio/DelayOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#delayoptions
+dictionary DelayOptions : AudioNodeOptions {
+ double maxDelayTime = 1;
+ double delayTime = 0;
+};
\ No newline at end of file
diff --git a/modules/webaudio/DynamicsCompressorNode.idl b/modules/webaudio/DynamicsCompressorNode.idl
index b6a6633..1aee711 100644
--- a/modules/webaudio/DynamicsCompressorNode.idl
+++ b/modules/webaudio/DynamicsCompressorNode.idl
@@ -10,23 +10,30 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-dynamicscompressornode-interface
+[
+ Constructor(BaseAudioContext context, optional DynamicsCompressorOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface DynamicsCompressorNode : AudioNode {
readonly attribute AudioParam threshold; // in Decibels
readonly attribute AudioParam knee; // in Decibels
readonly attribute AudioParam ratio; // unit-less
- readonly attribute AudioParam reduction; // in Decibels
+ readonly attribute float reduction; // in Decibels
readonly attribute AudioParam attack; // in Seconds
readonly attribute AudioParam release; // in Seconds
};
diff --git a/modules/webaudio/DynamicsCompressorOptions.idl b/modules/webaudio/DynamicsCompressorOptions.idl
new file mode 100644
index 0000000..d182297
--- /dev/null
+++ b/modules/webaudio/DynamicsCompressorOptions.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#dynamicscompressoroptions
+dictionary DynamicsCompressorOptions : AudioNodeOptions {
+ float attack = 0.003;
+ float knee = 30;
+ float ratio = 12;
+ float release = 0.25;
+ float threshold = -24;
+};
\ No newline at end of file
diff --git a/modules/webaudio/GainNode.idl b/modules/webaudio/GainNode.idl
index 60f5fdd..74eb6c1 100644
--- a/modules/webaudio/GainNode.idl
+++ b/modules/webaudio/GainNode.idl
@@ -10,18 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#GainNode
+[
+ Constructor(BaseAudioContext context, optional GainOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface GainNode : AudioNode {
// FIXME: eventually it will be interesting to remove the readonly restriction, but need to properly deal with thread safety here.
readonly attribute AudioParam gain;
diff --git a/modules/webaudio/GainOptions.idl b/modules/webaudio/GainOptions.idl
new file mode 100644
index 0000000..65fb4fe
--- /dev/null
+++ b/modules/webaudio/GainOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#gainoptions
+dictionary GainOptions : AudioNodeOptions {
+ float gain = 1;
+};
diff --git a/modules/webaudio/IIRFilterNode.idl b/modules/webaudio/IIRFilterNode.idl
index 313e516..1780a79 100644
--- a/modules/webaudio/IIRFilterNode.idl
+++ b/modules/webaudio/IIRFilterNode.idl
@@ -2,8 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// See https://webaudio.github.io/web-audio-api/#the-iirfilternode-interface
+[
+ Constructor(BaseAudioContext context, IIRFilterOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface IIRFilterNode : AudioNode {
[RaisesException] void getFrequencyResponse(Float32Array frequencyHz,
Float32Array magResponse,
Float32Array phaseResponse);
-};
\ No newline at end of file
+};
diff --git a/modules/webaudio/IIRFilterOptions.idl b/modules/webaudio/IIRFilterOptions.idl
new file mode 100644
index 0000000..b42d86d
--- /dev/null
+++ b/modules/webaudio/IIRFilterOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#iirfilteroptions
+dictionary IIRFilterOptions : AudioNodeOptions {
+ required sequence<double> feedforward;
+ required sequence<double> feedback;
+};
diff --git a/modules/webaudio/MediaElementAudioSourceNode.idl b/modules/webaudio/MediaElementAudioSourceNode.idl
index 8f96e41..5d1260f 100644
--- a/modules/webaudio/MediaElementAudioSourceNode.idl
+++ b/modules/webaudio/MediaElementAudioSourceNode.idl
@@ -10,18 +10,26 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-interface MediaElementAudioSourceNode : AudioSourceNode {
- readonly attribute HTMLMediaElement mediaElement;
+// See https://webaudio.github.io/web-audio-api/#MediaElementAudioSourceNode
+[
+ // TODO(rtoy): This should be AudioContext, not BaseAudioContext.
+ Constructor(BaseAudioContext context, MediaElementAudioSourceOptions options),
+ RaisesException=Constructor,
+ Measure
+]
+interface MediaElementAudioSourceNode : AudioNode {
+ [SameObject] readonly attribute HTMLMediaElement mediaElement;
};
diff --git a/modules/webaudio/MediaElementAudioSourceOptions.idl b/modules/webaudio/MediaElementAudioSourceOptions.idl
new file mode 100644
index 0000000..d5d5641
--- /dev/null
+++ b/modules/webaudio/MediaElementAudioSourceOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#mediaelementaudiosourceoptions
+dictionary MediaElementAudioSourceOptions {
+ required HTMLMediaElement mediaElement;
+};
diff --git a/modules/webaudio/MediaStreamAudioDestinationNode.idl b/modules/webaudio/MediaStreamAudioDestinationNode.idl
index 971e607..dc74efa 100644
--- a/modules/webaudio/MediaStreamAudioDestinationNode.idl
+++ b/modules/webaudio/MediaStreamAudioDestinationNode.idl
@@ -10,18 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-mediastreamaudiodestinationnode-interface
+[
+ Constructor(BaseAudioContext context, optional AudioNodeOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface MediaStreamAudioDestinationNode : AudioNode {
readonly attribute MediaStream stream;
};
diff --git a/modules/webaudio/MediaStreamAudioSourceNode.idl b/modules/webaudio/MediaStreamAudioSourceNode.idl
index 6da028b..999d6a7 100644
--- a/modules/webaudio/MediaStreamAudioSourceNode.idl
+++ b/modules/webaudio/MediaStreamAudioSourceNode.idl
@@ -10,18 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
-interface MediaStreamAudioSourceNode : AudioSourceNode {
- readonly attribute MediaStream mediaStream;
+// See https://webaudio.github.io/web-audio-api/#MediaStreamAudioSourceNode
+[
+ Constructor(BaseAudioContext context, MediaStreamAudioSourceOptions options),
+ RaisesException=Constructor,
+ Measure
+]
+interface MediaStreamAudioSourceNode : AudioNode {
+ [SameObject, ImplementedAs=getMediaStream] readonly attribute MediaStream mediaStream;
};
diff --git a/modules/webaudio/MediaStreamAudioSourceOptions.idl b/modules/webaudio/MediaStreamAudioSourceOptions.idl
new file mode 100644
index 0000000..7d74a79
--- /dev/null
+++ b/modules/webaudio/MediaStreamAudioSourceOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#mediastreamaudiosourceoptions
+dictionary MediaStreamAudioSourceOptions {
+ required MediaStream mediaStream;
+};
diff --git a/modules/webaudio/OfflineAudioCompletionEvent.idl b/modules/webaudio/OfflineAudioCompletionEvent.idl
index 6529fac..4aed122 100644
--- a/modules/webaudio/OfflineAudioCompletionEvent.idl
+++ b/modules/webaudio/OfflineAudioCompletionEvent.idl
@@ -10,18 +10,23 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#OfflineAudioCompletionEvent
+[
+ Constructor(DOMString type, OfflineAudioCompletionEventInit eventInitDict)
+]
interface OfflineAudioCompletionEvent : Event {
readonly attribute AudioBuffer renderedBuffer;
};
diff --git a/modules/webaudio/OfflineAudioCompletionEventInit.idl b/modules/webaudio/OfflineAudioCompletionEventInit.idl
new file mode 100644
index 0000000..c70ba7c
--- /dev/null
+++ b/modules/webaudio/OfflineAudioCompletionEventInit.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#offlineaudiocompletioneventinit
+dictionary OfflineAudioCompletionEventInit : EventInit {
+ required AudioBuffer renderedBuffer;
+};
diff --git a/modules/webaudio/OfflineAudioContext.idl b/modules/webaudio/OfflineAudioContext.idl
index 1f91f8f..92d713d 100644
--- a/modules/webaudio/OfflineAudioContext.idl
+++ b/modules/webaudio/OfflineAudioContext.idl
@@ -10,27 +10,30 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#OfflineAudioContext
[
Constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate),
+ Constructor(OfflineAudioContextOptions options),
ConstructorCallWith=ExecutionContext,
RaisesException=Constructor,
- NoInterfaceObject,
-] interface OfflineAudioContext : AudioContext {
+ Measure
+] interface OfflineAudioContext : BaseAudioContext {
// Offline rendering
attribute EventHandler oncomplete;
+ readonly attribute unsigned long length;
[CallWith=ScriptState, ImplementedAs=startOfflineRendering, MeasureAs=OfflineAudioContextStartRendering] Promise<AudioBuffer> startRendering();
[CallWith=ScriptState, ImplementedAs=suspendContext, MeasureAs=OfflineAudioContextSuspend] Promise<void> suspend(double suspendTime);
- [CallWith=ScriptState, ImplementedAs=resumeContext, MeasureAs=OfflineAudioContextResume] Promise<void> resume();
};
diff --git a/modules/webaudio/OfflineAudioContextOptions.idl b/modules/webaudio/OfflineAudioContextOptions.idl
new file mode 100644
index 0000000..99a9383
--- /dev/null
+++ b/modules/webaudio/OfflineAudioContextOptions.idl
@@ -0,0 +1,10 @@
+// Copyright 2017 The Chromium 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://webaudio.github.io/web-audio-api/#offlineaudiocontextoptions
+dictionary OfflineAudioContextOptions {
+ unsigned long numberOfChannels = 1;
+ required unsigned long length;
+ required float sampleRate;
+};
diff --git a/modules/webaudio/OscillatorNode.idl b/modules/webaudio/OscillatorNode.idl
index 0440252..1f3e305 100644
--- a/modules/webaudio/OscillatorNode.idl
+++ b/modules/webaudio/OscillatorNode.idl
@@ -10,18 +10,20 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-oscillatornode-interface
enum OscillatorType {
"sine",
"square",
@@ -31,17 +33,17 @@
};
// OscillatorNode is an audio generator of periodic waveforms.
-interface OscillatorNode : AudioSourceNode {
+[
+ Constructor(BaseAudioContext context, optional OscillatorOptions options),
+ RaisesException=Constructor,
+ Measure
+]
+interface OscillatorNode : AudioScheduledSourceNode {
[RaisesException=Setter] attribute OscillatorType type;
readonly attribute AudioParam frequency; // in Hertz
readonly attribute AudioParam detune; // in Cents
- [RaisesException] void start(optional double when);
- [RaisesException] void stop(optional double when);
-
void setPeriodicWave(PeriodicWave periodicWave);
-
- attribute EventHandler onended;
};
diff --git a/modules/webaudio/OscillatorOptions.idl b/modules/webaudio/OscillatorOptions.idl
new file mode 100644
index 0000000..689ec4a
--- /dev/null
+++ b/modules/webaudio/OscillatorOptions.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#oscillatoroptions
+dictionary OscillatorOptions : AudioNodeOptions {
+ OscillatorType type = "sine";
+ float detune = 0;
+ float frequency = 440;
+ PeriodicWave? periodicWave;
+};
\ No newline at end of file
diff --git a/modules/webaudio/PannerNode.idl b/modules/webaudio/PannerNode.idl
index d69f4d6..e182b19 100644
--- a/modules/webaudio/PannerNode.idl
+++ b/modules/webaudio/PannerNode.idl
@@ -10,18 +10,20 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-pannernode-interface
enum PanningModelType {
"equalpower",
"HRTF"
@@ -34,21 +36,31 @@
};
[
- NoInterfaceObject,
+ Constructor(BaseAudioContext context, optional PannerOptions options),
+ RaisesException=Constructor,
+ Measure
] interface PannerNode : AudioNode {
// Default model for stereo is equalpower.
attribute PanningModelType panningModel;
// Uses a 3D cartesian coordinate system
- void setPosition(float x, float y, float z);
- void setOrientation(float x, float y, float z);
- void setVelocity(float x, float y, float z);
+ [MeasureAs=PannerNodeSetPosition] void setPosition(float x, float y, float z);
+ [MeasureAs=PannerNodeSetOrientation] void setOrientation(float x, float y, float z);
+
+ // Uses a 3D cartesian coordinate system
+ readonly attribute AudioParam positionX;
+ readonly attribute AudioParam positionY;
+ readonly attribute AudioParam positionZ;
+
+ readonly attribute AudioParam orientationX;
+ readonly attribute AudioParam orientationY;
+ readonly attribute AudioParam orientationZ;
// Distance model
attribute DistanceModelType distanceModel;
- attribute double refDistance;
- attribute double maxDistance;
+ [RaisesException=Setter] attribute double refDistance;
+ [RaisesException=Setter] attribute double maxDistance;
attribute double rolloffFactor;
// Directional sound cone
diff --git a/modules/webaudio/PannerOptions.idl b/modules/webaudio/PannerOptions.idl
new file mode 100644
index 0000000..4cf7042
--- /dev/null
+++ b/modules/webaudio/PannerOptions.idl
@@ -0,0 +1,23 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#panneroptions
+dictionary PannerOptions : AudioNodeOptions {
+ PanningModelType panningModel = "equalpower";
+ DistanceModelType distanceModel = "inverse";
+
+ float positionX = 0;
+ float positionY = 0;
+ float positionZ = 0;
+ float orientationX = 1;
+ float orientationY = 0;
+ float orientationZ = 0;
+
+ double refDistance = 1;
+ double maxDistance= 10000;
+ double rolloffFactor = 1;
+ double coneInnerAngle = 360;
+ double coneOuterAngle = 360;
+ double coneOuterGain = 0;
+};
\ No newline at end of file
diff --git a/modules/webaudio/PeriodicWave.idl b/modules/webaudio/PeriodicWave.idl
index bf70cbd..9ae8e25 100644
--- a/modules/webaudio/PeriodicWave.idl
+++ b/modules/webaudio/PeriodicWave.idl
@@ -10,21 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
// PeriodicWave represents a periodic audio waveform given by its Fourier coefficients.
+// See https://webaudio.github.io/web-audio-api/#the-periodicwave-interface
[
- GarbageCollected
-] interface PeriodicWave {
-
+ Constructor(BaseAudioContext context, optional PeriodicWaveOptions options),
+ RaisesException=Constructor,
+ Measure
+]
+interface PeriodicWave {
};
diff --git a/modules/webaudio/PeriodicWaveConstraints.idl b/modules/webaudio/PeriodicWaveConstraints.idl
new file mode 100644
index 0000000..6c8e689
--- /dev/null
+++ b/modules/webaudio/PeriodicWaveConstraints.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#periodicwaveconstraints
+dictionary PeriodicWaveConstraints {
+ boolean disableNormalization = false;
+};
diff --git a/modules/webaudio/PeriodicWaveOptions.idl b/modules/webaudio/PeriodicWaveOptions.idl
new file mode 100644
index 0000000..f797ce2
--- /dev/null
+++ b/modules/webaudio/PeriodicWaveOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#periodicwaveoptions
+dictionary PeriodicWaveOptions : PeriodicWaveConstraints {
+ sequence<float> real;
+ sequence<float> imag;
+};
\ No newline at end of file
diff --git a/modules/webaudio/ScriptProcessorNode.idl b/modules/webaudio/ScriptProcessorNode.idl
index 382e384..7dd75e0 100644
--- a/modules/webaudio/ScriptProcessorNode.idl
+++ b/modules/webaudio/ScriptProcessorNode.idl
@@ -10,20 +10,25 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#the-scriptprocessornode-interface---deprecated
// For real-time audio stream synthesis/processing in JavaScript
-interface ScriptProcessorNode : AudioNode {
+[
+ ActiveScriptWrappable,
+ DependentLifetime
+] interface ScriptProcessorNode : AudioNode {
// Rendering callback
attribute EventHandler onaudioprocess;
diff --git a/modules/webaudio/StereoPannerNode.idl b/modules/webaudio/StereoPannerNode.idl
index d0a7776..355fb12 100644
--- a/modules/webaudio/StereoPannerNode.idl
+++ b/modules/webaudio/StereoPannerNode.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.
+// See https://webaudio.github.io/web-audio-api/#the-stereopannernode-interface
[
- NoInterfaceObject,
-] interface StereoPannerNode : AudioNode {
+ Constructor(BaseAudioContext context, optional StereoPannerOptions options),
+ RaisesException=Constructor,
+ Measure
+]
+interface StereoPannerNode : AudioNode {
readonly attribute AudioParam pan;
-};
\ No newline at end of file
+};
diff --git a/modules/webaudio/StereoPannerOptions.idl b/modules/webaudio/StereoPannerOptions.idl
new file mode 100644
index 0000000..87713a0
--- /dev/null
+++ b/modules/webaudio/StereoPannerOptions.idl
@@ -0,0 +1,8 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#stereopanneroptions
+dictionary StereoPannerOptions : AudioNodeOptions {
+ float pan = 0;
+};
\ No newline at end of file
diff --git a/modules/webaudio/WaveShaperNode.idl b/modules/webaudio/WaveShaperNode.idl
index aeca5fb..6289d54 100644
--- a/modules/webaudio/WaveShaperNode.idl
+++ b/modules/webaudio/WaveShaperNode.idl
@@ -10,24 +10,31 @@
* 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. 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 INC. 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
*/
+// See https://webaudio.github.io/web-audio-api/#WaveShaperNode
enum OverSampleType {
"none",
"2x",
"4x"
};
+[
+ Constructor(BaseAudioContext context, optional WaveShaperOptions options),
+ RaisesException=Constructor,
+ Measure
+]
interface WaveShaperNode : AudioNode {
[RaisesException=Setter] attribute Float32Array? curve;
attribute OverSampleType oversample;
diff --git a/modules/webaudio/WaveShaperOptions.idl b/modules/webaudio/WaveShaperOptions.idl
new file mode 100644
index 0000000..c004b3f
--- /dev/null
+++ b/modules/webaudio/WaveShaperOptions.idl
@@ -0,0 +1,9 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#waveshaperoptions
+dictionary WaveShaperOptions : AudioNodeOptions {
+ sequence<float> curve;
+ OverSampleType oversample = "none";
+};
\ No newline at end of file
diff --git a/modules/webaudio/WindowAudioWorklet.idl b/modules/webaudio/WindowAudioWorklet.idl
new file mode 100644
index 0000000..f21f06b
--- /dev/null
+++ b/modules/webaudio/WindowAudioWorklet.idl
@@ -0,0 +1,12 @@
+// Copyright 2016 The Chromium 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://webaudio.github.io/web-audio-api/#AudioWorklet
+
+[
+ ImplementedAs=WindowAudioWorklet,
+ RuntimeEnabled=AudioWorklet
+] partial interface Window {
+ readonly attribute Worklet audioWorklet;
+};
diff --git a/modules/webaudio/WindowWebAudio.idl b/modules/webaudio/WindowWebAudio.idl
deleted file mode 100644
index 0a5bb07..0000000
--- a/modules/webaudio/WindowWebAudio.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 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=DOMWindowWebAudio,
-] partial interface Window {
- [MeasureAs=AudioContext] attribute AudioContextConstructor AudioContext;
- [MeasureAs=OfflineAudioContext] attribute OfflineAudioContextConstructor OfflineAudioContext;
- [DeprecateAs=PrefixedAudioContext] attribute AudioContextConstructor webkitAudioContext;
- [DeprecateAs=PrefixedOfflineAudioContext] attribute OfflineAudioContextConstructor webkitOfflineAudioContext;
-};
diff --git a/modules/webaudio/testing/InternalsWebAudio.idl b/modules/webaudio/testing/InternalsWebAudio.idl
index fb3b231..9ee6fc0 100644
--- a/modules/webaudio/testing/InternalsWebAudio.idl
+++ b/modules/webaudio/testing/InternalsWebAudio.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.
-partial interface Internals {
+[
+ ImplementedAs=InternalsWebAudio
+] partial interface Internals {
unsigned long audioHandlerCount();
};
diff --git a/modules/webdatabase/Database.idl b/modules/webdatabase/Database.idl
index 6062830..9acb71f 100644
--- a/modules/webdatabase/Database.idl
+++ b/modules/webdatabase/Database.idl
@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#database
[
- GarbageCollected,
NoInterfaceObject
] interface Database {
readonly attribute DOMString version;
@@ -35,4 +35,3 @@
void transaction(SQLTransactionCallback callback, optional SQLTransactionErrorCallback errorCallback, optional VoidCallback successCallback);
void readTransaction(SQLTransactionCallback callback, optional SQLTransactionErrorCallback errorCallback, optional VoidCallback successCallback);
};
-
diff --git a/modules/webdatabase/DatabaseCallback.idl b/modules/webdatabase/DatabaseCallback.idl
deleted file mode 100644
index dc1987d..0000000
--- a/modules/webdatabase/DatabaseCallback.idl
+++ /dev/null
@@ -1,31 +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.
- * 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.
- */
-
-callback interface DatabaseCallback {
- boolean handleEvent(Database database);
-};
diff --git a/modules/webdatabase/SQLError.idl b/modules/webdatabase/SQLError.idl
index f946d55..287ddad 100644
--- a/modules/webdatabase/SQLError.idl
+++ b/modules/webdatabase/SQLError.idl
@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqlerror
[
- GarbageCollected,
NoInterfaceObject
] interface SQLError {
readonly attribute unsigned long code;
diff --git a/modules/webdatabase/SQLResultSet.idl b/modules/webdatabase/SQLResultSet.idl
index 24c04c2..84a20be 100644
--- a/modules/webdatabase/SQLResultSet.idl
+++ b/modules/webdatabase/SQLResultSet.idl
@@ -26,9 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqlresultset
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface SQLResultSet {
readonly attribute SQLResultSetRowList rows;
diff --git a/modules/webdatabase/SQLResultSetRowList.idl b/modules/webdatabase/SQLResultSetRowList.idl
index 21f2304..2f7b32e 100644
--- a/modules/webdatabase/SQLResultSetRowList.idl
+++ b/modules/webdatabase/SQLResultSetRowList.idl
@@ -26,9 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface SQLResultSetRowList {
readonly attribute unsigned long length;
[RaisesException, CallWith=ScriptState] getter any item(unsigned long index);
diff --git a/modules/webdatabase/SQLStatementCallback.idl b/modules/webdatabase/SQLStatementCallback.idl
index 48078af..77faa0e 100644
--- a/modules/webdatabase/SQLStatementCallback.idl
+++ b/modules/webdatabase/SQLStatementCallback.idl
@@ -26,6 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqlstatementcallback
callback interface SQLStatementCallback {
boolean handleEvent(SQLTransaction transaction, SQLResultSet resultSet);
};
diff --git a/modules/webdatabase/SQLStatementErrorCallback.idl b/modules/webdatabase/SQLStatementErrorCallback.idl
index 117431d..8feb6bd 100644
--- a/modules/webdatabase/SQLStatementErrorCallback.idl
+++ b/modules/webdatabase/SQLStatementErrorCallback.idl
@@ -26,6 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqlstatementerrorcallback
callback interface SQLStatementErrorCallback {
[Custom] boolean handleEvent(SQLTransaction transaction, SQLError error);
};
diff --git a/modules/webdatabase/SQLTransaction.idl b/modules/webdatabase/SQLTransaction.idl
index d1e50fe..7a08559 100644
--- a/modules/webdatabase/SQLTransaction.idl
+++ b/modules/webdatabase/SQLTransaction.idl
@@ -26,13 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/webdatabase/#sqltransaction
-
+// https://www.w3.org/TR/webdatabase/#objectarray
typedef sequence<any> ObjectArray;
+// https://www.w3.org/TR/webdatabase/#sqltransaction
[
- GarbageCollected,
- NoInterfaceObject,
+ NoInterfaceObject
] interface SQLTransaction {
// The spec defines |arguments| to be an "optional ObjectArray" though it defines the
// behavior when null is being passed.
diff --git a/modules/webdatabase/SQLTransactionCallback.idl b/modules/webdatabase/SQLTransactionCallback.idl
index 41cac85..450267b 100644
--- a/modules/webdatabase/SQLTransactionCallback.idl
+++ b/modules/webdatabase/SQLTransactionCallback.idl
@@ -26,6 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqltransactioncallback
callback interface SQLTransactionCallback {
boolean handleEvent(SQLTransaction transaction);
};
diff --git a/modules/webdatabase/SQLTransactionErrorCallback.idl b/modules/webdatabase/SQLTransactionErrorCallback.idl
index efe64a0..396ada4 100644
--- a/modules/webdatabase/SQLTransactionErrorCallback.idl
+++ b/modules/webdatabase/SQLTransactionErrorCallback.idl
@@ -26,6 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#sqltransactionerrorcallback
callback interface SQLTransactionErrorCallback {
boolean handleEvent(SQLError error);
};
diff --git a/modules/webdatabase/WindowWebDatabase.idl b/modules/webdatabase/WindowWebDatabase.idl
index 0d18b0e..3018a2c 100644
--- a/modules/webdatabase/WindowWebDatabase.idl
+++ b/modules/webdatabase/WindowWebDatabase.idl
@@ -24,9 +24,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.w3.org/TR/webdatabase/#databasecallback
+callback DatabaseCallback = boolean (Database database);
+
+// https://www.w3.org/TR/webdatabase/#databases
[
ImplementedAs=DOMWindowWebDatabase,
- RuntimeEnabled=Database,
+ RuntimeEnabled=Database
] partial interface Window {
[MeasureAs=OpenWebDatabase, LogActivity, RaisesException] Database openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback creationCallback);
};
diff --git a/modules/webgl/ANGLEInstancedArrays.idl b/modules/webgl/ANGLEInstancedArrays.idl
index eb8853a..9ae9da7 100644
--- a/modules/webgl/ANGLEInstancedArrays.idl
+++ b/modules/webgl/ANGLEInstancedArrays.idl
@@ -28,11 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/
+
[
+ DependentLifetime,
DoNotCheckConstants,
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ NoInterfaceObject
] interface ANGLEInstancedArrays {
const unsigned long VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
diff --git a/modules/webgl/CHROMIUMSubscribeUniform.idl b/modules/webgl/CHROMIUMSubscribeUniform.idl
deleted file mode 100644
index 16b6f28..0000000
--- a/modules/webgl/CHROMIUMSubscribeUniform.idl
+++ /dev/null
@@ -1,25 +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.
-
-typedef unsigned long GLenum;
-
-[
- DoNotCheckConstants,
- NoInterfaceObject,
- GarbageCollected,
- 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/modules/webgl/CHROMIUMValuebuffer.idl b/modules/webgl/CHROMIUMValuebuffer.idl
deleted file mode 100644
index a7277aa..0000000
--- a/modules/webgl/CHROMIUMValuebuffer.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.
-
-[
- NoInterfaceObject,
- GarbageCollected,
-] interface CHROMIUMValuebuffer {
-};
diff --git a/modules/webgl/EXTBlendMinMax.idl b/modules/webgl/EXTBlendMinMax.idl
index 773c314..969fab8 100644
--- a/modules/webgl/EXTBlendMinMax.idl
+++ b/modules/webgl/EXTBlendMinMax.idl
@@ -2,11 +2,12 @@
// 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/extensions/EXT_blend_minmax/
+
[
+ DependentLifetime,
DoNotCheckConstants,
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ NoInterfaceObject
] interface EXTBlendMinMax {
const unsigned long MIN_EXT = 0x8007;
const unsigned long MAX_EXT = 0x8008;
diff --git a/modules/webgl/EXTColorBufferFloat.idl b/modules/webgl/EXTColorBufferFloat.idl
index f528ec7..6fc15a4 100644
--- a/modules/webgl/EXTColorBufferFloat.idl
+++ b/modules/webgl/EXTColorBufferFloat.idl
@@ -2,9 +2,10 @@
// 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/extensions/EXT_color_buffer_float/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface EXTColorBufferFloat {
};
diff --git a/modules/webgl/EXTColorBufferHalfFloat.idl b/modules/webgl/EXTColorBufferHalfFloat.idl
new file mode 100644
index 0000000..588c4f9
--- /dev/null
+++ b/modules/webgl/EXTColorBufferHalfFloat.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+// https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float
+
+[
+ DependentLifetime,
+ NoInterfaceObject
+] interface EXTColorBufferHalfFloat {
+};
diff --git a/modules/webgl/EXTDisjointTimerQuery.idl b/modules/webgl/EXTDisjointTimerQuery.idl
index 6da8e5b..206e59c 100644
--- a/modules/webgl/EXTDisjointTimerQuery.idl
+++ b/modules/webgl/EXTDisjointTimerQuery.idl
@@ -2,13 +2,14 @@
// 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/extensions/EXT_disjoint_timer_query/
+
typedef unsigned long long GLuint64EXT;
[
+ DependentLifetime,
DoNotCheckConstants,
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ NoInterfaceObject
] interface EXTDisjointTimerQuery {
const GLenum QUERY_COUNTER_BITS_EXT = 0x8864;
const GLenum CURRENT_QUERY_EXT = 0x8865;
@@ -19,11 +20,11 @@
const GLenum GPU_DISJOINT_EXT = 0x8FBB;
WebGLTimerQueryEXT createQueryEXT();
- void deleteQueryEXT([Default=Undefined] WebGLTimerQueryEXT? query);
- boolean isQueryEXT([Default=Undefined] WebGLTimerQueryEXT? query);
- void beginQueryEXT(GLenum target, [Default=Undefined] WebGLTimerQueryEXT? query);
+ void deleteQueryEXT(WebGLTimerQueryEXT? query);
+ boolean isQueryEXT(WebGLTimerQueryEXT? query);
+ void beginQueryEXT(GLenum target, WebGLTimerQueryEXT query);
void endQueryEXT(GLenum target);
- void queryCounterEXT([Default=Undefined] WebGLTimerQueryEXT? query, GLenum target);
+ void queryCounterEXT(WebGLTimerQueryEXT query, GLenum target);
[CallWith=ScriptState] any getQueryEXT(GLenum target, GLenum pname);
- [CallWith=ScriptState] any getQueryObjectEXT([Default=Undefined] WebGLTimerQueryEXT? query, GLenum pname);
+ [CallWith=ScriptState] any getQueryObjectEXT(WebGLTimerQueryEXT query, GLenum pname);
};
diff --git a/modules/webgl/EXTDisjointTimerQueryWebGL2.idl b/modules/webgl/EXTDisjointTimerQueryWebGL2.idl
new file mode 100644
index 0000000..56f7406
--- /dev/null
+++ b/modules/webgl/EXTDisjointTimerQueryWebGL2.idl
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium 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/extensions/EXT_disjoint_timer_query_webgl2/
+
+typedef unsigned long long GLuint64EXT;
+
+[
+ DependentLifetime,
+ DoNotCheckConstants,
+ NoInterfaceObject
+] interface EXTDisjointTimerQueryWebGL2 {
+ const GLenum QUERY_COUNTER_BITS_EXT = 0x8864;
+ const GLenum TIME_ELAPSED_EXT = 0x88BF;
+ const GLenum TIMESTAMP_EXT = 0x8E28;
+ const GLenum GPU_DISJOINT_EXT = 0x8FBB;
+ void queryCounterEXT(WebGLQuery query, GLenum target);
+};
diff --git a/modules/webgl/EXTFragDepth.idl b/modules/webgl/EXTFragDepth.idl
index caadf78..571c806 100644
--- a/modules/webgl/EXTFragDepth.idl
+++ b/modules/webgl/EXTFragDepth.idl
@@ -23,9 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface EXTFragDepth {
};
diff --git a/modules/webgl/EXTShaderTextureLOD.idl b/modules/webgl/EXTShaderTextureLOD.idl
index 5c0b9eb..fd3c742 100644
--- a/modules/webgl/EXTShaderTextureLOD.idl
+++ b/modules/webgl/EXTShaderTextureLOD.idl
@@ -2,9 +2,10 @@
// 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/extensions/EXT_shader_texture_lod/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface EXTShaderTextureLOD {
};
diff --git a/modules/webgl/EXTTextureFilterAnisotropic.idl b/modules/webgl/EXTTextureFilterAnisotropic.idl
index 5c08b8b..de22a22 100644
--- a/modules/webgl/EXTTextureFilterAnisotropic.idl
+++ b/modules/webgl/EXTTextureFilterAnisotropic.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] 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
index b8af673..0b447ed 100644
--- a/modules/webgl/EXTsRGB.idl
+++ b/modules/webgl/EXTsRGB.idl
@@ -2,11 +2,12 @@
// 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/extensions/EXT_sRGB/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface EXTsRGB {
const unsigned long SRGB_EXT = 0x8C40;
const unsigned long SRGB_ALPHA_EXT = 0x8C42;
diff --git a/modules/webgl/OESElementIndexUint.idl b/modules/webgl/OESElementIndexUint.idl
index 6c8f5c6..ce50a63 100644
--- a/modules/webgl/OESElementIndexUint.idl
+++ b/modules/webgl/OESElementIndexUint.idl
@@ -23,9 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface OESElementIndexUint {
};
diff --git a/modules/webgl/OESStandardDerivatives.idl b/modules/webgl/OESStandardDerivatives.idl
index bb64a4c..a2a7dda 100644
--- a/modules/webgl/OESStandardDerivatives.idl
+++ b/modules/webgl/OESStandardDerivatives.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface OESStandardDerivatives {
const unsigned long FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
};
diff --git a/modules/webgl/OESTextureFloat.idl b/modules/webgl/OESTextureFloat.idl
index fe24758..9c54e3d 100644
--- a/modules/webgl/OESTextureFloat.idl
+++ b/modules/webgl/OESTextureFloat.idl
@@ -23,9 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_texture_float/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface OESTextureFloat {
};
diff --git a/modules/webgl/OESTextureFloatLinear.idl b/modules/webgl/OESTextureFloatLinear.idl
index 0c305b7..80110e2 100644
--- a/modules/webgl/OESTextureFloatLinear.idl
+++ b/modules/webgl/OESTextureFloatLinear.idl
@@ -23,9 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface OESTextureFloatLinear {
};
diff --git a/modules/webgl/OESTextureHalfFloat.idl b/modules/webgl/OESTextureHalfFloat.idl
index 1a9ebf3..6ed00bb 100644
--- a/modules/webgl/OESTextureHalfFloat.idl
+++ b/modules/webgl/OESTextureHalfFloat.idl
@@ -23,13 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-typedef unsigned long GLenum;
+// https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface OESTextureHalfFloat {
const GLenum HALF_FLOAT_OES = 0x8D61;
};
diff --git a/modules/webgl/OESTextureHalfFloatLinear.idl b/modules/webgl/OESTextureHalfFloatLinear.idl
index 7c147d9..c762c52 100644
--- a/modules/webgl/OESTextureHalfFloatLinear.idl
+++ b/modules/webgl/OESTextureHalfFloatLinear.idl
@@ -23,9 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface OESTextureHalfFloatLinear {
};
diff --git a/modules/webgl/OESVertexArrayObject.idl b/modules/webgl/OESVertexArrayObject.idl
index ebe9285..5de5f89 100644
--- a/modules/webgl/OESVertexArrayObject.idl
+++ b/modules/webgl/OESVertexArrayObject.idl
@@ -23,16 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
+
[
+ DependentLifetime,
DoNotCheckConstants,
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ NoInterfaceObject
] interface OESVertexArrayObject {
const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5;
WebGLVertexArrayObjectOES createVertexArrayOES();
- [CallWith=ScriptState] void deleteVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
+ void deleteVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
boolean isVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
- [CallWith=ScriptState] void bindVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
+ void bindVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
};
diff --git a/modules/webgl/PRESUBMIT.py b/modules/webgl/PRESUBMIT.py
index 923a26b..492a16f 100644
--- a/modules/webgl/PRESUBMIT.py
+++ b/modules/webgl/PRESUBMIT.py
@@ -2,40 +2,25 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Top-level presubmit script for gpu.
+"""Top-level presubmit script for Source/modules/webgl.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
-
-import re
-
-
def PostUploadHook(cl, change, output_api):
"""git cl upload will call this hook after the issue is created/modified.
- This hook adds extra try bots list to the CL description in order to run
- extra GPU tests in addition to CQ try bots.
+ This hook modifies the CL description in order to run extra GPU
+ tests (in particular, the WebGL 2.0 conformance tests) in addition
+ to the regular CQ try bots. This test suite is too large to run
+ against all Chromium commits, but should be run against changes
+ likely to affect these tests.
"""
- rietveld_obj = cl.RpcServer()
- issue = cl.issue
- description = rietveld_obj.get_description(issue)
- if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I):
- return []
-
- bots = [
- 'tryserver.chromium.win:win_optional_gpu_tests_rel',
- 'tryserver.chromium.mac:mac_optional_gpu_tests_rel',
- ]
-
- results = []
- new_description = description
- new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots)
- results.append(output_api.PresubmitNotifyResult(
- 'Automatically added optional GPU tests to run on CQ.'))
-
- if new_description != description:
- rietveld_obj.update_description(issue, new_description)
-
- return results
+ return output_api.EnsureCQIncludeTrybotsAreAdded(
+ cl,
+ ['master.tryserver.chromium.linux:linux_optional_gpu_tests_rel',
+ 'master.tryserver.chromium.mac:mac_optional_gpu_tests_rel',
+ 'master.tryserver.chromium.win:win_optional_gpu_tests_rel',
+ 'master.tryserver.chromium.android:android_optional_gpu_tests_rel'],
+ 'Automatically added optional GPU tests to run on CQ.')
diff --git a/modules/webgl/WebGL2RenderingContext.idl b/modules/webgl/WebGL2RenderingContext.idl
index a3387bf..7732235 100644
--- a/modules/webgl/WebGL2RenderingContext.idl
+++ b/modules/webgl/WebGL2RenderingContext.idl
@@ -2,11 +2,12 @@
// 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/latest/2.0/#3.7
+
[
- RuntimeEnabled=UnsafeES3APIs,
DoNotCheckConstants,
- SetWrapperReferenceFrom=canvas,
- WillBeGarbageCollected,
+ Exposed(Worker ExperimentalCanvasFeatures, Window StableBlinkFeatures),
+ DependentLifetime
] interface WebGL2RenderingContext { };
WebGL2RenderingContext implements WebGLRenderingContextBase;
WebGL2RenderingContext implements WebGL2RenderingContextBase;
diff --git a/modules/webgl/WebGL2RenderingContextBase.idl b/modules/webgl/WebGL2RenderingContextBase.idl
index cb2eaf0..0952630 100644
--- a/modules/webgl/WebGL2RenderingContextBase.idl
+++ b/modules/webgl/WebGL2RenderingContextBase.idl
@@ -2,26 +2,13 @@
// 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;
+// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7
+
+typedef long long GLint64;
+typedef unsigned long long GLuint64;
[
- RuntimeEnabled=UnsafeES3APIs,
- NoInterfaceObject,
- WillBeGarbageCollected,
+ NoInterfaceObject
] interface WebGL2RenderingContextBase {
const GLenum READ_BUFFER = 0x0C02;
const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
@@ -276,26 +263,13 @@
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;
const GLint TIMEOUT_IGNORED = -1;
@@ -303,15 +277,17 @@
const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247;
/* Buffer objects */
+ void bufferData(GLenum target, [AllowShared] ArrayBufferView srcData, GLenum usage, GLuint srcOffset, optional GLuint length = 0);
+ void bufferSubData(GLenum target, GLintptr dstByteOffset, [AllowShared] ArrayBufferView srcData, GLuint srcOffset, optional GLuint length = 0);
void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
- void getBufferSubData(GLenum target, GLintptr offset, ArrayBuffer? returnedData);
+ void getBufferSubData(GLenum target, GLintptr srcByteOffset, [AllowShared] ArrayBufferView dstData, optional GLuint dstOffset = 0, optional GLuint length = 0);
/* Framebuffer objects */
void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
- [CallWith=ScriptState] void framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level, GLint layer);
+ 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 invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height);
void readBuffer(GLenum mode);
/* Renderbuffer objects */
@@ -319,54 +295,165 @@
/* Texture objects */
void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLintptr offset);
+ void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ImageData data);
+ [CallWith=ExecutionContext, RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLImageElement image);
+ [CallWith=ExecutionContext, RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLCanvasElement canvas);
+ [CallWith=ExecutionContext,RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLVideoElement video);
+ [RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ImageBitmap bitmap);
+ void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData, GLuint srcOffset);
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLintptr offset);
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ImageData data);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLImageElement image);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLCanvasElement canvas);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLVideoElement video);
+ [RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ImageBitmap bitmap);
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData, GLuint srcOffset);
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);
void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLintptr offset);
- void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ArrayBufferView? pixels);
- 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);
- [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, ImageBitmap? bitmap);
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ImageData data);
+ [CallWith=ExecutionContext, RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLImageElement image);
+ [CallWith=ExecutionContext, RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLCanvasElement canvas);
+ [CallWith=ExecutionContext, RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLVideoElement video);
+ [RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ImageBitmap bitmap);
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView pixels, GLuint srcOffset);
+ void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLintptr offset);
+ void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ImageData data);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLImageElement image);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLCanvasElement canvas);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLVideoElement video);
+ [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ImageBitmap bitmap);
+ void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, [AllowShared] ArrayBufferView pixels, optional GLuint srcOffset = 0);
+
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);
+
+ void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLint border,
+ [AllowShared] ArrayBufferView data, GLuint srcOffset,
+ optional GLuint srcLengthOverride = 0);
+ void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format,
+ [AllowShared] ArrayBufferView data, GLuint srcOffset,
+ optional GLuint srcLengthOverride = 0);
+ void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, [AllowShared] ArrayBufferView data, optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0);
+ void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, [AllowShared] ArrayBufferView data, optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0);
+
+ void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLint border,
+ GLsizei imageSize, GLintptr offset);
+ void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format,
+ GLsizei imageSize, GLintptr offset);
+ void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLsizei depth, GLint border,
+ GLsizei imageSize, GLintptr offset);
+ void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth, GLenum format,
+ GLsizei imageSize, GLintptr offset);
/* Programs and shaders */
- GLint getFragDataLocation(WebGLProgram? program, DOMString name);
+ 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, [FlexibleArrayBufferView] Uint32Array v);
- void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> v);
- void uniform2uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v);
- void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> v);
- void uniform3uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v);
- void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> v);
- void uniform4uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v);
- void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> v);
- 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);
+ // The WebGL1 uniform*v signatures are visible here, so srcOffset has to be non-optional
+ // to avoid conflicts. The effect is the same: if uniform*v is called with only two arguments,
+ // it goes to the WebGL1 signatures; if it's called with three or four arguments, it goes to
+ // the WebGL2 specific signatures.
+ void uniform1fv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Float32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform2fv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Float32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform3fv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Float32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform4fv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Float32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform1iv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Int32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform1iv(WebGLUniformLocation? location, sequence<GLint> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform2iv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Int32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform2iv(WebGLUniformLocation? location, sequence<GLint> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform3iv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Int32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform3iv(WebGLUniformLocation? location, sequence<GLint> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform4iv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Int32Array v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform4iv(WebGLUniformLocation? location, sequence<GLint> v,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniform1uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform2uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform3uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform4uiv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Uint32Array v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> v,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array array,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array array,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array array,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array,
+ GLuint srcOffset, optional GLuint srcLength = 0);
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] Float32Array value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
- void vertexAttribI4iv(GLuint index, Int32Array v);
+ void vertexAttribI4iv(GLuint index, [AllowShared] Int32Array v);
void vertexAttribI4iv(GLuint index, sequence<GLint> v);
void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
- void vertexAttribI4uiv(GLuint index, Uint32Array v);
+ void vertexAttribI4uiv(GLuint index, [AllowShared] Uint32Array v);
void vertexAttribI4uiv(GLuint index, sequence<GLuint> v);
void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
@@ -378,50 +465,50 @@
/* 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 clearBufferiv(GLenum buffer, GLint drawbuffer, [AllowShared] Int32Array value, optional GLuint srcOffset = 0);
+ void clearBufferiv(GLenum buffer, GLint drawbuffer, sequence<GLint> value, optional GLuint srcOffset = 0);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, [AllowShared] Uint32Array value, optional GLuint srcOffset = 0);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, sequence<GLuint> value, optional GLuint srcOffset = 0);
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, [AllowShared] Float32Array value, optional GLuint srcOffset = 0);
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, sequence<GLfloat> value, optional GLuint srcOffset = 0);
void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
/* Query Objects */
- WebGLQuery createQuery();
+ WebGLQuery? createQuery();
void deleteQuery(WebGLQuery? query);
GLboolean isQuery(WebGLQuery? query);
- void beginQuery(GLenum target, 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);
+ [CallWith=ScriptState] any getQuery(GLenum target, GLenum pname);
+ [CallWith=ScriptState] any getQueryParameter(WebGLQuery query, GLenum pname);
/* Sampler Objects */
- WebGLSampler createSampler();
+ 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);
+ 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);
+ WebGLSync? fenceSync(GLenum condition, GLbitfield flags);
GLboolean isSync(WebGLSync? sync);
void deleteSync(WebGLSync? sync);
- GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLint64 timeout);
- void waitSync(WebGLSync? sync, GLbitfield flags, GLint64 timeout);
+ GLenum clientWaitSync(WebGLSync sync, GLbitfield flags, GLuint64 timeout);
+ void waitSync(WebGLSync sync, GLbitfield flags, GLint64 timeout);
- [CallWith=ScriptState] any getSyncParameter(WebGLSync? sync, GLenum pname);
+ [CallWith=ScriptState] any getSyncParameter(WebGLSync sync, GLenum pname);
/* Transform Feedback */
- WebGLTransformFeedback createTransformFeedback();
+ WebGLTransformFeedback? createTransformFeedback();
void deleteTransformFeedback(WebGLTransformFeedback? feedback);
GLboolean isTransformFeedback(WebGLTransformFeedback? feedback);
- void bindTransformFeedback (GLenum target, 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 transformFeedbackVaryings(WebGLProgram program, sequence<DOMString> varyings, GLenum bufferMode);
+ WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram program, GLuint index);
void pauseTransformFeedback();
void resumeTransformFeedback();
@@ -429,20 +516,21 @@
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);
- [CallWith=ScriptState] any 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);
+ sequence<GLuint>? getUniformIndices(WebGLProgram program, sequence<DOMString> uniformNames);
+ [CallWith=ScriptState] any 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();
- [CallWith=ScriptState] void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
+ WebGLVertexArrayObject? createVertexArray();
+ void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
- [CallWith=ScriptState] void bindVertexArray(WebGLVertexArrayObject? vertexArray);
+ void bindVertexArray(WebGLVertexArrayObject? vertexArray);
/* Reading */
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView dstData, GLintptr offset);
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLintptr offset);
};
WebGL2RenderingContextBase implements WebGLRenderingContextBase;
diff --git a/modules/webgl/WebGLActiveInfo.idl b/modules/webgl/WebGLActiveInfo.idl
index e22a5bd..6e9eda9 100644
--- a/modules/webgl/WebGLActiveInfo.idl
+++ b/modules/webgl/WebGLActiveInfo.idl
@@ -23,9 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface WebGLActiveInfo {
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.11
+
+interface WebGLActiveInfo {
readonly attribute long size;
readonly attribute unsigned long type;
readonly attribute DOMString name;
diff --git a/modules/webgl/WebGLBuffer.idl b/modules/webgl/WebGLBuffer.idl
index 826f3a0..d155504 100644
--- a/modules/webgl/WebGLBuffer.idl
+++ b/modules/webgl/WebGLBuffer.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.4
+
[
- GarbageCollected,
+ DependentLifetime
] interface WebGLBuffer {
};
diff --git a/modules/webgl/WebGLColorBufferFloat.idl b/modules/webgl/WebGLColorBufferFloat.idl
new file mode 100644
index 0000000..9ee7c1e
--- /dev/null
+++ b/modules/webgl/WebGLColorBufferFloat.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+// https://www.khronos.org/registry/webgl/extensions/WebGL_color_buffer_float/
+
+[
+ DependentLifetime,
+ NoInterfaceObject
+] interface WebGLColorBufferFloat {
+};
diff --git a/modules/webgl/WebGLCompressedTextureASTC.idl b/modules/webgl/WebGLCompressedTextureASTC.idl
index 43db7d6..943a1ff 100644
--- a/modules/webgl/WebGLCompressedTextureASTC.idl
+++ b/modules/webgl/WebGLCompressedTextureASTC.idl
@@ -2,11 +2,12 @@
// 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/extensions/WEBGL_compressed_texture_astc/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLCompressedTextureASTC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
diff --git a/modules/webgl/WebGLCompressedTextureATC.idl b/modules/webgl/WebGLCompressedTextureATC.idl
index 1bb3fe7..888d29f 100644
--- a/modules/webgl/WebGLCompressedTextureATC.idl
+++ b/modules/webgl/WebGLCompressedTextureATC.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLCompressedTextureATC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
diff --git a/modules/webgl/WebGLCompressedTextureETC.idl b/modules/webgl/WebGLCompressedTextureETC.idl
new file mode 100644
index 0000000..eadd961
--- /dev/null
+++ b/modules/webgl/WebGLCompressedTextureETC.idl
@@ -0,0 +1,23 @@
+// Copyright 2016 The Chromium 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/extensions/WEBGL_compressed_texture_etc/
+
+[
+ DependentLifetime,
+ NoInterfaceObject,
+ DoNotCheckConstants
+] interface WebGLCompressedTextureETC {
+ /* Compressed Texture Format */
+ const unsigned long COMPRESSED_R11_EAC = 0x9270;
+ const unsigned long COMPRESSED_SIGNED_R11_EAC = 0x9271;
+ const unsigned long COMPRESSED_RG11_EAC = 0x9272;
+ const unsigned long COMPRESSED_SIGNED_RG11_EAC = 0x9273;
+ const unsigned long COMPRESSED_RGB8_ETC2 = 0x9274;
+ const unsigned long COMPRESSED_SRGB8_ETC2 = 0x9275;
+ const unsigned long COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
+ const unsigned long COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
+ const unsigned long COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
+ const unsigned long COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
+};
diff --git a/modules/webgl/WebGLCompressedTextureETC1.idl b/modules/webgl/WebGLCompressedTextureETC1.idl
index 65f8321..331d47d 100644
--- a/modules/webgl/WebGLCompressedTextureETC1.idl
+++ b/modules/webgl/WebGLCompressedTextureETC1.idl
@@ -2,11 +2,12 @@
// 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/extensions/WEBGL_compressed_texture_etc1/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLCompressedTextureETC1 {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
diff --git a/modules/webgl/WebGLCompressedTexturePVRTC.idl b/modules/webgl/WebGLCompressedTexturePVRTC.idl
index 29c09ff..eb7102b 100644
--- a/modules/webgl/WebGLCompressedTexturePVRTC.idl
+++ b/modules/webgl/WebGLCompressedTexturePVRTC.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLCompressedTexturePVRTC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
diff --git a/modules/webgl/WebGLCompressedTextureS3TC.idl b/modules/webgl/WebGLCompressedTextureS3TC.idl
index 36f76b7..d79212f 100644
--- a/modules/webgl/WebGLCompressedTextureS3TC.idl
+++ b/modules/webgl/WebGLCompressedTextureS3TC.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLCompressedTextureS3TC {
/* Compressed Texture Formats */
const unsigned long COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
diff --git a/modules/webgl/WebGLCompressedTextureS3TCsRGB.idl b/modules/webgl/WebGLCompressedTextureS3TCsRGB.idl
new file mode 100644
index 0000000..3e7dc7f
--- /dev/null
+++ b/modules/webgl/WebGLCompressedTextureS3TCsRGB.idl
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium 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/extensions/WEBGL_compressed_texture_s3tc_srgb/
+
+[
+ DependentLifetime,
+ NoInterfaceObject,
+ DoNotCheckConstants
+] interface WebGLCompressedTextureS3TCsRGB {
+ /* Compressed Texture Formats */
+ const unsigned long COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
+ const unsigned long COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
+ const unsigned long COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
+ const unsigned long COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
+};
diff --git a/modules/webgl/WebGLContextEvent.idl b/modules/webgl/WebGLContextEvent.idl
index 484b8bc..f08c814 100644
--- a/modules/webgl/WebGLContextEvent.idl
+++ b/modules/webgl/WebGLContextEvent.idl
@@ -23,11 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// https://www.khronos.org/registry/webgl/specs/1.0/#5.15
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15
[
- Constructor(DOMString type, optional WebGLContextEventInit eventInit),
+ Constructor(DOMString type, optional WebGLContextEventInit eventInit)
] interface WebGLContextEvent : Event {
readonly attribute DOMString statusMessage;
};
-
diff --git a/modules/webgl/WebGLContextEventInit.idl b/modules/webgl/WebGLContextEventInit.idl
index 7a7ced8..9b6e106 100644
--- a/modules/webgl/WebGLContextEventInit.idl
+++ b/modules/webgl/WebGLContextEventInit.idl
@@ -2,7 +2,7 @@
// 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
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15
dictionary WebGLContextEventInit : EventInit {
DOMString statusMessage;
diff --git a/modules/webgl/WebGLDebugRendererInfo.idl b/modules/webgl/WebGLDebugRendererInfo.idl
index 635f2ec..ba96811 100644
--- a/modules/webgl/WebGLDebugRendererInfo.idl
+++ b/modules/webgl/WebGLDebugRendererInfo.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLDebugRendererInfo {
const unsigned long UNMASKED_VENDOR_WEBGL = 0x9245;
const unsigned long UNMASKED_RENDERER_WEBGL = 0x9246;
diff --git a/modules/webgl/WebGLDebugShaders.idl b/modules/webgl/WebGLDebugShaders.idl
index 9196da9..0003a14 100644
--- a/modules/webgl/WebGLDebugShaders.idl
+++ b/modules/webgl/WebGLDebugShaders.idl
@@ -23,10 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface WebGLDebugShaders {
- DOMString? getTranslatedShaderSource(WebGLShader? shader);
+ DOMString? getTranslatedShaderSource(WebGLShader shader);
};
diff --git a/modules/webgl/WebGLDepthTexture.idl b/modules/webgl/WebGLDepthTexture.idl
index d1b2ca9..09d1f10 100644
--- a/modules/webgl/WebGLDepthTexture.idl
+++ b/modules/webgl/WebGLDepthTexture.idl
@@ -23,11 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/
+
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLDepthTexture {
const unsigned long UNSIGNED_INT_24_8_WEBGL = 0x84FA;
};
diff --git a/modules/webgl/WebGLDrawBuffers.idl b/modules/webgl/WebGLDrawBuffers.idl
index b39138b..c45a880 100644
--- a/modules/webgl/WebGLDrawBuffers.idl
+++ b/modules/webgl/WebGLDrawBuffers.idl
@@ -23,13 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-typedef unsigned long GLenum;
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/
[
+ DependentLifetime,
NoInterfaceObject,
- DoNotCheckConstants,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DoNotCheckConstants
] interface WebGLDrawBuffers {
const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1;
diff --git a/modules/webgl/WebGLFramebuffer.idl b/modules/webgl/WebGLFramebuffer.idl
index b41a0d2..04cdaaf 100644
--- a/modules/webgl/WebGLFramebuffer.idl
+++ b/modules/webgl/WebGLFramebuffer.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.5
+
[
- GarbageCollected,
+ DependentLifetime
] interface WebGLFramebuffer {
};
diff --git a/modules/webgl/WebGLGetBufferSubDataAsync.idl b/modules/webgl/WebGLGetBufferSubDataAsync.idl
new file mode 100644
index 0000000..ac54d2d
--- /dev/null
+++ b/modules/webgl/WebGLGetBufferSubDataAsync.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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/extensions/WEBGL_get_buffer_sub_data_async/
+
+[
+ DependentLifetime,
+ NoInterfaceObject,
+ DoNotCheckConstants
+] interface WebGLGetBufferSubDataAsync {
+ [CallWith=ScriptState] Promise<ArrayBufferView> getBufferSubDataAsync(GLenum target, GLintptr srcByteOffset, ArrayBufferView dstData, optional GLuint dstOffset = 0, optional GLuint length = 0);
+};
diff --git a/modules/webgl/WebGLLoseContext.idl b/modules/webgl/WebGLLoseContext.idl
index bfcc898..09b5b37 100644
--- a/modules/webgl/WebGLLoseContext.idl
+++ b/modules/webgl/WebGLLoseContext.idl
@@ -23,10 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
+
[
- NoInterfaceObject,
- GarbageCollected,
- SetWrapperReferenceFrom=canvas,
+ DependentLifetime,
+ NoInterfaceObject
] interface WebGLLoseContext {
void loseContext();
void restoreContext();
diff --git a/modules/webgl/WebGLProgram.idl b/modules/webgl/WebGLProgram.idl
index 10042da..9d2d714 100644
--- a/modules/webgl/WebGLProgram.idl
+++ b/modules/webgl/WebGLProgram.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.6
+
[
- GarbageCollected,
+ DependentLifetime
] interface WebGLProgram {
};
diff --git a/modules/webgl/WebGLQuery.idl b/modules/webgl/WebGLQuery.idl
index 725f0b9..90f03ba 100644
--- a/modules/webgl/WebGLQuery.idl
+++ b/modules/webgl/WebGLQuery.idl
@@ -2,8 +2,9 @@
// 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/latest/2.0/#3.2
+
[
- RuntimeEnabled=UnsafeES3APIs,
- GarbageCollected
+ DependentLifetime
] interface WebGLQuery {
};
diff --git a/modules/webgl/WebGLRenderbuffer.idl b/modules/webgl/WebGLRenderbuffer.idl
index 98fa819..9a799f4 100644
--- a/modules/webgl/WebGLRenderbuffer.idl
+++ b/modules/webgl/WebGLRenderbuffer.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.7
+
[
- GarbageCollected,
+ DependentLifetime
] interface WebGLRenderbuffer {
};
diff --git a/modules/webgl/WebGLRenderingContext.idl b/modules/webgl/WebGLRenderingContext.idl
index 20922a2..6e3b334 100644
--- a/modules/webgl/WebGLRenderingContext.idl
+++ b/modules/webgl/WebGLRenderingContext.idl
@@ -23,11 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.khronos.org/registry/webgl/specs/latest/1.0/#WebGLRenderingContext
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#WebGLRenderingContext
[
DoNotCheckConstants,
- SetWrapperReferenceFrom=canvas,
- WillBeGarbageCollected,
+ Exposed(Worker ExperimentalCanvasFeatures, Window StableBlinkFeatures),
+ DependentLifetime
] interface WebGLRenderingContext { };
WebGLRenderingContext implements WebGLRenderingContextBase;
diff --git a/modules/webgl/WebGLRenderingContextBase.idl b/modules/webgl/WebGLRenderingContextBase.idl
index 2bad45c..fbac5cd 100644
--- a/modules/webgl/WebGLRenderingContextBase.idl
+++ b/modules/webgl/WebGLRenderingContextBase.idl
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.khronos.org/registry/webgl/specs/latest/1.0/#WebGLRenderingContextBase
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#WebGLRenderingContextBase
typedef unsigned long GLenum;
typedef boolean GLboolean;
@@ -44,11 +44,10 @@
// FIXME: [DoNotCheckConstants] 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'
- WillBeGarbageCollected,
+ NoInterfaceObject // Always used on target of 'implements'
] interface WebGLRenderingContextBase {
- readonly attribute HTMLCanvasElement canvas;
+ [ImplementedAs=getHTMLOrOffscreenCanvas] readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas;
/* ClearBufferMask */
const GLenum DEPTH_BUFFER_BIT = 0x00000100;
@@ -424,7 +423,6 @@
const GLenum RGB5_A1 = 0x8057;
const GLenum RGB565 = 0x8D62;
const GLenum DEPTH_COMPONENT16 = 0x81A5;
- const GLenum STENCIL_INDEX = 0x1901;
const GLenum STENCIL_INDEX8 = 0x8D48;
const GLenum DEPTH_STENCIL = 0x84F9;
@@ -473,12 +471,12 @@
readonly attribute GLsizei drawingBufferHeight;
void activeTexture(GLenum texture);
- [CallWith=ScriptState] void attachShader(WebGLProgram? program, WebGLShader? shader);
- void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
- [CallWith=ScriptState] void bindBuffer(GLenum target, WebGLBuffer? buffer);
- [CallWith=ScriptState] void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
- [CallWith=ScriptState] void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
- [CallWith=ScriptState] void bindTexture(GLenum target, WebGLTexture? 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);
@@ -487,10 +485,10 @@
// FIXME: should be union type
// https://www.khronos.org/bugzilla/show_bug.cgi?id=1172
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
- void bufferData(GLenum target, ArrayBufferView data, GLenum usage);
+ void bufferData(GLenum target, [AllowShared] ArrayBufferView data, GLenum usage);
void bufferData(GLenum target, ArrayBuffer? data, GLenum usage);
void bufferSubData(GLenum target, GLintptr offset, [FlexibleArrayBufferView] ArrayBufferView data);
- void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer? data);
+ void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer data);
GLenum checkFramebufferStatus(GLenum target);
void clear(GLbitfield mask);
@@ -498,12 +496,12 @@
void clearDepth(GLclampf depth);
void clearStencil(GLint s);
void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- void compileShader(WebGLShader? shader);
+ void compileShader(WebGLShader shader);
void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
- GLsizei width, GLsizei height, GLint border, ArrayBufferView data);
+ GLsizei width, GLsizei height, GLint border, [AllowShared] ArrayBufferView data);
void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height, GLenum format, ArrayBufferView data);
+ GLsizei width, GLsizei height, GLenum format, [AllowShared] ArrayBufferView data);
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);
@@ -527,7 +525,7 @@
void depthFunc(GLenum func);
void depthMask(GLboolean flag);
void depthRange(GLclampf zNear, GLclampf zFar);
- [CallWith=ScriptState] void detachShader(WebGLProgram? program, WebGLShader? shader);
+ void detachShader(WebGLProgram program, WebGLShader shader);
void disable(GLenum cap);
void disableVertexAttribArray(GLuint index);
void drawArrays(GLenum mode, GLint first, GLsizei count);
@@ -537,17 +535,17 @@
void enableVertexAttribArray(GLuint index);
void finish();
void flush();
- [CallWith=ScriptState] void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer? renderbuffer);
- [CallWith=ScriptState] void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture? texture, GLint level);
+ 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);
- WebGLActiveInfo getActiveAttrib(WebGLProgram? program, GLuint index);
- WebGLActiveInfo getActiveUniform(WebGLProgram? program, GLuint index);
+ WebGLActiveInfo getActiveAttrib(WebGLProgram program, GLuint index);
+ WebGLActiveInfo getActiveUniform(WebGLProgram program, GLuint index);
- sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
+ sequence<WebGLShader>? getAttachedShaders(WebGLProgram program);
- GLint getAttribLocation(WebGLProgram? program, DOMString name);
+ GLint getAttribLocation(WebGLProgram program, DOMString name);
[CallWith=ScriptState] any getBufferParameter(GLenum target, GLenum pname);
@@ -559,24 +557,24 @@
[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);
+ [CallWith=ScriptState] any getProgramParameter(WebGLProgram program, GLenum pname);
+ DOMString? getProgramInfoLog(WebGLProgram program);
[CallWith=ScriptState] any getRenderbufferParameter(GLenum target, GLenum pname);
- [CallWith=ScriptState] any getShaderParameter(WebGLShader? shader, GLenum pname);
+ [CallWith=ScriptState] any getShaderParameter(WebGLShader shader, GLenum pname);
- DOMString? getShaderInfoLog(WebGLShader? shader);
+ DOMString? getShaderInfoLog(WebGLShader shader);
WebGLShaderPrecisionFormat getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
- DOMString? getShaderSource(WebGLShader? shader);
+ DOMString? getShaderSource(WebGLShader shader);
sequence<DOMString>? getSupportedExtensions();
[CallWith=ScriptState] any getTexParameter(GLenum target, GLenum pname);
- [CallWith=ScriptState] any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
+ [CallWith=ScriptState] any getUniform(WebGLProgram program, WebGLUniformLocation location);
- WebGLUniformLocation getUniformLocation(WebGLProgram? program, DOMString name);
+ WebGLUniformLocation getUniformLocation(WebGLProgram program, DOMString name);
[CallWith=ScriptState] any getVertexAttrib(GLuint index, GLenum pname);
@@ -592,16 +590,16 @@
GLboolean isShader(WebGLShader? shader);
GLboolean isTexture(WebGLTexture? texture);
void lineWidth(GLfloat width);
- void linkProgram(WebGLProgram? program);
+ 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 readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void sampleCoverage(GLclampf value, GLboolean invert);
void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
- void shaderSource(WebGLShader? shader, DOMString string);
+ void shaderSource(WebGLShader shader, DOMString string);
void stencilFunc(GLenum func, GLint ref, GLuint mask);
void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
void stencilMask(GLuint mask);
@@ -618,17 +616,17 @@
void texImage2D(
GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLint border,
- GLenum format, GLenum type, ArrayBufferView? pixels);
+ GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
void texImage2D(
GLenum target, GLint level, GLint internalformat,
- GLenum format, GLenum type, ImageData? pixels);
- [RaisesException] void texImage2D(
+ GLenum format, GLenum type, ImageData pixels);
+ [CallWith=ExecutionContext, RaisesException] void texImage2D(
GLenum target, GLint level, GLint internalformat,
GLenum format, GLenum type, HTMLImageElement image);
- [RaisesException] void texImage2D(
+ [CallWith=ExecutionContext, RaisesException] void texImage2D(
GLenum target, GLint level, GLint internalformat,
GLenum format, GLenum type, HTMLCanvasElement canvas);
- [RaisesException] void texImage2D(
+ [CallWith=ExecutionContext, RaisesException] void texImage2D(
GLenum target, GLint level, GLint internalformat,
GLenum format, GLenum type, HTMLVideoElement video);
[RaisesException] void texImage2D(
@@ -638,17 +636,17 @@
void texSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
- GLenum format, GLenum type, ArrayBufferView? pixels);
+ GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
void texSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLenum format, GLenum type, ImageData? pixels);
- [RaisesException] void texSubImage2D(
+ GLenum format, GLenum type, ImageData pixels);
+ [CallWith=ExecutionContext, RaisesException] void texSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLImageElement image);
- [RaisesException] void texSubImage2D(
+ [CallWith=ExecutionContext, RaisesException] void texSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLCanvasElement canvas);
- [RaisesException] void texSubImage2D(
+ [CallWith=ExecutionContext, RaisesException] void texSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLVideoElement video);
[RaisesException] void texSubImage2D(
@@ -680,30 +678,32 @@
void uniform4iv(WebGLUniformLocation? location, [FlexibleArrayBufferView] Int32Array v);
void uniform4iv(WebGLUniformLocation? location, sequence<GLint> v);
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, [AllowShared] 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, [AllowShared] 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, [AllowShared] Float32Array array);
void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array);
- [CallWith=ScriptState] void useProgram(WebGLProgram? program);
- void validateProgram(WebGLProgram? program);
+ void useProgram(WebGLProgram? program);
+ void validateProgram(WebGLProgram program);
void vertexAttrib1f(GLuint indx, GLfloat x);
- void vertexAttrib1fv(GLuint indx, Float32Array values);
+ void vertexAttrib1fv(GLuint indx, [AllowShared] 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, [AllowShared] 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, [AllowShared] 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, [AllowShared] Float32Array values);
void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
- [CallWith=ScriptState] void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized,
+ void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized,
GLsizei stride, GLintptr offset);
void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
+
+ [RuntimeEnabled=ExperimentalCanvasFeatures, CallWith=ScriptState, RaisesException] Promise commit();
};
diff --git a/modules/webgl/WebGLSampler.idl b/modules/webgl/WebGLSampler.idl
index 30e10e2..4ade792 100644
--- a/modules/webgl/WebGLSampler.idl
+++ b/modules/webgl/WebGLSampler.idl
@@ -2,8 +2,9 @@
// 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/latest/2.0/#3.3
+
[
- RuntimeEnabled=UnsafeES3APIs,
- GarbageCollected
+ DependentLifetime
] interface WebGLSampler {
};
diff --git a/modules/webgl/WebGLShader.idl b/modules/webgl/WebGLShader.idl
index 2d17020..c40b939 100644
--- a/modules/webgl/WebGLShader.idl
+++ b/modules/webgl/WebGLShader.idl
@@ -23,7 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.8
+
[
- GarbageCollected,
+ DependentLifetime
] interface WebGLShader {
};
diff --git a/modules/webgl/WebGLShaderPrecisionFormat.idl b/modules/webgl/WebGLShaderPrecisionFormat.idl
index 20364ed..e80b1e4 100644
--- a/modules/webgl/WebGLShaderPrecisionFormat.idl
+++ b/modules/webgl/WebGLShaderPrecisionFormat.idl
@@ -24,9 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface WebGLShaderPrecisionFormat {
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.12
+
+interface WebGLShaderPrecisionFormat {
readonly attribute long rangeMin;
readonly attribute long rangeMax;
readonly attribute long precision;
diff --git a/modules/webgl/WebGLSync.idl b/modules/webgl/WebGLSync.idl
index 1ba4a8e..bf464c2 100644
--- a/modules/webgl/WebGLSync.idl
+++ b/modules/webgl/WebGLSync.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.
-[
- RuntimeEnabled=UnsafeES3APIs,
- GarbageCollected
-] interface WebGLSync {
+// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.4
+
+interface WebGLSync {
};
diff --git a/modules/webgl/WebGLTexture.idl b/modules/webgl/WebGLTexture.idl
index 850e448..f08f1c4 100644
--- a/modules/webgl/WebGLTexture.idl
+++ b/modules/webgl/WebGLTexture.idl
@@ -23,7 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.9
+
[
- GarbageCollected,
+ DependentLifetime
] interface WebGLTexture {
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute unsigned long lastUploadedVideoWidth;
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute unsigned long lastUploadedVideoHeight;
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute double lastUploadedVideoTimestamp;
+ [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute boolean lastUploadedVideoFrameWasSkipped;
};
diff --git a/modules/webgl/WebGLTimerQueryEXT.idl b/modules/webgl/WebGLTimerQueryEXT.idl
index d6223da..f73eac5 100644
--- a/modules/webgl/WebGLTimerQueryEXT.idl
+++ b/modules/webgl/WebGLTimerQueryEXT.idl
@@ -2,8 +2,9 @@
// 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/extensions/EXT_disjoint_timer_query/
+
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface WebGLTimerQueryEXT {
};
diff --git a/modules/webgl/WebGLTransformFeedback.idl b/modules/webgl/WebGLTransformFeedback.idl
index 88f4617..7cf7126 100644
--- a/modules/webgl/WebGLTransformFeedback.idl
+++ b/modules/webgl/WebGLTransformFeedback.idl
@@ -2,8 +2,9 @@
// 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/latest/2.0/#3.5
+
[
- RuntimeEnabled=UnsafeES3APIs,
- GarbageCollected
+ DependentLifetime
] interface WebGLTransformFeedback {
};
diff --git a/modules/webgl/WebGLUniformLocation.idl b/modules/webgl/WebGLUniformLocation.idl
index dd6a43e..5d273d3 100644
--- a/modules/webgl/WebGLUniformLocation.idl
+++ b/modules/webgl/WebGLUniformLocation.idl
@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-[
- GarbageCollected,
-] interface WebGLUniformLocation {
+// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.10
+
+interface WebGLUniformLocation {
};
diff --git a/modules/webgl/WebGLVertexArrayObject.idl b/modules/webgl/WebGLVertexArrayObject.idl
index 4a29ca9..ec3f3ad 100644
--- a/modules/webgl/WebGLVertexArrayObject.idl
+++ b/modules/webgl/WebGLVertexArrayObject.idl
@@ -2,8 +2,9 @@
// 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/latest/2.0/#3.6
+
[
- RuntimeEnabled=UnsafeES3APIs,
- GarbageCollected
+ DependentLifetime
] interface WebGLVertexArrayObject {
};
diff --git a/modules/webgl/WebGLVertexArrayObjectOES.idl b/modules/webgl/WebGLVertexArrayObjectOES.idl
index e1a533f..fb85de4 100644
--- a/modules/webgl/WebGLVertexArrayObjectOES.idl
+++ b/modules/webgl/WebGLVertexArrayObjectOES.idl
@@ -23,8 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
+
[
- NoInterfaceObject,
- GarbageCollected,
+ NoInterfaceObject
] interface WebGLVertexArrayObjectOES {
};
diff --git a/modules/webmidi/MIDIAccess.idl b/modules/webmidi/MIDIAccess.idl
index 7cebf53..0216c51 100644
--- a/modules/webmidi/MIDIAccess.idl
+++ b/modules/webmidi/MIDIAccess.idl
@@ -28,8 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://webaudio.github.io/web-midi-api/#MIDIAccess
+
[
- DependentLifetime,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface MIDIAccess : EventTarget {
readonly attribute MIDIInputMap inputs;
readonly attribute MIDIOutputMap outputs;
diff --git a/modules/webmidi/MIDIConnectionEvent.idl b/modules/webmidi/MIDIConnectionEvent.idl
index 73a77a3..a63c289 100644
--- a/modules/webmidi/MIDIConnectionEvent.idl
+++ b/modules/webmidi/MIDIConnectionEvent.idl
@@ -28,10 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://webaudio.github.io/web-midi-api/#idl-def-MIDIConnectionEvent
+// https://webaudio.github.io/web-midi-api/#MIDIConnectionEvent
[
- Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict),
+ Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict)
] interface MIDIConnectionEvent : Event {
readonly attribute MIDIPort port;
};
diff --git a/modules/webmidi/MIDIConnectionEventInit.idl b/modules/webmidi/MIDIConnectionEventInit.idl
index 3e539ce..a91d4f5 100644
--- a/modules/webmidi/MIDIConnectionEventInit.idl
+++ b/modules/webmidi/MIDIConnectionEventInit.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.
-// http://webaudio.github.io/web-midi-api/#idl-def-MIDIConnectionEventInit
+// https://webaudio.github.io/web-midi-api/#MIDIConnectionEventInit
dictionary MIDIConnectionEventInit : EventInit {
- MIDIPort port;
+ // TODO(foolip): |port| should be required and not nullable.
+ // https://crbug.com/647693
+ // https://github.com/WebAudio/web-midi-api/issues/168
+ MIDIPort? port;
};
diff --git a/modules/webmidi/MIDIInput.idl b/modules/webmidi/MIDIInput.idl
index 31a0627..51e4d3e 100644
--- a/modules/webmidi/MIDIInput.idl
+++ b/modules/webmidi/MIDIInput.idl
@@ -28,8 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://webaudio.github.io/web-midi-api/#MIDIInput
+
[
- SetWrapperReferenceTo(MIDIAccess midiAccess),
+ DependentLifetime
] interface MIDIInput : MIDIPort {
attribute EventHandler onmidimessage;
};
diff --git a/modules/webmidi/MIDIInputMap.idl b/modules/webmidi/MIDIInputMap.idl
index 86ff124..6c0f263 100644
--- a/modules/webmidi/MIDIInputMap.idl
+++ b/modules/webmidi/MIDIInputMap.idl
@@ -2,12 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// FIXME: Implement forEach.
-// callback ForEachCallback = void(DOMString id, MIDIInput port);
+// https://webaudio.github.io/web-midi-api/#MIDIInput
-[
- GarbageCollected,
-] interface MIDIInputMap {
- readonly attribute unsigned long size;
+interface MIDIInputMap {
readonly maplike<DOMString, MIDIInput>;
};
diff --git a/modules/webmidi/MIDIMessageEvent.idl b/modules/webmidi/MIDIMessageEvent.idl
index bf252c0..e2f3fb2 100644
--- a/modules/webmidi/MIDIMessageEvent.idl
+++ b/modules/webmidi/MIDIMessageEvent.idl
@@ -28,11 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://webaudio.github.io/web-midi-api/#idl-def-MIDIMessageEvent
+// https://webaudio.github.io/web-midi-api/#MIDIMessageEvent
[
- Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict),
+ Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict)
] interface MIDIMessageEvent : Event {
- readonly attribute double receivedTime;
readonly attribute Uint8Array data;
};
diff --git a/modules/webmidi/MIDIMessageEventInit.idl b/modules/webmidi/MIDIMessageEventInit.idl
index 4c9e046..2e2ecc8 100644
--- a/modules/webmidi/MIDIMessageEventInit.idl
+++ b/modules/webmidi/MIDIMessageEventInit.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://webaudio.github.io/web-midi-api/#idl-def-MIDIMessageEventInit
+// https://webaudio.github.io/web-midi-api/#MIDIMessageEventInit
dictionary MIDIMessageEventInit : EventInit {
- double receivedTime;
- Uint8Array data;
+ // TODO(foolip): |data| should be required and not nullable.
+ // https://crbug.com/647693
+ // https://github.com/WebAudio/web-midi-api/issues/168
+ Uint8Array? data;
};
diff --git a/modules/webmidi/MIDIOptions.idl b/modules/webmidi/MIDIOptions.idl
index 9df8a96..3136fc6 100644
--- a/modules/webmidi/MIDIOptions.idl
+++ b/modules/webmidi/MIDIOptions.idl
@@ -2,7 +2,7 @@
// 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/webmidi/#midioptions-dictionary
+// https://webaudio.github.io/web-midi-api/#MIDIOptions
dictionary MIDIOptions {
boolean sysex;
diff --git a/modules/webmidi/MIDIOutput.idl b/modules/webmidi/MIDIOutput.idl
index 58a8635..4289366 100644
--- a/modules/webmidi/MIDIOutput.idl
+++ b/modules/webmidi/MIDIOutput.idl
@@ -28,11 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/webmidi/#idl-def-MIDIOutput
-// http://cwilso.github.io/web-midi-api/#idl-def-MIDIOutput
+// https://webaudio.github.io/web-midi-api/#MIDIOutput
[
- SetWrapperReferenceTo(MIDIAccess midiAccess),
+ DependentLifetime
] interface MIDIOutput : MIDIPort {
// TODO(toyoshim): implement void clear()
[RaisesException] void send(Uint8Array data, optional double timestamp);
diff --git a/modules/webmidi/MIDIOutputMap.idl b/modules/webmidi/MIDIOutputMap.idl
index 546f074..63edbaf 100644
--- a/modules/webmidi/MIDIOutputMap.idl
+++ b/modules/webmidi/MIDIOutputMap.idl
@@ -2,12 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// FIXME: Implement forEach.
-// callback ForEachCallback = void(DOMString id, MIDIOutput port);
+// https://webaudio.github.io/web-midi-api/#MIDIOutputMap
-[
- GarbageCollected,
-] interface MIDIOutputMap {
- readonly attribute unsigned long size;
+interface MIDIOutputMap {
readonly maplike<DOMString, MIDIOutput>;
};
diff --git a/modules/webmidi/MIDIPort.idl b/modules/webmidi/MIDIPort.idl
index 0f44867..c0e1fc4 100644
--- a/modules/webmidi/MIDIPort.idl
+++ b/modules/webmidi/MIDIPort.idl
@@ -28,25 +28,33 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://webaudio.github.io/web-midi-api/#idl-def-MIDIPortConnectionState
+
enum MIDIPortConnectionState {
"open",
"closed",
"pending"
};
+// https://webaudio.github.io/web-midi-api/#idl-def-MIDIPortDeviceState
+
enum MIDIPortDeviceState {
"disconnected",
"connected"
};
+// https://webaudio.github.io/web-midi-api/#idl-def-MIDIPortType
+
enum MIDIPortType {
"input",
"output"
};
+// https://webaudio.github.io/web-midi-api/#MIDIPort
+
[
- DependentLifetime,
- GarbageCollected,
+ ActiveScriptWrappable,
+ DependentLifetime
] interface MIDIPort : EventTarget {
readonly attribute MIDIPortConnectionState connection;
readonly attribute DOMString id;
diff --git a/modules/webmidi/NavigatorWebMIDI.idl b/modules/webmidi/NavigatorWebMIDI.idl
index 6f4f7b5..da51aec 100644
--- a/modules/webmidi/NavigatorWebMIDI.idl
+++ b/modules/webmidi/NavigatorWebMIDI.idl
@@ -28,6 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-partial interface Navigator {
- [CallWith=ScriptState, MeasureAs=RequestMIDIAccess] Promise requestMIDIAccess(optional MIDIOptions options);
+// https://webaudio.github.io/web-midi-api/#requestMIDIAccess
+
+[
+ ImplementedAs=NavigatorWebMIDI
+] partial interface Navigator {
+ [
+ CallWith = ScriptState, MeasureAs = RequestMIDIAccess_ObscuredByFootprinting
+ ] Promise
+ requestMIDIAccess(optional MIDIOptions options);
};
diff --git a/modules/webshare/NavigatorShare.idl b/modules/webshare/NavigatorShare.idl
new file mode 100644
index 0000000..75f5b90
--- /dev/null
+++ b/modules/webshare/NavigatorShare.idl
@@ -0,0 +1,13 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/web-share/
+
+[
+ ImplementedAs=NavigatorShare,
+ RuntimeEnabled=WebShare
+] partial interface Navigator {
+ [SecureContext, CallWith=ScriptState, MeasureAs=WebShareShare]
+ Promise<void> share(optional ShareData data);
+};
diff --git a/modules/webshare/ShareData.idl b/modules/webshare/ShareData.idl
new file mode 100644
index 0000000..3911fe7
--- /dev/null
+++ b/modules/webshare/ShareData.idl
@@ -0,0 +1,11 @@
+// Copyright 2016 The Chromium 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://wicg.github.io/web-share/
+
+dictionary ShareData {
+ USVString title;
+ USVString text;
+ USVString url;
+};
diff --git a/modules/websockets/CloseEvent.idl b/modules/websockets/CloseEvent.idl
index 7371ad9..a9d727d 100644
--- a/modules/websockets/CloseEvent.idl
+++ b/modules/websockets/CloseEvent.idl
@@ -32,7 +32,7 @@
[
Constructor(DOMString type, optional CloseEventInit eventInitDict),
- Exposed=(Window,Worker),
+ Exposed=(Window,Worker)
] interface CloseEvent : Event {
readonly attribute boolean wasClean;
readonly attribute unsigned short code;
diff --git a/modules/websockets/WebSocket.idl b/modules/websockets/WebSocket.idl
index ee12816..852894e 100644
--- a/modules/websockets/WebSocket.idl
+++ b/modules/websockets/WebSocket.idl
@@ -34,13 +34,13 @@
enum BinaryType { "blob", "arraybuffer" };
[
- DependentLifetime,
+ ActiveScriptWrappable,
Constructor(DOMString url, optional (DOMString or sequence<DOMString>) protocols),
ConstructorCallWith=ExecutionContext,
+ DependentLifetime,
Exposed=(Window,Worker),
- RaisesException=Constructor,
- GarbageCollected,
ImplementedAs=DOMWebSocket,
+ RaisesException=Constructor
] interface WebSocket : EventTarget {
readonly attribute DOMString url;
@@ -58,7 +58,7 @@
attribute EventHandler onclose;
readonly attribute DOMString extensions;
readonly attribute DOMString protocol;
- [RaisesException] void close([Clamp] optional unsigned short code, optional USVString reason);
+ [RaisesException] void close(optional [Clamp] unsigned short code, optional USVString reason);
// messaging
attribute EventHandler onmessage;
diff --git a/modules/webusb/NavigatorUSB.idl b/modules/webusb/NavigatorUSB.idl
index d916a0e..02febf2 100644
--- a/modules/webusb/NavigatorUSB.idl
+++ b/modules/webusb/NavigatorUSB.idl
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#device-enumeration
+// https://wicg.github.io/webusb/#enumeration
[
- GarbageCollected,
- RuntimeEnabled=WebUSB,
+ ImplementedAs=NavigatorUSB
] partial interface Navigator {
- readonly attribute USB usb;
+ [SecureContext, RuntimeEnabled=WebUSB] readonly attribute USB usb;
};
diff --git a/modules/webusb/USB.idl b/modules/webusb/USB.idl
index 2c7489c..81f8af5 100644
--- a/modules/webusb/USB.idl
+++ b/modules/webusb/USB.idl
@@ -2,15 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#device-enumeration
+// https://wicg.github.io/webusb/#usb
[
- GarbageCollected,
- NoInterfaceObject,
- RuntimeEnabled=WebUSB,
+ RuntimeEnabled=WebUSB
] interface USB : EventTarget {
attribute EventHandler onconnect;
attribute EventHandler ondisconnect;
- [CallWith=ScriptState] Promise<sequence<USBDevice>> getDevices();
- [CallWith=ScriptState] Promise<sequence<USBDevice>> requestDevice(USBDeviceRequestOptions options);
+ [CallWith=ScriptState, MeasureAs=UsbGetDevices] Promise<sequence<USBDevice>> getDevices();
+ [CallWith=ScriptState, MeasureAs=UsbRequestDevice] Promise<sequence<USBDevice>> requestDevice(USBDeviceRequestOptions options);
};
diff --git a/modules/webusb/USBAlternateInterface.idl b/modules/webusb/USBAlternateInterface.idl
index cbf37fa..d951461 100644
--- a/modules/webusb/USBAlternateInterface.idl
+++ b/modules/webusb/USBAlternateInterface.idl
@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#interfaces
+// https://wicg.github.io/webusb/#interfaces
[
Constructor(USBInterface deviceInterface, octet alternateSetting),
RaisesException=Constructor,
- GarbageCollected,
- RuntimeEnabled=WebUSB,
+ RuntimeEnabled=WebUSB
] interface USBAlternateInterface {
readonly attribute octet alternateSetting;
readonly attribute octet interfaceClass;
readonly attribute octet interfaceSubclass;
readonly attribute octet interfaceProtocol;
readonly attribute DOMString? interfaceName;
- readonly attribute sequence<USBEndpoint> endpoints;
+ readonly attribute FrozenArray<USBEndpoint> endpoints;
};
diff --git a/modules/webusb/USBConfiguration.idl b/modules/webusb/USBConfiguration.idl
index 3cd0ec9..48b7c33 100644
--- a/modules/webusb/USBConfiguration.idl
+++ b/modules/webusb/USBConfiguration.idl
@@ -2,15 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#configurations
+// https://wicg.github.io/webusb/#configurations
[
Constructor(USBDevice device, octet configurationValue),
RaisesException=Constructor,
- GarbageCollected,
- RuntimeEnabled=WebUSB,
+ RuntimeEnabled=WebUSB
] interface USBConfiguration {
readonly attribute octet configurationValue;
readonly attribute DOMString? configurationName;
- readonly attribute sequence<USBInterface> interfaces;
+ readonly attribute FrozenArray<USBInterface> interfaces;
};
diff --git a/modules/webusb/USBConnectionEvent.idl b/modules/webusb/USBConnectionEvent.idl
index beaba0e..b0865a7 100644
--- a/modules/webusb/USBConnectionEvent.idl
+++ b/modules/webusb/USBConnectionEvent.idl
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#events
+// https://wicg.github.io/webusb/#events
[
- Constructor(DOMString type, optional USBConnectionEventInit eventInitDict),
- RuntimeEnabled=WebUSB,
+ Constructor(DOMString type, USBConnectionEventInit eventInitDict),
+ RuntimeEnabled=WebUSB
] interface USBConnectionEvent : Event {
- readonly attribute USBDevice device;
+ [SameObject] readonly attribute USBDevice device;
};
diff --git a/modules/webusb/USBConnectionEventInit.idl b/modules/webusb/USBConnectionEventInit.idl
index 797cf73..abb2b85 100644
--- a/modules/webusb/USBConnectionEventInit.idl
+++ b/modules/webusb/USBConnectionEventInit.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.
-// http://wicg.github.io/webusb/#events
+// https://wicg.github.io/webusb/#events
dictionary USBConnectionEventInit : EventInit {
- USBDevice device;
+ required USBDevice device;
};
diff --git a/modules/webusb/USBDevice.idl b/modules/webusb/USBDevice.idl
index 6d38461..def29e3 100644
--- a/modules/webusb/USBDevice.idl
+++ b/modules/webusb/USBDevice.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#idl-def-usbtransferstatus
+// https://wicg.github.io/webusb/#transfers
enum USBTransferStatus {
"ok",
@@ -10,13 +10,11 @@
"babble"
};
-// http://wicg.github.io/webusb/#device-usage
+// https://wicg.github.io/webusb/#device-usage
[
- GarbageCollected,
- RuntimeEnabled=WebUSB,
+ RuntimeEnabled=WebUSB
] interface USBDevice {
- readonly attribute DOMString guid;
readonly attribute octet usbVersionMajor;
readonly attribute octet usbVersionMinor;
readonly attribute octet usbVersionSubminor;
@@ -31,21 +29,22 @@
readonly attribute DOMString? manufacturerName;
readonly attribute DOMString? productName;
readonly attribute DOMString? serialNumber;
- readonly attribute sequence<USBConfiguration> configurations;
+ readonly attribute USBConfiguration? configuration;
+ readonly attribute FrozenArray<USBConfiguration> configurations;
+ readonly attribute boolean opened;
- [CallWith=ScriptState] Promise<void> open();
- [CallWith=ScriptState] Promise<void> close();
- [CallWith=ScriptState] Promise<void> getConfiguration();
- [CallWith=ScriptState] Promise<void> setConfiguration(octet configurationValue);
- [CallWith=ScriptState] Promise<void> claimInterface(octet interfaceNumber);
- [CallWith=ScriptState] Promise<void> releaseInterface(octet interfaceNumber);
- [CallWith=ScriptState] Promise<void> setInterface(octet interfaceNumber, octet alternateSetting);
- [CallWith=ScriptState] Promise<USBInTransferResult> controlTransferIn(USBControlTransferParameters setup, unsigned short length);
- [CallWith=ScriptState] Promise<USBOutTransferResult> controlTransferOut(USBControlTransferParameters setup, optional BufferSource data);
- [CallWith=ScriptState] Promise<void> clearHalt(octet endpointNumber);
- [CallWith=ScriptState] Promise<USBInTransferResult> transferIn(octet endpointNumber, unsigned long length);
- [CallWith=ScriptState] Promise<USBOutTransferResult> transferOut(octet endpointNumber, BufferSource data);
- [CallWith=ScriptState] Promise<USBIsochronousInTransferResult> isochronousTransferIn(octet endpointNumber, sequence<unsigned long> packetLengths);
- [CallWith=ScriptState] Promise<UsbIsochronousOutTransferResult> isochronousTransferOut(octet endpointNumber, BufferSource data, sequence<unsigned long> packetLengths);
- [CallWith=ScriptState] Promise<void> reset();
+ [CallWith=ScriptState, MeasureAs=UsbDeviceOpen] Promise<void> open();
+ [CallWith=ScriptState, MeasureAs=UsbDeviceClose] Promise<void> close();
+ [CallWith=ScriptState, MeasureAs=UsbDeviceSelectConfiguration] Promise<void> selectConfiguration(octet configurationValue);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceClaimInterface] Promise<void> claimInterface(octet interfaceNumber);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceReleaseInterface] Promise<void> releaseInterface(octet interfaceNumber);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceSelectAlternateInterface] Promise<void> selectAlternateInterface(octet interfaceNumber, octet alternateSetting);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceControlTransferIn] Promise<USBInTransferResult> controlTransferIn(USBControlTransferParameters setup, unsigned short length);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceControlTransferOut] Promise<USBOutTransferResult> controlTransferOut(USBControlTransferParameters setup, optional BufferSource data);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceClearHalt] Promise<void> clearHalt(USBDirection direction, octet endpointNumber);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceTransferIn] Promise<USBInTransferResult> transferIn(octet endpointNumber, unsigned long length);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceTransferOut] Promise<USBOutTransferResult> transferOut(octet endpointNumber, BufferSource data);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceIsochronousTransferIn] Promise<USBIsochronousInTransferResult> isochronousTransferIn(octet endpointNumber, sequence<unsigned long> packetLengths);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceIsochronousTransferOut] Promise<UsbIsochronousOutTransferResult> isochronousTransferOut(octet endpointNumber, BufferSource data, sequence<unsigned long> packetLengths);
+ [CallWith=ScriptState, MeasureAs=UsbDeviceReset] Promise<void> reset();
};
diff --git a/modules/webusb/USBDeviceFilter.idl b/modules/webusb/USBDeviceFilter.idl
index 5d59379..9b4c641 100644
--- a/modules/webusb/USBDeviceFilter.idl
+++ b/modules/webusb/USBDeviceFilter.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#device-enumeration
+// https://wicg.github.io/webusb/#enumeration
dictionary USBDeviceFilter {
unsigned short vendorId;
@@ -10,4 +10,5 @@
octet classCode;
octet subclassCode;
octet protocolCode;
+ DOMString serialNumber;
};
diff --git a/modules/webusb/USBDeviceRequestOptions.idl b/modules/webusb/USBDeviceRequestOptions.idl
index eea3c39..d0ddda7 100644
--- a/modules/webusb/USBDeviceRequestOptions.idl
+++ b/modules/webusb/USBDeviceRequestOptions.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#device-enumeration
+// https://wicg.github.io/webusb/#enumeration
dictionary USBDeviceRequestOptions {
required sequence<USBDeviceFilter> filters;
diff --git a/modules/webusb/USBEndpoint.idl b/modules/webusb/USBEndpoint.idl
index 9124e6d..07b815b 100644
--- a/modules/webusb/USBEndpoint.idl
+++ b/modules/webusb/USBEndpoint.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#endpoints
+// https://wicg.github.io/webusb/#endpoints
enum USBDirection {
"in",
@@ -18,8 +18,7 @@
[
Constructor(USBAlternateInterface alternate, octet endpointNumber, USBDirection direction),
RaisesException=Constructor,
- GarbageCollected,
- RuntimeEnabled=WebUSB,
+ RuntimeEnabled=WebUSB
] interface USBEndpoint {
readonly attribute octet endpointNumber;
readonly attribute USBDirection direction;
diff --git a/modules/webusb/USBInTransferResult.idl b/modules/webusb/USBInTransferResult.idl
index 2251b1d..e8b950b 100644
--- a/modules/webusb/USBInTransferResult.idl
+++ b/modules/webusb/USBInTransferResult.idl
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#idl-def-usbintransferresult
+// https://wicg.github.io/webusb/#usbintransferresult
[
- GarbageCollected,
RuntimeEnabled=WebUSB,
+ Constructor(USBTransferStatus status, optional DataView? data)
] interface USBInTransferResult {
- readonly attribute DataView data;
+ readonly attribute DataView? data;
readonly attribute USBTransferStatus status;
};
diff --git a/modules/webusb/USBInterface.idl b/modules/webusb/USBInterface.idl
index 54e3734..3768cd5 100644
--- a/modules/webusb/USBInterface.idl
+++ b/modules/webusb/USBInterface.idl
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#interfaces
+// https://wicg.github.io/webusb/#interfaces
[
Constructor(USBConfiguration configuration, octet interfaceNumber),
RaisesException=Constructor,
- GarbageCollected,
- RuntimeEnabled=WebUSB,
+ RuntimeEnabled=WebUSB
] interface USBInterface {
readonly attribute octet interfaceNumber;
- readonly attribute sequence<USBAlternateInterface> alternates;
+ readonly attribute USBAlternateInterface? alternate;
+ readonly attribute FrozenArray<USBAlternateInterface> alternates;
+ readonly attribute boolean claimed;
};
diff --git a/modules/webusb/USBIsochronousInTransferPacket.idl b/modules/webusb/USBIsochronousInTransferPacket.idl
index 3129bde..7bca63a 100644
--- a/modules/webusb/USBIsochronousInTransferPacket.idl
+++ b/modules/webusb/USBIsochronousInTransferPacket.idl
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://wicg.github.io/webusb/#idl-def-usbisochronousintransferpacket
+// https://wicg.github.io/webusb/#usbisochronousintransferpacket
[
- GarbageCollected,
RuntimeEnabled=WebUSB,
+ Constructor(USBTransferStatus status, optional DataView? data)
] interface USBIsochronousInTransferPacket {
readonly attribute USBTransferStatus status;
- readonly attribute DataView data;
+ readonly attribute DataView? data;
};
diff --git a/modules/webusb/USBIsochronousInTransferResult.idl b/modules/webusb/USBIsochronousInTransferResult.idl
index 139856f..e0120ee 100644
--- a/modules/webusb/USBIsochronousInTransferResult.idl
+++ b/modules/webusb/USBIsochronousInTransferResult.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://wicg.github.io/webusb/#idl-def-usbisochronousintransferresult
+// https://wicg.github.io/webusb/#usbisochronousintransferresult
[
- GarbageCollected,
RuntimeEnabled=WebUSB,
+ Constructor(sequence<USBIsochronousInTransferPacket> packets,
+ optional DataView? data)
] interface USBIsochronousInTransferResult {
- readonly attribute DataView data;
- readonly attribute sequence<USBIsochronousInTransferPacket> packets;
+ readonly attribute DataView? data;
+ readonly attribute FrozenArray<USBIsochronousInTransferPacket> packets;
};
diff --git a/modules/webusb/USBIsochronousOutTransferPacket.idl b/modules/webusb/USBIsochronousOutTransferPacket.idl
index c6789c3..5c9da5f 100644
--- a/modules/webusb/USBIsochronousOutTransferPacket.idl
+++ b/modules/webusb/USBIsochronousOutTransferPacket.idl
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://wicg.github.io/webusb/#idl-def-usbisochronousouttransferpacket
+// https://wicg.github.io/webusb/#usbisochronousouttransferpacket
[
- GarbageCollected,
RuntimeEnabled=WebUSB,
+ Constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0)
] interface USBIsochronousOutTransferPacket {
- readonly attribute USBTransferStatus status;
readonly attribute unsigned long bytesWritten;
+ readonly attribute USBTransferStatus status;
};
diff --git a/modules/webusb/USBIsochronousOutTransferResult.idl b/modules/webusb/USBIsochronousOutTransferResult.idl
index aebd8e1..2acee95 100644
--- a/modules/webusb/USBIsochronousOutTransferResult.idl
+++ b/modules/webusb/USBIsochronousOutTransferResult.idl
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// https://wicg.github.io/webusb/#idl-def-usbisochronousouttransferresult
+// https://wicg.github.io/webusb/#usbisochronousouttransferresult
[
- GarbageCollected,
RuntimeEnabled=WebUSB,
+ Constructor(sequence<USBIsochronousOutTransferPacket> packets)
] interface USBIsochronousOutTransferResult {
- readonly attribute sequence<USBIsochronousOutTransferPacket> packets;
+ readonly attribute FrozenArray<USBIsochronousOutTransferPacket> packets;
};
diff --git a/modules/webusb/USBOutTransferResult.idl b/modules/webusb/USBOutTransferResult.idl
index b43587a..52caf05 100644
--- a/modules/webusb/USBOutTransferResult.idl
+++ b/modules/webusb/USBOutTransferResult.idl
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// http://wicg.github.io/webusb/#idl-def-usbouttransferresult
+// https://wicg.github.io/webusb/#usbouttransferresult
[
- GarbageCollected,
RuntimeEnabled=WebUSB,
+ Constructor(USBTransferStatus status, optional unsigned long bytesWritten = 0)
] interface USBOutTransferResult {
readonly attribute unsigned long bytesWritten;
readonly attribute USBTransferStatus status;
diff --git a/modules/worklet/WindowWorklet.idl b/modules/worklet/WindowWorklet.idl
deleted file mode 100644
index 8b98be2..0000000
--- a/modules/worklet/WindowWorklet.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 The Chromium 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=DOMWindowWorklet,
- RuntimeEnabled=Worklet,
-] partial interface Window {
- [CallWith=ExecutionContext] readonly attribute Worklet renderWorklet;
-};
diff --git a/modules/worklet/Worklet.idl b/modules/worklet/Worklet.idl
deleted file mode 100644
index 0744c69..0000000
--- a/modules/worklet/Worklet.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 The Chromium 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://drafts.css-houdini.org/worklets/#worklet
-
-[
- DependentLifetime,
- GarbageCollected,
- RuntimeEnabled=Worklet,
-] interface Worklet {
- [CallWith=ScriptState] Promise<void> import(DOMString url);
-};
diff --git a/modules/worklet/WorkletGlobalScope.idl b/modules/worklet/WorkletGlobalScope.idl
deleted file mode 100644
index f3ceb1e..0000000
--- a/modules/worklet/WorkletGlobalScope.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 The Chromium 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://drafts.css-houdini.org/worklets/#workletglobalscope
-
-[
- Exposed=Worklet,
- Global=Worklet,
- RuntimeEnabled=Worklet,
- WillBeGarbageCollected,
-] interface WorkletGlobalScope {
-};