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:
Matt Brubeck 2017-10-17 09:39:20 -07:00
parent aa3122e7d1
commit efc3683cc7
137 changed files with 572 additions and 565 deletions

View file

@ -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);

View file

@ -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

View file

@ -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)]

View file

@ -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()? {

View file

@ -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.

View file

@ -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 {

View file

@ -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 {

View file

@ -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,

View file

@ -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>,

View file

@ -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))]

View file

@ -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>;