style: Drop css parser support for 'contain:style'.

We're not sure we're going to ship support for this value, and it's been marked
as 'at-risk' in the spec, so let's stop pretending we support it in the parser.

Spec issue:
https://github.com/w3c/csswg-drafts/issues/3280

Differential Revision: https://phabricator.services.mozilla.com/D22203
This commit is contained in:
Daniel Holbert 2019-03-06 20:44:37 +00:00 committed by Emilio Cobos Álvarez
parent b96981f88e
commit 33814a9afe
2 changed files with 8 additions and 20 deletions

View file

@ -3177,7 +3177,6 @@ fn static_assert() {
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS;
@ -3201,9 +3200,6 @@ fn static_assert() {
if v.contains(SpecifiedValue::LAYOUT) { if v.contains(SpecifiedValue::LAYOUT) {
bitfield |= NS_STYLE_CONTAIN_LAYOUT; bitfield |= NS_STYLE_CONTAIN_LAYOUT;
} }
if v.contains(SpecifiedValue::STYLE) {
bitfield |= NS_STYLE_CONTAIN_STYLE;
}
if v.contains(SpecifiedValue::PAINT) { if v.contains(SpecifiedValue::PAINT) {
bitfield |= NS_STYLE_CONTAIN_PAINT; bitfield |= NS_STYLE_CONTAIN_PAINT;
} }
@ -3219,7 +3215,6 @@ fn static_assert() {
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_SIZE;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS;
use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS; use crate::gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS;
@ -3249,9 +3244,6 @@ fn static_assert() {
if gecko_flags & (NS_STYLE_CONTAIN_LAYOUT as u8) != 0 { if gecko_flags & (NS_STYLE_CONTAIN_LAYOUT as u8) != 0 {
servo_flags.insert(SpecifiedValue::LAYOUT); servo_flags.insert(SpecifiedValue::LAYOUT);
} }
if gecko_flags & (NS_STYLE_CONTAIN_STYLE as u8) != 0 {
servo_flags.insert(SpecifiedValue::STYLE);
}
if gecko_flags & (NS_STYLE_CONTAIN_PAINT as u8) != 0 { if gecko_flags & (NS_STYLE_CONTAIN_PAINT as u8) != 0 {
servo_flags.insert(SpecifiedValue::PAINT); servo_flags.insert(SpecifiedValue::PAINT);
} }

View file

@ -752,25 +752,23 @@ pub fn assert_touch_action_matches() {
bitflags! { bitflags! {
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue)] #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue)]
#[value_info(other_values = "none,strict,content,size,layout,style,paint")] #[value_info(other_values = "none,strict,content,size,layout,paint")]
/// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property /// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property
pub struct Contain: u8 { pub struct Contain: u8 {
/// 'size' variant, turns on size containment /// 'size' variant, turns on size containment
const SIZE = 0x01; const SIZE = 0x01;
/// `layout` variant, turns on layout containment /// `layout` variant, turns on layout containment
const LAYOUT = 0x02; const LAYOUT = 0x02;
/// `style` variant, turns on style containment
const STYLE = 0x04;
/// `paint` variant, turns on paint containment /// `paint` variant, turns on paint containment
const PAINT = 0x08; const PAINT = 0x04;
/// `strict` variant, turns on all types of containment /// `strict` variant, turns on all types of containment
const STRICT = 0x10; const STRICT = 0x08;
/// 'content' variant, turns on style, layout, and paint containment /// 'content' variant, turns on layout and paint containment
const CONTENT = 0x20; const CONTENT = 0x10;
/// variant with all the bits that contain: strict turns on /// variant with all the bits that contain: strict turns on
const STRICT_BITS = Contain::LAYOUT.bits | Contain::STYLE.bits | Contain::PAINT.bits | Contain::SIZE.bits; const STRICT_BITS = Contain::LAYOUT.bits | Contain::PAINT.bits | Contain::SIZE.bits;
/// variant with all the bits that contain: content turns on /// variant with all the bits that contain: content turns on
const CONTENT_BITS = Contain::STYLE.bits | Contain::LAYOUT.bits | Contain::PAINT.bits; const CONTENT_BITS = Contain::LAYOUT.bits | Contain::PAINT.bits;
} }
} }
@ -803,7 +801,6 @@ impl ToCss for Contain {
} }
maybe_write_value!(Contain::SIZE => "size"); maybe_write_value!(Contain::SIZE => "size");
maybe_write_value!(Contain::LAYOUT => "layout"); maybe_write_value!(Contain::LAYOUT => "layout");
maybe_write_value!(Contain::STYLE => "style");
maybe_write_value!(Contain::PAINT => "paint"); maybe_write_value!(Contain::PAINT => "paint");
debug_assert!(has_any); debug_assert!(has_any);
@ -812,7 +809,7 @@ impl ToCss for Contain {
} }
impl Parse for Contain { impl Parse for Contain {
/// none | strict | content | [ size || layout || style || paint ] /// none | strict | content | [ size || layout || paint ]
fn parse<'i, 't>( fn parse<'i, 't>(
_context: &ParserContext, _context: &ParserContext,
input: &mut Parser<'i, 't>, input: &mut Parser<'i, 't>,
@ -822,7 +819,6 @@ impl Parse for Contain {
let flag = match_ignore_ascii_case! { &name, let flag = match_ignore_ascii_case! { &name,
"size" => Some(Contain::SIZE), "size" => Some(Contain::SIZE),
"layout" => Some(Contain::LAYOUT), "layout" => Some(Contain::LAYOUT),
"style" => Some(Contain::STYLE),
"paint" => Some(Contain::PAINT), "paint" => Some(Contain::PAINT),
"strict" if result.is_empty() => return Ok(Contain::STRICT | Contain::STRICT_BITS), "strict" if result.is_empty() => return Ok(Contain::STRICT | Contain::STRICT_BITS),
"content" if result.is_empty() => return Ok(Contain::CONTENT | Contain::CONTENT_BITS), "content" if result.is_empty() => return Ok(Contain::CONTENT | Contain::CONTENT_BITS),