mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Prevent more missing docs in the values module.
This commit is contained in:
parent
a0d425e8ce
commit
f37aa12927
13 changed files with 281 additions and 37 deletions
|
@ -2,6 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! `<length>` computed values, and related ones.
|
||||
|
||||
use app_units::Au;
|
||||
use ordered_float::NotNaN;
|
||||
use std::fmt;
|
||||
|
@ -16,6 +18,7 @@ pub use values::specified::{Angle, BorderStyle, Time, UrlOrNone};
|
|||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub struct CalcLengthOrPercentage {
|
||||
pub length: Au,
|
||||
pub percentage: Option<CSSFloat>,
|
||||
|
@ -23,11 +26,13 @@ pub struct CalcLengthOrPercentage {
|
|||
|
||||
impl CalcLengthOrPercentage {
|
||||
#[inline]
|
||||
#[allow(missing_docs)]
|
||||
pub fn length(&self) -> Au {
|
||||
self.length
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[allow(missing_docs)]
|
||||
pub fn percentage(&self) -> CSSFloat {
|
||||
self.percentage.unwrap_or(0.)
|
||||
}
|
||||
|
@ -130,6 +135,7 @@ impl ToComputedValue for specified::CalcLengthOrPercentage {
|
|||
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub enum LengthOrPercentage {
|
||||
Length(Au),
|
||||
Percentage(CSSFloat),
|
||||
|
@ -138,6 +144,7 @@ pub enum LengthOrPercentage {
|
|||
|
||||
impl LengthOrPercentage {
|
||||
#[inline]
|
||||
#[allow(missing_docs)]
|
||||
pub fn zero() -> LengthOrPercentage {
|
||||
LengthOrPercentage::Length(Au(0))
|
||||
}
|
||||
|
@ -154,6 +161,7 @@ impl LengthOrPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub fn to_hash_key(&self) -> (Au, NotNaN<f32>) {
|
||||
use self::LengthOrPercentage::*;
|
||||
match *self {
|
||||
|
@ -223,6 +231,7 @@ impl ToCss for LengthOrPercentage {
|
|||
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub enum LengthOrPercentageOrAuto {
|
||||
Length(Au),
|
||||
Percentage(CSSFloat),
|
||||
|
@ -311,6 +320,7 @@ impl ToCss for LengthOrPercentageOrAuto {
|
|||
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub enum LengthOrPercentageOrAutoOrContent {
|
||||
Length(Au),
|
||||
Percentage(CSSFloat),
|
||||
|
@ -397,6 +407,7 @@ impl ToCss for LengthOrPercentageOrAutoOrContent {
|
|||
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub enum LengthOrPercentageOrNone {
|
||||
Length(Au),
|
||||
Percentage(CSSFloat),
|
||||
|
@ -469,12 +480,17 @@ impl ToCss for LengthOrPercentageOrNone {
|
|||
}
|
||||
}
|
||||
|
||||
/// A computed `<length>` value.
|
||||
pub type Length = Au;
|
||||
|
||||
/// Either a computed `<length>` or the `none` keyword.
|
||||
pub type LengthOrNone = Either<Length, None_>;
|
||||
|
||||
/// Either a computed `<length>` or the `auto` keyword.
|
||||
pub type LengthOrAuto = Either<Length, Auto>;
|
||||
|
||||
/// Either a computed `<length>` or a `<number>` value.
|
||||
pub type LengthOrNumber = Either<Length, Number>;
|
||||
|
||||
/// Either a computed `<length>` or the `normal` keyword.
|
||||
pub type LengthOrNormal = Either<Length, Normal>;
|
||||
|
||||
pub type Length = Au;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue