[Webkit-unassigned] [Bug 243655] New: Add `JSGenerateToNativeObject` attributes to `Text`

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 8 00:27:07 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=243655

            Bug ID: 243655
           Summary: Add `JSGenerateToNativeObject` attributes to `Text`
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: tetsuharu.ohzeki at gmail.com

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()`.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220808/fa73090a/attachment.htm>


More information about the webkit-unassigned mailing list