style: restrict CSS properties for '::cue'.

According to the spec [1], only those CSS properties listed on the spec can be applied on the `::cue`.

[1] https://www.w3.org/TR/webvtt1/#the-cue-pseudo-element

Differential Revision: https://phabricator.services.mozilla.com/D34262
This commit is contained in:
Alastor Wu 2019-06-25 00:32:07 +00:00 committed by Emilio Cobos Álvarez
parent 5db88db8fc
commit 84a5ab2ba8
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
9 changed files with 50 additions and 41 deletions

View file

@ -939,7 +939,7 @@ impl CSSWideKeyword {
bitflags! {
/// A set of flags for properties.
pub struct PropertyFlags: u8 {
pub struct PropertyFlags: u16 {
/// This property requires a stacking context.
const CREATES_STACKING_CONTEXT = 1 << 0;
/// This property has values that can establish a containing block for
@ -954,13 +954,15 @@ bitflags! {
const APPLIES_TO_FIRST_LINE = 1 << 4;
/// This longhand property applies to ::placeholder.
const APPLIES_TO_PLACEHOLDER = 1 << 5;
/// This longhand property applies to ::cue.
const APPLIES_TO_CUE = 1 << 6;
/// This property's getComputedStyle implementation requires layout
/// to be flushed.
const GETCS_NEEDS_LAYOUT_FLUSH = 1 << 6;
const GETCS_NEEDS_LAYOUT_FLUSH = 1 << 7;
/// This property is a legacy shorthand.
///
/// https://drafts.csswg.org/css-cascade/#legacy-shorthand
const IS_LEGACY_SHORTHAND = 1 << 7;
const IS_LEGACY_SHORTHAND = 1 << 8;
/* The following flags are currently not used in Rust code, they
* only need to be listed in corresponding properties so that
@ -1184,7 +1186,7 @@ impl LonghandId {
pub fn flags(self) -> PropertyFlags {
// TODO(emilio): This can be simplified further as Rust gains more
// constant expression support.
const FLAGS: [u8; ${len(data.longhands)}] = [
const FLAGS: [u16; ${len(data.longhands)}] = [
% for property in data.longhands:
% for flag in property.flags:
PropertyFlags::${flag}.bits |
@ -1446,7 +1448,7 @@ impl ShorthandId {
/// Returns PropertyFlags for the given shorthand property.
#[inline]
pub fn flags(self) -> PropertyFlags {
const FLAGS: [u8; ${len(data.shorthands)}] = [
const FLAGS: [u16; ${len(data.shorthands)}] = [
% for property in data.shorthands:
% for flag in property.flags:
PropertyFlags::${flag}.bits |