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
[IFC][Integration][Line clamp] LineClamp.currentLineCount
should be propagated to the parent layoutState.
#12973
Conversation
EWS run on previous version of this PR (hash 8f4a9f4) |
193e4c2
to
4483e29
Compare
EWS run on previous version of this PR (hash 193e4c2) |
EWS run on previous version of this PR (hash 4483e29) |
4483e29
to
209cde3
Compare
EWS run on previous version of this PR (hash 209cde3) |
visibleLineCountForLineClamp
should be propagated to the parent layoutState.LineClamp.currentLineCount
should be propagated to the parent layoutState.
Rebased and updated this patch to accommodate to the latest changes. |
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.
Now we are diverging from legacy -webkit-line-clamp rendering, but I think it's a good change.
LayoutTests/fast/block/line-clamp-nested-blocks-with-layout-state-expected.html
Outdated
Show resolved
Hide resolved
LayoutTests/fast/block/line-clamp-nested-blocks-with-layout-state.html
Outdated
Show resolved
Hide resolved
currentLineClamp->currentLineCount, | ||
})); | ||
} | ||
} |
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.
I think this could be collapsed to
if (!layoutState())
return;
auto currentLineClamp = layoutState()->lineClamp();
m_layoutStateStack.removeLast();
if (auto* layoutState = this->layoutState(); layoutState && layoutState->lineClamp())
layoutState->setLineClamp(currentLineClamp);
maybe asserting on not mutating the maximum line clamp value
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.
I chose to assert for maximumLineCount
since it should be an immutable state established at applyModernLineClamp
.
209cde3
to
4865a76
Compare
EWS run on current version of this PR (hash 4865a76) |
@Ahmad-S792 Could you help try landing this patch? |
Added |
β¦ propagated to the parent layoutState. https://bugs.webkit.org/show_bug.cgi?id=255487 Reviewed by Alan Baradlay. Since multiple children share the same parent context for line clamp, `LineClamp.currentLineCount` set to the individual child should be propagated to their parent layoutState. Otherwise, subsequent children may not see the current state of this value during layout, causing incorrect line clamp results. * LayoutTests/fast/block/line-clamp-nested-blocks-with-layout-state-expected.html: Added. * LayoutTests/fast/block/line-clamp-nested-blocks-with-layout-state.html: Added. * Source/WebCore/page/LocalFrameViewLayoutContext.cpp: (WebCore::LocalFrameViewLayoutContext::popLayoutState): Canonical link: https://commits.webkit.org/263360@main
4865a76
to
59088ba
Compare
Committed 263360@main (59088ba): https://commits.webkit.org/263360@main Reviewed commits have been landed. Closing PR #12973 and removing active labels. |
@alanbaradlay - It seems that the bug landed against closed bug, should I ask 'webkit-bot' to revert it and ask @GetToSet to update Bug URL in commit message and land with correct bug number? I left comment on bugzilla as well. |
oops. I wouldn't revert it. I think it's ok as long as bugzillas are commented and connected accordingly. |
59088ba
4865a76