Changeset 152435 in webkit


Ignore:
Timestamp:
Jul 6, 2013 12:24:42 AM (11 years ago)
Author:
Christophe Dumez
Message:

Stop hardcoding interfaces that have indexed getters returning strings
https://bugs.webkit.org/show_bug.cgi?id=118414

Reviewed by Kentaro Hara.

Stop hardcoding the names of interfaces that have indexed getters returning
strings in the bindings generator. Now that we use the latest Web IDL indexed
getter, more information is provided in the IDL files and the generator is
able to figure out if the indexed getter is returning a DOMString on its own.

No new tests, no behavior change.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateGetOwnPropertySlotBody):
(GenerateImplementation):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152434 r152435  
     12013-07-06  Christophe Dumez  <ch.dumez@sisa.samsung.com>
     2
     3        Stop hardcoding interfaces that have indexed getters returning strings
     4        https://bugs.webkit.org/show_bug.cgi?id=118414
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Stop hardcoding the names of interfaces that have indexed getters returning
     9        strings in the bindings generator. Now that we use the latest Web IDL indexed
     10        getter, more information is provided in the IDL files and the generator is
     11        able to figure out if the indexed getter is returning a DOMString on its own.
     12
     13        No new tests, no behavior change.
     14
     15        * bindings/scripts/CodeGeneratorJS.pm:
     16        (GenerateGetOwnPropertySlotBody):
     17        (GenerateImplementation):
     18
    1192013-07-05  Tim Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r152404 r152435  
    179179}
    180180
    181 sub IndexGetterReturnsStrings
    182 {
    183     my $type = shift;
    184 
    185     return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "DOMStringList" or $type eq "DOMTokenList" or $type eq "DOMSettableTokenList";
    186     return 0;
    187 }
    188 
    189181sub AddIncludesForTypeInImpl
    190182{
     
    391383        # If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases
    392384        # where the index is out of range.
    393         if (IndexGetterReturnsStrings($interfaceName)) {
     385        if ($indexedGetterFunction->signature->type eq "DOMString") {
    394386            push(@getOwnPropertySlotImpl, "    if (index != PropertyName::NotAnIndex) {\n");
    395387        } else {
     
    19801972
    19811973            if ($indexedGetterFunction) {
    1982                 if (IndexGetterReturnsStrings($interfaceName)) {
     1974                if ($indexedGetterFunction->signature->type eq "DOMString") {
    19831975                    push(@implContent, "    if (index <= MAX_ARRAY_INDEX) {\n");
    19841976                } else {
     
    26582650        push(@implContent, "    ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n");
    26592651        push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);\n");
    2660         if (IndexGetterReturnsStrings($interfaceName)) {
     2652        if ($indexedGetterFunction->signature->type eq "DOMString") {
    26612653            $implIncludes{"KURL.h"} = 1;
    26622654            push(@implContent, "    return jsStringOrUndefined(exec, thisObj->impl()->item(index));\n");
Note: See TracChangeset for help on using the changeset viewer.