diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 21:44:39 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 21:44:39 +0000 |
commit | 07facf095ea17412a765f354b8fc17399a259630 (patch) | |
tree | 6d7b3ad5c82b0c35b2d2b51939e2455b97cb11fa /o3d/documentation | |
parent | dc5b41997c4e55a9df7245739f4b27a920212b12 (diff) | |
download | chromium_src-07facf095ea17412a765f354b8fc17399a259630.zip chromium_src-07facf095ea17412a765f354b8fc17399a259630.tar.gz chromium_src-07facf095ea17412a765f354b8fc17399a259630.tar.bz2 |
This CL contains the the changes needed to build
an externs file for the JSCompiler as well as
the code to build a compiled verison of the o3djs
sample libs.
Review URL: http://codereview.chromium.org/147079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/documentation')
-rw-r--r-- | o3d/documentation/JSCompiler_deploy.jar | bin | 0 -> 19582515 bytes | |||
-rw-r--r-- | o3d/documentation/build.scons | 67 | ||||
-rwxr-xr-x | o3d/documentation/build_docs.bat | 33 | ||||
-rwxr-xr-x | o3d/documentation/build_docs.py | 253 | ||||
-rw-r--r-- | o3d/documentation/externs/externs.js | 1859 | ||||
-rwxr-xr-x | o3d/documentation/externs/o3d-extra-externs.js | 48 | ||||
-rw-r--r-- | o3d/documentation/jsdoc-toolkit-templates/class.tmpl | 20 | ||||
-rw-r--r-- | o3d/documentation/jsdoc-toolkit-templates/publish.js | 172 |
8 files changed, 2328 insertions, 124 deletions
diff --git a/o3d/documentation/JSCompiler_deploy.jar b/o3d/documentation/JSCompiler_deploy.jar Binary files differnew file mode 100644 index 0000000..9f0b4f9 --- /dev/null +++ b/o3d/documentation/JSCompiler_deploy.jar diff --git a/o3d/documentation/build.scons b/o3d/documentation/build.scons index 339a06f..71c9770 100644 --- a/o3d/documentation/build.scons +++ b/o3d/documentation/build.scons @@ -28,7 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import glob import os.path import subprocess Import('env') @@ -38,11 +37,8 @@ Import('O3D_IDL_SOURCES') Import('O3D_JS_SOURCES') env.Replace( - EZT_FORMATTER = 'documentation/ezt_formatter.py', - CLASS_TREE_GEN = 'documentation/classtree.py', JSDOC_DIR = '$SCONSTRUCT_DIR/documentation', JSDOC_EZT_TEMPLATE_DIR = '$JSDOC_DIR/jsdoc-toolkit-templates/', - JSDOC_JAR = '$JSDOCTOOLKIT_DIR/jsrun.jar', PYTHONPATH = ['$NIXYSA_DIR', '$GFLAGS_DIR/python', '$PLY_DIR'] @@ -54,71 +50,14 @@ LOCAL_IDL_SOURCES = [IDL_DIR + i for i in O3D_IDL_SOURCES] JS_DIR = '$SCONSTRUCT_DIR/samples/o3djs/' LOCAL_JS_SOURCES = [JS_DIR + i for i in O3D_JS_SOURCES] -def IdlDocsEmitter(target, source, env): - bases = [os.path.splitext(s.name)[0] for s in source] - targets = [target[0].dir.abspath + "/%s.$IDL_GENERATE_EXT" % b for b in bases] - return targets, source +DOCSGEN_ARGS = ['$JSDOC_DIR/build_docs.py $JAVA_EXE'] -AUTOGEN_ARGS = ['$NIXYSA_DIR/codegen.py', - '--binding-module=o3d:plugin/o3d_binding.py', - '--generate=$IDL_GENERATE', - '--output-dir=${TARGET.dir}'] -if ARGUMENTS.get('force-docs', False): - AUTOGEN_ARGS += ['--force-docs'] -AUTOGEN_ARGS += ['$SOURCES'] - -JSDOCS_CMD = ' '.join([ - '$JAVA_EXE', - '-Djsdoc.dir=$JSDOCTOOLKIT_DIR', - '-jar $JSDOC_JAR', - '$JSDOCTOOLKIT_DIR/app/run.js', - '-v', - '-t=$JSDOC_EZT_TEMPLATE_DIR/', - '-d=${TARGET.dir}', - ' '.join(LOCAL_JS_SOURCES)]) - -def TouchAll(target=None, source=None, env=None): - for i in target: - if not os.path.exists(i.path): - open(i.path, 'wb').close() - -env["BUILDERS"]["IdlDocs"] = Builder(action=[env.Python(AUTOGEN_ARGS), - Action(TouchAll)], - emitter=IdlDocsEmitter) - -doxy_inputs = [] -doxy_inputs += env.IdlDocs( - 'dummy', LOCAL_IDL_SOURCES, - IDL_GENERATE='cppheader', - IDL_GENERATE_EXT='h') - -def EZTStep(target=None, source=None, env=None): - dir = env.Dir('$OBJ_ROOT/documentation/html') - html_files = glob.glob(dir.path + os.sep + '*.html') - for file in html_files: - ret = env.Execute(env.Python(['$EZT_FORMATTER', file])) - if ret > 0: - return ret - return 0 - -def ClassTreeStep(target=None, source=None, env=None): - dir = env.Dir('$OBJ_ROOT/documentation/html') - return env.Execute(env.Python(['$CLASS_TREE_GEN', dir.path])) - -env.Command( - 'html/doxygen.png', doxy_inputs, - ['$DOXYGEN documentation/Doxyfile', - Action(EZTStep), - Action(ClassTreeStep), - Touch('$TARGET')], -) - -env["BUILDERS"]["JSDocs"] = Builder(action=JSDOCS_CMD) +env["BUILDERS"]["JSDocs"] = Builder(action=env.Python(DOCSGEN_ARGS)) # index.ezt is a file that the jsdoctoolkit happens to build. # Putting it in jsdocs means that will be our target dir for the rest # of the files. -env.JSDocs('html/jsdocs/classtree.html', LOCAL_JS_SOURCES + +env.JSDocs('base.js', LOCAL_JS_SOURCES + LOCAL_IDL_SOURCES + ['$JSDOC_EZT_TEMPLATE_DIR/annotated.tmpl', '$JSDOC_EZT_TEMPLATE_DIR/class.tmpl', '$JSDOC_EZT_TEMPLATE_DIR/classtree.tmpl', diff --git a/o3d/documentation/build_docs.bat b/o3d/documentation/build_docs.bat new file mode 100755 index 0000000..bad9281 --- /dev/null +++ b/o3d/documentation/build_docs.bat @@ -0,0 +1,33 @@ +@echo OFF
+REM Copyright 2009, Google Inc.
+REM All rights reserved.
+REM
+REM Redistribution and use in source and binary forms, with or without
+REM modification, are permitted provided that the following conditions are
+REM met:
+REM
+REM * Redistributions of source code must retain the above copyright
+REM notice, this list of conditions and the following disclaimer.
+REM * Redistributions in binary form must reproduce the above
+REM copyright notice, this list of conditions and the following disclaimer
+REM in the documentation and/or other materials provided with the
+REM distribution.
+REM * Neither the name of Google Inc. nor the names of its
+REM contributors may be used to endorse or promote products derived from
+REM this software without specific prior written permission.
+REM
+REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+REM A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+REM OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+REM SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+REM LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+REM DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+REM THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+REM OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+set PYTHONDIR=%~dp0..\..\third_party\python_24
+call %PYTHONDIR%\setup_env.bat
+%PYTHONDIR%\python.exe %~dp0\build_docs.py %*
diff --git a/o3d/documentation/build_docs.py b/o3d/documentation/build_docs.py new file mode 100755 index 0000000..423f246 --- /dev/null +++ b/o3d/documentation/build_docs.py @@ -0,0 +1,253 @@ +#!/usr/bin/python2.4
+# Copyright 2009, 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.
+
+
+"""Docbuilder for O3D and o3djs."""
+
+
+import os
+import os.path
+import sys
+import imp
+import types
+import glob
+import subprocess
+
+_java_exe = ''
+_script_path = os.path.dirname(os.path.realpath(__file__))
+
+GlobalsDict = { }
+
+
+def MakePath(file_path):
+ """Makes a path absolute given a path relativel to this script."""
+ return os.path.join(_script_path, file_path)
+
+
+def UpdateGlobals(dict):
+ """Copies pairs from dict into GlobalDict."""
+ for i, v in dict.items():
+ GlobalsDict.__setitem__(i, v)
+
+
+def GetCallingNamespaces():
+ """Return the locals and globals for the function that called
+ into this module in the current call stack."""
+ try: 1/0
+ except ZeroDivisionError:
+ # Don't start iterating with the current stack-frame to
+ # prevent creating reference cycles (f_back is safe).
+ frame = sys.exc_info()[2].tb_frame.f_back
+
+ # Find the first frame that *isn't* from this file
+ while frame.f_globals.get("__name__") == __name__:
+ frame = frame.f_back
+
+ return frame.f_locals, frame.f_globals
+
+
+def ComputeExports(exports):
+ """Compute a dictionary of exports given one of the parameters
+ to the Export() function or the exports argument to SConscript()."""
+
+ loc, glob = GetCallingNamespaces()
+
+ retval = {}
+ try:
+ for export in exports:
+ if isinstance(export, types.DictType):
+ retval.update(export)
+ else:
+ try:
+ retval[export] = loc[export]
+ except KeyError:
+ retval[export] = glob[export]
+ except KeyError, x:
+ raise Error, "Export of non-existent variable '%s'"%x
+
+ return retval
+
+
+def Export(*vars):
+ """Copies the named variables to GlobalDict."""
+ for var in vars:
+ UpdateGlobals(ComputeExports(vars))
+
+
+def Import(filename):
+ """Imports a python file in a scope with 'Export' defined."""
+ scope = {'__builtins__': globals()['__builtins__'],
+ 'Export': Export}
+ file = open(filename, 'r')
+ exec file in scope
+ file.close()
+
+
+def Execute(args):
+ """Executes an external program."""
+ # Comment the next line in for debugging.
+ # print "Execute: ", ' '.join(args)
+ if subprocess.call(args) > 0:
+ raise RuntimeError('FAILED: ' + ' '.join(args))
+
+
+def AppendBasePath(folder, filenames):
+ """Appends a base path to a ist of files"""
+ return [os.path.join(folder, filename) for filename in filenames]
+
+
+def RunNixysa(idl_files, generate, output_dir, nixysa_options):
+ """Executes Nixysa."""
+ python_exe = 'python'
+ Execute([
+ python_exe,
+ MakePath('../third_party/nixysa/files/codegen.py'),
+ '--binding-module=o3d:%s' % MakePath('../plugin/o3d_binding.py'),
+ '--generate=' + generate,
+ '--force',
+ '--output-dir=' + output_dir] +
+ nixysa_options +
+ idl_files)
+
+
+def RunJSDocToolkit(js_files, output_dir, prefix):
+ """Executes the JSDocToolkit."""
+ list_filename = MakePath('../scons-out/docs/obj/doclist.conf')
+ f = open(list_filename, 'w')
+ f.write('{\n_: [\n')
+ for filename in js_files:
+ f.write('"%s",\n' % filename.replace('\\', '/'))
+ f.write(']\n}\n')
+ f.close()
+
+ Execute([
+ _java_exe,
+ '-Djsdoc.dir=%s' % MakePath('../third_party/jsdoctoolkit/files'),
+ '-jar',
+ MakePath('../third_party/jsdoctoolkit/files/jsrun.jar'),
+ MakePath('../third_party/jsdoctoolkit/files/app/run.js'),
+ '-D="prefix:%s"' % prefix,
+ '-v',
+ '-t=%s' % MakePath('./jsdoc-toolkit-templates//'),
+ '-d=' + output_dir,
+ '-c=' + list_filename])
+
+
+def BuildJavaScriptForDocsFromIDLs(idl_files, output_dir):
+ RunNixysa(idl_files, 'jsheader', output_dir, [])
+
+
+def BuildJavaScriptForExternsFromIDLs(idl_files, output_dir):
+ if (os.path.exists(output_dir)):
+ for filename in glob.glob(os.path.join(output_dir, '*.js')):
+ os.unlink(filename)
+ RunNixysa(idl_files, 'jsheader', output_dir, ['--no-return-docs'])
+
+
+def BuildO3DDocsFromJavaScript(js_files, output_dir):
+ RunJSDocToolkit(js_files, output_dir, 'classo3d_1_1_')
+
+
+def BuildO3DExternsFile(js_files_dir, extra_externs_file, externs_file):
+ outfile = open(externs_file, 'w')
+ filenames = (glob.glob(os.path.join(js_files_dir, '*.js')) +
+ [extra_externs_file])
+ for filename in filenames:
+ infile = open(filename, 'r')
+ outfile.write(infile.read())
+ infile.close()
+ outfile.close()
+
+
+def BuildCompiledO3DJS(o3djs_files,
+ externs_path,
+ o3d_externs_js_path,
+ compiled_o3djs_outpath):
+ Execute([
+ _java_exe,
+ '-jar',
+ MakePath('JSCompiler_deploy.jar'),
+ '--externs=%s' % externs_path,
+ ('--externs=%s' % o3d_externs_js_path),
+ ('--js_output_file=%s' % compiled_o3djs_outpath)] +
+ ['-js=%s' % (x, ) for x in o3djs_files]);
+
+
+def main():
+ """Builds the O3D API docs and externs and the o3djs docs."""
+ global _java_exe
+ _java_exe = sys.argv[1]
+
+ js_list_filename = MakePath('../samples/o3djs/js_list.scons')
+ idl_list_filename = MakePath('../plugin/idl_list.scons')
+ js_list_basepath = os.path.dirname(js_list_filename)
+ idl_list_basepath = os.path.dirname(idl_list_filename)
+
+ docs_js_outpath = MakePath('../scons-out/docs/obj/documentation/apijs')
+ externs_js_outpath = MakePath('../scons-out/docs/obj/externs')
+ o3d_docs_html_outpath = MakePath('../scons-out/docs/obj/documentation/html')
+ o3d_externs_path = MakePath('../scons-out/docs/obj/o3d-externs.js')
+ compiled_o3djs_outpath = MakePath(
+ '../scons-out/docs/obj/documentation/base.js')
+ externs_path = MakePath('externs/externs.js')
+ o3d_extra_externs_path = MakePath('externs/o3d-extra-externs.js')
+
+ Import(js_list_filename)
+ Import(idl_list_filename)
+
+ idl_files = AppendBasePath(idl_list_basepath, GlobalsDict['O3D_IDL_SOURCES'])
+ o3djs_files = AppendBasePath(js_list_basepath, GlobalsDict['O3D_JS_SOURCES'])
+
+ # we need to put base.js first?
+ o3djs_files = (
+ filter(lambda x: x.endswith('base.js'), o3djs_files) +
+ filter(lambda x: not x.endswith('base.js'), o3djs_files))
+
+ docs_js_files = [os.path.join(
+ docs_js_outpath,
+ os.path.splitext(os.path.basename(f))[0] + '.js')
+ for f in GlobalsDict['O3D_IDL_SOURCES']]
+
+ BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath)
+ BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files,
+ o3d_docs_html_outpath)
+ BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath)
+ BuildO3DExternsFile(externs_js_outpath,
+ o3d_extra_externs_path,
+ o3d_externs_path)
+ BuildCompiledO3DJS(o3djs_files,
+ externs_path,
+ o3d_externs_path,
+ compiled_o3djs_outpath)
+
+
+if __name__ == '__main__':
+ main()
+
diff --git a/o3d/documentation/externs/externs.js b/o3d/documentation/externs/externs.js new file mode 100644 index 0000000..4e694b0 --- /dev/null +++ b/o3d/documentation/externs/externs.js @@ -0,0 +1,1859 @@ +// Copyright 2006 Google Inc. +// All Rights Reserved. + +// Common external variables when compiling +// DEPRECATED: please use the files in //javascript/externs/... + +// JavaScript objects +/** + * @constructor + * @param {*} var_args + * @return {!Array} + */ +function Array(var_args) {} +/** + * @constructor + * @param {*} opt_value + * @return {boolean} + */ +function Boolean(opt_value) {} +/** + * @constructor + * @return {string} + */ +function Date(opt_yr_num, opt_mo_num, opt_day_num, opt_hr_num, opt_min_num, + opt_sec_num, opt_ms_num) {} +/** + * @constructor + * @param {*} opt_message + * @param {*} opt_file + * @param {*} opt_line + * @return {!Error} + */ +function Error(opt_message, opt_file, opt_line) {} +/** + * @constructor + * @param {*} var_args + */ +function Function(var_args) {} +/** + * @constructor + * @param {*} opt_value + * @return {number} + */ +function Number(opt_value) {} +/** + * @constructor + * @param {*} opt_value + */ +function Object(opt_value) {} +/** + * @constructor + * @param {*} opt_pattern + * @param {*} opt_flags + * @return {!RegExp} + */ +function RegExp(opt_pattern, opt_flags) {} +/** + * @constructor + * @param {*} opt_str + * @return {string} + */ +function String(opt_str) {} + +// For IE, returns an object representing key-value pairs for all the global +// variables prefixed with str, e.g. test* +function RuntimeObject(opt_str) {} + +/** @constructor */ +function Arguments() {} + +// JavaScript functions +// escape() and unescape() should only be used in browser where +// encode/decodeURIComponent are not present, as the latter +// handle fancy Unicode characters. +function decodeURI(x) {} +function decodeURIComponent(x) {} +function encodeURI(x) {} +function encodeURIComponent(x) {} +function escape(x) {} // Caution: Read comments above regarding +function unescape(x) {} // use of escape and unescape. +function isFinite(x) {} +function isNaN(x) {} +function parseFloat(x) {} +// base is required. If you really want to parse octal or hex based on the +// leader, then pass undefind as the base. +function parseInt(x, base) {} +function eval(x) {} + +// JavaScript builtins +var arguments; +var Infinity; +var Math; +var NaN; +var undefined; + +var builtins = {}; +builtins.arguments; // deprecated +builtins.arity; // deprecated +builtins.caller; +builtins.constructor; +builtins.length; +builtins.name; +builtins.prototype; + +// Window properties +// Only common properties are here, others such as open() and setTimeout() +// should be used with an explicit window object + +/** + * @constructor + * @extends {EventTarget} + */ +function Window() {} + +var window; +var top; +var navigator; +var document; +var screen; +var self; +function alert(x) {} +function confirm(x) {} +function prompt(x, opt_value) {} + +// Magic functions for Firefox's LiveConnect. +// We'll probably never use these in practice. But redefining them +// will fire up the JVM, so we want to reserve the symbol names. +var JavaArray; +var JavaClass; +var JavaMember; +var JavaObject; +var JavaPackage; +var Packages; +var java; +var netscape; +var sun; + +// Browser objects +/** @constructor */ function ActiveXObject(name, opt_location) {} +/** @constructor */ function CSSStyleDeclaration() {} +/** @constructor */ function StyleSheet() {} +/** @constructor */ function DOMParser() {} +// Image can't be used as a function +/** + * @constructor + * @extends {EventTarget} + */ +function Image(opt_width, opt_height) {} +/** @constructor */ function XMLHttpRequest() {} +/** @constructor */ function XMLSerializer() {} +/** + * @noalias + * @constructor + */ +function XPathResult() {} +/** @constructor */ function XSLTProcessor() {} +/** @constructor */ function Range() {} +/** @constructor */ function NodeFilter() {} +/** @constructor */ function Option(opt_text, opt_value, opt_defaultSelected, + opt_selected) {} +var opera; + +// Browser types for type checking +// see http://www.w3.org/TR/DOM-Level-2-HTML/ecma-script-binding.html + +// TODO(nicksantos): Rewrite all the DOM interfaces as interfaces, instead +// of kluding them as an inheritance hierarchy. + +/** + * @constructor + * @extends {Node} + */ +function Document() {} + +/** + * @constructor + * @extends {Node} + */ +function DocumentFragment() {} + +/** + * @constructor + * @extends {Node} + */ +function DocumentType() {} + +/** + * @constructor + * @extends {EventTarget} + */ +function Node() {} + +/** @constructor */ function NodeList() {} + +/** + * @constructor + * @extends {Node} + */ +function Element() {} + +/** + * @constructor + * @extends {Node} + */ +function CharacterData() {} + +/** + * @constructor + * @extends {CharacterData} + */ +function Text() {} + +/** @constructor */ function Event() {} +/** @constructor */ function EventTarget() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLAnchorElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLAppletElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLAreaElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLBaseElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLBaseFontElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLBlockquoteElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLBodyElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLBRElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLButtonElement() {} + +/** + * @constructor + */ +function HTMLCollection() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLDirectoryElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLDivElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLDListElement() {} + +/** + * @constructor + * @extends {Document} + */ +function HTMLDocument() {} + +/** + * @constructor + * @extends {Element} + */ +function HTMLElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLFieldSetElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLFontElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLFormElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLFrameElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLFrameSetElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLHeadElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLHeadingElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLHRElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLHtmlElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLIFrameElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLImageElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLInputElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLIsIndexElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLLabelElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLLayerElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLLegendElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLLIElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLLinkElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLMapElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLMenuElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLMetaElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLModElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLObjectElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLOListElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLOptGroupElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLOptionElement() {} + +/** + * @constructor + */ +function HTMLOptionsCollection() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLParagraphElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLParamElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLPreElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLQuoteElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLScriptElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLSelectElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLSpanElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLStyleElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTableCaptionElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTableCellElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTableColElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTableElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTableRowElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTableSectionElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTextAreaElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLTitleElement() {} + +/** + * @constructor + * @extends {HTMLElement} + */ +function HTMLUListElement() {} + +// Gecko Selection interface +/** @constructor */ function Selection() {} + +// IE Range interface +/** @constructor */ function TextRange() {} + +// IE Control Range interface +/** @constructor */ function controlRange() {} + +// Safari and Firefox canvas rendering context +/** @constructor */ function CanvasRenderingContext2D() {} + +// Browser object methods and properties + +/** + * The postMessage method (as defined by HTML5 spec and implemented in FF3). + * @param {string} message + * @param {string} targetOrigin + */ +Window.prototype.postMessage = function(message, targetOrigin) {}; + +/** + * The postMessage method (as implemented in Opera). + * @param {string} message + */ +Document.prototype.postMessage = function(message) {}; + +// Below is a generic list of methods and properties defined on various +// browser/DOM objects. Ideally these would be defined on the appropriate +// prototypes (as is done above). As long as the list below is around, +// please keep it alphabetically sorted. +var methods = {}; +methods.$1; +methods.$2; +methods.$3; +methods.$4; +methods.$5; +methods.$6; +methods.$7; +methods.$8; +methods.$9; +methods.ANY_TYPE; +methods.ANY_UNORDERED_NODE_TYPE; +methods.ATTRIBUTE_NODE; +methods.AT_TARGET; +methods.BOOLEAN_TYPE; +methods.BUBBLING_PHASE; +methods.CAPTURING_PHASE; +methods.CDATA_SECTION_NODE; +methods.CHARSET_RULE; +methods.COMMENT_NODE; +methods.CSS_ATTR; +methods.CSS_CM; +methods.CSS_COUNTER; +methods.CSS_CUSTOM; +methods.CSS_DEG; +methods.CSS_DIMENSION; +methods.CSS_EMS; +methods.CSS_EXS; +methods.CSS_GRAD; +methods.CSS_HZ; +methods.CSS_IDENT; +methods.CSS_IN; +methods.CSS_INHERIT; +methods.CSS_KHZ; +methods.CSS_MM; +methods.CSS_MS; +methods.CSS_NUMBER; +methods.CSS_PC; +methods.CSS_PERCENTAGE; +methods.CSS_PRIMITIVE_VALUE; +methods.CSS_PT; +methods.CSS_PX; +methods.CSS_RAD; +methods.CSS_RECT; +methods.CSS_RGBCOLOR; +methods.CSS_S; +methods.CSS_STRING; +methods.CSS_UNKNOWN; +methods.CSS_URI; +methods.CSS_VALUE_LIST; +methods.DOCUMENT_FRAGMENT_NODE; +methods.DOCUMENT_NODE; +methods.DOCUMENT_TYPE_NODE; +methods.DOMSTRING_SIZE_ERR; +methods.E; +methods.ELEMENT_NODE; +methods.END_TO_END; +methods.END_TO_START; +methods.ENTITY_NODE; +methods.ENTITY_REFERENCE_NODE; +methods.FILTER_ACCEPT; +methods.FILTER_REJECT; +methods.FILTER_SKIP; +methods.FIRST_ORDERED_NODE_TYPE; +methods.FONT_FACE_RULE; +methods.HIERARCHY_REQUEST_ERR; +methods.HORIZONTAL_AXIS; +methods.IMPORT_RULE; +methods.INDEX_SIZE_ERR; +methods.INFINITY; +methods.INUSE_ATTRIBUTE_ERR; +methods.INVALID_ACCESS_ERR; +methods.INVALID_CHARACTER_ERR; +methods.INVALID_MODIFICATION_ERR; +methods.INVALID_STATE_ERR; +methods.LOG10E; +methods.LOG2E; +methods.MAX_VALUE; +methods.MEDIA_RULE; +methods.MIN_VALUE; +methods.MODIFICATION; +methods.NAMESPACE_ERR; +methods.NEGATIVE_INFINITY; +methods.NOTATION_NODE; +methods.NOT_FOUND_ERR; +methods.NOT_SUPPORTED_ERR; +methods.NO_DATA_ALLOWED_ERR; +methods.NO_MODIFICATION_ALLOWED_ERR; +methods.NUMBER_TYPE; +methods.NaN; +methods.ORDERED_NODE_ITERATOR_TYPE; +methods.ORDERED_NODE_SNAPSHOT_TYPE; +methods.PAGE_RULE; +methods.PI; +methods.POSITIVE_INFINITY; +methods.PROCESSING_INSTRUCTION_NODE; +methods.PercentLoaded; // flash? +methods.REMOVAL; +methods.SHOW_ALL; +methods.SHOW_ATTRIBUTE; +methods.SHOW_CDATA_SECTION; +methods.SHOW_COMMENT; +methods.SHOW_DOCUMENT; +methods.SHOW_DOCUMENT_FRAGMENT; +methods.SHOW_DOCUMENT_TYPE; +methods.SHOW_ELEMENT; +methods.SHOW_ENTITY; +methods.SHOW_ENTITY_REFERENCE; +methods.SHOW_NOTATION; +methods.SHOW_PROCESSING_INSTRUCTION; +methods.SHOW_TEXT; +methods.START_TO_END; +methods.START_TO_START; +methods.STRING_TYPE; +methods.STYLE_RULE; +methods.SYNTAX_ERR; +methods.TEXT_NODE; +methods.TGotoLabel; +methods.TPlay; +methods.UNKNOWN_RULE; +methods.UNORDERED_NODE_ITERATOR_TYPE; +methods.UNORDERED_NODE_SNAPSHOT_TYPE; +methods.UNSPECIFIED_EVENT_TYPE_ERR; +methods.UTC; +methods.VERTICAL_AXIS; +methods.WRONG_DOCUMENT_ERR; +methods.aLink; +methods.abbr; +methods.abort; +methods.abs; +methods.accept; +methods.acceptCharset; +methods.acceptNode; +methods.accessKey; +methods.acos; +methods.action; +methods.activeElement; +methods.actualEncoding; +methods.add; +methods.addColorStop; +methods.addElement; +methods.addEventListener; +methods.addRange; +methods.addRule; +methods.adoptNode; +methods.alert; +methods.align; +methods.alinkColor; +methods.all; +methods.alt; +methods.altGraphKey; +methods.altKey; +methods.anchorNode; +methods.anchorOffset; +methods.anchors; +methods.angle; +methods.appCodeName; +methods.appName; +methods.appVersion; +methods.appendChild = function(newChild) {}; +methods.appendData; +methods.appendMedium; +methods.applets; +methods.apply; +methods.arc; +methods.arcTo; +methods.archive; +methods.areas; +methods.arguments; +methods.asin; +methods.assign; +methods.async; +methods.atan2; +methods.atan; +methods.atob; +methods.attachEvent; +methods.attrChange; +methods.attrName; +methods.attributes; +methods.availHeight; +methods.availWidth; +methods.axis; +methods.back; +methods.baseNode; +methods.baseOffset; +methods.beginPath; +methods.bezierCurveTo; +methods.bgColor; +methods.blendTrans; +methods.blue; +methods.blur; +methods.body; +methods.boundingWidth; +methods.btoa; +methods.bubbles; +methods.button; +methods.call; +methods.callee; +methods.caller; +methods.cancelBubble; +methods.cancelable; +methods.canHaveChildren; +methods.caption; +methods.captureEvents; +methods.ceil; +methods.cellIndex; +methods.cellPadding; +methods.cellSpacing; +methods.cells; +methods.ch; +methods.chOff; +methods.charAt = function(index) {}; +methods.charCode; +methods.charCodeAt; +methods.characterSet; +methods.charset; +methods.checked; +methods.childNodes; +methods.children; +methods.childNodes; +methods.cite; +methods.className; +methods.clearData; +methods.clearInterval = function(intervalRev) {}; +methods.clearParameters; +methods.clearRect; +methods.clearShadow; +methods.clearTimeout = function(timeoutRef) {}; +methods.click; +methods.clientHeight; +methods.clientLeft; +methods.clientTop; +methods.clientWidth; +methods.clientX; +methods.clientY; +methods.clipboardData; +methods.cloneContents; +methods.cloneNode = function(deepClone) {}; +methods.cloneRange; +methods.close; +methods.closed; +methods.closePath; +methods.closed; +methods.code; +methods.codeBase; +methods.codeType; +methods.colSpan; +methods.collapse; +methods.collapseToEnd; +methods.collapseToStart; +methods.collapsed; +methods.color; +methods.color2; +methods.colorDepth; +methods.cols; +methods.commonAncestorContainer; +methods.compact; +methods.compareBoundaryPoints; +methods.compareEndPoints; +methods.compareDocumentPosition = function(el) {}; +methods.compatMode; +methods.comparePoint; +methods.complete; +methods.componentFromPoint; +methods.concat; +methods.console; +methods.constructor; +methods.contains; +methods.containsNode; +methods.contentDocument; +methods.contentEditable; +methods.contentWindow; +methods.cookie; +methods.cookieEnabled; +methods.coordorigin; +methods.coords; +methods.coordsize; +methods.cos; +methods.createAttribute; +methods.createAttributeNS; +methods.createCDATASection; +methods.createCSSStyleSheet; +methods.createCaption; +methods.createComment; +methods.createControlRange; +methods.createContextualFragment; +methods.createDocument; +methods.createDocumentFragment; +methods.createDocumentType; +methods.createElement; +methods.createElementNS; +methods.createEntityReference; +methods.createEvent; +methods.createEventObject; +methods.createHTMLDocument; +methods.createLinearGradient; +methods.createNode; +methods.createNodeIterator; +methods.createNSResolver; +methods.createPattern; +methods.createPopup; +methods.createProcessingInstruction; +methods.createProcessor = function() {}; // XSLT +methods.createRadialGradient; +methods.createRange; +methods.createStyleSheet; +methods.createTFoot; +methods.createTHead; +methods.createTextNode; +methods.createTextRange = function() {}; +methods.createTreeWalker; +methods.cssRules; +methods.cssText; +methods.cssValueType; +methods.ctrlKey; +methods.currentNode; +methods.currentStyle; +methods.currentTarget; +methods.data; +methods.dataTransfer; +methods.dateTime; +methods.declare; +methods.defaultCharset; +methods.defaultChecked; +methods.defaultSelected; +methods.defaultValue; +methods.defaultView; +methods.defer; +methods.deleteCaption; +methods.deleteCell; +methods.deleteContents; +methods.deleteData; +methods.deleteMedium; +methods.deleteRow; +methods.deleteRule; +methods.deleteTFoot; +methods.deleteTHead; +methods.description; +methods.designMode; +methods.detach; +methods.detachEvent; +methods.detail; +methods.dir; +methods.direction; +methods.disabled; +methods.dispatchEvent; +methods.doctype; +methods.document; +methods.documentElement; +methods.documentMode; +methods.domain; +methods.drawImage; +methods.drawImageFromRect; +methods.dropEffect; +methods.dump; +methods.duplicate = function() {}; +methods.effectAllowed; +methods.elementFromPoint; +methods.elements; +methods.embeds; +methods.empty; +methods.enabledPlugin; +methods.encoding; +methods.enctype; +methods.endContainer; +methods.endOffset; +methods.entities; +methods.evaluate = function( + xpathExpression, contextNode, namespaceResolver, resultType, result) {}; +methods.event; +methods.eventPhase; +methods.exec; +methods.execCommand; +methods.execScript; +methods.expand; +methods.expandEntityReferences; +methods.explicitOriginalTarget; +methods.exp = function(x) {}; +methods.expn; +methods.extend; +methods.extentNode; +methods.extentOffset; +methods.extractContents; +methods.eval; +methods.every; +methods.face; +methods.fgColor; +methods.fileName; +methods.filename; +methods.fill = function() {}; +methods.filled; +methods.fillcolor; +methods.fillRect; +methods.fillStyle; +methods.filter; +methods.filters; +methods.findText; // IE text ranges +methods.fireEvent; +methods.firstChild; +methods.floor; +methods.focus; +methods.focusNode; +methods.focusOffset; +methods.forEach; +methods.form; +methods.forms; +methods.forward; +methods.frame; +methods.frames; +methods.frameBorder; +methods.frameElement; +methods.fromCharCode = function(var_args) {}; +methods.fromElement; +methods.getAllResponseHeaders; +methods.getAttribute; +methods.getAttributeNS; +methods.getAttributeNode; +methods.getAttributeNodeNS; +methods.getBookmark; +methods.getBoundingClientRect = function() {}; +methods.getBoxObjectFor = function(node) {}; +methods.getComputedStyle; +methods.getContext; +methods.getCounterValue; +methods.getData; +methods.getDate; +methods.getDay; +methods.getElementById; +methods.getElementsByName; +methods.getElementsByClassName; +methods.getElementsByTagName; +methods.getElementsByTagNameNS; +methods.getFloatValue; +methods.getFullYear; +methods.getHours; +methods.getImageData = function(sx, sy, sw, sh) {}; +methods.getMatchedCSSRules; +methods.getMilliseconds; +methods.getMinutes; +methods.getMonth; +methods.getNamedItem; +methods.getNamedItemNS; +methods.getOverrideStyle; +methods.getParameter; +methods.getPropertyCSSValue; +methods.getPropertyPriority; +methods.getPropertyShorthand; +methods.getPropertyValue; +methods.getRGBColorValue; +methods.getRangeAt; +methods.getRectValue; +methods.getResponseHeader; +methods.getSeconds; +methods.getSelection; +methods.getStringValue; +methods.getTime; +methods.getTimezoneOffset; +methods.getUTCDate; +methods.getUTCDay; +methods.getUTCFullYear; +methods.getUTCHours; +methods.getUTCMilliseconds; +methods.getUTCMinutes; +methods.getUTCMonth; +methods.getUTCSeconds; +methods.GetVariable; // ActiveXObject +methods.global; +methods.globalAlpha; +methods.globalCompositeOperation; +methods.go; +methods.green; +methods.handleEvent; +methods.hasAttribute; +methods.hasAttributeNS; +methods.hasAttributes = function() {}; +methods.hasChildNodes = function() {}; +methods.hasFeature; +methods.hasFocus; +methods.hasOwnProperty; +methods.hash; +methods.head; +methods.headers; +methods.history; +methods.host; +methods.hostname; +methods.href; +methods.hreflang; +methods.hspace; +methods.htmlFor; +methods.htmlText; +methods.httpEquiv; +methods.id; +methods.identifier; +methods.ignoreCase; +methods.images; +methods.implementation; +methods.imports; +methods.importNode; +methods.importStylesheet; +methods.indeterminate; +methods.index; +methods.indexOf; +methods.initEvent; +methods.initKeyboardEvent; +methods.initMouseEvent; +methods.initMutationEvent; +methods.initUIEvent; +methods.innerHTML; +methods.innerHeight; +methods.innerText; +methods.innerWidth; +methods.inputEncoding; +methods.input; // XSLT +methods.inRange; +methods.insertAdjacentText = function(where, text) {}; +methods.insertBefore = function(newNode, childNode) {}; +methods.insertCell; +methods.insertData; +methods.insertNode; +methods.insertRow; +methods.insertRule; +methods.internalSubset; +methods.intersectsNode; +methods.invalidIteratorState; +methods.isCollapsed; +methods.isContentEditable; +methods.isEqual = function(textRange) {}; +methods.isPointInPath = function(x, y) {}; +methods.isMap; +methods.isOpen; +methods.isPointInPath = function(x, y) {}; +methods.isPropertyImplicit; +methods.isPrototypeOf; +methods.isSupported = function(feature, version) {}; +methods.item; +methods.iterateNext = function() {}; +methods.javaEnabled; +methods.join; +methods.keyCode; +methods.keyIdentifier; +methods.keyLocation; +methods.KhtmlOpacity; +methods.label; +methods.lang; +methods.language; +methods.lastChild; +methods.lastIndex; +methods.lastIndexOf; +methods.lastMatch; +methods.lastModified; +methods.lastParen; +methods.layerX; +methods.layerY; +methods.leftContext; +methods.length; +methods.line; +methods.lineCap; +methods.lineJoin; +methods.lineNumber; +methods.lineTo; +methods.lineWidth; +methods.linkColor; +methods.links; +methods.localName; +methods.load; // XSLT +methods.loadXML; +methods.localeCompare; +methods.location; +methods.log; +methods.longDesc; +methods.map; +methods.marginHeight; +methods.marginWidth; +methods.match; +methods.max; +methods.maxLength; +methods.media; +methods.mediaText; +methods.mergeAttributes; +methods.message; +methods.metaKey; +methods.method; +methods.mimeTypes; +methods.min; +methods.miterLimit; +methods.move = function(unit, opt_count) {}; +methods.moveBy; +methods.moveEnd; +methods.moveStart; +methods.moveTo; +methods.moveToElementText = function(node) {}; +methods.moveToPoint; +methods.multiline; +methods.multiple; +methods.name; +methods.namedItem; +methods.namespaces; +methods.namespaceURI; +methods.naturalHeight; +methods.naturalWidth; +methods.navigationMode; +methods.newValue; +methods.nextNode; +methods.nextSibling; +methods.nodeType; +methods.noHref; +methods.noResize; +methods.noShade; +methods.now; // Date.now() +methods.noWrap; +methods.nodeName; +methods.nodeType; +methods.nodeValue; +methods.normalize = function() {}; +methods.notationName; +methods.notations; +methods.object; +methods.offsetHeight; +methods.offsetLeft; +methods.offsetParent; +methods.offsetTop; +methods.offsetWidth; +methods.offsetX; +methods.offsetY; +methods.onabort; +methods.onbeforeunload; +methods.onblur; +methods.onchange; +methods.onclick; +methods.oncontextmenu; +methods.ondblclick; +methods.ondrag; +methods.ondragend; +methods.ondragenter; // IE +methods.ondragleave; // IE +methods.ondragover; // IE +methods.ondragstart; // IE +methods.ondrop; // IE +methods.onerror; +methods.onfocus; +methods.onkeydown; +methods.onkeypress; +methods.onkeyup; +methods.onLine; +methods.onload; +methods.onmousedown; +methods.onmousemove; +methods.onmouseout; +methods.onmouseover; +methods.onmouseup; +methods.onmousewheel; +methods.onpropertychange; +methods.onreadystatechange; +methods.onresize; +methods.onscroll; +methods.onselect; +methods.onselectend; +methods.onselectstart; +methods.onsubmit; +methods.onunload; +methods.opacity; +methods.open; +methods.openDialog; +methods.opener; +methods.opera; +methods.options; +methods.originalTarget; +methods.outerHTML; +methods.outerHeight; +methods.outerText; +methods.outerWidth; +methods.output; // XSLT +methods.overflowX; +methods.overflowY; +methods.overrideMimeType; +methods.ownerDocument; +methods.ownerElement; +methods.ownerNode; +methods.ownerRule; +methods.owningElement; +methods.pageX; +methods.pageXOffset; +methods.pageY; +methods.pageYOffset; +methods.parentElement = function() {}; +methods.parent; +methods.parentNode; +methods.parentRule; +methods.parentStyleSheet; +methods.parentWindow; +methods.parse; +methods.parseError; +methods.parseFromString; +methods.parseJSON; +methods.pasteHTML; +methods.pathname; +methods.peek; +methods.pixelBottom; +methods.pixelDepth; +methods.pixelHeight; +methods.pixelLeft; +methods.pixelRight; +methods.pixelTop; +methods.pixelWidth; +methods.platform; +methods.play; +methods.plugins; +methods.pointerBeforeReferenceNode; +methods.pop; +methods.port; +methods.pow; +methods.preferredStylesheetSet; +methods.prefix; +methods.prevValue; +methods.preventDefault; +methods.previousNode; +methods.previousSibling; +methods.primitiveType; +methods.print; +methods.product; +methods.productSub; +methods.profile; +methods.prompt; +methods.propertyIsEnumerable; +methods.propertyName; +methods.protocol; +methods.publicId; +methods.push; +methods.putImageData = function(image, dx, dy) {}; +methods.quadraticCurveTo; +methods.queryCommandEnabled; +methods.queryCommandIndeterm; +methods.queryCommandState; +methods.queryCommandSupported; +methods.queryCommandValue; +methods.querySelector = function(selector) {}; +methods.querySelectorAll = function(selector) {}; +methods.quote = function() {}; +methods.rangeCount; +methods.random; +methods.rangeCount; +methods.readOnly; +methods.readyState; +methods.rect; +methods.red; +methods.reduce = function(callback, opt_initialValue) {}; +methods.reduceRight = function(callback, opt_initialValue) {}; +methods.referenceNode; +methods.referrer; +methods.refresh; +methods.rel; +methods.relatedNode; +methods.relatedTarget; +methods.releaseCapture; +methods.releaseEvents; +methods.reload; +methods.remove; +methods.removeAllRanges; +methods.removeAttribute; +methods.removeAttributeNS; +methods.removeAttributeNode; +methods.removeChild = function(oldChild) {}; +methods.removeEventListener; +methods.removeExpression = function(propertyName) {}; +methods.removeNamedItem; +methods.removeNamedItemNS; +methods.removeNode; +methods.removeParameter; +methods.removeProperty; +methods.repeat; +methods.replace; +methods.replaceChild = function(newNode, childNode) {}; +methods.replaceData; +methods.replaceNode = function(newNode) {}; +methods.reset; +methods.resizeBy = function(x, y) {}; +methods.resizeTo = function(w, h) {}; +methods.resolveExternals; // XSLT +methods.responseText; +methods.responseXML; +methods.restore; +methods.result; +methods.returnValue; +methods.rev; +methods.reverse; +methods.rightContext; +methods.rotate; +methods.rotation; +methods.round; +methods.rowIndex; +methods.rowSpan; +methods.rows; +methods.rules; +methods.runtimeStyle; +methods.save; +methods.scale; +methods.scheme; +methods.scope; +methods.screen; +methods.screenLeft; +methods.screenTop; +methods.screenX; +methods.screenY; +methods.scripts; +methods.scroll = function(x, y) {}; +methods.scrollBy; +methods.scrollByLines; +methods.scrollByPages; +methods.scrollHeight; +methods.scrollIntoView; +methods.scrollLeft; +methods.scrollTo = function(x, y) {}; +methods.scrollTop; +methods.scrollWidth; +methods.scrollX; +methods.scrollY; +methods.scrolling; +methods.search; +methods.sectionRowIndex; +methods.select; +methods.selectNode; +methods.selectNodeContents; +methods.selectNodes = function(patternString) {}; +methods.selectSingleNode = function(patternString) {}; +methods.selected; +methods.selectedIndex; +methods.selectedStylesheetSet; +methods.selection; +methods.selectionEnd; +methods.selectionStart; +methods.selectorText; +methods.send; +methods.separator; +methods.serializeToString; +methods.setActive = function() {}; +methods.setAlpha; +methods.setAttribute; +methods.setAttributeNS; +methods.setAttributeNode; +methods.setAttributeNodeNS; +methods.setBaseAndExtent; +methods.setCapture; +methods.setCompositeOperation; +methods.setData; +methods.setDate; +methods.setDragImage; +methods.setEnd; +methods.setEndAfter; +methods.setEndBefore; +methods.setEndPoint = function(type, range) {}; +methods.setExpression = function(propertyName, expression) {}; +methods.setFillColor; +methods.setFloatValue; +methods.setFullYear; +methods.setHours; +methods.setInterval = function(fn, interval) {}; +methods.setLineCap; +methods.setLineJoin; +methods.setLineWidth; +methods.setMilliseconds; +methods.setMinutes; +methods.setMiterLimit; +methods.setMonth; +methods.setNamedItem; +methods.setNamedItemNS; +methods.setParameter; +methods.setPosition; +methods.setProperty; +methods.setRequestHeader; +methods.setSUTCSeconds; +methods.setSeconds; +methods.setSelectionRange; +methods.setShadow; +methods.setStart; +methods.setStartAfter; +methods.setStartBefore; +methods.setStringValue; +methods.setStrokeColor; +methods.setTime; +methods.setTimeout = function(fn, time) {}; +methods.setTransform = function(m11, m12, m21, m22, dx, dy) {}; +methods.setUTCDate; +methods.setUTCFullYear; +methods.setUTCHours; +methods.setUTCMilliseconds; +methods.setUTCMinutes; +methods.setUTCMonth; +methods.setUTCSeconds; +methods.shadowBlur; +methods.shadowColor; +methods.shadowOffsetX; +methods.shadowOffsetY; +methods.shape; +methods.sheet; +methods.shift; +methods.shiftKey; +methods.showModalDialog = function(url, opt_arguments, opt_features) {}; +methods.sin; +methods.singleNodeValue; +methods.slice; +methods.snapshotItem = function(index) {}; +methods.snapshotLength; +methods.some; +methods.sort; +methods.source; +methods.sourceIndex; +methods.sourceURL; +methods.span; +methods.specified; +methods.splice; +methods.split; +methods.splitText; +methods.sqrt; +methods.src; +methods.srcElement; +methods.stack; +methods.standby; +methods.start; +methods.startContainer; +methods.startOffset; +methods.status; +methods.statusText; +methods.stop; +methods.stopPropagation; +methods.stroke; +methods.strokecolor; +methods.stroked; +methods.strokeRect; +methods.strokeStyle; +methods.strokeweight; +methods.style; +methods.styleSheet; +methods.stylesheet; // XSLT +methods.styleSheets; +methods.submit; +methods.substr = function(start, opt_length) {}; +methods.substring = function(start, opt_end) {}; +methods.substringData; +methods.suffixes; +methods.summary; +methods.surroundContents; +methods.systemId; +methods.tBodies; +methods.tFoot; +methods.tHead; +methods.tabIndex; +methods.tagName; +methods.tags; +methods.tan; +methods.target; +methods.test; +methods.text; +methods.textContent; +methods.timeStamp; +methods.title; +methods.toDateString; +methods.toElement; +methods.toExponential; +methods.toFixed; +methods.toJSONString; +methods.toLocaleDateString; +methods.toLocaleLowerCase; +methods.toLocaleString; +methods.toLocaleTimeString; +methods.toLocaleUpperCase; +methods.toLowerCase; +methods.toPrecision; +methods.toSource; +methods.toString; +methods.toSource; +methods.toTimeString; +methods.toUTCString; +methods.toUpperCase; +methods.transform = function(m11, m12, m21, m22, dx, dy) {}; +methods.setTransform = function(m11, m12, m21, m22, dx, dy) {}; +methods.transformToDocument; +methods.transformToFragment; +methods.translate; +methods.type; +methods.types; +methods.uneval; +methods.unshift; +methods.unselectable; +methods.useMap; +methods.userAgent; +methods.vAlign; +methods.value; +methods.valueOf; +methods.valueType; +methods.vendor; +methods.version; +methods.view; +methods.visible; +methods.vlinkColor; +methods.vspace; +methods.watch; +methods.whatToShow; +methods.wheelDelta; +methods.wheelDeltaX; +methods.wheelDeltaY; +methods.which; +methods.write; +methods.writeln; +methods.x; +methods.xml; +methods.y; + +// CSS style properties +methods.azimuth; +methods.background; +methods.backgroundAttachment; +methods.backgroundColor; +methods.backgroundImage; +methods.backgroundPosition; +methods.backgroundPositionX; +methods.backgroundPositionY; +methods.backgroundRepeat; +methods.border; +methods.borderCollapse; +methods.borderColor; +methods.borderSpacing; +methods.borderStyle; +methods.borderTop; +methods.borderRight; +methods.borderBottom; +methods.borderLeft; +methods.borderTopColor; +methods.borderRightColor; +methods.borderBottomColor; +methods.borderLeftColor; +methods.borderTopStyle; +methods.borderRightStyle; +methods.borderBottomStyle; +methods.borderLeftStyle; +methods.borderTopWidth; +methods.borderRightWidth; +methods.borderBottomWidth; +methods.borderLeftWidth; +methods.borderWidth; +methods.bottom; +methods.captionSide; +methods.clear; +methods.clip; +methods.color; +methods.content; +methods.counterIncrement; +methods.counterReset; +methods.cssFloat; +methods.cue; +methods.cueAfter; +methods.cueBefore; +methods.cursor; +methods.direction; +methods.display; +methods.elevation; +methods.emptyCells; +methods.font; +methods.fontFamily; +methods.fontSize; +methods.fontSizeAdjust; +methods.fontStretch; +methods.fontStyle; +methods.fontVariant; +methods.fontWeight; +methods.height; +methods.hideFocus; +methods.left; +methods.letterSpacing; +methods.lineHeight; +methods.listStyle; +methods.listStyleImage; +methods.listStylePosition; +methods.listStyleType; +methods.margin; +methods.marginBottom; +methods.marginLeft; +methods.marginRight; +methods.marginTop; +methods.markerOffset; +methods.marks; +methods.maxHeight; +methods.maxWidth; +methods.minHeight; +methods.minWidth; +methods.orphans; +methods.outline; +methods.outlineColor; +methods.outlineStyle; +methods.outlineWidth; +methods.overflow; +methods.padding; +methods.paddingTop; +methods.paddingRight; +methods.paddingBottom; +methods.paddingLeft; +methods.page; +methods.pageBreakAfter; +methods.pageBreakBefore; +methods.pageBreakInside; +methods.pause; +methods.pauseAfter; +methods.pauseBefore; +methods.pitch; +methods.pitchRange; +methods.position; +methods.quotes; +methods.richness; +methods.right; +methods.size; +methods.speak; +methods.speakHeader; +methods.speakNumeral; +methods.speakPunctuation; +methods.speechRate; +methods.stress; +methods.styleFloat; +methods.tableLayout; +methods.textAlign; +methods.textDecoration; +methods.textIndent; +methods.textShadow; +methods.textTransform; +methods.top; +methods.unicodeBidi; +methods.verticalAlign; +methods.visibility; +methods.voiceFamily; +methods.volume; +methods.whiteSpace; +methods.widows; +methods.width; +methods.wordSpacing; +methods.wordWrap; +methods.zIndex; +methods.zoom; + +// Gecko-only CSS style names. Copied from: +// http://lxr.mozilla.org/mozilla1.8.0/source/dom/public/idl/css/nsIDOMCSS2Properties.idl +methods.MozAppearance; +methods.MozBackgroundClip; +methods.MozBackgroundInlinePolicy; +methods.MozBackgroundOrigin; +methods.MozBinding; +methods.MozBorderBottomColors; +methods.MozBorderLeftColors; +methods.MozBorderRightColors; +methods.MozBorderTopColors; +methods.MozBorderRadius; +methods.MozBorderRadiusTopleft; +methods.MozBorderRadiusTopright; +methods.MozBorderRadiusBottomleft; +methods.MozBorderRadiusBottomright; +methods.MozBoxAlign; +methods.MozBoxDirection; +methods.MozBoxFlex; +methods.MozBoxOrient; +methods.MozBoxOrdinalGroup; +methods.MozBoxPack; +methods.MozBoxSizing; +methods.MozColumnCount; +methods.MozColumnWidth; +methods.MozColumnGap; +methods.MozFloatEdge; +methods.MozForceBrokenImageIcon; +methods.MozImageRegion; +methods.MozMarginEnd; +methods.MozMarginStart; +methods.MozOpacity; +methods.MozOutline; +methods.MozOutlineColor; +methods.MozOutlineRadius; +methods.MozOutlineRadiusTopleft; +methods.MozOutlineRadiusTopright; +methods.MozOutlineRadiusBottomleft; +methods.MozOutlineRadiusBottomright; +methods.MozOutlineStyle; +methods.MozOutlineWidth; +methods.MozOutlineOffset; +methods.MozPaddingEnd; +methods.MozPaddingStart; +methods.MozUserFocus; +methods.MozUserInput; +methods.MozUserModify; +methods.MozUserSelect; + +// Webkit-only CSS style names. Copied from: +// https://svn.corp.google.com/v/chrome/trunk/third_party/WebKit/WebCore/css/CSSPropertyNames.in?view=markup +methods.WebkitAppearance; +methods.WebkitBackgroundClip; +methods.WebkitBackgroundComposite; +methods.WebkitBackgroundOrigin; +methods.WebkitBackgroundSize; +methods.WebkitBinding; +methods.WebkitBorderBottomLeftRadius; +methods.WebkitBorderBottomRightRadius; +methods.WebkitBorderFit; +methods.WebkitBorderHorizontalSpacing; +methods.WebkitBorderImage; +methods.WebkitBorderRadius; +methods.WebkitBorderTopLeftRadius; +methods.WebkitBorderTopRightRadius; +methods.WebkitBorderVerticalSpacing; +methods.WebkitBoxAlign; +methods.WebkitBoxDirection; +methods.WebkitBoxFlex; +methods.WebkitBoxFlexGroup; +methods.WebkitBoxLines; +methods.WebkitBoxOrdinalGroup; +methods.WebkitBoxOrient; +methods.WebkitBoxPack; +methods.WebkitBoxShadow; +methods.WebkitBoxSizing; +methods.WebkitColumnBreakAfter; +methods.WebkitColumnBreakBefore; +methods.WebkitColumnBreakInside; +methods.WebkitColumnCount; +methods.WebkitColumnGap; +methods.WebkitColumnRule; +methods.WebkitColumnRuleColor; +methods.WebkitColumnRuleStyle; +methods.WebkitColumnRuleWidth; +methods.WebkitColumnWidth; +methods.WebkitColumns; +methods.WebkitDashboardRegion; +methods.WebkitFontSizeDelta; +methods.WebkitHighlight; +methods.WebkitLineBreak; +methods.WebkitLineClamp; +methods.WebkitMarginBottomCollapse; +methods.WebkitMarginCollapse; +methods.WebkitMarginStart; +methods.WebkitMarginTopCollapse; +methods.WebkitMarquee; +methods.WebkitMarqueeDirection; +methods.WebkitMarqueeIncrement; +methods.WebkitMarqueeRepetition; +methods.WebkitMarqueeSpeed; +methods.WebkitMarqueeStyle; +methods.WebkitMatchNearestMailBlockquoteColor; +methods.WebkitNbspMode; +methods.WebkitPaddingStart; +methods.WebkitRtlOrdering; +methods.WebkitTextDecorationsInEffect; +methods.WebkitTextFillColor; +methods.WebkitTextSecurity; +methods.WebkitTextSizeAdjust; +methods.WebkitTextStroke; +methods.WebkitTextStrokeColor; +methods.WebkitTextStrokeWidth; +methods.WebkitTransform; +methods.WebkitTransformOrigin; +methods.WebkitTransformOriginX; +methods.WebkitTransformOriginY; +methods.WebkitTransition; +methods.WebkitTransitionDuration; +methods.WebkitTransitionProperty; +methods.WebkitTransitionRepeatCount; +methods.WebkitTransitionTimingFunction; +methods.WebkitUserDrag; +methods.WebkitUserModify; +methods.WebkitUserSelect; diff --git a/o3d/documentation/externs/o3d-extra-externs.js b/o3d/documentation/externs/o3d-extra-externs.js new file mode 100755 index 0000000..e01c554 --- /dev/null +++ b/o3d/documentation/externs/o3d-extra-externs.js @@ -0,0 +1,48 @@ +
+/**
+ * Special global variable for V8 instances.
+ */
+var plugin;
+
+/**
+ * The main namespace for the o3d plugin.
+ * @namespace
+ */
+var o3d;
+
+/**
+ * @type {!Object}
+ */
+var Exception = goog.typedef;
+
+/**
+ * A namespace for the Cursor.
+ * @namespace
+ */
+o3d.Cursor = o3d.Cursor || { };
+
+/**
+ * A namespace for the VectorMath.
+ * @namespace
+ */
+var Vectormath;
+
+/**
+ * A namespace for the VectorMath.Aos
+ * @namespace
+ */
+Vectormath.Aos = Vectormath.Aos || { };
+
+/**
+ * A 4x4 Matrix of floats
+ * @type {!Array.<!Array.<number>>}
+ */
+o3d.Matrix4 = goog.typedef;
+
+/**
+ * RangeError.
+ * why is this sometimes needed and sometimes not?
+ * @exception
+ */
+var RangeError;
+
diff --git a/o3d/documentation/jsdoc-toolkit-templates/class.tmpl b/o3d/documentation/jsdoc-toolkit-templates/class.tmpl index 6d1b338..4ff9bd0 100644 --- a/o3d/documentation/jsdoc-toolkit-templates/class.tmpl +++ b/o3d/documentation/jsdoc-toolkit-templates/class.tmpl @@ -39,7 +39,7 @@ thisClass = data; <ul> <for each="seeAlso" in="data.see"> <li> - {+linkifyTypeSpec(seeAlso)+} + {+linkifyTypeSpec(makeName('[Class See Also]', thisClass.alias), seeAlso)+} </li> </for> </ul> @@ -65,7 +65,7 @@ thisClass = data; <if test="!method.isPrivate"> <li> <if test="method.isStatic||!method.memberOf"><static> </if> - <if test="method.type.length">{+linkifyTypeSpec(method.type)+} </if> + <if test="method.type.length">{+linkifyTypeSpec(makeName('[Method Summary]', thisClass.alias, method.name), method.type)+} </if> <a class="el" href="#{+method.name+}">{+method.name+}</a>{+makeSignature(method.params)+} </li> </if> @@ -84,7 +84,7 @@ thisClass = data; <if test="!property.isPrivate"> <li> <if test="property.isStatic||!property.memberOf"><static> </if> - {+linkifyTypeSpec(getPropertyType(property))+} + {+linkifyTypeSpec(makeName('[Property Summary]', thisClass.alias, property.name), getPropertyType(property))+} <a class="el" href="#{+property.name+}">{+property.name+}</a> </li> </if> @@ -114,7 +114,7 @@ thisClass = data; <tr> <td class="{+tempCSS+}">{+tempName+}</td> <td>{+tempParen+}</td> - <td class="paramtype">{+linkifyTypeSpec(param.type)+}</td> + <td class="paramtype">{+linkifyTypeSpec(makeName('[Constructor Param]', thisClass.alias, param.name), param.type)+}</td> <td class="paramname"><em>{+param.name+}</em></td> <td><if test="$param_last">)</if></td> <td></td> @@ -172,7 +172,7 @@ thisClass = data; <if test="member.params && member.params.length"> {! var tempCSS = "memname"; - var tempName = linkifyTypeSpec(member.type)+" "+member.memberOf+"."+member.name; + var tempName = linkifyTypeSpecForReturn(makeName('[Method Detail]', thisClass.alias, member.name), member.type)+" "+member.memberOf+"."+member.name; var tempParen = "("; var tempEnd = member.params.length > 1 ? "" : ")" !} @@ -180,7 +180,7 @@ thisClass = data; <tr> <td class="{+tempCSS+}">{+tempName+}</td> <td>{+tempParen+}</td> - <td class="paramtype">{+linkifyTypeSpec(param.type)+}</td> + <td class="paramtype">{+linkifyTypeSpec(makeName('[Param Detail]', thisClass.alias, member.name, param.name), param.type)+}</td> <td class="paramname"><em>{+param.name+}</em></td> <td><if test="$param_last">)</if></td> <td><if test="$param_last">{+tempInherited+}</if></td> @@ -222,7 +222,7 @@ thisClass = data; <if test="member.type && member.type.length"> <dl class="return" compact><dt><b>Returns:</b></dt> <dd> - {+linkifyTypeSpec(member.type)+}.<if test="member.returns && member.returns.length">{+sanitizeForEZT(member.returns[0].desc)+}</if> + {+linkifyTypeSpec(makeName('[Return detail]', thisClass.alias, member.name), member.type)+}.<if test="member.returns && member.returns.length">{+sanitizeForEZT(member.returns[0].desc)+}</if> </dd> </if> </div> @@ -232,7 +232,7 @@ thisClass = data; <dd><ul> <for each="seeAlso" in="member.see"> <li> - {+linkifyTypeSpec(seeAlso)+} + {+linkifyTypeSpec(makeName('[Method See Also]', thisClass.alias, '[See Also]'), seeAlso)+} </li> </for> </ul></dd> @@ -256,7 +256,7 @@ thisClass = data; <div class="memproto"> <table class="memname"> <tr> - <td class="memname">{+linkifyTypeSpec(getPropertyType(property))+} {+property.memberOf+"."+property.name+}</td> + <td class="memname">{+linkifyTypeSpec(makeName('[Property Detail]', thisClass.alias, property.name), getPropertyType(property))+} {+property.memberOf+"."+property.name+}</td> </tr> </table> </div> @@ -271,7 +271,7 @@ thisClass = data; <dd><ul> <for each="seeAlso" in="property.see"> <li> - {+linkifyTypeSpec(seeAlso)+} + {+linkifyTypeSpec(makeName('[Property See Also]', thisClass.alias), seeAlso)+} </li> </for> </ul></dd> diff --git a/o3d/documentation/jsdoc-toolkit-templates/publish.js b/o3d/documentation/jsdoc-toolkit-templates/publish.js index ddb686c..c461cde 100644 --- a/o3d/documentation/jsdoc-toolkit-templates/publish.js +++ b/o3d/documentation/jsdoc-toolkit-templates/publish.js @@ -49,6 +49,7 @@ var g_validJSDOCTypes = { 'void': true, 'undefined': true}; var g_unknownTypes = { }; +var g_numErrors = 0; /** * Called automatically by JsDoc Toolkit. @@ -60,7 +61,7 @@ function publish(symbolSet) { outDir: JSDOC.opt.d || SYS.pwd + '../out/jsdoc/', templatesDir: JSDOC.opt.t || SYS.pwd + '../templates/jsdoc/', symbolsDir: '', - prefix: 'js_1_0_'}; + prefix: JSDOC.opt.D.prefix || 'js_1_0_'}; publish.conf.srcDir = publish.conf.outDir + 'src/' publish.conf.htmlDir = publish.conf.outDir + 'original_html/' @@ -94,8 +95,8 @@ function publish(symbolSet) { var namespacesTemplate = new JSDOC.JsPlate(templatesDir + 'namespaces.tmpl'); } catch(e) { - print('Couldn\'t create the required templates: ' + e); - quit(); + generateError('Couldn\'t create the required templates: ' + e); + System.exit(1); } // some ustility filters @@ -172,6 +173,11 @@ function publish(symbolSet) { var namespaces = namespacesTemplate.process(classes); IO.saveFile(publish.conf.outDir, 'namespaces' + publish.conf.ext, namespaces); IO.saveFile(publish.conf.htmlDir, 'namespaces.html', namespaces); + + if (g_numErrors > 0) { + print('Num Errors: ' + g_numErrors); + System.exit(1); + } } @@ -437,12 +443,13 @@ function camelCaseToUnderscore(str) { /** * Prints a warning about an unknown type only once. + * @param {string} place Use to print error message if type not found. * @param {string} type Type specification. */ -function reportUnknownType(type) { +function reportUnknownType(place, type) { if (!g_unknownTypes[type]) { g_unknownTypes[type] = true; - print ('WARNING: reference to unknown type: "' + type + '"'); + generatePlaceError (place, 'reference to unknown type: "' + type + '"'); } } @@ -493,11 +500,46 @@ function getIndexOfClosingCharacter(str, startIndex) { } /** + * Make's a name by concatenating strings. + * @param {...[string]} strings to concatenate. + * @return {string} Concatenated string. + */ +function makeName() { + var str = ''; + for (var ii = 0; ii < arguments.length; ++ii) { + if (str) { + str += '.'; + } + str += arguments[ii]; + } + return str; +} + +/** + * Generates an error msg. + * @param {string} msg. + */ +function generateError(msg) { + ++g_numErrors; + print('ERROR: ' + msg); +} + +/** + * Generates an error msg. + * @param {string} place Use to print error message. + * @param {string} msg. + */ +function generatePlaceError(place, msg) { + generateError(place + ': ' + msg); +} + +/** * Converts a reference to a single JSDOC type specification to an html link. + * @param {string} place Use to print error message if type not found. * @param {string} str to linkify. * @return {string} linkified string. */ -function linkifySingleType(type) { +function linkifySingleType(place, type) { var not = ''; var equals = ''; // Remove ! if it exists. @@ -516,65 +558,69 @@ function linkifySingleType(type) { if (startsWith(type, 'Array.<')) { var closingAngle = getIndexOfClosingCharacter(type, 6); if (closingAngle < 0) { - print ('WARNING: Unmatched "<" in Array type : ' + type); + generatePlaceError(place, 'Unmatched "<" in Array type : ' + type); } else { link = 'Array.<' + - linkifySingleType(type.substring(7, closingAngle)) + '>'; + linkifySingleType(place, type.substring(7, closingAngle)) + '>'; } } else if (startsWith(type, 'function(')) { var closingParen = getIndexOfClosingCharacter(type, 8); if (closingParen < 0) { - print ('WARNING: Unmatched "(" in function type : ' + type); + generatePlaceError(place, 'Unmatched "(" in function type : ' + type); } else { var end = type.substring(closingParen + 1); if (!startsWith(end, ': ')) { - print ('WARNING: Malformed return specification on function. Must be' + - ' "function(args): type" including the space after the colon.'); + generatePlaceError(place, + 'Malformed return specification on function. Must be' + + ' "function(args): type" including the space after the colon.'); } else { - var args = type.substring(9, closingParen).split(/ *, */); var output = ''; - for (var ii = 0; ii < args.length; ++ii) { - if (ii > 0) { - output += ', '; + var argsStr = type.substring(9, closingParen); + if (argsStr) { + var args = argsStr.split(/ *, */); + for (var ii = 0; ii < args.length; ++ii) { + if (ii > 0) { + output += ', '; + } + output += linkifyTypeSpec(place, args[ii]); } - output += linkifyTypeSpec(args[ii]); } - link = 'function(' + output + '): ' + linkifyTypeSpec(end.substring(2)); + link = 'function(' + output + '): ' + + linkifyTypeSpec(place, end.substring(2)); } } } else if (type.indexOf(':') >= 0) { // check for records. - var elements = type.split(/\s*,\s*/); - var output = '{'; - for (var ii = 0; ii < elements.length; ++ii) { - if (ii > 0) { - output += ', '; - } - var element = elements[ii]; - var colon = element.indexOf(': '); - if (colon < 0) { - print ("WARNING: Malformed record specification. Format must be " + - "{id1: type1, id2: type2, ...}."); - output += element; - } else { - var name = element.substring(0, colon); - var subType = element.substring(colon + 2); - output += name + ': ' + linkifyTypeSpec(subType) + if (type.indexOf('::') >= 0) { // check for CPP scope + generatePlaceError(place, + 'CPP "::" scope operator found for type "' + type + + '" must be Javascript "." scope operator.'); + } else { + var elements = type.split(/\s*,\s*/); + var output = '{'; + for (var ii = 0; ii < elements.length; ++ii) { + if (ii > 0) { + output += ', '; + } + var element = elements[ii]; + var colon = element.indexOf(': '); + if (colon < 0) { + generatePlaceError(place, + 'Malformed record specification. Format must be ' + + '{id1: type1, id2: type2, ...}.'); + output += element; + } else { + var name = element.substring(0, colon); + var subType = element.substring(colon + 2); + output += name + ': ' + linkifyTypeSpec(place, subType) + } } + link = output + '}'; } - link = output + '}'; } else { var symbol = getSymbol(type); if (symbol) { link = '<a class="el" href="' + getLinkToSymbol(symbol) + '">' + type + '</a>'; - } else if (startsWith(type, 'o3d.')) { - // TODO: remove this hack, make nixysa generate JSDOC js - // files instead of C++ headers and pass those into - // jsdoctoolkit. - reportUnknownType(type); - link = '<a class="el" href="../classo3d_1_1_' + - camelCaseToUnderscore(type.substring(4)) + '.html">' + - type + '</a>'; } else { // See if the symbol is a property or field. var period = type.lastIndexOf('.'); @@ -586,11 +632,21 @@ function linkifySingleType(type) { link = '<a class="el" href="' + getLinkToSymbol(symbol) + '#' + field + '">' + type + '</a>'; } else { - if (subType[0] == '?') { - subType = subType.substring(1); - } - if (!g_validJSDOCTypes[subType]) { - reportUnknownType(type); + if (startsWith(type, 'o3d.')) { + // TODO(gman): remove this hack, make nixysa generate JSDOC js + // files instead of C++ headers and pass those into + // jsdoctoolkit. + reportUnknownType(place, type); + link = '<a class="el" href="../classo3d_1_1_' + + camelCaseToUnderscore(type.substring(4)) + '.html">' + + type + '</a>'; + } else { + if (subType[0] == '?') { + subType = subType.substring(1); + } + if (!g_validJSDOCTypes[subType]) { + reportUnknownType(place, type); + } } } } @@ -627,10 +683,11 @@ function fixSpecCommas(str) { * '(!o3djs.math.Vector3|!O3D.math.Vector4)' would change to * '(!<a href="??">o3djs.math.Vector3</a> * |!<a href="??">o3djs.math.Vector4</a>)'. + * @param {string} place Use to print error message if type not found. * @param {string} str to linkify. * @return {string} linkified string. */ -function linkifyTypeSpec(str) { +function linkifyTypeSpec(place, str) { var output = ''; if (str) { var fixed = fixSpecCommas(str); @@ -642,17 +699,32 @@ function linkifyTypeSpec(str) { if (tt > 0) { output += '|'; } - output += linkifySingleType(types[tt]); + output += linkifySingleType(place, types[tt]); } output += ')'; } else { - output += linkifySingleType(fixed); + output += linkifySingleType(place, fixed); } + } else { + generatePlaceError(place, 'missing type specification (' + str + ')'); } return output; } /** + * Same as linkifyTypeSpec but allows str to be undefined or ''. + * @param {string} place Use to print error message if type not found. + * @param {string} str to linkify. + * @return {string} linkified string. + */ +function linkifyTypeSpecForReturn(place, str) { + if (str) { + return linkifyTypeSpec(place, str); + } + return ''; +} + +/** * Gets a symbol for a type. * This is here mostly for debugging so you can insert a print before or after * each call to g_symbolSet.getSymbol. |