mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Implement z-index
.
This commit is contained in:
parent
eff0de0ce1
commit
01c90d8d6a
9 changed files with 81 additions and 18 deletions
|
@ -1701,13 +1701,13 @@ impl Fragment {
|
|||
&font_style);
|
||||
InlineMetrics::from_block_height(&font_metrics, block_flow.base.position.size.block)
|
||||
}
|
||||
InlineAbsoluteHypotheticalFragment(ref info) => {
|
||||
// See CSS 2.1 § 10.8.1.
|
||||
let block_flow = info.flow_ref.get().as_immutable_block();
|
||||
let font_style = text::computed_style_to_font_style(&*self.style);
|
||||
let font_metrics = text::font_metrics_for_style(layout_context.font_context(),
|
||||
&font_style);
|
||||
InlineMetrics::from_block_height(&font_metrics, block_flow.base.position.size.block)
|
||||
InlineAbsoluteHypotheticalFragment(_) => {
|
||||
// Hypothetical boxes take up no space.
|
||||
InlineMetrics {
|
||||
block_size_above_baseline: Au(0),
|
||||
depth_below_baseline: Au(0),
|
||||
ascent: Au(0),
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
InlineMetrics {
|
||||
|
@ -1719,6 +1719,14 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns true if this fragment is a hypothetical box. See CSS 2.1 § 10.3.7.
|
||||
pub fn is_hypothetical(&self) -> bool {
|
||||
match self.specific {
|
||||
InlineAbsoluteHypotheticalFragment(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this fragment can merge with another adjacent fragment or false otherwise.
|
||||
pub fn can_merge_with_fragment(&self, other: &Fragment) -> bool {
|
||||
match (&self.specific, &other.specific) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue