Commit graph

13 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Anthony Ramine
70ec61cf01 Refactor Position
A specified position is now a struct made of two values of different types,
the first one being PositionComponent<X>, and the second one PositionComponent<Y>.

A position component is represented by the new enum PositionComponent<Side>,
with the three values Center, Length(LengthOrPercentage), and
Side(Side, Option<LengthOrPercentage>).

Side keywords are represented by the X and Y enums, which don't include a value
for the center keyword anymore. They are accompanied by the Side trait, which
allows us to determine whether a side keyword is "left" or "top".

This refactor simplified the parsing and serialisation code and exposed bugs in it,
where it would reject valid <position> values followed by arbitrary tokens,
and where it would fail to prefer "left" to "right" when serialising positions
in basic shapes.
2017-05-10 16:56:01 +02:00
Ravi Shankar
63965f55f5 Make use of predefined_type for some aliased types 2017-04-25 17:40:39 +05:30
Ravi Shankar
61a17993eb Cleanup position and make use of generic Position for its users 2017-04-25 17:32:45 +05:30
Manish Goregaokar
a095565a8c stylo: Implement scroll-snap-destination
MozReview-Commit-ID: 6mr4ktfeEGT
2017-02-09 10:54:19 -08:00
Emilio Cobos Álvarez
f37aa12927
style: Prevent more missing docs in the values module. 2016-12-31 12:17:02 +01:00
Nazım Can Altınova
b302642592 Implement background-position-x/y 2016-12-15 01:36:27 +03:00
Nazım Can Altınova
a409d41d1d Implement HorizontalPosition / VerticalPosition 2016-12-12 13:48:36 +03:00
Ravi Shankar
6061985898 Prefer Servo-specific ToCss for all types 2016-11-07 09:14:22 +05:30
Manish Goregaokar
1e7973263f
Fix tidy 2016-08-02 15:57:30 +05:30
Manish Goregaokar
eb82cc25ef
Add Polygon to basic_shape.rs 2016-08-02 15:57:28 +05:30
Manish Goregaokar
44e33bcdc5
Move Position into its own values module 2016-08-02 15:57:23 +05:30