Remove redundant style_context() method of LayoutContext

This commit is contained in:
Pu Xingyu 2017-01-04 13:33:58 +08:00
parent cd63f1b158
commit f07bfaa974
3 changed files with 3 additions and 11 deletions

View file

@ -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]

View file

@ -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()

View file

@ -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();