script: Have Document own Layout (#32316)

Have `Document` own `Layout`. This makes it impossible to have a
`Document` without `Layout`, which was true, but now the compiler checks
it. In addition, `Layout` is now released when the `Document` is,
avoiding leaking the entire `Layout`.
This commit is contained in:
Martin Robinson 2024-05-20 15:04:32 +02:00 committed by GitHub
parent 2af6fe0b30
commit 53c0726ef4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 88 additions and 133 deletions

View file

@ -73,8 +73,8 @@ impl MediaQueryList {
pub fn evaluate(&self) -> bool {
let quirks_mode = self.document.quirks_mode();
self.document
.with_device(move |device| self.media_query_list.evaluate(device, quirks_mode))
self.media_query_list
.evaluate(self.document.window().layout().device(), quirks_mode)
}
}