diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 2e1e43c5aa..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "node": true, - "es6": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 2018 - }, - "rules": { - "indent": ["error", 4], - "linebreak-style": ["error", "unix"], - "quotes": ["error", "single"], - "semi": ["error", "always"], - "no-unused-vars": 0 - } -} diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b5c68e55be..dd84ea7824 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,6 +4,7 @@ about: Create a report to help us improve title: '' labels: '' assignees: '' + --- **Describe the bug** @@ -11,7 +12,6 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: - 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,17 +24,15 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - -- OS: [e.g. iOS] -- Browser [e.g. chrome, safari] -- Version [e.g. 22] + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] **Smartphone (please complete the following information):** - -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] -- Browser [e.g. stock browser, safari] -- Version [e.g. 22] + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md index 96a47352ab..48d5f81fa4 100644 --- a/.github/ISSUE_TEMPLATE/custom.md +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -4,4 +4,7 @@ about: Describe this issue template's purpose here. title: '' labels: '' assignees: '' + --- + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2f28cead03..bbcbbe7d61 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,6 +4,7 @@ about: Suggest an idea for this project title: '' labels: '' assignees: '' + --- **Is your feature request related to a problem? Please describe.** diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 70932bf142..eeaa2f1d75 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -16,6 +16,6 @@ jobs: pull-requests: write steps: - - uses: actions/labeler@v2 + - uses: actions/labeler@v4 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/latest-npm.yml b/.github/workflows/latest-npm.yml index adb7937a2b..085d4fd267 100644 --- a/.github/workflows/latest-npm.yml +++ b/.github/workflows/latest-npm.yml @@ -33,7 +33,7 @@ jobs: - '0.10' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ljharb/actions/node/run@main name: 'nvm install-latest-npm' with: diff --git a/.gitignore b/.gitignore index de010e39bd..e86fe25559 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - # Logs logs *.log @@ -55,7 +33,7 @@ bower_components build/Release # Dependency directories -# node_modules/ +node_modules/ jspm_packages/ # Typescript v1 declaration files @@ -74,11 +52,11 @@ typings/ *.tgz # dotenv environment variables file - +.env # gatsby files -# .cache/ -# public +.cache/ +public # Mac files .DS_Store @@ -89,10 +67,3 @@ yarn-error.log .pnp.js # Yarn Integrity file .yarn-integrity - -node_modules/ - -.package-lock.json -*.cache -*public -src/pages/docs/tools/Archive.md diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 3ce2c41f93..0000000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -{ "engines" : { "node" : ">=0.15" } } diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index c107424776..0000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -14.15.0 diff --git a/.vscode/PythonImportHelper-v2-Completion.json b/.vscode/PythonImportHelper-v2-Completion.json index 2e5f914a35..9551807b01 100644 --- a/.vscode/PythonImportHelper-v2-Completion.json +++ b/.vscode/PythonImportHelper-v2-Completion.json @@ -23,31 +23,6245 @@ "detail": "flask", "documentation": {} }, + { + "label": "gyp.common", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.common", + "description": "gyp.common", + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "GetEnvironFallback", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "GypError", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "GypError", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "OrderedSet", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "OrderedSet", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "GetEnvironFallback", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "GypError", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "OrderedSet", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "OrderedSet", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "GypError", + "importPath": "gyp.common", + "description": "gyp.common", + "isExtraImport": true, + "detail": "gyp.common", + "documentation": {} + }, + { + "label": "gyp.ninja_syntax", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.ninja_syntax", + "description": "gyp.ninja_syntax", + "detail": "gyp.ninja_syntax", + "documentation": {} + }, + { + "label": "json", + "kind": 6, + "isExtraImport": true, + "importPath": "json", + "description": "json", + "detail": "json", + "documentation": {} + }, + { + "label": "os", + "kind": 6, + "isExtraImport": true, + "importPath": "os", + "description": "os", + "detail": "os", + "documentation": {} + }, + { + "label": "posixpath", + "kind": 6, + "isExtraImport": true, + "importPath": "posixpath", + "description": "posixpath", + "detail": "posixpath", + "documentation": {} + }, + { + "label": "sys", + "kind": 6, + "isExtraImport": true, + "importPath": "sys", + "description": "sys", + "detail": "sys", + "documentation": {} + }, + { + "label": "gyp", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp", + "description": "gyp", + "detail": "gyp", + "documentation": {} + }, + { + "label": "gyp.generator.make", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.generator.make", + "description": "gyp.generator.make", + "detail": "gyp.generator.make", + "documentation": {} + }, + { + "label": "re", + "kind": 6, + "isExtraImport": true, + "importPath": "re", + "description": "re", + "detail": "re", + "documentation": {} + }, + { + "label": "subprocess", + "kind": 6, + "isExtraImport": true, + "importPath": "subprocess", + "description": "subprocess", + "detail": "subprocess", + "documentation": {} + }, + { + "label": "multiprocessing", + "kind": 6, + "isExtraImport": true, + "importPath": "multiprocessing", + "description": "multiprocessing", + "detail": "multiprocessing", + "documentation": {} + }, + { + "label": "signal", + "kind": 6, + "isExtraImport": true, + "importPath": "signal", + "description": "signal", + "detail": "signal", + "documentation": {} + }, + { + "label": "string", + "kind": 6, + "isExtraImport": true, + "importPath": "string", + "description": "string", + "detail": "string", + "documentation": {} + }, + { + "label": "collections", + "kind": 6, + "isExtraImport": true, + "importPath": "collections", + "description": "collections", + "detail": "collections", + "documentation": {} + }, + { + "label": "gyp.msvs_emulation", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.msvs_emulation", + "description": "gyp.msvs_emulation", + "detail": "gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "xml.sax.saxutils", + "kind": 6, + "isExtraImport": true, + "importPath": "xml.sax.saxutils", + "description": "xml.sax.saxutils", + "detail": "xml.sax.saxutils", + "documentation": {} + }, + { + "label": "escape", + "importPath": "xml.sax.saxutils", + "description": "xml.sax.saxutils", + "isExtraImport": true, + "detail": "xml.sax.saxutils", + "documentation": {} + }, + { + "label": "os.path", + "kind": 6, + "isExtraImport": true, + "importPath": "os.path", + "description": "os.path", + "detail": "os.path", + "documentation": {} + }, + { + "label": "shlex", + "kind": 6, + "isExtraImport": true, + "importPath": "shlex", + "description": "shlex", + "detail": "shlex", + "documentation": {} + }, + { + "label": "xml.etree.cElementTree", + "kind": 6, + "isExtraImport": true, + "importPath": "xml.etree.cElementTree", + "description": "xml.etree.cElementTree", + "detail": "xml.etree.cElementTree", + "documentation": {} + }, + { + "label": "errno", + "kind": 6, + "isExtraImport": true, + "importPath": "errno", + "description": "errno", + "detail": "errno", + "documentation": {} + }, + { + "label": "pprint", + "kind": 6, + "isExtraImport": true, + "importPath": "pprint", + "description": "pprint", + "detail": "pprint", + "documentation": {} + }, + { + "label": "code", + "kind": 6, + "isExtraImport": true, + "importPath": "code", + "description": "code", + "detail": "code", + "documentation": {} + }, + { + "label": "gyp.xcode_emulation", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.xcode_emulation", + "description": "gyp.xcode_emulation", + "detail": "gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "hashlib", + "kind": 6, + "isExtraImport": true, + "importPath": "hashlib", + "description": "hashlib", + "detail": "hashlib", + "documentation": {} + }, + { + "label": "copy", + "kind": 6, + "isExtraImport": true, + "importPath": "copy", + "description": "copy", + "detail": "copy", + "documentation": {} + }, + { + "label": "ntpath", + "kind": 6, + "isExtraImport": true, + "importPath": "ntpath", + "description": "ntpath", + "detail": "ntpath", + "documentation": {} + }, + { + "label": "gyp.easy_xml", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.easy_xml", + "description": "gyp.easy_xml", + "detail": "gyp.easy_xml", + "documentation": {} + }, + { + "label": "gyp.generator.ninja", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.generator.ninja", + "description": "gyp.generator.ninja", + "detail": "gyp.generator.ninja", + "documentation": {} + }, + { + "label": "gyp.MSVSNew", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSNew", + "description": "gyp.MSVSNew", + "detail": "gyp.MSVSNew", + "documentation": {} + }, + { + "label": "gyp.MSVSProject", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSProject", + "description": "gyp.MSVSProject", + "detail": "gyp.MSVSProject", + "documentation": {} + }, + { + "label": "gyp.MSVSSettings", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSSettings", + "description": "gyp.MSVSSettings", + "detail": "gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "gyp.MSVSToolFile", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSToolFile", + "description": "gyp.MSVSToolFile", + "detail": "gyp.MSVSToolFile", + "documentation": {} + }, + { + "label": "gyp.MSVSUserFile", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSUserFile", + "description": "gyp.MSVSUserFile", + "detail": "gyp.MSVSUserFile", + "documentation": {} + }, + { + "label": "gyp.MSVSUtil", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSUtil", + "description": "gyp.MSVSUtil", + "detail": "gyp.MSVSUtil", + "documentation": {} + }, + { + "label": "gyp.MSVSVersion", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.MSVSVersion", + "description": "gyp.MSVSVersion", + "detail": "gyp.MSVSVersion", + "documentation": {} + }, + { + "label": "gyp.generator.msvs", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.generator.msvs", + "description": "gyp.generator.msvs", + "detail": "gyp.generator.msvs", + "documentation": {} + }, + { + "label": "unittest", + "kind": 6, + "isExtraImport": true, + "importPath": "unittest", + "description": "unittest", + "detail": "unittest", + "documentation": {} + }, + { + "label": "StringIO", + "kind": 6, + "isExtraImport": true, + "importPath": "StringIO", + "description": "StringIO", + "detail": "StringIO", + "documentation": {} + }, + { + "label": "StringIO", + "importPath": "cStringIO", + "description": "cStringIO", + "isExtraImport": true, + "detail": "cStringIO", + "documentation": {} + }, + { + "label": "TestCommon", + "kind": 6, + "isExtraImport": true, + "importPath": "TestCommon", + "description": "TestCommon", + "detail": "TestCommon", + "documentation": {} + }, + { + "label": "filecmp", + "kind": 6, + "isExtraImport": true, + "importPath": "filecmp", + "description": "filecmp", + "detail": "filecmp", + "documentation": {} + }, + { + "label": "gyp.xcodeproj_file", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.xcodeproj_file", + "description": "gyp.xcodeproj_file", + "detail": "gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "gyp.xcode_ninja", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.xcode_ninja", + "description": "gyp.xcode_ninja", + "detail": "gyp.xcode_ninja", + "documentation": {} + }, + { + "label": "shutil", + "kind": 6, + "isExtraImport": true, + "importPath": "shutil", + "description": "shutil", + "detail": "shutil", + "documentation": {} + }, + { + "label": "tempfile", + "kind": 6, + "isExtraImport": true, + "importPath": "tempfile", + "description": "tempfile", + "detail": "tempfile", + "documentation": {} + }, + { + "label": "gyp.generator.xcode", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.generator.xcode", + "description": "gyp.generator.xcode", + "detail": "gyp.generator.xcode", + "documentation": {} + }, + { + "label": "random", + "kind": 6, + "isExtraImport": true, + "importPath": "random", + "description": "random", + "detail": "random", + "documentation": {} + }, + { + "label": "socket", + "kind": 6, + "isExtraImport": true, + "importPath": "socket", + "description": "socket", + "detail": "socket", + "documentation": {} + }, + { + "label": "glob", + "kind": 6, + "isExtraImport": true, + "importPath": "glob", + "description": "glob", + "detail": "glob", + "documentation": {} + }, + { + "label": "with_statement", + "importPath": "__future__", + "description": "__future__", + "isExtraImport": true, + "detail": "__future__", + "documentation": {} + }, + { + "label": "locale", + "kind": 6, + "isExtraImport": true, + "importPath": "locale", + "description": "locale", + "detail": "locale", + "documentation": {} + }, + { + "label": "fcntl", + "kind": 6, + "isExtraImport": true, + "importPath": "fcntl", + "description": "fcntl", + "detail": "fcntl", + "documentation": {} + }, + { + "label": "struct", + "kind": 6, + "isExtraImport": true, + "importPath": "struct", + "description": "struct", + "detail": "struct", + "documentation": {} + }, + { + "label": "Const", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "Dict", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "Discard", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "List", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "Module", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "Node", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "Stmt", + "importPath": "compiler.ast", + "description": "compiler.ast", + "isExtraImport": true, + "detail": "compiler.ast", + "documentation": {} + }, + { + "label": "compiler", + "kind": 6, + "isExtraImport": true, + "importPath": "compiler", + "description": "compiler", + "detail": "compiler", + "documentation": {} + }, + { + "label": "gyp.simple_copy", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.simple_copy", + "description": "gyp.simple_copy", + "detail": "gyp.simple_copy", + "documentation": {} + }, + { + "label": "optparse", + "kind": 6, + "isExtraImport": true, + "importPath": "optparse", + "description": "optparse", + "detail": "optparse", + "documentation": {} + }, + { + "label": "threading", + "kind": 6, + "isExtraImport": true, + "importPath": "threading", + "description": "threading", + "detail": "threading", + "documentation": {} + }, + { + "label": "time", + "kind": 6, + "isExtraImport": true, + "importPath": "time", + "description": "time", + "detail": "time", + "documentation": {} + }, + { + "label": "traceback", + "kind": 6, + "isExtraImport": true, + "importPath": "traceback", + "description": "traceback", + "detail": "traceback", + "documentation": {} + }, + { + "label": "gyp.input", + "kind": 6, + "isExtraImport": true, + "importPath": "gyp.input", + "description": "gyp.input", + "detail": "gyp.input", + "documentation": {} + }, + { + "label": "fnmatch", + "kind": 6, + "isExtraImport": true, + "importPath": "fnmatch", + "description": "fnmatch", + "detail": "fnmatch", + "documentation": {} + }, + { + "label": "plistlib", + "kind": 6, + "isExtraImport": true, + "importPath": "plistlib", + "description": "plistlib", + "detail": "plistlib", + "documentation": {} + }, + { + "label": "textwrap", + "kind": 6, + "isExtraImport": true, + "importPath": "textwrap", + "description": "textwrap", + "detail": "textwrap", + "documentation": {} + }, + { + "label": "stat", + "kind": 6, + "isExtraImport": true, + "importPath": "stat", + "description": "stat", + "detail": "stat", + "documentation": {} + }, + { + "label": "xml.dom.minidom", + "kind": 6, + "isExtraImport": true, + "importPath": "xml.dom.minidom", + "description": "xml.dom.minidom", + "detail": "xml.dom.minidom", + "documentation": {} + }, + { + "label": "parse", + "importPath": "xml.dom.minidom", + "description": "xml.dom.minidom", + "isExtraImport": true, + "detail": "xml.dom.minidom", + "documentation": {} + }, + { + "label": "Node", + "importPath": "xml.dom.minidom", + "description": "xml.dom.minidom", + "isExtraImport": true, + "detail": "xml.dom.minidom", + "documentation": {} + }, + { + "label": "pretty_vcproj", + "kind": 6, + "isExtraImport": true, + "importPath": "pretty_vcproj", + "description": "pretty_vcproj", + "detail": "pretty_vcproj", + "documentation": {} + }, + { + "label": "setup", + "importPath": "setuptools", + "description": "setuptools", + "isExtraImport": true, + "detail": "setuptools", + "documentation": {} + }, { "label": "form", "kind": 2, - "importPath": "docs.content.learning-area.html.forms.sending-form-data.python-example", - "description": "docs.content.learning-area.html.forms.sending-form-data.python-example", - "peekOfCode": "def form():\n return render_template(\"form.html\")\n@app.route(\"/hello\", methods=[\"GET\", \"POST\"])\ndef hello():\n return render_template(\"greeting.html\",\n say=request.form[\"say\"],\n to=request.form[\"to\"])\nif __name__ == \"__main__\":\n app.run()", - "detail": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "importPath": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "description": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "peekOfCode": "def form():\n return render_template(\"form.html\")\n@app.route(\"/hello\", methods=[\"GET\", \"POST\"])\ndef hello():\n return render_template(\"greeting.html\",\n say=request.form[\"say\"],\n to=request.form[\"to\"])\nif __name__ == \"__main__\":\n app.run()", + "detail": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "documentation": {} + }, + { + "label": "hello", + "kind": 2, + "importPath": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "description": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "peekOfCode": "def hello():\n return render_template(\"greeting.html\",\n say=request.form[\"say\"],\n to=request.form[\"to\"])\nif __name__ == \"__main__\":\n app.run()", + "detail": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "documentation": {} + }, + { + "label": "app", + "kind": 5, + "importPath": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "description": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "peekOfCode": "app = Flask(__name__)\n@app.route(\"/\", methods=[\"GET\", \"POST\"])\ndef form():\n return render_template(\"form.html\")\n@app.route(\"/hello\", methods=[\"GET\", \"POST\"])\ndef hello():\n return render_template(\"greeting.html\",\n say=request.form[\"say\"],\n to=request.form[\"to\"])\nif __name__ == \"__main__\":", + "detail": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "documentation": {} + }, + { + "label": "Target", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "class Target(object):\n \"\"\"Holds information about a particular target:\n deps: set of Targets this Target depends upon. This is not recursive, only the\n direct dependent Targets.\n match_status: one of the MatchStatus values.\n back_deps: set of Targets that have a dependency on this Target.\n visited: used during iteration to indicate whether we've visited this target.\n This is used for two iterations, once in building the set of Targets and\n again in _GetBuildTargets().\n name: fully qualified name of the target.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "Config", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "class Config(object):\n \"\"\"Details what we're looking for\n files: set of files to search for\n targets: see file description for details.\"\"\"\n def __init__(self):\n self.files = []\n self.targets = set()\n self.additional_compile_target_names = set()\n self.test_target_names = set()\n def Init(self, params):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "TargetCalculator", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "class TargetCalculator(object):\n \"\"\"Calculates the matching test_targets and matching compile_targets.\"\"\"\n def __init__(self, files, additional_compile_target_names, test_target_names,\n data, target_list, target_dicts, toplevel_dir, build_files):\n self._additional_compile_target_names = set(additional_compile_target_names)\n self._test_target_names = set(test_target_names)\n self._name_to_target, self._changed_targets, self._root_targets = (\n _GenerateTargets(data, target_list, target_dicts, toplevel_dir,\n frozenset(files), build_files))\n self._unqualified_mapping, self.invalid_targets = (", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "def CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n elif flavor == 'win':\n default_variables.setdefault('OS', 'win')\n # Copy additional generator configuration data from VS, which is shared\n # by the Windows Ninja generator.\n import gyp.generator.msvs as msvs_generator", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n \"\"\"Called by gyp as the final stage. Outputs results.\"\"\"\n config = Config()\n try:\n config.Init(params)\n if not config.files:\n raise Exception('Must specify files to analyze via config_path generator '\n 'flag')\n toplevel_dir = _ToGypPath(os.path.abspath(params['options'].toplevel_dir))\n if debug:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "files", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "files = [\"b.cc\", \"d.cc\"] (B depends upon b.cc and D depends upon d.cc), then\nthe following is output:\n|compile_targets| = [\"B\"] B must built as it depends upon the changed file b.cc\nand the supplied target A depends upon it. A is not output as a build_target\nas it is of type none with no rules and actions.\n|test_targets| = [\"B\"] B directly depends upon the change file b.cc.\nEven though the file d.cc, which D depends upon, has changed D is not output\nas it was not supplied by way of |additional_compile_targets| or |test_targets|.\nIf the generator flag analyzer_output_path is specified, output is written\nthere. Otherwise output is written to stdout.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "|compile_targets|", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "|compile_targets| = [\"B\"] B must built as it depends upon the changed file b.cc\nand the supplied target A depends upon it. A is not output as a build_target\nas it is of type none with no rules and actions.\n|test_targets| = [\"B\"] B directly depends upon the change file b.cc.\nEven though the file d.cc, which D depends upon, has changed D is not output\nas it was not supplied by way of |additional_compile_targets| or |test_targets|.\nIf the generator flag analyzer_output_path is specified, output is written\nthere. Otherwise output is written to stdout.\nIn Gyp the \"all\" target is shorthand for the root targets in the files passed\nto gyp. For example, if file \"a.gyp\" contains targets \"a1\" and", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "|test_targets|", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "|test_targets| = [\"B\"] B directly depends upon the change file b.cc.\nEven though the file d.cc, which D depends upon, has changed D is not output\nas it was not supplied by way of |additional_compile_targets| or |test_targets|.\nIf the generator flag analyzer_output_path is specified, output is written\nthere. Otherwise output is written to stdout.\nIn Gyp the \"all\" target is shorthand for the root targets in the files passed\nto gyp. For example, if file \"a.gyp\" contains targets \"a1\" and\n\"a2\", and file \"b.gyp\" contains targets \"b1\" and \"b2\" and \"a2\" has a dependency\non \"b2\" and gyp is supplied \"a.gyp\" then \"all\" consists of \"a1\" and \"a2\".\nNotice that \"b1\" and \"b2\" are not in the \"all\" target as \"b.gyp\" was not", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "debug", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "debug = False\nfound_dependency_string = 'Found dependency'\nno_dependency_string = 'No dependencies'\n# Status when it should be assumed that everything has changed.\nall_changed_string = 'Found dependency (all)'\n# MatchStatus is used indicate if and how a target depends upon the supplied\n# sources.\n# The target's sources contain one of the supplied paths.\nMATCH_STATUS_MATCHES = 1\n# The target has a dependency on another target that contains one of the", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "found_dependency_string", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "found_dependency_string = 'Found dependency'\nno_dependency_string = 'No dependencies'\n# Status when it should be assumed that everything has changed.\nall_changed_string = 'Found dependency (all)'\n# MatchStatus is used indicate if and how a target depends upon the supplied\n# sources.\n# The target's sources contain one of the supplied paths.\nMATCH_STATUS_MATCHES = 1\n# The target has a dependency on another target that contains one of the\n# supplied paths.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "no_dependency_string", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "no_dependency_string = 'No dependencies'\n# Status when it should be assumed that everything has changed.\nall_changed_string = 'Found dependency (all)'\n# MatchStatus is used indicate if and how a target depends upon the supplied\n# sources.\n# The target's sources contain one of the supplied paths.\nMATCH_STATUS_MATCHES = 1\n# The target has a dependency on another target that contains one of the\n# supplied paths.\nMATCH_STATUS_MATCHES_BY_DEPENDENCY = 2", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "all_changed_string", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "all_changed_string = 'Found dependency (all)'\n# MatchStatus is used indicate if and how a target depends upon the supplied\n# sources.\n# The target's sources contain one of the supplied paths.\nMATCH_STATUS_MATCHES = 1\n# The target has a dependency on another target that contains one of the\n# supplied paths.\nMATCH_STATUS_MATCHES_BY_DEPENDENCY = 2\n# The target's sources weren't in the supplied paths and none of the target's\n# dependencies depend upon a target that matched.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "MATCH_STATUS_MATCHES", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "MATCH_STATUS_MATCHES = 1\n# The target has a dependency on another target that contains one of the\n# supplied paths.\nMATCH_STATUS_MATCHES_BY_DEPENDENCY = 2\n# The target's sources weren't in the supplied paths and none of the target's\n# dependencies depend upon a target that matched.\nMATCH_STATUS_DOESNT_MATCH = 3\n# The target doesn't contain the source, but the dependent targets have not yet\n# been visited to determine a more specific status yet.\nMATCH_STATUS_TBD = 4", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "MATCH_STATUS_MATCHES_BY_DEPENDENCY", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "MATCH_STATUS_MATCHES_BY_DEPENDENCY = 2\n# The target's sources weren't in the supplied paths and none of the target's\n# dependencies depend upon a target that matched.\nMATCH_STATUS_DOESNT_MATCH = 3\n# The target doesn't contain the source, but the dependent targets have not yet\n# been visited to determine a more specific status yet.\nMATCH_STATUS_TBD = 4\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ngenerator_wants_static_library_dependencies_adjusted = False\ngenerator_default_variables = {", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "MATCH_STATUS_DOESNT_MATCH", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "MATCH_STATUS_DOESNT_MATCH = 3\n# The target doesn't contain the source, but the dependent targets have not yet\n# been visited to determine a more specific status yet.\nMATCH_STATUS_TBD = 4\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ngenerator_wants_static_library_dependencies_adjusted = False\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "MATCH_STATUS_TBD", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "MATCH_STATUS_TBD = 4\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ngenerator_wants_static_library_dependencies_adjusted = False\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n generator_default_variables[dirname] = '!!!'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ngenerator_wants_static_library_dependencies_adjusted = False\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n generator_default_variables[dirname] = '!!!'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',\n 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "generator_wants_static_library_dependencies_adjusted", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "generator_wants_static_library_dependencies_adjusted = False\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n generator_default_variables[dirname] = '!!!'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',\n 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',\n 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "peekOfCode": "generator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n generator_default_variables[dirname] = '!!!'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',\n 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',\n 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',\n 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.analyzer", + "documentation": {} + }, + { + "label": "AndroidMkWriter", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "class AndroidMkWriter(object):\n \"\"\"AndroidMkWriter packages up the writing of one target-specific Android.mk.\n Its only real entry point is Write(), and is mostly used for namespacing.\n \"\"\"\n def __init__(self, android_top_dir):\n self.android_top_dir = android_top_dir\n def Write(self, qualified_target, relative_target, base_path, output_filename,\n spec, configs, part_of_all, write_alias_target, sdk_version):\n \"\"\"The main entry point: writes a .mk file for a single target.\n Arguments:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "IsCPPExtension", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "def IsCPPExtension(ext):\n return make.COMPILABLE_EXTENSIONS.get(ext) == 'cxx'\ndef Sourceify(path):\n \"\"\"Convert a path to its source directory form. The Android backend does not\n support options.generator_output, so this function is a noop.\"\"\"\n return path\n# Map from qualified target to path to output.\n# For Android, the target of these maps is a tuple ('static', 'modulename'),\n# ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string,\n# since we link by module.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "Sourceify", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "def Sourceify(path):\n \"\"\"Convert a path to its source directory form. The Android backend does not\n support options.generator_output, so this function is a noop.\"\"\"\n return path\n# Map from qualified target to path to output.\n# For Android, the target of these maps is a tuple ('static', 'modulename'),\n# ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string,\n# since we link by module.\ntarget_outputs = {}\n# Map from qualified target to any linkable output. A subset", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "PerformBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "def PerformBuild(data, configurations, params):\n # The android backend only supports the default configuration.\n options = params['options']\n makefile = os.path.abspath(os.path.join(options.toplevel_dir,\n 'GypAndroid.mk'))\n env = dict(os.environ)\n env['ONE_SHOT_MAKEFILE'] = makefile\n arguments = ['make', '-C', os.environ['ANDROID_BUILD_TOP'], 'gyp_all_modules']\n print 'Building: %s' % arguments\n subprocess.check_call(arguments, env=env)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n options = params['options']\n generator_flags = params.get('generator_flags', {})\n builddir_name = generator_flags.get('output_dir', 'out')\n limit_to_target_all = generator_flags.get('limit_to_target_all', False)\n write_alias_targets = generator_flags.get('write_alias_targets', True)\n sdk_version = generator_flags.get('aosp_sdk_version', 0)\n android_top_dir = os.environ.get('ANDROID_BUILD_TOP')\n assert android_top_dir, '$ANDROID_BUILD_TOP not set; you need to run lunch.'\n def CalculateMakefilePath(build_file, base_name):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "generator_default_variables = {\n 'OS': 'android',\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'SHARED_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'SHARED_LIB_SUFFIX': '.so',\n 'INTERMEDIATE_DIR': '$(gyp_intermediate_dir)',\n 'SHARED_INTERMEDIATE_DIR': '$(gyp_shared_intermediate_dir)',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "generator_supports_multiple_toolsets = True\n# Generator-specific gyp specs.\ngenerator_additional_non_configuration_keys = [\n # Boolean to declare that this target does not want its name mangled.\n 'android_unmangled_name',\n # Map of android build system variables to set.\n 'aosp_build_settings',\n]\ngenerator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "generator_additional_non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "generator_additional_non_configuration_keys = [\n # Boolean to declare that this target does not want its name mangled.\n 'android_unmangled_name',\n # Map of android build system variables to set.\n 'aosp_build_settings',\n]\ngenerator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\nALL_MODULES_FOOTER = \"\"\"\\\n# \"gyp_all_modules\" is a concatenation of the \"gyp_all_modules\" targets from", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "generator_additional_path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "generator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\nALL_MODULES_FOOTER = \"\"\"\\\n# \"gyp_all_modules\" is a concatenation of the \"gyp_all_modules\" targets from\n# all the included sub-makefiles. This is just here to clarify.\ngyp_all_modules:\n\"\"\"\nheader = \"\"\"\\\n# This file is generated by gyp; do not edit.\n\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "generator_extra_sources_for_rules", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "generator_extra_sources_for_rules = []\nALL_MODULES_FOOTER = \"\"\"\\\n# \"gyp_all_modules\" is a concatenation of the \"gyp_all_modules\" targets from\n# all the included sub-makefiles. This is just here to clarify.\ngyp_all_modules:\n\"\"\"\nheader = \"\"\"\\\n# This file is generated by gyp; do not edit.\n\"\"\"\n# Map gyp target types to Android module classes.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "ALL_MODULES_FOOTER", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "ALL_MODULES_FOOTER = \"\"\"\\\n# \"gyp_all_modules\" is a concatenation of the \"gyp_all_modules\" targets from\n# all the included sub-makefiles. This is just here to clarify.\ngyp_all_modules:\n\"\"\"\nheader = \"\"\"\\\n# This file is generated by gyp; do not edit.\n\"\"\"\n# Map gyp target types to Android module classes.\nMODULE_CLASSES = {", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "header", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "header = \"\"\"\\\n# This file is generated by gyp; do not edit.\n\"\"\"\n# Map gyp target types to Android module classes.\nMODULE_CLASSES = {\n 'static_library': 'STATIC_LIBRARIES',\n 'shared_library': 'SHARED_LIBRARIES',\n 'executable': 'EXECUTABLES',\n}\ndef IsCPPExtension(ext):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "MODULE_CLASSES", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "MODULE_CLASSES = {\n 'static_library': 'STATIC_LIBRARIES',\n 'shared_library': 'SHARED_LIBRARIES',\n 'executable': 'EXECUTABLES',\n}\ndef IsCPPExtension(ext):\n return make.COMPILABLE_EXTENSIONS.get(ext) == 'cxx'\ndef Sourceify(path):\n \"\"\"Convert a path to its source directory form. The Android backend does not\n support options.generator_output, so this function is a noop.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "target_outputs", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "target_outputs = {}\n# Map from qualified target to any linkable output. A subset\n# of target_outputs. E.g. when mybinary depends on liba, we want to\n# include liba in the linker line; when otherbinary depends on\n# mybinary, we just want to build mybinary first.\ntarget_link_deps = {}\nclass AndroidMkWriter(object):\n \"\"\"AndroidMkWriter packages up the writing of one target-specific Android.mk.\n Its only real entry point is Write(), and is mostly used for namespacing.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "target_link_deps", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "peekOfCode": "target_link_deps = {}\nclass AndroidMkWriter(object):\n \"\"\"AndroidMkWriter packages up the writing of one target-specific Android.mk.\n Its only real entry point is Write(), and is mostly used for namespacing.\n \"\"\"\n def __init__(self, android_top_dir):\n self.android_top_dir = android_top_dir\n def Write(self, qualified_target, relative_target, base_path, output_filename,\n spec, configs, part_of_all, write_alias_target, sdk_version):\n \"\"\"The main entry point: writes a .mk file for a single target.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.android", + "documentation": {} + }, + { + "label": "CMakeTargetType", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "class CMakeTargetType(object):\n def __init__(self, command, modifier, property_modifier):\n self.command = command\n self.modifier = modifier\n self.property_modifier = property_modifier\ncmake_target_type_from_gyp_target_type = {\n 'executable': CMakeTargetType('add_executable', None, 'RUNTIME'),\n 'static_library': CMakeTargetType('add_library', 'STATIC', 'ARCHIVE'),\n 'shared_library': CMakeTargetType('add_library', 'SHARED', 'LIBRARY'),\n 'loadable_module': CMakeTargetType('add_library', 'MODULE', 'LIBRARY'),", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CMakeNamer", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "class CMakeNamer(object):\n \"\"\"Converts Gyp target names into CMake target names.\n CMake requires that target names be globally unique. One way to ensure\n this is to fully qualify the names of the targets. Unfortunatly, this\n ends up with all targets looking like \"chrome_chrome_gyp_chrome\" instead\n of just \"chrome\". If this generator were only interested in building, it\n would be possible to fully qualify all target names, then create\n unqualified target names which depend on all qualified targets which\n should have had that name. This is more or less what the 'make' generator\n does with aliases. However, one goal of this generator is to create CMake", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "RemovePrefix", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def RemovePrefix(a, prefix):\n \"\"\"Returns 'a' without 'prefix' if it starts with 'prefix'.\"\"\"\n return a[len(prefix):] if a.startswith(prefix) else a\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n default_variables.setdefault('OS', gyp.common.GetFlavor(params))\ndef Compilable(filename):\n \"\"\"Return true if the file is compilable (should be in OBJS).\"\"\"\n return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS)\ndef Linkable(filename):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n default_variables.setdefault('OS', gyp.common.GetFlavor(params))\ndef Compilable(filename):\n \"\"\"Return true if the file is compilable (should be in OBJS).\"\"\"\n return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS)\ndef Linkable(filename):\n \"\"\"Return true if the file is linkable (should be on the link line).\"\"\"\n return filename.endswith('.o')\ndef NormjoinPathForceCMakeSource(base_path, rel_path):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "Compilable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def Compilable(filename):\n \"\"\"Return true if the file is compilable (should be in OBJS).\"\"\"\n return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS)\ndef Linkable(filename):\n \"\"\"Return true if the file is linkable (should be on the link line).\"\"\"\n return filename.endswith('.o')\ndef NormjoinPathForceCMakeSource(base_path, rel_path):\n \"\"\"Resolves rel_path against base_path and returns the result.\n If rel_path is an absolute path it is returned unchanged.\n Otherwise it is resolved against base_path and normalized.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "Linkable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def Linkable(filename):\n \"\"\"Return true if the file is linkable (should be on the link line).\"\"\"\n return filename.endswith('.o')\ndef NormjoinPathForceCMakeSource(base_path, rel_path):\n \"\"\"Resolves rel_path against base_path and returns the result.\n If rel_path is an absolute path it is returned unchanged.\n Otherwise it is resolved against base_path and normalized.\n If the result is a relative path, it is forced to be relative to the\n CMakeLists.txt.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "NormjoinPathForceCMakeSource", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def NormjoinPathForceCMakeSource(base_path, rel_path):\n \"\"\"Resolves rel_path against base_path and returns the result.\n If rel_path is an absolute path it is returned unchanged.\n Otherwise it is resolved against base_path and normalized.\n If the result is a relative path, it is forced to be relative to the\n CMakeLists.txt.\n \"\"\"\n if os.path.isabs(rel_path):\n return rel_path\n if any([rel_path.startswith(var) for var in FULL_PATH_VARS]):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "NormjoinPath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def NormjoinPath(base_path, rel_path):\n \"\"\"Resolves rel_path against base_path and returns the result.\n TODO: what is this really used for?\n If rel_path begins with '$' it is returned unchanged.\n Otherwise it is resolved against base_path if relative, then normalized.\n \"\"\"\n if rel_path.startswith('$') and not rel_path.startswith('${configuration}'):\n return rel_path\n return os.path.normpath(os.path.join(base_path, rel_path))\ndef CMakeStringEscape(a):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CMakeStringEscape", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def CMakeStringEscape(a):\n \"\"\"Escapes the string 'a' for use inside a CMake string.\n This means escaping\n '\\' otherwise it may be seen as modifying the next character\n '\"' otherwise it will end the string\n ';' otherwise the string becomes a list\n The following do not need to be escaped\n '#' when the lexer is in string state, this does not start a comment\n The following are yet unknown\n '$' generator variables (like ${obj}) must not be escaped,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "SetFileProperty", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def SetFileProperty(output, source_name, property_name, values, sep):\n \"\"\"Given a set of source file, sets the given property on them.\"\"\"\n output.write('set_source_files_properties(')\n output.write(source_name)\n output.write(' PROPERTIES ')\n output.write(property_name)\n output.write(' \"')\n for value in values:\n output.write(CMakeStringEscape(value))\n output.write(sep)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "SetFilesProperty", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def SetFilesProperty(output, variable, property_name, values, sep):\n \"\"\"Given a set of source files, sets the given property on them.\"\"\"\n output.write('set_source_files_properties(')\n WriteVariable(output, variable)\n output.write(' PROPERTIES ')\n output.write(property_name)\n output.write(' \"')\n for value in values:\n output.write(CMakeStringEscape(value))\n output.write(sep)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "SetTargetProperty", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def SetTargetProperty(output, target_name, property_name, values, sep=''):\n \"\"\"Given a target, sets the given property.\"\"\"\n output.write('set_target_properties(')\n output.write(target_name)\n output.write(' PROPERTIES ')\n output.write(property_name)\n output.write(' \"')\n for value in values:\n output.write(CMakeStringEscape(value))\n output.write(sep)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "SetVariable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def SetVariable(output, variable_name, value):\n \"\"\"Sets a CMake variable.\"\"\"\n output.write('set(')\n output.write(variable_name)\n output.write(' \"')\n output.write(CMakeStringEscape(value))\n output.write('\")\\n')\ndef SetVariableList(output, variable_name, values):\n \"\"\"Sets a CMake variable to a list.\"\"\"\n if not values:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "SetVariableList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def SetVariableList(output, variable_name, values):\n \"\"\"Sets a CMake variable to a list.\"\"\"\n if not values:\n return SetVariable(output, variable_name, \"\")\n if len(values) == 1:\n return SetVariable(output, variable_name, values[0])\n output.write('list(APPEND ')\n output.write(variable_name)\n output.write('\\n \"')\n output.write('\"\\n \"'.join([CMakeStringEscape(value) for value in values]))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "UnsetVariable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def UnsetVariable(output, variable_name):\n \"\"\"Unsets a CMake variable.\"\"\"\n output.write('unset(')\n output.write(variable_name)\n output.write(')\\n')\ndef WriteVariable(output, variable_name, prepend=None):\n if prepend:\n output.write(prepend)\n output.write('${')\n output.write(variable_name)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "WriteVariable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def WriteVariable(output, variable_name, prepend=None):\n if prepend:\n output.write(prepend)\n output.write('${')\n output.write(variable_name)\n output.write('}')\nclass CMakeTargetType(object):\n def __init__(self, command, modifier, property_modifier):\n self.command = command\n self.modifier = modifier", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "StringToCMakeTargetName", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def StringToCMakeTargetName(a):\n \"\"\"Converts the given string 'a' to a valid CMake target name.\n All invalid characters are replaced by '_'.\n Invalid for cmake: ' ', '/', '(', ')', '\"'\n Invalid for make: ':'\n Invalid for unknown reasons but cause failures: '.'\n \"\"\"\n return a.translate(string.maketrans(' /():.\"', '_______'))\ndef WriteActions(target_name, actions, extra_sources, extra_deps,\n path_to_gyp, output):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "WriteActions", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def WriteActions(target_name, actions, extra_sources, extra_deps,\n path_to_gyp, output):\n \"\"\"Write CMake for the 'actions' in the target.\n Args:\n target_name: the name of the CMake target being generated.\n actions: the Gyp 'actions' dict for this target.\n extra_sources: [(, )] to append with generated source files.\n extra_deps: [] to append with generated targets.\n path_to_gyp: relative path from CMakeLists.txt being generated to\n the Gyp file in which the target being generated is defined.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "NormjoinRulePathForceCMakeSource", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source):\n if rel_path.startswith((\"${RULE_INPUT_PATH}\",\"${RULE_INPUT_DIRNAME}\")):\n if any([rule_source.startswith(var) for var in FULL_PATH_VARS]):\n return rel_path\n return NormjoinPathForceCMakeSource(base_path, rel_path)\ndef WriteRules(target_name, rules, extra_sources, extra_deps,\n path_to_gyp, output):\n \"\"\"Write CMake for the 'rules' in the target.\n Args:\n target_name: the name of the CMake target being generated.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "WriteRules", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def WriteRules(target_name, rules, extra_sources, extra_deps,\n path_to_gyp, output):\n \"\"\"Write CMake for the 'rules' in the target.\n Args:\n target_name: the name of the CMake target being generated.\n actions: the Gyp 'actions' dict for this target.\n extra_sources: [(, )] to append with generated source files.\n extra_deps: [] to append with generated targets.\n path_to_gyp: relative path from CMakeLists.txt being generated to\n the Gyp file in which the target being generated is defined.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "WriteCopies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):\n \"\"\"Write CMake for the 'copies' in the target.\n Args:\n target_name: the name of the CMake target being generated.\n actions: the Gyp 'actions' dict for this target.\n extra_deps: [] to append with generated targets.\n path_to_gyp: relative path from CMakeLists.txt being generated to\n the Gyp file in which the target being generated is defined.\n \"\"\"\n copy_name = target_name + '__copies'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CreateCMakeTargetBaseName", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def CreateCMakeTargetBaseName(qualified_target):\n \"\"\"This is the name we would like the target to have.\"\"\"\n _, gyp_target_name, gyp_target_toolset = (\n gyp.common.ParseQualifiedTarget(qualified_target))\n cmake_target_base_name = gyp_target_name\n if gyp_target_toolset and gyp_target_toolset != 'target':\n cmake_target_base_name += '_' + gyp_target_toolset\n return StringToCMakeTargetName(cmake_target_base_name)\ndef CreateCMakeTargetFullName(qualified_target):\n \"\"\"An unambiguous name for the target.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CreateCMakeTargetFullName", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def CreateCMakeTargetFullName(qualified_target):\n \"\"\"An unambiguous name for the target.\"\"\"\n gyp_file, gyp_target_name, gyp_target_toolset = (\n gyp.common.ParseQualifiedTarget(qualified_target))\n cmake_target_full_name = gyp_file + ':' + gyp_target_name\n if gyp_target_toolset and gyp_target_toolset != 'target':\n cmake_target_full_name += '_' + gyp_target_toolset\n return StringToCMakeTargetName(cmake_target_full_name)\nclass CMakeNamer(object):\n \"\"\"Converts Gyp target names into CMake target names.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "WriteTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,\n options, generator_flags, all_qualified_targets, output):\n # The make generator does this always.\n # TODO: It would be nice to be able to tell CMake all dependencies.\n circular_libs = generator_flags.get('circular', True)\n if not generator_flags.get('standalone', False):\n output.write('\\n#')\n output.write(qualified_target)\n output.write('\\n')\n gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "GenerateOutputForConfig", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def GenerateOutputForConfig(target_list, target_dicts, data,\n params, config_to_use):\n options = params['options']\n generator_flags = params['generator_flags']\n # generator_dir: relative path from pwd to where make puts build files.\n # Makes migrating from make to cmake easier, cmake doesn't put anything here.\n # Each Gyp configuration creates a different CMakeLists.txt file\n # to avoid incompatibilities between Gyp and CMake configurations.\n generator_dir = os.path.relpath(options.generator_output or '.')\n # output_dir: relative path from generator_dir to the build directory.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "PerformBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def PerformBuild(data, configurations, params):\n options = params['options']\n generator_flags = params['generator_flags']\n # generator_dir: relative path from pwd to where make puts build files.\n # Makes migrating from make to cmake easier, cmake doesn't put anything here.\n generator_dir = os.path.relpath(options.generator_output or '.')\n # output_dir: relative path from generator_dir to the build directory.\n output_dir = generator_flags.get('output_dir', 'out')\n for config_name in configurations:\n # build_dir: relative path from source root to our output files.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CallGenerateOutputForConfig", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def CallGenerateOutputForConfig(arglist):\n # Ignore the interrupt signal so that the parent process catches it and\n # kills all multiprocessing children.\n signal.signal(signal.SIGINT, signal.SIG_IGN)\n target_list, target_dicts, data, params, config_name = arglist\n GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)\ndef GenerateOutput(target_list, target_dicts, data, params):\n user_config = params.get('generator_flags', {}).get('config', None)\n if user_config:\n GenerateOutputForConfig(target_list, target_dicts, data,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n user_config = params.get('generator_flags', {}).get('config', None)\n if user_config:\n GenerateOutputForConfig(target_list, target_dicts, data,\n params, user_config)\n else:\n config_names = target_dicts[target_list[0]]['configurations'].keys()\n if params['parallel']:\n try:\n pool = multiprocessing.Pool(len(config_names))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "generator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'SHARED_LIB_PREFIX': 'lib',\n 'SHARED_LIB_SUFFIX': '.so',\n 'SHARED_LIB_DIR': '${builddir}/lib.${TOOLSET}',\n 'LIB_DIR': '${obj}.${TOOLSET}',\n 'INTERMEDIATE_DIR': '${obj}.${TOOLSET}/${TARGET}/geni',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "FULL_PATH_VARS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "FULL_PATH_VARS = ('${CMAKE_CURRENT_LIST_DIR}', '${builddir}', '${obj}')\ngenerator_supports_multiple_toolsets = True\ngenerator_wants_static_library_dependencies_adjusted = True\nCOMPILABLE_EXTENSIONS = {\n '.c': 'cc',\n '.cc': 'cxx',\n '.cpp': 'cxx',\n '.cxx': 'cxx',\n '.s': 's', # cc\n '.S': 's', # cc", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "generator_supports_multiple_toolsets = True\ngenerator_wants_static_library_dependencies_adjusted = True\nCOMPILABLE_EXTENSIONS = {\n '.c': 'cc',\n '.cc': 'cxx',\n '.cpp': 'cxx',\n '.cxx': 'cxx',\n '.s': 's', # cc\n '.S': 's', # cc\n}", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "generator_wants_static_library_dependencies_adjusted", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "generator_wants_static_library_dependencies_adjusted = True\nCOMPILABLE_EXTENSIONS = {\n '.c': 'cc',\n '.cc': 'cxx',\n '.cpp': 'cxx',\n '.cxx': 'cxx',\n '.s': 's', # cc\n '.S': 's', # cc\n}\ndef RemovePrefix(a, prefix):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "COMPILABLE_EXTENSIONS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "COMPILABLE_EXTENSIONS = {\n '.c': 'cc',\n '.cc': 'cxx',\n '.cpp': 'cxx',\n '.cxx': 'cxx',\n '.s': 's', # cc\n '.S': 's', # cc\n}\ndef RemovePrefix(a, prefix):\n \"\"\"Returns 'a' without 'prefix' if it starts with 'prefix'.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "cmake_target_type_from_gyp_target_type", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "peekOfCode": "cmake_target_type_from_gyp_target_type = {\n 'executable': CMakeTargetType('add_executable', None, 'RUNTIME'),\n 'static_library': CMakeTargetType('add_library', 'STATIC', 'ARCHIVE'),\n 'shared_library': CMakeTargetType('add_library', 'SHARED', 'LIBRARY'),\n 'loadable_module': CMakeTargetType('add_library', 'MODULE', 'LIBRARY'),\n 'none': CMakeTargetType('add_custom_target', 'SOURCES', None),\n}\ndef StringToCMakeTargetName(a):\n \"\"\"Converts the given string 'a' to a valid CMake target name.\n All invalid characters are replaced by '_'.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.cmake", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "def CalculateVariables(default_variables, params):\n generator_flags = params.get('generator_flags', {})\n for key, val in generator_flags.items():\n default_variables.setdefault(key, val)\n default_variables.setdefault('OS', gyp.common.GetFlavor(params))\n flavor = gyp.common.GetFlavor(params)\n if flavor =='win':\n # Copy additional generator configuration data from VS, which is shared\n # by the Windows Ninja generator.\n import gyp.generator.msvs as msvs_generator", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "CalculateGeneratorInputInfo", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "def CalculateGeneratorInputInfo(params):\n \"\"\"Calculate the generator specific info that gets fed to input (called by\n gyp).\"\"\"\n generator_flags = params.get('generator_flags', {})\n if generator_flags.get('adjust_static_libraries', False):\n global generator_wants_static_library_dependencies_adjusted\n generator_wants_static_library_dependencies_adjusted = True\n toplevel = params['options'].toplevel_dir\n generator_dir = os.path.relpath(params['options'].generator_output or '.')\n # output_dir: relative path from generator_dir to the build directory.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n # Map of target -> list of targets it depends on.\n edges = {}\n # Queue of targets to visit.\n targets_to_visit = target_list[:]\n while len(targets_to_visit) > 0:\n target = targets_to_visit.pop()\n if target in edges:\n continue\n edges[target] = []", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "generator_supports_multiple_toolsets = True\ngenerator_wants_static_library_dependencies_adjusted = False\ngenerator_filelist_paths = {\n}\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n # Some gyp steps fail if these are empty(!).\n generator_default_variables[dirname] = 'dir'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "generator_wants_static_library_dependencies_adjusted", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "generator_wants_static_library_dependencies_adjusted = False\ngenerator_filelist_paths = {\n}\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n # Some gyp steps fail if these are empty(!).\n generator_default_variables[dirname] = 'dir'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "generator_filelist_paths", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "generator_filelist_paths = {\n}\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n # Some gyp steps fail if these are empty(!).\n generator_default_variables[dirname] = 'dir'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "peekOfCode": "generator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',\n 'LIB_DIR', 'SHARED_LIB_DIR']:\n # Some gyp steps fail if these are empty(!).\n generator_default_variables[dirname] = 'dir'\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',\n 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',\n 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.dump_dependency_json", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def CalculateVariables(default_variables, params):\n generator_flags = params.get('generator_flags', {})\n for key, val in generator_flags.items():\n default_variables.setdefault(key, val)\n flavor = gyp.common.GetFlavor(params)\n default_variables.setdefault('OS', flavor)\n if flavor == 'win':\n # Copy additional generator configuration data from VS, which is shared\n # by the Eclipse generator.\n import gyp.generator.msvs as msvs_generator", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "CalculateGeneratorInputInfo", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def CalculateGeneratorInputInfo(params):\n \"\"\"Calculate the generator specific info that gets fed to input (called by\n gyp).\"\"\"\n generator_flags = params.get('generator_flags', {})\n if generator_flags.get('adjust_static_libraries', False):\n global generator_wants_static_library_dependencies_adjusted\n generator_wants_static_library_dependencies_adjusted = True\ndef GetAllIncludeDirectories(target_list, target_dicts,\n shared_intermediate_dirs, config_name, params,\n compiler_path):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GetAllIncludeDirectories", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GetAllIncludeDirectories(target_list, target_dicts,\n shared_intermediate_dirs, config_name, params,\n compiler_path):\n \"\"\"Calculate the set of include directories to be used.\n Returns:\n A list including all the include_dir's specified for every target followed\n by any include directories that were added as cflag compiler options.\n \"\"\"\n gyp_includes_set = set()\n compiler_includes_list = []", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GetCompilerPath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GetCompilerPath(target_list, data, options):\n \"\"\"Determine a command that can be used to invoke the compiler.\n Returns:\n If this is a gyp project that has explicit make settings, try to determine\n the compiler from that. Otherwise, see if a compiler was specified via the\n CC_target environment variable.\n \"\"\"\n # First, see if the compiler is configured in make's settings.\n build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])\n make_global_settings_dict = data[build_file].get('make_global_settings', {})", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GetAllDefines", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GetAllDefines(target_list, target_dicts, data, config_name, params,\n compiler_path):\n \"\"\"Calculate the defines for a project.\n Returns:\n A dict that includes explict defines declared in gyp files along with all of\n the default defines that the compiler uses.\n \"\"\"\n # Get defines declared in the gyp files.\n all_defines = {}\n flavor = gyp.common.GetFlavor(params)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "WriteIncludePaths", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def WriteIncludePaths(out, eclipse_langs, include_dirs):\n \"\"\"Write the includes section of a CDT settings export file.\"\"\"\n out.write('
\\n')\n out.write(' \\n')\n for lang in eclipse_langs:\n out.write(' \\n' % lang)\n for include_dir in include_dirs:\n out.write(' %s\\n' %\n include_dir)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "WriteMacros", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def WriteMacros(out, eclipse_langs, defines):\n \"\"\"Write the macros section of a CDT settings export file.\"\"\"\n out.write('
\\n')\n out.write(' \\n')\n for lang in eclipse_langs:\n out.write(' \\n' % lang)\n for key in sorted(defines.iterkeys()):\n out.write(' %s%s\\n' %\n (escape(key), escape(defines[key])))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GenerateOutputForConfig", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GenerateOutputForConfig(target_list, target_dicts, data, params,\n config_name):\n options = params['options']\n generator_flags = params.get('generator_flags', {})\n # build_dir: relative path from source root to our output files.\n # e.g. \"out/Debug\"\n build_dir = os.path.join(generator_flags.get('output_dir', 'out'),\n config_name)\n toplevel_build = os.path.join(options.toplevel_dir, build_dir)\n # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GenerateCdtSettingsFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GenerateCdtSettingsFile(target_list, target_dicts, data, params,\n config_name, out_name, options,\n shared_intermediate_dirs):\n gyp.common.EnsureDirExists(out_name)\n with open(out_name, 'w') as out:\n out.write('\\n')\n out.write('\\n')\n eclipse_langs = ['C++ Source File', 'C Source File', 'Assembly Source File',\n 'GNU C++', 'GNU C', 'Assembly']\n compiler_path = GetCompilerPath(target_list, data, options)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GenerateClasspathFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GenerateClasspathFile(target_list, target_dicts, toplevel_dir,\n toplevel_build, out_name):\n '''Generates a classpath file suitable for symbol navigation and code\n completion of Java code (such as in Android projects) by finding all\n .java and .jar files used as action inputs.'''\n gyp.common.EnsureDirExists(out_name)\n result = ET.Element('classpath')\n def AddElements(kind, paths):\n # First, we need to normalize the paths so they are all relative to the\n # toplevel dir.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GetJavaJars", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GetJavaJars(target_list, target_dicts, toplevel_dir):\n '''Generates a sequence of all .jars used as inputs.'''\n for target_name in target_list:\n target = target_dicts[target_name]\n for action in target.get('actions', []):\n for input_ in action['inputs']:\n if os.path.splitext(input_)[1] == '.jar' and not input_.startswith('$'):\n if os.path.isabs(input_):\n yield input_\n else:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GetJavaSourceDirs", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir):\n '''Generates a sequence of all likely java package root directories.'''\n for target_name in target_list:\n target = target_dicts[target_name]\n for action in target.get('actions', []):\n for input_ in action['inputs']:\n if (os.path.splitext(input_)[1] == '.java' and\n not input_.startswith('$')):\n dir_ = os.path.dirname(os.path.join(os.path.dirname(target_name),\n input_))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n \"\"\"Generate an XML settings file that can be imported into a CDT project.\"\"\"\n if params['options'].generator_output:\n raise NotImplementedError(\"--generator_output not implemented for eclipse\")\n user_config = params.get('generator_flags', {}).get('config', None)\n if user_config:\n GenerateOutputForConfig(target_list, target_dicts, data, params,\n user_config)\n else:\n config_names = target_dicts[target_list[0]]['configurations'].keys()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "generator_wants_static_library_dependencies_adjusted", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "generator_wants_static_library_dependencies_adjusted = False\ngenerator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'PRODUCT_DIR', 'LIB_DIR', 'SHARED_LIB_DIR']:\n # Some gyp steps fail if these are empty(!), so we convert them to variables\n generator_default_variables[dirname] = '$' + dirname\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',\n 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',\n 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "generator_default_variables = {\n}\nfor dirname in ['INTERMEDIATE_DIR', 'PRODUCT_DIR', 'LIB_DIR', 'SHARED_LIB_DIR']:\n # Some gyp steps fail if these are empty(!), so we convert them to variables\n generator_default_variables[dirname] = '$' + dirname\nfor unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',\n 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',\n 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',\n 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',\n 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "generator_default_variables['SHARED_INTERMEDIATE_DIR']", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "peekOfCode": "generator_default_variables['SHARED_INTERMEDIATE_DIR'] = \\\n '$SHARED_INTERMEDIATE_DIR'\ndef CalculateVariables(default_variables, params):\n generator_flags = params.get('generator_flags', {})\n for key, val in generator_flags.items():\n default_variables.setdefault(key, val)\n flavor = gyp.common.GetFlavor(params)\n default_variables.setdefault('OS', flavor)\n if flavor == 'win':\n # Copy additional generator configuration data from VS, which is shared", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.eclipse", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n output_files = {}\n for qualified_target in target_list:\n [input_file, target] = \\\n gyp.common.ParseQualifiedTarget(qualified_target)[0:2]\n if input_file[-4:] != '.gyp':\n continue\n input_file_stem = input_file[:-4]\n output_file = input_file_stem + params['options'].suffix + '.gypd'\n if not output_file in output_files:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "documentation": {} + }, + { + "label": "_generator_identity_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "peekOfCode": "_generator_identity_variables = [\n 'CONFIGURATION_NAME',\n 'EXECUTABLE_PREFIX',\n 'EXECUTABLE_SUFFIX',\n 'INTERMEDIATE_DIR',\n 'LIB_DIR',\n 'PRODUCT_DIR',\n 'RULE_INPUT_ROOT',\n 'RULE_INPUT_DIRNAME',\n 'RULE_INPUT_EXT',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "peekOfCode": "generator_default_variables = {\n}\n# gypd supports multiple toolsets\ngenerator_supports_multiple_toolsets = True\n# TODO(mark): This always uses <, which isn't right. The input module should\n# notify the generator to tell it which phase it is operating in, and this\n# module should use < for the early phase and then switch to > for the late\n# phase. Bonus points for carrying @ back into the output too.\nfor v in _generator_identity_variables:\n generator_default_variables[v] = '<(%s)' % v", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "peekOfCode": "generator_supports_multiple_toolsets = True\n# TODO(mark): This always uses <, which isn't right. The input module should\n# notify the generator to tell it which phase it is operating in, and this\n# module should use < for the early phase and then switch to > for the late\n# phase. Bonus points for carrying @ back into the output too.\nfor v in _generator_identity_variables:\n generator_default_variables[v] = '<(%s)' % v\ndef GenerateOutput(target_list, target_dicts, data, params):\n output_files = {}\n for qualified_target in target_list:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypd", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n locals = {\n 'target_list': target_list,\n 'target_dicts': target_dicts,\n 'data': data,\n }\n # Use a banner that looks like the stock Python one and like what\n # code.interact uses by default, but tack on something to indicate what\n # locals are available, and identify gypsh.\n banner='Python %s on %s\\nlocals.keys() = %s\\ngypsh' % \\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "documentation": {} + }, + { + "label": "_generator_identity_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "peekOfCode": "_generator_identity_variables = [\n 'EXECUTABLE_PREFIX',\n 'EXECUTABLE_SUFFIX',\n 'INTERMEDIATE_DIR',\n 'PRODUCT_DIR',\n 'RULE_INPUT_ROOT',\n 'RULE_INPUT_DIRNAME',\n 'RULE_INPUT_EXT',\n 'RULE_INPUT_NAME',\n 'RULE_INPUT_PATH',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "peekOfCode": "generator_default_variables = {\n}\nfor v in _generator_identity_variables:\n generator_default_variables[v] = '<(%s)' % v\ndef GenerateOutput(target_list, target_dicts, data, params):\n locals = {\n 'target_list': target_list,\n 'target_dicts': target_dicts,\n 'data': data,\n }", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.gypsh", + "documentation": {} + }, + { + "label": "MakefileWriter", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "class MakefileWriter(object):\n \"\"\"MakefileWriter packages up the writing of one target-specific foobar.mk.\n Its only real entry point is Write(), and is mostly used for namespacing.\n \"\"\"\n def __init__(self, generator_flags, flavor):\n self.generator_flags = generator_flags\n self.flavor = flavor\n self.suffix_rules_srcdir = {}\n self.suffix_rules_objdir1 = {}\n self.suffix_rules_objdir2 = {}", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')\n default_variables.setdefault('SHARED_LIB_DIR',\n generator_default_variables['PRODUCT_DIR'])\n default_variables.setdefault('LIB_DIR',\n generator_default_variables['PRODUCT_DIR'])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "CalculateGeneratorInputInfo", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def CalculateGeneratorInputInfo(params):\n \"\"\"Calculate the generator specific info that gets fed to input (called by\n gyp).\"\"\"\n generator_flags = params.get('generator_flags', {})\n android_ndk_version = generator_flags.get('android_ndk_version', None)\n # Android NDK requires a strict link order.\n if android_ndk_version:\n global generator_wants_sorted_dependencies\n generator_wants_sorted_dependencies = True\n output_dir = params['options'].generator_output or \\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "WriteRootHeaderSuffixRules", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')\n for ext in extensions:\n writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\\n' % ext)\n writer.write('\\t@$(call do_cmd,%s,1)\\n' % COMPILABLE_EXTENSIONS[ext])\n writer.write('\\n# Try building from generated source, too.\\n')\n for ext in extensions:\n writer.write(\n '$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\\n' % ext)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "Compilable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def Compilable(filename):\n \"\"\"Return true if the file is compilable (should be in OBJS).\"\"\"\n for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS):\n if res:\n return True\n return False\ndef Linkable(filename):\n \"\"\"Return true if the file is linkable (should be on the link line).\"\"\"\n return filename.endswith('.o')\ndef Target(filename):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "Linkable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def Linkable(filename):\n \"\"\"Return true if the file is linkable (should be on the link line).\"\"\"\n return filename.endswith('.o')\ndef Target(filename):\n \"\"\"Translate a compilable filename to its .o target.\"\"\"\n return os.path.splitext(filename)[0] + '.o'\ndef EscapeShellArgument(s):\n \"\"\"Quotes an argument so that it will be interpreted literally by a POSIX\n shell. Taken from\n http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "Target", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def Target(filename):\n \"\"\"Translate a compilable filename to its .o target.\"\"\"\n return os.path.splitext(filename)[0] + '.o'\ndef EscapeShellArgument(s):\n \"\"\"Quotes an argument so that it will be interpreted literally by a POSIX\n shell. Taken from\n http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python\n \"\"\"\n return \"'\" + s.replace(\"'\", \"'\\\\''\") + \"'\"\ndef EscapeMakeVariableExpansion(s):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "EscapeShellArgument", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def EscapeShellArgument(s):\n \"\"\"Quotes an argument so that it will be interpreted literally by a POSIX\n shell. Taken from\n http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python\n \"\"\"\n return \"'\" + s.replace(\"'\", \"'\\\\''\") + \"'\"\ndef EscapeMakeVariableExpansion(s):\n \"\"\"Make has its own variable expansion syntax using $. We must escape it for\n string to be interpreted literally.\"\"\"\n return s.replace('$', '$$')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "EscapeMakeVariableExpansion", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def EscapeMakeVariableExpansion(s):\n \"\"\"Make has its own variable expansion syntax using $. We must escape it for\n string to be interpreted literally.\"\"\"\n return s.replace('$', '$$')\ndef EscapeCppDefine(s):\n \"\"\"Escapes a CPP define so that it will reach the compiler unaltered.\"\"\"\n s = EscapeShellArgument(s)\n s = EscapeMakeVariableExpansion(s)\n # '#' characters must be escaped even embedded in a string, else Make will\n # treat it as the start of a comment.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "EscapeCppDefine", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def EscapeCppDefine(s):\n \"\"\"Escapes a CPP define so that it will reach the compiler unaltered.\"\"\"\n s = EscapeShellArgument(s)\n s = EscapeMakeVariableExpansion(s)\n # '#' characters must be escaped even embedded in a string, else Make will\n # treat it as the start of a comment.\n return s.replace('#', r'\\#')\ndef QuoteIfNecessary(string):\n \"\"\"TODO: Should this ideally be replaced with one or more of the above\n functions?\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "QuoteIfNecessary", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def QuoteIfNecessary(string):\n \"\"\"TODO: Should this ideally be replaced with one or more of the above\n functions?\"\"\"\n if '\"' in string:\n string = '\"' + string.replace('\"', '\\\\\"') + '\"'\n return string\ndef StringToMakefileVariable(string):\n \"\"\"Convert a string to a value that is acceptable as a make variable name.\"\"\"\n return re.sub('[^a-zA-Z0-9_]', '_', string)\nsrcdir_prefix = ''", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "StringToMakefileVariable", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def StringToMakefileVariable(string):\n \"\"\"Convert a string to a value that is acceptable as a make variable name.\"\"\"\n return re.sub('[^a-zA-Z0-9_]', '_', string)\nsrcdir_prefix = ''\ndef Sourceify(path):\n \"\"\"Convert a path to its source directory form.\"\"\"\n if '$(' in path:\n return path\n if os.path.isabs(path):\n return path", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "Sourceify", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def Sourceify(path):\n \"\"\"Convert a path to its source directory form.\"\"\"\n if '$(' in path:\n return path\n if os.path.isabs(path):\n return path\n return srcdir_prefix + path\ndef QuoteSpaces(s, quote=r'\\ '):\n return s.replace(' ', quote)\ndef SourceifyAndQuoteSpaces(path):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "QuoteSpaces", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def QuoteSpaces(s, quote=r'\\ '):\n return s.replace(' ', quote)\ndef SourceifyAndQuoteSpaces(path):\n \"\"\"Convert a path to its source directory form and quote spaces.\"\"\"\n return QuoteSpaces(Sourceify(path))\n# TODO: Avoid code duplication with _ValidateSourcesForMSVSProject in msvs.py.\ndef _ValidateSourcesForOSX(spec, all_sources):\n \"\"\"Makes sure if duplicate basenames are not specified in the source list.\n Arguments:\n spec: The target dictionary containing the properties of the target.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SourceifyAndQuoteSpaces", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def SourceifyAndQuoteSpaces(path):\n \"\"\"Convert a path to its source directory form and quote spaces.\"\"\"\n return QuoteSpaces(Sourceify(path))\n# TODO: Avoid code duplication with _ValidateSourcesForMSVSProject in msvs.py.\ndef _ValidateSourcesForOSX(spec, all_sources):\n \"\"\"Makes sure if duplicate basenames are not specified in the source list.\n Arguments:\n spec: The target dictionary containing the properties of the target.\n \"\"\"\n if spec.get('type', None) != 'static_library':", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "WriteAutoRegenerationRule", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def WriteAutoRegenerationRule(params, root_makefile, makefile_name,\n build_files):\n \"\"\"Write the target to regenerate the Makefile.\"\"\"\n options = params['options']\n build_files_args = [gyp.common.RelativePath(filename, options.toplevel_dir)\n for filename in params['build_files_arg']]\n gyp_binary = gyp.common.FixIfRelativePath(params['gyp_binary'],\n options.toplevel_dir)\n if not gyp_binary.startswith(os.sep):\n gyp_binary = os.path.join('.', gyp_binary)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "PerformBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def PerformBuild(data, configurations, params):\n options = params['options']\n for config in configurations:\n arguments = ['make']\n if options.toplevel_dir and options.toplevel_dir != '.':\n arguments += '-C', options.toplevel_dir\n arguments.append('BUILDTYPE=' + config)\n print 'Building [%s]: %s' % (config, arguments)\n subprocess.check_call(arguments)\ndef GenerateOutput(target_list, target_dicts, data, params):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n options = params['options']\n flavor = gyp.common.GetFlavor(params)\n generator_flags = params.get('generator_flags', {})\n builddir_name = generator_flags.get('output_dir', 'out')\n android_ndk_version = generator_flags.get('android_ndk_version', None)\n default_target = generator_flags.get('default_target', 'all')\n def CalculateMakefilePath(build_file, base_name):\n \"\"\"Determine where to write a Makefile for a given gyp file.\"\"\"\n # Paths in gyp files are relative to the .gyp file, but we want", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'SHARED_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'INTERMEDIATE_DIR': '$(obj).$(TOOLSET)/$(TARGET)/geni',\n 'SHARED_INTERMEDIATE_DIR': '$(obj)/gen',\n 'PRODUCT_DIR': '$(builddir)',\n 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', # This gets expanded by Python.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_supports_multiple_toolsets = True\n# Request sorted dependencies in the order from dependents to dependencies.\ngenerator_wants_sorted_dependencies = False\n# Placates pylint.\ngenerator_additional_non_configuration_keys = []\ngenerator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_wants_sorted_dependencies", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_wants_sorted_dependencies = False\n# Placates pylint.\ngenerator_additional_non_configuration_keys = []\ngenerator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_additional_non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_additional_non_configuration_keys = []\ngenerator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_additional_path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')\n default_variables.setdefault('SHARED_LIB_DIR',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_extra_sources_for_rules", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')\n default_variables.setdefault('SHARED_LIB_DIR',\n generator_default_variables['PRODUCT_DIR'])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "generator_filelist_paths", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "generator_filelist_paths = None\ndef CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')\n default_variables.setdefault('SHARED_LIB_DIR',\n generator_default_variables['PRODUCT_DIR'])\n default_variables.setdefault('LIB_DIR',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SPACE_REPLACEMENT", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "SPACE_REPLACEMENT = '?'\nLINK_COMMANDS_LINUX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "LINK_COMMANDS_LINUX", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "LINK_COMMANDS_LINUX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group\n# We support two kinds of shared objects (.so):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group\n# We support two kinds of shared objects (.so):\n# 1) shared_library, which is just bundling together many dependent libraries", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group\n# We support two kinds of shared objects (.so):\n# 1) shared_library, which is just bundling together many dependent libraries\n# into a link line.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group\n# We support two kinds of shared objects (.so):\n# 1) shared_library, which is just bundling together many dependent libraries\n# into a link line.\n# 2) loadable_module, which is generating a module intended for dlopen().", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group\n# We support two kinds of shared objects (.so):\n# 1) shared_library, which is just bundling together many dependent libraries\n# into a link line.\n# 2) loadable_module, which is generating a module intended for dlopen().\n#\n# They differ only slightly:\n# In the former case, we want to package all dependent code into the .so.\n# In the latter case, we want to package just the API exposed by the", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group\n# We support two kinds of shared objects (.so):\n# 1) shared_library, which is just bundling together many dependent libraries\n# into a link line.\n# 2) loadable_module, which is generating a module intended for dlopen().\n#\n# They differ only slightly:\n# In the former case, we want to package all dependent code into the .so.\n# In the latter case, we want to package just the API exposed by the\n# outermost module.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\n\"\"\"\nLINK_COMMANDS_MAC = \"\"\"\\\nquiet_cmd_alink = LIBTOOL-STATIC $@\ncmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\n\"\"\"\nLINK_COMMANDS_MAC = \"\"\"\\\nquiet_cmd_alink = LIBTOOL-STATIC $@\ncmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\n\"\"\"\nLINK_COMMANDS_MAC = \"\"\"\\\nquiet_cmd_alink = LIBTOOL-STATIC $@\ncmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\n\"\"\"\nLINK_COMMANDS_MAC = \"\"\"\\\nquiet_cmd_alink = LIBTOOL-STATIC $@\ncmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "LINK_COMMANDS_MAC", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "LINK_COMMANDS_MAC = \"\"\"\\\nquiet_cmd_alink = LIBTOOL-STATIC $@\ncmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink = LIBTOOL-STATIC $@\ncmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o \"$@\" $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "LINK_COMMANDS_ANDROID", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "LINK_COMMANDS_ANDROID = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\nquiet_cmd_link_host = LINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\nquiet_cmd_link_host = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\nquiet_cmd_link_host = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)\ncmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\nquiet_cmd_link_host = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)\ncmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\n# Other shared-object link notes:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\n# Due to circular dependencies between libraries :(, we wrap the\n# special \"figure out circular dependencies\" flags around the entire\n# input list during linking.\nquiet_cmd_link = LINK($(TOOLSET)) $@\nquiet_cmd_link_host = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)\ncmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\n# Other shared-object link notes:\n# - Set SONAME to the library filename so our binaries don't reference", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_link = LINK($(TOOLSET)) $@\nquiet_cmd_link_host = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)\ncmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\n# Other shared-object link notes:\n# - Set SONAME to the library filename so our binaries don't reference\n# the local, absolute paths used on the link command-line.\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_link_host", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_link_host = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)\ncmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\n# Other shared-object link notes:\n# - Set SONAME to the library filename so our binaries don't reference\n# the local, absolute paths used on the link command-line.\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)\ncmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\n# Other shared-object link notes:\n# - Set SONAME to the library filename so our binaries don't reference\n# the local, absolute paths used on the link command-line.\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\nquiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_link_host", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\n# Other shared-object link notes:\n# - Set SONAME to the library filename so our binaries don't reference\n# the local, absolute paths used on the link command-line.\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\nquiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\nquiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\nquiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\nquiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)\nquiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink_module_host", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink_module_host", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "LINK_COMMANDS_AIX", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "LINK_COMMANDS_AIX = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)\n\"\"\"\nLINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "LINK_COMMANDS_OS390", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "LINK_COMMANDS_OS390 = \"\"\"\\\nquiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink = AR($(TOOLSET)) $@\ncmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)\nquiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_alink_thin = AR($(TOOLSET)) $@\ncmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_alink_thin", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)\nquiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_link = LINK($(TOOLSET)) $@\ncmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.\nSHARED_HEADER = (\"\"\"\\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)\nquiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.\nSHARED_HEADER = (\"\"\"\\\n# We borrow heavily from the kernel build setup, though we are simpler since", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink = SOLINK($(TOOLSET)) $@\ncmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.\nSHARED_HEADER = (\"\"\"\\\n# We borrow heavily from the kernel build setup, though we are simpler since\n# we don't have Kconfig tweaking settings on us.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL\nquiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.\nSHARED_HEADER = (\"\"\"\\\n# We borrow heavily from the kernel build setup, though we are simpler since\n# we don't have Kconfig tweaking settings on us.\n# The implicit make rules have it looking for RCS files, among other things.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@\ncmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.\nSHARED_HEADER = (\"\"\"\\\n# We borrow heavily from the kernel build setup, though we are simpler since\n# we don't have Kconfig tweaking settings on us.\n# The implicit make rules have it looking for RCS files, among other things.\n# We instead explicitly write all the rules we care about.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_solink_module", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL\n\"\"\"\n# Header of toplevel Makefile.\n# This should go into the build tree, but it's easier to keep it here for now.\nSHARED_HEADER = (\"\"\"\\\n# We borrow heavily from the kernel build setup, though we are simpler since\n# we don't have Kconfig tweaking settings on us.\n# The implicit make rules have it looking for RCS files, among other things.\n# We instead explicitly write all the rules we care about.\n# It's even quicker (saves ~200ms) to pass -r on the command line.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SHARED_HEADER", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "SHARED_HEADER = (\"\"\"\\\n# We borrow heavily from the kernel build setup, though we are simpler since\n# we don't have Kconfig tweaking settings on us.\n# The implicit make rules have it looking for RCS files, among other things.\n# We instead explicitly write all the rules we care about.\n# It's even quicker (saves ~200ms) to pass -r on the command line.\nMAKEFLAGS=-r\n# The source directory tree.\nsrcdir := %(srcdir)s\nabs_srcdir := $(abspath $(srcdir))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "replace_spaces", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "replace_spaces = $(subst $(space),\"\"\" + SPACE_REPLACEMENT + \"\"\",$1)\nunreplace_spaces = $(subst \"\"\" + SPACE_REPLACEMENT + \"\"\",$(space),$1)\ndirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))\n# Flags to make gcc output dependency info. Note that you need to be\n# careful here to use the flags that ccache and distcc can understand.\n# We write to a dep file on the side first and then rename at the end\n# so we can't end up with a broken dep file.\ndepfile = $(depsdir)/$(call replace_spaces,$@).d\nDEPFLAGS = %(makedep_args)s -MF $(depfile).raw\n# We have to fixup the deps output in a few ways.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "unreplace_spaces", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "unreplace_spaces = $(subst \"\"\" + SPACE_REPLACEMENT + \"\"\",$(space),$1)\ndirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))\n# Flags to make gcc output dependency info. Note that you need to be\n# careful here to use the flags that ccache and distcc can understand.\n# We write to a dep file on the side first and then rename at the end\n# so we can't end up with a broken dep file.\ndepfile = $(depsdir)/$(call replace_spaces,$@).d\nDEPFLAGS = %(makedep_args)s -MF $(depfile).raw\n# We have to fixup the deps output in a few ways.\n# (1) the file output should mention the proper .o file.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "dirx", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))\n# Flags to make gcc output dependency info. Note that you need to be\n# careful here to use the flags that ccache and distcc can understand.\n# We write to a dep file on the side first and then rename at the end\n# so we can't end up with a broken dep file.\ndepfile = $(depsdir)/$(call replace_spaces,$@).d\nDEPFLAGS = %(makedep_args)s -MF $(depfile).raw\n# We have to fixup the deps output in a few ways.\n# (1) the file output should mention the proper .o file.\n# ccache or distcc lose the path to the target, so we convert a rule of", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "depfile", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "depfile = $(depsdir)/$(call replace_spaces,$@).d\nDEPFLAGS = %(makedep_args)s -MF $(depfile).raw\n# We have to fixup the deps output in a few ways.\n# (1) the file output should mention the proper .o file.\n# ccache or distcc lose the path to the target, so we convert a rule of\n# the form:\n# foobar.o: DEP1 DEP2\n# into\n# path/to/foobar.o: DEP1 DEP2\n# (2) we want missing files not to cause us to fail to build.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "DEPFLAGS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "DEPFLAGS = %(makedep_args)s -MF $(depfile).raw\n# We have to fixup the deps output in a few ways.\n# (1) the file output should mention the proper .o file.\n# ccache or distcc lose the path to the target, so we convert a rule of\n# the form:\n# foobar.o: DEP1 DEP2\n# into\n# path/to/foobar.o: DEP1 DEP2\n# (2) we want missing files not to cause us to fail to build.\n# We want to rewrite", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_cc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_cc = CC($(TOOLSET)) $@\ncmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_cxx = CXX($(TOOLSET)) $@\ncmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\n%(extra_commands)s\nquiet_cmd_touch = TOUCH $@\ncmd_touch = touch $@\nquiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_cc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_cxx = CXX($(TOOLSET)) $@\ncmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\n%(extra_commands)s\nquiet_cmd_touch = TOUCH $@\ncmd_touch = touch $@\nquiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_cxx", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_cxx = CXX($(TOOLSET)) $@\ncmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\n%(extra_commands)s\nquiet_cmd_touch = TOUCH $@\ncmd_touch = touch $@\nquiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s\n\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_cxx", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\n%(extra_commands)s\nquiet_cmd_touch = TOUCH $@\ncmd_touch = touch $@\nquiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s\n\"\"\"\nr\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_touch", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_touch = TOUCH $@\ncmd_touch = touch $@\nquiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s\n\"\"\"\nr\"\"\"\n# Define an escape_quotes function to escape single quotes.\n# This allows us to handle quotes properly as long as we always use", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_touch", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_touch = touch $@\nquiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s\n\"\"\"\nr\"\"\"\n# Define an escape_quotes function to escape single quotes.\n# This allows us to handle quotes properly as long as we always use\n# use single quotes and escape_quotes.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_copy", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_copy = COPY $@\n# send stderr to /dev/null to ignore messages when linking directories.\ncmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s\n\"\"\"\nr\"\"\"\n# Define an escape_quotes function to escape single quotes.\n# This allows us to handle quotes properly as long as we always use\n# use single quotes and escape_quotes.\nescape_quotes = $(subst ','\\'',$(1))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_copy", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_copy = rm -rf \"$@\" && cp %(copy_archive_args)s \"$<\" \"$@\"\n%(link_commands)s\n\"\"\"\nr\"\"\"\n# Define an escape_quotes function to escape single quotes.\n# This allows us to handle quotes properly as long as we always use\n# use single quotes and escape_quotes.\nescape_quotes = $(subst ','\\'',$(1))\n# This comment is here just to include a ' to unconfuse syntax highlighting.\n# Define an escape_vars function to escape '$' variable syntax.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "escape_quotes", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "escape_quotes = $(subst ','\\'',$(1))\n# This comment is here just to include a ' to unconfuse syntax highlighting.\n# Define an escape_vars function to escape '$' variable syntax.\n# This allows us to read/write command lines with shell variables (e.g.\n# $LD_LIBRARY_PATH), without triggering make substitution.\nescape_vars = $(subst $$,$$$$,$(1))\n# Helper that expands to a shell command to echo a string exactly as it is in\n# make. This uses printf instead of echo because printf's behaviour with respect\n# to escape sequences is more portable than echo's across different shells\n# (e.g., dash, bash).", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "escape_vars", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "escape_vars = $(subst $$,$$$$,$(1))\n# Helper that expands to a shell command to echo a string exactly as it is in\n# make. This uses printf instead of echo because printf's behaviour with respect\n# to escape sequences is more portable than echo's across different shells\n# (e.g., dash, bash).\nexact_echo = printf '%%s\\n' '$(call escape_quotes,$(1))'\n\"\"\"\n\"\"\"\n# Helper to compare the command we're about to run against the command\n# we logged the last time we ran the command. Produces an empty", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "exact_echo", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "exact_echo = printf '%%s\\n' '$(call escape_quotes,$(1))'\n\"\"\"\n\"\"\"\n# Helper to compare the command we're about to run against the command\n# we logged the last time we ran the command. Produces an empty\n# string (false) when the commands match.\n# Tricky point: Make has no string-equality test function.\n# The kernel uses the following, but it seems like it would have false\n# positives, where one string reordered its arguments.\n# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\\\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "command_changed", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\\\\n $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))\n# Helper that is non-empty when a prerequisite changes.\n# Normally make does this implicitly, but we force rules to always run\n# so we can check their command lines.\n# $? -- new prerequisites\n# $| -- order-only dependencies\nprereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))\n# Helper that executes all postbuilds until one fails.\ndefine do_postbuilds", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "prereq_changed", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))\n# Helper that executes all postbuilds until one fails.\ndefine do_postbuilds\n @E=0;\\\\\n for p in $(POSTBUILDS); do\\\\\n eval $$p;\\\\\n E=$$?;\\\\\n if [ $$E -ne 0 ]; then\\\\\n break;\\\\\n fi;\\\\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SHARED_HEADER_MAC_COMMANDS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "SHARED_HEADER_MAC_COMMANDS = \"\"\"\nquiet_cmd_objc = CXX($(TOOLSET)) $@\ncmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_objcxx = CXX($(TOOLSET)) $@\ncmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# Commands for precompiled header files.\nquiet_cmd_pch_c = CXX($(TOOLSET)) $@\ncmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_objc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_objc = CXX($(TOOLSET)) $@\ncmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_objcxx = CXX($(TOOLSET)) $@\ncmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# Commands for precompiled header files.\nquiet_cmd_pch_c = CXX($(TOOLSET)) $@\ncmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_objc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_objcxx = CXX($(TOOLSET)) $@\ncmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# Commands for precompiled header files.\nquiet_cmd_pch_c = CXX($(TOOLSET)) $@\ncmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_objcxx", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_objcxx = CXX($(TOOLSET)) $@\ncmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# Commands for precompiled header files.\nquiet_cmd_pch_c = CXX($(TOOLSET)) $@\ncmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_objcxx", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# Commands for precompiled header files.\nquiet_cmd_pch_c = CXX($(TOOLSET)) $@\ncmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_pch_c", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_pch_c = CXX($(TOOLSET)) $@\ncmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_pch_c", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_pch_cc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_pch_cc = CXX($(TOOLSET)) $@\ncmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.\nquiet_cmd_mac_tool = MACTOOL $(4) $<", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_pch_cc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<\nquiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.\nquiet_cmd_mac_tool = MACTOOL $(4) $<\ncmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_pch_m", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_pch_m = CXX($(TOOLSET)) $@\ncmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.\nquiet_cmd_mac_tool = MACTOOL $(4) $<\ncmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"\nquiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_pch_m", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<\nquiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.\nquiet_cmd_mac_tool = MACTOOL $(4) $<\ncmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"\nquiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@\ncmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_pch_mm", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_pch_mm = CXX($(TOOLSET)) $@\ncmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.\nquiet_cmd_mac_tool = MACTOOL $(4) $<\ncmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"\nquiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@\ncmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)\nquiet_cmd_infoplist = INFOPLIST $@", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_pch_mm", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<\n# gyp-mac-tool is written next to the root Makefile by gyp.\n# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd\n# already.\nquiet_cmd_mac_tool = MACTOOL $(4) $<\ncmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"\nquiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@\ncmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)\nquiet_cmd_infoplist = INFOPLIST $@\ncmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_mac_tool", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_mac_tool = MACTOOL $(4) $<\ncmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"\nquiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@\ncmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)\nquiet_cmd_infoplist = INFOPLIST $@\ncmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"\n\"\"\"\ndef WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_mac_tool", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_mac_tool = ./gyp-mac-tool $(4) $< \"$@\"\nquiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@\ncmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)\nquiet_cmd_infoplist = INFOPLIST $@\ncmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"\n\"\"\"\ndef WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')\n for ext in extensions:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_mac_package_framework", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@\ncmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)\nquiet_cmd_infoplist = INFOPLIST $@\ncmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"\n\"\"\"\ndef WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')\n for ext in extensions:\n writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\\n' % ext)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_mac_package_framework", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_mac_package_framework = ./gyp-mac-tool package-framework \"$@\" $(4)\nquiet_cmd_infoplist = INFOPLIST $@\ncmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"\n\"\"\"\ndef WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')\n for ext in extensions:\n writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\\n' % ext)\n writer.write('\\t@$(call do_cmd,%s,1)\\n' % COMPILABLE_EXTENSIONS[ext])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "quiet_cmd_infoplist", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "quiet_cmd_infoplist = INFOPLIST $@\ncmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"\n\"\"\"\ndef WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')\n for ext in extensions:\n writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\\n' % ext)\n writer.write('\\t@$(call do_cmd,%s,1)\\n' % COMPILABLE_EXTENSIONS[ext])\n writer.write('\\n# Try building from generated source, too.\\n')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "cmd_infoplist", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) \"$<\" -o \"$@\"\n\"\"\"\ndef WriteRootHeaderSuffixRules(writer):\n extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower)\n writer.write('# Suffix rules, putting all outputs into $(obj).\\n')\n for ext in extensions:\n writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\\n' % ext)\n writer.write('\\t@$(call do_cmd,%s,1)\\n' % COMPILABLE_EXTENSIONS[ext])\n writer.write('\\n# Try building from generated source, too.\\n')\n for ext in extensions:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SHARED_HEADER_SUFFIX_RULES_COMMENT1", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "SHARED_HEADER_SUFFIX_RULES_COMMENT1 = (\"\"\"\\\n# Suffix rules, putting all outputs into $(obj).\n\"\"\")\nSHARED_HEADER_SUFFIX_RULES_COMMENT2 = (\"\"\"\\\n# Try building from generated source, too.\n\"\"\")\nSHARED_FOOTER = \"\"\"\\\n# \"all\" is a concatenation of the \"all\" targets from all the included\n# sub-makefiles. This is just here to clarify.\nall:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SHARED_HEADER_SUFFIX_RULES_COMMENT2", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "SHARED_HEADER_SUFFIX_RULES_COMMENT2 = (\"\"\"\\\n# Try building from generated source, too.\n\"\"\")\nSHARED_FOOTER = \"\"\"\\\n# \"all\" is a concatenation of the \"all\" targets from all the included\n# sub-makefiles. This is just here to clarify.\nall:\n# Add in dependency-tracking rules. $(all_deps) is the list of every single\n# target in our tree. Only consider the ones with .d (dependency) info:\nd_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "SHARED_FOOTER", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "SHARED_FOOTER = \"\"\"\\\n# \"all\" is a concatenation of the \"all\" targets from all the included\n# sub-makefiles. This is just here to clarify.\nall:\n# Add in dependency-tracking rules. $(all_deps) is the list of every single\n# target in our tree. Only consider the ones with .d (dependency) info:\nd_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))\nifneq ($(d_files),)\n include $(d_files)\nendif", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "header", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "header = \"\"\"\\\n# This file is generated by gyp; do not edit.\n\"\"\"\n# Maps every compilable file extension to the do_cmd that compiles it.\nCOMPILABLE_EXTENSIONS = {\n '.c': 'cc',\n '.cc': 'cxx',\n '.cpp': 'cxx',\n '.cxx': 'cxx',\n '.s': 'cc',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "COMPILABLE_EXTENSIONS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "COMPILABLE_EXTENSIONS = {\n '.c': 'cc',\n '.cc': 'cxx',\n '.cpp': 'cxx',\n '.cxx': 'cxx',\n '.s': 'cc',\n '.S': 'cc',\n}\ndef Compilable(filename):\n \"\"\"Return true if the file is compilable (should be in OBJS).\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "srcdir_prefix", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "srcdir_prefix = ''\ndef Sourceify(path):\n \"\"\"Convert a path to its source directory form.\"\"\"\n if '$(' in path:\n return path\n if os.path.isabs(path):\n return path\n return srcdir_prefix + path\ndef QuoteSpaces(s, quote=r'\\ '):\n return s.replace(' ', quote)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "target_outputs", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "target_outputs = {}\n# Map from qualified target to any linkable output. A subset\n# of target_outputs. E.g. when mybinary depends on liba, we want to\n# include liba in the linker line; when otherbinary depends on\n# mybinary, we just want to build mybinary first.\ntarget_link_deps = {}\nclass MakefileWriter(object):\n \"\"\"MakefileWriter packages up the writing of one target-specific foobar.mk.\n Its only real entry point is Write(), and is mostly used for namespacing.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "target_link_deps", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "peekOfCode": "target_link_deps = {}\nclass MakefileWriter(object):\n \"\"\"MakefileWriter packages up the writing of one target-specific foobar.mk.\n Its only real entry point is Write(), and is mostly used for namespacing.\n \"\"\"\n def __init__(self, generator_flags, flavor):\n self.generator_flags = generator_flags\n self.flavor = flavor\n self.suffix_rules_srcdir = {}\n self.suffix_rules_objdir1 = {}", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.make", + "documentation": {} + }, + { + "label": "MSBuildRule", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "class MSBuildRule(object):\n \"\"\"Used to store information used to generate an MSBuild rule.\n Attributes:\n rule_name: The rule name, sanitized to use in XML.\n target_name: The name of the target.\n after_targets: The name of the AfterTargets element.\n before_targets: The name of the BeforeTargets element.\n depends_on: The name of the DependsOn element.\n compute_output: The name of the ComputeOutput element.\n dirs_to_make: The name of the DirsToMake element.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "def CalculateVariables(default_variables, params):\n \"\"\"Generated variables that require params to be known.\"\"\"\n generator_flags = params.get('generator_flags', {})\n # Select project file format version (if unset, default to auto detecting).\n msvs_version = MSVSVersion.SelectVisualStudioVersion(\n generator_flags.get('msvs_version', 'auto'))\n # Stash msvs_version for later (so we don't have to probe the system twice).\n params['msvs_version'] = msvs_version\n # Set a variable so conditions can be based on msvs_version.\n default_variables['MSVS_VERSION'] = msvs_version.ShortName()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "PerformBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "def PerformBuild(data, configurations, params):\n options = params['options']\n msvs_version = params['msvs_version']\n devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com')\n for build_file, build_file_dict in data.iteritems():\n (build_file_root, build_file_ext) = os.path.splitext(build_file)\n if build_file_ext != '.gyp':\n continue\n sln_path = build_file_root + options.suffix + '.sln'\n if options.generator_output:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n \"\"\"Generate .sln and .vcproj files.\n This is the entry point for this generator.\n Arguments:\n target_list: List of target pairs: 'base/base.gyp:base'.\n target_dicts: Dict of target properties keyed on target pair.\n data: Dictionary containing per .gyp data.\n \"\"\"\n global fixpath_prefix\n options = params['options']", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "OrderedDict", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "OrderedDict = _import_OrderedDict()\n# Regular expression for validating Visual Studio GUIDs. If the GUID\n# contains lowercase hex letters, MSVS will be fine. However,\n# IncrediBuild BuildConsole will parse the solution file, but then\n# silently skip building the target causing hard to track down errors.\n# Note that this only happens with the BuildConsole, and does not occur\n# if IncrediBuild is executed from inside Visual Studio. This regex\n# validates that the string looks like a GUID with all uppercase hex\n# letters.\nVALID_MSVS_GUID_CHARS = re.compile(r'^[A-F0-9\\-]+$')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "VALID_MSVS_GUID_CHARS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "VALID_MSVS_GUID_CHARS = re.compile(r'^[A-F0-9\\-]+$')\ngenerator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '.exe',\n 'STATIC_LIB_PREFIX': '',\n 'SHARED_LIB_PREFIX': '',\n 'STATIC_LIB_SUFFIX': '.lib',\n 'SHARED_LIB_SUFFIX': '.dll',\n 'INTERMEDIATE_DIR': '$(IntDir)',\n 'SHARED_INTERMEDIATE_DIR': '$(OutDir)obj/global_intermediate',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "generator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '.exe',\n 'STATIC_LIB_PREFIX': '',\n 'SHARED_LIB_PREFIX': '',\n 'STATIC_LIB_SUFFIX': '.lib',\n 'SHARED_LIB_SUFFIX': '.dll',\n 'INTERMEDIATE_DIR': '$(IntDir)',\n 'SHARED_INTERMEDIATE_DIR': '$(OutDir)obj/global_intermediate',\n 'OS': 'win',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "generator_additional_path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "generator_additional_path_sections = [\n 'msvs_cygwin_dirs',\n 'msvs_props',\n]\ngenerator_additional_non_configuration_keys = [\n 'msvs_cygwin_dirs',\n 'msvs_cygwin_shell',\n 'msvs_large_pdb',\n 'msvs_shard',\n 'msvs_external_builder',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "generator_additional_non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "generator_additional_non_configuration_keys = [\n 'msvs_cygwin_dirs',\n 'msvs_cygwin_shell',\n 'msvs_large_pdb',\n 'msvs_shard',\n 'msvs_external_builder',\n 'msvs_external_builder_out_dir',\n 'msvs_external_builder_build_cmd',\n 'msvs_external_builder_clean_cmd',\n 'msvs_external_builder_clcompile_cmd',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "precomp_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "precomp_keys = [\n 'msvs_precompiled_header',\n 'msvs_precompiled_source',\n]\ncached_username = None\ncached_domain = None\n# TODO(gspencer): Switch the os.environ calls to be\n# win32api.GetDomainName() and win32api.GetUserName() once the\n# python version in depot_tools has been updated to work on Vista\n# 64-bit.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "cached_username", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "cached_username = None\ncached_domain = None\n# TODO(gspencer): Switch the os.environ calls to be\n# win32api.GetDomainName() and win32api.GetUserName() once the\n# python version in depot_tools has been updated to work on Vista\n# 64-bit.\ndef _GetDomainAndUserName():\n if sys.platform not in ('win32', 'cygwin'):\n return ('DOMAIN', 'USERNAME')\n global cached_username", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "cached_domain", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "cached_domain = None\n# TODO(gspencer): Switch the os.environ calls to be\n# win32api.GetDomainName() and win32api.GetUserName() once the\n# python version in depot_tools has been updated to work on Vista\n# 64-bit.\ndef _GetDomainAndUserName():\n if sys.platform not in ('win32', 'cygwin'):\n return ('DOMAIN', 'USERNAME')\n global cached_username\n global cached_domain", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "fixpath_prefix", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "fixpath_prefix = None\ndef _NormalizedSource(source):\n \"\"\"Normalize the path.\n But not if that gets rid of a variable, as this may expand to something\n larger than one directory.\n Arguments:\n source: The path to be normalize.d\n Returns:\n The normalized path.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "quote_replacer_regex", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "quote_replacer_regex = re.compile(r'(\\\\*)\"')\ndef _EscapeCommandLineArgumentForMSVS(s):\n \"\"\"Escapes a Windows command-line argument.\n So that the Win32 CommandLineToArgv function will turn the escaped result back\n into the original string.\n See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx\n (\"Parsing C++ Command-Line Arguments\") to understand why we have to do\n this.\n Args:\n s: the string to be escaped.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "delimiters_replacer_regex", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "delimiters_replacer_regex = re.compile(r'(\\\\*)([,;]+)')\ndef _EscapeVCProjCommandLineArgListItem(s):\n \"\"\"Escapes command line arguments for MSVS.\n The VCProj format stores string lists in a single string using commas and\n semi-colons as separators, which must be quoted if they are to be\n interpreted literally. However, command-line arguments may already have\n quotes, and the VCProj parser is ignorant of the backslash escaping\n convention used by CommandLineToArgv, so the command-line quotes and the\n VCProj quotes may not be the same quotes. So to store a general\n command-line argument in a VCProj list, we need to parse the existing", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "quote_replacer_regex2", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "quote_replacer_regex2 = re.compile(r'(\\\\+)\"')\ndef _EscapeCommandLineArgumentForMSBuild(s):\n \"\"\"Escapes a Windows command-line argument for use by MSBuild.\"\"\"\n def _Replace(match):\n return (len(match.group(1)) / 2 * 4) * '\\\\' + '\\\\\"'\n # Escape all quotes so that they are interpreted literally.\n s = quote_replacer_regex2.sub(_Replace, s)\n return s\ndef _EscapeMSBuildSpecialCharacters(s):\n escape_dictionary = {", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "MSVS_VARIABLE_REFERENCE", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "peekOfCode": "MSVS_VARIABLE_REFERENCE = re.compile(r'\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)')\ndef _GetMSBuildPropertyGroup(spec, label, properties):\n \"\"\"Returns a PropertyGroup definition for the specified properties.\n Arguments:\n spec: The target project dict.\n label: An optional label for the PropertyGroup.\n properties: The dictionary to be converted. The key is the name of the\n property. The value is itself a dictionary; its key is the value and\n the value a list of condition for which this value is true.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs", + "documentation": {} + }, + { + "label": "TestSequenceFunctions", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs_test", + "peekOfCode": "class TestSequenceFunctions(unittest.TestCase):\n def setUp(self):\n self.stderr = StringIO.StringIO()\n def test_GetLibraries(self):\n self.assertEqual(\n msvs._GetLibraries({}),\n [])\n self.assertEqual(\n msvs._GetLibraries({'libraries': []}),\n [])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.msvs_test", + "documentation": {} + }, + { + "label": "Target", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "class Target(object):\n \"\"\"Target represents the paths used within a single gyp target.\n Conceptually, building a single target A is a series of steps:\n 1) actions/rules/copies generates source/resources/etc.\n 2) compiles generates .o files\n 3) link generates a binary (library/executable)\n 4) bundle merges the above in a mac bundle\n (Any of these steps can be optional.)\n From a build ordering perspective, a dependent target B could just\n depend on the last output of this series of steps.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "NinjaWriter", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "class NinjaWriter(object):\n def __init__(self, hash_for_rules, target_outputs, base_dir, build_dir,\n output_file, toplevel_build, output_file_name, flavor,\n toplevel_dir=None):\n \"\"\"\n base_dir: path from source root to directory containing this gyp file,\n by gyp semantics, all input paths are relative to this\n build_dir: path from source root to build output\n toplevel_dir: path to the toplevel directory\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "StripPrefix", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def StripPrefix(arg, prefix):\n if arg.startswith(prefix):\n return arg[len(prefix):]\n return arg\ndef QuoteShellArgument(arg, flavor):\n \"\"\"Quote a string such that it will be interpreted as a single argument\n by the shell.\"\"\"\n # Rather than attempting to enumerate the bad shell characters, just\n # whitelist common OK ones and quote anything else.\n if re.match(r'^[a-zA-Z0-9_=.\\\\/-]+$', arg):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "QuoteShellArgument", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def QuoteShellArgument(arg, flavor):\n \"\"\"Quote a string such that it will be interpreted as a single argument\n by the shell.\"\"\"\n # Rather than attempting to enumerate the bad shell characters, just\n # whitelist common OK ones and quote anything else.\n if re.match(r'^[a-zA-Z0-9_=.\\\\/-]+$', arg):\n return arg # No quoting necessary.\n if flavor == 'win':\n return gyp.msvs_emulation.QuoteForRspFile(arg)\n return \"'\" + arg.replace(\"'\", \"'\" + '\"\\'\"' + \"'\") + \"'\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "Define", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def Define(d, flavor):\n \"\"\"Takes a preprocessor define and returns a -D parameter that's ninja- and\n shell-escaped.\"\"\"\n if flavor == 'win':\n # cl.exe replaces literal # characters with = in preprocesor definitions for\n # some reason. Octal-encode to work around that.\n d = d.replace('#', '\\\\%03o' % ord('#'))\n return QuoteShellArgument(ninja_syntax.escape('-D' + d), flavor)\ndef AddArch(output, arch):\n \"\"\"Adds an arch string to an output path.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "AddArch", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def AddArch(output, arch):\n \"\"\"Adds an arch string to an output path.\"\"\"\n output, extension = os.path.splitext(output)\n return '%s.%s%s' % (output, arch, extension)\nclass Target(object):\n \"\"\"Target represents the paths used within a single gyp target.\n Conceptually, building a single target A is a series of steps:\n 1) actions/rules/copies generates source/resources/etc.\n 2) compiles generates .o files\n 3) link generates a binary (library/executable)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "CalculateVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def CalculateVariables(default_variables, params):\n \"\"\"Calculate additional variables for use in the build (called by gyp).\"\"\"\n global generator_additional_non_configuration_keys\n global generator_additional_path_sections\n flavor = gyp.common.GetFlavor(params)\n if flavor == 'mac':\n default_variables.setdefault('OS', 'mac')\n default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib')\n default_variables.setdefault('SHARED_LIB_DIR',\n generator_default_variables['PRODUCT_DIR'])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "ComputeOutputDir", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def ComputeOutputDir(params):\n \"\"\"Returns the path from the toplevel_dir to the build output directory.\"\"\"\n # generator_dir: relative path from pwd to where make puts build files.\n # Makes migrating from make to ninja easier, ninja doesn't put anything here.\n generator_dir = os.path.relpath(params['options'].generator_output or '.')\n # output_dir: relative path from generator_dir to the build directory.\n output_dir = params.get('generator_flags', {}).get('output_dir', 'out')\n # Relative path from source root to our output files. e.g. \"out\"\n return os.path.normpath(os.path.join(generator_dir, output_dir))\ndef CalculateGeneratorInputInfo(params):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "CalculateGeneratorInputInfo", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def CalculateGeneratorInputInfo(params):\n \"\"\"Called by __init__ to initialize generator values based on params.\"\"\"\n # E.g. \"out/gypfiles\"\n toplevel = params['options'].toplevel_dir\n qualified_out_dir = os.path.normpath(os.path.join(\n toplevel, ComputeOutputDir(params), 'gypfiles'))\n global generator_filelist_paths\n generator_filelist_paths = {\n 'toplevel': toplevel,\n 'qualified_out_dir': qualified_out_dir,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "OpenOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def OpenOutput(path, mode='w'):\n \"\"\"Open |path| for writing, creating directories if necessary.\"\"\"\n gyp.common.EnsureDirExists(path)\n return open(path, mode)\ndef CommandWithWrapper(cmd, wrappers, prog):\n wrapper = wrappers.get(cmd, '')\n if wrapper:\n return wrapper + ' ' + prog\n return prog\ndef GetDefaultConcurrentLinks():", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "CommandWithWrapper", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def CommandWithWrapper(cmd, wrappers, prog):\n wrapper = wrappers.get(cmd, '')\n if wrapper:\n return wrapper + ' ' + prog\n return prog\ndef GetDefaultConcurrentLinks():\n \"\"\"Returns a best-guess for a number of concurrent links.\"\"\"\n pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0))\n if pool_size:\n return pool_size", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "GetDefaultConcurrentLinks", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def GetDefaultConcurrentLinks():\n \"\"\"Returns a best-guess for a number of concurrent links.\"\"\"\n pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0))\n if pool_size:\n return pool_size\n if sys.platform in ('win32', 'cygwin'):\n import ctypes\n class MEMORYSTATUSEX(ctypes.Structure):\n _fields_ = [\n (\"dwLength\", ctypes.c_ulong),", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "GenerateOutputForConfig", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def GenerateOutputForConfig(target_list, target_dicts, data, params,\n config_name):\n options = params['options']\n flavor = gyp.common.GetFlavor(params)\n generator_flags = params.get('generator_flags', {})\n # build_dir: relative path from source root to our output files.\n # e.g. \"out/Debug\"\n build_dir = os.path.normpath(\n os.path.join(ComputeOutputDir(params), config_name))\n toplevel_build = os.path.join(options.toplevel_dir, build_dir)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "PerformBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def PerformBuild(data, configurations, params):\n options = params['options']\n for config in configurations:\n builddir = os.path.join(options.toplevel_dir, 'out', config)\n arguments = ['ninja', '-C', builddir]\n print 'Building [%s]: %s' % (config, arguments)\n subprocess.check_call(arguments)\ndef CallGenerateOutputForConfig(arglist):\n # Ignore the interrupt signal so that the parent process catches it and\n # kills all multiprocessing children.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "CallGenerateOutputForConfig", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def CallGenerateOutputForConfig(arglist):\n # Ignore the interrupt signal so that the parent process catches it and\n # kills all multiprocessing children.\n signal.signal(signal.SIGINT, signal.SIG_IGN)\n (target_list, target_dicts, data, params, config_name) = arglist\n GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)\ndef GenerateOutput(target_list, target_dicts, data, params):\n # Update target_dicts for iOS device builds.\n target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator(\n target_dicts)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n # Update target_dicts for iOS device builds.\n target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator(\n target_dicts)\n user_config = params.get('generator_flags', {}).get('config', None)\n if gyp.common.GetFlavor(params) == 'win':\n target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts)\n target_list, target_dicts = MSVSUtil.InsertLargePdbShims(\n target_list, target_dicts, generator_default_variables)\n if user_config:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "generator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'SHARED_LIB_PREFIX': 'lib',\n # Gyp expects the following variables to be expandable by the build\n # system to the appropriate locations. Ninja prefers paths to be\n # known at gyp time. To resolve this, introduce special\n # variables starting with $! and $| (which begin with a $ so gyp knows it", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "generator_additional_non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "generator_additional_non_configuration_keys = []\ngenerator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ndef StripPrefix(arg, prefix):\n if arg.startswith(prefix):\n return arg[len(prefix):]\n return arg\ndef QuoteShellArgument(arg, flavor):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "generator_additional_path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "generator_additional_path_sections = []\ngenerator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ndef StripPrefix(arg, prefix):\n if arg.startswith(prefix):\n return arg[len(prefix):]\n return arg\ndef QuoteShellArgument(arg, flavor):\n \"\"\"Quote a string such that it will be interpreted as a single argument", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "generator_extra_sources_for_rules", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "generator_extra_sources_for_rules = []\ngenerator_filelist_paths = None\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ndef StripPrefix(arg, prefix):\n if arg.startswith(prefix):\n return arg[len(prefix):]\n return arg\ndef QuoteShellArgument(arg, flavor):\n \"\"\"Quote a string such that it will be interpreted as a single argument\n by the shell.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "generator_filelist_paths", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "generator_filelist_paths = None\ngenerator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ndef StripPrefix(arg, prefix):\n if arg.startswith(prefix):\n return arg[len(prefix):]\n return arg\ndef QuoteShellArgument(arg, flavor):\n \"\"\"Quote a string such that it will be interpreted as a single argument\n by the shell.\"\"\"\n # Rather than attempting to enumerate the bad shell characters, just", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "generator_supports_multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "peekOfCode": "generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()\ndef StripPrefix(arg, prefix):\n if arg.startswith(prefix):\n return arg[len(prefix):]\n return arg\ndef QuoteShellArgument(arg, flavor):\n \"\"\"Quote a string such that it will be interpreted as a single argument\n by the shell.\"\"\"\n # Rather than attempting to enumerate the bad shell characters, just\n # whitelist common OK ones and quote anything else.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja", + "documentation": {} + }, + { + "label": "TestPrefixesAndSuffixes", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja_test", + "peekOfCode": "class TestPrefixesAndSuffixes(unittest.TestCase):\n def test_BinaryNamesWindows(self):\n # These cannot run on non-Windows as they require a VS installation to\n # correctly handle variable expansion.\n if sys.platform.startswith('win'):\n writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.',\n 'build.ninja', 'win')\n spec = { 'target_name': 'wee' }\n self.assertTrue(writer.ComputeOutputFileName(spec, 'executable').\n endswith('.exe'))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.ninja_test", + "documentation": {} + }, + { + "label": "XcodeProject", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "class XcodeProject(object):\n def __init__(self, gyp_path, path, build_file_dict):\n self.gyp_path = gyp_path\n self.path = path\n self.project = gyp.xcodeproj_file.PBXProject(path=path)\n projectDirPath = gyp.common.RelativePath(\n os.path.dirname(os.path.abspath(self.gyp_path)),\n os.path.dirname(path) or '.')\n self.project.SetProperty('projectDirPath', projectDirPath)\n self.project_file = \\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "CreateXCConfigurationList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def CreateXCConfigurationList(configuration_names):\n xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []})\n if len(configuration_names) == 0:\n configuration_names = ['Default']\n for configuration_name in configuration_names:\n xcbc = gyp.xcodeproj_file.XCBuildConfiguration({\n 'name': configuration_name})\n xccl.AppendProperty('buildConfigurations', xcbc)\n xccl.SetProperty('defaultConfigurationName', configuration_names[0])\n return xccl", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "AddSourceToTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def AddSourceToTarget(source, type, pbxp, xct):\n # TODO(mark): Perhaps source_extensions and library_extensions can be made a\n # little bit fancier.\n source_extensions = ['c', 'cc', 'cpp', 'cxx', 'm', 'mm', 's', 'swift']\n # .o is conceptually more of a \"source\" than a \"library,\" but Xcode thinks\n # of \"sources\" as things to compile and \"libraries\" (or \"frameworks\") as\n # things to link with. Adding an object file to an Xcode target's frameworks\n # phase works properly.\n library_extensions = ['a', 'dylib', 'framework', 'o']\n basename = posixpath.basename(source)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "AddResourceToTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def AddResourceToTarget(resource, pbxp, xct):\n # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call\n # where it's used.\n xct.ResourcesPhase().AddFile(resource)\ndef AddHeaderToTarget(header, pbxp, xct, is_public):\n # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call\n # where it's used.\n settings = '{ATTRIBUTES = (%s, ); }' % ('Private', 'Public')[is_public]\n xct.HeadersPhase().AddFile(header, settings)\n_xcode_variable_re = re.compile(r'(\\$\\((.*?)\\))')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "AddHeaderToTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def AddHeaderToTarget(header, pbxp, xct, is_public):\n # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call\n # where it's used.\n settings = '{ATTRIBUTES = (%s, ); }' % ('Private', 'Public')[is_public]\n xct.HeadersPhase().AddFile(header, settings)\n_xcode_variable_re = re.compile(r'(\\$\\((.*?)\\))')\ndef ExpandXcodeVariables(string, expansions):\n \"\"\"Expands Xcode-style $(VARIABLES) in string per the expansions dict.\n In some rare cases, it is appropriate to expand Xcode variables when a\n project file is generated. For any substring $(VAR) in string, if VAR is a", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "ExpandXcodeVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def ExpandXcodeVariables(string, expansions):\n \"\"\"Expands Xcode-style $(VARIABLES) in string per the expansions dict.\n In some rare cases, it is appropriate to expand Xcode variables when a\n project file is generated. For any substring $(VAR) in string, if VAR is a\n key in the expansions dict, $(VAR) will be replaced with expansions[VAR].\n Any $(VAR) substring in string for which VAR is not a key in the expansions\n dict will remain in the returned string.\n \"\"\"\n matches = _xcode_variable_re.findall(string)\n if matches == None:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "EscapeXcodeDefine", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def EscapeXcodeDefine(s):\n \"\"\"We must escape the defines that we give to XCode so that it knows not to\n split on spaces and to respect backslash and quote literals. However, we\n must not quote the define, or Xcode will incorrectly intepret variables\n especially $(inherited).\"\"\"\n return re.sub(_xcode_define_re, r'\\\\\\1', s)\ndef PerformBuild(data, configurations, params):\n options = params['options']\n for build_file, build_file_dict in data.iteritems():\n (build_file_root, build_file_ext) = os.path.splitext(build_file)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "PerformBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def PerformBuild(data, configurations, params):\n options = params['options']\n for build_file, build_file_dict in data.iteritems():\n (build_file_root, build_file_ext) = os.path.splitext(build_file)\n if build_file_ext != '.gyp':\n continue\n xcodeproj_path = build_file_root + options.suffix + '.xcodeproj'\n if options.generator_output:\n xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path)\n for config in configurations:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "CalculateGeneratorInputInfo", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def CalculateGeneratorInputInfo(params):\n toplevel = params['options'].toplevel_dir\n if params.get('flavor') == 'ninja':\n generator_dir = os.path.relpath(params['options'].generator_output or '.')\n output_dir = params.get('generator_flags', {}).get('output_dir', 'out')\n output_dir = os.path.normpath(os.path.join(generator_dir, output_dir))\n qualified_out_dir = os.path.normpath(os.path.join(\n toplevel, output_dir, 'gypfiles-xcode-ninja'))\n else:\n output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild'))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "GenerateOutput", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "def GenerateOutput(target_list, target_dicts, data, params):\n # Optionally configure each spec to use ninja as the external builder.\n ninja_wrapper = params.get('flavor') == 'ninja'\n if ninja_wrapper:\n (target_list, target_dicts, data) = \\\n gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params)\n options = params['options']\n generator_flags = params.get('generator_flags', {})\n parallel_builds = generator_flags.get('xcode_parallel_builds', True)\n serialize_all_tests = \\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "_intermediate_var", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "_intermediate_var = 'INTERMEDIATE_DIR'\n# SHARED_INTERMEDIATE_DIR is the same, except that it is shared among all\n# targets that share the same BUILT_PRODUCTS_DIR.\n_shared_intermediate_var = 'SHARED_INTERMEDIATE_DIR'\n_library_search_paths_var = 'LIBRARY_SEARCH_PATHS'\ngenerator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'SHARED_LIB_PREFIX': 'lib',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "_shared_intermediate_var", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "_shared_intermediate_var = 'SHARED_INTERMEDIATE_DIR'\n_library_search_paths_var = 'LIBRARY_SEARCH_PATHS'\ngenerator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'SHARED_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'SHARED_LIB_SUFFIX': '.dylib',\n # INTERMEDIATE_DIR is a place for targets to build up intermediate products.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "_library_search_paths_var", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "_library_search_paths_var = 'LIBRARY_SEARCH_PATHS'\ngenerator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'SHARED_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'SHARED_LIB_SUFFIX': '.dylib',\n # INTERMEDIATE_DIR is a place for targets to build up intermediate products.\n # It is specific to each build environment. It is only guaranteed to exist", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "generator_default_variables", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "generator_default_variables = {\n 'EXECUTABLE_PREFIX': '',\n 'EXECUTABLE_SUFFIX': '',\n 'STATIC_LIB_PREFIX': 'lib',\n 'SHARED_LIB_PREFIX': 'lib',\n 'STATIC_LIB_SUFFIX': '.a',\n 'SHARED_LIB_SUFFIX': '.dylib',\n # INTERMEDIATE_DIR is a place for targets to build up intermediate products.\n # It is specific to each build environment. It is only guaranteed to exist\n # and be constant within the context of a project, corresponding to a single", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "generator_additional_path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "generator_additional_path_sections = [\n 'mac_bundle_resources',\n 'mac_framework_headers',\n 'mac_framework_private_headers',\n # 'mac_framework_dirs', input already handles _dirs endings.\n]\n# The Xcode-specific keys that exist on targets and aren't moved down to\n# configurations.\ngenerator_additional_non_configuration_keys = [\n 'ios_app_extension',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "generator_additional_non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "generator_additional_non_configuration_keys = [\n 'ios_app_extension',\n 'ios_watch_app',\n 'ios_watchkit_extension',\n 'mac_bundle',\n 'mac_bundle_resources',\n 'mac_framework_headers',\n 'mac_framework_private_headers',\n 'mac_xctest_bundle',\n 'xcode_create_dependents_test_runner',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "generator_extra_sources_for_rules", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "generator_extra_sources_for_rules = [\n 'mac_bundle_resources',\n 'mac_framework_headers',\n 'mac_framework_private_headers',\n]\ngenerator_filelist_paths = None\n# Xcode's standard set of library directories, which don't need to be duplicated\n# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay.\nxcode_standard_library_dirs = frozenset([\n '$(SDKROOT)/usr/lib',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "generator_filelist_paths", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "generator_filelist_paths = None\n# Xcode's standard set of library directories, which don't need to be duplicated\n# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay.\nxcode_standard_library_dirs = frozenset([\n '$(SDKROOT)/usr/lib',\n '$(SDKROOT)/usr/local/lib',\n])\ndef CreateXCConfigurationList(configuration_names):\n xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []})\n if len(configuration_names) == 0:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "xcode_standard_library_dirs", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "xcode_standard_library_dirs = frozenset([\n '$(SDKROOT)/usr/lib',\n '$(SDKROOT)/usr/local/lib',\n])\ndef CreateXCConfigurationList(configuration_names):\n xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []})\n if len(configuration_names) == 0:\n configuration_names = ['Default']\n for configuration_name in configuration_names:\n xcbc = gyp.xcodeproj_file.XCBuildConfiguration({", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "file", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "file = open('$TMPDIR/GYP_serialize_test_runs', 'a')\nfcntl.flock(file.fileno(), fcntl.LOCK_EX)\nsys.exit(subprocess.call(sys.argv[1:]))\" \"\"\"\n # If we were unable to exec for some reason, we want to exit\n # with an error, and fixup variable references to be shell\n # syntax instead of xcode syntax.\n script = script + 'exec ' + command_prefix + '%s\\nexit 1\\n' % \\\n gyp.xcodeproj_file.ConvertVariablesToShellSyntax(\n gyp.common.EncodePOSIXShellList(command.get('action')))\n ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "_xcode_variable_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "_xcode_variable_re = re.compile(r'(\\$\\((.*?)\\))')\ndef ExpandXcodeVariables(string, expansions):\n \"\"\"Expands Xcode-style $(VARIABLES) in string per the expansions dict.\n In some rare cases, it is appropriate to expand Xcode variables when a\n project file is generated. For any substring $(VAR) in string, if VAR is a\n key in the expansions dict, $(VAR) will be replaced with expansions[VAR].\n Any $(VAR) substring in string for which VAR is not a key in the expansions\n dict will remain in the returned string.\n \"\"\"\n matches = _xcode_variable_re.findall(string)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "_xcode_define_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "peekOfCode": "_xcode_define_re = re.compile(r'([\\\\\\\"\\' ])')\ndef EscapeXcodeDefine(s):\n \"\"\"We must escape the defines that we give to XCode so that it knows not to\n split on spaces and to respect backslash and quote literals. However, we\n must not quote the define, or Xcode will incorrectly intepret variables\n especially $(inherited).\"\"\"\n return re.sub(_xcode_define_re, r'\\\\\\1', s)\ndef PerformBuild(data, configurations, params):\n options = params['options']\n for build_file, build_file_dict in data.iteritems():", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode", + "documentation": {} + }, + { + "label": "TestEscapeXcodeDefine", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode_test", + "peekOfCode": "class TestEscapeXcodeDefine(unittest.TestCase):\n if sys.platform == 'darwin':\n def test_InheritedRemainsUnescaped(self):\n self.assertEqual(xcode.EscapeXcodeDefine('$(inherited)'), '$(inherited)')\n def test_Escaping(self):\n self.assertEqual(xcode.EscapeXcodeDefine('a b\"c\\\\'), 'a\\\\ b\\\\\"c\\\\\\\\')\nif __name__ == '__main__':\n unittest.main()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.generator.xcode_test", + "documentation": {} + }, + { + "label": "MSVSSolutionEntry", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "peekOfCode": "class MSVSSolutionEntry(object):\n def __cmp__(self, other):\n # Sort by name then guid (so things are in order on vs2008).\n return cmp((self.name, self.get_guid()), (other.name, other.get_guid()))\nclass MSVSFolder(MSVSSolutionEntry):\n \"\"\"Folder in a Visual Studio project or solution.\"\"\"\n def __init__(self, path, name = None, entries = None,\n guid = None, items = None):\n \"\"\"Initializes the folder.\n Args:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "documentation": {} + }, + { + "label": "MSVSFolder", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "peekOfCode": "class MSVSFolder(MSVSSolutionEntry):\n \"\"\"Folder in a Visual Studio project or solution.\"\"\"\n def __init__(self, path, name = None, entries = None,\n guid = None, items = None):\n \"\"\"Initializes the folder.\n Args:\n path: Full path to the folder.\n name: Name of the folder.\n entries: List of folder entries to nest inside this folder. May contain\n Folder or Project objects. May be None, if the folder is empty.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "documentation": {} + }, + { + "label": "MSVSProject", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "peekOfCode": "class MSVSProject(MSVSSolutionEntry):\n \"\"\"Visual Studio project.\"\"\"\n def __init__(self, path, name = None, dependencies = None, guid = None,\n spec = None, build_file = None, config_platform_overrides = None,\n fixpath_prefix = None):\n \"\"\"Initializes the project.\n Args:\n path: Absolute path to the project file.\n name: Name of project. If None, the name will be the same as the base\n name of the project file.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "documentation": {} + }, + { + "label": "MSVSSolution", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "peekOfCode": "class MSVSSolution(object):\n \"\"\"Visual Studio solution.\"\"\"\n def __init__(self, path, version, entries=None, variants=None,\n websiteProperties=True):\n \"\"\"Initializes the solution.\n Args:\n path: Path to solution file.\n version: Format version to emit.\n entries: List of entries in solution. May contain Folder or Project\n objects. May be None, if the folder is empty.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "documentation": {} + }, + { + "label": "MakeGuid", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "peekOfCode": "def MakeGuid(name, seed='msvs_new'):\n \"\"\"Returns a GUID for the specified target name.\n Args:\n name: Target name.\n seed: Seed for MD5 hash.\n Returns:\n A GUID-line string calculated from the name and seed.\n This generates something which looks like a GUID, but depends only on the\n name and seed. This means the same name/seed will always generate the same\n GUID, so that projects and solutions which refer to each other can explicitly", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "documentation": {} + }, + { + "label": "ENTRY_TYPE_GUIDS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "peekOfCode": "ENTRY_TYPE_GUIDS = {\n 'project': '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}',\n 'folder': '{2150E333-8FDC-42A3-9474-1A3956D46DE8}',\n}\n#------------------------------------------------------------------------------\n# Helper functions\ndef MakeGuid(name, seed='msvs_new'):\n \"\"\"Returns a GUID for the specified target name.\n Args:\n name: Target name.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSNew", + "documentation": {} + }, + { + "label": "Tool", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "peekOfCode": "class Tool(object):\n \"\"\"Visual Studio tool.\"\"\"\n def __init__(self, name, attrs=None):\n \"\"\"Initializes the tool.\n Args:\n name: Tool name.\n attrs: Dict of tool attributes; may be None.\n \"\"\"\n self._attrs = attrs or {}\n self._attrs['Name'] = name", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "documentation": {} + }, + { + "label": "Filter", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "peekOfCode": "class Filter(object):\n \"\"\"Visual Studio filter - that is, a virtual folder.\"\"\"\n def __init__(self, name, contents=None):\n \"\"\"Initializes the folder.\n Args:\n name: Filter (folder) name.\n contents: List of filenames and/or Filter objects contained.\n \"\"\"\n self.name = name\n self.contents = list(contents or [])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "documentation": {} + }, + { + "label": "Writer", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "peekOfCode": "class Writer(object):\n \"\"\"Visual Studio XML project writer.\"\"\"\n def __init__(self, project_path, version, name, guid=None, platforms=None):\n \"\"\"Initializes the project.\n Args:\n project_path: Path to the project file.\n version: Format version to emit.\n name: Name of the project.\n guid: GUID to use for project, if not None.\n platforms: Array of string, the supported platforms. If null, ['Win32']", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSProject", + "documentation": {} + }, + { + "label": "_Tool", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _Tool(object):\n \"\"\"Represents a tool used by MSVS or MSBuild.\n Attributes:\n msvs_name: The name of the tool in MSVS.\n msbuild_name: The name of the tool in MSBuild.\n \"\"\"\n def __init__(self, msvs_name, msbuild_name):\n self.msvs_name = msvs_name\n self.msbuild_name = msbuild_name\ndef _AddTool(tool):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_Type", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _Type(object):\n \"\"\"Type of settings (Base class).\"\"\"\n def ValidateMSVS(self, value):\n \"\"\"Verifies that the value is legal for MSVS.\n Args:\n value: the value to check for this type.\n Raises:\n ValueError if value is not valid for MSVS.\n \"\"\"\n def ValidateMSBuild(self, value):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_String", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _String(_Type):\n \"\"\"A setting that's just a string.\"\"\"\n def ValidateMSVS(self, value):\n if not isinstance(value, basestring):\n raise ValueError('expected string; got %r' % value)\n def ValidateMSBuild(self, value):\n if not isinstance(value, basestring):\n raise ValueError('expected string; got %r' % value)\n def ConvertToMSBuild(self, value):\n # Convert the macros", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_StringList", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _StringList(_Type):\n \"\"\"A settings that's a list of strings.\"\"\"\n def ValidateMSVS(self, value):\n if not isinstance(value, basestring) and not isinstance(value, list):\n raise ValueError('expected string list; got %r' % value)\n def ValidateMSBuild(self, value):\n if not isinstance(value, basestring) and not isinstance(value, list):\n raise ValueError('expected string list; got %r' % value)\n def ConvertToMSBuild(self, value):\n # Convert the macros", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_Boolean", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _Boolean(_Type):\n \"\"\"Boolean settings, can have the values 'false' or 'true'.\"\"\"\n def _Validate(self, value):\n if value != 'true' and value != 'false':\n raise ValueError('expected bool; got %r' % value)\n def ValidateMSVS(self, value):\n self._Validate(value)\n def ValidateMSBuild(self, value):\n self._Validate(value)\n def ConvertToMSBuild(self, value):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_Integer", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _Integer(_Type):\n \"\"\"Integer settings.\"\"\"\n def __init__(self, msbuild_base=10):\n _Type.__init__(self)\n self._msbuild_base = msbuild_base\n def ValidateMSVS(self, value):\n # Try to convert, this will raise ValueError if invalid.\n self.ConvertToMSBuild(value)\n def ValidateMSBuild(self, value):\n # Try to convert, this will raise ValueError if invalid.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_Enumeration", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "class _Enumeration(_Type):\n \"\"\"Type of settings that is an enumeration.\n In MSVS, the values are indexes like '0', '1', and '2'.\n MSBuild uses text labels that are more representative, like 'Win32'.\n Constructor args:\n label_list: an array of MSBuild labels that correspond to the MSVS index.\n In the rare cases where MSVS has skipped an index value, None is\n used in the array to indicate the unused spot.\n new: an array of labels that are new to MSBuild.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "FixVCMacroSlashes", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "def FixVCMacroSlashes(s):\n \"\"\"Replace macros which have excessive following slashes.\n These macros are known to have a built-in trailing slash. Furthermore, many\n scripts hiccup on processing paths with extra slashes in the middle.\n This list is probably not exhaustive. Add as needed.\n \"\"\"\n if '$' in s:\n s = fix_vc_macro_slashes_regex.sub(r'\\1', s)\n return s\ndef ConvertVCMacrosToMSBuild(s):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "ConvertVCMacrosToMSBuild", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "def ConvertVCMacrosToMSBuild(s):\n \"\"\"Convert the MSVS macros found in the string to the MSBuild equivalent.\n This list is probably not exhaustive. Add as needed.\n \"\"\"\n if '$' in s:\n replace_map = {\n '$(ConfigurationName)': '$(Configuration)',\n '$(InputDir)': '%(RelativeDir)',\n '$(InputExt)': '%(Extension)',\n '$(InputFileName)': '%(Filename)%(Extension)',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "ConvertToMSBuildSettings", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr):\n \"\"\"Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+).\n Args:\n msvs_settings: A dictionary. The key is the tool name. The values are\n themselves dictionaries of settings and their values.\n stderr: The stream receiving the error messages.\n Returns:\n A dictionary of MSBuild settings. The key is either the MSBuild tool name\n or the empty string (for the global settings). The values are themselves\n dictionaries of settings and their values.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "ValidateMSVSSettings", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "def ValidateMSVSSettings(settings, stderr=sys.stderr):\n \"\"\"Validates that the names of the settings are valid for MSVS.\n Args:\n settings: A dictionary. The key is the tool name. The values are\n themselves dictionaries of settings and their values.\n stderr: The stream receiving the error messages.\n \"\"\"\n _ValidateSettings(_msvs_validators, settings, stderr)\ndef ValidateMSBuildSettings(settings, stderr=sys.stderr):\n \"\"\"Validates that the names of the settings are valid for MSBuild.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "ValidateMSBuildSettings", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "def ValidateMSBuildSettings(settings, stderr=sys.stderr):\n \"\"\"Validates that the names of the settings are valid for MSBuild.\n Args:\n settings: A dictionary. The key is the tool name. The values are\n themselves dictionaries of settings and their values.\n stderr: The stream receiving the error messages.\n \"\"\"\n _ValidateSettings(_msbuild_validators, settings, stderr)\ndef _ValidateSettings(validators, settings, stderr):\n \"\"\"Validates that the settings are valid for MSBuild or MSVS.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msvs_validators", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msvs_validators = {}\n_msbuild_validators = {}\n# A dictionary of settings converters. The key is the tool name, the value is\n# a dictionary mapping setting names to conversion functions.\n_msvs_to_msbuild_converters = {}\n# Tool name mapping from MSVS to MSBuild.\n_msbuild_name_of_tool = {}\nclass _Tool(object):\n \"\"\"Represents a tool used by MSVS or MSBuild.\n Attributes:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msbuild_validators", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msbuild_validators = {}\n# A dictionary of settings converters. The key is the tool name, the value is\n# a dictionary mapping setting names to conversion functions.\n_msvs_to_msbuild_converters = {}\n# Tool name mapping from MSVS to MSBuild.\n_msbuild_name_of_tool = {}\nclass _Tool(object):\n \"\"\"Represents a tool used by MSVS or MSBuild.\n Attributes:\n msvs_name: The name of the tool in MSVS.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msvs_to_msbuild_converters", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msvs_to_msbuild_converters = {}\n# Tool name mapping from MSVS to MSBuild.\n_msbuild_name_of_tool = {}\nclass _Tool(object):\n \"\"\"Represents a tool used by MSVS or MSBuild.\n Attributes:\n msvs_name: The name of the tool in MSVS.\n msbuild_name: The name of the tool in MSBuild.\n \"\"\"\n def __init__(self, msvs_name, msbuild_name):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msbuild_name_of_tool", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msbuild_name_of_tool = {}\nclass _Tool(object):\n \"\"\"Represents a tool used by MSVS or MSBuild.\n Attributes:\n msvs_name: The name of the tool in MSVS.\n msbuild_name: The name of the tool in MSBuild.\n \"\"\"\n def __init__(self, msvs_name, msbuild_name):\n self.msvs_name = msvs_name\n self.msbuild_name = msbuild_name", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_boolean", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_boolean = _Boolean()\n_integer = _Integer()\n# For now, we don't do any special validation on these types:\n_string = _String()\n_file_name = _String()\n_folder_name = _String()\n_file_list = _StringList()\n_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_integer", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_integer = _Integer()\n# For now, we don't do any special validation on these types:\n_string = _String()\n_file_name = _String()\n_folder_name = _String()\n_file_list = _StringList()\n_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_string", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_string = _String()\n_file_name = _String()\n_folder_name = _String()\n_file_list = _StringList()\n_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.\n_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_file_name", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_file_name = _String()\n_folder_name = _String()\n_file_list = _StringList()\n_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.\n_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):\n \"\"\"Defines a setting that has the same name in MSVS and MSBuild.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_folder_name", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_folder_name = _String()\n_file_list = _StringList()\n_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.\n_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):\n \"\"\"Defines a setting that has the same name in MSVS and MSBuild.\n Args:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_file_list", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_file_list = _StringList()\n_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.\n_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):\n \"\"\"Defines a setting that has the same name in MSVS and MSBuild.\n Args:\n tool: a dictionary that gives the names of the tool for MSVS and MSBuild.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_folder_list", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_folder_list = _StringList()\n_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.\n_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):\n \"\"\"Defines a setting that has the same name in MSVS and MSBuild.\n Args:\n tool: a dictionary that gives the names of the tool for MSVS and MSBuild.\n name: the name of the setting.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_string_list", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_string_list = _StringList()\n# Some boolean settings went from numerical values to boolean. The\n# mapping is 0: default, 1: false, 2: true.\n_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):\n \"\"\"Defines a setting that has the same name in MSVS and MSBuild.\n Args:\n tool: a dictionary that gives the names of the tool for MSVS and MSBuild.\n name: the name of the setting.\n setting_type: the type of this setting.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_newly_boolean", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_newly_boolean = _Enumeration(['', 'false', 'true'])\ndef _Same(tool, name, setting_type):\n \"\"\"Defines a setting that has the same name in MSVS and MSBuild.\n Args:\n tool: a dictionary that gives the names of the tool for MSVS and MSBuild.\n name: the name of the setting.\n setting_type: the type of this setting.\n \"\"\"\n _Renamed(tool, name, name, setting_type)\ndef _Renamed(tool, msvs_name, msbuild_name, setting_type):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "fix_vc_macro_slashes_regex_list", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "fix_vc_macro_slashes_regex_list = ('IntDir', 'OutDir')\nfix_vc_macro_slashes_regex = re.compile(\n r'(\\$\\((?:%s)\\))(?:[\\\\/]+)' % \"|\".join(fix_vc_macro_slashes_regex_list)\n)\n# Regular expression to detect keys that were generated by exclusion lists\n_EXCLUDED_SUFFIX_RE = re.compile('^(.*)_excluded$')\ndef _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr):\n \"\"\"Verify that 'setting' is valid if it is generated from an exclusion list.\n If the setting appears to be generated from an exclusion list, the root name\n is checked.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "fix_vc_macro_slashes_regex", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "fix_vc_macro_slashes_regex = re.compile(\n r'(\\$\\((?:%s)\\))(?:[\\\\/]+)' % \"|\".join(fix_vc_macro_slashes_regex_list)\n)\n# Regular expression to detect keys that were generated by exclusion lists\n_EXCLUDED_SUFFIX_RE = re.compile('^(.*)_excluded$')\ndef _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr):\n \"\"\"Verify that 'setting' is valid if it is generated from an exclusion list.\n If the setting appears to be generated from an exclusion list, the root name\n is checked.\n Args:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_EXCLUDED_SUFFIX_RE", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_EXCLUDED_SUFFIX_RE = re.compile('^(.*)_excluded$')\ndef _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr):\n \"\"\"Verify that 'setting' is valid if it is generated from an exclusion list.\n If the setting appears to be generated from an exclusion list, the root name\n is checked.\n Args:\n setting: A string that is the setting name to validate\n settings: A dictionary where the keys are valid settings\n error_msg: The message to emit in the event of error\n stderr: The stream receiving the error messages.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_compile", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_compile = _Tool('VCCLCompilerTool', 'ClCompile')\n_link = _Tool('VCLinkerTool', 'Link')\n_midl = _Tool('VCMIDLTool', 'Midl')\n_rc = _Tool('VCResourceCompilerTool', 'ResourceCompile')\n_lib = _Tool('VCLibrarianTool', 'Lib')\n_manifest = _Tool('VCManifestTool', 'Manifest')\n_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_link", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_link = _Tool('VCLinkerTool', 'Link')\n_midl = _Tool('VCMIDLTool', 'Midl')\n_rc = _Tool('VCResourceCompilerTool', 'ResourceCompile')\n_lib = _Tool('VCLibrarianTool', 'Lib')\n_manifest = _Tool('VCManifestTool', 'Manifest')\n_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)\n_AddTool(_rc)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_midl", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_midl = _Tool('VCMIDLTool', 'Midl')\n_rc = _Tool('VCResourceCompilerTool', 'ResourceCompile')\n_lib = _Tool('VCLibrarianTool', 'Lib')\n_manifest = _Tool('VCManifestTool', 'Manifest')\n_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)\n_AddTool(_rc)\n_AddTool(_lib)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_rc", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_rc = _Tool('VCResourceCompilerTool', 'ResourceCompile')\n_lib = _Tool('VCLibrarianTool', 'Lib')\n_manifest = _Tool('VCManifestTool', 'Manifest')\n_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)\n_AddTool(_rc)\n_AddTool(_lib)\n_AddTool(_manifest)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_lib", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_lib = _Tool('VCLibrarianTool', 'Lib')\n_manifest = _Tool('VCManifestTool', 'Manifest')\n_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)\n_AddTool(_rc)\n_AddTool(_lib)\n_AddTool(_manifest)\n_AddTool(_masm)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_manifest", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_manifest = _Tool('VCManifestTool', 'Manifest')\n_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)\n_AddTool(_rc)\n_AddTool(_lib)\n_AddTool(_manifest)\n_AddTool(_masm)\n# Add sections only found in the MSBuild settings.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_masm", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_masm = _Tool('MASM', 'MASM')\n_AddTool(_compile)\n_AddTool(_link)\n_AddTool(_midl)\n_AddTool(_rc)\n_AddTool(_lib)\n_AddTool(_manifest)\n_AddTool(_masm)\n# Add sections only found in the MSBuild settings.\n_msbuild_validators[''] = {}", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msbuild_validators['']", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msbuild_validators[''] = {}\n_msbuild_validators['ProjectReference'] = {}\n_msbuild_validators['ManifestResourceCompile'] = {}\n# Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and\n# ClCompile in MSBuild.\n# See \"c:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\1033\\cl.xml\" for\n# the schema of the MSBuild ClCompile settings.\n# Options that have the same name in MSVS and MSBuild\n_Same(_compile, 'AdditionalIncludeDirectories', _folder_list) # /I\n_Same(_compile, 'AdditionalOptions', _string_list)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msbuild_validators['ProjectReference']", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msbuild_validators['ProjectReference'] = {}\n_msbuild_validators['ManifestResourceCompile'] = {}\n# Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and\n# ClCompile in MSBuild.\n# See \"c:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\1033\\cl.xml\" for\n# the schema of the MSBuild ClCompile settings.\n# Options that have the same name in MSVS and MSBuild\n_Same(_compile, 'AdditionalIncludeDirectories', _folder_list) # /I\n_Same(_compile, 'AdditionalOptions', _string_list)\n_Same(_compile, 'AdditionalUsingDirectories', _folder_list) # /AI", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_msbuild_validators['ManifestResourceCompile']", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_msbuild_validators['ManifestResourceCompile'] = {}\n# Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and\n# ClCompile in MSBuild.\n# See \"c:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\1033\\cl.xml\" for\n# the schema of the MSBuild ClCompile settings.\n# Options that have the same name in MSVS and MSBuild\n_Same(_compile, 'AdditionalIncludeDirectories', _folder_list) # /I\n_Same(_compile, 'AdditionalOptions', _string_list)\n_Same(_compile, 'AdditionalUsingDirectories', _folder_list) # /AI\n_Same(_compile, 'AssemblerListingLocation', _file_name) # /Fa", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_subsystem_enumeration", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_subsystem_enumeration = _Enumeration(\n ['NotSet',\n 'Console', # /SUBSYSTEM:CONSOLE\n 'Windows', # /SUBSYSTEM:WINDOWS\n 'Native', # /SUBSYSTEM:NATIVE\n 'EFI Application', # /SUBSYSTEM:EFI_APPLICATION\n 'EFI Boot Service Driver', # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER\n 'EFI ROM', # /SUBSYSTEM:EFI_ROM\n 'EFI Runtime', # /SUBSYSTEM:EFI_RUNTIME_DRIVER\n 'WindowsCE'], # /SUBSYSTEM:WINDOWSCE", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "_target_machine_enumeration", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "peekOfCode": "_target_machine_enumeration = _Enumeration(\n ['NotSet',\n 'MachineX86', # /MACHINE:X86\n None,\n 'MachineARM', # /MACHINE:ARM\n 'MachineEBC', # /MACHINE:EBC\n 'MachineIA64', # /MACHINE:IA64\n None,\n 'MachineMIPS', # /MACHINE:MIPS\n 'MachineMIPS16', # /MACHINE:MIPS16", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings", + "documentation": {} + }, + { + "label": "TestSequenceFunctions", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings_test", + "peekOfCode": "class TestSequenceFunctions(unittest.TestCase):\n def setUp(self):\n self.stderr = StringIO.StringIO()\n def _ExpectedWarnings(self, expected):\n \"\"\"Compares recorded lines to expected warnings.\"\"\"\n self.stderr.seek(0)\n actual = self.stderr.read().split('\\n')\n actual = [line for line in actual if line]\n self.assertEqual(sorted(expected), sorted(actual))\n def testValidateMSVSSettings_tool_names(self):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSSettings_test", + "documentation": {} + }, + { + "label": "Writer", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSToolFile", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSToolFile", + "peekOfCode": "class Writer(object):\n \"\"\"Visual Studio XML tool file writer.\"\"\"\n def __init__(self, tool_file_path, name):\n \"\"\"Initializes the tool file.\n Args:\n tool_file_path: Path to the tool file.\n name: Name of the tool file.\n \"\"\"\n self.tool_file_path = tool_file_path\n self.name = name", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSToolFile", + "documentation": {} + }, + { + "label": "Writer", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUserFile", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUserFile", + "peekOfCode": "class Writer(object):\n \"\"\"Visual Studio XML user user file writer.\"\"\"\n def __init__(self, user_file_path, version, name):\n \"\"\"Initializes the user file.\n Args:\n user_file_path: Path to the user file.\n version: Version info.\n name: Name of the user file.\n \"\"\"\n self.user_file_path = user_file_path", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUserFile", + "documentation": {} + }, + { + "label": "ShardTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "peekOfCode": "def ShardTargets(target_list, target_dicts):\n \"\"\"Shard some targets apart to work around the linkers limits.\n Arguments:\n target_list: List of target pairs: 'base/base.gyp:base'.\n target_dicts: Dict of target properties keyed on target pair.\n Returns:\n Tuple of the new sharded versions of the inputs.\n \"\"\"\n # Gather the targets to shard, and how many pieces.\n targets_to_shard = {}", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "documentation": {} + }, + { + "label": "InsertLargePdbShims", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "peekOfCode": "def InsertLargePdbShims(target_list, target_dicts, vars):\n \"\"\"Insert a shim target that forces the linker to use 4KB pagesize PDBs.\n This is a workaround for targets with PDBs greater than 1GB in size, the\n limit for the 1KB pagesize PDBs created by the linker by default.\n Arguments:\n target_list: List of target pairs: 'base/base.gyp:base'.\n target_dicts: Dict of target properties keyed on target pair.\n vars: A dictionary of common GYP variables with generator-specific values.\n Returns:\n Tuple of the shimmed version of the inputs.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "documentation": {} + }, + { + "label": "TARGET_TYPE_EXT", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "peekOfCode": "TARGET_TYPE_EXT = {\n 'executable': 'exe',\n 'loadable_module': 'dll',\n 'shared_library': 'dll',\n 'static_library': 'lib',\n}\ndef _GetLargePdbShimCcPath():\n \"\"\"Returns the path of the large_pdb_shim.cc file.\"\"\"\n this_dir = os.path.abspath(os.path.dirname(__file__))\n src_dir = os.path.abspath(os.path.join(this_dir, '..', '..'))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSUtil", + "documentation": {} + }, + { + "label": "VisualStudioVersion", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSVersion", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSVersion", + "peekOfCode": "class VisualStudioVersion(object):\n \"\"\"Information regarding a version of Visual Studio.\"\"\"\n def __init__(self, short_name, description,\n solution_version, project_version, flat_sln, uses_vcxproj,\n path, sdk_based, default_toolset=None):\n self.short_name = short_name\n self.description = description\n self.solution_version = solution_version\n self.project_version = project_version\n self.flat_sln = flat_sln", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSVersion", + "documentation": {} + }, + { + "label": "SelectVisualStudioVersion", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.MSVSVersion", + "description": "node_modules.node-gyp.gyp.pylib.gyp.MSVSVersion", + "peekOfCode": "def SelectVisualStudioVersion(version='auto', allow_fallback=True):\n \"\"\"Select which version of Visual Studio projects to generate.\n Arguments:\n version: Hook to allow caller to force a particular version (vs auto).\n Returns:\n An object representing a visual studio project format version.\n \"\"\"\n # In auto mode, check environment variable for override.\n if version == 'auto':\n version = os.environ.get('GYP_MSVS_VERSION', 'auto')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.MSVSVersion", + "documentation": {} + }, + { + "label": "memoize", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "class memoize(object):\n def __init__(self, func):\n self.func = func\n self.cache = {}\n def __call__(self, *args):\n try:\n return self.cache[args]\n except KeyError:\n result = self.func(*args)\n self.cache[args] = result", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "GypError", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "class GypError(Exception):\n \"\"\"Error class representing an error, which is to be presented\n to the user. The main entry point will catch and display this.\n \"\"\"\n pass\ndef ExceptionAppend(e, msg):\n \"\"\"Append a message to the given exception's message.\"\"\"\n if not e.args:\n e.args = (msg,)\n elif len(e.args) == 1:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "OrderedSet", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "class OrderedSet(collections.MutableSet):\n def __init__(self, iterable=None):\n self.end = end = []\n end += [None, end, end] # sentinel node for doubly linked list\n self.map = {} # key --> [key, prev, next]\n if iterable is not None:\n self |= iterable\n def __len__(self):\n return len(self.map)\n def __contains__(self, key):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "CycleError", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "class CycleError(Exception):\n \"\"\"An exception raised when an unexpected cycle is detected.\"\"\"\n def __init__(self, nodes):\n self.nodes = nodes\n def __str__(self):\n return 'CycleError: cycle involving: ' + str(self.nodes)\ndef TopologicallySorted(graph, get_edges):\n r\"\"\"Topologically sort based on a user provided edge definition.\n Args:\n graph: A list of node names.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "ExceptionAppend", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def ExceptionAppend(e, msg):\n \"\"\"Append a message to the given exception's message.\"\"\"\n if not e.args:\n e.args = (msg,)\n elif len(e.args) == 1:\n e.args = (str(e.args[0]) + ' ' + msg,)\n else:\n e.args = (str(e.args[0]) + ' ' + msg,) + e.args[1:]\ndef FindQualifiedTargets(target, qualified_list):\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "FindQualifiedTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def FindQualifiedTargets(target, qualified_list):\n \"\"\"\n Given a list of qualified targets, return the qualified targets for the\n specified |target|.\n \"\"\"\n return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target]\ndef ParseQualifiedTarget(target):\n # Splits a qualified target into a build file, target name and toolset.\n # NOTE: rsplit is used to disambiguate the Windows drive letter separator.\n target_split = target.rsplit(':', 1)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "ParseQualifiedTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def ParseQualifiedTarget(target):\n # Splits a qualified target into a build file, target name and toolset.\n # NOTE: rsplit is used to disambiguate the Windows drive letter separator.\n target_split = target.rsplit(':', 1)\n if len(target_split) == 2:\n [build_file, target] = target_split\n else:\n build_file = None\n target_split = target.rsplit('#', 1)\n if len(target_split) == 2:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "ResolveTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def ResolveTarget(build_file, target, toolset):\n # This function resolves a target into a canonical form:\n # - a fully defined build file, either absolute or relative to the current\n # directory\n # - a target name\n # - a toolset\n #\n # build_file is the file relative to which 'target' is defined.\n # target is the qualified target.\n # toolset is the default toolset for that target.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "BuildFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def BuildFile(fully_qualified_target):\n # Extracts the build file from the fully qualified target.\n return ParseQualifiedTarget(fully_qualified_target)[0]\ndef GetEnvironFallback(var_list, default):\n \"\"\"Look up a key in the environment, with fallback to secondary keys\n and finally falling back to a default value.\"\"\"\n for var in var_list:\n if var in os.environ:\n return os.environ[var]\n return default", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "GetEnvironFallback", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def GetEnvironFallback(var_list, default):\n \"\"\"Look up a key in the environment, with fallback to secondary keys\n and finally falling back to a default value.\"\"\"\n for var in var_list:\n if var in os.environ:\n return os.environ[var]\n return default\ndef QualifiedTarget(build_file, target, toolset):\n # \"Qualified\" means the file that a target was defined in and the target\n # name, separated by a colon, suffixed by a # and the toolset name:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "QualifiedTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def QualifiedTarget(build_file, target, toolset):\n # \"Qualified\" means the file that a target was defined in and the target\n # name, separated by a colon, suffixed by a # and the toolset name:\n # /path/to/file.gyp:target_name#toolset\n fully_qualified = build_file + ':' + target\n if toolset:\n fully_qualified = fully_qualified + '#' + toolset\n return fully_qualified\n@memoize\ndef RelativePath(path, relative_to, follow_path_symlink=True):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "RelativePath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def RelativePath(path, relative_to, follow_path_symlink=True):\n # Assuming both |path| and |relative_to| are relative to the current\n # directory, returns a relative path that identifies path relative to\n # relative_to.\n # If |follow_symlink_path| is true (default) and |path| is a symlink, then\n # this method returns a path to the real file represented by |path|. If it is\n # false, this method returns a path to the symlink. If |path| is not a\n # symlink, this option has no effect.\n # Convert to normalized (and therefore absolute paths).\n if follow_path_symlink:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "InvertRelativePath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def InvertRelativePath(path, toplevel_dir=None):\n \"\"\"Given a path like foo/bar that is relative to toplevel_dir, return\n the inverse relative path back to the toplevel_dir.\n E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path)))\n should always produce the empty string, unless the path contains symlinks.\n \"\"\"\n if not path:\n return path\n toplevel_dir = '.' if toplevel_dir is None else toplevel_dir\n return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "FixIfRelativePath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def FixIfRelativePath(path, relative_to):\n # Like RelativePath but returns |path| unchanged if it is absolute.\n if os.path.isabs(path):\n return path\n return RelativePath(path, relative_to)\ndef UnrelativePath(path, relative_to):\n # Assuming that |relative_to| is relative to the current directory, and |path|\n # is a path relative to the dirname of |relative_to|, returns a path that\n # identifies |path| relative to the current directory.\n rel_dir = os.path.dirname(relative_to)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "UnrelativePath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def UnrelativePath(path, relative_to):\n # Assuming that |relative_to| is relative to the current directory, and |path|\n # is a path relative to the dirname of |relative_to|, returns a path that\n # identifies |path| relative to the current directory.\n rel_dir = os.path.dirname(relative_to)\n return os.path.normpath(os.path.join(rel_dir, path))\n# re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at\n# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02\n# and the documentation for various shells.\n# _quote is a pattern that should match any argument that needs to be quoted", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "EncodePOSIXShellArgument", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def EncodePOSIXShellArgument(argument):\n \"\"\"Encodes |argument| suitably for consumption by POSIX shells.\n argument may be quoted and escaped as necessary to ensure that POSIX shells\n treat the returned value as a literal representing the argument passed to\n this function. Parameter (variable) expansions beginning with $ are allowed\n to remain intact without escaping the $, to allow the argument to contain\n references to variables to be expanded by the shell.\n \"\"\"\n if not isinstance(argument, str):\n argument = str(argument)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "EncodePOSIXShellList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def EncodePOSIXShellList(list):\n \"\"\"Encodes |list| suitably for consumption by POSIX shells.\n Returns EncodePOSIXShellArgument for each item in list, and joins them\n together using the space character as an argument separator.\n \"\"\"\n encoded_arguments = []\n for argument in list:\n encoded_arguments.append(EncodePOSIXShellArgument(argument))\n return ' '.join(encoded_arguments)\ndef DeepDependencyTargets(target_dicts, roots):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "DeepDependencyTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def DeepDependencyTargets(target_dicts, roots):\n \"\"\"Returns the recursive list of target dependencies.\"\"\"\n dependencies = set()\n pending = set(roots)\n while pending:\n # Pluck out one.\n r = pending.pop()\n # Skip if visited already.\n if r in dependencies:\n continue", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "BuildFileTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def BuildFileTargets(target_list, build_file):\n \"\"\"From a target_list, returns the subset from the specified build_file.\n \"\"\"\n return [p for p in target_list if BuildFile(p) == build_file]\ndef AllTargets(target_list, target_dicts, build_file):\n \"\"\"Returns all targets (direct and dependencies) for the specified build_file.\n \"\"\"\n bftargets = BuildFileTargets(target_list, build_file)\n deptargets = DeepDependencyTargets(target_dicts, bftargets)\n return bftargets + deptargets", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "AllTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def AllTargets(target_list, target_dicts, build_file):\n \"\"\"Returns all targets (direct and dependencies) for the specified build_file.\n \"\"\"\n bftargets = BuildFileTargets(target_list, build_file)\n deptargets = DeepDependencyTargets(target_dicts, bftargets)\n return bftargets + deptargets\ndef WriteOnDiff(filename):\n \"\"\"Write to a file only if the new contents differ.\n Arguments:\n filename: name of the file to potentially write to.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "WriteOnDiff", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def WriteOnDiff(filename):\n \"\"\"Write to a file only if the new contents differ.\n Arguments:\n filename: name of the file to potentially write to.\n Returns:\n A file like object which will write to temporary file and only overwrite\n the target if it differs (on close).\n \"\"\"\n class Writer(object):\n \"\"\"Wrapper around file which only covers the target if it differs.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "EnsureDirExists", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def EnsureDirExists(path):\n \"\"\"Make sure the directory for |path| exists.\"\"\"\n try:\n os.makedirs(os.path.dirname(path))\n except OSError:\n pass\ndef GetFlavor(params):\n \"\"\"Returns |params.flavor| if it's set, the system's default flavor else.\"\"\"\n flavors = {\n 'cygwin': 'win',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "GetFlavor", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def GetFlavor(params):\n \"\"\"Returns |params.flavor| if it's set, the system's default flavor else.\"\"\"\n flavors = {\n 'cygwin': 'win',\n 'win32': 'win',\n 'darwin': 'mac',\n }\n if 'flavor' in params:\n return params['flavor']\n if sys.platform in flavors:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "CopyTool", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def CopyTool(flavor, out_path):\n \"\"\"Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it\n to |out_path|.\"\"\"\n # aix and solaris just need flock emulation. mac and win use more complicated\n # support scripts.\n prefix = {\n 'aix': 'flock',\n 'solaris': 'flock',\n 'mac': 'mac',\n 'win': 'win'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "uniquer", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def uniquer(seq, idfun=None):\n if idfun is None:\n idfun = lambda x: x\n seen = {}\n result = []\n for item in seq:\n marker = idfun(item)\n if marker in seen: continue\n seen[marker] = 1\n result.append(item)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "TopologicallySorted", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def TopologicallySorted(graph, get_edges):\n r\"\"\"Topologically sort based on a user provided edge definition.\n Args:\n graph: A list of node names.\n get_edges: A function mapping from node name to a hashable collection\n of node names which this node has outgoing edges to.\n Returns:\n A list containing all of the node in graph in topological order.\n It is assumed that calling get_edges once for each node and caching is\n cheaper than repeatedly calling get_edges.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "CrossCompileRequested", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "def CrossCompileRequested():\n # TODO: figure out how to not build extra host objects in the\n # non-cross-compile case when this is enabled, and enable unconditionally.\n return (os.environ.get('GYP_CROSSCOMPILE') or\n os.environ.get('AR_host') or\n os.environ.get('CC_host') or\n os.environ.get('CXX_host') or\n os.environ.get('AR_target') or\n os.environ.get('CC_target') or\n os.environ.get('CXX_target'))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "_quote", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "_quote = re.compile('[\\t\\n #$%&\\'()*;<=>?[{|}~]|^$')\n# _escape is a pattern that should match any character that needs to be\n# escaped with a backslash, whether or not the argument matched the _quote\n# pattern. _escape is used with re.sub to backslash anything in _escape's\n# first match group, hence the (parentheses) in the regular expression.\n#\n# _escape matches the following characters appearing anywhere in an argument:\n# \" to prevent POSIX shells from interpreting this character for quoting\n# \\ to prevent POSIX shells from interpreting this character for escaping\n# ` to prevent POSIX shells from interpreting this character for command", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "_escape", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common", + "peekOfCode": "_escape = re.compile(r'([\"\\\\`])')\ndef EncodePOSIXShellArgument(argument):\n \"\"\"Encodes |argument| suitably for consumption by POSIX shells.\n argument may be quoted and escaped as necessary to ensure that POSIX shells\n treat the returned value as a literal representing the argument passed to\n this function. Parameter (variable) expansions beginning with $ are allowed\n to remain intact without escaping the $, to allow the argument to contain\n references to variables to be expanded by the shell.\n \"\"\"\n if not isinstance(argument, str):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common", + "documentation": {} + }, + { + "label": "TestTopologicallySorted", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common_test", + "peekOfCode": "class TestTopologicallySorted(unittest.TestCase):\n def test_Valid(self):\n \"\"\"Test that sorting works on a valid graph with one possible order.\"\"\"\n graph = {\n 'a': ['b', 'c'],\n 'b': [],\n 'c': ['d'],\n 'd': ['b'],\n }\n def GetEdge(node):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common_test", + "documentation": {} + }, + { + "label": "TestGetFlavor", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.common_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.common_test", + "peekOfCode": "class TestGetFlavor(unittest.TestCase):\n \"\"\"Test that gyp.common.GetFlavor works as intended\"\"\"\n original_platform = ''\n def setUp(self):\n self.original_platform = sys.platform\n def tearDown(self):\n sys.platform = self.original_platform\n def assertFlavor(self, expected, argument, param):\n sys.platform = argument\n self.assertEqual(expected, gyp.common.GetFlavor(param))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.common_test", + "documentation": {} + }, + { + "label": "XmlToString", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "description": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "peekOfCode": "def XmlToString(content, encoding='utf-8', pretty=False):\n \"\"\" Writes the XML content to disk, touching the file only if it has changed.\n Visual Studio files have a lot of pre-defined structures. This function makes\n it easy to represent these structures as Python data structures, instead of\n having to create a lot of function calls.\n Each XML element of the content is represented as a list composed of:\n 1. The name of the element, a string,\n 2. The attributes of the element, a dictionary (optional), and\n 3+. The content of the element, if any. Strings are simple text nodes and\n lists are child elements.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "documentation": {} + }, + { + "label": "WriteXmlIfChanged", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "description": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "peekOfCode": "def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False,\n win32=False):\n \"\"\" Writes the XML content to disk, touching the file only if it has changed.\n Args:\n content: The structured content to be written.\n path: Location of the file.\n encoding: The encoding to report on the first line of the XML file.\n pretty: True if we want pretty printing with indents and new lines.\n \"\"\"\n xml_string = XmlToString(content, encoding, pretty)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "documentation": {} + }, + { + "label": "_xml_escape_map", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "description": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "peekOfCode": "_xml_escape_map = {\n '\"': '"',\n \"'\": ''',\n '<': '<',\n '>': '>',\n '&': '&',\n '\\n': ' ',\n '\\r': ' ',\n}\n_xml_escape_re = re.compile(", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "documentation": {} + }, + { + "label": "_xml_escape_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "description": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "peekOfCode": "_xml_escape_re = re.compile(\n \"(%s)\" % \"|\".join(map(re.escape, _xml_escape_map.keys())))\ndef _XmlEscape(value, attr=False):\n \"\"\" Escape a string for inclusion in XML.\"\"\"\n def replace(match):\n m = match.string[match.start() : match.end()]\n # don't replace single quotes in attrs\n if attr and m == \"'\":\n return m\n return _xml_escape_map[m]", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml", + "documentation": {} + }, + { + "label": "TestSequenceFunctions", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml_test", + "peekOfCode": "class TestSequenceFunctions(unittest.TestCase):\n def setUp(self):\n self.stderr = StringIO.StringIO()\n def test_EasyXml_simple(self):\n self.assertEqual(\n easy_xml.XmlToString(['test']),\n '')\n self.assertEqual(\n easy_xml.XmlToString(['test'], encoding='Windows-1252'),\n '')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.easy_xml_test", + "documentation": {} + }, + { + "label": "FlockTool", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.flock_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.flock_tool", + "peekOfCode": "class FlockTool(object):\n \"\"\"This class emulates the 'flock' command.\"\"\"\n def Dispatch(self, args):\n \"\"\"Dispatches a string command to a method.\"\"\"\n if len(args) < 1:\n raise Exception(\"Not enough arguments\")\n method = \"Exec%s\" % self._CommandifyName(args[0])\n getattr(self, method)(*args[1:])\n def _CommandifyName(self, name_string):\n \"\"\"Transforms a tool name like copy-info-plist to CopyInfoPlist\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.flock_tool", + "documentation": {} + }, + { + "label": "main", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.flock_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.flock_tool", + "peekOfCode": "def main(args):\n executor = FlockTool()\n executor.Dispatch(args)\nclass FlockTool(object):\n \"\"\"This class emulates the 'flock' command.\"\"\"\n def Dispatch(self, args):\n \"\"\"Dispatches a string command to a method.\"\"\"\n if len(args) < 1:\n raise Exception(\"Not enough arguments\")\n method = \"Exec%s\" % self._CommandifyName(args[0])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.flock_tool", + "documentation": {} + }, + { + "label": "ParallelProcessingError", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "class ParallelProcessingError(Exception):\n pass\nclass ParallelState(object):\n \"\"\"Class to keep track of state when processing input files in parallel.\n If build files are loaded in parallel, use this to keep track of\n state during farming out and processing parallel jobs. It's stored\n in a global so that the callback function can have access to it.\n \"\"\"\n def __init__(self):\n # The multiprocessing pool.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ParallelState", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "class ParallelState(object):\n \"\"\"Class to keep track of state when processing input files in parallel.\n If build files are loaded in parallel, use this to keep track of\n state during farming out and processing parallel jobs. It's stored\n in a global so that the callback function can have access to it.\n \"\"\"\n def __init__(self):\n # The multiprocessing pool.\n self.pool = None\n # The condition variable used to protect this object and notify", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "DependencyGraphNode", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "class DependencyGraphNode(object):\n \"\"\"\n Attributes:\n ref: A reference to an object that this DependencyGraphNode represents.\n dependencies: List of DependencyGraphNodes on which this one depends.\n dependents: List of DependencyGraphNodes that depend on this one.\n \"\"\"\n class CircularException(GypError):\n pass\n def __init__(self, ref):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "IsPathSection", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def IsPathSection(section):\n # If section ends in one of the '=+?!' characters, it's applied to a section\n # without the trailing characters. '/' is notably absent from this list,\n # because there's no way for a regular expression to be treated as a path.\n while section and section[-1:] in '=+?!':\n section = section[:-1]\n if section in path_sections:\n return True\n # Sections mathing the regexp '_(dir|file|path)s?$' are also\n # considered PathSections. Using manual string matching since that", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "GetIncludedBuildFiles", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def GetIncludedBuildFiles(build_file_path, aux_data, included=None):\n \"\"\"Return a list of all build files included into build_file_path.\n The returned list will contain build_file_path as well as all other files\n that it included, either directly or indirectly. Note that the list may\n contain files that were included into a conditional section that evaluated\n to false and was not merged into build_file_path's dict.\n aux_data is a dict containing a key for each build file or included build\n file. Those keys provide access to dicts whose \"included\" keys contain\n lists of all other files included by the build file.\n included should be left at its default None value by external callers. It", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "CheckedEval", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def CheckedEval(file_contents):\n \"\"\"Return the eval of a gyp file.\n The gyp file is restricted to dictionaries and lists only, and\n repeated keys are not allowed.\n Note that this is slower than eval() is.\n \"\"\"\n ast = compiler.parse(file_contents)\n assert isinstance(ast, Module)\n c1 = ast.getChildren()\n assert c1[0] is None", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "CheckNode", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def CheckNode(node, keypath):\n if isinstance(node, Dict):\n c = node.getChildren()\n dict = {}\n for n in range(0, len(c), 2):\n assert isinstance(c[n], Const)\n key = c[n].getChildren()[0]\n if key in dict:\n raise GypError(\"Key '\" + key + \"' repeated at level \" +\n repr(len(keypath) + 1) + \" with key path '\" +", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadOneBuildFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadOneBuildFile(build_file_path, data, aux_data, includes,\n is_target, check):\n if build_file_path in data:\n return data[build_file_path]\n if os.path.exists(build_file_path):\n # Open the build file for read ('r') with universal-newlines mode ('U')\n # to make sure platform specific newlines ('\\r\\n' or '\\r') are converted to '\\n'\n # which otherwise will fail eval()\n if sys.platform == 'zos':\n # On z/OS, universal-newlines mode treats the file as an ascii file. But since", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadBuildFileIncludesIntoDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadBuildFileIncludesIntoDict(subdict, subdict_path, data, aux_data,\n includes, check):\n includes_list = []\n if includes != None:\n includes_list.extend(includes)\n if 'includes' in subdict:\n for include in subdict['includes']:\n # \"include\" is specified relative to subdict_path, so compute the real\n # path to include by appending the provided \"include\" to the directory\n # in which subdict_path resides.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadBuildFileIncludesIntoList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadBuildFileIncludesIntoList(sublist, sublist_path, data, aux_data, check):\n for item in sublist:\n if type(item) is dict:\n LoadBuildFileIncludesIntoDict(item, sublist_path, data, aux_data,\n None, check)\n elif type(item) is list:\n LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check)\n# Processes toolsets in all the targets. This recurses into condition entries\n# since they can contain toolsets as well.\ndef ProcessToolsetsInDict(data):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ProcessToolsetsInDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ProcessToolsetsInDict(data):\n if 'targets' in data:\n target_list = data['targets']\n new_target_list = []\n for target in target_list:\n # If this target already has an explicit 'toolset', and no 'toolsets'\n # list, don't modify it further.\n if 'toolset' in target and 'toolsets' not in target:\n new_target_list.append(target)\n continue", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadTargetBuildFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes,\n depth, check, load_dependencies):\n # If depth is set, predefine the DEPTH variable to be a relative path from\n # this build file's directory to the directory identified by depth.\n if depth:\n # TODO(dglazkov) The backslash/forward-slash replacement at the end is a\n # temporary measure. This should really be addressed by keeping all paths\n # in POSIX until actual project generation.\n d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path))\n if d == '':", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "CallLoadTargetBuildFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def CallLoadTargetBuildFile(global_flags,\n build_file_path, variables,\n includes, depth, check,\n generator_input_info):\n \"\"\"Wrapper around LoadTargetBuildFile for parallel processing.\n This wrapper is used when LoadTargetBuildFile is executed in\n a worker process.\n \"\"\"\n try:\n signal.signal(signal.SIGINT, signal.SIG_IGN)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadTargetBuildFilesParallel", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadTargetBuildFilesParallel(build_files, data, variables, includes, depth,\n check, generator_input_info):\n parallel_state = ParallelState()\n parallel_state.condition = threading.Condition()\n # Make copies of the build_files argument that we can modify while working.\n parallel_state.dependencies = list(build_files)\n parallel_state.scheduled = set(build_files)\n parallel_state.pending = 0\n parallel_state.data = data\n try:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "FindEnclosingBracketGroup", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def FindEnclosingBracketGroup(input_str):\n stack = []\n start = -1\n for index, char in enumerate(input_str):\n if char in LBRACKETS:\n stack.append(char)\n if start == -1:\n start = index\n elif char in BRACKETS:\n if not stack:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "IsStrCanonicalInt", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def IsStrCanonicalInt(string):\n \"\"\"Returns True if |string| is in its canonical integer form.\n The canonical form is such that str(int(string)) == string.\n \"\"\"\n if type(string) is str:\n # This function is called a lot so for maximum performance, avoid\n # involving regexps which would otherwise make the code much\n # shorter. Regexps would need twice the time of this function.\n if string:\n if string == \"0\":", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "FixupPlatformCommand", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def FixupPlatformCommand(cmd):\n if sys.platform == 'win32':\n if type(cmd) is list:\n cmd = [re.sub('^cat ', 'type ', cmd[0])] + cmd[1:]\n else:\n cmd = re.sub('^cat ', 'type ', cmd)\n return cmd\nPHASE_EARLY = 0\nPHASE_LATE = 1\nPHASE_LATELATE = 2", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ExpandVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ExpandVariables(input, phase, variables, build_file):\n # Look for the pattern that gets expanded into variables\n if phase == PHASE_EARLY:\n variable_re = early_variable_re\n expansion_symbol = '<'\n elif phase == PHASE_LATE:\n variable_re = late_variable_re\n expansion_symbol = '>'\n elif phase == PHASE_LATELATE:\n variable_re = latelate_variable_re", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "EvalCondition", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def EvalCondition(condition, conditions_key, phase, variables, build_file):\n \"\"\"Returns the dict that should be used or None if the result was\n that nothing should be used.\"\"\"\n if type(condition) is not list:\n raise GypError(conditions_key + ' must be a list')\n if len(condition) < 2:\n # It's possible that condition[0] won't work in which case this\n # attempt will raise its own IndexError. That's probably fine.\n raise GypError(conditions_key + ' ' + condition[0] +\n ' must be at least length 2, not ' + str(len(condition)))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "EvalSingleCondition", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def EvalSingleCondition(\n cond_expr, true_dict, false_dict, phase, variables, build_file):\n \"\"\"Returns true_dict if cond_expr evaluates to true, and false_dict\n otherwise.\"\"\"\n # Do expansions on the condition itself. Since the conditon can naturally\n # contain variable references without needing to resort to GYP expansion\n # syntax, this is of dubious value for variables, but someone might want to\n # use a command expansion directly inside a condition.\n cond_expr_expanded = ExpandVariables(cond_expr, phase, variables,\n build_file)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ProcessConditionsInDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ProcessConditionsInDict(the_dict, phase, variables, build_file):\n # Process a 'conditions' or 'target_conditions' section in the_dict,\n # depending on phase.\n # early -> conditions\n # late -> target_conditions\n # latelate -> no conditions\n #\n # Each item in a conditions list consists of cond_expr, a string expression\n # evaluated as the condition, and true_dict, a dict that will be merged into\n # the_dict if cond_expr evaluates to true. Optionally, a third item,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadAutomaticVariablesFromDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadAutomaticVariablesFromDict(variables, the_dict):\n # Any keys with plain string values in the_dict become automatic variables.\n # The variable name is the key name with a \"_\" character prepended.\n for key, value in the_dict.iteritems():\n if type(value) in (str, int, list):\n variables['_' + key] = value\ndef LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key):\n # Any keys in the_dict's \"variables\" dict, if it has one, becomes a\n # variable. The variable name is the key name in the \"variables\" dict.\n # Variables that end with the % character are set only if they are unset in", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "LoadVariablesFromVariablesDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key):\n # Any keys in the_dict's \"variables\" dict, if it has one, becomes a\n # variable. The variable name is the key name in the \"variables\" dict.\n # Variables that end with the % character are set only if they are unset in\n # the variables dict. the_dict_key is the name of the key that accesses\n # the_dict in the_dict's parent dict. If the_dict's parent is not a dict\n # (it could be a list or it could be parentless because it is a root dict),\n # the_dict_key will be None.\n for key, value in the_dict.get('variables', {}).iteritems():\n if type(value) not in (str, int, list):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ProcessVariablesAndConditionsInDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ProcessVariablesAndConditionsInDict(the_dict, phase, variables_in,\n build_file, the_dict_key=None):\n \"\"\"Handle all variable and command expansion and conditional evaluation.\n This function is the public entry point for all variable expansions and\n conditional evaluations. The variables_in dictionary will not be modified\n by this function.\n \"\"\"\n # Make a copy of the variables_in dict that can be modified during the\n # loading of automatics and the loading of the variables dict.\n variables = variables_in.copy()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ProcessVariablesAndConditionsInList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ProcessVariablesAndConditionsInList(the_list, phase, variables,\n build_file):\n # Iterate using an index so that new values can be assigned into the_list.\n index = 0\n while index < len(the_list):\n item = the_list[index]\n if type(item) is dict:\n # Make a copy of the variables dict so that it won't influence anything\n # outside of its own scope.\n ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "BuildTargetsDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def BuildTargetsDict(data):\n \"\"\"Builds a dict mapping fully-qualified target names to their target dicts.\n |data| is a dict mapping loaded build files by pathname relative to the\n current directory. Values in |data| are build file contents. For each\n |data| value with a \"targets\" key, the value of the \"targets\" key is taken\n as a list containing target dicts. Each target's fully-qualified name is\n constructed from the pathname of the build file (|data| key) and its\n \"target_name\" property. These fully-qualified names are used as the keys\n in the returned dict. These keys provide access to the target dicts,\n the dicts in the \"targets\" lists.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "QualifyDependencies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def QualifyDependencies(targets):\n \"\"\"Make dependency links fully-qualified relative to the current directory.\n |targets| is a dict mapping fully-qualified target names to their target\n dicts. For each target in this dict, keys known to contain dependency\n links are examined, and any dependencies referenced will be rewritten\n so that they are fully-qualified and relative to the current directory.\n All rewritten dependencies are suitable for use as keys to |targets| or a\n similar dict.\n \"\"\"\n all_dependency_sections = [dep + op", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ExpandWildcardDependencies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ExpandWildcardDependencies(targets, data):\n \"\"\"Expands dependencies specified as build_file:*.\n For each target in |targets|, examines sections containing links to other\n targets. If any such section contains a link of the form build_file:*, it\n is taken as a wildcard link, and is expanded to list each target in\n build_file. The |data| dict provides access to build file dicts.\n Any target that does not wish to be included by wildcard can provide an\n optional \"suppress_wildcard\" key in its target dict. When present and\n true, a wildcard dependency link will not include such targets.\n All dependency names, including the keys to |targets| and the values in each", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "Unify", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def Unify(l):\n \"\"\"Removes duplicate elements from l, keeping the first element.\"\"\"\n seen = {}\n return [seen.setdefault(e, e) for e in l if e not in seen]\ndef RemoveDuplicateDependencies(targets):\n \"\"\"Makes sure every dependency appears only once in all targets's dependency\n lists.\"\"\"\n for target_name, target_dict in targets.iteritems():\n for dependency_key in dependency_sections:\n dependencies = target_dict.get(dependency_key, [])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "RemoveDuplicateDependencies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def RemoveDuplicateDependencies(targets):\n \"\"\"Makes sure every dependency appears only once in all targets's dependency\n lists.\"\"\"\n for target_name, target_dict in targets.iteritems():\n for dependency_key in dependency_sections:\n dependencies = target_dict.get(dependency_key, [])\n if dependencies:\n target_dict[dependency_key] = Unify(dependencies)\ndef Filter(l, item):\n \"\"\"Removes item from l.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "Filter", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def Filter(l, item):\n \"\"\"Removes item from l.\"\"\"\n res = {}\n return [res.setdefault(e, e) for e in l if e != item]\ndef RemoveSelfDependencies(targets):\n \"\"\"Remove self dependencies from targets that have the prune_self_dependency\n variable set.\"\"\"\n for target_name, target_dict in targets.iteritems():\n for dependency_key in dependency_sections:\n dependencies = target_dict.get(dependency_key, [])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "RemoveSelfDependencies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def RemoveSelfDependencies(targets):\n \"\"\"Remove self dependencies from targets that have the prune_self_dependency\n variable set.\"\"\"\n for target_name, target_dict in targets.iteritems():\n for dependency_key in dependency_sections:\n dependencies = target_dict.get(dependency_key, [])\n if dependencies:\n for t in dependencies:\n if t == target_name:\n if targets[t].get('variables', {}).get('prune_self_dependency', 0):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "RemoveLinkDependenciesFromNoneTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def RemoveLinkDependenciesFromNoneTargets(targets):\n \"\"\"Remove dependencies having the 'link_dependency' attribute from the 'none'\n targets.\"\"\"\n for target_name, target_dict in targets.iteritems():\n for dependency_key in dependency_sections:\n dependencies = target_dict.get(dependency_key, [])\n if dependencies:\n for t in dependencies:\n if target_dict.get('type', None) == 'none':\n if targets[t].get('variables', {}).get('link_dependency', 0):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "BuildDependencyList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def BuildDependencyList(targets):\n # Create a DependencyGraphNode for each target. Put it into a dict for easy\n # access.\n dependency_nodes = {}\n for target, spec in targets.iteritems():\n if target not in dependency_nodes:\n dependency_nodes[target] = DependencyGraphNode(target)\n # Set up the dependency links. Targets that have no dependencies are treated\n # as dependent on root_node.\n root_node = DependencyGraphNode(None)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "VerifyNoGYPFileCircularDependencies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def VerifyNoGYPFileCircularDependencies(targets):\n # Create a DependencyGraphNode for each gyp file containing a target. Put\n # it into a dict for easy access.\n dependency_nodes = {}\n for target in targets.iterkeys():\n build_file = gyp.common.BuildFile(target)\n if not build_file in dependency_nodes:\n dependency_nodes[build_file] = DependencyGraphNode(build_file)\n # Set up the dependency links.\n for target, spec in targets.iteritems():", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "DoDependentSettings", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def DoDependentSettings(key, flat_list, targets, dependency_nodes):\n # key should be one of all_dependent_settings, direct_dependent_settings,\n # or link_settings.\n for target in flat_list:\n target_dict = targets[target]\n build_file = gyp.common.BuildFile(target)\n if key == 'all_dependent_settings':\n dependencies = dependency_nodes[target].DeepDependencies()\n elif key == 'direct_dependent_settings':\n dependencies = \\", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "AdjustStaticLibraryDependencies", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes,\n sort_dependencies):\n # Recompute target \"dependencies\" properties. For each static library\n # target, remove \"dependencies\" entries referring to other static libraries,\n # unless the dependency has the \"hard_dependency\" attribute set. For each\n # linkable target, add a \"dependencies\" entry referring to all of the\n # target's computed list of link dependencies (including static libraries\n # if no such entry is already present.\n for target in flat_list:\n target_dict = targets[target]", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "MakePathRelative", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def MakePathRelative(to_file, fro_file, item):\n # If item is a relative path, it's relative to the build file dict that it's\n # coming from. Fix it up to make it relative to the build file dict that\n # it's going into.\n # Exception: any |item| that begins with these special characters is\n # returned without modification.\n # / Used when a path is already absolute (shortcut optimization;\n # such paths would be returned as absolute anyway)\n # $ Used for build environment variables\n # - Used for some build environment flags (such as -lapr-1 in a", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "MergeLists", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True):\n # Python documentation recommends objects which do not support hash\n # set this value to None. Python library objects follow this rule.\n is_hashable = lambda val: val.__hash__\n # If x is hashable, returns whether x is in s. Else returns whether x is in l.\n def is_in_set_or_list(x, s, l):\n if is_hashable(x):\n return x in s\n return x in l\n prepend_index = 0", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "MergeDicts", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def MergeDicts(to, fro, to_file, fro_file):\n # I wanted to name the parameter \"from\" but it's a Python keyword...\n for k, v in fro.iteritems():\n # It would be nice to do \"if not k in to: to[k] = v\" but that wouldn't give\n # copy semantics. Something else may want to merge from the |fro| dict\n # later, and having the same dict ref pointed to twice in the tree isn't\n # what anyone wants considering that the dicts may subsequently be\n # modified.\n if k in to:\n bad_merge = False", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "MergeConfigWithInheritance", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def MergeConfigWithInheritance(new_configuration_dict, build_file,\n target_dict, configuration, visited):\n # Skip if previously visted.\n if configuration in visited:\n return\n # Look at this configuration.\n configuration_dict = target_dict['configurations'][configuration]\n # Merge in parents.\n for parent in configuration_dict.get('inherit_from', []):\n MergeConfigWithInheritance(new_configuration_dict, build_file,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "SetUpConfigurations", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def SetUpConfigurations(target, target_dict):\n # key_suffixes is a list of key suffixes that might appear on key names.\n # These suffixes are handled in conditional evaluations (for =, +, and ?)\n # and rules/exclude processing (for ! and /). Keys with these suffixes\n # should be treated the same as keys without.\n key_suffixes = ['=', '+', '?', '!', '/']\n build_file = gyp.common.BuildFile(target)\n # Provide a single configuration by default if none exists.\n # TODO(mark): Signal an error if default_configurations exists but\n # configurations does not.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ProcessListFiltersInDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ProcessListFiltersInDict(name, the_dict):\n \"\"\"Process regular expression and exclusion-based filters on lists.\n An exclusion list is in a dict key named with a trailing \"!\", like\n \"sources!\". Every item in such a list is removed from the associated\n main list, which in this example, would be \"sources\". Removed items are\n placed into a \"sources_excluded\" list in the dict.\n Regular expression (regex) filters are contained in dict keys named with a\n trailing \"/\", such as \"sources/\" to operate on the \"sources\" list. Regex\n filters in a dict take the form:\n 'sources/': [ ['exclude', '_(linux|mac|win)\\\\.cc$'],", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ProcessListFiltersInList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ProcessListFiltersInList(name, the_list):\n for item in the_list:\n if type(item) is dict:\n ProcessListFiltersInDict(name, item)\n elif type(item) is list:\n ProcessListFiltersInList(name, item)\ndef ValidateTargetType(target, target_dict):\n \"\"\"Ensures the 'type' field on the target is one of the known types.\n Arguments:\n target: string, name of target.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ValidateTargetType", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ValidateTargetType(target, target_dict):\n \"\"\"Ensures the 'type' field on the target is one of the known types.\n Arguments:\n target: string, name of target.\n target_dict: dict, target spec.\n Raises an exception on error.\n \"\"\"\n VALID_TARGET_TYPES = ('executable', 'loadable_module',\n 'static_library', 'shared_library',\n 'mac_kernel_extension', 'none')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ValidateSourcesInTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ValidateSourcesInTarget(target, target_dict, build_file,\n duplicate_basename_check):\n if not duplicate_basename_check:\n return\n if target_dict.get('type', None) != 'static_library':\n return\n sources = target_dict.get('sources', [])\n basenames = {}\n for source in sources:\n name, ext = os.path.splitext(source)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ValidateRulesInTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules):\n \"\"\"Ensures that the rules sections in target_dict are valid and consistent,\n and determines which sources they apply to.\n Arguments:\n target: string, name of target.\n target_dict: dict, target spec containing \"rules\" and \"sources\" lists.\n extra_sources_for_rules: a list of keys to scan for rule matches in\n addition to 'sources'.\n \"\"\"\n # Dicts to map between values found in rules' 'rule_name' and 'extension'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ValidateRunAsInTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ValidateRunAsInTarget(target, target_dict, build_file):\n target_name = target_dict.get('target_name')\n run_as = target_dict.get('run_as')\n if not run_as:\n return\n if type(run_as) is not dict:\n raise GypError(\"The 'run_as' in target %s from file %s should be a \"\n \"dictionary.\" %\n (target_name, build_file))\n action = run_as.get('action')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "ValidateActionsInTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def ValidateActionsInTarget(target, target_dict, build_file):\n '''Validates the inputs to the actions in a target.'''\n target_name = target_dict.get('target_name')\n actions = target_dict.get('actions', [])\n for action in actions:\n action_name = action.get('action_name')\n if not action_name:\n raise GypError(\"Anonymous action in target %s. \"\n \"An action must have an 'action_name' field.\" %\n target_name)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "TurnIntIntoStrInDict", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def TurnIntIntoStrInDict(the_dict):\n \"\"\"Given dict the_dict, recursively converts all integers into strings.\n \"\"\"\n # Use items instead of iteritems because there's no need to try to look at\n # reinserted keys and their associated values.\n for k, v in the_dict.items():\n if type(v) is int:\n v = str(v)\n the_dict[k] = v\n elif type(v) is dict:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "TurnIntIntoStrInList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def TurnIntIntoStrInList(the_list):\n \"\"\"Given list the_list, recursively converts all integers into strings.\n \"\"\"\n for index in xrange(0, len(the_list)):\n item = the_list[index]\n if type(item) is int:\n the_list[index] = str(item)\n elif type(item) is dict:\n TurnIntIntoStrInDict(item)\n elif type(item) is list:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "PruneUnwantedTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets,\n data):\n \"\"\"Return only the targets that are deep dependencies of |root_targets|.\"\"\"\n qualified_root_targets = []\n for target in root_targets:\n target = target.strip()\n qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list)\n if not qualified_targets:\n raise GypError(\"Could not find target %s\" % target)\n qualified_root_targets.extend(qualified_targets)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "VerifyNoCollidingTargets", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def VerifyNoCollidingTargets(targets):\n \"\"\"Verify that no two targets in the same directory share the same name.\n Arguments:\n targets: A list of targets in the form 'path/to/file.gyp:target_name'.\n \"\"\"\n # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'.\n used = {}\n for target in targets:\n # Separate out 'path/to/file.gyp, 'target_name' from\n # 'path/to/file.gyp:target_name'.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "SetGeneratorGlobals", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def SetGeneratorGlobals(generator_input_info):\n # Set up path_sections and non_configuration_keys with the default data plus\n # the generator-specific data.\n global path_sections\n path_sections = set(base_path_sections)\n path_sections.update(generator_input_info['path_sections'])\n global non_configuration_keys\n non_configuration_keys = base_non_configuration_keys[:]\n non_configuration_keys.extend(generator_input_info['non_configuration_keys'])\n global multiple_toolsets", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "Load", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "def Load(build_files, variables, includes, depth, generator_input_info, check,\n circular_check, duplicate_basename_check, parallel, root_targets):\n SetGeneratorGlobals(generator_input_info)\n # A generator can have other lists (in addition to sources) be processed\n # for rules.\n extra_sources_for_rules = generator_input_info['extra_sources_for_rules']\n # Load build files. This loads every target-containing build file into\n # the |data| dictionary such that the keys to |data| are build file names,\n # and the values are the entire build file contents after \"early\" or \"pre\"\n # processing has been done and includes have been resolved.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "linkable_types", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "linkable_types = [\n 'executable',\n 'shared_library',\n 'loadable_module',\n 'mac_kernel_extension',\n]\n# A list of sections that contain links to other targets.\ndependency_sections = ['dependencies', 'export_dependent_settings']\n# base_path_sections is a list of sections defined by GYP that contain\n# pathnames. The generators can provide more keys, the two lists are merged", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "dependency_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "dependency_sections = ['dependencies', 'export_dependent_settings']\n# base_path_sections is a list of sections defined by GYP that contain\n# pathnames. The generators can provide more keys, the two lists are merged\n# into path_sections, but you should call IsPathSection instead of using either\n# list directly.\nbase_path_sections = [\n 'destination',\n 'files',\n 'include_dirs',\n 'inputs',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "base_path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "base_path_sections = [\n 'destination',\n 'files',\n 'include_dirs',\n 'inputs',\n 'libraries',\n 'outputs',\n 'sources',\n]\npath_sections = set()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "path_sections", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "path_sections = set()\n# These per-process dictionaries are used to cache build file data when loading\n# in parallel mode.\nper_process_data = {}\nper_process_aux_data = {}\ndef IsPathSection(section):\n # If section ends in one of the '=+?!' characters, it's applied to a section\n # without the trailing characters. '/' is notably absent from this list,\n # because there's no way for a regular expression to be treated as a path.\n while section and section[-1:] in '=+?!':", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "per_process_data", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "per_process_data = {}\nper_process_aux_data = {}\ndef IsPathSection(section):\n # If section ends in one of the '=+?!' characters, it's applied to a section\n # without the trailing characters. '/' is notably absent from this list,\n # because there's no way for a regular expression to be treated as a path.\n while section and section[-1:] in '=+?!':\n section = section[:-1]\n if section in path_sections:\n return True", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "per_process_aux_data", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "per_process_aux_data = {}\ndef IsPathSection(section):\n # If section ends in one of the '=+?!' characters, it's applied to a section\n # without the trailing characters. '/' is notably absent from this list,\n # because there's no way for a regular expression to be treated as a path.\n while section and section[-1:] in '=+?!':\n section = section[:-1]\n if section in path_sections:\n return True\n # Sections mathing the regexp '_(dir|file|path)s?$' are also", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "base_non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "base_non_configuration_keys = [\n # Sections that must exist inside targets and not configurations.\n 'actions',\n 'configurations',\n 'copies',\n 'default_configuration',\n 'dependencies',\n 'dependencies_original',\n 'libraries',\n 'postbuilds',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "non_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "non_configuration_keys = []\n# Keys that do not belong inside a configuration dictionary.\ninvalid_configuration_keys = [\n 'actions',\n 'all_dependent_settings',\n 'configurations',\n 'dependencies',\n 'direct_dependent_settings',\n 'libraries',\n 'link_settings',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "invalid_configuration_keys", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "invalid_configuration_keys = [\n 'actions',\n 'all_dependent_settings',\n 'configurations',\n 'dependencies',\n 'direct_dependent_settings',\n 'libraries',\n 'link_settings',\n 'sources',\n 'standalone_static_library',", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "multiple_toolsets", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "multiple_toolsets = False\n# Paths for converting filelist paths to output paths: {\n# toplevel,\n# qualified_output_dir,\n# }\ngenerator_filelist_paths = None\ndef GetIncludedBuildFiles(build_file_path, aux_data, included=None):\n \"\"\"Return a list of all build files included into build_file_path.\n The returned list will contain build_file_path as well as all other files\n that it included, either directly or indirectly. Note that the list may", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "generator_filelist_paths", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "generator_filelist_paths = None\ndef GetIncludedBuildFiles(build_file_path, aux_data, included=None):\n \"\"\"Return a list of all build files included into build_file_path.\n The returned list will contain build_file_path as well as all other files\n that it included, either directly or indirectly. Note that the list may\n contain files that were included into a conditional section that evaluated\n to false and was not merged into build_file_path's dict.\n aux_data is a dict containing a key for each build file or included build\n file. Those keys provide access to dicts whose \"included\" keys contain\n lists of all other files included by the build file.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "BRACKETS", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "BRACKETS = {'}': '{', ']': '[', ')': '('}\ndef FindEnclosingBracketGroup(input_str):\n stack = []\n start = -1\n for index, char in enumerate(input_str):\n if char in LBRACKETS:\n stack.append(char)\n if start == -1:\n start = index\n elif char in BRACKETS:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "early_variable_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "early_variable_re = re.compile(\n r'(?P(?P<(?:(?:!?@?)|\\|)?)'\n r'(?P[-a-zA-Z0-9_.]+)?'\n r'\\((?P\\s*\\[?)'\n r'(?P.*?)(\\]?)\\))')\n# This matches the same as early_variable_re, but with '>' instead of '<'.\nlate_variable_re = re.compile(\n r'(?P(?P>(?:(?:!?@?)|\\|)?)'\n r'(?P[-a-zA-Z0-9_.]+)?'\n r'\\((?P\\s*\\[?)'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "late_variable_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "late_variable_re = re.compile(\n r'(?P(?P>(?:(?:!?@?)|\\|)?)'\n r'(?P[-a-zA-Z0-9_.]+)?'\n r'\\((?P\\s*\\[?)'\n r'(?P.*?)(\\]?)\\))')\n# This matches the same as early_variable_re, but with '^' instead of '<'.\nlatelate_variable_re = re.compile(\n r'(?P(?P[\\^](?:(?:!?@?)|\\|)?)'\n r'(?P[-a-zA-Z0-9_.]+)?'\n r'\\((?P\\s*\\[?)'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "latelate_variable_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "latelate_variable_re = re.compile(\n r'(?P(?P[\\^](?:(?:!?@?)|\\|)?)'\n r'(?P[-a-zA-Z0-9_.]+)?'\n r'\\((?P\\s*\\[?)'\n r'(?P.*?)(\\]?)\\))')\n# Global cache of results from running commands so they don't have to be run\n# more then once.\ncached_command_results = {}\ndef FixupPlatformCommand(cmd):\n if sys.platform == 'win32':", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "cached_command_results", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "cached_command_results = {}\ndef FixupPlatformCommand(cmd):\n if sys.platform == 'win32':\n if type(cmd) is list:\n cmd = [re.sub('^cat ', 'type ', cmd[0])] + cmd[1:]\n else:\n cmd = re.sub('^cat ', 'type ', cmd)\n return cmd\nPHASE_EARLY = 0\nPHASE_LATE = 1", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "PHASE_EARLY", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "PHASE_EARLY = 0\nPHASE_LATE = 1\nPHASE_LATELATE = 2\ndef ExpandVariables(input, phase, variables, build_file):\n # Look for the pattern that gets expanded into variables\n if phase == PHASE_EARLY:\n variable_re = early_variable_re\n expansion_symbol = '<'\n elif phase == PHASE_LATE:\n variable_re = late_variable_re", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "PHASE_LATE", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "PHASE_LATE = 1\nPHASE_LATELATE = 2\ndef ExpandVariables(input, phase, variables, build_file):\n # Look for the pattern that gets expanded into variables\n if phase == PHASE_EARLY:\n variable_re = early_variable_re\n expansion_symbol = '<'\n elif phase == PHASE_LATE:\n variable_re = late_variable_re\n expansion_symbol = '>'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "PHASE_LATELATE", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "PHASE_LATELATE = 2\ndef ExpandVariables(input, phase, variables, build_file):\n # Look for the pattern that gets expanded into variables\n if phase == PHASE_EARLY:\n variable_re = early_variable_re\n expansion_symbol = '<'\n elif phase == PHASE_LATE:\n variable_re = late_variable_re\n expansion_symbol = '>'\n elif phase == PHASE_LATELATE:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "cached_conditions_asts", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "cached_conditions_asts = {}\ndef EvalCondition(condition, conditions_key, phase, variables, build_file):\n \"\"\"Returns the dict that should be used or None if the result was\n that nothing should be used.\"\"\"\n if type(condition) is not list:\n raise GypError(conditions_key + ' must be a list')\n if len(condition) < 2:\n # It's possible that condition[0] won't work in which case this\n # attempt will raise its own IndexError. That's probably fine.\n raise GypError(conditions_key + ' ' + condition[0] +", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "exception_re", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input", + "peekOfCode": "exception_re = re.compile(r'''[\"']?[-/$<>^]''')\ndef MakePathRelative(to_file, fro_file, item):\n # If item is a relative path, it's relative to the build file dict that it's\n # coming from. Fix it up to make it relative to the build file dict that\n # it's going into.\n # Exception: any |item| that begins with these special characters is\n # returned without modification.\n # / Used when a path is already absolute (shortcut optimization;\n # such paths would be returned as absolute anyway)\n # $ Used for build environment variables", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input", + "documentation": {} + }, + { + "label": "TestFindCycles", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.input_test", + "description": "node_modules.node-gyp.gyp.pylib.gyp.input_test", + "peekOfCode": "class TestFindCycles(unittest.TestCase):\n def setUp(self):\n self.nodes = {}\n for x in ('a', 'b', 'c', 'd', 'e'):\n self.nodes[x] = gyp.input.DependencyGraphNode(x)\n def _create_dependency(self, dependent, dependency):\n dependent.dependencies.append(dependency)\n dependency.dependents.append(dependent)\n def test_no_cycle_empty_graph(self):\n for label, node in self.nodes.iteritems():", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.input_test", + "documentation": {} + }, + { + "label": "MacTool", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.mac_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.mac_tool", + "peekOfCode": "class MacTool(object):\n \"\"\"This class performs all the Mac tooling steps. The methods can either be\n executed directly, or dispatched from an argument list.\"\"\"\n def Dispatch(self, args):\n \"\"\"Dispatches a string command to a method.\"\"\"\n if len(args) < 1:\n raise Exception(\"Not enough arguments\")\n method = \"Exec%s\" % self._CommandifyName(args[0])\n return getattr(self, method)(*args[1:])\n def _CommandifyName(self, name_string):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.mac_tool", + "documentation": {} + }, + { + "label": "main", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.mac_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.mac_tool", + "peekOfCode": "def main(args):\n executor = MacTool()\n exit_code = executor.Dispatch(args)\n if exit_code is not None:\n sys.exit(exit_code)\nclass MacTool(object):\n \"\"\"This class performs all the Mac tooling steps. The methods can either be\n executed directly, or dispatched from an argument list.\"\"\"\n def Dispatch(self, args):\n \"\"\"Dispatches a string command to a method.\"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.mac_tool", + "documentation": {} + }, + { + "label": "MsvsSettings", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "class MsvsSettings(object):\n \"\"\"A class that understands the gyp 'msvs_...' values (especially the\n msvs_settings field). They largely correpond to the VS2008 IDE DOM. This\n class helps map those settings to command line options.\"\"\"\n def __init__(self, spec, generator_flags):\n self.spec = spec\n self.vs_version = GetVSVersion(generator_flags)\n supported_fields = [\n ('msvs_configuration_attributes', dict),\n ('msvs_settings', dict),", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "PrecompiledHeader", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "class PrecompiledHeader(object):\n \"\"\"Helper to generate dependencies and build rules to handle generation of\n precompiled headers. Interface matches the GCH handler in xcode_emulation.py.\n \"\"\"\n def __init__(\n self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext):\n self.settings = settings\n self.config = config\n pch_source = self.settings.msvs_precompiled_source[self.config]\n self.pch_source = gyp_to_build_path(pch_source)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "QuoteForRspFile", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def QuoteForRspFile(arg):\n \"\"\"Quote a command line argument so that it appears as one argument when\n processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for\n Windows programs).\"\"\"\n # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment\n # threads. This is actually the quoting rules for CommandLineToArgvW, not\n # for the shell, because the shell doesn't do anything in Windows. This\n # works more or less because most programs (including the compiler, etc.)\n # use that function to handle command line arguments.\n # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "EncodeRspFileList", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def EncodeRspFileList(args):\n \"\"\"Process a list of arguments using QuoteCmdExeArgument.\"\"\"\n # Note that the first argument is assumed to be the command. Don't add\n # quotes around it because then built-ins like 'echo', etc. won't work.\n # Take care to normpath only the path in the case of 'call ../x.bat' because\n # otherwise the whole thing is incorrectly interpreted as a path and not\n # normalized correctly.\n if not args: return ''\n if args[0].startswith('call '):\n call, program = args[0].split(' ', 1)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "GetGlobalVSMacroEnv", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def GetGlobalVSMacroEnv(vs_version):\n \"\"\"Get a dict of variables mapping internal VS macro names to their gyp\n equivalents. Returns all variables that are independent of the target.\"\"\"\n env = {}\n # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when\n # Visual Studio is actually installed.\n if vs_version.Path():\n env['$(VSInstallDir)'] = vs_version.Path()\n env['$(VCInstallDir)'] = os.path.join(vs_version.Path(), 'VC') + '\\\\'\n # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "ExtractSharedMSVSSystemIncludes", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def ExtractSharedMSVSSystemIncludes(configs, generator_flags):\n \"\"\"Finds msvs_system_include_dirs that are common to all targets, removes\n them from all targets, and returns an OrderedSet containing them.\"\"\"\n all_system_includes = OrderedSet(\n configs[0].get('msvs_system_include_dirs', []))\n for config in configs[1:]:\n system_includes = config.get('msvs_system_include_dirs', [])\n all_system_includes = all_system_includes & OrderedSet(system_includes)\n if not all_system_includes:\n return None", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "GetVSVersion", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def GetVSVersion(generator_flags):\n global vs_version\n if not vs_version:\n vs_version = gyp.MSVSVersion.SelectVisualStudioVersion(\n generator_flags.get('msvs_version', 'auto'),\n allow_fallback=False)\n return vs_version\ndef _GetVsvarsSetupArgs(generator_flags, arch):\n vs = GetVSVersion(generator_flags)\n return vs.SetupScript()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "ExpandMacros", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def ExpandMacros(string, expansions):\n \"\"\"Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv\n for the canonical way to retrieve a suitable dict.\"\"\"\n if '$' in string:\n for old, new in expansions.iteritems():\n assert '$(' not in new, new\n string = string.replace(old, new)\n return string\ndef _ExtractImportantEnvironment(output_of_set):\n \"\"\"Extracts environment variables required for the toolchain to run from", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "GenerateEnvironmentFiles", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags,\n system_includes, open_out):\n \"\"\"It's not sufficient to have the absolute path to the compiler, linker,\n etc. on Windows, as those tools rely on .dlls being in the PATH. We also\n need to support both x86 and x64 compilers within the same build (to support\n msvs_target_platform hackery). Different architectures require a different\n compiler binary, and different supporting environment variables (INCLUDE,\n LIB, LIBPATH). So, we extract the environment here, wrap all invocations\n of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which\n sets up the environment, and then we do not prefix the compiler with", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "VerifyMissingSources", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja):\n \"\"\"Emulate behavior of msvs_error_on_missing_sources present in the msvs\n generator: Check that all regular source files, i.e. not created at run time,\n exist on disk. Missing files cause needless recompilation when building via\n VS, and we want this check to match for people/bots that build using ninja,\n so they're not surprised when the VS build fails.\"\"\"\n if int(generator_flags.get('msvs_error_on_missing_sources', 0)):\n no_specials = filter(lambda x: '$' not in x, sources)\n relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials]\n missing = filter(lambda x: not os.path.exists(x), relative)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "CalculateCommonVariables", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "def CalculateCommonVariables(default_variables, params):\n generator_flags = params.get('generator_flags', {})\n # Set a variable so conditions can be based on msvs_version.\n msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags)\n default_variables['MSVS_VERSION'] = msvs_version.ShortName()\n # To determine processor word size on Windows, in addition to checking\n # PROCESSOR_ARCHITECTURE (which reflects the word size of the current\n # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which\n # contains the actual word size of the system when running thru WOW64).\n if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "windows_quoter_regex", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "windows_quoter_regex = re.compile(r'(\\\\*)\"')\ndef QuoteForRspFile(arg):\n \"\"\"Quote a command line argument so that it appears as one argument when\n processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for\n Windows programs).\"\"\"\n # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment\n # threads. This is actually the quoting rules for CommandLineToArgvW, not\n # for the shell, because the shell doesn't do anything in Windows. This\n # works more or less because most programs (including the compiler, etc.)\n # use that function to handle command line arguments.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "vs_version", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "peekOfCode": "vs_version = None\ndef GetVSVersion(generator_flags):\n global vs_version\n if not vs_version:\n vs_version = gyp.MSVSVersion.SelectVisualStudioVersion(\n generator_flags.get('msvs_version', 'auto'),\n allow_fallback=False)\n return vs_version\ndef _GetVsvarsSetupArgs(generator_flags, arch):\n vs = GetVSVersion(generator_flags)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.msvs_emulation", + "documentation": {} + }, + { + "label": "Writer", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "description": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "peekOfCode": "class Writer(object):\n def __init__(self, output, width=78):\n self.output = output\n self.width = width\n def newline(self):\n self.output.write('\\n')\n def comment(self, text):\n for line in textwrap.wrap(text, self.width - 2):\n self.output.write('# ' + line + '\\n')\n def variable(self, key, value, indent=0):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "documentation": {} + }, + { + "label": "escape_path", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "description": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "peekOfCode": "def escape_path(word):\n return word.replace('$ ','$$ ').replace(' ','$ ').replace(':', '$:')\nclass Writer(object):\n def __init__(self, output, width=78):\n self.output = output\n self.width = width\n def newline(self):\n self.output.write('\\n')\n def comment(self, text):\n for line in textwrap.wrap(text, self.width - 2):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "documentation": {} + }, + { + "label": "escape", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "description": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "peekOfCode": "def escape(string):\n \"\"\"Escape a string such that it can be embedded into a Ninja file without\n further interpretation.\"\"\"\n assert '\\n' not in string, 'Ninja syntax does not allow newlines'\n # We only have one special metacharacter: '$'.\n return string.replace('$', '$$')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.ninja_syntax", + "documentation": {} + }, + { + "label": "OrderedDict", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.ordered_dict", + "description": "node_modules.node-gyp.gyp.pylib.gyp.ordered_dict", + "peekOfCode": "class OrderedDict(dict):\n 'Dictionary that remembers insertion order'\n # An inherited dict maps keys to values.\n # The inherited dict provides __getitem__, __len__, __contains__, and get.\n # The remaining methods are order-aware.\n # Big-O running times for all methods are the same as for regular dictionaries.\n # The internal self.__map dictionary maps keys to links in a doubly linked list.\n # The circular doubly linked list starts and ends with a sentinel element.\n # The sentinel element never gets deleted (this simplifies the algorithm).\n # Each link is stored as a list of length three: [PREV, NEXT, KEY].", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.ordered_dict", + "documentation": {} + }, + { + "label": "Error", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "description": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "peekOfCode": "class Error(Exception):\n pass\n__all__ = [\"Error\", \"deepcopy\"]\ndef deepcopy(x):\n \"\"\"Deep copy operation on gyp objects such as strings, ints, dicts\n and lists. More than twice as fast as copy.deepcopy but much less\n generic.\"\"\"\n try:\n return _deepcopy_dispatch[type(x)](x)\n except KeyError:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "documentation": {} + }, + { + "label": "deepcopy", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "description": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "peekOfCode": "def deepcopy(x):\n \"\"\"Deep copy operation on gyp objects such as strings, ints, dicts\n and lists. More than twice as fast as copy.deepcopy but much less\n generic.\"\"\"\n try:\n return _deepcopy_dispatch[type(x)](x)\n except KeyError:\n raise Error('Unsupported type %s for deepcopy. Use copy.deepcopy ' +\n 'or expand simple_copy support.' % type(x))\n_deepcopy_dispatch = d = {}", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "documentation": {} + }, + { + "label": "__all__", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "description": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "peekOfCode": "__all__ = [\"Error\", \"deepcopy\"]\ndef deepcopy(x):\n \"\"\"Deep copy operation on gyp objects such as strings, ints, dicts\n and lists. More than twice as fast as copy.deepcopy but much less\n generic.\"\"\"\n try:\n return _deepcopy_dispatch[type(x)](x)\n except KeyError:\n raise Error('Unsupported type %s for deepcopy. Use copy.deepcopy ' +\n 'or expand simple_copy support.' % type(x))", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "documentation": {} + }, + { + "label": "_deepcopy_dispatch", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "description": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "peekOfCode": "_deepcopy_dispatch = d = {}\ndef _deepcopy_atomic(x):\n return x\nfor x in (type(None), int, long, float,\n bool, str, unicode, type):\n d[x] = _deepcopy_atomic\ndef _deepcopy_list(x):\n return [deepcopy(a) for a in x]\nd[list] = _deepcopy_list\ndef _deepcopy_dict(x):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "documentation": {} + }, + { + "label": "d[list]", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "description": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "peekOfCode": "d[list] = _deepcopy_list\ndef _deepcopy_dict(x):\n y = {}\n for key, value in x.iteritems():\n y[deepcopy(key)] = deepcopy(value)\n return y\nd[dict] = _deepcopy_dict\ndel d", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "documentation": {} + }, + { + "label": "d[dict]", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "description": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "peekOfCode": "d[dict] = _deepcopy_dict\ndel d", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.simple_copy", + "documentation": {} + }, + { + "label": "WinTool", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "peekOfCode": "class WinTool(object):\n \"\"\"This class performs all the Windows tooling steps. The methods can either\n be executed directly, or dispatched from an argument list.\"\"\"\n def _UseSeparateMspdbsrv(self, env, args):\n \"\"\"Allows to use a unique instance of mspdbsrv.exe per linker instead of a\n shared one.\"\"\"\n if len(args) < 1:\n raise Exception(\"Not enough arguments\")\n if args[0] != 'link.exe':\n return", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "documentation": {} + }, + { + "label": "main", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "peekOfCode": "def main(args):\n executor = WinTool()\n exit_code = executor.Dispatch(args)\n if exit_code is not None:\n sys.exit(exit_code)\nclass WinTool(object):\n \"\"\"This class performs all the Windows tooling steps. The methods can either\n be executed directly, or dispatched from an argument list.\"\"\"\n def _UseSeparateMspdbsrv(self, env, args):\n \"\"\"Allows to use a unique instance of mspdbsrv.exe per linker instead of a", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "documentation": {} + }, + { + "label": "BASE_DIR", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "peekOfCode": "BASE_DIR = os.path.dirname(os.path.abspath(__file__))\n# A regex matching an argument corresponding to the output filename passed to\n# link.exe.\n_LINK_EXE_OUT_ARG = re.compile('/OUT:(?P.+)$', re.IGNORECASE)\ndef main(args):\n executor = WinTool()\n exit_code = executor.Dispatch(args)\n if exit_code is not None:\n sys.exit(exit_code)\nclass WinTool(object):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "documentation": {} + }, + { + "label": "_LINK_EXE_OUT_ARG", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "description": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "peekOfCode": "_LINK_EXE_OUT_ARG = re.compile('/OUT:(?P.+)$', re.IGNORECASE)\ndef main(args):\n executor = WinTool()\n exit_code = executor.Dispatch(args)\n if exit_code is not None:\n sys.exit(exit_code)\nclass WinTool(object):\n \"\"\"This class performs all the Windows tooling steps. The methods can either\n be executed directly, or dispatched from an argument list.\"\"\"\n def _UseSeparateMspdbsrv(self, env, args):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.win_tool", + "documentation": {} + }, + { + "label": "XcodeArchsDefault", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "class XcodeArchsDefault(object):\n \"\"\"A class to resolve ARCHS variable from xcode_settings, resolving Xcode\n macros and implementing filtering by VALID_ARCHS. The expansion of macros\n depends on the SDKROOT used (\"macosx\", \"iphoneos\", \"iphonesimulator\") and\n on the version of Xcode.\n \"\"\"\n # Match variable like $(ARCHS_STANDARD).\n variable_pattern = re.compile(r'\\$\\([a-zA-Z_][a-zA-Z0-9_]*\\)$')\n def __init__(self, default, mac, iphonesimulator, iphoneos):\n self._default = (default,)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "XcodeSettings", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "class XcodeSettings(object):\n \"\"\"A class that understands the gyp 'xcode_settings' object.\"\"\"\n # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached\n # at class-level for efficiency.\n _sdk_path_cache = {}\n _sdk_root_cache = {}\n # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so\n # cached at class-level for efficiency.\n _plist_cache = {}\n # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "MacPrefixHeader", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "class MacPrefixHeader(object):\n \"\"\"A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature.\n This feature consists of several pieces:\n * If GCC_PREFIX_HEADER is present, all compilations in that project get an\n additional |-include path_to_prefix_header| cflag.\n * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is\n instead compiled, and all other compilations in the project get an\n additional |-include path_to_compiled_header| instead.\n + Compiled prefix headers have the extension gch. There is one gch file for\n every language used in the project (c, cc, m, mm), since gch files for", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "XcodeArchsVariableMapping", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def XcodeArchsVariableMapping(archs, archs_including_64_bit=None):\n \"\"\"Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable,\n and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).\"\"\"\n mapping = {'$(ARCHS_STANDARD)': archs}\n if archs_including_64_bit:\n mapping['$(ARCHS_STANDARD_INCLUDING_64_BIT)'] = archs_including_64_bit\n return mapping\nclass XcodeArchsDefault(object):\n \"\"\"A class to resolve ARCHS variable from xcode_settings, resolving Xcode\n macros and implementing filtering by VALID_ARCHS. The expansion of macros", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetXcodeArchsDefault", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetXcodeArchsDefault():\n \"\"\"Returns the |XcodeArchsDefault| object to use to expand ARCHS for the\n installed version of Xcode. The default values used by Xcode for ARCHS\n and the expansion of the variables depends on the version of Xcode used.\n For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included\n uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses\n $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0\n and deprecated with Xcode 5.1.\n For \"macosx\" SDKROOT, all version starting with Xcode 5.0 includes 64-bit\n architecture as part of $(ARCHS_STANDARD) and default to only building it.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "XcodeVersion", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def XcodeVersion():\n \"\"\"Returns a tuple of version and build version of installed Xcode.\"\"\"\n # `xcodebuild -version` output looks like\n # Xcode 4.6.3\n # Build version 4H1503\n # or like\n # Xcode 3.2.6\n # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0\n # BuildVersion: 10M2518\n # Convert that to '0463', '4H1503'.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "CLTVersion", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def CLTVersion():\n \"\"\"Returns the version of command-line tools from pkgutil.\"\"\"\n # pkgutil output looks like\n # package-id: com.apple.pkg.CLTools_Executables\n # version: 5.0.1.0.1.1382131676\n # volume: /\n # location: /\n # install-time: 1382544035\n # groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group\n STANDALONE_PKG_ID = \"com.apple.pkg.DeveloperToolsCLILeo\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetStdoutQuiet", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetStdoutQuiet(cmdlist):\n \"\"\"Returns the content of standard output returned by invoking |cmdlist|.\n Ignores the stderr.\n Raises |GypError| if the command return with a non-zero return code.\"\"\"\n job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n out = job.communicate()[0]\n if job.returncode != 0:\n raise GypError('Error %d running %s' % (job.returncode, cmdlist[0]))\n return out.rstrip('\\n')\ndef GetStdout(cmdlist):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetStdout", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetStdout(cmdlist):\n \"\"\"Returns the content of standard output returned by invoking |cmdlist|.\n Raises |GypError| if the command return with a non-zero return code.\"\"\"\n job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)\n out = job.communicate()[0]\n if job.returncode != 0:\n sys.stderr.write(out + '\\n')\n raise GypError('Error %d running %s' % (job.returncode, cmdlist[0]))\n return out.rstrip('\\n')\ndef MergeGlobalXcodeSettingsToSpec(global_dict, spec):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "MergeGlobalXcodeSettingsToSpec", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def MergeGlobalXcodeSettingsToSpec(global_dict, spec):\n \"\"\"Merges the global xcode_settings dictionary into each configuration of the\n target represented by spec. For keys that are both in the global and the local\n xcode_settings dict, the local key gets precendence.\n \"\"\"\n # The xcode generator special-cases global xcode_settings and does something\n # that amounts to merging in the global xcode_settings into each local\n # xcode_settings dict.\n global_xcode_settings = global_dict.get('xcode_settings', {})\n for config in spec['configurations'].values():", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "IsMacBundle", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def IsMacBundle(flavor, spec):\n \"\"\"Returns if |spec| should be treated as a bundle.\n Bundles are directories with a certain subdirectory structure, instead of\n just a single file. Bundle rules do not produce a binary but also package\n resources into that directory.\"\"\"\n is_mac_bundle = (int(spec.get('mac_bundle', 0)) != 0 and flavor == 'mac')\n if is_mac_bundle:\n assert spec['type'] != 'none', (\n 'mac_bundle targets cannot have type none (target \"%s\")' %\n spec['target_name'])", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetMacBundleResources", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetMacBundleResources(product_dir, xcode_settings, resources):\n \"\"\"Yields (output, resource) pairs for every resource in |resources|.\n Only call this for mac bundle targets.\n Args:\n product_dir: Path to the directory containing the output bundle,\n relative to the build directory.\n xcode_settings: The XcodeSettings of the current target.\n resources: A list of bundle resources, relative to the build directory.\n \"\"\"\n dest = os.path.join(product_dir,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetMacInfoPlist", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path):\n \"\"\"Returns (info_plist, dest_plist, defines, extra_env), where:\n * |info_plist| is the source plist path, relative to the\n build directory,\n * |dest_plist| is the destination plist path, relative to the\n build directory,\n * |defines| is a list of preprocessor defines (empty if the plist\n shouldn't be preprocessed,\n * |extra_env| is a dict of env variables that should be exported when\n invoking |mac_tool copy-info-plist|.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "ExpandEnvVars", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def ExpandEnvVars(string, expansions):\n \"\"\"Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the\n expansions list. If the variable expands to something that references\n another variable, this variable is expanded as well if it's in env --\n until no variables present in env are left.\"\"\"\n for k, v in reversed(expansions):\n string = string.replace('${' + k + '}', v)\n string = string.replace('$(' + k + ')', v)\n string = string.replace('$' + k, v)\n return string", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetSortedXcodeEnv", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetSortedXcodeEnv(xcode_settings, built_products_dir, srcroot,\n configuration, additional_settings=None):\n env = _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration,\n additional_settings)\n return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)]\ndef GetSpecPostbuildCommands(spec, quiet=False):\n \"\"\"Returns the list of postbuilds explicitly defined on |spec|, in a form\n executable by a shell.\"\"\"\n postbuilds = []\n for postbuild in spec.get('postbuilds', []):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "GetSpecPostbuildCommands", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def GetSpecPostbuildCommands(spec, quiet=False):\n \"\"\"Returns the list of postbuilds explicitly defined on |spec|, in a form\n executable by a shell.\"\"\"\n postbuilds = []\n for postbuild in spec.get('postbuilds', []):\n if not quiet:\n postbuilds.append('echo POSTBUILD\\\\(%s\\\\) %s' % (\n spec['target_name'], postbuild['postbuild_name']))\n postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action']))\n return postbuilds", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "CloneConfigurationForDeviceAndEmulator", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "def CloneConfigurationForDeviceAndEmulator(target_dicts):\n \"\"\"If |target_dicts| contains any iOS targets, automatically create -iphoneos\n targets for iOS device builds.\"\"\"\n if _HasIOSTarget(target_dicts):\n return _AddIOSDeviceConfigurations(target_dicts)\n return target_dicts", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "XCODE_VERSION_CACHE", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "XCODE_VERSION_CACHE = None\n# Populated lazily by GetXcodeArchsDefault, to an |XcodeArchsDefault| instance\n# corresponding to the installed version of Xcode.\nXCODE_ARCHS_DEFAULT_CACHE = None\ndef XcodeArchsVariableMapping(archs, archs_including_64_bit=None):\n \"\"\"Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable,\n and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).\"\"\"\n mapping = {'$(ARCHS_STANDARD)': archs}\n if archs_including_64_bit:\n mapping['$(ARCHS_STANDARD_INCLUDING_64_BIT)'] = archs_including_64_bit", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "XCODE_ARCHS_DEFAULT_CACHE", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "peekOfCode": "XCODE_ARCHS_DEFAULT_CACHE = None\ndef XcodeArchsVariableMapping(archs, archs_including_64_bit=None):\n \"\"\"Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable,\n and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).\"\"\"\n mapping = {'$(ARCHS_STANDARD)': archs}\n if archs_including_64_bit:\n mapping['$(ARCHS_STANDARD_INCLUDING_64_BIT)'] = archs_including_64_bit\n return mapping\nclass XcodeArchsDefault(object):\n \"\"\"A class to resolve ARCHS variable from xcode_settings, resolving Xcode", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_emulation", + "documentation": {} + }, + { + "label": "IsValidTargetForWrapper", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_ninja", + "peekOfCode": "def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec):\n \"\"\"Limit targets for Xcode wrapper.\n Xcode sometimes performs poorly with too many targets, so only include\n proper executable targets, with filters to customize.\n Arguments:\n target_extras: Regular expression to always add, matching any target.\n executable_target_pattern: Regular expression limiting executable targets.\n spec: Specifications for target.\n \"\"\"\n target_name = spec.get('target_name')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_ninja", + "documentation": {} + }, + { + "label": "CreateWrapper", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcode_ninja", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcode_ninja", + "peekOfCode": "def CreateWrapper(target_list, target_dicts, data, params):\n \"\"\"Initialize targets for the ninja wrapper.\n This sets up the necessary variables in the targets to generate Xcode projects\n that use ninja as an external builder.\n Arguments:\n target_list: List of target pairs: 'base/base.gyp:base'.\n target_dicts: Dict of target properties keyed on target pair.\n data: Dict of flattened build files keyed on gyp path.\n params: Dict of global options for gyp.\n \"\"\"", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcode_ninja", + "documentation": {} + }, + { + "label": "XCObject", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCObject(object):\n \"\"\"The abstract base of all class types used in Xcode project files.\n Class variables:\n _schema: A dictionary defining the properties of this class. The keys to\n _schema are string property keys as used in project files. Values\n are a list of four or five elements:\n [ is_list, property_type, is_strong, is_required, default ]\n is_list: True if the property described is a list, as opposed\n to a single element.\n property_type: The type to use as the value of the property,", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCHierarchicalElement", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCHierarchicalElement(XCObject):\n \"\"\"Abstract base for PBXGroup and PBXFileReference. Not represented in a\n project file.\"\"\"\n # TODO(mark): Do name and path belong here? Probably so.\n # If path is set and name is not, name may have a default value. Name will\n # be set to the basename of path, if the basename of path is different from\n # the full value of path. If path is already just a leaf name, name will\n # not be set.\n _schema = XCObject._schema.copy()\n _schema.update({", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXGroup", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXGroup(XCHierarchicalElement):\n \"\"\"\n Attributes:\n _children_by_path: Maps pathnames of children of this PBXGroup to the\n actual child XCHierarchicalElement objects.\n _variant_children_by_name_and_path: Maps (name, path) tuples of\n PBXVariantGroup children to the actual child PBXVariantGroup objects.\n \"\"\"\n _schema = XCHierarchicalElement._schema.copy()\n _schema.update({", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCFileLikeElement", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCFileLikeElement(XCHierarchicalElement):\n # Abstract base for objects that can be used as the fileRef property of\n # PBXBuildFile.\n def PathHashables(self):\n # A PBXBuildFile that refers to this object will call this method to\n # obtain additional hashables specific to this XCFileLikeElement. Don't\n # just use this object's hashables, they're not specific and unique enough\n # on their own (without access to the parent hashables.) Instead, provide\n # hashables that identify this object by path by getting its hashables as\n # well as the hashables of ancestor XCHierarchicalElement objects.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCContainerPortal", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCContainerPortal(XCObject):\n # Abstract base for objects that can be used as the containerPortal property\n # of PBXContainerItemProxy.\n pass\nclass XCRemoteObject(XCObject):\n # Abstract base for objects that can be used as the remoteGlobalIDString\n # property of PBXContainerItemProxy.\n pass\nclass PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject):\n _schema = XCFileLikeElement._schema.copy()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCRemoteObject", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCRemoteObject(XCObject):\n # Abstract base for objects that can be used as the remoteGlobalIDString\n # property of PBXContainerItemProxy.\n pass\nclass PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject):\n _schema = XCFileLikeElement._schema.copy()\n _schema.update({\n 'explicitFileType': [0, str, 0, 0],\n 'lastKnownFileType': [0, str, 0, 0],\n 'name': [0, str, 0, 0],", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXFileReference", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject):\n _schema = XCFileLikeElement._schema.copy()\n _schema.update({\n 'explicitFileType': [0, str, 0, 0],\n 'lastKnownFileType': [0, str, 0, 0],\n 'name': [0, str, 0, 0],\n 'path': [0, str, 0, 1],\n })\n # Weird output rules for PBXFileReference.\n _should_print_single_line = True", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXVariantGroup", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXVariantGroup(PBXGroup, XCFileLikeElement):\n \"\"\"PBXVariantGroup is used by Xcode to represent localizations.\"\"\"\n # No additions to the schema relative to PBXGroup.\n pass\n# PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below\n# because it uses PBXContainerItemProxy, defined below.\nclass XCBuildConfiguration(XCObject):\n _schema = XCObject._schema.copy()\n _schema.update({\n 'baseConfigurationReference': [0, PBXFileReference, 0, 0],", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCBuildConfiguration", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCBuildConfiguration(XCObject):\n _schema = XCObject._schema.copy()\n _schema.update({\n 'baseConfigurationReference': [0, PBXFileReference, 0, 0],\n 'buildSettings': [0, dict, 0, 1, {}],\n 'name': [0, str, 0, 1],\n })\n def HasBuildSetting(self, key):\n return key in self._properties['buildSettings']\n def GetBuildSetting(self, key):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCConfigurationList", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCConfigurationList(XCObject):\n # _configs is the default list of configurations.\n _configs = [ XCBuildConfiguration({'name': 'Debug'}),\n XCBuildConfiguration({'name': 'Release'}) ]\n _schema = XCObject._schema.copy()\n _schema.update({\n 'buildConfigurations': [1, XCBuildConfiguration, 1, 1, _configs],\n 'defaultConfigurationIsVisible': [0, int, 0, 1, 1],\n 'defaultConfigurationName': [0, str, 0, 1, 'Release'],\n })", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXBuildFile", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXBuildFile(XCObject):\n _schema = XCObject._schema.copy()\n _schema.update({\n 'fileRef': [0, XCFileLikeElement, 0, 1],\n 'settings': [0, str, 0, 0], # hack, it's a dict\n })\n # Weird output rules for PBXBuildFile.\n _should_print_single_line = True\n _encode_transforms = XCObject._alternate_encode_transforms\n def Name(self):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCBuildPhase(XCObject):\n \"\"\"Abstract base for build phase classes. Not represented in a project\n file.\n Attributes:\n _files_by_path: A dict mapping each path of a child in the files list by\n path (keys) to the corresponding PBXBuildFile children (values).\n _files_by_xcfilelikeelement: A dict mapping each XCFileLikeElement (keys)\n to the corresponding PBXBuildFile children (values).\n \"\"\"\n # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXHeadersBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXHeadersBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Headers'\n def FileGroup(self, path):\n return self.PBXProjectAncestor().RootGroupForPath(path)\nclass PBXResourcesBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Resources'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXResourcesBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXResourcesBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Resources'\n def FileGroup(self, path):\n return self.PBXProjectAncestor().RootGroupForPath(path)\nclass PBXSourcesBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Sources'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXSourcesBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXSourcesBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Sources'\n def FileGroup(self, path):\n return self.PBXProjectAncestor().RootGroupForPath(path)\nclass PBXFrameworksBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Frameworks'", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXFrameworksBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXFrameworksBuildPhase(XCBuildPhase):\n # No additions to the schema relative to XCBuildPhase.\n def Name(self):\n return 'Frameworks'\n def FileGroup(self, path):\n (root, ext) = posixpath.splitext(path)\n if ext != '':\n ext = ext[1:].lower()\n if ext == 'o':\n # .o files are added to Xcode Frameworks phases, but conceptually aren't", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXShellScriptBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXShellScriptBuildPhase(XCBuildPhase):\n _schema = XCBuildPhase._schema.copy()\n _schema.update({\n 'inputPaths': [1, str, 0, 1, []],\n 'name': [0, str, 0, 0],\n 'outputPaths': [1, str, 0, 1, []],\n 'shellPath': [0, str, 0, 1, '/bin/sh'],\n 'shellScript': [0, str, 0, 1],\n 'showEnvVarsInLog': [0, int, 0, 0],\n })", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXCopyFilesBuildPhase", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXCopyFilesBuildPhase(XCBuildPhase):\n _schema = XCBuildPhase._schema.copy()\n _schema.update({\n 'dstPath': [0, str, 0, 1],\n 'dstSubfolderSpec': [0, int, 0, 1],\n 'name': [0, str, 0, 0],\n })\n # path_tree_re matches \"$(DIR)/path\" or just \"$(DIR)\". Match group 1 is\n # \"DIR\", match group 3 is \"path\" or None.\n path_tree_re = re.compile('^\\\\$\\\\((.*)\\\\)(/(.*)|)$')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXBuildRule", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXBuildRule(XCObject):\n _schema = XCObject._schema.copy()\n _schema.update({\n 'compilerSpec': [0, str, 0, 1],\n 'filePatterns': [0, str, 0, 0],\n 'fileType': [0, str, 0, 1],\n 'isEditable': [0, int, 0, 1, 1],\n 'outputFiles': [1, str, 0, 1, []],\n 'script': [0, str, 0, 0],\n })", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXContainerItemProxy", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXContainerItemProxy(XCObject):\n # When referencing an item in this project file, containerPortal is the\n # PBXProject root object of this project file. When referencing an item in\n # another project file, containerPortal is a PBXFileReference identifying\n # the other project file.\n #\n # When serving as a proxy to an XCTarget (in this project file or another),\n # proxyType is 1. When serving as a proxy to a PBXFileReference (in another\n # project file), proxyType is 2. Type 2 is used for references to the\n # producs of the other project file's targets.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXTargetDependency", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXTargetDependency(XCObject):\n # The \"target\" property accepts an XCTarget object, and obviously not\n # NoneType. But XCTarget is defined below, so it can't be put into the\n # schema yet. The definition of PBXTargetDependency can't be moved below\n # XCTarget because XCTarget's own schema references PBXTargetDependency.\n # Python doesn't deal well with this circular relationship, and doesn't have\n # a real way to do forward declarations. To work around, the type of\n # the \"target\" property is reset below, after XCTarget is defined.\n #\n # At least one of \"name\" and \"target\" is required.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXReferenceProxy", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXReferenceProxy(XCFileLikeElement):\n _schema = XCFileLikeElement._schema.copy()\n _schema.update({\n 'fileType': [0, str, 0, 1],\n 'path': [0, str, 0, 1],\n 'remoteRef': [0, PBXContainerItemProxy, 1, 1],\n })\nclass XCTarget(XCRemoteObject):\n # An XCTarget is really just an XCObject, the XCRemoteObject thing is just\n # to allow PBXProject to be used in the remoteGlobalIDString property of", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCTarget", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCTarget(XCRemoteObject):\n # An XCTarget is really just an XCObject, the XCRemoteObject thing is just\n # to allow PBXProject to be used in the remoteGlobalIDString property of\n # PBXContainerItemProxy.\n #\n # Setting a \"name\" property at instantiation may also affect \"productName\",\n # which may in turn affect the \"PRODUCT_NAME\" build setting in children of\n # \"buildConfigurationList\". See __init__ below.\n _schema = XCRemoteObject._schema.copy()\n _schema.update({", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXNativeTarget", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXNativeTarget(XCTarget):\n # buildPhases is overridden in the schema to be able to set defaults.\n #\n # NOTE: Contrary to most objects, it is advisable to set parent when\n # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject\n # object. A parent reference is required for a PBXNativeTarget during\n # construction to be able to set up the target defaults for productReference,\n # because a PBXBuildFile object must be created for the target and it must\n # be added to the PBXProject's mainGroup hierarchy.\n _schema = XCTarget._schema.copy()", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXAggregateTarget", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXAggregateTarget(XCTarget):\n pass\nclass PBXProject(XCContainerPortal):\n # A PBXProject is really just an XCObject, the XCContainerPortal thing is\n # just to allow PBXProject to be used in the containerPortal property of\n # PBXContainerItemProxy.\n \"\"\"\n Attributes:\n path: \"sample.xcodeproj\". TODO(mark) Document me!\n _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXProject", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class PBXProject(XCContainerPortal):\n # A PBXProject is really just an XCObject, the XCContainerPortal thing is\n # just to allow PBXProject to be used in the containerPortal property of\n # PBXContainerItemProxy.\n \"\"\"\n Attributes:\n path: \"sample.xcodeproj\". TODO(mark) Document me!\n _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each\n value is a reference to the dict in the\n projectReferences list associated with the keyed", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XCProjectFile", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "class XCProjectFile(XCObject):\n _schema = XCObject._schema.copy()\n _schema.update({\n 'archiveVersion': [0, int, 0, 1, 1],\n 'classes': [0, dict, 0, 1, {}],\n 'objectVersion': [0, int, 0, 1, 46],\n 'rootObject': [0, PBXProject, 1, 1],\n })\n def ComputeIDs(self, recursive=True, overwrite=True, hash=None):\n # Although XCProjectFile is implemented here as an XCObject, it's not a", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "SourceTreeAndPathFromPath", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "def SourceTreeAndPathFromPath(input_path):\n \"\"\"Given input_path, returns a tuple with sourceTree and path values.\n Examples:\n input_path (source_tree, output_path)\n '$(VAR)/path' ('VAR', 'path')\n '$(VAR)' ('VAR', None)\n 'path' (None, 'path')\n \"\"\"\n source_group_match = _path_leading_variable.match(input_path)\n if source_group_match:", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "ConvertVariablesToShellSyntax", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "def ConvertVariablesToShellSyntax(input_string):\n return re.sub(r'\\$\\((.*?)\\)', '${\\\\1}', input_string)\nclass XCObject(object):\n \"\"\"The abstract base of all class types used in Xcode project files.\n Class variables:\n _schema: A dictionary defining the properties of this class. The keys to\n _schema are string property keys as used in project files. Values\n are a list of four or five elements:\n [ is_list, property_type, is_strong, is_required, default ]\n is_list: True if the property described is a list, as opposed", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "_unquoted", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "_unquoted = re.compile('^[A-Za-z0-9$./_]+$')\n# Strings that match this pattern are quoted regardless of what _unquoted says.\n# Oddly, Xcode will quote any string with a run of three or more underscores.\n_quoted = re.compile('___')\n# This pattern should match any character that needs to be escaped by\n# XCObject._EncodeString. See that function.\n_escaped = re.compile('[\\\\\\\\\"]|[\\x00-\\x1f]')\n# Used by SourceTreeAndPathFromPath\n_path_leading_variable = re.compile(r'^\\$\\((.*?)\\)(/(.*))?$')\ndef SourceTreeAndPathFromPath(input_path):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "_quoted", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "_quoted = re.compile('___')\n# This pattern should match any character that needs to be escaped by\n# XCObject._EncodeString. See that function.\n_escaped = re.compile('[\\\\\\\\\"]|[\\x00-\\x1f]')\n# Used by SourceTreeAndPathFromPath\n_path_leading_variable = re.compile(r'^\\$\\((.*?)\\)(/(.*))?$')\ndef SourceTreeAndPathFromPath(input_path):\n \"\"\"Given input_path, returns a tuple with sourceTree and path values.\n Examples:\n input_path (source_tree, output_path)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "_escaped", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "_escaped = re.compile('[\\\\\\\\\"]|[\\x00-\\x1f]')\n# Used by SourceTreeAndPathFromPath\n_path_leading_variable = re.compile(r'^\\$\\((.*?)\\)(/(.*))?$')\ndef SourceTreeAndPathFromPath(input_path):\n \"\"\"Given input_path, returns a tuple with sourceTree and path values.\n Examples:\n input_path (source_tree, output_path)\n '$(VAR)/path' ('VAR', 'path')\n '$(VAR)' ('VAR', None)\n 'path' (None, 'path')", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "_path_leading_variable", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "_path_leading_variable = re.compile(r'^\\$\\((.*?)\\)(/(.*))?$')\ndef SourceTreeAndPathFromPath(input_path):\n \"\"\"Given input_path, returns a tuple with sourceTree and path values.\n Examples:\n input_path (source_tree, output_path)\n '$(VAR)/path' ('VAR', 'path')\n '$(VAR)' ('VAR', None)\n 'path' (None, 'path')\n \"\"\"\n source_group_match = _path_leading_variable.match(input_path)", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "PBXTargetDependency._schema['target'][1]", + "kind": 5, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "peekOfCode": "PBXTargetDependency._schema['target'][1] = XCTarget\nclass PBXNativeTarget(XCTarget):\n # buildPhases is overridden in the schema to be able to set defaults.\n #\n # NOTE: Contrary to most objects, it is advisable to set parent when\n # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject\n # object. A parent reference is required for a PBXNativeTarget during\n # construction to be able to set up the target defaults for productReference,\n # because a PBXBuildFile object must be created for the target and it must\n # be added to the PBXProject's mainGroup hierarchy.", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xcodeproj_file", + "documentation": {} + }, + { + "label": "XmlFix", + "kind": 6, + "importPath": "node_modules.node-gyp.gyp.pylib.gyp.xml_fix", + "description": "node_modules.node-gyp.gyp.pylib.gyp.xml_fix", + "peekOfCode": "class XmlFix(object):\n \"\"\"Object to manage temporary patching of xml.dom.minidom.\"\"\"\n def __init__(self):\n # Preserve current xml.dom.minidom functions.\n self.write_data = xml.dom.minidom._write_data\n self.writexml = xml.dom.minidom.Element.writexml\n # Inject replacement versions of a function and a method.\n xml.dom.minidom._write_data = _Replacement_write_data\n xml.dom.minidom.Element.writexml = _Replacement_writexml\n def Cleanup(self):", + "detail": "node_modules.node-gyp.gyp.pylib.gyp.xml_fix", + "documentation": {} + }, + { + "label": "ParseTarget", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.graphviz", + "description": "node_modules.node-gyp.gyp.tools.graphviz", + "peekOfCode": "def ParseTarget(target):\n target, _, suffix = target.partition('#')\n filename, _, target = target.partition(':')\n return filename, target, suffix\ndef LoadEdges(filename, targets):\n \"\"\"Load the edges map from the dump file, and filter it to only\n show targets in |targets| and their depedendents.\"\"\"\n file = open('dump.json')\n edges = json.load(file)\n file.close()", + "detail": "node_modules.node-gyp.gyp.tools.graphviz", "documentation": {} }, { - "label": "hello", + "label": "LoadEdges", "kind": 2, - "importPath": "docs.content.learning-area.html.forms.sending-form-data.python-example", - "description": "docs.content.learning-area.html.forms.sending-form-data.python-example", - "peekOfCode": "def hello():\n return render_template(\"greeting.html\",\n say=request.form[\"say\"],\n to=request.form[\"to\"])\nif __name__ == \"__main__\":\n app.run()", - "detail": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "importPath": "node_modules.node-gyp.gyp.tools.graphviz", + "description": "node_modules.node-gyp.gyp.tools.graphviz", + "peekOfCode": "def LoadEdges(filename, targets):\n \"\"\"Load the edges map from the dump file, and filter it to only\n show targets in |targets| and their depedendents.\"\"\"\n file = open('dump.json')\n edges = json.load(file)\n file.close()\n # Copy out only the edges we're interested in from the full edge list.\n target_edges = {}\n to_visit = targets[:]\n while to_visit:", + "detail": "node_modules.node-gyp.gyp.tools.graphviz", "documentation": {} }, { - "label": "app", + "label": "WriteGraph", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.graphviz", + "description": "node_modules.node-gyp.gyp.tools.graphviz", + "peekOfCode": "def WriteGraph(edges):\n \"\"\"Print a graphviz graph to stdout.\n |edges| is a map of target to a list of other targets it depends on.\"\"\"\n # Bucket targets by file.\n files = collections.defaultdict(list)\n for src, dst in edges.items():\n build_file, target_name, toolset = ParseTarget(src)\n files[build_file].append(src)\n print 'digraph D {'\n print ' fontsize=8' # Used by subgraphs.", + "detail": "node_modules.node-gyp.gyp.tools.graphviz", + "documentation": {} + }, + { + "label": "main", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.graphviz", + "description": "node_modules.node-gyp.gyp.tools.graphviz", + "peekOfCode": "def main():\n if len(sys.argv) < 2:\n print >>sys.stderr, __doc__\n print >>sys.stderr\n print >>sys.stderr, 'usage: %s target1 target2...' % (sys.argv[0])\n return 1\n edges = LoadEdges('dump.json', sys.argv[1:])\n WriteGraph(edges)\n return 0\nif __name__ == '__main__':", + "detail": "node_modules.node-gyp.gyp.tools.graphviz", + "documentation": {} + }, + { + "label": "comment_replace", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def comment_replace(matchobj):\n return matchobj.group(1) + matchobj.group(2) + '#' * len(matchobj.group(3))\ndef mask_comments(input):\n \"\"\"Mask the quoted strings so we skip braces inside quoted strings.\"\"\"\n search_re = re.compile(r'(.*?)(#)(.*)')\n return [search_re.sub(comment_replace, line) for line in input]\ndef quote_replace(matchobj):\n return \"%s%s%s%s\" % (matchobj.group(1),\n matchobj.group(2),\n 'x'*len(matchobj.group(3)),", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "mask_comments", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def mask_comments(input):\n \"\"\"Mask the quoted strings so we skip braces inside quoted strings.\"\"\"\n search_re = re.compile(r'(.*?)(#)(.*)')\n return [search_re.sub(comment_replace, line) for line in input]\ndef quote_replace(matchobj):\n return \"%s%s%s%s\" % (matchobj.group(1),\n matchobj.group(2),\n 'x'*len(matchobj.group(3)),\n matchobj.group(2))\ndef mask_quotes(input):", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "quote_replace", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def quote_replace(matchobj):\n return \"%s%s%s%s\" % (matchobj.group(1),\n matchobj.group(2),\n 'x'*len(matchobj.group(3)),\n matchobj.group(2))\ndef mask_quotes(input):\n \"\"\"Mask the quoted strings so we skip braces inside quoted strings.\"\"\"\n search_re = re.compile(r'(.*?)' + QUOTE_RE_STR)\n return [search_re.sub(quote_replace, line) for line in input]\ndef do_split(input, masked_input, search_re):", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "mask_quotes", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def mask_quotes(input):\n \"\"\"Mask the quoted strings so we skip braces inside quoted strings.\"\"\"\n search_re = re.compile(r'(.*?)' + QUOTE_RE_STR)\n return [search_re.sub(quote_replace, line) for line in input]\ndef do_split(input, masked_input, search_re):\n output = []\n mask_output = []\n for (line, masked_line) in zip(input, masked_input):\n m = search_re.match(masked_line)\n while m:", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "do_split", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def do_split(input, masked_input, search_re):\n output = []\n mask_output = []\n for (line, masked_line) in zip(input, masked_input):\n m = search_re.match(masked_line)\n while m:\n split = len(m.group(1))\n line = line[:split] + r'\\n' + line[split:]\n masked_line = masked_line[:split] + r'\\n' + masked_line[split:]\n m = search_re.match(masked_line)", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "split_double_braces", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def split_double_braces(input):\n \"\"\"Masks out the quotes and comments, and then splits appropriate\n lines (lines that matche the double_*_brace re's above) before\n indenting them below.\n These are used to split lines which have multiple braces on them, so\n that the indentation looks prettier when all laid out (e.g. closing\n braces make a nice diagonal line).\n \"\"\"\n double_open_brace_re = re.compile(r'(.*?[\\[\\{\\(,])(\\s*)([\\[\\{\\(])')\n double_close_brace_re = re.compile(r'(.*?[\\]\\}\\)],?)(\\s*)([\\]\\}\\)])')", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "count_braces", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def count_braces(line):\n \"\"\"keeps track of the number of braces on a given line and returns the result.\n It starts at zero and subtracts for closed braces, and adds for open braces.\n \"\"\"\n open_braces = ['[', '(', '{']\n close_braces = [']', ')', '}']\n closing_prefix_re = re.compile(r'(.*?[^\\s\\]\\}\\)]+.*?)([\\]\\}\\)],?)\\s*$')\n cnt = 0\n stripline = COMMENT_RE.sub(r'', line)\n stripline = QUOTE_RE.sub(r\"''\", stripline)", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "prettyprint_input", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def prettyprint_input(lines):\n \"\"\"Does the main work of indenting the input based on the brace counts.\"\"\"\n indent = 0\n basic_offset = 2\n last_line = \"\"\n for line in lines:\n if COMMENT_RE.match(line):\n print line\n else:\n line = line.strip('\\r\\n\\t ') # Otherwise doesn't strip \\r on Unix.", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "main", + "kind": 2, + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "def main():\n if len(sys.argv) > 1:\n data = open(sys.argv[1]).read().splitlines()\n else:\n data = sys.stdin.read().splitlines()\n # Split up the double braces.\n lines = split_double_braces(data)\n # Indent and print the output.\n prettyprint_input(lines)\n return 0", + "detail": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "documentation": {} + }, + { + "label": "COMMENT_RE", "kind": 5, - "importPath": "docs.content.learning-area.html.forms.sending-form-data.python-example", - "description": "docs.content.learning-area.html.forms.sending-form-data.python-example", - "peekOfCode": "app = Flask(__name__)\n@app.route(\"/\", methods=[\"GET\", \"POST\"])\ndef form():\n return render_template(\"form.html\")\n@app.route(\"/hello\", methods=[\"GET\", \"POST\"])\ndef hello():\n return render_template(\"greeting.html\",\n say=request.form[\"say\"],\n to=request.form[\"to\"])\nif __name__ == \"__main__\":", - "detail": "docs.content.learning-area.html.forms.sending-form-data.python-example", + "importPath": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "description": "node_modules.node-gyp.gyp.tools.pretty_gyp", + "peekOfCode": "COMMENT_RE = re.compile(r'\\s*#.*')\n# Regex to remove quoted strings when we're counting braces.\n# It takes into account quoted quotes, and makes sure that the quotes match.\n# NOTE: It does not handle quotes that span more than one line, or\n# cases where an escaped quote is preceeded by an escaped backslash.\nQUOTE_RE_STR = r'(?P[\\'\"])(.*?)(?[\\'\"])(.*?)(?![Foo](https://github.com/bgoonz/BGOONZ_BLOG_2.0/blob/master/static/images/Screenshot%202022-03-30%20at%2012-37-24%20Website%20Speed%20Test%20Tool%20-%20Testmysite.io%20by%20Netlify.png?raw=true) diff --git a/algolia-search.md b/algolia-search.md new file mode 100644 index 0000000000..2e332cf3ac --- /dev/null +++ b/algolia-search.md @@ -0,0 +1,669 @@ +![Add Algolia Search to Your Gatsby Site (Part 1)](https://malikgabroun.com/static/584a5bdf50b8cb52f308bcd290da23f3/3b307/searching.jpg) + +Photo by [Anthony Martino](https://unsplash.com/@amartino20) + +In this post, we will be looking into how to add algolia search to your gatsby site. we will see how to configure Algolia in gatsby and add Algolia's built-in component.. + +To setup algolia search, first, you need to: + +- create an account at algolia's website [here](https://www.algolia.com/users/sign_up) +- once done, you create an index you can name whatever you want (blog for example) + +After that, we can grab the API keys and put them in your `.env` which you can find them here [![algolia api keys](https://malikgabroun.com/static/d81f28f7e184299ddb2144e4116a22bf/fcda8/algolia-api-keys.png 'algolia api keys')](https://malikgabroun.com/static/d81f28f7e184299ddb2144e4116a22bf/5df5d/algolia-api-keys.png) + +``` +1GATSBY_ALGOLIA_APP_ID="xxxx"2GATSBY_ALGOLIA_INDEX_NAME="test"3ALGOLIA_API_KEY="xxx"4GATSBY_ALGOLIA_SEARCH_KEY="xxx" +``` + +## [](https://malikgabroun.com/blog/intro-to-algolia-in-gatsby-part-i/#configuration)Configuration + +Now moving back to code, by installing a couple of plugins that we are going to use + +``` +1npm install algoliasearch dotenv gatsby-plugin-algolia react-instantsearch-dom +``` + +After installing the gatsby plugin it will allow us to fetch the data with GraphQl and send it to algolia. + +Now that we install the plugins, we can start adding the configuration in `gatsby-config` to fetch the data from the build and insert it into the index in algolia. + +To do so, we create the query as follow + +``` +1const blogQuery = `2 {3 posts: allMdx(4 filter: { fileAbsolutePath: { regex: "/posts/" } }5 ) {6 edges {7 node {8 objectID: id9 frontmatter {10 title11 date12 path13 }14 excerpt(pruneLength: 5000)15 }16 }17 }18 }19`; +``` + +and then add the transformer method which is just mapping the data + +``` +1const settings = { attributesToSnippet: [`excerpt:20`] };2const queries = [3 {4 query: blogQuery,5 transformer: ({ data }) =>6 data.posts.edges.map(({ node: { frontmatter, ...rest } }) => {7 return {8 ...frontmatter,9 ...rest,10 };11 }),12 indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME,13 settings,14 },15]; +``` + +Basically what the above snippet does is the `queries` object grab the GraphQL json data and turning them each into own separate object that we want algolia to index from Gatsby GraphQl layer which is going to contains GraphQl query, optional index name, transformer function and settings object. + +The next step will be configuring `gatsby-plugin-algolia` as follow + +``` +1require("dotenv").config();234 +5module.exports = {6 plugins: [7 {8 resolve: `gatsby-plugin-algolia`,9 options: {10 appId: process.env.GATSBY_ALGOLIA_APP_ID,11 apiKey: process.env.ALGOLIA_API_KEY,12 indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME, 13 queries,14 chunkSize: 10000, 15 },16 },17 ],18}; +``` + +the plugin takes an options object with the keys we added earlier in the env file and the queries object which contains your query (you can pass more than one query to that, for example, a query for posts and a different one for pages) and the transformer method for mapping, index name and any settings you wish to pass. + +Once the configuration is done, you can run your project in production mode to send the data to algolia so that you can test by running `gatsby build` and it will look like the following [![gatsby indexing data to algolia](https://malikgabroun.com/static/ab96e8cfa1bcff9409a65040625c292b/fcda8/algolia-build.png 'gatsby indexing data to algolia')](https://malikgabroun.com/static/ab96e8cfa1bcff9409a65040625c292b/076ca/algolia-build.png) + +If you look in your dashboard after the build finish, you should be able to see the data as well [![algolia index dashboard](https://malikgabroun.com/static/5348cf03ba27e5cf3783da2d33581cce/fcda8/algolia-index-dashboard.png 'algolia index dashboard')](https://malikgabroun.com/static/5348cf03ba27e5cf3783da2d33581cce/a3c4c/algolia-index-dashboard.png) + +Now we can move to the frontend part after configuration and indexing part finished. + +## [](https://malikgabroun.com/blog/intro-to-algolia-in-gatsby-part-i/#frontend)Frontend + +In this section, we will be looking into how to install algolia search to your gatsby site. + +### [](https://malikgabroun.com/blog/intro-to-algolia-in-gatsby-part-i/#algolia-search-component)Algolia Search component + +To do that, first, we create a new component call it `Search.js` which would utilise algolia's instant-search component (you can check the [docs](https://www.algolia.com/doc/guides/building-search-ui/installation/react/) for more info) + +``` +1import algoliasearch from "algoliasearch/lite";2import { InstantSearch, SearchBox, Hits } from "react-instantsearch-dom";3import React from "react";4 +5const appId = process.env.GATSBY_ALGOLIA_APP_ID;6const searchKey = process.env.GATSBY_ALGOLIA_SEARCH_KEY;7const searchClient = algoliasearch(appId, searchKey);8 +9const Search = () => (10 14 15 16 17);18 +19export default Search; +``` + +As you can see in the above snippet, we first added `InstantSearch` component which as defined by algolia in the [docs](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/) as a component that interact with Algolia’s API, to easily build instant-search applications. `InstantSearch` takes two properties, `searchClient` that contains your app id and search key which was defined in env earlier and indexName that you defined in algolia's account. The component has two children components, `SearchBox` component as the name implies and input field with search and delete icon and a `Hits` component (Hits are the return result from your query). The result of the search component will look something like this ![Search Component](https://malikgabroun.com/static/48f558d3489bae12bb05be88caee9e37/fcda8/SearchComponent.png 'Search Component') + +We can replace the HTML you see in the screenshot from the list of posts with the actual hits which is a good spot to do highlighting for the searched keywords etc. To do so, we can add an attribute `hitComponent` which going to pass the data that it receives from `Hits` to the component you pass to it for example postPreview. + +``` +1import PostPreview from "./PostPreview";2; +``` + +And our `PostPreview` can look something like the following where we add a link to the post and show the excerpt about the post. + +``` +1import React from "react";2import { Link } from "gatsby";3import { Highlight } from "react-instantsearch-dom";4import { css } from "@emotion/core";5const PostPreview = ({ hit }) => {6 return (7
8

9 10 11 12

13 {new Date(hit.date).toLocaleDateString()}14

15 16

17
18 );19};20 +21export default PostPreview; +``` + +once that done, we can add another widget that does the highlighting. By default, the prop `attribute` that was to `Highlight` component is going to be enabled on all the searchable attributes, but you can limit it to a specific one that you want to make it searchable. + +The `Highlight` widget is going to look for the attribute to highlight, which is going to create a span around the searched term in the content and highlight that span. + +An example of adding the `Highlight` widget + +``` +1 +``` + +By adding the above, it is going to highlight the attribute title if it matches the search query as you can see below [![Highlight Component](https://malikgabroun.com/static/249c1d6ce3bf01038eb53069d4d337d8/fcda8/highlight-widget.png 'Highlight Component')](https://malikgabroun.com/static/249c1d6ce3bf01038eb53069d4d337d8/332b4/highlight-widget.png) + +As a result, now we have `Search` component that uses algolia `InstantSearch` as a base component. + +**Following the post and you can find a starter repo [here](https://github.com/gabroun/gatsby-mdx-starter) that shows usage of Algolia Search component** + +I hope part one showed how you can install and add algolia search component to your Gatsby site. Part two will cover how to create a custom search component with Algolia. + +--- + +--- + +--- + +--- + +This guide will run you through the process of setting up a custom search experience powered by [Algolia](https://www.algolia.com/) on a Gatsby site. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#what-is-algolia)What is Algolia? + +Algolia is a site search hosting platform and API that provides you with the components you need to build powerful search functionality without setting up your own server. + +Algolia will host the search index. You tell it what pages you have, where they are and how to navigate them, and the Algolia API will return those results to the user based on whatever search terms they use. + +Algolia provides a free tier that offers a limited number of monthly searches. A paid plan is required for higher volumes. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#indexing-and-searching)Indexing and searching + +There are two stages to providing search functionality: indexing your pages and building a search interface for users to query the index. + +The [Gatsby Algolia plugin](https://github.com/algolia/gatsby-plugin-algolia) handles the indexing. It sends your pages to Algolia for indexing every time you run `gatsby build`. You use GraphQL to customize which pages and what information to index. + +To build the user interface for searching, this guide will use [React InstantSearch](https://www.algolia.com/doc/guides/building-search-ui/getting-started/react/), which is a library provided by Algolia with ready-made React components. This is the quickest way to get up and running, but you could also build your own custom user interface. + +> Note: If you want to build a search for technical documentation, Algolia provides a product called [DocSearch](https://docsearch.algolia.com/) that simplifies the process further and eliminates the need for manual indexing. This is the preferred approach for documentation sites. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#setting-up-the-project)Setting up the project + +This guide will set up a search based on the [Gatsby starter blog](https://www.gatsbyjs.com/starters/gatsbyjs/gatsby-starter-blog/). You can base it on your own project instead, but that might require minor modifications to the code, depending on your page structure and the frameworks you use. + +Create a new site using + +``` +gatsby new gatsby-algolia-guide https://github.com/gatsbyjs/gatsby-starter-blog +``` + +The starter blog contains the pages you will index in the directory `content/blog`. These are Markdown files that have the [frontmatter field](https://www.gatsbyjs.com/docs/how-to/routing/adding-markdown-pages/#frontmatter-for-metadata-in-markdown-files) `title`. It is referenced when configuring the Algolia query. If you call this field something else, the query needs to be modified. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#indexing)Indexing + +Now that you have a project set up you can proceed to indexing your pages in Algolia. + +Start by adding the [Algolia plugin](https://github.com/algolia/gatsby-plugin-algolia): + +``` +npm install gatsby-plugin-algolia +``` + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#configuring-the-algolia-plugin)Configuring the Algolia plugin + +You will need to provide some information that identifies your account to the Algolia plugin and authorizes it to write data to it. + +If you don’t already have an Algolia account, [create one](https://www.algolia.com/users/sign_up). There is a free trial that does not require a credit card. + +Then, go to [the ‘API Keys’ section of your Algolia profile](https://www.algolia.com/api-keys). It should look like this screenshot, only with letters and numbers instead of black boxes: + +[![The API Keys section of the Algolia profile](https://www.gatsbyjs.com/static/7d7464953fdefee4e5dff0ce845f0834/321ea/algolia-api-keys.png 'The API Keys section of the Algolia profile')](https://www.gatsbyjs.com/static/7d7464953fdefee4e5dff0ce845f0834/d26de/algolia-api-keys.png) + +Copy out the Application ID, Search-Only API Key, and Admin API Key from Algolia and create a file called `.env` in the root of your project (`gatsby-algolia-guide` if created as described above). This file contains your [project environment variables](https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables). Replace the placeholders with your copied values: + +``` +GATSBY_ALGOLIA_APP_ID=GATSBY_ALGOLIA_SEARCH_KEY=ALGOLIA_ADMIN_KEY= +``` + +Note that the value of the Admin Key must be kept secret, since it allows write access to your index. It must therefore not be included in any code you ship. + +It is also best practice not to check in the `.env` file for this reason. Consider creating an `.env.example` without the values to git instead. This way, if someone else sets up the project, they know what configuration they need to supply but don’t have access to your private values. + +Next, modify `gatsby-config.js` to read the configuration and add the `gatsby-plugin-algolia` plugin. + +Add the following line at the top of `gatsby-config.js` to read the configuration from `.env`: + +``` +require("dotenv").config() +``` + +Then add the configuration for `gatsby-plugin-algolia` to the list of plugins in the `gatsby-config.js`. `dotenv` makes the configuration values available as keys in `process.env`. + +``` +plugins: [ ... // your existing plugins here { resolve: `gatsby-plugin-algolia`, options: { appId: process.env.GATSBY_ALGOLIA_APP_ID, apiKey: process.env.ALGOLIA_ADMIN_KEY, queries: require("./src/utils/algolia-queries") }, } ],} +``` + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#query-the-pages-for-indexing)Query the pages for indexing + +You still need to supply a `queries` configuration. Queries tell the Algolia plugin what data is to be indexed. They perform GraphQL queries for the relevant pages and convert the response into a set of Algolia records. These contain key/value pairs with the data to be indexed. + +The configuration could have been entered straight into the `gatsby-config.js`, but the configuration above loads it from a new file `src/utils/algolia-queries.js` to avoid clutter. Create this page in your project: + +src/utils/algolia-queries.js + +``` +const escapeStringRegexp = require("escape-string-regexp")const pagePath = `content`const indexName = `Pages`const pageQuery = `{ pages: allMarkdownRemark( filter: { fileAbsolutePath: { regex: "/${escapeStringRegexp(pagePath)}/" }, } ) { edges { node { id frontmatter { title } fields { slug } excerpt(pruneLength: 5000) } } }}`function pageToAlgoliaRecord({ node: { id, frontmatter, fields, ...rest } }) { return { objectID: id, ...frontmatter, ...fields, ...rest, }}const queries = [ { query: pageQuery, transformer: ({ data }) => data.pages.edges.map(pageToAlgoliaRecord), indexName, settings: { attributesToSnippet: [`excerpt:20`] }, },]module.exports = queries +``` + +If you did not start from the Gatsby start blog, you might need to modify the `pagePath` to match where your content is kept. + +The file exports a list of queries. Each query defines a single index. You can build [multiple indices](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/in-depth/choosing-between-one-or-more-indices/) with Algolia but this guide will only use a single one. + +Each index requires a GraphQL query that retrieves the pages and data to be indexed. A `transformer` transforms the GraphQL data to an Algolia record. + +Each index has a name that identifies it. If the index does not exist, it will be created automatically during indexing. + +Note that each record must have an ID in the key `objectID`. The Algolia documentation provides more information on [how to structure data into records](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/#attributes---what-to-put-in-your-record). + +In this guide, the slug, field `excerpt`, and frontmatter field `title` are indexed. It will display these fields in the search results. To index more fields, add them to `pageQuery` with GraphQL. + +Each query has optional [settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/). The code above tells Algolia you will want to generate “snippets” of context around your hits in the `excerpt` attribute. + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#test-your-indexing)Test your indexing + +This should complete the indexing setup. Now run `gatsby build`. If all goes well, the output should include the following: + +``` +success Building static HTML for pages - 7.610s - 5/5 0.66/sAlgolia: 1 queries to indexAlgolia: query 0: executing queryAlgolia: query 0: graphql resulted in 3 recordsAlgolia: query 0: splitting in 1 jobs +``` + +Check that `graphql resulted in` is followed by the number of pages in your project. If the number is wrong, there is something wrong with your query. + +Log in to your Algolia account, go to “Indices” and then select the “Page” index and you should see your indexed page data. + +[![Algolia index displaying the indexed page](https://www.gatsbyjs.com/static/4fbad40aaf341ec977e903213c235827/321ea/algolia-index.png 'Algolia index displaying the indexed page')](https://www.gatsbyjs.com/static/4fbad40aaf341ec977e903213c235827/b8471/algolia-index.png) + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#troubleshooting)Troubleshooting + +If you get the error `GraphQLError: Field "fileAbsolutePath" is not defined by type MarkdownRemarkFilterInput` it means that no pages were found in your project. Check the path configured for `gatsby-source-filesystem` and the query (particularly `pagePath`). + +Algolia has an upper bound of 10KB for an index entry. If you get the error `AlgoliaSearchError: Record at the position XX objectID=xx-xx-xx-xx-xx is too big size=xxxx bytes` it means you exceeded that limit. Note how the excerpts are pruned to 5000 characters in the query. Make sure you prune long fields and don’t index unnecessary data. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#adding-the-user-interface)Adding the user interface + +Now that there is data in the index, it is time to build the user interface for searching. It will display as a magnifying glass icon button that, when clicked, expands into a form field. Search results will appear in a popover below the input field as the user types. + +The guide will use the following frameworks: + +- [React InstantSearch](https://community.algolia.com/react-instantsearch), a component library provided by Algolia for easily building search interfaces. +- [Algolia Search](https://www.npmjs.com/package/algoliasearch) provides the API client for calling Algolia. +- [Styled Components](https://styled-components.com/) for embedding the CSS in the code, integrated using the [Gatsby styled component plugin](https://www.gatsbyjs.com/plugins/gatsby-plugin-styled-components/). +- [Styled Icons](https://styled-icons.js.org/) provides the magnifying glass icon for the search bar. + +Styled Components can also be replaced by any other CSS solution you prefer. + +Install these frameworks by running the following command: + +``` +npm install react-instantsearch-dom algoliasearch styled-components gatsby-plugin-styled-components @styled-icons/fa-solid +``` + +Add the `gatsby-plugin-styled-components` to your `gatsby-config`: + +``` +plugins: [ ... // your existing plugins here `gatsby-plugin-styled-components`, ],} +``` + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#search-box)Search box + +The first step is to create the input field where the user enters the search query. Algolia calls this the “search box”. + +src/components/search/search-box.js + +``` +import React from "react"import { connectSearchBox } from "react-instantsearch-dom"import { Search as SearchIcon } from "@styled-icons/fa-solid"export default connectSearchBox( ({ refine, currentRefinement, className, onFocus }) => (
refine(e.target.value)} value={currentRefinement} onFocus={onFocus} /> )) +``` + +The component consists of an HTML form containing an input field and the magnifying glass icon. Most of the work is done by Algolia’s [`connectSearchBox`](https://community.algolia.com/react-instantsearch/connectors/connectSearchBox.html) function. It exposes the current search string as `currentRefinement` and a function for changing it called `refine`. + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#displaying-search-results)Displaying search results + +That’s all there is to entering the search query. Next, build a component for displaying search results: + +src/components/search/search-result.js + +``` +import { Link } from "gatsby"import { default as React } from "react"import { connectStateResults, Highlight, Hits, Index, Snippet, PoweredBy,} from "react-instantsearch-dom"const HitCount = connectStateResults(({ searchResults }) => { const hitCount = searchResults && searchResults.nbHits return hitCount > 0 ? (
{hitCount} result{hitCount !== 1 ? `s` : ``}
) : null})const PageHit = ({ hit }) => (

)const HitsInIndex = ({ index }) => ( )const SearchResult = ({ indices, className }) => (
{indices.map(index => ( ))}
)export default SearchResult +``` + +Since Algolia supports multiple indices, the `SearchResult` iterates over all indices and displays hits for each of them using the `HitsInIndex` component. It, in turn, relies heavily on the [`Hits` component](https://www.algolia.com/doc/api-reference/widgets/hits/react/) from the InstantSearch library. + +The `PageHit` component is responsible for displaying a single page (“hit”) in a search result. + +[`connectStateResults`](https://community.algolia.com/react-instantsearch/connectors/connectStateResults.html) wraps components to provide them with details about the current search such as the query, the number of results and timing statistics. + +If you’re using Algolia’s free tier, they ask you to acknowledge the use of their technology by including the string “Powered by Algolia”, which is what `PoweredBy` does. + +`Highlight` and `Snippet` both display attributes of matching search results to the user. The former renders the full value whereas the latter only shows a snippet. A snippet is the text immediately surrounding the match. The `attribute` property is the name of the key in the Algolia index (as generated by `pageToAlgoliaRecord` in `algolia-queries.js`). + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#tying-the-search-widget-together)Tying the search widget together + +You now need to hook up the two components to each other and perform the actual search: + +src/components/search/index.js + +``` +import algoliasearch from "algoliasearch/lite"import { createRef, default as React, useState, useMemo } from "react"import { InstantSearch } from "react-instantsearch-dom"import { ThemeProvider } from "styled-components"import StyledSearchBox from "./styled-search-box"import StyledSearchResult from "./styled-search-result"import StyledSearchRoot from "./styled-search-root"import useClickOutside from "./use-click-outside"const theme = { foreground: "#050505", background: "white", faded: "#888",}export default function Search({ indices }) { const rootRef = createRef() const [query, setQuery] = useState() const [hasFocus, setFocus] = useState(false) const searchClient = useMemo( () => algoliasearch( process.env.GATSBY_ALGOLIA_APP_ID, process.env.GATSBY_ALGOLIA_SEARCH_KEY ), [] ) useClickOutside(rootRef, () => setFocus(false)) return ( setQuery(query)} > setFocus(true)} hasFocus={hasFocus} /> 0 && hasFocus} indices={indices} /> )} +``` + +The `ThemeProvider` exports variables for the CSS to use (this is the [theming](https://styled-components.com/docs/advanced#theming) functionality of `styled-components`). If you are using `styled-components` elsewhere in your project you probably want to place it at the root of your widget hierarchy rather than in the search widget itself. + +The `hasFocus` variable tracks whether the search box is currently in focus. When it is, it should display the input field (if not, only the search icon button is visible). + +The `searchClient` variable is [memoized](https://reactjs.org/docs/hooks-reference.html#usememo) to avoid re-creating the Algolia search client when the `Search` component is re-rendered. This is important for performance, as the client caches searches to minimise the number of requests made to Algolia. + +`StyledSearchRoot` is the root of the whole component. The React hook `useClickOutside` provides a callback if the user clicks anywhere else on the page, in which case it should close. + +`InstantSearch` from [`react-instantsearch-dom`](https://community.algolia.com/react-instantsearch) wraps the search box and search results to orchestrate the search. + +### [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#supporting-files)Supporting files + +Almost done! Only some supporting files left. You need to add the implementation of the `useClickOutside` hook: + +src/components/search/use-click-outside.js + +``` +import { useEffect } from "react"const events = [`mousedown`, `touchstart`]export default (ref, onClickOutside) => { const isOutside = element => !ref.current || !ref.current.contains(element) const onClick = event => { if (isOutside(event.target)) { onClickOutside() } } useEffect(() => { for (const event of events) { document.addEventListener(event, onClick) } return () => { for (const event of events) document.removeEventListener(event, onClick) } })} +``` + +And finally, you should also add some CSS. The `Styled` components wrap the components you wrote earlier to add styling to them. If you wish to use a different CSS framework, you can skip these. In that case, replace `StyledSearchBox` with `SearchBox`, `StyledSearchResult` with `SearchResult` and `StyledSearchRoot` with `
` in `index.js`. + +src/components/search/styled-search-root.js + +``` +import styled from "styled-components"export default styled.div` position: relative; margin: 0.6em 0;` +``` + +The root element needs relative positioning so you can position the popover underneath it. + +src/components/search/styled-search-box.js + +``` +import styled, { css } from "styled-components"import SearchBox from "./search-box"const open = css` width: 10em; background: ${({ theme }) => theme.background}; cursor: text; margin-left: -1.6em; padding-left: 1.6em;`const closed = css` width: 0; background: transparent; cursor: pointer; margin-left: -1em; padding-left: 1em;`export default styled(SearchBox)` display: flex; flex-direction: row-reverse; align-items: center; margin-bottom: 0; .SearchInput { outline: none; border: ${({ hasFocus }) => (hasFocus ? "auto" : "none")}; font-size: 1em; transition: 100ms; border-radius: 2px; color: ${({ theme }) => theme.foreground}; ::placeholder { color: ${({ theme }) => theme.faded}; } ${({ hasFocus }) => (hasFocus ? open : closed)} } .SearchIcon { width: 1em; margin: 0.3em; color: ${({ theme }) => theme.foreground}; pointer-events: none; }` +``` + +The `SearchBox` has an open and a closed state. The `hasFocus` property determines which state the component is in. `open` and `closed` contain the CSS that is different for the two states. + +Finally, add some styling to the search result: + +src/components/search/styled-search-result.js + +``` +import styled, { css } from "styled-components"import SearchResult from "./search-result"const Popover = css` max-height: 80vh; overflow: scroll; -webkit-overflow-scrolling: touch; position: absolute; z-index: 2; right: 0; top: 100%; margin-top: 0.5em; width: 80vw; max-width: 30em; box-shadow: 0 0 5px 0; padding: 1em; border-radius: 2px; background: ${({ theme }) => theme.background};`export default styled(SearchResult)` display: ${props => (props.show ? `block` : `none`)}; ${Popover} .HitCount { display: flex; justify-content: flex-end; } .Hits { ul { list-style: none; margin-left: 0; } li.ais-Hits-item { margin-bottom: 1em; a { color: ${({ theme }) => theme.foreground}; h4 { margin-bottom: 0.2em; } } } } .ais-PoweredBy { display: flex; justify-content: flex-end; font-size: 80%; svg { width: 70px; } }` +``` + +`Popover` creates a popover floating under the search box. The `show` property determines whether it is visible or not. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#usage)Usage + +The search widget is now ready for use. It needs to be placed somewhere in your project’s layout. If you start from Gatsby starter blog, you can use the `layout` component: + +``` +import React from "react"import { Link } from "gatsby"import { rhythm, scale } from "../utils/typography"import Search from "./search"const searchIndices = [{ name: `Pages`, title: `Pages` }]const Layout = ({ location, title, children }) => { // ... return (
{header}
{children}
© {new Date().getFullYear()}, Built with {` `} Gatsby
)}export default Layout +``` + +If you started from a different project your layout may look different; the highlighted lines show which lines need to be added. + +Note that this is where you define the search indices you wish to search. They are passed as a property to `Search`. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#running)Running + +Running `gatsby develop` should now give you a working search that looks something like this: + +[![Search widget displaying search results](https://www.gatsbyjs.com/static/c2b0e4bba13a5850a9c9454f9a1b3886/321ea/algolia-final-search.png 'Search widget displaying search results')](https://www.gatsbyjs.com/static/c2b0e4bba13a5850a9c9454f9a1b3886/e6c84/algolia-final-search.png) + +You can also play around with it at [https://janosh.io/blog](https://janosh.io/blog). + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#deploying-to-netlify)Deploying to Netlify + +If you try to deploy the project to Netlify, the deployment will fail with the error `AlgoliaSearchError: Please provide an application ID`. This is because Netlify does not have access to the Algolia configuration. Remember, it is kept in the `.env` file which is not checked in. + +You therefore need to declare the same environment variables you put in `.env` in Netlify. Go to your Netlify site dashboard under **Settings > Build & deploy > Environment > Environment variables** and enter the keys `GATSBY_ALGOLIA_APP_ID`, `GATSBY_ALGOLIA_SEARCH_KEY` and `ALGOLIA_ADMIN_KEY` with the same values as you used in the `.env` file. After a redeploy, the search should now work! + +[![Netlify environment variable configuration](https://www.gatsbyjs.com/static/3106f00be7f21a1b1749ee8498cdafd8/321ea/algolia-netlify-env.png 'Netlify environment variable configuration')](https://www.gatsbyjs.com/static/3106f00be7f21a1b1749ee8498cdafd8/22284/algolia-netlify-env.png) + +The Netlify documentation has more information on [how to configure environment variables in Netlify](https://docs.netlify.com/configure-builds/environment-variables/#declare-variables). Also see the [Environment Variables](https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables) guide for an overview of environment variables in Gatsby. + +## [](https://www.gatsbyjs.com/docs/adding-search-with-algolia/#additional-resources)Additional Resources + +If you have any issues or if you want to learn more about using Algolia for search, check out this tutorial from Jason Lengstorf: + +[https://youtu.be/VSkXyuXzwlc](https://youtu.be/VSkXyuXzwlc) + +You can also find stories of companies using Gatsby + Algolia together [in the Algolia section of the blog](https://www.gatsbyjs.com/blog/tags/algolia). + +[Edit this page on GitHub](https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/adding-search-with-algolia.md) + +--- + +--- + +--- + +--- + +**with support for Partial Updates** + +You can specify a list of queries to run and how to transform them into an array of objects to index. When you run `gatsby build`, it will publish those to Algolia. + +Here we have an example with some data that might not be very relevant, but will work with the default configuration of `gatsby new` + +``` +npm install --save gatsby-plugin-algolia-search +``` + +First add credentials to a .env file, which you won’t commit. If you track this in your file, and especially if the site is open source, you will leak your admin API key. This would mean anyone is able to change anything on your Algolia index. + +``` +// .env.production +ALGOLIA_APP_ID=XXX +ALGOLIA_API_KEY=XXX +ALGOLIA_INDEX_NAME=XXX +``` + +``` +require('dotenv').config({ + path: `.env.${process.env.NODE_ENV}`, +}) + +// gatsby-config.js +const myQuery = `{ + allSitePage { + edges { + node { + # try to find a unique id for each node + # if this field is absent, it's going to + # be inserted by Algolia automatically + # and will be less simple to update etc. + objectID: id + component + path + componentChunkName + jsonName + internal { + type + contentDigest + owner + } + } + } + } +}`; + +const queries = [ + { + query: myQuery, + transformer: ({ data }) => data.allSitePage.edges.map(({ node }) => node), // optional + indexName: 'index name to target', // overrides main index name, optional + settings: { + // optional, any index settings + }, + matchFields: ['slug', 'modified'], // Array overrides main match fields, optional + }, +]; + +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-algolia-search`, + options: { + appId: process.env.ALGOLIA_APP_ID, + apiKey: process.env.ALGOLIA_API_KEY, + indexName: "index name to target", // for all queries + queries, + chunkSize: 10000, // default: 1000 + settings: { + // optional, any index settings + }, + enablePartialUpdates: true, // default: false + matchFields: ['slug', 'modified'], // Array default: ['modified'] + }, + }, + ], +}; +``` + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-algolia-search/#partial-updates-v040)Partial Updates `v0.4.0` + +By default all records will be reindexed on every build. To enable only indexing the new, changed and deleted records include the following in the options of the plugin: + +``` + resolve: `gatsby-plugin-algolia-search`, + options: { + /* ... */ + enablePartialUpdates: true, + /* (optional) Fields to use for comparing if the index object is different from the new one */ + /* By default it uses a field called "modified" which could be a boolean | datetime string */ + matchFields: ['slug', 'modified'] // Array default: ['modified'] + } +``` + +This saves a lot of Algolia operations since you don’t reindex everything on everybuild. + +### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-algolia-search/#advanced)Advanced + +You can also specify `matchFields` per query to check for different fields based on the type of objects you are indexing. + +--- + +--- + +--- + +--- + +![](https://miro.medium.com/max/1400/1*4gek2a2hKVKa_sEyWoXbrg.png) + +Photo by [Anthony Martino](https://unsplash.com/@amartino20) + +In this post, we will be looking into how to add Algolia search to our gatsby site. We will see how to configure Algolia in Gatsby and add Algolia’s built-in component. + +## Setup + +To setup algolia search, first we need to: + +- create an account at algolia’s website [here](https://www.algolia.com/users/sign_up) +- once done, we can create an index that we can name whatever we want (i.e blog) + +After that, we can grab the API keys and put them in our`.env` which we can find them here + +![](https://miro.medium.com/max/1300/0*Jkrvjip5cqmavqu3.png) + +``` +// .envGATSBY_ALGOLIA_APP_ID="xxxx"GATSBY_ALGOLIA_INDEX_NAME="test"ALGOLIA_API_KEY="xxx"GATSBY_ALGOLIA_SEARCH_KEY="xxx" +``` + +## Installation + +Now we can move back to code, by installing a couple of plugins that we are going to need + +``` +npm install algoliasearch dotenv gatsby-plugin-algolia react-instantsearch-dom +``` + +After installing the gatsby plugin it will allow us to fetch the data with GraphQL and send it to algolia. + +## Configuration + +Now that we installed the plugins, we can start adding the configuration in `gatsby-config` file to fetch the data from the build and insert it into the index in algolia. + +To do so, we need to create the query as follow + +``` +const blogQuery = ` { posts: allMdx( filter: { fileAbsolutePath: { regex: "/posts/" } } ) { edges { node { objectID: id frontmatter { title date path } excerpt(pruneLength: 5000) } } } }`; +``` + +and then add the transformer method which is just mapping the data + +``` +const settings = { attributesToSnippet: [`excerpt:20`] };const queries = [ { query: blogQuery, transformer: ({ data }) => data.posts.edges.map(({ node: { frontmatter, ...rest } }) => { return { ...frontmatter, ...rest, }; }), indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME, settings, },]; +``` + +Basically, what the above snippet does is that the `queries` object going to grab the GraphQL JSON data and turn them each into own separate object that we want algolia to index from Gatsby GraphQL layer. + +This is going to contain GraphQL query, optional index name, transformer function and settings object. + +The next step will be configuring `gatsby-plugin-algolia` as follow + +``` +require('dotenv').config();// we can pass an object with a property of path to config method which would look// like this for example {path: '.env.production'} in case if you want to configure for different modesmodule.exports = { plugins: [ { resolve: `gatsby-plugin-algolia`, options: { appId: process.env.GATSBY_ALGOLIA_APP_ID, apiKey: process.env.ALGOLIA_API_KEY, indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME, // for all queries queries, chunkSize: 10000, // default: 1000 }, }, ],}; +``` + +The plugin takes an `options` object with the keys we added earlier in the env file and the queries object which contains our query (we can pass more than one query to that. + +For example, a query for posts and a different one for pages) and the transformer method for mapping, index name and any settings we wish to pass. + +Once the configuration is done, we can run the project in production mode to send the data to algolia, so that we can test it by running `gatsby build` and it will look like the following + +![](https://miro.medium.com/max/1300/0*0-wkuOAboahagf58.png) + +If you look in the dashboard after the build finished, we should be able to see the data as well + +![](https://miro.medium.com/max/1300/0*iEHnWRNlDPVuiJPJ.png) + +Now we can move to the frontend part after configuration and indexing part finished. + +## Frontend + +In this section, we will be looking into how to install algolia search to our gatsby site. + +## Installing Algolia search component + +To do that, first, we can create a new component and call it `Search.js` which would utilise algolia's instant-search component (you can check the [docs](https://www.algolia.com/doc/guides/building-search-ui/installation/react/) for more info) + +``` +import algoliasearch from 'algoliasearch/lite';import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom';import React from 'react';const appId = process.env.GATSBY_ALGOLIA_APP_ID;const searchKey = process.env.GATSBY_ALGOLIA_SEARCH_KEY;const searchClient = algoliasearch(appId, searchKey);const Search = () => ( );export default Search; +``` + +As we can see in the above snippet, first we added `InstantSearch` component which as defined by algolia in the [docs](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/) as a component that interacts with Algolia’s API, to easily build instant-search applications. + +`InstantSearch` takes two properties, `searchClient` that contains your app id, search key (which was defined in env file earlier) and indexName that we defined in algolia's account. + +The component has two children components, `SearchBox` component as the name implies and input field with search and delete icon and a `Hits` component (Hits are the return result from your query). + +The result of the search component will look something like this + +![](https://miro.medium.com/max/1300/0*IfRz1pfkJb0PVS__.png) + +We can replace the HTML we see in the screenshot from the list of posts with the actual hits which is a good spot to do highlighting for the searched keywords etc. + +To do so, we can add an attribute `hitComponent` which going to pass the data that it receives from `Hits` to the component we pass to it. for example postPreview. + +``` +import PostPreview from './PostPreview';; +``` + +And our `PostPreview` can look something like the following where we add A link to the post and show the excerpt about the post. + +``` +import React from 'react';import { Link } from 'gatsby';import { Highlight } from 'react-instantsearch-dom';import { css } from '@emotion/core';const PostPreview = ({ hit }) => { return (

{new Date(hit.date).toLocaleDateString()}

);};export default PostPreview; +``` + +once that done, we can add another widget that does the highlighting. By default, the prop `attribute` that was added to `Highlight` component is going to be enabled on all the searchable attributes, but you can limit it to a specific one that you want to make it searchable. + +The `Highlight` widget is going to look for the attribute to highlight, which is going to create a span around the searched term in the content and highlight that span. + +An example of adding the `Highlight` widget + +``` + +``` + +By adding the above, it is going to highlight the attribute title if it matches the search query as you can see below + +![](https://miro.medium.com/max/1300/0*1p44LY1vxnS3NTuP.png) + +As a result, now we have `Search` component that uses algolia `InstantSearch` as a base component. + +**Following the post and you can find a starter repo** [**here**](https://github.com/gabroun/gatsby-mdx-starter) **that shows usage of Algolia Search component** + +## In Conclusion + +I hope part one showed how we can install and add algolia search component to our Gatsby site. Part two will cover how to create a custom search component with Algolia. + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- + +--- diff --git a/cloudflared.deb b/cloudflared.deb deleted file mode 100644 index 0d15fe6d4c..0000000000 Binary files a/cloudflared.deb and /dev/null differ diff --git a/docs/index.html b/docs/index.html index 81034cd16a..b066b10a1b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,7 +12,7 @@ - + diff --git a/gatsby-browser.js b/gatsby-browser.js index 5f2652bffd..c31a635998 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -3,27 +3,31 @@ * * See: https://www.gatsbyjs.org/docs/browser-apis/ */ + // onPreRouteUpdate() and onRouteUpdate() are called before onInitialClientRender, // use initialized flag to ensure that window.onGatsbyPreRouteUpdate() and // window.onGatsbyRouteUpdate() will not be called before // window.onGatsbyInitialClientRender() has run let initialized = false; + exports.onInitialClientRender = () => { - initialized = true; - if ( 'onGatsbyInitialClientRender' in window && typeof window.onGatsbyInitialClientRender === 'function' ) { - window.onGatsbyInitialClientRender(); - } - if ( 'onGatsbyRouteUpdate' in window && typeof window.onGatsbyRouteUpdate === 'function' ) { - window.onGatsbyRouteUpdate(); - } + initialized = true; + if ('onGatsbyInitialClientRender' in window && typeof window.onGatsbyInitialClientRender === 'function') { + window.onGatsbyInitialClientRender(); + } + if ('onGatsbyRouteUpdate' in window && typeof window.onGatsbyRouteUpdate === 'function') { + window.onGatsbyRouteUpdate(); + } }; + exports.onRouteUpdate = () => { - if ( initialized && 'onGatsbyRouteUpdate' in window && typeof window.onGatsbyRouteUpdate === 'function' ) { - window.onGatsbyRouteUpdate(); - } + if (initialized && 'onGatsbyRouteUpdate' in window && typeof window.onGatsbyRouteUpdate === 'function') { + window.onGatsbyRouteUpdate(); + } }; + exports.onPreRouteUpdate = () => { - if ( initialized && 'onGatsbyPreRouteUpdate' in window && typeof window.onGatsbyPreRouteUpdate === 'function' ) { - window.onGatsbyPreRouteUpdate(); - } -}; + if (initialized && 'onGatsbyPreRouteUpdate' in window && typeof window.onGatsbyPreRouteUpdate === 'function') { + window.onGatsbyPreRouteUpdate(); + } +}; \ No newline at end of file diff --git a/install-dependencies.js b/install-dependencies.js deleted file mode 100644 index 4c0a215dae..0000000000 --- a/install-dependencies.js +++ /dev/null @@ -1,34 +0,0 @@ -/* eslint-disable eol-last */ -const fs = require('fs/promises'); -const { - spawn -} = require('child_process'); -const path = require('path'); -const root = process.cwd(); -// eslint-disable-next-line func-style -function npmInstall(cwd) { - return new Promise((resolve) => { - const childProcess = spawn('npm', ['install'], { - cwd - }); - childProcess.on('exit', resolve); - }); -} -// eslint-disable-next-line func-style -async function install() { - const base = path.resolve(root); - const ignoreFolders = ['node_modules']; - const deps = (await fs.readdir(base, { - withFileTypes: true - })) - .filter((dep) => dep.isDirectory()) - .filter((dep) => !ignoreFolders.includes(dep.name)) - .map((folder) => path.resolve(base, folder.name)) - .concat([base]) - .map((dep) => npmInstall(dep)); - await Promise.all(deps); - // eslint-disable-next-line no-console - console.log('Done!'); -} -install(); -npmInstall('./') \ No newline at end of file diff --git a/mdx.md b/mdx.md new file mode 100644 index 0000000000..f42276ae5e --- /dev/null +++ b/mdx.md @@ -0,0 +1,523 @@ +![Logo](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/img/gatsby-mdx.png) + +> `gatsby-plugin-mdx` is the official integration for using [MDX](https://mdxjs.com/) with [Gatsby](https://www.gatsbyjs.com/). + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#whats-mdx)What’s MDX? + +MDX is markdown for the component era. It lets you write JSX embedded inside markdown. It’s a great combination because it allows you to use markdown’s often terse syntax (such as `# heading`) for the little things and JSX for more advanced components. + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#why-mdx)Why MDX? + +Before MDX, some of the benefits of writing Markdown were lost when integrating with JSX. Implementations were often template string-based which required lots of escaping and cumbersome syntax. + +MDX seeks to make writing with Markdown and JSX simpler while being more expressive. Writing is fun again when you combine components, that can even be dynamic or load data, with the simplicity of Markdown for long-form content. + +### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#read-more-about-mdx)Read more about MDX + +- [📚 Gatsby guide](https://www.gatsbyjs.com/docs/mdx/) +- [📣 Language](https://mdxjs.com/) +- [👩🔬 Specification](https://github.com/mdx-js/specification) + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#table-of-contents)Table of contents + +- [What’s MDX?](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#whats-mdx) + - [Why MDX?](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#why-mdx) + - [Read more about MDX](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#read-more-about-mdx) + - [Table of contents](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#table-of-contents) + - [Installation](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#installation) + - [Usage](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#usage) + - [Configuration](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#configuration) + - [Extensions](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#extensions) + - [Default layouts](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#default-layouts) + - [Imports](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#imports) + - [Shortcodes](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#shortcodes) + - [Gatsby remark plugins](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#gatsby-remark-plugins) + - [Remark plugins](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#remark-plugins) + - [Rehype plugins](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#rehype-plugins) + - [Media types](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#media-types) + - [Explanation](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#explanation) + - [shouldBlockNodeFromTransformation](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#shouldblocknodefromtransformation) + - [Components](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#components) + - [MDXProvider](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#mdxprovider) + - [Related](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#related) + - [MDXRenderer](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#mdxrenderer) + - [License](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#license) + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#installation)Installation + +Install: + +``` +npm install gatsby-plugin-mdx @mdx-js/mdx@v1 @mdx-js/react@v1 +``` + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#usage)Usage + +After installing `gatsby-plugin-mdx` you can add it to your plugins list in your `gatsby-config.js`. + +``` +module.exports = { + plugins: [ + { + resolve: `gatsby-source-filesystem`, + options: { + name: `pages`, + path: `${__dirname}/src/pages/`, + }, + }, + `gatsby-plugin-mdx`, + ], +} +``` + +By default, this configuration will allow you to automatically create pages with `.mdx` files in `src/pages` and will process any Gatsby nodes with Markdown media types into MDX content. + +Note that `gatsby-plugin-mdx` requires `gatsby-source-filesystem` to be present and configured to process local markdown files in order to generate the resulting Gatsby nodes. + +To automatically create pages with `.mdx` from other sources, you also need to configure `gatsby-plugin-page-creator`. + +``` +module.exports = { + plugins: [ + { + resolve: `gatsby-source-filesystem`, + options: { + name: `posts`, + path: `${__dirname}/src/posts/`, + }, + }, + { + resolve: "gatsby-plugin-page-creator", + options: { + path: `${__dirname}/src/posts`, + }, + }, + `gatsby-plugin-mdx`, + ], +} +``` + +### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#configuration)Configuration + +`gatsby-plugin-mdx` exposes a configuration API that can be used similarly to any other Gatsby plugin. You can define MDX extensions, layouts, global scope, and more. + +| Key | Default | Description | +| --- | --- | --- | +| [`extensions`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#extensions) | `[".mdx"]` | Configure the file extensions that gatsby-plugin-mdx will process | +| [`defaultLayouts`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#default-layouts) | `{}` | Set the layout components for MDX source types | +| [`gatsbyRemarkPlugins`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#gatsby-remark-plugins) | `[]` | Use Gatsby-specific remark plugins | +| [`remarkPlugins`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#remark-plugins) | `[]` | Specify remark plugins | +| [`rehypePlugins`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#rehype-plugins) | `[]` | Specify rehype plugins | +| [`mediaTypes`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#media-types) | `["text/markdown", "text/x-markdown"]` | Determine which media types are processed by MDX | +| [`shouldBlockNodeFromTransformation`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#shouldblocknodefromtransformation) | `(node) => false` | Disable MDX transformation for nodes where this function returns true | +| [`commonmark`](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#commonmark) | `false` | Use CommonMark | + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#extensions)Extensions + +By default, only files with the `.mdx` file extension are treated as MDX when using `gatsby-source-filesystem`. To use `.md` or other file extensions, you can define an array of file extensions in the `gatsby-plugin-mdx` section of your `gatsby-config.js`. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + extensions: [`.mdx`, `.md`], + }, + }, + ], +} +``` + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#default-layouts)Default layouts + +`defaultLayouts` takes an object where the `key` is the `name` key of the `gatsby-source-filesystem` configuration you want to target. `default` applies to any MDX file that doesn’t already have a layout defined, even if it’s imported manually using `import MDX from './thing.mdx`. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-source-filesystem`, + options: { + name: `pages`, + path: `${__dirname}/src/pages/`, + }, + }, + { + resolve: `gatsby-source-filesystem`, + options: { + name: `posts`, + path: `${__dirname}/src/posts/`, + }, + }, + { + resolve: "gatsby-plugin-page-creator", + options: { + path: `${__dirname}/src/posts`, + }, + }, + { + resolve: `gatsby-plugin-mdx`, + options: { + defaultLayouts: { + posts: require.resolve("./src/components/posts-layout.js"), + default: require.resolve("./src/components/default-page-layout.js"), + }, + }, + }, + ], +} +``` + +MDX has a layout concept that is different from Gatsby’s. MDX layouts are written using the default export JavaScript syntax in a single MDX file. An MDX layout will wrap the MDX content in an additional component, so this can be a good place for a page layout depending on how you are using MDX. + +``` +export default ({ children }) => ( +
+

My Layout

+
{children}
+
+) + +# My MDX + +some content +``` + +or as an import: + +``` +import PageLayout from './src/components/page-layout'; + +export default PageLayout + +# My MDX + +some content +``` + +Sometimes you don’t want to include the layout in every file, so `gatsby-plugin-mdx` offers the option to set default layouts in the `gatsby-config.js` plugin config. Set the key to the `name` set in the `gatsby-source-filesystem` config. If no matching default layout is found, the default layout named `default` is used. + +You can also set `options.defaultLayouts.default` if you only want to use one layout for all MDX pages that don’t already have a layout defined. + +``` +module.exports = { + siteMetadata: { + title: `Gatsby MDX Kitchen Sink`, + }, + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + defaultLayouts: { + posts: require.resolve("./src/components/posts-layout.js"), + default: require.resolve("./src/components/default-page-layout.js"), + }, + }, + }, + { + resolve: `gatsby-source-filesystem`, + options: { + name: `posts`, + path: `${__dirname}/src/posts/`, + }, + }, + { + resolve: "gatsby-plugin-page-creator", + options: { + path: `${__dirname}/src/posts`, + }, + }, + ], +} +``` + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#imports)Imports + +When importing a react component into your MDX, you can import it using the `import` statement as in JavaScript. + +``` +import { SketchPicker } from "react-color" + +# Hello, world! + +Here's a color picker! + + +``` + +_**Note:** You should rerun your Gatsby development environment to update imports in MDX files. Otherwise, you’ll get a `ReferenceError` for new imports. You can use the shortcodes approach if that is an issue for you._ + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#shortcodes)Shortcodes + +If you want to allow usage of a component from anywhere (often referred to as a shortcode), you can pass it to the [MDXProvider](https://www.gatsbyjs.com/docs/mdx/customizing-components/). + +``` +// src/components/layout.js +import React from "react" +import { MDXProvider } from "@mdx-js/react" +import { Link } from "gatsby" +import { YouTube, Twitter, TomatoBox } from "./ui" + +const shortcodes = { Link, YouTube, Twitter, TomatoBox } + +export default ({ children }) => ( + {children} +) +``` + +Then, in any MDX file, you can navigate using `Link` and render `YouTube`, `Twitter`, and `TomatoBox` components without an import. + +``` +# Hello, world! + +Here's a YouTube embed + + + + +``` + +[Read more about MDX shortcodes](https://mdxjs.com/blog/shortcodes) + +This config option is used for compatibility with a set of plugins many people [use with remark](https://www.gatsbyjs.com/plugins/?=gatsby-remark-) that require the gatsby environment to function properly. In some cases, like [gatsby-remark-prismjs](https://www.gatsbyjs.com/plugins/gatsby-remark-prismjs/?=gatsby-remark-), it makes more sense to use a library like [prism-react-renderer](https://github.com/FormidableLabs/prism-react-renderer) to render codeblocks using a [React component](https://www.gatsbyjs.com/api-reference/mdx-provider). In other cases, like [gatsby-remark-images](https://www.gatsbyjs.com/plugins/gatsby-remark-images/?=gatsby-remark-), the interaction with the Gatsby APIs is well deserved because the images can be optimized by Gatsby and you should continue using it. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + `gatsby-remark-images`, + { + resolve: `gatsby-plugin-mdx`, + options: { + gatsbyRemarkPlugins: [ + { + resolve: `gatsby-remark-images`, + options: { + maxWidth: 590, + }, + }, + ], + }, + }, + ], +} +``` + +Using a string reference is also supported for `gatsbyRemarkPlugins`. + +``` +gatsbyRemarkPlugins: [`gatsby-remark-images`] +``` + +> Note that in the case of `gatsby-remark-images` the plugin needs to be included as both a sub-plugin of gatsby-plugin-mdx and a string entry in the plugins array. + +This is a configuration option that is [mirrored from the core MDX processing pipeline](https://mdxjs.com/plugins). It enables the use of [remark plugins](https://github.com/remarkjs/remark/blob/master/doc/plugins.md) for processing MDX content. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + remarkPlugins: [ + require("remark-abbr"), + // To pass options, use a 2-element array with the + // configuration in an object in the second element + [require("remark-external-links"), { target: false }], + ], + }, + }, + ], +} +``` + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#rehype-plugins)Rehype plugins + +This is a configuration option that is [mirrored from the core MDX processing pipeline](https://mdxjs.com/plugins). It enables the use of [rehype plugins](https://github.com/rehypejs/rehype/blob/master/doc/plugins.md) for processing MDX content. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + rehypePlugins: [ + // Generate heading ids for rehype-autolink-headings + require("rehype-slug"), + // To pass options, use a 2-element array with the + // configuration in an object in the second element + [require("rehype-autolink-headings"), { behavior: "wrap" }], + ], + }, + }, + ], +} +``` + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#media-types)Media types + +Deciding what content gets processed by `gatsby-plugin-mdx`. This is an advanced option that is useful for dealing with specialized generated content. It is not intended to be configured for most users. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + mediaTypes: [`text/markdown`, `text/x-markdown`], + }, + }, + ], +} +``` + +##### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#explanation)Explanation + +Gatsby includes the media-type of the content on any given node. For `file` nodes, we choose whether to process the content with MDX or not by the file extension. For remote content or generated content, we choose which nodes to process by looking at the media type. + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#shouldblocknodefromtransformation)shouldBlockNodeFromTransformation + +Given a function `(node) => Boolean` allows you to decide for each node if it should be transformed or not. + +``` +// gatsby-config.js +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + shouldBlockNodeFromTransformation(node) { + return ( + [`NPMPackage`, `NPMPackageReadme`].includes(node.internal.type) || + (node.internal.type === `File` && + path.parse(node.dir).dir.endsWith(`packages`)) + ) + }, + }, + }, + ], +} +``` + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#commonmark)CommonMark + +MDX will be parsed using CommonMark. + +### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#components)Components + +MDX and `gatsby-plugin-mdx` use components for different things like rendering and component mappings. + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#mdxprovider)MDXProvider + +`MDXProvider` is a React component that allows you to replace the rendering of tags in MDX content. It does this by providing a list of components via context to the internal `MDXTag` component that handles rendering of base tags like `p` and `h1`. There are two special tags that can be replaced too: `inlineCode` and `wrapper`. `inlineCode` is for inline `` and `wrapper` is the special element that wraps all of the MDX content. + +``` +import { MDXProvider } from "@mdx-js/react" + +const MyH1 = props =>

+const MyParagraph = props => ( +

+) + +const components = { + h1: MyH1, + p: MyParagraph, +} + +export const wrapRootElement = ({ element }) => ( + {element} +) +``` + +The following components can be customized with the MDXProvider: + +| Tag | Name | Syntax | +| --- | --- | --- | +| `p` | [Paragraph](https://github.com/syntax-tree/mdast#paragraph) | | +| `h1` | [Heading 1](https://github.com/syntax-tree/mdast#heading) | `#` | +| `h2` | [Heading 2](https://github.com/syntax-tree/mdast#heading) | `##` | +| `h3` | [Heading 3](https://github.com/syntax-tree/mdast#heading) | `###` | +| `h4` | [Heading 4](https://github.com/syntax-tree/mdast#heading) | `####` | +| `h5` | [Heading 5](https://github.com/syntax-tree/mdast#heading) | `#####` | +| `h6` | [Heading 6](https://github.com/syntax-tree/mdast#heading) | `######` | +| `thematicBreak` | [Thematic break](https://github.com/syntax-tree/mdast#thematicbreak) | `***` | +| `blockquote` | [Blockquote](https://github.com/syntax-tree/mdast#blockquote) | `>` | +| `ul` | [List](https://github.com/syntax-tree/mdast#list) | `-` | +| `ol` | [Ordered list](https://github.com/syntax-tree/mdast#list) | `1.` | +| `li` | [List item](https://github.com/syntax-tree/mdast#listitem) | | +| `table` | [Table](https://github.com/syntax-tree/mdast#table) | \`--- | +| `tr` | [Table row](https://github.com/syntax-tree/mdast#tablerow) | \`This | +| `td`/`th` | [Table cell](https://github.com/syntax-tree/mdast#tablecell) | | +| `pre` | [Pre](https://github.com/syntax-tree/mdast#code) | | +| `code` | [Code](https://github.com/syntax-tree/mdast#code) | | +| `em` | [Emphasis](https://github.com/syntax-tree/mdast#emphasis) | `_emphasis_` | +| `strong` | [Strong](https://github.com/syntax-tree/mdast#strong) | `**strong**` | +| `delete` | [Delete](https://github.com/syntax-tree/mdast#delete) | `~~strikethrough~~` | +| `inlineCode` | [InlineCode](https://github.com/syntax-tree/mdast#inlinecode) | | +| `hr` | [Break](https://github.com/syntax-tree/mdast#break) | `---` | +| `a` | [Link](https://github.com/syntax-tree/mdast#link) | `` or `[MDX](https://mdxjs.com)` | +| `img` | [Image](https://github.com/syntax-tree/mdast#image) | `![alt](https://mdx-logo.now.sh)` | +| | | | + +It’s important to define the `components` you pass in a stable way so that the references don’t change if you want to be able to navigate to a hash. That’s why we defined `components` outside of any render functions in these examples. + +You can also expose any custom component to every mdx file using `MDXProvider`. See [Shortcodes](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#shortcodes) + +- [MDX components](https://mdxjs.com/getting-started/#mdxprovider) + +#### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#mdxrenderer)MDXRenderer + +`MDXRenderer` is a React component that takes _compiled_ MDX content and renders it. You will need to use this if your MDX content is coming from a GraphQL page query or `StaticQuery`. + +`MDXRenderer` takes any prop and passes it on to your MDX content, just like a normal React component. + +``` +{mdx.body} +``` + +Using a page query: + +``` +import { MDXRenderer } from "gatsby-plugin-mdx" + +export default class MyPageLayout { + render() { + return {this.props.data.mdx.body} + } +} + +export const pageQuery = graphql` + query MDXQuery($id: String!) { + mdx(id: { eq: $id }) { + id + body + } + } +` +``` + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#troubleshooting)Troubleshooting + +### [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#excerpts-for-non-latin-languages)Excerpts for non-latin languages + +By default, `excerpt` uses `underscore.string/prune` which doesn’t handle non-latin characters ([https://github.com/epeli/underscore.string/issues/418](https://github.com/epeli/underscore.string/issues/418)). + +If that is the case, you can set `truncate` option on `excerpt` field, like: + +``` +{ + markdownRemark { + excerpt(truncate: true) + } +} +``` + +## [](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#license)License + +MIT diff --git a/netlify.toml b/netlify.toml index c884c46f36..63d5090e2f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,8 +2,3 @@ [build] publish = "public" command = "npm run build" - functions = "lambda" -[build.environment] - NODE_VERSION = "12.22.3" - YARN_VERSION = "1.22.4" - YARN_FLAGS = "--no-ignore-optional" diff --git a/notes/BGOONZ_BLOG_2.0.wiki/articles/BasicWebDevelopmentEnvironmentSetup.md b/notes/BGOONZ_BLOG_2.0.wiki/articles/BasicWebDevelopmentEnvironmentSetup.md index bf21ab5a88..1f0f4a5b93 100644 --- a/notes/BGOONZ_BLOG_2.0.wiki/articles/BasicWebDevelopmentEnvironmentSetup.md +++ b/notes/BGOONZ_BLOG_2.0.wiki/articles/BasicWebDevelopmentEnvironmentSetup.md @@ -1,9 +1,8 @@ -Basic Web Development Environment Setup -======================================= +# Basic Web Development Environment Setup Windows Subsystem for Linux (WSL) and Ubuntu ------------------------------------------------------------------------- +--- ### Basic Web Development Environment Setup diff --git a/notes/BGOONZ_BLOG_2.0.wiki/articles/DOM-standard.md b/notes/BGOONZ_BLOG_2.0.wiki/articles/DOM-standard.md index 8a0b0f4875..49fac15d63 100644 --- a/notes/BGOONZ_BLOG_2.0.wiki/articles/DOM-standard.md +++ b/notes/BGOONZ_BLOG_2.0.wiki/articles/DOM-standard.md @@ -1,10 +1,11 @@ - # DOM Standard > ## Excerpt +> > This specification depends on the Infra Standard. [INFRA] --- + ## 1\. Infrastructure[](https://dom.spec.whatwg.org/#infrastructure) This specification depends on the Infra Standard. [\[INFRA\]](https://dom.spec.whatwg.org/#biblio-infra) @@ -52,11 +53,8 @@ The index of an object is its number of [preceding](https://dom.spec.whatwg.org/ The ordered set parser takes a string input and then runs these steps: 1. Let inputTokens be the result of [splitting input on ASCII whitespace](https://infra.spec.whatwg.org/#split-on-ascii-whitespace). - 2. Let tokens be a new [ordered set](https://infra.spec.whatwg.org/#ordered-set). - 3. [For each](https://infra.spec.whatwg.org/#list-iterate) token in inputTokens, [append](https://infra.spec.whatwg.org/#set-append) token to tokens. - 4. Return tokens. The ordered set serializer takes a set and returns the [concatenation](https://infra.spec.whatwg.org/#string-concatenate) of set using U+0020 SPACE. @@ -66,11 +64,8 @@ The ordered set serializer takes a set and returns the [concatenation](https://i To scope-match a selectors string selectors against a node, run these steps: 1. Let s be the result of [parse a selector](https://drafts.csswg.org/selectors-4/#parse-a-selector) selectors. [\[SELECTORS4\]](https://dom.spec.whatwg.org/#biblio-selectors4) - 2. If s is failure, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. Return the result of [match a selector against a tree](https://drafts.csswg.org/selectors-4/#match-a-selector-against-a-tree) with s and node’s [root](https://dom.spec.whatwg.org/#concept-tree-root) using [scoping root](https://drafts.csswg.org/selectors-4/#scoping-root) node. [\[SELECTORS4\]](https://dom.spec.whatwg.org/#biblio-selectors4). - Support for namespaces within selectors is not planned and will not be added. @@ -81,25 +76,15 @@ To validate a qualifiedName, [throw](https://webidl.spec.whatwg.org/#dfn-throw) To validate and extract a namespace and qualifiedName, run these steps: 1. If namespace is the empty string, then set it to null. - 2. [Validate](https://dom.spec.whatwg.org/#validate) qualifiedName. - 3. Let prefix be null. - 4. Let localName be qualifiedName. - 5. If qualifiedName contains a U+003A (:), then [strictly split](https://infra.spec.whatwg.org/#strictly-split) the string on it and set prefix to the part before and localName to the part after. - 6. If prefix is non-null and namespace is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NamespaceError](https://webidl.spec.whatwg.org/#namespaceerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 7. If prefix is "`xml`" and namespace is not the [XML namespace](https://infra.spec.whatwg.org/#xml-namespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NamespaceError](https://webidl.spec.whatwg.org/#namespaceerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 8. If either qualifiedName or prefix is "`xmlns`" and namespace is not the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NamespaceError](https://webidl.spec.whatwg.org/#namespaceerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 9. If namespace is the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace) and neither qualifiedName nor prefix is "`xmlns`", then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NamespaceError](https://webidl.spec.whatwg.org/#namespaceerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - -10. Return namespace, prefix, and localName. - +10. Return namespace, prefix, and localName. ## 2\. Events[](https://dom.spec.whatwg.org/#events) @@ -110,8 +95,8 @@ Throughout the web platform [events](https://dom.spec.whatwg.org/#concept-event) obj.addEventListener("load", imgFetched) function imgFetched(ev) { - // great success - … +// great success +… } [Event listeners](https://dom.spec.whatwg.org/#concept-event-listener) can be removed by utilizing the `[removeEventListener()](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener)` method, passing the same arguments. @@ -132,8 +117,8 @@ obj.dispatchEvent(event) Apart from signaling, [events](https://dom.spec.whatwg.org/#concept-event) are sometimes also used to let an application control what happens next in an operation. For instance as part of form submission an [event](https://dom.spec.whatwg.org/#concept-event) whose `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value is "`submit`" is [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch). If this [event](https://dom.spec.whatwg.org/#concept-event)’s `[preventDefault()](https://dom.spec.whatwg.org/#dom-event-preventdefault)` method is invoked, form submission will be terminated. Applications who wish to make use of this functionality through [events](https://dom.spec.whatwg.org/#concept-event) [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch) by the application (synthetic events) can make use of the return value of the `[dispatchEvent()](https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent)` method: if(obj.dispatchEvent(event)) { - // event was not canceled, time for some magic - … +// event was not canceled, time for some magic +… } When an [event](https://dom.spec.whatwg.org/#concept-event) is [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch) to an object that [participates](https://dom.spec.whatwg.org/#concept-tree-participate) in a [tree](https://dom.spec.whatwg.org/#concept-tree) (e.g., an [element](https://dom.spec.whatwg.org/#concept-element)), it can reach [event listeners](https://dom.spec.whatwg.org/#concept-event-listener) on that object’s [ancestors](https://dom.spec.whatwg.org/#concept-tree-ancestor) too. Effectively, all the object’s [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) [event listeners](https://dom.spec.whatwg.org/#concept-event-listener) whose [capture](https://dom.spec.whatwg.org/#event-listener-capture) is true are invoked, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). And then, if [event](https://dom.spec.whatwg.org/#concept-event)’s `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` is true, all the object’s [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) [event listeners](https://dom.spec.whatwg.org/#concept-event-listener) whose [capture](https://dom.spec.whatwg.org/#event-listener-capture) is false are invoked, now in reverse [tree order](https://dom.spec.whatwg.org/#concept-tree-order). @@ -141,22 +126,23 @@ When an [event](https://dom.spec.whatwg.org/#concept-event) is [dispatched](http Let’s look at an example of how [events](https://dom.spec.whatwg.org/#concept-event) work in a [tree](https://dom.spec.whatwg.org/#concept-tree): + - - Boring example - - - Hello world! - - function test(e) { - debug(e.target, e.currentTarget, e.eventPhase) - } - document.addEventListener("hey", test, {capture: true}) - document.body.addEventListener("hey", test) - var ev \= new Event("hey", {bubbles:true}) - document.getElementById("x").dispatchEvent(ev) - - + +Boring example + + +Hello world! + +function test(e) { +debug(e.target, e.currentTarget, e.eventPhase) +} +document.addEventListener("hey", test, {capture: true}) +document.body.addEventListener("hey", test) +var ev \= new Event("hey", {bubbles:true}) +document.getElementById("x").dispatchEvent(ev) + + The `debug` function will be invoked twice. Each time the [event](https://dom.spec.whatwg.org/#concept-event)’s `[target](https://dom.spec.whatwg.org/#dom-event-target)` attribute value will be the `span` [element](https://dom.spec.whatwg.org/#concept-element). The first time `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute’s value will be the [document](https://dom.spec.whatwg.org/#concept-document), the second time the `body` [element](https://dom.spec.whatwg.org/#concept-element). `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute’s value switches from `[CAPTURING_PHASE](https://dom.spec.whatwg.org/#dom-event-capturing_phase)` to `[BUBBLING_PHASE](https://dom.spec.whatwg.org/#dom-event-bubbling_phase)`. If an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) was registered for the `span` [element](https://dom.spec.whatwg.org/#concept-element), `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute’s value would have been `[AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target)`. @@ -169,59 +155,59 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera4+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=(Window,Worker,AudioWorklet)\] interface `Event` { - `constructor`([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-event-event-type-eventinitdict-type), optional [EventInit](https://dom.spec.whatwg.org/#dictdef-eventinit) `eventInitDict`[](https://dom.spec.whatwg.org/#dom-event-event-type-eventinitdict-eventinitdict) = {}); - - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [type](https://dom.spec.whatwg.org/#dom-event-type); - readonly attribute [EventTarget](https://dom.spec.whatwg.org/#eventtarget)? [target](https://dom.spec.whatwg.org/#dom-event-target); - readonly attribute [EventTarget](https://dom.spec.whatwg.org/#eventtarget)? [srcElement](https://dom.spec.whatwg.org/#dom-event-srcelement); // legacy - readonly attribute [EventTarget](https://dom.spec.whatwg.org/#eventtarget)? [currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget); - [sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[EventTarget](https://dom.spec.whatwg.org/#eventtarget)\> [composedPath](https://dom.spec.whatwg.org/#dom-event-composedpath)(); - - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [NONE](https://dom.spec.whatwg.org/#dom-event-none) = 0; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [CAPTURING\_PHASE](https://dom.spec.whatwg.org/#dom-event-capturing_phase) = 1; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [AT\_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target) = 2; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [BUBBLING\_PHASE](https://dom.spec.whatwg.org/#dom-event-bubbling_phase) = 3; - readonly attribute [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase); - - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [stopPropagation](https://dom.spec.whatwg.org/#dom-event-stoppropagation)(); - attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [cancelBubble](https://dom.spec.whatwg.org/#dom-event-cancelbubble); // legacy alias of .stopPropagation() - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [stopImmediatePropagation](https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation)(); - - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [cancelable](https://dom.spec.whatwg.org/#dom-event-cancelable); - attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [returnValue](https://dom.spec.whatwg.org/#dom-event-returnvalue); // legacy - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [preventDefault](https://dom.spec.whatwg.org/#dom-event-preventdefault)(); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [defaultPrevented](https://dom.spec.whatwg.org/#dom-event-defaultprevented); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [composed](https://dom.spec.whatwg.org/#dom-event-composed); - - \[[LegacyUnforgeable](https://webidl.spec.whatwg.org/#LegacyUnforgeable)\] readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted); - readonly attribute [DOMHighResTimeStamp](https://w3c.github.io/hr-time/#dom-domhighrestimestamp) [timeStamp](https://dom.spec.whatwg.org/#dom-event-timestamp); - - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [initEvent](https://dom.spec.whatwg.org/#dom-event-initevent)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-event-initevent-type-bubbles-cancelable-type), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `bubbles`[](https://dom.spec.whatwg.org/#dom-event-initevent-type-bubbles-cancelable-bubbles) = false, optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `cancelable`[](https://dom.spec.whatwg.org/#dom-event-initevent-type-bubbles-cancelable-cancelable) = false); // legacy +`constructor`([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-event-event-type-eventinitdict-type), optional [EventInit](https://dom.spec.whatwg.org/#dictdef-eventinit) `eventInitDict`[](https://dom.spec.whatwg.org/#dom-event-event-type-eventinitdict-eventinitdict) = {}); + +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [type](https://dom.spec.whatwg.org/#dom-event-type); +readonly attribute [EventTarget](https://dom.spec.whatwg.org/#eventtarget)? [target](https://dom.spec.whatwg.org/#dom-event-target); +readonly attribute [EventTarget](https://dom.spec.whatwg.org/#eventtarget)? [srcElement](https://dom.spec.whatwg.org/#dom-event-srcelement); // legacy +readonly attribute [EventTarget](https://dom.spec.whatwg.org/#eventtarget)? [currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget); +[sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[EventTarget](https://dom.spec.whatwg.org/#eventtarget)\> [composedPath](https://dom.spec.whatwg.org/#dom-event-composedpath)(); + +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [NONE](https://dom.spec.whatwg.org/#dom-event-none) = 0; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [CAPTURING_PHASE](https://dom.spec.whatwg.org/#dom-event-capturing_phase) = 1; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target) = 2; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [BUBBLING_PHASE](https://dom.spec.whatwg.org/#dom-event-bubbling_phase) = 3; +readonly attribute [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase); + +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [stopPropagation](https://dom.spec.whatwg.org/#dom-event-stoppropagation)(); +attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [cancelBubble](https://dom.spec.whatwg.org/#dom-event-cancelbubble); // legacy alias of .stopPropagation() +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [stopImmediatePropagation](https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation)(); + +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [cancelable](https://dom.spec.whatwg.org/#dom-event-cancelable); +attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [returnValue](https://dom.spec.whatwg.org/#dom-event-returnvalue); // legacy +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [preventDefault](https://dom.spec.whatwg.org/#dom-event-preventdefault)(); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [defaultPrevented](https://dom.spec.whatwg.org/#dom-event-defaultprevented); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [composed](https://dom.spec.whatwg.org/#dom-event-composed); + +\[[LegacyUnforgeable](https://webidl.spec.whatwg.org/#LegacyUnforgeable)\] readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted); +readonly attribute [DOMHighResTimeStamp](https://w3c.github.io/hr-time/#dom-domhighrestimestamp) [timeStamp](https://dom.spec.whatwg.org/#dom-event-timestamp); + +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [initEvent](https://dom.spec.whatwg.org/#dom-event-initevent)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-event-initevent-type-bubbles-cancelable-type), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `bubbles`[](https://dom.spec.whatwg.org/#dom-event-initevent-type-bubbles-cancelable-bubbles) = false, optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `cancelable`[](https://dom.spec.whatwg.org/#dom-event-initevent-type-bubbles-cancelable-cancelable) = false); // legacy }; dictionary `EventInit` { - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `bubbles`[](https://dom.spec.whatwg.org/#dom-eventinit-bubbles) = false; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `cancelable`[](https://dom.spec.whatwg.org/#dom-eventinit-cancelable) = false; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `composed`[](https://dom.spec.whatwg.org/#dom-eventinit-composed) = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `bubbles`[](https://dom.spec.whatwg.org/#dom-eventinit-bubbles) = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `cancelable`[](https://dom.spec.whatwg.org/#dom-eventinit-cancelable) = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `composed`[](https://dom.spec.whatwg.org/#dom-eventinit-composed) = false; }; An `[Event](https://dom.spec.whatwg.org/#event)` object is simply named an event. It allows for signaling that something has occurred, e.g., that an image has completed downloading. @@ -246,19 +232,19 @@ In all current engines. Firefox11+Safari6+Chrome15+ -___ +--- Opera11.6+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android14+iOS Safari6+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12+ -___ +--- Node.js15.0.0+ @@ -272,23 +258,23 @@ In all current engines. Firefox1.5+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ -``event . `[type](https://dom.spec.whatwg.org/#dom-event-type)` `` +`` event . `[type](https://dom.spec.whatwg.org/#dom-event-type)` `` Returns the type of event, e.g. "`click`", "`hashchange`", or "`submit`". @@ -298,23 +284,23 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ -``event . `[target](https://dom.spec.whatwg.org/#dom-event-target)` `` +`` event . `[target](https://dom.spec.whatwg.org/#dom-event-target)` `` Returns the object to which event is [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch) (its [target](https://dom.spec.whatwg.org/#event-target)). @@ -324,23 +310,23 @@ In all current engines. Firefox1+Safari10+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari10+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ -``event . `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` `` +`` event . `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` `` Returns the object whose [event listener](https://dom.spec.whatwg.org/#concept-event-listener)’s [callback](https://dom.spec.whatwg.org/#event-listener-callback) is currently being invoked. @@ -350,23 +336,23 @@ In all current engines. Firefox52+Safari10+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android52+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ -___ +--- Node.js14.5.0+ -``event . `[composedPath()](https://dom.spec.whatwg.org/#dom-event-composedpath)` `` +`` event . `[composedPath()](https://dom.spec.whatwg.org/#dom-event-composedpath)` `` Returns the [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) objects of event’s [path](https://dom.spec.whatwg.org/#event-path) (objects on which listeners will be invoked), except for any [nodes](https://dom.spec.whatwg.org/#concept-node) in [shadow trees](https://dom.spec.whatwg.org/#concept-shadow-tree) of which the [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root)’s [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`closed`" that are not reachable from event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)`. @@ -376,23 +362,23 @@ In all current engines. Firefox1.5+Safari4+Chrome45+ -___ +--- Opera32+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android45+Android WebView45+Samsung Internet5.0+Opera Mobile32+ -___ +--- Node.js14.5.0+ -``event . `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` `` +`` event . `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` `` Returns the [event](https://dom.spec.whatwg.org/#concept-event)’s phase, which is one of `[NONE](https://dom.spec.whatwg.org/#dom-event-none)`, `[CAPTURING_PHASE](https://dom.spec.whatwg.org/#dom-event-capturing_phase)`, `[AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target)`, and `[BUBBLING_PHASE](https://dom.spec.whatwg.org/#dom-event-bubbling_phase)`. @@ -402,19 +388,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ @@ -428,19 +414,19 @@ In all current engines. Firefox10+Safari5+Chrome6+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android10+iOS Safari5+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile14+ -___ +--- Node.js14.5.0+ @@ -454,23 +440,23 @@ In all current engines. Firefox1.5+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ -___ +--- Node.js14.5.0+ -``event . `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` `` +`` event . `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` `` Returns true or false depending on how event was initialized. True if event goes through its [target](https://dom.spec.whatwg.org/#event-target)’s [ancestors](https://dom.spec.whatwg.org/#concept-tree-ancestor) in reverse [tree order](https://dom.spec.whatwg.org/#concept-tree-order); otherwise false. @@ -480,23 +466,23 @@ In all current engines. Firefox1.5+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ -___ +--- Node.js14.5.0+ -``event . `[cancelable](https://dom.spec.whatwg.org/#dom-event-cancelable)` `` +`` event . `[cancelable](https://dom.spec.whatwg.org/#dom-event-cancelable)` `` Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch), can be canceled by invoking the `[preventDefault()](https://dom.spec.whatwg.org/#dom-event-preventdefault)` method. @@ -506,19 +492,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ @@ -532,23 +518,23 @@ In all current engines. Firefox6+Safari5+Chrome18+ -___ +--- Opera11+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android6+iOS Safari5+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile11+ -___ +--- Node.js14.5.0+ -``event . `[defaultPrevented](https://dom.spec.whatwg.org/#dom-event-defaultprevented)` `` +`` event . `[defaultPrevented](https://dom.spec.whatwg.org/#dom-event-defaultprevented)` `` Returns true if `[preventDefault()](https://dom.spec.whatwg.org/#dom-event-preventdefault)` was invoked successfully to indicate cancelation; otherwise false. @@ -558,23 +544,23 @@ In all current engines. Firefox52+Safari10+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android52+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ -___ +--- Node.js14.5.0+ -``event . `[composed](https://dom.spec.whatwg.org/#dom-event-composed)` `` +`` event . `[composed](https://dom.spec.whatwg.org/#dom-event-composed)` `` Returns true or false depending on how event was initialized. True if event invokes listeners past a `[ShadowRoot](https://dom.spec.whatwg.org/#shadowroot)` [node](https://dom.spec.whatwg.org/#concept-node) that is the [root](https://dom.spec.whatwg.org/#concept-tree-root) of its [target](https://dom.spec.whatwg.org/#event-target); otherwise false. @@ -584,23 +570,23 @@ In all current engines. Firefox1.5+Safari10+Chrome46+ -___ +--- Opera33+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari10+Chrome for Android46+Android WebView46+Samsung Internet5.0+Opera Mobile33+ -___ +--- Node.js14.5.0+ -``event . `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` `` +`` event . `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` `` Returns true if event was [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch) by the user agent, and false otherwise. @@ -610,23 +596,23 @@ In all current engines. Firefox1.5+Safari4+Chrome49+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android49+Android WebView49+Samsung Internet5.0+Opera Mobile36+ -___ +--- Node.js14.5.0+ -``event . `[timeStamp](https://dom.spec.whatwg.org/#dom-event-timestamp)` `` +`` event . `[timeStamp](https://dom.spec.whatwg.org/#dom-event-timestamp)` `` Returns the event’s timestamp as the number of milliseconds measured relative to the [time origin](https://w3c.github.io/hr-time/#dfn-time-origin). @@ -641,69 +627,49 @@ The `currentTarget` attribute must return the value it was initialized to. When The `composedPath()` method steps are: 1. Let composedPath be an empty [list](https://infra.spec.whatwg.org/#list). - 2. Let path be [this](https://webidl.spec.whatwg.org/#this)’s [path](https://dom.spec.whatwg.org/#event-path). - 3. If path [is empty](https://infra.spec.whatwg.org/#list-is-empty), then return composedPath. - 4. Let currentTarget be [this](https://webidl.spec.whatwg.org/#this)’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute value. - 5. [Append](https://infra.spec.whatwg.org/#list-append) currentTarget to composedPath. - 6. Let currentTargetIndex be 0. - 7. Let currentTargetHiddenSubtreeLevel be 0. - 8. Let index be path’s [size](https://infra.spec.whatwg.org/#list-size) − 1. - 9. While index is greater than or equal to 0: - + 1. If path\[index\]'s [root-of-closed-tree](https://dom.spec.whatwg.org/#event-path-root-of-closed-tree) is true, then increase currentTargetHiddenSubtreeLevel by 1. - 2. If path\[index\]'s [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) is currentTarget, then set currentTargetIndex to index and [break](https://infra.spec.whatwg.org/#iteration-break). - 3. If path\[index\]'s [slot-in-closed-tree](https://dom.spec.whatwg.org/#event-path-slot-in-closed-tree) is true, then decrease currentTargetHiddenSubtreeLevel by 1. - - 4. Decrease index by 1. - -10. Let currentHiddenLevel and maxHiddenLevel be currentTargetHiddenSubtreeLevel. - -11. Set index to currentTargetIndex − 1. - -12. While index is greater than or equal to 0: - - 1. If path\[index\]'s [root-of-closed-tree](https://dom.spec.whatwg.org/#event-path-root-of-closed-tree) is true, then increase currentHiddenLevel by 1. - - 2. If currentHiddenLevel is less than or equal to maxHiddenLevel, then [prepend](https://infra.spec.whatwg.org/#list-prepend) path\[index\]'s [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) to composedPath. - - 3. If path\[index\]'s [slot-in-closed-tree](https://dom.spec.whatwg.org/#event-path-slot-in-closed-tree) is true, then: - - 1. Decrease currentHiddenLevel by 1. - - 2. If currentHiddenLevel is less than maxHiddenLevel, then set maxHiddenLevel to currentHiddenLevel. - 4. Decrease index by 1. - -13. Set currentHiddenLevel and maxHiddenLevel to currentTargetHiddenSubtreeLevel. - -14. Set index to currentTargetIndex + 1. - -15. While index is less than path’s [size](https://infra.spec.whatwg.org/#list-size): - - 1. If path\[index\]'s [slot-in-closed-tree](https://dom.spec.whatwg.org/#event-path-slot-in-closed-tree) is true, then increase currentHiddenLevel by 1. - - 2. If currentHiddenLevel is less than or equal to maxHiddenLevel, then [append](https://infra.spec.whatwg.org/#list-append) path\[index\]'s [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) to composedPath. - - 3. If path\[index\]'s [root-of-closed-tree](https://dom.spec.whatwg.org/#event-path-root-of-closed-tree) is true, then: - - 1. Decrease currentHiddenLevel by 1. - - 2. If currentHiddenLevel is less than maxHiddenLevel, then set maxHiddenLevel to currentHiddenLevel. - - 4. Increase index by 1. - -16. Return composedPath. - + +10. Let currentHiddenLevel and maxHiddenLevel be currentTargetHiddenSubtreeLevel. + +11. Set index to currentTargetIndex − 1. + +12. While index is greater than or equal to 0: + +13. If path\[index\]'s [root-of-closed-tree](https://dom.spec.whatwg.org/#event-path-root-of-closed-tree) is true, then increase currentHiddenLevel by 1. +14. If currentHiddenLevel is less than or equal to maxHiddenLevel, then [prepend](https://infra.spec.whatwg.org/#list-prepend) path\[index\]'s [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) to composedPath. +15. If path\[index\]'s [slot-in-closed-tree](https://dom.spec.whatwg.org/#event-path-slot-in-closed-tree) is true, then: + + 1. Decrease currentHiddenLevel by 1. + 2. If currentHiddenLevel is less than maxHiddenLevel, then set maxHiddenLevel to currentHiddenLevel. + +16. Decrease index by 1. +17. Set currentHiddenLevel and maxHiddenLevel to currentTargetHiddenSubtreeLevel. + +18. Set index to currentTargetIndex + 1. + +19. While index is less than path’s [size](https://infra.spec.whatwg.org/#list-size): + +20. If path\[index\]'s [slot-in-closed-tree](https://dom.spec.whatwg.org/#event-path-slot-in-closed-tree) is true, then increase currentHiddenLevel by 1. +21. If currentHiddenLevel is less than or equal to maxHiddenLevel, then [append](https://infra.spec.whatwg.org/#list-append) path\[index\]'s [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) to composedPath. +22. If path\[index\]'s [root-of-closed-tree](https://dom.spec.whatwg.org/#event-path-root-of-closed-tree) is true, then: + + 1. Decrease currentHiddenLevel by 1. + 2. If currentHiddenLevel is less than maxHiddenLevel, then set maxHiddenLevel to currentHiddenLevel. + +23. Increase index by 1. +24. Return composedPath. The `eventPhase` attribute must return the value it was initialized to, which must be one of the following: @@ -725,17 +691,17 @@ When an [event](https://dom.spec.whatwg.org/#concept-event) is [dispatched](http Initially the attribute must be initialized to `[NONE](https://dom.spec.whatwg.org/#dom-event-none)`. -___ +--- Each [event](https://dom.spec.whatwg.org/#concept-event) has the following associated flags that are all initially unset: -- stop propagation flag -- stop immediate propagation flag -- canceled flag -- in passive listener flag -- composed flag -- initialized flag -- dispatch flag +- stop propagation flag +- stop immediate propagation flag +- canceled flag +- in passive listener flag +- composed flag +- initialized flag +- dispatch flag The `stopPropagation()` method steps are to set [this](https://webidl.spec.whatwg.org/#this)’s [stop propagation flag](https://dom.spec.whatwg.org/#stop-propagation-flag). @@ -747,19 +713,19 @@ In all current engines. Firefox53+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android53+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ -___ +--- Node.js14.5.0+ @@ -783,7 +749,7 @@ The `defaultPrevented` getter steps are to return true if [this](https://webidl. The `composed` getter steps are to return true if [this](https://webidl.spec.whatwg.org/#this)’s [composed flag](https://dom.spec.whatwg.org/#composed-flag) is set; otherwise false. -___ +--- The `isTrusted` attribute must return the value it was initialized to. When an [event](https://dom.spec.whatwg.org/#concept-event) is created the attribute must be initialized to false. @@ -791,38 +757,29 @@ The `isTrusted` attribute must return the value it was initialized to. When an [ The `timeStamp` attribute must return the value it was initialized to. -___ +--- To initialize an event, with type, bubbles, and cancelable, run these steps: 1. Set event’s [initialized flag](https://dom.spec.whatwg.org/#initialized-flag). - 2. Unset event’s [stop propagation flag](https://dom.spec.whatwg.org/#stop-propagation-flag), [stop immediate propagation flag](https://dom.spec.whatwg.org/#stop-immediate-propagation-flag), and [canceled flag](https://dom.spec.whatwg.org/#canceled-flag). - 3. Set event’s `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` attribute to false. - 4. Set event’s [target](https://dom.spec.whatwg.org/#event-target) to null. - 5. Set event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute to type. - 6. Set event’s `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` attribute to bubbles. - 7. Set event’s `[cancelable](https://dom.spec.whatwg.org/#dom-event-cancelable)` attribute to cancelable. - The `initEvent(type, bubbles, cancelable)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this)’s [dispatch flag](https://dom.spec.whatwg.org/#dispatch-flag) is set, then return. - 2. [Initialize](https://dom.spec.whatwg.org/#concept-event-initialize) [this](https://webidl.spec.whatwg.org/#this) with type, bubbles, and cancelable. - `[initEvent()](https://dom.spec.whatwg.org/#dom-event-initevent)` is redundant with [event](https://dom.spec.whatwg.org/#concept-event) constructors and incapable of setting `[composed](https://dom.spec.whatwg.org/#dom-event-composed)`. It has to be supported for legacy content. ### 2.3. Legacy extensions to the `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` interface[](https://dom.spec.whatwg.org/#interface-window-extensions) partial interface [Window](https://html.spec.whatwg.org/multipage/window-object.html#window) { - \[[Replaceable](https://webidl.spec.whatwg.org/#Replaceable)\] readonly attribute ([Event](https://dom.spec.whatwg.org/#event) or [undefined](https://webidl.spec.whatwg.org/#idl-undefined)) [event](https://dom.spec.whatwg.org/#dom-window-event); // legacy +\[[Replaceable](https://webidl.spec.whatwg.org/#Replaceable)\] readonly attribute ([Event](https://dom.spec.whatwg.org/#event) or [undefined](https://webidl.spec.whatwg.org/#idl-undefined)) [event](https://dom.spec.whatwg.org/#dom-window-event); // legacy }; Each `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` object has an associated current event (undefined or an `[Event](https://dom.spec.whatwg.org/#event)` object). Unless stated otherwise it is undefined. @@ -839,29 +796,29 @@ In all current engines. Firefox6+Safari5+Chrome15+ -___ +--- Opera11+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android6+iOS Safari5+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile11+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=(Window,Worker)\] interface `CustomEvent` : [Event](https://dom.spec.whatwg.org/#event) { - `constructor`([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-customevent-customevent-type-eventinitdict-type), optional [CustomEventInit](https://dom.spec.whatwg.org/#dictdef-customeventinit) `eventInitDict`[](https://dom.spec.whatwg.org/#dom-customevent-customevent-type-eventinitdict-eventinitdict) = {}); +`constructor`([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-customevent-customevent-type-eventinitdict-type), optional [CustomEventInit](https://dom.spec.whatwg.org/#dictdef-customeventinit) `eventInitDict`[](https://dom.spec.whatwg.org/#dom-customevent-customevent-type-eventinitdict-eventinitdict) = {}); - readonly attribute [any](https://webidl.spec.whatwg.org/#idl-any) [detail](https://dom.spec.whatwg.org/#dom-customevent-detail); +readonly attribute [any](https://webidl.spec.whatwg.org/#idl-any) [detail](https://dom.spec.whatwg.org/#dom-customevent-detail); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [initCustomEvent](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-type), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `bubbles`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-bubbles) = false, optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `cancelable`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-cancelable) = false, optional [any](https://webidl.spec.whatwg.org/#idl-any) `detail`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-detail) = null); // legacy +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [initCustomEvent](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-type), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `bubbles`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-bubbles) = false, optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `cancelable`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-cancelable) = false, optional [any](https://webidl.spec.whatwg.org/#idl-any) `detail`[](https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-detail) = null); // legacy }; dictionary `CustomEventInit` : [EventInit](https://dom.spec.whatwg.org/#dictdef-eventinit) { - [any](https://webidl.spec.whatwg.org/#idl-any) `detail`[](https://dom.spec.whatwg.org/#dom-customeventinit-detail) = null; +[any](https://webidl.spec.whatwg.org/#idl-any) `detail`[](https://dom.spec.whatwg.org/#dom-customeventinit-detail) = null; }; [Events](https://dom.spec.whatwg.org/#concept-event) using the `[CustomEvent](https://dom.spec.whatwg.org/#customevent)` interface can be used to carry custom data. @@ -872,15 +829,15 @@ In all current engines. Firefox11+Safari6+Chrome15+ -___ +--- Opera11.6+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android14+iOS Safari6+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12+ @@ -894,19 +851,19 @@ In all current engines. Firefox11+Safari5+Chrome15+ -___ +--- Opera11.6+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android14+iOS Safari5+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12+ -``event . `[detail](https://dom.spec.whatwg.org/#dom-customevent-detail)` `` +`` event . `[detail](https://dom.spec.whatwg.org/#dom-customevent-detail)` `` Returns any custom data event was created with. Typically used for synthetic events. @@ -915,11 +872,8 @@ The `detail` attribute must return the value it was initialized to. The `initCustomEvent(type, bubbles, cancelable, detail)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this)’s [dispatch flag](https://dom.spec.whatwg.org/#dispatch-flag) is set, then return. - 2. [Initialize](https://dom.spec.whatwg.org/#concept-event-initialize) [this](https://webidl.spec.whatwg.org/#this) with type, bubbles, and cancelable. - 3. Set [this](https://webidl.spec.whatwg.org/#this)’s `[detail](https://dom.spec.whatwg.org/#dom-customevent-detail)` attribute to detail. - ### 2.5. Constructing events[](https://dom.spec.whatwg.org/#constructing-events) @@ -930,47 +884,36 @@ This construct can be used by `[Event](https://dom.spec.whatwg.org/#event)` subc When a constructor[](https://dom.spec.whatwg.org/#concept-event-constructor) of the `[Event](https://dom.spec.whatwg.org/#event)` interface, or of an interface that inherits from the `[Event](https://dom.spec.whatwg.org/#event)` interface, is invoked, these steps must be run, given the arguments type and eventInitDict: 1. Let event be the result of running the [inner event creation steps](https://dom.spec.whatwg.org/#inner-event-creation-steps) with this interface, null, now, and eventInitDict. - 2. Initialize event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute to type. - 3. Return event. - To create an event using eventInterface, which must be either `[Event](https://dom.spec.whatwg.org/#event)` or an interface that inherits from it, and optionally given a [Realm](https://tc39.es/ecma262/#realm) realm, run these steps: 1. If realm is not given, then set it to null. - 2. Let dictionary be the result of [converting](https://webidl.spec.whatwg.org/#dfn-convert-ecmascript-to-idl-value) the JavaScript value undefined to the dictionary type accepted by eventInterface’s constructor. (This dictionary type will either be `[EventInit](https://dom.spec.whatwg.org/#dictdef-eventinit)` or a dictionary that inherits from it.) - + This does not work if members are required; see [whatwg/dom#600](https://github.com/whatwg/dom/issues/600). - + 3. Let event be the result of running the [inner event creation steps](https://dom.spec.whatwg.org/#inner-event-creation-steps) with eventInterface, realm, the time of the occurrence that the event is signaling, and dictionary. - + [](https://dom.spec.whatwg.org/#example-timestamp-initialization)In macOS the time of the occurrence for input actions is available via the `timestamp` property of `NSEvent` objects. - + 4. Initialize event’s `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` attribute to true. - 5. Return event. - [Create an event](https://dom.spec.whatwg.org/#concept-event-create) is meant to be used by other specifications which need to separately [create](https://dom.spec.whatwg.org/#concept-event-create) and [dispatch](https://dom.spec.whatwg.org/#concept-event-dispatch) events, instead of simply [firing](https://dom.spec.whatwg.org/#concept-event-fire) them. It ensures the event’s attributes are initialized to the correct defaults. The inner event creation steps, given an interface, realm, time, and dictionary, are as follows: 1. Let event be the result of creating a new object using eventInterface. If realm is non-null, then use that Realm; otherwise, use the default behavior defined in Web IDL. - + As of the time of this writing Web IDL does not yet define any default behavior; see [whatwg/webidl#135](https://github.com/whatwg/webidl/issues/135). - + 2. Set event’s [initialized flag](https://dom.spec.whatwg.org/#initialized-flag). - 3. Initialize event’s `[timeStamp](https://dom.spec.whatwg.org/#dom-event-timestamp)` attribute to the [relative high resolution coarse time](https://w3c.github.io/hr-time/#dfn-relative-high-resolution-coarse-time) given time and event’s [relevant global object](https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global). - 4. [For each](https://infra.spec.whatwg.org/#map-iterate) member → value in dictionary, if event has an attribute whose [identifier](https://webidl.spec.whatwg.org/#dfn-identifier) is member, then initialize that attribute to value. - 5. Run the [event constructing steps](https://dom.spec.whatwg.org/#concept-event-constructor-ext) with event and dictionary. - 6. Return event. - ### 2.6. Defining event interfaces[](https://dom.spec.whatwg.org/#defining-event-interfaces) @@ -986,19 +929,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ @@ -1008,15 +951,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -1026,39 +969,39 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=(Window,Worker,AudioWorklet)\] interface `EventTarget` { - [constructor](https://dom.spec.whatwg.org/#dom-eventtarget-eventtarget)(); +[constructor](https://dom.spec.whatwg.org/#dom-eventtarget-eventtarget)(); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [addEventListener](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener-type-callback-options-type), [EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)? `callback`[](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener-type-callback-options-callback), optional ([AddEventListenerOptions](https://dom.spec.whatwg.org/#dictdef-addeventlisteneroptions) or [boolean](https://webidl.spec.whatwg.org/#idl-boolean)) `options`[](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener-type-callback-options-options) = {}); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [removeEventListener](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener-type-callback-options-type), [EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)? `callback`[](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener-type-callback-options-callback), optional ([EventListenerOptions](https://dom.spec.whatwg.org/#dictdef-eventlisteneroptions) or [boolean](https://webidl.spec.whatwg.org/#idl-boolean)) `options`[](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener-type-callback-options-options) = {}); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [dispatchEvent](https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent)([Event](https://dom.spec.whatwg.org/#event) `event`[](https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent-event-event)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [addEventListener](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener-type-callback-options-type), [EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)? `callback`[](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener-type-callback-options-callback), optional ([AddEventListenerOptions](https://dom.spec.whatwg.org/#dictdef-addeventlisteneroptions) or [boolean](https://webidl.spec.whatwg.org/#idl-boolean)) `options`[](https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener-type-callback-options-options) = {}); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [removeEventListener](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `type`[](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener-type-callback-options-type), [EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)? `callback`[](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener-type-callback-options-callback), optional ([EventListenerOptions](https://dom.spec.whatwg.org/#dictdef-eventlisteneroptions) or [boolean](https://webidl.spec.whatwg.org/#idl-boolean)) `options`[](https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener-type-callback-options-options) = {}); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [dispatchEvent](https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent)([Event](https://dom.spec.whatwg.org/#event) `event`[](https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent-event-event)); }; callback interface `EventListener` { - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) `handleEvent`[](https://dom.spec.whatwg.org/#dom-eventlistener-handleevent)([Event](https://dom.spec.whatwg.org/#event) `event`[](https://dom.spec.whatwg.org/#dom-eventlistener-handleevent-event-event)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) `handleEvent`[](https://dom.spec.whatwg.org/#dom-eventlistener-handleevent)([Event](https://dom.spec.whatwg.org/#event) `event`[](https://dom.spec.whatwg.org/#dom-eventlistener-handleevent-event-event)); }; dictionary `EventListenerOptions` { - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `capture` = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `capture` = false; }; dictionary `AddEventListenerOptions` : [EventListenerOptions](https://dom.spec.whatwg.org/#dictdef-eventlisteneroptions) { - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `passive` = false; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `once` = false; - [AbortSignal](https://dom.spec.whatwg.org/#abortsignal) `signal`; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `passive` = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `once` = false; +[AbortSignal](https://dom.spec.whatwg.org/#abortsignal) `signal`; }; An `[EventTarget](https://dom.spec.whatwg.org/#eventtarget)` object represents a target to which an [event](https://dom.spec.whatwg.org/#concept-event) can be [dispatched](https://dom.spec.whatwg.org/#concept-event-dispatch) when something has occurred. @@ -1067,13 +1010,13 @@ Each `[EventTarget](https://dom.spec.whatwg.org/#eventtarget)` object has an ass An event listener can be used to observe a specific [event](https://dom.spec.whatwg.org/#concept-event) and consists of: -- type (a string) -- callback (null or an `[EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)` object) -- capture (a boolean, initially false) -- passive (a boolean, initially false) -- once (a boolean, initially false) -- signal (null or an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object) -- removed (a boolean for bookkeeping purposes, initially false) +- type (a string) +- callback (null or an `[EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)` object) +- capture (a boolean, initially false) +- passive (a boolean, initially false) +- once (a boolean, initially false) +- signal (null or an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object) +- removed (a boolean for bookkeeping purposes, initially false) Although [callback](https://dom.spec.whatwg.org/#event-listener-callback) is an `[EventListener](https://dom.spec.whatwg.org/#callbackdef-eventlistener)` object, an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) is a broader concept as can be seen above. @@ -1095,19 +1038,19 @@ In all current engines. Firefox59+Safari14+Chrome64+ -___ +--- Opera51+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android59+iOS Safari14+Chrome for Android64+Android WebView64+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1121,19 +1064,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ @@ -1159,19 +1102,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ @@ -1185,19 +1128,19 @@ In all current engines. Firefox2+Safari3.1+Chrome4+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView4+Samsung Internet1.0+Opera Mobile10.1+ -___ +--- Node.js14.5.0+ @@ -1208,26 +1151,19 @@ Node.js14.5.0+ To flatten options, run these steps: 1. If options is a boolean, then return options. - 2. Return options\["`[capture](https://dom.spec.whatwg.org/#dom-eventlisteneroptions-capture)`"\]. - To flatten more options, run these steps: 1. Let capture be the result of [flattening](https://dom.spec.whatwg.org/#concept-flatten-options) options. - 2. Let once and passive be false. - 3. Let signal be null. - 4. If options is a [dictionary](https://webidl.spec.whatwg.org/#dfn-dictionary), then: - + 1. Set passive to options\["`[passive](https://dom.spec.whatwg.org/#dom-addeventlisteneroptions-passive)`"\] and once to options\["`[once](https://dom.spec.whatwg.org/#dom-addeventlisteneroptions-once)`"\]. - 2. If options\["`[signal](https://dom.spec.whatwg.org/#dom-addeventlisteneroptions-signal)`"\] [exists](https://infra.spec.whatwg.org/#map-exists), then set signal to options\["`[signal](https://dom.spec.whatwg.org/#dom-addeventlisteneroptions-signal)`"\]. - + 5. Return capture, passive, once, and signal. - The `new EventTarget()` constructor steps are to do nothing. @@ -1238,15 +1174,11 @@ In the future we could allow custom [get the parent](https://dom.spec.whatwg.org To add an event listener, given an `[EventTarget](https://dom.spec.whatwg.org/#eventtarget)` object eventTarget and an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) listener, run these steps: 1. If eventTarget is a `[ServiceWorkerGlobalScope](https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope)` object, its [service worker](https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-service-worker)’s [script resource](https://w3c.github.io/ServiceWorker/#dfn-script-resource)’s [has ever been evaluated flag](https://w3c.github.io/ServiceWorker/#dfn-has-ever-been-evaluated-flag) is set, and listener’s [type](https://dom.spec.whatwg.org/#event-listener-type) matches the `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value of any of the [service worker events](https://w3c.github.io/ServiceWorker/#dfn-service-worker-events), then [report a warning to the console](https://console.spec.whatwg.org/#report-a-warning-to-the-console) that this might not give the expected results. [\[SERVICE-WORKERS\]](https://dom.spec.whatwg.org/#biblio-service-workers) - 2. If listener’s [signal](https://dom.spec.whatwg.org/#event-listener-signal) is not null and is [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), then return. - 3. If listener’s [callback](https://dom.spec.whatwg.org/#event-listener-callback) is null, then return. - 4. If eventTarget’s [event listener list](https://dom.spec.whatwg.org/#eventtarget-event-listener-list) does not [contain](https://infra.spec.whatwg.org/#list-contain) an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) whose [type](https://dom.spec.whatwg.org/#event-listener-type) is listener’s [type](https://dom.spec.whatwg.org/#event-listener-type), [callback](https://dom.spec.whatwg.org/#event-listener-callback) is listener’s [callback](https://dom.spec.whatwg.org/#event-listener-callback), and [capture](https://dom.spec.whatwg.org/#event-listener-capture) is listener’s [capture](https://dom.spec.whatwg.org/#event-listener-capture), then [append](https://infra.spec.whatwg.org/#list-append) listener to eventTarget’s [event listener list](https://dom.spec.whatwg.org/#eventtarget-event-listener-list). - 5. If listener’s [signal](https://dom.spec.whatwg.org/#event-listener-signal) is not null, then [add the following](https://dom.spec.whatwg.org/#abortsignal-add) abort steps to it: - + 1. [Remove an event listener](https://dom.spec.whatwg.org/#remove-an-event-listener) with eventTarget and listener. The [add an event listener](https://dom.spec.whatwg.org/#add-an-event-listener) concept exists to ensure [event handlers](https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers) use the same code path. [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) @@ -1254,16 +1186,12 @@ The [add an event listener](https://dom.spec.whatwg.org/#add-an-event-listener) The `addEventListener(type, callback, options)` method steps are: 1. Let capture, passive, once, and signal be the result of [flattening more](https://dom.spec.whatwg.org/#event-flatten-more) options. - 2. [Add an event listener](https://dom.spec.whatwg.org/#add-an-event-listener) with [this](https://webidl.spec.whatwg.org/#this) and an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) whose [type](https://dom.spec.whatwg.org/#event-listener-type) is type, [callback](https://dom.spec.whatwg.org/#event-listener-callback) is callback, [capture](https://dom.spec.whatwg.org/#event-listener-capture) is capture, [passive](https://dom.spec.whatwg.org/#event-listener-passive) is passive, [once](https://dom.spec.whatwg.org/#event-listener-once) is once, and [signal](https://dom.spec.whatwg.org/#event-listener-signal) is signal. - To remove an event listener, given an `[EventTarget](https://dom.spec.whatwg.org/#eventtarget)` object eventTarget and an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) listener, run these steps: 1. If eventTarget is a `[ServiceWorkerGlobalScope](https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope)` object and its [service worker](https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-service-worker)’s [set of event types to handle](https://w3c.github.io/ServiceWorker/#dfn-set-of-event-types-to-handle) contains type, then [report a warning to the console](https://console.spec.whatwg.org/#report-a-warning-to-the-console) that this might not give the expected results. [\[SERVICE-WORKERS\]](https://dom.spec.whatwg.org/#biblio-service-workers) - 2. Set listener’s [removed](https://dom.spec.whatwg.org/#event-listener-removed) to true and [remove](https://infra.spec.whatwg.org/#list-remove) listener from eventTarget’s [event listener list](https://dom.spec.whatwg.org/#eventtarget-event-listener-list). - HTML needs this to define event handlers. [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) @@ -1274,20 +1202,15 @@ HTML needs this to define `document.open()`. [\[HTML\]](https://dom.spec.whatwg. The `removeEventListener(type, callback, options)` method steps are: 1. Let capture be the result of [flattening](https://dom.spec.whatwg.org/#concept-flatten-options) options. - 2. If [this](https://webidl.spec.whatwg.org/#this)’s [event listener list](https://dom.spec.whatwg.org/#eventtarget-event-listener-list) [contains](https://infra.spec.whatwg.org/#list-contain) an [event listener](https://dom.spec.whatwg.org/#concept-event-listener) whose [type](https://dom.spec.whatwg.org/#event-listener-type) is type, [callback](https://dom.spec.whatwg.org/#event-listener-callback) is callback, and [capture](https://dom.spec.whatwg.org/#event-listener-capture) is capture, then [remove an event listener](https://dom.spec.whatwg.org/#remove-an-event-listener) with [this](https://webidl.spec.whatwg.org/#this) and that [event listener](https://dom.spec.whatwg.org/#concept-event-listener). - The event listener list will not contain multiple event listeners with equal type, callback, and capture, as [add an event listener](https://dom.spec.whatwg.org/#add-an-event-listener) prevents that. The `dispatchEvent(event)` method steps are: 1. If event’s [dispatch flag](https://dom.spec.whatwg.org/#dispatch-flag) is set, or if its [initialized flag](https://dom.spec.whatwg.org/#initialized-flag) is not set, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. Initialize event’s `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` attribute to false. - 3. Return the result of [dispatching](https://dom.spec.whatwg.org/#concept-event-dispatch) event to [this](https://webidl.spec.whatwg.org/#this). - ### 2.8. Observing event listeners[](https://dom.spec.whatwg.org/#observing-event-listeners) @@ -1302,245 +1225,178 @@ Ideally, any new event APIs are defined such that they do not need this property To dispatch an event to a target, with an optional legacy target override flag and an optional legacyOutputDidListenersThrowFlag, run these steps: 1. Set event’s [dispatch flag](https://dom.spec.whatwg.org/#dispatch-flag). - 2. Let targetOverride be target, if legacy target override flag is not given, and target’s [associated `Document`](https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window) otherwise. [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) - + legacy target override flag is only used by HTML and only when target is a `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` object. - + 3. Let activationTarget be null. - 4. Let relatedTarget be the result of [retargeting](https://dom.spec.whatwg.org/#retarget) event’s [relatedTarget](https://dom.spec.whatwg.org/#event-relatedtarget) against target. - 5. If target is not relatedTarget or target is event’s [relatedTarget](https://dom.spec.whatwg.org/#event-relatedtarget), then: - + 1. Let touchTargets be a new [list](https://infra.spec.whatwg.org/#list). - 2. [For each](https://infra.spec.whatwg.org/#list-iterate) touchTarget of event’s [touch target list](https://dom.spec.whatwg.org/#event-touch-target-list), [append](https://infra.spec.whatwg.org/#list-append) the result of [retargeting](https://dom.spec.whatwg.org/#retarget) touchTarget against target to touchTargets. - 3. [Append to an event path](https://dom.spec.whatwg.org/#concept-event-path-append) with event, target, targetOverride, relatedTarget, touchTargets, and false. - 4. Let isActivationEvent be true, if event is a `[MouseEvent](https://www.w3.org/TR/uievents/#mouseevent)` object and event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute is "`click`"; otherwise false. - 5. If isActivationEvent is true and target has [activation behavior](https://dom.spec.whatwg.org/#eventtarget-activation-behavior), then set activationTarget to target. - 6. Let slottable be target, if target is a [slottable](https://dom.spec.whatwg.org/#concept-slotable) and is [assigned](https://dom.spec.whatwg.org/#slotable-assigned), and null otherwise. - 7. Let slot-in-closed-tree be false. - 8. Let parent be the result of invoking target’s [get the parent](https://dom.spec.whatwg.org/#get-the-parent) with event. - 9. While parent is non-null: - + 1. If slottable is non-null: - + 1. Assert: parent is a [slot](https://dom.spec.whatwg.org/#concept-slot). - 2. Set slottable to null. - 3. If parent’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) whose [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`closed`", then set slot-in-closed-tree to true. - + 2. If parent is a [slottable](https://dom.spec.whatwg.org/#concept-slotable) and is [assigned](https://dom.spec.whatwg.org/#slotable-assigned), then set slottable to parent. - 3. Let relatedTarget be the result of [retargeting](https://dom.spec.whatwg.org/#retarget) event’s [relatedTarget](https://dom.spec.whatwg.org/#event-relatedtarget) against parent. - 4. Let touchTargets be a new [list](https://infra.spec.whatwg.org/#list). - 5. [For each](https://infra.spec.whatwg.org/#list-iterate) touchTarget of event’s [touch target list](https://dom.spec.whatwg.org/#event-touch-target-list), [append](https://infra.spec.whatwg.org/#list-append) the result of [retargeting](https://dom.spec.whatwg.org/#retarget) touchTarget against parent to touchTargets. - 6. If parent is a `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` object, or parent is a [node](https://dom.spec.whatwg.org/#concept-node) and target’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-ancestor) of parent, then: - + 1. If isActivationEvent is true, event’s `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` attribute is true, activationTarget is null, and parent has [activation behavior](https://dom.spec.whatwg.org/#eventtarget-activation-behavior), then set activationTarget to parent. - 2. [Append to an event path](https://dom.spec.whatwg.org/#concept-event-path-append) with event, parent, null, relatedTarget, touchTargets, and slot-in-closed-tree. - + 7. Otherwise, if parent is relatedTarget, then set parent to null. - 8. Otherwise, set target to parent and then: - + 1. If isActivationEvent is true, activationTarget is null, and target has [activation behavior](https://dom.spec.whatwg.org/#eventtarget-activation-behavior), then set activationTarget to target. - 2. [Append to an event path](https://dom.spec.whatwg.org/#concept-event-path-append) with event, parent, target, relatedTarget, touchTargets, and slot-in-closed-tree. - + 9. If parent is non-null, then set parent to the result of invoking parent’s [get the parent](https://dom.spec.whatwg.org/#get-the-parent) with event. - - 10. Set slot-in-closed-tree to false. - - 10. Let clearTargetsStruct be the last struct in event’s [path](https://dom.spec.whatwg.org/#event-path) whose [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null. - - 11. Let clearTargets be true if clearTargetsStruct’s [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target), clearTargetsStruct’s [relatedTarget](https://dom.spec.whatwg.org/#event-path-relatedtarget), or an `[EventTarget](https://dom.spec.whatwg.org/#eventtarget)` object in clearTargetsStruct’s [touch target list](https://dom.spec.whatwg.org/#event-path-touch-target-list) is a [node](https://dom.spec.whatwg.org/#concept-node) and its [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root); otherwise false. - - 12. If activationTarget is non-null and activationTarget has [legacy-pre-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior), then run activationTarget’s [legacy-pre-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior). - - 13. [For each](https://infra.spec.whatwg.org/#list-iterate) struct in event’s [path](https://dom.spec.whatwg.org/#event-path), in reverse order: - - 1. If struct’s [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null, then set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target)`. - - 2. Otherwise, set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[CAPTURING_PHASE](https://dom.spec.whatwg.org/#dom-event-capturing_phase)`. - - 3. [Invoke](https://dom.spec.whatwg.org/#concept-event-listener-invoke) with struct, event, "`capturing`", and legacyOutputDidListenersThrowFlag if given. - - 14. [For each](https://infra.spec.whatwg.org/#list-iterate) struct in event’s [path](https://dom.spec.whatwg.org/#event-path): - - 1. If struct’s [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null, then set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target)`. - - 2. Otherwise: - - 1. If event’s `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` attribute is false, then [continue](https://infra.spec.whatwg.org/#iteration-continue). - - 2. Set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[BUBBLING_PHASE](https://dom.spec.whatwg.org/#dom-event-bubbling_phase)`. - - 3. [Invoke](https://dom.spec.whatwg.org/#concept-event-listener-invoke) with struct, event, "`bubbling`", and legacyOutputDidListenersThrowFlag if given. - + 10. Set slot-in-closed-tree to false. + + 10. Let clearTargetsStruct be the last struct in event’s [path](https://dom.spec.whatwg.org/#event-path) whose [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null. + + 11. Let clearTargets be true if clearTargetsStruct’s [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target), clearTargetsStruct’s [relatedTarget](https://dom.spec.whatwg.org/#event-path-relatedtarget), or an `[EventTarget](https://dom.spec.whatwg.org/#eventtarget)` object in clearTargetsStruct’s [touch target list](https://dom.spec.whatwg.org/#event-path-touch-target-list) is a [node](https://dom.spec.whatwg.org/#concept-node) and its [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root); otherwise false. + + 12. If activationTarget is non-null and activationTarget has [legacy-pre-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior), then run activationTarget’s [legacy-pre-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior). + + 13. [For each](https://infra.spec.whatwg.org/#list-iterate) struct in event’s [path](https://dom.spec.whatwg.org/#event-path), in reverse order: + + 14. If struct’s [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null, then set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target)`. + 15. Otherwise, set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[CAPTURING_PHASE](https://dom.spec.whatwg.org/#dom-event-capturing_phase)`. + 16. [Invoke](https://dom.spec.whatwg.org/#concept-event-listener-invoke) with struct, event, "`capturing`", and legacyOutputDidListenersThrowFlag if given. + 17. [For each](https://infra.spec.whatwg.org/#list-iterate) struct in event’s [path](https://dom.spec.whatwg.org/#event-path): + + 18. If struct’s [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null, then set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[AT_TARGET](https://dom.spec.whatwg.org/#dom-event-at_target)`. + 19. Otherwise: + + 1. If event’s `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` attribute is false, then [continue](https://infra.spec.whatwg.org/#iteration-continue). + 2. Set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[BUBBLING_PHASE](https://dom.spec.whatwg.org/#dom-event-bubbling_phase)`. + + 20. [Invoke](https://dom.spec.whatwg.org/#concept-event-listener-invoke) with struct, event, "`bubbling`", and legacyOutputDidListenersThrowFlag if given. + 6. Set event’s `[eventPhase](https://dom.spec.whatwg.org/#dom-event-eventphase)` attribute to `[NONE](https://dom.spec.whatwg.org/#dom-event-none)`. - 7. Set event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute to null. - 8. Set event’s [path](https://dom.spec.whatwg.org/#event-path) to the empty list. - 9. Unset event’s [dispatch flag](https://dom.spec.whatwg.org/#dispatch-flag), [stop propagation flag](https://dom.spec.whatwg.org/#stop-propagation-flag), and [stop immediate propagation flag](https://dom.spec.whatwg.org/#stop-immediate-propagation-flag). - -10. If clearTargets, then: - - 1. Set event’s [target](https://dom.spec.whatwg.org/#event-target) to null. - - 2. Set event’s [relatedTarget](https://dom.spec.whatwg.org/#event-relatedtarget) to null. - - 3. Set event’s [touch target list](https://dom.spec.whatwg.org/#event-touch-target-list) to the empty list. - -11. If activationTarget is non-null, then: - - 1. If event’s [canceled flag](https://dom.spec.whatwg.org/#canceled-flag) is unset, then run activationTarget’s [activation behavior](https://dom.spec.whatwg.org/#eventtarget-activation-behavior) with event. - - 2. Otherwise, if activationTarget has [legacy-canceled-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior), then run activationTarget’s [legacy-canceled-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior). - -12. Return false if event’s [canceled flag](https://dom.spec.whatwg.org/#canceled-flag) is set; otherwise true. - +10. If clearTargets, then: + +11. Set event’s [target](https://dom.spec.whatwg.org/#event-target) to null. +12. Set event’s [relatedTarget](https://dom.spec.whatwg.org/#event-relatedtarget) to null. +13. Set event’s [touch target list](https://dom.spec.whatwg.org/#event-touch-target-list) to the empty list. +14. If activationTarget is non-null, then: + +15. If event’s [canceled flag](https://dom.spec.whatwg.org/#canceled-flag) is unset, then run activationTarget’s [activation behavior](https://dom.spec.whatwg.org/#eventtarget-activation-behavior) with event. +16. Otherwise, if activationTarget has [legacy-canceled-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior), then run activationTarget’s [legacy-canceled-activation behavior](https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior). +17. Return false if event’s [canceled flag](https://dom.spec.whatwg.org/#canceled-flag) is set; otherwise true. To append to an event path, given an event, invocationTarget, shadowAdjustedTarget, relatedTarget, touchTargets, and a slot-in-closed-tree, run these steps: 1. Let invocationTargetInShadowTree be false. - 2. If invocationTarget is a [node](https://dom.spec.whatwg.org/#concept-node) and its [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then set invocationTargetInShadowTree to true. - 3. Let root-of-closed-tree be false. - 4. If invocationTarget is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) whose [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`closed`", then set root-of-closed-tree to true. - 5. [Append](https://infra.spec.whatwg.org/#list-append) a new [struct](https://infra.spec.whatwg.org/#struct) to event’s [path](https://dom.spec.whatwg.org/#event-path) whose [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target) is invocationTarget, [invocation-target-in-shadow-tree](https://dom.spec.whatwg.org/#event-path-invocation-target-in-shadow-tree) is invocationTargetInShadowTree, [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is shadowAdjustedTarget, [relatedTarget](https://dom.spec.whatwg.org/#event-path-relatedtarget) is relatedTarget, [touch target list](https://dom.spec.whatwg.org/#event-path-touch-target-list) is touchTargets, [root-of-closed-tree](https://dom.spec.whatwg.org/#event-path-root-of-closed-tree) is root-of-closed-tree, and [slot-in-closed-tree](https://dom.spec.whatwg.org/#event-path-slot-in-closed-tree) is slot-in-closed-tree. - To invoke, given a struct, event, phase, and an optional legacyOutputDidListenersThrowFlag, run these steps: 1. Set event’s [target](https://dom.spec.whatwg.org/#event-target) to the [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) of the last struct in event’s [path](https://dom.spec.whatwg.org/#event-path), that is either struct or preceding struct, whose [shadow-adjusted target](https://dom.spec.whatwg.org/#event-path-shadow-adjusted-target) is non-null. - 2. Set event’s [relatedTarget](https://dom.spec.whatwg.org/#event-relatedtarget) to struct’s [relatedTarget](https://dom.spec.whatwg.org/#event-path-relatedtarget). - 3. Set event’s [touch target list](https://dom.spec.whatwg.org/#event-touch-target-list) to struct’s [touch target list](https://dom.spec.whatwg.org/#event-path-touch-target-list). - 4. If event’s [stop propagation flag](https://dom.spec.whatwg.org/#stop-propagation-flag) is set, then return. - 5. Initialize event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute to struct’s [invocation target](https://dom.spec.whatwg.org/#event-path-invocation-target). - 6. Let listeners be a [clone](https://infra.spec.whatwg.org/#list-clone) of event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute value’s [event listener list](https://dom.spec.whatwg.org/#eventtarget-event-listener-list). - + This avoids [event listeners](https://dom.spec.whatwg.org/#concept-event-listener) added after this point from being run. Note that removal still has an effect due to the [removed](https://dom.spec.whatwg.org/#event-listener-removed) field. - + 7. Let invocationTargetInShadowTree be struct’s [invocation-target-in-shadow-tree](https://dom.spec.whatwg.org/#event-path-invocation-target-in-shadow-tree). - 8. Let found be the result of running [inner invoke](https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke) with event, listeners, phase, invocationTargetInShadowTree, and legacyOutputDidListenersThrowFlag if given. - 9. If found is false and event’s `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` attribute is true, then: - + 1. Let originalEventType be event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value. - 2. If event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value is a match for any of the strings in the first column in the following table, set event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value to the string in the second column on the same row as the matching string, and return otherwise. - + Event type - + Legacy event type - + "`animationend`" - + "`webkitAnimationEnd`" - + "`animationiteration`" - + "`webkitAnimationIteration`" - + "`animationstart`" - + "`webkitAnimationStart`" - + "`transitionend`" - + "`webkitTransitionEnd`" - + 3. [Inner invoke](https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke) with event, listeners, phase, invocationTargetInShadowTree, and legacyOutputDidListenersThrowFlag if given. - 4. Set event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value to originalEventType. - To inner invoke, given an event, listeners, phase, invocationTargetInShadowTree, and an optional legacyOutputDidListenersThrowFlag, run these steps: 1. Let found be false. - 2. [For each](https://infra.spec.whatwg.org/#list-iterate) listener in listeners, whose [removed](https://dom.spec.whatwg.org/#event-listener-removed) is false: - + 1. If event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value is not listener’s [type](https://dom.spec.whatwg.org/#event-listener-type), then [continue](https://infra.spec.whatwg.org/#iteration-continue). - 2. Set found to true. - 3. If phase is "`capturing`" and listener’s [capture](https://dom.spec.whatwg.org/#event-listener-capture) is false, then [continue](https://infra.spec.whatwg.org/#iteration-continue). - 4. If phase is "`bubbling`" and listener’s [capture](https://dom.spec.whatwg.org/#event-listener-capture) is true, then [continue](https://infra.spec.whatwg.org/#iteration-continue). - 5. If listener’s [once](https://dom.spec.whatwg.org/#event-listener-once) is true, then [remove](https://infra.spec.whatwg.org/#list-remove) listener from event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute value’s [event listener list](https://dom.spec.whatwg.org/#eventtarget-event-listener-list). - 6. Let global be listener [callback](https://dom.spec.whatwg.org/#event-listener-callback)’s [associated Realm](https://webidl.spec.whatwg.org/#dfn-associated-realm)’s [global object](https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global). - 7. Let currentEvent be undefined. - 8. If global is a `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` object, then: - + 1. Set currentEvent to global’s [current event](https://dom.spec.whatwg.org/#window-current-event). - 2. If invocationTargetInShadowTree is false, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to event. - + 9. If listener’s [passive](https://dom.spec.whatwg.org/#event-listener-passive) is true, then set event’s [in passive listener flag](https://dom.spec.whatwg.org/#in-passive-listener-flag). - - 10. [Call a user object’s operation](https://webidl.spec.whatwg.org/#call-a-user-objects-operation) with listener’s [callback](https://dom.spec.whatwg.org/#event-listener-callback), "`handleEvent`", « event », and event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute value. If this throws an exception, then: - - 1. [Report the exception](https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception). - - 2. Set legacyOutputDidListenersThrowFlag if given. - - The legacyOutputDidListenersThrowFlag is only used by Indexed Database API. [\[INDEXEDDB\]](https://dom.spec.whatwg.org/#biblio-indexeddb) - - 11. Unset event’s [in passive listener flag](https://dom.spec.whatwg.org/#in-passive-listener-flag). - - 12. If global is a `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` object, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to currentEvent. - - 13. If event’s [stop immediate propagation flag](https://dom.spec.whatwg.org/#stop-immediate-propagation-flag) is set, then return found. - + 10. [Call a user object’s operation](https://webidl.spec.whatwg.org/#call-a-user-objects-operation) with listener’s [callback](https://dom.spec.whatwg.org/#event-listener-callback), "`handleEvent`", « event », and event’s `[currentTarget](https://dom.spec.whatwg.org/#dom-event-currenttarget)` attribute value. If this throws an exception, then: + + 11. [Report the exception](https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception). + 12. Set legacyOutputDidListenersThrowFlag if given. + + The legacyOutputDidListenersThrowFlag is only used by Indexed Database API. [\[INDEXEDDB\]](https://dom.spec.whatwg.org/#biblio-indexeddb) + + 13. Unset event’s [in passive listener flag](https://dom.spec.whatwg.org/#in-passive-listener-flag). + + 14. If global is a `[Window](https://html.spec.whatwg.org/multipage/window-object.html#window)` object, then set global’s [current event](https://dom.spec.whatwg.org/#window-current-event) to currentEvent. + + 15. If event’s [stop immediate propagation flag](https://dom.spec.whatwg.org/#stop-immediate-propagation-flag) is set, then return found. + 3. Return found. - ### 2.10. Firing events[](https://dom.spec.whatwg.org/#firing-events) To fire an event named e at target, optionally using an eventConstructor, with a description of how IDL attributes are to be initialized, and a legacy target override flag, run these steps: 1. If eventConstructor is not given, then let eventConstructor be `[Event](https://dom.spec.whatwg.org/#event)`. - 2. Let event be the result of [creating an event](https://dom.spec.whatwg.org/#concept-event-create) given eventConstructor, in the [relevant Realm](https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm) of target. - 3. Initialize event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute to e. - 4. Initialize any other IDL attributes of event as described in the invocation of this algorithm. - + This also allows for the `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` attribute to be set to false. - + 5. Return the result of [dispatching](https://dom.spec.whatwg.org/#concept-event-dispatch) event at target, with legacy target override flag set if set. - Fire in the context of DOM is short for [creating](https://dom.spec.whatwg.org/#concept-event-create), initializing, and [dispatching](https://dom.spec.whatwg.org/#concept-event-dispatch) an [event](https://dom.spec.whatwg.org/#concept-event). [Fire an event](https://dom.spec.whatwg.org/#concept-event-fire) makes that process easier to write down. @@ -1551,9 +1407,7 @@ Or, when a custom constructor is needed, "[fire an event](https://dom.spec.whatw Occasionally the return value is important: 1. Let doAction be the result of [firing an event](https://dom.spec.whatwg.org/#concept-event-fire) named `like` at target. - 2. If doAction is true, then … - ### 2.11. Action versus occurrence[](https://dom.spec.whatwg.org/#action-versus-occurance) @@ -1617,29 +1471,29 @@ In all current engines. Firefox57+Safari12.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari12.2+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=(Window,Worker)\] interface `AbortController` { - [constructor](https://dom.spec.whatwg.org/#dom-abortcontroller-abortcontroller)(); +[constructor](https://dom.spec.whatwg.org/#dom-abortcontroller-abortcontroller)(); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [AbortSignal](https://dom.spec.whatwg.org/#abortsignal) [signal](https://dom.spec.whatwg.org/#dom-abortcontroller-signal); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [AbortSignal](https://dom.spec.whatwg.org/#abortsignal) [signal](https://dom.spec.whatwg.org/#dom-abortcontroller-signal); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [abort](https://dom.spec.whatwg.org/#dom-abortcontroller-abort)(optional [any](https://webidl.spec.whatwg.org/#idl-any) `reason`[](https://dom.spec.whatwg.org/#dom-abortcontroller-abort-reason-reason)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [abort](https://dom.spec.whatwg.org/#dom-abortcontroller-abort)(optional [any](https://webidl.spec.whatwg.org/#idl-any) `reason`[](https://dom.spec.whatwg.org/#dom-abortcontroller-abort-reason-reason)); }; [AbortController/AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/AbortController "The AbortController() constructor creates a new AbortController object instance.") @@ -1648,19 +1502,19 @@ In all current engines. Firefox57+Safari12.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari12.2+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1670,19 +1524,19 @@ In all current engines. Firefox57+Safari12.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari12.2+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1696,19 +1550,19 @@ In all current engines. Firefox57+Safari12.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari12.2+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1725,9 +1579,7 @@ An `[AbortController](https://dom.spec.whatwg.org/#abortcontroller)` object has The `new AbortController()` constructor steps are: 1. Let signal be a new `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object. - 2. Set [this](https://webidl.spec.whatwg.org/#this)’s [signal](https://dom.spec.whatwg.org/#abortcontroller-signal) to signal. - The `signal` getter steps are to return [this](https://webidl.spec.whatwg.org/#this)’s [signal](https://dom.spec.whatwg.org/#abortcontroller-signal). @@ -1741,31 +1593,31 @@ In all current engines. Firefox57+Safari11.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari11.3+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=(Window,Worker)\] interface `AbortSignal` : [EventTarget](https://dom.spec.whatwg.org/#eventtarget) { - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] static [AbortSignal](https://dom.spec.whatwg.org/#abortsignal) [abort](https://dom.spec.whatwg.org/#dom-abortsignal-abort)(optional [any](https://webidl.spec.whatwg.org/#idl-any) `reason`[](https://dom.spec.whatwg.org/#dom-abortsignal-abort-reason-reason)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] static [AbortSignal](https://dom.spec.whatwg.org/#abortsignal) [abort](https://dom.spec.whatwg.org/#dom-abortsignal-abort)(optional [any](https://webidl.spec.whatwg.org/#idl-any) `reason`[](https://dom.spec.whatwg.org/#dom-abortsignal-abort-reason-reason)); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [aborted](https://dom.spec.whatwg.org/#dom-abortsignal-aborted); - readonly attribute [any](https://webidl.spec.whatwg.org/#idl-any) [reason](https://dom.spec.whatwg.org/#dom-abortsignal-reason); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [throwIfAborted](https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted)(); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [aborted](https://dom.spec.whatwg.org/#dom-abortsignal-aborted); +readonly attribute [any](https://webidl.spec.whatwg.org/#idl-any) [reason](https://dom.spec.whatwg.org/#dom-abortsignal-reason); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [throwIfAborted](https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted)(); - attribute [EventHandler](https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler) [onabort](https://dom.spec.whatwg.org/#dom-abortsignal-onabort); +attribute [EventHandler](https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler) [onabort](https://dom.spec.whatwg.org/#dom-abortsignal-onabort); }; [AbortSignal/abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort "The static AbortSignal.abort() method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).") @@ -1774,19 +1626,19 @@ In all current engines. Firefox88+Safari15+Chrome93+ -___ +--- Opera79+Edge93+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android88+iOS Safari15+Chrome for Android93+Android WebView93+Samsung InternetNoneOpera MobileNone -___ +--- Node.jsNone @@ -1800,19 +1652,19 @@ In all current engines. Firefox57+Safari11.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari11.3+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1837,9 +1689,7 @@ An `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object has associat To add an algorithm algorithm to an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object signal, run these steps: 1. If signal is [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), then return. - 2. [Append](https://infra.spec.whatwg.org/#set-append) algorithm to signal’s [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms). - To remove[](https://dom.spec.whatwg.org/#abortsignal-remove) an algorithm algorithm from an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` signal, [remove](https://infra.spec.whatwg.org/#list-remove) algorithm from signal’s [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms). @@ -1848,9 +1698,7 @@ The [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms The static `abort(reason)` method steps are: 1. Let signal be a new `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object. - 2. Set signal’s [abort reason](https://dom.spec.whatwg.org/#abortsignal-abort-reason) to reason if it is given; otherwise to a new "`[AbortError](https://webidl.spec.whatwg.org/#aborterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. Return signal. The `aborted` getter steps are to return true if [this](https://webidl.spec.whatwg.org/#this) is [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted); otherwise false. @@ -1862,35 +1710,36 @@ The `throwIfAborted()` method steps are to throw [this](https://webidl.spec.what This method is primarily useful for when functions accepting `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)`s want to throw (or return a rejected promise) at specific checkpoints, instead of passing along the `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` to other methods. For example, the following function allows aborting in between each attempt to poll for a condition. This gives opportunities to abort the polling process, even though the actual asynchronous operation (i.e., `await func()`) does not accept an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)`. async function waitForCondition(func, targetValue, { signal } \= {}) { - while (true) { - signal?.throwIfAborted(); +while (true) { +signal?.throwIfAborted(); const result \= await func(); if (result \=== targetValue) { return; } - } + +} } -[AbortSignal/abort\_event](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_event "The abort event of the Fetch API is fired when a fetch request is aborted, i.e. using AbortController.abort().") +[AbortSignal/abort_event](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_event "The abort event of the Fetch API is fired when a fetch request is aborted, i.e. using AbortController.abort().") In all current engines. Firefox57+Safari11.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari11.3+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1900,19 +1749,19 @@ In all current engines. Firefox57+Safari11.1+Chrome66+ -___ +--- Opera53+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android57+iOS Safari11.3+Chrome for Android66+Android WebView66+Samsung Internet9.0+Opera Mobile47+ -___ +--- Node.js15.0.0+ @@ -1923,35 +1772,27 @@ Changes to an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object r To signal abort, given an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object signal and an optional reason, run these steps: 1. If signal is [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), then return. - 2. Set signal’s [abort reason](https://dom.spec.whatwg.org/#abortsignal-abort-reason) to reason if it is given; otherwise to a new "`[AbortError](https://webidl.spec.whatwg.org/#aborterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. [For each](https://infra.spec.whatwg.org/#list-iterate) algorithm in signal’s [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms): run algorithm. - 4. [Empty](https://infra.spec.whatwg.org/#list-empty) signal’s [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms). - 5. [Fire an event](https://dom.spec.whatwg.org/#concept-event-fire) named `[abort](https://dom.spec.whatwg.org/#eventdef-abortsignal-abort)` at signal. - A followingSignal (an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)`) is made to follow[](https://dom.spec.whatwg.org/#abortsignal-follow) a parentSignal (an `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)`) by running these steps: 1. If followingSignal is [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), then return. - 2. If parentSignal is [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), then [signal abort](https://dom.spec.whatwg.org/#abortsignal-signal-abort) on followingSignal with parentSignal’s [abort reason](https://dom.spec.whatwg.org/#abortsignal-abort-reason). - 3. Otherwise, [add the following abort steps](https://dom.spec.whatwg.org/#abortsignal-add) to parentSignal: - + 1. [Signal abort](https://dom.spec.whatwg.org/#abortsignal-signal-abort) on followingSignal with parentSignal’s [abort reason](https://dom.spec.whatwg.org/#abortsignal-abort-reason). - ### 3.3. Using `[AbortController](https://dom.spec.whatwg.org/#abortcontroller)` and `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` objects in APIs[](https://dom.spec.whatwg.org/#abortcontroller-api-integration) Any web platform API using promises to represent operations that can be aborted must adhere to the following: -- Accept `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` objects through a `signal` dictionary member. -- Convey that the operation got aborted by rejecting the promise with `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object’s [abort reason](https://dom.spec.whatwg.org/#abortsignal-abort-reason). -- Reject immediately if the `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` is already [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), otherwise: -- Use the [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms) mechanism to observe changes to the `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object and do so in a manner that does not lead to clashes with other observers. +- Accept `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` objects through a `signal` dictionary member. +- Convey that the operation got aborted by rejecting the promise with `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object’s [abort reason](https://dom.spec.whatwg.org/#abortsignal-abort-reason). +- Reject immediately if the `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` is already [aborted](https://dom.spec.whatwg.org/#abortsignal-aborted), otherwise: +- Use the [abort algorithms](https://dom.spec.whatwg.org/#abortsignal-abort-algorithms) mechanism to observe changes to the `[AbortSignal](https://dom.spec.whatwg.org/#abortsignal)` object and do so in a manner that does not lead to clashes with other observers. APIs not using promises should still adhere to the above as much as possible. @@ -1973,15 +1814,15 @@ To illustrate, consider this HTML document: It is represented as follows: -- [Document](https://dom.spec.whatwg.org/#concept-document) - - [Doctype](https://dom.spec.whatwg.org/#concept-doctype): `html` - - `[Element](https://dom.spec.whatwg.org/#element)`: `html` `class`\="`e`" - - `[Element](https://dom.spec.whatwg.org/#element)`: `head` - - `[Element](https://dom.spec.whatwg.org/#element)`: `title` - - `[Text](https://dom.spec.whatwg.org/#text)`: Aliens? - - `[Text](https://dom.spec.whatwg.org/#text)`: ⏎␣ - - `[Element](https://dom.spec.whatwg.org/#element)`: `body` - - `[Text](https://dom.spec.whatwg.org/#text)`: Why yes.⏎ +- [Document](https://dom.spec.whatwg.org/#concept-document) + - [Doctype](https://dom.spec.whatwg.org/#concept-doctype): `html` + - `[Element](https://dom.spec.whatwg.org/#element)`: `html` `class`\="`e`" + - `[Element](https://dom.spec.whatwg.org/#element)`: `head` + - `[Element](https://dom.spec.whatwg.org/#element)`: `title` + - `[Text](https://dom.spec.whatwg.org/#text)`: Aliens? + - `[Text](https://dom.spec.whatwg.org/#text)`: ⏎␣ + - `[Element](https://dom.spec.whatwg.org/#element)`: `body` + - `[Text](https://dom.spec.whatwg.org/#text)`: Why yes.⏎ Note that, due to the magic that is [HTML parsing](https://html.spec.whatwg.org/multipage/parsing.html#html-parser), not all [ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace) were turned into `[Text](https://dom.spec.whatwg.org/#text)` [nodes](https://dom.spec.whatwg.org/#concept-node), but the general concept is clear. Markup goes in, a [tree](https://dom.spec.whatwg.org/#concept-tree) of [nodes](https://dom.spec.whatwg.org/#concept-node) comes out. @@ -2000,15 +1841,10 @@ A [node tree](https://dom.spec.whatwg.org/#concept-node-tree) is constrained as In [tree order](https://dom.spec.whatwg.org/#concept-tree-order): 1. Zero or more `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` or `[Comment](https://dom.spec.whatwg.org/#comment)` [nodes](https://dom.spec.whatwg.org/#concept-node). - 2. Optionally one `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` [node](https://dom.spec.whatwg.org/#concept-node). - 3. Zero or more `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` or `[Comment](https://dom.spec.whatwg.org/#comment)` [nodes](https://dom.spec.whatwg.org/#concept-node). - 4. Optionally one `[Element](https://dom.spec.whatwg.org/#element)` [node](https://dom.spec.whatwg.org/#concept-node). - 5. Zero or more `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` or `[Comment](https://dom.spec.whatwg.org/#comment)` [nodes](https://dom.spec.whatwg.org/#concept-node). - `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` @@ -2029,11 +1865,8 @@ No [children](https://dom.spec.whatwg.org/#concept-tree-child). To determine the length of a [node](https://dom.spec.whatwg.org/#concept-node) node, run these steps: 1. If node is a `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` or `[Attr](https://dom.spec.whatwg.org/#attr)` [node](https://dom.spec.whatwg.org/#concept-node), then return 0. - 2. If node is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then return node’s [data](https://dom.spec.whatwg.org/#concept-cd-data)’s [length](https://infra.spec.whatwg.org/#string-length). - 3. Return the number of node’s [children](https://dom.spec.whatwg.org/#concept-tree-child). - A [node](https://dom.spec.whatwg.org/#concept-node) is considered empty if its [length](https://dom.spec.whatwg.org/#concept-node-length) is 0. @@ -2067,15 +1900,15 @@ In all current engines. Firefox63+Safari10+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -2088,19 +1921,13 @@ A [slot](https://dom.spec.whatwg.org/#concept-slot) has an associated name (a st Use these [attribute change steps](https://dom.spec.whatwg.org/#concept-element-attributes-change-ext) to update a [slot](https://dom.spec.whatwg.org/#concept-slot)’s [name](https://dom.spec.whatwg.org/#slot-name): 1. If element is a [slot](https://dom.spec.whatwg.org/#concept-slot), localName is `name`, and namespace is null, then: - + 1. If value is oldValue, then return. - 2. If value is null and oldValue is the empty string, then return. - 3. If value is the empty string and oldValue is null, then return. - 4. If value is null or the empty string, then set element’s [name](https://dom.spec.whatwg.org/#slot-name) to the empty string. - 5. Otherwise, set element’s [name](https://dom.spec.whatwg.org/#slot-name) to value. - 6. Run [assign slottables for a tree](https://dom.spec.whatwg.org/#assign-slotables-for-a-tree) with element’s [root](https://dom.spec.whatwg.org/#concept-tree-root). - The first [slot](https://dom.spec.whatwg.org/#concept-slot) in a [shadow tree](https://dom.spec.whatwg.org/#concept-shadow-tree), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order), whose [name](https://dom.spec.whatwg.org/#slot-name) is the empty string, is sometimes known as the "default slot". @@ -2117,21 +1944,14 @@ A [slottable](https://dom.spec.whatwg.org/#concept-slotable) has an associated n Use these [attribute change steps](https://dom.spec.whatwg.org/#concept-element-attributes-change-ext) to update a [slottable](https://dom.spec.whatwg.org/#concept-slotable)’s [name](https://dom.spec.whatwg.org/#slotable-name): 1. If localName is `slot` and namespace is null, then: - + 1. If value is oldValue, then return. - 2. If value is null and oldValue is the empty string, then return. - 3. If value is the empty string and oldValue is null, then return. - 4. If value is null or the empty string, then set element’s [name](https://dom.spec.whatwg.org/#slotable-name) to the empty string. - 5. Otherwise, set element’s [name](https://dom.spec.whatwg.org/#slotable-name) to value. - 6. If element is [assigned](https://dom.spec.whatwg.org/#slotable-assigned), then run [assign slottables](https://dom.spec.whatwg.org/#assign-slotables) for element’s [assigned slot](https://dom.spec.whatwg.org/#slotable-assigned-slot). - 7. Run [assign a slot](https://dom.spec.whatwg.org/#assign-a-slot) for element. - A [slottable](https://dom.spec.whatwg.org/#concept-slotable) has an associated assigned slot (null or a [slot](https://dom.spec.whatwg.org/#concept-slot)). Unless stated otherwise it is null. A [slottable](https://dom.spec.whatwg.org/#concept-slotable) is assigned if its [assigned slot](https://dom.spec.whatwg.org/#slotable-assigned-slot) is non-null. @@ -2144,87 +1964,62 @@ A [slottable](https://dom.spec.whatwg.org/#concept-slotable)’s [manual slot as To find a slot for a given [slottable](https://dom.spec.whatwg.org/#concept-slotable) slottable and an optional _open flag_ (unset unless stated otherwise), run these steps: 1. If slottable’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is null, then return null. - 2. Let shadow be slottable’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent)’s [shadow root](https://dom.spec.whatwg.org/#concept-element-shadow-root). - 3. If shadow is null, then return null. - 4. If the _open flag_ is set and shadow’s [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is _not_ "`open`", then return null. - 5. If shadow’s [slot assignment](https://dom.spec.whatwg.org/#shadowroot-slot-assignment) is "`manual`", then return the [slot](https://dom.spec.whatwg.org/#concept-slot) in shadow’s [descendants](https://dom.spec.whatwg.org/#concept-tree-descendant) whose [manually assigned nodes](https://html.spec.whatwg.org/multipage/scripting.html#manually-assigned-nodes) [contains](https://infra.spec.whatwg.org/#list-contain) slottable, if any; otherwise null. - 6. Return the first [slot](https://dom.spec.whatwg.org/#concept-slot) in [tree order](https://dom.spec.whatwg.org/#concept-tree-order) in shadow’s [descendants](https://dom.spec.whatwg.org/#concept-tree-descendant) whose [name](https://dom.spec.whatwg.org/#slot-name) is slottable’s [name](https://dom.spec.whatwg.org/#slotable-name), if any; otherwise null. - To find slottables for a given [slot](https://dom.spec.whatwg.org/#concept-slot) slot, run these steps: 1. Let result be an empty list. - 2. Let root be slot’s [root](https://dom.spec.whatwg.org/#concept-tree-root). - 3. If root is not a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then return result. - 4. Let host be root’s [host](https://dom.spec.whatwg.org/#concept-documentfragment-host). - 5. If root’s [slot assignment](https://dom.spec.whatwg.org/#shadowroot-slot-assignment) is "`manual`", then: - + 1. Let result be « ». - 2. [For each](https://infra.spec.whatwg.org/#list-iterate) [slottable](https://dom.spec.whatwg.org/#concept-slotable) slottable of slot’s [manually assigned nodes](https://html.spec.whatwg.org/multipage/scripting.html#manually-assigned-nodes), if slottable’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is host, [append](https://infra.spec.whatwg.org/#list-append) slottable to result. - + 6. Otherwise, for each [slottable](https://dom.spec.whatwg.org/#concept-slotable) [child](https://dom.spec.whatwg.org/#concept-tree-child) slottable of host, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order): - + 1. Let foundSlot be the result of [finding a slot](https://dom.spec.whatwg.org/#find-a-slot) given slottable. - 2. If foundSlot is slot, then [append](https://infra.spec.whatwg.org/#list-append) slottable to result. - + 7. Return result. - To find flattened slottables for a given [slot](https://dom.spec.whatwg.org/#concept-slot) slot, run these steps: 1. Let result be an empty list. - 2. If slot’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is not a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then return result. - 3. Let slottables be the result of [finding slottables](https://dom.spec.whatwg.org/#find-slotables) given slot. - 4. If slottables is the empty list, then append each [slottable](https://dom.spec.whatwg.org/#concept-slotable) [child](https://dom.spec.whatwg.org/#concept-tree-child) of slot, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order), to slottables. - 5. For each node in slottables: - + 1. If node is a [slot](https://dom.spec.whatwg.org/#concept-slot) whose [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then: - + 1. Let temporaryResult be the result of [finding flattened slottables](https://dom.spec.whatwg.org/#find-flattened-slotables) given node. - 2. Append each [slottable](https://dom.spec.whatwg.org/#concept-slotable) in temporaryResult, in order, to result. - + 2. Otherwise, append node to result. - + 6. Return result. - ##### 4.2.2.4. Assigning slottables and slots[](https://dom.spec.whatwg.org/#assigning-slotables-and-slots) To assign slottables for a [slot](https://dom.spec.whatwg.org/#concept-slot) slot, run these steps: 1. Let slottables be the result of [finding slottables](https://dom.spec.whatwg.org/#find-slotables) for slot. - 2. If slottables and slot’s [assigned nodes](https://dom.spec.whatwg.org/#slot-assigned-nodes) are not identical, then run [signal a slot change](https://dom.spec.whatwg.org/#signal-a-slot-change) for slot. - 3. Set slot’s [assigned nodes](https://dom.spec.whatwg.org/#slot-assigned-nodes) to slottables. - 4. For each slottable in slottables, set slottable’s [assigned slot](https://dom.spec.whatwg.org/#slotable-assigned-slot) to slot. - To assign slottables for a tree, given a [node](https://dom.spec.whatwg.org/#concept-node) root, run [assign slottables](https://dom.spec.whatwg.org/#assign-slotables) for each [slot](https://dom.spec.whatwg.org/#concept-slot) slot in root’s [inclusive descendants](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). To assign a slot, given a [slottable](https://dom.spec.whatwg.org/#concept-slotable) slottable, run these steps: 1. Let slot be the result of [finding a slot](https://dom.spec.whatwg.org/#find-a-slot) with slottable. - 2. If slot is non-null, then run [assign slottables](https://dom.spec.whatwg.org/#assign-slotables) for slot. - ##### 4.2.2.5. Signaling slot change[](https://dom.spec.whatwg.org/#signaling-slot-change) @@ -2233,53 +2028,40 @@ Each [similar-origin window agent](https://html.spec.whatwg.org/multipage/webapp To signal a slot change, for a [slot](https://dom.spec.whatwg.org/#concept-slot) slot, run these steps: 1. [Append](https://infra.spec.whatwg.org/#set-append) slot to slot’s [relevant agent](https://html.spec.whatwg.org/multipage/webappapis.html#relevant-agent)’s [signal slots](https://dom.spec.whatwg.org/#signal-slot-list). - 2. [Queue a mutation observer microtask](https://dom.spec.whatwg.org/#queue-a-mutation-observer-compound-microtask). - #### 4.2.3. Mutation algorithms[](https://dom.spec.whatwg.org/#mutation-algorithms) To ensure pre-insertion validity of a node into a parent before a child, run these steps: 1. If parent is not a `[Document](https://dom.spec.whatwg.org/#document)`, `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)`, or `[Element](https://dom.spec.whatwg.org/#element)` [node](https://dom.spec.whatwg.org/#concept-node), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If node is a [host-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-host-including-inclusive-ancestor) of parent, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. If child is non-null and its [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not parent, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotFoundError](https://webidl.spec.whatwg.org/#notfounderror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 4. If node is not a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)`, `[DocumentType](https://dom.spec.whatwg.org/#documenttype)`, `[Element](https://dom.spec.whatwg.org/#element)`, or `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 5. If either node is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) and parent is a [document](https://dom.spec.whatwg.org/#concept-document), or node is a [doctype](https://dom.spec.whatwg.org/#concept-doctype) and parent is not a [document](https://dom.spec.whatwg.org/#concept-document), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 6. If parent is a [document](https://dom.spec.whatwg.org/#concept-document), and any of the statements below, switched on the interface node [implements](https://webidl.spec.whatwg.org/#implements), are true, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` - + If node has more than one [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child) or has a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) [child](https://dom.spec.whatwg.org/#concept-tree-child). - + Otherwise, if node has one [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child) and either parent has an [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child), child is a [doctype](https://dom.spec.whatwg.org/#concept-doctype), or child is non-null and a [doctype](https://dom.spec.whatwg.org/#concept-doctype) is [following](https://dom.spec.whatwg.org/#concept-tree-following) child. - + `[Element](https://dom.spec.whatwg.org/#element)` - + parent has an [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child), child is a [doctype](https://dom.spec.whatwg.org/#concept-doctype), or child is non-null and a [doctype](https://dom.spec.whatwg.org/#concept-doctype) is [following](https://dom.spec.whatwg.org/#concept-tree-following) child. - + `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` - + parent has a [doctype](https://dom.spec.whatwg.org/#concept-doctype) [child](https://dom.spec.whatwg.org/#concept-tree-child), child is non-null and an [element](https://dom.spec.whatwg.org/#concept-element) is [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) child, or child is null and parent has an [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child). - To pre-insert a node into a parent before a child, run these steps: 1. [Ensure pre-insertion validity](https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity) of node into parent before child. - 2. Let referenceChild be child. - 3. If referenceChild is node, then set referenceChild to node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - 4. [Insert](https://dom.spec.whatwg.org/#concept-node-insert) node into parent before referenceChild. - 5. Return node. - [Specifications](https://dom.spec.whatwg.org/#other-applicable-specifications) may define insertion steps for all or some [nodes](https://dom.spec.whatwg.org/#concept-node). The algorithm is passed insertedNode, as indicated in the [insert](https://dom.spec.whatwg.org/#concept-node-insert) algorithm below. @@ -2288,207 +2070,158 @@ To pre-insert a node into a parent before a child, run these steps: To insert a node into a parent before a child, with an optional _suppress observers flag_, run these steps: 1. Let nodes be node’s [children](https://dom.spec.whatwg.org/#concept-tree-child), if node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node); otherwise « node ». - 2. Let count be nodes’s [size](https://infra.spec.whatwg.org/#list-size). - 3. If count is 0, then return. - 4. If node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + 1. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) its [children](https://dom.spec.whatwg.org/#concept-tree-child) with the _suppress observers flag_ set. - 2. [Queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for node with « », nodes, null, and null. - + This step intentionally does not pay attention to the _suppress observers flag_. - + 5. If child is non-null, then: - + 1. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is parent and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is greater than child’s [index](https://dom.spec.whatwg.org/#concept-tree-index), increase its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) by count. - 2. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is parent and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is greater than child’s [index](https://dom.spec.whatwg.org/#concept-tree-index), increase its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) by count. - + 6. Let previousSibling be child’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) or parent’s [last child](https://dom.spec.whatwg.org/#concept-tree-last-child) if child is null. - 7. For each node in nodes, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order): - + 1. [Adopt](https://dom.spec.whatwg.org/#concept-node-adopt) node into parent’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. If child is null, then [append](https://infra.spec.whatwg.org/#set-append) node to parent’s [children](https://dom.spec.whatwg.org/#concept-tree-child). - 3. Otherwise, [insert](https://infra.spec.whatwg.org/#list-insert) node into parent’s [children](https://dom.spec.whatwg.org/#concept-tree-child) before child’s [index](https://dom.spec.whatwg.org/#concept-tree-index). - 4. If parent is a [shadow host](https://dom.spec.whatwg.org/#element-shadow-host) whose [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root)’s [slot assignment](https://dom.spec.whatwg.org/#shadowroot-slot-assignment) is "`named`" and node is a [slottable](https://dom.spec.whatwg.org/#concept-slotable), then [assign a slot](https://dom.spec.whatwg.org/#assign-a-slot) for node. - 5. If parent’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), and parent is a [slot](https://dom.spec.whatwg.org/#concept-slot) whose [assigned nodes](https://dom.spec.whatwg.org/#slot-assigned-nodes) is the empty list, then run [signal a slot change](https://dom.spec.whatwg.org/#signal-a-slot-change) for parent. - 6. Run [assign slottables for a tree](https://dom.spec.whatwg.org/#assign-slotables-for-a-tree) with node’s [root](https://dom.spec.whatwg.org/#concept-tree-root). - 7. For each [shadow-including inclusive descendant](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-descendant) inclusiveDescendant of node, in [shadow-including tree order](https://dom.spec.whatwg.org/#concept-shadow-including-tree-order): - + 1. Run the [insertion steps](https://dom.spec.whatwg.org/#concept-node-insert-ext) with inclusiveDescendant. - 2. If inclusiveDescendant is [connected](https://dom.spec.whatwg.org/#connected), then: - + 1. If inclusiveDescendant is [custom](https://dom.spec.whatwg.org/#concept-element-custom), then [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with inclusiveDescendant, callback name "`connectedCallback`", and an empty argument list. - 2. Otherwise, [try to upgrade](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-try-upgrade) inclusiveDescendant. - + If this successfully upgrades inclusiveDescendant, its `connectedCallback` will be enqueued automatically during the [upgrade an element](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element) algorithm. - + 8. If _suppress observers flag_ is unset, then [queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for parent with nodes, « », previousSibling, and child. - 9. Run the [children changed steps](https://dom.spec.whatwg.org/#concept-node-children-changed-ext) for parent. - To append a node to a parent, [pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into parent before null. To replace a child with node within a parent, run these steps: 1. If parent is not a `[Document](https://dom.spec.whatwg.org/#document)`, `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)`, or `[Element](https://dom.spec.whatwg.org/#element)` [node](https://dom.spec.whatwg.org/#concept-node), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If node is a [host-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-host-including-inclusive-ancestor) of parent, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. If child’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not parent, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotFoundError](https://webidl.spec.whatwg.org/#notfounderror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 4. If node is not a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)`, `[DocumentType](https://dom.spec.whatwg.org/#documenttype)`, `[Element](https://dom.spec.whatwg.org/#element)`, or `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 5. If either node is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) and parent is a [document](https://dom.spec.whatwg.org/#concept-document), or node is a [doctype](https://dom.spec.whatwg.org/#concept-doctype) and parent is not a [document](https://dom.spec.whatwg.org/#concept-document), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 6. If parent is a [document](https://dom.spec.whatwg.org/#concept-document), and any of the statements below, switched on the interface node [implements](https://webidl.spec.whatwg.org/#implements), are true, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` - + If node has more than one [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child) or has a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) [child](https://dom.spec.whatwg.org/#concept-tree-child). - + Otherwise, if node has one [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child) and either parent has an [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child) that is not child or a [doctype](https://dom.spec.whatwg.org/#concept-doctype) is [following](https://dom.spec.whatwg.org/#concept-tree-following) child. - + `[Element](https://dom.spec.whatwg.org/#element)` - + parent has an [element](https://dom.spec.whatwg.org/#concept-element) [child](https://dom.spec.whatwg.org/#concept-tree-child) that is not child or a [doctype](https://dom.spec.whatwg.org/#concept-doctype) is [following](https://dom.spec.whatwg.org/#concept-tree-following) child. - + `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` - + parent has a [doctype](https://dom.spec.whatwg.org/#concept-doctype) [child](https://dom.spec.whatwg.org/#concept-tree-child) that is not child, or an [element](https://dom.spec.whatwg.org/#concept-element) is [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) child. - + The above statements differ from the [pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) algorithm. - + 7. Let referenceChild be child’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - 8. If referenceChild is node, then set referenceChild to node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - 9. Let previousSibling be child’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling). - -10. Let removedNodes be the empty set. - -11. If child’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is non-null, then: - - 1. Set removedNodes to « child ». - - 2. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) child with the _suppress observers flag_ set. - - +10. Let removedNodes be the empty set. + +11. If child’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is non-null, then: + +12. Set removedNodes to « child ». +13. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) child with the _suppress observers flag_ set. + + The above can only be false if child is node. - -12. Let nodes be node’s [children](https://dom.spec.whatwg.org/#concept-tree-child) if node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node); otherwise « node ». - -13. [Insert](https://dom.spec.whatwg.org/#concept-node-insert) node into parent before referenceChild with the _suppress observers flag_ set. - -14. [Queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for parent with nodes, removedNodes, previousSibling, and referenceChild. - -15. Return child. - + +12. Let nodes be node’s [children](https://dom.spec.whatwg.org/#concept-tree-child) if node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node); otherwise « node ». + +13. [Insert](https://dom.spec.whatwg.org/#concept-node-insert) node into parent before referenceChild with the _suppress observers flag_ set. + +14. [Queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for parent with nodes, removedNodes, previousSibling, and referenceChild. + +15. Return child. To replace all with a node within a parent, run these steps: 1. Let removedNodes be parent’s [children](https://dom.spec.whatwg.org/#concept-tree-child). - 2. Let addedNodes be the empty set. - 3. If node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node), then set addedNodes to node’s [children](https://dom.spec.whatwg.org/#concept-tree-child). - 4. Otherwise, if node is non-null, set addedNodes to « node ». - 5. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) all parent’s [children](https://dom.spec.whatwg.org/#concept-tree-child), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order), with the _suppress observers flag_ set. - 6. If node is non-null, then [insert](https://dom.spec.whatwg.org/#concept-node-insert) node into parent before null with the _suppress observers flag_ set. - 7. If either addedNodes or removedNodes [is not empty](https://infra.spec.whatwg.org/#list-is-empty), then [queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for parent with addedNodes, removedNodes, null, and null. - This algorithm does not make any checks with regards to the [node tree](https://dom.spec.whatwg.org/#concept-node-tree) constraints. Specification authors need to use it wisely. To pre-remove a child from a parent, run these steps: 1. If child’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not parent, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotFoundError](https://webidl.spec.whatwg.org/#notfounderror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) child. - 3. Return child. - [Specifications](https://dom.spec.whatwg.org/#other-applicable-specifications) may define removing steps for all or some [nodes](https://dom.spec.whatwg.org/#concept-node). The algorithm is passed removedNode, and optionally oldParent, as indicated in the [remove](https://dom.spec.whatwg.org/#concept-node-remove) algorithm below. To remove a node, with an optional _suppress observers flag_, run these steps: 1. Let parent be node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) - 2. Assert: parent is non-null. - 3. Let index be node’s [index](https://dom.spec.whatwg.org/#concept-tree-index). - 4. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of node, set its [start](https://dom.spec.whatwg.org/#concept-range-start) to (parent, index). - 5. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of node, set its [end](https://dom.spec.whatwg.org/#concept-range-end) to (parent, index). - 6. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is parent and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is greater than index, decrease its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) by 1. - 7. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is parent and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is greater than index, decrease its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) by 1. - 8. For each `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` object iterator whose [root](https://dom.spec.whatwg.org/#concept-traversal-root)’s [node document](https://dom.spec.whatwg.org/#concept-node-document) is node’s [node document](https://dom.spec.whatwg.org/#concept-node-document), run the [`NodeIterator` pre-removing steps](https://dom.spec.whatwg.org/#nodeiterator-pre-removing-steps) given node and iterator. - 9. Let oldPreviousSibling be node’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling). - -10. Let oldNextSibling be node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - -11. [Remove](https://infra.spec.whatwg.org/#list-remove) node from its parent’s [children](https://dom.spec.whatwg.org/#concept-tree-child). - -12. If node is [assigned](https://dom.spec.whatwg.org/#slotable-assigned), then run [assign slottables](https://dom.spec.whatwg.org/#assign-slotables) for node’s [assigned slot](https://dom.spec.whatwg.org/#slotable-assigned-slot). - -13. If parent’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), and parent is a [slot](https://dom.spec.whatwg.org/#concept-slot) whose [assigned nodes](https://dom.spec.whatwg.org/#slot-assigned-nodes) is the empty list, then run [signal a slot change](https://dom.spec.whatwg.org/#signal-a-slot-change) for parent. - -14. If node has an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) that is a [slot](https://dom.spec.whatwg.org/#concept-slot), then: - - 1. Run [assign slottables for a tree](https://dom.spec.whatwg.org/#assign-slotables-for-a-tree) with parent’s [root](https://dom.spec.whatwg.org/#concept-tree-root). - - 2. Run [assign slottables for a tree](https://dom.spec.whatwg.org/#assign-slotables-for-a-tree) with node. - -15. Run the [removing steps](https://dom.spec.whatwg.org/#concept-node-remove-ext) with node and parent. - -16. Let isParentConnected be parent’s [connected](https://dom.spec.whatwg.org/#connected). - -17. If node is [custom](https://dom.spec.whatwg.org/#concept-element-custom) and isParentConnected is true, then [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with node, callback name "`disconnectedCallback`", and an empty argument list. - +10. Let oldNextSibling be node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). + +11. [Remove](https://infra.spec.whatwg.org/#list-remove) node from its parent’s [children](https://dom.spec.whatwg.org/#concept-tree-child). + +12. If node is [assigned](https://dom.spec.whatwg.org/#slotable-assigned), then run [assign slottables](https://dom.spec.whatwg.org/#assign-slotables) for node’s [assigned slot](https://dom.spec.whatwg.org/#slotable-assigned-slot). + +13. If parent’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), and parent is a [slot](https://dom.spec.whatwg.org/#concept-slot) whose [assigned nodes](https://dom.spec.whatwg.org/#slot-assigned-nodes) is the empty list, then run [signal a slot change](https://dom.spec.whatwg.org/#signal-a-slot-change) for parent. + +14. If node has an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) that is a [slot](https://dom.spec.whatwg.org/#concept-slot), then: + +15. Run [assign slottables for a tree](https://dom.spec.whatwg.org/#assign-slotables-for-a-tree) with parent’s [root](https://dom.spec.whatwg.org/#concept-tree-root). +16. Run [assign slottables for a tree](https://dom.spec.whatwg.org/#assign-slotables-for-a-tree) with node. +17. Run the [removing steps](https://dom.spec.whatwg.org/#concept-node-remove-ext) with node and parent. + +18. Let isParentConnected be parent’s [connected](https://dom.spec.whatwg.org/#connected). + +19. If node is [custom](https://dom.spec.whatwg.org/#concept-element-custom) and isParentConnected is true, then [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with node, callback name "`disconnectedCallback`", and an empty argument list. + + It is intentional for now that [custom](https://dom.spec.whatwg.org/#concept-element-custom) [elements](https://dom.spec.whatwg.org/#concept-element) do not get parent passed. This might change in the future if there is a need. - -18. For each [shadow-including descendant](https://dom.spec.whatwg.org/#concept-shadow-including-descendant) descendant of node, in [shadow-including tree order](https://dom.spec.whatwg.org/#concept-shadow-including-tree-order), then: - - 1. Run the [removing steps](https://dom.spec.whatwg.org/#concept-node-remove-ext) with descendant. - - 2. If descendant is [custom](https://dom.spec.whatwg.org/#concept-element-custom) and isParentConnected is true, then [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with descendant, callback name "`disconnectedCallback`", and an empty argument list. - -19. For each [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) inclusiveAncestor of parent, and then [for each](https://infra.spec.whatwg.org/#list-iterate) registered of inclusiveAncestor’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list), if registered’s [options](https://dom.spec.whatwg.org/#registered-observer-options)\["`[subtree](https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree)`"\] is true, then [append](https://infra.spec.whatwg.org/#list-append) a new [transient registered observer](https://dom.spec.whatwg.org/#transient-registered-observer) whose [observer](https://dom.spec.whatwg.org/#registered-observer-observer) is registered’s [observer](https://dom.spec.whatwg.org/#registered-observer-observer), [options](https://dom.spec.whatwg.org/#registered-observer-options) is registered’s [options](https://dom.spec.whatwg.org/#registered-observer-options), and [source](https://dom.spec.whatwg.org/#transient-registered-observer-source) is registered to node’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list). - -20. If _suppress observers flag_ is unset, then [queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for parent with « », « node », oldPreviousSibling, and oldNextSibling. - -21. Run the [children changed steps](https://dom.spec.whatwg.org/#concept-node-children-changed-ext) for parent. - + +18. For each [shadow-including descendant](https://dom.spec.whatwg.org/#concept-shadow-including-descendant) descendant of node, in [shadow-including tree order](https://dom.spec.whatwg.org/#concept-shadow-including-tree-order), then: + +1. Run the [removing steps](https://dom.spec.whatwg.org/#concept-node-remove-ext) with descendant. +1. If descendant is [custom](https://dom.spec.whatwg.org/#concept-element-custom) and isParentConnected is true, then [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with descendant, callback name "`disconnectedCallback`", and an empty argument list. +1. For each [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) inclusiveAncestor of parent, and then [for each](https://infra.spec.whatwg.org/#list-iterate) registered of inclusiveAncestor’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list), if registered’s [options](https://dom.spec.whatwg.org/#registered-observer-options)\["`[subtree](https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree)`"\] is true, then [append](https://infra.spec.whatwg.org/#list-append) a new [transient registered observer](https://dom.spec.whatwg.org/#transient-registered-observer) whose [observer](https://dom.spec.whatwg.org/#registered-observer-observer) is registered’s [observer](https://dom.spec.whatwg.org/#registered-observer-observer), [options](https://dom.spec.whatwg.org/#registered-observer-options) is registered’s [options](https://dom.spec.whatwg.org/#registered-observer-options), and [source](https://dom.spec.whatwg.org/#transient-registered-observer-source) is registered to node’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list). + +1. If _suppress observers flag_ is unset, then [queue a tree mutation record](https://dom.spec.whatwg.org/#queue-a-tree-mutation-record) for parent with « », « node », oldPreviousSibling, and oldNextSibling. + +1. Run the [children changed steps](https://dom.spec.whatwg.org/#concept-node-children-changed-ext) for parent. #### 4.2.4. Mixin `[NonElementParentNode](https://dom.spec.whatwg.org/#nonelementparentnode)`[](https://dom.spec.whatwg.org/#interface-nonelementparentnode) Web compatibility prevents the `[getElementById()](https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid)` method from being exposed on [elements](https://dom.spec.whatwg.org/#concept-element) (and therefore on `[ParentNode](https://dom.spec.whatwg.org/#parentnode)`). interface mixin `NonElementParentNode` { - [Element](https://dom.spec.whatwg.org/#element)? [getElementById](https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `elementId`[](https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid-elementid-elementid)); +[Element](https://dom.spec.whatwg.org/#element)? [getElementById](https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `elementId`[](https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid-elementid-elementid)); }; [Document](https://dom.spec.whatwg.org/#document) includes [NonElementParentNode](https://dom.spec.whatwg.org/#nonelementparentnode); [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) includes [NonElementParentNode](https://dom.spec.whatwg.org/#nonelementparentnode); @@ -2499,15 +2232,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -2531,28 +2264,23 @@ The `[DocumentOrShadowRoot](https://dom.spec.whatwg.org/#documentorshadowroot)` To convert nodes into a node, given nodes and document, run these steps: 1. Let node be null. - 2. Replace each string in nodes with a new `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is the string and [node document](https://dom.spec.whatwg.org/#concept-node-document) is document. - 3. If nodes contains one [node](https://dom.spec.whatwg.org/#concept-node), then set node to nodes\[0\]. - 4. Otherwise, set node to a new `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node) whose [node document](https://dom.spec.whatwg.org/#concept-node-document) is document, and then [append](https://dom.spec.whatwg.org/#concept-node-append) each [node](https://dom.spec.whatwg.org/#concept-node) in nodes, if any, to it. - 5. Return node. - interface mixin `ParentNode` { - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [children](https://dom.spec.whatwg.org/#dom-parentnode-children); - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [firstElementChild](https://dom.spec.whatwg.org/#dom-parentnode-firstelementchild); - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [lastElementChild](https://dom.spec.whatwg.org/#dom-parentnode-lastelementchild); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [childElementCount](https://dom.spec.whatwg.org/#dom-parentnode-childelementcount); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [children](https://dom.spec.whatwg.org/#dom-parentnode-children); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [firstElementChild](https://dom.spec.whatwg.org/#dom-parentnode-firstelementchild); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [lastElementChild](https://dom.spec.whatwg.org/#dom-parentnode-lastelementchild); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [childElementCount](https://dom.spec.whatwg.org/#dom-parentnode-childelementcount); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [prepend](https://dom.spec.whatwg.org/#dom-parentnode-prepend)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-parentnode-prepend-nodes-nodes)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [append](https://dom.spec.whatwg.org/#dom-parentnode-append)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-parentnode-append-nodes-nodes)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [replaceChildren](https://dom.spec.whatwg.org/#dom-parentnode-replacechildren)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-parentnode-replacechildren-nodes-nodes)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [prepend](https://dom.spec.whatwg.org/#dom-parentnode-prepend)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-parentnode-prepend-nodes-nodes)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [append](https://dom.spec.whatwg.org/#dom-parentnode-append)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-parentnode-append-nodes-nodes)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [replaceChildren](https://dom.spec.whatwg.org/#dom-parentnode-replacechildren)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-parentnode-replacechildren-nodes-nodes)); - [Element](https://dom.spec.whatwg.org/#element)? [querySelector](https://dom.spec.whatwg.org/#dom-parentnode-queryselector)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-parentnode-queryselector-selectors-selectors)); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [NodeList](https://dom.spec.whatwg.org/#nodelist) [querySelectorAll](https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall-selectors-selectors)); +[Element](https://dom.spec.whatwg.org/#element)? [querySelector](https://dom.spec.whatwg.org/#dom-parentnode-queryselector)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-parentnode-queryselector-selectors-selectors)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [NodeList](https://dom.spec.whatwg.org/#nodelist) [querySelectorAll](https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall-selectors-selectors)); }; [Document](https://dom.spec.whatwg.org/#document) includes [ParentNode](https://dom.spec.whatwg.org/#parentnode); [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) includes [ParentNode](https://dom.spec.whatwg.org/#parentnode); @@ -2564,15 +2292,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -2582,15 +2310,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -2600,19 +2328,19 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ -``collection = node . `[children](https://dom.spec.whatwg.org/#dom-parentnode-children)` `` +`` collection = node . `[children](https://dom.spec.whatwg.org/#dom-parentnode-children)` `` Returns the [child](https://dom.spec.whatwg.org/#concept-tree-child) [elements](https://dom.spec.whatwg.org/#concept-element). @@ -2622,15 +2350,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -2640,15 +2368,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -2658,19 +2386,19 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ -``element = node . `[firstElementChild](https://dom.spec.whatwg.org/#dom-parentnode-firstelementchild)` `` +`` element = node . `[firstElementChild](https://dom.spec.whatwg.org/#dom-parentnode-firstelementchild)` `` Returns the first [child](https://dom.spec.whatwg.org/#concept-tree-child) that is an [element](https://dom.spec.whatwg.org/#concept-element); otherwise null. @@ -2680,15 +2408,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -2698,15 +2426,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -2716,19 +2444,19 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ -``element = node . `[lastElementChild](https://dom.spec.whatwg.org/#dom-parentnode-lastelementchild)` `` +`` element = node . `[lastElementChild](https://dom.spec.whatwg.org/#dom-parentnode-lastelementchild)` `` Returns the last [child](https://dom.spec.whatwg.org/#concept-tree-child) that is an [element](https://dom.spec.whatwg.org/#concept-element); otherwise null. @@ -2738,15 +2466,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -2756,15 +2484,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -2774,15 +2502,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -2798,15 +2526,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -2816,15 +2544,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -2834,15 +2562,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -2858,15 +2586,15 @@ In all current engines. Firefox78+Safari14+Chrome86+ -___ +--- Opera72+Edge86+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android79+iOS Safari14+Chrome for Android86+Android WebView86+Samsung Internet14.0+Opera Mobile61+ @@ -2876,15 +2604,15 @@ In all current engines. Firefox78+Safari14+Chrome86+ -___ +--- Opera72+Edge86+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android79+iOS Safari14+Chrome for Android86+Android WebView86+Samsung Internet14.0+Opera Mobile61+ @@ -2894,15 +2622,15 @@ In all current engines. Firefox78+Safari14+Chrome86+ -___ +--- Opera72+Edge86+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android79+iOS Safari14+Chrome for Android86+Android WebView86+Samsung Internet14.0+Opera Mobile61+ @@ -2918,15 +2646,15 @@ In all current engines. Firefox3.5+Safari3.1+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -2936,15 +2664,15 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ @@ -2958,15 +2686,15 @@ In all current engines. Firefox3.5+Safari3.1+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -2976,15 +2704,15 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ @@ -2994,15 +2722,15 @@ In all current engines. Firefox3.5+Safari3.1+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -3012,15 +2740,15 @@ In all current engines. Firefox3.5+Safari3.1+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -3040,15 +2768,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -3058,15 +2786,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -3076,15 +2804,15 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ @@ -3093,25 +2821,18 @@ The `childElementCount` getter steps are to return the number of [children](http The `prepend(nodes)` method steps are: 1. Let node be the result of [converting nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node) given nodes and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. [Pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into [this](https://webidl.spec.whatwg.org/#this) before [this](https://webidl.spec.whatwg.org/#this)’s [first child](https://dom.spec.whatwg.org/#concept-tree-first-child). - The `append(nodes)` method steps are: 1. Let node be the result of [converting nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node) given nodes and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) node to [this](https://webidl.spec.whatwg.org/#this). - The `replaceChildren(nodes)` method steps are: 1. Let node be the result of [converting nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node) given nodes and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. [Ensure pre-insertion validity](https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity) of node into [this](https://webidl.spec.whatwg.org/#this) before null. - 3. [Replace all](https://dom.spec.whatwg.org/#concept-node-replace-all) with node within [this](https://webidl.spec.whatwg.org/#this). - The `querySelector(selectors)` method steps are to return the first result of running [scope-match a selectors string](https://dom.spec.whatwg.org/#scope-match-a-selectors-string) selectors against [this](https://webidl.spec.whatwg.org/#this), if the result is not an empty list; otherwise null. @@ -3122,8 +2843,8 @@ The `querySelectorAll(selectors)` method steps are to return the [static](https: Web compatibility prevents the `[previousElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling)` and `[nextElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling)` attributes from being exposed on [doctypes](https://dom.spec.whatwg.org/#concept-doctype) (and therefore on `[ChildNode](https://dom.spec.whatwg.org/#childnode)`). interface mixin `NonDocumentTypeChildNode` { - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [previousElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling); - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [nextElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [previousElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [nextElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling); }; [Element](https://dom.spec.whatwg.org/#element) includes [NonDocumentTypeChildNode](https://dom.spec.whatwg.org/#nondocumenttypechildnode); [CharacterData](https://dom.spec.whatwg.org/#characterdata) includes [NonDocumentTypeChildNode](https://dom.spec.whatwg.org/#nondocumenttypechildnode); @@ -3134,15 +2855,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -3152,19 +2873,19 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ -``element = node . `[previousElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling)` `` +`` element = node . `[previousElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling)` `` Returns the first [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) [sibling](https://dom.spec.whatwg.org/#concept-tree-sibling) that is an [element](https://dom.spec.whatwg.org/#concept-element); otherwise null. @@ -3174,15 +2895,15 @@ In all current engines. Firefox25+Safari9+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android25+iOS Safari9+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -3192,19 +2913,19 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- Opera10+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ -``element = node . `[nextElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling)` `` +`` element = node . `[nextElementSibling](https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling)` `` Returns the first [following](https://dom.spec.whatwg.org/#concept-tree-following) [sibling](https://dom.spec.whatwg.org/#concept-tree-sibling) that is an [element](https://dom.spec.whatwg.org/#concept-element); otherwise null. @@ -3215,10 +2936,10 @@ The `nextElementSibling` getter steps are to return the first [following](https: #### 4.2.8. Mixin `[ChildNode](https://dom.spec.whatwg.org/#childnode)`[](https://dom.spec.whatwg.org/#interface-childnode) interface mixin `ChildNode` { - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [before](https://dom.spec.whatwg.org/#dom-childnode-before)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-childnode-before-nodes-nodes)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [after](https://dom.spec.whatwg.org/#dom-childnode-after)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-childnode-after-nodes-nodes)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [replaceWith](https://dom.spec.whatwg.org/#dom-childnode-replacewith)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-childnode-replacewith-nodes-nodes)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [remove](https://dom.spec.whatwg.org/#dom-childnode-remove)(); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [before](https://dom.spec.whatwg.org/#dom-childnode-before)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-childnode-before-nodes-nodes)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [after](https://dom.spec.whatwg.org/#dom-childnode-after)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-childnode-after-nodes-nodes)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [replaceWith](https://dom.spec.whatwg.org/#dom-childnode-replacewith)(([Node](https://dom.spec.whatwg.org/#node) or [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString))... `nodes`[](https://dom.spec.whatwg.org/#dom-childnode-replacewith-nodes-nodes)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [remove](https://dom.spec.whatwg.org/#dom-childnode-remove)(); }; [DocumentType](https://dom.spec.whatwg.org/#documenttype) includes [ChildNode](https://dom.spec.whatwg.org/#childnode); [Element](https://dom.spec.whatwg.org/#element) includes [ChildNode](https://dom.spec.whatwg.org/#childnode); @@ -3230,15 +2951,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -3248,15 +2969,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -3266,19 +2987,19 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ -``node . `[before(...nodes)](https://dom.spec.whatwg.org/#dom-childnode-before)` `` +`` node . `[before(...nodes)](https://dom.spec.whatwg.org/#dom-childnode-before)` `` Inserts nodes just before node, while replacing strings in nodes with equivalent `[Text](https://dom.spec.whatwg.org/#text)` [nodes](https://dom.spec.whatwg.org/#concept-node). @@ -3290,15 +3011,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -3308,15 +3029,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -3326,19 +3047,19 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ -``node . `[after(...nodes)](https://dom.spec.whatwg.org/#dom-childnode-after)` `` +`` node . `[after(...nodes)](https://dom.spec.whatwg.org/#dom-childnode-after)` `` Inserts nodes just after node, while replacing strings in nodes with equivalent `[Text](https://dom.spec.whatwg.org/#text)` [nodes](https://dom.spec.whatwg.org/#concept-node). @@ -3350,15 +3071,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -3368,15 +3089,15 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ @@ -3386,19 +3107,19 @@ In all current engines. Firefox49+Safari10+Chrome54+ -___ +--- Opera39+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ -``node . `[replaceWith(...nodes)](https://dom.spec.whatwg.org/#dom-childnode-replacewith)` `` +`` node . `[replaceWith(...nodes)](https://dom.spec.whatwg.org/#dom-childnode-replacewith)` `` Replaces node with nodes, while replacing strings in nodes with equivalent `[Text](https://dom.spec.whatwg.org/#text)` [nodes](https://dom.spec.whatwg.org/#concept-node). @@ -3410,15 +3131,15 @@ In all current engines. Firefox23+Safari7+Chrome24+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android23+iOS Safari7+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile14+ @@ -3428,15 +3149,15 @@ In all current engines. Firefox23+Safari7+Chrome24+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android23+iOS Safari7+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile14+ @@ -3446,78 +3167,60 @@ In all current engines. Firefox23+Safari7+Chrome24+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android23+iOS Safari7+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile14+ -``node . `[remove()](https://dom.spec.whatwg.org/#dom-childnode-remove)` `` +`` node . `[remove()](https://dom.spec.whatwg.org/#dom-childnode-remove)` `` Removes node. The `before(nodes)` method steps are: 1. Let parent be [this](https://webidl.spec.whatwg.org/#this)’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If parent is null, then return. - 3. Let viablePreviousSibling be [this](https://webidl.spec.whatwg.org/#this)’s first [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) [sibling](https://dom.spec.whatwg.org/#concept-tree-sibling) not in nodes; otherwise null. - 4. Let node be the result of [converting nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node), given nodes and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 5. If viablePreviousSibling is null, then set it to parent’s [first child](https://dom.spec.whatwg.org/#concept-tree-first-child); otherwise to viablePreviousSibling’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - 6. [Pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into parent before viablePreviousSibling. - The `after(nodes)` method steps are: 1. Let parent be [this](https://webidl.spec.whatwg.org/#this)’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If parent is null, then return. - 3. Let viableNextSibling be [this](https://webidl.spec.whatwg.org/#this)’s first [following](https://dom.spec.whatwg.org/#concept-tree-following) [sibling](https://dom.spec.whatwg.org/#concept-tree-sibling) not in nodes; otherwise null. - 4. Let node be the result of [converting nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node), given nodes and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 5. [Pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into parent before viableNextSibling. - The `replaceWith(nodes)` method steps are: 1. Let parent be [this](https://webidl.spec.whatwg.org/#this)’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If parent is null, then return. - 3. Let viableNextSibling be [this](https://webidl.spec.whatwg.org/#this)’s first [following](https://dom.spec.whatwg.org/#concept-tree-following) [sibling](https://dom.spec.whatwg.org/#concept-tree-sibling) not in nodes; otherwise null. - 4. Let node be the result of [converting nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node), given nodes and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 5. If [this](https://webidl.spec.whatwg.org/#this)’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is parent, [replace](https://dom.spec.whatwg.org/#concept-node-replace) [this](https://webidl.spec.whatwg.org/#this) with node within parent. - + [This](https://webidl.spec.whatwg.org/#this) could have been inserted into node. - + 6. Otherwise, [pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into parent before viableNextSibling. - The `remove()` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this)’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is null, then return. - 2. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) [this](https://webidl.spec.whatwg.org/#this). - #### 4.2.9. Mixin `[Slottable](https://dom.spec.whatwg.org/#slotable)`[](https://dom.spec.whatwg.org/#mixin-slotable) interface mixin `Slottable` { - readonly attribute [HTMLSlotElement](https://html.spec.whatwg.org/multipage/scripting.html#htmlslotelement)? [assignedSlot](https://dom.spec.whatwg.org/#dom-slotable-assignedslot); +readonly attribute [HTMLSlotElement](https://html.spec.whatwg.org/multipage/scripting.html#htmlslotelement)? [assignedSlot](https://dom.spec.whatwg.org/#dom-slotable-assignedslot); }; [Element](https://dom.spec.whatwg.org/#element) includes [Slottable](https://dom.spec.whatwg.org/#slotable); [Text](https://dom.spec.whatwg.org/#text) includes [Slottable](https://dom.spec.whatwg.org/#slotable); @@ -3528,15 +3231,15 @@ In all current engines. Firefox63+Safari10.1+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -3546,15 +3249,15 @@ In all current engines. Firefox63+Safari10.1+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -3578,15 +3281,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -3594,9 +3297,9 @@ A `[NodeList](https://dom.spec.whatwg.org/#nodelist)` object is a [collection](h \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `NodeList` { - getter [Node](https://dom.spec.whatwg.org/#node)? [item](https://dom.spec.whatwg.org/#dom-nodelist-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-nodelist-item-index-index)); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-nodelist-length); - iterable<[Node](https://dom.spec.whatwg.org/#node)\>; +getter [Node](https://dom.spec.whatwg.org/#node)? [item](https://dom.spec.whatwg.org/#dom-nodelist-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-nodelist-item-index-index)); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-nodelist-length); +iterable<[Node](https://dom.spec.whatwg.org/#node)\>; }; [NodeList/length](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/length "The NodeList.length property returns the number of items in a NodeList.") @@ -3605,15 +3308,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -3627,15 +3330,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -3653,23 +3356,23 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE8+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window, [LegacyUnenumerableNamedProperties](https://webidl.spec.whatwg.org/#LegacyUnenumerableNamedProperties)\] interface `HTMLCollection` { - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-htmlcollection-length); - getter [Element](https://dom.spec.whatwg.org/#element)? [item](https://dom.spec.whatwg.org/#dom-htmlcollection-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-htmlcollection-item-index-index)); - getter [Element](https://dom.spec.whatwg.org/#element)? `namedItem`([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `name`[](https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-name-name)); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-htmlcollection-length); +getter [Element](https://dom.spec.whatwg.org/#element)? [item](https://dom.spec.whatwg.org/#dom-htmlcollection-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-htmlcollection-item-index-index)); +getter [Element](https://dom.spec.whatwg.org/#element)? `namedItem`([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `name`[](https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-name-name)); }; An `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` object is a [collection](https://dom.spec.whatwg.org/#concept-collection) of [elements](https://dom.spec.whatwg.org/#concept-element). @@ -3682,15 +3385,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE8+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -3704,15 +3407,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE8+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -3737,15 +3440,12 @@ The `item(index)` method steps are to return the indexth [element](https://dom.s The [supported property names](https://webidl.spec.whatwg.org/#dfn-supported-property-names) are the values from the list returned by these steps: 1. Let result be an empty list. - 2. For each element [represented by the collection](https://dom.spec.whatwg.org/#represented-by-the-collection), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order): - + 1. If element has an [ID](https://dom.spec.whatwg.org/#concept-id) which is not in result, append element’s [ID](https://dom.spec.whatwg.org/#concept-id) to result. - 2. If element is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) a [`name` attribute](https://dom.spec.whatwg.org/#concept-named-attribute) whose [value](https://dom.spec.whatwg.org/#concept-attribute-value) is neither the empty string nor is in result, append element’s [`name` attribute](https://dom.spec.whatwg.org/#concept-named-attribute) [value](https://dom.spec.whatwg.org/#concept-attribute-value) to result. - + 3. Return result. - [HTMLCollection/namedItem](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection/namedItem "The namedItem() method of the HTMLCollection interface returns the first Element in the collection whose id or name attribute match the specified name, or null if no element matches.") @@ -3753,29 +3453,27 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE8+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `namedItem(key)`[](https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key) method steps are: 1. If key is the empty string, return null. - 2. Return the first [element](https://dom.spec.whatwg.org/#concept-element) in the [collection](https://dom.spec.whatwg.org/#concept-collection) for which at least one of the following is true: - - - it has an [ID](https://dom.spec.whatwg.org/#concept-id) which is key; - - it is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) a [`name` attribute](https://dom.spec.whatwg.org/#concept-named-attribute) whose [value](https://dom.spec.whatwg.org/#concept-attribute-value) is key; - + + - it has an [ID](https://dom.spec.whatwg.org/#concept-id) which is key; + - it is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) a [`name` attribute](https://dom.spec.whatwg.org/#concept-named-attribute) whose [value](https://dom.spec.whatwg.org/#concept-attribute-value) is key; + or null if there is no such [element](https://dom.spec.whatwg.org/#concept-element). - ### 4.3. Mutation observers[](https://dom.spec.whatwg.org/#mutation-observers) @@ -3786,36 +3484,25 @@ Each [similar-origin window agent](https://html.spec.whatwg.org/multipage/webapp To queue a mutation observer microtask, run these steps: 1. If the [surrounding agent](https://tc39.es/ecma262/#surrounding-agent)’s [mutation observer microtask queued](https://dom.spec.whatwg.org/#mutation-observer-compound-microtask-queued-flag) is true, then return. - 2. Set the [surrounding agent](https://tc39.es/ecma262/#surrounding-agent)’s [mutation observer microtask queued](https://dom.spec.whatwg.org/#mutation-observer-compound-microtask-queued-flag) to true. - 3. [Queue](https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-microtask) a [microtask](https://html.spec.whatwg.org/multipage/webappapis.html#microtask) to [notify mutation observers](https://dom.spec.whatwg.org/#notify-mutation-observers). - To notify mutation observers, run these steps: 1. Set the [surrounding agent](https://tc39.es/ecma262/#surrounding-agent)’s [mutation observer microtask queued](https://dom.spec.whatwg.org/#mutation-observer-compound-microtask-queued-flag) to false. - 2. Let notifySet be a [clone](https://infra.spec.whatwg.org/#list-clone) of the [surrounding agent](https://tc39.es/ecma262/#surrounding-agent)’s [mutation observers](https://dom.spec.whatwg.org/#mutation-observer-list). - 3. Let signalSet be a [clone](https://infra.spec.whatwg.org/#list-clone) of the [surrounding agent](https://tc39.es/ecma262/#surrounding-agent)’s [signal slots](https://dom.spec.whatwg.org/#signal-slot-list). - 4. [Empty](https://infra.spec.whatwg.org/#list-empty) the [surrounding agent](https://tc39.es/ecma262/#surrounding-agent)’s [signal slots](https://dom.spec.whatwg.org/#signal-slot-list). - 5. [For each](https://infra.spec.whatwg.org/#list-iterate) mo of notifySet: - + 1. Let records be a [clone](https://infra.spec.whatwg.org/#list-clone) of mo’s [record queue](https://dom.spec.whatwg.org/#concept-mo-queue). - 2. [Empty](https://infra.spec.whatwg.org/#list-empty) mo’s [record queue](https://dom.spec.whatwg.org/#concept-mo-queue). - 3. [For each](https://infra.spec.whatwg.org/#list-iterate) node of mo’s [node list](https://dom.spec.whatwg.org/#mutationobserver-node-list), [remove](https://infra.spec.whatwg.org/#list-remove) all [transient registered observers](https://dom.spec.whatwg.org/#transient-registered-observer) whose [observer](https://dom.spec.whatwg.org/#registered-observer-observer) is mo from node’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list). - 4. If records [is not empty](https://infra.spec.whatwg.org/#list-is-empty), then [invoke](https://webidl.spec.whatwg.org/#invoke-a-callback-function) mo’s [callback](https://dom.spec.whatwg.org/#concept-mo-callback) with « records, mo », and mo. If this throws an exception, catch it, and [report the exception](https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception). - + 6. [For each](https://infra.spec.whatwg.org/#list-iterate) slot of signalSet, [fire an event](https://dom.spec.whatwg.org/#concept-event-fire) named `[slotchange](https://html.spec.whatwg.org/multipage/indices.html#event-slotchange)`, with its `[bubbles](https://dom.spec.whatwg.org/#dom-event-bubbles)` attribute set to true, at slot. - -___ +--- Each [node](https://dom.spec.whatwg.org/#concept-node) has a registered observer list (a [list](https://infra.spec.whatwg.org/#list) of zero or more [registered observers](https://dom.spec.whatwg.org/#registered-observer)), which is initially empty. @@ -3833,46 +3520,46 @@ In all current engines. Firefox14+Safari7+Chrome26+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE11 -___ +--- Firefox for Android14+iOS Safari7+Chrome for Android26+Android WebView37+Samsung Internet1.5+Opera Mobile14+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `MutationObserver` { - [constructor](https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver)([MutationCallback](https://dom.spec.whatwg.org/#callbackdef-mutationcallback) `callback`[](https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver-callback-callback)); +[constructor](https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver)([MutationCallback](https://dom.spec.whatwg.org/#callbackdef-mutationcallback) `callback`[](https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver-callback-callback)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [observe](https://dom.spec.whatwg.org/#dom-mutationobserver-observe)([Node](https://dom.spec.whatwg.org/#node) `target`[](https://dom.spec.whatwg.org/#dom-mutationobserver-observe-target-options-target), optional [MutationObserverInit](https://dom.spec.whatwg.org/#dictdef-mutationobserverinit) `options`[](https://dom.spec.whatwg.org/#dom-mutationobserver-observe-target-options-options) = {}); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [disconnect](https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect)(); - [sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)\> [takeRecords](https://dom.spec.whatwg.org/#dom-mutationobserver-takerecords)(); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [observe](https://dom.spec.whatwg.org/#dom-mutationobserver-observe)([Node](https://dom.spec.whatwg.org/#node) `target`[](https://dom.spec.whatwg.org/#dom-mutationobserver-observe-target-options-target), optional [MutationObserverInit](https://dom.spec.whatwg.org/#dictdef-mutationobserverinit) `options`[](https://dom.spec.whatwg.org/#dom-mutationobserver-observe-target-options-options) = {}); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [disconnect](https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect)(); +[sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)\> [takeRecords](https://dom.spec.whatwg.org/#dom-mutationobserver-takerecords)(); }; callback `MutationCallback` = [undefined](https://webidl.spec.whatwg.org/#idl-undefined) ([sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)\> `mutations`[](https://dom.spec.whatwg.org/#dom-mutationcallback-mutations), [MutationObserver](https://dom.spec.whatwg.org/#mutationobserver) `observer`[](https://dom.spec.whatwg.org/#dom-mutationcallback-observer)); dictionary `MutationObserverInit` { - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `childList` = false; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `attributes`; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `characterData`; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `subtree` = false; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `attributeOldValue`; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `characterDataOldValue`; - [sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)\> `attributeFilter`; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `childList` = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `attributes`; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `characterData`; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `subtree` = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `attributeOldValue`; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `characterDataOldValue`; +[sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)\> `attributeFilter`; }; A `[MutationObserver](https://dom.spec.whatwg.org/#mutationobserver)` object can be used to observe mutations to the [tree](https://dom.spec.whatwg.org/#concept-tree) of [nodes](https://dom.spec.whatwg.org/#concept-node). Each `[MutationObserver](https://dom.spec.whatwg.org/#mutationobserver)` object has these associated concepts: -- A callback set on creation. -- A node list (a [list](https://infra.spec.whatwg.org/#list) of [nodes](https://dom.spec.whatwg.org/#concept-node)), which is initially empty. -- A record queue (a [queue](https://infra.spec.whatwg.org/#queue) of zero or more `[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)` objects), which is initially empty. +- A callback set on creation. +- A node list (a [list](https://infra.spec.whatwg.org/#list) of [nodes](https://dom.spec.whatwg.org/#concept-node)), which is initially empty. +- A record queue (a [queue](https://infra.spec.whatwg.org/#queue) of zero or more `[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)` objects), which is initially empty. [MutationObserver/MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver "The DOM MutationObserver() constructor — part of the MutationObserver interface — creates and returns a new observer which invokes a specified callback when DOM events occur.") @@ -3880,19 +3567,19 @@ In all current engines. Firefox14+Safari7+Chrome26+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE11 -___ +--- Firefox for Android14+iOS Safari7+Chrome for Android26+Android WebView37+Samsung Internet1.5+Opera Mobile14+ -``observer = new `[MutationObserver(callback)](https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver)` `` +`` observer = new `[MutationObserver(callback)](https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver)` `` Constructs a `[MutationObserver](https://dom.spec.whatwg.org/#mutationobserver)` object and sets its [callback](https://dom.spec.whatwg.org/#concept-mo-callback) to callback. The callback is invoked with a list of `[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)` objects as first argument and the constructed `[MutationObserver](https://dom.spec.whatwg.org/#mutationobserver)` object as second argument. It is invoked after [nodes](https://dom.spec.whatwg.org/#concept-node) registered with the `[observe()](https://dom.spec.whatwg.org/#dom-mutationobserver-observe)` method, are mutated. @@ -3902,19 +3589,19 @@ In all current engines. Firefox14+Safari6+Chrome18+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE11 -___ +--- Firefox for Android14+iOS Safari6+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile14+ -``observer . `[observe(target, options)](https://dom.spec.whatwg.org/#dom-mutationobserver-observe)` `` +`` observer . `[observe(target, options)](https://dom.spec.whatwg.org/#dom-mutationobserver-observe)` `` Instructs the user agent to observe a given target (a [node](https://dom.spec.whatwg.org/#concept-node)) and report any mutations based on the criteria given by options (an object). @@ -3954,19 +3641,19 @@ In all current engines. Firefox14+Safari6+Chrome18+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE11 -___ +--- Firefox for Android14+iOS Safari6+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile14+ -``observer . `[disconnect()](https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect)` `` +`` observer . `[disconnect()](https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect)` `` Stops observer from observing any mutations. Until the `[observe()](https://dom.spec.whatwg.org/#dom-mutationobserver-observe)` method is used again, observer’s [callback](https://dom.spec.whatwg.org/#concept-mo-callback) will not be invoked. @@ -3976,115 +3663,90 @@ In all current engines. Firefox14+Safari6+Chrome18+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE11 -___ +--- Firefox for Android14+iOS Safari6+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile14+ -``observer . `[takeRecords()](https://dom.spec.whatwg.org/#dom-mutationobserver-takerecords)` `` +`` observer . `[takeRecords()](https://dom.spec.whatwg.org/#dom-mutationobserver-takerecords)` `` Empties the [record queue](https://dom.spec.whatwg.org/#concept-mo-queue) and returns what was in there. The `new MutationObserver(callback)` constructor steps are: 1. Set [this](https://webidl.spec.whatwg.org/#this)’s [callback](https://dom.spec.whatwg.org/#concept-mo-callback) to callback. - 2. [Append](https://infra.spec.whatwg.org/#set-append) [this](https://webidl.spec.whatwg.org/#this) to [this](https://webidl.spec.whatwg.org/#this)’s [relevant agent](https://html.spec.whatwg.org/multipage/webappapis.html#relevant-agent)’s [mutation observers](https://dom.spec.whatwg.org/#mutation-observer-list). - The `observe(target, options)` method steps are: 1. If either options\["`[attributeOldValue](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue)`"\] or options\["`[attributeFilter](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter)`"\] [exists](https://infra.spec.whatwg.org/#map-exists), and options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\] does not [exist](https://infra.spec.whatwg.org/#map-exists), then set options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\] to true. - 2. If options\["`[characterDataOldValue](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue)`"\] [exists](https://infra.spec.whatwg.org/#map-exists) and options\["`[characterData](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata)`"\] does not [exist](https://infra.spec.whatwg.org/#map-exists), then set options\["`[characterData](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata)`"\] to true. - 3. If none of options\["`[childList](https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist)`"\], options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\], and options\["`[characterData](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata)`"\] is true, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a `TypeError`. - 4. If options\["`[attributeOldValue](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue)`"\] is true and options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\] is false, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a `TypeError`. - 5. If options\["`[attributeFilter](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter)`"\] is present and options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\] is false, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a `TypeError`. - 6. If options\["`[characterDataOldValue](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue)`"\] is true and options\["`[characterData](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata)`"\] is false, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a `TypeError`. - 7. [For each](https://infra.spec.whatwg.org/#list-iterate) registered of target’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list), if registered’s [observer](https://dom.spec.whatwg.org/#registered-observer-observer) is [this](https://webidl.spec.whatwg.org/#this): - + 1. [For each](https://infra.spec.whatwg.org/#list-iterate) node of [this](https://webidl.spec.whatwg.org/#this)’s [node list](https://dom.spec.whatwg.org/#mutationobserver-node-list), [remove](https://infra.spec.whatwg.org/#list-remove) all [transient registered observers](https://dom.spec.whatwg.org/#transient-registered-observer) whose [source](https://dom.spec.whatwg.org/#transient-registered-observer-source) is registered from node’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list). - 2. Set registered’s [options](https://dom.spec.whatwg.org/#registered-observer-options) to options. - + 8. Otherwise: - + 1. [Append](https://infra.spec.whatwg.org/#list-append) a new [registered observer](https://dom.spec.whatwg.org/#registered-observer) whose [observer](https://dom.spec.whatwg.org/#registered-observer-observer) is [this](https://webidl.spec.whatwg.org/#this) and [options](https://dom.spec.whatwg.org/#registered-observer-options) is options to target’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list). - 2. [Append](https://infra.spec.whatwg.org/#list-append) target to [this](https://webidl.spec.whatwg.org/#this)’s [node list](https://dom.spec.whatwg.org/#mutationobserver-node-list). - The `disconnect()` method steps are: 1. [For each](https://infra.spec.whatwg.org/#list-iterate) node of [this](https://webidl.spec.whatwg.org/#this)’s [node list](https://dom.spec.whatwg.org/#mutationobserver-node-list), [remove](https://infra.spec.whatwg.org/#list-remove) any [registered observer](https://dom.spec.whatwg.org/#registered-observer) from node’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list) for which [this](https://webidl.spec.whatwg.org/#this) is the [observer](https://dom.spec.whatwg.org/#registered-observer-observer). - 2. [Empty](https://infra.spec.whatwg.org/#list-empty) [this](https://webidl.spec.whatwg.org/#this)’s [record queue](https://dom.spec.whatwg.org/#concept-mo-queue). - The `takeRecords()` method steps are: 1. Let records be a [clone](https://infra.spec.whatwg.org/#list-clone) of [this](https://webidl.spec.whatwg.org/#this)’s [record queue](https://dom.spec.whatwg.org/#concept-mo-queue). - 2. [Empty](https://infra.spec.whatwg.org/#list-empty) [this](https://webidl.spec.whatwg.org/#this)’s [record queue](https://dom.spec.whatwg.org/#concept-mo-queue). - 3. Return records. - #### 4.3.2. Queuing a mutation record[](https://dom.spec.whatwg.org/#queueing-a-mutation-record) To queue a mutation record of type for target with name, namespace, oldValue, addedNodes, removedNodes, previousSibling, and nextSibling, run these steps: 1. Let interestedObservers be an empty [map](https://infra.spec.whatwg.org/#ordered-map). - 2. Let nodes be the [inclusive ancestors](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of target. - 3. For each node in nodes, and then [for each](https://infra.spec.whatwg.org/#list-iterate) registered of node’s [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list): - + 1. Let options be registered’s [options](https://dom.spec.whatwg.org/#registered-observer-options). - 2. If none of the following are true - - - node is not target and options\["`[subtree](https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree)`"\] is false - - type is "`attributes`" and options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\] either does not [exist](https://infra.spec.whatwg.org/#map-exists) or is false - - type is "`attributes`", options\["`[attributeFilter](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter)`"\] [exists](https://infra.spec.whatwg.org/#map-exists), and options\["`[attributeFilter](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter)`"\] does not [contain](https://infra.spec.whatwg.org/#list-contain) name or namespace is non-null - - type is "`characterData`" and options\["`[characterData](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata)`"\] either does not [exist](https://infra.spec.whatwg.org/#map-exists) or is false - - type is "`childList`" and options\["`[childList](https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist)`"\] is false - + + - node is not target and options\["`[subtree](https://dom.spec.whatwg.org/#dom-mutationobserverinit-subtree)`"\] is false + - type is "`attributes`" and options\["`[attributes](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributes)`"\] either does not [exist](https://infra.spec.whatwg.org/#map-exists) or is false + - type is "`attributes`", options\["`[attributeFilter](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter)`"\] [exists](https://infra.spec.whatwg.org/#map-exists), and options\["`[attributeFilter](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter)`"\] does not [contain](https://infra.spec.whatwg.org/#list-contain) name or namespace is non-null + - type is "`characterData`" and options\["`[characterData](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdata)`"\] either does not [exist](https://infra.spec.whatwg.org/#map-exists) or is false + - type is "`childList`" and options\["`[childList](https://dom.spec.whatwg.org/#dom-mutationobserverinit-childlist)`"\] is false + then: - + 1. Let mo be registered’s [observer](https://dom.spec.whatwg.org/#registered-observer-observer). - 2. If interestedObservers\[mo\] does not [exist](https://infra.spec.whatwg.org/#map-exists), then [set](https://infra.spec.whatwg.org/#map-set) interestedObservers\[mo\] to null. - 3. If either type is "`attributes`" and options\["`[attributeOldValue](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributeoldvalue)`"\] is true, or type is "`characterData`" and options\["`[characterDataOldValue](https://dom.spec.whatwg.org/#dom-mutationobserverinit-characterdataoldvalue)`"\] is true, then [set](https://infra.spec.whatwg.org/#map-set) interestedObservers\[mo\] to oldValue. - + 4. [For each](https://infra.spec.whatwg.org/#map-iterate) observer → mappedOldValue of interestedObservers: - + 1. Let record be a new `[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)` object with its `[type](https://dom.spec.whatwg.org/#dom-mutationrecord-type)` set to type, `[target](https://dom.spec.whatwg.org/#dom-mutationrecord-target)` set to target, `[attributeName](https://dom.spec.whatwg.org/#dom-mutationrecord-attributename)` set to name, `[attributeNamespace](https://dom.spec.whatwg.org/#dom-mutationrecord-attributenamespace)` set to namespace, `[oldValue](https://dom.spec.whatwg.org/#dom-mutationrecord-oldvalue)` set to mappedOldValue, `[addedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-addednodes)` set to addedNodes, `[removedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-removednodes)` set to removedNodes, `[previousSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling)` set to previousSibling, and `[nextSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-nextsibling)` set to nextSibling. - 2. [Enqueue](https://infra.spec.whatwg.org/#queue-enqueue) record to observer’s [record queue](https://dom.spec.whatwg.org/#concept-mo-queue). - + 5. [Queue a mutation observer microtask](https://dom.spec.whatwg.org/#queue-a-mutation-observer-compound-microtask). - To queue a tree mutation record for target with addedNodes, removedNodes, previousSibling, and nextSibling, run these steps: 1. Assert: either addedNodes or removedNodes [is not empty](https://infra.spec.whatwg.org/#list-is-empty). - 2. [Queue a mutation record](https://dom.spec.whatwg.org/#queue-a-mutation-record) of "`childList`" for target with null, null, null, addedNodes, removedNodes, previousSibling, and nextSibling. - #### 4.3.3. Interface `[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord)`[](https://dom.spec.whatwg.org/#interface-mutationrecord) @@ -4094,60 +3756,60 @@ In all current engines. Firefox14+Safari7+Chrome16+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IE11 -___ +--- Firefox for Android14+iOS Safari7+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile14+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `MutationRecord` { - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [type](https://dom.spec.whatwg.org/#dom-mutationrecord-type); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [Node](https://dom.spec.whatwg.org/#node) [target](https://dom.spec.whatwg.org/#dom-mutationrecord-target); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NodeList](https://dom.spec.whatwg.org/#nodelist) [addedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-addednodes); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NodeList](https://dom.spec.whatwg.org/#nodelist) [removedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-removednodes); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [previousSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [nextSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-nextsibling); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [attributeName](https://dom.spec.whatwg.org/#dom-mutationrecord-attributename); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [attributeNamespace](https://dom.spec.whatwg.org/#dom-mutationrecord-attributenamespace); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [oldValue](https://dom.spec.whatwg.org/#dom-mutationrecord-oldvalue); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [type](https://dom.spec.whatwg.org/#dom-mutationrecord-type); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [Node](https://dom.spec.whatwg.org/#node) [target](https://dom.spec.whatwg.org/#dom-mutationrecord-target); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NodeList](https://dom.spec.whatwg.org/#nodelist) [addedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-addednodes); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NodeList](https://dom.spec.whatwg.org/#nodelist) [removedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-removednodes); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [previousSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [nextSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-nextsibling); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [attributeName](https://dom.spec.whatwg.org/#dom-mutationrecord-attributename); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [attributeNamespace](https://dom.spec.whatwg.org/#dom-mutationrecord-attributenamespace); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [oldValue](https://dom.spec.whatwg.org/#dom-mutationrecord-oldvalue); }; -``record . `[type](https://dom.spec.whatwg.org/#dom-mutationrecord-type)` `` +`` record . `[type](https://dom.spec.whatwg.org/#dom-mutationrecord-type)` `` Returns "`attributes`" if it was an [attribute](https://dom.spec.whatwg.org/#concept-attribute) mutation. "`characterData`" if it was a mutation to a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node). And "`childList`" if it was a mutation to the [tree](https://dom.spec.whatwg.org/#concept-tree) of [nodes](https://dom.spec.whatwg.org/#concept-node). -``record . `[target](https://dom.spec.whatwg.org/#dom-mutationrecord-target)` `` +`` record . `[target](https://dom.spec.whatwg.org/#dom-mutationrecord-target)` `` Returns the [node](https://dom.spec.whatwg.org/#concept-node) the mutation affected, depending on the `[type](https://dom.spec.whatwg.org/#dom-mutationrecord-type)`. For "`attributes`", it is the [element](https://dom.spec.whatwg.org/#concept-element) whose [attribute](https://dom.spec.whatwg.org/#concept-attribute) changed. For "`characterData`", it is the `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node). For "`childList`", it is the [node](https://dom.spec.whatwg.org/#concept-node) whose [children](https://dom.spec.whatwg.org/#concept-tree-child) changed. -``record . `[addedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-addednodes)` `` +`` record . `[addedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-addednodes)` `` -``record . `[removedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-removednodes)` `` +`` record . `[removedNodes](https://dom.spec.whatwg.org/#dom-mutationrecord-removednodes)` `` Return the [nodes](https://dom.spec.whatwg.org/#concept-node) added and removed respectively. -``record . `[previousSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling)` `` +`` record . `[previousSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-previoussibling)` `` -``record . `[nextSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-nextsibling)` `` +`` record . `[nextSibling](https://dom.spec.whatwg.org/#dom-mutationrecord-nextsibling)` `` Return the [previous](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) and [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling) respectively of the added or removed [nodes](https://dom.spec.whatwg.org/#concept-node); otherwise null. -``record . `[attributeName](https://dom.spec.whatwg.org/#dom-mutationrecord-attributename)` `` +`` record . `[attributeName](https://dom.spec.whatwg.org/#dom-mutationrecord-attributename)` `` Returns the [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) of the changed [attribute](https://dom.spec.whatwg.org/#concept-attribute); otherwise null. -``record . `[attributeNamespace](https://dom.spec.whatwg.org/#dom-mutationrecord-attributenamespace)` `` +`` record . `[attributeNamespace](https://dom.spec.whatwg.org/#dom-mutationrecord-attributenamespace)` `` Returns the [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) of the changed [attribute](https://dom.spec.whatwg.org/#concept-attribute); otherwise null. -``record . `[oldValue](https://dom.spec.whatwg.org/#dom-mutationrecord-oldvalue)` `` +`` record . `[oldValue](https://dom.spec.whatwg.org/#dom-mutationrecord-oldvalue)` `` The return value depends on `[type](https://dom.spec.whatwg.org/#dom-mutationrecord-type)`. For "`attributes`", it is the [value](https://dom.spec.whatwg.org/#concept-attribute-value) of the changed [attribute](https://dom.spec.whatwg.org/#concept-attribute) before the change. For "`characterData`", it is the [data](https://dom.spec.whatwg.org/#concept-cd-data) of the changed [node](https://dom.spec.whatwg.org/#concept-node) before the change. For "`childList`", it is null. @@ -4167,78 +3829,78 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `Node` : [EventTarget](https://dom.spec.whatwg.org/#eventtarget) { - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [ELEMENT\_NODE](https://dom.spec.whatwg.org/#dom-node-element_node) = 1; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [ATTRIBUTE\_NODE](https://dom.spec.whatwg.org/#dom-node-attribute_node) = 2; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [TEXT\_NODE](https://dom.spec.whatwg.org/#dom-node-text_node) = 3; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [CDATA\_SECTION\_NODE](https://dom.spec.whatwg.org/#dom-node-cdata_section_node) = 4; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ENTITY_REFERENCE_NODE`[](https://dom.spec.whatwg.org/#dom-node-entity_reference_node) = 5; // legacy - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ENTITY_NODE`[](https://dom.spec.whatwg.org/#dom-node-entity_node) = 6; // legacy - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [PROCESSING\_INSTRUCTION\_NODE](https://dom.spec.whatwg.org/#dom-node-processing_instruction_node) = 7; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [COMMENT\_NODE](https://dom.spec.whatwg.org/#dom-node-comment_node) = 8; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_NODE](https://dom.spec.whatwg.org/#dom-node-document_node) = 9; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_TYPE\_NODE](https://dom.spec.whatwg.org/#dom-node-document_type_node) = 10; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_FRAGMENT\_NODE](https://dom.spec.whatwg.org/#dom-node-document_fragment_node) = 11; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `NOTATION_NODE`[](https://dom.spec.whatwg.org/#dom-node-notation_node) = 12; // legacy - readonly attribute [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [nodeType](https://dom.spec.whatwg.org/#dom-node-nodetype); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [nodeName](https://dom.spec.whatwg.org/#dom-node-nodename); - - readonly attribute [USVString](https://webidl.spec.whatwg.org/#idl-USVString) [baseURI](https://dom.spec.whatwg.org/#dom-node-baseuri); - - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isConnected](https://dom.spec.whatwg.org/#dom-node-isconnected); - readonly attribute [Document](https://dom.spec.whatwg.org/#document)? [ownerDocument](https://dom.spec.whatwg.org/#dom-node-ownerdocument); - [Node](https://dom.spec.whatwg.org/#node) [getRootNode](https://dom.spec.whatwg.org/#dom-node-getrootnode)(optional [GetRootNodeOptions](https://dom.spec.whatwg.org/#dictdef-getrootnodeoptions) `options`[](https://dom.spec.whatwg.org/#dom-node-getrootnode-options-options) = {}); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [parentNode](https://dom.spec.whatwg.org/#dom-node-parentnode); - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [parentElement](https://dom.spec.whatwg.org/#dom-node-parentelement); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasChildNodes](https://dom.spec.whatwg.org/#dom-node-haschildnodes)(); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NodeList](https://dom.spec.whatwg.org/#nodelist) [childNodes](https://dom.spec.whatwg.org/#dom-node-childnodes); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [firstChild](https://dom.spec.whatwg.org/#dom-node-firstchild); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [lastChild](https://dom.spec.whatwg.org/#dom-node-lastchild); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [previousSibling](https://dom.spec.whatwg.org/#dom-node-previoussibling); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [nextSibling](https://dom.spec.whatwg.org/#dom-node-nextsibling); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [nodeValue](https://dom.spec.whatwg.org/#dom-node-nodevalue); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [textContent](https://dom.spec.whatwg.org/#dom-node-textcontent); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [normalize](https://dom.spec.whatwg.org/#dom-node-normalize)(); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Node](https://dom.spec.whatwg.org/#node) [cloneNode](https://dom.spec.whatwg.org/#dom-node-clonenode)(optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `deep`[](https://dom.spec.whatwg.org/#dom-node-clonenode-deep-deep) = false); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isEqualNode](https://dom.spec.whatwg.org/#dom-node-isequalnode)([Node](https://dom.spec.whatwg.org/#node)? `otherNode`[](https://dom.spec.whatwg.org/#dom-node-isequalnode-othernode-othernode)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isSameNode](https://dom.spec.whatwg.org/#dom-node-issamenode)([Node](https://dom.spec.whatwg.org/#node)? `otherNode`[](https://dom.spec.whatwg.org/#dom-node-issamenode-othernode-othernode)); // legacy alias of === - - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_POSITION\_DISCONNECTED](https://dom.spec.whatwg.org/#dom-node-document_position_disconnected) = 0x01; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_POSITION\_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding) = 0x02; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_POSITION\_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following) = 0x04; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_POSITION\_CONTAINS](https://dom.spec.whatwg.org/#dom-node-document_position_contains) = 0x08; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_POSITION\_CONTAINED\_BY](https://dom.spec.whatwg.org/#dom-node-document_position_contained_by) = 0x10; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT\_POSITION\_IMPLEMENTATION\_SPECIFIC](https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific) = 0x20; - [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [compareDocumentPosition](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition)([Node](https://dom.spec.whatwg.org/#node) `other`[](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition-other-other)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [contains](https://dom.spec.whatwg.org/#dom-node-contains)([Node](https://dom.spec.whatwg.org/#node)? `other`[](https://dom.spec.whatwg.org/#dom-node-contains-other-other)); - - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [lookupPrefix](https://dom.spec.whatwg.org/#dom-node-lookupprefix)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-node-lookupprefix-namespace-namespace)); - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [lookupNamespaceURI](https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `prefix`[](https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri-prefix-prefix)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isDefaultNamespace](https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace-namespace-namespace)); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [insertBefore](https://dom.spec.whatwg.org/#dom-node-insertbefore)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-node-insertbefore-node-child-node), [Node](https://dom.spec.whatwg.org/#node)? `child`[](https://dom.spec.whatwg.org/#dom-node-insertbefore-node-child-child)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [appendChild](https://dom.spec.whatwg.org/#dom-node-appendchild)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-node-appendchild-node-node)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [replaceChild](https://dom.spec.whatwg.org/#dom-node-replacechild)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-node-replacechild-node-child-node), [Node](https://dom.spec.whatwg.org/#node) `child`[](https://dom.spec.whatwg.org/#dom-node-replacechild-node-child-child)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [removeChild](https://dom.spec.whatwg.org/#dom-node-removechild)([Node](https://dom.spec.whatwg.org/#node) `child`[](https://dom.spec.whatwg.org/#dom-node-removechild-child-child)); +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [ELEMENT_NODE](https://dom.spec.whatwg.org/#dom-node-element_node) = 1; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [ATTRIBUTE_NODE](https://dom.spec.whatwg.org/#dom-node-attribute_node) = 2; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [TEXT_NODE](https://dom.spec.whatwg.org/#dom-node-text_node) = 3; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [CDATA_SECTION_NODE](https://dom.spec.whatwg.org/#dom-node-cdata_section_node) = 4; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ENTITY_REFERENCE_NODE`[](https://dom.spec.whatwg.org/#dom-node-entity_reference_node) = 5; // legacy +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ENTITY_NODE`[](https://dom.spec.whatwg.org/#dom-node-entity_node) = 6; // legacy +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [PROCESSING_INSTRUCTION_NODE](https://dom.spec.whatwg.org/#dom-node-processing_instruction_node) = 7; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [COMMENT_NODE](https://dom.spec.whatwg.org/#dom-node-comment_node) = 8; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_NODE](https://dom.spec.whatwg.org/#dom-node-document_node) = 9; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_TYPE_NODE](https://dom.spec.whatwg.org/#dom-node-document_type_node) = 10; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_FRAGMENT_NODE](https://dom.spec.whatwg.org/#dom-node-document_fragment_node) = 11; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `NOTATION_NODE`[](https://dom.spec.whatwg.org/#dom-node-notation_node) = 12; // legacy +readonly attribute [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [nodeType](https://dom.spec.whatwg.org/#dom-node-nodetype); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [nodeName](https://dom.spec.whatwg.org/#dom-node-nodename); + +readonly attribute [USVString](https://webidl.spec.whatwg.org/#idl-USVString) [baseURI](https://dom.spec.whatwg.org/#dom-node-baseuri); + +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isConnected](https://dom.spec.whatwg.org/#dom-node-isconnected); +readonly attribute [Document](https://dom.spec.whatwg.org/#document)? [ownerDocument](https://dom.spec.whatwg.org/#dom-node-ownerdocument); +[Node](https://dom.spec.whatwg.org/#node) [getRootNode](https://dom.spec.whatwg.org/#dom-node-getrootnode)(optional [GetRootNodeOptions](https://dom.spec.whatwg.org/#dictdef-getrootnodeoptions) `options`[](https://dom.spec.whatwg.org/#dom-node-getrootnode-options-options) = {}); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [parentNode](https://dom.spec.whatwg.org/#dom-node-parentnode); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [parentElement](https://dom.spec.whatwg.org/#dom-node-parentelement); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasChildNodes](https://dom.spec.whatwg.org/#dom-node-haschildnodes)(); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NodeList](https://dom.spec.whatwg.org/#nodelist) [childNodes](https://dom.spec.whatwg.org/#dom-node-childnodes); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [firstChild](https://dom.spec.whatwg.org/#dom-node-firstchild); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [lastChild](https://dom.spec.whatwg.org/#dom-node-lastchild); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [previousSibling](https://dom.spec.whatwg.org/#dom-node-previoussibling); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? [nextSibling](https://dom.spec.whatwg.org/#dom-node-nextsibling); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [nodeValue](https://dom.spec.whatwg.org/#dom-node-nodevalue); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [textContent](https://dom.spec.whatwg.org/#dom-node-textcontent); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [normalize](https://dom.spec.whatwg.org/#dom-node-normalize)(); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Node](https://dom.spec.whatwg.org/#node) [cloneNode](https://dom.spec.whatwg.org/#dom-node-clonenode)(optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `deep`[](https://dom.spec.whatwg.org/#dom-node-clonenode-deep-deep) = false); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isEqualNode](https://dom.spec.whatwg.org/#dom-node-isequalnode)([Node](https://dom.spec.whatwg.org/#node)? `otherNode`[](https://dom.spec.whatwg.org/#dom-node-isequalnode-othernode-othernode)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isSameNode](https://dom.spec.whatwg.org/#dom-node-issamenode)([Node](https://dom.spec.whatwg.org/#node)? `otherNode`[](https://dom.spec.whatwg.org/#dom-node-issamenode-othernode-othernode)); // legacy alias of === + +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_POSITION_DISCONNECTED](https://dom.spec.whatwg.org/#dom-node-document_position_disconnected) = 0x01; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_POSITION_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding) = 0x02; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following) = 0x04; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_POSITION_CONTAINS](https://dom.spec.whatwg.org/#dom-node-document_position_contains) = 0x08; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_POSITION_CONTAINED_BY](https://dom.spec.whatwg.org/#dom-node-document_position_contained_by) = 0x10; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC](https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific) = 0x20; +[unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [compareDocumentPosition](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition)([Node](https://dom.spec.whatwg.org/#node) `other`[](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition-other-other)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [contains](https://dom.spec.whatwg.org/#dom-node-contains)([Node](https://dom.spec.whatwg.org/#node)? `other`[](https://dom.spec.whatwg.org/#dom-node-contains-other-other)); + +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [lookupPrefix](https://dom.spec.whatwg.org/#dom-node-lookupprefix)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-node-lookupprefix-namespace-namespace)); +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [lookupNamespaceURI](https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `prefix`[](https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri-prefix-prefix)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isDefaultNamespace](https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace-namespace-namespace)); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [insertBefore](https://dom.spec.whatwg.org/#dom-node-insertbefore)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-node-insertbefore-node-child-node), [Node](https://dom.spec.whatwg.org/#node)? `child`[](https://dom.spec.whatwg.org/#dom-node-insertbefore-node-child-child)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [appendChild](https://dom.spec.whatwg.org/#dom-node-appendchild)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-node-appendchild-node-node)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [replaceChild](https://dom.spec.whatwg.org/#dom-node-replacechild)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-node-replacechild-node-child-node), [Node](https://dom.spec.whatwg.org/#node) `child`[](https://dom.spec.whatwg.org/#dom-node-replacechild-node-child-child)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [removeChild](https://dom.spec.whatwg.org/#dom-node-removechild)([Node](https://dom.spec.whatwg.org/#node) `child`[](https://dom.spec.whatwg.org/#dom-node-removechild-child-child)); }; dictionary `GetRootNodeOptions` { - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `composed` = false; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `composed` = false; }; `[Node](https://dom.spec.whatwg.org/#node)` is an abstract interface that is used by all [nodes](https://dom.spec.whatwg.org/#concept-node). You cannot get a direct instance of it. @@ -4251,7 +3913,7 @@ A [node](https://dom.spec.whatwg.org/#concept-node)’s [get the parent](https:/ Each [node](https://dom.spec.whatwg.org/#concept-node) also has a [registered observer list](https://dom.spec.whatwg.org/#registered-observer-list). -___ +--- [Node/nodeType](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType "The read-only nodeType property of a Node element is an integer that identifies what the node is. It distinguishes different kind of nodes from each other, such as elements, text and comments.") @@ -4259,19 +3921,19 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``node . `[nodeType](https://dom.spec.whatwg.org/#dom-node-nodetype)` `` +`` node . `[nodeType](https://dom.spec.whatwg.org/#dom-node-nodetype)` `` Returns a number appropriate for the type of node, as follows: @@ -4317,19 +3979,19 @@ In all current engines. Firefox1+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[nodeName](https://dom.spec.whatwg.org/#dom-node-nodename)` `` +`` node . `[nodeName](https://dom.spec.whatwg.org/#dom-node-nodename)` `` Returns a string appropriate for the type of node, as follows: @@ -4445,7 +4107,7 @@ Its [name](https://dom.spec.whatwg.org/#concept-doctype-name). "`#document-fragment`". -___ +--- [Node/baseURI](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI "The read-only baseURI property of the Node interface returns the absolute base URL of the document containing the node.") @@ -4453,25 +4115,25 @@ In all current engines. Firefox1+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[baseURI](https://dom.spec.whatwg.org/#dom-node-baseuri)` `` +`` node . `[baseURI](https://dom.spec.whatwg.org/#dom-node-baseuri)` `` Returns node’s [node document](https://dom.spec.whatwg.org/#concept-node-document)’s [document base URL](https://html.spec.whatwg.org/multipage/urls-and-fetching.html#document-base-url). The `baseURI` getter steps are to return [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document)’s [document base URL](https://html.spec.whatwg.org/multipage/urls-and-fetching.html#document-base-url), [serialized](https://url.spec.whatwg.org/#concept-url-serializer). -___ +--- [Node/isConnected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected "The read-only isConnected property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to the context object, for example the Document object in the case of the normal DOM, or the ShadowRoot in the case of a shadow DOM.") @@ -4479,19 +4141,19 @@ In all current engines. Firefox49+Safari10+Chrome51+ -___ +--- Opera38+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android49+iOS Safari10+Chrome for Android51+Android WebView51+Samsung Internet6.0+Opera Mobile41+ -``node . `[isConnected](https://dom.spec.whatwg.org/#dom-node-isconnected)` `` +`` node . `[isConnected](https://dom.spec.whatwg.org/#dom-node-isconnected)` `` Returns true if node is [connected](https://dom.spec.whatwg.org/#connected); otherwise false. @@ -4501,19 +4163,19 @@ In all current engines. Firefox9+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android9+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[ownerDocument](https://dom.spec.whatwg.org/#dom-node-ownerdocument)` `` +`` node . `[ownerDocument](https://dom.spec.whatwg.org/#dom-node-ownerdocument)` `` Returns the [node document](https://dom.spec.whatwg.org/#concept-node-document). Returns null for [documents](https://dom.spec.whatwg.org/#concept-document). @@ -4523,19 +4185,19 @@ In all current engines. Firefox53+Safari10.1+Chrome54+ -___ +--- Opera41+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android53+iOS Safari10.3+Chrome for Android54+Android WebView54+Samsung Internet6.0+Opera Mobile41+ -``node . `[getRootNode()](https://dom.spec.whatwg.org/#dom-node-getrootnode)` `` +`` node . `[getRootNode()](https://dom.spec.whatwg.org/#dom-node-getrootnode)` `` Returns node’s [root](https://dom.spec.whatwg.org/#concept-tree-root). @@ -4549,19 +4211,19 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``node . `[parentNode](https://dom.spec.whatwg.org/#dom-node-parentnode)` `` +`` node . `[parentNode](https://dom.spec.whatwg.org/#dom-node-parentnode)` `` Returns the [parent](https://dom.spec.whatwg.org/#concept-tree-parent). @@ -4571,19 +4233,19 @@ In all current engines. Firefox9+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android9+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``node . `[parentElement](https://dom.spec.whatwg.org/#dom-node-parentelement)` `` +`` node . `[parentElement](https://dom.spec.whatwg.org/#dom-node-parentelement)` `` Returns the [parent element](https://dom.spec.whatwg.org/#parent-element). @@ -4593,19 +4255,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[hasChildNodes()](https://dom.spec.whatwg.org/#dom-node-haschildnodes)` `` +`` node . `[hasChildNodes()](https://dom.spec.whatwg.org/#dom-node-haschildnodes)` `` Returns whether node has [children](https://dom.spec.whatwg.org/#concept-tree-child). @@ -4615,19 +4277,19 @@ In all current engines. Firefox1+Safari1.2+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``node . `[childNodes](https://dom.spec.whatwg.org/#dom-node-childnodes)` `` +`` node . `[childNodes](https://dom.spec.whatwg.org/#dom-node-childnodes)` `` Returns the [children](https://dom.spec.whatwg.org/#concept-tree-child). @@ -4637,19 +4299,19 @@ In all current engines. Firefox1+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[firstChild](https://dom.spec.whatwg.org/#dom-node-firstchild)` `` +`` node . `[firstChild](https://dom.spec.whatwg.org/#dom-node-firstchild)` `` Returns the [first child](https://dom.spec.whatwg.org/#concept-tree-first-child). @@ -4659,19 +4321,19 @@ In all current engines. Firefox1+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android45+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[lastChild](https://dom.spec.whatwg.org/#dom-node-lastchild)` `` +`` node . `[lastChild](https://dom.spec.whatwg.org/#dom-node-lastchild)` `` Returns the [last child](https://dom.spec.whatwg.org/#concept-tree-last-child). @@ -4681,19 +4343,19 @@ In all current engines. Firefox1+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[previousSibling](https://dom.spec.whatwg.org/#dom-node-previoussibling)` `` +`` node . `[previousSibling](https://dom.spec.whatwg.org/#dom-node-previoussibling)` `` Returns the [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling). @@ -4703,19 +4365,19 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``node . `[nextSibling](https://dom.spec.whatwg.org/#dom-node-nextsibling)` `` +`` node . `[nextSibling](https://dom.spec.whatwg.org/#dom-node-nextsibling)` `` Returns the [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). @@ -4743,7 +4405,7 @@ The `previousSibling` getter steps are to return [this](https://webidl.spec.what The `nextSibling` getter steps are to return [this](https://webidl.spec.whatwg.org/#this)’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). -___ +--- [Node/nodeValue](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue "The nodeValue property of the Node interface returns or sets the value of the current node.") @@ -4751,15 +4413,15 @@ In all current engines. Firefox1+Safari7+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari7+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -4797,15 +4459,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -4832,11 +4494,8 @@ Null. To string replace all with a string string within a [node](https://dom.spec.whatwg.org/#concept-node) parent, run these steps: 1. Let node be null. - 2. If string is not the empty string, then set node to a new `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is string and [node document](https://dom.spec.whatwg.org/#concept-node-document) is parent’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 3. [Replace all](https://dom.spec.whatwg.org/#concept-node-replace-all) with node within parent. - The `[textContent](https://dom.spec.whatwg.org/#dom-node-textcontent)` setter steps are to, if the given value is null, act as if it was the empty string instead, and then do as described below, switching on the interface [this](https://webidl.spec.whatwg.org/#this) [implements](https://webidl.spec.whatwg.org/#implements): @@ -4858,7 +4517,7 @@ Otherwise Do nothing. -___ +--- [Node/normalize](https://developer.mozilla.org/en-US/docs/Web/API/Node/normalize "The normalize() method of the Node puts the specified node and all of its sub-tree into a normalized form. In a normalized sub-tree, no text nodes in the sub-tree are empty and there are no adjacent text nodes.") @@ -4866,19 +4525,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[normalize()](https://dom.spec.whatwg.org/#dom-node-normalize)` `` +`` node . `[normalize()](https://dom.spec.whatwg.org/#dom-node-normalize)` `` Removes [empty](https://dom.spec.whatwg.org/#concept-node-empty) [exclusive `Text` nodes](https://dom.spec.whatwg.org/#exclusive-text-node) and concatenates the [data](https://dom.spec.whatwg.org/#concept-cd-data) of remaining [contiguous exclusive `Text` nodes](https://dom.spec.whatwg.org/#contiguous-exclusive-text-nodes) into the first of their [nodes](https://dom.spec.whatwg.org/#concept-node). @@ -4890,22 +4549,17 @@ The `normalize()` method steps are to run these steps for each [descendant](http 4. [Replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node node, offset length, count 0, and data data. 5. Let currentNode be node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). 6. While currentNode is an [exclusive `Text` node](https://dom.spec.whatwg.org/#exclusive-text-node): - + 1. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is currentNode, add length to its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) and set its [start node](https://dom.spec.whatwg.org/#concept-range-start-node) to node. - 2. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is currentNode, add length to its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) and set its [end node](https://dom.spec.whatwg.org/#concept-range-end-node) to node. - 3. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is currentNode’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is currentNode’s [index](https://dom.spec.whatwg.org/#concept-tree-index), set its [start node](https://dom.spec.whatwg.org/#concept-range-start-node) to node and its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) to length. - 4. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is currentNode’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is currentNode’s [index](https://dom.spec.whatwg.org/#concept-tree-index), set its [end node](https://dom.spec.whatwg.org/#concept-range-end-node) to node and its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) to length. - 5. Add currentNode’s [length](https://dom.spec.whatwg.org/#concept-node-length) to length. - 6. Set currentNode to its [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - + 7. [Remove](https://dom.spec.whatwg.org/#concept-node-remove) node’s [contiguous exclusive `Text` nodes](https://dom.spec.whatwg.org/#contiguous-exclusive-text-nodes) (excluding itself), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). -___ +--- [Node/cloneNode](https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode "The cloneNode() method of the Node interface returns a duplicate of the node on which this method was called. Its parameter controls if the subtree contained in a node is also cloned or not.") @@ -4913,15 +4567,15 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -4935,19 +4589,19 @@ In all current engines. Firefox2+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[isEqualNode(otherNode)](https://dom.spec.whatwg.org/#dom-node-isequalnode)` `` +`` node . `[isEqualNode(otherNode)](https://dom.spec.whatwg.org/#dom-node-isequalnode)` `` Returns whether node and otherNode have the same properties. @@ -4958,47 +4612,43 @@ HTML defines [cloning steps](https://dom.spec.whatwg.org/#concept-node-clone-ext To clone a node, with an optional document and _clone children flag_, run these steps: 1. If document is not given, let document be node’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. If node is an [element](https://dom.spec.whatwg.org/#concept-element), then: - + 1. Let copy be the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element), given document, node’s [local name](https://dom.spec.whatwg.org/#concept-element-local-name), node’s [namespace](https://dom.spec.whatwg.org/#concept-element-namespace), node’s [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix), and node’s [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value), with the synchronous custom elements flag unset. - 2. [For each](https://infra.spec.whatwg.org/#list-iterate) attribute in node’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute): - + 1. Let copyAttribute be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of attribute. - 2. [Append](https://dom.spec.whatwg.org/#concept-element-attributes-append) copyAttribute to copy. - + 3. Otherwise, let copy be a [node](https://dom.spec.whatwg.org/#concept-node) that [implements](https://webidl.spec.whatwg.org/#implements) the same interfaces as node, and fulfills these additional requirements, switching on the interface node [implements](https://webidl.spec.whatwg.org/#implements): - + `[Document](https://dom.spec.whatwg.org/#document)` - + Set copy’s [encoding](https://dom.spec.whatwg.org/#concept-document-encoding), [content type](https://dom.spec.whatwg.org/#concept-document-content-type), [URL](https://dom.spec.whatwg.org/#concept-document-url), [origin](https://dom.spec.whatwg.org/#concept-document-origin), [type](https://dom.spec.whatwg.org/#concept-document-type), and [mode](https://dom.spec.whatwg.org/#concept-document-mode) to those of node. - + `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` - + Set copy’s [name](https://dom.spec.whatwg.org/#concept-doctype-name), [public ID](https://dom.spec.whatwg.org/#concept-doctype-publicid), and [system ID](https://dom.spec.whatwg.org/#concept-doctype-systemid) to those of node. - + `[Attr](https://dom.spec.whatwg.org/#attr)` - + Set copy’s [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix), [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), and [value](https://dom.spec.whatwg.org/#concept-attribute-value) to those of node. - + `[Text](https://dom.spec.whatwg.org/#text)` - + `[Comment](https://dom.spec.whatwg.org/#comment)` - + Set copy’s [data](https://dom.spec.whatwg.org/#concept-cd-data) to that of node. - + `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` - + Set copy’s [target](https://dom.spec.whatwg.org/#concept-pi-target) and [data](https://dom.spec.whatwg.org/#concept-cd-data) to those of node. - + Otherwise - + Do nothing. - + 4. Set copy’s [node document](https://dom.spec.whatwg.org/#concept-node-document) and document to copy, if copy is a [document](https://dom.spec.whatwg.org/#concept-document), and set copy’s [node document](https://dom.spec.whatwg.org/#concept-node-document) to document otherwise. - 5. Run any [cloning steps](https://dom.spec.whatwg.org/#concept-node-clone-ext) defined for node in [other applicable specifications](https://dom.spec.whatwg.org/#other-applicable-specifications) and pass copy, node, document and the _clone children flag_ if set, as parameters. 6. If the _clone children flag_ is set, [clone](https://dom.spec.whatwg.org/#concept-node-clone) all the [children](https://dom.spec.whatwg.org/#concept-tree-child) of node and append them to copy, with document as specified and the _clone children flag_ being set. 7. Return copy. @@ -5006,48 +4656,42 @@ To clone a node, with an optional document and _clone children flag_, run these The `cloneNode(deep)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. Return a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of [this](https://webidl.spec.whatwg.org/#this), with the _clone children flag_ set if deep is true. - A [node](https://dom.spec.whatwg.org/#concept-node) A equals a [node](https://dom.spec.whatwg.org/#concept-node) B if all of the following conditions are true: -- A and B [implement](https://webidl.spec.whatwg.org/#implements) the same interfaces. - -- The following are equal, switching on the interface A [implements](https://webidl.spec.whatwg.org/#implements): - - `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` - - Its [name](https://dom.spec.whatwg.org/#concept-doctype-name), [public ID](https://dom.spec.whatwg.org/#concept-doctype-publicid), and [system ID](https://dom.spec.whatwg.org/#concept-doctype-systemid). - - `[Element](https://dom.spec.whatwg.org/#element)` - - Its [namespace](https://dom.spec.whatwg.org/#concept-element-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix), [local name](https://dom.spec.whatwg.org/#concept-element-local-name), and its [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute)’s [size](https://infra.spec.whatwg.org/#list-size). - - `[Attr](https://dom.spec.whatwg.org/#attr)` - - Its [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace), [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), and [value](https://dom.spec.whatwg.org/#concept-attribute-value). - - `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` - - Its [target](https://dom.spec.whatwg.org/#concept-pi-target) and [data](https://dom.spec.whatwg.org/#concept-cd-data). - - `[Text](https://dom.spec.whatwg.org/#text)` - - `[Comment](https://dom.spec.whatwg.org/#comment)` - - Its [data](https://dom.spec.whatwg.org/#concept-cd-data). - - Otherwise - - — - -- If A is an [element](https://dom.spec.whatwg.org/#concept-element), each [attribute](https://dom.spec.whatwg.org/#concept-attribute) in its [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) has an [attribute](https://dom.spec.whatwg.org/#concept-attribute) that [equals](https://dom.spec.whatwg.org/#concept-node-equals) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) in B’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute). - -- A and B have the same number of [children](https://dom.spec.whatwg.org/#concept-tree-child). - -- Each [child](https://dom.spec.whatwg.org/#concept-tree-child) of A [equals](https://dom.spec.whatwg.org/#concept-node-equals) the [child](https://dom.spec.whatwg.org/#concept-tree-child) of B at the identical [index](https://dom.spec.whatwg.org/#concept-tree-index). - +- A and B [implement](https://webidl.spec.whatwg.org/#implements) the same interfaces. +- The following are equal, switching on the interface A [implements](https://webidl.spec.whatwg.org/#implements): + + `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` + + Its [name](https://dom.spec.whatwg.org/#concept-doctype-name), [public ID](https://dom.spec.whatwg.org/#concept-doctype-publicid), and [system ID](https://dom.spec.whatwg.org/#concept-doctype-systemid). + + `[Element](https://dom.spec.whatwg.org/#element)` + + Its [namespace](https://dom.spec.whatwg.org/#concept-element-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix), [local name](https://dom.spec.whatwg.org/#concept-element-local-name), and its [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute)’s [size](https://infra.spec.whatwg.org/#list-size). + + `[Attr](https://dom.spec.whatwg.org/#attr)` + + Its [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace), [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), and [value](https://dom.spec.whatwg.org/#concept-attribute-value). + + `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` + + Its [target](https://dom.spec.whatwg.org/#concept-pi-target) and [data](https://dom.spec.whatwg.org/#concept-cd-data). + + `[Text](https://dom.spec.whatwg.org/#text)` + + `[Comment](https://dom.spec.whatwg.org/#comment)` + + Its [data](https://dom.spec.whatwg.org/#concept-cd-data). + + Otherwise + + — + +- If A is an [element](https://dom.spec.whatwg.org/#concept-element), each [attribute](https://dom.spec.whatwg.org/#concept-attribute) in its [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) has an [attribute](https://dom.spec.whatwg.org/#concept-attribute) that [equals](https://dom.spec.whatwg.org/#concept-node-equals) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) in B’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute). +- A and B have the same number of [children](https://dom.spec.whatwg.org/#concept-tree-child). +- Each [child](https://dom.spec.whatwg.org/#concept-tree-child) of A [equals](https://dom.spec.whatwg.org/#concept-node-equals) the [child](https://dom.spec.whatwg.org/#concept-tree-child) of B at the identical [index](https://dom.spec.whatwg.org/#concept-tree-index). The `isEqualNode(otherNode)` method steps are to return true if otherNode is non-null and [this](https://webidl.spec.whatwg.org/#this) [equals](https://dom.spec.whatwg.org/#concept-node-equals) otherNode; otherwise false. @@ -5057,21 +4701,21 @@ In all current engines. Firefox48+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android48+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `isSameNode(otherNode)` method steps are to return true if otherNode is [this](https://webidl.spec.whatwg.org/#this); otherwise false. -___ +--- [Node/compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition "The compareDocumentPosition() method of the Node interface reports the position of its argument node relative to the node on which it is called.") @@ -5079,19 +4723,19 @@ In all current engines. Firefox9+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android9+iOS Safari3.2+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ -``node . `[compareDocumentPosition(other)](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition)` `` +`` node . `[compareDocumentPosition(other)](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition)` `` Returns a bitmask indicating the position of other relative to node. These are the bits that can be set: @@ -5121,102 +4765,83 @@ In all current engines. Firefox9+Safari1.1+Chrome16+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android9+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ -``node . `[contains(other)](https://dom.spec.whatwg.org/#dom-node-contains)` `` +`` node . `[contains(other)](https://dom.spec.whatwg.org/#dom-node-contains)` `` Returns true if other is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of node; otherwise false. These are the constants `[compareDocumentPosition()](https://dom.spec.whatwg.org/#dom-node-comparedocumentposition)` returns as mask: -- `DOCUMENT_POSITION_DISCONNECTED` (1); -- `DOCUMENT_POSITION_PRECEDING` (2); -- `DOCUMENT_POSITION_FOLLOWING` (4); -- `DOCUMENT_POSITION_CONTAINS` (8); -- `DOCUMENT_POSITION_CONTAINED_BY` (16, 10 in hexadecimal); -- `DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` (32, 20 in hexadecimal). +- `DOCUMENT_POSITION_DISCONNECTED` (1); +- `DOCUMENT_POSITION_PRECEDING` (2); +- `DOCUMENT_POSITION_FOLLOWING` (4); +- `DOCUMENT_POSITION_CONTAINS` (8); +- `DOCUMENT_POSITION_CONTAINED_BY` (16, 10 in hexadecimal); +- `DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` (32, 20 in hexadecimal). The `compareDocumentPosition(other)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this) is other, then return zero. - 2. Let node1 be other and node2 be [this](https://webidl.spec.whatwg.org/#this). - 3. Let attr1 and attr2 be null. - 4. If node1 is an [attribute](https://dom.spec.whatwg.org/#concept-attribute), then set attr1 to node1 and node1 to attr1’s [element](https://dom.spec.whatwg.org/#concept-attribute-element). - 5. If node2 is an [attribute](https://dom.spec.whatwg.org/#concept-attribute), then: - + 1. Set attr2 to node2 and node2 to attr2’s [element](https://dom.spec.whatwg.org/#concept-attribute-element). - 2. If attr1 and node1 are non-null, and node2 is node1, then: - + 1. [For each](https://infra.spec.whatwg.org/#list-iterate) attr in node2’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute): - + 1. If attr [equals](https://dom.spec.whatwg.org/#concept-node-equals) attr1, then return the result of adding `[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC](https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific)` and `[DOCUMENT_POSITION_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding)`. - 2. If attr [equals](https://dom.spec.whatwg.org/#concept-node-equals) attr2, then return the result of adding `[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC](https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific)` and `[DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following)`. - + 6. If node1 or node2 is null, or node1’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is not node2’s [root](https://dom.spec.whatwg.org/#concept-tree-root), then return the result of adding `[DOCUMENT_POSITION_DISCONNECTED](https://dom.spec.whatwg.org/#dom-node-document_position_disconnected)`, `[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC](https://dom.spec.whatwg.org/#dom-node-document_position_implementation_specific)`, and either `[DOCUMENT_POSITION_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding)` or `[DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following)`, with the constraint that this is to be consistent, together. - + Whether to return `[DOCUMENT_POSITION_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding)` or `[DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following)` is typically implemented via pointer comparison. In JavaScript implementations a cached `Math.random()` value can be used. - + 7. If node1 is an [ancestor](https://dom.spec.whatwg.org/#concept-tree-ancestor) of node2 and attr1 is null, or node1 is node2 and attr2 is non-null, then return the result of adding `[DOCUMENT_POSITION_CONTAINS](https://dom.spec.whatwg.org/#dom-node-document_position_contains)` to `[DOCUMENT_POSITION_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding)`. - 8. If node1 is a [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) of node2 and attr2 is null, or node1 is node2 and attr1 is non-null, then return the result of adding `[DOCUMENT_POSITION_CONTAINED_BY](https://dom.spec.whatwg.org/#dom-node-document_position_contained_by)` to `[DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following)`. - 9. If node1 is [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) node2, then return `[DOCUMENT_POSITION_PRECEDING](https://dom.spec.whatwg.org/#dom-node-document_position_preceding)`. - + Due to the way [attributes](https://dom.spec.whatwg.org/#concept-attribute) are handled in this algorithm this results in a [node](https://dom.spec.whatwg.org/#concept-node)’s [attributes](https://dom.spec.whatwg.org/#concept-attribute) counting as [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) that [node](https://dom.spec.whatwg.org/#concept-node)’s [children](https://dom.spec.whatwg.org/#concept-tree-child), despite [attributes](https://dom.spec.whatwg.org/#concept-attribute) not [participating](https://dom.spec.whatwg.org/#concept-tree-participate) in the same [tree](https://dom.spec.whatwg.org/#concept-tree). - -10. Return `[DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following)`. - + +10. Return `[DOCUMENT_POSITION_FOLLOWING](https://dom.spec.whatwg.org/#dom-node-document_position_following)`. The `contains(other)` method steps are to return true if other is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of [this](https://webidl.spec.whatwg.org/#this); otherwise false (including when other is null). -___ +--- To locate a namespace prefix for an element using namespace, run these steps: 1. If element’s [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is namespace and its [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is non-null, then return its [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix). - 2. If element [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix) is "`xmlns`" and [value](https://dom.spec.whatwg.org/#concept-attribute-value) is namespace, then return element’s first such [attribute](https://dom.spec.whatwg.org/#concept-attribute)’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name). - 3. If element’s [parent element](https://dom.spec.whatwg.org/#parent-element) is not null, then return the result of running [locate a namespace prefix](https://dom.spec.whatwg.org/#locate-a-namespace-prefix) on that [element](https://dom.spec.whatwg.org/#concept-element) using namespace. - 4. Return null. - To locate a namespace for a node using prefix, switch on the interface node [implements](https://webidl.spec.whatwg.org/#implements): `[Element](https://dom.spec.whatwg.org/#element)` 1. If its [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is non-null and its [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is prefix, then return [namespace](https://dom.spec.whatwg.org/#concept-element-namespace). - 2. If it [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) is the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix) is "`xmlns`", and [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is prefix, or if prefix is null and it [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) is the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix) is null, and [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is "`xmlns`", then return its [value](https://dom.spec.whatwg.org/#concept-attribute-value) if it is not the empty string, and null otherwise. - 3. If its [parent element](https://dom.spec.whatwg.org/#parent-element) is null, then return null. - 4. Return the result of running [locate a namespace](https://dom.spec.whatwg.org/#locate-a-namespace) on its [parent element](https://dom.spec.whatwg.org/#parent-element) using prefix. - `[Document](https://dom.spec.whatwg.org/#document)` 1. If its [document element](https://dom.spec.whatwg.org/#document-element) is null, then return null. - 2. Return the result of running [locate a namespace](https://dom.spec.whatwg.org/#locate-a-namespace) on its [document element](https://dom.spec.whatwg.org/#document-element) using prefix. - `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` @@ -5227,16 +4852,12 @@ Return null. `[Attr](https://dom.spec.whatwg.org/#attr)` 1. If its [element](https://dom.spec.whatwg.org/#concept-attribute-element) is null, then return null. - 2. Return the result of running [locate a namespace](https://dom.spec.whatwg.org/#locate-a-namespace) on its [element](https://dom.spec.whatwg.org/#concept-attribute-element) using prefix. - Otherwise 1. If its [parent element](https://dom.spec.whatwg.org/#parent-element) is null, then return null. - 2. Return the result of running [locate a namespace](https://dom.spec.whatwg.org/#locate-a-namespace) on its [parent element](https://dom.spec.whatwg.org/#parent-element) using prefix. - [Node/lookupPrefix](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupPrefix "The lookupPrefix() method of the Node interface returns a String containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the first prefix is returned.") @@ -5244,46 +4865,44 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `lookupPrefix(namespace)` method steps are: 1. If namespace is null or the empty string, then return null. - 2. Switch on the interface [this](https://webidl.spec.whatwg.org/#this) [implements](https://webidl.spec.whatwg.org/#implements): - + `[Element](https://dom.spec.whatwg.org/#element)` - + Return the result of [locating a namespace prefix](https://dom.spec.whatwg.org/#locate-a-namespace-prefix) for it using namespace. - + `[Document](https://dom.spec.whatwg.org/#document)` - + Return the result of [locating a namespace prefix](https://dom.spec.whatwg.org/#locate-a-namespace-prefix) for its [document element](https://dom.spec.whatwg.org/#document-element), if its [document element](https://dom.spec.whatwg.org/#document-element) is non-null; otherwise null. - + `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` - + `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` - + Return null. - + `[Attr](https://dom.spec.whatwg.org/#attr)` - + Return the result of [locating a namespace prefix](https://dom.spec.whatwg.org/#locate-a-namespace-prefix) for its [element](https://dom.spec.whatwg.org/#concept-attribute-element), if its [element](https://dom.spec.whatwg.org/#concept-attribute-element) is non-null; otherwise null. - + Otherwise - + Return the result of [locating a namespace prefix](https://dom.spec.whatwg.org/#locate-a-namespace-prefix) for its [parent element](https://dom.spec.whatwg.org/#parent-element), if its [parent element](https://dom.spec.whatwg.org/#parent-element) is non-null; otherwise null. - [Node/lookupNamespaceURI](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupNamespaceURI "The lookupNamespaceURI() method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (and null if not).") @@ -5291,24 +4910,22 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `lookupNamespaceURI(prefix)` method steps are: 1. If prefix is the empty string, then set it to null. - 2. Return the result of running [locate a namespace](https://dom.spec.whatwg.org/#locate-a-namespace) for [this](https://webidl.spec.whatwg.org/#this) using prefix. - [Node/isDefaultNamespace](https://developer.mozilla.org/en-US/docs/Web/API/Node/isDefaultNamespace "The isDefaultNamespace() method of the Node interface accepts a namespace URI as an argument. It returns a boolean value that is true if the namespace is the default namespace on the given node and false if not.") @@ -5316,28 +4933,25 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `isDefaultNamespace(namespace)` method steps are: 1. If namespace is the empty string, then set it to null. - 2. Let defaultNamespace be the result of running [locate a namespace](https://dom.spec.whatwg.org/#locate-a-namespace) for [this](https://webidl.spec.whatwg.org/#this) using null. - 3. Return true if defaultNamespace is the same as namespace; otherwise false. - -___ +--- [Node/insertBefore](https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore "The insertBefore() method of the Node interface inserts a node before a reference node as a child of a specified parent node.") @@ -5345,15 +4959,15 @@ In all current engines. Firefox3+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5365,15 +4979,15 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5385,15 +4999,15 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5405,49 +5019,41 @@ In all current engines. Firefox1+Safari1.1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `removeChild(child)` method steps are to return the result of [pre-removing](https://dom.spec.whatwg.org/#concept-node-pre-remove) child from [this](https://webidl.spec.whatwg.org/#this). -___ +--- The list of elements with qualified name qualifiedName for a [node](https://dom.spec.whatwg.org/#concept-node) root is the `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` returned by the following algorithm: 1. If qualifiedName is U+002A (\*), then return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches only [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element). - 2. Otherwise, if root’s [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches the following [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element): - - - Whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and whose [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name) is qualifiedName, in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - - - Whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is _not_ the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and whose [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name) is qualifiedName. - + + - Whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and whose [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name) is qualifiedName, in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). + - Whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is _not_ the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and whose [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name) is qualifiedName. + 3. Otherwise, return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element) whose [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name) is qualifiedName. - When invoked with the same argument, and as long as root’s [node document](https://dom.spec.whatwg.org/#concept-node-document)’s [type](https://dom.spec.whatwg.org/#concept-document-type) has not changed, the same `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` object may be returned as returned by an earlier call. The list of elements with namespace namespace and local name localName for a [node](https://dom.spec.whatwg.org/#concept-node) root is the `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` returned by the following algorithm: 1. If namespace is the empty string, then set it to null. - 2. If both namespace and localName are U+002A (\*), then return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element). - 3. If namespace is U+002A (\*), then return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element) whose [local name](https://dom.spec.whatwg.org/#concept-element-local-name) is localName. - 4. If localName is U+002A (\*), then return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element) whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is namespace. - 5. Return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element) whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is namespace and [local name](https://dom.spec.whatwg.org/#concept-element-local-name) is localName. - When invoked with the same arguments, the same `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` object may be returned as returned by an earlier call. @@ -5456,9 +5062,8 @@ The list of elements with class names classNames for a [node](https://dom.spec.w 1. Let classes be the result of running the [ordered set parser](https://dom.spec.whatwg.org/#concept-ordered-set-parser) on classNames. 2. If classes is the empty set, return an empty `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)`. 3. Return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` rooted at root, whose filter matches [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant) [elements](https://dom.spec.whatwg.org/#concept-element) that have all their [classes](https://dom.spec.whatwg.org/#concept-class) in classes. - + The comparisons for the [classes](https://dom.spec.whatwg.org/#concept-class) must be done in an [ASCII case-insensitive](https://infra.spec.whatwg.org/#ascii-case-insensitive) manner if root’s [node document](https://dom.spec.whatwg.org/#concept-node-document)’s [mode](https://dom.spec.whatwg.org/#concept-document-mode) is "`quirks`"; otherwise in an [identical to](https://infra.spec.whatwg.org/#string-is) manner. - When invoked with the same argument, the same `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` object may be returned as returned by an earlier call. @@ -5470,15 +5075,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera3+Edge79+ -___ +--- Edge (Legacy)12+IE4+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5488,65 +5093,65 @@ In all current engines. Firefox1+Safari10+Chrome34+ -___ +--- Opera21+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari10+Chrome for Android34+Android WebView37+Samsung Internet2.0+Opera Mobile21+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `Document` : [Node](https://dom.spec.whatwg.org/#node) { - [constructor](https://dom.spec.whatwg.org/#dom-document-document)(); - - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [DOMImplementation](https://dom.spec.whatwg.org/#domimplementation) [implementation](https://dom.spec.whatwg.org/#dom-document-implementation); - readonly attribute [USVString](https://webidl.spec.whatwg.org/#idl-USVString) [URL](https://dom.spec.whatwg.org/#dom-document-url); - readonly attribute [USVString](https://webidl.spec.whatwg.org/#idl-USVString) [documentURI](https://dom.spec.whatwg.org/#dom-document-documenturi); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [compatMode](https://dom.spec.whatwg.org/#dom-document-compatmode); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [characterSet](https://dom.spec.whatwg.org/#dom-document-characterset); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [charset](https://dom.spec.whatwg.org/#dom-document-charset); // legacy alias of .characterSet - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [inputEncoding](https://dom.spec.whatwg.org/#dom-document-inputencoding); // legacy alias of .characterSet - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [contentType](https://dom.spec.whatwg.org/#dom-document-contenttype); - - readonly attribute [DocumentType](https://dom.spec.whatwg.org/#documenttype)? [doctype](https://dom.spec.whatwg.org/#dom-document-doctype); - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [documentElement](https://dom.spec.whatwg.org/#dom-document-documentelement); - [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagName](https://dom.spec.whatwg.org/#dom-document-getelementsbytagname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-document-getelementsbytagname-qualifiedname-qualifiedname)); - [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagNameNS](https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens-namespace-localname-localname)); - [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByClassName](https://dom.spec.whatwg.org/#dom-document-getelementsbyclassname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `classNames`[](https://dom.spec.whatwg.org/#dom-document-getelementsbyclassname-classnames-classnames)); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Element](https://dom.spec.whatwg.org/#element) [createElement](https://dom.spec.whatwg.org/#dom-document-createelement)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-document-createelement-localname-options-localname), optional ([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) or [ElementCreationOptions](https://dom.spec.whatwg.org/#dictdef-elementcreationoptions)) `options`[](https://dom.spec.whatwg.org/#dom-document-createelement-localname-options-options) = {}); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Element](https://dom.spec.whatwg.org/#element) [createElementNS](https://dom.spec.whatwg.org/#dom-document-createelementns)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-document-createelementns-namespace-qualifiedname-options-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-document-createelementns-namespace-qualifiedname-options-qualifiedname), optional ([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) or [ElementCreationOptions](https://dom.spec.whatwg.org/#dictdef-elementcreationoptions)) `options`[](https://dom.spec.whatwg.org/#dom-document-createelementns-namespace-qualifiedname-options-options) = {}); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) [createDocumentFragment](https://dom.spec.whatwg.org/#dom-document-createdocumentfragment)(); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Text](https://dom.spec.whatwg.org/#text) [createTextNode](https://dom.spec.whatwg.org/#dom-document-createtextnode)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-document-createtextnode-data-data)); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [CDATASection](https://dom.spec.whatwg.org/#cdatasection) [createCDATASection](https://dom.spec.whatwg.org/#dom-document-createcdatasection)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-document-createcdatasection-data-data)); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Comment](https://dom.spec.whatwg.org/#comment) [createComment](https://dom.spec.whatwg.org/#dom-document-createcomment)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) ); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction) [createProcessingInstruction](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `target`[](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction-target-data-target), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction-target-data-data)); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Node](https://dom.spec.whatwg.org/#node) [importNode](https://dom.spec.whatwg.org/#dom-document-importnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-document-importnode-node-deep-node), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `deep`[](https://dom.spec.whatwg.org/#dom-document-importnode-node-deep-deep) = false); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [adoptNode](https://dom.spec.whatwg.org/#dom-document-adoptnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-document-adoptnode-node-node)); - - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Attr](https://dom.spec.whatwg.org/#attr) [createAttribute](https://dom.spec.whatwg.org/#dom-document-createattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-document-createattribute-localname-localname)); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Attr](https://dom.spec.whatwg.org/#attr) [createAttributeNS](https://dom.spec.whatwg.org/#dom-document-createattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-document-createattributens-namespace-qualifiedname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-document-createattributens-namespace-qualifiedname-qualifiedname)); - - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Event](https://dom.spec.whatwg.org/#event) [createEvent](https://dom.spec.whatwg.org/#dom-document-createevent)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `interface`[](https://dom.spec.whatwg.org/#dom-document-createevent-interface-interface)); // legacy - - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Range](https://dom.spec.whatwg.org/#range) [createRange](https://dom.spec.whatwg.org/#dom-document-createrange)(); - - // NodeFilter.SHOW\_ALL = 0xFFFFFFFF - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [NodeIterator](https://dom.spec.whatwg.org/#nodeiterator) [createNodeIterator](https://dom.spec.whatwg.org/#dom-document-createnodeiterator)([Node](https://dom.spec.whatwg.org/#node) `root`[](https://dom.spec.whatwg.org/#dom-document-createnodeiterator-root-whattoshow-filter-root), optional [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `whatToShow`[](https://dom.spec.whatwg.org/#dom-document-createnodeiterator-root-whattoshow-filter-whattoshow) = 0xFFFFFFFF, optional [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? `filter`[](https://dom.spec.whatwg.org/#dom-document-createnodeiterator-root-whattoshow-filter-filter) = null); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [TreeWalker](https://dom.spec.whatwg.org/#treewalker) [createTreeWalker](https://dom.spec.whatwg.org/#dom-document-createtreewalker)([Node](https://dom.spec.whatwg.org/#node) `root`[](https://dom.spec.whatwg.org/#dom-document-createtreewalker-root-whattoshow-filter-root), optional [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `whatToShow`[](https://dom.spec.whatwg.org/#dom-document-createtreewalker-root-whattoshow-filter-whattoshow) = 0xFFFFFFFF, optional [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? `filter`[](https://dom.spec.whatwg.org/#dom-document-createtreewalker-root-whattoshow-filter-filter) = null); +[constructor](https://dom.spec.whatwg.org/#dom-document-document)(); + +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [DOMImplementation](https://dom.spec.whatwg.org/#domimplementation) [implementation](https://dom.spec.whatwg.org/#dom-document-implementation); +readonly attribute [USVString](https://webidl.spec.whatwg.org/#idl-USVString) [URL](https://dom.spec.whatwg.org/#dom-document-url); +readonly attribute [USVString](https://webidl.spec.whatwg.org/#idl-USVString) [documentURI](https://dom.spec.whatwg.org/#dom-document-documenturi); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [compatMode](https://dom.spec.whatwg.org/#dom-document-compatmode); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [characterSet](https://dom.spec.whatwg.org/#dom-document-characterset); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [charset](https://dom.spec.whatwg.org/#dom-document-charset); // legacy alias of .characterSet +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [inputEncoding](https://dom.spec.whatwg.org/#dom-document-inputencoding); // legacy alias of .characterSet +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [contentType](https://dom.spec.whatwg.org/#dom-document-contenttype); + +readonly attribute [DocumentType](https://dom.spec.whatwg.org/#documenttype)? [doctype](https://dom.spec.whatwg.org/#dom-document-doctype); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [documentElement](https://dom.spec.whatwg.org/#dom-document-documentelement); +[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagName](https://dom.spec.whatwg.org/#dom-document-getelementsbytagname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-document-getelementsbytagname-qualifiedname-qualifiedname)); +[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagNameNS](https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens-namespace-localname-localname)); +[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByClassName](https://dom.spec.whatwg.org/#dom-document-getelementsbyclassname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `classNames`[](https://dom.spec.whatwg.org/#dom-document-getelementsbyclassname-classnames-classnames)); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Element](https://dom.spec.whatwg.org/#element) [createElement](https://dom.spec.whatwg.org/#dom-document-createelement)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-document-createelement-localname-options-localname), optional ([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) or [ElementCreationOptions](https://dom.spec.whatwg.org/#dictdef-elementcreationoptions)) `options`[](https://dom.spec.whatwg.org/#dom-document-createelement-localname-options-options) = {}); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Element](https://dom.spec.whatwg.org/#element) [createElementNS](https://dom.spec.whatwg.org/#dom-document-createelementns)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-document-createelementns-namespace-qualifiedname-options-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-document-createelementns-namespace-qualifiedname-options-qualifiedname), optional ([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) or [ElementCreationOptions](https://dom.spec.whatwg.org/#dictdef-elementcreationoptions)) `options`[](https://dom.spec.whatwg.org/#dom-document-createelementns-namespace-qualifiedname-options-options) = {}); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) [createDocumentFragment](https://dom.spec.whatwg.org/#dom-document-createdocumentfragment)(); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Text](https://dom.spec.whatwg.org/#text) [createTextNode](https://dom.spec.whatwg.org/#dom-document-createtextnode)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-document-createtextnode-data-data)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [CDATASection](https://dom.spec.whatwg.org/#cdatasection) [createCDATASection](https://dom.spec.whatwg.org/#dom-document-createcdatasection)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-document-createcdatasection-data-data)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Comment](https://dom.spec.whatwg.org/#comment) [createComment](https://dom.spec.whatwg.org/#dom-document-createcomment)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) ); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction) [createProcessingInstruction](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `target`[](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction-target-data-target), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction-target-data-data)); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Node](https://dom.spec.whatwg.org/#node) [importNode](https://dom.spec.whatwg.org/#dom-document-importnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-document-importnode-node-deep-node), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `deep`[](https://dom.spec.whatwg.org/#dom-document-importnode-node-deep-deep) = false); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Node](https://dom.spec.whatwg.org/#node) [adoptNode](https://dom.spec.whatwg.org/#dom-document-adoptnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-document-adoptnode-node-node)); + +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Attr](https://dom.spec.whatwg.org/#attr) [createAttribute](https://dom.spec.whatwg.org/#dom-document-createattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-document-createattribute-localname-localname)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Attr](https://dom.spec.whatwg.org/#attr) [createAttributeNS](https://dom.spec.whatwg.org/#dom-document-createattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-document-createattributens-namespace-qualifiedname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-document-createattributens-namespace-qualifiedname-qualifiedname)); + +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Event](https://dom.spec.whatwg.org/#event) [createEvent](https://dom.spec.whatwg.org/#dom-document-createevent)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `interface`[](https://dom.spec.whatwg.org/#dom-document-createevent-interface-interface)); // legacy + +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Range](https://dom.spec.whatwg.org/#range) [createRange](https://dom.spec.whatwg.org/#dom-document-createrange)(); + +// NodeFilter.SHOW_ALL = 0xFFFFFFFF +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [NodeIterator](https://dom.spec.whatwg.org/#nodeiterator) [createNodeIterator](https://dom.spec.whatwg.org/#dom-document-createnodeiterator)([Node](https://dom.spec.whatwg.org/#node) `root`[](https://dom.spec.whatwg.org/#dom-document-createnodeiterator-root-whattoshow-filter-root), optional [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `whatToShow`[](https://dom.spec.whatwg.org/#dom-document-createnodeiterator-root-whattoshow-filter-whattoshow) = 0xFFFFFFFF, optional [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? `filter`[](https://dom.spec.whatwg.org/#dom-document-createnodeiterator-root-whattoshow-filter-filter) = null); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [TreeWalker](https://dom.spec.whatwg.org/#treewalker) [createTreeWalker](https://dom.spec.whatwg.org/#dom-document-createtreewalker)([Node](https://dom.spec.whatwg.org/#node) `root`[](https://dom.spec.whatwg.org/#dom-document-createtreewalker-root-whattoshow-filter-root), optional [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `whatToShow`[](https://dom.spec.whatwg.org/#dom-document-createtreewalker-root-whattoshow-filter-whattoshow) = 0xFFFFFFFF, optional [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? `filter`[](https://dom.spec.whatwg.org/#dom-document-createtreewalker-root-whattoshow-filter-filter) = null); }; \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `XMLDocument` : [Document](https://dom.spec.whatwg.org/#document) {}; dictionary `ElementCreationOptions` { - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `is`; +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `is`; }; `[Document](https://dom.spec.whatwg.org/#document)` [nodes](https://dom.spec.whatwg.org/#concept-node) are simply known as documents. @@ -5565,7 +5170,7 @@ The [mode](https://dom.spec.whatwg.org/#concept-document-mode) is only ever chan A [document](https://dom.spec.whatwg.org/#concept-document)’s [get the parent](https://dom.spec.whatwg.org/#get-the-parent) algorithm, given an event, returns null if event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute value is "`load`" or [document](https://dom.spec.whatwg.org/#concept-document) does not have a [browsing context](https://html.spec.whatwg.org/multipage/browsers.html#concept-document-bc); otherwise the [document](https://dom.spec.whatwg.org/#concept-document)’s [relevant global object](https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global). -___ +--- [Document/Document](https://developer.mozilla.org/en-US/docs/Web/API/Document/Document "The Document constructor creates a new Document object that is a web page loaded in the browser and serving as an entry point into the page's content.") @@ -5573,19 +5178,19 @@ In all current engines. Firefox20+Safari8+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android20+iOS Safari8+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ -``document = new `[Document()](https://dom.spec.whatwg.org/#dom-document-document)` `` +`` document = new `[Document()](https://dom.spec.whatwg.org/#dom-document-document)` `` Returns a new [document](https://dom.spec.whatwg.org/#concept-document). @@ -5595,19 +5200,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` `` +`` document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` `` Returns document’s `[DOMImplementation](https://dom.spec.whatwg.org/#domimplementation)` object. @@ -5617,19 +5222,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera3+Edge79+ -___ +--- Edge (Legacy)12+IE4+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``document . `[URL](https://dom.spec.whatwg.org/#dom-document-url)` `` +`` document . `[URL](https://dom.spec.whatwg.org/#dom-document-url)` `` [Document/documentURI](https://developer.mozilla.org/en-US/docs/Web/API/Document/documentURI "The documentURI read-only property of the Document interface returns the document location as a string.") @@ -5637,19 +5242,19 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``document . `[documentURI](https://dom.spec.whatwg.org/#dom-document-documenturi)` `` +`` document . `[documentURI](https://dom.spec.whatwg.org/#dom-document-documenturi)` `` Returns document’s [URL](https://dom.spec.whatwg.org/#concept-document-url). @@ -5659,19 +5264,19 @@ In all current engines. Firefox1+Safari3.1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``document . `[compatMode](https://dom.spec.whatwg.org/#dom-document-compatmode)` `` +`` document . `[compatMode](https://dom.spec.whatwg.org/#dom-document-compatmode)` `` Returns the string "`BackCompat`" if document’s [mode](https://dom.spec.whatwg.org/#concept-document-mode) is "`quirks`"; otherwise "`CSS1Compat`". @@ -5681,19 +5286,19 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes -``document . `[characterSet](https://dom.spec.whatwg.org/#dom-document-characterset)` `` +`` document . `[characterSet](https://dom.spec.whatwg.org/#dom-document-characterset)` `` Returns document’s [encoding](https://dom.spec.whatwg.org/#concept-document-encoding). @@ -5703,19 +5308,19 @@ In all current engines. Firefox1+Safari9+Chrome36+ -___ +--- Opera23+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android4+iOS Safari9+Chrome for Android36+Android WebView37+Samsung Internet3.0+Opera Mobile24+ -``document . `[contentType](https://dom.spec.whatwg.org/#dom-document-contenttype)` `` +`` document . `[contentType](https://dom.spec.whatwg.org/#dom-document-contenttype)` `` Returns document’s [content type](https://dom.spec.whatwg.org/#concept-document-content-type). @@ -5733,7 +5338,7 @@ The `characterSet`, `charset`, and `inputEncoding` getter steps are to return [t The `contentType` getter steps are to return [this](https://webidl.spec.whatwg.org/#this)’s [content type](https://dom.spec.whatwg.org/#concept-document-content-type). -___ +--- [Document/doctype](https://developer.mozilla.org/en-US/docs/Web/API/Document/doctype "Returns the Document Type Declaration (DTD) associated with current document. The returned object implements the DocumentType interface. Use DOMImplementation.createDocumentType() to create a DocumentType.") @@ -5741,15 +5346,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -5763,15 +5368,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5785,15 +5390,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera5.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5809,15 +5414,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -5837,15 +5442,15 @@ In all current engines. Firefox3+Safari3.1+Chrome1+ -___ +--- Opera9.5+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5857,15 +5462,15 @@ In all current engines. Firefox3+Safari6+Chrome1+ -___ +--- Opera9.5+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5897,11 +5502,11 @@ The `getElementsByClassName(classNames)` method steps are to return the [list of A call to `document.getElementById("example").getElementsByClassName("aaa")` would return a `[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection)` with the two paragraphs `p1` and `p2` in it. -A call to `getElementsByClassName("ccc bbb")` would only return one node, however, namely `p3`. A call to `document.getElementById("example").getElementsByClassName("bbb  ccc ")` would return the same thing. +A call to `getElementsByClassName("ccc bbb")` would only return one node, however, namely `p3`. A call to `document.getElementById("example").getElementsByClassName("bbb ccc ")` would return the same thing. A call to `getElementsByClassName("aaa,bbb")` would return no nodes; none of the elements above are in the `aaa,bbb` class. -___ +--- [Document/createElement](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement "In an HTML document, the document.createElement() method creates the HTML element specified by tagName, or an HTMLUnknownElement if tagName isn't recognized.") @@ -5909,15 +5514,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera6+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -5935,15 +5540,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -5955,10 +5560,10 @@ If qualifiedName does not match the `[QName](https://www.w3.org/TR/xml-names/#NT If one of the following conditions is true a "`[NamespaceError](https://webidl.spec.whatwg.org/#namespaceerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)` will be thrown: -- [Namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is not null and namespace is the empty string. -- [Namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is "`xml`" and namespace is not the [XML namespace](https://infra.spec.whatwg.org/#xml-namespace). -- qualifiedName or [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is "`xmlns`" and namespace is not the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace). -- namespace is the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace) and neither qualifiedName nor [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is "`xmlns`". +- [Namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is not null and namespace is the empty string. +- [Namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is "`xml`" and namespace is not the [XML namespace](https://infra.spec.whatwg.org/#xml-namespace). +- qualifiedName or [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is "`xmlns`" and namespace is not the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace). +- namespace is the [XMLNS namespace](https://infra.spec.whatwg.org/#xmlns-namespace) and neither qualifiedName nor [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) is "`xmlns`". When supplied, options’s `[is](https://dom.spec.whatwg.org/#dom-elementcreationoptions-is)` can be used to create a [customized built-in element](https://html.spec.whatwg.org/multipage/custom-elements.html#customized-built-in-element). @@ -5968,19 +5573,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``documentFragment = document . `[createDocumentFragment()](https://dom.spec.whatwg.org/#dom-document-createdocumentfragment)` `` +`` documentFragment = document . `[createDocumentFragment()](https://dom.spec.whatwg.org/#dom-document-createdocumentfragment)` `` Returns a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node). @@ -5990,23 +5595,23 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ -``text = document . `[createTextNode(data)](https://dom.spec.whatwg.org/#dom-document-createtextnode)` `` +`` text = document . `[createTextNode(data)](https://dom.spec.whatwg.org/#dom-document-createtextnode)` `` Returns a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is data. -``text = document . `[createCDATASection(data)](https://dom.spec.whatwg.org/#dom-document-createcdatasection)` `` +`` text = document . `[createCDATASection(data)](https://dom.spec.whatwg.org/#dom-document-createcdatasection)` `` Returns a `[CDATASection](https://dom.spec.whatwg.org/#cdatasection)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is data. @@ -6016,15 +5621,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -6034,19 +5639,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``comment = document . `[createComment(data)](https://dom.spec.whatwg.org/#dom-document-createcomment)` `` +`` comment = document . `[createComment(data)](https://dom.spec.whatwg.org/#dom-document-createcomment)` `` Returns a `[Comment](https://dom.spec.whatwg.org/#comment)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is data. @@ -6056,19 +5661,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``processingInstruction = document . `[createProcessingInstruction(target, data)](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction)` `` +`` processingInstruction = document . `[createProcessingInstruction(target, data)](https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction)` `` Returns a `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` [node](https://dom.spec.whatwg.org/#concept-node) whose [target](https://dom.spec.whatwg.org/#concept-pi-target) is target and [data](https://dom.spec.whatwg.org/#concept-cd-data) is data. If target does not match the `[Name](https://www.w3.org/TR/xml/#NT-Name)` production an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)` will be thrown. If data contains "`?>`" an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)` will be thrown. @@ -6079,28 +5684,18 @@ The HTML Standard will, e.g., define that for `html` and the [HTML namespace](ht The `createElement(localName, options)` method steps are: 1. If localName does not match the `[Name](https://www.w3.org/TR/xml/#NT-Name)` production, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If [this](https://webidl.spec.whatwg.org/#this) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set localName to localName in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 3. Let is be null. - 4. If options is a [dictionary](https://webidl.spec.whatwg.org/#dfn-dictionary) and options\["`[is](https://dom.spec.whatwg.org/#dom-elementcreationoptions-is)`"\] [exists](https://infra.spec.whatwg.org/#map-exists), then set is to it. - 5. Let namespace be the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), if [this](https://webidl.spec.whatwg.org/#this) is an [HTML document](https://dom.spec.whatwg.org/#html-document) or [this](https://webidl.spec.whatwg.org/#this)’s [content type](https://dom.spec.whatwg.org/#concept-document-content-type) is "`application/xhtml+xml`"; otherwise null. - 6. Return the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element) given [this](https://webidl.spec.whatwg.org/#this), localName, namespace, null, is, and with the synchronous custom elements flag set. - The internal `createElementNS` steps, given document, namespace, qualifiedName, and options, are as follows: 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to [validate and extract](https://dom.spec.whatwg.org/#validate-and-extract). - 2. Let is be null. - 3. If options is a [dictionary](https://webidl.spec.whatwg.org/#dfn-dictionary) and options\["`[is](https://dom.spec.whatwg.org/#dom-elementcreationoptions-is)`"\] [exists](https://infra.spec.whatwg.org/#map-exists), then set is to it. - 4. Return the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element) given document, localName, namespace, prefix, is, and with the synchronous custom elements flag set. - The `createElementNS(namespace, qualifiedName, options)` method steps are to return the result of running the [internal `createElementNS` steps](https://dom.spec.whatwg.org/#internal-createelementns-steps), given [this](https://webidl.spec.whatwg.org/#this), namespace, qualifiedName, and options. @@ -6115,11 +5710,8 @@ No check is performed that data consists of characters that match the `[Char](ht The `createCDATASection(data)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If data contains the string "`]]>`", then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. Return a new `[CDATASection](https://dom.spec.whatwg.org/#cdatasection)` [node](https://dom.spec.whatwg.org/#concept-node) with its [data](https://dom.spec.whatwg.org/#concept-cd-data) set to data and [node document](https://dom.spec.whatwg.org/#concept-node-document) set to [this](https://webidl.spec.whatwg.org/#this). - The method steps are to return a new `[Comment](https://dom.spec.whatwg.org/#comment)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is data and [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this). @@ -6133,7 +5725,7 @@ The `createProcessingInstruction(target, data)` method steps are: No check is performed that target contains "`xml`" or "`:`", or that data contains characters that match the `[Char](https://www.w3.org/TR/xml/#NT-Char)` production. -___ +--- [Document/importNode](https://developer.mozilla.org/en-US/docs/Web/API/Document/importNode "The Document object's importNode() method creates a copy of a Node or DocumentFragment from another document, to be inserted into the current document later.") @@ -6141,15 +5733,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -6165,15 +5757,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -6186,45 +5778,33 @@ If node is a [document](https://dom.spec.whatwg.org/#concept-document), throws a The `importNode(node, deep)` method steps are: 1. If node is a [document](https://dom.spec.whatwg.org/#concept-document) or [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. Return a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of node, with [this](https://webidl.spec.whatwg.org/#this) and the _clone children flag_ set if deep is true. - [Specifications](https://dom.spec.whatwg.org/#other-applicable-specifications) may define adopting steps for all or some [nodes](https://dom.spec.whatwg.org/#concept-node). The algorithm is passed node and oldDocument, as indicated in the [adopt](https://dom.spec.whatwg.org/#concept-node-adopt) algorithm. To adopt a node into a document, run these steps: 1. Let oldDocument be node’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. If node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is non-null, then [remove](https://dom.spec.whatwg.org/#concept-node-remove) node. - 3. If document is not oldDocument, then: - + 1. For each inclusiveDescendant in node’s [shadow-including inclusive descendants](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-descendant): - + 1. Set inclusiveDescendant’s [node document](https://dom.spec.whatwg.org/#concept-node-document) to document. - 2. If inclusiveDescendant is an [element](https://dom.spec.whatwg.org/#concept-element), then set the [node document](https://dom.spec.whatwg.org/#concept-node-document) of each [attribute](https://dom.spec.whatwg.org/#concept-attribute) in inclusiveDescendant’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) to document. - + 2. For each inclusiveDescendant in node’s [shadow-including inclusive descendants](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-descendant) that is [custom](https://dom.spec.whatwg.org/#concept-element-custom), [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with inclusiveDescendant, callback name "`adoptedCallback`", and an argument list containing oldDocument and document. - 3. For each inclusiveDescendant in node’s [shadow-including inclusive descendants](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-descendant), in [shadow-including tree order](https://dom.spec.whatwg.org/#concept-shadow-including-tree-order), run the [adopting steps](https://dom.spec.whatwg.org/#concept-node-adopt-ext) with inclusiveDescendant and oldDocument. - The `adoptNode(node)` method steps are: 1. If node is a [document](https://dom.spec.whatwg.org/#concept-document), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If node is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. If node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node) whose [host](https://dom.spec.whatwg.org/#concept-documentfragment-host) is non-null, then return. - 4. [Adopt](https://dom.spec.whatwg.org/#concept-node-adopt) node into [this](https://webidl.spec.whatwg.org/#this). - 5. Return node. - -___ +--- [Document/createAttribute](https://developer.mozilla.org/en-US/docs/Web/API/Document/createAttribute "The Document.createAttribute() method creates a new attribute node, and returns it. The object created a node implementing the Attr interface. The DOM does not enforce what sort of attributes can be added to a particular element in this manner.") @@ -6232,33 +5812,30 @@ In all current engines. Firefox44+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android44+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `createAttribute(localName)` method steps are: 1. If localName does not match the `[Name](https://www.w3.org/TR/xml/#NT-Name)` production in XML, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If [this](https://webidl.spec.whatwg.org/#this) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set localName to localName in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). 3. Return a new [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is localName and [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this). The `createAttributeNS(namespace, qualifiedName)` method steps are: 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to [validate and extract](https://dom.spec.whatwg.org/#validate-and-extract). - 2. Return a new [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) is namespace, [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix) is prefix, [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is localName, and [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this). - -___ +--- [Document/createEvent](https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent "Creates an event of the type specified. The returned object should be first initialized and can then be passed to EventTarget.dispatchEvent.") @@ -6266,156 +5843,148 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera7+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `createEvent(interface)` method steps are: 1. Let constructor be null. - 2. If interface is an [ASCII case-insensitive](https://infra.spec.whatwg.org/#ascii-case-insensitive) match for any of the strings in the first column in the following table, then set constructor to the interface in the second column on the same row as the matching string: - + String - + Interface - + Notes - + "`beforeunloadevent`" - + `[BeforeUnloadEvent](https://html.spec.whatwg.org/multipage/browsing-the-web.html#beforeunloadevent)` - + [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) - + "`compositionevent`" - + `[CompositionEvent](https://www.w3.org/TR/uievents/#compositionevent)` - + [\[UIEVENTS\]](https://dom.spec.whatwg.org/#biblio-uievents) - + "`customevent`" - + `[CustomEvent](https://dom.spec.whatwg.org/#customevent)` - + "`devicemotionevent`" - + `[DeviceMotionEvent](https://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion)` - + [\[DEVICE-ORIENTATION\]](https://dom.spec.whatwg.org/#biblio-device-orientation) - + "`deviceorientationevent`" - + `[DeviceOrientationEvent](https://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion)` - + "`dragevent`" - + `[DragEvent](https://html.spec.whatwg.org/multipage/dnd.html#dragevent)` - + [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) - + "`event`" - + `[Event](https://dom.spec.whatwg.org/#event)` - + "`events`" - + "`focusevent`" - + `[FocusEvent](https://www.w3.org/TR/uievents/#focusevent)` - + [\[UIEVENTS\]](https://dom.spec.whatwg.org/#biblio-uievents) - + "`hashchangeevent`" - + `[HashChangeEvent](https://html.spec.whatwg.org/multipage/browsing-the-web.html#hashchangeevent)` - + [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) - + "`htmlevents`" - + `[Event](https://dom.spec.whatwg.org/#event)` - + "`keyboardevent`" - + `[KeyboardEvent](https://www.w3.org/TR/uievents/#keyboardevent)` - + [\[UIEVENTS\]](https://dom.spec.whatwg.org/#biblio-uievents) - + "`messageevent`" - + `[MessageEvent](https://html.spec.whatwg.org/multipage/comms.html#messageevent)` - + [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) - + "`mouseevent`" - + `[MouseEvent](https://www.w3.org/TR/uievents/#mouseevent)` - + [\[UIEVENTS\]](https://dom.spec.whatwg.org/#biblio-uievents) - + "`mouseevents`" - + "`storageevent`" - + `[StorageEvent](https://html.spec.whatwg.org/multipage/webstorage.html#storageevent)` - + [\[HTML\]](https://dom.spec.whatwg.org/#biblio-html) - + "`svgevents`" - + `[Event](https://dom.spec.whatwg.org/#event)` - + "`textevent`" - + `[CompositionEvent](https://www.w3.org/TR/uievents/#compositionevent)` - + [\[UIEVENTS\]](https://dom.spec.whatwg.org/#biblio-uievents) - + "`touchevent`" - + `[TouchEvent](https://w3c.github.io/touch-events/#idl-def-touchevent)` - + [\[TOUCH-EVENTS\]](https://dom.spec.whatwg.org/#biblio-touch-events) - + "`uievent`" - + `[UIEvent](https://www.w3.org/TR/uievents/#uievent)` - + [\[UIEVENTS\]](https://dom.spec.whatwg.org/#biblio-uievents) - + "`uievents`" - + 3. If constructor is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 4. If the interface indicated by constructor is not exposed on the [relevant global object](https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global) of [this](https://webidl.spec.whatwg.org/#this), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + Typically user agents disable support for touch events in some configurations, in which case this clause would be triggered for the interface `[TouchEvent](https://w3c.github.io/touch-events/#idl-def-touchevent)`. - + 5. Let event be the result of [creating an event](https://dom.spec.whatwg.org/#concept-event-create) given constructor. - 6. Initialize event’s `[type](https://dom.spec.whatwg.org/#dom-event-type)` attribute to the empty string. - 7. Initialize event’s `[timeStamp](https://dom.spec.whatwg.org/#dom-event-timestamp)` attribute to the result of calling [current high resolution time](https://w3c.github.io/hr-time/#dfn-current-high-resolution-time) with [this](https://webidl.spec.whatwg.org/#this)’s [relevant global object](https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global). - 8. Initialize event’s `[isTrusted](https://dom.spec.whatwg.org/#dom-event-istrusted)` attribute to false. - 9. Unset event’s [initialized flag](https://dom.spec.whatwg.org/#initialized-flag). - -10. Return event. - +10. Return event. [Event](https://dom.spec.whatwg.org/#concept-event) constructors ought to be used instead. -___ +--- [Document/createRange](https://developer.mozilla.org/en-US/docs/Web/API/Document/createRange "The Document.createRange() method returns a new Range object.") @@ -6423,15 +5992,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -6439,7 +6008,7 @@ The `createRange()` method steps are to return a new [live range](https://dom.sp The `[Range()](https://dom.spec.whatwg.org/#dom-range-range)` constructor can be used instead. -___ +--- [Document/createNodeIterator](https://developer.mozilla.org/en-US/docs/Web/API/Document/createNodeIterator "Returns a new NodeIterator object.") @@ -6447,32 +6016,26 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes The `createNodeIterator(root, whatToShow, filter)` method steps are: 1. Let iterator be a new `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` object. - 2. Set iterator’s [root](https://dom.spec.whatwg.org/#concept-traversal-root) and iterator’s [reference](https://dom.spec.whatwg.org/#nodeiterator-reference) to root. - 3. Set iterator’s [pointer before reference](https://dom.spec.whatwg.org/#nodeiterator-pointer-before-reference) to true. - 4. Set iterator’s [whatToShow](https://dom.spec.whatwg.org/#concept-traversal-whattoshow) to whatToShow. - 5. Set iterator’s [filter](https://dom.spec.whatwg.org/#concept-traversal-filter) to filter. - 6. Return iterator. - [Document/createTreeWalker](https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker "The Document.createTreeWalker() creator method returns a newly created TreeWalker object.") @@ -6480,28 +6043,24 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `createTreeWalker(root, whatToShow, filter)` method steps are: 1. Let walker be a new `[TreeWalker](https://dom.spec.whatwg.org/#treewalker)` object. - 2. Set walker’s [root](https://dom.spec.whatwg.org/#concept-traversal-root) and walker’s [current](https://dom.spec.whatwg.org/#treewalker-current) to root. - 3. Set walker’s [whatToShow](https://dom.spec.whatwg.org/#concept-traversal-whattoshow) to whatToShow. - 4. Set walker’s [filter](https://dom.spec.whatwg.org/#concept-traversal-filter) to filter. - 5. Return walker. #### 4.5.1. Interface `[DOMImplementation](https://dom.spec.whatwg.org/#domimplementation)`[](https://dom.spec.whatwg.org/#interface-domimplementation) @@ -6512,15 +6071,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -6528,11 +6087,11 @@ User agents must create a `[DOMImplementation](https://dom.spec.whatwg.org/#domi \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `DOMImplementation` { - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentType](https://dom.spec.whatwg.org/#documenttype) [createDocumentType](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype-qualifiedname-publicid-systemid-qualifiedname), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `publicId`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype-qualifiedname-publicid-systemid-publicid), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `systemId`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype-qualifiedname-publicid-systemid-systemid)); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [XMLDocument](https://dom.spec.whatwg.org/#xmldocument) [createDocument](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument-namespace-qualifiedname-doctype-namespace), \[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument-namespace-qualifiedname-doctype-qualifiedname), optional [DocumentType](https://dom.spec.whatwg.org/#documenttype)? `doctype`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument-namespace-qualifiedname-doctype-doctype) = null); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Document](https://dom.spec.whatwg.org/#document) [createHTMLDocument](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument)(optional [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `title`[](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument-title-title)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentType](https://dom.spec.whatwg.org/#documenttype) [createDocumentType](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype-qualifiedname-publicid-systemid-qualifiedname), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `publicId`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype-qualifiedname-publicid-systemid-publicid), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `systemId`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype-qualifiedname-publicid-systemid-systemid)); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [XMLDocument](https://dom.spec.whatwg.org/#xmldocument) [createDocument](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument-namespace-qualifiedname-doctype-namespace), \[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument-namespace-qualifiedname-doctype-qualifiedname), optional [DocumentType](https://dom.spec.whatwg.org/#documenttype)? `doctype`[](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument-namespace-qualifiedname-doctype-doctype) = null); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Document](https://dom.spec.whatwg.org/#document) [createHTMLDocument](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument)(optional [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `title`[](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument-title-title)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasFeature](https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature)(); // useless; always returns true +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasFeature](https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature)(); // useless; always returns true }; [DOMImplementation/createDocumentType](https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType "The DOMImplementation.createDocumentType() method returns a DocumentType object which can either be used with DOMImplementation.createDocument upon document creation or can be put into the document via methods like Node.insertBefore() or Node.replaceChild().") @@ -6541,19 +6100,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``doctype = document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` . `[createDocumentType(qualifiedName, publicId, systemId)](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype)` `` +`` doctype = document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` . `[createDocumentType(qualifiedName, publicId, systemId)](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype)` `` Returns a [doctype](https://dom.spec.whatwg.org/#concept-doctype), with the given qualifiedName, publicId, and systemId. If qualifiedName does not match the `[Name](https://www.w3.org/TR/xml/#NT-Name)` production, an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)` is thrown, and if it does not match the `[QName](https://www.w3.org/TR/xml-names/#NT-QName)` production, a "`[NamespaceError](https://webidl.spec.whatwg.org/#namespaceerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)` is thrown. @@ -6563,19 +6122,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``doc = document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` . [createDocument(namespace, qualifiedName [, doctype = null])](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument)`` +`` doc = document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` . [createDocument(namespace, qualifiedName [, doctype = null])](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument) `` Returns an `[XMLDocument](https://dom.spec.whatwg.org/#xmldocument)`, with a [document element](https://dom.spec.whatwg.org/#document-element) whose [local name](https://dom.spec.whatwg.org/#concept-element-local-name) is qualifiedName and whose [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is namespace (unless qualifiedName is the empty string), and with doctype, if it is given, as its [doctype](https://dom.spec.whatwg.org/#concept-doctype). @@ -6587,86 +6146,68 @@ In all current engines. Firefox4+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ -``doc = document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` . [createHTMLDocument([title])](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument)`` +`` doc = document . `[implementation](https://dom.spec.whatwg.org/#dom-document-implementation)` . [createHTMLDocument([title])](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument) `` Returns a [document](https://dom.spec.whatwg.org/#concept-document), with a basic [tree](https://dom.spec.whatwg.org/#concept-tree) already constructed including a `[title](https://html.spec.whatwg.org/multipage/semantics.html#the-title-element)` element, unless the title argument is omitted. The `createDocumentType(qualifiedName, publicId, systemId)` method steps are: 1. [Validate](https://dom.spec.whatwg.org/#validate) qualifiedName. - 2. Return a new [doctype](https://dom.spec.whatwg.org/#concept-doctype), with qualifiedName as its [name](https://dom.spec.whatwg.org/#concept-doctype-name), publicId as its [public ID](https://dom.spec.whatwg.org/#concept-doctype-publicid), and systemId as its [system ID](https://dom.spec.whatwg.org/#concept-doctype-systemid), and with its [node document](https://dom.spec.whatwg.org/#concept-node-document) set to the associated [document](https://dom.spec.whatwg.org/#concept-document) of [this](https://webidl.spec.whatwg.org/#this). - No check is performed that publicId code points match the `[PubidChar](https://www.w3.org/TR/xml/#NT-PubidChar)` production or that systemId does not contain both a '`"`' and a "`'`". The `createDocument(namespace, qualifiedName, doctype)` method steps are: 1. Let document be a new `[XMLDocument](https://dom.spec.whatwg.org/#xmldocument)`. - 2. Let element be null. - 3. If qualifiedName is not the empty string, then set element to the result of running the [internal `createElementNS` steps](https://dom.spec.whatwg.org/#internal-createelementns-steps), given document, namespace, qualifiedName, and an empty dictionary. - 4. If doctype is non-null, [append](https://dom.spec.whatwg.org/#concept-node-append) doctype to document. - 5. If element is non-null, [append](https://dom.spec.whatwg.org/#concept-node-append) element to document. - 6. document’s [origin](https://dom.spec.whatwg.org/#concept-document-origin) is [this](https://webidl.spec.whatwg.org/#this)’s associated [document](https://dom.spec.whatwg.org/#concept-document)’s [origin](https://dom.spec.whatwg.org/#concept-document-origin). - 7. document’s [content type](https://dom.spec.whatwg.org/#concept-document-content-type) is determined by namespace: - + [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) - + `application/xhtml+xml` - + [SVG namespace](https://infra.spec.whatwg.org/#svg-namespace) - + `image/svg+xml` - + Any other namespace - + `application/xml` - + 8. Return document. - The `createHTMLDocument(title)` method steps are: 1. Let doc be a new [document](https://dom.spec.whatwg.org/#concept-document) that is an [HTML document](https://dom.spec.whatwg.org/#html-document). - 2. Set doc’s [content type](https://dom.spec.whatwg.org/#concept-document-content-type) to "`text/html`". - 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) a new [doctype](https://dom.spec.whatwg.org/#concept-doctype), with "`html`" as its [name](https://dom.spec.whatwg.org/#concept-doctype-name) and with its [node document](https://dom.spec.whatwg.org/#concept-node-document) set to doc, to doc. - 4. [Append](https://dom.spec.whatwg.org/#concept-node-append) the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element) given doc, `[html](https://html.spec.whatwg.org/multipage/semantics.html#the-html-element)`, and the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), to doc. - 5. [Append](https://dom.spec.whatwg.org/#concept-node-append) the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element) given doc, `[head](https://html.spec.whatwg.org/multipage/semantics.html#the-head-element)`, and the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), to the `[html](https://html.spec.whatwg.org/multipage/semantics.html#the-html-element)` element created earlier. - 6. If title is given: - + 1. [Append](https://dom.spec.whatwg.org/#concept-node-append) the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element) given doc, `[title](https://html.spec.whatwg.org/multipage/semantics.html#the-title-element)`, and the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), to the `[head](https://html.spec.whatwg.org/multipage/semantics.html#the-head-element)` element created earlier. - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) a new `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node), with its [data](https://dom.spec.whatwg.org/#concept-cd-data) set to title (which could be the empty string) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) set to doc, to the `[title](https://html.spec.whatwg.org/multipage/semantics.html#the-title-element)` element created earlier. - + 7. [Append](https://dom.spec.whatwg.org/#concept-node-append) the result of [creating an element](https://dom.spec.whatwg.org/#concept-create-element) given doc, `[body](https://html.spec.whatwg.org/multipage/sections.html#the-body-element)`, and the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), to the `[html](https://html.spec.whatwg.org/multipage/semantics.html#the-html-element)` element created earlier. - 8. doc’s [origin](https://dom.spec.whatwg.org/#concept-document-origin) is [this](https://webidl.spec.whatwg.org/#this)’s associated [document](https://dom.spec.whatwg.org/#concept-document)’s [origin](https://dom.spec.whatwg.org/#concept-document-origin). - 9. Return doc. - The `hasFeature()` method steps are to return true. @@ -6680,23 +6221,23 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `DocumentType` : [Node](https://dom.spec.whatwg.org/#node) { - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [name](https://dom.spec.whatwg.org/#dom-documenttype-name); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [publicId](https://dom.spec.whatwg.org/#dom-documenttype-publicid); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [systemId](https://dom.spec.whatwg.org/#dom-documenttype-systemid); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [name](https://dom.spec.whatwg.org/#dom-documenttype-name); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [publicId](https://dom.spec.whatwg.org/#dom-documenttype-publicid); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [systemId](https://dom.spec.whatwg.org/#dom-documenttype-systemid); }; `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` [nodes](https://dom.spec.whatwg.org/#concept-node) are simply known as doctypes. @@ -6719,21 +6260,21 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `DocumentFragment` : [Node](https://dom.spec.whatwg.org/#node) { - [constructor](https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment)(); +[constructor](https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment)(); }; A `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node) has an associated host (null or an [element](https://dom.spec.whatwg.org/#concept-element) in a different [node tree](https://dom.spec.whatwg.org/#concept-node-tree)). It is null unless otherwise stated. @@ -6748,19 +6289,19 @@ In all current engines. Firefox24+Safari8+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android24+iOS Safari8+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ -``tree = new `[DocumentFragment()](https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment)` `` +`` tree = new `[DocumentFragment()](https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment)` `` Returns a new `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node). @@ -6774,25 +6315,25 @@ In all current engines. Firefox63+Safari10.1+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `ShadowRoot` : [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) { - readonly attribute [ShadowRootMode](https://dom.spec.whatwg.org/#enumdef-shadowrootmode) [mode](https://dom.spec.whatwg.org/#dom-shadowroot-mode); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [delegatesFocus](https://dom.spec.whatwg.org/#dom-shadowroot-delegatesfocus); - readonly attribute [SlotAssignmentMode](https://dom.spec.whatwg.org/#enumdef-slotassignmentmode) [slotAssignment](https://dom.spec.whatwg.org/#dom-shadowroot-slotassignment); - readonly attribute [Element](https://dom.spec.whatwg.org/#element) [host](https://dom.spec.whatwg.org/#dom-shadowroot-host); - attribute [EventHandler](https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler) [onslotchange](https://dom.spec.whatwg.org/#dom-shadowroot-onslotchange); +readonly attribute [ShadowRootMode](https://dom.spec.whatwg.org/#enumdef-shadowrootmode) [mode](https://dom.spec.whatwg.org/#dom-shadowroot-mode); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [delegatesFocus](https://dom.spec.whatwg.org/#dom-shadowroot-delegatesfocus); +readonly attribute [SlotAssignmentMode](https://dom.spec.whatwg.org/#enumdef-slotassignmentmode) [slotAssignment](https://dom.spec.whatwg.org/#dom-shadowroot-slotassignment); +readonly attribute [Element](https://dom.spec.whatwg.org/#element) [host](https://dom.spec.whatwg.org/#dom-shadowroot-host); +attribute [EventHandler](https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler) [onslotchange](https://dom.spec.whatwg.org/#dom-shadowroot-onslotchange); }; enum `ShadowRootMode` { `"open"`[](https://dom.spec.whatwg.org/#dom-shadowrootmode-open), `"closed"`[](https://dom.spec.whatwg.org/#dom-shadowrootmode-closed) }; @@ -6808,15 +6349,15 @@ In all current engines. Firefox94+Safari15+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android94+iOS Safari15+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -6836,15 +6377,15 @@ In all current engines. Firefox63+Safari10.1+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -6860,15 +6401,15 @@ In all current engines. Firefox63+Safari10.1+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10.3+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -6876,7 +6417,7 @@ The `host` getter steps are to return [this](https://webidl.spec.whatwg.org/#thi The `onslotchange` attribute is an [event handler IDL attribute](https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes) for the `onslotchange`[](https://dom.spec.whatwg.org/#shadowroot-onslotchange) [event handler](https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers), whose [event handler event type](https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type) is `[slotchange](https://html.spec.whatwg.org/multipage/indices.html#event-slotchange)`. -___ +--- In shadow-including tree order is [shadow-including preorder, depth-first traversal](https://dom.spec.whatwg.org/#shadow-including-preorder-depth-first-traversal) of a [node tree](https://dom.spec.whatwg.org/#concept-node-tree). Shadow-including preorder, depth-first traversal of a [node tree](https://dom.spec.whatwg.org/#concept-node-tree) tree is preorder, depth-first traversal of tree, with for each [shadow host](https://dom.spec.whatwg.org/#element-shadow-host) encountered in tree, [shadow-including preorder, depth-first traversal](https://dom.spec.whatwg.org/#shadow-including-preorder-depth-first-traversal) of that [element](https://dom.spec.whatwg.org/#concept-element)’s [shadow root](https://dom.spec.whatwg.org/#concept-element-shadow-root)’s [node tree](https://dom.spec.whatwg.org/#concept-node-tree) just after it is encountered. @@ -6892,25 +6433,21 @@ A shadow-including inclusive ancestor is an object or one of its [shadow-includi A [node](https://dom.spec.whatwg.org/#concept-node) A is closed-shadow-hidden from a [node](https://dom.spec.whatwg.org/#concept-node) B if all of the following conditions are true: -- A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root). - -- A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is not a [shadow-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-ancestor) of B. - -- A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) whose [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`closed`" or A’s [root](https://dom.spec.whatwg.org/#concept-tree-root)’s [host](https://dom.spec.whatwg.org/#concept-documentfragment-host) is [closed-shadow-hidden](https://dom.spec.whatwg.org/#concept-closed-shadow-hidden) from B. - +- A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root). +- A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is not a [shadow-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-ancestor) of B. +- A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) whose [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`closed`" or A’s [root](https://dom.spec.whatwg.org/#concept-tree-root)’s [host](https://dom.spec.whatwg.org/#concept-documentfragment-host) is [closed-shadow-hidden](https://dom.spec.whatwg.org/#concept-closed-shadow-hidden) from B. To retarget an object A against an object B, repeat these steps until they return an object: 1. If one of the following is true - - - A is not a [node](https://dom.spec.whatwg.org/#concept-node) - - A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is not a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) - - B is a [node](https://dom.spec.whatwg.org/#concept-node) and A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-ancestor) of B - + + - A is not a [node](https://dom.spec.whatwg.org/#concept-node) + - A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is not a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) + - B is a [node](https://dom.spec.whatwg.org/#concept-node) and A’s [root](https://dom.spec.whatwg.org/#concept-tree-root) is a [shadow-including inclusive ancestor](https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-ancestor) of B + then return A. - + 2. Set A to A’s [root](https://dom.spec.whatwg.org/#concept-tree-root)’s [host](https://dom.spec.whatwg.org/#concept-documentfragment-host). - The [retargeting](https://dom.spec.whatwg.org/#retarget) algorithm is used by [event dispatch](https://dom.spec.whatwg.org/#concept-event-dispatch) as well as other specifications, such as Fullscreen. [\[FULLSCREEN\]](https://dom.spec.whatwg.org/#biblio-fullscreen) @@ -6922,68 +6459,68 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE4+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `Element` : [Node](https://dom.spec.whatwg.org/#node) { - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [namespaceURI](https://dom.spec.whatwg.org/#dom-element-namespaceuri); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [prefix](https://dom.spec.whatwg.org/#dom-element-prefix); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [localName](https://dom.spec.whatwg.org/#dom-element-localname); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [tagName](https://dom.spec.whatwg.org/#dom-element-tagname); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [id](https://dom.spec.whatwg.org/#dom-element-id); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [className](https://dom.spec.whatwg.org/#dom-element-classname); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject), [PutForwards](https://webidl.spec.whatwg.org/#PutForwards)\=[value](https://dom.spec.whatwg.org/#dom-domtokenlist-value)\] readonly attribute [DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist) [classList](https://dom.spec.whatwg.org/#dom-element-classlist); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [slot](https://dom.spec.whatwg.org/#dom-element-slot); - - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasAttributes](https://dom.spec.whatwg.org/#dom-element-hasattributes)(); - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap) [attributes](https://dom.spec.whatwg.org/#dom-element-attributes); - [sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)\> [getAttributeNames](https://dom.spec.whatwg.org/#dom-element-getattributenames)(); - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [getAttribute](https://dom.spec.whatwg.org/#dom-element-getattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-getattribute-qualifiedname-qualifiedname)); - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [getAttributeNS](https://dom.spec.whatwg.org/#dom-element-getattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-getattributens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-getattributens-namespace-localname-localname)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setAttribute](https://dom.spec.whatwg.org/#dom-element-setattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-setattribute-qualifiedname-value-qualifiedname), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `value`[](https://dom.spec.whatwg.org/#dom-element-setattribute-qualifiedname-value-value)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setAttributeNS](https://dom.spec.whatwg.org/#dom-element-setattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-setattributens-namespace-qualifiedname-value-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-setattributens-namespace-qualifiedname-value-qualifiedname), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `value`[](https://dom.spec.whatwg.org/#dom-element-setattributens-namespace-qualifiedname-value-value)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [removeAttribute](https://dom.spec.whatwg.org/#dom-element-removeattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-removeattribute-qualifiedname-qualifiedname)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [removeAttributeNS](https://dom.spec.whatwg.org/#dom-element-removeattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-removeattributens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-removeattributens-namespace-localname-localname)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [toggleAttribute](https://dom.spec.whatwg.org/#dom-element-toggleattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-toggleattribute-qualifiedname-force-qualifiedname), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `force`[](https://dom.spec.whatwg.org/#dom-element-toggleattribute-qualifiedname-force-force)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasAttribute](https://dom.spec.whatwg.org/#dom-element-hasattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-hasattribute-qualifiedname-qualifiedname)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasAttributeNS](https://dom.spec.whatwg.org/#dom-element-hasattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-hasattributens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-hasattributens-namespace-localname-localname)); - - [Attr](https://dom.spec.whatwg.org/#attr)? [getAttributeNode](https://dom.spec.whatwg.org/#dom-element-getattributenode)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-getattributenode-qualifiedname-qualifiedname)); - [Attr](https://dom.spec.whatwg.org/#attr)? [getAttributeNodeNS](https://dom.spec.whatwg.org/#dom-element-getattributenodens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-getattributenodens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-getattributenodens-namespace-localname-localname)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setAttributeNode](https://dom.spec.whatwg.org/#dom-element-setattributenode)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-element-setattributenode-attr-attr)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setAttributeNodeNS](https://dom.spec.whatwg.org/#dom-element-setattributenodens)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-element-setattributenodens-attr-attr)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr) [removeAttributeNode](https://dom.spec.whatwg.org/#dom-element-removeattributenode)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-element-removeattributenode-attr-attr)); - - [ShadowRoot](https://dom.spec.whatwg.org/#shadowroot) [attachShadow](https://dom.spec.whatwg.org/#dom-element-attachshadow)([ShadowRootInit](https://dom.spec.whatwg.org/#dictdef-shadowrootinit) `init`[](https://dom.spec.whatwg.org/#dom-element-attachshadow-init-init)); - readonly attribute [ShadowRoot](https://dom.spec.whatwg.org/#shadowroot)? [shadowRoot](https://dom.spec.whatwg.org/#dom-element-shadowroot); - - [Element](https://dom.spec.whatwg.org/#element)? [closest](https://dom.spec.whatwg.org/#dom-element-closest)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-element-closest-selectors-selectors)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [matches](https://dom.spec.whatwg.org/#dom-element-matches)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-element-matches-selectors-selectors)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [webkitMatchesSelector](https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector-selectors-selectors)); // legacy alias of .matches - - [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagName](https://dom.spec.whatwg.org/#dom-element-getelementsbytagname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-getelementsbytagname-qualifiedname-qualifiedname)); - [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagNameNS](https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens-namespace-localname-localname)); - [HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByClassName](https://dom.spec.whatwg.org/#dom-element-getelementsbyclassname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `classNames`[](https://dom.spec.whatwg.org/#dom-element-getelementsbyclassname-classnames-classnames)); - - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Element](https://dom.spec.whatwg.org/#element)? [insertAdjacentElement](https://dom.spec.whatwg.org/#dom-element-insertadjacentelement)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `where`[](https://dom.spec.whatwg.org/#dom-element-insertadjacentelement-where-element-where), [Element](https://dom.spec.whatwg.org/#element) `element`[](https://dom.spec.whatwg.org/#dom-element-insertadjacentelement-where-element-element)); // legacy - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [insertAdjacentText](https://dom.spec.whatwg.org/#dom-element-insertadjacenttext)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `where`[](https://dom.spec.whatwg.org/#dom-element-insertadjacenttext-where-data-where), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-element-insertadjacenttext-where-data-data)); // legacy +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [namespaceURI](https://dom.spec.whatwg.org/#dom-element-namespaceuri); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [prefix](https://dom.spec.whatwg.org/#dom-element-prefix); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [localName](https://dom.spec.whatwg.org/#dom-element-localname); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [tagName](https://dom.spec.whatwg.org/#dom-element-tagname); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [id](https://dom.spec.whatwg.org/#dom-element-id); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [className](https://dom.spec.whatwg.org/#dom-element-classname); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject), [PutForwards](https://webidl.spec.whatwg.org/#PutForwards)\=[value](https://dom.spec.whatwg.org/#dom-domtokenlist-value)\] readonly attribute [DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist) [classList](https://dom.spec.whatwg.org/#dom-element-classlist); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [Unscopable](https://webidl.spec.whatwg.org/#Unscopable)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [slot](https://dom.spec.whatwg.org/#dom-element-slot); + +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasAttributes](https://dom.spec.whatwg.org/#dom-element-hasattributes)(); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap) [attributes](https://dom.spec.whatwg.org/#dom-element-attributes); +[sequence](https://webidl.spec.whatwg.org/#idl-sequence)<[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)\> [getAttributeNames](https://dom.spec.whatwg.org/#dom-element-getattributenames)(); +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [getAttribute](https://dom.spec.whatwg.org/#dom-element-getattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-getattribute-qualifiedname-qualifiedname)); +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [getAttributeNS](https://dom.spec.whatwg.org/#dom-element-getattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-getattributens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-getattributens-namespace-localname-localname)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setAttribute](https://dom.spec.whatwg.org/#dom-element-setattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-setattribute-qualifiedname-value-qualifiedname), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `value`[](https://dom.spec.whatwg.org/#dom-element-setattribute-qualifiedname-value-value)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setAttributeNS](https://dom.spec.whatwg.org/#dom-element-setattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-setattributens-namespace-qualifiedname-value-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-setattributens-namespace-qualifiedname-value-qualifiedname), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `value`[](https://dom.spec.whatwg.org/#dom-element-setattributens-namespace-qualifiedname-value-value)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [removeAttribute](https://dom.spec.whatwg.org/#dom-element-removeattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-removeattribute-qualifiedname-qualifiedname)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [removeAttributeNS](https://dom.spec.whatwg.org/#dom-element-removeattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-removeattributens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-removeattributens-namespace-localname-localname)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [toggleAttribute](https://dom.spec.whatwg.org/#dom-element-toggleattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-toggleattribute-qualifiedname-force-qualifiedname), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `force`[](https://dom.spec.whatwg.org/#dom-element-toggleattribute-qualifiedname-force-force)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasAttribute](https://dom.spec.whatwg.org/#dom-element-hasattribute)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-hasattribute-qualifiedname-qualifiedname)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [hasAttributeNS](https://dom.spec.whatwg.org/#dom-element-hasattributens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-hasattributens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-hasattributens-namespace-localname-localname)); + +[Attr](https://dom.spec.whatwg.org/#attr)? [getAttributeNode](https://dom.spec.whatwg.org/#dom-element-getattributenode)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-getattributenode-qualifiedname-qualifiedname)); +[Attr](https://dom.spec.whatwg.org/#attr)? [getAttributeNodeNS](https://dom.spec.whatwg.org/#dom-element-getattributenodens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-getattributenodens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-getattributenodens-namespace-localname-localname)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setAttributeNode](https://dom.spec.whatwg.org/#dom-element-setattributenode)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-element-setattributenode-attr-attr)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setAttributeNodeNS](https://dom.spec.whatwg.org/#dom-element-setattributenodens)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-element-setattributenodens-attr-attr)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr) [removeAttributeNode](https://dom.spec.whatwg.org/#dom-element-removeattributenode)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-element-removeattributenode-attr-attr)); + +[ShadowRoot](https://dom.spec.whatwg.org/#shadowroot) [attachShadow](https://dom.spec.whatwg.org/#dom-element-attachshadow)([ShadowRootInit](https://dom.spec.whatwg.org/#dictdef-shadowrootinit) `init`[](https://dom.spec.whatwg.org/#dom-element-attachshadow-init-init)); +readonly attribute [ShadowRoot](https://dom.spec.whatwg.org/#shadowroot)? [shadowRoot](https://dom.spec.whatwg.org/#dom-element-shadowroot); + +[Element](https://dom.spec.whatwg.org/#element)? [closest](https://dom.spec.whatwg.org/#dom-element-closest)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-element-closest-selectors-selectors)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [matches](https://dom.spec.whatwg.org/#dom-element-matches)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-element-matches-selectors-selectors)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [webkitMatchesSelector](https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `selectors`[](https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector-selectors-selectors)); // legacy alias of .matches + +[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagName](https://dom.spec.whatwg.org/#dom-element-getelementsbytagname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-element-getelementsbytagname-qualifiedname-qualifiedname)); +[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByTagNameNS](https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-element-getelementsbytagnamens-namespace-localname-localname)); +[HTMLCollection](https://dom.spec.whatwg.org/#htmlcollection) [getElementsByClassName](https://dom.spec.whatwg.org/#dom-element-getelementsbyclassname)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `classNames`[](https://dom.spec.whatwg.org/#dom-element-getelementsbyclassname-classnames-classnames)); + +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Element](https://dom.spec.whatwg.org/#element)? [insertAdjacentElement](https://dom.spec.whatwg.org/#dom-element-insertadjacentelement)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `where`[](https://dom.spec.whatwg.org/#dom-element-insertadjacentelement-where-element-where), [Element](https://dom.spec.whatwg.org/#element) `element`[](https://dom.spec.whatwg.org/#dom-element-insertadjacentelement-where-element-element)); // legacy +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [insertAdjacentText](https://dom.spec.whatwg.org/#dom-element-insertadjacenttext)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `where`[](https://dom.spec.whatwg.org/#dom-element-insertadjacenttext-where-data-where), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-element-insertadjacenttext-where-data-data)); // legacy }; dictionary `ShadowRootInit` { - required [ShadowRootMode](https://dom.spec.whatwg.org/#enumdef-shadowrootmode) `mode`; - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `delegatesFocus` = false; - [SlotAssignmentMode](https://dom.spec.whatwg.org/#enumdef-slotassignmentmode) `slotAssignment` = "named"; +required [ShadowRootMode](https://dom.spec.whatwg.org/#enumdef-shadowrootmode) `mode`; +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) `delegatesFocus` = false; +[SlotAssignmentMode](https://dom.spec.whatwg.org/#enumdef-slotassignmentmode) `slotAssignment` = "named"; }; `[Element](https://dom.spec.whatwg.org/#element)` [nodes](https://dom.spec.whatwg.org/#concept-node) are simply known as elements. @@ -7032,9 +6569,7 @@ An [element](https://dom.spec.whatwg.org/#concept-element)’s qualified name is An [element](https://dom.spec.whatwg.org/#concept-element)’s HTML-uppercased qualified name is the return value of these steps: 1. Let qualifiedName be [this](https://webidl.spec.whatwg.org/#this)’s [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name). - 2. If [this](https://webidl.spec.whatwg.org/#this) is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set qualifiedName to qualifiedName in [ASCII uppercase](https://infra.spec.whatwg.org/#ascii-uppercase). - 3. Return qualifiedName. User agents could optimize [qualified name](https://dom.spec.whatwg.org/#concept-element-qualified-name) and [HTML-uppercased qualified name](https://dom.spec.whatwg.org/#element-html-uppercased-qualified-name) by storing them in internal slots. @@ -7042,83 +6577,61 @@ User agents could optimize [qualified name](https://dom.spec.whatwg.org/#concept To create an element, given a document, localName, namespace, and optional prefix, is, and synchronous custom elements flag, run these steps: 1. If prefix was not given, let prefix be null. - 2. If is was not given, let is be null. - 3. Let result be null. - 4. Let definition be the result of [looking up a custom element definition](https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition) given document, namespace, localName, and is. - 5. If definition is non-null, and definition’s [name](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-name) is not equal to its [local name](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-local-name) (i.e., definition represents a [customized built-in element](https://html.spec.whatwg.org/multipage/custom-elements.html#customized-built-in-element)), then: - + 1. Let interface be the [element interface](https://dom.spec.whatwg.org/#concept-element-interface) for localName and the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace). - 2. Set result to a new [element](https://dom.spec.whatwg.org/#concept-element) that implements interface, with no attributes, [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) set to the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) set to prefix, [local name](https://dom.spec.whatwg.org/#concept-element-local-name) set to localName, [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) set to "`undefined`", [custom element definition](https://dom.spec.whatwg.org/#concept-element-custom-element-definition) set to null, [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) set to is, and [node document](https://dom.spec.whatwg.org/#concept-node-document) set to document. - 3. If the synchronous custom elements flag is set, then run this step while catching any exceptions: - + 1. [Upgrade](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element) element using definition. - - + If this step threw an exception, then: - + 1. [Report the exception](https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception). - 2. Set result’s [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) to "`failed`". - + 4. Otherwise, [enqueue a custom element upgrade reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-upgrade-reaction) given result and definition. - + 6. Otherwise, if definition is non-null, then: - + 1. If the synchronous custom elements flag is set, then run these steps while catching any exceptions: - + 1. Let C be definition’s [constructor](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-constructor). - 2. Set result to the result of [constructing](https://webidl.spec.whatwg.org/#construct-a-callback-function) C, with no arguments. - 3. Assert: result’s [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) and [custom element definition](https://dom.spec.whatwg.org/#concept-element-custom-element-definition) are initialized. - 4. Assert: result’s [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace). - + IDL enforces that result is an `[HTMLElement](https://html.spec.whatwg.org/multipage/dom.html#htmlelement)` object, which all use the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace). - + 5. If result’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) [is not empty](https://infra.spec.whatwg.org/#list-is-empty), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 6. If result has [children](https://dom.spec.whatwg.org/#concept-tree-child), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 7. If result’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 8. If result’s [node document](https://dom.spec.whatwg.org/#concept-node-document) is not document, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 9. If result’s [local name](https://dom.spec.whatwg.org/#concept-element-local-name) is not equal to localName, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - - 10. Set result’s [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) to prefix. - - 11. Set result’s [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) to null. - - + 10. Set result’s [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) to prefix. + + 11. Set result’s [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) to null. + If any of these steps threw an exception, then: - + 1. [Report the exception](https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception). - 2. Set result to a new [element](https://dom.spec.whatwg.org/#concept-element) that implements the `[HTMLUnknownElement](https://html.spec.whatwg.org/multipage/dom.html#htmlunknownelement)` interface, with no attributes, [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) set to the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) set to prefix, [local name](https://dom.spec.whatwg.org/#concept-element-local-name) set to localName, [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) set to "`failed`", [custom element definition](https://dom.spec.whatwg.org/#concept-element-custom-element-definition) set to null, [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) set to null, and [node document](https://dom.spec.whatwg.org/#concept-node-document) set to document. - + 2. Otherwise: - + 1. Set result to a new [element](https://dom.spec.whatwg.org/#concept-element) that implements the `[HTMLElement](https://html.spec.whatwg.org/multipage/dom.html#htmlelement)` interface, with no attributes, [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) set to the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) set to prefix, [local name](https://dom.spec.whatwg.org/#concept-element-local-name) set to localName, [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) set to "`undefined`", [custom element definition](https://dom.spec.whatwg.org/#concept-element-custom-element-definition) set to null, [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) set to null, and [node document](https://dom.spec.whatwg.org/#concept-node-document) set to document. - 2. [Enqueue a custom element upgrade reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-upgrade-reaction) given result and definition. - + 7. Otherwise: - + 1. Let interface be the [element interface](https://dom.spec.whatwg.org/#concept-element-interface) for localName and namespace. - 2. Set result to a new [element](https://dom.spec.whatwg.org/#concept-element) that implements interface, with no attributes, [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) set to namespace, [namespace prefix](https://dom.spec.whatwg.org/#concept-element-namespace-prefix) set to prefix, [local name](https://dom.spec.whatwg.org/#concept-element-local-name) set to localName, [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) set to "`uncustomized`", [custom element definition](https://dom.spec.whatwg.org/#concept-element-custom-element-definition) set to null, [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) set to is, and [node document](https://dom.spec.whatwg.org/#concept-node-document) set to document. - 3. If namespace is the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), and either localName is a [valid custom element name](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name) or is is non-null, then set result’s [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) to "`undefined`". - + 8. Return result. - [Elements](https://dom.spec.whatwg.org/#concept-element) also have an attribute list, which is a [list](https://infra.spec.whatwg.org/#list) exposed through a `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)`. Unless explicitly given when an [element](https://dom.spec.whatwg.org/#concept-element) is created, its [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) [is empty](https://infra.spec.whatwg.org/#list-is-empty). @@ -7129,86 +6642,59 @@ This and [other specifications](https://dom.spec.whatwg.org/#other-applicable-sp To handle attribute changes for an [attribute](https://dom.spec.whatwg.org/#concept-attribute) attribute with element, oldValue, and newValue, run these steps: 1. [Queue a mutation record](https://dom.spec.whatwg.org/#queue-a-mutation-record) of "`attributes`" for element with attribute’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), attribute’s [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace), oldValue, « », « », null, and null. - 2. If element is [custom](https://dom.spec.whatwg.org/#concept-element-custom), then [enqueue a custom element callback reaction](https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction) with element, callback name "`attributeChangedCallback`", and an argument list containing attribute’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), oldValue, newValue, and attribute’s [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace). - 3. Run the [attribute change steps](https://dom.spec.whatwg.org/#concept-element-attributes-change-ext) with element, attribute’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), oldValue, newValue, and attribute’s [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace). - To change an [attribute](https://dom.spec.whatwg.org/#concept-attribute) attribute to value, run these steps: 1. [Handle attribute changes](https://dom.spec.whatwg.org/#handle-attribute-changes) for attribute with attribute’s [element](https://dom.spec.whatwg.org/#concept-attribute-element), attribute’s [value](https://dom.spec.whatwg.org/#concept-attribute-value), and value. - 2. Set attribute’s [value](https://dom.spec.whatwg.org/#concept-attribute-value) to value. - To append an [attribute](https://dom.spec.whatwg.org/#concept-attribute) attribute to an [element](https://dom.spec.whatwg.org/#concept-element) element, run these steps: 1. [Handle attribute changes](https://dom.spec.whatwg.org/#handle-attribute-changes) for attribute with element, null, and attribute’s [value](https://dom.spec.whatwg.org/#concept-attribute-value). - 2. [Append](https://infra.spec.whatwg.org/#list-append) attribute to element’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute). - 3. Set attribute’s [element](https://dom.spec.whatwg.org/#concept-attribute-element) to element. - To remove an [attribute](https://dom.spec.whatwg.org/#concept-attribute) attribute, run these steps: 1. [Handle attribute changes](https://dom.spec.whatwg.org/#handle-attribute-changes) for attribute with attribute’s [element](https://dom.spec.whatwg.org/#concept-attribute-element), attribute’s [value](https://dom.spec.whatwg.org/#concept-attribute-value), and null. - 2. [Remove](https://infra.spec.whatwg.org/#list-remove) attribute from attribute’s [element](https://dom.spec.whatwg.org/#concept-attribute-element)’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute). 3. Set attribute’s [element](https://dom.spec.whatwg.org/#concept-attribute-element) to null. - To replace an [attribute](https://dom.spec.whatwg.org/#concept-attribute) oldAttr with an [attribute](https://dom.spec.whatwg.org/#concept-attribute) newAttr, run these steps: 1. [Handle attribute changes](https://dom.spec.whatwg.org/#handle-attribute-changes) for oldAttr with oldAttr’s [element](https://dom.spec.whatwg.org/#concept-attribute-element), oldAttr’s [value](https://dom.spec.whatwg.org/#concept-attribute-value), and newAttr’s [value](https://dom.spec.whatwg.org/#concept-attribute-value). - 2. [Replace](https://infra.spec.whatwg.org/#list-replace) oldAttr by newAttr in oldAttr’s [element](https://dom.spec.whatwg.org/#concept-attribute-element)’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute). - 3. Set newAttr’s [element](https://dom.spec.whatwg.org/#concept-attribute-element) to oldAttr’s [element](https://dom.spec.whatwg.org/#concept-attribute-element). - 4. Set oldAttr’s [element](https://dom.spec.whatwg.org/#concept-attribute-element) to null. - -___ +--- To get an attribute by name given a qualifiedName and [element](https://dom.spec.whatwg.org/#concept-element) element, run these steps: 1. If element is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set qualifiedName to qualifiedName in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 2. Return the first [attribute](https://dom.spec.whatwg.org/#concept-attribute) in element’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) whose [qualified name](https://dom.spec.whatwg.org/#concept-attribute-qualified-name) is qualifiedName; otherwise null. - To get an attribute by namespace and local name given a namespace, localName, and [element](https://dom.spec.whatwg.org/#concept-element) element, run these steps: 1. If namespace is the empty string, then set it to null. - 2. Return the [attribute](https://dom.spec.whatwg.org/#concept-attribute) in element’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) is namespace and [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is localName, if any; otherwise null. - To get an attribute value given an [element](https://dom.spec.whatwg.org/#concept-element) element, localName, and optionally a namespace (null unless stated otherwise), run these steps: 1. Let attr be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace) given namespace, localName, and element. - 2. If attr is null, then return the empty string. - 3. Return attr’s [value](https://dom.spec.whatwg.org/#concept-attribute-value). - To set an attribute given an attr and element, run these steps: 1. If attr’s [element](https://dom.spec.whatwg.org/#concept-attribute-element) is neither null nor element, [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InUseAttributeError](https://webidl.spec.whatwg.org/#inuseattributeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. Let oldAttr be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace) given attr’s [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace), attr’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), and element. - 3. If oldAttr is attr, return attr. - 4. If oldAttr is non-null, then [replace](https://dom.spec.whatwg.org/#concept-element-attributes-replace) oldAttr with attr. - 5. Otherwise, [append](https://dom.spec.whatwg.org/#concept-element-attributes-append) attr to element. - 6. Return oldAttr. - To set an attribute value for an [element](https://dom.spec.whatwg.org/#concept-element) element, using a localName and value, and an optional prefix, and namespace, run these steps: @@ -7217,27 +6703,20 @@ To set an attribute value for an [element](https://dom.spec.whatwg.org/#concept- 3. Let attribute be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace) given namespace, localName, and element. 4. If attribute is null, create an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) is namespace, [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix) is prefix, [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is localName, [value](https://dom.spec.whatwg.org/#concept-attribute-value) is value, and [node document](https://dom.spec.whatwg.org/#concept-node-document) is element’s [node document](https://dom.spec.whatwg.org/#concept-node-document), then [append](https://dom.spec.whatwg.org/#concept-element-attributes-append) this [attribute](https://dom.spec.whatwg.org/#concept-attribute) to element, and then return. 5. [Change](https://dom.spec.whatwg.org/#concept-element-attributes-change) attribute to value. - To remove an attribute by name given a qualifiedName and [element](https://dom.spec.whatwg.org/#concept-element) element, run these steps: 1. Let attr be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name) given qualifiedName and element. - 2. If attr is non-null, then [remove](https://dom.spec.whatwg.org/#concept-element-attributes-remove) attr. - 3. Return attr. - To remove an attribute by namespace and local name given a namespace, localName, and [element](https://dom.spec.whatwg.org/#concept-element) element, run these steps: 1. Let attr be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace) given namespace, localName, and element. - 2. If attr is non-null, then [remove](https://dom.spec.whatwg.org/#concept-element-attributes-remove) attr. - 3. Return attr. - -___ +--- An [element](https://dom.spec.whatwg.org/#concept-element) can have an associated unique identifier (ID) @@ -7246,17 +6725,15 @@ Historically [elements](https://dom.spec.whatwg.org/#concept-element) could have Use these [attribute change steps](https://dom.spec.whatwg.org/#concept-element-attributes-change-ext) to update an [element](https://dom.spec.whatwg.org/#concept-element)’s [ID](https://dom.spec.whatwg.org/#concept-id): 1. If localName is `id`, namespace is null, and value is null or the empty string, then unset element’s [ID](https://dom.spec.whatwg.org/#concept-id). - 2. Otherwise, if localName is `id`, namespace is null, then set element’s [ID](https://dom.spec.whatwg.org/#concept-id) to value. - While this specification defines requirements for `class`, `id`, and `slot` [attributes](https://dom.spec.whatwg.org/#concept-attribute) on any [element](https://dom.spec.whatwg.org/#concept-element), it makes no claims as to whether using them is conforming or not. -___ +--- A [node](https://dom.spec.whatwg.org/#concept-node)’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of type `[Element](https://dom.spec.whatwg.org/#element)` is known as its parent element. If the [node](https://dom.spec.whatwg.org/#concept-node) has a [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of a different type, its [parent element](https://dom.spec.whatwg.org/#parent-element) is null. -___ +--- [Element/namespaceURI](https://developer.mozilla.org/en-US/docs/Web/API/Element/namespaceURI "The Element.namespaceURI read-only property returns the namespace URI of the element, or null if the element is not in a namespace.") @@ -7264,15 +6741,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7286,15 +6763,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7308,15 +6785,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7330,15 +6807,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -7354,7 +6831,7 @@ The `localName` getter steps are to return [this](https://webidl.spec.whatwg.org The `tagName` getter steps are to return [this](https://webidl.spec.whatwg.org/#this)’s [HTML-uppercased qualified name](https://dom.spec.whatwg.org/#element-html-uppercased-qualified-name). -___ +--- [Element/id](https://developer.mozilla.org/en-US/docs/Web/API/Element/id "The id property of the Element interface represents the element's identifier, reflecting the id global attribute.") @@ -7362,15 +6839,15 @@ In all current engines. Firefox1+Safari1+Chrome23+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile12.1+ @@ -7384,15 +6861,15 @@ In all current engines. Firefox1+Safari1+Chrome22+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android25+Android WebView37+Samsung Internet1.5+Opera Mobile10.1+ @@ -7406,15 +6883,15 @@ In all current engines. Firefox3.6+Safari7+Chrome22+ -___ +--- Opera11.5+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android4+iOS Safari7+Chrome for Android25+Android WebView4.4+Samsung Internet1.5+Opera Mobile11.5+ @@ -7428,33 +6905,33 @@ In all current engines. Firefox63+Safari10+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ -[Global\_attributes/slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot "The slot global attribute assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot created by the element whose name attribute's value matches that slot attribute's value.") +[Global_attributes/slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot "The slot global attribute assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot created by the element whose name attribute's value matches that slot attribute's value.") In all current engines. Firefox63+Safari10+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIE? -___ +--- Firefox for Android63+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ @@ -7482,7 +6959,7 @@ The `slot` attribute must [reflect](https://dom.spec.whatwg.org/#concept-reflect `id`, `class`, and `slot` are effectively superglobal attributes as they can appear on any element, regardless of that element’s namespace. -___ +--- [Element/hasAttributes](https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttributes "The hasAttributes() method of the Element interface returns a boolean value indicating whether the current element has any attributes or not.") @@ -7490,15 +6967,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE8+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7512,15 +6989,15 @@ In all current engines. Firefox45+Safari10.1+Chrome61+ -___ +--- Opera48+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for Android45+iOS Safari10.3+Chrome for Android61+Android WebView61+Samsung Internet8.0+Opera Mobile45+ @@ -7534,15 +7011,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -7556,15 +7033,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7578,15 +7055,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -7600,15 +7077,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7622,15 +7099,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -7644,15 +7121,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7666,15 +7143,15 @@ In all current engines. Firefox63+Safari12+Chrome69+ -___ +--- Opera56+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for Android63+iOS Safari12+Chrome for Android69+Android WebView69+Samsung Internet10.0+Opera Mobile48+ @@ -7690,15 +7167,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE8+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -7712,15 +7189,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7736,15 +7213,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -7757,40 +7234,27 @@ These are not guaranteed to be unique. The `getAttribute(qualifiedName)` method steps are: 1. Let attr be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name) given qualifiedName and [this](https://webidl.spec.whatwg.org/#this). - 2. If attr is null, return null. - 3. Return attr’s [value](https://dom.spec.whatwg.org/#concept-attribute-value). - The `getAttributeNS(namespace, localName)` method steps are: 1. Let attr be the result of [getting an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace) given namespace, localName, and [this](https://webidl.spec.whatwg.org/#this). - 2. If attr is null, return null. - 3. Return attr’s [value](https://dom.spec.whatwg.org/#concept-attribute-value). - The `setAttribute(qualifiedName, value)` method steps are: 1. If qualifiedName does not match the `[Name](https://www.w3.org/TR/xml/#NT-Name)` production in XML, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If [this](https://webidl.spec.whatwg.org/#this) is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set qualifiedName to qualifiedName in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 3. Let attribute be the first [attribute](https://dom.spec.whatwg.org/#concept-attribute) in [this](https://webidl.spec.whatwg.org/#this)’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) whose [qualified name](https://dom.spec.whatwg.org/#concept-attribute-qualified-name) is qualifiedName, and null otherwise. - 4. If attribute is null, create an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is qualifiedName, [value](https://dom.spec.whatwg.org/#concept-attribute-value) is value, and [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document), then [append](https://dom.spec.whatwg.org/#concept-element-attributes-append) this [attribute](https://dom.spec.whatwg.org/#concept-attribute) to [this](https://webidl.spec.whatwg.org/#this), and then return. - 5. [Change](https://dom.spec.whatwg.org/#concept-element-attributes-change) attribute to value. - The `setAttributeNS(namespace, qualifiedName, value)` method steps are: 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to [validate and extract](https://dom.spec.whatwg.org/#validate-and-extract). - 2. [Set an attribute value](https://dom.spec.whatwg.org/#concept-element-attributes-set-value) for [this](https://webidl.spec.whatwg.org/#this) using localName, value, and also prefix and namespace. - The `removeAttribute(qualifiedName)` method steps are to [remove an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-name) given qualifiedName and [this](https://webidl.spec.whatwg.org/#this), and then return undefined. @@ -7799,36 +7263,27 @@ The `removeAttributeNS(namespace, localName)` method steps are to [remove an att The `hasAttribute(qualifiedName)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this) is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set qualifiedName to qualifiedName in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 2. Return true if [this](https://webidl.spec.whatwg.org/#this) [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [qualified name](https://dom.spec.whatwg.org/#concept-attribute-qualified-name) is qualifiedName; otherwise false. - The `toggleAttribute(qualifiedName, force)` method steps are: 1. If qualifiedName does not match the `[Name](https://www.w3.org/TR/xml/#NT-Name)` production in XML, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If [this](https://webidl.spec.whatwg.org/#this) is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then set qualifiedName to qualifiedName in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 3. Let attribute be the first [attribute](https://dom.spec.whatwg.org/#concept-attribute) in [this](https://webidl.spec.whatwg.org/#this)’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) whose [qualified name](https://dom.spec.whatwg.org/#concept-attribute-qualified-name) is qualifiedName, and null otherwise. - 4. If attribute is null, then: - + 1. If force is not given or is true, create an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is qualifiedName, [value](https://dom.spec.whatwg.org/#concept-attribute-value) is the empty string, and [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document), then [append](https://dom.spec.whatwg.org/#concept-element-attributes-append) this [attribute](https://dom.spec.whatwg.org/#concept-attribute) to [this](https://webidl.spec.whatwg.org/#this), and then return true. - 2. Return false. - + 5. Otherwise, if force is not given or is false, [remove an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-name) given qualifiedName and [this](https://webidl.spec.whatwg.org/#this), and then return false. - 6. Return true. - The `hasAttributeNS(namespace, localName)` method steps are: 1. If namespace is the empty string, then set it to null. - 2. Return true if [this](https://webidl.spec.whatwg.org/#this) [has](https://dom.spec.whatwg.org/#concept-element-attribute-has) an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) is namespace and [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is localName; otherwise false. -___ +--- [Element/getAttributeNode](https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNode "Returns the specified attribute of the specified element, as an Attr node.") @@ -7836,15 +7291,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7856,15 +7311,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7876,15 +7331,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7894,15 +7349,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -7914,28 +7369,25 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ The `removeAttributeNode(attr)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this)’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute) does not [contain](https://infra.spec.whatwg.org/#list-contain) attr, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotFoundError](https://webidl.spec.whatwg.org/#notfounderror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. [Remove](https://dom.spec.whatwg.org/#concept-element-attributes-remove) attr. - 3. Return attr. - -___ +--- [Element/attachShadow](https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow "The Element.attachShadow() method attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot.") @@ -7943,19 +7395,19 @@ In all current engines. Firefox63+Safari10+Chrome53+ -___ +--- Opera40+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ -``var shadow = element . `[attachShadow(init)](https://dom.spec.whatwg.org/#dom-element-attachshadow)` `` +`` var shadow = element . `[attachShadow(init)](https://dom.spec.whatwg.org/#dom-element-attachshadow)` `` Creates a [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) for element and returns it. @@ -7965,64 +7417,52 @@ In all current engines. Firefox63+Safari10+Chrome35+ -___ +--- Opera22+Edge79+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for Android63+iOS Safari10+Chrome for Android35+Android WebView37+Samsung Internet3.0+Opera Mobile22+ -``var shadow = element . `[shadowRoot](https://dom.spec.whatwg.org/#dom-element-shadowroot)` `` +`` var shadow = element . `[shadowRoot](https://dom.spec.whatwg.org/#dom-element-shadowroot)` `` Returns element’s [shadow root](https://dom.spec.whatwg.org/#concept-element-shadow-root), if any, and if [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root)’s [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`open`", and null otherwise. The `attachShadow(init)` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this)’s [namespace](https://dom.spec.whatwg.org/#concept-element-namespace) is not the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If [this](https://webidl.spec.whatwg.org/#this)’s [local name](https://dom.spec.whatwg.org/#concept-element-local-name) is not one of the following: - - - a [valid custom element name](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name) - - "`article`", "`aside`", "`blockquote`", "`body`", "`div`", "`footer`", "`h1`", "`h2`", "`h3`", "`h4`", "`h5`", "`h6`", "`header`", "`main`", "`nav`", "`p`", "`section`", or "`span`" - + + - a [valid custom element name](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name) + - "`article`", "`aside`", "`blockquote`", "`body`", "`div`", "`footer`", "`h1`", "`h2`", "`h3`", "`h4`", "`h5`", "`h6`", "`header`", "`main`", "`nav`", "`p`", "`section`", or "`span`" + then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + 3. If [this](https://webidl.spec.whatwg.org/#this)’s [local name](https://dom.spec.whatwg.org/#concept-element-local-name) is a [valid custom element name](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name), or [this](https://webidl.spec.whatwg.org/#this)’s [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value) is not null, then: - + 1. Let definition be the result of [looking up a custom element definition](https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition) given [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document), its [namespace](https://dom.spec.whatwg.org/#concept-element-namespace), its [local name](https://dom.spec.whatwg.org/#concept-element-local-name), and its [`is` value](https://dom.spec.whatwg.org/#concept-element-is-value). - 2. If definition is not null and definition’s [disable shadow](https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-disable-shadow) is true, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + 4. If [this](https://webidl.spec.whatwg.org/#this) is a [shadow host](https://dom.spec.whatwg.org/#element-shadow-host), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 5. Let shadow be a new [shadow root](https://dom.spec.whatwg.org/#concept-shadow-root) whose [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document), [host](https://dom.spec.whatwg.org/#concept-documentfragment-host) is [this](https://webidl.spec.whatwg.org/#this), and [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is init\["`[mode](https://dom.spec.whatwg.org/#dom-shadowrootinit-mode)`"\]. - 6. Set shadow’s [delegates focus](https://dom.spec.whatwg.org/#shadowroot-delegates-focus) to init\["`[delegatesFocus](https://dom.spec.whatwg.org/#dom-shadowrootinit-delegatesfocus)`"\]. - 7. If [this](https://webidl.spec.whatwg.org/#this)’s [custom element state](https://dom.spec.whatwg.org/#concept-element-custom-element-state) is "`precustomized`" or "`custom`", then set shadow’s [available to element internals](https://dom.spec.whatwg.org/#shadowroot-available-to-element-internals) to true. - 8. Set shadow’s [slot assignment](https://dom.spec.whatwg.org/#shadowroot-slot-assignment) to init\["`[slotAssignment](https://dom.spec.whatwg.org/#dom-shadowrootinit-slotassignment)`"\]. - 9. Set [this](https://webidl.spec.whatwg.org/#this)’s [shadow root](https://dom.spec.whatwg.org/#concept-element-shadow-root) to shadow. - -10. Return shadow. - +10. Return shadow. The `shadowRoot` getter steps are: 1. Let shadow be [this](https://webidl.spec.whatwg.org/#this)’s [shadow root](https://dom.spec.whatwg.org/#concept-element-shadow-root). - 2. If shadow is null or its [mode](https://dom.spec.whatwg.org/#shadowroot-mode) is "`closed`", then return null. - 3. Return shadow. - -___ +--- [Element/closest](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest "The closest() method traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. Will return itself or the matching ancestor. If no such element exists, it returns null.") @@ -8030,19 +7470,19 @@ In all current engines. Firefox35+Safari6+Chrome41+ -___ +--- Opera28+Edge79+ -___ +--- Edge (Legacy)15+IENone -___ +--- Firefox for Android35+iOS Safari9+Chrome for Android41+Android WebView41+Samsung Internet4.0+Opera Mobile28+ -``element . `[closest(selectors)](https://dom.spec.whatwg.org/#dom-element-closest)` `` +`` element . `[closest(selectors)](https://dom.spec.whatwg.org/#dom-element-closest)` `` Returns the first (starting at element) [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) that matches selectors, and null otherwise. @@ -8052,19 +7492,19 @@ In all current engines. Firefox34+Safari7+Chrome33+ -___ +--- Opera21+Edge79+ -___ +--- Edge (Legacy)15+IENone -___ +--- Firefox for Android34+iOS Safari8+Chrome for Android33+Android WebView4.4+Samsung Internet2.0+Opera Mobile21+ -``element . `[matches(selectors)](https://dom.spec.whatwg.org/#dom-element-matches)` `` +`` element . `[matches(selectors)](https://dom.spec.whatwg.org/#dom-element-matches)` `` Returns true if matching selectors against element’s [root](https://dom.spec.whatwg.org/#concept-tree-root) yields element; otherwise false. @@ -8079,13 +7519,10 @@ The `closest(selectors)` method steps are: The `matches(selectors)` and `webkitMatchesSelector(selectors)` method steps are: 1. Let s be the result of [parse a selector](https://drafts.csswg.org/selectors-4/#parse-a-selector) from selectors. [\[SELECTORS4\]](https://dom.spec.whatwg.org/#biblio-selectors4) - 2. If s is failure, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. If the result of [match a selector against an element](https://drafts.csswg.org/selectors-4/#match-a-selector-against-an-element), using s, [this](https://webidl.spec.whatwg.org/#this), and [:scope element](https://drafts.csswg.org/selectors-4/#scope-element) [this](https://webidl.spec.whatwg.org/#this), returns success, then return true; otherwise, return false. [\[SELECTORS4\]](https://dom.spec.whatwg.org/#biblio-selectors4) - -___ +--- [Element/getElementsByTagName](https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName "The Element.getElementsByTagName() method returns a live HTMLCollection of elements with the given tag name.") @@ -8093,15 +7530,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -8113,15 +7550,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8129,7 +7566,7 @@ The `getElementsByTagNameNS(namespace, localName)` method steps are to return th The `getElementsByClassName(classNames)` method steps are to return the [list of elements with class names classNames](https://dom.spec.whatwg.org/#concept-getelementsbyclassname) for [this](https://webidl.spec.whatwg.org/#this). -___ +--- To insert adjacent, given an [element](https://dom.spec.whatwg.org/#concept-element) element, string where, and a [node](https://dom.spec.whatwg.org/#concept-node) node, run the steps associated with the first [ASCII case-insensitive](https://infra.spec.whatwg.org/#ascii-case-insensitive) match for where: @@ -8163,15 +7600,15 @@ In all current engines. Firefox48+Safari3+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android48+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -8183,24 +7620,22 @@ In all current engines. Firefox48+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android48+iOS Safari4+Chrome for Android18+Android WebView2.2+Samsung Internet1.0+Opera Mobile12.1+ The `insertAdjacentText(where, data)` method steps are: 1. Let text be a new `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) whose [data](https://dom.spec.whatwg.org/#concept-cd-data) is data and [node document](https://dom.spec.whatwg.org/#concept-node-document) is [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. Run [insert adjacent](https://dom.spec.whatwg.org/#insert-adjacent), given [this](https://webidl.spec.whatwg.org/#this), where, and text. - This method returns nothing because it existed before we had a chance to design it. @@ -8212,36 +7647,36 @@ In all current engines. Firefox34+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android34+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window, - [LegacyUnenumerableNamedProperties](https://webidl.spec.whatwg.org/#LegacyUnenumerableNamedProperties)\] +[LegacyUnenumerableNamedProperties](https://webidl.spec.whatwg.org/#LegacyUnenumerableNamedProperties)\] interface `NamedNodeMap` { - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-namednodemap-length); - getter [Attr](https://dom.spec.whatwg.org/#attr)? [item](https://dom.spec.whatwg.org/#dom-namednodemap-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-namednodemap-item-index-index)); - getter [Attr](https://dom.spec.whatwg.org/#attr)? [getNamedItem](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditem)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditem-qualifiedname-qualifiedname)); - [Attr](https://dom.spec.whatwg.org/#attr)? [getNamedItemNS](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns-namespace-localname-localname)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setNamedItem](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditem)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditem-attr-attr)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setNamedItemNS](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditemns)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditemns-attr-attr)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr) [removeNamedItem](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem-qualifiedname-qualifiedname)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr) [removeNamedItemNS](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns-namespace-localname-localname)); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-namednodemap-length); +getter [Attr](https://dom.spec.whatwg.org/#attr)? [item](https://dom.spec.whatwg.org/#dom-namednodemap-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-namednodemap-item-index-index)); +getter [Attr](https://dom.spec.whatwg.org/#attr)? [getNamedItem](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditem)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditem-qualifiedname-qualifiedname)); +[Attr](https://dom.spec.whatwg.org/#attr)? [getNamedItemNS](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-namednodemap-getnameditemns-namespace-localname-localname)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setNamedItem](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditem)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditem-attr-attr)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr)? [setNamedItemNS](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditemns)([Attr](https://dom.spec.whatwg.org/#attr) `attr`[](https://dom.spec.whatwg.org/#dom-namednodemap-setnameditemns-attr-attr)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr) [removeNamedItem](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `qualifiedName`[](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem-qualifiedname-qualifiedname)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Attr](https://dom.spec.whatwg.org/#attr) [removeNamedItemNS](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `namespace`[](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns-namespace-localname-namespace), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns-namespace-localname-localname)); }; A `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)` has an associated element (an [element](https://dom.spec.whatwg.org/#concept-element)). A `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)` object’s attribute list is its [element](https://dom.spec.whatwg.org/#concept-namednodemap-element)’s [attribute list](https://dom.spec.whatwg.org/#concept-element-attribute). -___ +--- A `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)` object’s [supported property indices](https://webidl.spec.whatwg.org/#dfn-supported-property-indices) are the numbers in the range zero to its [attribute list](https://dom.spec.whatwg.org/#concept-namednodemap-attribute)’s [size](https://infra.spec.whatwg.org/#list-size) minus one, unless the [attribute list](https://dom.spec.whatwg.org/#concept-namednodemap-attribute) [is empty](https://infra.spec.whatwg.org/#list-is-empty), in which case there are no [supported property indices](https://webidl.spec.whatwg.org/#dfn-supported-property-indices). @@ -8250,22 +7685,17 @@ The `length` getter steps are to return the [attribute list](https://dom.spec.wh The `item(index)` method steps are: 1. If index is equal to or greater than [this](https://webidl.spec.whatwg.org/#this)’s [attribute list](https://dom.spec.whatwg.org/#concept-namednodemap-attribute)’s [size](https://infra.spec.whatwg.org/#list-size), then return null. - 2. Otherwise, return [this](https://webidl.spec.whatwg.org/#this)’s [attribute list](https://dom.spec.whatwg.org/#concept-namednodemap-attribute)\[index\]. - A `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)` object’s [supported property names](https://webidl.spec.whatwg.org/#dfn-supported-property-names) are the return value of running these steps: 1. Let names be the [qualified names](https://dom.spec.whatwg.org/#concept-attribute-qualified-name) of the [attributes](https://dom.spec.whatwg.org/#concept-attribute) in this `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)` object’s [attribute list](https://dom.spec.whatwg.org/#concept-namednodemap-attribute), with duplicates omitted, in order. - 2. If this `[NamedNodeMap](https://dom.spec.whatwg.org/#namednodemap)` object’s [element](https://dom.spec.whatwg.org/#concept-namednodemap-element) is in the [HTML namespace](https://infra.spec.whatwg.org/#html-namespace) and its [node document](https://dom.spec.whatwg.org/#concept-node-document) is an [HTML document](https://dom.spec.whatwg.org/#html-document), then [for each](https://infra.spec.whatwg.org/#list-iterate) name in names: - + 1. Let lowercaseName be name, in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 2. If lowercaseName is not equal to name, remove name from names. - + 3. Return names. - [NamedNodeMap/getNamedItem](https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap/getNamedItem "The getNamedItem() method of the NamedNodeMap interface returns the Attr corresponding to the given name, or null if there is no corresponding attribute.") @@ -8273,15 +7703,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8294,20 +7724,14 @@ The `setNamedItem(attr)` and `setNamedItemNS(attr)` method steps are to return t The `removeNamedItem(qualifiedName)` method steps are: 1. Let attr be the result of [removing an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-name) given qualifiedName and [element](https://dom.spec.whatwg.org/#concept-namednodemap-element). - 2. If attr is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotFoundError](https://webidl.spec.whatwg.org/#notfounderror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. Return attr. - The `removeNamedItemNS(namespace, localName)` method steps are: 1. Let attr be the result of [removing an attribute](https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-namespace) given namespace, localName, and [element](https://dom.spec.whatwg.org/#concept-namednodemap-element). - 2. If attr is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotFoundError](https://webidl.spec.whatwg.org/#notfounderror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. Return attr. - #### 4.9.2. Interface `[Attr](https://dom.spec.whatwg.org/#attr)`[](https://dom.spec.whatwg.org/#interface-attr) @@ -8317,29 +7741,29 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera8+Edge79+ -___ +--- Edge (Legacy)12+IE5.5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `Attr` : [Node](https://dom.spec.whatwg.org/#node) { - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [namespaceURI](https://dom.spec.whatwg.org/#dom-attr-namespaceuri); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [prefix](https://dom.spec.whatwg.org/#dom-attr-prefix); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [localName](https://dom.spec.whatwg.org/#dom-attr-localname); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [name](https://dom.spec.whatwg.org/#dom-attr-name); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [value](https://dom.spec.whatwg.org/#dom-attr-value); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [namespaceURI](https://dom.spec.whatwg.org/#dom-attr-namespaceuri); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [prefix](https://dom.spec.whatwg.org/#dom-attr-prefix); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [localName](https://dom.spec.whatwg.org/#dom-attr-localname); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [name](https://dom.spec.whatwg.org/#dom-attr-name); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [value](https://dom.spec.whatwg.org/#dom-attr-value); - readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [ownerElement](https://dom.spec.whatwg.org/#dom-attr-ownerelement); +readonly attribute [Element](https://dom.spec.whatwg.org/#element)? [ownerElement](https://dom.spec.whatwg.org/#dom-attr-ownerelement); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [specified](https://dom.spec.whatwg.org/#dom-attr-specified); // useless; always returns true +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [specified](https://dom.spec.whatwg.org/#dom-attr-specified); // useless; always returns true }; `[Attr](https://dom.spec.whatwg.org/#attr)` [nodes](https://dom.spec.whatwg.org/#concept-node) are simply known as attributes. They are sometimes referred to as _content attributes_ to avoid confusion with IDL attributes. @@ -8356,7 +7780,7 @@ When an [attribute](https://dom.spec.whatwg.org/#concept-attribute) is created, An `A` attribute is an [attribute](https://dom.spec.whatwg.org/#concept-attribute) whose [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) is `A` and whose [namespace](https://dom.spec.whatwg.org/#concept-attribute-namespace) and [namespace prefix](https://dom.spec.whatwg.org/#concept-attribute-namespace-prefix) are null. -___ +--- [Attr/namespaceURI](https://developer.mozilla.org/en-US/docs/Web/API/Attr/namespaceURI "The Attr.namespaceURI read-only property returns the namespace URI of the attribute, or null if the element is not in a namespace.") @@ -8364,15 +7788,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8384,15 +7808,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8404,15 +7828,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8425,17 +7849,15 @@ The `value` getter steps are to return [this](https://webidl.spec.whatwg.org/#th To set an existing attribute value, given an [attribute](https://dom.spec.whatwg.org/#concept-attribute) attribute and string value, run these steps: 1. If attribute’s [element](https://dom.spec.whatwg.org/#concept-attribute-element) is null, then set attribute’s [value](https://dom.spec.whatwg.org/#concept-attribute-value) to value. - 2. Otherwise, [change](https://dom.spec.whatwg.org/#concept-element-attributes-change) attribute to value. - The `[value](https://dom.spec.whatwg.org/#dom-attr-value)` setter steps are to [set an existing attribute value](https://dom.spec.whatwg.org/#set-an-existing-attribute-value) with [this](https://webidl.spec.whatwg.org/#this) and the given value. -___ +--- The `ownerElement` getter steps are to return [this](https://webidl.spec.whatwg.org/#this)’s [element](https://dom.spec.whatwg.org/#concept-attribute-element). -___ +--- The `specified` getter steps are to return true. @@ -8447,27 +7869,27 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `CharacterData` : [Node](https://dom.spec.whatwg.org/#node) { - attribute \[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [data](https://dom.spec.whatwg.org/#dom-characterdata-data); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-characterdata-length); - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [substringData](https://dom.spec.whatwg.org/#dom-characterdata-substringdata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-substringdata-offset-count-offset), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `count`[](https://dom.spec.whatwg.org/#dom-characterdata-substringdata-offset-count-count)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [appendData](https://dom.spec.whatwg.org/#dom-characterdata-appenddata)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-characterdata-appenddata-data-data)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [insertData](https://dom.spec.whatwg.org/#dom-characterdata-insertdata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-insertdata-offset-data-offset), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-characterdata-insertdata-offset-data-data)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [deleteData](https://dom.spec.whatwg.org/#dom-characterdata-deletedata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-deletedata-offset-count-offset), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `count`[](https://dom.spec.whatwg.org/#dom-characterdata-deletedata-offset-count-count)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [replaceData](https://dom.spec.whatwg.org/#dom-characterdata-replacedata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-replacedata-offset-count-data-offset), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `count`[](https://dom.spec.whatwg.org/#dom-characterdata-replacedata-offset-count-data-count), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-characterdata-replacedata-offset-count-data-data)); +attribute \[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [data](https://dom.spec.whatwg.org/#dom-characterdata-data); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-characterdata-length); +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [substringData](https://dom.spec.whatwg.org/#dom-characterdata-substringdata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-substringdata-offset-count-offset), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `count`[](https://dom.spec.whatwg.org/#dom-characterdata-substringdata-offset-count-count)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [appendData](https://dom.spec.whatwg.org/#dom-characterdata-appenddata)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-characterdata-appenddata-data-data)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [insertData](https://dom.spec.whatwg.org/#dom-characterdata-insertdata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-insertdata-offset-data-offset), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-characterdata-insertdata-offset-data-data)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [deleteData](https://dom.spec.whatwg.org/#dom-characterdata-deletedata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-deletedata-offset-count-offset), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `count`[](https://dom.spec.whatwg.org/#dom-characterdata-deletedata-offset-count-count)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [replaceData](https://dom.spec.whatwg.org/#dom-characterdata-replacedata)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-characterdata-replacedata-offset-count-data-offset), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `count`[](https://dom.spec.whatwg.org/#dom-characterdata-replacedata-offset-count-data-count), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-characterdata-replacedata-offset-count-data-data)); }; `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` is an abstract interface. You cannot get a direct instance of it. It is used by `[Text](https://dom.spec.whatwg.org/#text)`, `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)`, and `[Comment](https://dom.spec.whatwg.org/#comment)` [nodes](https://dom.spec.whatwg.org/#concept-node). @@ -8480,19 +7902,16 @@ To replace data of node node with offset offset, count count, and data data, run 2. If offset is greater than length, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[IndexSizeError](https://webidl.spec.whatwg.org/#indexsizeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. 3. If offset plus count is greater than length, then set count to length minus offset. 4. [Queue a mutation record](https://dom.spec.whatwg.org/#queue-a-mutation-record) of "`characterData`" for node with null, null, node’s [data](https://dom.spec.whatwg.org/#concept-cd-data), « », « », null, and null. - 5. Insert data into node’s [data](https://dom.spec.whatwg.org/#concept-cd-data) after offset [code units](https://infra.spec.whatwg.org/#code-unit). 6. Let delete offset be offset + data’s [length](https://infra.spec.whatwg.org/#string-length). 7. Starting from delete offset [code units](https://infra.spec.whatwg.org/#code-unit), remove count [code units](https://infra.spec.whatwg.org/#code-unit) from node’s [data](https://dom.spec.whatwg.org/#concept-cd-data). 8. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is node and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is greater than offset but less than or equal to offset plus count, set its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) to offset. - 9. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is node and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is greater than offset but less than or equal to offset plus count, set its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) to offset. - -10. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is node and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is greater than offset plus count, increase its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) by data’s [length](https://infra.spec.whatwg.org/#string-length) and decrease it by count. - -11. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is node and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is greater than offset plus count, increase its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) by data’s [length](https://infra.spec.whatwg.org/#string-length) and decrease it by count. - -12. If node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is non-null, then run the [children changed steps](https://dom.spec.whatwg.org/#concept-node-children-changed-ext) for node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). +10. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is node and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is greater than offset plus count, increase its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) by data’s [length](https://infra.spec.whatwg.org/#string-length) and decrease it by count. + +11. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is node and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is greater than offset plus count, increase its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) by data’s [length](https://infra.spec.whatwg.org/#string-length) and decrease it by count. + +12. If node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is non-null, then run the [children changed steps](https://dom.spec.whatwg.org/#concept-node-children-changed-ext) for node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). To substring data with node node, offset offset, and count count, run these steps: @@ -8507,15 +7926,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8527,15 +7946,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8547,15 +7966,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8567,15 +7986,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8587,15 +8006,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8607,15 +8026,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8627,15 +8046,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE6+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8649,24 +8068,24 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `Text` : [CharacterData](https://dom.spec.whatwg.org/#characterdata) { - [constructor](https://dom.spec.whatwg.org/#dom-text-text)(optional [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-text-text-data-data) = ""); +[constructor](https://dom.spec.whatwg.org/#dom-text-text)(optional [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `data`[](https://dom.spec.whatwg.org/#dom-text-text-data-data) = ""); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Text](https://dom.spec.whatwg.org/#text) [splitText](https://dom.spec.whatwg.org/#dom-text-splittext)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-text-splittext-offset-offset)); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [wholeText](https://dom.spec.whatwg.org/#dom-text-wholetext); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Text](https://dom.spec.whatwg.org/#text) [splitText](https://dom.spec.whatwg.org/#dom-text-splittext)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-text-splittext-offset-offset)); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [wholeText](https://dom.spec.whatwg.org/#dom-text-wholetext); }; [Text/Text](https://developer.mozilla.org/en-US/docs/Web/API/Text/Text "The Text() constructor returns a new Text object with the optional string given in parameter as its textual content.") @@ -8675,15 +8094,15 @@ In all current engines. Firefox24+Safari8+Chrome28+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android24+iOS Safari8+Chrome for Android28+Android WebView37+Samsung Internet2.0+Opera Mobile14+ @@ -8697,19 +8116,19 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE5+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes -``text . `[splitText(offset)](https://dom.spec.whatwg.org/#dom-text-splittext)` `` +`` text . `[splitText(offset)](https://dom.spec.whatwg.org/#dom-text-splittext)` `` Splits [data](https://dom.spec.whatwg.org/#concept-cd-data) at the given offset and returns the remainder as `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node). @@ -8719,23 +8138,23 @@ In all current engines. Firefox3.5+Safari4+Chrome1+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3.2+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes -``text . `[wholeText](https://dom.spec.whatwg.org/#dom-text-wholetext)` `` +`` text . `[wholeText](https://dom.spec.whatwg.org/#dom-text-wholetext)` `` Returns the combined [data](https://dom.spec.whatwg.org/#concept-cd-data) of all direct `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) [siblings](https://dom.spec.whatwg.org/#concept-tree-sibling). -___ +--- An exclusive `[Text](https://dom.spec.whatwg.org/#text)` node is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) that is not a `[CDATASection](https://dom.spec.whatwg.org/#cdatasection)` [node](https://dom.spec.whatwg.org/#concept-node). @@ -8747,7 +8166,7 @@ The child text content[](https://dom.spec.whatwg.org/#concept-child-text-content The descendant text content of a [node](https://dom.spec.whatwg.org/#concept-node) node is the [concatenation](https://infra.spec.whatwg.org/#string-concatenate) of the [data](https://dom.spec.whatwg.org/#concept-cd-data) of all the `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) [descendants](https://dom.spec.whatwg.org/#concept-tree-descendant) of node, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). -___ +--- The `new Text(data)` constructor steps are to set [this](https://webidl.spec.whatwg.org/#this)’s [data](https://dom.spec.whatwg.org/#concept-cd-data) to data and [this](https://webidl.spec.whatwg.org/#this)’s [node document](https://dom.spec.whatwg.org/#concept-node-document) to [current global object](https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object)’s [associated `Document`](https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window). @@ -8760,17 +8179,13 @@ To split a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.w 5. Let new node be a new `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node), with the same [node document](https://dom.spec.whatwg.org/#concept-node-document) as node. Set new node’s [data](https://dom.spec.whatwg.org/#concept-cd-data) to new data. 6. Let parent be node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). 7. If parent is not null, then: - + 1. [Insert](https://dom.spec.whatwg.org/#concept-node-insert) new node into parent before node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - 2. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is node and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is greater than offset, set its [start node](https://dom.spec.whatwg.org/#concept-range-start-node) to new node and decrease its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) by offset. - 3. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is node and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is greater than offset, set its [end node](https://dom.spec.whatwg.org/#concept-range-end-node) to new node and decrease its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) by offset. - 4. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is parent and [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is equal to the [index](https://dom.spec.whatwg.org/#concept-tree-index) of node plus 1, increase its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) by 1. - 5. For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is parent and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is equal to the [index](https://dom.spec.whatwg.org/#concept-tree-index) of node plus 1, increase its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) by 1. - + 8. [Replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node node, offset offset, count count, and data the empty string. 9. Return new node. @@ -8786,15 +8201,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ @@ -8810,21 +8225,21 @@ In all current engines. Firefox1+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `ProcessingInstruction` : [CharacterData](https://dom.spec.whatwg.org/#characterdata) { - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [target](https://dom.spec.whatwg.org/#dom-processinginstruction-target); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [target](https://dom.spec.whatwg.org/#dom-processinginstruction-target); }; `[ProcessingInstruction](https://dom.spec.whatwg.org/#processinginstruction)` [nodes](https://dom.spec.whatwg.org/#concept-node) have an associated target. @@ -8835,15 +8250,15 @@ In all current engines. Firefox1+Safari4+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -8855,21 +8270,21 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for AndroidYesiOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] -interface : [CharacterData](https://dom.spec.whatwg.org/#characterdata) { - [constructor](https://dom.spec.whatwg.org/#dom-comment-comment)(optional [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) = ""); +interface : [CharacterData](https://dom.spec.whatwg.org/#characterdata) { +[constructor](https://dom.spec.whatwg.org/#dom-comment-comment)(optional [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) = ""); }; [Comment/Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment/Comment "The Comment() constructor returns a newly created Comment object with the optional string given in parameter as its textual content.") @@ -8878,15 +8293,15 @@ In all current engines. Firefox24+Safari7+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)16+IENone -___ +--- Firefox for Android24+iOS Safari7+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -8904,12 +8319,12 @@ The constructor steps are to set [this](https://webidl.spec.whatwg.org/#this)’ [Ranges](https://dom.spec.whatwg.org/#concept-range) are frequently used in editing for selecting and copying content. -- `[Element](https://dom.spec.whatwg.org/#element)`: `p` - - `[Element](https://dom.spec.whatwg.org/#element)`: `Little-endian BOM; decode as big-endian!` - - `[Text](https://dom.spec.whatwg.org/#text)`: CSS 2.1 syndata is - - `[Element](https://dom.spec.whatwg.org/#element)`: `` - - `[Text](https://dom.spec.whatwg.org/#text)`: awesome - - `[Text](https://dom.spec.whatwg.org/#text)`: ! +- `[Element](https://dom.spec.whatwg.org/#element)`: `p` + - `[Element](https://dom.spec.whatwg.org/#element)`: `Little-endian BOM; decode as big-endian!` + - `[Text](https://dom.spec.whatwg.org/#text)`: CSS 2.1 syndata is + - `[Element](https://dom.spec.whatwg.org/#element)`: `` + - `[Text](https://dom.spec.whatwg.org/#text)`: awesome + - `[Text](https://dom.spec.whatwg.org/#text)`: ! In the [node tree](https://dom.spec.whatwg.org/#concept-node-tree) above, a [range](https://dom.spec.whatwg.org/#concept-range) can be used to represent the sequence “syndata is awes”. Assuming p is assigned to the `p` [element](https://dom.spec.whatwg.org/#concept-element), and em to the `em` [element](https://dom.spec.whatwg.org/#concept-element), this would be done as follows: @@ -8941,20 +8356,15 @@ A correct [boundary point](https://dom.spec.whatwg.org/#concept-range-bp)’s [o The position of a [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (nodeA, offsetA) relative to a [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (nodeB, offsetB) is before, equal, or after, as returned by these steps: 1. Assert: nodeA and nodeB have the same [root](https://dom.spec.whatwg.org/#concept-tree-root). - 2. If nodeA is nodeB, then return [equal](https://dom.spec.whatwg.org/#concept-range-bp-equal) if offsetA is offsetB, [before](https://dom.spec.whatwg.org/#concept-range-bp-before) if offsetA is less than offsetB, and [after](https://dom.spec.whatwg.org/#concept-range-bp-after) if offsetA is greater than offsetB. 3. If nodeA is [following](https://dom.spec.whatwg.org/#concept-tree-following) nodeB, then if the [position](https://dom.spec.whatwg.org/#concept-range-bp-position) of (nodeB, offsetB) relative to (nodeA, offsetA) is [before](https://dom.spec.whatwg.org/#concept-range-bp-before), return [after](https://dom.spec.whatwg.org/#concept-range-bp-after), and if it is [after](https://dom.spec.whatwg.org/#concept-range-bp-after), return [before](https://dom.spec.whatwg.org/#concept-range-bp-before). - 4. If nodeA is an [ancestor](https://dom.spec.whatwg.org/#concept-tree-ancestor) of nodeB: - + 1. Let child be nodeB. - 2. While child is not a [child](https://dom.spec.whatwg.org/#concept-tree-child) of nodeA, set child to its [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 3. If child’s [index](https://dom.spec.whatwg.org/#concept-tree-index) is less than offsetA, then return [after](https://dom.spec.whatwg.org/#concept-range-bp-after). - + 5. Return [before](https://dom.spec.whatwg.org/#concept-range-bp-before). - ### 5.3. Interface `[AbstractRange](https://dom.spec.whatwg.org/#abstractrange)`[](https://dom.spec.whatwg.org/#interface-abstractrange) @@ -8964,25 +8374,25 @@ In all current engines. Firefox69+Safari14.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari14.5+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `AbstractRange` { - readonly attribute [Node](https://dom.spec.whatwg.org/#node) [startContainer](https://dom.spec.whatwg.org/#dom-range-startcontainer); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [startOffset](https://dom.spec.whatwg.org/#dom-range-startoffset); - readonly attribute [Node](https://dom.spec.whatwg.org/#node) [endContainer](https://dom.spec.whatwg.org/#dom-range-endcontainer); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [endOffset](https://dom.spec.whatwg.org/#dom-range-endoffset); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [collapsed](https://dom.spec.whatwg.org/#dom-range-collapsed); +readonly attribute [Node](https://dom.spec.whatwg.org/#node) [startContainer](https://dom.spec.whatwg.org/#dom-range-startcontainer); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [startOffset](https://dom.spec.whatwg.org/#dom-range-startoffset); +readonly attribute [Node](https://dom.spec.whatwg.org/#node) [endContainer](https://dom.spec.whatwg.org/#dom-range-endcontainer); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [endOffset](https://dom.spec.whatwg.org/#dom-range-endoffset); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [collapsed](https://dom.spec.whatwg.org/#dom-range-collapsed); }; Objects implementing the `[AbstractRange](https://dom.spec.whatwg.org/#abstractrange)` interface are known as ranges. @@ -8999,15 +8409,15 @@ In all current engines. Firefox69+Safari14.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari14.5+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ @@ -9017,15 +8427,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9035,15 +8445,15 @@ In all current engines. Firefox69+Safari10.1+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ @@ -9057,15 +8467,15 @@ In all current engines. Firefox69+Safari14.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari14.5+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ @@ -9075,15 +8485,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9093,15 +8503,15 @@ In all current engines. Firefox69+Safari10.1+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ @@ -9115,15 +8525,15 @@ In all current engines. Firefox69+Safari14.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari14.5+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ @@ -9133,15 +8543,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9151,15 +8561,15 @@ In all current engines. Firefox69+Safari10.1+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ @@ -9173,15 +8583,15 @@ In all current engines. Firefox69+Safari14.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari14.5+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ @@ -9191,15 +8601,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9209,15 +8619,15 @@ In all current engines. Firefox69+Safari10.1+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ @@ -9231,15 +8641,15 @@ In all current engines. Firefox69+Safari14.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari14.5+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ @@ -9249,15 +8659,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9267,15 +8677,15 @@ In all current engines. Firefox69+Safari10.1+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ @@ -9301,28 +8711,28 @@ In all current engines. Firefox69+Safari10.1+Chrome60+ -___ +--- Opera47+Edge79+ -___ +--- Edge (Legacy)18IENone -___ +--- Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+ dictionary `StaticRangeInit` { - required [Node](https://dom.spec.whatwg.org/#node) `startContainer`; - required [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `startOffset`; - required [Node](https://dom.spec.whatwg.org/#node) `endContainer`; - required [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `endOffset`; +required [Node](https://dom.spec.whatwg.org/#node) `startContainer`; +required [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `startOffset`; +required [Node](https://dom.spec.whatwg.org/#node) `endContainer`; +required [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `endOffset`; }; \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `StaticRange` : [AbstractRange](https://dom.spec.whatwg.org/#abstractrange) { - [constructor](https://dom.spec.whatwg.org/#dom-staticrange-staticrange)([StaticRangeInit](https://dom.spec.whatwg.org/#dictdef-staticrangeinit) `init`[](https://dom.spec.whatwg.org/#dom-staticrange-staticrange-init-init)); +[constructor](https://dom.spec.whatwg.org/#dom-staticrange-staticrange)([StaticRangeInit](https://dom.spec.whatwg.org/#dictdef-staticrangeinit) `init`[](https://dom.spec.whatwg.org/#dom-staticrange-staticrange-init-init)); }; [StaticRange/StaticRange](https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/StaticRange "The StaticRange() constructor creates a new StaticRange object representing a span of content within the DOM.") @@ -9331,15 +8741,15 @@ In all current engines. Firefox71+Safari13.1+Chrome90+ -___ +--- Opera76+Edge90+ -___ +--- Edge (Legacy)NoneIENone -___ +--- Firefox for AndroidNoneiOS Safari13.4+Chrome for Android90+Android WebView90+Samsung Internet15.0+Opera Mobile64+ @@ -9350,20 +8760,14 @@ Returns a new [range](https://dom.spec.whatwg.org/#concept-range) object that do The `new StaticRange(init)` constructor steps are: 1. If init\["`[startContainer](https://dom.spec.whatwg.org/#dom-staticrangeinit-startcontainer)`"\] or init\["`[endContainer](https://dom.spec.whatwg.org/#dom-staticrangeinit-endcontainer)`"\] is a `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` or `[Attr](https://dom.spec.whatwg.org/#attr)` [node](https://dom.spec.whatwg.org/#concept-node), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidNodeTypeError](https://webidl.spec.whatwg.org/#invalidnodetypeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. Set [this](https://webidl.spec.whatwg.org/#this)’s [start](https://dom.spec.whatwg.org/#concept-range-start) to (init\["`[startContainer](https://dom.spec.whatwg.org/#dom-staticrangeinit-startcontainer)`"\], init\["`[startOffset](https://dom.spec.whatwg.org/#dom-staticrangeinit-startoffset)`"\]) and [end](https://dom.spec.whatwg.org/#concept-range-end) to (init\["`[endContainer](https://dom.spec.whatwg.org/#dom-staticrangeinit-endcontainer)`"\], init\["`[endOffset](https://dom.spec.whatwg.org/#dom-staticrangeinit-endoffset)`"\]). - A `[StaticRange](https://dom.spec.whatwg.org/#staticrange)` is valid[](https://dom.spec.whatwg.org/#staticrange-valid) if all of the following are true: -- Its [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) are in the same [node tree](https://dom.spec.whatwg.org/#concept-node-tree). - -- Its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is between 0 and its [start node](https://dom.spec.whatwg.org/#concept-range-start-node)’s [length](https://dom.spec.whatwg.org/#concept-node-length), inclusive. - -- Its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is between 0 and its [end node](https://dom.spec.whatwg.org/#concept-range-end-node)’s [length](https://dom.spec.whatwg.org/#concept-node-length), inclusive. - -- Its [start](https://dom.spec.whatwg.org/#concept-range-start) is [before](https://dom.spec.whatwg.org/#concept-range-bp-before) or [equal](https://dom.spec.whatwg.org/#concept-range-bp-equal) to its [end](https://dom.spec.whatwg.org/#concept-range-end). - +- Its [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) are in the same [node tree](https://dom.spec.whatwg.org/#concept-node-tree). +- Its [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) is between 0 and its [start node](https://dom.spec.whatwg.org/#concept-range-start-node)’s [length](https://dom.spec.whatwg.org/#concept-node-length), inclusive. +- Its [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) is between 0 and its [end node](https://dom.spec.whatwg.org/#concept-range-end-node)’s [length](https://dom.spec.whatwg.org/#concept-node-length), inclusive. +- Its [start](https://dom.spec.whatwg.org/#concept-range-start) is [before](https://dom.spec.whatwg.org/#concept-range-bp-before) or [equal](https://dom.spec.whatwg.org/#concept-range-bp-equal) to its [end](https://dom.spec.whatwg.org/#concept-range-end). ### 5.5. Interface `[Range](https://dom.spec.whatwg.org/#range)`[](https://dom.spec.whatwg.org/#interface-range) @@ -9373,55 +8777,55 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `Range` : [AbstractRange](https://dom.spec.whatwg.org/#abstractrange) { - [constructor](https://dom.spec.whatwg.org/#dom-range-range)(); +[constructor](https://dom.spec.whatwg.org/#dom-range-range)(); - readonly attribute [Node](https://dom.spec.whatwg.org/#node) [commonAncestorContainer](https://dom.spec.whatwg.org/#dom-range-commonancestorcontainer); +readonly attribute [Node](https://dom.spec.whatwg.org/#node) [commonAncestorContainer](https://dom.spec.whatwg.org/#dom-range-commonancestorcontainer); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setStart](https://dom.spec.whatwg.org/#dom-range-setstart)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setstart-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-setstart-node-offset-offset)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setEnd](https://dom.spec.whatwg.org/#dom-range-setend)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setend-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-setend-node-offset-offset)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setStartBefore](https://dom.spec.whatwg.org/#dom-range-setstartbefore)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setstartbefore-node-node)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setStartAfter](https://dom.spec.whatwg.org/#dom-range-setstartafter)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setstartafter-node-node)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setEndBefore](https://dom.spec.whatwg.org/#dom-range-setendbefore)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setendbefore-node-node)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setEndAfter](https://dom.spec.whatwg.org/#dom-range-setendafter)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setendafter-node-node)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [collapse](https://dom.spec.whatwg.org/#dom-range-collapse)(optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `toStart`[](https://dom.spec.whatwg.org/#dom-range-collapse-tostart-tostart) = false); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [selectNode](https://dom.spec.whatwg.org/#dom-range-selectnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-selectnode-node-node)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [selectNodeContents](https://dom.spec.whatwg.org/#dom-range-selectnodecontents)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-selectnodecontents-node-node)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setStart](https://dom.spec.whatwg.org/#dom-range-setstart)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setstart-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-setstart-node-offset-offset)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setEnd](https://dom.spec.whatwg.org/#dom-range-setend)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setend-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-setend-node-offset-offset)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setStartBefore](https://dom.spec.whatwg.org/#dom-range-setstartbefore)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setstartbefore-node-node)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setStartAfter](https://dom.spec.whatwg.org/#dom-range-setstartafter)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setstartafter-node-node)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setEndBefore](https://dom.spec.whatwg.org/#dom-range-setendbefore)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setendbefore-node-node)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [setEndAfter](https://dom.spec.whatwg.org/#dom-range-setendafter)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-setendafter-node-node)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [collapse](https://dom.spec.whatwg.org/#dom-range-collapse)(optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `toStart`[](https://dom.spec.whatwg.org/#dom-range-collapse-tostart-tostart) = false); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [selectNode](https://dom.spec.whatwg.org/#dom-range-selectnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-selectnode-node-node)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [selectNodeContents](https://dom.spec.whatwg.org/#dom-range-selectnodecontents)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-selectnodecontents-node-node)); - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `START_TO_START` = 0; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `START_TO_END` = 1; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `END_TO_END` = 2; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `END_TO_START` = 3; - [short](https://webidl.spec.whatwg.org/#idl-short) [compareBoundaryPoints](https://dom.spec.whatwg.org/#dom-range-compareboundarypoints)([unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `how`[](https://dom.spec.whatwg.org/#dom-range-compareboundarypoints-how-sourcerange-how), [Range](https://dom.spec.whatwg.org/#range) `sourceRange`[](https://dom.spec.whatwg.org/#dom-range-compareboundarypoints-how-sourcerange-sourcerange)); +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `START_TO_START` = 0; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `START_TO_END` = 1; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `END_TO_END` = 2; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `END_TO_START` = 3; +[short](https://webidl.spec.whatwg.org/#idl-short) [compareBoundaryPoints](https://dom.spec.whatwg.org/#dom-range-compareboundarypoints)([unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `how`[](https://dom.spec.whatwg.org/#dom-range-compareboundarypoints-how-sourcerange-how), [Range](https://dom.spec.whatwg.org/#range) `sourceRange`[](https://dom.spec.whatwg.org/#dom-range-compareboundarypoints-how-sourcerange-sourcerange)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [deleteContents](https://dom.spec.whatwg.org/#dom-range-deletecontents)(); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) [extractContents](https://dom.spec.whatwg.org/#dom-range-extractcontents)(); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) [cloneContents](https://dom.spec.whatwg.org/#dom-range-clonecontents)(); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [insertNode](https://dom.spec.whatwg.org/#dom-range-insertnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-insertnode-node-node)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [surroundContents](https://dom.spec.whatwg.org/#dom-range-surroundcontents)([Node](https://dom.spec.whatwg.org/#node) `newParent`[](https://dom.spec.whatwg.org/#dom-range-surroundcontents-newparent-newparent)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [deleteContents](https://dom.spec.whatwg.org/#dom-range-deletecontents)(); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) [extractContents](https://dom.spec.whatwg.org/#dom-range-extractcontents)(); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions), [NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) [cloneContents](https://dom.spec.whatwg.org/#dom-range-clonecontents)(); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [insertNode](https://dom.spec.whatwg.org/#dom-range-insertnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-insertnode-node-node)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [surroundContents](https://dom.spec.whatwg.org/#dom-range-surroundcontents)([Node](https://dom.spec.whatwg.org/#node) `newParent`[](https://dom.spec.whatwg.org/#dom-range-surroundcontents-newparent-newparent)); - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Range](https://dom.spec.whatwg.org/#range) [cloneRange](https://dom.spec.whatwg.org/#dom-range-clonerange)(); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [detach](https://dom.spec.whatwg.org/#dom-range-detach)(); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [Range](https://dom.spec.whatwg.org/#range) [cloneRange](https://dom.spec.whatwg.org/#dom-range-clonerange)(); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [detach](https://dom.spec.whatwg.org/#dom-range-detach)(); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isPointInRange](https://dom.spec.whatwg.org/#dom-range-ispointinrange)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-ispointinrange-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-ispointinrange-node-offset-offset)); - [short](https://webidl.spec.whatwg.org/#idl-short) [comparePoint](https://dom.spec.whatwg.org/#dom-range-comparepoint)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-comparepoint-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-comparepoint-node-offset-offset)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [isPointInRange](https://dom.spec.whatwg.org/#dom-range-ispointinrange)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-ispointinrange-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-ispointinrange-node-offset-offset)); +[short](https://webidl.spec.whatwg.org/#idl-short) [comparePoint](https://dom.spec.whatwg.org/#dom-range-comparepoint)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-comparepoint-node-offset-node), [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `offset`[](https://dom.spec.whatwg.org/#dom-range-comparepoint-node-offset-offset)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [intersectsNode](https://dom.spec.whatwg.org/#dom-range-intersectsnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-intersectsnode-node-node)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [intersectsNode](https://dom.spec.whatwg.org/#dom-range-intersectsnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-range-intersectsnode-node-node)); - [stringifier](https://dom.spec.whatwg.org/#dom-range-stringifier); +[stringifier](https://dom.spec.whatwg.org/#dom-range-stringifier); }; Objects implementing the `[Range](https://dom.spec.whatwg.org/#range)` interface are known as live ranges. @@ -9436,26 +8840,17 @@ A [node](https://dom.spec.whatwg.org/#concept-node) is partially contained in a Some facts to better understand these definitions: -- The content that one would think of as being within the [live range](https://dom.spec.whatwg.org/#concept-live-range) consists of all [contained](https://dom.spec.whatwg.org/#contained) [nodes](https://dom.spec.whatwg.org/#concept-node), plus possibly some of the contents of the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) and [end node](https://dom.spec.whatwg.org/#concept-range-end-node) if those are `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [nodes](https://dom.spec.whatwg.org/#concept-node). - -- The [nodes](https://dom.spec.whatwg.org/#concept-node) that are contained in a [live range](https://dom.spec.whatwg.org/#concept-live-range) will generally not be contiguous, because the [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of a [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) will not always be [contained](https://dom.spec.whatwg.org/#contained). - -- However, the [descendants](https://dom.spec.whatwg.org/#concept-tree-descendant) of a [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) are [contained](https://dom.spec.whatwg.org/#contained), and if two [siblings](https://dom.spec.whatwg.org/#concept-tree-sibling) are [contained](https://dom.spec.whatwg.org/#contained), so are any [siblings](https://dom.spec.whatwg.org/#concept-tree-sibling) that lie between them. - -- The [start node](https://dom.spec.whatwg.org/#concept-range-start-node) and [end node](https://dom.spec.whatwg.org/#concept-range-end-node) of a [live range](https://dom.spec.whatwg.org/#concept-live-range) are never [contained](https://dom.spec.whatwg.org/#contained) within it. - -- The first [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) (if there are any) will always be after the [start node](https://dom.spec.whatwg.org/#concept-range-start-node), and the last [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) will always be equal to or before the [end node](https://dom.spec.whatwg.org/#concept-range-end-node)’s last [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant). - -- There exists a [partially contained](https://dom.spec.whatwg.org/#partially-contained) [node](https://dom.spec.whatwg.org/#concept-node) if and only if the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) and [end node](https://dom.spec.whatwg.org/#concept-range-end-node) are different. - -- The `[commonAncestorContainer](https://dom.spec.whatwg.org/#dom-range-commonancestorcontainer)` attribute value is neither [contained](https://dom.spec.whatwg.org/#contained) nor [partially contained](https://dom.spec.whatwg.org/#partially-contained). - -- If the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is an [ancestor](https://dom.spec.whatwg.org/#concept-tree-ancestor) of the [end node](https://dom.spec.whatwg.org/#concept-range-end-node), the common [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) will be the [start node](https://dom.spec.whatwg.org/#concept-range-start-node). Exactly one of its [children](https://dom.spec.whatwg.org/#concept-tree-child) will be [partially contained](https://dom.spec.whatwg.org/#partially-contained), and a [child](https://dom.spec.whatwg.org/#concept-tree-child) will be [contained](https://dom.spec.whatwg.org/#contained) if and only if it [precedes](https://dom.spec.whatwg.org/#concept-tree-preceding) the [partially contained](https://dom.spec.whatwg.org/#partially-contained) [child](https://dom.spec.whatwg.org/#concept-tree-child). If the [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is an [ancestor](https://dom.spec.whatwg.org/#concept-tree-ancestor) of the [start node](https://dom.spec.whatwg.org/#concept-range-start-node), the opposite holds. - -- If the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of the [end node](https://dom.spec.whatwg.org/#concept-range-end-node), nor vice versa, the common [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) will be distinct from both of them. Exactly two of its [children](https://dom.spec.whatwg.org/#concept-tree-child) will be [partially contained](https://dom.spec.whatwg.org/#partially-contained), and a [child](https://dom.spec.whatwg.org/#concept-tree-child) will be contained if and only if it lies between those two. - - -___ +- The content that one would think of as being within the [live range](https://dom.spec.whatwg.org/#concept-live-range) consists of all [contained](https://dom.spec.whatwg.org/#contained) [nodes](https://dom.spec.whatwg.org/#concept-node), plus possibly some of the contents of the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) and [end node](https://dom.spec.whatwg.org/#concept-range-end-node) if those are `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [nodes](https://dom.spec.whatwg.org/#concept-node). +- The [nodes](https://dom.spec.whatwg.org/#concept-node) that are contained in a [live range](https://dom.spec.whatwg.org/#concept-live-range) will generally not be contiguous, because the [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of a [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) will not always be [contained](https://dom.spec.whatwg.org/#contained). +- However, the [descendants](https://dom.spec.whatwg.org/#concept-tree-descendant) of a [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) are [contained](https://dom.spec.whatwg.org/#contained), and if two [siblings](https://dom.spec.whatwg.org/#concept-tree-sibling) are [contained](https://dom.spec.whatwg.org/#contained), so are any [siblings](https://dom.spec.whatwg.org/#concept-tree-sibling) that lie between them. +- The [start node](https://dom.spec.whatwg.org/#concept-range-start-node) and [end node](https://dom.spec.whatwg.org/#concept-range-end-node) of a [live range](https://dom.spec.whatwg.org/#concept-live-range) are never [contained](https://dom.spec.whatwg.org/#contained) within it. +- The first [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) (if there are any) will always be after the [start node](https://dom.spec.whatwg.org/#concept-range-start-node), and the last [contained](https://dom.spec.whatwg.org/#contained) [node](https://dom.spec.whatwg.org/#concept-node) will always be equal to or before the [end node](https://dom.spec.whatwg.org/#concept-range-end-node)’s last [descendant](https://dom.spec.whatwg.org/#concept-tree-descendant). +- There exists a [partially contained](https://dom.spec.whatwg.org/#partially-contained) [node](https://dom.spec.whatwg.org/#concept-node) if and only if the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) and [end node](https://dom.spec.whatwg.org/#concept-range-end-node) are different. +- The `[commonAncestorContainer](https://dom.spec.whatwg.org/#dom-range-commonancestorcontainer)` attribute value is neither [contained](https://dom.spec.whatwg.org/#contained) nor [partially contained](https://dom.spec.whatwg.org/#partially-contained). +- If the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is an [ancestor](https://dom.spec.whatwg.org/#concept-tree-ancestor) of the [end node](https://dom.spec.whatwg.org/#concept-range-end-node), the common [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) will be the [start node](https://dom.spec.whatwg.org/#concept-range-start-node). Exactly one of its [children](https://dom.spec.whatwg.org/#concept-tree-child) will be [partially contained](https://dom.spec.whatwg.org/#partially-contained), and a [child](https://dom.spec.whatwg.org/#concept-tree-child) will be [contained](https://dom.spec.whatwg.org/#contained) if and only if it [precedes](https://dom.spec.whatwg.org/#concept-tree-preceding) the [partially contained](https://dom.spec.whatwg.org/#partially-contained) [child](https://dom.spec.whatwg.org/#concept-tree-child). If the [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is an [ancestor](https://dom.spec.whatwg.org/#concept-tree-ancestor) of the [start node](https://dom.spec.whatwg.org/#concept-range-start-node), the opposite holds. +- If the [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of the [end node](https://dom.spec.whatwg.org/#concept-range-end-node), nor vice versa, the common [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) will be distinct from both of them. Exactly two of its [children](https://dom.spec.whatwg.org/#concept-tree-child) will be [partially contained](https://dom.spec.whatwg.org/#partially-contained), and a [child](https://dom.spec.whatwg.org/#concept-tree-child) will be contained if and only if it lies between those two. + +--- [Range/Range](https://developer.mozilla.org/en-US/docs/Web/API/Range/Range "The Range() constructor returns a newly created Range object whose start and end is the global Document object.") @@ -9463,15 +8858,15 @@ In all current engines. Firefox24+Safari8+Chrome29+ -___ +--- Opera16+Edge79+ -___ +--- Edge (Legacy)15+IENone -___ +--- Firefox for Android24+iOS Safari8+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+ @@ -9481,7 +8876,7 @@ Returns a new [live range](https://dom.spec.whatwg.org/#concept-live-range). The `new Range()` constructor steps are to set [this](https://webidl.spec.whatwg.org/#this)’s [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) to ([current global object](https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object)’s [associated `Document`](https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window), 0). -___ +--- [Range/commonAncestorContainer](https://developer.mozilla.org/en-US/docs/Web/API/Range/commonAncestorContainer "The Range.commonAncestorContainer read-only property returns the deepest — or furthest down the document tree — Node that contains both boundary points of the Range. This means that if Range.startContainer and Range.endContainer both refer to the same node, this node is the common ancestor container.") @@ -9489,15 +8884,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9511,7 +8906,7 @@ The `commonAncestorContainer` getter steps are: 2. While container is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of [end node](https://dom.spec.whatwg.org/#concept-range-end-node), let container be container’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). 3. Return container. -___ +--- To set the start or end of a range to a [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (node, offset), run these steps: @@ -9519,15 +8914,14 @@ To set the start or end of a range to a [boundary point](https://dom.spec.whatwg 2. If offset is greater than node’s [length](https://dom.spec.whatwg.org/#concept-node-length), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[IndexSizeError](https://webidl.spec.whatwg.org/#indexsizeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. 3. Let bp be the [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (node, offset). 4. If these steps were invoked as "set the start" - + 1. If range’s [root](https://dom.spec.whatwg.org/#concept-range-root) is not equal to node’s [root](https://dom.spec.whatwg.org/#concept-tree-root), or if bp is [after](https://dom.spec.whatwg.org/#concept-range-bp-after) the range’s [end](https://dom.spec.whatwg.org/#concept-range-end), set range’s [end](https://dom.spec.whatwg.org/#concept-range-end) to bp. 2. Set range’s [start](https://dom.spec.whatwg.org/#concept-range-start) to bp. - + If these steps were invoked as "set the end" - + 1. If range’s [root](https://dom.spec.whatwg.org/#concept-range-root) is not equal to node’s [root](https://dom.spec.whatwg.org/#concept-tree-root), or if bp is [before](https://dom.spec.whatwg.org/#concept-range-bp-before) the range’s [start](https://dom.spec.whatwg.org/#concept-range-start), set range’s [start](https://dom.spec.whatwg.org/#concept-range-start) to bp. 2. Set range’s [end](https://dom.spec.whatwg.org/#concept-range-end) to bp. - [Range/setStart](https://developer.mozilla.org/en-US/docs/Web/API/Range/setStart "The Range.setStart() method sets the start position of a Range.") @@ -9535,15 +8929,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9555,15 +8949,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9575,15 +8969,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9599,26 +8993,23 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `setStartAfter(node)` method steps are: 1. Let parent be node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If parent is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidNodeTypeError](https://webidl.spec.whatwg.org/#invalidnodetypeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. [Set the start](https://dom.spec.whatwg.org/#concept-range-bp-set) of [this](https://webidl.spec.whatwg.org/#this) to [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (parent, node’s [index](https://dom.spec.whatwg.org/#concept-tree-index) plus 1). - [Range/setEndBefore](https://developer.mozilla.org/en-US/docs/Web/API/Range/setEndBefore "The Range.setEndBefore() method sets the end position of a Range relative to another Node. The parent Node of end of the Range will be the same as that for the referenceNode.") @@ -9626,15 +9017,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9650,26 +9041,23 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `setEndAfter(node)` method steps are: 1. Let parent be node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If parent is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidNodeTypeError](https://webidl.spec.whatwg.org/#invalidnodetypeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. [Set the end](https://dom.spec.whatwg.org/#concept-range-bp-set) of [this](https://webidl.spec.whatwg.org/#this) to [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (parent, node’s [index](https://dom.spec.whatwg.org/#concept-tree-index) plus 1). - [Range/collapse](https://developer.mozilla.org/en-US/docs/Web/API/Range/collapse "The Range.collapse() method collapses the Range to one of its boundary points.") @@ -9677,15 +9065,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9694,15 +9082,10 @@ The `collapse(toStart)` method steps are to, if toStart is true, set [end](https To select a [node](https://dom.spec.whatwg.org/#concept-node) node within a [range](https://dom.spec.whatwg.org/#concept-range) range, run these steps: 1. Let parent be node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If parent is null, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidNodeTypeError](https://webidl.spec.whatwg.org/#invalidnodetypeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. Let index be node’s [index](https://dom.spec.whatwg.org/#concept-tree-index). - 4. Set range’s [start](https://dom.spec.whatwg.org/#concept-range-start) to [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (parent, index). - 5. Set range’s [end](https://dom.spec.whatwg.org/#concept-range-end) to [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (parent, index plus 1). - [Range/selectNode](https://developer.mozilla.org/en-US/docs/Web/API/Range/selectNode "The Range.selectNode() method sets the Range to contain the Node and its contents. The parent Node of the start and end of the Range will be the same as the parent of the referenceNode.") @@ -9710,15 +9093,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9730,15 +9113,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9749,7 +9132,7 @@ The `selectNodeContents(node)` method steps are: 3. Set [start](https://dom.spec.whatwg.org/#concept-range-start) to the [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (node, 0). 4. Set [end](https://dom.spec.whatwg.org/#concept-range-end) to the [boundary point](https://dom.spec.whatwg.org/#concept-range-bp) (node, length). -___ +--- [Range/compareBoundaryPoints](https://developer.mozilla.org/en-US/docs/Web/API/Range/compareBoundaryPoints "The Range.compareBoundaryPoints() method compares the boundary points of the Range with those of another range.") @@ -9757,62 +9140,61 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `compareBoundaryPoints(how, sourceRange)` method steps are: 1. If how is not one of - - - `[START_TO_START](https://dom.spec.whatwg.org/#dom-range-start_to_start)`, - - `[START_TO_END](https://dom.spec.whatwg.org/#dom-range-start_to_end)`, - - `[END_TO_END](https://dom.spec.whatwg.org/#dom-range-end_to_end)`, and - - `[END_TO_START](https://dom.spec.whatwg.org/#dom-range-end_to_start)`, - + + - `[START_TO_START](https://dom.spec.whatwg.org/#dom-range-start_to_start)`, + - `[START_TO_END](https://dom.spec.whatwg.org/#dom-range-start_to_end)`, + - `[END_TO_END](https://dom.spec.whatwg.org/#dom-range-end_to_end)`, and + - `[END_TO_START](https://dom.spec.whatwg.org/#dom-range-end_to_start)`, + then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + 2. If [this](https://webidl.spec.whatwg.org/#this)’s [root](https://dom.spec.whatwg.org/#concept-range-root) is not the same as sourceRange’s [root](https://dom.spec.whatwg.org/#concept-range-root), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[WrongDocumentError](https://webidl.spec.whatwg.org/#wrongdocumenterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. 3. If how is: - + `[START_TO_START](https://dom.spec.whatwg.org/#dom-range-start_to_start)`: - + Let this point be [this](https://webidl.spec.whatwg.org/#this)’s [start](https://dom.spec.whatwg.org/#concept-range-start). Let other point be sourceRange’s [start](https://dom.spec.whatwg.org/#concept-range-start). - + `[START_TO_END](https://dom.spec.whatwg.org/#dom-range-start_to_end)`: - + Let this point be [this](https://webidl.spec.whatwg.org/#this)’s [end](https://dom.spec.whatwg.org/#concept-range-end). Let other point be sourceRange’s [start](https://dom.spec.whatwg.org/#concept-range-start). - + `[END_TO_END](https://dom.spec.whatwg.org/#dom-range-end_to_end)`: - + Let this point be [this](https://webidl.spec.whatwg.org/#this)’s [end](https://dom.spec.whatwg.org/#concept-range-end). Let other point be sourceRange’s [end](https://dom.spec.whatwg.org/#concept-range-end). - + `[END_TO_START](https://dom.spec.whatwg.org/#dom-range-end_to_start)`: - + Let this point be [this](https://webidl.spec.whatwg.org/#this)’s [start](https://dom.spec.whatwg.org/#concept-range-start). Let other point be sourceRange’s [end](https://dom.spec.whatwg.org/#concept-range-end). - + 4. If the [position](https://dom.spec.whatwg.org/#concept-range-bp-position) of this point relative to other point is - + [before](https://dom.spec.whatwg.org/#concept-range-bp-before) - + Return −1. - + [equal](https://dom.spec.whatwg.org/#concept-range-bp-equal) - + Return 0. - + [after](https://dom.spec.whatwg.org/#concept-range-bp-after) - + Return 1. - [Range/deleteContents](https://developer.mozilla.org/en-US/docs/Web/API/Range/deleteContents "The Range.deleteContents() method removes the contents of the Range from the Document.") @@ -9820,111 +9202,108 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `deleteContents()` method steps are: 1. If [this](https://webidl.spec.whatwg.org/#this) is [collapsed](https://dom.spec.whatwg.org/#range-collapsed), then return. - 2. Let original start node, original start offset, original end node, and original end offset be [this](https://webidl.spec.whatwg.org/#this)’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node), [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset), [end node](https://dom.spec.whatwg.org/#concept-range-end-node), and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset), respectively. 3. If original start node is original end node and it is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then [replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node original start node, offset original start offset, count original end offset minus original start offset, and data the empty string, and then return. - 4. Let nodes to remove be a list of all the [nodes](https://dom.spec.whatwg.org/#concept-node) that are [contained](https://dom.spec.whatwg.org/#contained) in [this](https://webidl.spec.whatwg.org/#this), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order), omitting any [node](https://dom.spec.whatwg.org/#concept-node) whose [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is also [contained](https://dom.spec.whatwg.org/#contained) in [this](https://webidl.spec.whatwg.org/#this). 5. If original start node is an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set new node to original start node and new offset to original start offset. 6. Otherwise: 1. Let reference node equal original start node. 2. While reference node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not null and is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set reference node to its [parent](https://dom.spec.whatwg.org/#concept-tree-parent). 3. Set new node to the [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of reference node, and new offset to one plus the [index](https://dom.spec.whatwg.org/#concept-tree-index) of reference node. - + If reference node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) were null, it would be the [root](https://dom.spec.whatwg.org/#concept-range-root) of [this](https://webidl.spec.whatwg.org/#this), so would be an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, and we could not reach this point. - 7. If original start node is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then [replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node original start node, offset original start offset, count original start node’s [length](https://dom.spec.whatwg.org/#concept-node-length) minus original start offset, data the empty string. - 8. For each node in nodes to remove, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order), [remove](https://dom.spec.whatwg.org/#concept-node-remove) node. - 9. If original end node is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then [replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node original end node, offset 0, count original end offset and data the empty string. - -10. Set [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) to (new node, new offset). +10. Set [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) to (new node, new offset). To a [live range](https://dom.spec.whatwg.org/#concept-live-range) range, run these steps: 1. Let fragment be a new `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node) whose [node document](https://dom.spec.whatwg.org/#concept-node-document) is range’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. If range is [collapsed](https://dom.spec.whatwg.org/#range-collapsed), then return fragment. - 3. Let original start node, original start offset, original end node, and original end offset be range’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node), [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset), [end node](https://dom.spec.whatwg.org/#concept-range-end-node), and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset), respectively. 4. If original start node is original end node and it is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of original start node. 2. Set the [data](https://dom.spec.whatwg.org/#concept-cd-data) of clone to the result of [substringing data](https://dom.spec.whatwg.org/#concept-cd-substring) with node original start node, offset original start offset, and count original end offset minus original start offset. 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. 4. [Replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node original start node, offset original start offset, count original end offset minus original start offset, and data the empty string. 5. Return fragment. + 5. Let common ancestor be original start node. 6. While common ancestor is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set common ancestor to its own [parent](https://dom.spec.whatwg.org/#concept-tree-parent). 7. Let first partially contained child be null. 8. If original start node is _not_ an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set first partially contained child to the first [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range. 9. Let last partially contained child be null. -10. If original end node is _not_ an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original start node, set last partially contained child to the last [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range. - +10. If original end node is _not_ an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original start node, set last partially contained child to the last [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range. + + These variable assignments do actually always make sense. For instance, if original start node is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, original start node is itself [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range, and so are all its [ancestors](https://dom.spec.whatwg.org/#concept-tree-ancestor) up until a [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor. common ancestor cannot be original start node, because it has to be an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node. The other case is similar. Also, notice that the two [children](https://dom.spec.whatwg.org/#concept-tree-child) will never be equal if both are defined. - -11. Let contained children be a list of all [children](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that are [contained](https://dom.spec.whatwg.org/#contained) in range, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). -12. If any member of contained children is a [doctype](https://dom.spec.whatwg.org/#concept-doctype), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + +11. Let contained children be a list of all [children](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that are [contained](https://dom.spec.whatwg.org/#contained) in range, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). +12. If any member of contained children is a [doctype](https://dom.spec.whatwg.org/#concept-doctype), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. + + We do not have to worry about the first or last partially contained node, because a [doctype](https://dom.spec.whatwg.org/#concept-doctype) can never be partially contained. It cannot be a boundary point of a range, and it cannot be the ancestor of anything. - -13. If original start node is an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set new node to original start node and new offset to original start offset. -14. Otherwise: - 1. Let reference node equal original start node. - 2. While reference node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not null and is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set reference node to its [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 3. Set new node to the [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of reference node, and new offset to one plus reference node’s [index](https://dom.spec.whatwg.org/#concept-tree-index). - - If reference node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is null, it would be the [root](https://dom.spec.whatwg.org/#concept-range-root) of range, so would be an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, and we could not reach this point. - -15. If first partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + +13. If original start node is an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set new node to original start node and new offset to original start offset. +14. Otherwise: +15. Let reference node equal original start node. +16. While reference node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is not null and is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set reference node to its [parent](https://dom.spec.whatwg.org/#concept-tree-parent). +17. Set new node to the [parent](https://dom.spec.whatwg.org/#concept-tree-parent) of reference node, and new offset to one plus reference node’s [index](https://dom.spec.whatwg.org/#concept-tree-index). + + If reference node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is null, it would be the [root](https://dom.spec.whatwg.org/#concept-range-root) of range, so would be an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, and we could not reach this point. + +18. If first partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: + + In this case, first partially contained child is original start node. - + 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of original start node. 2. Set the [data](https://dom.spec.whatwg.org/#concept-cd-data) of clone to the result of [substringing data](https://dom.spec.whatwg.org/#concept-cd-substring) with node original start node, offset original start offset, and count original start node’s [length](https://dom.spec.whatwg.org/#concept-node-length) minus original start offset. 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. 4. [Replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node original start node, offset original start offset, count original start node’s [length](https://dom.spec.whatwg.org/#concept-node-length) minus original start offset, and data the empty string. -16. Otherwise, if first partially contained child is not null: - 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of first partially contained child. - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. - 3. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (original start node, original start offset) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (first partially contained child, first partially contained child’s [length](https://dom.spec.whatwg.org/#concept-node-length)). - 4. Let subfragment be the result of [extracting](https://dom.spec.whatwg.org/#concept-range-extract) subrange. - - 5. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. -17. For each contained child in contained children, [append](https://dom.spec.whatwg.org/#concept-node-append) contained child to fragment. -18. If last partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + +16. Otherwise, if first partially contained child is not null: +1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of first partially contained child. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. +1. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (original start node, original start offset) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (first partially contained child, first partially contained child’s [length](https://dom.spec.whatwg.org/#concept-node-length)). +1. Let subfragment be the result of [extracting](https://dom.spec.whatwg.org/#concept-range-extract) subrange. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. +1. For each contained child in contained children, [append](https://dom.spec.whatwg.org/#concept-node-append) contained child to fragment. +1. If last partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: + + In this case, last partially contained child is original end node. - + 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of original end node. 2. Set the [data](https://dom.spec.whatwg.org/#concept-cd-data) of clone to the result of [substringing data](https://dom.spec.whatwg.org/#concept-cd-substring) with node original end node, offset 0, and count original end offset. 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. 4. [Replace data](https://dom.spec.whatwg.org/#concept-cd-replace) with node original end node, offset 0, count original end offset, and data the empty string. -19. Otherwise, if last partially contained child is not null: - 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of last partially contained child. - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. - 3. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (last partially contained child, 0) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (original end node, original end offset). - 4. Let subfragment be the result of [extracting](https://dom.spec.whatwg.org/#concept-range-extract) subrange. - - 5. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. -20. Set range’s [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) to (new node, new offset). -21. Return fragment. + +19. Otherwise, if last partially contained child is not null: +1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of last partially contained child. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. +1. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (last partially contained child, 0) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (original end node, original end offset). +1. Let subfragment be the result of [extracting](https://dom.spec.whatwg.org/#concept-range-extract) subrange. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. +1. Set range’s [start](https://dom.spec.whatwg.org/#concept-range-start) and [end](https://dom.spec.whatwg.org/#concept-range-end) to (new node, new offset). +1. Return fragment. [Range/extractContents](https://developer.mozilla.org/en-US/docs/Web/API/Range/extractContents "The Range.extractContents() method moves contents of the Range from the document tree into a DocumentFragment.") @@ -9932,15 +9311,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -9949,62 +9328,65 @@ The `extractContents()` method steps are to return the result of [extracting](ht To clone the contents of a [live range](https://dom.spec.whatwg.org/#concept-live-range) range, run these steps: 1. Let fragment be a new `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node) whose [node document](https://dom.spec.whatwg.org/#concept-node-document) is range’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node)’s [node document](https://dom.spec.whatwg.org/#concept-node-document). - 2. If range is [collapsed](https://dom.spec.whatwg.org/#range-collapsed), then return fragment. - 3. Let original start node, original start offset, original end node, and original end offset be range’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node), [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset), [end node](https://dom.spec.whatwg.org/#concept-range-end-node), and [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset), respectively. 4. If original start node is original end node and it is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of original start node. 2. Set the [data](https://dom.spec.whatwg.org/#concept-cd-data) of clone to the result of [substringing data](https://dom.spec.whatwg.org/#concept-cd-substring) with node original start node, offset original start offset, and count original end offset minus original start offset. 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. 4. Return fragment. + 5. Let common ancestor be original start node. 6. While common ancestor is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set common ancestor to its own [parent](https://dom.spec.whatwg.org/#concept-tree-parent). 7. Let first partially contained child be null. 8. If original start node is _not_ an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, set first partially contained child to the first [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range. 9. Let last partially contained child be null. -10. If original end node is _not_ an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original start node, set last partially contained child to the last [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range. - +10. If original end node is _not_ an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original start node, set last partially contained child to the last [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range. + + These variable assignments do actually always make sense. For instance, if original start node is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node, original start node is itself [partially contained](https://dom.spec.whatwg.org/#partially-contained) in range, and so are all its [ancestors](https://dom.spec.whatwg.org/#concept-tree-ancestor) up until a [child](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor. common ancestor cannot be original start node, because it has to be an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of original end node. The other case is similar. Also, notice that the two [children](https://dom.spec.whatwg.org/#concept-tree-child) will never be equal if both are defined. - -11. Let contained children be a list of all [children](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that are [contained](https://dom.spec.whatwg.org/#contained) in range, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). -12. If any member of contained children is a [doctype](https://dom.spec.whatwg.org/#concept-doctype), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + +11. Let contained children be a list of all [children](https://dom.spec.whatwg.org/#concept-tree-child) of common ancestor that are [contained](https://dom.spec.whatwg.org/#contained) in range, in [tree order](https://dom.spec.whatwg.org/#concept-tree-order). +12. If any member of contained children is a [doctype](https://dom.spec.whatwg.org/#concept-doctype), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[HierarchyRequestError](https://webidl.spec.whatwg.org/#hierarchyrequesterror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. + + We do not have to worry about the first or last partially contained node, because a [doctype](https://dom.spec.whatwg.org/#concept-doctype) can never be partially contained. It cannot be a boundary point of a range, and it cannot be the ancestor of anything. - -13. If first partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + +13. If first partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: + + In this case, first partially contained child is original start node. - + 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of original start node. 2. Set the [data](https://dom.spec.whatwg.org/#concept-cd-data) of clone to the result of [substringing data](https://dom.spec.whatwg.org/#concept-cd-substring) with node original start node, offset original start offset, and count original start node’s [length](https://dom.spec.whatwg.org/#concept-node-length) minus original start offset. 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. -14. Otherwise, if first partially contained child is not null: - 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of first partially contained child. - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. - 3. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (original start node, original start offset) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (first partially contained child, first partially contained child’s [length](https://dom.spec.whatwg.org/#concept-node-length)). - 4. Let subfragment be the result of [cloning the contents](https://dom.spec.whatwg.org/#concept-range-clone) of subrange. - - 5. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. -15. For each contained child in contained children: - 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of contained child with the _clone children flag_ set. - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. -16. If last partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: - + +14. Otherwise, if first partially contained child is not null: +1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of first partially contained child. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. +1. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (original start node, original start offset) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (first partially contained child, first partially contained child’s [length](https://dom.spec.whatwg.org/#concept-node-length)). +1. Let subfragment be the result of [cloning the contents](https://dom.spec.whatwg.org/#concept-range-clone) of subrange. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. +1. For each contained child in contained children: +1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of contained child with the _clone children flag_ set. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. +1. If last partially contained child is a `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [node](https://dom.spec.whatwg.org/#concept-node), then: + + In this case, last partially contained child is original end node. - + 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of original end node. 2. Set the [data](https://dom.spec.whatwg.org/#concept-cd-data) of clone to the result of [substringing data](https://dom.spec.whatwg.org/#concept-cd-substring) with node original end node, offset 0, and count original end offset. 3. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. -17. Otherwise, if last partially contained child is not null: - 1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of last partially contained child. - 2. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. - 3. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (last partially contained child, 0) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (original end node, original end offset). - 4. Let subfragment be the result of [cloning the contents](https://dom.spec.whatwg.org/#concept-range-clone) of subrange. - - 5. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. -18. Return fragment. + +17. Otherwise, if last partially contained child is not null: +1. Let clone be a [clone](https://dom.spec.whatwg.org/#concept-node-clone) of last partially contained child. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) clone to fragment. +1. Let subrange be a new [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start](https://dom.spec.whatwg.org/#concept-range-start) is (last partially contained child, 0) and whose [end](https://dom.spec.whatwg.org/#concept-range-end) is (original end node, original end offset). +1. Let subfragment be the result of [cloning the contents](https://dom.spec.whatwg.org/#concept-range-clone) of subrange. +1. [Append](https://dom.spec.whatwg.org/#concept-node-append) subfragment to clone. +1. Return fragment. [Range/cloneContents](https://developer.mozilla.org/en-US/docs/Web/API/Range/cloneContents "The Range.cloneContents() returns a DocumentFragment copying the objects of type Node included in the Range.") @@ -10012,15 +9394,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10037,12 +9419,10 @@ To insert a [node](https://dom.spec.whatwg.org/#concept-node) node into a [live 7. If range’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node), set referenceNode to the result of [splitting](https://dom.spec.whatwg.org/#concept-text-split) it with offset range’s [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset). 8. If node is referenceNode, set referenceNode to its [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). 9. If node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is non-null, then [remove](https://dom.spec.whatwg.org/#concept-node-remove) node. - -10. Let newOffset be parent’s [length](https://dom.spec.whatwg.org/#concept-node-length) if referenceNode is null, and referenceNode’s [index](https://dom.spec.whatwg.org/#concept-tree-index) otherwise. -11. Increase newOffset by node’s [length](https://dom.spec.whatwg.org/#concept-node-length) if node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node), and one otherwise. -12. [Pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into parent before referenceNode. -13. If range is [collapsed](https://dom.spec.whatwg.org/#range-collapsed), then set range’s [end](https://dom.spec.whatwg.org/#concept-range-end) to (parent, newOffset). - +10. Let newOffset be parent’s [length](https://dom.spec.whatwg.org/#concept-node-length) if referenceNode is null, and referenceNode’s [index](https://dom.spec.whatwg.org/#concept-tree-index) otherwise. +11. Increase newOffset by node’s [length](https://dom.spec.whatwg.org/#concept-node-length) if node is a `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node), and one otherwise. +12. [Pre-insert](https://dom.spec.whatwg.org/#concept-node-pre-insert) node into parent before referenceNode. +13. If range is [collapsed](https://dom.spec.whatwg.org/#range-collapsed), then set range’s [end](https://dom.spec.whatwg.org/#concept-range-end) to (parent, newOffset). [Range/insertNode](https://developer.mozilla.org/en-US/docs/Web/API/Range/insertNode "The Range.insertNode() method inserts a node at the start of the Range.") @@ -10050,15 +9430,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10070,36 +9450,30 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `surroundContents(newParent)` method steps are: 1. If a non-`[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node) is [partially contained](https://dom.spec.whatwg.org/#partially-contained) in [this](https://webidl.spec.whatwg.org/#this), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If newParent is a `[Document](https://dom.spec.whatwg.org/#document)`, `[DocumentType](https://dom.spec.whatwg.org/#documenttype)`, or `[DocumentFragment](https://dom.spec.whatwg.org/#documentfragment)` [node](https://dom.spec.whatwg.org/#concept-node), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidNodeTypeError](https://webidl.spec.whatwg.org/#invalidnodetypeerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + For historical reasons `[CharacterData](https://dom.spec.whatwg.org/#characterdata)` [nodes](https://dom.spec.whatwg.org/#concept-node) are not checked here and end up throwing later on as a side effect. - + 3. Let fragment be the result of [extracting](https://dom.spec.whatwg.org/#concept-live-range) [this](https://webidl.spec.whatwg.org/#this). - 4. If newParent has [children](https://dom.spec.whatwg.org/#concept-tree-child), then [replace all](https://dom.spec.whatwg.org/#concept-node-replace-all) with null within newParent. - 5. [Insert](https://dom.spec.whatwg.org/#concept-range-insert) newParent into [this](https://webidl.spec.whatwg.org/#this). - 6. [Append](https://dom.spec.whatwg.org/#concept-node-append) fragment to newParent. - 7. [Select](https://dom.spec.whatwg.org/#concept-range-select) newParent within [this](https://webidl.spec.whatwg.org/#this). - [Range/cloneRange](https://developer.mozilla.org/en-US/docs/Web/API/Range/cloneRange "The Range.cloneRange() method returns a Range object with boundary points identical to the cloned Range.") @@ -10107,15 +9481,15 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10125,21 +9499,21 @@ The `cloneRange()` method steps are to return a new [live range](https://dom.spe Firefox1–15Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4–15iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The `detach()` method steps are to do nothing. Its functionality (disabling a `[Range](https://dom.spec.whatwg.org/#range)` object) was removed, but the method itself is preserved for compatibility. -___ +--- [Range/comparePoint](https://developer.mozilla.org/en-US/docs/Web/API/Range/comparePoint "The Range.comparePoint() method returns -1, 0, or 1 depending on whether the referenceNode is before, the same as, or after the Range.") @@ -10147,15 +9521,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -10169,15 +9543,15 @@ In all current engines. Firefox17+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android19+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -10191,15 +9565,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)15+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -10220,7 +9594,7 @@ The `comparePoint(node, offset)` method steps are: 5. If (node, offset) is [after](https://dom.spec.whatwg.org/#concept-range-bp-after) [end](https://dom.spec.whatwg.org/#concept-range-end), return 1. 6. Return 0. -___ +--- The `intersectsNode(node)` method steps are: @@ -10231,7 +9605,7 @@ The `intersectsNode(node)` method steps are: 5. If (parent, offset) is [before](https://dom.spec.whatwg.org/#concept-range-bp-before) [end](https://dom.spec.whatwg.org/#concept-range-end) and (parent, offset plus 1) is [after](https://dom.spec.whatwg.org/#concept-range-bp-after) [start](https://dom.spec.whatwg.org/#concept-range-start), return true. 6. Return false. -___ +--- [Range/toString](https://developer.mozilla.org/en-US/docs/Web/API/Range/toString "The Range.toString() method is a stringifier returning the text of the Range.") @@ -10239,34 +9613,28 @@ In all current engines. Firefox1+Safari1+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ The stringification behavior must run these steps: 1. Let s be the empty string. - 2. If [this](https://webidl.spec.whatwg.org/#this)’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is [this](https://webidl.spec.whatwg.org/#this)’s [end node](https://dom.spec.whatwg.org/#concept-range-end-node) and it is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node), then return the substring of that `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node)’s [data](https://dom.spec.whatwg.org/#concept-cd-data) beginning at [this](https://webidl.spec.whatwg.org/#this)’s [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) and ending at [this](https://webidl.spec.whatwg.org/#this)’s [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset). - 3. If [this](https://webidl.spec.whatwg.org/#this)’s [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node), then append the substring of that [node](https://dom.spec.whatwg.org/#concept-node)’s [data](https://dom.spec.whatwg.org/#concept-cd-data) from [this](https://webidl.spec.whatwg.org/#this)’s [start offset](https://dom.spec.whatwg.org/#concept-range-start-offset) until the end to s. - 4. Append the [concatenation](https://infra.spec.whatwg.org/#string-concatenate) of the [data](https://dom.spec.whatwg.org/#concept-cd-data) of all `[Text](https://dom.spec.whatwg.org/#text)` [nodes](https://dom.spec.whatwg.org/#concept-node) that are [contained](https://dom.spec.whatwg.org/#contained) in [this](https://webidl.spec.whatwg.org/#this), in [tree order](https://dom.spec.whatwg.org/#concept-tree-order), to s. - 5. If [this](https://webidl.spec.whatwg.org/#this)’s [end node](https://dom.spec.whatwg.org/#concept-range-end-node) is a `[Text](https://dom.spec.whatwg.org/#text)` [node](https://dom.spec.whatwg.org/#concept-node), then append the substring of that [node](https://dom.spec.whatwg.org/#concept-node)’s [data](https://dom.spec.whatwg.org/#concept-cd-data) from its start until [this](https://webidl.spec.whatwg.org/#this)’s [end offset](https://dom.spec.whatwg.org/#concept-range-end-offset) to s. - 6. Return s. - -___ +--- The `[createContextualFragment()](https://w3c.github.io/DOM-Parsing/#dfn-createcontextualfragment-fragment)`, `[getClientRects()](https://drafts.csswg.org/cssom-view-1/#dom-range-getclientrects)`, and `[getBoundingClientRect()](https://drafts.csswg.org/cssom-view-1/#dom-range-getboundingclientrect)` methods are defined in other specifications. [\[DOM-Parsing\]](https://dom.spec.whatwg.org/#biblio-dom-parsing) [\[CSSOM-VIEW\]](https://dom.spec.whatwg.org/#biblio-cssom-view) @@ -10281,21 +9649,13 @@ Each `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` and `[TreeWalke To filter a [node](https://dom.spec.whatwg.org/#concept-node) node within a `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` or `[TreeWalker](https://dom.spec.whatwg.org/#treewalker)` object traverser, run these steps: 1. If traverser’s [active flag](https://dom.spec.whatwg.org/#concept-traversal-active) is set, then throw an "`[InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. Let n be node’s `[nodeType](https://dom.spec.whatwg.org/#dom-node-nodetype)` attribute value − 1. - 3. If the nth bit (where 0 is the least significant bit) of traverser’s [whatToShow](https://dom.spec.whatwg.org/#concept-traversal-whattoshow) is not set, then return `[FILTER_SKIP](https://dom.spec.whatwg.org/#dom-nodefilter-filter_skip)`. - 4. If traverser’s [filter](https://dom.spec.whatwg.org/#concept-traversal-filter) is null, then return `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`. - 5. Set traverser’s [active flag](https://dom.spec.whatwg.org/#concept-traversal-active). - 6. Let result be the return value of [call a user object’s operation](https://webidl.spec.whatwg.org/#call-a-user-objects-operation) with traverser’s [filter](https://dom.spec.whatwg.org/#concept-traversal-filter), "`acceptNode`", and « node ». If this throws an exception, then unset traverser’s [active flag](https://dom.spec.whatwg.org/#concept-traversal-active) and rethrow the exception. - 7. Unset traverser’s [active flag](https://dom.spec.whatwg.org/#concept-traversal-active). - 8. Return result. - ### 6.1. Interface `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)`[](https://dom.spec.whatwg.org/#interface-nodeiterator) @@ -10305,30 +9665,30 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `NodeIterator` { - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [Node](https://dom.spec.whatwg.org/#node) [root](https://dom.spec.whatwg.org/#dom-nodeiterator-root); - readonly attribute [Node](https://dom.spec.whatwg.org/#node) [referenceNode](https://dom.spec.whatwg.org/#dom-nodeiterator-referencenode); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [pointerBeforeReferenceNode](https://dom.spec.whatwg.org/#dom-nodeiterator-pointerbeforereferencenode); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [whatToShow](https://dom.spec.whatwg.org/#dom-nodeiterator-whattoshow); - readonly attribute [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? [filter](https://dom.spec.whatwg.org/#dom-nodeiterator-filter); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [Node](https://dom.spec.whatwg.org/#node) [root](https://dom.spec.whatwg.org/#dom-nodeiterator-root); +readonly attribute [Node](https://dom.spec.whatwg.org/#node) [referenceNode](https://dom.spec.whatwg.org/#dom-nodeiterator-referencenode); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [pointerBeforeReferenceNode](https://dom.spec.whatwg.org/#dom-nodeiterator-pointerbeforereferencenode); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [whatToShow](https://dom.spec.whatwg.org/#dom-nodeiterator-whattoshow); +readonly attribute [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? [filter](https://dom.spec.whatwg.org/#dom-nodeiterator-filter); - [Node](https://dom.spec.whatwg.org/#node)? [nextNode](https://dom.spec.whatwg.org/#dom-nodeiterator-nextnode)(); - [Node](https://dom.spec.whatwg.org/#node)? [previousNode](https://dom.spec.whatwg.org/#dom-nodeiterator-previousnode)(); +[Node](https://dom.spec.whatwg.org/#node)? [nextNode](https://dom.spec.whatwg.org/#dom-nodeiterator-nextnode)(); +[Node](https://dom.spec.whatwg.org/#node)? [previousNode](https://dom.spec.whatwg.org/#dom-nodeiterator-previousnode)(); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [detach](https://dom.spec.whatwg.org/#dom-nodeiterator-detach)(); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) [detach](https://dom.spec.whatwg.org/#dom-nodeiterator-detach)(); }; `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` objects can be created using the `[createNodeIterator()](https://dom.spec.whatwg.org/#dom-document-createnodeiterator)` method on `[Document](https://dom.spec.whatwg.org/#document)` objects. @@ -10342,21 +9702,17 @@ As mentioned earlier, `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator) The `NodeIterator` pre-removing steps given a nodeIterator and toBeRemovedNode, are as follows: 1. If toBeRemovedNode is not an [inclusive ancestor](https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor) of nodeIterator’s [reference](https://dom.spec.whatwg.org/#nodeiterator-reference), or toBeRemovedNode is nodeIterator’s [root](https://dom.spec.whatwg.org/#concept-traversal-root), then return. - 2. If nodeIterator’s [pointer before reference](https://dom.spec.whatwg.org/#nodeiterator-pointer-before-reference) is true, then: - + 1. Let next be toBeRemovedNode’s first [following](https://dom.spec.whatwg.org/#concept-tree-following) [node](https://dom.spec.whatwg.org/#concept-node) that is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of nodeIterator’s [root](https://dom.spec.whatwg.org/#concept-traversal-root) and is not an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of toBeRemovedNode, and null if there is no such [node](https://dom.spec.whatwg.org/#concept-node). - 2. If next is non-null, then set nodeIterator’s [reference](https://dom.spec.whatwg.org/#nodeiterator-reference) to next and return. - 3. Otherwise, set nodeIterator’s [pointer before reference](https://dom.spec.whatwg.org/#nodeiterator-pointer-before-reference) to false. - + Steps are not terminated here. - + 3. Set nodeIterator’s [reference](https://dom.spec.whatwg.org/#nodeiterator-reference) to toBeRemovedNode’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent), if toBeRemovedNode’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) is null, and to the [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of toBeRemovedNode’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) that appears last in [tree order](https://dom.spec.whatwg.org/#concept-tree-order) otherwise. - -___ +--- [NodeIterator/root](https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator/root "The NodeIterator.root read-only property represents the Node that is the root of what the NodeIterator traverses.") @@ -10364,15 +9720,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10384,15 +9740,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes @@ -10404,15 +9760,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera MobileYes @@ -10424,15 +9780,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10444,15 +9800,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10461,35 +9817,29 @@ The `filter` getter steps are to return [this](https://webidl.spec.whatwg.org/#t To traverse, given a `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` object iterator and a direction direction, run these steps: 1. Let node be iterator’s [reference](https://dom.spec.whatwg.org/#nodeiterator-reference). - 2. Let beforeNode be iterator’s [pointer before reference](https://dom.spec.whatwg.org/#nodeiterator-pointer-before-reference). - 3. While true: - + 1. Branch on direction: - + next - + If beforeNode is false, then set node to the first [node](https://dom.spec.whatwg.org/#concept-node) [following](https://dom.spec.whatwg.org/#concept-tree-following) node in iterator’s [iterator collection](https://dom.spec.whatwg.org/#iterator-collection). If there is no such [node](https://dom.spec.whatwg.org/#concept-node), then return null. - + If beforeNode is true, then set it to false. - + previous - + If beforeNode is true, then set node to the first [node](https://dom.spec.whatwg.org/#concept-node) [preceding](https://dom.spec.whatwg.org/#concept-tree-preceding) node in iterator’s [iterator collection](https://dom.spec.whatwg.org/#iterator-collection). If there is no such [node](https://dom.spec.whatwg.org/#concept-node), then return null. - + If beforeNode is false, then set it to true. - + 2. Let result be the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within iterator. - 3. If result is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then [break](https://infra.spec.whatwg.org/#iteration-break). - + 4. Set iterator’s [reference](https://dom.spec.whatwg.org/#nodeiterator-reference) to node. - 5. Set iterator’s [pointer before reference](https://dom.spec.whatwg.org/#nodeiterator-pointer-before-reference) to beforeNode. - 6. Return node. - [NodeIterator/nextNode](https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator/nextNode "The NodeIterator.nextNode() method returns the next node in the set represented by the NodeIterator and advances the position of the iterator within the set. The first call to nextNode() returns the first node in the set.") @@ -10497,15 +9847,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10517,15 +9867,15 @@ In all current engines. Firefox3.5+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10541,32 +9891,32 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `TreeWalker` { - \[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [Node](https://dom.spec.whatwg.org/#node) [root](https://dom.spec.whatwg.org/#dom-treewalker-root); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [whatToShow](https://dom.spec.whatwg.org/#dom-treewalker-whattoshow); - readonly attribute [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? [filter](https://dom.spec.whatwg.org/#dom-treewalker-filter); - attribute [Node](https://dom.spec.whatwg.org/#node) [currentNode](https://dom.spec.whatwg.org/#dom-treewalker-currentnode); - - [Node](https://dom.spec.whatwg.org/#node)? [parentNode](https://dom.spec.whatwg.org/#dom-treewalker-parentnode)(); - [Node](https://dom.spec.whatwg.org/#node)? [firstChild](https://dom.spec.whatwg.org/#dom-treewalker-firstchild)(); - [Node](https://dom.spec.whatwg.org/#node)? [lastChild](https://dom.spec.whatwg.org/#dom-treewalker-lastchild)(); - [Node](https://dom.spec.whatwg.org/#node)? [previousSibling](https://dom.spec.whatwg.org/#dom-treewalker-previoussibling)(); - [Node](https://dom.spec.whatwg.org/#node)? [nextSibling](https://dom.spec.whatwg.org/#dom-treewalker-nextsibling)(); - [Node](https://dom.spec.whatwg.org/#node)? [previousNode](https://dom.spec.whatwg.org/#dom-treewalker-previousnode)(); - [Node](https://dom.spec.whatwg.org/#node)? [nextNode](https://dom.spec.whatwg.org/#dom-treewalker-nextnode)(); +\[[SameObject](https://webidl.spec.whatwg.org/#SameObject)\] readonly attribute [Node](https://dom.spec.whatwg.org/#node) [root](https://dom.spec.whatwg.org/#dom-treewalker-root); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [whatToShow](https://dom.spec.whatwg.org/#dom-treewalker-whattoshow); +readonly attribute [NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)? [filter](https://dom.spec.whatwg.org/#dom-treewalker-filter); +attribute [Node](https://dom.spec.whatwg.org/#node) [currentNode](https://dom.spec.whatwg.org/#dom-treewalker-currentnode); + +[Node](https://dom.spec.whatwg.org/#node)? [parentNode](https://dom.spec.whatwg.org/#dom-treewalker-parentnode)(); +[Node](https://dom.spec.whatwg.org/#node)? [firstChild](https://dom.spec.whatwg.org/#dom-treewalker-firstchild)(); +[Node](https://dom.spec.whatwg.org/#node)? [lastChild](https://dom.spec.whatwg.org/#dom-treewalker-lastchild)(); +[Node](https://dom.spec.whatwg.org/#node)? [previousSibling](https://dom.spec.whatwg.org/#dom-treewalker-previoussibling)(); +[Node](https://dom.spec.whatwg.org/#node)? [nextSibling](https://dom.spec.whatwg.org/#dom-treewalker-nextsibling)(); +[Node](https://dom.spec.whatwg.org/#node)? [previousNode](https://dom.spec.whatwg.org/#dom-treewalker-previousnode)(); +[Node](https://dom.spec.whatwg.org/#node)? [nextNode](https://dom.spec.whatwg.org/#dom-treewalker-nextnode)(); }; `[TreeWalker](https://dom.spec.whatwg.org/#treewalker)` objects can be created using the `[createTreeWalker()](https://dom.spec.whatwg.org/#dom-document-createtreewalker)` method on `[Document](https://dom.spec.whatwg.org/#document)` objects. @@ -10581,15 +9931,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10601,15 +9951,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10621,15 +9971,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10643,21 +9993,21 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ The `[currentNode](https://dom.spec.whatwg.org/#dom-treewalker-currentnode)` setter steps are to set [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current) to the given value. -___ +--- [TreeWalker/parentNode](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker/parentNode "The TreeWalker.parentNode() method moves the current Node to the first visible ancestor node in the document order, and returns the found node. If no such node exists, or if it is above the TreeWalker's root node, returns null and the current node is not changed.") @@ -10665,63 +10015,50 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ The `parentNode()` method steps are: 1. Let node be [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current). - 2. While node is non-null and is not [this](https://webidl.spec.whatwg.org/#this)’s [root](https://dom.spec.whatwg.org/#concept-traversal-root): - + 1. Set node to node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 2. If node is non-null and [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within [this](https://webidl.spec.whatwg.org/#this) returns `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - + 3. Return null. - To traverse children, given a walker and type, run these steps: 1. Let node be walker’s [current](https://dom.spec.whatwg.org/#treewalker-current). - 2. Set node to node’s [first child](https://dom.spec.whatwg.org/#concept-tree-first-child) if type is first, and node’s [last child](https://dom.spec.whatwg.org/#concept-tree-last-child) if type is last. - 3. While node is non-null: - + 1. Let result be the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within walker. - 2. If result is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set walker’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - 3. If result is `[FILTER_SKIP](https://dom.spec.whatwg.org/#dom-nodefilter-filter_skip)`, then: - + 1. Let child be node’s [first child](https://dom.spec.whatwg.org/#concept-tree-first-child) if type is first, and node’s [last child](https://dom.spec.whatwg.org/#concept-tree-last-child) if type is last. - 2. If child is non-null, then set node to child and [continue](https://infra.spec.whatwg.org/#iteration-continue). - + 4. While node is non-null: - + 1. Let sibling be node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling) if type is first, and node’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) if type is last. - 2. If sibling is non-null, then set node to sibling and [break](https://infra.spec.whatwg.org/#iteration-break). - 3. Let parent be node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 4. If parent is null, walker’s [root](https://dom.spec.whatwg.org/#concept-traversal-root), or walker’s [current](https://dom.spec.whatwg.org/#treewalker-current), then return null. - 5. Set node to parent. - + 4. Return null. - [TreeWalker/firstChild](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker/firstChild "The TreeWalker.firstChild() method moves the current Node to the first visible child of the current node, and returns the found child. It also moves the current node to this child. If no such child exists, returns null and the current node is not changed.") @@ -10729,15 +10066,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10749,15 +10086,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10766,31 +10103,21 @@ The `lastChild()` method steps are to [traverse children](https://dom.spec.whatw To traverse siblings, given a walker and type, run these steps: 1. Let node be walker’s [current](https://dom.spec.whatwg.org/#treewalker-current). - 2. If node is [root](https://dom.spec.whatwg.org/#concept-traversal-root), then return null. - 3. While true: - + 1. Let sibling be node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling) if type is next, and node’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) if type is previous. - 2. While sibling is non-null: - + 1. Set node to sibling. - 2. Let result be the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within walker. - 3. If result is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set walker’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - 4. Set sibling to node’s [first child](https://dom.spec.whatwg.org/#concept-tree-first-child) if type is next, and node’s [last child](https://dom.spec.whatwg.org/#concept-tree-last-child) if type is previous. - 5. If result is `[FILTER_REJECT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_reject)` or sibling is null, then set sibling to node’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling) if type is next, and node’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling) if type is previous. - + 3. Set node to node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 4. If node is null or walker’s [root](https://dom.spec.whatwg.org/#concept-traversal-root), then return null. - 5. If the return value of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within walker is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then return null. - [TreeWalker/nextSibling](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker/nextSibling "The TreeWalker.nextSibling() method moves the current Node to its next sibling, if any, and returns the found sibling. If there is no such node, return null and the current node is not changed.") @@ -10798,15 +10125,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10818,15 +10145,15 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ @@ -10838,50 +10165,41 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ The `previousNode()` method steps are: 1. Let node be [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current). - 2. While node is not [this](https://webidl.spec.whatwg.org/#this)’s [root](https://dom.spec.whatwg.org/#concept-traversal-root): - + 1. Let sibling be node’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling). - 2. While sibling is non-null: - + 1. Set node to sibling. - 2. Let result be the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within [this](https://webidl.spec.whatwg.org/#this). - 3. While result is not `[FILTER_REJECT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_reject)` and node has a [child](https://dom.spec.whatwg.org/#concept-tree-child): - + 1. Set node to node’s [last child](https://dom.spec.whatwg.org/#concept-tree-last-child). - 2. Set result to the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within [this](https://webidl.spec.whatwg.org/#this). - + 4. If result is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - 5. Set sibling to node’s [previous sibling](https://dom.spec.whatwg.org/#concept-tree-previous-sibling). - + 3. If node is [this](https://webidl.spec.whatwg.org/#this)’s [root](https://dom.spec.whatwg.org/#concept-traversal-root) or node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent) is null, then return null. - 4. Set node to node’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - 5. If the return value of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within [this](https://webidl.spec.whatwg.org/#this) is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - + 3. Return null. - [TreeWalker/nextNode](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker/nextNode "The TreeWalker.nextNode() method moves the current Node to the next visible node in the document order, and returns the found node. It also moves the current node to this one. If no such node exists, returns null and the current node is not changed.") @@ -10889,52 +10207,41 @@ In all current engines. Firefox4+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile10.1+ The `nextNode()` method steps are: 1. Let node be [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current). - 2. Let result be `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`. - 3. While true: - + 1. While result is not `[FILTER_REJECT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_reject)` and node has a [child](https://dom.spec.whatwg.org/#concept-tree-child): - + 1. Set node to its [first child](https://dom.spec.whatwg.org/#concept-tree-first-child). - 2. Set result to the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within [this](https://webidl.spec.whatwg.org/#this). - 3. If result is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - + 2. Let sibling be null. - 3. Let temporary be node. - 4. While temporary is non-null: - + 1. If temporary is [this](https://webidl.spec.whatwg.org/#this)’s [root](https://dom.spec.whatwg.org/#concept-traversal-root), then return null. - 2. Set sibling to temporary’s [next sibling](https://dom.spec.whatwg.org/#concept-tree-next-sibling). - 3. If sibling is non-null, then set node to sibling and [break](https://infra.spec.whatwg.org/#iteration-break). - 4. Set temporary to temporary’s [parent](https://dom.spec.whatwg.org/#concept-tree-parent). - + 5. Set result to the result of [filtering](https://dom.spec.whatwg.org/#concept-node-filter) node within [this](https://webidl.spec.whatwg.org/#this). - 6. If result is `[FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept)`, then set [this](https://webidl.spec.whatwg.org/#this)’s [current](https://dom.spec.whatwg.org/#treewalker-current) to node and return node. - ### 6.3. Interface `[NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)`[](https://dom.spec.whatwg.org/#interface-nodefilter) @@ -10944,15 +10251,15 @@ In all current engines. Firefox2+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ @@ -10962,63 +10269,63 @@ In all current engines. Firefox2+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IE9+ -___ +--- Firefox for Android4+iOS Safari3+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] callback interface `NodeFilter` { - // Constants for acceptNode() - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [FILTER\_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept) = 1; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [FILTER\_REJECT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_reject) = 2; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [FILTER\_SKIP](https://dom.spec.whatwg.org/#dom-nodefilter-filter_skip) = 3; - - // Constants for whatToShow - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_ALL](https://dom.spec.whatwg.org/#dom-nodefilter-show_all) = 0xFFFFFFFF; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_ELEMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_element) = 0x1; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_ATTRIBUTE](https://dom.spec.whatwg.org/#dom-nodefilter-show_attribute) = 0x2; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_TEXT](https://dom.spec.whatwg.org/#dom-nodefilter-show_text) = 0x4; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_CDATA\_SECTION](https://dom.spec.whatwg.org/#dom-nodefilter-show_cdata_section) = 0x8; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `SHOW_ENTITY_REFERENCE`[](https://dom.spec.whatwg.org/#dom-nodefilter-show_entity_reference) = 0x10; // legacy - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `SHOW_ENTITY`[](https://dom.spec.whatwg.org/#dom-nodefilter-show_entity) = 0x20; // legacy - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_PROCESSING\_INSTRUCTION](https://dom.spec.whatwg.org/#dom-nodefilter-show_processing_instruction) = 0x40; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_COMMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_comment) = 0x80; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_DOCUMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_document) = 0x100; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_DOCUMENT\_TYPE](https://dom.spec.whatwg.org/#dom-nodefilter-show_document_type) = 0x200; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW\_DOCUMENT\_FRAGMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_document_fragment) = 0x400; - const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `SHOW_NOTATION`[](https://dom.spec.whatwg.org/#dom-nodefilter-show_notation) = 0x800; // legacy - - [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `acceptNode`[](https://dom.spec.whatwg.org/#dom-nodefilter-acceptnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-nodefilter-acceptnode-node-node)); +// Constants for acceptNode() +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [FILTER_ACCEPT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_accept) = 1; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [FILTER_REJECT](https://dom.spec.whatwg.org/#dom-nodefilter-filter_reject) = 2; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) [FILTER_SKIP](https://dom.spec.whatwg.org/#dom-nodefilter-filter_skip) = 3; + +// Constants for whatToShow +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_ALL](https://dom.spec.whatwg.org/#dom-nodefilter-show_all) = 0xFFFFFFFF; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_ELEMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_element) = 0x1; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_ATTRIBUTE](https://dom.spec.whatwg.org/#dom-nodefilter-show_attribute) = 0x2; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_TEXT](https://dom.spec.whatwg.org/#dom-nodefilter-show_text) = 0x4; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_CDATA_SECTION](https://dom.spec.whatwg.org/#dom-nodefilter-show_cdata_section) = 0x8; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `SHOW_ENTITY_REFERENCE`[](https://dom.spec.whatwg.org/#dom-nodefilter-show_entity_reference) = 0x10; // legacy +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `SHOW_ENTITY`[](https://dom.spec.whatwg.org/#dom-nodefilter-show_entity) = 0x20; // legacy +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_PROCESSING_INSTRUCTION](https://dom.spec.whatwg.org/#dom-nodefilter-show_processing_instruction) = 0x40; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_COMMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_comment) = 0x80; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_DOCUMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_document) = 0x100; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_DOCUMENT_TYPE](https://dom.spec.whatwg.org/#dom-nodefilter-show_document_type) = 0x200; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [SHOW_DOCUMENT_FRAGMENT](https://dom.spec.whatwg.org/#dom-nodefilter-show_document_fragment) = 0x400; +const [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `SHOW_NOTATION`[](https://dom.spec.whatwg.org/#dom-nodefilter-show_notation) = 0x800; // legacy + +[unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `acceptNode`[](https://dom.spec.whatwg.org/#dom-nodefilter-acceptnode)([Node](https://dom.spec.whatwg.org/#node) `node`[](https://dom.spec.whatwg.org/#dom-nodefilter-acceptnode-node-node)); }; `[NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)` objects can be used as [filter](https://dom.spec.whatwg.org/#concept-traversal-filter) for `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` and `[TreeWalker](https://dom.spec.whatwg.org/#treewalker)` objects and also provide constants for their [whatToShow](https://dom.spec.whatwg.org/#concept-traversal-whattoshow) bitmask. A `[NodeFilter](https://dom.spec.whatwg.org/#callbackdef-nodefilter)` object is typically implemented as a JavaScript function. These constants can be used as [filter](https://dom.spec.whatwg.org/#concept-traversal-filter) return value: -- `FILTER_ACCEPT` (1); -- `FILTER_REJECT` (2); -- `FILTER_SKIP` (3). +- `FILTER_ACCEPT` (1); +- `FILTER_REJECT` (2); +- `FILTER_SKIP` (3). These constants can be used for [whatToShow](https://dom.spec.whatwg.org/#concept-traversal-whattoshow): -- `SHOW_ALL` (4294967295, FFFFFFFF in hexadecimal); -- `SHOW_ELEMENT` (1); -- `SHOW_ATTRIBUTE` (2); -- `SHOW_TEXT` (4); -- `SHOW_CDATA_SECTION` (8); -- `SHOW_PROCESSING_INSTRUCTION` (64, 40 in hexadecimal); -- (128, 80 in hexadecimal); -- `SHOW_DOCUMENT` (256, 100 in hexadecimal); -- `SHOW_DOCUMENT_TYPE` (512, 200 in hexadecimal); -- `SHOW_DOCUMENT_FRAGMENT` (1024, 400 in hexadecimal). +- `SHOW_ALL` (4294967295, FFFFFFFF in hexadecimal); +- `SHOW_ELEMENT` (1); +- `SHOW_ATTRIBUTE` (2); +- `SHOW_TEXT` (4); +- `SHOW_CDATA_SECTION` (8); +- `SHOW_PROCESSING_INSTRUCTION` (64, 40 in hexadecimal); +- (128, 80 in hexadecimal); +- `SHOW_DOCUMENT` (256, 100 in hexadecimal); +- `SHOW_DOCUMENT_TYPE` (512, 200 in hexadecimal); +- `SHOW_DOCUMENT_FRAGMENT` (1024, 400 in hexadecimal). ## 7\. Sets[](https://dom.spec.whatwg.org/#sets) @@ -11032,30 +10339,30 @@ In all current engines. Firefox3.6+Safari6+Chrome8+ -___ +--- Opera11.5+Edge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera Mobile11.5+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `DOMTokenList` { - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-domtokenlist-length); - getter [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [item](https://dom.spec.whatwg.org/#dom-domtokenlist-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-domtokenlist-item-index-index)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [contains](https://dom.spec.whatwg.org/#dom-domtokenlist-contains)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-contains-token-token)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [add](https://dom.spec.whatwg.org/#dom-domtokenlist-add)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)... `tokens`[](https://dom.spec.whatwg.org/#dom-domtokenlist-add-tokens-tokens)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [remove](https://dom.spec.whatwg.org/#dom-domtokenlist-remove)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)... `tokens`[](https://dom.spec.whatwg.org/#dom-domtokenlist-remove-tokens-tokens)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [toggle](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle-token-force-token), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `force`[](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle-token-force-force)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [replace](https://dom.spec.whatwg.org/#dom-domtokenlist-replace)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-replace-token-newtoken-token), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `newToken`[](https://dom.spec.whatwg.org/#dom-domtokenlist-replace-token-newtoken-newtoken)); - [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [supports](https://dom.spec.whatwg.org/#dom-domtokenlist-supports)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-supports-token-token)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] stringifier[](https://dom.spec.whatwg.org/#DOMTokenList-stringification-behavior) attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [value](https://dom.spec.whatwg.org/#dom-domtokenlist-value); - iterable<[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)\>; +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) [length](https://dom.spec.whatwg.org/#dom-domtokenlist-length); +getter [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? [item](https://dom.spec.whatwg.org/#dom-domtokenlist-item)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-domtokenlist-item-index-index)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [contains](https://dom.spec.whatwg.org/#dom-domtokenlist-contains)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-contains-token-token)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [add](https://dom.spec.whatwg.org/#dom-domtokenlist-add)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)... `tokens`[](https://dom.spec.whatwg.org/#dom-domtokenlist-add-tokens-tokens)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [undefined](https://webidl.spec.whatwg.org/#idl-undefined) [remove](https://dom.spec.whatwg.org/#dom-domtokenlist-remove)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)... `tokens`[](https://dom.spec.whatwg.org/#dom-domtokenlist-remove-tokens-tokens)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [toggle](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle-token-force-token), optional [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `force`[](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle-token-force-force)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [boolean](https://webidl.spec.whatwg.org/#idl-boolean) [replace](https://dom.spec.whatwg.org/#dom-domtokenlist-replace)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-replace-token-newtoken-token), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `newToken`[](https://dom.spec.whatwg.org/#dom-domtokenlist-replace-token-newtoken-newtoken)); +[boolean](https://webidl.spec.whatwg.org/#idl-boolean) [supports](https://dom.spec.whatwg.org/#dom-domtokenlist-supports)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `token`[](https://dom.spec.whatwg.org/#dom-domtokenlist-supports-token-token)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] stringifier[](https://dom.spec.whatwg.org/#DOMTokenList-stringification-behavior) attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) [value](https://dom.spec.whatwg.org/#dom-domtokenlist-value); +iterable<[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)\>; }; A `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object has an associated token set (a [set](https://infra.spec.whatwg.org/#ordered-set)), which is initially empty. @@ -11067,42 +10374,30 @@ A `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object also has an A `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object’s validation steps for a given token are: 1. If the associated [attribute](https://dom.spec.whatwg.org/#concept-attribute)’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) does not define [supported tokens](https://dom.spec.whatwg.org/#concept-supported-tokens), [throw](https://webidl.spec.whatwg.org/#dfn-throw) a `TypeError`. - 2. Let lowercase token be a copy of token, in [ASCII lowercase](https://infra.spec.whatwg.org/#ascii-lowercase). - 3. If lowercase token is present in [supported tokens](https://dom.spec.whatwg.org/#concept-supported-tokens), return true. - 4. Return false. - A `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object’s update steps are: 1. If the associated [element](https://dom.spec.whatwg.org/#concept-element) does not have an associated [attribute](https://dom.spec.whatwg.org/#concept-attribute) and [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens) is empty, then return. - 2. [Set an attribute value](https://dom.spec.whatwg.org/#concept-element-attributes-set-value) for the associated [element](https://dom.spec.whatwg.org/#concept-element) using associated [attribute](https://dom.spec.whatwg.org/#concept-attribute)’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name) and the result of running the [ordered set serializer](https://dom.spec.whatwg.org/#concept-ordered-set-serializer) for [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens). - A `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object’s serialize steps are to return the result of running [get an attribute value](https://dom.spec.whatwg.org/#concept-element-attributes-get-value) given the associated [element](https://dom.spec.whatwg.org/#concept-element) and the associated [attribute](https://dom.spec.whatwg.org/#concept-attribute)’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name). -___ +--- A `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object has these [attribute change steps](https://dom.spec.whatwg.org/#concept-element-attributes-change-ext) for its associated [element](https://dom.spec.whatwg.org/#concept-element): 1. If localName is associated attribute’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), namespace is null, and value is null, then [empty](https://infra.spec.whatwg.org/#list-empty) [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens). - 2. Otherwise, if localName is associated attribute’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name), namespace is null, then set [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens) to value, [parsed](https://dom.spec.whatwg.org/#concept-ordered-set-parser). - When a `[DOMTokenList](https://dom.spec.whatwg.org/#domtokenlist)` object is created, then: 1. Let element be associated [element](https://dom.spec.whatwg.org/#concept-element). - 2. Let localName be associated attribute’s [local name](https://dom.spec.whatwg.org/#concept-attribute-local-name). - 3. Let value be the result of [getting an attribute value](https://dom.spec.whatwg.org/#concept-element-attributes-get-value) given element and localName. - 4. Run the [attribute change steps](https://dom.spec.whatwg.org/#concept-element-attributes-change-ext) for element, localName, value, value, and null. - [DOMTokenList/length](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/length "The length read-only property of the DOMTokenList interface is an integer representing the number of objects stored in the object.") @@ -11110,19 +10405,19 @@ In all current engines. Firefox50+Safari6+Chrome8+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android50+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera MobileYes -``tokenlist . `[length](https://dom.spec.whatwg.org/#dom-domtokenlist-length)` `` +`` tokenlist . `[length](https://dom.spec.whatwg.org/#dom-domtokenlist-length)` `` Returns the number of tokens. @@ -11132,19 +10427,19 @@ In all current engines. Firefox3.6+Safari6+Chrome8+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera MobileYes -``tokenlist . `[item(index)](https://dom.spec.whatwg.org/#dom-domtokenlist-item)` `` +`` tokenlist . `[item(index)](https://dom.spec.whatwg.org/#dom-domtokenlist-item)` `` `tokenlist[index]` @@ -11156,19 +10451,19 @@ In all current engines. Firefox3.6+Safari6+Chrome8+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera MobileYes -``tokenlist . `[contains(token)](https://dom.spec.whatwg.org/#dom-domtokenlist-contains)` `` +`` tokenlist . `[contains(token)](https://dom.spec.whatwg.org/#dom-domtokenlist-contains)` `` Returns true if token is present; otherwise false. @@ -11178,15 +10473,15 @@ In all current engines. Firefox3.6+Safari6+Chrome8+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera MobileYes @@ -11204,15 +10499,15 @@ In all current engines. Firefox3.6+Safari6+Chrome8+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera MobileYes @@ -11230,15 +10525,15 @@ In all current engines. Firefox3.6+Safari6+Chrome8+ -___ +--- OperaYesEdge79+ -___ +--- Edge (Legacy)12+IE10+ -___ +--- Firefox for Android4+iOS Safari6+Chrome for Android18+Android WebView3+Samsung Internet1.0+Opera MobileYes @@ -11258,15 +10553,15 @@ In all current engines. Firefox49+Safari10.1+Chrome61+ -___ +--- Opera48+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10.3+Chrome for Android61+Android WebView61+Samsung Internet8.0+Opera Mobile45+ @@ -11286,15 +10581,15 @@ In all current engines. Firefox49+Safari10.1+Chrome49+ -___ +--- Opera36+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android49+iOS Safari10.3+Chrome for Android49+Android WebView49+Samsung Internet5.0+Opera Mobile36+ @@ -11310,19 +10605,19 @@ In all current engines. Firefox47+Safari10+Chrome50+ -___ +--- Opera37+Edge79+ -___ +--- Edge (Legacy)17+IENone -___ +--- Firefox for Android47+iOS Safari10+Chrome for Android50+Android WebView50+Samsung Internet5.0+Opera Mobile37+ -``tokenlist . `[value](https://dom.spec.whatwg.org/#dom-domtokenlist-value)` `` +`` tokenlist . `[value](https://dom.spec.whatwg.org/#dom-domtokenlist-value)` `` Returns the associated set as string. @@ -11335,80 +10630,59 @@ The object’s [supported property indices](https://webidl.spec.whatwg.org/#dfn- The `item(index)` method steps are: 1. If index is equal to or greater than [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens)’s [size](https://infra.spec.whatwg.org/#list-size), then return null. - 2. Return [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens)\[index\]. - The `contains(token)` method steps are to return true if [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens)\[token\] [exists](https://infra.spec.whatwg.org/#list-contain); otherwise false. The `add(tokens…)` method steps are: 1. [For each](https://infra.spec.whatwg.org/#list-iterate) token in tokens: - + 1. If token is the empty string, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If token contains any [ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + 2. [For each](https://infra.spec.whatwg.org/#list-iterate) token in tokens, [append](https://infra.spec.whatwg.org/#set-append) token to [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens). - 3. Run the [update steps](https://dom.spec.whatwg.org/#concept-dtl-update). - The `remove(tokens…)` method steps are: 1. [For each](https://infra.spec.whatwg.org/#list-iterate) token in tokens: - + 1. If token is the empty string, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If token contains any [ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - + 2. For each token in tokens, [remove](https://infra.spec.whatwg.org/#list-remove) token from [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens). - 3. Run the [update steps](https://dom.spec.whatwg.org/#concept-dtl-update). - The `toggle(token, force)` method steps are: 1. If token is the empty string, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If token contains any [ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. If [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens)\[token\] [exists](https://infra.spec.whatwg.org/#list-contain), then: - + 1. If force is either not given or is false, then [remove](https://infra.spec.whatwg.org/#list-remove) token from [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens), run the [update steps](https://dom.spec.whatwg.org/#concept-dtl-update) and return false. - 2. Return true. - + 4. Otherwise, if force not given or is true, [append](https://infra.spec.whatwg.org/#set-append) token to [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens), run the [update steps](https://dom.spec.whatwg.org/#concept-dtl-update), and return true. - 5. Return false. - The [update steps](https://dom.spec.whatwg.org/#concept-dtl-update) are not always run for `[toggle()](https://dom.spec.whatwg.org/#dom-domtokenlist-toggle)` for web compatibility. The `replace(token, newToken)` method steps are: 1. If either token or newToken is the empty string, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) a "`[SyntaxError](https://webidl.spec.whatwg.org/#syntaxerror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 2. If either token or newToken contains any [ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "`[InvalidCharacterError](https://webidl.spec.whatwg.org/#invalidcharactererror)`" `[DOMException](https://webidl.spec.whatwg.org/#idl-DOMException)`. - 3. If [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens) does not [contain](https://infra.spec.whatwg.org/#list-contain) token, then return false. - 4. [Replace](https://infra.spec.whatwg.org/#set-replace) token in [this](https://webidl.spec.whatwg.org/#this)’s [token set](https://dom.spec.whatwg.org/#concept-dtl-tokens) with newToken. - 5. Run the [update steps](https://dom.spec.whatwg.org/#concept-dtl-update). - 6. Return true. - The [update steps](https://dom.spec.whatwg.org/#concept-dtl-update) are not always run for `[replace()](https://dom.spec.whatwg.org/#dom-domtokenlist-replace)` for web compatibility. The `supports(token)` method steps are: 1. Let result be the return value of [validation steps](https://dom.spec.whatwg.org/#concept-domtokenlist-validation) called with token. - 2. Return result. - The `value` attribute must return the result of running [this](https://webidl.spec.whatwg.org/#this)’s [serialize steps](https://dom.spec.whatwg.org/#concept-dtl-serialize). @@ -11426,15 +10700,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11444,15 +10718,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11462,15 +10736,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile14+ @@ -11480,15 +10754,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11498,15 +10772,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11516,15 +10790,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera15+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile14+ @@ -11534,15 +10808,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11552,15 +10826,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11570,15 +10844,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11588,41 +10862,41 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `XPathResult` { - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ANY_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-any_type) = 0; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `NUMBER_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-number_type) = 1; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `STRING_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-string_type) = 2; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `BOOLEAN_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-boolean_type) = 3; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `UNORDERED_NODE_ITERATOR_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-unordered_node_iterator_type) = 4; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ORDERED_NODE_ITERATOR_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-ordered_node_iterator_type) = 5; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `UNORDERED_NODE_SNAPSHOT_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-unordered_node_snapshot_type) = 6; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ORDERED_NODE_SNAPSHOT_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-ordered_node_snapshot_type) = 7; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ANY_UNORDERED_NODE_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-any_unordered_node_type) = 8; - const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `FIRST_ORDERED_NODE_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-first_ordered_node_type) = 9; - - readonly attribute [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `resultType`[](https://dom.spec.whatwg.org/#dom-xpathresult-resulttype); - readonly attribute [unrestricted double](https://webidl.spec.whatwg.org/#idl-unrestricted-double) `numberValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-numbervalue); - readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `stringValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-stringvalue); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `booleanValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-booleanvalue); - readonly attribute [Node](https://dom.spec.whatwg.org/#node)? `singleNodeValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-singlenodevalue); - readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `invalidIteratorState`[](https://dom.spec.whatwg.org/#dom-xpathresult-invaliditeratorstate); - readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `snapshotLength`[](https://dom.spec.whatwg.org/#dom-xpathresult-snapshotlength); - - [Node](https://dom.spec.whatwg.org/#node)? `iterateNext`[](https://dom.spec.whatwg.org/#dom-xpathresult-iteratenext)(); - [Node](https://dom.spec.whatwg.org/#node)? `snapshotItem`[](https://dom.spec.whatwg.org/#dom-xpathresult-snapshotitem)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-xpathresult-snapshotitem-index-index)); +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ANY_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-any_type) = 0; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `NUMBER_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-number_type) = 1; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `STRING_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-string_type) = 2; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `BOOLEAN_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-boolean_type) = 3; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `UNORDERED_NODE_ITERATOR_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-unordered_node_iterator_type) = 4; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ORDERED_NODE_ITERATOR_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-ordered_node_iterator_type) = 5; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `UNORDERED_NODE_SNAPSHOT_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-unordered_node_snapshot_type) = 6; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ORDERED_NODE_SNAPSHOT_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-ordered_node_snapshot_type) = 7; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `ANY_UNORDERED_NODE_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-any_unordered_node_type) = 8; +const [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `FIRST_ORDERED_NODE_TYPE`[](https://dom.spec.whatwg.org/#dom-xpathresult-first_ordered_node_type) = 9; + +readonly attribute [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `resultType`[](https://dom.spec.whatwg.org/#dom-xpathresult-resulttype); +readonly attribute [unrestricted double](https://webidl.spec.whatwg.org/#idl-unrestricted-double) `numberValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-numbervalue); +readonly attribute [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `stringValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-stringvalue); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `booleanValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-booleanvalue); +readonly attribute [Node](https://dom.spec.whatwg.org/#node)? `singleNodeValue`[](https://dom.spec.whatwg.org/#dom-xpathresult-singlenodevalue); +readonly attribute [boolean](https://webidl.spec.whatwg.org/#idl-boolean) `invalidIteratorState`[](https://dom.spec.whatwg.org/#dom-xpathresult-invaliditeratorstate); +readonly attribute [unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `snapshotLength`[](https://dom.spec.whatwg.org/#dom-xpathresult-snapshotlength); + +[Node](https://dom.spec.whatwg.org/#node)? `iterateNext`[](https://dom.spec.whatwg.org/#dom-xpathresult-iteratenext)(); +[Node](https://dom.spec.whatwg.org/#node)? `snapshotItem`[](https://dom.spec.whatwg.org/#dom-xpathresult-snapshotitem)([unsigned long](https://webidl.spec.whatwg.org/#idl-unsigned-long) `index`[](https://dom.spec.whatwg.org/#dom-xpathresult-snapshotitem-index-index)); }; ### 8.2. Interface `[XPathExpression](https://dom.spec.whatwg.org/#xpathexpression)`[](https://dom.spec.whatwg.org/#interface-xpathexpression) @@ -11633,15 +10907,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11651,22 +10925,22 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `XPathExpression` { - // XPathResult.ANY\_TYPE = 0 - [XPathResult](https://dom.spec.whatwg.org/#xpathresult) `evaluate`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate)([Node](https://dom.spec.whatwg.org/#node) `contextNode`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate-contextnode-type-result-contextnode), optional [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `type`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate-contextnode-type-result-type) = 0, optional [XPathResult](https://dom.spec.whatwg.org/#xpathresult)? `result`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate-contextnode-type-result-result) = null); +// XPathResult.ANY_TYPE = 0 +[XPathResult](https://dom.spec.whatwg.org/#xpathresult) `evaluate`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate)([Node](https://dom.spec.whatwg.org/#node) `contextNode`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate-contextnode-type-result-contextnode), optional [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `type`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate-contextnode-type-result-type) = 0, optional [XPathResult](https://dom.spec.whatwg.org/#xpathresult)? `result`[](https://dom.spec.whatwg.org/#dom-xpathexpression-evaluate-contextnode-type-result-result) = null); }; ### 8.3. Mixin `[XPathEvaluatorBase](https://dom.spec.whatwg.org/#xpathevaluatorbase)`[](https://dom.spec.whatwg.org/#mixin-xpathevaluatorbase) @@ -11677,15 +10951,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ @@ -11695,15 +10969,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11713,15 +10987,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12.1+ @@ -11731,15 +11005,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ @@ -11749,15 +11023,15 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera9+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile10.1+ @@ -11767,27 +11041,27 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ callback interface `XPathNSResolver` { - [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `lookupNamespaceURI`[](https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `prefix`[](https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri-prefix-prefix)); +[DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `lookupNamespaceURI`[](https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString)? `prefix`[](https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri-prefix-prefix)); }; interface mixin `XPathEvaluatorBase` { - \[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [XPathExpression](https://dom.spec.whatwg.org/#xpathexpression) `createExpression`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-createexpression)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `expression`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-createexpression-expression-resolver-expression), optional [XPathNSResolver](https://dom.spec.whatwg.org/#callbackdef-xpathnsresolver)? `resolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-createexpression-expression-resolver-resolver) = null); - [XPathNSResolver](https://dom.spec.whatwg.org/#callbackdef-xpathnsresolver) `createNSResolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-creatensresolver)([Node](https://dom.spec.whatwg.org/#node) `nodeResolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-creatensresolver-noderesolver-noderesolver)); - // XPathResult.ANY\_TYPE = 0 - [XPathResult](https://dom.spec.whatwg.org/#xpathresult) `evaluate`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `expression`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-expression), [Node](https://dom.spec.whatwg.org/#node) `contextNode`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-contextnode), optional [XPathNSResolver](https://dom.spec.whatwg.org/#callbackdef-xpathnsresolver)? `resolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-resolver) = null, optional [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `type`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-type) = 0, optional [XPathResult](https://dom.spec.whatwg.org/#xpathresult)? `result`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-result) = null); +\[[NewObject](https://webidl.spec.whatwg.org/#NewObject)\] [XPathExpression](https://dom.spec.whatwg.org/#xpathexpression) `createExpression`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-createexpression)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `expression`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-createexpression-expression-resolver-expression), optional [XPathNSResolver](https://dom.spec.whatwg.org/#callbackdef-xpathnsresolver)? `resolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-createexpression-expression-resolver-resolver) = null); +[XPathNSResolver](https://dom.spec.whatwg.org/#callbackdef-xpathnsresolver) `createNSResolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-creatensresolver)([Node](https://dom.spec.whatwg.org/#node) `nodeResolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-creatensresolver-noderesolver-noderesolver)); +// XPathResult.ANY_TYPE = 0 +[XPathResult](https://dom.spec.whatwg.org/#xpathresult) `evaluate`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate)([DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `expression`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-expression), [Node](https://dom.spec.whatwg.org/#node) `contextNode`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-contextnode), optional [XPathNSResolver](https://dom.spec.whatwg.org/#callbackdef-xpathnsresolver)? `resolver`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-resolver) = null, optional [unsigned short](https://webidl.spec.whatwg.org/#idl-unsigned-short) `type`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-type) = 0, optional [XPathResult](https://dom.spec.whatwg.org/#xpathresult)? `result`[](https://dom.spec.whatwg.org/#dom-xpathevaluatorbase-evaluate-expression-contextnode-resolver-type-result-result) = null); }; [Document](https://dom.spec.whatwg.org/#document) includes [XPathEvaluatorBase](https://dom.spec.whatwg.org/#xpathevaluatorbase); @@ -11799,21 +11073,21 @@ In all current engines. Firefox1+Safari3+Chrome1+ -___ +--- Opera12.1+Edge79+ -___ +--- Edge (Legacy)12+IENone -___ +--- Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+ \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `XPathEvaluator` { - `constructor`[](https://dom.spec.whatwg.org/#dom-xpathevaluator-xpathevaluator)(); +`constructor`[](https://dom.spec.whatwg.org/#dom-xpathevaluator-xpathevaluator)(); }; [XPathEvaluator](https://dom.spec.whatwg.org/#xpathevaluator) includes [XPathEvaluatorBase](https://dom.spec.whatwg.org/#xpathevaluatorbase); @@ -11828,15 +11102,15 @@ XSL Transformations (XSLT) is a language for transforming XML documents into oth \[[Exposed](https://webidl.spec.whatwg.org/#Exposed)\=Window\] interface `XSLTProcessor` { - `constructor`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-xsltprocessor)(); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) `importStylesheet`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-importstylesheet)([Node](https://dom.spec.whatwg.org/#node) `style`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-importstylesheet-style-style)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) `transformToFragment`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtofragment)([Node](https://dom.spec.whatwg.org/#node) `source`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtofragment-source-output-source), [Document](https://dom.spec.whatwg.org/#document) `output`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtofragment-source-output-output)); - \[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Document](https://dom.spec.whatwg.org/#document) `transformToDocument`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtodocument)([Node](https://dom.spec.whatwg.org/#node) `source`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtodocument-source-source)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) `setParameter`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter)(\[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `namespaceURI`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter-namespaceuri-localname-value-namespaceuri), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter-namespaceuri-localname-value-localname), [any](https://webidl.spec.whatwg.org/#idl-any) `value`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter-namespaceuri-localname-value-value)); - [any](https://webidl.spec.whatwg.org/#idl-any) `getParameter`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-getparameter)(\[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `namespaceURI`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-getparameter-namespaceuri-localname-namespaceuri), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-getparameter-namespaceuri-localname-localname)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) `removeParameter`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-removeparameter)(\[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `namespaceURI`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-removeparameter-namespaceuri-localname-namespaceuri), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-removeparameter-namespaceuri-localname-localname)); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) `clearParameters`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-clearparameters)(); - [undefined](https://webidl.spec.whatwg.org/#idl-undefined) `reset`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-reset)(); +`constructor`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-xsltprocessor)(); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) `importStylesheet`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-importstylesheet)([Node](https://dom.spec.whatwg.org/#node) `style`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-importstylesheet-style-style)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [DocumentFragment](https://dom.spec.whatwg.org/#documentfragment) `transformToFragment`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtofragment)([Node](https://dom.spec.whatwg.org/#node) `source`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtofragment-source-output-source), [Document](https://dom.spec.whatwg.org/#document) `output`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtofragment-source-output-output)); +\[[CEReactions](https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions)\] [Document](https://dom.spec.whatwg.org/#document) `transformToDocument`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtodocument)([Node](https://dom.spec.whatwg.org/#node) `source`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-transformtodocument-source-source)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) `setParameter`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter)(\[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `namespaceURI`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter-namespaceuri-localname-value-namespaceuri), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter-namespaceuri-localname-value-localname), [any](https://webidl.spec.whatwg.org/#idl-any) `value`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-setparameter-namespaceuri-localname-value-value)); +[any](https://webidl.spec.whatwg.org/#idl-any) `getParameter`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-getparameter)(\[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `namespaceURI`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-getparameter-namespaceuri-localname-namespaceuri), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-getparameter-namespaceuri-localname-localname)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) `removeParameter`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-removeparameter)(\[[LegacyNullToEmptyString](https://webidl.spec.whatwg.org/#LegacyNullToEmptyString)\] [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `namespaceURI`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-removeparameter-namespaceuri-localname-namespaceuri), [DOMString](https://webidl.spec.whatwg.org/#idl-DOMString) `localName`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-removeparameter-namespaceuri-localname-localname)); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) `clearParameters`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-clearparameters)(); +[undefined](https://webidl.spec.whatwg.org/#idl-undefined) `reset`[](https://dom.spec.whatwg.org/#dom-xsltprocessor-reset)(); }; ## 10\. Historical[](https://dom.spec.whatwg.org/#historical) @@ -11845,78 +11119,78 @@ This standard used to contain several interfaces and interface members that have These interfaces have been removed: -- `DOMConfiguration`[](https://dom.spec.whatwg.org/#domconfiguration) -- `DOMError`[](https://dom.spec.whatwg.org/#domerror) -- `DOMErrorHandler`[](https://dom.spec.whatwg.org/#domerrorhandler) -- `DOMImplementationList`[](https://dom.spec.whatwg.org/#domimplementationlist) -- `DOMImplementationSource`[](https://dom.spec.whatwg.org/#domimplementationsource) -- `DOMLocator`[](https://dom.spec.whatwg.org/#domlocator) -- `DOMObject`[](https://dom.spec.whatwg.org/#domobject) -- `DOMUserData`[](https://dom.spec.whatwg.org/#domuserdata) -- `Entity`[](https://dom.spec.whatwg.org/#entity) -- `EntityReference`[](https://dom.spec.whatwg.org/#entityreference) -- `MutationEvent`[](https://dom.spec.whatwg.org/#mutationevent) -- `MutationNameEvent`[](https://dom.spec.whatwg.org/#mutationnameevent) -- `NameList`[](https://dom.spec.whatwg.org/#namelist) -- `Notation`[](https://dom.spec.whatwg.org/#notation) -- `RangeException`[](https://dom.spec.whatwg.org/#rangeexception) -- `TypeInfo`[](https://dom.spec.whatwg.org/#typeinfo) -- `UserDataHandler`[](https://dom.spec.whatwg.org/#userdatahandler) +- `DOMConfiguration`[](https://dom.spec.whatwg.org/#domconfiguration) +- `DOMError`[](https://dom.spec.whatwg.org/#domerror) +- `DOMErrorHandler`[](https://dom.spec.whatwg.org/#domerrorhandler) +- `DOMImplementationList`[](https://dom.spec.whatwg.org/#domimplementationlist) +- `DOMImplementationSource`[](https://dom.spec.whatwg.org/#domimplementationsource) +- `DOMLocator`[](https://dom.spec.whatwg.org/#domlocator) +- `DOMObject`[](https://dom.spec.whatwg.org/#domobject) +- `DOMUserData`[](https://dom.spec.whatwg.org/#domuserdata) +- `Entity`[](https://dom.spec.whatwg.org/#entity) +- `EntityReference`[](https://dom.spec.whatwg.org/#entityreference) +- `MutationEvent`[](https://dom.spec.whatwg.org/#mutationevent) +- `MutationNameEvent`[](https://dom.spec.whatwg.org/#mutationnameevent) +- `NameList`[](https://dom.spec.whatwg.org/#namelist) +- `Notation`[](https://dom.spec.whatwg.org/#notation) +- `RangeException`[](https://dom.spec.whatwg.org/#rangeexception) +- `TypeInfo`[](https://dom.spec.whatwg.org/#typeinfo) +- `UserDataHandler`[](https://dom.spec.whatwg.org/#userdatahandler) And these interface members have been removed: `[Attr](https://dom.spec.whatwg.org/#attr)` -- `schemaTypeInfo`[](https://dom.spec.whatwg.org/#dom-attr-schematypeinfo) -- `isId`[](https://dom.spec.whatwg.org/#dom-attr-isid) +- `schemaTypeInfo`[](https://dom.spec.whatwg.org/#dom-attr-schematypeinfo) +- `isId`[](https://dom.spec.whatwg.org/#dom-attr-isid) `[Document](https://dom.spec.whatwg.org/#document)` -- `createEntityReference()`[](https://dom.spec.whatwg.org/#dom-document-createentityreference) -- `xmlEncoding`[](https://dom.spec.whatwg.org/#dom-document-xmlencoding) -- `xmlStandalone`[](https://dom.spec.whatwg.org/#dom-document-xmlstandalone) -- `xmlVersion`[](https://dom.spec.whatwg.org/#dom-document-xmlversion) -- `strictErrorChecking`[](https://dom.spec.whatwg.org/#dom-document-stricterrorchecking) -- `domConfig`[](https://dom.spec.whatwg.org/#dom-document-domconfig) -- `normalizeDocument()`[](https://dom.spec.whatwg.org/#dom-document-normalizedocument) -- `renameNode()`[](https://dom.spec.whatwg.org/#dom-document-renamenode) +- `createEntityReference()`[](https://dom.spec.whatwg.org/#dom-document-createentityreference) +- `xmlEncoding`[](https://dom.spec.whatwg.org/#dom-document-xmlencoding) +- `xmlStandalone`[](https://dom.spec.whatwg.org/#dom-document-xmlstandalone) +- `xmlVersion`[](https://dom.spec.whatwg.org/#dom-document-xmlversion) +- `strictErrorChecking`[](https://dom.spec.whatwg.org/#dom-document-stricterrorchecking) +- `domConfig`[](https://dom.spec.whatwg.org/#dom-document-domconfig) +- `normalizeDocument()`[](https://dom.spec.whatwg.org/#dom-document-normalizedocument) +- `renameNode()`[](https://dom.spec.whatwg.org/#dom-document-renamenode) `[DocumentType](https://dom.spec.whatwg.org/#documenttype)` -- `entities`[](https://dom.spec.whatwg.org/#dom-documenttype-entities) -- `notations`[](https://dom.spec.whatwg.org/#dom-documenttype-notations) -- `internalSubset`[](https://dom.spec.whatwg.org/#dom-documenttype-internalsubset) +- `entities`[](https://dom.spec.whatwg.org/#dom-documenttype-entities) +- `notations`[](https://dom.spec.whatwg.org/#dom-documenttype-notations) +- `internalSubset`[](https://dom.spec.whatwg.org/#dom-documenttype-internalsubset) `[DOMImplementation](https://dom.spec.whatwg.org/#domimplementation)` -- `getFeature()`[](https://dom.spec.whatwg.org/#dom-domimplementation-getfeature) +- `getFeature()`[](https://dom.spec.whatwg.org/#dom-domimplementation-getfeature) `[Element](https://dom.spec.whatwg.org/#element)` -- `schemaTypeInfo`[](https://dom.spec.whatwg.org/#dom-element-schematypeinfo) -- `setIdAttribute()`[](https://dom.spec.whatwg.org/#dom-element-setidattribute) -- `setIdAttributeNS()`[](https://dom.spec.whatwg.org/#dom-element-setidattributens) -- `setIdAttributeNode()`[](https://dom.spec.whatwg.org/#dom-element-setidattributenode) +- `schemaTypeInfo`[](https://dom.spec.whatwg.org/#dom-element-schematypeinfo) +- `setIdAttribute()`[](https://dom.spec.whatwg.org/#dom-element-setidattribute) +- `setIdAttributeNS()`[](https://dom.spec.whatwg.org/#dom-element-setidattributens) +- `setIdAttributeNode()`[](https://dom.spec.whatwg.org/#dom-element-setidattributenode) `[Node](https://dom.spec.whatwg.org/#node)` -- `isSupported`[](https://dom.spec.whatwg.org/#dom-node-issupported) -- `getFeature()`[](https://dom.spec.whatwg.org/#dom-node-getfeature) -- `getUserData()`[](https://dom.spec.whatwg.org/#dom-node-getuserdata) -- `setUserData()`[](https://dom.spec.whatwg.org/#dom-node-setuserdata) +- `isSupported`[](https://dom.spec.whatwg.org/#dom-node-issupported) +- `getFeature()`[](https://dom.spec.whatwg.org/#dom-node-getfeature) +- `getUserData()`[](https://dom.spec.whatwg.org/#dom-node-getuserdata) +- `setUserData()`[](https://dom.spec.whatwg.org/#dom-node-setuserdata) `[NodeIterator](https://dom.spec.whatwg.org/#nodeiterator)` -- `expandEntityReferences`[](https://dom.spec.whatwg.org/#dom-nodeiterator-expandentityreferences) +- `expandEntityReferences`[](https://dom.spec.whatwg.org/#dom-nodeiterator-expandentityreferences) `[Text](https://dom.spec.whatwg.org/#text)` -- `isElementContentWhitespace`[](https://dom.spec.whatwg.org/#dom-text-iselementcontentwhitespace) -- `replaceWholeText()`[](https://dom.spec.whatwg.org/#dom-text-replacewholetext) +- `isElementContentWhitespace`[](https://dom.spec.whatwg.org/#dom-text-iselementcontentwhitespace) +- `replaceWholeText()`[](https://dom.spec.whatwg.org/#dom-text-replacewholetext) `[TreeWalker](https://dom.spec.whatwg.org/#treewalker)` -- `expandEntityReferences`[](https://dom.spec.whatwg.org/#dom-treewalker-expandentityreferences) +- `expandEntityReferences`[](https://dom.spec.whatwg.org/#dom-treewalker-expandentityreferences) ## Acknowledgments[](https://dom.spec.whatwg.org/#acks) diff --git a/notes/BGOONZ_BLOG_2.0.wiki/articles/Data-Structures.md b/notes/BGOONZ_BLOG_2.0.wiki/articles/Data-Structures.md index fb324a96c3..22726641b6 100644 --- a/notes/BGOONZ_BLOG_2.0.wiki/articles/Data-Structures.md +++ b/notes/BGOONZ_BLOG_2.0.wiki/articles/Data-Structures.md @@ -1,5 +1,4 @@ -What are data structures ------------------------- +## What are data structures Data structures, at a high level, are techniques for storing and organizing data that make it easier to modify, navigate, and access. Data structures determine how data is collected, the functions we can use to access it, and the relationships between data. @@ -7,11 +6,11 @@ Data structures are used in almost all areas of computer science and programmin Data structures enable us to: -- Manage and utilize large datasets -- Search for particular data from a database -- Design algorithms that are tailored towards particular programs -- Handle multiple requests from users at once -- Simplify and speed up data processing +- Manage and utilize large datasets +- Search for particular data from a database +- Design algorithms that are tailored towards particular programs +- Handle multiple requests from users at once +- Simplify and speed up data processing Data structures are vital for efficient, real-world problem solving. After all, the way we organize data has a lot of impact on performance and useability. In fact, most top companies require a strong understanding of data structures. @@ -21,8 +20,7 @@ JavaScript has primitive and non-primitive data structures. Primitive data stru Non-primitive data structures are not defined by the programming language but rather by the programmer. These include linear data structures, static data structures, and dynamic data structures, like queue and linked lists. -1\. Array ---------- +## 1\. Array The most basic of all data structures, an array stores data in memory for later use. Each array has a fixed number of cells decided on its creation, and each cell has a corresponding numeric index used to select its data. Whenever you'd like to use the array, all you need are the desired indices, and you can access any of the data within. @@ -30,22 +28,21 @@ The most basic of all data structures, an array stores data in memory for later Advantages -- Simple to create and use. -- Foundational building block for complex data structures +- Simple to create and use. +- Foundational building block for complex data structures Disadvantages -- Fixed size -- Expensive to insert/delete or resequence values -- Inefficient to sort +- Fixed size +- Expensive to insert/delete or resequence values +- Inefficient to sort ### Applications -- Basic spreadsheets -- Within complex structures such as hash tables +- Basic spreadsheets +- Within complex structures such as hash tables -2\. Queues ----------- +## 2\. Queues Queues are conceptually similar to stacks; both are sequential structures, but queues process elements in the order they were entered rather than the most recent element. @@ -57,22 +54,21 @@ For a visual, consider a single-lane tunnel: the first car to enter is the first Advantages -- Dynamic size -- Orders data in the order it was received -- Low runtime +- Dynamic size +- Orders data in the order it was received +- Low runtime Disadvantages -- Can only retrieve the oldest element +- Can only retrieve the oldest element ### Applications -- Effective as a buffer when receiving frequent data -- Convenient way to store order-sensitive data such as stored voicemails -- Ensures the oldest data is processed first +- Effective as a buffer when receiving frequent data +- Convenient way to store order-sensitive data such as stored voicemails +- Ensures the oldest data is processed first -3\. Linked List ---------------- +## 3\. Linked List Linked lists are a data structure which, unlike the previous three, does not use physical placement of data in memory. This means that, rather than indexes or positions, linked lists use a referencing system: elements are stored in nodes that contain a pointer to the next node, repeating until all nodes are linked. @@ -82,21 +78,20 @@ This system allows efficient insertion and removal of items without the need for Advantages -- Efficient insertion and removal of new elements -- Less complex than restructuring an array +- Efficient insertion and removal of new elements +- Less complex than restructuring an array Disadvantages -- Uses more memory than arrays -- Inefficient to retrieve a specific element -- Inefficient to traverse the list backward +- Uses more memory than arrays +- Inefficient to retrieve a specific element +- Inefficient to traverse the list backward ### Applications -- Best used when data must be added and removed in quick succession from unknown locations +- Best used when data must be added and removed in quick succession from unknown locations -4\. Trees ---------- +## 4\. Trees Trees are another relation-based data structure, which specialize in representing hierarchical structures. Like a linked list, nodes contain both elements of data and pointers marking its relation to immediate nodes. @@ -117,28 +112,27 @@ This type of tree is defined by four strict rules: Advantages -- Ideal for storing hierarchical relationships -- Dynamic size -- Quick at insert and delete operations -- In a binary search tree, inserted nodes are sequenced immediately. -- Binary search trees are efficient at searches; length is only O(height)O(height). +- Ideal for storing hierarchical relationships +- Dynamic size +- Quick at insert and delete operations +- In a binary search tree, inserted nodes are sequenced immediately. +- Binary search trees are efficient at searches; length is only O(height)O(height). Disadvantages -- Slow to rearrange nodes -- Child nodes hold no information about their parent node -- Binary search trees are not as fast as the more complicated hash table -- Binary search trees can degenerate into linear search (scanning all elements) if not implemented with balanced subtrees. +- Slow to rearrange nodes +- Child nodes hold no information about their parent node +- Binary search trees are not as fast as the more complicated hash table +- Binary search trees can degenerate into linear search (scanning all elements) if not implemented with balanced subtrees. ### Applications -- Storing hierarchical data such as a file location. -- Binary search trees are excellent for tasks needing searching or ordering of data. +- Storing hierarchical data such as a file location. +- Binary search trees are excellent for tasks needing searching or ordering of data. -> *Enjoying the article? Scroll down to [sign up](https://www.educative.io/blog/blog-newsletter-annoucement) for our free, bi-monthly newsletter.* +> _Enjoying the article? Scroll down to [sign up](https://www.educative.io/blog/blog-newsletter-annoucement) for our free, bi-monthly newsletter._ -5\. Graphs ----------- +## 5\. Graphs Graphs are a relation-based data structure helpful for storing web-like relationships. Each node, or vertex, as they're called in graphs, has a title (A, B, C, etc.), a value contained within, and a list of links (called edges) it has with other vertices. @@ -146,29 +140,28 @@ Graphs are a relation-based data structure helpful for storing web-like relation In the above example, each circle is a vertex, and each line is an edge. If produced in writing, this structure would look like: -*V = {a, b, c, d}* +_V = {a, b, c, d}_ -*E = {ab, ac, bc, cd}* +_E = {ab, ac, bc, cd}_ While hard to visualize at first, this structure is invaluable in conveying relationship charts in textual form, anything from circuitry to train networks. Advantages -- Can quickly convey visuals over text -- Usable to model a diverse number of subjects so long as they contain a relational structure +- Can quickly convey visuals over text +- Usable to model a diverse number of subjects so long as they contain a relational structure Disadvantages -- At a higher level, text can be time-consuming to convert to an image. -- It can be difficult to see the existing edges or how many edges a given vertex has connected to it +- At a higher level, text can be time-consuming to convert to an image. +- It can be difficult to see the existing edges or how many edges a given vertex has connected to it ### Applications -- Network representations -- Modeling social networks, such as Facebook. +- Network representations +- Modeling social networks, such as Facebook. -6\. Hash Tables (Map) ---------------------- +## 6\. Hash Tables (Map) Hash tables are a complex data structure capable of storing large amounts of information and retrieving specific elements efficiently. This data structure relies on the concept of key/value pairs, where the "key" is a searched string and the "value" is the data paired with that key. @@ -176,25 +169,24 @@ Hash tables are a complex data structure capable of storing large amounts of inf Advantages -- Key can be in any form, while array's indices must be integers -- Highly efficient search function -- Constant number of operations for each search -- Constant cost for insertion or deletion operations +- Key can be in any form, while array's indices must be integers +- Highly efficient search function +- Constant number of operations for each search +- Constant cost for insertion or deletion operations Disadvantages -- Collisions: an error caused when two keys convert to the same hash code or two hash codes point to the same value. -- These errors can be common and often require an overhaul of the hash function. +- Collisions: an error caused when two keys convert to the same hash code or two hash codes point to the same value. +- These errors can be common and often require an overhaul of the hash function. ### Applications -- Database storage -- Address lookups by name +- Database storage +- Address lookups by name Each hash table can be very different, from the types of the keys and values, to the way their hash functions work. Due to these differences and the multi-layered aspects of a hash table, it is nearly impossible to encapsulate so generally. -Data structure interview questions ----------------------------------- +## Data structure interview questions For many developers and programmers, data structures are most important for [cracking Javascript coding interviews](https://www.educative.io/blog/acing-the-javascript-interview-top-questions-explained). Questions and problems on data structures are fundamental to modern-day coding interviews. In fact, they have a lot to say over your hireability and entry-level rate as a candidate. @@ -240,17 +232,17 @@ There are two ways you could solve this coding problem in an interview. Let's di function removeEven(arr) { -    var odds = [] +var odds = [] -    for (let number of arr) { +for (let number of arr) { -        if (number % 2 != 0) // Check if the item in the list is NOT even ('%' is the modulus symbol!) +if (number % 2 != 0) // Check if the item in the list is NOT even ('%' is the modulus symbol!) -            odds.push(number) //If it isn't even append it to the empty list +odds.push(number) //If it isn't even append it to the empty list -    } +} -  return odds // Return the new list +return odds // Return the new list } @@ -272,7 +264,7 @@ This approach starts with the first element of the array. If that current elemen function removeEven(arr) { -    return arr.filter((v => (v % 2) != 0)) +return arr.filter((v => (v % 2) != 0)) } @@ -370,53 +362,53 @@ Stack.js module.exports = class Stack { -    constructor() { +constructor() { -        this.items = []; +this.items = []; -        this.top = null; +this.top = null; -    } +} -    getTop() { +getTop() { -        if (this.items.length == 0) +if (this.items.length == 0) -            return null; +return null; -        return this.top; +return this.top; -    } +} -    isEmpty() { +isEmpty() { -        return this.items.length == 0; +return this.items.length == 0; -    } +} -    size() { +size() { -        return this.items.length; +return this.items.length; -    } +} -    push(element) { +push(element) { -        this.items.push(element); +this.items.push(element); -        this.top = element; +this.top = element; -    } +} -    pop() { +pop() { -        if (this.items.length != 0) { +if (this.items.length != 0) { -            if (this.items.length == 1) { +if (this.items.length == 1) { -                this.top = null; +this.top = null; -                return this.items.pop(); +return this.items.pop(); Run @@ -515,52 +507,52 @@ Queue.js module.exports = class Queue { -    constructor() { +constructor() { -        this.items = []; +this.items = []; -        this.front = null; +this.front = null; -        this.back = null; +this.back = null; -    } +} -    isEmpty() { +isEmpty() { -        return this.items.length == 0; +return this.items.length == 0; -    } +} -    getFront() { +getFront() { -        if (this.items.length != 0) { +if (this.items.length != 0) { -            return this.items[0]; +return this.items[0]; -        } else +} else -            return null; +return null; -    } +} -    size() { +size() { -        return this.items.length; +return this.items.length; -    } +} -    enqueue(element) { +enqueue(element) { -        this.items.push(element); +this.items.push(element); -    } +} Run The key is to generate consecutive binary numbers by appending 0 and 1 to previous binary numbers. To clarify, -- 10 and 11 can be generated if 0 and 1 are appended to 1. -- 100 and 101 are generated if 0 and 1 are appended to 10. +- 10 and 11 can be generated if 0 and 1 are appended to 1. +- 100 and 101 are generated if 0 and 1 are appended to 10. Once we generate a binary number, it is then enqueued to a queue so that new binary numbers can be generated if we append 0 and 1 when that number will be enqueued. @@ -664,63 +656,63 @@ const Node = require('./Node.js'); module.exports = class LinkedList { -  constructor() { +constructor() { -    this.head = null; +this.head = null; -  } +} -  //Insertion At Head   +//Insertion At Head -  insertAtHead(newData) { +insertAtHead(newData) { -    let tempNode = new Node(newData); +let tempNode = new Node(newData); -    tempNode.nextElement = this.head; +tempNode.nextElement = this.head; -    this.head = tempNode; +this.head = tempNode; -    return this; //returning the updated list +return this; //returning the updated list -  } +} -  isEmpty() { +isEmpty() { -    return (this.head == null); +return (this.head == null); -  } +} -  //function to print the linked list +//function to print the linked list -  printList() { +printList() { -    if (this.isEmpty()) { +if (this.isEmpty()) { -      console.log("Empty List"); +console.log("Empty List"); -      return false; +return false; -    } else { +} else { -      let temp = this.head; +let temp = this.head; -      while (temp != null) { +while (temp != null) { -        process.stdout.write(String(temp.data)); +process.stdout.write(String(temp.data)); -        process.stdout.write(" -> "); +process.stdout.write(" -> "); -        temp = temp.nextElement; +temp = temp.nextElement; Run We use a loop to iterate through the input list. For a `current` node, its link with the `previous` node is reversed. then, `next` stores the next node in the list. Let's break that down by line. -- Line 22- Store the `current` node's `nextElement` in `next` -- Line 23 - Set `current` node's `nextElement` to `previous` -- Line 24 - Make the `current` node the new `previous` for the next iteration -- Line 25 - Use `next` to go to the next node -- Line 29 - We reset the `head` pointer to point at the last node +- Line 22- Store the `current` node's `nextElement` in `next` +- Line 23 - Set `current` node's `nextElement` to `previous` +- Line 24 - Make the `current` node the new `previous` for the next iteration +- Line 25 - Use `next` to go to the next node +- Line 29 - We reset the `head` pointer to point at the last node Since the list is traversed only once, the algorithm runs in *O(n)*. @@ -820,53 +812,53 @@ const Node = require('./Node.js'); module.exports = class BinarySearchTree { -    constructor(rootValue) { +constructor(rootValue) { -        this.root = new Node(rootValue); +this.root = new Node(rootValue); -    } +} -    insert(currentNode, newValue) { +insert(currentNode, newValue) { -        if (currentNode === null) { +if (currentNode === null) { -            currentNode = new Node(newValue); +currentNode = new Node(newValue); -        } else if (newValue < currentNode.val) { +} else if (newValue < currentNode.val) { -            currentNode.leftChild = this.insert(currentNode.leftChild, newValue); +currentNode.leftChild = this.insert(currentNode.leftChild, newValue); -        } else { +} else { -            currentNode.rightChild = this.insert(currentNode.rightChild, newValue); +currentNode.rightChild = this.insert(currentNode.rightChild, newValue); -        } +} -        return currentNode; +return currentNode; -    } +} -    insertBST(newValue) { +insertBST(newValue) { -        if(this.root==null){ +if(this.root==null){ -            this.root=new Node(newValue); +this.root=new Node(newValue); -            return; +return; -        } +} -        this.insert(this.root, newValue); +this.insert(this.root, newValue); -    } +} -    preOrderPrint(currentNode) { +preOrderPrint(currentNode) { -        if (currentNode !== null) { +if (currentNode !== null) { -            console.log(currentNode.val); +console.log(currentNode.val); -            this.preOrderPrint(currentNode.leftChild); +this.preOrderPrint(currentNode.leftChild); Run @@ -974,43 +966,43 @@ const Node = require('./Node.js'); module.exports = class Graph { -  constructor(vertices) { +constructor(vertices) { -    this.vertices = vertices; +this.vertices = vertices; -    this.list = []; +this.list = []; -    var it; +var it; -    for (it = 0; it < vertices; it++) { +for (it = 0; it < vertices; it++) { -      let temp = new LinkedList(); +let temp = new LinkedList(); -      this.list.push(temp); +this.list.push(temp); -    } +} -  } +} -  addEdge(source, destination) { +addEdge(source, destination) { -    if (source < this.vertices && destination < this.vertices) +if (source < this.vertices && destination < this.vertices) -    this.list[source].insertAtHead(destination); +this.list[source].insertAtHead(destination); -    return this; +return this; -  } +} -  printGraph() { +printGraph() { -    console.log(">>Adjacency List of Directed Graph<<"); +console.log(">>Adjacency List of Directed Graph<<"); -    var i; +var i; -    for (i = 0; i < this.list.length; i++) { +for (i = 0; i < this.list.length; i++) { -      process.stdout.write("|" + String(i) + "| => "); +process.stdout.write("|" + String(i) + "| => "); Run @@ -1090,45 +1082,45 @@ To solve this problem, we must min heapify all parent nodes. Take a look. function minHeapify(heap, index) { -    var left = index * 2; +var left = index \* 2; -    var right = (index * 2) + 1; +var right = (index \* 2) + 1; -    var smallest = index; +var smallest = index; -    if ((heap.length > left) && (heap[smallest] > heap[left])) { +if ((heap.length > left) && (heap[smallest] > heap[left])) { -        smallest = left +smallest = left -    } +} -    if ((heap.length > right) && (heap[smallest] > heap[right])) +if ((heap.length > right) && (heap[smallest] > heap[right])) -        smallest = right +smallest = right -    if (smallest != index) { +if (smallest != index) { -        var tmp = heap[smallest] +var tmp = heap[smallest] -        heap[smallest] = heap[index] +heap[smallest] = heap[index] -        heap[index] = tmp +heap[index] = tmp -        minHeapify(heap, smallest) +minHeapify(heap, smallest) -    } +} -    return heap; +return heap; } function convertMax(maxHeap) { -    for (var i = Math.floor((maxHeap.length) / 2); i > -1; i--) +for (var i = Math.floor((maxHeap.length) / 2); i > -1; i--) -        maxHeap = minHeapify(maxHeap, i) +maxHeap = minHeapify(maxHeap, i) -    return maxHeap +return maxHeap } @@ -1138,4 +1130,4 @@ console.log(convertMax(maxHeap)) Run -We consider `maxHeap` to be a regular array and reorder it to accurately represent a min-heap. You can see this done in the code above. The `convertMax()` function then restores the heap property on all nodes from the lowest parent node by calling the `minHeapify()` function. In regards to time complexity, this solution takes *O(nlog(n))O(nlog(n))* time. \ No newline at end of file +We consider `maxHeap` to be a regular array and reorder it to accurately represent a min-heap. You can see this done in the code above. The `convertMax()` function then restores the heap property on all nodes from the lowest parent node by calling the `minHeapify()` function. In regards to time complexity, this solution takes *O(nlog(n))O(nlog(n))* time. diff --git a/notes/BGOONZ_BLOG_2.0.wiki/articles/anatomy-of-search-engine.md b/notes/BGOONZ_BLOG_2.0.wiki/articles/anatomy-of-search-engine.md index 3ad076e95b..73efbc18a2 100644 --- a/notes/BGOONZ_BLOG_2.0.wiki/articles/anatomy-of-search-engine.md +++ b/notes/BGOONZ_BLOG_2.0.wiki/articles/anatomy-of-search-engine.md @@ -1,21 +1,22 @@ - # The Anatomy of a Search Engine > ## Excerpt +> > These tasks are becoming increasingly difficult as the Web grows. However, -hardware performance and cost have improved dramatically to partially offset -the difficulty. There are, however, several notable exceptions to this -progress such as disk seek time and operating system robustness. In designing -Google, we have considered both the rate of growth of the Web and technological -changes. Google is designed to scale well to extremely large data sets. -It makes efficient use of storage space to store the index. Its data structures -are optimized for fast and efficient access (see section 4.2). -Further, we expect that the cost to index and store text or HTML will eventually -decline relative to the amount that will be available (see Appendix -B). This will result in favorable scaling properties for centralized -systems like Google. +> hardware performance and cost have improved dramatically to partially offset +> the difficulty. There are, however, several notable exceptions to this +> progress such as disk seek time and operating system robustness. In designing +> Google, we have considered both the rate of growth of the Web and technological +> changes. Google is designed to scale well to extremely large data sets. +> It makes efficient use of storage space to store the index. Its data structures +> are optimized for fast and efficient access (see section 4.2). +> Further, we expect that the cost to index and store text or HTML will eventually +> decline relative to the amount that will be available (see Appendix +> B). This will result in favorable scaling properties for centralized +> systems like Google. --- + **Sergey Brin and Lawrence Page** {sergey, page}@cs.stanford.edu @@ -24,11 +25,11 @@ Computer Science Department, Stanford University, Stanford, CA 94305 ### Abstract ->        In this paper, we present Google, a prototype of a large-scale search engine which makes heavy use of the structure present in hypertext. Google is designed to crawl and index the Web efficiently and produce much more satisfying search results than existing systems. The prototype with a full text and hyperlink database of at least 24 million pages is available at [http://google.stanford.edu/](http://google.stanford.edu/) +> In this paper, we present Google, a prototype of a large-scale search engine which makes heavy use of the structure present in hypertext. Google is designed to crawl and index the Web efficiently and produce much more satisfying search results than existing systems. The prototype with a full text and hyperlink database of at least 24 million pages is available at [http://google.stanford.edu/](http://google.stanford.edu/) >        To engineer a search engine is a challenging task. Search engines index tens to hundreds of millions of web pages involving a comparable number of distinct terms. They answer tens of millions of queries every day. Despite the importance of large-scale search engines on the web, very little academic research has been done on them. Furthermore, due to rapid advance in technology and web proliferation, creating a web search engine today is very different from three years ago. This paper provides an in-depth description of our large-scale web search engine -- the first such detailed public description we know of to date. >        Apart from the problems of scaling traditional search techniques to data of this magnitude, there are new technical challenges involved with using the additional information present in hypertext to produce better search results. This paper addresses this question of how to build a practical large-scale system which can exploit the additional information present in hypertext. Also we look at the problem of how to effectively deal with uncontrolled hypertext collections where anyone can publish anything they want. -> -> **Keywords**: World Wide Web, Search Engines, Information Retrieval, PageRank, Google +> +> **Keywords**: World Wide Web, Search Engines, Information Retrieval, PageRank, Google ## 1\. Introduction @@ -72,9 +73,9 @@ The citation (link) graph of the web is an important resource that has largely g Academic citation literature has been applied to the web, largely by counting citations or backlinks to a given page. This gives some approximation of a page's importance or quality. PageRank extends this idea by not counting links from all pages equally, and by normalizing by the number of links on a page. PageRank is defined as follows: > _We assume page A has pages T1...Tn which point to it (i.e., are citations). The parameter d is a damping factor which can be set between 0 and 1. We usually set d to 0.85. There are more details about d in the next section. Also C(A) is defined as the number of links going out of page A. The PageRank of a page A is given as follows:_ -> +> > _PR(A) = (1-d) + d (PR(T1)/C(T1) + ... + PR(Tn)/C(Tn))_ -> +> > _Note that the PageRanks form a probability distribution over web pages, so the sum of all web pages' PageRanks will be one._ PageRank or _PR(A)_ can be calculated using a simple iterative algorithm, and corresponds to the principal eigenvector of the normalized link matrix of the web. Also, a PageRank for 26 million web pages can be computed in a few hours on a medium size workstation. There are many other details which are beyond the scope of this paper. @@ -117,7 +118,7 @@ First, we will provide a high level discussion of the architecture. Then, there Figure 1. High Level Google Architecture -   + ### 4.1 Google Architecture Overview @@ -139,7 +140,7 @@ BigFiles are virtual files spanning multiple file systems and are addressable by #### 4.2.2 Repository -   + ![](http://infolab.stanford.edu/~backrub/repos.gif) @@ -167,7 +168,7 @@ Our compact encoding uses two bytes for every hit. There are two types of hits: Figure 3. Forward and Reverse Indexes and the Lexicon -  + The length of a hit list is stored before the hits themselves. To save space, the length of the hit list is combined with the wordID in the forward index and the docID in the inverted index. This limits it to 8 and 5 bits respectively (there are some tricks which allow 8 bits to be borrowed from the wordID). If the length is longer than would fit in that many bits, an escape code is used in those bits, and the next two bytes contain the actual length. @@ -191,9 +192,9 @@ It turns out that running a crawler which connects to more than half a million s ### 4.4 Indexing the Web -- **Parsing --** Any parser which is designed to run on the entire Web must handle a huge array of possible errors. These range from typos in HTML tags to kilobytes of zeros in the middle of a tag, non-ASCII characters, HTML tags nested hundreds deep, and a great variety of other errors that challenge anyone's imagination to come up with equally creative ones. For maximum speed, instead of using YACC to generate a CFG parser, we use flex to generate a lexical analyzer which we outfit with its own stack. Developing this parser which runs at a reasonable speed and is very robust involved a fair amount of work. -- **Indexing** **Documents into Barrels --** After each document is parsed, it is encoded into a number of barrels. Every word is converted into a wordID by using an in-memory hash table -- the lexicon. New additions to the lexicon hash table are logged to a file. Once the words are converted into wordID's, their occurrences in the current document are translated into hit lists and are written into the forward barrels. The main difficulty with parallelization of the indexing phase is that the lexicon needs to be shared. Instead of sharing the lexicon, we took the approach of writing a log of all the extra words that were not in a base lexicon, which we fixed at 14 million words. That way multiple indexers can run in parallel and then the small log file of extra words can be processed by one final indexer. -- **Sorting** -- In order to generate the inverted index, the sorter takes each of the forward barrels and sorts it by wordID to produce an inverted barrel for title and anchor hits and a full text inverted barrel. This process happens one barrel at a time, thus requiring little temporary storage. Also, we parallelize the sorting phase to use as many machines as we have simply by running multiple sorters, which can process different buckets at the same time. Since the barrels don't fit into main memory, the sorter further subdivides them into baskets which do fit into memory based on wordID and docID. Then the sorter, loads each basket into memory, sorts it and writes its contents into the short inverted barrel and the full inverted barrel. +- **Parsing --** Any parser which is designed to run on the entire Web must handle a huge array of possible errors. These range from typos in HTML tags to kilobytes of zeros in the middle of a tag, non-ASCII characters, HTML tags nested hundreds deep, and a great variety of other errors that challenge anyone's imagination to come up with equally creative ones. For maximum speed, instead of using YACC to generate a CFG parser, we use flex to generate a lexical analyzer which we outfit with its own stack. Developing this parser which runs at a reasonable speed and is very robust involved a fair amount of work. +- **Indexing** **Documents into Barrels --** After each document is parsed, it is encoded into a number of barrels. Every word is converted into a wordID by using an in-memory hash table -- the lexicon. New additions to the lexicon hash table are logged to a file. Once the words are converted into wordID's, their occurrences in the current document are translated into hit lists and are written into the forward barrels. The main difficulty with parallelization of the indexing phase is that the lexicon needs to be shared. Instead of sharing the lexicon, we took the approach of writing a log of all the extra words that were not in a base lexicon, which we fixed at 14 million words. That way multiple indexers can run in parallel and then the small log file of extra words can be processed by one final indexer. +- **Sorting** -- In order to generate the inverted index, the sorter takes each of the forward barrels and sorts it by wordID to produce an inverted barrel for title and anchor hits and a full text inverted barrel. This process happens one barrel at a time, thus requiring little temporary storage. Also, we parallelize the sorting phase to use as many machines as we have simply by running multiple sorters, which can process different buckets at the same time. Since the barrels don't fit into main memory, the sorter further subdivides them into baskets which do fit into memory based on wordID and docID. Then the sorter, loads each basket into memory, sorts it and writes its contents into the short inverted barrel and the full inverted barrel. ### 4.5 Searching @@ -206,12 +207,12 @@ The goal of searching is to provide quality search results efficiently. Many of 5. Compute the rank of that document for the query. 6. If we are in the short barrels and at the end of any doclist, seek to the start of the doclist in the full barrel for every word and go to step 4. 7. If we are not at the end of any doclist go to step 4. - + Sort the documents that have matched by rank and return the top k. Figure 4. Google Query Evaluation -  + To put a limit on response time, once a certain number (currently 40,000) of matching documents are found, the searcher automatically goes to step 8 in Figure 4. This means that it is possible that sub-optimal results would be returned. We are currently investigating other ways to solve this problem. In the past, we sorted the hits according to PageRank, which seemed to improve the situation. @@ -227,14 +228,15 @@ The ranking function has many parameters like the type-weights and the type-prox ## 5 Results and Performance -   The most important measure of a search engine is the quality of its search results. While a complete user evaluation is beyond the scope of this paper, our own experience with Google has shown it to produce better results than the major commercial search engines for most searches. As an example which illustrates the use of PageRank, anchor text, and proximity, Figure 4 shows Google's results for a search on "bill clinton". These results demonstrates some of Google's features. The results are clustered by server. This helps considerably when sifting through result sets. A number of results are from the whitehouse.gov domain which is what one may reasonably expect from such a search. Currently, most major commercial search engines do not return any results from whitehouse.gov, much less the right ones. Notice that there is no title for the first result. This is because it was not crawled. Instead, Google relied on anchor text to determine this was a good answer to the query. Similarly, the fifth result is an email address which, of course, is not crawlable. It is also a result of anchor text. +The most important measure of a search engine is the quality of its search results. While a complete user evaluation is beyond the scope of this paper, our own experience with Google has shown it to produce better results than the major commercial search engines for most searches. As an example which illustrates the use of PageRank, anchor text, and proximity, Figure 4 shows Google's results for a search on "bill clinton". These results demonstrates some of Google's features. The results are clustered by server. This helps considerably when sifting through result sets. A number of results are from the whitehouse.gov domain which is what one may reasonably expect from such a search. Currently, most major commercial search engines do not return any results from whitehouse.gov, much less the right ones. Notice that there is no title for the first result. This is because it was not crawled. Instead, Google relied on anchor text to determine this was a good answer to the query. Similarly, the fifth result is an email address which, of course, is not crawlable. It is also a result of anchor text. All of the results are reasonably high quality pages and, at last check, none were broken links. This is largely because they all have high PageRank. The PageRanks are the percentages in red along with bar graphs. Finally, there are no results about a Bill other than Clinton or about a Clinton other than Bill. This is because we place heavy importance on the proximity of word occurrences. Of course a true test of the quality of a search engine would involve an extensive user study or results analysis which we do not have room for here. Instead, we invite the reader to try Google for themselves at [http://google.stanford.edu](http://google.stanford.edu/). ### 5.1 Storage Requirements -Aside from search quality, Google is designed to scale cost effectively to the size of the Web as it grows. One aspect of this is to use storage efficiently. Table 1 has a breakdown of some statistics and storage requirements of Google. Due to compression the total size of the repository is about 53 GB, just over one third of the total data it stores. At current disk prices this makes the repository a relatively cheap source of useful data. More importantly, the total of all the data used by the search engine requires a comparable amount of storage, about 55 GB. Furthermore, most queries can be answered using just the short inverted index. With better encoding and compression of the Document Index, a high quality web search engine may fit onto a 7GB drive of a new PC. -   +Aside from search quality, Google is designed to scale cost effectively to the size of the Web as it grows. One aspect of this is to use storage efficiently. Table 1 has a breakdown of some statistics and storage requirements of Google. Due to compression the total size of the repository is about 53 GB, just over one third of the total data it stores. At current disk prices this makes the repository a relatively cheap source of useful data. More importantly, the total of all the data used by the search engine requires a comparable amount of storage, about 55 GB. Furthermore, most queries can be answered using just the short inverted index. With better encoding and compression of the Document Index, a high quality web search engine may fit onto a 7GB drive of a new PC. + + Storage Statistics @@ -298,11 +300,11 @@ Number of 404's 1.6 million -  + Table 1. Statistics -   + ###  5.2 System Performance @@ -312,11 +314,11 @@ It is important for a search engine to crawl and index efficiently. This way inf Improving the performance of search was not the major focus of our research up to this point. The current version of Google answers most queries in between 1 and 10 seconds. This time is mostly dominated by disk IO over NFS (since disks are spread over a number of machines). Furthermore, Google does not have any optimizations such as query caching, subindices on common terms, and other common optimizations. We intend to speed up Google considerably through distribution and hardware, software, and algorithmic improvements. Our target is to be able to handle several hundred queries per second. Table 2 has some sample query times from the current version of Google. They are repeated to show the speedups resulting from cached IO. -  + **Initial Query** -**Same Query Repeated (IO mostly cached)** +**Same Query Repeated (IO mostly cached)** **Query** @@ -368,11 +370,11 @@ search engines 1.16 -  + Table 2. Search Times -   + ## 6 Conclusions @@ -400,33 +402,33 @@ Scott Hassan and Alan Steremberg have been critical to the development of Google ## References -- Best of the Web 1994 -- Navigators [http://botw.org/1994/awards/navigators.html](http://botw.org/1994/awards/navigators.html) -- Bill Clinton Joke of the Day: April 14, 1997. [http://www.io.com/~cjburke/clinton/970414.html.](http://www.io.com/~cjburke/clinton/970414.html) -- Bzip2 Homepage [http://www.muraroa.demon.co.uk/](http://www.muraroa.demon.co.uk/) -- Google Search Engine [http://google.stanford.edu/](http://google.stanford.edu/) -- Harvest [http://harvest.transarc.com/](http://harvest.transarc.com/) -- Mauldin, Michael L. Lycos Design Choices in an Internet Search Service, IEEE Expert Interview [http://www.computer.org/pubs/expert/1997/trends/x1008/mauldin.htm](http://www.computer.org/pubs/expert/1997/trends/x1008/mauldin.htm) -- The Effect of Cellular Phone Use Upon Driver Attention [http://www.webfirst.com/aaa/text/cell/cell0toc.htm](http://www.webfirst.com/aaa/text/cell/cell0toc.htm) -- Search Engine Watch [http://www.searchenginewatch.com/](http://www.searchenginewatch.com/) -- RFC 1950 (zlib) [ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html](ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html) -- Robots Exclusion Protocol: [http://info.webcrawler.com/mak/projects/robots/exclusion.htm](http://info.webcrawler.com/mak/projects/robots/exclusion.html) -- Web Growth Summary: [http://www.mit.edu/people/mkgray/net/web-growth-summary.html](http://www.mit.edu/people/mkgray/net/web-growth-summary.html) -- Yahoo! [http://www.yahoo.com/](http://www.yahoo.com/) - -- \[Abiteboul 97\] Serge Abiteboul and Victor Vianu, _Queries and Computation on the Web_. Proceedings of the International Conference on Database Theory. Delphi, Greece 1997. -- \[Bagdikian 97\] Ben H. Bagdikian. _The Media Monopoly_. 5th Edition. Publisher: Beacon, ISBN: 0807061557 -- \[Chakrabarti 98\] S.Chakrabarti, B.Dom, D.Gibson, J.Kleinberg, P. Raghavan and S. Rajagopalan. _Automatic Resource Compilation by Analyzing Hyperlink Structure and Associated Text._ Seventh International Web Conference (WWW 98). Brisbane, Australia, April 14-18, 1998. -- \[Cho 98\] Junghoo Cho, Hector Garcia-Molina, Lawrence Page. _Efficient Crawling Through URL Ordering._ Seventh International Web Conference (WWW 98). Brisbane, Australia, April 14-18, 1998. -- \[Gravano 94\] Luis Gravano, Hector Garcia-Molina, and A. Tomasic. _The Effectiveness of GlOSS for the Text-Database Discovery Problem._ Proc. of the 1994 ACM SIGMOD International Conference On Management Of Data, 1994. -- \[Kleinberg 98\] Jon Kleinberg, _Authoritative Sources in a Hyperlinked Environment_, Proc. ACM-SIAM Symposium on Discrete Algorithms, 1998. -- \[Marchiori 97\] Massimo Marchiori. _The Quest for Correct Information on the Web: Hyper Search Engines._ The Sixth International WWW Conference (WWW 97). Santa Clara, USA, April 7-11, 1997. -- \[McBryan 94\] Oliver A. McBryan. GENVL and _WWWW: Tools for Taming the Web. First International Conference on the World Wide Web._ CERN, Geneva (Switzerland), May 25-26-27 1994. [http://www.cs.colorado.edu/home/mcbryan/mypapers/www94.ps](http://www.cs.colorado.edu/home/mcbryan/mypapers/www94.ps) -- \[Page 98\] Lawrence Page, Sergey Brin, Rajeev Motwani, Terry Winograd. _The PageRank Citation Ranking: Bringing Order to the Web._ Manuscript in progress. [http://google.stanford.edu/~backrub/pageranksub.ps](http://google.stanford.edu/~backrub/pageranksub.ps) -- \[Pinkerton 94\] Brian Pinkerton, _Finding What People Want: Experiences with the WebCrawler._ The Second International WWW Conference Chicago, USA, October 17-20, 1994. [http://info.webcrawler.com/bp/WWW94.html](http://info.webcrawler.com/bp/WWW94.html) -- \[Spertus 97\] Ellen Spertus. _ParaSite: Mining Structural Information on the Web._ The Sixth International WWW Conference (WWW 97). Santa Clara, USA, April 7-11, 1997. -- \[TREC 96\] _Proceedings of the fifth Text REtrieval Conference (TREC-5)._ Gaithersburg, Maryland, November 20-22, 1996. Publisher: Department of Commerce, National Institute of Standards and Technology. Editors: D. K. Harman and E. M. Voorhees. Full text at: [http://trec.nist.gov/](http://trec.nist.gov/) -- \[Witten 94\] Ian H Witten, Alistair Moffat, and Timothy C. Bell. _Managing Gigabytes: Compressing and Indexing Documents and Images._ New York: Van Nostrand Reinhold, 1994. -- \[Weiss 96\] Ron Weiss, Bienvenido Velez, Mark A. Sheldon, Chanathip Manprempre, Peter Szilagyi, Andrzej Duda, and David K. Gifford. _HyPursuit: A Hierarchical Network Search Engine that Exploits Content-Link Hypertext Clustering._ Proceedings of the 7th ACM Conference on Hypertext. New York, 1996. +- Best of the Web 1994 -- Navigators [http://botw.org/1994/awards/navigators.html](http://botw.org/1994/awards/navigators.html) +- Bill Clinton Joke of the Day: April 14, 1997. [http://www.io.com/~cjburke/clinton/970414.html.](http://www.io.com/~cjburke/clinton/970414.html) +- Bzip2 Homepage [http://www.muraroa.demon.co.uk/](http://www.muraroa.demon.co.uk/) +- Google Search Engine [http://google.stanford.edu/](http://google.stanford.edu/) +- Harvest [http://harvest.transarc.com/](http://harvest.transarc.com/) +- Mauldin, Michael L. Lycos Design Choices in an Internet Search Service, IEEE Expert Interview [http://www.computer.org/pubs/expert/1997/trends/x1008/mauldin.htm](http://www.computer.org/pubs/expert/1997/trends/x1008/mauldin.htm) +- The Effect of Cellular Phone Use Upon Driver Attention [http://www.webfirst.com/aaa/text/cell/cell0toc.htm](http://www.webfirst.com/aaa/text/cell/cell0toc.htm) +- Search Engine Watch [http://www.searchenginewatch.com/](http://www.searchenginewatch.com/) +- RFC 1950 (zlib) [ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html](ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html) +- Robots Exclusion Protocol: [http://info.webcrawler.com/mak/projects/robots/exclusion.htm](http://info.webcrawler.com/mak/projects/robots/exclusion.html) +- Web Growth Summary: [http://www.mit.edu/people/mkgray/net/web-growth-summary.html](http://www.mit.edu/people/mkgray/net/web-growth-summary.html) +- Yahoo! [http://www.yahoo.com/](http://www.yahoo.com/) + +- \[Abiteboul 97\] Serge Abiteboul and Victor Vianu, _Queries and Computation on the Web_. Proceedings of the International Conference on Database Theory. Delphi, Greece 1997. +- \[Bagdikian 97\] Ben H. Bagdikian. _The Media Monopoly_. 5th Edition. Publisher: Beacon, ISBN: 0807061557 +- \[Chakrabarti 98\] S.Chakrabarti, B.Dom, D.Gibson, J.Kleinberg, P. Raghavan and S. Rajagopalan. _Automatic Resource Compilation by Analyzing Hyperlink Structure and Associated Text._ Seventh International Web Conference (WWW 98). Brisbane, Australia, April 14-18, 1998. +- \[Cho 98\] Junghoo Cho, Hector Garcia-Molina, Lawrence Page. _Efficient Crawling Through URL Ordering._ Seventh International Web Conference (WWW 98). Brisbane, Australia, April 14-18, 1998. +- \[Gravano 94\] Luis Gravano, Hector Garcia-Molina, and A. Tomasic. _The Effectiveness of GlOSS for the Text-Database Discovery Problem._ Proc. of the 1994 ACM SIGMOD International Conference On Management Of Data, 1994. +- \[Kleinberg 98\] Jon Kleinberg, _Authoritative Sources in a Hyperlinked Environment_, Proc. ACM-SIAM Symposium on Discrete Algorithms, 1998. +- \[Marchiori 97\] Massimo Marchiori. _The Quest for Correct Information on the Web: Hyper Search Engines._ The Sixth International WWW Conference (WWW 97). Santa Clara, USA, April 7-11, 1997. +- \[McBryan 94\] Oliver A. McBryan. GENVL and _WWWW: Tools for Taming the Web. First International Conference on the World Wide Web._ CERN, Geneva (Switzerland), May 25-26-27 1994. [http://www.cs.colorado.edu/home/mcbryan/mypapers/www94.ps](http://www.cs.colorado.edu/home/mcbryan/mypapers/www94.ps) +- \[Page 98\] Lawrence Page, Sergey Brin, Rajeev Motwani, Terry Winograd. _The PageRank Citation Ranking: Bringing Order to the Web._ Manuscript in progress. [http://google.stanford.edu/~backrub/pageranksub.ps](http://google.stanford.edu/~backrub/pageranksub.ps) +- \[Pinkerton 94\] Brian Pinkerton, _Finding What People Want: Experiences with the WebCrawler._ The Second International WWW Conference Chicago, USA, October 17-20, 1994. [http://info.webcrawler.com/bp/WWW94.html](http://info.webcrawler.com/bp/WWW94.html) +- \[Spertus 97\] Ellen Spertus. _ParaSite: Mining Structural Information on the Web._ The Sixth International WWW Conference (WWW 97). Santa Clara, USA, April 7-11, 1997. +- \[TREC 96\] _Proceedings of the fifth Text REtrieval Conference (TREC-5)._ Gaithersburg, Maryland, November 20-22, 1996. Publisher: Department of Commerce, National Institute of Standards and Technology. Editors: D. K. Harman and E. M. Voorhees. Full text at: [http://trec.nist.gov/](http://trec.nist.gov/) +- \[Witten 94\] Ian H Witten, Alistair Moffat, and Timothy C. Bell. _Managing Gigabytes: Compressing and Indexing Documents and Images._ New York: Van Nostrand Reinhold, 1994. +- \[Weiss 96\] Ron Weiss, Bienvenido Velez, Mark A. Sheldon, Chanathip Manprempre, Peter Szilagyi, Andrzej Duda, and David K. Gifford. _HyPursuit: A Hierarchical Network Search Engine that Exploits Content-Link Hypertext Clustering._ Proceedings of the 7th ACM Conference on Hypertext. New York, 1996. ## Vitae @@ -455,9 +457,6 @@ Of course a distributed systems like G_l_oss \[[Gravano 94](http://infolab.stanf Because humans can only type or speak a finite amount, and as computers continue improving, text indexing will scale even better than it does now. Of course there could be an infinite amount of machine generated content, but just indexing huge amounts of human generated content seems tremendously useful. So we are optimistic that our centralized web search engine architecture will improve in its ability to cover the pertinent text information over time and that there is a bright future for search. - - - As we'll see, the trick is to ask the web itself to rank the importance of pages... Imagine a library containing 25 billion documents but with no centralized organization and no librarians. In addition, anyone may add a document at any time without telling anyone. You may feel sure that one of the documents contained in the collection has a piece of information that is vitally important to you, and, being impatient like most of us, you'd like to find it in a matter of seconds. How would you go about doing it? @@ -478,19 +477,19 @@ We will assign to each web page _P_ a measure of its importance _I(P)_, called t Here's how the PageRank is determined. Suppose that page _Pj_ has _lj_ links. If one of those links is to page _Pi_, then _Pj_ will pass on 1/_lj_ of its importance to _Pi_. The importance ranking of _Pi_ is then the sum of all the contributions made by pages linking to it. That is, if we denote the set of pages linking to _Pi_ by _Bi_, then -![\[ I(P_i)=\sum_{P_j\in B_i} \frac{I(P_j)}{l_j} \] ](https://www.ams.org/featurecolumn/images/december2006/index_1.gif) +![[ I(P_i)=\sum_{P_j\in B_i} \frac{I(P_j)}{l_j} ] ](https://www.ams.org/featurecolumn/images/december2006/index_1.gif) This may remind you of the chicken and the egg: to determine the importance of a page, we first need to know the importance of all the pages linking to it. However, we may recast the problem into one that is more mathematically familiar. Let's first create a matrix, called the hyperlink matrix, ![$ {\bf H}=[H_{ij}] $ ](https://www.ams.org/featurecolumn/images/december2006/index_2.gif) in which the entry in the _ith_ row and _jth_ column is -![\[ H_{ij}=\left\{\begin{array}{ll}1/l_{j} & \hbox{if } P_j\in B_i \\ 0 & \hbox{otherwise} \end{array}\right. \] ](https://www.ams.org/featurecolumn/images/december2006/index_3.gif) +![[ H_{ij}=\left{\begin{array}{ll}1/l_{j} & \hbox{if } P_j\in B_i \ 0 & \hbox{otherwise} \end{array}\right. ] ](https://www.ams.org/featurecolumn/images/december2006/index_3.gif) Notice that **H** has some special properties. First, its entries are all nonnegative. Also, the sum of the entries in a column is one unless the page corresponding to that column has no links. Matrices in which all the entries are nonnegative and the sum of the entries in every column is one are called _stochastic_; they will play an important role in our story. We will also form a vector ![$ I=[I(P_i)] $ ](https://www.ams.org/featurecolumn/images/december2006/index_4.gif) whose components are PageRanks--that is, the importance rankings--of all the pages. The condition above defining the PageRank may be expressed as -![\[ I = {\bf H}I \] ](https://www.ams.org/featurecolumn/images/december2006/index_5.gif) +![[ I = {\bf H}I ] ](https://www.ams.org/featurecolumn/images/december2006/index_5.gif) In other words, the vector _I_ is an eigenvector of the matrix **H** with eigenvalue 1. We also call this a _stationary vector_ of **H**. @@ -516,11 +515,11 @@ There are many ways to find the eigenvectors of a square matrix. However, we are How does the power method work? We begin by choosing a vector _I 0_ as a candidate for _I_ and then producing a sequence of vectors _I k_ by -![\[ I^{k+1}={\bf H}I^k \] ](https://www.ams.org/featurecolumn/images/december2006/index_6.gif) +![[ I^{k+1}={\bf H}I^k ] ](https://www.ams.org/featurecolumn/images/december2006/index_6.gif) The method is founded on the following general principle that we will soon investigate. -_**General principle:** The sequence _I k_ will converge to the stationary vector _I_._ +_**General principle:** The sequence \_I k_ will converge to the stationary vector _I_.\_ We will illustrate with the example above. @@ -674,9 +673,9 @@ It is natural to ask what these numbers mean. Of course, there can be no absolut Three questions naturally come to mind: -- Does the sequence _I k_ always converge? -- Is the vector to which it converges independent of the initial vector _I 0_? -- Do the importance rankings contain the information that we want? +- Does the sequence _I k_ always converge? +- Is the vector to which it converges independent of the initial vector _I 0_? +- Do the importance rankings contain the information that we want? Given the current method, the answer to all three questions is "No!" However, we'll see how to modify our method so that we can answer "yes" to all three. @@ -696,7 +695,7 @@ _I 1_ _I 2_ -_I 3\=_I__ +\_I 3\=\_I\_\_ 1 @@ -722,7 +721,7 @@ Imagine that we surf the web at random; that is, when we find ourselves on a web As we surf randomly, we will denote by ![$ T_j $ ](https://www.ams.org/featurecolumn/images/december2006/index_8.gif) the fraction of time that we spend on page _Pj_. Then the fraction of the time that we end up on page _Pi_ page coming from _Pj_ is ![$ T_j/l_j $ ](https://www.ams.org/featurecolumn/images/december2006/index_9.gif) . If we end up on _Pi_, we must have come from a page linking to it. This means that -![\[ T_i = \sum_{P_j\in B_i} T_j/l_j \] ](https://www.ams.org/featurecolumn/images/december2006/index_10.gif) +![[ T_i = \sum_{P_j\in B_i} T_j/l_j ] ](https://www.ams.org/featurecolumn/images/december2006/index_10.gif) where the sum is over all the pages _Pj_ linking to _Pi_. Notice that this is the same equation defining the PageRank rankings and so ![$ I(P_i) = T_i $ ](https://www.ams.org/featurecolumn/images/december2006/index_11.gif) . This allows us to interpret a web page's PageRank as the fraction of time that a random surfer spends on that web page. This may make sense if you have ever surfed around for information about a topic you were unfamiliar with: if you follow links for a while, you find yourself coming back to some pages more often than others. Just as "All roads lead to Rome," these are typically more important pages. @@ -754,21 +753,21 @@ In general, the power method is a technique for finding an eigenvector of a squa We will assume that the eigenvalues of **S** are ![$ \lambda_j $ ](https://www.ams.org/featurecolumn/images/december2006/index_14.gif) and that -![\[ 1 = \lambda_1 > |\lambda_2| \geq |\lambda_3| \geq \ldots \geq |\lambda_n| \] ](https://www.ams.org/featurecolumn/images/december2006/index_15.gif) +![[ 1 = \lambda_1 > |\lambda_2| \geq |\lambda_3| \geq \ldots \geq |\lambda_n| ] ](https://www.ams.org/featurecolumn/images/december2006/index_15.gif) We will also assume that there is a basis _vj_ of eigenvectors for **S** with corresponding eigenvalues ![$ \lambda_j $ ](https://www.ams.org/featurecolumn/images/december2006/index_16.gif) . This assumption is not necessarily true, but with it we may more easily illustrate how the power method works. We may write our initial vector _I 0_ as -![\[ I^0 = c_1v_1+c_2v_2 + \ldots + c_nv_n \] ](https://www.ams.org/featurecolumn/images/december2006/index_17.gif) +![[ I^0 = c_1v_1+c_2v_2 + \ldots + c_nv_n ] ](https://www.ams.org/featurecolumn/images/december2006/index_17.gif) Then -![ \begin{eqnarray*} I^1={\bf S}I^0 &=&c_1v_1+c_2\lambda_2v_2 + \ldots + c_n\lambda_nv_n \\ I^2={\bf S}I^1 &=&c_1v_1+c_2\lambda_2^2v_2 + \ldots + c_n\lambda_n^2v_n \\ \vdots & & \vdots \\ I^{k}={\bf S}I^{k-1} &=&c_1v_1+c_2\lambda_2^kv_2 + \ldots + c_n\lambda_n^kv_n \\ \end{eqnarray*} ](https://www.ams.org/featurecolumn/images/december2006/index_18.gif) +![ \begin{eqnarray*} I^1={\bf S}I^0 &=&c_1v_1+c_2\lambda_2v_2 + \ldots + c_n\lambda_nv_n \ I^2={\bf S}I^1 &=&c_1v_1+c_2\lambda_2^2v_2 + \ldots + c_n\lambda_n^2v_n \ \vdots & & \vdots \ I^{k}={\bf S}I^{k-1} &=&c_1v_1+c_2\lambda_2^kv_2 + \ldots + c_n\lambda_n^kv_n \ \end{eqnarray*} ](https://www.ams.org/featurecolumn/images/december2006/index_18.gif) Since the eigenvalues ![$ \lambda_j $ ](https://www.ams.org/featurecolumn/images/december2006/index_19.gif) with ![$ j\geq2 $ ](https://www.ams.org/featurecolumn/images/december2006/index_20.gif) have magnitude smaller than one, it follows that ![$ \lambda_j^k\to0 $ ](https://www.ams.org/featurecolumn/images/december2006/index_21.gif) if ![$ j\geq2 $ ](https://www.ams.org/featurecolumn/images/december2006/index_22.gif) and therefore ![$ I^k\to I=c_1v_1 $ ](https://www.ams.org/featurecolumn/images/december2006/index_23.gif) , an eigenvector corresponding to the eigenvalue 1. It is important to note here that the rate at which ![$ I^k\to I $ ](https://www.ams.org/featurecolumn/images/december2006/index_24.gif) is determined by ![$ |\lambda_2| $ ](https://www.ams.org/featurecolumn/images/december2006/index_25.gif) . When ![$ |\lambda_2| $ ](https://www.ams.org/featurecolumn/images/december2006/index_26.gif) is relatively close to 0, then ![$ \lambda_2^k\to0 $ ](https://www.ams.org/featurecolumn/images/december2006/index_27.gif) relatively quickly. For instance, consider the matrix -![\[ {\bf S} = \left[\begin{array}{cc}0.65 & 0.35 \\ 0.35 & 0.65 \end{array}\right]. \] ](https://www.ams.org/featurecolumn/images/december2006/index_28.gif) +![[ {\bf S} = \left[\begin{array}{cc}0.65 & 0.35 \ 0.35 & 0.65 \end{array}\right]. ] ](https://www.ams.org/featurecolumn/images/december2006/index_28.gif) The eigenvalues of this matrix are ![$ \lambda_1=1 $ ](https://www.ams.org/featurecolumn/images/december2006/index_29.gif) and ![$ \lambda_2=0.3 $ ](https://www.ams.org/featurecolumn/images/december2006/index_30.gif) . In the figure below, we see the vectors _I k_, shown in red, converging to the stationary vector _I_ shown in green. @@ -776,7 +775,7 @@ The eigenvalues of this matrix are ![$ \lambda_1=1 $ ](https://www.ams.org/featu Now consider the matrix -![\[ {\bf S} = \left[\begin{array}{cc}0.85 & 0.15 \\ 0.15 & 0.85 \end{array}\right]. \] ](https://www.ams.org/featurecolumn/images/december2006/index_31.gif) +![[ {\bf S} = \left[\begin{array}{cc}0.85 & 0.15 \ 0.15 & 0.85 \end{array}\right]. ] ](https://www.ams.org/featurecolumn/images/december2006/index_31.gif) Here the eigenvalues are ![$ \lambda_1=1 $ ](https://www.ams.org/featurecolumn/images/december2006/index_32.gif) and ![$ \lambda_2=0.7 $ ](https://www.ams.org/featurecolumn/images/december2006/index_33.gif) . Notice how the vectors _I k_ converge more slowly to the stationary vector _I_ in this example in which the second eigenvalue has a larger magnitude. @@ -890,7 +889,7 @@ Notice that the PageRanks assigned to the first four web pages are zero. However Links come into this box, but none go out. Just as in the example of the dangling node we discussed above, these pages form an "importance sink" that drains the importance out of the other four pages. This happens when the matrix **S** is _reducible_; that is, **S** can be written in block form as -![\[ S=\left[\begin{array}{cc} * & 0 \\ * & * \end{array}\right]. \] ](https://www.ams.org/featurecolumn/images/december2006/index_39.gif) +![[ S=\left[\begin{array}{cc} * & 0 \ * & * \end{array}\right]. ] ](https://www.ams.org/featurecolumn/images/december2006/index_39.gif) Indeed, if the matrix **S** is irreducible, we can guarantee that there is a stationary vector with all positive entries. @@ -904,7 +903,7 @@ To find a new matrix that is both primitive and irreducible, we will modify the If we denote by **1** the ![$ n\times n $ ](https://www.ams.org/featurecolumn/images/december2006/index_43.gif) matrix whose entries are all one, we obtain the _Google matrix_: -![\[ {\bf G}=\alpha{\bf S}+ (1-\alpha)\frac{1}{n}{\bf 1} \] ](https://www.ams.org/featurecolumn/images/december2006/index_44.gif) +![[ {\bf G}=\alpha{\bf S}+ (1-\alpha)\frac{1}{n}{\bf 1} ] ](https://www.ams.org/featurecolumn/images/december2006/index_44.gif) Notice now that **G** is stochastic as it is a combination of stochastic matrices. Furthermore, all the entries of **G** are positive, which implies that **G** is both primitive and irreducible. Therefore, **G** has a unique stationary vector _I_ that may be found using the power method. @@ -918,15 +917,15 @@ What we've described so far looks like a good theory, but remember that we need Remember that the stochastic matrix **S** may be written as -![\[ {\bf S}={\bf H} + {\bf A} \] ](https://www.ams.org/featurecolumn/images/december2006/index_52.gif) +![[ {\bf S}={\bf H} + {\bf A} ] ](https://www.ams.org/featurecolumn/images/december2006/index_52.gif) and therefore the Google matrix has the form -![\[ {\bf G}=\alpha{\bf H} + \alpha{\bf A} + \frac{1-\alpha}{n}{\bf 1} \] ](https://www.ams.org/featurecolumn/images/december2006/index_53.gif) +![[ {\bf G}=\alpha{\bf H} + \alpha{\bf A} + \frac{1-\alpha}{n}{\bf 1} ] ](https://www.ams.org/featurecolumn/images/december2006/index_53.gif) Therefore, -![\[ {\bf G}I^k=\alpha{\bf H}I^k + \alpha{\bf A}I^k + \frac{1-\alpha}{n}{\bf 1}I^k \] ](https://www.ams.org/featurecolumn/images/december2006/index_54.gif) +![[ {\bf G}I^k=\alpha{\bf H}I^k + \alpha{\bf A}I^k + \frac{1-\alpha}{n}{\bf 1}I^k ] ](https://www.ams.org/featurecolumn/images/december2006/index_54.gif) Now recall that most of the entries in **H** are zero; on average, only ten entries per column are nonzero. Therefore, evaluating **H**_I k_ requires only ten nonzero terms for each entry in the resulting vector. Also, the rows of **A** are all identical as are the rows of **1**. Therefore, evaluating **A**_I k_ and **1**_I k_ amounts to adding the current importance rankings of the dangling nodes or of all web pages. This only needs to be done once. @@ -938,4 +937,4 @@ Of course, the web is continually changing. First, the content of web pages, esp Brin and Page introduced Google in 1998, a time when the pace at which the web was growing began to outstrip the ability of current search engines to yield useable results. At that time, most search engines had been developed by businesses who were not interested in publishing the details of how their products worked. In developing Google, Brin and Page wanted to "push more development and understanding into the academic realm." That is, they hoped, first of all, to improve the design of search engines by moving it into a more open, academic environment. In addition, they felt that the usage statistics for their search engine would provide an interesting data set for research. It appears that the federal government, which recently tried to gain some of Google's statistics, feels the same way. -There are other algorithms that use the hyperlink structure of the web to rank the importance of web pages. One notable example is the HITS algorithm, produced by Jon Kleinberg, which forms the basis of the [Teoma search engine.](http://www.ask.com/) In fact, it is interesting to compare the results of searches sent to different search engines as a way to understand why some complain of a Googleopoly. \ No newline at end of file +There are other algorithms that use the hyperlink structure of the web to rank the importance of web pages. One notable example is the HITS algorithm, produced by Jon Kleinberg, which forms the basis of the [Teoma search engine.](http://www.ask.com/) In fact, it is interesting to compare the results of searches sent to different search engines as a way to understand why some complain of a Googleopoly. diff --git a/notes/BGOONZ_BLOG_2.0.wiki/articles/custom-search-bar.md b/notes/BGOONZ_BLOG_2.0.wiki/articles/custom-search-bar.md index b3e8eb88f1..fe48bf7b57 100644 --- a/notes/BGOONZ_BLOG_2.0.wiki/articles/custom-search-bar.md +++ b/notes/BGOONZ_BLOG_2.0.wiki/articles/custom-search-bar.md @@ -1,12 +1,12 @@ - - # [SOLVED] - How to add a Google Search Bar to your Website? - 2021 Expertrec > ## Excerpt +> > Easy steps to add a Google search bar or box to your website✅✅. You need not have any coding knowledge to follow the steps below. This --- -Easy steps to add a Google search bar or box to your website. You need not have any coding knowledge to follow the steps below. This method works with all major CMS’s such as WordPress, Ghost, Drupal, Joomla, etc. + +Easy steps to add a Google search bar or box to your website. You need not have any coding knowledge to follow the steps below. This method works with all major CMS’s such as WordPress, Ghost, Drupal, Joomla, etc. ![How to add a Google Search Bar to your Website](https://cdn-bbeoo.nitrocdn.com/qmCVQYRCWGzHArsQEaxlonBAyCtBBIUq/assets/static/optimized/rev-5e70179/wp-content/uploads/2021/01/How-to-add-a-Google-Search-Bar-to-your-Website-1024x576.png) @@ -19,14 +19,14 @@ If you are on WordPress, it has a default search bar that adds basic search func ### Creating a Google custom search using (programmable search engine) 1. To create a Programmable Search Engine: - + 1. Sign in to [Control Panel](https://programmablesearchengine.google.com/create/new) using your Google Account ([get an account](https://www.google.com/accounts/NewAccount) if you don’t have one). 2. The **name** of your search engine will be automatically generated based on the URLs you select. You can change this name at any time. 3. Select the **language** of your search engine. This defines the language of the buttons and other design elements of your search engine but doesn’t affect the actual search results. 4. Click **Create**. - + Your basic search engine is ready to use! To see more configuration options, go to the [Control Panel](https://programmablesearchengine.google.com/). Control Panel also has a preview window that allows you to test and fine-tune your search results. - + 2. Go to [https://cse.google.co.in/cse/](https://cse.google.co.in/cse/)[![add google search to website](https://cdn-bbeoo.nitrocdn.com/qmCVQYRCWGzHArsQEaxlonBAyCtBBIUq/assets/static/optimized/rev-5e70179/wp-content/uploads/2018/03/google-custom-search-bar.png)](https://blog.expertrec.com/add-search-to-website/) 3. Sign in to [Control Panel](https://programmablesearchengine.google.com/create/new) using your Google Account ([get an account](https://www.google.com/accounts/NewAccount) if you don’t have one). 4. The **name** of your search engine will be automatically generated based on the URLs you select. You can change this name at any time. @@ -66,17 +66,17 @@ First of all, you need to enable Image Search in the [Control Panel](https://pr ### Advantages of adding Google custom search -- Google custom search is free. There are few custom search engines that are free. -- If you enable ads inside Google custom search, you can make money from AdSense. +- Google custom search is free. There are few custom search engines that are free. +- If you enable ads inside Google custom search, you can make money from AdSense. ### [Disadvantages of using google custom search-](https://blog.expertrec.com/disadvantages-of-using-google-custom-search/) -- Ads- You can lose your website visitors to competitors. -- No control over what is indexed or when -- No control of search results -- No support -- Minimal UI customization options -- It can be shut down or changed at any time. Google is known for killing products ruthlessly without considering the user base. +- Ads- You can lose your website visitors to competitors. +- No control over what is indexed or when +- No control of search results +- No support +- Minimal UI customization options +- It can be shut down or changed at any time. Google is known for killing products ruthlessly without considering the user base. Though this might sound great to have Google search on your website, there is no free lunch.  Google shows ads to cover up for this service.  Now say, your site is about shoes of brand X.  when people search on your site for a shoe you have,  Google shows an ad of your competitor brand Y and **places it above** your site results.  Your visitors are going to believe that you indeed are recommending brand Y yourself.  If you are going to monetize your visitors, then this will drastically reduce your income. @@ -95,12 +95,12 @@ Before starting to make a custom search engine using Expertrec, make sure that i 5. Initiate a website crawl. (Now Expertrec crawlers will start crawling your website. This could take some time depending on the size and number of pages on your website). 6. Once the crawl completes, you can make changes to your search engine’s look and feel and also to the search engine’s ranking algorithm by using the control panel. There are more advanced features like search weights, promotions, synonyms, and more.![add google search to website](https://cdn-bbeoo.nitrocdn.com/qmCVQYRCWGzHArsQEaxlonBAyCtBBIUq/assets/static/optimized/rev-5e70179/wp-content/uploads/2018/03/UI-editor.jpg) 7. Go to the code section and add it to your website. You can also email the code to your developer and ask them to add it to their website. - - the code contains two portions ( one within **** and another piece of code ****). - - The is just the JavaScript component and can be added using Google tag manager or using the code editor. - - The code adds the search box to your website. The place where you add this code determines the location of the search box.![add google search to website](https://cdn-bbeoo.nitrocdn.com/qmCVQYRCWGzHArsQEaxlonBAyCtBBIUq/assets/static/optimized/rev-5e70179/wp-content/uploads/2018/03/expertrec-cse-code.png) + - the code contains two portions ( one within **** and another piece of code ****). + - The is just the JavaScript component and can be added using Google tag manager or using the code editor. + - The code adds the search box to your website. The place where you add this code determines the location of the search box.![add google search to website](https://cdn-bbeoo.nitrocdn.com/qmCVQYRCWGzHArsQEaxlonBAyCtBBIUq/assets/static/optimized/rev-5e70179/wp-content/uploads/2018/03/expertrec-cse-code.png) 8. It is advisable to make the code changes in a test mode or development website before taking live in your live/ production site. 9. As a final step, remove any website cache that you might have. -10. Now your site search engine is live. After a few days of search engine usage, you can check out the search analytics to check out what users are searching for and reorganize your content strategy accordingly. +10. Now your site search engine is live. After a few days of search engine usage, you can check out the search analytics to check out what users are searching for and reorganize your content strategy accordingly. ## Advantages of Using Expertrec search bar @@ -127,43 +127,42 @@ This plugin replaces your default WordPress search form. However, for some theme ### **Features** -- Superfast. (Since our search loads from our super-fast servers with super caching technology-enabled, you can expect to deliver a super-fast search experience to your website visitors). -- Free voice search. (Currently supported only in Chrome browsers). -- Image search. ( Featured images are automatically captured from every page and are displayed alongside the search results). -- PDF search. (Contents within the PDF are indexed and displayed inside search results. Users can separately select only PDF results using the filter option) -- Relevant and better search results. (Our search learns as users interact more and more with the search engine, which leads to better re-ranking ). -- No Ads. (We promise never to show ads in our search results). -- Search Filters and Facets. (Our crawler automatically detects categories of blogs and products and creates a filter for users to fine-tune their search results). -- Custom Search engine rules. (You can define custom search rules to promote or demote search results). -- Synonyms. ( You can set synonyms by adding in our easy-to-use interface, for example, furniture=sofa, etc.) -- Complete control over the UI (no coding required). -- Quick and easy configuration. (no coding required). -- Fast type ahead auto-complete search suggestions. -- Advanced word matching and typo correction. -- The self Learning search algorithm continuously gets better. -- Highlighting Search term. -- Responsive – works across all devices (mobile, tablet, desktop, android app). +- Superfast. (Since our search loads from our super-fast servers with super caching technology-enabled, you can expect to deliver a super-fast search experience to your website visitors). +- Free voice search. (Currently supported only in Chrome browsers). +- Image search. ( Featured images are automatically captured from every page and are displayed alongside the search results). +- PDF search. (Contents within the PDF are indexed and displayed inside search results. Users can separately select only PDF results using the filter option) +- Relevant and better search results. (Our search learns as users interact more and more with the search engine, which leads to better re-ranking ). +- No Ads. (We promise never to show ads in our search results). +- Search Filters and Facets. (Our crawler automatically detects categories of blogs and products and creates a filter for users to fine-tune their search results). +- Custom Search engine rules. (You can define custom search rules to promote or demote search results). +- Synonyms. ( You can set synonyms by adding in our easy-to-use interface, for example, furniture=sofa, etc.) +- Complete control over the UI (no coding required). +- Quick and easy configuration. (no coding required). +- Fast type ahead auto-complete search suggestions. +- Advanced word matching and typo correction. +- The self Learning search algorithm continuously gets better. +- Highlighting Search term. +- Responsive – works across all devices (mobile, tablet, desktop, android app). [Add a google search bar to your site for $9 per month](https://cse.expertrec.com/?platform=cse) - - - --- + --- # How to add custom google search bar inside your web-page? - GeeksforGeeks > ## Excerpt +> > A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. --- + A search bar is necessary for a good website. Creating your own search engine from scratch might be a difficult task but this task can be skipped with the help of Google. Google has created a website to create a custom search bar, to create your own check the below link. -- https://programmablesearchengine.google.com/about/ - - . - +- https://programmablesearchengine.google.com/about/ + + . **Creating a Custom Search Bar:** On this website, anyone can easily program their search bar by just selecting the sites you want to be searched for. Follow the steps explained below. @@ -171,70 +170,66 @@ A search bar is necessary for a good website. Creating your own search engine fr **Embedding the Search Bar on a Webpage:** After getting your code you can simply paste it inside your web page to see the working search bar. -- **Example:** You can see that the output screen has a search bar with an option to search which shows the result from the sites or domain you have selected while creating this search bar. Moreover, this search option will automatically change as you change the sites from the control panel. Currently, the search results are been shown in the default manner. Apart from that, you can manipulate the result displaying manner and much more as directed on the below links - - https://developers.google.com/custom-search/docs/element - - . - - - HTML - - ## HTML - - `` - - `<``html``>` - - `<``head``>` - - `<``title``>Custom Search-Bar` - - `<``style``>` - - `body {` - - `background-image: linear-gradient(to left, white, green);` - - `color: lawngreen;` - - `}` - - `` - - `` - - `<``body``>` - - `<``h1` `style``=``"text-align: center;"``>GeeksforGeeks` - - `<``script` `async` `src``=` - - `` - - `<``div` `class``=``"gcse-search"``>` - - `` - - `` - -- **Output:** ![](https://media.geeksforgeeks.org/wp-content/uploads/20200515125003/Screencast-2020-05-15-124903.gif) +- **Example:** You can see that the output screen has a search bar with an option to search which shows the result from the sites or domain you have selected while creating this search bar. Moreover, this search option will automatically change as you change the sites from the control panel. Currently, the search results are been shown in the default manner. Apart from that, you can manipulate the result displaying manner and much more as directed on the below links + https://developers.google.com/custom-search/docs/element + . + - HTML + ## HTML ---- ---- + `` + + ` <``html``> ` + + ` <``head``> ` + + ` <``title``>Custom Search-Bar ` + + ` <``style``> ` + + `body {` + + `background-image: linear-gradient(to left, white, green);` + + `color: lawngreen;` + + `}` + + ` ` + + ` ` + ` <``body``> ` + ` <``h1 ` ` style``=``"text-align: center;"``>GeeksforGeeks ` + ` <``script ` `async` ` src``= ` + + ` ` + + ` <``div ` ` class``=``"gcse-search"``> ` + + ` ` + + ` ` + +- **Output:** ![](https://media.geeksforgeeks.org/wp-content/uploads/20200515125003/Screencast-2020-05-15-124903.gif) + +--- + +--- # Implementing search box  |  Programmable Search Engine > ## Excerpt +> > Once you've created your Programmable Search Engine, you can add the Programmable Search Element to your site. To do this, you'll need to copy some code and paste it into your site's HTML where you want your search engine to appear. --- + Once you've created your Programmable Search Engine, you can add the Programmable Search Element to your site. To do this, you'll need to copy some code and paste it into your site's HTML where you want your search engine to appear. 1. In the [Control Panel](https://programmablesearchengine.google.com/) click the search engine you want to use. @@ -291,25 +286,18 @@ Note the _q=myQuery_ param in the address bar - this is how the `