mirror of
https://github.com/servo/servo.git
synced 2025-06-18 05:14:28 +00:00
Remove redundant style_context() method of LayoutContext
This commit is contained in:
parent
cd63f1b158
commit
f07bfaa974
3 changed files with 3 additions and 11 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue