mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
parent
b96981f88e
commit
33814a9afe
2 changed files with 8 additions and 20 deletions
|
@ -752,25 +752,23 @@ pub fn assert_touch_action_matches() {
|
|||
|
||||
bitflags! {
|
||||
#[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
|
||||
pub struct Contain: u8 {
|
||||
/// 'size' variant, turns on size containment
|
||||
const SIZE = 0x01;
|
||||
/// `layout` variant, turns on layout containment
|
||||
const LAYOUT = 0x02;
|
||||
/// `style` variant, turns on style containment
|
||||
const STYLE = 0x04;
|
||||
/// `paint` variant, turns on paint containment
|
||||
const PAINT = 0x08;
|
||||
const PAINT = 0x04;
|
||||
/// `strict` variant, turns on all types of containment
|
||||
const STRICT = 0x10;
|
||||
/// 'content' variant, turns on style, layout, and paint containment
|
||||
const CONTENT = 0x20;
|
||||
const STRICT = 0x08;
|
||||
/// 'content' variant, turns on layout and paint containment
|
||||
const CONTENT = 0x10;
|
||||
/// 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
|
||||
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::LAYOUT => "layout");
|
||||
maybe_write_value!(Contain::STYLE => "style");
|
||||
maybe_write_value!(Contain::PAINT => "paint");
|
||||
|
||||
debug_assert!(has_any);
|
||||
|
@ -812,7 +809,7 @@ impl ToCss for Contain {
|
|||
}
|
||||
|
||||
impl Parse for Contain {
|
||||
/// none | strict | content | [ size || layout || style || paint ]
|
||||
/// none | strict | content | [ size || layout || paint ]
|
||||
fn parse<'i, 't>(
|
||||
_context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
|
@ -822,7 +819,6 @@ impl Parse for Contain {
|
|||
let flag = match_ignore_ascii_case! { &name,
|
||||
"size" => Some(Contain::SIZE),
|
||||
"layout" => Some(Contain::LAYOUT),
|
||||
"style" => Some(Contain::STYLE),
|
||||
"paint" => Some(Contain::PAINT),
|
||||
"strict" if result.is_empty() => return Ok(Contain::STRICT | Contain::STRICT_BITS),
|
||||
"content" if result.is_empty() => return Ok(Contain::CONTENT | Contain::CONTENT_BITS),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue