Auto merge of #18209 - jdm:devirtualize, r=mbrubeck

Devirtualize CSS error reporting.

This removes a trait object from the path of reporting a CSS error.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18209)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-24 13:19:25 -05:00 committed by GitHub
commit d4ddec8d33
28 changed files with 255 additions and 211 deletions

View file

@ -105,7 +105,6 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::{Sender, channel};
use std::sync::mpsc::TryRecvError::{Disconnected, Empty};
use style::context::ReflowGoal;
use style::error_reporting::ParseErrorReporter;
use style::media_queries;
use style::parser::ParserContext as CssParserContext;
use style::properties::PropertyId;
@ -377,7 +376,7 @@ impl Window {
&self.bluetooth_extra_permission_data
}
pub fn css_error_reporter(&self) -> &ParseErrorReporter {
pub fn css_error_reporter(&self) -> &CSSErrorReporter {
&self.error_reporter
}
@ -1012,7 +1011,7 @@ impl WindowMethods for Window {
let mut parser = Parser::new(&mut input);
let url = self.get_url();
let quirks_mode = self.Document().quirks_mode();
let context = CssParserContext::new_for_cssom(&url, self.css_error_reporter(), Some(CssRuleType::Media),
let context = CssParserContext::new_for_cssom(&url, Some(CssRuleType::Media),
PARSING_MODE_DEFAULT,
quirks_mode);
let media_query_list = media_queries::parse_media_query_list(&context, &mut parser);