|
Lines 443-449
void RenderBlockFlow::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalH
a/Source/WebCore/rendering/RenderBlockFlow.cpp_sec1
|
| 443 |
if (recomputeLogicalWidthAndColumnWidth()) |
443 |
if (recomputeLogicalWidthAndColumnWidth()) |
| 444 |
relayoutChildren = true; |
444 |
relayoutChildren = true; |
| 445 |
|
445 |
|
| 446 |
if (auto* layoutState = view().frameView().layoutContext().layoutState(); layoutState && layoutState->lineClamp()) |
446 |
if (auto* layoutState = view().frameView().layoutContext().layoutState(); layoutState && layoutState->legacyLineClamp()) |
| 447 |
relayoutChildren = true; |
447 |
relayoutChildren = true; |
| 448 |
|
448 |
|
| 449 |
rebuildFloatingObjectSetFromIntrudingFloats(); |
449 |
rebuildFloatingObjectSetFromIntrudingFloats(); |
|
Lines 3945-3974
void RenderBlockFlow::layoutModernLines(bool relayoutChildren, LayoutUnit& repai
a/Source/WebCore/rendering/RenderBlockFlow.cpp_sec2
|
| 3945 |
|
3945 |
|
| 3946 |
setLogicalHeight(newBorderBoxBottom); |
3946 |
setLogicalHeight(newBorderBoxBottom); |
| 3947 |
auto updateLineClampStateAndLogicalHeightIfApplicable = [&] { |
3947 |
auto updateLineClampStateAndLogicalHeightIfApplicable = [&] { |
| 3948 |
auto lineClamp = layoutState.lineClamp(); |
3948 |
auto legacyLineClamp = layoutState.legacyLineClamp(); |
| 3949 |
if (!lineClamp || isFloatingOrOutOfFlowPositioned()) |
3949 |
if (!legacyLineClamp || isFloatingOrOutOfFlowPositioned()) |
| 3950 |
return; |
3950 |
return; |
| 3951 |
lineClamp->currentLineCount += layoutFormattingContextLineLayout.lineCount(); |
3951 |
legacyLineClamp->currentLineCount += layoutFormattingContextLineLayout.lineCount(); |
| 3952 |
if (lineClamp->clampedRenderer) { |
3952 |
if (legacyLineClamp->clampedRenderer) { |
| 3953 |
// We've already clamped this flex container at a previous flex item. |
3953 |
// We've already clamped this flex container at a previous flex item. |
| 3954 |
layoutState.setLineClamp(*lineClamp); |
3954 |
layoutState.setLegacyLineClamp(*legacyLineClamp); |
| 3955 |
return; |
3955 |
return; |
| 3956 |
} |
3956 |
} |
| 3957 |
auto clampedContentHeight = [&]() -> std::optional<LayoutUnit> { |
3957 |
auto clampedContentHeight = [&]() -> std::optional<LayoutUnit> { |
| 3958 |
if (auto clampedHeight = layoutFormattingContextLineLayout.clampedContentLogicalHeight()) |
3958 |
if (auto clampedHeight = layoutFormattingContextLineLayout.clampedContentLogicalHeight()) |
| 3959 |
return clampedHeight; |
3959 |
return clampedHeight; |
| 3960 |
if (lineClamp->currentLineCount == lineClamp->maximumLineCount) { |
3960 |
if (legacyLineClamp->currentLineCount == legacyLineClamp->maximumLineCount) { |
| 3961 |
// Even if we did not truncate the content, this might be our clamping position. |
3961 |
// Even if we did not truncate the content, this might be our clamping position. |
| 3962 |
return computeContentHeight(); |
3962 |
return computeContentHeight(); |
| 3963 |
} |
3963 |
} |
| 3964 |
return { }; |
3964 |
return { }; |
| 3965 |
}; |
3965 |
}; |
| 3966 |
if (auto logicalHeight = clampedContentHeight()) { |
3966 |
if (auto logicalHeight = clampedContentHeight()) { |
| 3967 |
lineClamp->clampedContentLogicalHeight = logicalHeight; |
3967 |
legacyLineClamp->clampedContentLogicalHeight = logicalHeight; |
| 3968 |
lineClamp->clampedRenderer = this; |
3968 |
legacyLineClamp->clampedRenderer = this; |
| 3969 |
setLogicalHeight(borderAndPaddingBefore() + *logicalHeight + borderAndPaddingAfter() + scrollbarLogicalHeight()); |
3969 |
setLogicalHeight(borderAndPaddingBefore() + *logicalHeight + borderAndPaddingAfter() + scrollbarLogicalHeight()); |
| 3970 |
} |
3970 |
} |
| 3971 |
layoutState.setLineClamp(*lineClamp); |
3971 |
layoutState.setLegacyLineClamp(*legacyLineClamp); |
| 3972 |
}; |
3972 |
}; |
| 3973 |
updateLineClampStateAndLogicalHeightIfApplicable(); |
3973 |
updateLineClampStateAndLogicalHeightIfApplicable(); |
| 3974 |
} |
3974 |
} |