Bug 243655 - Add `JSGenerateToNativeObject` attributes to `Text`
Summary: Add `JSGenerateToNativeObject` attributes to `Text`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 218692
  Show dependency treegraph
 
Reported: 2022-08-08 00:27 PDT by Tetsuharu Ohzeki [UTC+9]
Modified: 2022-08-08 02:12 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tetsuharu Ohzeki [UTC+9] 2022-08-08 00:27:07 PDT
If we don't add this attribute, HTMLSlotElement.assign() in bug 218692 will be compile error with following errors.

```
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLFormElement.cpp:37:
/src/webkit/Source/WebCore/bindings/js/JSDOMConvertInterface.h:43:16: error: cannot initialize return object of type 'WebCore::JSToWrappedOverloader<WebCore::Text>::ReturnType' (aka 'WebCore::Text *') with an rvalue of type 'WebCore::Node *'
        return WrapperType::toWrapped(JSC::getVM(&lexicalGlobalObject), value);
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource10.cpp:1:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLFormElement.cpp:41:
/src/webkit/Source/WebCore/bindings/js/JSDOMConvertUnion.h:203:68: note: in instantiation of member function 'WebCore::JSToWrappedOverloader<WebCore::Text>::toWrapped' requested here
                auto castedValue = JSToWrappedOverloader<RawType>::toWrapped(lexicalGlobalObject, value);
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource10.cpp:1:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLFormElement.cpp:22:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLFormElement.h:25:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLElement.h:25:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSElement.h:25:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSNode.h:23:
In file included from /src/webkit/Source/WebCore/bindings/js/JSDOMConvertDictionary.h:28:
In file included from /src/webkit/Source/WebCore/bindings/IDLTypes.h:32:
/src/webkit/WebKitBuild/Debug/usr/local/include/wtf/Brigand.h:1331:14: note: in instantiation of function template specialization 'brigand::for_each_args<(lambda at /src/webkit/Source/WebCore/bindings/js/JSDOMConvertUnion.h:195:50), brigand::type_<WebCore::IDLInterface<WebCore::Element>>, brigand::type_<WebCore::IDLInterface<WebCore::Text>>>' requested here
      return for_each_args( f, type_<Elements>()... );
/src/webkit/WebKitBuild/Debug/usr/local/include/wtf/Brigand.h:1336:20: note: in instantiation of function template specialization 'brigand::detail::for_each_impl<list, WebCore::IDLInterface<WebCore::Element>, WebCore::IDLInterface<WebCore::Text>, (lambda at /src/webkit/Source/WebCore/bindings/js/JSDOMConvertUnion.h:195:50)>' requested here
    return detail::for_each_impl( List{}, f );
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource10.cpp:1:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLFormElement.cpp:41:
/src/webkit/Source/WebCore/bindings/js/JSDOMConvertUnion.h:195:22: note: in instantiation of function template specialization 'brigand::for_each<brigand::list<WebCore::IDLInterface<WebCore::Element>, WebCore::IDLInterface<WebCore::Text>>, (lambda at /src/webkit/Source/WebCore/bindings/js/JSDOMConvertUnion.h:195:50)>' requested here
            brigand::for_each<InterfaceTypeList>([&](auto&& type) {
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource10.cpp:41:
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLSlotElement.cpp:39:
/src/webkit/Source/WebCore/bindings/js/JSDOMConvertVariadic.h:43:43: note: in instantiation of member function 'WebCore::Converter<WebCore::IDLUnion<WebCore::IDLInterface<WebCore::Element>, WebCore::IDLInterface<WebCore::Text>>>::convert' requested here
        auto result = Converter<IDLType>::convert(lexicalGlobalObject, value);
/src/webkit/Source/WebCore/bindings/js/JSDOMConvertVariadic.h:63:50: note: in instantiation of member function 'WebCore::VariadicConverter<WebCore::IDLUnion<WebCore::IDLInterface<WebCore::Element>, WebCore::IDLInterface<WebCore::Text>>>::convert' requested here
        auto value = VariadicConverter<IDLType>::convert(lexicalGlobalObject, callFrame.uncheckedArgument(i));
In file included from /src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/unified-sources/UnifiedSource10.cpp:41:
/src/webkit/WebKitBuild/Debug/DerivedSources/WebCore/JSHTMLSlotElement.cpp:297:18: note: in instantiation of function template specialization 'WebCore::convertVariadicArguments<WebCore::IDLUnion<WebCore::IDLInterface<WebCore::Element>, WebCore::IDLInterface<WebCore::Text>>>' requested here
    auto nodes = convertVariadicArguments<IDLUnion<IDLInterface<Element>, IDLInterface<Text>>>(*lexicalGlobalObject, *callFrame, 0);
1 error generated.
```

To avoid this, we need generate `JSText::toWrapped()`.
Comment 1 Tetsuharu Ohzeki [UTC+9] 2022-08-08 00:40:38 PDT
Pull request: https://github.com/WebKit/WebKit/pull/3099
Comment 2 EWS 2022-08-08 02:11:23 PDT
Committed 253202@main (062294f6788f): <https://commits.webkit.org/253202@main>

Reviewed commits have been landed. Closing PR #3099 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-08-08 02:12:16 PDT
<rdar://problem/98306039>