Introduce a dedicated data structure for text queries

Add an IndexableText structure for text queries.
Instead of linear search for a node this now uses a HashMap.
Remove the now irrelevant fields from TextDisplayItem.
This commit is contained in:
Pyfisch 2018-02-11 21:00:32 +01:00
parent a5115139ba
commit 2d74bcfea5
6 changed files with 70 additions and 49 deletions

View file

@ -7,6 +7,7 @@
use app_units::Au;
use construct::ConstructionResult;
use context::LayoutContext;
use display_list::IndexableText;
use euclid::{Point2D, Vector2D, Rect, Size2D};
use flow::{Flow, GetBaseFlow};
use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
@ -51,6 +52,8 @@ pub struct LayoutThreadData {
/// The root stacking context.
pub display_list: Option<Arc<DisplayList>>,
pub indexable_text: IndexableText,
/// A queued response for the union of the content boxes of a node.
pub content_box_response: Option<Rect<Au>>,