Bug 223122
| Summary: | [SameObject] is not applied in FrozenArrays or TypeArrays | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Imanol Fernandez <ifernandez> |
| Component: | Bindings | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ashvayka, cdumez, sam, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Imanol Fernandez
Hi,
I'm trying to pass some WebXR [SameObject] related tests and found that [SameObject] doesn't work as expected with array related types. JS correctly receives the same object when using DOM wrappers but not when using FrozenArrays o TypedArrays (using Vec<T> and Float32Array in the C++ DOM class).
Is there any problem in the binding code generation or Vec<T>/TypesArrays should be wrapped in a special way to be cached to comply with [SameObject], such as DOMStringList instead of Vec<String>/FrozenArray<String>?
I didn't find good examples of other module specs using [SameObject] with FrozeArrays/TypedArrays, almost all of them are in WebXR spec :)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Chris Dumez
"SameObject": {
"contextsAllowed": ["attribute"],
"standard": {
"url": "https://heycam.github.io/webidl/#SameObject"
},
"unsupported": true
},
We just don't support [SameObject] in WebKit right now. There are way to implement this with JS visitors or [CachedAttribute] though. We do this all the time.
Where are you trying to use it exactly?
Chris Dumez
(In reply to Chris Dumez from comment #1)
> "SameObject": {
> "contextsAllowed": ["attribute"],
> "standard": {
> "url": "https://heycam.github.io/webidl/#SameObject"
> },
> "unsupported": true
> },
>
> We just don't support [SameObject] in WebKit right now. There are way to
> implement this with JS visitors or [CachedAttribute] though. We do this all
> the time.
>
> Where are you trying to use it exactly?
MessageEvent.ports seems to be an example of FrozenArray attribute where we've implementation our custom "SameObject" support. You may be able to use that as example.
Radar WebKit Bug Importer
<rdar://problem/75622221>
Imanol Fernandez
MessageEvent.ports was a great example, thanks!
I implemented the related changes in bug 223635