mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.
This commit is contained in:
parent
b8900782b0
commit
466faac2a5
223 changed files with 4414 additions and 4105 deletions
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::callback::RethrowExceptions;
|
||||
use dom::bindings::callback::ExceptionHandling::RethrowExceptions;
|
||||
use dom::bindings::codegen::Bindings::TreeWalkerBinding;
|
||||
use dom::bindings::codegen::Bindings::TreeWalkerBinding::TreeWalkerMethods;
|
||||
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||
|
@ -58,8 +58,8 @@ impl TreeWalker {
|
|||
what_to_show: u32,
|
||||
node_filter: Option<NodeFilter>) -> Temporary<TreeWalker> {
|
||||
let filter = match node_filter {
|
||||
None => FilterNone,
|
||||
Some(jsfilter) => FilterJS(jsfilter)
|
||||
None => Filter::None,
|
||||
Some(jsfilter) => Filter::JS(jsfilter)
|
||||
};
|
||||
TreeWalker::new_with_filter(document, root_node, what_to_show, filter)
|
||||
}
|
||||
|
@ -76,9 +76,9 @@ impl<'a> TreeWalkerMethods for JSRef<'a, TreeWalker> {
|
|||
|
||||
fn GetFilter(self) -> Option<NodeFilter> {
|
||||
match self.filter {
|
||||
FilterNone => None,
|
||||
FilterJS(nf) => Some(nf),
|
||||
FilterNative(_) => panic!("Cannot convert native node filter to DOM NodeFilter")
|
||||
Filter::None => None,
|
||||
Filter::JS(nf) => Some(nf),
|
||||
Filter::Native(_) => panic!("Cannot convert native node filter to DOM NodeFilter")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,9 +331,9 @@ impl<'a> PrivateTreeWalkerHelpers<'a> for JSRef<'a, TreeWalker> {
|
|||
// "5. If an exception was thrown, re-throw the exception."
|
||||
// "6. Return result."
|
||||
match self.filter {
|
||||
FilterNone => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
||||
FilterNative(f) => Ok((f)(node)),
|
||||
FilterJS(callback) => callback.AcceptNode_(self, node, RethrowExceptions)
|
||||
Filter::None => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
||||
Filter::Native(f) => Ok((f)(node)),
|
||||
Filter::JS(callback) => callback.AcceptNode_(self, node, RethrowExceptions)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,9 +551,9 @@ impl<'a> Iterator<JSRef<'a, Node>> for JSRef<'a, TreeWalker> {
|
|||
|
||||
#[jstraceable]
|
||||
pub enum Filter {
|
||||
FilterNone,
|
||||
FilterNative(fn (node: JSRef<Node>) -> u16),
|
||||
FilterJS(NodeFilter)
|
||||
None,
|
||||
Native(fn (node: JSRef<Node>) -> u16),
|
||||
JS(NodeFilter)
|
||||
}
|
||||
|
||||
// FIXME: NodeFilterConstants will be defined in NodeFilterBindings.rs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue