style: Let aspect-ratio (css-sizing-4) support 'auto | <ratio>'.

In order to test its parsing and serialization, we expose it but protect
it behind a pref.

Besides, I would like to drop layout.css.aspect-ratio-number.enabled in
the next patch because the spec has been updated. It seems we don't have
to keep this pref and we should always use Number.

Differential Revision: https://phabricator.services.mozilla.com/D74955
This commit is contained in:
Boris Chiou 2020-05-21 06:45:10 +00:00 committed by Emilio Cobos Álvarez
parent bd23e05c47
commit fc9321bb23
8 changed files with 185 additions and 18 deletions

View file

@ -7,7 +7,8 @@
//!
//! [position]: https://drafts.csswg.org/css-backgrounds-3/#position
use crate::values::computed::{Integer, LengthPercentage, Percentage};
use crate::values::computed::{Integer, LengthPercentage, NonNegativeNumber, Percentage};
use crate::values::generics::position::AspectRatio as GenericAspectRatio;
use crate::values::generics::position::Position as GenericPosition;
use crate::values::generics::position::PositionComponent as GenericPositionComponent;
use crate::values::generics::position::PositionOrAuto as GenericPositionOrAuto;
@ -68,3 +69,6 @@ impl GenericPositionComponent for LengthPercentage {
/// A computed value for the `z-index` property.
pub type ZIndex = GenericZIndex<Integer>;
/// A computed value for the `aspect-ratio` property.
pub type AspectRatio = GenericAspectRatio<NonNegativeNumber>;