diff options
author | Brian J. Burg <burg@cs.washington.edu> | 2012-09-29 12:11:55 -0700 |
---|---|---|
committer | Brian J. Burg <burg@cs.washington.edu> | 2012-09-29 12:11:55 -0700 |
commit | 9ed67b31df9da0102e5bcad128a90b342216d617 (patch) | |
tree | 7f15539a79af521b2a227101d611cf1588badef7 | |
parent | 5774950edefa18cdc7b1651b472ca65ecc43cc6f (diff) | |
download | servo-9ed67b31df9da0102e5bcad128a90b342216d617.tar.gz servo-9ed67b31df9da0102e5bcad128a90b342216d617.zip |
Remove remaining #doc attr comments
-rw-r--r-- | src/servo/css/parser.rs | 4 | ||||
-rw-r--r-- | src/servo/css/resolve/matching.rs | 45 | ||||
-rw-r--r-- | src/servo/layout/text.rs | 4 | ||||
-rw-r--r-- | src/servo/text/glyph.rs | 6 | ||||
-rw-r--r-- | src/servo/util/color.rs | 20 |
5 files changed, 47 insertions, 32 deletions
diff --git a/src/servo/css/parser.rs b/src/servo/css/parser.rs index a0fa5021692..b1cad6a7ed8 100644 --- a/src/servo/css/parser.rs +++ b/src/servo/css/parser.rs @@ -1,4 +1,6 @@ -#[doc="Constructs a list of css style rules from a token stream"] +/** +Constructs a list of css style rules from a token stream +*/ // TODO: fail according to the css spec instead of failing when things // are not as expected diff --git a/src/servo/css/resolve/matching.rs b/src/servo/css/resolve/matching.rs index 86c85086c49..dcf9a9346c5 100644 --- a/src/servo/css/resolve/matching.rs +++ b/src/servo/css/resolve/matching.rs @@ -1,4 +1,6 @@ -#[doc="Performs CSS selector matching."] +/** + Performs CSS selector matching. +*/ use dom::node::{LayoutData, Node, Text}; use dom::element::ElementData; @@ -6,7 +8,9 @@ use dom::element::ElementData; use values::*; use styles::{SpecifiedStyle}; -#[doc="Check if a CSS attribute matches the attribute of an HTML element."] +/** + Check if a CSS attribute matches the attribute of an HTML element. +*/ fn attrs_match(attr: Attr, elmt: ElementData) -> bool { match attr { Exists(name) => { @@ -55,11 +59,13 @@ trait PrivMatchingMethods { fn matches_selector(sel : ~Selector) -> bool; } -impl Node : PrivMatchingMethods { - #[doc=" - Checks if the given CSS selector, which must describe a single element with no relational - information, describes the given HTML element. - "] +impl Node : PrivMatchingMethods { + + /** + Checks if the given CSS selector, which must describe a single + element with no relational information, describes the given HTML + element. + */ fn matches_element(sel: ~Selector) -> bool { match *sel { Child(_, _) | Descendant(_, _) | Sibling(_, _) => { return false; } @@ -87,7 +93,9 @@ impl Node : PrivMatchingMethods { //unsupported. } - #[doc = "Checks if a generic CSS selector matches a given HTML element"] + /** + Checks if a generic CSS selector matches a given HTML element + */ fn matches_selector(sel : ~Selector) -> bool { match *sel { Element(*) => { return self.matches_element(sel); } @@ -162,7 +170,9 @@ trait PrivStyleMethods { } impl Node : PrivStyleMethods { - #[doc="Update the computed style of an HTML element with a style specified by CSS."] + /** + Update the computed style of an HTML element with a style specified by CSS. + */ fn update_style(decl : StyleDeclaration) { self.aux(|layout| { match decl { @@ -182,13 +192,16 @@ trait MatchingMethods { } impl Node : MatchingMethods { - #[doc="Compare an html element to a list of css rules and update its - style according to the rules matching it."] + /** + Compare an html element to a list of css rules and update its + style according to the rules matching it. + */ fn match_css_style(styles : Stylesheet) { - // Loop over each rule, see if our node matches what is described in the rule. If it - // matches, update its style. As we don't currently have priorities of style information, - // the latest rule takes precedence over the others. So we just overwrite style - // information as we go. + // Loop over each rule, see if our node matches what is + // described in the rule. If it matches, update its style. As + // we don't currently have priorities of style information, + // the latest rule takes precedence over the others. So we + // just overwrite style information as we go. for styles.each |sty| { let (selectors, decls) = copy **sty; @@ -201,7 +214,7 @@ impl Node : MatchingMethods { } } - self.aux(|a| #debug["Changed the style to: %?", copy *a.style]); + self.aux(|a| debug!("Changed the style to: %?", copy *a.style)); } } diff --git a/src/servo/layout/text.rs b/src/servo/layout/text.rs index e5ed486b895..d9abc3e7531 100644 --- a/src/servo/layout/text.rs +++ b/src/servo/layout/text.rs @@ -1,4 +1,4 @@ -#[doc="Text layout."] +/** Text layout. */ use au = gfx::geometry; use geom::size::Size2D; @@ -24,7 +24,7 @@ trait TextLayout { fn reflow_text(ctx: &LayoutContext); } -#[doc="The main reflow routine for text layout."] +/** The main reflow routine for text layout. */ impl @RenderBox : TextLayout { fn reflow_text(ctx: &LayoutContext) { let d = match self { diff --git a/src/servo/text/glyph.rs b/src/servo/text/glyph.rs index ba7d26ab640..2814a20861e 100644 --- a/src/servo/text/glyph.rs +++ b/src/servo/text/glyph.rs @@ -3,10 +3,10 @@ export GlyphIndex, GlyphPos, Glyph; use gfx::geometry::au; use geom::point::Point2D; -#[doc = "The index of a particular glyph within a font"] +/** The index of a particular glyph within a font */ type GlyphIndex = uint; -#[doc="The position of a glyph on the screen."] +/** The position of a glyph on the screen. */ struct GlyphPos { advance: Point2D<au>, offset: Point2D<au>, @@ -19,7 +19,7 @@ fn GlyphPos(advance: Point2D<au>, offset: Point2D<au>) -> GlyphPos { } } -#[doc="A single glyph."] +/** A single glyph. */ struct Glyph { index: GlyphIndex, pos: GlyphPos, diff --git a/src/servo/util/color.rs b/src/servo/util/color.rs index 51526d33a34..971cd5129ad 100644 --- a/src/servo/util/color.rs +++ b/src/servo/util/color.rs @@ -1,4 +1,4 @@ -#[doc = "A library for handling colors and parsing css color declarations."] +/** A library for handling colors and parsing css color declarations. */ // TODO: handle #rrggbb color declarations, handle rgb(r%,g%,b%), // sanitize input / crop it to correct ranges, predefine other 130 @@ -61,8 +61,8 @@ fn hsl(h : float, s : float, l : float) -> Color { impl Color { fn print() -> ~str { - #fmt["rgba(%u,%u,%u,%f)", self.red as uint, self.green as uint, - self.blue as uint, self.alpha] + fmt!("rgba(%u,%u,%u,%f)", self.red as uint, self.green as uint, + self.blue as uint, self.alpha) } } @@ -70,11 +70,11 @@ mod parsing { export parse_color; fn fail_unrecognized(col : ~str) -> Option<Color> { - #warn["Unrecognized color %s", col]; + warn!("Unrecognized color %s", col); return None; } - #[doc="Match an exact color keyword."] + /** Match an exact color keyword. */ fn parse_by_name(color : ~str) -> Option<Color> { let col = match color.to_lower() { ~"black" => black(), @@ -100,7 +100,7 @@ mod parsing { return Some(col); } - #[doc="Parses a color specification in the form rgb(foo,bar,baz)"] + /** Parses a color specification in the form rgb(foo,bar,baz) */ fn parse_rgb(color : ~str) -> Option<Color> { // Shave off the rgb( and the ) let only_colors = color.substr(4u, color.len() - 5u); @@ -116,7 +116,7 @@ mod parsing { } } - #[doc="Parses a color specification in the form rgba(foo,bar,baz,qux)"] + /** Parses a color specification in the form rgba(foo,bar,baz,qux) */ fn parse_rgba(color : ~str) -> Option<Color> { // Shave off the rgba( and the ) let only_vals = color.substr(5u, color.len() - 6u); @@ -132,7 +132,7 @@ mod parsing { } } - #[doc="Parses a color specification in the form hsl(foo,bar,baz)"] + /** Parses a color specification in the form hsl(foo,bar,baz) */ fn parse_hsl(color : ~str) -> Option<Color> { // Shave off the hsl( and the ) let only_vals = color.substr(4u, color.len() - 5u); @@ -148,7 +148,7 @@ mod parsing { } } - #[doc="Parses a color specification in the form hsla(foo,bar,baz,qux)"] + /** Parses a color specification in the form hsla(foo,bar,baz,qux) */ fn parse_hsla(color : ~str) -> Option<Color> { // Shave off the hsla( and the ) let only_vals = color.substr(5u, color.len() - 6u); @@ -240,7 +240,7 @@ mod test { } -#[doc="Define the colors specified by css"] +/** Define the colors specified by css */ mod css_colors { // The 16 basic css colors fn black() -> Color { |