mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix new warnings
This commit is contained in:
parent
5f422b6161
commit
cf05e37c0b
3 changed files with 1 additions and 25 deletions
|
@ -2,14 +2,11 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::StyleSheetBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::StyleSheetBinding::StyleSheetMethods;
|
use crate::dom::bindings::codegen::Bindings::StyleSheetBinding::StyleSheetMethods;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::Reflector;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
use crate::dom::cssstylesheet::CSSStyleSheet;
|
use crate::dom::cssstylesheet::CSSStyleSheet;
|
||||||
use crate::dom::window::Window;
|
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
@ -34,20 +31,6 @@ impl StyleSheet {
|
||||||
title: title,
|
title: title,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn new(
|
|
||||||
window: &Window,
|
|
||||||
type_: DOMString,
|
|
||||||
href: Option<DOMString>,
|
|
||||||
title: Option<DOMString>,
|
|
||||||
) -> DomRoot<StyleSheet> {
|
|
||||||
reflect_dom_object(
|
|
||||||
Box::new(StyleSheet::new_inherited(type_, href, title)),
|
|
||||||
window,
|
|
||||||
StyleSheetBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StyleSheetMethods for StyleSheet {
|
impl StyleSheetMethods for StyleSheet {
|
||||||
|
|
|
@ -84,7 +84,6 @@ impl TreeWalkerMethods for TreeWalker {
|
||||||
match self.filter {
|
match self.filter {
|
||||||
Filter::None => None,
|
Filter::None => None,
|
||||||
Filter::Dom(ref nf) => Some(nf.clone()),
|
Filter::Dom(ref nf) => Some(nf.clone()),
|
||||||
Filter::Native(_) => panic!("Cannot convert native node filter to DOM NodeFilter"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +433,6 @@ impl TreeWalker {
|
||||||
match self.filter {
|
match self.filter {
|
||||||
// Step 4.
|
// Step 4.
|
||||||
Filter::None => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
Filter::None => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
||||||
Filter::Native(f) => Ok((f)(node)),
|
|
||||||
Filter::Dom(ref callback) => {
|
Filter::Dom(ref callback) => {
|
||||||
// Step 5.
|
// Step 5.
|
||||||
self.active.set(true);
|
self.active.set(true);
|
||||||
|
@ -479,6 +477,5 @@ impl<'a> Iterator for &'a TreeWalker {
|
||||||
#[derive(JSTraceable)]
|
#[derive(JSTraceable)]
|
||||||
pub enum Filter {
|
pub enum Filter {
|
||||||
None,
|
None,
|
||||||
Native(fn(node: &Node) -> u16),
|
|
||||||
Dom(Rc<NodeFilter>),
|
Dom(Rc<NodeFilter>),
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,10 +124,6 @@ impl Worker {
|
||||||
Ok(worker)
|
Ok(worker)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_closing(&self) -> bool {
|
|
||||||
self.closing.load(Ordering::SeqCst)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_terminated(&self) -> bool {
|
pub fn is_terminated(&self) -> bool {
|
||||||
self.terminated.get()
|
self.terminated.get()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue