mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
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:
parent
f989d3776e
commit
08eb4faf4d
20 changed files with 74 additions and 862 deletions
|
@ -24,6 +24,7 @@ use servo_url::{MutableOrigin, ServoUrl};
|
|||
use time::precise_time_ns;
|
||||
use uuid::Uuid;
|
||||
|
||||
use super::bindings::codegen::Bindings::MessagePortBinding::StructuredSerializeOptions;
|
||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||
use crate::dom::bindings::codegen::Bindings::ImageBitmapBinding::{
|
||||
ImageBitmapOptions, ImageBitmapSource,
|
||||
|
@ -431,6 +432,17 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
fn IsSecureContext(&self) -> bool {
|
||||
self.upcast::<GlobalScope>().is_secure_context()
|
||||
}
|
||||
|
||||
/// <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 WorkerGlobalScope {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue