Skip to content
Permalink
Browse files

Remove redundant style_context() method of LayoutContext

  • Loading branch information
stshine committed Feb 5, 2017
1 parent cd63f1b commit f07bfaa97466018f93124e308556aa93293cf648
Showing with 3 additions and 11 deletions.
  1. +1 −1 components/layout/construct.rs
  2. +0 −8 components/layout/context.rs
  3. +2 −2 components/layout/fragment.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]
@@ -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<FontContext> {
self.persistent.font_context.borrow_mut()
@@ -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();

0 comments on commit f07bfaa

Please sign in to comment.
You can’t perform that action at this time.