diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2016-04-11 09:17:04 -0400 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-04-11 09:17:04 -0400 |
commit | c9193eaeca0b16ef065136302a86a14b5461474c (patch) | |
tree | 3aa1de399027aa22931c70d48e80ba0e3664cf25 /components/script | |
parent | 2d503c8281e0df7e4512b7df6c3032a5b6b5507f (diff) | |
download | servo-c9193eaeca0b16ef065136302a86a14b5461474c.tar.gz servo-c9193eaeca0b16ef065136302a86a14b5461474c.zip |
Remove get_ prefix for functions in LayoutHTMLInputElementHelpers
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/element.rs | 6 | ||||
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 26 |
2 files changed, 16 insertions, 16 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 4e2af78f31a..f27bc3a35fb 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -377,7 +377,7 @@ impl LayoutElementHelpers for LayoutJS<Element> { }, // Others _ => { - match this.get_size_for_layout() { + match this.size_for_layout() { 0 => None, s => Some(s as i32), } @@ -571,7 +571,7 @@ impl LayoutElementHelpers for LayoutJS<Element> { // TODO option and menuitem can also have a checked state. match self.downcast::<HTMLInputElement>() { Some(input) => unsafe { - input.get_checked_state_for_layout() + input.checked_state_for_layout() }, None => false, } @@ -583,7 +583,7 @@ impl LayoutElementHelpers for LayoutJS<Element> { // TODO progress elements can also be matched with :indeterminate match self.downcast::<HTMLInputElement>() { Some(input) => unsafe { - input.get_indeterminate_state_for_layout() + input.indeterminate_state_for_layout() }, None => false, } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 903c68ec9af..c8e053ece0f 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -208,15 +208,15 @@ impl HTMLInputElement { pub trait LayoutHTMLInputElementHelpers { #[allow(unsafe_code)] - unsafe fn get_value_for_layout(self) -> String; + unsafe fn value_for_layout(self) -> String; #[allow(unsafe_code)] - unsafe fn get_size_for_layout(self) -> u32; + unsafe fn size_for_layout(self) -> u32; #[allow(unsafe_code)] - unsafe fn get_selection_for_layout(self) -> Option<Range<isize>>; + unsafe fn selection_for_layout(self) -> Option<Range<isize>>; #[allow(unsafe_code)] - unsafe fn get_checked_state_for_layout(self) -> bool; + unsafe fn checked_state_for_layout(self) -> bool; #[allow(unsafe_code)] - unsafe fn get_indeterminate_state_for_layout(self) -> bool; + unsafe fn indeterminate_state_for_layout(self) -> bool; } #[allow(unsafe_code)] @@ -226,7 +226,7 @@ unsafe fn get_raw_textinput_value(input: LayoutJS<HTMLInputElement>) -> DOMStrin impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { #[allow(unsafe_code)] - unsafe fn get_value_for_layout(self) -> String { + unsafe fn value_for_layout(self) -> String { #[allow(unsafe_code)] unsafe fn get_raw_attr_value(input: LayoutJS<HTMLInputElement>, default: &str) -> String { let elem = input.upcast::<Element>(); @@ -245,7 +245,7 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { InputType::InputPassword => { let text = get_raw_textinput_value(self); if !text.is_empty() { - // The implementation of get_selection_for_layout expects a 1:1 mapping of chars. + // The implementation of selection_for_layout expects a 1:1 mapping of chars. text.chars().map(|_| '●').collect() } else { String::from((*self.unsafe_get()).placeholder.borrow_for_layout().clone()) @@ -254,7 +254,7 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { _ => { let text = get_raw_textinput_value(self); if !text.is_empty() { - // The implementation of get_selection_for_layout expects a 1:1 mapping of chars. + // The implementation of selection_for_layout expects a 1:1 mapping of chars. String::from(text) } else { String::from((*self.unsafe_get()).placeholder.borrow_for_layout().clone()) @@ -265,19 +265,19 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { #[allow(unrooted_must_root)] #[allow(unsafe_code)] - unsafe fn get_size_for_layout(self) -> u32 { + unsafe fn size_for_layout(self) -> u32 { (*self.unsafe_get()).size.get() } #[allow(unrooted_must_root)] #[allow(unsafe_code)] - unsafe fn get_selection_for_layout(self) -> Option<Range<isize>> { + unsafe fn selection_for_layout(self) -> Option<Range<isize>> { if !(*self.unsafe_get()).upcast::<Element>().focus_state() { return None; } // Use the raw textinput to get the index as long as we use a 1:1 char mapping - // in get_value_for_layout. + // in value_for_layout. let raw = match (*self.unsafe_get()).input_type.get() { InputType::InputText | InputType::InputPassword => get_raw_textinput_value(self), @@ -293,13 +293,13 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> { #[allow(unrooted_must_root)] #[allow(unsafe_code)] - unsafe fn get_checked_state_for_layout(self) -> bool { + unsafe fn checked_state_for_layout(self) -> bool { self.upcast::<Element>().get_state_for_layout().contains(IN_CHECKED_STATE) } #[allow(unrooted_must_root)] #[allow(unsafe_code)] - unsafe fn get_indeterminate_state_for_layout(self) -> bool { + unsafe fn indeterminate_state_for_layout(self) -> bool { self.upcast::<Element>().get_state_for_layout().contains(IN_INDETERMINATE_STATE) } } |