mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
script: Allow moving back to non-quirks mode (#30898)
The code in script is written so that the document itself can move from quirks to non-quirks mode, but this is never communicated to layout -- meaning quirky layout keeps happening. This is an issue when rewriting the entire document with `document.write()` which is what some WPT tests do to test quirks mode behavior.
This commit is contained in:
parent
c8cfab2518
commit
abb017b854
1 changed files with 4 additions and 4 deletions
|
@ -823,12 +823,12 @@ impl Document {
|
||||||
self.quirks_mode.get()
|
self.quirks_mode.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_quirks_mode(&self, mode: QuirksMode) {
|
pub fn set_quirks_mode(&self, new_mode: QuirksMode) {
|
||||||
self.quirks_mode.set(mode);
|
let old_mode = self.quirks_mode.replace(new_mode);
|
||||||
|
|
||||||
if mode == QuirksMode::Quirks {
|
if old_mode != new_mode {
|
||||||
match self.window.layout_chan() {
|
match self.window.layout_chan() {
|
||||||
Some(chan) => chan.send(Msg::SetQuirksMode(mode)).unwrap(),
|
Some(chan) => chan.send(Msg::SetQuirksMode(new_mode)).unwrap(),
|
||||||
None => warn!("Layout channel unavailable"),
|
None => warn!("Layout channel unavailable"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue