Replaced DOMString by String in devtools.

This commit is contained in:
Alan Jeffrey 2015-11-10 15:40:10 -06:00
parent 9cbc4393eb
commit 5101506089
6 changed files with 27 additions and 28 deletions

View file

@ -806,17 +806,17 @@ impl Node {
pub fn summarize(&self) -> NodeInfo {
NodeInfo {
uniqueId: self.get_unique_id(),
baseURI: self.BaseURI(),
baseURI: String::from(self.BaseURI()),
parent: self.GetParentNode().map(|node| node.get_unique_id()).unwrap_or("".to_owned()),
nodeType: self.NodeType(),
namespaceURI: DOMString::new(), //FIXME
nodeName: self.NodeName(),
namespaceURI: String::new(), //FIXME
nodeName: String::from(self.NodeName()),
numChildren: self.ChildNodes().Length() as usize,
//FIXME doctype nodes only
name: DOMString::new(),
publicId: DOMString::new(),
systemId: DOMString::new(),
name: String::new(),
publicId: String::new(),
systemId: String::new(),
attrs: self.downcast().map(Element::summarize).unwrap_or(vec![]),
isDocumentElement:
@ -825,7 +825,7 @@ impl Node {
.map(|elem| elem.upcast::<Node>() == self)
.unwrap_or(false),
shortValue: self.GetNodeValue().unwrap_or_default(), //FIXME: truncate
shortValue: self.GetNodeValue().map(String::from).unwrap_or_default(), //FIXME: truncate
incompleteValue: false, //FIXME: reflect truncation
}
}

View file

@ -85,7 +85,7 @@ impl Worker {
let pipeline_id = global.pipeline();
let title = format!("Worker for {}", worker_url);
let page_info = DevtoolsPageInfo {
title: DOMString(title),
title: title,
url: worker_url.clone(),
};
chan.send(ScriptToDevtoolsControlMsg::NewGlobal((pipeline_id, Some(worker_id)),

View file

@ -1632,7 +1632,7 @@ impl ScriptTask {
let content_type = match metadata.content_type {
Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => {
Some(DOMString("text/plain".to_owned()))
Some(DOMString::from("text/plain"))
}
_ => None
};
@ -1705,7 +1705,7 @@ impl ScriptTask {
fn notify_devtools(&self, title: DOMString, url: Url, ids: (PipelineId, Option<WorkerId>)) {
if let Some(ref chan) = self.devtools_chan {
let page_info = DevtoolsPageInfo {
title: title,
title: String::from(title),
url: url,
};
chan.send(ScriptToDevtoolsControlMsg::NewGlobal(
@ -1924,7 +1924,7 @@ impl ScriptTask {
// http://dev.w3.org/csswg/cssom-view/#resizing-viewports
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-resize
let uievent = UIEvent::new(window.r(),
DOMString("resize".to_owned()), EventBubbles::DoesNotBubble,
DOMString::from("resize"), EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable, Some(window.r()),
0i32);
uievent.upcast::<Event>().fire(window.upcast());