mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Backed out changeset 9e2c7d3018de (bug 1804761) for causing wpt failures on content-visibility-068.html CLOSED TREE
This commit is contained in:
parent
67513fa535
commit
9c0eaab6ba
@ -529,32 +529,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
||||
.set_effective_containment(new_contain);
|
||||
}
|
||||
|
||||
/// content-visibility: auto should force contain-intrinsic-size to gain
|
||||
/// an auto value
|
||||
///
|
||||
/// <https://github.com/w3c/csswg-drafts/issues/8407>
|
||||
fn adjust_for_contain_intrinsic_size(&mut self) {
|
||||
let content_visibility = self.style.get_box().clone_content_visibility();
|
||||
if content_visibility != ContentVisibility::Auto {
|
||||
return;
|
||||
}
|
||||
|
||||
let pos = self.style.get_position();
|
||||
let new_width = pos.clone_contain_intrinsic_width().add_auto_if_needed();
|
||||
let new_height = pos.clone_contain_intrinsic_height().add_auto_if_needed();
|
||||
if new_width.is_none() && new_height.is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
let pos = self.style.mutate_position();
|
||||
if let Some(width) = new_width {
|
||||
pos.set_contain_intrinsic_width(width);
|
||||
}
|
||||
if let Some(height) = new_height {
|
||||
pos.set_contain_intrinsic_height(height);
|
||||
}
|
||||
}
|
||||
|
||||
/// Handles the relevant sections in:
|
||||
///
|
||||
/// https://drafts.csswg.org/css-display/#unbox-html
|
||||
@ -974,7 +948,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
||||
self.adjust_for_position();
|
||||
self.adjust_for_overflow();
|
||||
self.adjust_for_contain();
|
||||
self.adjust_for_contain_intrinsic_size();
|
||||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
self.adjust_for_table_text_align();
|
||||
|
@ -25,20 +25,6 @@ pub type VerticalAlign = GenericVerticalAlign<LengthPercentage>;
|
||||
/// A computed value for the `contain-intrinsic-size` property.
|
||||
pub type ContainIntrinsicSize = GenericContainIntrinsicSize<NonNegativeLength>;
|
||||
|
||||
impl ContainIntrinsicSize {
|
||||
/// Converts contain-intrinsic-size to auto style.
|
||||
pub fn add_auto_if_needed(&self) -> Option<Self> {
|
||||
use crate::Zero;
|
||||
// TODO: support contain-intrinsic-size: auto none, see
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1835813
|
||||
Some(match *self {
|
||||
Self::None => Self::AutoLength(Zero::zero()),
|
||||
Self::Length(ref l) => Self::AutoLength(*l),
|
||||
Self::AutoLength(..) => return None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// A computed value for the `line-clamp` property.
|
||||
pub type LineClamp = GenericLineClamp<Integer>;
|
||||
|
||||
|
@ -1,57 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Last remembered size</title>
|
||||
<link rel="author" title="Jihye Hong" href="mailto:jihye@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#last-remembered">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-contain-2/#content-visibility">
|
||||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/8407">
|
||||
<meta name="assert" content="Tests that content-visibility: auto forces contain-intrinsic-size to gain an auto value." />
|
||||
|
||||
<style>
|
||||
#t1 {
|
||||
position: absolute;
|
||||
left: 0vmax;
|
||||
content-visibility: auto;
|
||||
contain-intrinsic-size: 1000vmax 1000vmax;
|
||||
background: red;
|
||||
}
|
||||
#t1::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
</style>
|
||||
<div id="t1"></div>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
function nextRendering() {
|
||||
return new Promise(resolve => {
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
|
||||
});
|
||||
}
|
||||
|
||||
promise_test(async () => {
|
||||
// Size normally.
|
||||
await nextRendering();
|
||||
|
||||
assert_equals(t1.clientWidth, 10, "Sizing normally: clientWidth");
|
||||
assert_equals(t1.clientHeight, 10, "Sizing normally: clientHeight");
|
||||
|
||||
await nextRendering();
|
||||
|
||||
// Move off-screen the target. Same size as in previous step!
|
||||
t1.style.left = "-200vmax";
|
||||
|
||||
assert_true(window.getComputedStyle(t1).containIntrinsicSize.includes("auto"), "containIntrinsicSize should be adjusted to auto");
|
||||
|
||||
await nextRendering();
|
||||
|
||||
assert_equals(t1.clientWidth, 10, "Sizing with new last remembered size: clientWidth");
|
||||
assert_equals(t1.clientHeight, 10, "Sizing with new last remembered size: clientHeight");
|
||||
}, 'content-visibility: auto forces contain-intrinsic-size to gain an auto value');
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user