mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update some code that's feature-gated under core.
This commit is contained in:
parent
29a36adbe7
commit
ba87666cdb
33 changed files with 104 additions and 107 deletions
|
@ -121,13 +121,13 @@ impl Actor for ConsoleActor {
|
|||
msg_type: &String,
|
||||
msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"getCachedMessages" => {
|
||||
let types = msg.get(&"messageTypes".to_string()).unwrap().as_array().unwrap();
|
||||
let /*mut*/ messages = vec!();
|
||||
for msg_type in types.iter() {
|
||||
let msg_type = msg_type.as_string().unwrap();
|
||||
match msg_type.as_slice() {
|
||||
match &*msg_type {
|
||||
"ConsoleAPI" => {
|
||||
//TODO: figure out all consoleapi properties from FFOX source
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ impl Actor for HighlighterActor {
|
|||
msg_type: &String,
|
||||
_msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"showBoxModel" => {
|
||||
let msg = ShowBoxModelReply {
|
||||
from: self.name(),
|
||||
|
@ -106,12 +106,12 @@ impl Actor for NodeActor {
|
|||
msg_type: &String,
|
||||
msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"modifyAttributes" => {
|
||||
let target = msg.get(&"to".to_string()).unwrap().as_string().unwrap();
|
||||
let mods = msg.get(&"modifications".to_string()).unwrap().as_array().unwrap();
|
||||
let modifications = mods.iter().map(|json_mod| {
|
||||
json::decode(json_mod.to_string().as_slice()).unwrap()
|
||||
json::decode(&json_mod.to_string()).unwrap()
|
||||
}).collect();
|
||||
|
||||
self.script_chan.send(ModifyAttribute(self.pipeline,
|
||||
|
@ -280,7 +280,7 @@ impl Actor for WalkerActor {
|
|||
msg_type: &String,
|
||||
msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"querySelector" => {
|
||||
let msg = QuerySelectorReply {
|
||||
from: self.name(),
|
||||
|
@ -426,7 +426,7 @@ impl Actor for PageStyleActor {
|
|||
msg_type: &String,
|
||||
msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"getApplied" => {
|
||||
//TODO: query script for relevant applied styles to node (msg.node)
|
||||
let msg = GetAppliedReply {
|
||||
|
@ -498,7 +498,7 @@ impl Actor for InspectorActor {
|
|||
msg_type: &String,
|
||||
_msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"getWalker" => {
|
||||
if self.walker.borrow().is_none() {
|
||||
let walker = WalkerActor {
|
||||
|
|
|
@ -55,7 +55,7 @@ impl Actor for RootActor {
|
|||
msg_type: &String,
|
||||
_msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"listAddons" => {
|
||||
let actor = ErrorReply {
|
||||
from: "root".to_string(),
|
||||
|
@ -72,7 +72,7 @@ impl Actor for RootActor {
|
|||
from: "root".to_string(),
|
||||
selected: 0,
|
||||
tabs: self.tabs.iter().map(|tab| {
|
||||
registry.find::<TabActor>(tab.as_slice()).encodable()
|
||||
registry.find::<TabActor>(tab).encodable()
|
||||
}).collect()
|
||||
};
|
||||
stream.write_json_packet(&actor);
|
||||
|
|
|
@ -80,7 +80,7 @@ impl Actor for TabActor {
|
|||
msg_type: &String,
|
||||
_msg: &json::Object,
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
Ok(match &**msg_type {
|
||||
"reconfigure" => {
|
||||
stream.write_json_packet(&ReconfigureReply { from: self.name() });
|
||||
true
|
||||
|
@ -97,7 +97,7 @@ impl Actor for TabActor {
|
|||
javascriptEnabled: true,
|
||||
traits: TabTraits,
|
||||
};
|
||||
let console_actor = registry.find::<ConsoleActor>(self.console.as_slice());
|
||||
let console_actor = registry.find::<ConsoleActor>(&self.console);
|
||||
console_actor.streams.borrow_mut().push(stream.clone());
|
||||
stream.write_json_packet(&msg);
|
||||
console_actor.script_chan.send(
|
||||
|
@ -112,7 +112,7 @@ impl Actor for TabActor {
|
|||
from: self.name(),
|
||||
__type__: "detached".to_string(),
|
||||
};
|
||||
let console_actor = registry.find::<ConsoleActor>(self.console.as_slice());
|
||||
let console_actor = registry.find::<ConsoleActor>(&self.console);
|
||||
console_actor.streams.borrow_mut().pop();
|
||||
stream.write_json_packet(&msg);
|
||||
console_actor.script_chan.send(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue