diff options
author | Pu Xingyu <pu.stshine@gmail.com> | 2017-01-04 13:33:58 +0800 |
---|---|---|
committer | Pu Xingyu <pu.stshine@gmail.com> | 2017-02-06 00:44:11 +0800 |
commit | f07bfaa97466018f93124e308556aa93293cf648 (patch) | |
tree | e7856552cdc64c93b06377f2533ec1188696bbee /components | |
parent | cd63f1b158807035d2a83584e64329015a3fff4d (diff) | |
download | servo-f07bfaa97466018f93124e308556aa93293cf648.tar.gz servo-f07bfaa97466018f93124e308556aa93293cf648.zip |
Remove redundant style_context() method of LayoutContext
Diffstat (limited to 'components')
-rw-r--r-- | components/layout/construct.rs | 2 | ||||
-rw-r--r-- | components/layout/context.rs | 8 | ||||
-rw-r--r-- | 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,20 +131,12 @@ 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<FontContext> { 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<N: ThreadSafeLayoutNode>(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(); |