aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2015-11-10 15:40:10 -0600
committerAlan Jeffrey <ajeffrey@mozilla.com>2015-11-12 17:52:58 -0600
commit5101506089718b11bb1092c2356d911e16439707 (patch)
tree746a965761e1ead521c6a8e0c40aef9eff16b8c5
parent9cbc4393eb61bfe46ef1d8868a0ab32fa64c0985 (diff)
downloadservo-5101506089718b11bb1092c2356d911e16439707.tar.gz
servo-5101506089718b11bb1092c2356d911e16439707.zip
Replaced DOMString by String in devtools.
-rw-r--r--components/devtools/actors/inspector.rs14
-rw-r--r--components/devtools/lib.rs2
-rw-r--r--components/devtools_traits/lib.rs17
-rw-r--r--components/script/dom/node.rs14
-rw-r--r--components/script/dom/worker.rs2
-rw-r--r--components/script/script_task.rs6
6 files changed, 27 insertions, 28 deletions
diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs
index 916503c84de..71f56522bcc 100644
--- a/components/devtools/actors/inspector.rs
+++ b/components/devtools/actors/inspector.rs
@@ -206,16 +206,16 @@ impl NodeInfoToProtocol for NodeInfo {
NodeActorMsg {
actor: actor_name,
- baseURI: self.baseURI.0,
+ baseURI: self.baseURI,
parent: actors.script_to_actor(self.parent.clone()),
nodeType: self.nodeType,
- namespaceURI: self.namespaceURI.0,
- nodeName: self.nodeName.0,
+ namespaceURI: self.namespaceURI,
+ nodeName: self.nodeName,
numChildren: self.numChildren,
- name: self.name.0,
- publicId: self.publicId.0,
- systemId: self.systemId.0,
+ name: self.name,
+ publicId: self.publicId,
+ systemId: self.systemId,
attrs: self.attrs.into_iter().map(|attr| {
AttrMsg {
@@ -233,7 +233,7 @@ impl NodeInfoToProtocol for NodeInfo {
isDocumentElement: self.isDocumentElement,
- shortValue: self.shortValue.0,
+ shortValue: self.shortValue,
incompleteValue: self.incompleteValue,
}
}
diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs
index 0a15aa759a0..6a627f9a88f 100644
--- a/components/devtools/lib.rs
+++ b/components/devtools/lib.rs
@@ -225,7 +225,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
let DevtoolsPageInfo { title, url } = page_info;
let tab = TabActor {
name: actors.new_name("tab"),
- title: title.0,
+ title: String::from(title),
url: url.serialize(),
console: console.name(),
inspector: inspector.name(),
diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs
index 83d31784003..eb139b24544 100644
--- a/components/devtools_traits/lib.rs
+++ b/components/devtools_traits/lib.rs
@@ -35,13 +35,12 @@ use rustc_serialize::{Decodable, Decoder};
use std::net::TcpStream;
use time::Duration;
use url::Url;
-use util::str::DOMString;
// Information would be attached to NewGlobal to be received and show in devtools.
// Extend these fields if we need more information.
#[derive(Deserialize, Serialize)]
pub struct DevtoolsPageInfo {
- pub title: DOMString,
+ pub title: String,
pub url: Url
}
@@ -102,22 +101,22 @@ pub struct AttrInfo {
#[derive(Deserialize, Serialize)]
pub struct NodeInfo {
pub uniqueId: String,
- pub baseURI: DOMString,
+ pub baseURI: String,
pub parent: String,
pub nodeType: u16,
- pub namespaceURI: DOMString,
- pub nodeName: DOMString,
+ pub namespaceURI: String,
+ pub nodeName: String,
pub numChildren: usize,
- pub name: DOMString,
- pub publicId: DOMString,
- pub systemId: DOMString,
+ pub name: String,
+ pub publicId: String,
+ pub systemId: String,
pub attrs: Vec<AttrInfo>,
pub isDocumentElement: bool,
- pub shortValue: DOMString,
+ pub shortValue: String,
pub incompleteValue: bool,
}
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index b5bc0e525d5..40e039280e5 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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
}
}
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 2102b9b6969..0ab8b3a323d 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -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)),
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 48972b3fe70..564f8575d17 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -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());