mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Have ContentBox(es)Queries consult the flow tree
Instead of looking at the display tree, have ContentBox(es)Query consult the flow tree. This allow optimizing away parts of the display tree later. To do this we need to be more careful about how we send reflow requests, only querying the flow tree when possible. Fixes #3790.
This commit is contained in:
parent
1a3ff8739c
commit
2d72f00ccf
19 changed files with 374 additions and 213 deletions
|
@ -22,7 +22,7 @@ use text;
|
|||
use util::OpaqueNodeMethods;
|
||||
use wrapper::{TLayoutNode, ThreadSafeLayoutNode};
|
||||
|
||||
use geom::Size2D;
|
||||
use geom::{Point2D, Rect, Size2D};
|
||||
use gfx::display_list::OpaqueNode;
|
||||
use gfx::text::glyph::CharIndex;
|
||||
use gfx::text::text_run::TextRun;
|
||||
|
@ -1482,6 +1482,13 @@ impl Fragment {
|
|||
pub fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
|
||||
self.style = (*new_style).clone()
|
||||
}
|
||||
|
||||
pub fn abs_bounds_from_origin(&self, fragment_origin: &Point2D<Au>) -> Rect<Au> {
|
||||
// FIXME(#2795): Get the real container size
|
||||
let container_size = Size2D::zero();
|
||||
self.border_box.to_physical(self.style.writing_mode, container_size)
|
||||
.translate(fragment_origin)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for Fragment {
|
||||
|
@ -1502,3 +1509,13 @@ bitflags! {
|
|||
static IntrinsicInlineSizeIncludesSpecified = 0x08,
|
||||
}
|
||||
}
|
||||
|
||||
/// A top-down fragment bounds iteration handler.
|
||||
pub trait FragmentBoundsIterator {
|
||||
/// The operation to perform.
|
||||
fn process(&mut self, fragment: &Fragment, bounds: Rect<Au>);
|
||||
|
||||
/// Returns true if this fragment must be processed in-order. If this returns false,
|
||||
/// we skip the operation for this fragment, but continue processing siblings.
|
||||
fn should_process(&mut self, fragment: &Fragment) -> bool;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue