mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
merge from master
This commit is contained in:
commit
6e774ea6eb
1044 changed files with 46059 additions and 1506 deletions
|
@ -886,8 +886,8 @@ fn first_node_not_in<I>(mut nodes: I, not_in: &[NodeOrString]) -> Option<Root<No
|
|||
{
|
||||
nodes.find(|node| {
|
||||
not_in.iter().all(|n| {
|
||||
match n {
|
||||
&NodeOrString::eNode(ref n) => n != node,
|
||||
match *n {
|
||||
NodeOrString::eNode(ref n) => n != node,
|
||||
_ => true,
|
||||
}
|
||||
})
|
||||
|
@ -1649,7 +1649,7 @@ impl Node {
|
|||
let node_elem = node.downcast::<Element>().unwrap();
|
||||
let copy_elem = copy.downcast::<Element>().unwrap();
|
||||
|
||||
for attr in node_elem.attrs().iter().map(JS::root) {
|
||||
for attr in node_elem.attrs().iter() {
|
||||
copy_elem.push_new_attribute(attr.local_name().clone(),
|
||||
attr.value().clone(),
|
||||
attr.name().clone(),
|
||||
|
@ -1720,12 +1720,10 @@ impl Node {
|
|||
let prefix_atom = prefix.as_ref().map(|s| Atom::from_slice(s));
|
||||
|
||||
// Step 2.
|
||||
let namespace_attr =
|
||||
element.attrs()
|
||||
.iter()
|
||||
.map(|attr| attr.root())
|
||||
.find(|attr| attr_defines_namespace(attr.r(),
|
||||
&prefix_atom));
|
||||
let attrs = element.attrs();
|
||||
let namespace_attr = attrs.iter().find(|attr| {
|
||||
attr_defines_namespace(attr, &prefix_atom)
|
||||
});
|
||||
|
||||
// Steps 2.1-2.
|
||||
if let Some(attr) = namespace_attr {
|
||||
|
@ -2155,12 +2153,10 @@ impl NodeMethods for Node {
|
|||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let attrs = element.attrs();
|
||||
attrs.iter().all(|attr| {
|
||||
let attr = attr.root();
|
||||
other_element.attrs().iter().any(|other_attr| {
|
||||
let other_attr = other_attr.root();
|
||||
(*attr.r().namespace() == *other_attr.r().namespace()) &&
|
||||
(attr.r().local_name() == other_attr.r().local_name()) &&
|
||||
(**attr.r().value() == **other_attr.r().value())
|
||||
(*attr.namespace() == *other_attr.namespace()) &&
|
||||
(attr.local_name() == other_attr.local_name()) &&
|
||||
(**attr.value() == **other_attr.value())
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue