Bug 172898

Summary: Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, sam, simon.fraser
Priority: P2 Keywords: WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://drafts.fxtf.org/geometry/#dommatrixreadonly
Bug Depends on:    
Bug Blocks: 163505    
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2017-06-03 13:26:04 PDT
Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array:
- https://drafts.fxtf.org/geometry/#dommatrixreadonly
Comment 1 Chris Dumez 2017-06-03 13:41:32 PDT
Created attachment 311942 [details]
WIP Patch
Comment 2 Chris Dumez 2017-06-03 14:24:38 PDT
Created attachment 311943 [details]
Patch
Comment 3 Chris Dumez 2017-06-03 16:16:14 PDT
Created attachment 311948 [details]
Patch
Comment 4 Sam Weinig 2017-06-03 16:45:32 PDT
Comment on attachment 311948 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311948&action=review

> Source/WebCore/css/DOMMatrixReadOnly.idl:97
> +    [NewObject] Float32Array? toFloat32Array();
> +    [NewObject] Float64Array? toFloat64Array();

Perhaps this should throw an out of memory exception rather than making them nullable?
Comment 5 Chris Dumez 2017-06-03 17:07:52 PDT
(In reply to Sam Weinig from comment #4)
> Comment on attachment 311948 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=311948&action=review
> 
> > Source/WebCore/css/DOMMatrixReadOnly.idl:97
> > +    [NewObject] Float32Array? toFloat32Array();
> > +    [NewObject] Float64Array? toFloat64Array();
> 
> Perhaps this should throw an out of memory exception rather than making them
> nullable?

Good idea, will do.
Comment 6 Chris Dumez 2017-06-03 17:45:40 PDT
(In reply to Sam Weinig from comment #4)
> Comment on attachment 311948 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=311948&action=review
> 
> > Source/WebCore/css/DOMMatrixReadOnly.idl:97
> > +    [NewObject] Float32Array? toFloat32Array();
> > +    [NewObject] Float64Array? toFloat64Array();
> 
> Perhaps this should throw an out of memory exception rather than making them
> nullable?

Wait, is there such an exception? Cannot find it.
Comment 7 Chris Dumez 2017-06-03 17:47:44 PDT
(In reply to Chris Dumez from comment #6)
> (In reply to Sam Weinig from comment #4)
> > Comment on attachment 311948 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=311948&action=review
> > 
> > > Source/WebCore/css/DOMMatrixReadOnly.idl:97
> > > +    [NewObject] Float32Array? toFloat32Array();
> > > +    [NewObject] Float64Array? toFloat64Array();
> > 
> > Perhaps this should throw an out of memory exception rather than making them
> > nullable?
> 
> Wait, is there such an exception? Cannot find it.

From WebIDL:
"UnknownError"	The operation failed for an unknown transient reason (e.g. out of memory).

I guess I'll use that.
Comment 8 Chris Dumez 2017-06-03 17:53:05 PDT
Darn, MayThrowException does not seem to play nicely with typed array :(

In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:27:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:30:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBufferSource.h:29:
/Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertInterface.h:74:16: error: call to 'toJSNewlyCreated' is ambiguous
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:27:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:28:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertAny.h:29:
/Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.h:165:28: note: in instantiation of function template specialization 'WebCore::JSConverter<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >::convertNewlyCreated<WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
/Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.h:175:12: note: in instantiation of function template specialization 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::Float32Adaptor> >, WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:877:28: note: in instantiation of function template specialization 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::Float32Adaptor> >, WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:22:
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.h:78:14: note: candidate function
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<DOMMatrixReadOnly>&&);
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.h:79:21: note: candidate function
inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<DOMMatrixReadOnly>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:29:
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrix.h:62:14: note: candidate function
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<DOMMatrix>&&);
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrix.h:63:21: note: candidate function
inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<DOMMatrix>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:27:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:30:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBufferSource.h:29:
/Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertInterface.h:74:16: error: call to 'toJSNewlyCreated' is ambiguous
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:27:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:28:
In file included from /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertAny.h:29:
/Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.h:165:28: note: in instantiation of function template specialization 'WebCore::JSConverter<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >::convertNewlyCreated<WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
/Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.h:175:12: note: in instantiation of function template specialization 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::Float64Adaptor> >, WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:890:28: note: in instantiation of function template specialization 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::Float64Adaptor> >, WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:22:
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.h:78:14: note: candidate function
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<DOMMatrixReadOnly>&&);
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.h:79:21: note: candidate function
inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<DOMMatrixReadOnly>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
In file included from /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrixReadOnly.cpp:29:
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrix.h:62:14: note: candidate function
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<DOMMatrix>&&);
/Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/JSDOMMatrix.h:63:21: note: candidate function
inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<DOMMatrix>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
2 errors generated.
Comment 9 Sam Weinig 2017-06-03 18:06:40 PDT
(In reply to Chris Dumez from comment #8)
> Darn, MayThrowException does not seem to play nicely with typed array :(
> 
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:27:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:30:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> JSDOMConvertBufferSource.h:29:
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> JSDOMConvertInterface.h:74:16: error: call to 'toJSNewlyCreated' is ambiguous
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:27:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:28:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertAny.h:
> 29:
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> h:165:28: note: in instantiation of function template specialization
> 'WebCore::JSConverter<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::
> Float32Adaptor> >
> >::convertNewlyCreated<WTF::Ref<JSC::GenericTypedArrayView<JSC::
> Float32Adaptor> > >' requested here
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> h:175:12: note: in instantiation of function template specialization
> 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> GenericTypedArrayView<JSC::Float32Adaptor> >,
> WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:877:28: note: in instantiation of function template
> specialization
> 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> GenericTypedArrayView<JSC::Float32Adaptor> >,
> WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:22:
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.h:78:14: note: candidate function
> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> Ref<DOMMatrixReadOnly>&&);
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.h:79:21: note: candidate function
> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> JSDOMGlobalObject* globalObject, RefPtr<DOMMatrixReadOnly>&& impl) { return
> impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> JSC::jsNull(); }
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:29:
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrix.h:62:14: note: candidate function
> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> Ref<DOMMatrix>&&);
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrix.h:63:21: note: candidate function
> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> JSDOMGlobalObject* globalObject, RefPtr<DOMMatrix>&& impl) { return impl ?
> toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> JSC::jsNull(); }
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:27:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:30:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> JSDOMConvertBufferSource.h:29:
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> JSDOMConvertInterface.h:74:16: error: call to 'toJSNewlyCreated' is ambiguous
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:27:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:28:
> In file included from
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertAny.h:
> 29:
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> h:165:28: note: in instantiation of function template specialization
> 'WebCore::JSConverter<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::
> Float64Adaptor> >
> >::convertNewlyCreated<WTF::Ref<JSC::GenericTypedArrayView<JSC::
> Float64Adaptor> > >' requested here
> /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> h:175:12: note: in instantiation of function template specialization
> 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> GenericTypedArrayView<JSC::Float64Adaptor> >,
> WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:890:28: note: in instantiation of function template
> specialization
> 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> GenericTypedArrayView<JSC::Float64Adaptor> >,
> WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:22:
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.h:78:14: note: candidate function
> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> Ref<DOMMatrixReadOnly>&&);
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.h:79:21: note: candidate function
> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> JSDOMGlobalObject* globalObject, RefPtr<DOMMatrixReadOnly>&& impl) { return
> impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> JSC::jsNull(); }
> In file included from
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrixReadOnly.cpp:29:
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrix.h:62:14: note: candidate function
> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> Ref<DOMMatrix>&&);
> /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> JSDOMMatrix.h:63:21: note: candidate function
> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> JSDOMGlobalObject* globalObject, RefPtr<DOMMatrix>&& impl) { return impl ?
> toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> JSC::jsNull(); }
> 2 errors generated.

Yeah, whoever added TypeArray support (it surpassingly was not me) added it incorrectly and modeled TypedArrays as IDLInterfaces. Unfortunately, since they are not generated, they don't have all the necessary goods, like toJS()/toJSNewlyCreated() implementations. I should go in a make them their own IDL type.
Comment 10 Chris Dumez 2017-06-03 18:07:45 PDT
(In reply to Sam Weinig from comment #9)
> (In reply to Chris Dumez from comment #8)
> > Darn, MayThrowException does not seem to play nicely with typed array :(
> > 
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:27:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:30:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> > JSDOMConvertBufferSource.h:29:
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> > JSDOMConvertInterface.h:74:16: error: call to 'toJSNewlyCreated' is ambiguous
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:27:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:28:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertAny.h:
> > 29:
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> > h:165:28: note: in instantiation of function template specialization
> > 'WebCore::JSConverter<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::
> > Float32Adaptor> >
> > >::convertNewlyCreated<WTF::Ref<JSC::GenericTypedArrayView<JSC::
> > Float32Adaptor> > >' requested here
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> > h:175:12: note: in instantiation of function template specialization
> > 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> > GenericTypedArrayView<JSC::Float32Adaptor> >,
> > WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:877:28: note: in instantiation of function template
> > specialization
> > 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> > GenericTypedArrayView<JSC::Float32Adaptor> >,
> > WTF::Ref<JSC::GenericTypedArrayView<JSC::Float32Adaptor> > >' requested here
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:22:
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.h:78:14: note: candidate function
> > JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> > Ref<DOMMatrixReadOnly>&&);
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.h:79:21: note: candidate function
> > inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> > JSDOMGlobalObject* globalObject, RefPtr<DOMMatrixReadOnly>&& impl) { return
> > impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> > JSC::jsNull(); }
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:29:
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrix.h:62:14: note: candidate function
> > JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> > Ref<DOMMatrix>&&);
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrix.h:63:21: note: candidate function
> > inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> > JSDOMGlobalObject* globalObject, RefPtr<DOMMatrix>&& impl) { return impl ?
> > toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> > JSC::jsNull(); }
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:27:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:30:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> > JSDOMConvertBufferSource.h:29:
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/
> > JSDOMConvertInterface.h:74:16: error: call to 'toJSNewlyCreated' is ambiguous
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:27:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvert.h:28:
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertAny.h:
> > 29:
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> > h:165:28: note: in instantiation of function template specialization
> > 'WebCore::JSConverter<WebCore::IDLInterface<JSC::GenericTypedArrayView<JSC::
> > Float64Adaptor> >
> > >::convertNewlyCreated<WTF::Ref<JSC::GenericTypedArrayView<JSC::
> > Float64Adaptor> > >' requested here
> > /Volumes/Data/WebKit/OpenSource/Source/WebCore/bindings/js/JSDOMConvertBase.
> > h:175:12: note: in instantiation of function template specialization
> > 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> > GenericTypedArrayView<JSC::Float64Adaptor> >,
> > WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:890:28: note: in instantiation of function template
> > specialization
> > 'WebCore::toJSNewlyCreated<WebCore::IDLInterface<JSC::
> > GenericTypedArrayView<JSC::Float64Adaptor> >,
> > WTF::Ref<JSC::GenericTypedArrayView<JSC::Float64Adaptor> > >' requested here
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:22:
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.h:78:14: note: candidate function
> > JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> > Ref<DOMMatrixReadOnly>&&);
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.h:79:21: note: candidate function
> > inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> > JSDOMGlobalObject* globalObject, RefPtr<DOMMatrixReadOnly>&& impl) { return
> > impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> > JSC::jsNull(); }
> > In file included from
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrixReadOnly.cpp:29:
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrix.h:62:14: note: candidate function
> > JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*,
> > Ref<DOMMatrix>&&);
> > /Volumes/Data/WebKit/OpenSource/WebKitBuild/Release/DerivedSources/WebCore/
> > JSDOMMatrix.h:63:21: note: candidate function
> > inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state,
> > JSDOMGlobalObject* globalObject, RefPtr<DOMMatrix>&& impl) { return impl ?
> > toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) :
> > JSC::jsNull(); }
> > 2 errors generated.
> 
> Yeah, whoever added TypeArray support (it surpassingly was not me) added it
> incorrectly and modeled TypedArrays as IDLInterfaces. Unfortunately, since
> they are not generated, they don't have all the necessary goods, like
> toJS()/toJSNewlyCreated() implementations. I should go in a make them their
> own IDL type.

I think it might have been me :( Anyway, I'll get it building.
Comment 11 Sam Weinig 2017-06-03 18:09:21 PDT
(In reply to Chris Dumez from comment #7)
> (In reply to Chris Dumez from comment #6)
> > (In reply to Sam Weinig from comment #4)
> > > Comment on attachment 311948 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=311948&action=review
> > > 
> > > > Source/WebCore/css/DOMMatrixReadOnly.idl:97
> > > > +    [NewObject] Float32Array? toFloat32Array();
> > > > +    [NewObject] Float64Array? toFloat64Array();
> > > 
> > > Perhaps this should throw an out of memory exception rather than making them
> > > nullable?
> > 
> > Wait, is there such an exception? Cannot find it.
> 
> From WebIDL:
> "UnknownError"	The operation failed for an unknown transient reason (e.g.
> out of memory).
> 
> I guess I'll use that.

Alternatively, you could add a new type that converts to JSC::throwOutOfMemoryError() which is what the JavaScriptCore uses.
Comment 12 Chris Dumez 2017-06-03 18:15:57 PDT
Created attachment 311951 [details]
Patch
Comment 13 Chris Dumez 2017-06-03 18:54:19 PDT
Comment on attachment 311951 [details]
Patch

Clearing flags on attachment: 311951

Committed r217764: <http://trac.webkit.org/changeset/217764>
Comment 14 Chris Dumez 2017-06-03 18:54:22 PDT
All reviewed patches have been landed.  Closing bug.