mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Place floats in layout 2020, but don't flow text around the floats yet.
This commit puts floats behind the `layout.floats.enabled` pref, because of the following issues and unimplemented features: * Inline formatting contexts don't take floats into account, so text doesn't flow around the floats yet. * Non-floated block formatting contexts don't take floats into account, so BFCs can overlap floats. * Block formatting contexts that contain floats don't expand vertically to contain all the floats. That is, floats can stick out the bottom of BFCs, contra spec.
This commit is contained in:
parent
053a0aa4fd
commit
cdec48328e
235 changed files with 1018 additions and 623 deletions
|
@ -200,6 +200,8 @@ impl Fragment {
|
|||
Visibility::Hidden => (),
|
||||
Visibility::Collapse => (),
|
||||
},
|
||||
Fragment::HoistedFloat(_) => {},
|
||||
Fragment::Float => {},
|
||||
Fragment::AbsoluteOrFixedPositioned(_) => {},
|
||||
Fragment::Anonymous(_) => {},
|
||||
Fragment::Image(i) => match i.style.get_inherited_box().visibility {
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::cell::ArcRefCell;
|
|||
use crate::display_list::conversions::ToWebRender;
|
||||
use crate::display_list::DisplayListBuilder;
|
||||
use crate::fragment_tree::ContainingBlockManager;
|
||||
use crate::fragments::{AnonymousFragment, BoxFragment, Fragment};
|
||||
use crate::fragments::{AnonymousFragment, BoxFragment, Fragment, HoistedFloatFragment};
|
||||
use crate::geom::PhysicalRect;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::FragmentTree;
|
||||
|
@ -554,6 +554,14 @@ impl Fragment {
|
|||
stacking_context,
|
||||
);
|
||||
},
|
||||
Fragment::HoistedFloat(fragment) => {
|
||||
fragment.build_stacking_context_tree(
|
||||
display_list,
|
||||
containing_block_info,
|
||||
stacking_context,
|
||||
);
|
||||
},
|
||||
Fragment::Float => {},
|
||||
Fragment::AbsoluteOrFixedPositioned(fragment) => {
|
||||
let shared_fragment = fragment.borrow();
|
||||
let fragment_ref = match shared_fragment.fragment.as_ref() {
|
||||
|
@ -1095,3 +1103,20 @@ impl AnonymousFragment {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HoistedFloatFragment {
|
||||
fn build_stacking_context_tree(
|
||||
&self,
|
||||
display_list: &mut DisplayList,
|
||||
containing_block_info: &ContainingBlockInfo,
|
||||
stacking_context: &mut StackingContext,
|
||||
) {
|
||||
self.fragment.borrow().build_stacking_context_tree(
|
||||
&self.fragment,
|
||||
display_list,
|
||||
containing_block_info,
|
||||
stacking_context,
|
||||
StackingContextBuildMode::SkipHoisted,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue