fune/servo/components/script/dom/mutationrecord.rs
Sumit 7137918b7e servo: Merge #16268 - Basic MutationObserver interface stubs (from jdm:tmp); r=jdm
Rebase and squash of https://github.com/servo/servo/pull/16190.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8e2a1477ae800b86eae45fc9c6daf85615100854

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : febfe9bf5d1c77941bdc9a4e820a0e08741b2d57
2017-04-05 01:56:16 -05:00

34 lines
996 B
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::MutationRecordBinding::MutationRecordBinding::MutationRecordMethods;
use dom::bindings::js::{JS, Root};
use dom::bindings::reflector::Reflector;
use dom::bindings::str::DOMString;
use dom::node::Node;
use dom_struct::dom_struct;
#[dom_struct]
pub struct MutationRecord {
reflector_: Reflector,
//property for record type
record_type: DOMString,
//property for target node
target: JS<Node>,
}
impl MutationRecordMethods for MutationRecord {
// https://dom.spec.whatwg.org/#dom-mutationrecord-type
fn Type(&self) -> DOMString {
self.record_type.clone()
}
// https://dom.spec.whatwg.org/#dom-mutationrecord-target
fn Target(&self) -> Root<Node> {
return Root::from_ref(&*self.target);
}
}