Make Stylist::quirks_mode hold a QuirksMode

This commit is contained in:
Anthony Ramine 2017-04-23 10:32:16 +02:00
parent 8f1356de60
commit f872fdac9a
4 changed files with 15 additions and 12 deletions

View file

@ -601,7 +601,7 @@ impl LayoutThread {
Msg::AddStylesheet(style_info) => {
self.handle_add_stylesheet(style_info, possibly_locked_rw_data)
}
Msg::SetQuirksMode => self.handle_set_quirks_mode(possibly_locked_rw_data),
Msg::SetQuirksMode(mode) => self.handle_set_quirks_mode(possibly_locked_rw_data, mode),
Msg::GetRPC(response_chan) => {
response_chan.send(box LayoutRPCImpl(self.rw_data.clone()) as
Box<LayoutRPC + Send>).unwrap();
@ -772,9 +772,11 @@ impl LayoutThread {
}
/// Sets quirks mode for the document, causing the quirks mode stylesheet to be used.
fn handle_set_quirks_mode<'a, 'b>(&self, possibly_locked_rw_data: &mut RwData<'a, 'b>) {
fn handle_set_quirks_mode<'a, 'b>(&self,
possibly_locked_rw_data: &mut RwData<'a, 'b>,
quirks_mode: QuirksMode) {
let mut rw_data = possibly_locked_rw_data.lock();
Arc::get_mut(&mut rw_data.stylist).unwrap().set_quirks_mode(true);
Arc::get_mut(&mut rw_data.stylist).unwrap().set_quirks_mode(quirks_mode);
possibly_locked_rw_data.block(rw_data);
}