mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
layout: Stop doing unsafe transmutes between refcell references.
This commit splits the style and layout data in two separate refcells. These transmutes have been a source of trouble (for example on Android), and they feel like a hack anyway. Fixes #16982
This commit is contained in:
parent
bb310efbb9
commit
deaa935f5b
9 changed files with 79 additions and 94 deletions
|
@ -1173,7 +1173,7 @@ impl LayoutThread {
|
|||
|
||||
// If we haven't styled this node yet, we don't need to track a
|
||||
// restyle.
|
||||
let mut data = match el.mutate_layout_data() {
|
||||
let style_data = match el.get_data() {
|
||||
Some(d) => d,
|
||||
None => {
|
||||
unsafe { el.unset_snapshot_flags() };
|
||||
|
@ -1186,7 +1186,7 @@ impl LayoutThread {
|
|||
map.insert(el.as_node().opaque(), s);
|
||||
}
|
||||
|
||||
let mut style_data = &mut data.base.style_data;
|
||||
let mut style_data = style_data.borrow_mut();
|
||||
let mut restyle_data = style_data.ensure_restyle();
|
||||
|
||||
// Stash the data on the element for processing by the style system.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue