Bug 1463589 - Adjust whitespace and condition checking for strict/content bits.
MozReview-Commit-ID: KibR5Nac7Gb
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -5048,17 +5048,16 @@ nsComputedDOMStyle::DoGetContain()
"contain: strict should imply contain: size layout style paint");
val->SetIdent(eCSSKeyword_strict);
} else if (mask & NS_STYLE_CONTAIN_CONTENT) {
NS_ASSERTION(mask == (NS_STYLE_CONTAIN_CONTENT | NS_STYLE_CONTAIN_CONTENT_BITS),
"contain: content should imply contain: layout style paint");
val->SetIdent(eCSSKeyword_content);
} else {
nsAutoString valueStr;
-
nsStyleUtil::AppendBitmaskCSSValue(nsCSSProps::kContainKTable,
mask,
NS_STYLE_CONTAIN_SIZE, NS_STYLE_CONTAIN_PAINT,
valueStr);
val->SetString(valueStr);
}
return val.forget();
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -450,18 +450,17 @@ enum class StyleDisplay : uint8_t {
MozInlineStack,
MozDeck,
MozGroupbox,
MozPopup,
#endif
};
// See nsStyleDisplay
-// If these are re-ordered, nsComputedDOMStyle::DoGetContain() and
-// nsCSSValue::AppendToString() must be updated.
+// If these are re-ordered, nsComputedDOMStyle::DoGetContain() must be updated.
#define NS_STYLE_CONTAIN_NONE 0
#define NS_STYLE_CONTAIN_SIZE 0x01
#define NS_STYLE_CONTAIN_LAYOUT 0x02
#define NS_STYLE_CONTAIN_STYLE 0x04
#define NS_STYLE_CONTAIN_PAINT 0x08
#define NS_STYLE_CONTAIN_STRICT 0x10
#define NS_STYLE_CONTAIN_CONTENT 0x20
// NS_STYLE_CONTAIN_ALL_BITS does not correspond to a keyword.
--- a/layout/style/test/test_value_computation.html
+++ b/layout/style/test/test_value_computation.html
@@ -163,17 +163,16 @@ function test_value(property, val, is_in
// means we'll have a cached aStartStruct from the parent in the rule
// tree (caching the "other" value), so we'll make sure we don't get
// the initial value from the luck of default-initialization.
// This means that it's important that we set the prereqs on
// gRule1.style rather than on gElement.style.
gRule2.style.setProperty(property, val, "");
var val_computed_n = get_computed_value(getComputedStyle(gElementN, ""), property);
var val_computed_f = get_computed_value(getComputedStyle(gElementF, ""), property);
-
isnot(val_computed_n, "",
"should not get empty value for '" + property + ":" + val + "'");
isnot(val_computed_f, "",
"should not get empty value for '" + property + ":" + val + "'");
if (is_initial) {
(xfail_value(property, val, is_initial, false) ? todo_is : is)(
val_computed_n, initial_computed_n,
"should get initial value for '" + property + ":" + val + "'");
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2923,17 +2923,17 @@ pref("layout.css.unset-value.enabled", t
// Is support for the "all" shorthand enabled?
pref("layout.css.all-shorthand.enabled", true);
// Is support for CSS overflow-clip-box enabled for non-UA sheets?
pref("layout.css.overflow-clip-box.enabled", false);
// Is support for CSS contain enabled?
-pref("layout.css.contain.enabled", true);
+pref("layout.css.contain.enabled", false);
// Is support for CSS box-decoration-break enabled?
pref("layout.css.box-decoration-break.enabled", true);
// Is layout of CSS outline-style:auto enabled?
pref("layout.css.outline-style-auto.enabled", false);
// Is CSSOM-View scroll-behavior and its MSD smooth scrolling enabled?
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3676,27 +3676,30 @@ fn static_assert() {
use gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT;
use gecko_bindings::structs::NS_STYLE_CONTAIN_ALL_BITS;
use gecko_bindings::structs::NS_STYLE_CONTAIN_CONTENT_BITS;
use properties::longhands::contain::{self, SpecifiedValue};
let mut servo_flags = contain::computed_value::T::empty();
let gecko_flags = self.gecko.mContain;
- if gecko_flags & (NS_STYLE_CONTAIN_STRICT as u8) != 0 &&
- gecko_flags & (NS_STYLE_CONTAIN_ALL_BITS as u8) != 0 {
+ if gecko_flags & (NS_STYLE_CONTAIN_STRICT as u8) != 0 {
+ debug_assert_eq!(gecko_flags & (NS_STYLE_CONTAIN_ALL_BITS as u8),
+ NS_STYLE_CONTAIN_ALL_BITS as u8,
+ "When strict is specified, ALL_BITS should be specified as well");
servo_flags.insert(SpecifiedValue::STRICT | SpecifiedValue::STRICT_BITS);
return servo_flags;
}
- if gecko_flags & (NS_STYLE_CONTAIN_CONTENT as u8) != 0 &&
- gecko_flags & (NS_STYLE_CONTAIN_CONTENT_BITS as u8) != 0 {
+ if gecko_flags & (NS_STYLE_CONTAIN_CONTENT as u8) != 0 {
+ debug_assert_eq!(gecko_flags & (NS_STYLE_CONTAIN_CONTENT_BITS as u8),
+ NS_STYLE_CONTAIN_CONTENT_BITS as u8,
+ "When content is specified, CONTENT_BITS should be specified as well");
servo_flags.insert(SpecifiedValue::CONTENT | SpecifiedValue::CONTENT_BITS);
return servo_flags;
}
-
if gecko_flags & (NS_STYLE_CONTAIN_LAYOUT as u8) != 0 {
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 {
servo_flags.insert(SpecifiedValue::PAINT);