layout_2020: Add support for transitions and animations

This commit is contained in:
Martin Robinson 2020-05-11 10:20:40 +02:00
parent c183f95297
commit a238597a18
7 changed files with 54 additions and 18 deletions

View file

@ -26,6 +26,7 @@ use crate::style_ext::{Display, DisplayGeneratingBox};
use crate::DefiniteContainingBlock;
use app_units::Au;
use euclid::default::{Point2D, Rect, Size2D};
use fxhash::FxHashSet;
use gfx_traits::print_tree::PrintTree;
use script_layout_interface::wrapper_traits::LayoutNode;
use script_layout_interface::{LayoutElementType, LayoutNodeType};
@ -303,6 +304,15 @@ impl FragmentTree {
})
}
pub fn remove_nodes_in_fragment_tree_from_set(&self, set: &mut FxHashSet<OpaqueNode>) {
self.find(|fragment, _| {
if let Some(tag) = fragment.tag().as_ref() {
set.remove(tag);
}
None::<()>
});
}
pub fn get_content_box_for_node(&self, requested_node: OpaqueNode) -> Rect<Au> {
let mut bounding_box = PhysicalRect::zero();
self.find(|fragment, containing_block| {