mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Generate a fragment for an empty elements with borders or padding
This commit is contained in:
parent
fbef2724bf
commit
1807fd3cc5
3 changed files with 66 additions and 4 deletions
|
@ -1662,9 +1662,22 @@ pub mod computed {
|
|||
}
|
||||
|
||||
impl LengthOrPercentage {
|
||||
#[inline]
|
||||
pub fn zero() -> LengthOrPercentage {
|
||||
LengthOrPercentage::Length(Au(0))
|
||||
}
|
||||
|
||||
/// 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::LengthOrPercentage::*;
|
||||
match *self {
|
||||
Length(Au(0)) | Percentage(0.0) => true,
|
||||
Length(_) | Percentage(_) | Calc(_) => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for LengthOrPercentage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue