style: Implement the CSS line-break property, with values "auto | anywhere".

Note that the "loose | normal | strict" values are not yet parsed/implemented.

Differential Revision: https://phabricator.services.mozilla.com/D29817
This commit is contained in:
Jonathan Kew 2019-05-20 20:46:07 +00:00 committed by Emilio Cobos Álvarez
parent 67909022a0
commit 0dc70cf7f2
6 changed files with 40 additions and 3 deletions

View file

@ -77,7 +77,7 @@ pub use self::svg::MozContextProperties;
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::table::XSpan;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight};
pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight};
pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing};
pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
pub use self::time::Time;

View file

@ -20,7 +20,7 @@ use style_traits::{CssWriter, ToCss};
pub use crate::values::specified::TextAlignKeyword as TextAlign;
pub use crate::values::specified::TextTransform;
pub use crate::values::specified::{OverflowWrap, WordBreak};
pub use crate::values::specified::{LineBreak, OverflowWrap, WordBreak};
pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition};
/// A computed value for the `initial-letter` property.

View file

@ -81,7 +81,7 @@ pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::svg_path::SVGPathData;
pub use self::table::XSpan;
pub use self::text::TextTransform;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextAlign};
pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight, TextAlign};
pub use self::text::{OverflowWrap, TextEmphasisPosition, TextEmphasisStyle, WordBreak};
pub use self::text::{TextAlignKeyword, TextDecorationLine, TextOverflow, WordSpacing};
pub use self::time::Time;

View file

@ -1005,6 +1005,32 @@ pub enum WordBreak {
BreakWord,
}
/// Values for the `line-break` property.
#[repr(u8)]
#[derive(
Clone,
Copy,
Debug,
Eq,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[allow(missing_docs)]
pub enum LineBreak {
Auto,
/// TODO: additional values not yet implemented
/// Loose,
/// Normal,
/// Strict,
Anywhere,
}
/// Values for the `overflow-wrap` property.
#[repr(u8)]
#[derive(