diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-12 03:47:50 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-12 03:47:50 +0530 |
commit | a5a7a8318cbb9cc1338e9894aee61221a2fa3f27 (patch) | |
tree | 790cd822b9aa141280bf64b96b3ff24ae260a19a /components/script/script_thread.rs | |
parent | bd7255dd243f4fba409db86b5d45fc2c530225d9 (diff) | |
parent | 907322c66605145b80933605867ff1c69e1a452c (diff) | |
download | servo-a5a7a8318cbb9cc1338e9894aee61221a2fa3f27.tar.gz servo-a5a7a8318cbb9cc1338e9894aee61221a2fa3f27.zip |
Auto merge of #8972 - GauriGNaik:expose-css-errors-1, r=jdm
M1501: CSS Error Reporting: Final Steps Last Part
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8972)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 26452be569b..29793e1383a 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -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; @@ -703,14 +704,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> { @@ -2181,7 +2174,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, @@ -2195,7 +2188,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(); + } + } } } |