| Summary: | [LFC][IFC] Introduce layout bounds based vertical alignment | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zalan <zalan> | ||||||||
| Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | bfulgham, koivisto, simon.fraser, webkit-bug-importer, zalan | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
zalan
2020-10-16 09:11:25 PDT
Created attachment 411584 [details]
Patch
Created attachment 411611 [details]
Patch
Created attachment 411664 [details]
Patch
Comment on attachment 411664 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411664&action=review > Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp:411 > auto lineBoxLogicalHeight = lineBox.logicalHeight(); > - auto lineLogicalHeight = InlineLayoutUnit { }; > - if (rootStyle.lineHeight().isNegative()) { > - // Negative line height value means the line height is driven by the content. > - auto usedLineSpacing = [&] { > - auto logicalTopWithLineSpacing = InlineLayoutUnit { }; > - auto logicalBottomWithLineSpacing = lineBoxLogicalHeight; > - for (auto& inlineLevelBox : lineBox.inlineLevelBoxList()) { > - if (auto lineSpacing = inlineLevelBox->lineSpacing()) { > - // FIXME: check if line spacing is distributed evenly. > - logicalTopWithLineSpacing = std::min(logicalTopWithLineSpacing, inlineLevelBox->logicalTop() - *lineSpacing / 2); > - logicalBottomWithLineSpacing = std::max(logicalBottomWithLineSpacing, inlineLevelBox->logicalBottom() + *lineSpacing / 2); > - } > - } > - return -logicalTopWithLineSpacing + (logicalBottomWithLineSpacing - lineBoxLogicalHeight); > - }; > - lineLogicalHeight = lineBox.logicalHeight() + usedLineSpacing(); > - } else > - lineLogicalHeight = rootStyle.computedLineHeight(); > - > + auto lineLogicalHeight = lineBox.logicalHeight(); > auto logicalRect = InlineRect { lineContent.logicalTopLeft, lineContent.lineLogicalWidth, lineLogicalHeight}; > // Inline tree height is all integer based. > auto lineBoxOffset = floorf((lineLogicalHeight - lineBoxLogicalHeight) / 2); lineBoxOffset == 0? (In reply to Antti Koivisto from comment #4) > Comment on attachment 411664 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=411664&action=review > > > Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp:411 > > auto lineBoxLogicalHeight = lineBox.logicalHeight(); > > - auto lineLogicalHeight = InlineLayoutUnit { }; > > - if (rootStyle.lineHeight().isNegative()) { > > - // Negative line height value means the line height is driven by the content. > > - auto usedLineSpacing = [&] { > > - auto logicalTopWithLineSpacing = InlineLayoutUnit { }; > > - auto logicalBottomWithLineSpacing = lineBoxLogicalHeight; > > - for (auto& inlineLevelBox : lineBox.inlineLevelBoxList()) { > > - if (auto lineSpacing = inlineLevelBox->lineSpacing()) { > > - // FIXME: check if line spacing is distributed evenly. > > - logicalTopWithLineSpacing = std::min(logicalTopWithLineSpacing, inlineLevelBox->logicalTop() - *lineSpacing / 2); > > - logicalBottomWithLineSpacing = std::max(logicalBottomWithLineSpacing, inlineLevelBox->logicalBottom() + *lineSpacing / 2); > > - } > > - } > > - return -logicalTopWithLineSpacing + (logicalBottomWithLineSpacing - lineBoxLogicalHeight); > > - }; > > - lineLogicalHeight = lineBox.logicalHeight() + usedLineSpacing(); > > - } else > > - lineLogicalHeight = rootStyle.computedLineHeight(); > > - > > + auto lineLogicalHeight = lineBox.logicalHeight(); > > auto logicalRect = InlineRect { lineContent.logicalTopLeft, lineContent.lineLogicalWidth, lineLogicalHeight}; > > // Inline tree height is all integer based. > > auto lineBoxOffset = floorf((lineLogicalHeight - lineBoxLogicalHeight) / 2); > > lineBoxOffset == 0? was testing the review process :) Will get rid of that offset concept in a follow-up patch. Committed r268642: <https://trac.webkit.org/changeset/268642> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411664 [details]. |