-
Notifications
You must be signed in to change notification settings - Fork 715
[css-sizing] Is the last remembered size recorded if there is size containment in a single axis? #7529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Subtopic: Is last-remembered size recorded if size containment in single axis?<fantasai> github: https://github.com//issues/7529 <fantasai> oriol: we are only storing last remembered size if there's not size containment <fantasai> oriol: however, in newer specs of css-contain, we may have size containment in a single axis <fantasai> oriol: what happens? <fantasai> oriol: Are we still storing both width and height of last remembered size? <fantasai> oriol: do we not update last remembered size in the uncontained axis? <fantasai> oriol: shoudl we check at least one of the axes has size containment and then store both? <fantasai> oriol: how should this work exactly? <fantasai> TabAtkins: this is a very good question <fantasai> Rossen_: do you have a proposal, Oriol? <fantasai> oriol: maybe would feel more natural to me to do independently rather than together <fantasai> oriol: right now Chromium stores together <TabAtkins> q+ <flackr> q+ <fantasai> oriol: I don't have a strong opinion <Rossen_> ack TabAtkins <fantasai> TabAtkins: I think I lean toward tracking them together, just because say you have a set width and you have a contained block size <fantasai> TabAtkins: whatever block size you want to remember, that depends on your width <fantasai> TabAtkins: if you end up with a different width, your height is not going to be very meaningful <fantasai> TabAtkins: it's weird to expect a different width also <fantasai> TabAtkins: but I feel either record both or record neither <fantasai> TabAtkins: and you need to have containment to get sizing to trigger <fantasai> flackr: I was going to suggest the opposite <Rossen_> ack flackr <fantasai> flackr: reason beign that the only way that you have containment in one axis by it being an explicit style, whereas containment in both axes is because of content-visiblity and being off-screen <fantasai> flackr: if the developer, while on screen, has containment in one axis <fantasai> flackr: then it should ??? last remembered size when it goes off screen <fantasai> Rossen_: that's a compelling argument <fantasai> TabAtkins: that seems reasonable <fantasai> Rossen_: sounds like we're approaching a resolution <fantasai> Rossen_: proposed resolution is that we'll keep them separate, and store them separate <fantasai> Rossen_: any objections? <flackr> s/???/store the <TabAtkins> RESOLVED: "last remembered size" is tracked for the two axises independently (in case of containment in one axis), and can be invoked independently (with c-i-s:auto in one axis) |
To clarify, I think the minutes and the discussion don't quite match the resolution. I believe that we have decided that contain-intrinsic-size auto records last remembered size (both width and height) even if size containment is set in one of the two dimensions. Is my understanding correct? The resolution seems to imply that we should not record it for one dimension size containment, since that would be the only reason to record the axes separately, but it doesn't explicitly say whether or not to record the dimension that is contained |
My understanding is that we decided to only record the one that has |
#7807 resolved to update the last remembered size if the element doesn't skip its contents, even if it has size containment. So It's still possible to have |
https://bugs.webkit.org/show_bug.cgi?id=249919 Reviewed by Oriol Brufau. According to [1], "last remembered size" is tracked for the two axises independently, and can be invoked independently. This patch supports "last remembered size" in a single direction. It replaces the m_lastRememberedSize of m_lastRememberedLogicalWidth and m_lastRememberedLogicalHeight in ElementRareData. The value -1 means there is no last remembered width/height. [1] w3c/csswg-drafts#7529 * LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/auto-009-expected.txt: * Source/WebCore/dom/ContainerNode.cpp: (WebCore::ContainerNode::removeChild): * Source/WebCore/dom/Document.cpp: (WebCore::CallbackForContainIntrinsicSize): * Source/WebCore/dom/Element.cpp: (WebCore::Element::lastRememberedLogicalWidth const): (WebCore::Element::lastRememberedLogicalHeight const): (WebCore::Element::setLastRememberedLogicalWidth): (WebCore::Element::clearLastRememberedLogicalWidth): (WebCore::Element::setLastRememberedLogicalHeight): (WebCore::Element::clearLastRememberedLogicalHeight): (WebCore::Element::lastRememberedSize const): Deleted. (WebCore::Element::setLastRememberedSize): Deleted. (WebCore::Element::clearLastRememberedSize): Deleted. * Source/WebCore/dom/Element.h: * Source/WebCore/dom/ElementRareData.cpp: * Source/WebCore/dom/ElementRareData.h: (WebCore::LayoutUnitMarkableTraits::isEmptyValue): (WebCore::LayoutUnitMarkableTraits::emptyValue): (WebCore::ElementRareData::lastRememberedLogicalWidth const): (WebCore::ElementRareData::lastRememberedLogicalHeight const): (WebCore::ElementRareData::setLastRememberedLogicalWidth): (WebCore::ElementRareData::setLastRememberedLogicalHeight): (WebCore::ElementRareData::clearLastRememberedLogicalWidth): (WebCore::ElementRareData::clearLastRememberedLogicalHeight): (WebCore::ElementRareData::useTypes const): (WebCore::ElementRareData::lastRememberedSize const): Deleted. (WebCore::ElementRareData::setLastRememberedSize): Deleted. (WebCore::ElementRareData::clearLastRememberedSize): Deleted. * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::explicitIntrinsicInnerWidth const): (WebCore::RenderBox::explicitIntrinsicInnerHeight const): * Source/WebCore/rendering/style/RenderStyle.h: (WebCore::RenderStyle::containIntrinsicLogicalWidthType const): (WebCore::RenderStyle::containIntrinsicLogicalHeightType const): * Source/WebCore/rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateElementRenderer): Canonical link: https://commits.webkit.org/260939@main
From https://drafts.csswg.org/css-sizing-4/#last-remembered
What if the element has
contain: inline-size
?contain-intrinsic-size
hasauto
in a single axis ([css-sizing] Last remembered size relies on unclearcontain-intrinsic-size: auto
#7516).The text was updated successfully, but these errors were encountered: