mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Structure reflow code to make it more modular (#36597)
This reworks the structure of reflow in `layout_thread_2020` in order to make it more modular. The goal here is to allow possibly adding a new fragment tree traversal and to, in general, make the code a bit more organized. Testing: This should not change any behavior so is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
73b778e67f
commit
554fa26da2
2 changed files with 273 additions and 242 deletions
|
@ -12,19 +12,15 @@ use crate::context::LayoutContext;
|
|||
use crate::dom::DOMLayoutData;
|
||||
|
||||
pub struct RecalcStyle<'a> {
|
||||
context: LayoutContext<'a>,
|
||||
context: &'a LayoutContext<'a>,
|
||||
}
|
||||
|
||||
impl<'a> RecalcStyle<'a> {
|
||||
pub fn new(context: LayoutContext<'a>) -> Self {
|
||||
pub fn new(context: &'a LayoutContext<'a>) -> Self {
|
||||
RecalcStyle { context }
|
||||
}
|
||||
|
||||
pub fn context(&self) -> &LayoutContext<'a> {
|
||||
&self.context
|
||||
}
|
||||
|
||||
pub fn destroy(self) -> LayoutContext<'a> {
|
||||
self.context
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue