diff options
author | Sean McArthur <sean.monstar@gmail.com> | 2014-09-04 16:25:26 -0700 |
---|---|---|
committer | Sean McArthur <sean.monstar@gmail.com> | 2014-09-05 12:22:56 -0700 |
commit | 375e475f99e8767fd2cc7c5f67e3a8e7f15760a8 (patch) | |
tree | 025ac59b6f56d9c3c294cac96929a408cd8e8698 /src | |
parent | 64a9075535cbb70eb7b349d2226948747e2f7940 (diff) | |
download | servo-375e475f99e8767fd2cc7c5f67e3a8e7f15760a8.tar.gz servo-375e475f99e8767fd2cc7c5f67e3a8e7f15760a8.zip |
make Node.type_id field private
Diffstat (limited to 'src')
-rw-r--r-- | src/components/layout/wrapper.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/node.rs | 7 | ||||
-rw-r--r-- | src/components/script/script_task.rs | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/components/layout/wrapper.rs b/src/components/layout/wrapper.rs index 9616eedcb3a..d052c263655 100644 --- a/src/components/layout/wrapper.rs +++ b/src/components/layout/wrapper.rs @@ -383,7 +383,7 @@ impl<'le> TElement for LayoutElement<'le> { fn get_link(&self) -> Option<&'static str> { // FIXME: This is HTML only. - match self.element.node.type_id { + match self.element.node.type_id_for_layout() { // http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html# // selector-link ElementNodeTypeId(HTMLAnchorElementTypeId) | diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index bf629122605..96ee5f62ba2 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -73,7 +73,7 @@ pub struct Node { pub eventtarget: EventTarget, /// The type of node that this is. - pub type_id: NodeTypeId, + type_id: NodeTypeId, /// The parent of this node. parent_node: Cell<Option<JS<Node>>>, @@ -762,6 +762,7 @@ pub trait RawLayoutNodeHelpers { unsafe fn get_hover_state_for_layout(&self) -> bool; unsafe fn get_disabled_state_for_layout(&self) -> bool; unsafe fn get_enabled_state_for_layout(&self) -> bool; + fn type_id_for_layout(&self) -> NodeTypeId; } impl RawLayoutNodeHelpers for Node { @@ -774,6 +775,10 @@ impl RawLayoutNodeHelpers for Node { unsafe fn get_enabled_state_for_layout(&self) -> bool { (*self.unsafe_get_flags()).contains(InEnabledState) } + + fn type_id_for_layout(&self) -> NodeTypeId { + self.type_id + } } diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index ce0d18b8c87..fdbcff82410 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -208,7 +208,7 @@ trait PrivateScriptTaskHelpers { impl<'a> PrivateScriptTaskHelpers for JSRef<'a, Node> { fn click_event_filter_by_disabled_state(&self) -> bool { - match self.type_id { + match self.type_id() { ElementNodeTypeId(HTMLButtonElementTypeId) | ElementNodeTypeId(HTMLInputElementTypeId) | // ElementNodeTypeId(HTMLKeygenElementTypeId) | |