review fix

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
atbrakhi 2025-05-15 13:42:45 +02:00
parent f6e02f9ef9
commit 8cd0d85add
No known key found for this signature in database
GPG key ID: 0096A2CC06462847
5 changed files with 7 additions and 41 deletions

View file

@ -20,7 +20,6 @@ use ipc_channel::ipc::{self, IpcSender};
use serde::Serialize;
use serde_json::{Map, Value};
use super::source::SourceActor;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actors::inspector::InspectorActor;
use crate::actors::inspector::accessibility::AccessibilityActor;
@ -232,8 +231,6 @@ impl BrowsingContextActor {
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 style_sheets = StyleSheetsActor::new(actors.new_name("stylesheets"));
@ -273,7 +270,6 @@ impl BrowsingContextActor {
actors.register(Box::new(css_properties));
actors.register(Box::new(inspector));
actors.register(Box::new(reflow));
actors.register(Box::new(source));
actors.register(Box::new(style_sheets));
actors.register(Box::new(tabdesc));
actors.register(Box::new(thread));

View file

@ -50,12 +50,6 @@ struct SourceContentReply {
source: String,
}
#[derive(Serialize)]
struct BreakableLinesReply {
from: String,
lines: Vec<u32>,
}
impl SourceManager {
pub fn new() -> Self {
Self {
@ -119,14 +113,6 @@ impl Actor for SourceActor {
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
},
"getBreakableLines" => {
let reply = BreakableLinesReply {
from: self.name(),
lines: [].to_vec(),
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
},
_ => ActorMessageStatus::Ignored,
})
}

View file

@ -7,7 +7,7 @@ use std::net::TcpStream;
use serde::Serialize;
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::protocol::JsonPacketStream;
use crate::{EmptyReplyMsg, StreamId};

View file

@ -527,21 +527,12 @@ impl DevtoolsInstance {
let thread_actor_name = actors.find::<WorkerActor>(worker_actor_name).thread.clone();
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(
source_info.url.clone(),
source_info.content.clone(),
source_actor_name.clone(),
);
>>>>>>> 2fbcdac63d6 (fmt)
let source = SourceData {
actor: source_actor_name,
@ -569,21 +560,12 @@ impl DevtoolsInstance {
};
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(
source_info.url.clone(),
source_info.content.clone(),
source_actor_name.clone(),
);
>>>>>>> 2fbcdac63d6 (fmt)
let source = SourceData {
actor: source_actor_name,

View file

@ -1000,6 +1000,7 @@ impl HTMLScriptElement {
return;
}
// TODO: Step 3. Unblock rendering on el.
let mut script = match result {
// Step 4. If el's result is null, then fire an event named error at el, and return.
Err(e) => {
@ -1014,13 +1015,14 @@ impl HTMLScriptElement {
if let Some(chan) = self.global().devtools_chan() {
let pipeline_id = self.global().pipeline_id();
// TODO: https://github.com/servo/servo/issues/36874
let content = match &script.code {
SourceCode::Text(text) => text.to_string(),
SourceCode::Compiled(compiled) => compiled.original_text.to_string(),
};
// Fix this, would be nice if we could use SCRIPT_JS_MIMES
let content_type = Some("application/javascript".to_string());
// https://html.spec.whatwg.org/multipage/#scriptingLanguages
let content_type = Some("text/javascript".to_string());
let source_info = SourceInfo {
url: script.url.clone(),