Auto merge of #23499 - est31:unused_code_removal_3, r=jdm

Remove unused code (3/N)

<!-- Please describe your changes on the following line: -->

Third PR in a series of PRs to remove unused/dead code from servo, powered by an (upcoming) tool of mine. Please take a look and tell me if you want to keep something.

* First PR: #23477
* Second PR: #23498

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they only remove dead code

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23499)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-06-04 02:27:29 -04:00 committed by GitHub
commit faf3a183f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 4 additions and 203 deletions

View file

@ -600,8 +600,6 @@ pub trait LayoutElementHelpers {
fn local_name(&self) -> &LocalName;
fn namespace(&self) -> &Namespace;
fn get_lang_for_layout(&self) -> String;
fn get_checked_state_for_layout(&self) -> bool;
fn get_indeterminate_state_for_layout(&self) -> bool;
fn get_state_for_layout(&self) -> ElementState;
fn insert_selector_flags(&self, flags: ElementSelectorFlags);
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool;
@ -1029,26 +1027,6 @@ impl LayoutElementHelpers for LayoutDom<Element> {
}
}
#[inline]
#[allow(unsafe_code)]
fn get_checked_state_for_layout(&self) -> bool {
// TODO option and menuitem can also have a checked state.
match self.downcast::<HTMLInputElement>() {
Some(input) => unsafe { input.checked_state_for_layout() },
None => false,
}
}
#[inline]
#[allow(unsafe_code)]
fn get_indeterminate_state_for_layout(&self) -> bool {
// TODO progress elements can also be matched with :indeterminate
match self.downcast::<HTMLInputElement>() {
Some(input) => unsafe { input.indeterminate_state_for_layout() },
None => false,
}
}
#[inline]
#[allow(unsafe_code)]
fn get_state_for_layout(&self) -> ElementState {
@ -3293,10 +3271,6 @@ impl Element {
self.state.set(state);
}
pub fn active_state(&self) -> bool {
self.state.get().contains(ElementState::IN_ACTIVE_STATE)
}
/// <https://html.spec.whatwg.org/multipage/#concept-selector-active>
pub fn set_active_state(&self, value: bool) {
self.set_state(ElementState::IN_ACTIVE_STATE, value);
@ -3360,18 +3334,10 @@ impl Element {
}
}
pub fn target_state(&self) -> bool {
self.state.get().contains(ElementState::IN_TARGET_STATE)
}
pub fn set_target_state(&self, value: bool) {
self.set_state(ElementState::IN_TARGET_STATE, value)
}
pub fn fullscreen_state(&self) -> bool {
self.state.get().contains(ElementState::IN_FULLSCREEN_STATE)
}
pub fn set_fullscreen_state(&self, value: bool) {
self.set_state(ElementState::IN_FULLSCREEN_STATE, value)
}