mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
stylo: Implement scroll-snap-destination
MozReview-Commit-ID: 6mr4ktfeEGT
This commit is contained in:
parent
3b59dbadee
commit
a095565a8c
5 changed files with 26 additions and 1 deletions
|
@ -20,6 +20,7 @@ pub use super::specified::{Angle, BorderStyle, GridLine, Time, UrlOrNone};
|
|||
pub use super::specified::url::UrlExtraData;
|
||||
pub use self::length::{CalcLengthOrPercentage, Length, LengthOrNumber, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
pub use self::length::{LengthOrPercentageOrAutoOrContent, LengthOrPercentageOrNone, LengthOrNone};
|
||||
pub use self::position::Position;
|
||||
|
||||
pub mod basic_shape;
|
||||
pub mod image;
|
||||
|
|
|
@ -19,6 +19,16 @@ pub struct Position {
|
|||
pub vertical: LengthOrPercentage,
|
||||
}
|
||||
|
||||
impl Position {
|
||||
/// Construct a position at (0, 0)
|
||||
pub fn zero() -> Self {
|
||||
Position {
|
||||
horizontal: LengthOrPercentage::zero(),
|
||||
vertical: LengthOrPercentage::zero(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for Position {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
try!(self.horizontal.to_css(dest));
|
||||
|
|
|
@ -27,6 +27,7 @@ pub use self::image::{SizeKeyword, VerticalDirection};
|
|||
pub use self::length::{FontRelativeLength, ViewportPercentageLength, CharacterWidth, Length, CalcLengthOrPercentage};
|
||||
pub use self::length::{Percentage, LengthOrNone, LengthOrNumber, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
pub use self::length::{LengthOrPercentageOrNone, LengthOrPercentageOrAutoOrContent, NoCalcLength, CalcUnit};
|
||||
pub use self::position::{HorizontalPosition, Position, VerticalPosition};
|
||||
|
||||
pub mod basic_shape;
|
||||
pub mod grid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue