Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random fixups #5992

Merged
merged 4 commits into from May 12, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

fix Stylist::add_quirks_mode_stylesheet() to not panic when resources…

… cannot be loaded
  • Loading branch information
Mike Blumenkrantz
Mike Blumenkrantz committed May 12, 2015
commit 082479344f5244093093b0d3e1ee558e9daf5a81
@@ -163,12 +163,20 @@ impl Stylist {
}

pub fn add_quirks_mode_stylesheet(&mut self) {
self.add_stylesheet(Stylesheet::from_bytes(
&read_resource_file(&["quirks-mode.css"]).unwrap(),
Url::parse("chrome:///quirks-mode.css").unwrap(),
None,
None,
Origin::UserAgent))
match read_resource_file(&["quirks-mode.css"]) {
Ok(res) => {
self.add_stylesheet(Stylesheet::from_bytes(
&res,
Url::parse("chrome:///quirks-mode.css").unwrap(),
None,
None,
Origin::UserAgent));
}
Err(..) => {
error!("Stylist::add_quirks_mode_stylesheet() failed at loading 'quirks-mode.css'!");
process::exit(1);
}
}
}

pub fn add_stylesheet(&mut self, stylesheet: Stylesheet) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.