Merge pull request #3202 from Ms2ger/node-priv-members

Make some of Node's members private; r=Manishearth
This commit is contained in:
Ms2ger 2014-09-03 18:02:18 +02:00
commit 940c013176
2 changed files with 8 additions and 7 deletions

View file

@ -345,7 +345,8 @@ impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> {
fn get_html_element(&self) -> Option<Temporary<HTMLHtmlElement>> {
self.GetDocumentElement().root().filtered(|root| {
root.node.type_id == ElementNodeTypeId(HTMLHtmlElementTypeId)
let root: &JSRef<Node> = NodeCast::from_ref(&**root);
root.type_id() == ElementNodeTypeId(HTMLHtmlElementTypeId)
}).map(|elem| {
Temporary::from_rooted(HTMLHtmlElementCast::to_ref(&*elem).unwrap())
})

View file

@ -76,25 +76,25 @@ pub struct Node {
pub type_id: NodeTypeId,
/// The parent of this node.
pub parent_node: Cell<Option<JS<Node>>>,
parent_node: Cell<Option<JS<Node>>>,
/// The first child of this node.
pub first_child: Cell<Option<JS<Node>>>,
first_child: Cell<Option<JS<Node>>>,
/// The last child of this node.
pub last_child: Cell<Option<JS<Node>>>,
last_child: Cell<Option<JS<Node>>>,
/// The next sibling of this node.
pub next_sibling: Cell<Option<JS<Node>>>,
next_sibling: Cell<Option<JS<Node>>>,
/// The previous sibling of this node.
pub prev_sibling: Cell<Option<JS<Node>>>,
prev_sibling: Cell<Option<JS<Node>>>,
/// The document that this node belongs to.
owner_doc: Cell<Option<JS<Document>>>,
/// The live list of children return by .childNodes.
pub child_list: Cell<Option<JS<NodeList>>>,
child_list: Cell<Option<JS<NodeList>>>,
/// A bitfield of flags for node items.
flags: Traceable<RefCell<NodeFlags>>,