layout: Check flow descendants of inline block fragments to find their

baselines when aligning inline fragments per CSS 2.1 § 10.8.1.
This commit is contained in:
Patrick Walton 2016-04-27 12:44:43 -07:00
parent 8823f87276
commit 04f05349b1
6 changed files with 191 additions and 65 deletions

View file

@ -1837,6 +1837,21 @@ pub mod computed {
Auto,
Calc(CalcLengthOrPercentage),
}
impl LengthOrPercentageOrAuto {
/// Returns true if the computed value is absolute 0 or 0%.
///
/// (Returns false for calc() values, even if ones that may resolve to zero.)
#[inline]
pub fn is_definitely_zero(&self) -> bool {
use self::LengthOrPercentageOrAuto::*;
match *self {
Length(Au(0)) | Percentage(0.0) => true,
Length(_) | Percentage(_) | Calc(_) | Auto => false
}
}
}
impl fmt::Debug for LengthOrPercentageOrAuto {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {