Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebIDL] Add support for default parameter values
https://bugs.webkit.org/show_bug.cgi?id=149263 <rdar://problem/22545600> Reviewed by Ryosuke Niwa. LayoutTests/imported/w3c: Rebaseline several W3C tests now that more NodeIterator / TreeWalker checks are passing. * web-platform-tests/dom/traversal/NodeIterator-expected.txt: * web-platform-tests/dom/traversal/TreeWalker-basic-expected.txt: Source/WebCore: Add support for default parameter values to our Web IDL parser and JS bindings generator. This allows the bindings to convert undefined to the parameter's default value for optional parameters: https://heycam.github.io/webidl/#dfn-optional-argument-default-value Previously, our bindings generator would just convert undefined to 0 / false / "undefined" for optional parameters, depending on the parameter type. This patch uses the new default parameter support to fix a bug in document.createNodeIterator() / document.createTreeWalker()'s handling of the whatToShow parameter: https://dom.spec.whatwg.org/#document WebKit currently was undefined to 0 in this case, even though it should use the parameter's default value: OxFFFFFFFF. I am planning to go through other optional parameters in a follow-up patch and add default values where needed. No new tests, already covered by existing layout tests and added bindings tests coverage. * bindings/scripts/CodeGeneratorJS.pm: (GenerateParametersCheck): * bindings/scripts/IDLParser.pm: (parseOptionalOrRequiredArgument): * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: (webkit_dom_test_obj_method_with_optional_arg_and_default_value): (webkit_dom_test_obj_method_with_optional_string_and_default_value): * bindings/scripts/test/GObject/WebKitDOMTestObj.h: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue): * bindings/scripts/test/ObjC/DOMTestObj.h: * bindings/scripts/test/ObjC/DOMTestObj.mm: (-[DOMTestObj methodWithOptionalArgAndDefaultValue:]): (-[DOMTestObj methodWithOptionalStringAndDefaultValue:]): * bindings/scripts/test/TestObj.idl: * dom/Document.idl: LayoutTests: Rebaseline several NodeIterator / TreeWalker tests now that more checks are passing. * fast/dom/createNodeIterator-parameters-expected.txt: * fast/dom/createTreeWalker-parameters-expected.txt: Canonical link: https://commits.webkit.org/167401@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
16 changed files
with
191 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters