Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r186265 - REGRESSION (r178097): JavaScript TypeError after clic…
…king on compose button in Yahoo Mail https://bugs.webkit.org/show_bug.cgi?id=146515 <rdar://problem/21348421> Reviewed by Chris Dumez. Source/WebCore: Fixes an issue where extra arguments passed to a Web IDL overloaded function, whose implementation is generated by the bindings generator script, are not ignored as per the note in section "Interface object [[Call]] method" of the Web IDL spec, <http://www.w3.org/TR/2012/CR-WebIDL-20120419/> (19 April 2012). Currently for an overloaded function the JavaScript bindings generator script emits code to throw a TypeError when it cannot find a candidate function that takes the same number of arguments as passed by a caller. Prior to the change made in bug #139179 (r178097), the bindings code for HTMLSelectElement.add() was written by hand and ignored extra arguments that were passed to it. Following this change, the bindings code for HTMLSelectElement.add() is generated by the bindings generator script. Therefore, we throw a TypeError when Yahoo Mail calls HTMLSelectElement.add() with extra arguments because the code emitted by the bindings generator script does not ignore them. * bindings/scripts/CodeGeneratorJS.pm: (LengthOfLongestFunctionParameterList): Added. Computes the length of longest overload parameter list. (GenerateOverloadedFunction): Emit code that ignores more arguments than LengthOfLongestFunctionParameterList(). (GenerateOverloadedConstructorDefinition): Ditto. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12): Added; expected result for an overloaded function that takes a variadic number of Blob elements. (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Update expected result. The added if-conditional expression for the IDL declaration overloadedMethod(Blob... blobArgs) is empty because we do not support overloading of functions with variadic arguments. (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors5): Added; expected result for an overloaded constructors that takes a variadic number of long arguments. (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors): Update expected result. The added if-conditional expression for the IDL declaration Constructor(long... longArgs) is empty because we do not support overloading of constructors with variadic arguments. * bindings/scripts/test/TestObj.idl: Added declaration overloadedMethod(Blob...). Also fixed typo in license block text. * bindings/scripts/test/TestOverloadedConstructors.idl: Added declaration Constructor(long... longArgs). Also fixed typo in license block text. LayoutTests: Add new sub-tests to LayoutTests/fast/dom/HTMLSelectElement/{add, options-collection-add}.html, simplify existing test code, share common code, and update expected results. Additionally, update results for tests in LayoutTests/fast/canvas now that we ignore extra arguments passed to a Web IDL overloaded function whose implementation is generated by the bindings generator script. * fast/canvas/canvas-overloads-drawImage-expected.txt: * fast/canvas/canvas-overloads-setFillColor-expected.txt: * fast/canvas/canvas-overloads-setShadow-expected.txt: * fast/canvas/canvas-overloads-setStrokeColor-expected.txt: * fast/canvas/script-tests/canvas-overloads-drawImage.js: * fast/canvas/script-tests/canvas-overloads-setFillColor.js: * fast/canvas/script-tests/canvas-overloads-setShadow.js: * fast/canvas/script-tests/canvas-overloads-setStrokeColor.js: * fast/dom/HTMLSelectElement/add-expected.txt: * fast/dom/HTMLSelectElement/add.html: * fast/dom/HTMLSelectElement/options-collection-add-expected.txt: * fast/dom/HTMLSelectElement/options-collection-add.html: * fast/dom/HTMLSelectElement/resources/html-select-and-options-collection-utilities.js: Added. (createSelectElementWithTestData): (deepCopy): (createOption): (createGroup):
- Loading branch information
1 parent
4d585f0
commit 6277b35
Showing
20 changed files
with
396 additions
and
274 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
Oops, something went wrong.