mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc. This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.
This commit is contained in:
parent
aa3122e7d1
commit
efc3683cc7
137 changed files with 572 additions and 565 deletions
|
@ -27,7 +27,7 @@ pub type TextShadowList = ShadowList<SimpleShadow>;
|
|||
|
||||
/// An animated value for shadow lists.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-shadow-list
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-shadow-list>
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct ShadowList<Shadow>(Vec<Shadow>);
|
||||
|
|
|
@ -48,15 +48,15 @@ pub trait Animate: Sized {
|
|||
|
||||
/// An animation procedure.
|
||||
///
|
||||
/// https://w3c.github.io/web-animations/#procedures-for-animating-properties
|
||||
/// <https://w3c.github.io/web-animations/#procedures-for-animating-properties>
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum Procedure {
|
||||
/// https://w3c.github.io/web-animations/#animation-interpolation
|
||||
/// <https://w3c.github.io/web-animations/#animation-interpolation>
|
||||
Interpolate { progress: f64 },
|
||||
/// https://w3c.github.io/web-animations/#animation-addition
|
||||
/// <https://w3c.github.io/web-animations/#animation-addition>
|
||||
Add,
|
||||
/// https://w3c.github.io/web-animations/#animation-accumulation
|
||||
/// <https://w3c.github.io/web-animations/#animation-accumulation>
|
||||
Accumulate { count: u64 },
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ impl Procedure {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-number>
|
||||
impl Animate for i32 {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
|
@ -121,7 +121,7 @@ impl Animate for i32 {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-number>
|
||||
impl Animate for f32 {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
|
@ -132,7 +132,7 @@ impl Animate for f32 {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-number>
|
||||
impl Animate for f64 {
|
||||
#[inline]
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
|
|
|
@ -46,7 +46,7 @@ impl JustifyItems {
|
|||
impl ToComputedValue for specified::JustifyItems {
|
||||
type ComputedValue = JustifyItems;
|
||||
|
||||
/// https://drafts.csswg.org/css-align/#valdef-justify-items-legacy
|
||||
/// <https://drafts.csswg.org/css-align/#valdef-justify-items-legacy>
|
||||
fn to_computed_value(&self, _context: &Context) -> JustifyItems {
|
||||
use values::specified::align;
|
||||
let specified = *self;
|
||||
|
|
|
@ -67,7 +67,7 @@ impl Angle {
|
|||
Angle::Radian(0.0)
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-number>
|
||||
#[inline]
|
||||
fn animate_fallback(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
Ok(Angle::from_radians(self.radians().animate(&other.radians(), procedure)?))
|
||||
|
|
|
@ -27,11 +27,11 @@ use values::specified::position::{X, Y};
|
|||
pub type ImageLayer = Either<None_, Image>;
|
||||
|
||||
/// Computed values for an image according to CSS-IMAGES.
|
||||
/// https://drafts.csswg.org/css-images/#image-values
|
||||
/// <https://drafts.csswg.org/css-images/#image-values>
|
||||
pub type Image = GenericImage<Gradient, MozImageRect, ComputedUrl>;
|
||||
|
||||
/// Computed values for a CSS gradient.
|
||||
/// https://drafts.csswg.org/css-images/#gradients
|
||||
/// <https://drafts.csswg.org/css-images/#gradients>
|
||||
pub type Gradient = GenericGradient<
|
||||
LineDirection,
|
||||
Length,
|
||||
|
|
|
@ -307,7 +307,7 @@ pub enum LengthOrPercentage {
|
|||
}
|
||||
|
||||
impl LengthOrPercentage {
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-lpcalc
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
|
||||
fn animate_fallback(
|
||||
&self,
|
||||
other: &Self,
|
||||
|
@ -465,7 +465,7 @@ pub enum LengthOrPercentageOrAuto {
|
|||
}
|
||||
|
||||
impl LengthOrPercentageOrAuto {
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-lpcalc
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
|
||||
fn animate_fallback(
|
||||
&self,
|
||||
other: &Self,
|
||||
|
@ -561,7 +561,7 @@ pub enum LengthOrPercentageOrNone {
|
|||
}
|
||||
|
||||
impl LengthOrPercentageOrNone {
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-lpcalc
|
||||
/// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
|
||||
fn animate_fallback(
|
||||
&self,
|
||||
other: &Self,
|
||||
|
|
|
@ -37,7 +37,7 @@ impl SVGPaint {
|
|||
}
|
||||
|
||||
/// A value of <length> | <percentage> | <number> for stroke-dashoffset.
|
||||
/// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
|
||||
/// <https://www.w3.org/TR/SVG11/painting.html#StrokeProperties>
|
||||
pub type SvgLengthOrPercentageOrNumber =
|
||||
generic::SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number>;
|
||||
|
||||
|
@ -52,7 +52,7 @@ impl From<Au> for SVGLength {
|
|||
}
|
||||
|
||||
/// A value of <length> | <percentage> | <number> for stroke-width/stroke-dasharray.
|
||||
/// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
|
||||
/// <https://www.w3.org/TR/SVG11/painting.html#StrokeProperties>
|
||||
pub type NonNegativeSvgLengthOrPercentageOrNumber =
|
||||
generic::SvgLengthOrPercentageOrNumber<NonNegativeLengthOrPercentage, NonNegativeNumber>;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use values::generics::rect::Rect;
|
|||
/// A clipping shape, for `clip-path`.
|
||||
pub type ClippingShape<BasicShape, Url> = ShapeSource<BasicShape, GeometryBox, Url>;
|
||||
|
||||
/// https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box
|
||||
/// <https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box>
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -71,7 +71,7 @@ pub enum BasicShape<H, V, LengthOrPercentage> {
|
|||
Polygon(Polygon<LengthOrPercentage>),
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-shapes/#funcdef-inset
|
||||
/// <https://drafts.csswg.org/css-shapes/#funcdef-inset>
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -81,7 +81,7 @@ pub struct InsetRect<LengthOrPercentage> {
|
|||
pub round: Option<BorderRadius<LengthOrPercentage>>,
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-shapes/#funcdef-circle
|
||||
/// <https://drafts.csswg.org/css-shapes/#funcdef-circle>
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -91,7 +91,7 @@ pub struct Circle<H, V, LengthOrPercentage> {
|
|||
pub radius: ShapeRadius<LengthOrPercentage>,
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-shapes/#funcdef-ellipse
|
||||
/// <https://drafts.csswg.org/css-shapes/#funcdef-ellipse>
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -102,7 +102,7 @@ pub struct Ellipse<H, V, LengthOrPercentage> {
|
|||
pub semiaxis_y: ShapeRadius<LengthOrPercentage>,
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-shapes/#typedef-shape-radius
|
||||
/// <https://drafts.csswg.org/css-shapes/#typedef-shape-radius>
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -121,7 +121,7 @@ pub enum ShapeRadius<LengthOrPercentage> {
|
|||
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||
/// A generic type for representing the `polygon()` function
|
||||
///
|
||||
/// https://drafts.csswg.org/css-shapes/#funcdef-polygon
|
||||
/// <https://drafts.csswg.org/css-shapes/#funcdef-polygon>
|
||||
pub struct Polygon<LengthOrPercentage> {
|
||||
/// The filling rule for a polygon.
|
||||
pub fill: FillRule,
|
||||
|
|
|
@ -63,7 +63,7 @@ impl<L> BorderSpacing<L> {
|
|||
|
||||
/// A generic value for `border-radius`, `outline-radius` and `inset()`.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-backgrounds-3/#border-radius
|
||||
/// <https://drafts.csswg.org/css-backgrounds-3/#border-radius>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug)]
|
||||
|
|
|
@ -16,7 +16,7 @@ use values::specified::grid::parse_line_names;
|
|||
|
||||
/// A `<grid-line>` type.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, Default, PartialEq, ToComputedValue)]
|
||||
|
@ -25,7 +25,7 @@ pub struct GridLine<Integer> {
|
|||
pub is_span: bool,
|
||||
/// A custom identifier for named lines.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#grid-placement-slot
|
||||
/// <https://drafts.csswg.org/css-grid/#grid-placement-slot>
|
||||
pub ident: Option<CustomIdent>,
|
||||
/// Denotes the nth grid line from grid item's placement.
|
||||
pub line_num: Option<Integer>,
|
||||
|
@ -144,7 +144,7 @@ add_impls_for_keyword_enum!(TrackKeyword);
|
|||
/// A track breadth for explicit grid track sizing. It's generic solely to
|
||||
/// avoid re-implementing it for the computed type.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-breadth
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-breadth>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||
|
@ -160,7 +160,7 @@ pub enum TrackBreadth<L> {
|
|||
impl<L> TrackBreadth<L> {
|
||||
/// Check whether this is a `<fixed-breadth>` (i.e., it only has `<length-percentage>`)
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-fixed-breadth
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-fixed-breadth>
|
||||
#[inline]
|
||||
pub fn is_fixed(&self) -> bool {
|
||||
match *self {
|
||||
|
@ -183,7 +183,7 @@ impl<L: ToCss> ToCss for TrackBreadth<L> {
|
|||
/// A `<track-size>` type for explicit grid track sizing. Like `<track-breadth>`, this is
|
||||
/// generic only to avoid code bloat. It only takes `<length-percentage>`
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-size
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
|
@ -193,18 +193,18 @@ pub enum TrackSize<L> {
|
|||
/// A `minmax` function for a range over an inflexible `<track-breadth>`
|
||||
/// and a flexible `<track-breadth>`
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-minmax
|
||||
/// <https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-minmax>
|
||||
Minmax(TrackBreadth<L>, TrackBreadth<L>),
|
||||
/// A `fit-content` function.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content
|
||||
/// <https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content>
|
||||
FitContent(L),
|
||||
}
|
||||
|
||||
impl<L> TrackSize<L> {
|
||||
/// Check whether this is a `<fixed-size>`
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-fixed-size
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-fixed-size>
|
||||
pub fn is_fixed(&self) -> bool {
|
||||
match *self {
|
||||
TrackSize::Breadth(ref breadth) => breadth.is_fixed(),
|
||||
|
@ -347,7 +347,7 @@ where
|
|||
|
||||
/// The initial argument of the `repeat` function.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-repeat
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-repeat>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue, ToCss)]
|
||||
|
@ -477,7 +477,7 @@ pub enum TrackListValue<LengthOrPercentage, Integer> {
|
|||
|
||||
/// The type of a `<track-list>` as determined during parsing.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-list
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -501,7 +501,7 @@ pub enum TrackListType {
|
|||
|
||||
/// A grid `<track-list>` type.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-list
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
|
|
|
@ -30,13 +30,13 @@ pub enum Image<Gradient, MozImageRect, ImageUrl> {
|
|||
/// A `-moz-element(# <element-id>)`
|
||||
Element(Atom),
|
||||
/// A paint worklet image.
|
||||
/// https://drafts.css-houdini.org/css-paint-api/
|
||||
/// <https://drafts.css-houdini.org/css-paint-api/>
|
||||
#[cfg(feature = "servo")]
|
||||
PaintWorklet(PaintWorklet),
|
||||
}
|
||||
|
||||
/// A CSS gradient.
|
||||
/// https://drafts.csswg.org/css-images/#gradients
|
||||
/// <https://drafts.csswg.org/css-images/#gradients>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
||||
|
@ -110,7 +110,7 @@ pub enum Ellipse<LengthOrPercentage> {
|
|||
Extent(ShapeExtent),
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-images/#typedef-extent-keyword
|
||||
/// <https://drafts.csswg.org/css-images/#typedef-extent-keyword>
|
||||
define_css_keyword_enum!(ShapeExtent:
|
||||
"closest-side" => ClosestSide,
|
||||
"farthest-side" => FarthestSide,
|
||||
|
@ -122,7 +122,7 @@ define_css_keyword_enum!(ShapeExtent:
|
|||
add_impls_for_keyword_enum!(ShapeExtent);
|
||||
|
||||
/// A gradient item.
|
||||
/// https://drafts.csswg.org/css-images-4/#color-stop-syntax
|
||||
/// <https://drafts.csswg.org/css-images-4/#color-stop-syntax>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue, ToCss)]
|
||||
|
@ -134,7 +134,7 @@ pub enum GradientItem<Color, LengthOrPercentage> {
|
|||
}
|
||||
|
||||
/// A color stop.
|
||||
/// https://drafts.csswg.org/css-images/#typedef-color-stop-list
|
||||
/// <https://drafts.csswg.org/css-images/#typedef-color-stop-list>
|
||||
#[derive(Clone, Copy, PartialEq, ToComputedValue, ToCss)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -146,7 +146,7 @@ pub struct ColorStop<Color, LengthOrPercentage> {
|
|||
}
|
||||
|
||||
/// Specified values for a paint worklet.
|
||||
/// https://drafts.css-houdini.org/css-paint-api/
|
||||
/// <https://drafts.css-houdini.org/css-paint-api/>
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct PaintWorklet {
|
||||
|
|
|
@ -68,7 +68,7 @@ impl SymbolsType {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-counter-styles/#typedef-counter-style
|
||||
/// <https://drafts.csswg.org/css-counter-styles/#typedef-counter-style>
|
||||
///
|
||||
/// Since wherever <counter-style> is used, 'none' is a valid value as
|
||||
/// well, we combine them into one type to make code simpler.
|
||||
|
@ -159,8 +159,8 @@ impl<T: ToCss> ToCss for FontSettingTag<T> {
|
|||
}
|
||||
|
||||
impl<T: Parse> Parse for FontSettingTag<T> {
|
||||
/// https://www.w3.org/TR/css-fonts-3/#propdef-font-feature-settings
|
||||
/// https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-
|
||||
/// <https://www.w3.org/TR/css-fonts-3/#propdef-font-feature-settings>
|
||||
/// <https://drafts.csswg.org/css-fonts-4/#low-level-font-variation->
|
||||
/// settings-control-the-font-variation-settings-property
|
||||
/// <string> [ on | off | <integer> ]
|
||||
/// <string> <number>
|
||||
|
@ -201,7 +201,7 @@ pub enum FontSettings<T> {
|
|||
}
|
||||
|
||||
impl<T: Parse> Parse for FontSettings<T> {
|
||||
/// https://www.w3.org/TR/css-fonts-3/#propdef-font-feature-settings
|
||||
/// <https://www.w3.org/TR/css-fonts-3/#propdef-font-feature-settings>
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
if input.try(|i| i.expect_ident_matching("normal")).is_ok() {
|
||||
return Ok(FontSettings::Normal);
|
||||
|
|
|
@ -15,7 +15,7 @@ use values::distance::{ComputeSquaredDistance, SquaredDistance};
|
|||
|
||||
/// An SVG paint value
|
||||
///
|
||||
/// https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint
|
||||
/// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Debug, PartialEq)]
|
||||
|
@ -64,7 +64,7 @@ impl<ColorType, UrlPaintServer> SVGPaintKind<ColorType, UrlPaintServer> {
|
|||
|
||||
/// Parse SVGPaint's fallback.
|
||||
/// fallback is keyword(none), Color or empty.
|
||||
/// https://svgwg.org/svg2-draft/painting.html#SpecifyingPaint
|
||||
/// <https://svgwg.org/svg2-draft/painting.html#SpecifyingPaint>
|
||||
fn parse_fallback<'i, 't, ColorType: Parse>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>)
|
||||
-> Option<Either<ColorType, None_>> {
|
||||
|
@ -110,7 +110,7 @@ impl<ColorType: Parse, UrlPaintServer: Parse> Parse for SVGPaint<ColorType, UrlP
|
|||
}
|
||||
|
||||
/// A value of <length> | <percentage> | <number> for svg which allow unitless length.
|
||||
/// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
|
||||
/// <https://www.w3.org/TR/SVG11/painting.html#StrokeProperties>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToAnimatedValue)]
|
||||
|
|
|
@ -39,7 +39,7 @@ pub struct TransformOrigin<H, V, Depth> {
|
|||
|
||||
/// A generic timing function.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-timing-1/#single-timing-function-production
|
||||
/// <https://drafts.csswg.org/css-timing-1/#single-timing-function-production>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
|
|
|
@ -95,7 +95,7 @@ impl<A: Parse, B: Parse> Parse for Either<A, B> {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-values-4/#custom-idents
|
||||
/// <https://drafts.csswg.org/css-values-4/#custom-idents>
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, ToComputedValue)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -126,7 +126,7 @@ impl ToCss for CustomIdent {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-animations/#typedef-keyframes-name
|
||||
/// <https://drafts.csswg.org/css-animations/#typedef-keyframes-name>
|
||||
#[derive(Clone, Debug, ToComputedValue)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -138,7 +138,7 @@ pub enum KeyframesName {
|
|||
}
|
||||
|
||||
impl KeyframesName {
|
||||
/// https://drafts.csswg.org/css-animations/#dom-csskeyframesrule-name
|
||||
/// <https://drafts.csswg.org/css-animations/#dom-csskeyframesrule-name>
|
||||
pub fn from_ident(value: &str) -> Self {
|
||||
let location = SourceLocation { line: 0, column: 0 };
|
||||
let custom_ident = CustomIdent::from_ident(location, &value.into(), &["none"]).ok();
|
||||
|
|
|
@ -111,7 +111,7 @@ const ALIGN_ALL_SHIFT: u32 = structs::NS_STYLE_ALIGN_ALL_SHIFT;
|
|||
|
||||
/// Value of the `align-content` or `justify-content` property.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#content-distribution
|
||||
/// <https://drafts.csswg.org/css-align/#content-distribution>
|
||||
///
|
||||
/// The 16-bit field stores the primary value in its lower 8 bits, and the optional fallback value
|
||||
/// in its upper 8 bits. This matches the representation of these properties in Gecko.
|
||||
|
@ -135,7 +135,7 @@ impl AlignJustifyContent {
|
|||
|
||||
/// Construct a value including a fallback alignment.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#fallback-alignment
|
||||
/// <https://drafts.csswg.org/css-align/#fallback-alignment>
|
||||
#[inline]
|
||||
pub fn with_fallback(flags: AlignFlags, fallback: AlignFlags) -> Self {
|
||||
AlignJustifyContent(flags.bits() as u16 | ((fallback.bits() as u16) << ALIGN_ALL_SHIFT))
|
||||
|
@ -207,7 +207,7 @@ impl Parse for AlignJustifyContent {
|
|||
|
||||
/// Value of the `align-self` or `justify-self` property.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#self-alignment
|
||||
/// <https://drafts.csswg.org/css-align/#self-alignment>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
||||
pub struct AlignJustifySelf(pub AlignFlags);
|
||||
|
@ -245,7 +245,7 @@ impl Parse for AlignJustifySelf {
|
|||
|
||||
/// Value of the `align-items` property
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#self-alignment
|
||||
/// <https://drafts.csswg.org/css-align/#self-alignment>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
||||
pub struct AlignItems(pub AlignFlags);
|
||||
|
@ -283,7 +283,7 @@ impl Parse for AlignItems {
|
|||
|
||||
/// Value of the `justify-items` property
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#justify-items-property
|
||||
/// <https://drafts.csswg.org/css-align/#justify-items-property>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
pub struct JustifyItems(pub AlignFlags);
|
||||
|
|
|
@ -237,7 +237,7 @@ impl Parse for ShapeRadius {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-shapes/#basic-shape-serialization
|
||||
/// <https://drafts.csswg.org/css-shapes/#basic-shape-serialization>
|
||||
///
|
||||
/// Positions get serialized differently with basic shapes. Keywords
|
||||
/// are converted to percentages where possible. Only the two or four
|
||||
|
|
|
@ -84,7 +84,7 @@ pub struct CalcLengthOrPercentage {
|
|||
}
|
||||
|
||||
impl ToCss for CalcLengthOrPercentage {
|
||||
/// https://drafts.csswg.org/css-values/#calc-serialize
|
||||
/// <https://drafts.csswg.org/css-values/#calc-serialize>
|
||||
///
|
||||
/// FIXME(emilio): Should this simplify away zeros?
|
||||
#[allow(unused_assignments)]
|
||||
|
|
|
@ -128,7 +128,7 @@ impl Color {
|
|||
|
||||
/// Parse a color, with quirks.
|
||||
///
|
||||
/// https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk
|
||||
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
|
||||
pub fn parse_quirky<'i, 't>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks)
|
||||
|
@ -145,7 +145,7 @@ impl Color {
|
|||
|
||||
/// Parse a <quirky-color> value.
|
||||
///
|
||||
/// https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk
|
||||
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
|
||||
fn parse_quirky_color<'i, 't>(input: &mut Parser<'i, 't>) -> Result<RGBA, ParseError<'i>> {
|
||||
let location = input.current_source_location();
|
||||
let (value, unit) = match *input.next()? {
|
||||
|
|
|
@ -239,7 +239,7 @@ impl ToComputedValue for KeywordSize {
|
|||
}
|
||||
|
||||
impl FontSize {
|
||||
/// https://html.spec.whatwg.org/multipage/#rules-for-parsing-a-legacy-font-size
|
||||
/// <https://html.spec.whatwg.org/multipage/#rules-for-parsing-a-legacy-font-size>
|
||||
pub fn from_html_size(size: u8) -> Self {
|
||||
FontSize::Keyword(match size {
|
||||
// If value is less than 1, let it be 1.
|
||||
|
|
|
@ -85,7 +85,7 @@ impl ToNsCssValue for PixelOrPercentage {
|
|||
/// Only bare px or percentage values are allowed. Other length units and
|
||||
/// calc() values are not allowed.
|
||||
///
|
||||
/// https://w3c.github.io/IntersectionObserver/#parse-a-root-margin
|
||||
/// <https://w3c.github.io/IntersectionObserver/#parse-a-root-margin>
|
||||
pub struct IntersectionObserverRootMargin(pub Rect<PixelOrPercentage>);
|
||||
|
||||
impl Parse for IntersectionObserverRootMargin {
|
||||
|
|
|
@ -70,7 +70,7 @@ impl Parse for TrackSize<LengthOrPercentage> {
|
|||
|
||||
/// Parse the grid line names into a vector of owned strings.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-line-names
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-line-names>
|
||||
pub fn parse_line_names<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Box<[CustomIdent]>, ParseError<'i>> {
|
||||
input.expect_square_bracket_block()?;
|
||||
input.parse_nested_block(|input| {
|
||||
|
@ -88,7 +88,7 @@ pub fn parse_line_names<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Box<[Custo
|
|||
|
||||
/// The type of `repeat` function (only used in parsing).
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-repeat
|
||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-repeat>
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
enum RepeatType {
|
||||
|
|
|
@ -37,11 +37,11 @@ use values::specified::url::SpecifiedUrl;
|
|||
pub type ImageLayer = Either<None_, Image>;
|
||||
|
||||
/// Specified values for an image according to CSS-IMAGES.
|
||||
/// https://drafts.csswg.org/css-images/#image-values
|
||||
/// <https://drafts.csswg.org/css-images/#image-values>
|
||||
pub type Image = GenericImage<Gradient, MozImageRect, SpecifiedUrl>;
|
||||
|
||||
/// Specified values for a CSS gradient.
|
||||
/// https://drafts.csswg.org/css-images/#gradients
|
||||
/// <https://drafts.csswg.org/css-images/#gradients>
|
||||
#[cfg(not(feature = "gecko"))]
|
||||
pub type Gradient = GenericGradient<
|
||||
LineDirection,
|
||||
|
@ -53,7 +53,7 @@ pub type Gradient = GenericGradient<
|
|||
>;
|
||||
|
||||
/// Specified values for a CSS gradient.
|
||||
/// https://drafts.csswg.org/css-images/#gradients
|
||||
/// <https://drafts.csswg.org/css-images/#gradients>
|
||||
#[cfg(feature = "gecko")]
|
||||
pub type Gradient = GenericGradient<
|
||||
LineDirection,
|
||||
|
|
|
@ -213,15 +213,15 @@ impl FontRelativeLength {
|
|||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// A viewport-relative length.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#viewport-relative-lengths
|
||||
/// <https://drafts.csswg.org/css-values/#viewport-relative-lengths>
|
||||
pub enum ViewportPercentageLength {
|
||||
/// A vw unit: https://drafts.csswg.org/css-values/#vw
|
||||
Vw(CSSFloat),
|
||||
/// A vh unit: https://drafts.csswg.org/css-values/#vh
|
||||
Vh(CSSFloat),
|
||||
/// https://drafts.csswg.org/css-values/#vmin
|
||||
/// <https://drafts.csswg.org/css-values/#vmin>
|
||||
Vmin(CSSFloat),
|
||||
/// https://drafts.csswg.org/css-values/#vmax
|
||||
/// <https://drafts.csswg.org/css-values/#vmax>
|
||||
Vmax(CSSFloat)
|
||||
}
|
||||
|
||||
|
@ -440,24 +440,24 @@ impl Mul<CSSFloat> for PhysicalLength {
|
|||
|
||||
/// A `<length>` without taking `calc` expressions into account
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#lengths
|
||||
/// <https://drafts.csswg.org/css-values/#lengths>
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum NoCalcLength {
|
||||
/// An absolute length
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#absolute-length
|
||||
/// <https://drafts.csswg.org/css-values/#absolute-length>
|
||||
Absolute(AbsoluteLength),
|
||||
|
||||
/// A font-relative length:
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#font-relative-lengths
|
||||
/// <https://drafts.csswg.org/css-values/#font-relative-lengths>
|
||||
FontRelative(FontRelativeLength),
|
||||
|
||||
/// A viewport-relative length.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#viewport-relative-lengths
|
||||
/// <https://drafts.csswg.org/css-values/#viewport-relative-lengths>
|
||||
ViewportPercentage(ViewportPercentageLength),
|
||||
|
||||
/// HTML5 "character width", as defined in HTML5 § 14.5.4.
|
||||
|
@ -581,7 +581,7 @@ impl NoCalcLength {
|
|||
/// An extension to `NoCalcLength` to parse `calc` expressions.
|
||||
/// This is commonly used for the `<length>` values.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#lengths
|
||||
/// <https://drafts.csswg.org/css-values/#lengths>
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
|
@ -590,7 +590,7 @@ pub enum Length {
|
|||
NoCalc(NoCalcLength),
|
||||
/// A calc expression.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#calc-notation
|
||||
/// <https://drafts.csswg.org/css-values/#calc-notation>
|
||||
Calc(Box<CalcLengthOrPercentage>),
|
||||
}
|
||||
|
||||
|
@ -908,7 +908,7 @@ impl LengthOrPercentage {
|
|||
|
||||
/// Parse a length, treating dimensionless numbers as pixels
|
||||
///
|
||||
/// https://www.w3.org/TR/SVG2/types.html#presentation-attribute-css-value
|
||||
/// <https://www.w3.org/TR/SVG2/types.html#presentation-attribute-css-value>
|
||||
pub fn parse_numbers_are_pixels<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<LengthOrPercentage, ParseError<'i>> {
|
||||
if let Ok(lop) = input.try(|i| Self::parse(context, i)) {
|
||||
|
@ -959,7 +959,7 @@ impl Parse for LengthOrPercentage {
|
|||
|
||||
impl LengthOrPercentage {
|
||||
/// Parses a length or a percentage, allowing the unitless length quirk.
|
||||
/// https://quirks.spec.whatwg.org/#the-unitless-length-quirk
|
||||
/// <https://quirks.spec.whatwg.org/#the-unitless-length-quirk>
|
||||
#[inline]
|
||||
pub fn parse_quirky<'i, 't>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
|
@ -1191,7 +1191,7 @@ impl NonNegativeLengthOrPercentage {
|
|||
}
|
||||
|
||||
/// Parses a length or a percentage, allowing the unitless length quirk.
|
||||
/// https://quirks.spec.whatwg.org/#the-unitless-length-quirk
|
||||
/// <https://quirks.spec.whatwg.org/#the-unitless-length-quirk>
|
||||
#[inline]
|
||||
pub fn parse_quirky<'i, 't>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
|
|
|
@ -365,7 +365,7 @@ impl ToComputedValue for Opacity {
|
|||
|
||||
/// An specified `<integer>`, optionally coming from a `calc()` expression.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#integers
|
||||
/// <https://drafts.csswg.org/css-values/#integers>
|
||||
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
|
|
@ -43,7 +43,7 @@ fn parse_context_value<'i, 't, T>(input: &mut Parser<'i, 't>, value: T)
|
|||
}
|
||||
|
||||
/// A value of <length> | <percentage> | <number> for stroke-dashoffset.
|
||||
/// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
|
||||
/// <https://www.w3.org/TR/SVG11/painting.html#StrokeProperties>
|
||||
pub type SvgLengthOrPercentageOrNumber =
|
||||
generic::SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number>;
|
||||
|
||||
|
@ -66,7 +66,7 @@ impl From<SvgLengthOrPercentageOrNumber> for SVGLength {
|
|||
}
|
||||
|
||||
/// A value of <length> | <percentage> | <number> for stroke-width/stroke-dasharray.
|
||||
/// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
|
||||
/// <https://www.w3.org/TR/SVG11/painting.html#StrokeProperties>
|
||||
pub type NonNegativeSvgLengthOrPercentageOrNumber =
|
||||
generic::SvgLengthOrPercentageOrNumber<NonNegativeLengthOrPercentage, NonNegativeNumber>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue