mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
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:
parent
2af6fe0b30
commit
53c0726ef4
7 changed files with 88 additions and 133 deletions
|
@ -462,8 +462,8 @@ impl HTMLElementMethods for HTMLElement {
|
|||
|
||||
window.layout_reflow(QueryMsg::ElementInnerTextQuery);
|
||||
let text = window
|
||||
.with_layout(|layout| layout.query_element_inner_text(node.to_trusted_node_address()))
|
||||
.unwrap_or_default();
|
||||
.layout()
|
||||
.query_element_inner_text(node.to_trusted_node_address());
|
||||
DOMString::from(text)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue