mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Make OpaqueLayoutAndStyleData just a bit less opaque
It now stores a NonNull<dyn Any>.
This commit is contained in:
parent
e47e884cc7
commit
4c61baee30
11 changed files with 83 additions and 65 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
use crate::construct::ConstructionResult;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::data::StyleAndLayoutData;
|
||||
use crate::display_list::items::{DisplayList, OpaqueNode, ScrollOffsetMap};
|
||||
use crate::display_list::IndexableText;
|
||||
use crate::flow::{Flow, GetBaseFlow};
|
||||
|
@ -26,7 +27,6 @@ use script_layout_interface::rpc::{OffsetParentResponse, ResolvedStyleResponse,
|
|||
use script_layout_interface::wrapper_traits::{
|
||||
LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_layout_interface::StyleData;
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use script_traits::LayoutMsg as ConstellationMsg;
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
|
@ -1037,8 +1037,13 @@ fn inner_text_collection_steps<'dom>(
|
|||
};
|
||||
|
||||
let element_data = unsafe {
|
||||
node.get_style_and_layout_data()
|
||||
.map(|d| &(*(d.ptr.as_ptr() as *mut StyleData)).element_data)
|
||||
&node.get_style_and_layout_data().as_ref().map(|opaque| {
|
||||
&opaque
|
||||
.downcast_ref::<StyleAndLayoutData>()
|
||||
.unwrap()
|
||||
.style_data
|
||||
.element_data
|
||||
})
|
||||
};
|
||||
|
||||
if element_data.is_none() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue