-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Trimmed inline-start margins for flex items in horizontal writing mode should be reflected in computed style. #11722
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
Conversation
f19ab3e
to
6a7346d
Compare
EWS run on previous version of this PR (hash 6a7346d)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated with #11741?
6a7346d
to
c1ef8a1
Compare
EWS run on previous version of this PR (hash c1ef8a1) |
c1ef8a1
to
6e98230
Compare
EWS run on current version of this PR (hash 6e98230) |
…e should be reflected in computed style. https://bugs.webkit.org/show_bug.cgi?id=253714 rdar://106559056 Reviewed by Alan Baradlay. Currently, we trim the inline-start margin of a flex item when we call flexItem.box.setMarginStart inside either RenderFlexibleBox::trimCrossAxisMarginStart or RenderFlexibleBox::trimMainAxisMarginStart. Instead, we can replace these calls with setTrimmedMarginForChild with an argument of MarginTrimType::InlineStart to both trim the margin and set the appropriate bit in the rare data object. In horizontal writing-mode this bit should correspond to margin-left. Once layout has finished, this bit can be used to determine if the box has a trimmed inline-start margin. When ComputedStyleExtractor tries to obtain the "margin-left," value, it will first need to check if this margin has been trimmed. This can be done by calling box->hasTrimedMargin(PhysicalDirection::Left). hasTrimmedMargin will first map this PhysicalDirection to a MarginTrimType and then check if the appropriate rare data bit has been set. If this returns true, then the box should have a trimmed inline-start (left) margin and ComputedStyleExtractor should consult the box's m_marginBox to get the trimmed value. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-inline-start-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-inline-start.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-multi-line-inline-start-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-multi-line-inline-start.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-inline-start-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-inline-start.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-multi-line-inline-start-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-multi-line-inline-start.html: Added. * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::rendererContainingBlockHasMarginTrim): (WebCore::isLayoutDependent): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * Source/WebCore/rendering/RenderBlock.cpp: (WebCore::RenderBlock::setTrimmedMarginForChild): * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::physicalToFlowRelativeDirectionMapping const): (WebCore::RenderBox::hasTrimmedMargin const): * Source/WebCore/rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::trimMainAxisMarginStart): (WebCore::RenderFlexibleBox::trimCrossAxisMarginStart): Canonical link: https://commits.webkit.org/262708@main
6e98230
to
c69be37
Compare
Committed 262708@main (c69be37): https://commits.webkit.org/262708@main Reviewed commits have been landed. Closing PR #11722 and removing active labels. |
c69be37
6e98230