Initial structuredClone implementation (#32960)

* Initial structuredClone implementation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Rename PostMessageOptions to StructuredSerializeOptions

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update wpt test 2020 layout result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove dublicated StructuredClone implementation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove comment from StructuredSerializeOptions webidl

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2024-08-08 12:12:45 +02:00 committed by GitHub
parent f989d3776e
commit 08eb4faf4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 74 additions and 862 deletions

View file

@ -77,6 +77,7 @@ use webrender_api::units::{DeviceIntPoint, DeviceIntSize, LayoutPixel};
use webrender_api::{DocumentId, ExternalScrollId};
use webrender_traits::WebRenderScriptApi;
use super::bindings::codegen::Bindings::MessagePortBinding::StructuredSerializeOptions;
use super::bindings::trace::HashMapTracedValues;
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
@ -1560,6 +1561,17 @@ impl WindowMethods for Window {
.map(|(k, _v)| DOMString::from(&***k))
.collect()
}
/// <https://html.spec.whatwg.org/multipage/#dom-structuredclone>
fn StructuredClone(
&self,
cx: JSContext,
value: HandleValue,
options: RootedTraceableBox<StructuredSerializeOptions>,
) -> Fallible<js::jsval::JSVal> {
self.upcast::<GlobalScope>()
.structured_clone(cx, value, options)
}
}
impl Window {