mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Issue #2241 - Part 5: Expose Geometry interfaces to web workers.
Exposes DOMMatrix, DOMPoint, DOMQuad, and DOMRect to workers. Backported from Mozilla bug 1420580.
This commit is contained in:
parent
69e45fd84e
commit
c3042a2f41
14 changed files with 404 additions and 16 deletions
|
|
@ -132,3 +132,27 @@ DOMQuad::ToJSON(DOMQuadJSON& aInit)
|
|||
aInit.mP3.Construct(RefPtr<DOMPoint>(P3()).forget());
|
||||
aInit.mP4.Construct(RefPtr<DOMPoint>(P4()).forget());
|
||||
}
|
||||
|
||||
// https://drafts.fxtf.org/geometry/#structured-serialization
|
||||
bool
|
||||
DOMQuad::WriteStructuredClone(JSStructuredCloneWriter* aWriter) const
|
||||
{
|
||||
for (const auto& point : mPoints) {
|
||||
if (!point->WriteStructuredClone(aWriter)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DOMQuad::ReadStructuredClone(JSStructuredCloneReader* aReader)
|
||||
{
|
||||
for (auto& point : mPoints) {
|
||||
point = new DOMPoint(mParent);
|
||||
if (!point->ReadStructuredClone(aReader)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue