mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Rust upgrade for new master rebase
This commit is contained in:
parent
fe22598c56
commit
a6100563a6
39 changed files with 115 additions and 165 deletions
|
@ -370,7 +370,7 @@ class CGMethodCall(CGThing):
|
|||
|
||||
overloadCGThings = []
|
||||
overloadCGThings.append(
|
||||
CGGeneric("let argcount = cmp::min(argc,%d);" %
|
||||
CGGeneric("let argcount = cmp::min(argc, %d);" %
|
||||
maxArgCount))
|
||||
overloadCGThings.append(
|
||||
CGSwitch("argcount",
|
||||
|
@ -3894,7 +3894,7 @@ class CGProxyUnwrap(CGAbstractMethod):
|
|||
}*/
|
||||
//MOZ_ASSERT(IsProxy(obj));
|
||||
let box_: *%s = cast::transmute(GetProxyPrivate(obj).to_private());
|
||||
return cast::transmute(&*box_);""" % (self.descriptor.concreteType)
|
||||
return box_;""" % (self.descriptor.concreteType)
|
||||
|
||||
class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||
def __init__(self, descriptor):
|
||||
|
@ -4203,7 +4203,7 @@ class CGAbstractClassHook(CGAbstractExternMethod):
|
|||
|
||||
def definition_body_prologue(self):
|
||||
return """
|
||||
let this: *%s = &*unwrap::<*%s>(obj);
|
||||
let this: *%s = unwrap::<*%s>(obj);
|
||||
""" % (self.descriptor.concreteType, self.descriptor.concreteType)
|
||||
|
||||
def definition_body(self):
|
||||
|
|
|
@ -732,6 +732,8 @@ enum CloneChildrenFlag {
|
|||
DoNotCloneChildren
|
||||
}
|
||||
|
||||
fn as_uintptr<T>(t: &T) -> uintptr_t { t as *T as uintptr_t }
|
||||
|
||||
impl Node {
|
||||
pub fn ancestors(&self) -> AncestorIterator {
|
||||
AncestorIterator {
|
||||
|
@ -1564,7 +1566,7 @@ impl Node {
|
|||
match prev_text {
|
||||
Some(ref text_node) => {
|
||||
let mut prev_characterdata: JS<CharacterData> = CharacterDataCast::to(text_node);
|
||||
prev_characterdata.get_mut().AppendData(characterdata.get().Data());
|
||||
let _ = prev_characterdata.get_mut().AppendData(characterdata.get().Data());
|
||||
abstract_self.remove_child(&mut child);
|
||||
},
|
||||
None => prev_text = Some(child)
|
||||
|
@ -1685,20 +1687,18 @@ impl Node {
|
|||
}
|
||||
|
||||
if lastself != lastother {
|
||||
unsafe {
|
||||
let abstract_uint: uintptr_t = cast::transmute(abstract_self.get());
|
||||
let other_uint: uintptr_t = cast::transmute(other.get());
|
||||
|
||||
let random = if abstract_uint < other_uint {
|
||||
NodeConstants::DOCUMENT_POSITION_FOLLOWING
|
||||
} else {
|
||||
NodeConstants::DOCUMENT_POSITION_PRECEDING
|
||||
};
|
||||
// step 3.
|
||||
return random +
|
||||
NodeConstants::DOCUMENT_POSITION_DISCONNECTED +
|
||||
NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
|
||||
}
|
||||
let abstract_uint: uintptr_t = as_uintptr(&abstract_self.get());
|
||||
let other_uint: uintptr_t = as_uintptr(&other.get());
|
||||
|
||||
let random = if abstract_uint < other_uint {
|
||||
NodeConstants::DOCUMENT_POSITION_FOLLOWING
|
||||
} else {
|
||||
NodeConstants::DOCUMENT_POSITION_PRECEDING
|
||||
};
|
||||
// step 3.
|
||||
return random +
|
||||
NodeConstants::DOCUMENT_POSITION_DISCONNECTED +
|
||||
NodeConstants::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
|
||||
}
|
||||
|
||||
for child in lastself.traverse_preorder() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue