aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/dompointreadonly.rs
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2019-07-05 11:03:34 +0900
committerKagami Sascha Rosylight <saschanaz@outlook.com>2019-07-06 01:15:24 +0900
commit40dbb2c1008f9629e6794d980fdc9374a8bbbb59 (patch)
treee23771068af5ff278fb7e5594b27d43be66f88cb /components/script/dom/dompointreadonly.rs
parent5f477707a1ec863aea7868299b960e86582382bc (diff)
downloadservo-40dbb2c1008f9629e6794d980fdc9374a8bbbb59.tar.gz
servo-40dbb2c1008f9629e6794d980fdc9374a8bbbb59.zip
Implement DOMPoint.fromPoint
Diffstat (limited to 'components/script/dom/dompointreadonly.rs')
-rw-r--r--components/script/dom/dompointreadonly.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/dompointreadonly.rs b/components/script/dom/dompointreadonly.rs
index 2387cb8f6d5..4c327107388 100644
--- a/components/script/dom/dompointreadonly.rs
+++ b/components/script/dom/dompointreadonly.rs
@@ -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 {