aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/inline/text_run.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_2020/flow/inline/text_run.rs')
-rw-r--r--components/layout_2020/flow/inline/text_run.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/layout_2020/flow/inline/text_run.rs b/components/layout_2020/flow/inline/text_run.rs
index b0687900000..0d0c6398017 100644
--- a/components/layout_2020/flow/inline/text_run.rs
+++ b/components/layout_2020/flow/inline/text_run.rs
@@ -12,6 +12,7 @@ use fonts::{
};
use fonts_traits::ByteIndex;
use log::warn;
+use malloc_size_of_derive::MallocSizeOf;
use range::Range as ServoRange;
use servo_arc::Arc;
use style::computed_values::text_rendering::T as TextRendering;
@@ -37,9 +38,10 @@ pub(crate) const XI_LINE_BREAKING_CLASS_WJ: u8 = 30;
pub(crate) const XI_LINE_BREAKING_CLASS_ZWJ: u8 = 42;
/// <https://www.w3.org/TR/css-display-3/#css-text-run>
-#[derive(Debug)]
+#[derive(Debug, MallocSizeOf)]
pub(crate) struct TextRun {
pub base_fragment_info: BaseFragmentInfo,
+ #[conditional_malloc_size_of]
pub parent_style: Arc<ComputedValues>,
pub text_range: Range<usize>,
@@ -47,6 +49,7 @@ pub(crate) struct TextRun {
/// segments, and shaped.
pub shaped_text: Vec<TextRunSegment>,
pub selection_range: Option<ServoRange<ByteIndex>>,
+ #[conditional_malloc_size_of]
pub selected_style: Arc<ComputedValues>,
}
@@ -64,7 +67,7 @@ enum SegmentStartSoftWrapPolicy {
FollowLinebreaker,
}
-#[derive(Debug)]
+#[derive(Debug, MallocSizeOf)]
pub(crate) struct TextRunSegment {
/// The index of this font in the parent [`super::InlineFormattingContext`]'s collection of font
/// information.