mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
review fix
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
f6e02f9ef9
commit
8cd0d85add
5 changed files with 7 additions and 41 deletions
|
@ -20,7 +20,6 @@ use ipc_channel::ipc::{self, IpcSender};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde_json::{Map, Value};
|
use serde_json::{Map, Value};
|
||||||
|
|
||||||
use super::source::SourceActor;
|
|
||||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||||
use crate::actors::inspector::InspectorActor;
|
use crate::actors::inspector::InspectorActor;
|
||||||
use crate::actors::inspector::accessibility::AccessibilityActor;
|
use crate::actors::inspector::accessibility::AccessibilityActor;
|
||||||
|
@ -232,8 +231,6 @@ impl BrowsingContextActor {
|
||||||
browsing_context: name.clone(),
|
browsing_context: name.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let source = SourceActor::new(actors.new_name("source"), "".to_string(), "".to_string());
|
|
||||||
|
|
||||||
let reflow = ReflowActor::new(actors.new_name("reflow"));
|
let reflow = ReflowActor::new(actors.new_name("reflow"));
|
||||||
|
|
||||||
let style_sheets = StyleSheetsActor::new(actors.new_name("stylesheets"));
|
let style_sheets = StyleSheetsActor::new(actors.new_name("stylesheets"));
|
||||||
|
@ -273,7 +270,6 @@ impl BrowsingContextActor {
|
||||||
actors.register(Box::new(css_properties));
|
actors.register(Box::new(css_properties));
|
||||||
actors.register(Box::new(inspector));
|
actors.register(Box::new(inspector));
|
||||||
actors.register(Box::new(reflow));
|
actors.register(Box::new(reflow));
|
||||||
actors.register(Box::new(source));
|
|
||||||
actors.register(Box::new(style_sheets));
|
actors.register(Box::new(style_sheets));
|
||||||
actors.register(Box::new(tabdesc));
|
actors.register(Box::new(tabdesc));
|
||||||
actors.register(Box::new(thread));
|
actors.register(Box::new(thread));
|
||||||
|
|
|
@ -50,12 +50,6 @@ struct SourceContentReply {
|
||||||
source: String,
|
source: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
|
||||||
struct BreakableLinesReply {
|
|
||||||
from: String,
|
|
||||||
lines: Vec<u32>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SourceManager {
|
impl SourceManager {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -119,14 +113,6 @@ impl Actor for SourceActor {
|
||||||
let _ = stream.write_json_packet(&reply);
|
let _ = stream.write_json_packet(&reply);
|
||||||
ActorMessageStatus::Processed
|
ActorMessageStatus::Processed
|
||||||
},
|
},
|
||||||
"getBreakableLines" => {
|
|
||||||
let reply = BreakableLinesReply {
|
|
||||||
from: self.name(),
|
|
||||||
lines: [].to_vec(),
|
|
||||||
};
|
|
||||||
let _ = stream.write_json_packet(&reply);
|
|
||||||
ActorMessageStatus::Processed
|
|
||||||
},
|
|
||||||
_ => ActorMessageStatus::Ignored,
|
_ => ActorMessageStatus::Ignored,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use std::net::TcpStream;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde_json::{Map, Value};
|
use serde_json::{Map, Value};
|
||||||
|
|
||||||
use super::source::{SourceData, SourcesReply, SourceManager};
|
use super::source::{SourceData, SourceManager, SourcesReply};
|
||||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||||
use crate::protocol::JsonPacketStream;
|
use crate::protocol::JsonPacketStream;
|
||||||
use crate::{EmptyReplyMsg, StreamId};
|
use crate::{EmptyReplyMsg, StreamId};
|
||||||
|
|
|
@ -527,21 +527,12 @@ impl DevtoolsInstance {
|
||||||
|
|
||||||
let thread_actor_name = actors.find::<WorkerActor>(worker_actor_name).thread.clone();
|
let thread_actor_name = actors.find::<WorkerActor>(worker_actor_name).thread.clone();
|
||||||
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
|
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
thread_actor
|
|
||||||
.source_manager
|
|
||||||
.add_source(source_info.url.clone(), source_info.content.clone());
|
|
||||||
=======
|
|
||||||
thread_actor.source_manager.add_source(source_info.url.clone(), source_info.content.clone(), source_actor_name.clone());
|
|
||||||
>>>>>>> 6eddb58a96d (pass correct actor name to SourceData)
|
|
||||||
=======
|
|
||||||
thread_actor.source_manager.add_source(
|
thread_actor.source_manager.add_source(
|
||||||
source_info.url.clone(),
|
source_info.url.clone(),
|
||||||
source_info.content.clone(),
|
source_info.content.clone(),
|
||||||
source_actor_name.clone(),
|
source_actor_name.clone(),
|
||||||
);
|
);
|
||||||
>>>>>>> 2fbcdac63d6 (fmt)
|
|
||||||
|
|
||||||
let source = SourceData {
|
let source = SourceData {
|
||||||
actor: source_actor_name,
|
actor: source_actor_name,
|
||||||
|
@ -569,21 +560,12 @@ impl DevtoolsInstance {
|
||||||
};
|
};
|
||||||
|
|
||||||
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
|
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
|
||||||
<<<<<<< HEAD
|
|
||||||
<<<<<<< HEAD
|
|
||||||
thread_actor
|
|
||||||
.source_manager
|
|
||||||
.add_source(source_info.url.clone(), source_info.content.clone());
|
|
||||||
=======
|
|
||||||
thread_actor.source_manager.add_source(source_info.url.clone(), source_info.content.clone(), source_actor_name.clone());
|
|
||||||
>>>>>>> 6eddb58a96d (pass correct actor name to SourceData)
|
|
||||||
=======
|
|
||||||
thread_actor.source_manager.add_source(
|
thread_actor.source_manager.add_source(
|
||||||
source_info.url.clone(),
|
source_info.url.clone(),
|
||||||
source_info.content.clone(),
|
source_info.content.clone(),
|
||||||
source_actor_name.clone(),
|
source_actor_name.clone(),
|
||||||
);
|
);
|
||||||
>>>>>>> 2fbcdac63d6 (fmt)
|
|
||||||
|
|
||||||
let source = SourceData {
|
let source = SourceData {
|
||||||
actor: source_actor_name,
|
actor: source_actor_name,
|
||||||
|
|
|
@ -1000,6 +1000,7 @@ impl HTMLScriptElement {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Step 3. Unblock rendering on el.
|
||||||
let mut script = match result {
|
let mut script = match result {
|
||||||
// Step 4. If el's result is null, then fire an event named error at el, and return.
|
// Step 4. If el's result is null, then fire an event named error at el, and return.
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
@ -1014,13 +1015,14 @@ impl HTMLScriptElement {
|
||||||
if let Some(chan) = self.global().devtools_chan() {
|
if let Some(chan) = self.global().devtools_chan() {
|
||||||
let pipeline_id = self.global().pipeline_id();
|
let pipeline_id = self.global().pipeline_id();
|
||||||
|
|
||||||
|
// TODO: https://github.com/servo/servo/issues/36874
|
||||||
let content = match &script.code {
|
let content = match &script.code {
|
||||||
SourceCode::Text(text) => text.to_string(),
|
SourceCode::Text(text) => text.to_string(),
|
||||||
SourceCode::Compiled(compiled) => compiled.original_text.to_string(),
|
SourceCode::Compiled(compiled) => compiled.original_text.to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fix this, would be nice if we could use SCRIPT_JS_MIMES
|
// https://html.spec.whatwg.org/multipage/#scriptingLanguages
|
||||||
let content_type = Some("application/javascript".to_string());
|
let content_type = Some("text/javascript".to_string());
|
||||||
|
|
||||||
let source_info = SourceInfo {
|
let source_info = SourceInfo {
|
||||||
url: script.url.clone(),
|
url: script.url.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue