aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-03-31 21:12:38 -0400
committerCorey Farwell <coreyf@rwell.org>2016-03-31 21:12:38 -0400
commitbf4db405e4d10cc4a2d665abf7e8c8d701254699 (patch)
tree483012fdd7aca504ae7d5753e321d4393fde1719 /components/script/dom/node.rs
parent210a2431370bc963e736917cff0483dc5d06e9cd (diff)
downloadservo-bf4db405e4d10cc4a2d665abf7e8c8d701254699.tar.gz
servo-bf4db405e4d10cc4a2d665abf7e8c8d701254699.zip
Remove `get_*` on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis https://github.com/servo/servo/issues/6224
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 730f69f24cd..39ad21a46b6 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -420,7 +420,7 @@ impl Node {
self.flags.set(flags);
}
- pub fn get_has_changed(&self) -> bool {
+ pub fn has_changed(&self) -> bool {
self.get_flag(HAS_CHANGED)
}
@@ -428,7 +428,7 @@ impl Node {
self.set_flag(HAS_CHANGED, state)
}
- pub fn get_is_dirty(&self) -> bool {
+ pub fn is_dirty(&self) -> bool {
self.get_flag(IS_DIRTY)
}
@@ -436,7 +436,7 @@ impl Node {
self.set_flag(IS_DIRTY, state)
}
- pub fn get_has_dirty_descendants(&self) -> bool {
+ pub fn has_dirty_descendants(&self) -> bool {
self.get_flag(HAS_DIRTY_DESCENDANTS)
}
@@ -454,7 +454,7 @@ impl Node {
// the document's version, but we do have to deal with the case where the node has moved
// document, so may have a higher version count than its owning document.
let doc: Root<Node> = Root::upcast(self.owner_doc());
- let version = max(self.get_inclusive_descendants_version(), doc.get_inclusive_descendants_version()) + 1;
+ let version = max(self.inclusive_descendants_version(), doc.inclusive_descendants_version()) + 1;
for ancestor in self.inclusive_ancestors() {
ancestor.inclusive_descendants_version.set(version);
}
@@ -475,14 +475,14 @@ impl Node {
NodeDamage::OtherNodeDamage => self.set_has_changed(true),
}
- if self.get_is_dirty() && !force_ancestors {
+ if self.is_dirty() && !force_ancestors {
return
}
// 2. Dirty descendants.
fn dirty_subtree(node: &Node) {
// Stop if this subtree is already dirty.
- if node.get_is_dirty() { return }
+ if node.is_dirty() { return }
node.set_flag(IS_DIRTY | HAS_DIRTY_DESCENDANTS, true);
@@ -495,13 +495,13 @@ impl Node {
// 4. Dirty ancestors.
for ancestor in self.ancestors() {
- if !force_ancestors && ancestor.get_has_dirty_descendants() { break }
+ if !force_ancestors && ancestor.has_dirty_descendants() { break }
ancestor.set_has_dirty_descendants(true);
}
}
/// The maximum version number of this node's descendants, including itself
- pub fn get_inclusive_descendants_version(&self) -> u64 {
+ pub fn inclusive_descendants_version(&self) -> u64 {
self.inclusive_descendants_version.get()
}
@@ -570,15 +570,15 @@ impl Node {
TrustedNodeAddress(&*self as *const Node as *const libc::c_void)
}
- pub fn get_bounding_content_box(&self) -> Rect<Au> {
+ pub fn bounding_content_box(&self) -> Rect<Au> {
window_from_node(self).content_box_query(self.to_trusted_node_address())
}
- pub fn get_content_boxes(&self) -> Vec<Rect<Au>> {
+ pub fn content_boxes(&self) -> Vec<Rect<Au>> {
window_from_node(self).content_boxes_query(self.to_trusted_node_address())
}
- pub fn get_client_rect(&self) -> Rect<i32> {
+ pub fn client_rect(&self) -> Rect<i32> {
window_from_node(self).client_rect_query(self.to_trusted_node_address())
}
@@ -586,7 +586,7 @@ impl Node {
// https://drafts.csswg.org/cssom-view/#dom-element-scrollheight
// https://drafts.csswg.org/cssom-view/#dom-element-scrolltop
// https://drafts.csswg.org/cssom-view/#dom-element-scrollleft
- pub fn get_scroll_area(&self) -> Rect<i32> {
+ pub fn scroll_area(&self) -> Rect<i32> {
// Step 1
let document = self.owner_doc();
// Step 3
@@ -798,15 +798,15 @@ impl Node {
}
}
- pub fn get_unique_id(&self) -> String {
+ pub fn unique_id(&self) -> String {
self.unique_id.borrow().to_simple_string()
}
pub fn summarize(&self) -> NodeInfo {
NodeInfo {
- uniqueId: self.get_unique_id(),
+ uniqueId: self.unique_id(),
baseURI: String::from(self.BaseURI()),
- parent: self.GetParentNode().map_or("".to_owned(), |node| node.get_unique_id()),
+ parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()),
nodeType: self.NodeType(),
namespaceURI: String::new(), //FIXME
nodeName: String::from(self.NodeName()),