Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove redundant style_context() method of LayoutContext
  • Loading branch information
stshine committed Feb 5, 2017
1 parent cd63f1b commit f07bfaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/layout/construct.rs
Expand Up @@ -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]
Expand Down
8 changes: 0 additions & 8 deletions components/layout/context.rs
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions components/layout/fragment.rs
Expand Up @@ -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();
Expand Down

0 comments on commit f07bfaa

Please sign in to comment.