Implement DOMPoint.fromPoint

This commit is contained in:
Kagami Sascha Rosylight 2019-07-05 11:03:34 +09:00
parent 5f477707a1
commit 40dbb2c100
19 changed files with 30 additions and 133 deletions

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::{
DOMPointReadOnlyMethods, Wrap,
};
@ -50,6 +51,11 @@ impl DOMPointReadOnly {
) -> Fallible<DomRoot<DOMPointReadOnly>> {
Ok(DOMPointReadOnly::new(global, x, y, z, w))
}
// https://drafts.fxtf.org/geometry/#dom-dompointreadonly-frompoint
pub fn FromPoint(global: &GlobalScope, init: &DOMPointInit) -> DomRoot<Self> {
Self::new(global, init.x, init.y, init.z, init.w)
}
}
impl DOMPointReadOnlyMethods for DOMPointReadOnly {