rustdoc: Fix many rustdoc errors (#31147)

This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
This commit is contained in:
Martin Robinson 2024-01-22 14:13:48 +01:00 committed by GitHub
parent d7de206dbd
commit 5c1723c983
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
185 changed files with 939 additions and 942 deletions

View file

@ -4,7 +4,7 @@
//! Float layout.
//!
//! See CSS 2.1 § 9.5.1: https://www.w3.org/TR/CSS2/visuren.html#float-position
//! See CSS 2.1 § 9.5.1: <https://www.w3.org/TR/CSS2/visuren.html#float-position>
use std::collections::VecDeque;
use std::fmt::{Debug, Formatter, Result as FmtResult};
@ -506,7 +506,7 @@ pub struct PlacementInfo {
/// Whether the float is left or right.
///
/// See CSS 2.1 § 9.5.1: https://www.w3.org/TR/CSS2/visuren.html#float-position
/// See CSS 2.1 § 9.5.1: <https://www.w3.org/TR/CSS2/visuren.html#float-position>
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FloatSide {
Left,
@ -600,8 +600,8 @@ impl FloatBand {
///
/// AA trees were chosen for simplicity.
///
/// See: https://en.wikipedia.org/wiki/AA_tree
/// https://arxiv.org/pdf/1412.4882.pdf
/// See: <https://en.wikipedia.org/wiki/AA_tree>
/// <https://arxiv.org/pdf/1412.4882.pdf>
#[derive(Clone, Debug)]
pub struct FloatBandTree {
pub root: FloatBandLink,
@ -787,12 +787,13 @@ impl FloatBandLink {
}
/// Corrects tree balance:
///
///```text
/// T L
/// / \ / \
/// L R → A T if level(T) = level(L)
/// / \ / \
/// A B B R
/// ```
fn skew(&self) -> FloatBandLink {
if let Some(ref this) = self.0 {
if let Some(ref left) = this.left.0 {
@ -816,12 +817,13 @@ impl FloatBandLink {
}
/// Corrects tree balance:
///
///```text
/// T R
/// / \ / \
/// A R → T X if level(T) = level(X)
/// / \ / \
/// B X A B
/// ```
fn split(&self) -> FloatBandLink {
if let Some(ref this) = self.0 {
if let Some(ref right) = this.right.0 {

View file

@ -93,7 +93,7 @@ pub(crate) struct InlineBox {
pub children: Vec<ArcRefCell<InlineLevelBox>>,
}
/// https://www.w3.org/TR/css-display-3/#css-text-run
/// <https://www.w3.org/TR/css-display-3/#css-text-run>
#[derive(Debug, Serialize)]
pub(crate) struct TextRun {
pub base_fragment_info: BaseFragmentInfo,
@ -296,7 +296,7 @@ impl LineBlockSizes {
.adjust_for_nested_baseline_offset(baseline_offset);
}
/// From https://drafts.csswg.org/css2/visudet.html#line-height:
/// From <https://drafts.csswg.org/css2/visudet.html#line-height>:
/// > The inline-level boxes are aligned vertically according to their 'vertical-align'
/// > property. In case they are aligned 'top' or 'bottom', they must be aligned so as
/// > to minimize the line box height. If such boxes are tall enough, there are multiple
@ -475,7 +475,7 @@ struct InlineContainerState {
has_content: bool,
/// Indicates whether this nesting level have text decorations in effect.
/// From https://drafts.csswg.org/css-text-decor/#line-decoration
/// From <https://drafts.csswg.org/css-text-decor/#line-decoration>
// "When specified on or propagated to a block container that establishes
// an IFC..."
text_decoration_line: TextDecorationLine,
@ -483,7 +483,7 @@ struct InlineContainerState {
/// The block size contribution of this container's default font ie the size of the
/// "strut." Whether this is integrated into the [`Self::nested_strut_block_sizes`]
/// depends on the line-height quirk described in
/// https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk.
/// <https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk>.
strut_block_sizes: LineBlockSizes,
/// The strut block size of this inline container maxed with the strut block
@ -527,7 +527,7 @@ struct InlineFormattingContextState<'a, 'b> {
/// The [`InlineContainerState`] for the container formed by the root of the
/// [`InlineFormattingContext`]. This is effectively the "root inline box" described
/// by https://drafts.csswg.org/css-inline/#model:
/// by <https://drafts.csswg.org/css-inline/#model>:
///
/// > The block container also generates a root inline box, which is an anonymous
/// > inline box that holds all of its inline-level contents. (Thus, all text in an
@ -546,10 +546,10 @@ struct InlineFormattingContextState<'a, 'b> {
/// are currently laid out at the top-level of each [`InlineFormattingContext`].
fragments: Vec<Fragment>,
/// Information about the line currently being laid out into [`LineItems`]s.
/// Information about the line currently being laid out into [`LineItem`]s.
current_line: LineUnderConstruction,
/// Information about the unbreakable line segment currently being laid out into [`LineItems`]s.
/// Information about the unbreakable line segment currently being laid out into [`LineItem`]s.
current_line_segment: UnbreakableSegmentUnderConstruction,
/// The line breaking state for this inline formatting context.
@ -2183,7 +2183,7 @@ fn font_metrics_from_style(layout_context: &LayoutContext, style: &ComputedValue
/// comes before or after an atomic inline element.
///
/// From https://www.w3.org/TR/css-text-3/#line-break-details:
/// From <https://www.w3.org/TR/css-text-3/#line-break-details>:
///
/// > For Web-compatibility there is a soft wrap opportunity before and after each
/// > replaced element or other atomic inline, even when adjacent to a character that
@ -2213,7 +2213,7 @@ fn is_baseline_relative(vertical_align: GenericVerticalAlign<LengthPercentage>)
/// all inline containers get struts. In quirks mode this isn't always the case
/// though.
///
/// From https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk
/// From <https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk>
///
/// > ### § 3.3. The line height calculation quirk
/// > In quirks mode and limited-quirks mode, an inline box that matches the following

View file

@ -622,8 +622,8 @@ impl BlockLevelBox {
/// Lay out a normal flow non-replaced block that does not establish a new formatting
/// context.
///
/// - https://drafts.csswg.org/css2/visudet.html#blockwidth
/// - https://drafts.csswg.org/css2/visudet.html#normal-block
/// - <https://drafts.csswg.org/css2/visudet.html#blockwidth>
/// - <https://drafts.csswg.org/css2/visudet.html#normal-block>
fn layout_in_flow_non_replaced_block_level_same_formatting_context(
layout_context: &LayoutContext,
positioning_context: &mut PositioningContext,
@ -826,8 +826,8 @@ impl NonReplacedFormattingContext {
/// Lay out a normal in flow non-replaced block that establishes an independent
/// formatting context in its containing formatting context.
///
/// - https://drafts.csswg.org/css2/visudet.html#blockwidth
/// - https://drafts.csswg.org/css2/visudet.html#normal-block
/// - <https://drafts.csswg.org/css2/visudet.html#blockwidth>
/// - <https://drafts.csswg.org/css2/visudet.html#normal-block>
fn layout_in_flow_block_level(
&self,
layout_context: &LayoutContext,
@ -1119,9 +1119,9 @@ impl NonReplacedFormattingContext {
}
}
/// https://drafts.csswg.org/css2/visudet.html#block-replaced-width
/// https://drafts.csswg.org/css2/visudet.html#inline-replaced-width
/// https://drafts.csswg.org/css2/visudet.html#inline-replaced-height
/// <https://drafts.csswg.org/css2/visudet.html#block-replaced-width>
/// <https://drafts.csswg.org/css2/visudet.html#inline-replaced-width>
/// <https://drafts.csswg.org/css2/visudet.html#inline-replaced-height>
fn layout_in_flow_replaced_block_level<'a>(
containing_block: &ContainingBlock,
base_fragment_info: BaseFragmentInfo,

View file

@ -34,7 +34,7 @@ pub struct BoxTree {
/// There may be zero if that element has `display: none`.
root: BlockFormattingContext,
/// https://drafts.csswg.org/css-backgrounds/#special-backgrounds
/// <https://drafts.csswg.org/css-backgrounds/#special-backgrounds>
canvas_background: CanvasBackground,
}
@ -338,7 +338,7 @@ impl BoxTree {
}
}
/// https://drafts.csswg.org/css-backgrounds/#root-background
/// <https://drafts.csswg.org/css-backgrounds/#root-background>
#[derive(Clone, Serialize)]
pub struct CanvasBackground {
/// DOM node for the root element
@ -346,7 +346,7 @@ pub struct CanvasBackground {
/// The element whose style the canvas takes background properties from (see next field).
/// This can be the root element (same as the previous field), or the HTML `<body>` element.
/// See https://drafts.csswg.org/css-backgrounds/#body-background
/// See <https://drafts.csswg.org/css-backgrounds/#body-background>
pub from_element: OpaqueNode,
/// The computed styles to take background properties from.