mirror of
https://github.com/servo/servo.git
synced 2025-10-18 01:09:16 +01:00
Upgrade to latest Rust.
This commit is contained in:
parent
728fb9a7de
commit
a7ef1cd35e
127 changed files with 1892 additions and 2501 deletions
|
@ -22,7 +22,6 @@ use layout_interface::{ContentBoxesResponse, ContentChangedDocumentDamage};
|
|||
use layout_interface::{MatchSelectorsDocumentDamage};
|
||||
use style;
|
||||
|
||||
use std::comm;
|
||||
use std::str::eq;
|
||||
use std::ascii::StrAsciiExt;
|
||||
|
||||
|
@ -123,7 +122,7 @@ pub enum ElementTypeId {
|
|||
//
|
||||
|
||||
|
||||
impl<'self> Element {
|
||||
impl Element {
|
||||
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, namespace: Namespace, document: AbstractDocument) -> Element {
|
||||
Element {
|
||||
node: Node::new_inherited(ElementNodeTypeId(type_id), document),
|
||||
|
@ -175,7 +174,7 @@ impl<'self> Element {
|
|||
//FIXME: Throw for XML-invalid names
|
||||
//FIXME: Throw for XMLNS-invalid names
|
||||
let (prefix, local_name) = if name.contains(":") {
|
||||
let parts: ~[&str] = name.splitn_iter(':', 1).collect();
|
||||
let parts: ~[&str] = name.splitn(':', 1).collect();
|
||||
(Some(parts[0].to_owned()), parts[1].to_owned())
|
||||
} else {
|
||||
(None, name.clone())
|
||||
|
@ -238,14 +237,14 @@ impl<'self> Element {
|
|||
// This hardcoding is awful.
|
||||
match abstract_self.type_id() {
|
||||
ElementNodeTypeId(HTMLImageElementTypeId) => {
|
||||
do abstract_self.with_mut_image_element |image| {
|
||||
abstract_self.with_mut_image_element(|image| {
|
||||
image.AfterSetAttr(local_name.clone(), value.clone());
|
||||
}
|
||||
});
|
||||
}
|
||||
ElementNodeTypeId(HTMLIframeElementTypeId) => {
|
||||
do abstract_self.with_mut_iframe_element |iframe| {
|
||||
abstract_self.with_mut_iframe_element(|iframe| {
|
||||
iframe.AfterSetAttr(local_name.clone(), value.clone());
|
||||
}
|
||||
});
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
|
@ -390,18 +389,18 @@ impl Element {
|
|||
let win = self.node.owner_doc().document().window;
|
||||
let node = abstract_self;
|
||||
assert!(node.is_element());
|
||||
let (port, chan) = comm::stream();
|
||||
let (port, chan) = Chan::new();
|
||||
let rects =
|
||||
match win.page.query_layout(ContentBoxesQuery(node, chan), port) {
|
||||
ContentBoxesResponse(rects) => {
|
||||
do rects.map |r| {
|
||||
rects.map(|r| {
|
||||
ClientRect::new(
|
||||
win,
|
||||
r.origin.y,
|
||||
r.origin.y + r.size.height,
|
||||
r.origin.x,
|
||||
r.origin.x + r.size.width)
|
||||
}
|
||||
})
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -412,7 +411,7 @@ impl Element {
|
|||
let win = self.node.owner_doc().document().window;
|
||||
let node = abstract_self;
|
||||
assert!(node.is_element());
|
||||
let (port, chan) = comm::stream();
|
||||
let (port, chan) = Chan::new();
|
||||
match win.page.query_layout(ContentBoxQuery(node, chan), port) {
|
||||
ContentBoxResponse(rect) => {
|
||||
ClientRect::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue