mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Kill establishes_containing_block_for_absolute
We inline the related tests at the two call sites.
This commit is contained in:
parent
6e0a7dc3b2
commit
7a704d2f04
1 changed files with 7 additions and 23 deletions
|
@ -71,19 +71,6 @@ use webrender_api::{ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, L
|
||||||
use webrender_api::{LayoutSize, LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder};
|
use webrender_api::{LayoutSize, LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder};
|
||||||
use webrender_api::{NinePatchBorderSource, NormalBorder, ScrollSensitivity, StickyOffsetBounds};
|
use webrender_api::{NinePatchBorderSource, NormalBorder, ScrollSensitivity, StickyOffsetBounds};
|
||||||
|
|
||||||
fn establishes_containing_block_for_absolute(
|
|
||||||
flags: StackingContextCollectionFlags,
|
|
||||||
positioning: StylePosition,
|
|
||||||
established_reference_frame: bool,
|
|
||||||
) -> bool {
|
|
||||||
if established_reference_frame {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
!flags.contains(StackingContextCollectionFlags::POSITION_NEVER_CREATES_CONTAINING_BLOCK) &&
|
|
||||||
StylePosition::Static != positioning
|
|
||||||
}
|
|
||||||
|
|
||||||
trait RgbColor {
|
trait RgbColor {
|
||||||
fn rgb(r: u8, g: u8, b: u8) -> Self;
|
fn rgb(r: u8, g: u8, b: u8) -> Self;
|
||||||
}
|
}
|
||||||
|
@ -2360,11 +2347,11 @@ impl BlockFlow {
|
||||||
flags,
|
flags,
|
||||||
);
|
);
|
||||||
|
|
||||||
if establishes_containing_block_for_absolute(
|
let creates_containing_block = !flags
|
||||||
flags,
|
.contains(StackingContextCollectionFlags::POSITION_NEVER_CREATES_CONTAINING_BLOCK);
|
||||||
self.positioning(),
|
let abspos_containing_block = established_reference_frame.is_some() ||
|
||||||
established_reference_frame.is_some(),
|
(creates_containing_block && self.positioning() != StylePosition::Static);
|
||||||
) {
|
if abspos_containing_block {
|
||||||
state.containing_block_clipping_and_scrolling = state.current_clipping_and_scrolling;
|
state.containing_block_clipping_and_scrolling = state.current_clipping_and_scrolling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2842,11 +2829,8 @@ impl InlineFlowDisplayListBuilding for InlineFlow {
|
||||||
for fragment in self.fragments.fragments.iter_mut() {
|
for fragment in self.fragments.fragments.iter_mut() {
|
||||||
state.containing_block_clipping_and_scrolling = previous_cb_clipping_and_scrolling;
|
state.containing_block_clipping_and_scrolling = previous_cb_clipping_and_scrolling;
|
||||||
|
|
||||||
if establishes_containing_block_for_absolute(
|
let abspos_containing_block = fragment.style.get_box().position != StylePosition::Static;
|
||||||
StackingContextCollectionFlags::empty(),
|
if abspos_containing_block {
|
||||||
fragment.style.get_box().position,
|
|
||||||
false,
|
|
||||||
) {
|
|
||||||
state.containing_block_clipping_and_scrolling =
|
state.containing_block_clipping_and_scrolling =
|
||||||
state.current_clipping_and_scrolling;
|
state.current_clipping_and_scrolling;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue