Changeset 204033 in webkit


Ignore:
Timestamp:
Aug 2, 2016 12:11:27 PM (8 years ago)
Author:
Chris Dumez
Message:

Kill [StrictTypeChecking] IDL extended attribute
https://bugs.webkit.org/show_bug.cgi?id=160382

Reviewed by Darin Adler.

Kill [StrictTypeChecking] IDL extended attribute. Its only remaining
use was on DOMString parameters for a few CanvasRenderingContext2D
operations in order to work around a bug in our overload resolution.

However, as of r204028, we implement the Web IDL overload resolution
algorithm and [StrictTypeChecking] is now a no-op and is no longer
needed.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateParametersCheckExpression):

  • bindings/scripts/IDLAttributes.txt:
  • bindings/scripts/test/TestObj.idl:
  • bindings/scripts/test/TestTypedefs.idl:
  • html/canvas/CanvasRenderingContext2D.idl:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r204032 r204033  
     12016-08-02  Chris Dumez  <cdumez@apple.com>
     2
     3        Kill [StrictTypeChecking] IDL extended attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=160382
     5
     6        Reviewed by Darin Adler.
     7
     8        Kill [StrictTypeChecking] IDL extended attribute. Its only remaining
     9        use was on DOMString parameters for a few CanvasRenderingContext2D
     10        operations in order to work around a bug in our overload resolution.
     11
     12        However, as of r204028, we implement the Web IDL overload resolution
     13        algorithm and [StrictTypeChecking] is now a no-op and is no longer
     14        needed.
     15
     16        * bindings/scripts/CodeGeneratorJS.pm:
     17        (GenerateParametersCheckExpression):
     18        * bindings/scripts/IDLAttributes.txt:
     19        * bindings/scripts/test/TestObj.idl:
     20        * bindings/scripts/test/TestTypedefs.idl:
     21        * html/canvas/CanvasRenderingContext2D.idl:
     22
    1232016-08-02  Frederic Wang  <fwang@igalia.com>
    224
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r204028 r204033  
    19571957        my $type = $parameter->type;
    19581958
    1959         # For DOMString with StrictTypeChecking only Null, Undefined and Object
    1960         # are accepted for compatibility. Otherwise, no restrictions are made to
    1961         # match the non-overloaded behavior.
    1962         # FIXME: Implement WebIDL overload resolution algorithm.
    1963         if ($type eq "DOMString" || $codeGenerator->IsEnumType($type)) {
    1964             if ($parameter->extendedAttributes->{"StrictTypeChecking"}) {
    1965                 push(@andExpression, "(${value}.isUndefinedOrNull() || ${value}.isString() || ${value}.isObject())");
    1966                 $usedArguments{$parameterIndex} = 1;
    1967             }
    1968         } elsif ($codeGenerator->IsCallbackInterface($parameter->type)) {
     1959        if ($codeGenerator->IsCallbackInterface($parameter->type)) {
    19691960            # For Callbacks only checks if the value is null or object.
    19701961            if ($codeGenerator->IsFunctionOnlyCallbackInterface($parameter->type)) {
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r203463 r204033  
    121121SetterCallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow
    122122SkipVTableValidation
    123 StrictTypeChecking
    124123SuppressToJSObject
    125124TreatNullAs=EmptyString
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r204028 r204033  
    252252#if defined(TESTING_JS)
    253253    // Overloads
    254     void    overloadedMethod(TestObj? objArg, [StrictTypeChecking] DOMString strArg);
     254    void    overloadedMethod(TestObj? objArg, DOMString strArg);
    255255    void    overloadedMethod(TestObj? objArg, optional long longArg);
    256     void    overloadedMethod([StrictTypeChecking] DOMString strArg);
     256    void    overloadedMethod(DOMString strArg);
    257257    void    overloadedMethod(long longArg);
    258258    void    overloadedMethod(TestCallback callback);
  • trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl

    r203956 r204033  
    4343    void func(optional ARRAY_OF_LONGS x = []);
    4444
    45     void setShadow(DOUBLE width, DOUBLE height, unrestricted float blur, [StrictTypeChecking] optional STRING color, optional DOUBLE alpha);
     45    void setShadow(DOUBLE width, DOUBLE height, unrestricted float blur, optional STRING color, optional DOUBLE alpha);
    4646
    4747    ULONGLONG methodWithSequenceArg(sequence<SCRIPT_VALUE> sequenceArg);
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl

    r203510 r204033  
    127127    void strokeText(DOMString text, unrestricted float x, unrestricted float y, optional unrestricted float maxWidth);
    128128
    129     void setStrokeColor([StrictTypeChecking] DOMString color, optional unrestricted float alpha);
     129    void setStrokeColor(DOMString color, optional unrestricted float alpha);
    130130    void setStrokeColor(unrestricted float grayLevel, optional float alpha = 1);
    131131    void setStrokeColor(unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a);
    132132    void setStrokeColor(unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a);
    133133
    134     void setFillColor([StrictTypeChecking] DOMString color, optional unrestricted float alpha);
     134    void setFillColor(DOMString color, optional unrestricted float alpha);
    135135    void setFillColor(unrestricted float grayLevel, optional unrestricted float alpha = 1);
    136136    void setFillColor(unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a);
     
    161161
    162162    void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur,
    163         [StrictTypeChecking] optional DOMString color, optional unrestricted float alpha);
     163        optional DOMString color, optional unrestricted float alpha);
    164164    void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur, unrestricted float grayLevel,
    165165        optional unrestricted float alpha = 1);
Note: See TracChangeset for help on using the changeset viewer.