diff --git a/components/style/bezier.rs b/components/style/bezier.rs index 0d74bf5da42..2bae08ac800 100644 --- a/components/style/bezier.rs +++ b/components/style/bezier.rs @@ -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, @@ -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, p2: Point2D) -> Bezier { let cx = 3.0 * p1.x; diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index d8638284e14..4a29ea7aad1 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -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,