mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +00:00
Final steps
This commit is contained in:
parent
4143caaa57
commit
907322c666
7 changed files with 46 additions and 12 deletions
|
@ -18,6 +18,7 @@
|
|||
//! loop.
|
||||
|
||||
use devtools;
|
||||
use devtools_traits::CSSError;
|
||||
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo};
|
||||
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
|
||||
use document_loader::DocumentLoader;
|
||||
|
@ -702,14 +703,6 @@ pub unsafe extern "C" fn shadow_check_callback(_cx: *mut JSContext,
|
|||
DOMProxyShadowsResult::ShadowCheckFailed
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
pub struct CSSError {
|
||||
filename: String,
|
||||
line: usize,
|
||||
column: usize,
|
||||
msg: String
|
||||
}
|
||||
|
||||
impl ScriptThread {
|
||||
pub fn page_fetch_complete(id: PipelineId, subpage: Option<SubpageId>, metadata: Metadata)
|
||||
-> Option<ParserRoot> {
|
||||
|
@ -2180,7 +2173,7 @@ impl ScriptThread {
|
|||
}
|
||||
|
||||
fn handle_css_error_reporting(&self, pipeline_id: PipelineId, filename: String,
|
||||
line: usize, column: usize, msg: String) {
|
||||
line: u32, column: u32, msg: String) {
|
||||
let parent_page = self.root_page();
|
||||
let page = match parent_page.find(pipeline_id) {
|
||||
Some(page) => page,
|
||||
|
@ -2194,7 +2187,17 @@ impl ScriptThread {
|
|||
column: column,
|
||||
msg: msg
|
||||
};
|
||||
document.report_css_error(css_error);
|
||||
|
||||
document.report_css_error(css_error.clone());
|
||||
let window = page.window();
|
||||
|
||||
if window.live_devtools_updates() {
|
||||
if let Some(ref chan) = self.devtools_chan {
|
||||
chan.send(ScriptToDevtoolsControlMsg::ReportCSSError(
|
||||
pipeline_id,
|
||||
css_error)).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue