Skip to content

Commit

Permalink
servo: Merge #18924 - Fix commonmark Markdown warnings in docs, part …
Browse files Browse the repository at this point in the history
…1 (from mbrubeck:doc); r=Manishearth

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.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they are doc formatting changes only

Source-Repo: https://github.com/servo/servo
Source-Revision: 0e62a5829b7c29ae2667a21a439aff1e89201bf3

UltraBlame original commit: 27bc43d5d11ced40c6014d9055825993935d185e
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent fcdd242 commit d0c4ef5
Show file tree
Hide file tree
Showing 21 changed files with 232 additions and 225 deletions.
1 change: 1 addition & 0 deletions servo/components/config/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub struct Opts {




pub time_profiling: Option<OutputOptions>,


Expand Down
2 changes: 2 additions & 0 deletions servo/components/net_traits/blob_url_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub struct BlobBuf {




pub fn parse_blob_url(url: &ServoUrl) -> Result<(Uuid, FileOrigin), ()> {
let url_inner = Url::parse(url.path()).map_err(|_| ())?;
let id = {
Expand All @@ -50,6 +51,7 @@ pub fn parse_blob_url(url: &ServoUrl) -> Result<(Uuid, FileOrigin), ()> {




pub fn get_blob_origin(url: &ServoUrl) -> FileOrigin {
if url.scheme() == "file" {

Expand Down
1 change: 1 addition & 0 deletions servo/components/script/document_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@




use dom::bindings::root::Dom;
use dom::document::Document;
use ipc_channel::ipc::IpcSender;
Expand Down
2 changes: 1 addition & 1 deletion servo/components/script/dom/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ impl Document {
/// Per-process shared lock for author-origin stylesheets
///
/// FIXME: make it per-document or per-pipeline instead:
/// https://github.com/servo/servo/issues/16027
/// <https://github.com/servo/servo/issues/16027>
/// (Need to figure out what to do with the style attribute
/// of elements adopted into another document.)
static ref PER_PROCESS_AUTHOR_SHARED_LOCK: StyleSharedRwLock = {
Expand Down
14 changes: 7 additions & 7 deletions servo/components/script/dom/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,7 @@ impl ElementMethods for Element {
self.upcast::<Node>().client_rect().size.height
}

/// https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML
/// <https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML>
fn GetInnerHTML(&self) -> Fallible<DOMString> {
let qname = QualName::new(self.prefix().clone(),
self.namespace().clone(),
Expand All @@ -2075,7 +2075,7 @@ impl ElementMethods for Element {
}
}

/// https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML
/// <https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML>
fn SetInnerHTML(&self, value: DOMString) -> ErrorResult {
// Step 1.
let frag = self.parse_fragment(value)?;
Expand Down Expand Up @@ -2779,7 +2779,7 @@ impl Element {

/// Please call this method *only* for real click events
///
/// https://html.spec.whatwg.org/multipage/#run-authentic-click-activation-steps
/// <https://html.spec.whatwg.org/multipage/#run-authentic-click-activation-steps>
///
/// Use an element's synthetic click activation (or handle_event) for any script-triggered clicks.
/// If the spec says otherwise, check with Manishearth first
Expand Down Expand Up @@ -2859,7 +2859,7 @@ impl Element {
self.state.get().contains(IN_ACTIVE_STATE)
}

/// https://html.spec.whatwg.org/multipage/#concept-selector-active
/// <https://html.spec.whatwg.org/multipage/#concept-selector-active>
pub fn set_active_state(&self, value: bool) {
self.set_state(IN_ACTIVE_STATE, value);

Expand Down Expand Up @@ -2936,7 +2936,7 @@ impl Element {
self.set_state(IN_FULLSCREEN_STATE, value)
}

/// https://dom.spec.whatwg.org/#connected
/// <https://dom.spec.whatwg.org/#connected>
pub fn is_connected(&self) -> bool {
let node = self.upcast::<Node>();
let root = node.GetRootNode();
Expand Down Expand Up @@ -2998,11 +2998,11 @@ impl Element {
#[derive(Clone, Copy)]
pub enum AttributeMutation<'a> {
/// The attribute is set, keep track of old value.
/// https://dom.spec.whatwg.org/#attribute-is-set
/// <https://dom.spec.whatwg.org/#attribute-is-set>
Set(Option<&'a AttrValue>),

/// The attribute is removed.
/// https://dom.spec.whatwg.org/#attribute-is-removed
/// <https://dom.spec.whatwg.org/#attribute-is-removed>
Removed,
}

Expand Down
4 changes: 2 additions & 2 deletions servo/components/script/dom/htmlanchorelement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,12 @@ impl Activatable for HTMLAnchorElement {
}
}

/// https://html.spec.whatwg.org/multipage/#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name
/// <https://html.spec.whatwg.org/multipage/#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name>
fn is_current_browsing_context(target: DOMString) -> bool {
target.is_empty() || target == "_self"
}

/// https://html.spec.whatwg.org/multipage/#following-hyperlinks-2
/// <https://html.spec.whatwg.org/multipage/#following-hyperlinks-2>
pub fn follow_hyperlink(subject: &Element, hyperlink_suffix: Option<String>, referrer_policy: Option<ReferrerPolicy>) {
// Step 1: replace.
// Step 2: source browsing context.
Expand Down
2 changes: 1 addition & 1 deletion servo/components/script/dom/htmlinputelement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ impl HTMLInputElement {
}
}

/// https://html.spec.whatwg.org/multipage/#constructing-the-form-data-set
/// <https://html.spec.whatwg.org/multipage/#constructing-the-form-data-set>
/// Steps range from 3.1 to 3.7 (specific to HTMLInputElement)
pub fn form_datums(&self, submitter: Option<FormSubmitter>) -> Vec<FormDatum> {
// 3.1: disabled state check is in get_unclean_dataset
Expand Down
2 changes: 1 addition & 1 deletion servo/components/script/dom/htmllinkelement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl VirtualMethods for HTMLLinkElement {


impl HTMLLinkElement {
/// https://html.spec.whatwg.org/multipage/#concept-link-obtain
/// <https://html.spec.whatwg.org/multipage/#concept-link-obtain>
fn handle_stylesheet_url(&self, href: &str) {
let document = document_from_node(self);
if document.browsing_context().is_none() {
Expand Down
2 changes: 2 additions & 0 deletions servo/components/script_traits/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ pub enum DiscardBrowsingContext {




#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
pub enum DocumentActivity {

Expand Down Expand Up @@ -870,6 +871,7 @@ impl fmt::Debug for Painter {




#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
pub struct DrawAPaintImageResult {

Expand Down
2 changes: 1 addition & 1 deletion servo/components/selectors/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ macro_rules! with_all_bounds {
///
/// NB: We need Clone so that we can derive(Clone) on struct with that
/// are parameterized on SelectorImpl. See
/// https://github.com/rust-lang/rust/issues/26925
/// <https://github.com/rust-lang/rust/issues/26925>
pub trait SelectorImpl: Clone + Sized + 'static {
type AttrValue: $($InSelector)*;
type Identifier: $($InSelector)* + PrecomputedHash;
Expand Down
1 change: 1 addition & 0 deletions servo/components/servo_arc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@






#![allow(missing_docs)]
Expand Down
20 changes: 10 additions & 10 deletions servo/components/style/counter_style/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,49 +229,49 @@ macro_rules! counter_style_descriptors {
}

counter_style_descriptors! {
/// https://drafts.csswg.org/css-counter-styles/#counter-style-system
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-system>
"system" system / eCSSCounterDesc_System: System = {
System::Symbolic
}

/// https://drafts.csswg.org/css-counter-styles/#counter-style-negative
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-negative>
"negative" negative / eCSSCounterDesc_Negative: Negative = {
Negative(Symbol::String("-".to_owned()), None)
}

/// https://drafts.csswg.org/css-counter-styles/#counter-style-prefix
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-prefix>
"prefix" prefix / eCSSCounterDesc_Prefix: Symbol = {
Symbol::String("".to_owned())
}

/// https://drafts.csswg.org/css-counter-styles/#counter-style-suffix
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-suffix>
"suffix" suffix / eCSSCounterDesc_Suffix: Symbol = {
Symbol::String(". ".to_owned())
}

/// https://drafts.csswg.org/css-counter-styles/#counter-style-range
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-range>
"range" range / eCSSCounterDesc_Range: Ranges = {
Ranges(Vec::new()) // Empty Vec represents 'auto'
}

/// https://drafts.csswg.org/css-counter-styles/#counter-style-pad
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-pad>
"pad" pad / eCSSCounterDesc_Pad: Pad = {
Pad(0, Symbol::String("".to_owned()))
}

/// https://drafts.csswg.org/css-counter-styles/#counter-style-fallback
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-fallback>
"fallback" fallback / eCSSCounterDesc_Fallback: Fallback = {
// FIXME https://bugzilla.mozilla.org/show_bug.cgi?id=1359323 use atom!()
Fallback(CustomIdent(Atom::from("decimal")))
}

/// https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols
/// <https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols>
"symbols" symbols / eCSSCounterDesc_Symbols: Symbols = !

/// https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-additive-symbols
/// <https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-additive-symbols>
"additive-symbols" additive_symbols / eCSSCounterDesc_AdditiveSymbols: AdditiveSymbols = !

/// https://drafts.csswg.org/css-counter-styles/#counter-style-speak-as
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-speak-as>
"speak-as" speak_as / eCSSCounterDesc_SpeakAs: SpeakAs = {
SpeakAs::Auto
}
Expand Down
48 changes: 24 additions & 24 deletions servo/components/style/element_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ bitflags! {
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub flags ElementState: u64 {
/// The mouse is down on this element.
/// https://html.spec.whatwg.org/multipage/#selector-active
/// <https://html.spec.whatwg.org/multipage/#selector-active>
/// FIXME(#7333): set/unset this when appropriate
const IN_ACTIVE_STATE = 1 << 0,
/// This element has focus.
/// https://html.spec.whatwg.org/multipage/#selector-focus
/// <https://html.spec.whatwg.org/multipage/#selector-focus>
const IN_FOCUS_STATE = 1 << 1,
/// The mouse is hovering over this element.
/// https://html.spec.whatwg.org/multipage/#selector-hover
/// <https://html.spec.whatwg.org/multipage/#selector-hover>
const IN_HOVER_STATE = 1 << 2,
/// Content is enabled (and can be disabled).
/// http://www.whatwg.org/html/#selector-enabled
/// <http://www.whatwg.org/html/#selector-enabled>
const IN_ENABLED_STATE = 1 << 3,
/// Content is disabled.
/// http://www.whatwg.org/html/#selector-disabled
/// <http://www.whatwg.org/html/#selector-disabled>
const IN_DISABLED_STATE = 1 << 4,
/// Content is checked.
/// https://html.spec.whatwg.org/multipage/#selector-checked
/// <https://html.spec.whatwg.org/multipage/#selector-checked>
const IN_CHECKED_STATE = 1 << 5,
/// https://html.spec.whatwg.org/multipage/#selector-indeterminate
/// <https://html.spec.whatwg.org/multipage/#selector-indeterminate>
const IN_INDETERMINATE_STATE = 1 << 6,
/// https://html.spec.whatwg.org/multipage/#selector-placeholder-shown
/// <https://html.spec.whatwg.org/multipage/#selector-placeholder-shown>
const IN_PLACEHOLDER_SHOWN_STATE = 1 << 7,
/// https://html.spec.whatwg.org/multipage/#selector-target
/// <https://html.spec.whatwg.org/multipage/#selector-target>
const IN_TARGET_STATE = 1 << 8,
/// https://fullscreen.spec.whatwg.org/#%3Afullscreen-pseudo-class
/// <https://fullscreen.spec.whatwg.org/#%3Afullscreen-pseudo-class>
const IN_FULLSCREEN_STATE = 1 << 9,
/// https://html.spec.whatwg.org/multipage/#selector-valid
/// <https://html.spec.whatwg.org/multipage/#selector-valid>
const IN_VALID_STATE = 1 << 10,
/// https://html.spec.whatwg.org/multipage/#selector-invalid
/// <https://html.spec.whatwg.org/multipage/#selector-invalid>
const IN_INVALID_STATE = 1 << 11,
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-valid
const IN_MOZ_UI_VALID_STATE = 1 << 12,
Expand All @@ -66,31 +66,31 @@ bitflags! {
const IN_HANDLER_DISABLED_STATE = 1 << 19,
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-handler-crashed
const IN_HANDLER_CRASHED_STATE = 1 << 20,
/// https://html.spec.whatwg.org/multipage/#selector-required
/// <https://html.spec.whatwg.org/multipage/#selector-required>
const IN_REQUIRED_STATE = 1 << 21,
/// https://html.spec.whatwg.org/multipage/#selector-optional
/// <https://html.spec.whatwg.org/multipage/#selector-optional>
const IN_OPTIONAL_STATE = 1 << 22,
/// https://html.spec.whatwg.org/multipage/#selector-read-write
/// <https://html.spec.whatwg.org/multipage/#selector-read-write>
const IN_READ_WRITE_STATE = 1 << 22,
/// Non-standard: Older custom-elements spec.
const IN_UNRESOLVED_STATE = 1 << 23,
/// https://html.spec.whatwg.org/multipage/#selector-visited
/// <https://html.spec.whatwg.org/multipage/#selector-visited>
const IN_VISITED_STATE = 1 << 24,
/// https://html.spec.whatwg.org/multipage/#selector-link
/// <https://html.spec.whatwg.org/multipage/#selector-link>
const IN_UNVISITED_STATE = 1 << 25,
/// https://drafts.csswg.org/selectors-4/#the-any-link-pseudo
/// <https://drafts.csswg.org/selectors-4/#the-any-link-pseudo>
const IN_VISITED_OR_UNVISITED_STATE = IN_VISITED_STATE.bits | IN_UNVISITED_STATE.bits,
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-drag-over
const IN_DRAGOVER_STATE = 1 << 26,
/// https://html.spec.whatwg.org/multipage/#selector-in-range
/// <https://html.spec.whatwg.org/multipage/#selector-in-range>
const IN_INRANGE_STATE = 1 << 27,
/// https://html.spec.whatwg.org/multipage/#selector-out-of-range
/// <https://html.spec.whatwg.org/multipage/#selector-out-of-range>
const IN_OUTOFRANGE_STATE = 1 << 28,
/// https://html.spec.whatwg.org/multipage/#selector-read-only
/// <https://html.spec.whatwg.org/multipage/#selector-read-only>
const IN_MOZ_READONLY_STATE = 1 << 29,
/// https://html.spec.whatwg.org/multipage/#selector-read-write
/// <https://html.spec.whatwg.org/multipage/#selector-read-write>
const IN_MOZ_READWRITE_STATE = 1 << 30,
/// https://html.spec.whatwg.org/multipage/#selector-default
/// <https://html.spec.whatwg.org/multipage/#selector-default>
const IN_DEFAULT_STATE = 1 << 31,
/// Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-submit-invalid
const IN_MOZ_SUBMITINVALID_STATE = 1 << 32,
Expand All @@ -114,7 +114,7 @@ bitflags! {
const IN_HANDLER_VULNERABLE_UPDATABLE_STATE = 1 << 41,
/// Non-standard & undocumented.
const IN_HANDLER_VULNERABLE_NO_UPDATE_STATE = 1 << 42,
/// https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo
/// <https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo>
const IN_FOCUS_WITHIN_STATE = 1 << 43,
/// :dir matching; the states are used for dynamic change detection.
/// State that elements that match :dir(ltr) are in.
Expand Down
2 changes: 1 addition & 1 deletion servo/components/style/font_face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ macro_rules! font_face_descriptors_common {
) => {
/// Data inside a `@font-face` rule.
///
/// https://drafts.csswg.org/css-fonts/#font-face-rule
/// <https://drafts.csswg.org/css-fonts/#font-face-rule>
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FontFaceRuleData {
$(
Expand Down
Loading

0 comments on commit d0c4ef5

Please sign in to comment.