From f07bfaa97466018f93124e308556aa93293cf648 Mon Sep 17 00:00:00 2001 From: Pu Xingyu Date: Wed, 4 Jan 2017 13:33:58 +0800 Subject: [PATCH] Remove redundant style_context() method of LayoutContext --- components/layout/construct.rs | 2 +- components/layout/context.rs | 8 -------- components/layout/fragment.rs | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 95603f8dea7..046fd19afc4 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -333,7 +333,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> #[inline] fn style_context(&self) -> &SharedStyleContext { - self.layout_context.style_context() + self.layout_context.shared_context() } #[inline] diff --git a/components/layout/context.rs b/components/layout/context.rs index baac3f29c41..8d83cf4b5c1 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -131,19 +131,11 @@ impl<'a> LayoutContext<'a> { } impl<'a> LayoutContext<'a> { - // FIXME(bholley): The following two methods are identical and should be merged. - // shared_context() is the appropriate name, but it involves renaming a lot of - // calls. #[inline(always)] pub fn shared_context(&self) -> &SharedStyleContext { &self.shared.style_context } - #[inline(always)] - pub fn style_context(&self) -> &SharedStyleContext { - &self.shared.style_context - } - #[inline(always)] pub fn font_context(&self) -> RefMut { self.persistent.font_context.borrow_mut() diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 558abe47b37..046838f4ade 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -642,8 +642,8 @@ pub struct TruncatedFragmentInfo { impl Fragment { /// Constructs a new `Fragment` instance. pub fn new(node: &N, specific: SpecificFragmentInfo, ctx: &LayoutContext) -> Fragment { - let style_context = ctx.style_context(); - let style = node.style(style_context); + let shared_context = ctx.shared_context(); + let style = node.style(shared_context); let writing_mode = style.writing_mode; let mut restyle_damage = node.restyle_damage();