[WebIDL] Implement overload resolution algorithm
https://bugs.webkit.org/show_bug.cgi?id=160394

Reviewed by Darin Adler.

Source/WebCore:

Implement overload resolution algorithm:
- http://heycam.github.io/webidl/#es-overloads

This means that our support for operation overloading in our IDL is
now a lot more extensive than it used to be and is now compliant with
the Web IDL specification.

In particular, overloading should now work for a lot more parameter
types which means that:
- We should be able to drop some custom bindings code in a follow-up patch.
- We will be able to drop the [StrictTypeChecking] attribute which was
  a hack used to make overloading work for parameters of type DOMString.

Also, the order of the overloads in the IDL no longer impacts the
generated bindings code. It used to be that you needed to put the
overloads with the more specific parameter types first in order for the
generated bindings code to be somewhat correct.

No new tests, rebaselined bindings tests.

* bindings/scripts/CodeGenerator.pm:
(IsStringOrEnumType):
* bindings/scripts/CodeGeneratorJS.pm:
(IsNullableType):
(StripNullable):
(ComputeEffectiveOverloadSet):
(AreTypesDistinguishableForOverloadResolution):
(GetDistinguishingArgumentIndex):
(GetOverloadThatMatches):
(GenerateOverloadedFunction):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted.
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
* bindings/scripts/test/TestObj.idl:
* dom/EventTarget.h:
* dom/EventTarget.idl:
* html/HTMLOptionsCollection.h:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.h:
(WebCore::HTMLSelectElement::add):
* html/HTMLSelectElement.idl:

LayoutTests:

Update / Rebaseline existing test. There is no major behavior change.
We sometimes get a different exception message than we used to.

* fast/canvas/canvas-clip-path-expected.txt:
* fast/canvas/canvas-fill-path-expected.txt:
* fast/canvas/canvas-path-addPath-expected.txt:
* fast/canvas/canvas-path-isPointInPath-expected.txt:
* fast/canvas/canvas-path-isPointInStroke-expected.txt:
* fast/canvas/canvas-putImageData-expected.txt:
* fast/canvas/canvas-putImageData.js:
* fast/canvas/canvas-stroke-path-expected.txt:
* fast/canvas/webgl/script-tests/texImageTest.js:
* fast/canvas/webgl/texImageTest-expected.txt:
* 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/incompatible-operations-expected.txt:
* js/dom/select-options-add-expected.txt:
* webaudio/audiobuffer-expected.txt:
* webaudio/audiobuffer.html:
* webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@204028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed