Skip to content

Commit

Permalink
More docs in style.
Browse files Browse the repository at this point in the history
Follow up to #14802.
  • Loading branch information
SimonSapin committed Jan 2, 2017
1 parent e995af9 commit 125a216
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions components/style/bezier.rs
Expand Up @@ -12,7 +12,7 @@ use euclid::point::Point2D;

const NEWTON_METHOD_ITERATIONS: u8 = 8;

/// A Bézier curve.
/// A unit cubic Bézier curve, used for timing functions in CSS transitions and animations.
pub struct Bezier {
ax: f64,
bx: f64,
Expand All @@ -23,7 +23,13 @@ pub struct Bezier {
}

impl Bezier {
/// Create a Bézier curve from two control points.
/// Create a unit cubic Bézier curve from the two middle control points.
///
/// X coordinate is time, Y coordinate is function advancement.
/// The nominal range for both is 0 to 1.
///
/// The start and end points are always (0, 0) and (1, 1) so that a transition or animation
/// starts at 0% and ends at 100%.
#[inline]
pub fn new(p1: Point2D<f64>, p2: Point2D<f64>) -> Bezier {
let cx = 3.0 * p1.x;
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/declaration_block.rs
Expand Up @@ -492,7 +492,7 @@ pub fn parse_style_attribute(input: &str,
}

/// Parse a given property declaration. Can result in multiple
/// `PropertyDeclaration`s when expanding a longhand, for example.
/// `PropertyDeclaration`s when expanding a shorthand, for example.
pub fn parse_one_declaration(id: PropertyId,
input: &str,
base_url: &ServoUrl,
Expand Down

0 comments on commit 125a216

Please sign in to comment.