Commit graph

6 commits

Author SHA1 Message Date
webbeef
677184a0e6
BroadcastChannel: cleanup routers when closing tabs (#38046)
BroadcastChannel uses 2 hash maps in the constellation and they were not
kept properly in sync. Also fixed a logic error where
`Option<HashMap<...>>` was not considered empty when being `None`.

Testing: These warnings should not happen anymore:
[2025-07-14T03:54:22Z WARN constellation::constellation] No sender for
broadcast router: (4,1)

[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including ImageBitmap
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including MessagePort
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including
OffscreenCanvas (should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including ReadableStream
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including WritableStream
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including
TransformStream (should never happen).

Signed-off-by: webbeef <me@webbeef.org>
2025-07-14 15:43:45 +00:00
Andrei Volykhin
4054f9a5a0
canvas: Make OffscreenCanvas transferable (without placeholder) (#37872)
Follow the specification and make OffscreenCanvas objects are
transferable,
but not in case if there are a weak reference to placeholder canvas
element.
To handle it properly need to implement dedicated frame
provider/dispatcher
between canvas element (script thread) and offscreen canvas (dedicated
worker thread).

https://html.spec.whatwg.org/multipage/#the-offscreencanvas-interface:transferable-objects

Testing: Improvements in the following tests
-
html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html
-
html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob*
-
html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer*
-
html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js

Part of #24276

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-08 14:47:29 +00:00
Andrei Volykhin
1f5087d773
imagebitmap: Make ImageBitmap serializable and transferable (#37101)
According to specification ImageBitmap objects are serializable objects
and transferable objects.

https://html.spec.whatwg.org/multipage/#the-imagebitmap-interface:imagebitmap-11

Testing:
 - html/canvas/element/manual/imagebitmap/*
 - html/infrastructure/safe-passing-of-structured-data/*
 - html/webappapis/structured-clone/*
 - workers/semantics/structured-clone/*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-05-23 20:40:25 +00:00
Taym Haddadi
5b2305784a
Stream implement pipeThrough (#36977)
Part of https://github.com/servo/servo/issues/34676

https://github.com/servo/servo/pull/36905 needs to be merged first.

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-05-20 14:33:22 +00:00
Taym Haddadi
62569979ff
Make transform stream transferrable (#36905)
Part of https://github.com/servo/servo/issues/34676

#36739 needs to be merged first.

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-05-12 16:02:06 +00:00
Martin Robinson
fee2ea34af
constellation: Re-split structured data types into separate files (#36615)
In #36364 I moved both serializable and transferable implementations
from the `script_traits` crate into a single file called
`message_ports.rs`. Gregory raised the point that this was a bit of a
inaccurate grouping. This change attempts to fix it according to the
division in the specification.

See [the relevant thread on zulip][thread].

[thread]:
https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Organizing.20*_traits.20crates/near/510864104.

Testing: Covered by existing test as this is just code movement.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-04-21 03:41:55 +00:00