mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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
This commit is contained in:
parent
3b376bb319
commit
11a3ce1257
9 changed files with 29 additions and 29 deletions
|
@ -791,7 +791,7 @@ impl Element {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_root_element(&self) -> Root<Element> {
|
||||
pub fn root_element(&self) -> Root<Element> {
|
||||
if self.node.is_in_doc() {
|
||||
self.upcast::<Node>()
|
||||
.owner_doc()
|
||||
|
@ -864,7 +864,7 @@ impl Element {
|
|||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptionElement)) => {
|
||||
self.get_disabled_state()
|
||||
self.disabled_state()
|
||||
}
|
||||
// TODO:
|
||||
// an optgroup element that has a disabled attribute
|
||||
|
@ -1874,7 +1874,7 @@ impl<'a> ::selectors::Element for Root<Element> {
|
|||
NonTSPseudoClass::Disabled |
|
||||
NonTSPseudoClass::Checked |
|
||||
NonTSPseudoClass::Indeterminate =>
|
||||
Element::get_state(self).contains(pseudo_class.state_flag()),
|
||||
Element::state(self).contains(pseudo_class.state_flag()),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2077,7 +2077,7 @@ impl Element {
|
|||
self.set_click_in_progress(false);
|
||||
}
|
||||
|
||||
pub fn get_state(&self) -> ElementState {
|
||||
pub fn state(&self) -> ElementState {
|
||||
self.state.get()
|
||||
}
|
||||
|
||||
|
@ -2096,7 +2096,7 @@ impl Element {
|
|||
self.state.set(state);
|
||||
}
|
||||
|
||||
pub fn get_active_state(&self) -> bool {
|
||||
pub fn active_state(&self) -> bool {
|
||||
self.state.get().contains(IN_ACTIVE_STATE)
|
||||
}
|
||||
|
||||
|
@ -2104,7 +2104,7 @@ impl Element {
|
|||
self.set_state(IN_ACTIVE_STATE, value)
|
||||
}
|
||||
|
||||
pub fn get_focus_state(&self) -> bool {
|
||||
pub fn focus_state(&self) -> bool {
|
||||
self.state.get().contains(IN_FOCUS_STATE)
|
||||
}
|
||||
|
||||
|
@ -2113,7 +2113,7 @@ impl Element {
|
|||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
}
|
||||
|
||||
pub fn get_hover_state(&self) -> bool {
|
||||
pub fn hover_state(&self) -> bool {
|
||||
self.state.get().contains(IN_HOVER_STATE)
|
||||
}
|
||||
|
||||
|
@ -2121,7 +2121,7 @@ impl Element {
|
|||
self.set_state(IN_HOVER_STATE, value)
|
||||
}
|
||||
|
||||
pub fn get_enabled_state(&self) -> bool {
|
||||
pub fn enabled_state(&self) -> bool {
|
||||
self.state.get().contains(IN_ENABLED_STATE)
|
||||
}
|
||||
|
||||
|
@ -2129,7 +2129,7 @@ impl Element {
|
|||
self.set_state(IN_ENABLED_STATE, value)
|
||||
}
|
||||
|
||||
pub fn get_disabled_state(&self) -> bool {
|
||||
pub fn disabled_state(&self) -> bool {
|
||||
self.state.get().contains(IN_DISABLED_STATE)
|
||||
}
|
||||
|
||||
|
@ -2141,7 +2141,7 @@ impl Element {
|
|||
impl Element {
|
||||
pub fn check_ancestors_disabled_state_for_form_control(&self) {
|
||||
let node = self.upcast::<Node>();
|
||||
if self.get_disabled_state() {
|
||||
if self.disabled_state() {
|
||||
return;
|
||||
}
|
||||
for ancestor in node.ancestors() {
|
||||
|
@ -2150,7 +2150,7 @@ impl Element {
|
|||
if !ancestor.is::<HTMLFieldSetElement>() {
|
||||
continue;
|
||||
}
|
||||
if !ancestor.downcast::<Element>().unwrap().get_disabled_state() {
|
||||
if !ancestor.downcast::<Element>().unwrap().disabled_state() {
|
||||
continue;
|
||||
}
|
||||
if ancestor.is_parent_of(node) {
|
||||
|
@ -2175,13 +2175,13 @@ impl Element {
|
|||
}
|
||||
|
||||
pub fn check_parent_disabled_state_for_option(&self) {
|
||||
if self.get_disabled_state() {
|
||||
if self.disabled_state() {
|
||||
return;
|
||||
}
|
||||
let node = self.upcast::<Node>();
|
||||
if let Some(ref parent) = node.GetParentNode() {
|
||||
if parent.is::<HTMLOptGroupElement>() &&
|
||||
parent.downcast::<Element>().unwrap().get_disabled_state() {
|
||||
parent.downcast::<Element>().unwrap().disabled_state() {
|
||||
self.set_disabled_state(true);
|
||||
self.set_enabled_state(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue