mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Privatize InheritTypes
This commit is contained in:
parent
acd98a73a4
commit
9a52bb8310
80 changed files with 252 additions and 101 deletions
|
@ -14,13 +14,14 @@ use dom::eventtarget::{EventTarget, NodeTargetTypeId};
|
|||
use dom::node::{CommentNodeTypeId, Node, NodeTypeId, TextNodeTypeId, ProcessingInstructionNodeTypeId, NodeHelpers};
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::cell::{Ref, RefCell};
|
||||
|
||||
#[jstraceable]
|
||||
#[must_root]
|
||||
#[privatize]
|
||||
pub struct CharacterData {
|
||||
pub node: Node,
|
||||
pub data: RefCell<DOMString>,
|
||||
node: Node,
|
||||
data: RefCell<DOMString>,
|
||||
}
|
||||
|
||||
impl CharacterDataDerived for EventTarget {
|
||||
|
@ -41,6 +42,21 @@ impl CharacterData {
|
|||
data: RefCell::new(data),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn node<'a>(&'a self) -> &'a Node {
|
||||
&self.node
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn data(&self) -> Ref<DOMString> {
|
||||
self.data.borrow()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_data(&self, data: DOMString) {
|
||||
*self.data.borrow_mut() = data;
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue