render: revive display contents wrappers
This commit is contained in:
1 parent
3d02525f35
commit
4d9da4eb31
3 files changed
+53
-1
No files matched your search
@@ -328,7 +328,15 @@ fn apply_value(style: &mut LayoutStyle, name: &str, value: &str) {
|
||||
style.display = crate::Display::Block;
|
||||
style.flow_root = true;
|
||||
}
|
||||
"contents" => style.display_contents = true,
|
||||
"contents" => {
|
||||
// `display:contents` can override an earlier `display:none`
|
||||
// in the cascade (responsive desktop/mobile wrappers do
|
||||
// this constantly). It suppresses only this element's box;
|
||||
// its children remain generated and are flattened into the
|
||||
// parent formatting context.
|
||||
style.display = crate::Display::Block;
|
||||
style.display_contents = true;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -3276,6 +3284,13 @@ mod tests {
|
||||
assert!(infinite.animation_iteration_infinite);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn display_contents_overrides_an_earlier_display_none() {
|
||||
let style = compute_style("div", Some("display:none; display:contents"));
|
||||
assert_eq!(style.display, Display::Block);
|
||||
assert!(style.display_contents);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn authored_display_replaces_internal_flex_provenance() {
|
||||
let native_cell = compute_style("td", None);
|
||||
|
||||
Reference in new issue
Block a user