From 6d91d77fba1e2151f32379bfd7552444b00bdde7 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sat, 7 Dec 2019 14:05:37 +0100 Subject: [PATCH] Rename content_rect to rect in TextFragment and ImageFragment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since they don’t have padding etc. --- components/layout_2020/display_list.rs | 4 ++-- components/layout_2020/flow/inline.rs | 4 ++-- components/layout_2020/fragments.rs | 4 ++-- components/layout_2020/replaced.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/layout_2020/display_list.rs b/components/layout_2020/display_list.rs index e8a43be33b4..dabdb32b88b 100644 --- a/components/layout_2020/display_list.rs +++ b/components/layout_2020/display_list.rs @@ -53,7 +53,7 @@ impl Fragment { Fragment::Text(t) => { is_contentful.0 = true; let rect = t - .content_rect + .rect .to_physical(t.parent_style.writing_mode, containing_block) .translate(&containing_block.top_left); let mut baseline_origin = rect.top_left.clone(); @@ -79,7 +79,7 @@ impl Fragment { use style::computed_values::image_rendering::T as ImageRendering; is_contentful.0 = true; let rect = i - .content_rect + .rect .to_physical(i.style.writing_mode, containing_block) .translate(&containing_block.top_left); let common = CommonItemProperties { diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index 25546325c1d..bd1f2768723 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -601,7 +601,7 @@ impl TextRun { LineHeight::Number(n) => font_size * n.0, LineHeight::Length(l) => l.0, }; - let content_rect = Rect { + let rect = Rect { start_corner: Vec2 { block: Length::zero(), inline: ifc.inline_position - ifc.current_nesting_level.inline_start, @@ -619,7 +619,7 @@ impl TextRun { .fragments_so_far .push(Fragment::Text(TextFragment { parent_style: self.parent_style.clone(), - content_rect, + rect, ascent: font_ascent.into(), font_key, glyphs, diff --git a/components/layout_2020/fragments.rs b/components/layout_2020/fragments.rs index 3effe5436e3..4dbacc5611e 100644 --- a/components/layout_2020/fragments.rs +++ b/components/layout_2020/fragments.rs @@ -56,7 +56,7 @@ pub(crate) struct AnonymousFragment { pub(crate) struct TextFragment { pub parent_style: ServoArc, - pub content_rect: Rect, + pub rect: Rect, pub ascent: Length, pub font_key: FontInstanceKey, pub glyphs: Vec>, @@ -64,7 +64,7 @@ pub(crate) struct TextFragment { pub(crate) struct ImageFragment { pub style: ServoArc, - pub content_rect: Rect, + pub rect: Rect, pub image_key: ImageKey, } diff --git a/components/layout_2020/replaced.rs b/components/layout_2020/replaced.rs index 8cb77d267bd..8a28cbf763c 100644 --- a/components/layout_2020/replaced.rs +++ b/components/layout_2020/replaced.rs @@ -45,7 +45,7 @@ impl ReplacedContent { .map(|image_key| { Fragment::Image(ImageFragment { style: style.clone(), - content_rect: flow_relative::Rect { + rect: flow_relative::Rect { start_corner: flow_relative::Vec2::zero(), size, },