Changeset 200288 in webkit


Ignore:
Timestamp:
Apr 29, 2016, 10:09:10 PM (10 years ago)
Author:
Darin Adler
Message:

First step in using "enum class" instead of "String" for enumerations in DOM
https://bugs.webkit.org/show_bug.cgi?id=157163

Reviewed by Chris Dumez.

Source/JavaScriptCore:

  • runtime/JSString.h:

(JSC::jsStringWithCache): Deleted unneeded overload for AtomicString.

Source/WebCore:

This patch adds the basic support for using "enum class" to implement enumerations
in the C++ DOM. This is enough so we can use it for one case, but not enough for
others. For example, it correctly generates code to get an attribute, but likely
does not correctly generate code to set an attribute or call a function with an
argument type that is the new style of enum.

  • bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes

at the start of this file. Added a new one named stringBasedEnumerationHash
and a comment explaining that we need to eventually make it empty.
(ProcessDocument): Pass the enumerations into the GenerateInterface function.
(IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
as opposed to enumerations we use "enum class" for.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateInterface): Take the enumerations argument and pass it along to the
functions that generate headers and implementation files.
(EnumerationClassName): Added. Maps from an enumeration type name as seen
in the IDL file to the enumeration class name used in the C++ DOM implementation.
(EnumerationValueName): Added. Maps from an anumeration string value as seen
in the IDL file to an enumeration value name used in the C++ DOM implementatino.
(EnumerationImplementationContent): Added. Generates a string with all the content
needed in the implementation file to define the helper functions for enumerations.
(GenerateHeader): Tweak.
(GenerateImplementation): Added call to EnumerationImplementationContent.
(GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
longer way of writing out the same thing.
(GenerateCallbackHeader): Tweak.
(GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
(GetNativeType): Continue to return String for string-based enum types, but for
other enum types, return the result of EnumerationClassName instead.
(JSValueToNative): Use toWTFString instead of toString/value (see above), convert
to a string only for string-based enum types, and add a preliminary, probably not
yet working, version of the code for non-string-based enum types. Will finish this
in the next patch when we are trying to use one of the new enumerations for a setter
or a function argument.
(NativeToJSValue): Call the stringValue function to convert an enumeration value
into a string when it's not a string-based enumeration.

  • bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
  • bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
  • bindings/scripts/test/JS/JSTestGlobalObject.cpp:
  • bindings/scripts/test/JS/JSTestInterface.cpp:
  • bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
  • bindings/scripts/test/JS/JSTestNode.cpp:
  • bindings/scripts/test/JS/JSTestNondeterministic.cpp:
  • bindings/scripts/test/JS/JSTestObj.cpp:
  • bindings/scripts/test/JS/JSTestObj.h:
  • bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
  • bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
  • bindings/scripts/test/JS/JSTestTypedefs.cpp:

Regenerated.

  • css/FontFace.cpp:

(WebCore::FontFace::status): Updated to return enum values rather than strings.

  • css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.

Added enum class for FontFaceLoadStatus, with names that match the names from the
enumeration in the IDL, but with our standard enum capitalization style. Changed
the return value of the status function to FontFaceLoadStatus.

Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r200277 r200288  
     12016-04-28  Darin Adler  <darin@apple.com>
     2
     3        First step in using "enum class" instead of "String" for enumerations in DOM
     4        https://bugs.webkit.org/show_bug.cgi?id=157163
     5
     6        Reviewed by Chris Dumez.
     7
     8        * runtime/JSString.h:
     9        (JSC::jsStringWithCache): Deleted unneeded overload for AtomicString.
     10
    1112016-04-29  Benjamin Poulain  <bpoulain@apple.com>
    212
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r199686 r200288  
    654654}
    655655
    656 ALWAYS_INLINE JSString* jsStringWithCache(ExecState* exec, const AtomicString& s)
    657 {
    658     return jsStringWithCache(exec, s.string());
    659 }
    660 
    661656ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    662657{
  • trunk/Source/WebCore/ChangeLog

    r200287 r200288  
     12016-04-28  Darin Adler  <darin@apple.com>
     2
     3        First step in using "enum class" instead of "String" for enumerations in DOM
     4        https://bugs.webkit.org/show_bug.cgi?id=157163
     5
     6        Reviewed by Chris Dumez.
     7
     8        This patch adds the basic support for using "enum class" to implement enumerations
     9        in the C++ DOM. This is enough so we can use it for one case, but not enough for
     10        others. For example, it correctly generates code to get an attribute, but likely
     11        does not correctly generate code to set an attribute or call a function with an
     12        argument type that is the new style of enum.
     13
     14        * bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes
     15        at the start of this file. Added a new one named stringBasedEnumerationHash
     16        and a comment explaining that we need to eventually make it empty.
     17        (ProcessDocument): Pass the enumerations into the GenerateInterface function.
     18        (IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
     19        as opposed to enumerations we use "enum class" for.
     20
     21        * bindings/scripts/CodeGeneratorJS.pm:
     22        (GenerateInterface): Take the enumerations argument and pass it along to the
     23        functions that generate headers and implementation files.
     24        (EnumerationClassName): Added. Maps from an enumeration type name as seen
     25        in the IDL file to the enumeration class name used in the C++ DOM implementation.
     26        (EnumerationValueName): Added. Maps from an anumeration string value as seen
     27        in the IDL file to an enumeration value name used in the C++ DOM implementatino.
     28        (EnumerationImplementationContent): Added. Generates a string with all the content
     29        needed in the implementation file to define the helper functions for enumerations.
     30        (GenerateHeader): Tweak.
     31        (GenerateImplementation): Added call to EnumerationImplementationContent.
     32        (GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
     33        longer way of writing out the same thing.
     34        (GenerateCallbackHeader): Tweak.
     35        (GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
     36        (GetNativeType): Continue to return String for string-based enum types, but for
     37        other enum types, return the result of EnumerationClassName instead.
     38        (JSValueToNative): Use toWTFString instead of toString/value (see above), convert
     39        to a string only for string-based enum types, and add a preliminary, probably not
     40        yet working, version of the code for non-string-based enum types. Will finish this
     41        in the next patch when we are trying to use one of the new enumerations for a setter
     42        or a function argument.
     43        (NativeToJSValue): Call the stringValue function to convert an enumeration value
     44        into a string when it's not a string-based enumeration.
     45
     46        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
     47        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
     48        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
     49        * bindings/scripts/test/JS/JSTestInterface.cpp:
     50        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
     51        * bindings/scripts/test/JS/JSTestNode.cpp:
     52        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
     53        * bindings/scripts/test/JS/JSTestObj.cpp:
     54        * bindings/scripts/test/JS/JSTestObj.h:
     55        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
     56        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
     57        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
     58        Regenerated.
     59
     60        * css/FontFace.cpp:
     61        (WebCore::FontFace::status): Updated to return enum values rather than strings.
     62
     63        * css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.
     64        Added enum class for FontFaceLoadStatus, with names that match the names from the
     65        enumeration in the IDL, but with our standard enum capitalization style. Changed
     66        the return value of the status function to FontFaceLoadStatus.
     67
    1682016-04-29  Chris Dumez  <cdumez@apple.com>
    269
  • trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm

    r200236 r200288  
    4545my $verbose = 0;
    4646
    47 my %numericTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1,
    48                        "unsigned int" => 1, "unsigned short" => 1,
    49                        "unsigned long" => 1, "unsigned long long" => 1,
    50                        "float" => 1, "double" => 1,
    51                        "unrestricted float" => 1, "unrestricted double" => 1,
    52                        "byte" => 1, "octet" => 1);
    53 
    54 my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1);
    55 
    56 my %stringTypeHash = ("DOMString" => 1);
     47my %numericTypeHash = (
     48    "byte" => 1,
     49    "double" => 1,
     50    "float" => 1,
     51    "int" => 1,
     52    "long long" => 1,
     53    "long" => 1,
     54    "octet" => 1,
     55    "short" => 1,
     56    "unrestricted double" => 1,
     57    "unrestricted float" => 1,
     58    "unsigned int" => 1,
     59    "unsigned long long" => 1,
     60    "unsigned long" => 1,
     61    "unsigned short" => 1,
     62);
     63
     64my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1 );
     65
     66my %stringTypeHash = ( "DOMString" => 1 );
    5767
    5868# WebCore types used directly in IDL files.
    5969my %webCoreTypeHash = (
     70    "Dictionary" => 1,
    6071    "SerializedScriptValue" => 1,
    61     "Dictionary" => 1
    6272);
    6373
    6474my %enumTypeHash = ();
    6575
    66 my %nonPointerTypeHash = ("DOMTimeStamp" => 1);
    67 
    68 my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick" => 1,
    69                                "onerror" => 1, "onload" => 1, "onmousedown" => 1,
    70                                "onmouseenter" => 1, "onmouseleave" => 1,
    71                                "onmousemove" => 1, "onmouseout" => 1, "onmouseover" => 1,
    72                                "onmouseup" => 1, "onresize" => 1, "onscroll" => 1,
    73                                "onunload" => 1);
     76my %nonPointerTypeHash = ( "DOMTimeStamp" => 1 );
     77
     78my %svgAttributesInHTMLHash = (
     79    "class" => 1,
     80    "id" => 1,
     81    "onabort" => 1,
     82    "onclick" => 1,
     83    "onerror" => 1,
     84    "onload" => 1,
     85    "onmousedown" => 1,
     86    "onmouseenter" => 1,
     87    "onmouseleave" => 1,
     88    "onmousemove" => 1,
     89    "onmouseout" => 1,
     90    "onmouseover" => 1,
     91    "onmouseup" => 1,
     92    "onresize" => 1,
     93    "onscroll" => 1,
     94    "onunload" => 1,
     95);
    7496
    7597my %svgTypeNeedingTearOff = (
     
    95117);
    96118
     119# FIXME: Remove each enum from this hash as we convert it from the string-based
     120# enumeration to using an actual enum class in the C++. Once that is done, we should
     121# remove this hash and the function that calls it.
     122my %stringBasedEnumerationHash = (
     123    "AppendMode" => 1,
     124    "AudioContextState" => 1,
     125    "AutoFillButtonType" => 1,
     126    "CachePolicy" => 1,
     127    "CanvasWindingRule" => 1,
     128    "DeviceType" => 1,
     129    "EndOfStreamError" => 1,
     130    "FontFaceSetLoadStatus" => 1,
     131    "IDBCursorDirection" => 1,
     132    "IDBRequestReadyState" => 1,
     133    "IDBTransactionMode" => 1,
     134    "ImageSmoothingQuality" => 1,
     135    "KeyType" => 1,
     136    "KeyUsage" => 1,
     137    "MediaControlEvent" => 1,
     138    "MediaDeviceKind" => 1,
     139    "MediaSessionInterruptingCategory" => 1,
     140    "MediaSessionKind" => 1,
     141    "MediaStreamTrackState" => 1,
     142    "OverSampleType" => 1,
     143    "PageOverlayType" => 1,
     144    "RTCBundlePolicyEnum" => 1,
     145    "RTCIceTransportPolicyEnum" => 1,
     146    "ReferrerPolicy" => 1,
     147    "RequestCache" => 1,
     148    "RequestCredentials" => 1,
     149    "RequestDestination" => 1,
     150    "RequestMode" => 1,
     151    "RequestRedirect" => 1,
     152    "RequestType" => 1,
     153    "ResourceLoadPriority" => 1,
     154    "ResponseType" => 1,
     155    "TextTrackKind" => 1,
     156    "TextTrackMode" => 1,
     157    "VideoPresentationMode" => 1,
     158    "XMLHttpRequestResponseType" => 1,
     159);
     160
    97161# Cache of IDL file pathnames.
    98162my $idlFiles;
     
    142206    foreach my $interface (@$interfaces) {
    143207        print "Generating $useGenerator bindings code for IDL interface \"" . $interface->name . "\"...\n" if $verbose;
    144         $codeGenerator->GenerateInterface($interface, $defines);
     208        # FIXME: Repeating each enumeration for every interface would not work if we actually were using
     209        # multiple interfaces per file, but we aren't, so this is fine for now.
     210        $codeGenerator->GenerateInterface($interface, $defines, $useDocument->enumerations);
    145211        $codeGenerator->WriteData($interface, $useOutputDir, $useOutputHeadersDir);
    146212    }
     
    333399
    334400    return 1 if $stringTypeHash{$type};
     401    return 0;
     402}
     403
     404sub IsStringBasedEnumType
     405{
     406    my $object = shift;
     407    my $type = shift;
     408
     409    return 0 if !$object->IsEnumType($type);
     410    return 1 if exists $stringBasedEnumerationHash{$type};
    335411    return 0;
    336412}
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r200286 r200288  
    124124    my $interface = shift;
    125125    my $defines = shift;
     126    my $enumerations = shift;
    126127
    127128    $codeGenerator->LinkOverloadedFunctions($interface);
     
    130131    if ($interface->isCallback) {
    131132        $object->GenerateCallbackHeader($interface);
    132         $object->GenerateCallbackImplementation($interface);
     133        $object->GenerateCallbackImplementation($interface, $enumerations);
    133134    } else {
    134135        $object->GenerateHeader($interface);
    135         $object->GenerateImplementation($interface);
     136        $object->GenerateImplementation($interface, $enumerations);
    136137    }
    137138}
     
    831832}
    832833
     834sub GetEnumerationClassName {
     835    my ($name) = @_;
     836    return $codeGenerator->WK_ucfirst($name);
     837};
     838
     839sub GetEnumerationValueName {
     840    my ($name) = @_;
     841    return "EmptyString" if $name eq "";
     842    return $codeGenerator->WK_ucfirst($name);
     843};
     844
     845sub GetEnumerationImplementationContent
     846{
     847    my ($enumerations) = @_;
     848
     849    my $result = "";
     850    foreach my $enumeration (@$enumerations) {
     851        my $name = $enumeration->name;
     852        next if $codeGenerator->IsStringBasedEnumType($name);
     853
     854        my $className = GetEnumerationClassName($name);
     855
     856        # Declare these instead of using "static" because these functions may be unused
     857        # and we don't want to get warnings about unused static functions.
     858        $result .= "const String& stringValue($className);\n";
     859        $result .= "Optional<$className> enumerationValue$className(const String&);\n\n";
     860
     861        $result .= "const String& stringValue($className enumerationValue)\n";
     862        $result .= "{\n";
     863        # FIXME: Might be nice to make this global be "const", but NeverDestroyed does not currently support that.
     864        # FIXME: Might be nice to make the entire array be NeverDestroyed instead of each value, but not sure the syntax for that.
     865        $result .= "    static NeverDestroyed<const String> values[] = {\n";
     866        foreach my $value (@{$enumeration->values}) {
     867            $result .= "        ASCIILiteral(\"$value\"),\n";
     868        }
     869        $result .= "    };\n";
     870        my $index = 0;
     871        foreach my $value (@{$enumeration->values}) {
     872            my $enumerationValueName = GetEnumerationValueName($value);
     873            if ($index) {
     874                $result .= "    static_assert(static_cast<size_t>($className::$enumerationValueName) == $index, \"$className::$enumerationValueName is not $index as expected\");\n";
     875            } else {
     876                # Keep the style checker happy. Not sure I still love this style guideline.
     877                $result .= "    static_assert(!static_cast<size_t>($className::$enumerationValueName), \"$className::$enumerationValueName is not $index as expected\");\n";
     878            }
     879            $index++;
     880        }
     881        $result .= "    ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));\n";
     882        $result .= "    return values[static_cast<size_t>(enumerationValue)];\n";
     883        $result .= "}\n\n";
     884
     885        $result .= "Optional<$className> enumerationValue$className(const String& stringValue)\n";
     886        $result .= "{\n";
     887        foreach my $value (@{$enumeration->values}) {
     888            my $enumerationValueName = GetEnumerationValueName($value);
     889            $result .= "    if (stringValue == \"$value\")\n";
     890            $result .= "        return $className::$enumerationValueName;\n";
     891        }
     892        $result .= "    return Nullopt;\n";
     893        $result .= "}\n\n";
     894    }
     895    return $result;
     896}
     897
    833898sub GenerateHeader
    834899{
    835     my $object = shift;
    836     my $interface = shift;
     900    my ($object, $interface) = @_;
    837901
    838902    my $interfaceName = $interface->name;
     
    17971861sub GenerateImplementation
    17981862{
    1799     my ($object, $interface) = @_;
     1863    my ($object, $interface, $enumerations) = @_;
    18001864
    18011865    my $interfaceName = $interface->name;
     
    18281892    push(@implContent, "\nusing namespace JSC;\n\n");
    18291893    push(@implContent, "namespace WebCore {\n\n");
     1894
     1895    push(@implContent, GetEnumerationImplementationContent($enumerations));
    18301896
    18311897    my @functions = @{$interface->functions};
     
    36033669                push(@$outputArray, "        $name = ASCIILiteral(" . $parameter->default . ");\n");
    36043670                push(@$outputArray, "    else {\n");
    3605                 push(@$outputArray, "        $name = state->uncheckedArgument($argsIndex).toString(state)->value(state);\n");
     3671                push(@$outputArray, "        $name = state->uncheckedArgument($argsIndex).toWTFString(state);\n");
    36063672                &$exceptionCheck("    ");
    36073673                &$enumValueCheck("    ");
     
    37223788sub GenerateCallbackHeader
    37233789{
    3724     my $object = shift;
    3725     my $interface = shift;
     3790    my ($object, $interface) = @_;
    37263791
    37273792    my $interfaceName = $interface->name;
     
    38073872sub GenerateCallbackImplementation
    38083873{
    3809     my ($object, $interface) = @_;
     3874    my ($object, $interface, $enumerations) = @_;
    38103875
    38113876    my $interfaceName = $interface->name;
     
    38233888    push(@implContent, "\nusing namespace JSC;\n\n");
    38243889    push(@implContent, "namespace WebCore {\n\n");
     3890
     3891    push(@implContent, GetEnumerationImplementationContent($enumerations));
    38253892
    38263893    # Constructor
     
    41804247
    41814248    return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType;
    4182     return "String" if $codeGenerator->IsEnumType($type);
     4249    return "String" if $codeGenerator->IsStringBasedEnumType($type);
     4250    return GetEnumerationClassName($type) if $codeGenerator->IsEnumType($type);
    41834251
    41844252    # For all other types, the native type is a pointer with same type name as the IDL type.
     
    42974365        return "$value.toString(state)->toAtomicString(state)" if $signature->extendedAttributes->{"AtomicString"};
    42984366
    4299         return "$value.toString(state)->value(state)";
     4367        return "$value.toWTFString(state)";
    43004368    }
    43014369
     
    43434411    }
    43444412
     4413    return "$value.toWTFString(state)" if $codeGenerator->IsStringBasedEnumType($type);
     4414
    43454415    if ($codeGenerator->IsEnumType($type)) {
    4346         return "$value.toString(state)->value(state)";
     4416        my $className = GetEnumerationClassName($type);
     4417        return "enumerationValue$className($value.toWTFString(state)).value()";
    43474418    }
    43484419
     
    43954466    if ($codeGenerator->IsEnumType($type)) {
    43964467        AddToImplIncludes("<runtime/JSString.h>", $conditional);
     4468        $value = "stringValue($value)" unless $codeGenerator->IsStringBasedEnumType($type);
    43974469        return "jsStringWithCache(state, $value)";
    43984470    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp

    r200286 r200288  
    223223    if (UNLIKELY(state->argumentCount() < 1))
    224224        return throwVMError(state, createNotEnoughArgumentsError(state));
    225     String message = state->argument(0).toString(state)->value(state);
     225    String message = state->argument(0).toWTFString(state);
    226226    if (UNLIKELY(state->hadException()))
    227227        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp

    r200286 r200288  
    194194    if (UNLIKELY(state->argumentCount() < 1))
    195195        return throwVMError(state, createNotEnoughArgumentsError(state));
    196     String str = state->argument(0).toString(state)->value(state);
     196    String str = state->argument(0).toWTFString(state);
    197197    if (UNLIKELY(state->hadException()))
    198198        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp

    r200286 r200288  
    215215    }
    216216    auto& impl = castedThis->wrapped();
    217     String nativeValue = value.toString(state)->value(state);
     217    String nativeValue = value.toWTFString(state);
    218218    if (UNLIKELY(state->hadException()))
    219219        return false;
     
    233233    }
    234234    auto& impl = castedThis->wrapped();
    235     String nativeValue = value.toString(state)->value(state);
     235    String nativeValue = value.toWTFString(state);
    236236    if (UNLIKELY(state->hadException()))
    237237        return false;
     
    257257    if (UNLIKELY(state->argumentCount() < 1))
    258258        return throwVMError(state, createNotEnoughArgumentsError(state));
    259     String testParam = state->argument(0).toString(state)->value(state);
     259    String testParam = state->argument(0).toWTFString(state);
    260260    if (UNLIKELY(state->hadException()))
    261261        return JSValue::encode(jsUndefined());
     
    275275    if (UNLIKELY(state->argumentCount() < 1))
    276276        return throwVMError(state, createNotEnoughArgumentsError(state));
    277     String testParam = state->argument(0).toString(state)->value(state);
     277    String testParam = state->argument(0).toWTFString(state);
    278278    if (UNLIKELY(state->hadException()))
    279279        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r200286 r200288  
    229229        return throwVMError(state, createNotEnoughArgumentsError(state));
    230230    ExceptionCode ec = 0;
    231     String str1 = state->argument(0).toString(state)->value(state);
     231    String str1 = state->argument(0).toWTFString(state);
    232232    if (UNLIKELY(state->hadException()))
    233233        return JSValue::encode(jsUndefined());
    234     String str2 = state->argument(1).isUndefined() ? ASCIILiteral("defaultString") : state->uncheckedArgument(1).toString(state)->value(state);
     234    String str2 = state->argument(1).isUndefined() ? ASCIILiteral("defaultString") : state->uncheckedArgument(1).toWTFString(state);
    235235    if (UNLIKELY(state->hadException()))
    236236        return JSValue::encode(jsUndefined());
     
    633633{
    634634    JSValue value = JSValue::decode(encodedValue);
    635     String nativeValue = value.toString(state)->value(state);
     635    String nativeValue = value.toWTFString(state);
    636636    if (UNLIKELY(state->hadException()))
    637637        return false;
     
    652652    }
    653653    auto& impl = castedThis->wrapped();
    654     String nativeValue = value.toString(state)->value(state);
     654    String nativeValue = value.toWTFString(state);
    655655    if (UNLIKELY(state->hadException()))
    656656        return false;
     
    699699{
    700700    JSValue value = JSValue::decode(encodedValue);
    701     String nativeValue = value.toString(state)->value(state);
     701    String nativeValue = value.toWTFString(state);
    702702    if (UNLIKELY(state->hadException()))
    703703        return false;
     
    718718    }
    719719    auto& impl = castedThis->wrapped();
    720     String nativeValue = value.toString(state)->value(state);
     720    String nativeValue = value.toWTFString(state);
    721721    if (UNLIKELY(state->hadException()))
    722722        return false;
     
    796796    if (!context)
    797797        return JSValue::encode(jsUndefined());
    798     String strArg = state->argument(0).toString(state)->value(state);
     798    String strArg = state->argument(0).toWTFString(state);
    799799    if (UNLIKELY(state->hadException()))
    800800        return JSValue::encode(jsUndefined());
     
    864864    if (!context)
    865865        return JSValue::encode(jsUndefined());
    866     String strArg = state->argument(0).toString(state)->value(state);
     866    String strArg = state->argument(0).toWTFString(state);
    867867    if (UNLIKELY(state->hadException()))
    868868        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp

    r200286 r200288  
    8787        return throwVMError(state, createNotEnoughArgumentsError(state));
    8888    ExceptionCode ec = 0;
    89     String str1 = state->argument(0).toString(state)->value(state);
     89    String str1 = state->argument(0).toWTFString(state);
    9090    if (UNLIKELY(state->hadException()))
    9191        return JSValue::encode(jsUndefined());
    92     String str2 = state->argument(1).isUndefined() ? ASCIILiteral("defaultString") : state->uncheckedArgument(1).toString(state)->value(state);
     92    String str2 = state->argument(1).isUndefined() ? ASCIILiteral("defaultString") : state->uncheckedArgument(1).toWTFString(state);
    9393    if (UNLIKELY(state->hadException()))
    9494        return JSValue::encode(jsUndefined());
    95     String str3 = state->argument(2).isUndefined() ? String() : state->uncheckedArgument(2).toString(state)->value(state);
     95    String str3 = state->argument(2).isUndefined() ? String() : state->uncheckedArgument(2).toWTFString(state);
    9696    if (UNLIKELY(state->hadException()))
    9797        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp

    r200286 r200288  
    166166    }
    167167    auto& impl = castedThis->wrapped();
    168     String nativeValue = value.toString(state)->value(state);
     168    String nativeValue = value.toWTFString(state);
    169169    if (UNLIKELY(state->hadException()))
    170170        return false;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp

    r200286 r200288  
    353353    }
    354354    auto& impl = castedThis->wrapped();
    355     String nativeValue = value.toString(state)->value(state);
     355    String nativeValue = value.toWTFString(state);
    356356    if (UNLIKELY(state->hadException()))
    357357        return false;
     
    370370    }
    371371    auto& impl = castedThis->wrapped();
    372     String nativeValue = value.toString(state)->value(state);
     372    String nativeValue = value.toWTFString(state);
    373373    if (UNLIKELY(state->hadException()))
    374374        return false;
     
    387387    }
    388388    auto& impl = castedThis->wrapped();
    389     String nativeValue = value.toString(state)->value(state);
     389    String nativeValue = value.toWTFString(state);
    390390    if (UNLIKELY(state->hadException()))
    391391        return false;
     
    405405    auto& impl = castedThis->wrapped();
    406406    ExceptionCode ec = 0;
    407     String nativeValue = value.toString(state)->value(state);
     407    String nativeValue = value.toWTFString(state);
    408408    if (UNLIKELY(state->hadException()))
    409409        return false;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r200286 r200288  
    8989
    9090namespace WebCore {
     91
     92const String& stringValue(TestEnumType);
     93Optional<TestEnumType> enumerationValueTestEnumType(const String&);
     94
     95const String& stringValue(TestEnumType enumerationValue)
     96{
     97    static NeverDestroyed<const String> values[] = {
     98        ASCIILiteral(""),
     99        ASCIILiteral("EnumValue1"),
     100        ASCIILiteral("EnumValue2"),
     101        ASCIILiteral("EnumValue3"),
     102    };
     103    static_assert(!static_cast<size_t>(TestEnumType::EmptyString), "TestEnumType::EmptyString is not 0 as expected");
     104    static_assert(static_cast<size_t>(TestEnumType::EnumValue1) == 1, "TestEnumType::EnumValue1 is not 1 as expected");
     105    static_assert(static_cast<size_t>(TestEnumType::EnumValue2) == 2, "TestEnumType::EnumValue2 is not 2 as expected");
     106    static_assert(static_cast<size_t>(TestEnumType::EnumValue3) == 3, "TestEnumType::EnumValue3 is not 3 as expected");
     107    ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     108    return values[static_cast<size_t>(enumerationValue)];
     109}
     110
     111Optional<TestEnumType> enumerationValueTestEnumType(const String& stringValue)
     112{
     113    if (stringValue == "")
     114        return TestEnumType::EmptyString;
     115    if (stringValue == "EnumValue1")
     116        return TestEnumType::EnumValue1;
     117    if (stringValue == "EnumValue2")
     118        return TestEnumType::EnumValue2;
     119    if (stringValue == "EnumValue3")
     120        return TestEnumType::EnumValue3;
     121    return Nullopt;
     122}
     123
     124const String& stringValue(Optional);
     125Optional<Optional> enumerationValueOptional(const String&);
     126
     127const String& stringValue(Optional enumerationValue)
     128{
     129    static NeverDestroyed<const String> values[] = {
     130        ASCIILiteral(""),
     131        ASCIILiteral("OptionalValue1"),
     132        ASCIILiteral("OptionalValue2"),
     133        ASCIILiteral("OptionalValue3"),
     134    };
     135    static_assert(!static_cast<size_t>(Optional::EmptyString), "Optional::EmptyString is not 0 as expected");
     136    static_assert(static_cast<size_t>(Optional::OptionalValue1) == 1, "Optional::OptionalValue1 is not 1 as expected");
     137    static_assert(static_cast<size_t>(Optional::OptionalValue2) == 2, "Optional::OptionalValue2 is not 2 as expected");
     138    static_assert(static_cast<size_t>(Optional::OptionalValue3) == 3, "Optional::OptionalValue3 is not 3 as expected");
     139    ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     140    return values[static_cast<size_t>(enumerationValue)];
     141}
     142
     143Optional<Optional> enumerationValueOptional(const String& stringValue)
     144{
     145    if (stringValue == "")
     146        return Optional::EmptyString;
     147    if (stringValue == "OptionalValue1")
     148        return Optional::OptionalValue1;
     149    if (stringValue == "OptionalValue2")
     150        return Optional::OptionalValue2;
     151    if (stringValue == "OptionalValue3")
     152        return Optional::OptionalValue3;
     153    return Nullopt;
     154}
    91155
    92156// Functions
     
    9911055    }
    9921056    auto& impl = castedThis->wrapped();
    993     JSValue result = jsStringWithCache(state, impl.enumAttr());
     1057    JSValue result = jsStringWithCache(state, stringValue(impl.enumAttr()));
    9941058    return JSValue::encode(result);
    9951059}
     
    21482212    }
    21492213    auto& impl = castedThis->wrapped();
    2150     JSValue result = jsStringWithCache(state, impl.attributeWithReservedEnumType());
     2214    JSValue result = jsStringWithCache(state, stringValue(impl.attributeWithReservedEnumType()));
    21512215    return JSValue::encode(result);
    21522216}
     
    22062270{
    22072271    JSValue value = JSValue::decode(encodedValue);
    2208     String nativeValue = value.toString(state)->value(state);
     2272    String nativeValue = value.toWTFString(state);
    22092273    if (UNLIKELY(state->hadException()))
    22102274        return false;
     
    22362300    }
    22372301    auto& impl = castedThis->wrapped();
    2238     String nativeValue = value.toString(state)->value(state);
     2302    TestEnumType nativeValue = enumerationValueTestEnumType(value.toWTFString(state)).value();
    22392303    if (UNLIKELY(state->hadException()))
    22402304        return false;
     
    24082472    }
    24092473    auto& impl = castedThis->wrapped();
    2410     String nativeValue = value.toString(state)->value(state);
     2474    String nativeValue = value.toWTFString(state);
    24112475    if (UNLIKELY(state->hadException()))
    24122476        return false;
     
    25102574    }
    25112575    auto& impl = castedThis->wrapped();
    2512     String nativeValue = value.toString(state)->value(state);
     2576    String nativeValue = value.toWTFString(state);
    25132577    if (UNLIKELY(state->hadException()))
    25142578        return false;
     
    25782642    }
    25792643    auto& impl = castedThis->wrapped();
    2580     String nativeValue = value.toString(state)->value(state);
     2644    String nativeValue = value.toWTFString(state);
    25812645    if (UNLIKELY(state->hadException()))
    25822646        return false;
     
    25952659    }
    25962660    auto& impl = castedThis->wrapped();
    2597     String nativeValue = value.toString(state)->value(state);
     2661    String nativeValue = value.toWTFString(state);
    25982662    if (UNLIKELY(state->hadException()))
    25992663        return false;
     
    26462710    }
    26472711    auto& impl = castedThis->wrapped();
    2648     String nativeValue = value.toString(state)->value(state);
     2712    String nativeValue = value.toWTFString(state);
    26492713    if (UNLIKELY(state->hadException()))
    26502714        return false;
     
    26642728    }
    26652729    auto& impl = castedThis->wrapped();
    2666     String nativeValue = value.toString(state)->value(state);
     2730    String nativeValue = value.toWTFString(state);
    26672731    if (UNLIKELY(state->hadException()))
    26682732        return false;
     
    27712835    }
    27722836    auto& impl = castedThis->wrapped();
    2773     String nativeValue = value.toString(state)->value(state);
     2837    String nativeValue = value.toWTFString(state);
    27742838    if (UNLIKELY(state->hadException()))
    27752839        return false;
     
    27892853    auto& impl = castedThis->wrapped();
    27902854    ExceptionCode ec = 0;
    2791     String nativeValue = value.toString(state)->value(state);
     2855    String nativeValue = value.toWTFString(state);
    27922856    if (UNLIKELY(state->hadException()))
    27932857        return false;
     
    33033367    }
    33043368    auto& impl = castedThis->wrapped();
    3305     String nativeValue = value.toString(state)->value(state);
     3369    Optional nativeValue = enumerationValueOptional(value.toWTFString(state)).value();
    33063370    if (UNLIKELY(state->hadException()))
    33073371        return false;
     
    33233387    Ref<TestNode> forwardedImpl = castedThis->wrapped().putForwardsAttribute();
    33243388    auto& impl = forwardedImpl.get();
    3325     String nativeValue = value.toString(state)->value(state);
     3389    String nativeValue = value.toWTFString(state);
    33263390    if (UNLIKELY(state->hadException()))
    33273391        return false;
     
    33433407        return false;
    33443408    auto& impl = *forwardedImpl;
    3345     String nativeValue = value.toString(state)->value(state);
     3409    String nativeValue = value.toWTFString(state);
    33463410    if (UNLIKELY(state->hadException()))
    33473411        return false;
     
    33763440    if (UNLIKELY(state->argumentCount() < 1))
    33773441        return throwVMError(state, createNotEnoughArgumentsError(state));
    3378     String testParam = state->argument(0).toString(state)->value(state);
     3442    String testParam = state->argument(0).toWTFString(state);
    33793443    if (UNLIKELY(state->hadException()))
    33803444        return JSValue::encode(jsUndefined());
     
    34483512    if (UNLIKELY(state->hadException()))
    34493513        return JSValue::encode(jsUndefined());
    3450     String strArg = state->argument(1).toString(state)->value(state);
     3514    String strArg = state->argument(1).toWTFString(state);
    34513515    if (UNLIKELY(state->hadException()))
    34523516        return JSValue::encode(jsUndefined());
     
    34853549    if (UNLIKELY(state->hadException()))
    34863550        return JSValue::encode(jsUndefined());
    3487     String strArg = state->argument(1).toString(state)->value(state);
     3551    String strArg = state->argument(1).toWTFString(state);
    34883552    if (UNLIKELY(state->hadException()))
    34893553        return JSValue::encode(jsUndefined());
     
    35223586    if (UNLIKELY(state->hadException()))
    35233587        return JSValue::encode(jsUndefined());
    3524     String strArg = state->argument(1).toString(state)->value(state);
     3588    String strArg = state->argument(1).toWTFString(state);
    35253589    if (UNLIKELY(state->hadException()))
    35263590        return JSValue::encode(jsUndefined());
     
    35593623    if (UNLIKELY(state->hadException()))
    35603624        return JSValue::encode(jsUndefined());
    3561     String strArg = state->argument(1).toString(state)->value(state);
     3625    String strArg = state->argument(1).toWTFString(state);
    35623626    if (UNLIKELY(state->hadException()))
    35633627        return JSValue::encode(jsUndefined());
     
    35963660    if (UNLIKELY(state->hadException()))
    35973661        return JSValue::encode(jsUndefined());
    3598     String strArg = state->argument(1).toString(state)->value(state);
     3662    String strArg = state->argument(1).toWTFString(state);
    35993663    if (UNLIKELY(state->hadException()))
    36003664        return JSValue::encode(jsUndefined());
     
    37393803        enumArg = ASCIILiteral("EnumValue1");
    37403804    else {
    3741         enumArg = state->uncheckedArgument(0).toString(state)->value(state);
     3805        enumArg = state->uncheckedArgument(0).toWTFString(state);
    37423806        if (UNLIKELY(state->hadException()))
    37433807            return JSValue::encode(jsUndefined());
     
    37603824        return throwVMError(state, createNotEnoughArgumentsError(state));
    37613825    ExceptionCode ec = 0;
    3762     String strArg = state->argument(0).toString(state)->value(state);
     3826    String strArg = state->argument(0).toWTFString(state);
    37633827    if (UNLIKELY(state->hadException()))
    37643828        return JSValue::encode(jsUndefined());
     
    38693933    if (UNLIKELY(state->argumentCount() < 1))
    38703934        return throwVMError(state, createNotEnoughArgumentsError(state));
    3871     String argument = state->argument(0).toString(state)->value(state);
     3935    String argument = state->argument(0).toWTFString(state);
    38723936    if (UNLIKELY(state->hadException()))
    38733937        return JSValue::encode(jsUndefined());
     
    41414205    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    41424206    auto& impl = castedThis->wrapped();
    4143     String str = state->argument(0).isUndefined() ? String() : state->uncheckedArgument(0).toString(state)->value(state);
     4207    String str = state->argument(0).isUndefined() ? String() : state->uncheckedArgument(0).toWTFString(state);
    41444208    if (UNLIKELY(state->hadException()))
    41454209        return JSValue::encode(jsUndefined());
     
    41714235    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    41724236    auto& impl = castedThis->wrapped();
    4173     String str = state->argument(0).isUndefined() ? ASCIILiteral("foo") : state->uncheckedArgument(0).toString(state)->value(state);
     4237    String str = state->argument(0).isUndefined() ? ASCIILiteral("foo") : state->uncheckedArgument(0).toWTFString(state);
    41744238    if (UNLIKELY(state->hadException()))
    41754239        return JSValue::encode(jsUndefined());
     
    42014265    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    42024266    auto& impl = castedThis->wrapped();
    4203     String str = state->argument(0).isUndefined() ? String() : state->uncheckedArgument(0).toString(state)->value(state);
     4267    String str = state->argument(0).isUndefined() ? String() : state->uncheckedArgument(0).toWTFString(state);
    42044268    if (UNLIKELY(state->hadException()))
    42054269        return JSValue::encode(jsUndefined());
     
    42164280    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    42174281    auto& impl = castedThis->wrapped();
    4218     String str = state->argument(0).toString(state)->value(state);
     4282    String str = state->argument(0).toWTFString(state);
    42194283    if (UNLIKELY(state->hadException()))
    42204284        return JSValue::encode(jsUndefined());
     
    42464310    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    42474311    auto& impl = castedThis->wrapped();
    4248     String str = state->argument(0).isUndefined() ? emptyString() : state->uncheckedArgument(0).toString(state)->value(state);
     4312    String str = state->argument(0).isUndefined() ? emptyString() : state->uncheckedArgument(0).toWTFString(state);
    42494313    if (UNLIKELY(state->hadException()))
    42504314        return JSValue::encode(jsUndefined());
     
    46694733    if (UNLIKELY(state->hadException()))
    46704734        return JSValue::encode(jsUndefined());
    4671     String strArg = state->argument(1).toString(state)->value(state);
     4735    String strArg = state->argument(1).toWTFString(state);
    46724736    if (UNLIKELY(state->hadException()))
    46734737        return JSValue::encode(jsUndefined());
     
    47064770    if (UNLIKELY(state->argumentCount() < 1))
    47074771        return throwVMError(state, createNotEnoughArgumentsError(state));
    4708     String strArg = state->argument(0).toString(state)->value(state);
     4772    String strArg = state->argument(0).toWTFString(state);
    47094773    if (UNLIKELY(state->hadException()))
    47104774        return JSValue::encode(jsUndefined());
     
    48444908    if (UNLIKELY(state->argumentCount() < 1))
    48454909        return throwVMError(state, createNotEnoughArgumentsError(state));
    4846     String strArg = state->argument(0).toString(state)->value(state);
     4910    String strArg = state->argument(0).toWTFString(state);
    48474911    if (UNLIKELY(state->hadException()))
    48484912        return JSValue::encode(jsUndefined());
     
    49985062    if (UNLIKELY(state->argumentCount() < 1))
    49995063        return throwVMError(state, createNotEnoughArgumentsError(state));
    5000     String type = state->argument(0).toString(state)->value(state);
     5064    String type = state->argument(0).toWTFString(state);
    50015065    if (UNLIKELY(state->hadException()))
    50025066        return JSValue::encode(jsUndefined());
     
    52265290    if (UNLIKELY(state->argumentCount() < 1))
    52275291        return throwVMError(state, createNotEnoughArgumentsError(state));
    5228     String value = state->argument(0).toString(state)->value(state);
     5292    String value = state->argument(0).toWTFString(state);
    52295293    if (UNLIKELY(state->hadException()))
    52305294        return JSValue::encode(jsUndefined());
     
    52975361        return throwVMError(state, createNotEnoughArgumentsError(state));
    52985362    ExceptionCode ec = 0;
    5299     String str = state->argument(0).toString(state)->value(state);
     5363    String str = state->argument(0).toWTFString(state);
    53005364    if (UNLIKELY(state->hadException()))
    53015365        return JSValue::encode(jsUndefined());
     
    53765440    if (UNLIKELY(state->argumentCount() < 1))
    53775441        return throwVMError(state, createNotEnoughArgumentsError(state));
    5378     String head = state->argument(0).toString(state)->value(state);
     5442    String head = state->argument(0).toWTFString(state);
    53795443    if (UNLIKELY(state->hadException()))
    53805444        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp

    r200286 r200288  
    111111    if (UNLIKELY(state->argumentCount() < 1))
    112112        return throwVMError(state, createNotEnoughArgumentsError(state));
    113     String string = state->argument(0).toString(state)->value(state);
     113    String string = state->argument(0).toWTFString(state);
    114114    if (UNLIKELY(state->hadException()))
    115115        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp

    r200286 r200288  
    201201    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestOverrideBuiltins::info());
    202202    auto& impl = castedThis->wrapped();
    203     String name = state->argument(0).isUndefined() ? ASCIILiteral("test") : state->uncheckedArgument(0).toString(state)->value(state);
     203    String name = state->argument(0).isUndefined() ? ASCIILiteral("test") : state->uncheckedArgument(0).toWTFString(state);
    204204    if (UNLIKELY(state->hadException()))
    205205        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

    r200286 r200288  
    129129    if (UNLIKELY(state->argumentCount() < 2))
    130130        return throwVMError(state, createNotEnoughArgumentsError(state));
    131     String hello = state->argument(0).toString(state)->value(state);
     131    String hello = state->argument(0).toWTFString(state);
    132132    if (UNLIKELY(state->hadException()))
    133133        return JSValue::encode(jsUndefined());
     
    424424    }
    425425    auto& impl = castedThis->wrapped();
    426     String nativeValue = value.toString(state)->value(state);
     426    String nativeValue = value.toWTFString(state);
    427427    if (UNLIKELY(state->hadException()))
    428428        return false;
     
    442442    auto& impl = castedThis->wrapped();
    443443    ExceptionCode ec = 0;
    444     String nativeValue = value.toString(state)->value(state);
     444    String nativeValue = value.toWTFString(state);
    445445    if (UNLIKELY(state->hadException()))
    446446        return false;
     
    490490    if (UNLIKELY(state->hadException()))
    491491        return JSValue::encode(jsUndefined());
    492     String color = state->argument(3).isUndefined() ? String() : state->uncheckedArgument(3).toString(state)->value(state);
     492    String color = state->argument(3).isUndefined() ? String() : state->uncheckedArgument(3).toWTFString(state);
    493493    if (UNLIKELY(state->hadException()))
    494494        return JSValue::encode(jsUndefined());
  • trunk/Source/WebCore/css/FontFace.cpp

    r199642 r200288  
    318318}
    319319
    320 String FontFace::status() const
     320FontFaceLoadStatus FontFace::status() const
    321321{
    322322    switch (m_backing->status()) {
    323323    case CSSFontFace::Status::Pending:
    324         return String("unloaded", String::ConstructFromLiteral);
     324        return FontFaceLoadStatus::Unloaded;
    325325    case CSSFontFace::Status::Loading:
    326         return String("loading", String::ConstructFromLiteral);
     326        return FontFaceLoadStatus::Loading;
    327327    case CSSFontFace::Status::TimedOut:
    328         return String("error", String::ConstructFromLiteral);
     328        return FontFaceLoadStatus::Error;
    329329    case CSSFontFace::Status::Success:
    330         return String("loaded", String::ConstructFromLiteral);
     330        return FontFaceLoadStatus::Loaded;
    331331    case CSSFontFace::Status::Failure:
    332         return String("error", String::ConstructFromLiteral);
     332        return FontFaceLoadStatus::Error;
    333333    }
    334334    ASSERT_NOT_REACHED();
    335     return String("error", String::ConstructFromLiteral);
     335    return FontFaceLoadStatus::Error;
    336336}
    337337
  • trunk/Source/WebCore/css/FontFace.h

    r199642 r200288  
    3737#include <wtf/text/WTFString.h>
    3838
    39 namespace Deprecated {
    40 class ScriptValue;
    41 }
    42 
    4339namespace WebCore {
    4440
     
    4642class CSSValue;
    4743class Dictionary;
     44
     45enum class FontFaceLoadStatus { Unloaded, Loading, Loaded, Error };
    4846
    4947class FontFace final : public RefCounted<FontFace>, public CSSFontFace::Client {
     
    6866    String variant() const;
    6967    String featureSettings() const;
    70     String status() const;
     68    FontFaceLoadStatus status() const;
    7169
    7270    typedef DOMPromise<FontFace&, DOMCoreException&> Promise;
Note: See TracChangeset for help on using the changeset viewer.