Update WR (reference frames for fixed position elements).

This commit is contained in:
Glenn Watson 2017-03-03 09:46:24 +10:00
parent fa32d50c7a
commit 750794eb77
7 changed files with 73 additions and 56 deletions

View file

@ -29,7 +29,7 @@ use app_units::Au;
use block::{BlockFlow, FormattingContextType};
use context::LayoutContext;
use display_list_builder::DisplayListBuildState;
use euclid::{Point2D, Size2D};
use euclid::{Matrix4D, Point2D, Size2D};
use flex::FlexFlow;
use floats::{Floats, SpeculatedFloatPlacement};
use flow_list::{FlowList, MutFlowListIterator};
@ -272,7 +272,11 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
// TODO: Take into account 3d transforms, even though it's a fairly
// uncommon case.
let transform_2d = self.as_block().fragment.transform_matrix(&position).to_2d();
let transform_2d = self.as_block()
.fragment
.transform_matrix(&position)
.unwrap_or(Matrix4D::identity())
.to_2d();
let transformed_overflow = Overflow {
paint: f32_rect_to_au_rect(transform_2d.transform_rect(
&au_rect_to_f32_rect(overflow.paint))),