mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Improve logic for establishing a stacking context (#35947)
In particular: - `z-index` will now work on unpositioned grid items. - `will-change: z-index` will only establish a stacking context if `z-index` applies, i.e. if the box is positioned or a flex/grid item. - The conditions in `establishes_stacking_context()` are reordered, so that the most likely ones are checked first. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
205b97d5ed
commit
f93006af95
33 changed files with 233 additions and 114 deletions
|
@ -20,7 +20,9 @@ use crate::formatting_contexts::{
|
|||
Baselines, IndependentFormattingContext, IndependentFormattingContextContents,
|
||||
IndependentLayout,
|
||||
};
|
||||
use crate::fragment_tree::{BoxFragment, CollapsedBlockMargins, Fragment, SpecificLayoutInfo};
|
||||
use crate::fragment_tree::{
|
||||
BoxFragment, CollapsedBlockMargins, Fragment, FragmentFlags, SpecificLayoutInfo,
|
||||
};
|
||||
use crate::geom::{
|
||||
LogicalSides, LogicalVec2, PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize, Size,
|
||||
SizeConstraint, Sizes,
|
||||
|
@ -560,8 +562,12 @@ impl TaffyContainer {
|
|||
|
||||
match &mut child.taffy_level_box {
|
||||
TaffyItemBoxInner::InFlowBox(independent_box) => {
|
||||
let mut fragment_info = independent_box.base_fragment_info();
|
||||
fragment_info
|
||||
.flags
|
||||
.insert(FragmentFlags::IS_FLEX_OR_GRID_ITEM);
|
||||
let mut box_fragment = BoxFragment::new(
|
||||
independent_box.base_fragment_info(),
|
||||
fragment_info,
|
||||
independent_box.style().clone(),
|
||||
std::mem::take(&mut child.child_fragments),
|
||||
content_size,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue