aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-25 00:09:16 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-25 00:09:16 -0500
commita3fe756cdbe1ce4ea478a2026e0735a62f9411f5 (patch)
tree47a7dedf74f1f5b486fd7240706158dbf60ed1ee /components/script
parent0b64586bf5368f6bb200353205459c7ec88f7052 (diff)
parenta5139787deea92fab1c60c46c3abda4ef49a78e7 (diff)
downloadservo-a3fe756cdbe1ce4ea478a2026e0735a62f9411f5.tar.gz
servo-a3fe756cdbe1ce4ea478a2026e0735a62f9411f5.zip
Auto merge of #11366 - Ms2ger:css_errors_store, r=SimonSapin
Stop storing CSS errors on the Document. Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [x] These changes do not require tests because removing dead code Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. They are never read. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11366) <!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/document.rs8
-rw-r--r--components/script/script_thread.rs28
2 files changed, 13 insertions, 23 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index d204bd0d8c6..42708265325 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use devtools_traits::CSSError;
use document_loader::{DocumentLoader, LoadType};
use dom::activation::{ActivationSource, synthetic_click_activation};
use dom::attr::{Attr, AttrValue};
@@ -232,8 +231,6 @@ pub struct Document {
dom_complete: Cell<u64>,
load_event_start: Cell<u64>,
load_event_end: Cell<u64>,
- /// Vector to store CSS errors
- css_errors_store: DOMRefCell<Vec<CSSError>>,
/// https://html.spec.whatwg.org/multipage/#concept-document-https-state
https_state: Cell<HttpsState>,
touchpad_pressure_phase: Cell<TouchpadPressurePhase>,
@@ -332,10 +329,6 @@ impl Document {
self.trigger_mozbrowser_event(MozBrowserEvent::SecurityChange(https_state));
}
- pub fn report_css_error(&self, css_error: CSSError) {
- self.css_errors_store.borrow_mut().push(css_error);
- }
-
// https://html.spec.whatwg.org/multipage/#fully-active
pub fn is_fully_active(&self) -> bool {
let browsing_context = match self.browsing_context() {
@@ -1705,7 +1698,6 @@ impl Document {
dom_complete: Cell::new(Default::default()),
load_event_start: Cell::new(Default::default()),
load_event_end: Cell::new(Default::default()),
- css_errors_store: DOMRefCell::new(vec![]),
https_state: Cell::new(HttpsState::None),
touchpad_pressure_phase: Cell::new(TouchpadPressurePhase::BeforeClick),
origin: origin,
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 330eebafdfe..0a4f3d6fb3b 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1971,29 +1971,27 @@ impl ScriptThread {
fn handle_css_error_reporting(&self, pipeline_id: PipelineId, filename: String,
line: usize, column: usize, msg: String) {
+ let sender = match self.devtools_chan {
+ Some(ref sender) => sender,
+ None => return,
+ };
+
let parent_context = self.root_browsing_context();
let context = match parent_context.find(pipeline_id) {
Some(context) => context,
None => return,
};
- let document = context.active_document();
- let css_error = CSSError {
- filename: filename,
- line: line,
- column: column,
- msg: msg
- };
-
- document.report_css_error(css_error.clone());
let window = context.active_window();
-
if window.live_devtools_updates() {
- if let Some(ref chan) = self.devtools_chan {
- chan.send(ScriptToDevtoolsControlMsg::ReportCSSError(
- pipeline_id,
- css_error)).unwrap();
- }
+ let css_error = CSSError {
+ filename: filename,
+ line: line,
+ column: column,
+ msg: msg
+ };
+ let message = ScriptToDevtoolsControlMsg::ReportCSSError(pipeline_id, css_error);
+ sender.send(message).unwrap();
}
}
}