Refactor container-type into a Style value type#65594
Merged
webkit-commit-queue merged 1 commit intoMay 26, 2026
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 89b70e0) Details |
89b70e0 to
6b5b32d
Compare
Collaborator
|
EWS run on current version of this PR (hash 6b5b32d) Details |
Contributor
Author
|
@weinig |
nt1m
approved these changes
May 26, 2026
https://bugs.webkit.org/show_bug.cgi?id=315483 Reviewed by Sam Weinig and Tim Nguyen. Migrate the computed value of the container-type property from the ContainerType enum (a 2-bit bitfield in NonInheritedRareData) to a Style::ContainerType value type with computed-style-storage-kind "reference", matching the sibling properties stored in the same struct (scrollbar-gutter -> Style::ScrollbarGutter, scroll-snap-type -> Style::ScrollSnapType). This is a preparatory, non-functional change: only normal, size and inline-size are supported, exactly as before. Call sites that compared against ContainerType::Normal now use the equivalent isNormal() / hasSize() / hasInlineSize() accessors on Style::ContainerType. No new tests, as there is no behavior change. * Source/WebCore/Headers.cmake: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/css/CSSProperties.json: * Source/WebCore/dom/Document.cpp: (WebCore::Document::updateLayoutIfDimensionsOutOfDate): * Source/WebCore/dom/Element.cpp: (WebCore::Element::resolveComputedStyle): * Source/WebCore/rendering/RenderBlock.cpp: (WebCore::RenderBlock::establishesIndependentFormattingContextIgnoringDisplayType const): * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::willBeDestroyed): (WebCore::RenderBox::styleWillChange): * Source/WebCore/rendering/RenderElement.cpp: (WebCore::RenderElement::hasEligibleContainmentForSizeQuery const): * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::usedContain const): * Source/WebCore/rendering/style/RenderStyleConstants.h: * Source/WebCore/style/ContainerQueryEvaluator.cpp: (WebCore::Style::ContainerQueryEvaluator::selectContainer): * Source/WebCore/style/StyleBuilderCustom.h: (WebCore::Style::forwardInheritedValue): * Source/WebCore/style/StyleExtractor.cpp: (WebCore::Style::hasValidStyleForProperty): * Source/WebCore/style/StyleExtractorCustom.h: (WebCore::Style::ExtractorCustom::extractContainerShorthand): (WebCore::Style::ExtractorCustom::extractContainerShorthandSerialization): * Source/WebCore/style/StyleScope.cpp: (WebCore::Style::Scope::invalidateForContainerDependencies): * Source/WebCore/style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::pushParent): (WebCore::Style::TreeResolver::updateStateForQueryContainer): * Source/WebCore/style/computed/StyleComputedStyleBase.h: * Source/WebCore/style/computed/data/StyleNonInheritedRareData.cpp: (WebCore::Style::NonInheritedRareData::NonInheritedRareData): (WebCore::Style::NonInheritedRareData::operator== const): (WebCore::Style::NonInheritedRareData::usedContain const): (WebCore::Style::NonInheritedRareData::dumpDifferences const): * Source/WebCore/style/computed/data/StyleNonInheritedRareData.h: * Source/WebCore/style/values/contain/StyleContainerType.cpp: Added. (WebCore::Style::CSSValueConversion<ContainerType>::operator): * Source/WebCore/style/values/contain/StyleContainerType.h: Added. (WebCore::Style::ContainerType::ContainerType): (WebCore::Style::ContainerType::isNormal const): (WebCore::Style::ContainerType::hasSize const): (WebCore::Style::ContainerType::hasInlineSize const): (WebCore::Style::ContainerType::hasSizeContainment const): (WebCore::Style::ContainerType::switchOn const): * Source/WebCore/style/values/primitives/StyleKeyword+Mappings.h: Canonical link: https://commits.webkit.org/313869@main
6b5b32d to
d9dde2e
Compare
Collaborator
|
Committed 313869@main (d9dde2e): https://commits.webkit.org/313869@main Reviewed commits have been landed. Closing PR #65594 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 vision-sim
🧪 win-tests
d9dde2e
6b5b32d
🛠 playstation