layout: Implement z-index.

This commit is contained in:
Patrick Walton 2014-10-02 14:11:04 -07:00
parent eff0de0ce1
commit 01c90d8d6a
9 changed files with 81 additions and 18 deletions

View file

@ -943,7 +943,14 @@ impl InlineFlow {
/// `style` is the style of the block.
pub fn compute_minimum_ascent_and_descent(&self,
font_context: &mut FontContext,
style: &ComputedValues) -> (Au, Au) {
style: &ComputedValues)
-> (Au, Au) {
// As a special case, if this flow contains only hypothetical fragments, then the entire
// flow is hypothetical and takes up no space. See CSS 2.1 § 10.3.7.
if self.fragments.fragments.iter().all(|fragment| fragment.is_hypothetical()) {
return (Au(0), Au(0))
}
let font_style = text::computed_style_to_font_style(style);
let font_metrics = text::font_metrics_for_style(font_context, &font_style);
let line_height = text::line_height_from_style(style, &font_metrics);